aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-31 02:21:52 +0000
committermeissner <meissner@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-31 02:21:52 +0000
commitcc92bb2f3f0d7a9d5d4580465a5830461fdc5482 (patch)
tree80c278ae614efc38d3dbfbc6ff251bfae6ca2c45
parent94f8a7715439af94ba0217023934aa3d89f1ceb5 (diff)
Update tag branch to 139818function-specific-branch
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/tags/function-specific-branch@139819 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog54
-rw-r--r--MAINTAINERS52
-rw-r--r--Makefile.def1
-rw-r--r--Makefile.in3
-rw-r--r--Makefile.tpl2
-rw-r--r--config/ChangeLog27
-rw-r--r--config/acinclude.m41277
-rw-r--r--config/mt-mips-elfoabi7
-rw-r--r--config/mt-spu6
-rwxr-xr-xconfigure17
-rw-r--r--configure.ac17
-rw-r--r--gcc/ChangeLog5418
-rw-r--r--gcc/ChangeLog-20072
-rw-r--r--gcc/DATESTAMP2
-rw-r--r--gcc/Makefile.in268
-rw-r--r--gcc/ada/9drpc.adb2
-rw-r--r--gcc/ada/ChangeLog2414
-rw-r--r--gcc/ada/Makefile.in2297
-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.c376
-rw-r--r--gcc/ada/adaint.h5
-rw-r--r--gcc/ada/ali.adb8
-rw-r--r--gcc/ada/argv.c4
-rw-r--r--gcc/ada/back_end.adb2
-rw-r--r--gcc/ada/bindgen.adb143
-rw-r--r--gcc/ada/checks.adb93
-rw-r--r--gcc/ada/checks.ads8
-rw-r--r--gcc/ada/cio.c23
-rw-r--r--gcc/ada/clean.adb39
-rw-r--r--gcc/ada/config-lang.in35
-rw-r--r--gcc/ada/cstreams.c15
-rw-r--r--gcc/ada/directio.ads6
-rw-r--r--gcc/ada/einfo.adb40
-rw-r--r--gcc/ada/einfo.ads34
-rw-r--r--gcc/ada/errno.c14
-rw-r--r--gcc/ada/errutil.adb2
-rw-r--r--gcc/ada/exp_aggr.adb82
-rw-r--r--gcc/ada/exp_attr.adb271
-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.adb175
-rw-r--r--gcc/ada/exp_ch4.ads2
-rw-r--r--gcc/ada/exp_ch5.adb113
-rw-r--r--gcc/ada/exp_ch6.adb132
-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.adb1044
-rw-r--r--gcc/ada/exp_ch9.ads12
-rw-r--r--gcc/ada/exp_dbug.ads2
-rw-r--r--gcc/ada/exp_disp.adb33
-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.adb16
-rw-r--r--gcc/ada/exp_util.ads8
-rw-r--r--gcc/ada/fe.h2
-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-pehage.adb229
-rw-r--r--gcc/ada/g-pehage.ads32
-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.adb96
-rw-r--r--gcc/ada/g-socket.ads16
-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.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-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.in (renamed from gcc/ada/Make-lang.in)133
-rw-r--r--gcc/ada/gcc-interface/Makefile.in2303
-rw-r--r--gcc/ada/gcc-interface/ada-tree.def (renamed from gcc/ada/ada-tree.def)0
-rw-r--r--gcc/ada/gcc-interface/ada-tree.h (renamed from gcc/ada/ada-tree.h)8
-rw-r--r--gcc/ada/gcc-interface/ada.h (renamed from gcc/ada/ada.h)0
-rw-r--r--gcc/ada/gcc-interface/config-lang.in43
-rw-r--r--gcc/ada/gcc-interface/cuintp.c (renamed from gcc/ada/cuintp.c)0
-rw-r--r--gcc/ada/gcc-interface/decl.c (renamed from gcc/ada/decl.c)173
-rw-r--r--gcc/ada/gcc-interface/deftarg.c (renamed from gcc/ada/deftarg.c)0
-rw-r--r--gcc/ada/gcc-interface/gigi.h (renamed from gcc/ada/gigi.h)44
-rw-r--r--gcc/ada/gcc-interface/lang-specs.h (renamed from gcc/ada/lang-specs.h)0
-rw-r--r--gcc/ada/gcc-interface/lang.opt (renamed from gcc/ada/lang.opt)0
-rw-r--r--gcc/ada/gcc-interface/misc.c (renamed from gcc/ada/misc.c)10
-rw-r--r--gcc/ada/gcc-interface/targtyps.c (renamed from gcc/ada/targtyps.c)0
-rw-r--r--gcc/ada/gcc-interface/trans.c (renamed from gcc/ada/trans.c)322
-rw-r--r--gcc/ada/gcc-interface/utils.c (renamed from gcc/ada/utils.c)677
-rw-r--r--gcc/ada/gcc-interface/utils2.c (renamed from gcc/ada/utils2.c)69
-rw-r--r--gcc/ada/gen-soccon.c747
-rw-r--r--gcc/ada/gnat-style.texi46
-rw-r--r--gcc/ada/gnat_rm.texi74
-rw-r--r--gcc/ada/gnat_ugn.texi294
-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/gnatlink.adb278
-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.c216
-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.adb447
-rw-r--r--gcc/ada/makeutl.adb10
-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.adb26
-rw-r--r--gcc/ada/mlib-utl.ads17
-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.ads36
-rw-r--r--gcc/ada/osint-b.ads2
-rw-r--r--gcc/ada/osint-c.ads2
-rw-r--r--gcc/ada/osint.ads31
-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.adb5
-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-env.adb44
-rw-r--r--gcc/ada/prj-makr.ads5
-rw-r--r--gcc/ada/prj-nmsc.adb1052
-rw-r--r--gcc/ada/prj-nmsc.ads2
-rw-r--r--gcc/ada/prj-part.adb23
-rw-r--r--gcc/ada/prj-part.ads26
-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-util.ads10
-rw-r--r--gcc/ada/prj.adb361
-rw-r--r--gcc/ada/prj.ads318
-rw-r--r--gcc/ada/raise-gcc.c84
-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.adb71
-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-direio.adb10
-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-finimp.ads6
-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.adb137
-rwxr-xr-xgcc/ada/s-os_lib.ads81
-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.adb4
-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
-rwxr-xr-xgcc/ada/s-regexp.ads4
-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.adb68
-rw-r--r--gcc/ada/s-stausa.ads4
-rw-r--r--gcc/ada/s-strops.adb6
-rw-r--r--gcc/ada/s-strxdr.adb18
-rw-r--r--gcc/ada/s-ststop.adb380
-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.adb47
-rw-r--r--gcc/ada/sem_attr.adb169
-rw-r--r--gcc/ada/sem_cat.adb6
-rw-r--r--gcc/ada/sem_ch10.adb40
-rw-r--r--gcc/ada/sem_ch12.adb116
-rw-r--r--gcc/ada/sem_ch12.ads10
-rw-r--r--gcc/ada/sem_ch13.adb128
-rw-r--r--gcc/ada/sem_ch3.adb274
-rw-r--r--gcc/ada/sem_ch4.adb102
-rw-r--r--gcc/ada/sem_ch5.adb73
-rw-r--r--gcc/ada/sem_ch6.adb557
-rw-r--r--gcc/ada/sem_ch6.ads8
-rw-r--r--gcc/ada/sem_ch7.adb11
-rw-r--r--gcc/ada/sem_ch8.adb194
-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.adb505
-rw-r--r--gcc/ada/sem_res.adb174
-rw-r--r--gcc/ada/sem_type.adb13
-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.adb4
-rw-r--r--gcc/ada/sinput.ads12
-rw-r--r--gcc/ada/snames.adb10
-rw-r--r--gcc/ada/snames.ads1483
-rw-r--r--gcc/ada/snames.h382
-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-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/targparm.adb6
-rw-r--r--gcc/ada/targparm.ads3
-rw-r--r--gcc/ada/tbuild.adb2
-rw-r--r--gcc/ada/tbuild.ads19
-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/uintp.adb2
-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/xref_lib.adb1
-rw-r--r--gcc/alias.c46
-rw-r--r--gcc/attribs.c14
-rw-r--r--gcc/basic-block.h40
-rw-r--r--gcc/bb-reorder.c22
-rw-r--r--gcc/builtins.c563
-rw-r--r--gcc/c-common.c708
-rw-r--r--gcc/c-common.h16
-rw-r--r--gcc/c-cppbuiltin.c13
-rw-r--r--gcc/c-decl.c532
-rw-r--r--gcc/c-errors.c14
-rw-r--r--gcc/c-gimplify.c21
-rw-r--r--gcc/c-lex.c8
-rw-r--r--gcc/c-objc-common.h2
-rw-r--r--gcc/c-omp.c2
-rw-r--r--gcc/c-opts.c62
-rw-r--r--gcc/c-parser.c198
-rw-r--r--gcc/c-pch.c8
-rw-r--r--gcc/c-ppoutput.c6
-rw-r--r--gcc/c-pragma.c358
-rw-r--r--gcc/c-pretty-print.c6
-rw-r--r--gcc/c-semantics.c3
-rw-r--r--gcc/c-tree.h13
-rw-r--r--gcc/c-typeck.c516
-rw-r--r--gcc/c.opt2
-rw-r--r--gcc/caller-save.c467
-rw-r--r--gcc/calls.c56
-rw-r--r--gcc/cfgcleanup.c7
-rw-r--r--gcc/cfgexpand.c651
-rw-r--r--gcc/cfghooks.c8
-rw-r--r--gcc/cfghooks.h6
-rw-r--r--gcc/cfgloop.c11
-rw-r--r--gcc/cfgloop.h2
-rw-r--r--gcc/cfgloopanal.c25
-rw-r--r--gcc/cfgrtl.c4
-rw-r--r--gcc/cgraph.c183
-rw-r--r--gcc/cgraph.h31
-rw-r--r--gcc/cgraphbuild.c142
-rw-r--r--gcc/cgraphunit.c269
-rw-r--r--gcc/collect2.c66
-rw-r--r--gcc/combine.c5
-rw-r--r--gcc/common.opt68
-rw-r--r--gcc/config.gcc47
-rw-r--r--gcc/config.host16
-rw-r--r--gcc/config.in24
-rw-r--r--gcc/config/alpha/alpha.c140
-rw-r--r--gcc/config/alpha/alpha.h19
-rw-r--r--gcc/config/arc/arc.h2
-rw-r--r--gcc/config/arm/arm-cores.def1
-rw-r--r--gcc/config/arm/arm-protos.h3
-rw-r--r--gcc/config/arm/arm-tune.md2
-rw-r--r--gcc/config/arm/arm.c308
-rw-r--r--gcc/config/arm/arm.h45
-rw-r--r--gcc/config/arm/arm.md13
-rw-r--r--gcc/config/arm/arm1020e.md14
-rw-r--r--gcc/config/arm/constraints.md2
-rw-r--r--gcc/config/arm/cortex-r4.md10
-rw-r--r--gcc/config/arm/iwmmxt.md72
-rw-r--r--gcc/config/arm/neon.md67
-rw-r--r--gcc/config/arm/t-arm-coff2
-rw-r--r--gcc/config/arm/t-linux2
-rw-r--r--gcc/config/arm/vfp.md115
-rw-r--r--gcc/config/avr/avr-protos.h10
-rw-r--r--gcc/config/avr/avr.c46
-rw-r--r--gcc/config/avr/avr.h19
-rw-r--r--gcc/config/avr/avr.md171
-rw-r--r--gcc/config/avr/t-avr2
-rw-r--r--gcc/config/bfin/bfin.c59
-rw-r--r--gcc/config/bfin/bfin.h13
-rw-r--r--gcc/config/crx/crx.c12
-rw-r--r--gcc/config/crx/crx.h2
-rw-r--r--gcc/config/fr30/fr30.h7
-rw-r--r--gcc/config/frv/frv-protos.h6
-rw-r--r--gcc/config/frv/frv.c88
-rw-r--r--gcc/config/frv/frv.h2
-rw-r--r--gcc/config/h8300/h8300.c48
-rw-r--r--gcc/config/h8300/h8300.h2
-rw-r--r--gcc/config/i386/cpuid.h4
-rw-r--r--gcc/config/i386/darwin.h3
-rw-r--r--gcc/config/i386/driver-i386.c2
-rw-r--r--gcc/config/i386/emmintrin.h2
-rw-r--r--gcc/config/i386/gas.h3
-rw-r--r--gcc/config/i386/i386-c.c23
-rw-r--r--gcc/config/i386/i386-modes.def15
-rw-r--r--gcc/config/i386/i386-protos.h4
-rw-r--r--gcc/config/i386/i386.c2465
-rw-r--r--gcc/config/i386/i386.h121
-rw-r--r--gcc/config/i386/i386.md1448
-rw-r--r--gcc/config/i386/i386.opt18
-rw-r--r--gcc/config/i386/mmx.md139
-rw-r--r--gcc/config/i386/predicates.md37
-rw-r--r--gcc/config/i386/sse.md3820
-rw-r--r--gcc/config/i386/winnt.c6
-rw-r--r--gcc/config/ia64/ia64.c50
-rw-r--r--gcc/config/ia64/ia64.h15
-rw-r--r--gcc/config/iq2000/iq2000.c8
-rw-r--r--gcc/config/iq2000/iq2000.h12
-rw-r--r--gcc/config/m32c/m32c-protos.h4
-rw-r--r--gcc/config/m32c/m32c.c30
-rw-r--r--gcc/config/m32r/m32r.h11
-rw-r--r--gcc/config/m68hc11/m68hc11.c70
-rw-r--r--gcc/config/m68hc11/m68hc11.h2
-rw-r--r--gcc/config/mcore/mcore.c14
-rw-r--r--gcc/config/mcore/mcore.h10
-rw-r--r--gcc/config/mips/constraints.md6
-rw-r--r--gcc/config/mips/driver-native.c2
-rw-r--r--gcc/config/mips/iris6.h24
-rw-r--r--gcc/config/mips/irix-crti.asm7
-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.c1347
-rw-r--r--gcc/config/mips/mips.h230
-rw-r--r--gcc/config/mips/mips.md823
-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.c57
-rw-r--r--gcc/config/mn10300/mn10300.h13
-rw-r--r--gcc/config/mn10300/mn10300.md24
-rw-r--r--gcc/config/pa/pa.c53
-rw-r--r--gcc/config/pa/pa.h16
-rw-r--r--gcc/config/pa/x-ada4
-rw-r--r--gcc/config/pa/x-ada-hpux104
-rw-r--r--gcc/config/pdp11/pdp11.c4
-rw-r--r--gcc/config/pdp11/pdp11.h4
-rw-r--r--gcc/config/rs6000/driver-rs6000.c40
-rw-r--r--gcc/config/rs6000/rs6000-c.c14
-rw-r--r--gcc/config/rs6000/rs6000.c247
-rw-r--r--gcc/config/rs6000/rs6000.h31
-rw-r--r--gcc/config/s390/2084.md2
-rw-r--r--gcc/config/s390/s390.c389
-rw-r--r--gcc/config/s390/s390.h32
-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.h4
-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.c279
-rw-r--r--gcc/config/sh/sh.h27
-rw-r--r--gcc/config/sh/sh.md7
-rw-r--r--gcc/config/sparc/linux64.h6
-rw-r--r--gcc/config/sparc/sparc.c37
-rw-r--r--gcc/config/sparc/sparc.h22
-rw-r--r--gcc/config/spu/spu-c.c74
-rw-r--r--gcc/config/spu/spu.c124
-rw-r--r--gcc/config/spu/spu.h41
-rw-r--r--gcc/config/spu/spu.md537
-rw-r--r--gcc/config/spu/spu_mfcio.h126
-rw-r--r--gcc/config/spu/t-spu-elf7
-rw-r--r--gcc/config/stormy16/stormy16.c55
-rw-r--r--gcc/config/stormy16/stormy16.h11
-rw-r--r--gcc/config/stormy16/stormy16.md6
-rw-r--r--gcc/config/v850/v850.h7
-rw-r--r--gcc/config/v850/v850.md2
-rw-r--r--gcc/config/vax/vax.h6
-rw-r--r--gcc/config/xtensa/t-xtensa1
-rw-r--r--gcc/config/xtensa/xtensa.c123
-rw-r--r--gcc/config/xtensa/xtensa.h7
-rw-r--r--gcc/config/xtensa/xtensa.md5
-rwxr-xr-xgcc/configure210
-rw-r--r--gcc/configure.ac82
-rw-r--r--gcc/coretypes.h9
-rw-r--r--gcc/coverage.c12
-rw-r--r--gcc/cp/ChangeLog1497
-rw-r--r--gcc/cp/Make-lang.in8
-rw-r--r--gcc/cp/call.c88
-rw-r--r--gcc/cp/class.c148
-rw-r--r--gcc/cp/cp-gimplify.c244
-rw-r--r--gcc/cp/cp-objcp-common.h2
-rw-r--r--gcc/cp/cp-tree.h139
-rw-r--r--gcc/cp/cvt.c40
-rw-r--r--gcc/cp/decl.c665
-rw-r--r--gcc/cp/decl2.c109
-rw-r--r--gcc/cp/error.c17
-rw-r--r--gcc/cp/except.c47
-rw-r--r--gcc/cp/friend.c10
-rw-r--r--gcc/cp/init.c158
-rw-r--r--gcc/cp/lex.c15
-rw-r--r--gcc/cp/mangle.c12
-rw-r--r--gcc/cp/method.c8
-rw-r--r--gcc/cp/name-lookup.c38
-rw-r--r--gcc/cp/name-lookup.h2
-rw-r--r--gcc/cp/optimize.c29
-rw-r--r--gcc/cp/parser.c363
-rw-r--r--gcc/cp/pt.c251
-rw-r--r--gcc/cp/rtti.c6
-rw-r--r--gcc/cp/search.c14
-rw-r--r--gcc/cp/semantics.c45
-rw-r--r--gcc/cp/tree.c67
-rw-r--r--gcc/cp/typeck.c316
-rw-r--r--gcc/cp/typeck2.c96
-rw-r--r--gcc/dbxout.c21
-rw-r--r--gcc/debug.c8
-rw-r--r--gcc/debug.h6
-rw-r--r--gcc/defaults.h57
-rw-r--r--gcc/diagnostic.c118
-rw-r--r--gcc/diagnostic.def4
-rw-r--r--gcc/diagnostic.h22
-rw-r--r--gcc/doc/cpp.texi6
-rw-r--r--gcc/doc/extend.texi335
-rw-r--r--gcc/doc/fragments.texi40
-rw-r--r--gcc/doc/gcc.texi10
-rw-r--r--gcc/doc/gccint.texi12
-rw-r--r--gcc/doc/install.texi33
-rw-r--r--gcc/doc/invoke.texi281
-rw-r--r--gcc/doc/passes.texi28
-rw-r--r--gcc/doc/tm.texi219
-rw-r--r--gcc/dojump.c15
-rw-r--r--gcc/domwalk.c24
-rw-r--r--gcc/domwalk.h4
-rw-r--r--gcc/dse.c21
-rw-r--r--gcc/dwarf2asm.c74
-rw-r--r--gcc/dwarf2asm.h7
-rw-r--r--gcc/dwarf2out.c1603
-rw-r--r--gcc/ebitmap.h2
-rw-r--r--gcc/emit-rtl.c9
-rw-r--r--gcc/errors.c3
-rw-r--r--gcc/errors.h2
-rw-r--r--gcc/except.c112
-rw-r--r--gcc/except.h11
-rw-r--r--gcc/explow.c12
-rw-r--r--gcc/expmed.c40
-rw-r--r--gcc/expr.c221
-rw-r--r--gcc/expr.h27
-rw-r--r--gcc/final.c78
-rw-r--r--gcc/fix-header.c5
-rw-r--r--gcc/flags.h46
-rw-r--r--gcc/fold-const.c183
-rw-r--r--gcc/fortran/ChangeLog657
-rw-r--r--gcc/fortran/Make-lang.in6
-rw-r--r--gcc/fortran/arith.c3
-rw-r--r--gcc/fortran/array.c88
-rw-r--r--gcc/fortran/check.c358
-rw-r--r--gcc/fortran/cpp.c2
-rw-r--r--gcc/fortran/cpp.h2
-rw-r--r--gcc/fortran/data.c4
-rw-r--r--gcc/fortran/data.h2
-rw-r--r--gcc/fortran/decl.c550
-rw-r--r--gcc/fortran/dependency.c4
-rw-r--r--gcc/fortran/dump-parse-tree.c8
-rw-r--r--gcc/fortran/error.c2
-rw-r--r--gcc/fortran/expr.c151
-rw-r--r--gcc/fortran/f95-lang.c29
-rw-r--r--gcc/fortran/gfc-internals.texi7
-rw-r--r--gcc/fortran/gfortran.h335
-rw-r--r--gcc/fortran/gfortran.texi14
-rw-r--r--gcc/fortran/interface.c34
-rw-r--r--gcc/fortran/intrinsic.c218
-rw-r--r--gcc/fortran/intrinsic.h316
-rw-r--r--gcc/fortran/intrinsic.texi7
-rw-r--r--gcc/fortran/invoke.texi68
-rw-r--r--gcc/fortran/io.c25
-rw-r--r--gcc/fortran/lang.opt16
-rw-r--r--gcc/fortran/libgfortran.h4
-rw-r--r--gcc/fortran/match.c53
-rw-r--r--gcc/fortran/match.h13
-rw-r--r--gcc/fortran/module.c237
-rw-r--r--gcc/fortran/options.c38
-rw-r--r--gcc/fortran/parse.c306
-rw-r--r--gcc/fortran/parse.h6
-rw-r--r--gcc/fortran/primary.c342
-rw-r--r--gcc/fortran/resolve.c761
-rw-r--r--gcc/fortran/scanner.c8
-rw-r--r--gcc/fortran/simplify.c4
-rw-r--r--gcc/fortran/st.c2
-rw-r--r--gcc/fortran/symbol.c336
-rw-r--r--gcc/fortran/target-memory.c25
-rw-r--r--gcc/fortran/trans-array.c269
-rw-r--r--gcc/fortran/trans-array.h14
-rw-r--r--gcc/fortran/trans-common.c3
-rw-r--r--gcc/fortran/trans-decl.c413
-rw-r--r--gcc/fortran/trans-expr.c150
-rw-r--r--gcc/fortran/trans-intrinsic.c184
-rw-r--r--gcc/fortran/trans-io.c48
-rw-r--r--gcc/fortran/trans-openmp.c58
-rw-r--r--gcc/fortran/trans-stmt.c157
-rw-r--r--gcc/fortran/trans-types.c38
-rw-r--r--gcc/fortran/trans.c96
-rw-r--r--gcc/fortran/trans.h26
-rw-r--r--gcc/function.c312
-rw-r--r--gcc/function.h63
-rw-r--r--gcc/fwprop.c8
-rw-r--r--gcc/gcc.c4
-rw-r--r--gcc/gcov.c3
-rw-r--r--gcc/gcse.c8
-rw-r--r--gcc/gengtype.c6
-rw-r--r--gcc/ggc-page.c4
-rw-r--r--gcc/gimple-low.c577
-rw-r--r--gcc/gimplify.c2729
-rw-r--r--gcc/global.c51
-rw-r--r--gcc/gthr-posix.c37
-rw-r--r--gcc/gthr-posix.h131
-rw-r--r--gcc/gthr.h31
-rw-r--r--gcc/haifa-sched.c75
-rw-r--r--gcc/hard-reg-set.h9
-rw-r--r--gcc/ifcvt.c39
-rw-r--r--gcc/ipa-cp.c784
-rw-r--r--gcc/ipa-inline.c361
-rw-r--r--gcc/ipa-prop.c1030
-rw-r--r--gcc/ipa-prop.h103
-rw-r--r--gcc/ipa-pure-const.c329
-rw-r--r--gcc/ipa-reference.c524
-rw-r--r--gcc/ipa-struct-reorg.c532
-rw-r--r--gcc/ipa-struct-reorg.h8
-rw-r--r--gcc/ipa-type-escape.c519
-rw-r--r--gcc/ipa-type-escape.h4
-rw-r--r--gcc/ipa-utils.c2
-rw-r--r--gcc/java/ChangeLog84
-rw-r--r--gcc/java/Make-lang.in5
-rw-r--r--gcc/java/class.c16
-rw-r--r--gcc/java/decl.c24
-rw-r--r--gcc/java/expr.c15
-rw-r--r--gcc/java/gcj.texi13
-rw-r--r--gcc/java/java-gimplify.c25
-rw-r--r--gcc/java/java-tree.h4
-rw-r--r--gcc/java/lang.c8
-rw-r--r--gcc/java/typeck.c3
-rw-r--r--gcc/jump.c22
-rw-r--r--gcc/lambda-code.c380
-rw-r--r--gcc/lambda-mat.c1
-rw-r--r--gcc/lambda-trans.c1
-rw-r--r--gcc/lambda.h4
-rw-r--r--gcc/langhooks-def.h4
-rw-r--r--gcc/langhooks.c65
-rw-r--r--gcc/langhooks.h16
-rw-r--r--gcc/libada-mk.in29
-rw-r--r--gcc/local-alloc.c63
-rw-r--r--gcc/loop-unroll.c4
-rw-r--r--gcc/loop-unswitch.c2
-rw-r--r--gcc/machmode.h2
-rw-r--r--gcc/matrix-reorg.c774
-rw-r--r--gcc/objc/ChangeLog16
-rw-r--r--gcc/objc/Make-lang.in4
-rw-r--r--gcc/objc/objc-act.c2
-rw-r--r--gcc/objc/objc-act.h4
-rw-r--r--gcc/objcp/Make-lang.in6
-rw-r--r--gcc/omp-low.c2737
-rw-r--r--gcc/opt-functions.awk1
-rw-r--r--gcc/optabs.c54
-rw-r--r--gcc/optabs.h1
-rw-r--r--gcc/optc-gen.awk2
-rw-r--r--gcc/opth-gen.awk2
-rw-r--r--gcc/opts.c219
-rw-r--r--gcc/opts.h4
-rw-r--r--gcc/params.def16
-rw-r--r--gcc/params.h2
-rw-r--r--gcc/passes.c102
-rw-r--r--gcc/po/ChangeLog12
-rw-r--r--gcc/po/gcc.pot14859
-rw-r--r--gcc/po/sv.po4
-rw-r--r--gcc/postreload-gcse.c5
-rw-r--r--gcc/postreload.c2
-rw-r--r--gcc/predict.c525
-rw-r--r--gcc/pretty-print.c4
-rw-r--r--gcc/print-tree.c50
-rw-r--r--gcc/profile.c251
-rw-r--r--gcc/real.c249
-rw-r--r--gcc/real.h55
-rw-r--r--gcc/recog.c24
-rw-r--r--gcc/regclass.c56
-rw-r--r--gcc/regmove.c7
-rw-r--r--gcc/regs.h18
-rw-r--r--gcc/reload.c142
-rw-r--r--gcc/reload.h11
-rw-r--r--gcc/reload1.c456
-rw-r--r--gcc/reorg.c14
-rw-r--r--gcc/rtl.h15
-rw-r--r--gcc/rtlanal.c60
-rw-r--r--gcc/scan.c2
-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/sdbout.c2
-rw-r--r--gcc/see.c2
-rw-r--r--gcc/simplify-rtx.c42
-rw-r--r--gcc/stmt.c64
-rw-r--r--gcc/system.h6
-rw-r--r--gcc/target-def.h13
-rw-r--r--gcc/target.h31
-rw-r--r--gcc/targhooks.c13
-rw-r--r--gcc/targhooks.h1
-rw-r--r--gcc/testsuite/ChangeLog2427
-rw-r--r--gcc/testsuite/ChangeLog-1993-20074
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle-neon.C4
-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/initlist1.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/initlist5.C4
-rw-r--r--gcc/testsuite/g++.dg/expr/anew4.C3
-rw-r--r--gcc/testsuite/g++.dg/ext/altivec-2.C2
-rw-r--r--gcc/testsuite/g++.dg/ext/altivec-3.C11
-rw-r--r--gcc/testsuite/g++.dg/inherit/thunk8.C2
-rw-r--r--gcc/testsuite/g++.dg/ipa/iinline-1.C47
-rw-r--r--gcc/testsuite/g++.dg/lookup/new1.C4
-rw-r--r--gcc/testsuite/g++.dg/opt/anchor1.C2
-rw-r--r--gcc/testsuite/g++.dg/other/anon5.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/crash27.C3
-rw-r--r--gcc/testsuite/g++.dg/parse/error15.C2
-rw-r--r--gcc/testsuite/g++.dg/template/crash60.C2
-rw-r--r--gcc/testsuite/g++.dg/template/crash7.C6
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/check.h36
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/eh-alloca-1.C56
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/eh-fastcall-1.C43
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/eh-global-1.C39
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/eh-inline-1.C39
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/eh-inline-2.C57
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/eh-vararg-1.C72
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/eh-vararg-2.C77
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/stackalign.exp39
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/stdcall-1.C17
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/test-unwind.h132
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/throw-1.C61
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/throw-2.C52
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/throw-3.C52
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/throw-4.C54
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/unwind-0.C12
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/unwind-1.C16
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/unwind-2.C29
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/unwind-3.C35
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/unwind-4.C17
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/unwind-5.C31
-rw-r--r--gcc/testsuite/g++.dg/torture/stackalign/unwind-6.C31
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr31146-2.C2
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr31146.C3
-rw-r--r--gcc/testsuite/g++.dg/warn/Wconversion-integer.C4
-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/pr23075.C2
-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/crash52.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/crash7.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/report.C4
-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/g++.old-deja/g++.pt/error2.C2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20001226-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20031003-1.c6
-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.dg/20011008-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/20040206-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/20041213-1.c20
-rw-r--r--gcc/testsuite/gcc.dg/Wall.c3
-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-real-integer.c40
-rw-r--r--gcc/testsuite/gcc.dg/Wcxx-compat-2.c53
-rw-r--r--gcc/testsuite/gcc.dg/Wno-all.c3
-rw-r--r--gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c3
-rw-r--r--gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c2
-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/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/assign-warn-1.c3
-rw-r--r--gcc/testsuite/gcc.dg/assign-warn-2.c1
-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/c90-fordecl-1.c3
-rw-r--r--gcc/testsuite/gcc.dg/cleanup-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/conv-2.c4
-rw-r--r--gcc/testsuite/gcc.dg/cpp/cpp.exp2
-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/dfp/composite-type.c8
-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/gomp/block-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/gomp/block-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/gomp/block-3.c6
-rw-r--r--gcc/testsuite/gcc.dg/gomp/block-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/gomp/block-5.c4
-rw-r--r--gcc/testsuite/gcc.dg/gomp/block-6.c2
-rw-r--r--gcc/testsuite/gcc.dg/gomp/block-7.c12
-rw-r--r--gcc/testsuite/gcc.dg/gomp/block-8.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/ipa-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-2.c5
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-3.c6
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-4.c4
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-5.c5
-rw-r--r--gcc/testsuite/gcc.dg/ipa/ipa-7.c4
-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/20020213-1.c3
-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/pch/valid-3.c6
-rw-r--r--gcc/testsuite/gcc.dg/pch/valid-3.hs3
-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/pr3074-1.c3
-rw-r--r--gcc/testsuite/gcc.dg/pr32370.c4
-rw-r--r--gcc/testsuite/gcc.dg/pr35899.c2
-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/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/stackalign/alloca-1.c44
-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/builtin-apply-1.c9
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c30
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-3.c31
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-4.c29
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c34
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/check.h36
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/comp-goto-1.c41
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/fastcall-1.c31
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/global-1.c27
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/inline-1.c28
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/inline-2.c45
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/nested-1.c44
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/nested-2.c45
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/nested-3.c62
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/nested-4.c33
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/nested-5.c38
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/nested-6.c28
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-1.c55
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-2.c56
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-3.c42
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-4.c38
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-5.c11
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/pr16660-1.c17
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/pr16660-2.c12
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/pr16660-3.c14
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/push-1.c59
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/regparm-1.c60
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/ret-struct-1.c34
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/setjmp-1.c43
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/setjmp-2.c46
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/setjmp-3.c37
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/setjmp-4.c39
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/sibcall-1.c35
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp52
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/struct-1.c28
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/vararg-1.c59
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/vararg-2.c65
-rw-r--r--gcc/testsuite/gcc.dg/torture/stackalign/vararg-3.c84
-rw-r--r--gcc/testsuite/gcc.dg/transparent-union-1.c2
-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/20030728-1.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-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/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.c6
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr21829.c33
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/pr30375.c2
-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-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/uninit-15.c27
-rw-r--r--gcc/testsuite/gcc.dg/uninit-6.c2
-rw-r--r--gcc/testsuite/gcc.dg/uninit-B.c2
-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-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.c5
-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.c5
-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-18.c1
-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/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-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-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-7.c2
-rw-r--r--gcc/testsuite/gcc.dg/winline-4.c11
-rw-r--r--gcc/testsuite/gcc.dg/wtr-static-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/20060512-1.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/20060512-2.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/20060512-3.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/20060512-4.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/aesdec.c14
-rw-r--r--gcc/testsuite/gcc.target/i386/aesdeclast.c14
-rw-r--r--gcc/testsuite/gcc.target/i386/aesenc.c14
-rw-r--r--gcc/testsuite/gcc.target/i386/aesenclast.c14
-rw-r--r--gcc/testsuite/gcc.target/i386/aesimc.c14
-rw-r--r--gcc/testsuite/gcc.target/i386/aeskeygenassist.c14
-rw-r--r--gcc/testsuite/gcc.target/i386/cold-1.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-1.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-2.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-3.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-4.c8
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-5.c232
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-6.c124
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-7.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-8.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/funcspec-9.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/hot-1.c33
-rw-r--r--gcc/testsuite/gcc.target/i386/i386.exp13
-rw-r--r--gcc/testsuite/gcc.target/i386/m128-check.h103
-rw-r--r--gcc/testsuite/gcc.target/i386/opt-2.c4
-rw-r--r--gcc/testsuite/gcc.target/i386/regparm.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-22.c22
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-23.c2
-rw-r--r--gcc/testsuite/gcc.target/i386/sse-check.h1
-rw-r--r--gcc/testsuite/gcc.target/i386/sse3-addsubpd.c14
-rw-r--r--gcc/testsuite/gcc.target/i386/sse3-addsubps.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse3-haddpd.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/sse3-haddps.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse3-hsubpd.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/sse3-hsubps.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/sse3-lddqu.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/sse3-movddup.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse3-movshdup.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse3-movsldup.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-blendpd.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-blendps.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-dppd-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-dppd-2.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-dpps-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-dpps-2.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-extractps.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-insertps-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-insertps-2.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-movntdqa.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-mpsadbw.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-packusdw.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pblendvb.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pblendw.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pcmpeqq.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pextrb.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pextrd.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pextrq.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pextrw.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-phminposuw.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pinsrb.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pinsrd.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pinsrq.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pmaxsb.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pmaxsd.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pmaxud.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pmaxuw.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pminsb.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pminsd.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pminud.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pminuw.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbd.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbq.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbw.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pmovsxdq.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pmovsxwd.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pmovsxwq.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbd.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbq.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbw.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pmovzxdq.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pmovzxwd.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pmovzxwq.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pmuldq.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-pmulld.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-ptest-1.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-ptest-2.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-ptest-3.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-roundpd-1.c40
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-roundpd-2.c38
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_1-roundpd-3.c38
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_2-pcmpestri-1.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_2-pcmpestri-2.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_2-pcmpestrm-1.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_2-pcmpestrm-2.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_2-pcmpgtq.c12
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_2-pcmpistri-1.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_2-pcmpistri-2.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_2-pcmpistrm-1.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/sse4_2-pcmpistrm-2.c13
-rw-r--r--gcc/testsuite/gcc.target/i386/ssse3-pabsb.c18
-rw-r--r--gcc/testsuite/gcc.target/i386/ssse3-pabsd.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/ssse3-pabsw.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/ssse3-palignr.c19
-rw-r--r--gcc/testsuite/gcc.target/i386/ssse3-phaddd.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/ssse3-phaddsw.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/ssse3-phaddw.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/ssse3-phsubd.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/ssse3-phsubsw.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/ssse3-phsubw.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/ssse3-pmaddubsw.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/ssse3-pmulhrsw.c17
-rw-r--r--gcc/testsuite/gcc.target/i386/ssse3-pshufb.c19
-rw-r--r--gcc/testsuite/gcc.target/i386/ssse3-psignb.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/ssse3-psignd.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/ssse3-psignw.c16
-rw-r--r--gcc/testsuite/gcc.target/i386/stackalign/asm-1.c7
-rw-r--r--gcc/testsuite/gcc.target/i386/stackalign/return-1.c11
-rw-r--r--gcc/testsuite/gcc.target/i386/stackalign/return-2.c18
-rw-r--r--gcc/testsuite/gcc.target/i386/stackalign/return-3.c10
-rw-r--r--gcc/testsuite/gcc.target/i386/stackalign/return-4.c10
-rw-r--r--gcc/testsuite/gcc.target/i386/stackalign/return-5.c14
-rw-r--r--gcc/testsuite/gcc.target/i386/stackalign/return-6.c14
-rw-r--r--gcc/testsuite/gcc.target/i386/stackalign/stackalign.exp47
-rw-r--r--gcc/testsuite/gcc.target/ia64/types-1.c28
-rw-r--r--gcc/testsuite/gcc.target/powerpc/altivec-macros.c12
-rw-r--r--gcc/testsuite/gcc.target/powerpc/altivec-types-1.c3
-rw-r--r--gcc/testsuite/gcc.target/powerpc/darwin-save-world-1.c1
-rw-r--r--gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c2
-rw-r--r--gcc/testsuite/gcc.target/sparc/ultrasp3.c2
-rw-r--r--gcc/testsuite/gcc.target/x86_64/abi/abi-x86_64.exp2
-rw-r--r--gcc/testsuite/gcc.target/x86_64/abi/asm-support.s80
-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/c_sizeof_2.f905
-rw-r--r--gcc/testsuite/gfortran.dg/conflicts.f908
-rw-r--r--gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f4
-rw-r--r--gcc/testsuite/gfortran.dg/finalize_5.f032
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_g0_2.f082
-rw-r--r--gcc/testsuite/gfortran.dg/fmt_t_7.f32
-rw-r--r--gcc/testsuite/gfortran.dg/gamma_2.f9024
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/block-1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/index_2.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/private_type_6.f902
-rw-r--r--gcc/testsuite/gfortran.dg/proc_decl_1.f904
-rw-r--r--gcc/testsuite/gfortran.dg/rank_1.f905
-rw-r--r--gcc/testsuite/gfortran.dg/result_in_spec_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/selected_char_kind_3.f904
-rw-r--r--gcc/testsuite/gfortran.dg/structure_constructor_7.f032
-rw-r--r--gcc/testsuite/gfortran.dg/structure_constructor_8.f034
-rw-r--r--gcc/testsuite/gfortran.dg/warn_std_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/warn_std_2.f908
-rw-r--r--gcc/testsuite/gfortran.dg/warn_std_3.f906
-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.exp143
-rw-r--r--gcc/timevar.def2
-rw-r--r--gcc/toplev.c47
-rw-r--r--gcc/toplev.h18
-rw-r--r--gcc/tracer.c10
-rw-r--r--gcc/tree-affine.c66
-rw-r--r--gcc/tree-call-cdce.c207
-rw-r--r--gcc/tree-cfg.c3531
-rw-r--r--gcc/tree-cfgcleanup.c179
-rw-r--r--gcc/tree-chrec.c23
-rw-r--r--gcc/tree-chrec.h4
-rw-r--r--gcc/tree-complex.c811
-rw-r--r--gcc/tree-data-ref.c267
-rw-r--r--gcc/tree-data-ref.h16
-rw-r--r--gcc/tree-dfa.c209
-rw-r--r--gcc/tree-dump.c26
-rw-r--r--gcc/tree-eh.c1801
-rw-r--r--gcc/tree-flow-inline.h406
-rw-r--r--gcc/tree-flow.h322
-rw-r--r--gcc/tree-gimple.c653
-rw-r--r--gcc/tree-gimple.h235
-rw-r--r--gcc/tree-if-conv.c284
-rw-r--r--gcc/tree-inline.c2436
-rw-r--r--gcc/tree-inline.h28
-rw-r--r--gcc/tree-into-ssa.c322
-rw-r--r--gcc/tree-iterator.c2
-rw-r--r--gcc/tree-loop-distribution.c134
-rw-r--r--gcc/tree-loop-linear.c24
-rw-r--r--gcc/tree-mudflap.c316
-rw-r--r--gcc/tree-nested.c1000
-rw-r--r--gcc/tree-nomudflap.c2
-rw-r--r--gcc/tree-nrv.c90
-rw-r--r--gcc/tree-object-size.c391
-rw-r--r--gcc/tree-optimize.c63
-rw-r--r--gcc/tree-outof-ssa.c272
-rw-r--r--gcc/tree-parloops.c518
-rw-r--r--gcc/tree-pass.h17
-rw-r--r--gcc/tree-phinodes.c216
-rw-r--r--gcc/tree-predcom.c451
-rw-r--r--gcc/tree-pretty-print.c521
-rw-r--r--gcc/tree-profile.c188
-rw-r--r--gcc/tree-scalar-evolution.c597
-rw-r--r--gcc/tree-scalar-evolution.h4
-rw-r--r--gcc/tree-sra.c765
-rw-r--r--gcc/tree-ssa-address.c32
-rw-r--r--gcc/tree-ssa-alias-warnings.c159
-rw-r--r--gcc/tree-ssa-alias.c206
-rw-r--r--gcc/tree-ssa-ccp.c1665
-rw-r--r--gcc/tree-ssa-coalesce.c116
-rw-r--r--gcc/tree-ssa-copy.c237
-rw-r--r--gcc/tree-ssa-copyrename.c35
-rw-r--r--gcc/tree-ssa-dce.c242
-rw-r--r--gcc/tree-ssa-dom.c1659
-rw-r--r--gcc/tree-ssa-dse.c185
-rw-r--r--gcc/tree-ssa-forwprop.c606
-rw-r--r--gcc/tree-ssa-ifcombine.c258
-rw-r--r--gcc/tree-ssa-live.c111
-rw-r--r--gcc/tree-ssa-live.h4
-rw-r--r--gcc/tree-ssa-loop-ch.c53
-rw-r--r--gcc/tree-ssa-loop-im.c572
-rw-r--r--gcc/tree-ssa-loop-ivcanon.c98
-rw-r--r--gcc/tree-ssa-loop-ivopts.c383
-rw-r--r--gcc/tree-ssa-loop-manip.c153
-rw-r--r--gcc/tree-ssa-loop-niter.c385
-rw-r--r--gcc/tree-ssa-loop-prefetch.c67
-rw-r--r--gcc/tree-ssa-loop-unswitch.c28
-rw-r--r--gcc/tree-ssa-loop.c15
-rw-r--r--gcc/tree-ssa-math-opts.c225
-rw-r--r--gcc/tree-ssa-operands.c769
-rw-r--r--gcc/tree-ssa-operands.h37
-rw-r--r--gcc/tree-ssa-phiopt.c396
-rw-r--r--gcc/tree-ssa-phiprop.c88
-rw-r--r--gcc/tree-ssa-pre.c1082
-rw-r--r--gcc/tree-ssa-propagate.c847
-rw-r--r--gcc/tree-ssa-propagate.h46
-rw-r--r--gcc/tree-ssa-reassoc.c863
-rw-r--r--gcc/tree-ssa-sccvn.c845
-rw-r--r--gcc/tree-ssa-sccvn.h37
-rw-r--r--gcc/tree-ssa-sink.c112
-rw-r--r--gcc/tree-ssa-structalias.c404
-rw-r--r--gcc/tree-ssa-structalias.h4
-rw-r--r--gcc/tree-ssa-ter.c101
-rw-r--r--gcc/tree-ssa-threadedge.c257
-rw-r--r--gcc/tree-ssa-threadupdate.c50
-rw-r--r--gcc/tree-ssa-uncprop.c58
-rw-r--r--gcc/tree-ssa.c330
-rw-r--r--gcc/tree-ssanames.c18
-rw-r--r--gcc/tree-stdarg.c227
-rw-r--r--gcc/tree-switch-conversion.c259
-rw-r--r--gcc/tree-tailcall.c477
-rw-r--r--gcc/tree-vect-analyze.c917
-rw-r--r--gcc/tree-vect-generic.c191
-rw-r--r--gcc/tree-vect-patterns.c290
-rw-r--r--gcc/tree-vect-transform.c2608
-rw-r--r--gcc/tree-vectorizer.c648
-rw-r--r--gcc/tree-vectorizer.h154
-rw-r--r--gcc/tree-vrp.c1307
-rw-r--r--gcc/tree.c474
-rw-r--r--gcc/tree.def72
-rw-r--r--gcc/tree.h288
-rw-r--r--gcc/value-prof.c773
-rw-r--r--gcc/value-prof.h24
-rw-r--r--gcc/varasm.c24
-rw-r--r--gcc/varpool.c16
-rw-r--r--gcc/vmsdbgout.c2
-rw-r--r--gnattools/ChangeLog28
-rw-r--r--gnattools/Makefile.in35
-rwxr-xr-xgnattools/configure995
-rw-r--r--gnattools/configure.ac17
-rw-r--r--libada/ChangeLog43
-rw-r--r--libada/Makefile.in76
-rwxr-xr-xlibada/configure991
-rw-r--r--libada/configure.ac14
-rw-r--r--libcpp/ChangeLog10
-rw-r--r--libcpp/files.c55
-rw-r--r--libcpp/po/ChangeLog4
-rw-r--r--libcpp/po/cpplib.pot358
-rw-r--r--libffi/ChangeLog13
-rw-r--r--libffi/src/powerpc/ffi.c19
-rw-r--r--libffi/src/powerpc/ffitarget.h8
-rw-r--r--libgcc/ChangeLog4
-rw-r--r--libgcc/config.host4
-rw-r--r--libgfortran/ChangeLog80
-rw-r--r--libgfortran/Makefile.am21
-rw-r--r--libgfortran/Makefile.in167
-rw-r--r--libgfortran/gfortran.map1
-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.c294
-rw-r--r--libgfortran/libgfortran.h60
-rw-r--r--libgfortran/runtime/error.c15
-rw-r--r--libgomp/ChangeLog19
-rw-r--r--libgomp/config/linux/mips/futex.h75
-rw-r--r--libgomp/configure.tgt4
-rw-r--r--libgomp/libgomp.texi7
-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/ChangeLog24
-rw-r--r--libiberty/Makefile.in150
-rw-r--r--libiberty/functions.texi16
-rw-r--r--libiberty/maint-tool4
-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/ChangeLog566
-rw-r--r--libstdc++-v3/Makefile.in1
-rw-r--r--libstdc++-v3/acinclude.m4349
-rw-r--r--libstdc++-v3/config.h.in67
-rw-r--r--libstdc++-v3/config/abi/pre/gnu.ver29
-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/configure20470
-rw-r--r--libstdc++-v3/configure.ac95
-rw-r--r--libstdc++-v3/crossconfig.m4158
-rw-r--r--libstdc++-v3/doc/Makefile.am2
-rw-r--r--libstdc++-v3/doc/Makefile.in3
-rw-r--r--libstdc++-v3/doc/html/api.html2
-rw-r--r--libstdc++-v3/doc/html/manual/abi.html20
-rw-r--r--libstdc++-v3/doc/html/manual/api.html4
-rw-r--r--libstdc++-v3/doc/html/manual/backwards.html48
-rw-r--r--libstdc++-v3/doc/html/manual/bitmap_allocator.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt01ch01.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt01ch02.html275
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt01ch03s02.html10
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt01ch03s04.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt02pr01.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt04ch11.html20
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt06ch14.html14
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt06ch15.html16
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt09pr02.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt12ch30s03.html4
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt12ch31s03.html2
-rw-r--r--libstdc++-v3/doc/html/manual/bk01pt12pr03.html2
-rw-r--r--libstdc++-v3/doc/html/manual/build.html95
-rw-r--r--libstdc++-v3/doc/html/manual/codecvt.html20
-rw-r--r--libstdc++-v3/doc/html/manual/debug.html31
-rw-r--r--libstdc++-v3/doc/html/manual/intro.html2
-rw-r--r--libstdc++-v3/doc/html/manual/messages.html18
-rw-r--r--libstdc++-v3/doc/html/manual/parallel_mode.html4
-rw-r--r--libstdc++-v3/doc/html/manual/shared_ptr.html22
-rw-r--r--libstdc++-v3/doc/html/manual/spine.html4
-rw-r--r--libstdc++-v3/doc/html/manual/test.html180
-rw-r--r--libstdc++-v3/doc/html/spine.html2
-rw-r--r--libstdc++-v3/doc/xml/manual/build.xml182
-rw-r--r--libstdc++-v3/doc/xml/manual/configure.xml60
-rw-r--r--libstdc++-v3/doc/xml/manual/debug.xml35
-rw-r--r--libstdc++-v3/doc/xml/manual/intro.xml49
-rw-r--r--libstdc++-v3/doc/xml/manual/test.xml353
-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_bvector.h4
-rw-r--r--libstdc++-v3/include/bits/stl_list.h2
-rw-r--r--libstdc++-v3/include/bits/stl_map.h2
-rw-r--r--libstdc++-v3/include/bits/stl_multimap.h2
-rw-r--r--libstdc++-v3/include/bits/stl_multiset.h2
-rw-r--r--libstdc++-v3/include/bits/stl_pair.h2
-rw-r--r--libstdc++-v3/include/bits/stl_set.h8
-rw-r--r--libstdc++-v3/include/bits/stl_vector.h10
-rw-r--r--libstdc++-v3/include/bits/stringfwd.h14
-rw-r--r--libstdc++-v3/include/debug/map.h2
-rw-r--r--libstdc++-v3/include/debug/multimap.h2
-rw-r--r--libstdc++-v3/include/debug/multiset.h2
-rw-r--r--libstdc++-v3/include/debug/safe_association.h4
-rw-r--r--libstdc++-v3/include/debug/set.h2
-rw-r--r--libstdc++-v3/include/debug/string4
-rw-r--r--libstdc++-v3/include/debug/vector4
-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/chrono67
-rw-r--r--libstdc++-v3/include/std/condition_variable75
-rw-r--r--libstdc++-v3/include/std/mutex128
-rw-r--r--libstdc++-v3/include/std/regex1
-rw-r--r--libstdc++-v3/include/std/utility1
-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/boost_shared_ptr.h9
-rw-r--r--libstdc++-v3/include/tr1_impl/cstdint12
-rw-r--r--libstdc++-v3/include/tr1_impl/hashtable2
-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/libmath/mathconf.h12
-rw-r--r--libstdc++-v3/libsupc++/Makefile.am3
-rw-r--r--libstdc++-v3/libsupc++/Makefile.in10
-rw-r--r--libstdc++-v3/libsupc++/eh_alloc.cc68
-rw-r--r--libstdc++-v3/libsupc++/eh_arm.cc8
-rw-r--r--libstdc++-v3/libsupc++/eh_call.cc4
-rw-r--r--libstdc++-v3/libsupc++/eh_personality.cc22
-rw-r--r--libstdc++-v3/libsupc++/eh_throw.cc26
-rw-r--r--libstdc++-v3/libsupc++/eh_type.cc12
-rw-r--r--libstdc++-v3/libsupc++/exception8
-rw-r--r--libstdc++-v3/libsupc++/unwind-cxx.h144
-rw-r--r--libstdc++-v3/linkage.m488
-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/src/mt_allocator.cc2
-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/18_support/exception_ptr/current_exception.cc92
-rw-r--r--libstdc++-v3/testsuite/18_support/exception_ptr/lifespan.cc190
-rw-r--r--libstdc++-v3/testsuite/18_support/exception_ptr/rethrow_exception.cc115
-rw-r--r--libstdc++-v3/testsuite/18_support/headers/cstdint/types_std_c++0x.cc9
-rw-r--r--libstdc++-v3/testsuite/18_support/numeric_limits/char16_32_t.cc5
-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/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/25_algorithms/nth_element/2.cc8
-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/30_threads/mutex/cons/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/30_threads/mutex/cons/copy_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/copy_neg.cc2
-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/dg-options.exp9
-rw-r--r--libstdc++-v3/testsuite/lib/libstdc++.exp93
-rw-r--r--libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdint/types_std_tr1.cc7
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_api.h28
-rw-r--r--svn-mergepoint2
1667 files changed, 104659 insertions, 78982 deletions
diff --git a/ChangeLog b/ChangeLog
index 69d15720422..8afe2f8111e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,55 @@
+2008-08-30 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * MAINTAINERS: Consistently use tabs to separate columns.
+
+2008-08-29 Tristan Gingold <gingold@adacore.com>
+
+ * MAINTAINERS (Write after Approval): Add myself.
+
+2008-08-28 Tristan Gingold <gingold@adacore.com>
+
+ * configure.ac (powerpc-*-darwin*, i?86-*-darwin*,x86_64-*-darwin9):
+ Enable bfd, binutils and opcodes.
+ * configure: Regenerate.
+
+2008-08-27 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * MAINTAINERS: Update my hppa and hpux entries. Remove my vax entry.
+
+2008-08-23 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ * MAINTAINERS: Use correct Umlaut for last name.
+
+2008-08-23 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ * MAINTAINERS: Move myself from Reviewers to Write after Approval.
+
+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.
+ * Makefile.def (flags_to_pass): Add ADA_CFLAGS.
+ * Makefile.tpl (HOST_EXPORTS): Pass ADA_CFLAGS.
+ * configure: Regenerate.
+ * Makefile.in: Regenerate.
+
+2008-07-28 Aldy Hernandez <aldyh@redhat.com>
+
+ * MAINTAINERS: Add Jakub and myself as gimple maintainers.
+
2008-07-11 Dodji Seketeli <dseketel@redhat.com>
* MAINTAINERS (Write after Approval): Add myself.
@@ -3651,7 +3703,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 ba77126fee1..2f196eb2fad 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -21,7 +21,7 @@ Maintainers
Blanket Write Privs.
Richard Earnshaw richard.earnshaw@arm.com
-Richard Henderson rth@redhat.com
+Richard Henderson rth@redhat.com
Geoffrey Keating geoffk@geoffk.org
Richard Kenner kenner@nyu.edu
Jeff Law law@redhat.com
@@ -50,7 +50,7 @@ frv port Alexandre Oliva aoliva@redhat.com
h8 port Jeff Law law@redhat.com
h8 port Kazu Hirata kazu@codesourcery.com
hppa port Jeff Law law@redhat.com
-hppa port Dave Anglin dave.anglin@nrc.ca
+hppa port John David Anglin dave.anglin@nrc-cnrc.gc.ca
i386 port Richard Henderson rth@redhat.com
i386 port Jan Hubicka jh@suse.cz
i386 port Uros Bizjak ubizjak@gmail.com
@@ -63,14 +63,14 @@ m68k port (?) Jeff Law law@redhat.com
m68k port Andreas Schwab schwab@suse.de
m68k-motorola-sysv port Philippe De Muyter phdm@macqel.be
mcore port Nick Clifton nickc@redhat.com
-mips port Eric Christopher echristo@apple.com
+mips port Eric Christopher echristo@apple.com
mips port Richard Sandiford rdsandiford@googlemail.com
mmix port Hans-Peter Nilsson hp@bitrange.com
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,9 +83,8 @@ 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
x86-64 port Jan Hubicka jh@suse.cz
xstormy16 port Nick Clifton nickc@redhat.com
@@ -99,7 +98,7 @@ darwin port Eric Christopher echristo@apple.com
darwin port Stan Shebs stanshebs@earthlink.net
DJGPP DJ Delorie dj@delorie.com
freebsd Loren J. Rittle ljrittle@acm.org
-hpux Dave Anglin dave.anglin@nrc.ca
+hpux John David Anglin dave.anglin@nrc-cnrc.gc.ca
hpux Steve Ellcey sje@cup.hp.com
irix, osf Rainer Orth ro@TechFak.Uni-Bielefeld.DE
netbsd Jason Thorpe thorpej@netbsd.org
@@ -138,7 +137,7 @@ libgcc Ian Lance Taylor ian@airs.com
libgcc-math Richard Guenther rguenther@suse.de
libgcj Tom Tromey tromey@redhat.com
libgcj Bryce McKinlay mckinlay@redhat.com
-libgomp Richard Henderson rth@redhat.com
+libgomp Richard Henderson rth@redhat.com
libgomp Jakub Jelinek jakub@redhat.com
libiberty DJ Delorie dj@redhat.com
libiberty Ian Lance Taylor ian@airs.com
@@ -158,7 +157,7 @@ callgraph Jan Hubicka jh@suse.cz
debugging code Jim Wilson wilson@tuliptree.org
dwarf debugging code Jason Merrill jason@redhat.com
c++ runtime libs Paolo Carlini paolo.carlini@oracle.com
-c++ runtime libs Gabriel Dos Reis gdr@integrable-solutions.net
+c++ runtime libs Gabriel Dos Reis gdr@integrable-solutions.net
c++ runtime libs Ulrich Drepper drepper@redhat.com
c++ runtime libs Phil Edwards pme@gcc.gnu.org
c++ runtime libs Benjamin Kosnik bkoz@redhat.com
@@ -166,6 +165,8 @@ c++ runtime libs Loren J. Rittle ljrittle@acm.org
*synthetic multiply Torbjorn Granlund tege@swox.com
*c-torture Torbjorn Granlund tege@swox.com
fixincludes Bruce Korb bkorb@gnu.org
+*gimpl* Jakub Jelinek jakub@redhat.com
+*gimpl* Aldy Hernandez aldyh@redhat.com
gcse.c Jeff Law law@redhat.com
global opt framework Jeff Law law@redhat.com
jump.c David S. Miller davem@redhat.com
@@ -197,7 +198,7 @@ PRE Daniel Berlin dberlin@dberlin.org
code sinking Daniel Berlin dberlin@dberlin.org
mudflap Frank Ch. Eigler fche@redhat.com
tree browser/unparser Sebastian Pop sebastian.pop@amd.com
-scev, data dependence Daniel Berlin dberlin@dberlin.org
+scev, data dependence Daniel Berlin dberlin@dberlin.org
scev, data dependence Sebastian Pop sebastian.pop@amd.com
linear loop transforms Daniel Berlin dberlin@dberlin.org
profile feedback Jan Hubicka jh@suse.cz
@@ -236,10 +237,9 @@ dataflow Seongbae Park seongbae.park@gmail.com
dataflow Kenneth Zadeck zadeck@naturalbridge.com
Fortran Janne Blomqvist jb@gcc.gnu.org
Fortran Tobias Burnus burnus@net-b.de
-Fortran François-Xavier Coudert fxcoudert@gcc.gnu.org
Fortran Jerry DeLisle jvdelisle@gcc.gnu.org
Fortran Erik Edelmann erik.edelmann@iki.fi
-Fortran Thomas Koenig tkoenig@gcc.gnu.org
+Fortran Thomas König tkoenig@gcc.gnu.org
Fortran Toon Moene toon@moene.indiv.nluug.nl
Fortran Brooks Moses brooks.moses@codesourcery.com
Fortran Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
@@ -255,20 +255,20 @@ from other maintainers or reviewers.
Write After Approval (last name alphabetical order)
-Mark G. Adams mark.g.adams@sympatico.ca
-Raksit Ashok raksit@google.com
-Matt Austern austern@google.com
-David Ayers d.ayers@inode.at
+Mark G. Adams mark.g.adams@sympatico.ca
+Raksit Ashok raksit@google.com
+Matt Austern austern@google.com
+David Ayers d.ayers@inode.at
Giovanni Bajo giovannibajo@gcc.gnu.org
Simon Baldwin simonb@google.com
Scott Bambrough scottb@netwinder.org
Wolfgang Bangerth bangerth@dealii.org
-Andrey Belevantsev abel@ispras.ru
+Andrey Belevantsev abel@ispras.ru
Peter Bergner bergner@vnet.ibm.com
Jan Beulich jbeulich@novell.com
David Billinghurst David.Billinghurst@riotinto.com
Tomas Bily tbily@suse.cz
-Laurynas Biveinis laurynas.biveinis@gmail.com
+Laurynas Biveinis laurynas.biveinis@gmail.com
Eric Blake ericb@gcc.gnu.org
Jim Blandy jimb@codesourcery.com
Phil Blundell pb@futuretv.com
@@ -277,7 +277,7 @@ Segher Boessenkool segher@kernel.crashing.org
Andrea Bona andrea.bona@st.com
Paolo Bonzini bonzini@gnu.org
Neil Booth neil@daikokuya.co.uk
-Robert Bowdidge bowdidge@apple.com
+Robert Bowdidge bowdidge@apple.com
Joel Brobecker brobecker@gnat.com
Dave Brolley brolley@redhat.com
Julian Brown julian@codesourcery.com
@@ -292,12 +292,13 @@ William Cohen wcohen@redhat.com
Josh Conner jconner@apple.com
R. Kelley Cook kcook@gcc.gnu.org
Christian Cornelssen ccorn@cs.tu-berlin.de
+François-Xavier Coudert fxcoudert@gcc.gnu.org
Ian Dall ian@beware.dropbear.id.au
David Daney ddaney@avtrex.com
Bud Davis jmdavis@link.com
Benoit Dupont de Dinechin benoit.dupont-de-dinechin@st.com
Mohan Embar gnustuff@thisiscool.com
-Revital Eres eres@il.ibm.com
+Revital Eres eres@il.ibm.com
Marc Espie espie@cvs.openbsd.org
Rafael Ávila de Espíndola rafael.espindola@gmail.com
Ansgar Esztermann ansgar@thphy.uni-duesseldorf.de
@@ -310,6 +311,7 @@ Nathan Froyd froydnj@codesourcery.com
Chao-ying Fu fu@mips.com
Kaveh Ghazi ghazi@caip.rutgers.edu
Matthew Gingell gingell@gnat.com
+Tristan Gingold gingold@adacore.com
Anthony Green green@redhat.com
Doug Gregor doug.gregor@gmail.com
Jon Grimm jgrimm2@us.ibm.com
@@ -369,11 +371,11 @@ Sa Liu saliu@de.ibm.com
Ralph Loader rcl@ihug.co.nz
Gabor Loki loki@inf.u-szeged.hu
Sandra Loosemore sandra@codesourcery.com
-Manuel López-Ibáñez manu@gcc.gnu.org
+Manuel López-Ibáñez manu@gcc.gnu.org
Dave Love d.love@dl.ac.uk
Martin v. Löwis loewis@informatik.hu-berlin.de
H.J. Lu hjl.tools@gmail.com
-Xinliang David Li davidxl@google.com
+Xinliang David Li davidxl@google.com
William Maddox maddox@google.com
Ziga Mahkovec ziga.mahkovec@klika.si
Simon Martin simartin@users.sourceforge.net
@@ -411,15 +413,15 @@ Rolf Rasmussen rolfwr@gcc.gnu.org
Volker Reichelt v.reichelt@netcologne.de
Tom Rix trix@redhat.com
Craig Rodrigues rodrigc@gcc.gnu.org
-Erven Rohou erven.rohou@st.com
+Erven Rohou erven.rohou@st.com
Gavin Romig-Koch gavin@redhat.com
-Ira Rosen irar@il.ibm.com
+Ira Rosen irar@il.ibm.com
Maciej W. Rozycki macro@linux-mips.org
Douglas Rupp rupp@gnat.com
Silvius Rus rus@google.com
Matthew Sachs msachs@apple.com
Dodji Seketeli dseketel@redhat.com
-Svein Seldal svein@dev.seldal.com
+Svein Seldal svein@dev.seldal.com
Thiemo Seufer ths@networkno.de
Mark Shinwell shinwell@codesourcery.com
Johannes Singler singler@ira.uka.de
diff --git a/Makefile.def b/Makefile.def
index 3924617ebd3..832fc4236e9 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -226,6 +226,7 @@ flags_to_pass = { flag= YACC ; };
// Host tools
flags_to_pass = { flag= ADAFLAGS ; optional=true ; };
+flags_to_pass = { flag= ADA_CFLAGS ; };
flags_to_pass = { flag= AR_FLAGS ; };
flags_to_pass = { flag= BOOT_ADAFLAGS ; optional=true ; };
flags_to_pass = { flag= BOOT_CFLAGS ; };
diff --git a/Makefile.in b/Makefile.in
index 81bf0e9011c..2ede05810ee 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -164,6 +164,7 @@ HOST_SUBDIR = @host_subdir@
HOST_EXPORTS = \
$(BASE_EXPORTS) \
CC="$(CC)"; export CC; \
+ ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
@@ -290,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@
@@ -514,6 +516,7 @@ BASE_FLAGS_TO_PASS = \
"SHELL=$(SHELL)" \
"YACC=$(YACC)" \
"`echo 'ADAFLAGS=$(ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
+ "ADA_CFLAGS=$(ADA_CFLAGS)" \
"AR_FLAGS=$(AR_FLAGS)" \
"`echo 'BOOT_ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
"BOOT_CFLAGS=$(BOOT_CFLAGS)" \
diff --git a/Makefile.tpl b/Makefile.tpl
index 4c744eba394..a9dfd3e2af4 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -167,6 +167,7 @@ HOST_SUBDIR = @host_subdir@
HOST_EXPORTS = \
$(BASE_EXPORTS) \
CC="$(CC)"; export CC; \
+ ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
@@ -293,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 e64c1cab72e..1062d8ee5e2 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,30 @@
+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.
+ * mh-pa-hpux10: New, from gcc/config/pa/x-ada-hpux10.
+
+2008-07-25 Keith Seitz <keiths@redhat.com>
+
+ * acinclude.m4: Remove libide, libgui, and all the other Tcl
+ functions.
+ * tcl.m4: New file.
+
2008-07-11 Joseph Myers <joseph@codesourcery.com>
* mh-mingw (LDFLAGS): Append to rather than replacing previous
diff --git a/config/acinclude.m4 b/config/acinclude.m4
index c7c0ab5dc11..8242b2c7a8a 100644
--- a/config/acinclude.m4
+++ b/config/acinclude.m4
@@ -497,99 +497,6 @@ AC_SUBST(DEVOHDIR)
])
dnl ====================================================================
-dnl find the IDE library and headers.
-AC_DEFUN([CYG_AC_PATH_IDE], [
-AC_MSG_CHECKING(for IDE headers in the source tree)
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-IDEHDIR=
-IDELIB=
-AC_CACHE_VAL(ac_cv_c_ideh,[
-for i in $dirlist; do
- if test -f "${srcdir}/$i/libide/src/event.h" ; then
- ac_cv_c_ideh=`(cd ${srcdir}/$i/libide/src; ${PWDCMD-pwd})`;
- fi
-done
-])
-if test x"${ac_cv_c_ideh}" != x; then
- IDEHDIR="-I${ac_cv_c_ideh}"
- AC_MSG_RESULT(${ac_cv_c_ideh})
-else
- AC_MSG_RESULT(none)
-fi
-
-AC_MSG_CHECKING(for LIBIDE TCL headers in the source tree)
-AC_CACHE_VAL(ac_cv_c_idetclh,[
-for i in $dirlist; do
- if test -f "${srcdir}/$i/libidetcl/src/idetcl.h" ; then
- ac_cv_c_idetclh=`(cd ${srcdir}/$i/libidetcl/src; ${PWDCMD-pwd})`;
- fi
-done
-])
-if test x"${ac_cv_c_idetclh}" != x; then
- IDEHDIR="${IDEHDIR} -I${ac_cv_c_idetclh}"
- AC_MSG_RESULT(${ac_cv_c_idetclh})
-else
- AC_MSG_RESULT(none)
-fi
-
-AC_MSG_CHECKING(for IDE headers in the build tree)
-AC_CACHE_VAL(ac_cv_c_ideh2,[
-for i in $dirlist; do
- if test -f "$i/libide/src/Makefile" ; then
- ac_cv_c_ideh2=`(cd $i/libide/src; ${PWDCMD-pwd})`;
- fi
-done
-])
-if test x"${ac_cv_c_ideh2}" != x; then
- IDEHDIR="${IDEHDIR} -I${ac_cv_c_ideh2}"
- AC_MSG_RESULT(${ac_cv_c_ideh2})
-else
- AC_MSG_RESULT(none)
-fi
-
-dnl look for the library
-AC_MSG_CHECKING(for IDE library)
-AC_CACHE_VAL(ac_cv_c_idelib,[
-if test x"${ac_cv_c_idelib}" = x ; then
- for i in $dirlist; do
- if test -f "$i/libide/src/Makefile" ; then
- ac_cv_c_idelib=`(cd $i/libide/src; ${PWDCMD-pwd})`
- break
- fi
- done
-fi])
-if test x"${ac_cv_c_idelib}" != x ; then
- IDELIB="-L${ac_cv_c_idelib}"
- AC_MSG_RESULT(${ac_cv_c_idelib})
-else
- AC_MSG_RESULT(none)
-fi
-
-dnl find libiddetcl.a if it exists
-AC_MSG_CHECKING(for IDE TCL library)
-AC_CACHE_VAL(ac_cv_c_idetcllib,[
-if test x"${ac_cv_c_idetcllib}" = x ; then
- for i in $dirlist; do
- if test -f "$i/libidetcl/src/Makefile" ; then
- ac_cv_c_idetcllib=`(cd $i/libidetcl/src; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-])
-if test x"${ac_cv_c_idetcllib}" != x ; then
- IDELIB="${IDELIB} -L${ac_cv_c_idetcllib}"
- IDETCLLIB="-lidetcl"
- AC_MSG_RESULT(${ac_cv_c_idetcllib})
-else
- AC_MSG_RESULT(none)
-fi
-AC_SUBST(IDEHDIR)
-AC_SUBST(IDELIB)
-AC_SUBST(IDETCLLIB)
-])
-
-dnl ====================================================================
dnl Find all the ILU headers and libraries
AC_DEFUN([CYG_AC_PATH_ILU], [
AC_MSG_CHECKING(for ILU kernel headers in the source tree)
@@ -837,1187 +744,3 @@ fi
AC_LANG_RESTORE
AC_SUBST(LIBGCC)
])
-
-dnl ====================================================================
-dnl Ok, lets find the tcl source trees so we can use the headers
-dnl Warning: transition of version 9 to 10 will break this algorithm
-dnl because 10 sorts before 9. We also look for just tcl. We have to
-dnl be careful that we don't match stuff like tclX by accident.
-dnl the alternative search directory is involked by --with-tclinclude
-AC_DEFUN([CYG_AC_PATH_TCL], [
- CYG_AC_PATH_TCLH
- CYG_AC_PATH_TCLCONFIG
- CYG_AC_LOAD_TCLCONFIG
-])
-AC_DEFUN([CYG_AC_PATH_TCLH], [
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-no_tcl=true
-AC_MSG_CHECKING(for Tcl headers in the source tree)
-AC_ARG_WITH(tclinclude, [ --with-tclinclude directory where tcl headers are], with_tclinclude=${withval})
-AC_CACHE_VAL(ac_cv_c_tclh,[
-dnl first check to see if --with-tclinclude was specified
-if test x"${with_tclinclude}" != x ; then
- if test -f ${with_tclinclude}/tcl.h ; then
- ac_cv_c_tclh=`(cd ${with_tclinclude}; ${PWDCMD-pwd})`
- elif test -f ${with_tclinclude}/generic/tcl.h ; then
- ac_cv_c_tclh=`(cd ${with_tclinclude}/generic; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_tclinclude} directory doesn't contain headers])
- fi
-fi
-
-dnl next check if it came with Tcl configuration file
-if test x"${ac_cv_c_tclconfig}" != x ; then
- for i in $dirlist; do
- if test -f $ac_cv_c_tclconfig/$i/generic/tcl.h ; then
- ac_cv_c_tclh=`(cd $ac_cv_c_tclconfig/$i/generic; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl next check in private source directory
-dnl since ls returns lowest version numbers first, reverse its output
-if test x"${ac_cv_c_tclh}" = x ; then
- dnl find the top level Tcl source directory
- for i in $dirlist; do
- if test -n "`ls -dr $srcdir/$i/tcl* 2>/dev/null`" ; then
- tclpath=$srcdir/$i
- break
- fi
- done
-
- dnl find the exact Tcl source dir. We do it this way, cause there
- dnl might be multiple version of Tcl, and we want the most recent one.
- for i in `ls -dr $tclpath/tcl* 2>/dev/null ` ; do
- if test -f $i/generic/tcl.h ; then
- ac_cv_c_tclh=`(cd $i/generic; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl check if its installed with the compiler
-if test x"${ac_cv_c_tclh}" = x ; then
- dnl Get the path to the compiler
- ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/include
- if test -f $ccpath/tcl.h; then
- ac_cv_c_tclh=$ccpath
- fi
-fi
-
-dnl see if one is installed
-if test x"${ac_cv_c_tclh}" = x ; then
- AC_MSG_RESULT(none)
- AC_CHECK_HEADER(tcl.h, ac_cv_c_tclh=installed, ac_cv_c_tclh="")
-else
- AC_MSG_RESULT(${ac_cv_c_tclh})
-fi
-])
- TCLHDIR=""
-if test x"${ac_cv_c_tclh}" = x ; then
- AC_MSG_ERROR([Can't find any Tcl headers])
-fi
-if test x"${ac_cv_c_tclh}" != x ; then
- no_tcl=""
- if test x"${ac_cv_c_tclh}" != x"installed" ; then
- if test x"${CC}" = xcl ; then
- tmp="`cygpath --windows ${ac_cv_c_tclh}`"
- ac_cv_c_tclh="`echo $tmp | sed -e s#\\\\\\\\#/#g`"
- fi
- AC_MSG_RESULT(${ac_cv_c_tclh})
- TCLHDIR="-I${ac_cv_c_tclh}"
- fi
-fi
-
-AC_SUBST(TCLHDIR)
-])
-
-dnl ====================================================================
-dnl Ok, lets find the tcl configuration
-AC_DEFUN([CYG_AC_PATH_TCLCONFIG], [
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-dnl First, look for one uninstalled.
-dnl the alternative search directory is invoked by --with-tclconfig
-if test x"${no_tcl}" = x ; then
- dnl we reset no_tcl in case something fails here
- no_tcl=true
- AC_ARG_WITH(tclconfig, [ --with-tclconfig directory containing tcl configuration (tclConfig.sh)],
- with_tclconfig=${withval})
- AC_MSG_CHECKING([for Tcl configuration script])
- AC_CACHE_VAL(ac_cv_c_tclconfig,[
-
- dnl First check to see if --with-tclconfig was specified.
- if test x"${with_tclconfig}" != x ; then
- if test -f "${with_tclconfig}/tclConfig.sh" ; then
- ac_cv_c_tclconfig=`(cd ${with_tclconfig}; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh])
- fi
- fi
-
- dnl next check if it came with Tcl configuration file in the source tree
- if test x"${ac_cv_c_tclconfig}" = x ; then
- for i in $dirlist; do
- dnl need to test both unix and win directories, since
- dnl cygwin's tkConfig.sh could be in either directory depending
- dnl on the cygwin port of tcl.
- if test -f $srcdir/$i/unix/tclConfig.sh ; then
- ac_cv_c_tclconfig=`(cd $srcdir/$i/unix; ${PWDCMD-pwd})`
- break
- fi
- if test -f $srcdir/$i/win/tclConfig.sh ; then
- ac_cv_c_tclconfig=`(cd $srcdir/$i/win; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- dnl check in a few other locations
- if test x"${ac_cv_c_tclconfig}" = x ; then
- dnl find the top level Tcl source directory
- for i in $dirlist; do
- if test -n "`ls -dr $i/tcl* 2>/dev/null`" ; then
- tclconfpath=$i
- break
- fi
- done
-
- dnl find the exact Tcl dir. We do it this way, cause there
- dnl might be multiple version of Tcl, and we want the most recent one.
- for i in `ls -dr $tclconfpath/tcl* 2>/dev/null ` ; do
- dnl need to test both unix and win directories, since
- dnl cygwin's tclConfig.sh could be in either directory depending
- dnl on the cygwin port of tcl.
- if test -f $i/unix/tclConfig.sh ; then
- ac_cv_c_tclconfig=`(cd $i/unix; ${PWDCMD-pwd})`
- break
- fi
- if test -f $i/win/tclConfig.sh ; then
- ac_cv_c_tclconfig=`(cd $i/win; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
-
- dnl Check to see if it's installed. We have to look in the $CC path
- dnl to find it, cause our $prefix may not match the compilers.
- if test x"${ac_cv_c_tclconfig}" = x ; then
- dnl Get the path to the compiler
- ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/lib
- if test -f $ccpath/tclConfig.sh; then
- ac_cv_c_tclconfig=$ccpath
- fi
- fi
- ]) dnl end of cache_val
-
- if test x"${ac_cv_c_tclconfig}" = x ; then
- TCLCONFIG=""
- AC_MSG_WARN(Can't find Tcl configuration definitions)
- else
- no_tcl=""
- TCLCONFIG=${ac_cv_c_tclconfig}/tclConfig.sh
- AC_MSG_RESULT(${TCLCONFIG})
- fi
-fi
-AC_SUBST(TCLCONFIG)
-])
-
-dnl Defined as a separate macro so we don't have to cache the values
-dnl from PATH_TCLCONFIG (because this can also be cached).
-AC_DEFUN([CYG_AC_LOAD_TCLCONFIG], [
- . $TCLCONFIG
-
-dnl AC_SUBST(TCL_VERSION)
-dnl AC_SUBST(TCL_MAJOR_VERSION)
-dnl AC_SUBST(TCL_MINOR_VERSION)
-dnl AC_SUBST(TCL_CC)
- AC_SUBST(TCL_DEFS)
-
-dnl not used, don't export to save symbols
- AC_SUBST(TCL_LIB_FILE)
- AC_SUBST(TCL_LIB_FULL_PATH)
- AC_SUBST(TCL_LIBS)
-dnl not used, don't export to save symbols
-dnl AC_SUBST(TCL_PREFIX)
-
- AC_SUBST(TCL_CFLAGS)
-
-dnl not used, don't export to save symbols
-dnl AC_SUBST(TCL_EXEC_PREFIX)
-
- AC_SUBST(TCL_SHLIB_CFLAGS)
- AC_SUBST(TCL_SHLIB_LD)
-dnl don't export, not used outside of configure
-dnl AC_SUBST(TCL_SHLIB_LD_LIBS)
-dnl AC_SUBST(TCL_SHLIB_SUFFIX)
-dnl not used, don't export to save symbols
-dnl AC_SUBST(TCL_DL_LIBS)
- AC_SUBST(TCL_LD_FLAGS)
- AC_SUBST(TCL_LD_SEARCH_FLAGS)
-dnl don't export, not used outside of configure
-dnl AC_SUBST(TCL_COMPAT_OBJS)
- AC_SUBST(TCL_RANLIB)
- AC_SUBST(TCL_BUILD_LIB_SPEC)
- AC_SUBST(TCL_LIB_SPEC)
- AC_SUBST(TCL_BIN_DIR)
-dnl AC_SUBST(TCL_LIB_VERSIONS_OK)
-
-dnl not used, don't export to save symbols
-dnl AC_SUBST(TCL_SHARED_LIB_SUFFIX)
-
-dnl not used, don't export to save symbols
-dnl AC_SUBST(TCL_UNSHARED_LIB_SUFFIX)
-])
-
-dnl ====================================================================
-AC_DEFUN([CYG_AC_PATH_TK], [
- CYG_AC_PATH_TKH
- CYG_AC_PATH_TKCONFIG
- CYG_AC_LOAD_TKCONFIG
-])
-AC_DEFUN([CYG_AC_PATH_TKH], [
-#
-# Ok, lets find the tk source trees so we can use the headers
-# If the directory (presumably symlink) named "tk" exists, use that one
-# in preference to any others. Same logic is used when choosing library
-# and again with Tcl. The search order is the best place to look first, then in
-# decreasing significance. The loop breaks if the trigger file is found.
-# Note the gross little conversion here of srcdir by cd'ing to the found
-# directory. This converts the path from a relative to an absolute, so
-# recursive cache variables for the path will work right. We check all
-# the possible paths in one loop rather than many separate loops to speed
-# things up.
-# the alternative search directory is involked by --with-tkinclude
-#
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-no_tk=true
-AC_MSG_CHECKING(for Tk headers in the source tree)
-AC_ARG_WITH(tkinclude, [ --with-tkinclude directory where tk headers are], with_tkinclude=${withval})
-AC_CACHE_VAL(ac_cv_c_tkh,[
-dnl first check to see if --with-tkinclude was specified
-if test x"${with_tkinclude}" != x ; then
- if test -f ${with_tkinclude}/tk.h ; then
- ac_cv_c_tkh=`(cd ${with_tkinclude}; ${PWDCMD-pwd})`
- elif test -f ${with_tkinclude}/generic/tk.h ; then
- ac_cv_c_tkh=`(cd ${with_tkinclude}/generic; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_tkinclude} directory doesn't contain headers])
- fi
-fi
-
-dnl next check if it came with Tk configuration file
-if test x"${ac_cv_c_tkconfig}" != x ; then
- for i in $dirlist; do
- if test -f $ac_cv_c_tkconfig/$i/generic/tk.h ; then
- ac_cv_c_tkh=`(cd $ac_cv_c_tkconfig/$i/generic; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl next check in private source directory
-dnl since ls returns lowest version numbers first, reverse its output
-if test x"${ac_cv_c_tkh}" = x ; then
- dnl find the top level Tk source directory
- for i in $dirlist; do
- if test -n "`ls -dr $srcdir/$i/tk* 2>/dev/null`" ; then
- tkpath=$srcdir/$i
- break
- fi
- done
-
- dnl find the exact Tk source dir. We do it this way, cause there
- dnl might be multiple version of Tk, and we want the most recent one.
- for i in `ls -dr $tkpath/tk* 2>/dev/null ` ; do
- if test -f $i/generic/tk.h ; then
- ac_cv_c_tkh=`(cd $i/generic; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl see if one is installed
-if test x"${ac_cv_c_tkh}" = x ; then
- AC_MSG_RESULT(none)
- dnl Get the path to the compiler. We do it this way instead of using
- dnl AC_CHECK_HEADER, cause this doesn't depend in having X configured.
- ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/include
- if test -f $ccpath/tk.h; then
- ac_cv_c_tkh=$ccpath
- fi
-else
- AC_MSG_RESULT(${ac_cv_c_tkh})
-fi
-])
- TKHDIR=""
-if test x"${ac_cv_c_tkh}" = x ; then
- AC_MSG_ERROR([Can't find any Tk headers])
-fi
-if test x"${ac_cv_c_tkh}" != x ; then
- no_tk=""
- if test x"${ac_cv_c_tkh}" != x"installed" ; then
- if test x"${CC}" = xcl ; then
- tmp="`cygpath --windows ${ac_cv_c_tkh}`"
- ac_cv_c_tkh="`echo $tmp | sed -e s#\\\\\\\\#/#g`"
- fi
- AC_MSG_RESULT([found in ${ac_cv_c_tkh}])
- TKHDIR="-I${ac_cv_c_tkh}"
- fi
-fi
-
-AC_SUBST(TKHDIR)
-])
-
-AC_DEFUN([CYG_AC_PATH_TKCONFIG], [
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-dnl First, look for one uninstalled.
-dnl the alternative search directory is invoked by --with-tkconfig
-if test x"${no_tk}" = x ; then
- dnl we reset no_tk in case something fails here
- no_tk=true
- AC_ARG_WITH(tkconfig, [ --with-tkconfig directory containing tk configuration (tkConfig.sh)],
- with_tkconfig=${withval})
- AC_MSG_CHECKING([for Tk configuration script])
- AC_CACHE_VAL(ac_cv_c_tkconfig,[
-
- dnl First check to see if --with-tkconfig was specified.
- if test x"${with_tkconfig}" != x ; then
- if test -f "${with_tkconfig}/tkConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd ${with_tkconfig}; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh])
- fi
- fi
-
- dnl next check if it came with Tk configuration file in the source tree
- if test x"${ac_cv_c_tkconfig}" = x ; then
- for i in $dirlist; do
- dnl need to test both unix and win directories, since
- dnl cygwin's tkConfig.sh could be in either directory depending
- dnl on the cygwin port of tk.
- if test -f $srcdir/$i/unix/tkConfig.sh ; then
- ac_cv_c_tkconfig=`(cd $srcdir/$i/unix; ${PWDCMD-pwd})`
- break
- fi
- if test -f $srcdir/$i/win/tkConfig.sh ; then
- ac_cv_c_tkconfig=`(cd $srcdir/$i/unix; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- dnl check in a few other locations
- if test x"${ac_cv_c_tkconfig}" = x ; then
- dnl find the top level Tk source directory
- for i in $dirlist; do
- if test -n "`ls -dr $i/tk* 2>/dev/null`" ; then
- tkconfpath=$i
- break
- fi
- done
-
- dnl find the exact Tk dir. We do it this way, cause there
- dnl might be multiple version of Tk, and we want the most recent one.
- for i in `ls -dr $tkconfpath/tk* 2>/dev/null ` ; do
- dnl need to test both unix and win directories, since
- dnl cygwin's tkConfig.sh could be in either directory depending
- dnl on the cygwin port of tk.
- if test -f $i/unix/tkConfig.sh ; then
- ac_cv_c_tkconfig=`(cd $i/unix; ${PWDCMD-pwd})`
- break
- fi
- if test -f $i/win/tkConfig.sh ; then
- ac_cv_c_tkconfig=`(cd $i/win; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
-
- dnl Check to see if it's installed. We have to look in the $CC path
- dnl to find it, cause our $prefix may not match the compilers.
- if test x"${ac_cv_c_tkconfig}" = x ; then
- dnl Get the path to the compiler
- ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/lib
- if test -f $ccpath/tkConfig.sh; then
- ac_cv_c_tkconfig=$ccpath
- fi
- fi
- ]) dnl end of cache_val
-
- if test x"${ac_cv_c_tkconfig}" = x ; then
- TKCONFIG=""
- AC_MSG_WARN(Can't find Tk configuration definitions)
- else
- no_tk=""
- TKCONFIG=${ac_cv_c_tkconfig}/tkConfig.sh
- AC_MSG_RESULT(${TKCONFIG})
- fi
-fi
-AC_SUBST(TKCONFIG)
-])
-
-dnl Defined as a separate macro so we don't have to cache the values
-dnl from PATH_TKCONFIG (because this can also be cached).
-AC_DEFUN([CYG_AC_LOAD_TKCONFIG], [
- if test -f "$TKCONFIG" ; then
- . $TKCONFIG
- fi
-
- AC_SUBST(TK_VERSION)
-dnl not actually used, don't export to save symbols
-dnl AC_SUBST(TK_MAJOR_VERSION)
-dnl AC_SUBST(TK_MINOR_VERSION)
- AC_SUBST(TK_DEFS)
-
-dnl not used, don't export to save symbols
- AC_SUBST(TK_LIB_FILE)
- AC_SUBST(TK_LIB_FULL_PATH)
- AC_SUBST(TK_LIBS)
-dnl not used, don't export to save symbols
-dnl AC_SUBST(TK_PREFIX)
-
-dnl not used, don't export to save symbols
-dnl AC_SUBST(TK_EXEC_PREFIX)
- AC_SUBST(TK_BUILD_INCLUDES)
- AC_SUBST(TK_XINCLUDES)
- AC_SUBST(TK_XLIBSW)
- AC_SUBST(TK_BUILD_LIB_SPEC)
- AC_SUBST(TK_LIB_SPEC)
-])
-
-dnl ====================================================================
-dnl Ok, lets find the itcl source trees so we can use the headers
-dnl the alternative search directory is involked by --with-itclinclude
-AC_DEFUN([CYG_AC_PATH_ITCL], [
- CYG_AC_PATH_ITCLH
- CYG_AC_PATH_ITCLLIB
- CYG_AC_PATH_ITCLSH
- CYG_AC_PATH_ITCLMKIDX
-])
-AC_DEFUN([CYG_AC_PATH_ITCLH], [
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-no_itcl=true
-AC_MSG_CHECKING(for Itcl headers in the source tree)
-AC_ARG_WITH(itclinclude, [ --with-itclinclude directory where itcl headers are], with_itclinclude=${withval})
-AC_CACHE_VAL(ac_cv_c_itclh,[
-dnl first check to see if --with-itclinclude was specified
-if test x"${with_itclinclude}" != x ; then
- if test -f ${with_itclinclude}/itcl.h ; then
- ac_cv_c_itclh=`(cd ${with_itclinclude}; ${PWDCMD-pwd})`
- elif test -f ${with_itclinclude}/src/itcl.h ; then
- ac_cv_c_itclh=`(cd ${with_itclinclude}/src; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_itclinclude} directory doesn't contain headers])
- fi
-fi
-
-dnl next check if it came with Itcl configuration file
-if test x"${ac_cv_c_itclconfig}" != x ; then
- for i in $dirlist; do
- if test -f $ac_cv_c_itclconfig/$i/src/itcl.h ; then
- ac_cv_c_itclh=`(cd $ac_cv_c_itclconfig/$i/src; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl next check in private source directory
-dnl since ls returns lowest version numbers first, reverse its output
-if test x"${ac_cv_c_itclh}" = x ; then
- dnl find the top level Itcl source directory
- for i in $dirlist; do
- if test -n "`ls -dr $srcdir/$i/itcl* 2>/dev/null`" ; then
- itclpath=$srcdir/$i
- break
- fi
- done
-
- dnl find the exact Itcl source dir. We do it this way, cause there
- dnl might be multiple version of Itcl, and we want the most recent one.
- for i in `ls -dr $itclpath/itcl* 2>/dev/null ` ; do
- if test -f $i/src/itcl.h ; then
- ac_cv_c_itclh=`(cd $i/src; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl see if one is installed
-if test x"${ac_cv_c_itclh}" = x ; then
- AC_MSG_RESULT(none)
- AC_CHECK_HEADER(itcl.h, ac_cv_c_itclh=installed, ac_cv_c_itclh="")
-else
- AC_MSG_RESULT(${ac_cv_c_itclh})
-fi
-])
- ITCLHDIR=""
-if test x"${ac_cv_c_itclh}" = x ; then
- AC_MSG_ERROR([Can't find any Itcl headers])
-fi
-if test x"${ac_cv_c_itclh}" != x ; then
- no_itcl=""
- if test x"${ac_cv_c_itclh}" != x"installed" ; then
- AC_MSG_RESULT(${ac_cv_c_itclh})
- ITCLHDIR="-I${ac_cv_c_itclh}"
- fi
-fi
-
-AC_SUBST(ITCLHDIR)
-])
-
-dnl Ok, lets find the itcl library
-dnl First, look for one uninstalled.
-dnl the alternative search directory is invoked by --with-itcllib
-AC_DEFUN([CYG_AC_PATH_ITCLLIB], [
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-if test x"${no_itcl}" = x ; then
- dnl we reset no_itcl incase something fails here
- no_itcl=true
- AC_ARG_WITH(itcllib,
- [ --with-itcllib directory where the itcl library is],
- with_itcllib=${withval})
- AC_MSG_CHECKING([for Itcl library])
- AC_CACHE_VAL(ac_cv_c_itcllib,[
- dnl First check to see if --with-itcllib was specified.
- if test x"${with_itcllib}" != x ; then
- if test -f "${with_itcllib}/libitcl$TCL_SHARED_LIB_SUFFIX" ; then
- ac_cv_c_itcllib=`(cd ${with_itcllib}; ${PWDCMD-pwd})`/libitcl$TCL_SHARED_LIB_SUFFIX
- else
- if test -f "${with_itcllib}/libitcl$TCL_UNSHARED_LIB_SUFFIX"; then
- ac_cv_c_itcllib=`(cd ${with_itcllib}; ${PWDCMD-pwd})`/libitcl$TCL_UNSHARED_LIB_SUFFIX
- fi
- fi
- fi
- dnl then check for a Itcl library. Since these are uninstalled,
- dnl use the simple lib name root.
- if test x"${ac_cv_c_itcllib}" = x ; then
- dnl find the top level Itcl build directory
- for i in $dirlist; do
- if test -n "`ls -dr $i/itcl* 2>/dev/null`" ; then
- itclpath=$i/itcl
- break
- fi
- done
- dnl Itcl 7.5 and greater puts library in subdir. Look there first.
- if test -f "$itclpath/src/libitcl.$TCL_SHLIB_SUFFIX" ; then
- ac_cv_c_itcllib=`(cd $itclpath/src; ${PWDCMD-pwd})`
- elif test -f "$itclpath/src/libitcl.a"; then
- ac_cv_c_itcllib=`(cd $itclpath/src; ${PWDCMD-pwd})`
- fi
- fi
- dnl check in a few other private locations
- if test x"${ac_cv_c_itcllib}" = x ; then
- for i in ${dirlist}; do
- if test -n "`ls -dr ${srcdir}/$i/itcl* 2>/dev/null`" ; then
- itclpath=${srcdir}/$i
- break
- fi
- done
- for i in `ls -dr ${itclpath}/itcl* 2>/dev/null` ; do
- dnl Itcl 7.5 and greater puts library in subdir. Look there first.
- if test -f "$i/src/libitcl$TCL_SHLIB_SUFFIX" ; then
- ac_cv_c_itcllib=`(cd $i/src; ${PWDCMD-pwd})`
- break
- elif test -f "$i/src/libitcl.a"; then
- ac_cv_c_itcllib=`(cd $i/src; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
-
- dnl see if one is conveniently installed with the compiler
- if test x"${ac_cv_c_itcllib}" = x ; then
- dnl Get the path to the compiler
- ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/lib
- dnl Itcl 7.5 and greater puts library in subdir. Look there first.
- if test -f "${ccpath}/libitcl$TCL_SHLIB_SUFFIX" ; then
- ac_cv_c_itcllib=`(cd ${ccpath}; ${PWDCMD-pwd})`
- elif test -f "${ccpath}/libitcl.a"; then
- ac_cv_c_itcllib=`(cd ${ccpath}; ${PWDCMD-pwd})`
- fi
- fi
- ])
- if test x"${ac_cv_c_itcllib}" = x ; then
- ITCLLIB=""
- AC_MSG_WARN(Can't find Itcl library)
- else
- ITCLLIB="-L${ac_cv_c_itcllib}"
- AC_MSG_RESULT(${ac_cv_c_itcllib})
- no_itcl=""
- fi
-fi
-
-AC_PROVIDE([$0])
-AC_SUBST(ITCLLIB)
-])
-
-
-dnl ====================================================================
-dnl Ok, lets find the itcl source trees so we can use the itcl_sh script
-dnl the alternative search directory is involked by --with-itclinclude
-AC_DEFUN([CYG_AC_PATH_ITCLSH], [
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-no_itcl=true
-AC_MSG_CHECKING(for the itcl_sh script)
-AC_ARG_WITH(itclinclude, [ --with-itclinclude directory where itcl headers are], with_itclinclude=${withval})
-AC_CACHE_VAL(ac_cv_c_itclsh,[
-dnl first check to see if --with-itclinclude was specified
-if test x"${with_itclinclude}" != x ; then
- if test -f ${with_itclinclude}/itcl_sh ; then
- ac_cv_c_itclsh=`(cd ${with_itclinclude}; ${PWDCMD-pwd})`
- elif test -f ${with_itclinclude}/src/itcl_sh ; then
- ac_cv_c_itclsh=`(cd ${with_itclinclude}/src; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_itclinclude} directory doesn't contain itcl_sh])
- fi
-fi
-
-dnl next check in private source directory
-dnl since ls returns lowest version numbers first, reverse its output
-if test x"${ac_cv_c_itclsh}" = x ; then
- dnl find the top level Itcl source directory
- for i in $dirlist; do
- if test -n "`ls -dr $srcdir/$i/itcl* 2>/dev/null`" ; then
- itclpath=$srcdir/$i
- break
- fi
- done
-
- dnl find the exact Itcl source dir. We do it this way, cause there
- dnl might be multiple version of Itcl, and we want the most recent one.
- for i in `ls -dr $itclpath/itcl* 2>/dev/null ` ; do
- if test -f $i/src/itcl_sh ; then
- ac_cv_c_itclsh=`(cd $i/src; ${PWDCMD-pwd})`/itcl_sh
- break
- fi
- done
-fi
-
-dnl see if one is installed
-if test x"${ac_cv_c_itclsh}" = x ; then
- AC_MSG_RESULT(none)
- AC_PATH_PROG(ac_cv_c_itclsh, itcl_sh)
-else
- AC_MSG_RESULT(${ac_cv_c_itclsh})
-fi
-])
-
-if test x"${ac_cv_c_itclsh}" = x ; then
- AC_MSG_ERROR([Can't find the itcl_sh script])
-fi
-if test x"${ac_cv_c_itclsh}" != x ; then
- no_itcl=""
- AC_MSG_RESULT(${ac_cv_c_itclsh})
- ITCLSH="${ac_cv_c_itclsh}"
-fi
-AC_SUBST(ITCLSH)
-])
-
-
-dnl ====================================================================
-dnl Ok, lets find the itcl source trees so we can use the itcl_sh script
-dnl the alternative search directory is involked by --with-itclinclude
-AC_DEFUN([CYG_AC_PATH_ITCLMKIDX], [
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-no_itcl=true
-AC_MSG_CHECKING(for itcl_mkindex.tcl script)
-AC_ARG_WITH(itclinclude, [ --with-itclinclude directory where itcl headers are], with_itclinclude=${withval})
-AC_CACHE_VAL(ac_cv_c_itclmkidx,[
-dnl first check to see if --with-itclinclude was specified
-if test x"${with_itclinclude}" != x ; then
- if test -f ${with_itclinclude}/itcl_sh ; then
- ac_cv_c_itclmkidx=`(cd ${with_itclinclude}; ${PWDCMD-pwd})`
- elif test -f ${with_itclinclude}/src/itcl_sh ; then
- ac_cv_c_itclmkidx=`(cd ${with_itclinclude}/src; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_itclinclude} directory doesn't contain itcl_sh])
- fi
-fi
-
-dnl next check in private source directory
-dnl since ls returns lowest version numbers first, reverse its output
-if test x"${ac_cv_c_itclmkidx}" = x ; then
- dnl find the top level Itcl source directory
- for i in $dirlist; do
- if test -n "`ls -dr $srcdir/$i/itcl* 2>/dev/null`" ; then
- itclpath=$srcdir/$i
- break
- fi
- done
-
- dnl find the exact Itcl source dir. We do it this way, cause there
- dnl might be multiple version of Itcl, and we want the most recent one.
- for i in `ls -dr $itclpath/itcl* 2>/dev/null ` ; do
- if test -f $i/library/itcl_mkindex.tcl ; then
- ac_cv_c_itclmkidx=`(cd $i/library; ${PWDCMD-pwd})`/itcl_mkindex.tcl
- break
- fi
- done
-fi
-if test x"${ac_cv_c_itclmkidx}" = x ; then
- dnl Get the path to the compiler
- ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/share
- dnl Itcl 7.5 and greater puts library in subdir. Look there first.
- for i in `ls -dr $ccpath/itcl* 2>/dev/null ` ; do
- if test -f $i/itcl_mkindex.tcl ; then
- ac_cv_c_itclmkidx=`(cd $i; ${PWDCMD-pwd})`/itcl_mkindex.tcl
- break
- fi
- done
-fi
-])
-
-if test x"${ac_cv_c_itclmkidx}" = x ; then
- AC_MSG_ERROR([Can't find the itcl_mkindex.tcl script])
-fi
-if test x"${ac_cv_c_itclmkidx}" != x ; then
- no_itcl=""
- AC_MSG_RESULT(${ac_cv_c_itclmkidx})
- ITCLMKIDX="${ac_cv_c_itclmkidx}"
-else
- AC_MSG_RESULT(none)
-fi
-AC_SUBST(ITCLMKIDX)
-])
-
-dnl ====================================================================
-dnl Ok, lets find the tix source trees so we can use the headers
-dnl the alternative search directory is involked by --with-tixinclude
-AC_DEFUN([CYG_AC_PATH_TIX], [
- CYG_AC_PATH_TIXH
- CYG_AC_PATH_TIXLIB
-])
-AC_DEFUN([CYG_AC_PATH_TIXH], [
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-no_tix=true
-AC_MSG_CHECKING(for Tix headers in the source tree)
-AC_ARG_WITH(tixinclude, [ --with-tixinclude directory where tix headers are], with_tixinclude=${withval})
-AC_CACHE_VAL(ac_cv_c_tixh,[
-dnl first check to see if --with-tixinclude was specified
-if test x"${with_tixinclude}" != x ; then
- if test -f ${with_tixinclude}/tix.h ; then
- ac_cv_c_tixh=`(cd ${with_tixinclude}; ${PWDCMD-pwd})`
- elif test -f ${with_tixinclude}/generic/tix.h ; then
- ac_cv_c_tixh=`(cd ${with_tixinclude}/generic; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_tixinclude} directory doesn't contain headers])
- fi
-fi
-
-dnl next check if it came with Tix configuration file
-if test x"${ac_cv_c_tixconfig}" != x ; then
- for i in $dirlist; do
- if test -f $ac_cv_c_tixconfig/$i/generic/tix.h ; then
- ac_cv_c_tixh=`(cd $ac_cv_c_tixconfig/$i/generic; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl next check in private source directory
-dnl since ls returns lowest version numbers first, reverse its output
-if test x"${ac_cv_c_tixh}" = x ; then
- dnl find the top level Tix source directory
- for i in $dirlist; do
- if test -n "`ls -dr $srcdir/$i/tix* 2>/dev/null`" ; then
- tixpath=$srcdir/$i
- break
- fi
- done
-
- dnl find the exact Tix source dir. We do it this way, cause there
- dnl might be multiple version of Tix, and we want the most recent one.
- for i in `ls -dr $tixpath/tix* 2>/dev/null ` ; do
- if test -f $i/generic/tix.h ; then
- ac_cv_c_tixh=`(cd $i/generic; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl see if one is installed
-if test x"${ac_cv_c_tixh}" = x ; then
- AC_MSG_RESULT(none)
- dnl Get the path to the compiler
-
- dnl Get the path to the compiler. We do it this way instead of using
- dnl AC_CHECK_HEADER, cause this doesn't depend in having X configured.
- ccpath=`which ${CC} | sed -e 's:/bin/.*::'`/include
- if test -f $ccpath/tix.h; then
- ac_cv_c_tixh=installed
- fi
-else
- AC_MSG_RESULT(${ac_cv_c_tixh})
-fi
-])
-if test x"${ac_cv_c_tixh}" = x ; then
- AC_MSG_ERROR([Can't find any Tix headers])
-fi
-if test x"${ac_cv_c_tixh}" != x ; then
- no_tix=""
- AC_MSG_RESULT(${ac_cv_c_tixh})
- if test x"${ac_cv_c_tixh}" != x"installed" ; then
- TIXHDIR="-I${ac_cv_c_tixh}"
- fi
-fi
-
-AC_SUBST(TIXHDIR)
-])
-
-AC_DEFUN([CYG_AC_PATH_TIXCONFIG], [
-#
-# Ok, lets find the tix configuration
-# First, look for one uninstalled.
-# the alternative search directory is invoked by --with-tixconfig
-#
-
-if test x"${no_tix}" = x ; then
- # we reset no_tix in case something fails here
- no_tix=true
- AC_ARG_WITH(tixconfig, [ --with-tixconfig directory containing tix configuration (tixConfig.sh)],
- with_tixconfig=${withval})
- AC_MSG_CHECKING([for Tix configuration])
- AC_CACHE_VAL(ac_cv_c_tixconfig,[
-
- # First check to see if --with-tixconfig was specified.
- if test x"${with_tixconfig}" != x ; then
- if test -f "${with_tixconfig}/tixConfig.sh" ; then
- ac_cv_c_tixconfig=`(cd ${with_tixconfig}; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_tixconfig} directory doesn't contain tixConfig.sh])
- fi
- fi
-
- # then check for a private Tix library
- if test x"${ac_cv_c_tixconfig}" = x ; then
- for i in \
- ../tix \
- `ls -dr ../tix[[4]]* 2>/dev/null` \
- ../../tix \
- `ls -dr ../../tix[[4]]* 2>/dev/null` \
- ../../../tix \
- `ls -dr ../../../tix[[4]]* 2>/dev/null` ; do
- if test -f "$i/tixConfig.sh" ; then
- ac_cv_c_tixconfig=`(cd $i; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- # check in a few common install locations
- if test x"${ac_cv_c_tixconfig}" = x ; then
- for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
- if test -f "$i/tixConfig.sh" ; then
- ac_cv_c_tkconfig=`(cd $i; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- # check in a few other private locations
- if test x"${ac_cv_c_tixconfig}" = x ; then
- for i in \
- ${srcdir}/../tix \
- `ls -dr ${srcdir}/../tix[[4-9]]* 2>/dev/null` ; do
- if test -f "$i/tixConfig.sh" ; then
- ac_cv_c_tixconfig=`(cd $i; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- ])
- if test x"${ac_cv_c_tixconfig}" = x ; then
- TIXCONFIG="# no Tix configs found"
- AC_MSG_WARN(Can't find Tix configuration definitions)
- else
- no_tix=
- TIXCONFIG=${ac_cv_c_tixconfig}/tixConfig.sh
- AC_MSG_RESULT(found $TIXCONFIG)
- fi
-fi
-
-])
-
-# Defined as a separate macro so we don't have to cache the values
-# from PATH_TIXCONFIG (because this can also be cached).
-AC_DEFUN([CYG_AC_LOAD_TIXCONFIG], [
- if test -f "$TIXCONFIG" ; then
- . $TIXCONFIG
- fi
-
- AC_SUBST(TIX_BUILD_LIB_SPEC)
- AC_SUBST(TIX_LIB_FULL_PATH)
-])
-
-AC_DEFUN([CYG_AC_PATH_ITCLCONFIG], [
-#
-# Ok, lets find the itcl configuration
-# First, look for one uninstalled.
-# the alternative search directory is invoked by --with-itclconfig
-#
-
-if test x"${no_itcl}" = x ; then
- # we reset no_itcl in case something fails here
- no_itcl=true
- AC_ARG_WITH(itclconfig, [ --with-itclconfig directory containing itcl configuration (itclConfig.sh)],
- with_itclconfig=${withval})
- AC_MSG_CHECKING([for Itcl configuration])
- AC_CACHE_VAL(ac_cv_c_itclconfig,[
-
- # First check to see if --with-itclconfig was specified.
- if test x"${with_itclconfig}" != x ; then
- if test -f "${with_itclconfig}/itclConfig.sh" ; then
- ac_cv_c_itclconfig=`(cd ${with_itclconfig}; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_itclconfig} directory doesn't contain itclConfig.sh])
- fi
- fi
-
- # then check for a private itcl library
- if test x"${ac_cv_c_itclconfig}" = x ; then
- for i in \
- ../itcl/itcl \
- `ls -dr ../itcl/itcl[[3]]* 2>/dev/null` \
- ../../itcl/itcl \
- `ls -dr ../../itcl/itcl[[3]]* 2>/dev/null` \
- ../../../itcl/itcl \
- `ls -dr ../../../itcl/itcl[[3]]* 2>/dev/null` ; do
- if test -f "$i/itclConfig.sh" ; then
- ac_cv_c_itclconfig=`(cd $i; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- # check in a few common install locations
- if test x"${ac_cv_c_itclconfig}" = x ; then
- for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
- if test -f "$i/itclConfig.sh" ; then
- ac_cv_c_itclconfig=`(cd $i; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- # check in a few other private locations
- if test x"${ac_cv_c_itclconfig}" = x ; then
- for i in \
- ${srcdir}/../itcl/itcl \
- `ls -dr ${srcdir}/../itcl/itcl[[3]]* 2>/dev/null` ; do
- if test -f "$i/itcl/itclConfig.sh" ; then
- ac_cv_c_itclconfig=`(cd $i; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- ])
- if test x"${ac_cv_c_itclconfig}" = x ; then
- ITCLCONFIG="# no itcl configs found"
- AC_MSG_WARN(Can't find itcl configuration definitions)
- else
- no_itcl=
- ITCLCONFIG=${ac_cv_c_itclconfig}/itclConfig.sh
- AC_MSG_RESULT(found $ITCLCONFIG)
- fi
-fi
-
-])
-
-# Defined as a separate macro so we don't have to cache the values
-# from PATH_ITCLCONFIG (because this can also be cached).
-AC_DEFUN([CYG_AC_LOAD_ITCLCONFIG], [
- if test -f "$ITCLCONFIG" ; then
- . $ITCLCONFIG
- fi
-
- AC_SUBST(ITCL_BUILD_LIB_SPEC)
- AC_SUBST(ITCL_SH)
- AC_SUBST(ITCL_LIB_FILE)
- AC_SUBST(ITCL_LIB_FULL_PATH)
-
-])
-
-
-AC_DEFUN([CYG_AC_PATH_ITKCONFIG], [
-#
-# Ok, lets find the itk configuration
-# First, look for one uninstalled.
-# the alternative search directory is invoked by --with-itkconfig
-#
-
-if test x"${no_itk}" = x ; then
- # we reset no_itk in case something fails here
- no_itk=true
- AC_ARG_WITH(itkconfig, [ --with-itkconfig directory containing itk configuration (itkConfig.sh)],
- with_itkconfig=${withval})
- AC_MSG_CHECKING([for Itk configuration])
- AC_CACHE_VAL(ac_cv_c_itkconfig,[
-
- # First check to see if --with-itkconfig was specified.
- if test x"${with_itkconfig}" != x ; then
- if test -f "${with_itkconfig}/itkConfig.sh" ; then
- ac_cv_c_itkconfig=`(cd ${with_itkconfig}; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_itkconfig} directory doesn't contain itkConfig.sh])
- fi
- fi
-
- # then check for a private itk library
- if test x"${ac_cv_c_itkconfig}" = x ; then
- for i in \
- ../itcl/itk \
- `ls -dr ../itcl/itk[[3]]* 2>/dev/null` \
- ../../itcl/itk \
- `ls -dr ../../itcl/itk[[3]]* 2>/dev/null` \
- ../../../itcl/itk \
- `ls -dr ../../../itcl/itk[[3]]* 2>/dev/null` ; do
- if test -f "$i/itkConfig.sh" ; then
- ac_cv_c_itkconfig=`(cd $i; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- # check in a few common install locations
- if test x"${ac_cv_c_itkconfig}" = x ; then
- for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
- if test -f "$i/itcl/itkConfig.sh" ; then
- ac_cv_c_itkconfig=`(cd $i; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- # check in a few other private locations
- if test x"${ac_cv_c_itkconfig}" = x ; then
- for i in \
- ${srcdir}/../itcl/itk \
- `ls -dr ${srcdir}/../itcl/itk[[3]]* 2>/dev/null` ; do
- if test -f "$i/itkConfig.sh" ; then
- ac_cv_c_itkconfig=`(cd $i; ${PWDCMD-pwd})`
- break
- fi
- done
- fi
- ])
- if test x"${ac_cv_c_itkconfig}" = x ; then
- ITCLCONFIG="# no itk configs found"
- AC_MSG_WARN(Can't find itk configuration definitions)
- else
- no_itk=
- ITKCONFIG=${ac_cv_c_itkconfig}/itkConfig.sh
- AC_MSG_RESULT(found $ITKCONFIG)
- fi
-fi
-
-])
-
-# Defined as a separate macro so we don't have to cache the values
-# from PATH_ITKCONFIG (because this can also be cached).
-AC_DEFUN([CYG_AC_LOAD_ITKCONFIG], [
- if test -f "$ITKCONFIG" ; then
- . $ITKCONFIG
- fi
-
- AC_SUBST(ITK_BUILD_LIB_SPEC)
- AC_SUBST(ITK_LIB_FILE)
- AC_SUBST(ITK_LIB_FULL_PATH)
-])
-
-
-dnl ====================================================================
-dnl Ok, lets find the libgui source trees so we can use the headers
-dnl the alternative search directory is involked by --with-libguiinclude
-AC_DEFUN([CYG_AC_PATH_LIBGUI], [
- CYG_AC_PATH_LIBGUIH
- CYG_AC_PATH_LIBGUILIB
-])
-AC_DEFUN([CYG_AC_PATH_LIBGUIH], [
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../..../../../../../../../../../../.."
-no_libgui=true
-AC_MSG_CHECKING(for Libgui headers in the source tree)
-AC_ARG_WITH(libguiinclude, [ --with-libguiinclude directory where libgui headers are], with_libguiinclude=${withval})
-AC_CACHE_VAL(ac_cv_c_libguih,[
-dnl first check to see if --with-libguiinclude was specified
-if test x"${with_libguiinclude}" != x ; then
- if test -f ${with_libguiinclude}/guitcl.h ; then
- ac_cv_c_libguih=`(cd ${with_libguiinclude}; ${PWDCMD-pwd})`
- elif test -f ${with_libguiinclude}/src/guitcl.h ; then
- ac_cv_c_libguih=`(cd ${with_libguiinclude}/src; ${PWDCMD-pwd})`
- else
- AC_MSG_ERROR([${with_libguiinclude} directory doesn't contain headers])
- fi
-fi
-
-dnl next check if it came with Libgui configuration file
-if test x"${ac_cv_c_libguiconfig}" != x ; then
- for i in $dirlist; do
- if test -f $ac_cv_c_libguiconfig/$i/src/guitcl.h ; then
- ac_cv_c_libguih=`(cd $ac_cv_c_libguiconfig/$i/src; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl next check in private source directory
-dnl since ls returns lowest version numbers first, reverse its output
-if test x"${ac_cv_c_libguih}" = x ; then
- dnl find the top level Libgui source directory
- for i in $dirlist; do
- if test -n "`ls -dr $srcdir/$i/libgui* 2>/dev/null`" ; then
- libguipath=$srcdir/$i
- break
- fi
- done
-
- dnl find the exact Libgui source dir. We do it this way, cause there
- dnl might be multiple version of Libgui, and we want the most recent one.
- for i in `ls -dr $libguipath/libgui* 2>/dev/null ` ; do
- if test -f $i/src/guitcl.h ; then
- ac_cv_c_libguih=`(cd $i/src; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-
-dnl see if one is installed
-if test x"${ac_cv_c_libguih}" = x ; then
- AC_MSG_RESULT(none)
- AC_CHECK_HEADER(guitcl.h, ac_cv_c_libguih=installed, ac_cv_c_libguih="")
-fi
-])
-LIBGUIHDIR=""
-if test x"${ac_cv_c_libguih}" = x ; then
- AC_MSG_WARN([Can't find any Libgui headers])
-fi
-if test x"${ac_cv_c_libguih}" != x ; then
- no_libgui=""
- if test x"${ac_cv_c_libguih}" != x"installed" ; then
- LIBGUIHDIR="-I${ac_cv_c_libguih}"
- fi
-fi
-AC_MSG_RESULT(${ac_cv_c_libguih})
-AC_SUBST(LIBGUIHDIR)
-])
-
-dnl ====================================================================
-dnl find the GUI library
-AC_DEFUN([CYG_AC_PATH_LIBGUILIB], [
-AC_MSG_CHECKING(for GUI library in the build tree)
-dirlist=".. ../../ ../../../ ../../../../ ../../../../../ ../../../../../../ ../../../../../../.. ../../../../../../../.. ../../../../../../../../.. ../../../../../../../../../.."
-dnl look for the library
-AC_MSG_CHECKING(for GUI library)
-AC_CACHE_VAL(ac_cv_c_libguilib,[
-if test x"${ac_cv_c_libguilib}" = x ; then
- for i in $dirlist; do
- if test -f "$i/libgui/src/Makefile" ; then
- ac_cv_c_libguilib=`(cd $i/libgui/src; ${PWDCMD-pwd})`
- break
- fi
- done
-fi
-])
-if test x"${ac_cv_c_libguilib}" != x ; then
- GUILIB="${GUILIB} -L${ac_cv_c_libguilib}"
- LIBGUILIB="-lgui"
- AC_MSG_RESULT(${ac_cv_c_libguilib})
-else
- AC_MSG_RESULT(none)
-fi
-
-AC_SUBST(GUILIB)
-AC_SUBST(LIBGUILIB)
-])
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-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/configure b/configure
index 1c190078943..59d190d3716 100755
--- a/configure
+++ b/configure
@@ -2198,7 +2198,7 @@ case "${target}" in
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
;;
powerpc-*-darwin* | i[3456789]86-*-darwin* | x86_64-*-darwin9*)
- noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
+ noconfigdirs="$noconfigdirs ld gas gdb gprof"
noconfigdirs="$noconfigdirs sim target-rda"
;;
*-*-darwin*)
@@ -2844,10 +2844,18 @@ fi
# without overflowing the jump tables (-J says to use a 32 bit table)
tentative_cc="cc -J"
;;
- *-hp-hpux*)
+ hppa*-hp-hpux10*)
tentative_cc="cc -Wp,-H256000"
+ host_makefile_frag="config/mh-pa-hpux10"
;;
- *-*-hiux*)
+ hppa*-hp-hpux* | hppa*-*-hiux*)
+ tentative_cc="cc -Wp,-H256000"
+ host_makefile_frag="config/mh-pa"
+ ;;
+ hppa*-*)
+ host_makefile_frag="config/mh-pa"
+ ;;
+ *-hp-hpux* | *-*-hiux*)
tentative_cc="cc -Wp,-H256000"
;;
rs6000-*-lynxos*)
@@ -5440,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 b7fb222298d..d4b962f0445 100644
--- a/configure.ac
+++ b/configure.ac
@@ -447,7 +447,7 @@ case "${target}" in
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
;;
powerpc-*-darwin* | i[[3456789]]86-*-darwin* | x86_64-*-darwin9*)
- noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
+ noconfigdirs="$noconfigdirs ld gas gdb gprof"
noconfigdirs="$noconfigdirs sim target-rda"
;;
*-*-darwin*)
@@ -1067,10 +1067,18 @@ case "${host}" in
# without overflowing the jump tables (-J says to use a 32 bit table)
tentative_cc="cc -J"
;;
- *-hp-hpux*)
+ hppa*-hp-hpux10*)
tentative_cc="cc -Wp,-H256000"
+ host_makefile_frag="config/mh-pa-hpux10"
;;
- *-*-hiux*)
+ hppa*-hp-hpux* | hppa*-*-hiux*)
+ tentative_cc="cc -Wp,-H256000"
+ host_makefile_frag="config/mh-pa"
+ ;;
+ hppa*-*)
+ host_makefile_frag="config/mh-pa"
+ ;;
+ *-hp-hpux* | *-*-hiux*)
tentative_cc="cc -Wp,-H256000"
;;
rs6000-*-lynxos*)
@@ -1896,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 a795a40c749..5b5c83353a3 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,4990 @@
+2008-08-29 Michael Meissner <gnu@the-meissners.org>
+
+ * dojump.c (top level): Include basic-block.h to declare
+ optimize_insn_for_speed_p
+
+ * Makefile.in (dodump.h): Add $(BASIC_BLOCK_H) dependency.
+
+ * opts.h (CL_SAVE): New option class for marking options that are
+ target specific options usable in the target attribute.
+ (CL_MIN_OPTION_CLASS): CL_SAVE is now the minimum option.
+
+ * opt-functions.awk (switch_flags): Add CL_SAVE flag so backends
+ can easily find the target specific options that are safe to use
+ in the attribute or pragma.
+
+ * attribs.c (decl_attributes): Change #pragma GCC option to
+ #pragma GCC target, and attribute((option(...))) to
+ attribute((target(...))).
+
+ * doc/extend.texi (target attribute): Change from option
+ attribute. Delete push/pop/reset.
+ (#pragma GCC target): Change from #pragma GCC option. Delete
+ push/pop/reset.
+ (#pragma GCC push_options): Document new pragma.
+ (#pragma GCC pop_options): Document new pragma.
+ (#pragma GCC reset_options): Document new pragma.
+
+ * targhooks.c (default_target_option_valid_attribute_p): Add
+ warning about port not supporting target attributes.
+ (default_target_option_pragma_parse): New function, warn about
+ #pragma GCC target not being supported.
+
+ * targhooks.h (default_target_option_pragma_parse): Add
+ declaration.
+
+ * tree.h (TI_CURRENT_TARGET_PRAGMA): Rename from
+ TI_CURRENT_OPTION_PRAGMA.
+ (current_target_pragma): Rename from current_option_pragma.
+
+ * target.h: (struct target_option): Delete booleans for changing
+ the optimization level on hot/cold functions. Change signature of
+ pragma_parse hook to take a second tree.
+
+ * c-tree.h (c_builtin_function_ext_scope): Add declaration.
+
+ * c-decl.c (c_builtin_function_ext_scope): New function, guarantee
+ that the declaration is done at global scope.
+
+ * langhooks.c (add_builtin_function_common): Move most of the code
+ from add_builtin_function here, calling the hook passed in.
+ (add_builtin_function): Call add_builtin_function_common with
+ standard builtin hook.
+ (add_builtin_function_ext_scope): New function to add builtins to
+ global scope.
+
+ * langhooks.h (struct lang_hooks): Add builtin_function_ext_scope
+ hook.
+ (add_builtin_function_ext_scope): Add declaration.
+
+ * c-pragma.c (handle_pragma_target): Rename from
+ handle_pragma_option, #pragma GCC option is now #pragma GCC
+ target. Move warning about port not supporting target options to
+ default pragma parse hook. Remove push/pop/reset from this
+ pragma.
+ (handle_pragma_optimize): Remove push/pop/reset from this pragma.
+ (option_stack): Delete static variable.
+ (optimize_stack): Ditto.
+ (optons_stack): New stack of saved target and optimization
+ options.
+ (handle_pragma_push_options): New function to handle pushing both
+ target and optimization options.
+ (handle_pragma_pop_options): New function to handle popping both
+ target and optimization options.
+ (handle_pragma_reset_options): New function to handle resetting
+ both target and optimization options to their initial state.
+ (init_pragma): Rename handle_pragma_option to
+ handle_pragma_target. Add support for push_options, pop_options,
+ and reset_options pragmas.
+
+ * target-def.h (TARGET_OPTION_PRAGMA_PARSE): Change default to
+ default_target_option_pragma_parse.
+ (TARGET_OPTION_VALID_ATTRIBUTE_P): Change default to
+ default_target_option_valid_attribute_p.
+ (TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION): Delete.
+ (TARGET_OPTION_HOT_ATTRIBUTE_SETS_OPTIMIZATION): Ditto.
+ (TARGET_OPTION_HOOKS): Delete the fields for whether to change
+ optimization level on hot/cold functions.
+
+ * tree-inline.c (tree_can_inline_p): Disable suppressing inlining
+ if the caller and callee have different optimization levels.
+
+ * c-common.c (handle_target_attribute): Rename from
+ handle_option_attribute, attribute((option(...))) is now
+ attribute((target(...))). Move warning if the port does not
+ support target attributes to the default hook.
+ (handle_hot_attribute): Delete code to change the optimization
+ level of hot functions.
+ (handle_cold_attribute): Ditto.
+
+ * config/i386/i386-c.c (ix86_pragma_target_parse): Take a second
+ argument that is the binary tree options to use if there are no
+ arguments. Call ix86_valid_target_attribute_tree instead of
+ ix86_valid_option_attribute_tree.
+ (ix86_pragma_target_parse): Rename from ix86_pragma_option_parse.
+ (ix86_register_pragmas): Use ix86_pragma_target_parse instead of
+ ix86_pragma_option_parse.
+
+ * config/i386/i386-protos.h (ix86_valid_target_attribute_tree):
+ Rename from ix86_valid_option_attribute_tree.
+
+ * config/i386/i386.c (ix86_add_new_builtins): New function to add
+ new builtins when the ISA changes.
+ (ix86_valid_target_attribute_tree): Rename from
+ ix86_valid_option_attribute_tree. Change callers. If the
+ function specified optimization options, use those as the starting
+ point before setting up the target attributes. If the
+ optimization options were changed in the course of setting the
+ target attributes, record the new optimization options.
+ (ix86_valid_target_attribute_tree_inner_p): Rename from
+ ix86_valid_option_attribute_tree_inner_p. Change callers. Call
+ ix86_add_new_builtins if the ISA changed.
+ (ix86_valid_target_attribute_p): Rename from
+ ix86_valid_option_attribute_p. Change callers.
+ (enum ix86_builtins): Add IX86_BUILTIN_PCMOV to allow both
+ __builtin_ia32_pcmov and __builtin_ia32_pcmov_v2di to be declared
+ as delayed builtin functions.
+ (struct builtin_isa): New structure to record builtin functions
+ that should be delayed until the ISA for that function is used.
+ (ix86_builtins_isa): Change from int to struct to track builtin
+ functions we want to declare at some point.
+ (def_builtin): If the front end can delay defining the builtin
+ functions, don't create builtins for ISAs not part of the default
+ options.
+ (def_builtin_const): Ditto.
+ (bdesc_multi_arg): Declare __builtin_ia32_pcmov and
+ __builtin_ia32_pcmov_v2di to be different builtin functions.
+ (ix86_expand_builtin): Changes due to ix86_builtins_isa now being
+ a structure instead of an int.
+ (TARGET_OPTION_VALID_ATTRIBUTE_P): Use
+ ix86_valid_target_attribute_p, not ix86_valid_option_attribute_p.
+ (TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION): Delete.
+ (TARGET_OPTION_HOT_ATTRIBUTE_SETS_OPTIMIZATION): Ditto.
+
+ * config/ia64/ia64.h
+ (TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION): Delete.
+ (TARGET_OPTION_HOT_ATTRIBUTE_SETS_OPTIMIZATION): Ditto.
+
+ * langhooks-def.h (LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE): New
+ hook, default to being the same as LANG_HOOKS_BUILTIN_FUNCTION.
+ (LANG_HOOKS_INITIALIZER): Add
+ LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE hook.
+
+2008-08-30 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ PR target/37270
+ * config/sh/sh.h (LEGITIMIZE_RELOAD_ADDRESS): Generate
+ the reload address with the index register for SFmode
+ access with a displacement.
+
+2008-08-30 Jan Hubicka <jh@suse.cz>
+
+ * optabs.c (expand_abs_nojump): Update BRANCH_COST call.
+ * fold-cost.c (LOGICAL_OP_NON_SHORT_CIRCUIT, fold_truthop): Likewise.
+ * dojump.c (do_jump): Likewise.
+ * ifcvt.c (MAX_CONDITIONAL_EXECUTE): Likewise.
+ (note-if_info): Add BRANCH_COST.
+ (noce_try_store_flag_constants, noce_try_addcc, noce_try_store_flag_mask,
+ noce_try_cmove_arith, noce_try_cmove_arith, noce_try_cmove_arith,
+ noce_find_if_block, find_if_case_1, find_if_case_2): Use compuated
+ branch cost.
+ * expr.h (BRANCH_COST): Update default.
+ * predict.c (predictable_edge_p): New function.
+ * expmed.c (expand_smod_pow2, expand_sdiv_pow2, emit_store_flag):
+ Update BRANCH_COST call.
+ * basic-block.h (predictable_edge_p): Declare.
+ * config/alpha/alpha.h (BRANCH_COST): Update.
+ * config/frv/frv.h (BRANCH_COST): Update.
+ * config/s390/s390.h (BRANCH_COST): Update.
+ * config/spu/spu.h (BRANCH_COST): Update.
+ * config/sparc/sparc.h (BRANCH_COST): Update.
+ * config/m32r/m32r.h (BRANCH_COST): Update.
+ * config/i386/i386.h (BRANCH_COST): Update.
+ * config/i386/i386.c (ix86_expand_int_movcc): Update use of BRANCH_COST.
+ * config/sh/sh.h (BRANCH_COST): Update.
+ * config/pdp11/pdp11.h (BRANCH_COST): Update.
+ * config/avr/avr.h (BRANCH_COST): Update.
+ * config/crx/crx.h (BRANCH_COST): Update.
+ * config/xtensa/xtensa.h (BRANCH_COST): Update.
+ * config/stormy16/stormy16.h (BRANCH_COST): Update.
+ * config/m68hc11/m68hc11.h (BRANCH_COST): Update.
+ * config/iq2000/iq2000.h (BRANCH_COST): Update.
+ * config/ia64/ia64.h (BRANCH_COST): Update.
+ * config/rs6000/rs6000.h (BRANCH_COST): Update.
+ * config/arc/arc.h (BRANCH_COST): Update.
+ * config/score/score.h (BRANCH_COST): Update.
+ * config/arm/arm.h (BRANCH_COST): Update.
+ * config/pa/pa.h (BRANCH_COST): Update.
+ * config/mips/mips.h (BRANCH_COST): Update.
+ * config/vax/vax.h (BRANCH_COST): Update.
+ * config/h8300/h8300.h (BRANCH_COST): Update.
+ * params.def (PARAM_PREDICTABLE_BRANCH_OUTCOME): New.
+ * doc/invoke.texi (predictable-branch-cost-outcome): Document.
+ * doc/tm.texi (BRANCH_COST): Update.
+
+2008-08-30 Samuel Tardieu <sam@rfc1149.net>
+
+ PR target/37283
+ * config/arm/arm.c (arm_optimization_options): Set
+ flag_section_anchors to 2 instead of 1 to distinguish it from
+ -fsection-anchors given explicitely on the command line.
+
+2008-08-30 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * recog.c (split_insn): Consider attaching a REG_EQUAL note to the
+ final insn of a split.
+
+2008-08-30 Jan Hubicka <jh@suse.cz>
+
+ * postreload-gcse.c (gate_handle_gcse2): Disable for functions
+ optimized for speed.
+ * final.c (compute_alignments): Use optimize_bb_for_size_p.
+ * tree-call-cdce.c (gate_call_cdce): Use optimize_function_for_speed_p.
+ * opts.c (flag_predictive_commoning_set, flag_unswitch_loops_set,
+ flag_gcse_after_reload_set): New static vars.
+ (common_handle_option): Enable those flags for profile-use.
+ (decode_options): Remove optimize_size flags that are handled
+ on higher granuality.
+ * tree-vectorizer.c (vectorize_loops): Use
+ optimize_loop_nest_for_speed_p.
+ * tree-ssa-pre.c (do_pre): Use optimize_function_for_speed_p.
+ * tree-predcom.c (tree_predictive_commoning): Use
+ optimize_loop_for_speed_p.
+ * varasm.c (assemble_start_function): Use optimize_function_for_speed_p.
+ * bb-reorder.c (rest_of_handle_reorder_blocks): Likewise.
+ * predict.c (optimize_loop_for_speed_p): Fix walk.
+
+2008-08-30 Jan Hubicka <jh@suse.cz>
+
+ * ipa-inline.c (cgraph_estimate_growth): Discover self recursive
+ functions.
+ (cgraph_decide_inlining_of_small_function): Use edge->count to detect
+ profile presence locally.
+
+2008-08-29 Joseph Myers <joseph@codesourcery.com>
+
+ PR bootstrap/37086
+ * tree-vrp.c (find_switch_asserts): Make idx volatile for GCC
+ versions before 4.0.
+
+2008-08-29 Jan Hubicka <jh@suse.cz>
+
+ * tree-inline.c (insert_init_stmt): Insert sequence even when
+ not in SSA form.
+
+2008-08-29 Jeff Law <law@redhat.com>
+
+ * mn10300.c (mn10300_secondary_reload_class): We need secondary
+ reloads for AM33-2 if IN is a pseudo with an equivalent memory
+ location and class is an FP register.
+
+2008-08-29 Jan Hubicka <jh@suse.cz>
+
+ * see.c (see_merge_one_def_extension): Silence used uninitialized
+ warning.
+ * matrix-reorg.c (check_allocation_function): Likewise.
+ * config/i386/driver-i386.c (detect_caches_amd): Likewise.
+
+2008-08-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/37261
+ * fold-const.c (fold_binary): In (X | C1) & C2 canonicalization
+ compute new & and | in type rather than TREE_TYPE (arg0).
+
+ * dwarf2out.c (fortran_common): Update comment.
+ (gen_variable_die): Swap com_die and var_die variables in Fortran
+ COMMON block handling code.
+
+ * dwarf2out.c (descr_info_loc): Handle VAR_DECL.
+
+ * dwarf2out.c (gen_const_die): New function.
+ (size_of_die, value_format, output_die): Output larger
+ dw_val_class_vec using DW_FORM_block2 or DW_FORM_block4.
+ (native_encode_initializer): New function.
+ (tree_add_const_value_attribute): Call it.
+ (gen_decl_die, dwarf2out_decl): Handle CONST_DECLs if is_fortran ().
+
+ * dwarf2out.c (gen_formal_parameter_die, gen_variable_die): For
+ DECL_BY_REFERENCE decls don't pass TREE_READONLY and
+ TREE_THIS_VOLATILE to add_type_attribute.
+
+ * dwarf2out.c (add_subscript_info): Stop on Fortran TYPE_STRING_FLAG
+ types.
+ (gen_array_type_die): Emit DW_TAG_string_type for Fortran character
+ types.
+
+ * dwarf2out.c (loc_by_reference): New function.
+ (add_location_or_const_value_attribute): Use it.
+
+ PR fortran/23057
+ * dwarf2out.c (gen_variable_die): Represent Fortran COMMON vars
+ as DW_TAG_variable children of DW_TAG_common_block rather than
+ DW_TAG_member children. Put DW_AT_external to individual
+ DW_TAG_variable DIEs, not to DW_TAG_common_block.
+
+ * dwarf2out.c (add_bound_info): If lookup_decl_die failed, try
+ loc_descriptor_from_tree_1.
+
+ PR fortran/29635
+ PR fortran/23057
+ * debug.h (struct gcc_debug_hooks): Add NAME and CHILD
+ arguments to imported_module_or_decl.
+ (debug_nothing_tree_tree): Removed.
+ (debug_nothing_tree_tree_tree_bool): New prototype.
+ * debug.c (do_nothing_debug_hooks): Adjust.
+ (debug_nothing_tree_tree): Removed.
+ (debug_nothing_tree_tree_tree_bool): New function.
+ * dwarf2out.c (is_symbol_die): Handle DW_TAG_module.
+ (gen_variable_die): Put all common vars for the
+ same COMMON block under one DW_TAG_common_block.
+ (declare_in_namespace): Return new context_die, for Fortran
+ return the module DIE instead of adding extra declarations into
+ the namespace.
+ (gen_type_die_with_usage): Adjust declare_in_namespace caller.
+ (gen_namespace_die): If is_fortran (), generate DW_TAG_module
+ instead of DW_TAG_namespace. If DECL_EXTERNAL is set, add
+ DW_AT_declaration.
+ (dwarf2out_global_decl): Don't skip Fortran global vars.
+ (gen_decl_die): Likewise. Adjust declare_in_namespace callers.
+ (dwarf2out_imported_module_or_decl): Add NAME and CHILD arguments.
+ If NAME is non-NULL, add DW_AT_name. If CHILD is non-NULL, put
+ DW_TAG_imported_declaration as child of previous
+ DW_TAG_imported_module.
+ * dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Adjust.
+ * sdbout.c (sdb_debug_hooks): Likewise.
+ * vmsdbgout.c (vmsdbg_debug_hooks): Likewise.
+
+2008-08-29 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c (cgraph_remove_node): Do not remove nested nodes.
+
+ * cgraph.h (cgraph_maybe_hot_edge_p): Declare.
+ * ipa-cp.c (n_cloning_candidates): New static variable.
+ (ipcp_print_profile_data, ipcp_function_scale_print): Forward declare.
+ (ipcp_print_all_lattices): Improve debug output.
+ (ipcp_cloning_candidate_p): New function.
+ (ipcp_initialize_node_lattices): Use it.
+ (ipcp_init_stage): Do only analyzis here; prettier debug output.
+ (ipcp_propagate_stage): Prettier debug output.
+ (ipcp_iterate_stage): Initialize latices here; prettier debug output.
+ (ipcp_print_all_structures): Remove.
+ (ipcp_need_redirect_p): Test !n_cloning_candidates.
+ (ipcp_insert_stage): Prettier debug output; call
+ cgraph_remove_unreachable_nodes before propagating.
+ (pass_ipa_cp): Schedule function removal pass.
+ * ipa-inline.c (inline_indirect_intraprocedural_analysis): Better
+ debug output.
+ (cgraph_maybe_hot_edge_p): Move to ...
+ * predict.c (cgraph_maybe_hot_edge_p) ... here.
+ * opts.c (flag_ipa_cp_set, flag_ipa_cp_clone_set): New.
+ (common_handle_option): Set them; enable ipa-cp when profiling.
+ * ipa-prop.c (ipa_print_node_jump_functions): Prettier output.
+ (ipa_print_all_jump_functions): Likewise.
+ (ipa_print_all_tree_maps, ipa_print_node_param_flags): Remove.
+ (ipa_print_node_params, ipa_print_all_params): New.
+ * ipa-prop.h (ipa_print_all_tree_maps, ipa_print_node_param_flags,
+ ipa_print_all_param_flags): Remove.
+ (ipa_print_node_params, ipa_print_all_params): New.
+
+2008-08-29 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.c (xtensa_secondary_reload_class): Revert
+ change from 2008-04-03.
+ * config/xtensa/xtensa.h (IRA_COVER_CLASSES): Define.
+
+2008-08-29 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-opt/37251
+
+ * ira-color.c (push_allocnos_to_stack): Truncate
+ removed_splay_allocno_vec.
+
+2008-08-29 Vladimir Makarov <vmakarov@redhat.com>
+
+ PR rtl-opt/37243
+ * ira-color (ira_fast_allocation): Don't assign hard registers to
+ global allocnos.
+
+2008-08-29 Jan Hubicka <jh@suse.cz>
+
+ PR middle-end/37278
+ * predict.c (optimize_loop_nest_for_speed_p): Do not ICE
+ for cold internal loops.
+
+2008-08-29 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-structalias.c (create_variable_info_for): Do not
+ create fields for heap vars or vars with a noalias state.
+ For NO_ALIAS_ANYTHING variables add a self-constraint, not one
+ from ESCAPED.
+
+2008-08-29 Richard Guenther <rguenther@suse.de>
+
+ * common.opt (ftree-store-ccp): Mark as preserved for
+ backward compatibility.
+ * doc/invoke.texi (-ftree-store-ccp): Remove documentation.
+ * tree-pass.h (pass_store_ccp): Remove.
+ * tree-ssa-propagate.h (struct prop_value_d): Remove mem_ref field.
+ (first_vdef): Remove declaration.
+ (get_value_loaded_by): Likewise.
+ * tree-ssa-ccp.c (do_store_ccp): Remove.
+ (get_default_value): Simplify as do_store_ccp is always false
+ now. Do not initialize mem_ref.
+ (set_value_varying): Likewise.
+ (canonicalize_float_value): Likewise.
+ (set_lattice_value): Likewise.
+ (likely_value): Likewise.
+ (surely_varying_stmt_p): Likewise.
+ (ccp_initialize): Likewise.
+ (ccp_lattice_meet): Likewise.
+ (ccp_visit_phi_node): Likewise.
+ (ccp_fold): Likewise.
+ (evaluate_stmt): Likewise.
+ (visit_assignment): Likewise.
+ (ccp_visit_stmt): Likewise.
+ (execute_ssa_ccp): Fold into ...
+ (do_ssa_ccp): ... this.
+ (do_ssa_store_ccp): Remove.
+ (gate_store_ccp): Likewise.
+ (pass_store_ccp): Likewise.
+ * tree-ssa-copy.c (copy_prop_visit_phi_node): Do not
+ initialize mem_ref.
+ * tree-ssa-propagate.c (first_vdef): Remove.
+ (get_value_loaded_by): Likewise.
+ (replace_vuses_in): Likewise.
+ (substitute_and_fold): Do not call replace_vuses_in.
+ * opts.c (decode_options): Do not set flag_tree_store_ccp.
+
+2008-08-29 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/37236
+ * tree-ssa-structalias.c (intra_create_variable_infos): Mark
+ PARAM_NOALIAS tags with is_heapvar.
+ * tree-ssa-operands.c (access_can_touch_variable): Offset
+ based tests do not apply for heapvars. Fix offset test.
+
+2008-08-29 Jan Hubicka <jh@suse.cz>
+
+ * doc/invoke.texi (-fipa-cp): Enabled by default at -O2/-Os/-O3
+ (-fipa-cp-clone): Enabled by default at -O3.
+ * opts.c (decode_options): Enable ipa-cp at -O2, ipa-cp-clone at -O3;
+ make ipa-cp-clone to imply ipa-cp; disable cloning at -Os.
+
+2008-08-29 Jan Hubicka <jh@suse.cz>
+
+ * tree.c (build_function_type_skip_args, build_function_decl_skip_args):
+ New functions.
+ * tree.h (build_function_type_skip_args, build_function_decl_skip_args):
+ Declare.
+ * gimple.c (giple_copy_call_skip_args): New function.
+ (giple_copy_call_skip_args): Declare.
+
+ * cgraph.h (cgraph_function_versioning): Add skip_args arugmnet
+ * ipa-cp.c (ipcp_node_not_modifiable_p): Rename to ...
+ (ipcp_node_modifiable_p): ... this one; use tree_versionable_function_p.
+ (ipcp_create_replace_map): Improve debug output.
+ (ipcp_need_redirect_p): Return false when not clonning.
+ (ipcp_update_callgraph): Skip args.
+ (ipcp_insert_stage): UPdate call of !ipcp_node_modifiable_p;
+ skip args.
+ * cgraphunit.c (cgraph_function_versioning): Add skip_args argument.
+ (save_inline_function_body): Update call of tree_function_versioning.
+ * ipa-prop.c (ipa_edge_removal_hook): Do not ICE on unanalyzed nodes.
+ * tree-inline.c (copy_arguments_for_versioning): Add skip_args argument.
+ (tree_function_versioning): Likewise.
+ * tree-inline.h (tree_function_versioning): Update prototype.
+
+2008-08-29 Jan Hubicka <jh@suse.cz>
+
+ * loop-unswitch.c (unswitch_single_loop): Use optimize_loop_for_speed_p.
+ * tree-ssa-threadupdate.c (mark_threaded_blocks): Use optimize_function_for_size_p.
+ * tracer.c (ignore_bb_p): Use optimize_bb_for_size_p.
+ * postreload-gcse.c (eliminate_partially_redundant_load): Use optimize_bb_for_size_p.
+ * value-prof.c (gimple_divmod_fixed_value_transform,
+ gimple_mod_pow2_value_transform, gimple_mod_subtract_transform,
+ gimple_stringops_transform): Use optimize_bb_for_size_p.
+ * ipa-cp.c (ipcp_insert_stage): Use optimize_function_for_size_p.
+ * final.c (compute_alignments): Use optimize_function_for_size_p.
+ * builtins.c (fold_builtin_cabs): Use optimize_function_for_speed_p.
+ (fold_builtin_strcpy, fold_builtin_fputs): Use
+ optimize_function_for_size_p.
+ * fold-const.c (tree_swap_operands_p): Use optimize_function_for_size_p.
+ * recog.c (relax_delay_slots): Likewise.
+ * tree-ssa-math-opts.c (replace_reciprocal): Use optimize_bb_for_speed_p.
+ (execute_cse_reciprocals): Use optimize_bb_for_size_p.
+ * ipa-inline.c (cgraph_decide_recursive_inlining): Use
+ optimize_function_for_size_p.
+ (cgraph_decide_inlining_of_small_function): Use
+ optimize_function_for_size_p.
+ * global.c (find_reg): Use optimize_function_for_size_p.
+ * opts.c (decode_options): Do not clear flag_tree_ch, flag_inline_functions,
+ flag_unswitch_loops, flag_unroll_loops, flag_unroll_all_loops and
+ flag_prefetch_loop_arrays. Those can work it out from profile.
+ * tree-ssa-loop-ivcanon.c (tree_unroll_loops_completely): Use
+ optimize_loop_for_speed_p.
+ * predict.c (optimize_bb_for_size_p, optimize_bb_for_speed_p): Constify
+ argument.
+ (optimize_loop_nest_for_size_p, optimize_loop_nest_for_speed_p): New.
+ * tree-parloops.c (parallelize_loops): Use optimize_loop_for_size_p.
+ * tree-eh.c (decide_copy_try_finally): Use optimize_function_for_size_p.
+ * local-alloc.c (block_alloc): Pass BB pointer.
+ (find_free_reg): Add BB pointer, use optimize_bb_for_size_p.
+ * gcse.c (gcse_main): Use optimize_function_for_size_p.
+ * loop-unroll.c (decide_unrolling_and_peeling): Use optimize_loop_for_size_p.
+ (decide_peel_completely): Likewise.
+ * tree-vect-analyze.c (vect_mark_for_runtime_alias_test): Use
+ optimize_loop_for_size_p.
+ (vect_enhance_data_refs_alignment): Likewise.
+ * tree-ssa-coalesce.c (coalesce_cost): Add optimize_for_size argument.
+ (coalesce_cost_bb, coalesce_cost_edge, create_outofssa_var_map): Update call.
+ * cfgcleanup.c (outgoing_edges_match): Use optimize_bb_for_speed_p.
+ (try_crossjump_bb): Use optimize_bb_for_size_p.
+ * tree-ssa-loop-prefetch.c (loop_prefetch_arrays): Use
+ optimize_loop_for_speed_p.
+ * bb-reorder.c (find_traces_1_round): Likewise.
+ (copy_bb): Use optimize_bb_for_speed_p.
+ (duplicate_computed_gotos): Likewise.
+ * basic-block.h (optimize_loop_nest_for_size_p,
+ optimize_loop_nest_for_speed_p): New.
+ * stmt.c (expand_case): Use optimize_insn_for_size_p.
+
+2008-08-29 Tristan Gingold <gingold@adacore.com>
+
+ * gcov.c (main): Call expandargv.
+
+2008-08-29 Jan Hubicka <jh@suse.cz>
+
+ * tree-ssa-loop-ch.c (should_duplicate_loop_header_p): Check that loop
+ is not cold.
+ * predict.c (optimize_bb_for_size_p, optimize_bb_for_speed_p):
+ Constify arguments.
+ (optimize_loop_for_size_p, optimize_loop_for_speed_p): New functions.
+ * basic-block.h (optimize_bb_for_size_p, optimize_bb_for_speed_p):
+ Constify.
+ (optimize_loop_for_size_p, optimize_loop_for_speed_p): Declare.
+
+2008-08-29 Jan Hubicka <jh@suse.cz>
+
+ * tree-pass.h (pass_strip_predict_hints): Declare.
+ * predict.c (strip_builtin_expect): Rename to ...
+ (strip_predict_hints): ... this one; strip also GIMPLE_PREDICT.
+ (tree_bb_level_predictions): Do not remove GIMPLE_PREDICT.
+ (tree_estimate_probability): Do not strip builtin_expect.
+ (pass_strip_predict_hints): New pass.
+ * tree-inline.c (expand_call_inline): When inlining cold function, predict
+ it as unlikely.
+ * passes.c (init_optimization_passes): Add pass_strip_predict_hints.
+
+2008-08-29 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37207
+ * tree-vrp.c (extract_range_from_binary_expr): Also try
+ to constant fold if only one of the operands is a constant.
+
+2008-08-29 Nick Clifton <nickc@redhat.com>
+
+ * config/m32r/m32r.h (LEGITIMATE_CONSTANT_P): Treat LABEL_REFs in
+ the same way as SYMBOL_REFs.
+
+2008-08-28 Bob Wilson <bob.wilson@acm.org>
+
+ * config/xtensa/xtensa.md (<u>mulsidi3): Use a temporary register.
+
+2008-08-28 Adam Nemet <anemet@caviumnetworks.com>
+
+ * config/mips/mips.h (ISA_HAS_BBIT): New macro.
+ * config/mips/mips.md (branch_likely): Remove const. Fix
+ comment formatting.
+ (define_delay for type "branch"): Change to only apply for branch
+ with likely variant.
+ (define_delay for type "branch" and "branch_likely" no). New delay
+ definition.
+ (equality_op): New code iterator.
+ (bbv, bbinv): New code attributes.
+ (*branch_bit<bbv><mode>, *branch_bit<bbv><mode>_inverted): New
+ patterns.
+
+2008-08-28 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+ Andrew Pinski <pinskia@gcc.gnu.org>
+
+ PR 18050
+ * c-common.c (verify_tree): Fix handling of ADDR_EXPR.
+
+2008-08-28 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * gtrh-posix.h: Fix uses of _POSIX_TIMEOUTS per the normal Posix
+ rule that a symbolic constant must be defined and >= 0 for the
+ corresponding facility to be present at compile-time.
+ * gthr-posix.c: Likewise.
+
+2008-08-28 Adam Nemet <anemet@caviumnetworks.com>
+
+ * config/mips/mips.h (ISA_HAS_DMUL3): New macro.
+ * config/mips/mips.md (D): New mode attribute.
+ (mulsi3, muldi3): Merge it into ...
+ (mul<mode>3): ... new template. Use _mul3 ending for 3-op
+ patterns.
+ (muldi3_mul3): New pattern.
+ (mulsi3_mult3): Rename to mulsi3_mul3.
+
+2008-08-28 Jan Hubicka <jh@suse.cz>
+
+ * expmed.c (store_bit_field_1): Be prepared for movstrict expander
+ to fail.
+ * predict.c (always_optimize_for_size_p): Rename to ...
+ (optimize_function_for_size): ... this one; make extern.
+ (optimize_function_for_speed_p): New.
+ (optimize_bb_for_size_p, optimize_bb_for_size_p,
+ optimize_edge_for_size_p,optimize_edge_for_size_p,
+ optimize_insn_for_size_p, optimize_insn_for_size_p): Update.
+ * basic-block.h (optimize_function_for_size_p,
+ optimize_function_for_speed_p): Declare.
+ * i386.md (optimize_size checks): Replace them by appropriate
+ predicate.
+ (standard_80387_constant_p, ix86_compute_frame_layout,
+ ix86_expand_epilogue, ix86_decompose_address,
+ print_operand, emit_i387_cw_initialization,
+ inline_memory_move_cost, ix86_pad_returns,
+ ix86_reorg): Replace optimize_size checks.
+
+2008-08-28 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * rtl.h (simplify_subreg_regno): Declare.
+ * rtlanal.c (simplify_subreg_regno): New function, split out from...
+ * simplify-rtx.c (simplify_subreg): ...here.
+ * reload.c (find_reloads): Use simplify_subreg_regno instead of
+ subreg_offset_representable_p.
+
+2008-08-28 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c/30949
+ * c-typeck.c (convert_for_assignment): Give a note describing what
+ was passed and what was expected.
+
+2008-08-28 Joey Ye <joey.ye@intel.com>
+
+ * doc/extend.texi: Document AVX built-in functions.
+ * doc/invoke.texi: Document -mavx.
+
+2008-08-28 H.J. Lu <hongjiu.lu@intel.com>
+ Joey Ye <joey.ye@intel.com>
+ Xuepeng Guo <xuepeng.guo@intel.com>
+
+ * config.gcc (extra_headers): Add gmmintrin.h for x86 and x86-64.
+
+ * config/i386/cpuid.h (bit_FMA): New.
+ (bit_XSAVE): Likewise.
+ (bit_OSXSAVE): Likewise.
+ (bit_AVX): Likewise.
+
+ * config/i386/gas.h (ASM_OUTPUT_OPCODE): Undefine before
+ define. Use ASM_OUTPUT_AVX_PREFIX.
+
+ * config/i386/gmmintrin.h: New.
+
+ * config/i386/i386.c (x86_64_reg_class): Add X86_64_AVX_CLASS.
+ (OPTION_MASK_ISA_AVX_SET): New.
+ (OPTION_MASK_ISA_FMA_SET): Likewise.
+ (OPTION_MASK_ISA_AVX_UNSET): Likewise.
+ (OPTION_MASK_ISA_FMA_SET): Likewise.
+ (OPTION_MASK_ISA_SSE4_2_UNSET): Updated.
+ (ix86_handle_option): Handle OPT_mavx and OPT_mfma.
+ (pta_flags): Add PTA_AVX and PTA_FMA.
+ (override_options): Handle PTA_AVX and PTA_FMA.
+ (init_cumulative_args): Handle warn_avx.
+ (classify_argument): Return 0 for COImode and OImode. Return
+ 1 and X86_64_AVX_CLASS for 256bit vector types.
+ (examine_argument): Handle X86_64_AVX_CLASS.
+ (construct_container): Likewise.
+ (function_arg_advance_32): Pass OImode and 256bit vector types
+ in AVX register.
+ (function_arg_advance_64): Take a new argument to indicate if a
+ parameter is named. Handle 256bit vector types. Return
+ immediately for unnamed 256bit vector mode parameters.
+ (function_arg_advance): Updated.
+ (function_arg_32): Add comments for TImode. Handle OImode
+ and 256bit vector types.
+ (function_arg_64): Take a new argument to indicate if a
+ parameter is named. Handle 256bit vector types. Return NULL
+ for unnamed 256bit vector mode parameters.
+ (function_arg): Updated.
+ (setup_incoming_varargs_64): Support
+ AVX encoding for *sse_prologue_save_insn.
+ (ix86_gimplify_va_arg): Handle 256bit vector mode parameters.
+ (standard_sse_constant_p): Return -2 for all 1s if SSE2 isn't
+ enabled. For all 1s in 256bit vector modes, return 3 if AVX is
+ enabled, otherwise return -3.
+ (standard_sse_constant_opcode): Handle AVX and 256bit vector
+ modes.
+ (print_reg): Support AVX registers. Handle 'x' and 't'.
+ Handle 'd' to duplicate the operand.
+ (print_operand): Likewise. Also support AVX vector compare
+ instructions.
+ (output_387_binary_op): Support AVX.
+ (output_fp_compare): Likewise.
+ (ix86_expand_vector_move_misalign): Likewise.
+ (ix86_attr_length_vex_default): New.
+ (ix86_builtins): Add IX86_BUILTIN_ADDPD256,
+ IX86_BUILTIN_ADDPS256, IX86_BUILTIN_ADDSUBPD256,
+ IX86_BUILTIN_ADDSUBPS256, IX86_BUILTIN_ANDPD256,
+ IX86_BUILTIN_ANDPS256, IX86_BUILTIN_ANDNPD256,
+ IX86_BUILTIN_ANDNPS256, IX86_BUILTIN_BLENDPD256,
+ IX86_BUILTIN_BLENDPS256, IX86_BUILTIN_BLENDVPD256,
+ IX86_BUILTIN_BLENDVPS256, IX86_BUILTIN_DIVPD256,
+ IX86_BUILTIN_DIVPS256, IX86_BUILTIN_DPPS256,
+ IX86_BUILTIN_HADDPD256, IX86_BUILTIN_HADDPS256,
+ IX86_BUILTIN_HSUBPD256, IX86_BUILTIN_HSUBPS256,
+ IX86_BUILTIN_MAXPD256, IX86_BUILTIN_MAXPS256,
+ IX86_BUILTIN_MINPD256, IX86_BUILTIN_MINPS256,
+ IX86_BUILTIN_MULPD256, IX86_BUILTIN_MULPS256,
+ IX86_BUILTIN_ORPD256, IX86_BUILTIN_ORPS256,
+ IX86_BUILTIN_SHUFPD256, IX86_BUILTIN_SHUFPS256,
+ IX86_BUILTIN_SUBPD256, IX86_BUILTIN_SUBPS256,
+ IX86_BUILTIN_XORPD256, IX86_BUILTIN_XORPS256,
+ IX86_BUILTIN_CMPSD, IX86_BUILTIN_CMPSS, IX86_BUILTIN_CMPPD,
+ IX86_BUILTIN_CMPPS, IX86_BUILTIN_CMPPD256,
+ IX86_BUILTIN_CMPPS256, IX86_BUILTIN_CVTDQ2PD256,
+ IX86_BUILTIN_CVTDQ2PS256, IX86_BUILTIN_CVTPD2PS256,
+ IX86_BUILTIN_CVTPS2DQ256, IX86_BUILTIN_CVTPS2PD256,
+ IX86_BUILTIN_CVTTPD2DQ256, IX86_BUILTIN_CVTPD2DQ256,
+ IX86_BUILTIN_CVTTPS2DQ256, IX86_BUILTIN_EXTRACTF128PD256,
+ IX86_BUILTIN_EXTRACTF128PS256, IX86_BUILTIN_EXTRACTF128SI256,
+ IX86_BUILTIN_VZEROALL, IX86_BUILTIN_VZEROUPPER,
+ IX86_BUILTIN_VZEROUPPER_REX64, IX86_BUILTIN_VPERMILVARPD,
+ IX86_BUILTIN_VPERMILVARPS, IX86_BUILTIN_VPERMILVARPD256,
+ IX86_BUILTIN_VPERMILVARPS256, IX86_BUILTIN_VPERMILPD,
+ IX86_BUILTIN_VPERMILPS, IX86_BUILTIN_VPERMILPD256,
+ IX86_BUILTIN_VPERMILPS256, IX86_BUILTIN_VPERMIL2PD,
+ IX86_BUILTIN_VPERMIL2PS, IX86_BUILTIN_VPERMIL2PD256,
+ IX86_BUILTIN_VPERMIL2PS256, IX86_BUILTIN_VPERM2F128PD256,
+ IX86_BUILTIN_VPERM2F128PS256, IX86_BUILTIN_VPERM2F128SI256,
+ IX86_BUILTIN_VBROADCASTSS, IX86_BUILTIN_VBROADCASTSD256,
+ IX86_BUILTIN_VBROADCASTSS256, IX86_BUILTIN_VBROADCASTPD256,
+ IX86_BUILTIN_VBROADCASTPS256, IX86_BUILTIN_VINSERTF128PD256,
+ IX86_BUILTIN_VINSERTF128PS256, IX86_BUILTIN_VINSERTF128SI256,
+ IX86_BUILTIN_LOADUPD256, IX86_BUILTIN_LOADUPS256,
+ IX86_BUILTIN_STOREUPD256, IX86_BUILTIN_STOREUPS256,
+ IX86_BUILTIN_LDDQU256, IX86_BUILTIN_LOADDQU256,
+ IX86_BUILTIN_STOREDQU256, IX86_BUILTIN_MASKLOADPD,
+ IX86_BUILTIN_MASKLOADPS, IX86_BUILTIN_MASKSTOREPD,
+ IX86_BUILTIN_MASKSTOREPS, IX86_BUILTIN_MASKLOADPD256,
+ IX86_BUILTIN_MASKLOADPS256, IX86_BUILTIN_MASKSTOREPD256,
+ IX86_BUILTIN_MASKSTOREPS256, IX86_BUILTIN_MOVSHDUP256,
+ IX86_BUILTIN_MOVSLDUP256, IX86_BUILTIN_MOVDDUP256,
+ IX86_BUILTIN_SQRTPD256, IX86_BUILTIN_SQRTPS256,
+ IX86_BUILTIN_SQRTPS_NR256, IX86_BUILTIN_RSQRTPS256,
+ IX86_BUILTIN_RSQRTPS_NR256, IX86_BUILTIN_RCPPS256,
+ IX86_BUILTIN_ROUNDPD256, IX86_BUILTIN_ROUNDPS256,
+ IX86_BUILTIN_UNPCKHPD256, IX86_BUILTIN_UNPCKLPD256,
+ IX86_BUILTIN_UNPCKHPS256, IX86_BUILTIN_UNPCKLPS256,
+ IX86_BUILTIN_SI256_SI, IX86_BUILTIN_PS256_PS,
+ IX86_BUILTIN_PD256_PD, IX86_BUILTIN_SI_SI256,
+ IX86_BUILTIN_PS_PS256, IX86_BUILTIN_PD_PD256,
+ IX86_BUILTIN_VTESTZPD, IX86_BUILTIN_VTESTCPD,
+ IX86_BUILTIN_VTESTNZCPD, IX86_BUILTIN_VTESTZPS,
+ IX86_BUILTIN_VTESTCPS, IX86_BUILTIN_VTESTNZCPS,
+ IX86_BUILTIN_VTESTZPD256, IX86_BUILTIN_VTESTCPD256,
+ IX86_BUILTIN_VTESTNZCPD256, IX86_BUILTIN_VTESTZPS256,
+ IX86_BUILTIN_VTESTCPS256, IX86_BUILTIN_VTESTNZCPS256,
+ IX86_BUILTIN_PTESTZ256, IX86_BUILTIN_PTESTC256,
+ IX86_BUILTIN_PTESTNZC256, IX86_BUILTIN_MOVMSKPD256
+ and IX86_BUILTIN_MOVMSKPS256,
+ (ix86_special_builtin_type): Add V32QI_FTYPE_PCCHAR,
+ V8SF_FTYPE_PCV4SF, V8SF_FTYPE_PCFLOAT, V4DF_FTYPE_PCV2DF,
+ V4DF_FTYPE_PCDOUBLE, V8SF_FTYPE_PCV8SF_V8SF,
+ V4DF_FTYPE_PCV4DF_V4DF, V4SF_FTYPE_PCV4SF_V4SF,
+ V2DF_FTYPE_PCV2DF_V2DF, VOID_FTYPE_PCHAR_V32QI,
+ VOID_FTYPE_PFLOAT_V8SF, VOID_FTYPE_PDOUBLE_V4DF,
+ VOID_FTYPE_PV8SF_V8SF_V8SF, VOID_FTYPE_PV4DF_V4DF_V4DF,
+ VOID_FTYPE_PV4SF_V4SF_V4SF and VOID_FTYPE_PV2DF_V2DF_V2DF,
+ (ix86_builtin_type): Add INT_FTYPE_V8SF_V8SF_PTEST,
+ INT_FTYPE_V4DI_V4DI_PTEST, INT_FTYPE_V4DF_V4DF_PTEST,
+ INT_FTYPE_V4SF_V4SF_PTEST, INT_FTYPE_V2DF_V2DF_PTEST,
+ INT_FTYPE_V8SF, INT_FTYPE_V4DF, V8SI_FTYPE_V8SF, V8SI_FTYPE_V4SI,
+ V8SF_FTYPE_V8SF, V8SF_FTYPE_V8SI, V8SF_FTYPE_V4SF,
+ V4SI_FTYPE_V8SI, V4SI_FTYPE_V4DF, V4DF_FTYPE_V4DF,
+ V4DF_FTYPE_V4SI, V4DF_FTYPE_V4SF, V4DF_FTYPE_V2DF,
+ V4SF_FTYPE_V4DF, V4SF_FTYPE_V8SF, V2DF_FTYPE_V4DF,
+ V8SF_FTYPE_V8SF_V8SF, V8SF_FTYPE_V8SF_V8SI,
+ V4DF_FTYPE_V4DF_V4DF, V4DF_FTYPE_V4DF_V4DI,
+ V4SF_FTYPE_V4SF_V4SI, V2DF_FTYPE_V2DF_V2DI,
+ V8SF_FTYPE_V8SF_INT, V4SI_FTYPE_V8SI_INT, V4SF_FTYPE_V8SF_INT,
+ V2DF_FTYPE_V4DF_INT, V4DF_FTYPE_V4DF_INT,
+ V8SF_FTYPE_V8SF_V8SF_V8SF, V4DF_FTYPE_V4DF_V4DF_V4DF,
+ V8SI_FTYPE_V8SI_V8SI_INT, V8SF_FTYPE_V8SF_V8SF_INT,
+ V4DF_FTYPE_V4DF_V4DF_INT, V4DF_FTYPE_V4DF_V2DF_INT,
+ V8SF_FTYPE_V8SF_V8SF_V8SI_INT, V4DF_FTYPE_V4DF_V4DF_V4DI_INT,
+ V4SF_FTYPE_V4SF_V4SF_V4SI_INT and V2DF_FTYPE_V2DF_V2DF_V2DI_INT.
+ (bdesc_special_args): Add IX86_BUILTIN_VZEROALL,
+ IX86_BUILTIN_VZEROUPPER. IX86_BUILTIN_VZEROUPPER_REX64,
+ IX86_BUILTIN_VBROADCASTSS, IX86_BUILTIN_VBROADCASTSD256,
+ IX86_BUILTIN_VBROADCASTSS256, IX86_BUILTIN_VBROADCASTPD256,
+ IX86_BUILTIN_VBROADCASTPS256, IX86_BUILTIN_LOADUPD256,
+ IX86_BUILTIN_LOADUPS256, IX86_BUILTIN_STOREUPD256,
+ IX86_BUILTIN_STOREUPS256, IX86_BUILTIN_LOADDQU256,
+ IX86_BUILTIN_STOREDQU256, IX86_BUILTIN_LDDQU256,
+ IX86_BUILTIN_MASKLOADPD, IX86_BUILTIN_MASKLOADPS,
+ IX86_BUILTIN_MASKLOADPD256, IX86_BUILTIN_MASKLOADPS256,
+ IX86_BUILTIN_MASKSTOREPD, IX86_BUILTIN_MASKSTOREPS,
+ IX86_BUILTIN_MASKSTOREPD256 and IX86_BUILTIN_MASKSTOREPS256.
+ (ix86_builtins): Add IX86_BUILTIN_ADDPD256,
+ IX86_BUILTIN_ADDPS256, IX86_BUILTIN_ADDSUBPD256,
+ IX86_BUILTIN_ADDSUBPS256, IX86_BUILTIN_ANDPD256,
+ IX86_BUILTIN_ANDPS256, IX86_BUILTIN_ANDNPD256,
+ IX86_BUILTIN_ANDNPS256, IX86_BUILTIN_DIVPD256,
+ IX86_BUILTIN_DIVPS256, IX86_BUILTIN_HADDPD256,
+ IX86_BUILTIN_HSUBPS256, IX86_BUILTIN_HSUBPD256,
+ IX86_BUILTIN_HADDPS256, IX86_BUILTIN_MAXPD256,
+ IX86_BUILTIN_MAXPS256, IX86_BUILTIN_MINPD256,
+ IX86_BUILTIN_MINPS256, IX86_BUILTIN_MULPD256,
+ IX86_BUILTIN_MULPS256, IX86_BUILTIN_ORPD256,
+ IX86_BUILTIN_ORPS256, IX86_BUILTIN_SUBPD256,
+ IX86_BUILTIN_SUBPS256, IX86_BUILTIN_XORPD256,
+ IX86_BUILTIN_XORPS256, IX86_BUILTIN_VPERMILVARPD,
+ IX86_BUILTIN_VPERMILVARPS, IX86_BUILTIN_VPERMILVARPD256,
+ IX86_BUILTIN_VPERMILVARPS256, IX86_BUILTIN_BLENDPD256,
+ IX86_BUILTIN_BLENDPS256, IX86_BUILTIN_BLENDVPD256,
+ IX86_BUILTIN_BLENDVPS256, IX86_BUILTIN_DPPS256,
+ IX86_BUILTIN_SHUFPD256, IX86_BUILTIN_SHUFPS256,
+ IX86_BUILTIN_CMPSD, IX86_BUILTIN_CMPSS, IX86_BUILTIN_CMPPD,
+ IX86_BUILTIN_CMPPS,
+ IX86_BUILTIN_CMPPD256,IX86_BUILTIN_CMPPS256,
+ IX86_BUILTIN_EXTRACTF128PD256, IX86_BUILTIN_EXTRACTF128PS256,
+ IX86_BUILTIN_EXTRACTF128SI256, IX86_BUILTIN_CVTDQ2PD256,
+ IX86_BUILTIN_CVTDQ2PS256, IX86_BUILTIN_CVTPD2PS256,
+ IX86_BUILTIN_CVTPS2DQ256, IX86_BUILTIN_CVTPS2PD256,
+ IX86_BUILTIN_CVTTPD2DQ256, IX86_BUILTIN_CVTPD2DQ256,
+ IX86_BUILTIN_CVTTPS2DQ256, IX86_BUILTIN_VPERM2F128PD256,
+ IX86_BUILTIN_VPERM2F128PS256, IX86_BUILTIN_VPERM2F128SI256,
+ IX86_BUILTIN_VPERMILPD, IX86_BUILTIN_VPERMILPS,
+ IX86_BUILTIN_VPERMILPD256, IX86_BUILTIN_VPERMILPS256,
+ IX86_BUILTIN_VPERMIL2PD, IX86_BUILTIN_VPERMILPS,
+ IX86_BUILTIN_VPERMILPD256, IX86_BUILTIN_VPERMILPS256,
+ IX86_BUILTIN_VPERMIL2PD, IX86_BUILTIN_VPERMIL2PS,
+ IX86_BUILTIN_VPERMIL2PD256, IX86_BUILTIN_VPERMIL2PS256,
+ IX86_BUILTIN_VINSERTF128PD256, IX86_BUILTIN_VINSERTF128PS256,
+ IX86_BUILTIN_VINSERTF128SI256, IX86_BUILTIN_MOVSHDUP256,
+ IX86_BUILTIN_MOVSLDUP256, IX86_BUILTIN_MOVDDUP256,
+ IX86_BUILTIN_SQRTPD256, IX86_BUILTIN_SQRTPS256,
+ IX86_BUILTIN_SQRTPS_NR256, IX86_BUILTIN_RSQRTPS256,
+ IX86_BUILTIN_RSQRTPS_NR256, IX86_BUILTIN_RCPPS256,
+ IX86_BUILTIN_ROUNDPD256, IX86_BUILTIN_ROUNDPS256,
+ IX86_BUILTIN_UNPCKHPD256, IX86_BUILTIN_UNPCKLPD256,
+ IX86_BUILTIN_UNPCKHPS256, IX86_BUILTIN_UNPCKLPS256,
+ IX86_BUILTIN_SI256_SI, IX86_BUILTIN_PS256_PS,
+ IX86_BUILTIN_PD256_PD, IX86_BUILTIN_SI_SI256,
+ IX86_BUILTIN_PS_PS256, IX86_BUILTIN_PD_PD256,
+ IX86_BUILTIN_VTESTZPD, IX86_BUILTIN_VTESTCPD,
+ IX86_BUILTIN_VTESTNZCPD, IX86_BUILTIN_VTESTZPS,
+ IX86_BUILTIN_VTESTCPS, IX86_BUILTIN_VTESTNZCPS,
+ IX86_BUILTIN_VTESTZPD256, IX86_BUILTIN_VTESTCPD256,
+ IX86_BUILTIN_VTESTNZCPD256, IX86_BUILTIN_VTESTZPS256,
+ IX86_BUILTIN_VTESTCPS256, IX86_BUILTIN_VTESTNZCPS256,
+ IX86_BUILTIN_PTESTZ256, IX86_BUILTIN_PTESTC256,
+ IX86_BUILTIN_PTESTNZC256, IX86_BUILTIN_MOVMSKPD256 and
+ IX86_BUILTIN_MOVMSKPS256.
+ (ix86_init_mmx_sse_builtins): Support AVX builtins.
+ (ix86_expand_args_builtin): Likewise.
+ (ix86_expand_special_args_builtin): Likewise.
+ (ix86_hard_regno_mode_ok): Handle AVX modes.
+ (ix86_expand_vector_init_duplicate): Likewise.
+ (ix86_expand_vector_init_one_nonzero): Likewise.
+ (ix86_expand_vector_init_one_var): Likewise.
+ (ix86_expand_vector_init_concat): Likewise.
+ (ix86_expand_vector_init_general): Likewise.
+ (ix86_expand_vector_set): Likewise.
+ (ix86_vector_mode_supported_p): Likewise.
+ (x86_extended_reg_mentioned_p): Check INSN_P before using
+ PATTERN.
+
+ * config/i386/i386-c.c (ix86_target_macros_internal): Handle
+ OPTION_MASK_ISA_AVX and OPTION_MASK_ISA_FMA.
+
+ * config/i386/i386.h (TARGET_AVX): New.
+ (TARGET_FMA): Likewise.
+ (TARGET_CPU_CPP_BUILTINS): Handle TARGET_AVX and TARGET_FMA.
+ (BIGGEST_ALIGNMENT): Set to 256 for TARGET_AVX.
+ (VALID_AVX256_REG_MODE): New.
+ (AVX256_VEC_FLOAT_MODE_P): Likewise.
+ (AVX_FLOAT_MODE_P): Likewise.
+ (AVX128_VEC_FLOAT_MODE_P): Likewise.
+ (AVX256_VEC_FLOAT_MODE_P): Likewise.
+ (AVX_VEC_FLOAT_MODE_P): Likewise.
+ (ASM_OUTPUT_AVX_PREFIX): Likewise.
+ (ASM_OUTPUT_OPCODE): Likewise.
+ (UNITS_PER_SIMD_WORD): Add a FIXME for 32byte vectorizer
+ support.
+ (SSE_REG_MODE_P): Allow 256bit vector modes.
+ (ix86_args): Add a warn_avx field.
+
+ * config/i386/i386.md (UNSPEC_PCMP): New.
+ (UNSPEC_VPERMIL): Likewise.
+ (UNSPEC_VPERMIL2): Likewise.
+ (UNSPEC_VPERMIL2F128): Likewise.
+ (UNSPEC_MASKLOAD): Likewise.
+ (UNSPEC_MASKSTORE): Likewise.
+ (UNSPEC_CAST): Likewise.
+ (UNSPEC_VTESTP): Likewise.
+ (UNSPECV_VZEROALL): Likewise.
+ (UNSPECV_VZEROUPPER): Likewise.
+ (XMM0_REG): Likewise.
+ (XMM1_REG): Likewise.
+ (XMM2_REG): Likewise.
+ (XMM3_REG): Likewise.
+ (XMM4_REG): Likewise.
+ (XMM5_REG): Likewise.
+ (XMM6_REG): Likewise.
+ (XMM8_REG): Likewise.
+ (XMM9_REG): Likewise.
+ (XMM10_REG): Likewise.
+ (XMM11_REG): Likewise.
+ (XMM12_REG): Likewise.
+ (XMM13_REG): Likewise.
+ (XMM14_REG): Likewise.
+ (XMM15_REG): Likewise.
+ (prefix): Likewise.
+ (prefix_vex_imm8): Likewise.
+ (prefix_vex_w): Likewise.
+ (length_vex): Likewise.
+ (maxmin): Likewise.
+ (movoi): Likewise.
+ (*avx_ashlti3): Likewise.
+ (*avx_lshrti3): Likewise.
+ (*avx_setcc<mode>): Likewise.
+ (*fop_<mode>_comm_mixed_avx): Likewise.
+ (*fop_<mode>_comm_avx): Likewise.
+ (*fop_<mode>_1_mixed_avx): Likewise.
+ (*fop_<mode>_1_avx): Likewise.
+ (*avx_<code><mode>3): Likewise.
+ (*avx_ieee_smin<mode>3): Likewise.
+ (*avx_ieee_smax<mode>3): Likewise.
+ (mode): Add OI, V8SF and V4DF.
+ (length): Support VEX prefix.
+ (*cmpfp_i_mixed): Set prefix attribute.
+ (*cmpfp_i_sse): Likewise.
+ (*cmpfp_iu_mixed): Likewise.
+ (*cmpfp_iu_sse): Likewise.
+ (*movsi_1): Support AVX.
+ (*movdi_2): Likewise.
+ (*movdi_1_rex64): Likewise.
+ (*movti_internal): Likewise.
+ (*movti_rex64): Likewise.
+ (*movsf_1): Likewise.
+ (*movdf_nointeger): Likewise.
+ (*movdf_integer_rex64): Likewise.
+ (*movtf_internal): Likewise.
+ (zero_extendsidi2_32): Likewise.
+ (zero_extendsidi2_rex64): Likewise.
+ (*extendsfdf2_mixed): Likewise.
+ (*extendsfdf2_sse): Likewise.
+ (*truncdfsf_fast_mixed): Likewise.
+ (*truncdfsf_fast_sse): Likewise.
+ (*truncdfsf_mixed): Likewise.
+ (fix_trunc<mode>di_sse): Likewise.
+ (fix_trunc<mode>si_sse): Likewise.
+ (*float<SSEMODEI24:mode><MODEF:mode>2_mixed_interunit): Likewise.
+ (*float<SSEMODEI24:mode><MODEF:mode>2_mixed_nointerunit): Likewise.
+ (*float<SSEMODEI24:mode><MODEF:mode>2_sse_interunit): Likewise.
+ (*float<SSEMODEI24:mode><MODEF:mode>2_sse_nointerunit): Likewise.
+ (*rcpsf2_sse): Likewise.
+ (*rsqrtsf2_sse): Likewise.
+ (*sqrt<mode>2_sse): Likewise.
+ (sse4_1_round<mode>2): Likewise.
+ (*sse_prologue_save_insn): Disallow REX prefix for AVX.
+ Support AVX. Set length attribute properly for AVX.
+
+ * config/i386/i386-modes.def (VECTOR_MODES (INT, 32)): New.
+ (VECTOR_MODES (FLOAT, 32)): Likewise.
+ (VECTOR_MODE (INT, DI, 8)): Likewise.
+ (VECTOR_MODE (INT, HI, 32)): Likewise.
+ (VECTOR_MODE (INT, QI, 64)): Likewise.
+ (VECTOR_MODE (FLOAT, DF, 8)): Likewise.
+ (VECTOR_MODE (FLOAT, SF, 16)): Likewise.
+ (VECTOR_MODE (INT, DI, 4)): Removed.
+ (VECTOR_MODE (INT, SI, 8)): Likewise.
+ (VECTOR_MODE (INT, HI, 16)): Likewise.
+ (VECTOR_MODE (INT, QI, 32)): Likewise.
+ (VECTOR_MODE (FLOAT, SF, 8)): Likewise.
+ (INT_MODE (OI, 32)): Likewise.
+
+ * config/i386/i386.opt (mavx): New.
+ (mfma): Likewise.
+
+ * config/i386/i386-protos.h (ix86_attr_length_vex_default): New.
+
+ * config/i386/mmx.md (*mov<mode>_internal_rex64): Support AVX.
+ (*mov<mode>_internal_avx): New.
+ (*movv2sf_internal_rex64_avx): Likewise.
+ (*movv2sf_internal_avx): Likewise.
+
+ * config/i386/predicates.md (const_4_to_5_operand): New.
+ (const_6_to_7_operand): Likewise.
+ (const_8_to_11_operand): Likewise.
+ (const_12_to_15_operand): Likewise.
+ (avx_comparison_float_operator): Likewise.
+
+ * config/i386/sse.md (AVX256MODEI): New.
+ (AVX256MODE): Likewise.
+ (AVXMODEQI): Likewise.
+ (AVXMODE): Likewise.
+ (AVX256MODEF2P): Likewise.
+ (AVX256MODE2P): Likewise.
+ (AVX256MODE4P): Likewise.
+ (AVX256MODE8P): Likewise.
+ (AVXMODEF2P): Likewise.
+ (AVXMODEF4P): Likewise.
+ (AVXMODEDCVTDQ2PS): Likewise.
+ (AVXMODEDCVTPS2DQ): Likewise.
+ (avxvecmode): Likewise.
+ (avxvecpsmode): Likewise.
+ (avxhalfvecmode): Likewise.
+ (avxscalarmode): Likewise.
+ (avxcvtvecmode): Likewise.
+ (avxpermvecmode): Likewise.
+ (avxmodesuffixf2c): Likewise.
+ (avxmodesuffixp): Likewise.
+ (avxmodesuffixs): Likewise.
+ (avxmodesuffix): Likewise.
+ (vpermilbits): Likewise.
+ (pinsrbits): Likewise.
+ (mov<mode>): Likewise.
+ (*mov<mode>_internal): Likewise.
+ (push<mode>1): Likewise.
+ (movmisalign<mode>): Likewise.
+ (avx_movup<avxmodesuffixf2c><avxmodesuffix>): Likewise.
+ (avx_movdqu<avxmodesuffix>): Likewise.
+ (avx_lddqu<avxmodesuffix>): Likewise.
+ (<plusminus_insn><mode>3): Likewise.
+ (*avx_<plusminus_insn><mode>3): Likewise.
+ (*avx_vm<plusminus_insn><mode>3): Likewise.
+ (mul<mode>3): Likewise.
+ (*avx_mul<mode>3): Likewise.
+ (*avx_vmmul<mode>3): Likewise.
+ (divv8sf3): Likewise.
+ (divv4df3): Likewise.
+ (avx_div<mode>3): Likewise.
+ (*avx_div<mode>3): Likewise.
+ (*avx_vmdiv<mode>3): Likewise.
+ (avx_rcpv8sf2): Likewise.
+ (*avx_vmrcpv4sf2): Likewise.
+ (sqrtv8sf2): Likewise.
+ (avx_sqrtv8sf2): Likewise.
+ (*avx_vmsqrt<mode>2): Likewise.
+ (rsqrtv8sf2): Likewise.
+ (avx_rsqrtv8sf2): Likewise.
+ (*avx_vmrsqrtv4sf2): Likewise.
+ (<code><mode>3): Likewise.
+ (*avx_<code><mode>3_finite): Likewise.
+ (*avx_<code><mode>3): Likewise.
+ (*avx_vm<code><mode>3): Likewise.
+ (*avx_ieee_smin<mode>3): Likewise.
+ (*avx_ieee_smax<mode>3): Likewise.
+ (avx_addsubv8sf3): Likewise.
+ (avx_addsubv4df3): Likewise.
+ (*avx_addsubv4sf3): Likewise.
+ (*avx_addsubv2df3): Likewise.
+ (avx_h<plusminus_insn>v4df3): Likewise.
+ (avx_h<plusminus_insn>v8sf3): Likewise.
+ (*avx_h<plusminus_insn>v4sf3): Likewise.
+ (*avx_h<plusminus_insn>v2df3): Likewise.
+ (avx_cmpp<avxmodesuffixf2c><mode>3): Likewise.
+ (avx_cmps<ssemodesuffixf2c><mode>3): Likewise.
+ (*avx_maskcmp<mode>3): Likewise.
+ (avx_nand<mode>3): Likewise.
+ (*avx_<code><mode>3): Likewise.
+ (*avx_nand<mode>3): Likewise.
+ (*avx_<code><mode>3): Likewise.
+ (*avx_cvtsi2ss): Likewise.
+ (*avx_cvtsi2ssq): Likewise.
+ (*avx_cvtsi2sd): Likewise.
+ (*avx_cvtsi2sdq): Likewise.
+ (*avx_cvtsd2ss): Likewise.
+ (avx_cvtss2sd): Likewise.
+ (avx_cvtdq2ps<avxmodesuffix>): Likewise.
+ (avx_cvtps2dq<avxmodesuffix>): Likewise.
+ (avx_cvttps2dq<avxmodesuffix>): Likewise.
+ (*avx_cvtsi2sd): Likewise.
+ (*avx_cvtsi2sdq): Likewise.
+ (avx_cvtdq2pd256): Likewise.
+ (avx_cvtpd2dq256): Likewise.
+ (avx_cvttpd2dq256): Likewise.
+ (*avx_cvtsd2ss): Likewise.
+ (*avx_cvtss2sd): Likewise.
+ (avx_cvtpd2ps256): Likewise.
+ (avx_cvtps2pd256): Likewise.
+ (*avx_movhlps): Likewise.
+ (*avx_movlhps): Likewise.
+ (avx_unpckhps256): Likewise.
+ (*avx_unpckhps): Likewise.
+ (avx_unpcklps256): Likewise.
+ (*avx_unpcklps): Likewise.
+ (avx_movshdup256): Likewise.
+ (avx_movsldup256): Likewise.
+ (avx_shufps256): Likewise.
+ (avx_shufps256_1): Likewise.
+ (*avx_shufps_<mode>): Likewise.
+ (*avx_loadhps): Likewise.
+ (*avx_storelps): Likewise.
+ (*avx_loadlps): Likewise.
+ (*avx_movss): Likewise.
+ (*vec_dupv4sf_avx): Likewise.
+ (*vec_concatv2sf_avx): Likewise.
+ (*vec_concatv4sf_avx): Likewise.
+ (*vec_setv4sf_0_avx): Likewise.
+ (*vec_setv4sf_avx): Likewise.
+ (*avx_insertps): Likewise.
+ (avx_vextractf128<mode>): Likewise.
+ (vec_extract_lo_<mode>): Likewise.
+ (vec_extract_hi_<mode>): Likewise.
+ (vec_extract_lo_<mode>): Likewise.
+ (vec_extract_hi_<mode>): Likewise.
+ (vec_extract_lo_v16hi): Likewise.
+ (vec_extract_hi_v16hi): Likewise.
+ (vec_extract_lo_v32qi): Likewise.
+ (vec_extract_hi_v32qi): Likewise.
+ (avx_unpckhpd256): Likewise.
+ (*avx_unpckhpd): Likewise.
+ (avx_movddup256): Likewise.
+ (*avx_movddup): Likewise.
+ (avx_unpcklpd256): Likewise.
+ (*avx_unpcklpd): Likewise.
+ (avx_shufpd256): Likewise.
+ (avx_shufpd256_1): Likewise.
+ (*avx_punpckhqdq): Likewise.
+ (*avx_punpcklqdq): Likewise.
+ (*avx_shufpd_<mode>): Likewise.
+ (*avx_storehpd): Likewise.
+ (*avx_loadhpd): Likewise.
+ (*avx_loadlpd): Likewise.
+ (*avx_movsd): Likewise.
+ (*vec_concatv2df_avx): Likewise.
+ (*avx_<plusminus_insn><mode>3): Likewise.
+ (*avx_<plusminus_insn><mode>3): Likewise.
+ (*avx_mulv8hi3): Likewise.
+ (*avxv8hi3_highpart): Likewise.
+ (*avx_umulv8hi3_highpart): Likewise.
+ (*avx_umulv2siv2di3): Likewise.
+ (*avx_mulv2siv2di3): Likewise.
+ (*avx_pmaddwd): Likewise.
+ (*avx_mulv4si3): Likewise.
+ (*avx_ashr<mode>3): Likewise.
+ (*avx_lshr<mode>3): Likewise.
+ (*avx_ashl<mode>3): Likewise.
+ (*avx_<code><mode>3): Likewise.
+ (*avx_eq<mode>3): Likewise.
+ (*avx_gt<mode>3): Likewise.
+ (*avx_nand<mode>3): Likewise.
+ (*avx_nand<mode>3): Likewise.
+ (*avx_<code><mode>3): Likewise.
+ (*avx_<code><mode>3): Likewise.
+ (*avx_packsswb): Likewise.
+ (*avx_packssdw): Likewise.
+ (*avx_packuswb): Likewise.
+ (*avx_punpckhbw): Likewise.
+ (*avx_punpcklbw): Likewise.
+ (*avx_punpckhwd): Likewise.
+ (*avx_punpcklwd): Likewise.
+ (*avx_punpckhdq): Likewise.
+ (*avx_punpckldq): Likewise.
+ (*avx_pinsr<avxmodesuffixs>): Likewise.
+ (*avx_pinsrq): Likewise.
+ (*avx_loadld): Likewise.
+ (*vec_extractv2di_1_rex64_avx): Likewise.
+ (*vec_extractv2di_1_avx): Likewise.
+ (*vec_dupv2di_avx): Likewise.
+ (*vec_concatv2si_avx): Likewise.
+ (*vec_concatv4si_1_avx): Likewise.
+ (*vec_concatv2di_avx): Likewise.
+ (*vec_concatv2di_rex64_avx): Likewise.
+ (*avx_uavgv16qi3): Likewise.
+ (*avx_uavgv8hi3): Likewise.
+ (*avx_psadbw): Likewise.
+ (avx_movmskp<avxmodesuffixf2c>256): Likewise.
+ (*avx_phaddwv8hi3): Likewise.
+ (*avx_phadddv4si3): Likewise.
+ (*avx_phaddswv8hi3): Likewise.
+ (*avx_phsubwv8hi3): Likewise.
+ (*avx_phsubdv4si3): Likewise.
+ (*avx_phsubswv8hi3): Likewise.
+ (*avx_pmaddubsw128): Likewise.
+ (*avx_pmulhrswv8hi3): Likewise.
+ (*avx_pshufbv16qi3): Likewise.
+ (*avx_psign<mode>3): Likewise.
+ (*avx_palignrti): Likewise.
+ (avx_blendp<avxmodesuffixf2c><avxmodesuffix>): Likewise.
+ (avx_blendvp<avxmodesuffixf2c><avxmodesuffix>): Likewise.
+ (avx_dpp<avxmodesuffixf2c><avxmodesuffix>): Likewise.
+ (*avx_mpsadbw): Likewise.
+ (*avx_packusdw): Likewise.
+ (*avx_pblendvb): Likewise.
+ (*avx_pblendw): Likewise.
+ (avx_vtestp<avxmodesuffixf2c><avxmodesuffix>): Likewise.
+ (avx_ptest256): Likewise.
+ (avx_roundp<avxmodesuffixf2c>256): Likewise.
+ (*avx_rounds<ssemodesuffixf2c>): Likewise.
+ (*avx_aesenc): Likewise.
+ (*avx_aesenclast): Likewise.
+ (*avx_aesdec): Likewise.
+ (*avx_aesdeclast): Likewise.
+ (avx_vzeroupper): Likewise.
+ (avx_vzeroupper_rex64): Likewise.
+ (avx_vpermil<mode>): Likewise.
+ (avx_vpermilvar<mode>3): Likewise.
+ (avx_vpermil2<mode>3): Likewise.
+ (avx_vperm2f128<mode>3): Likewise.
+ (avx_vbroadcasts<avxmodesuffixf2c><avxmodesuffix>): Likewise.
+ (avx_vbroadcastss256): Likewise.
+ (avx_vbroadcastf128_p<avxmodesuffixf2c>256): Likewise.
+ (avx_vinsertf128<mode>): Likewise.
+ (vec_set_lo_<mode>): Likewise.
+ (vec_set_hi_<mode>): Likewise.
+ (vec_set_lo_<mode>): Likewise.
+ (vec_set_hi_<mode>): Likewise.
+ (vec_set_lo_v16hi): Likewise.
+ (vec_set_hi_v16hi): Likewise.
+ (vec_set_lo_v32qi): Likewise.
+ (vec_set_hi_v32qi): Likewise.
+ (avx_maskloadp<avxmodesuffixf2c><avxmodesuffix>): Likewise.
+ (avx_maskstorep<avxmodesuffixf2c><avxmodesuffix>): Likewise.
+ (avx_<avxmodesuffixp><avxmodesuffix>_<avxmodesuffixp>): Likewise.
+ (avx_<avxmodesuffixp>_<avxmodesuffixp><avxmodesuffix>): Likewise.
+ (vec_init<mode>): Likewise.
+ (*vec_concat<mode>_avx): Likewise.
+ (blendbits): Support V8SF and V4DF.
+ (sse2_movq128): Support AVX.
+ (<sse>_movnt<mode>): Likewise.
+ (sse2_movntv2di): Likewise.
+ (sse_rcpv4sf2): Likewise.
+ (sse_sqrtv4sf2): Likewise.
+ (sse_rsqrtv4sf2): Likewise.
+ (<sse>_comi): Likewise.
+ (<sse>_ucomi): Likewise.
+ (sse_cvtss2si): Likewise.
+ (sse_cvtss2si_2): Likewise.
+ (sse_cvtss2siq): Likewise.
+ (sse_cvtss2siq_2): Likewise.
+ (sse_cvttss2si): Likewise.
+ (sse_cvttss2siq): Likewise.
+ (sse2_cvtsd2si): Likewise.
+ (sse2_cvtsd2si_2): Likewise.
+ (sse2_cvtsd2siq): Likewise.
+ (sse2_cvtsd2siq_2): Likewise.
+ (sse2_cvttsd2si): Likewise.
+ (sse2_cvttsd2siq): Likewise.
+ (sse2_cvtdq2pd): Likewise.
+ (*sse2_cvtpd2dq): Likewise.
+ (*sse2_cvttpd2dq): Likewise.
+ (*sse2_cvtpd2ps): Likewise.
+ (sse2_cvtps2pd): Likewise.
+ (sse3_movshdup): Likewise.
+ (sse3_movsldup): Likewise.
+ (sse_storehps): Likewise.
+ (*sse4_1_extractps): Likewise.
+ (sse2_storelpd): Likewise.
+ (vec_dupv2df_sse3): Likewise.
+ (*vec_concatv2df_sse3): Likewise.
+ (*sse4_1_pextrb): Likewise.
+ (*sse4_1_pextrb_memory): Likewise.
+ (*sse2_pextrw): Likewise.
+ (*sse4_1_pextrw_memory): Likewise.
+ (*sse4_1_pextrd): Likewise.
+ (*sse4_1_pextrq): Likewise.
+ (sse2_pshufd_1): Likewise.
+ (sse2_pshuflw_1): Likewise.
+ (sse2_pshufhw_1): Likewise.
+ (*sse2_storeq_rex64): Likewise.
+ (*vec_dupv4si): Likewise.
+ (<sse>_movmskp<ssemodesuffixf2c>): Likewise.
+ (sse2_pmovmskb): Likewise.
+ (*sse2_maskmovdqu): Likewise.
+ (*sse2_maskmovdqu_rex64): Likewise.
+ (sse_ldmxcsr): Likewise.
+ (sse_stmxcsr): Likewise.
+ (abs<mode>2): Likewise.
+ (sse4_1_movntdqa): Likewise.
+ (sse4_1_phminposuw): Likewise.
+ (sse4_1_extendv8qiv8hi2): Likewise.
+ (*sse4_1_extendv8qiv8hi2): Likewise.
+ (sse4_1_extendv4qiv4si2): Likewise.
+ (*sse4_1_extendv4qiv4si2): Likewise.
+ (sse4_1_extendv2qiv2di2): Likewise.
+ (*sse4_1_extendv2qiv2di2): Likewise.
+ (sse4_1_extendv4hiv4si2): Likewise.
+ (*sse4_1_extendv4hiv4si2): Likewise.
+ (sse4_1_extendv2hiv2di2): Likewise.
+ (*sse4_1_extendv2hiv2di2): Likewise.
+ (sse4_1_extendv2siv2di2): Likewise.
+ (*sse4_1_extendv2siv2di2): Likewise.
+ (sse4_1_zero_extendv8qiv8hi2): Likewise.
+ (*sse4_1_zero_extendv8qiv8hi2): Likewise.
+ (sse4_1_zero_extendv4qiv4si2): Likewise.
+ (*sse4_1_zero_extendv4qiv4si2): Likewise.
+ (sse4_1_zero_extendv2qiv2di2): Likewise.
+ (*sse4_1_zero_extendv2qiv2di2): Likewise.
+ (sse4_1_zero_extendv4hiv4si2): Likewise.
+ (*sse4_1_zero_extendv4hiv4si2): Likewise.
+ (sse4_1_zero_extendv2hiv2di2): Likewise.
+ (*sse4_1_zero_extendv2hiv2di2): Likewise.
+ (sse4_1_zero_extendv2siv2di2): Likewise.
+ (*sse4_1_zero_extendv2siv2di2): Likewise.
+ (sse4_1_ptest): Likewise.
+ (sse4_1_roundp<ssemodesuffixf2c>): Likewise.
+ (sse4_2_pcmpestri): Likewise.
+ (sse4_2_pcmpestrm): Likewise.
+ (sse4_2_pcmpistri): Likewise.
+ (sse4_2_pcmpistrm): Likewise.
+ (aesimc): Likewise.
+ (aeskeygenassist): Likewise.
+
+2008-08-28 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/predicates.md (vzeroall_operation): New.
+
+ * config/i386/sse.md (avx_vzeroall): New.
+ (*avx_vzeroall): Likewise.
+
+2008-08-28 Paul Brook <paul@codesourcery.com>
+ Mark Shinwell <shinwell@codesourcery.com>
+ Richard Earnshaw <richard.earnshaw@arm.com>
+
+ * config/arm/arm.c (TARGET_MAX_ANCHOR_OFFSET): New.
+ (TARGET_MIN_ANCHOR_OFFSET): New.
+ (arm_override_options): Set correct anchor ranges for Thumb-1
+ and Thumb-2 if required.
+ (legitimize_pic_address): Handle case involving a TLS symbol
+ reference with an addend.
+ (arm_optimization_options): Enable section anchors at -O1 and
+ above.
+ * config/arm/arm.h (OPTIMIZATION_OPTIONS): New.
+ * config/arm/arm-protos.h (arm_optimization_options): New.
+
+2008-08-28 Nick Clifton <nickc@redhat.com>
+
+ * config/stormy16/stormy16.h (IRA_COVER_CLASSES): Define.
+ * config/stormy16/stormy16.md (zero_extendqihi2): Fix length
+ attribute.
+
+ * config/v850/v850.h (IRA_COVER_CLASSES): Define.
+ * config/v850/v850.md (return): Remove frame size restriction.
+
+ * config/mcore/mcore.h (IRA_COVER_CLASSES): Define.
+
+ * config/iq2000/iq2000.h (IRA_COVER_CLASSES): Define.
+
+ * config/fr30/fr30.h (IRA_COVER_CLASSES): Define.
+
+ * config/m32r/m32r.h (IRA_COVER_CLASSES): Define.
+
+2008-08-28 Paul Brook <paul@codesourcery.com>
+
+ * config/arm/vfp11.md: Update license notice.
+ * config/arm/cortex-r4.md: Ditto.
+
+2008-08-28 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37207
+ * tree-ssa-ifcombine.c (recognize_single_bit_test): Fix
+ tuplification bug.
+
+2008-08-28 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/36741
+ * tree.c (int_fits_type_p): Don't forget unsigned integers
+ of type sizetype which higher end word equals -1.
+
+2008-08-28 Ira Rosen <irar@il.ibm.com>
+
+ * target.h (struct vectorize): Add new target builtin.
+ * tree-vectorizer.c (destroy_loop_vec_info): Call
+ vect_free_slp_instance instead of vect_free_slp_node.
+ * tree-vectorizer.h (enum slp_load_perm_type): New.
+ (struct _slp_instance): Add new fields.
+ (SLP_INSTANCE_LOAD_PERMUTATION): New.
+ (SLP_INSTANCE_LOADS): New.
+ (vect_free_slp_tree): Remove.
+ (vect_free_slp_instance): Declare.
+ (SLP_TREE_LOADS_PERM_TYPE, TARG_VEC_PERMUTE_COST): New.
+ (vectorizable_load): Add argument.
+ (vect_transform_slp_perm_load): New.
+ * tree-vect-analyze.c (vect_analyze_operations): Add an argument to
+ vectorizable_load.
+ (vect_get_place_in_interleaving_chain): New function.
+ (vect_free_slp_tree): Make static.
+ (vect_free_slp_instance): New function.
+ (vect_build_slp_tree): Add new arguments. Allow load permutations and
+ collect the load location in the interleaving chain.
+ (vect_supported_slp_permutation_p): New function.
+ (vect_supported_load_permutation_p): Likewise.
+ (vect_analyze_slp_instance): In case of loads permutation, call
+ vect_supported_load_permutation_p to check that the permutation is
+ supported.
+ * target-def.h (TARGET_VECTORIZE_BUILTIN_VEC_PERM): New.
+ * tree-vect-transform.c (vect_transform_stmt): Add new argument.
+ (vect_create_mask_and_perm): New function.
+ (vect_get_mask_element, vect_transform_slp_perm_load): Likewise.
+ (vectorizable_load): Add an argument. Don't keep the created vectors
+ statements in the node if permutation is required. Call
+ vect_transform_slp_perm_load to generate the permutation.
+ (vect_transform_stmt): Add new argument. Call vectorizable_load with
+ additional argument.
+ (vect_schedule_slp_instance): In case of loads permutation, allocate
+ vectorized statements structure for all the related SLP nodes. Call
+ vect_transform_stmt with addditional argument.
+ (vect_transform_loop): Call vect_transform_stmt with correct arguments.
+ * config/spu/spu.c (spu_builtin_vec_perm): New.
+ (TARGET_VECTORIZE_BUILTIN_VEC_PERM): Redefine.
+ * config/spu/spu.h (TARG_VEC_PERMUTE_COS): Define.
+ * config/rs6000/rs6000.c (rs6000_builtin_vec_perm): New.
+ (TARGET_VECTORIZE_BUILTIN_VEC_PERM): Redefine.
+
+2008-08-28 Chris Fairles <chris.fairles@gmail.com>
+
+ * gthr-posix.h (__gthread_create, __gthread_join, __gthread_detach,
+ __gthread_mutex_timed_lock, __gthread_recursive_mutex_timed_lock,
+ __gthread_cond_signal, __gthread_cond_timedwait,
+ __gthread_cond_timedwait_recursive): New functions.
+ * gthr-posix.c (pthread_mutex_timedlock, pthread_cond_timedwait):
+ Likewise.
+ * gthr.h: Comment on defining __GTHREADS_CXX0X macro in conforming
+ thread interfaces.
+
+2008-08-28 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/37005
+ * fold-const.c (maybe_canonicalize_comparison_1): Require
+ undefined overflow only for canonicalizing A +- CST cmp CST.
+ Make sure to not generate new constants that are not inside
+ their TYPE_MIN/MAX_VALUE range.
+ (maybe_canonicalize_comparison): Remove undefined overflow
+ checking from here.
+ (fold_binary): Remove now duplicate folding.
+
+2008-08-27 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * c-typeck.c (convert_for_assignment): Adjust WARN_FOR_ASSIGNMENT
+ use not updated in the last change.
+
+2008-08-27 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/sh.h (REG_CLASS_CONTENTS): Drop fr32 from FPUL_REGS.
+ (IRA_COVER_CLASSES): Add FPUL_REGS.
+
+2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 37217
+ * c-common.c (conversion_warning): Check for null operands.
+
+2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c/31673
+ * c-decl.c (check_for_loop_decls): Improve error message. Give
+ hint.
+
+2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c/37186
+ * c-typeck.c (WARN_FOR_ASSIGNMENT): Add OPT parameter.
+ (convert_for_assignment): Pass corrent OPT_W* parameter to
+ WARN_FOR_ASSIGNMENT.
+
+2008-08-27 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/35321
+ * c-common.c (fold_offsetof_1): Handle TARGET_EXPR like CALL_EXPR.
+
+2008-08-27 Paul Brook <paul@codesourcery.com>
+
+ * config.gcc: Loosen checks for arm uclinux eabi targets.
+
+2008-08-27 Paul Brook <paul@codesourcery.com>
+
+ * config/arm/t-arm-coff (LIB1ASMFUNCS): Add missing undescrore on
+ _clzsi2.
+ * config/arm/t-linux (LIB1ASMFUNCS): Ditto.
+
+2008-08-26 Douglas Gregor <doug.gregor@gmail.com>
+
+ * c-common.c (do_switch_warnings): Look through the CONST_DECLs in
+ the enumerators of an ENUMERAL_TYPE.
+ * dbxout.c (dbxout_type): Ditto.
+
+2008-08-26 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR rtl-opt/37219
+ * fwprop.c (fwprop): Check that the loop_father is the outer loop.
+ (fwprop_addr): Check that the loop_father is not the outer loop.
+
+2008-08-26 Paul Brook <paul@codesourcery.com>
+
+ * config/arm/vfp.md: Document fmul{s,d} and fmac{s,d} types.
+ Remove documentation entry for fmul type.
+ Use fmuls to annotate single-precision multiplication patterns,
+ fmuld to annotate double-precision multiplication patterns,
+ fmacs to annotate single-precision multiply-accumulate patterns
+ and fmacd to annotate double-precision multiply-accumulate patterns.
+ * config/arm/vfp11.md: Update reservations accordingly.
+ * config/arm/arm.md: Note that certain values of the "type"
+ attribute are documented in vfp.md.
+ * config/arm/arm1020e.md: Remove out of date duplicate comment.
+ (v10_cvt): Use new fmul types.
+
+2008-08-26 Paul Brook <paul@codesourcery.com>
+
+ * config/arm/vfp.md: Move pipeline description for VFP11 to...
+ * config/arm/vfp11.md: ...here. New.
+ * config/arm/arm.md: Include vfp11.md.
+
+2008-08-26 Hans-Peter Nilsson <hp@axis.com>
+
+ * opts.c (decode_options) [!IRA_COVER_CLASSES]: Add missing
+ parameter to inform call.
+
+2008-08-26 Jeff Law <law@redhat.com>
+
+ * mn10300.md (movqi, movhi): Split i->d*a case into two cases to
+ avoid the possibility of getting DATA_OR_ADDRESS_REGS as the
+ preferred class when copying a constant into a partial word register.
+
+2008-08-26 Ben Elliston <bje@au.ibm.com>
+
+ * rtlanal.c: Fix uses of "it's" with "its" where appropriate.
+ * cp/typeck.c: Likewise.
+ * cp/tree.c: Likewise.
+ * gimple-low.c: Likewise.
+ * jump.c: Likewise.
+
+2008-08-26 Vladimir Makarov <vmakarov@redhat.com>
+
+ * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c,
+ ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files.
+
+ * doc/passes.texi: Describe IRA.
+
+ * doc/tm.texi (IRA_COVER_CLASSES,
+ IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros.
+
+ * doc/invoke.texi (ira-max-loops-num): Describe the new parameter.
+ (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills,
+ -fira-propagate-cost, -fno-ira-share-save-slots,
+ -fno-ira-share-spill-slots, -fira-verbose): Describe new options.
+
+ * flags.h (ira_algorithm): New enumeration.
+ (flag_ira_algorithm, flag_ira_verbose): New external variable
+ declarations.
+
+ * postreload.c (gate_handle_postreload): Don't do post reload
+ optimizations unless the reload is completed.
+
+ * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for
+ IRA.
+
+ * tree-pass.h (pass_ira): New external variable declaration.
+
+ * reload.h: Add 2008 to the Copyright.
+
+ * cfgloopanal.c: Include params.h.
+ (estimate_reg_pressure_cost): Decrease cost for IRA optimization
+ mode.
+
+ * params.h (IRA_MAX_LOOPS_NUM): New macro.
+
+ * toplev.c (ira.h): New include.
+ (flag_ira_algorithm, flag_ira_verbose): New external variables.
+ (backend_init_target): Call ira_init.
+ (backend_init): Call ira_init_once.
+ (finalize): Call finish_ira_once.
+
+ * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills,
+ flag_ira_share_save_slots, flag_ira_share_spill_slots): New
+ external variables.
+
+ * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost,
+ may_move_out_cost): New external variable declarations.
+ (move_table): New typedef.
+
+ * caller-save.c: Include headers output.h and ira.h.
+ (no_caller_save_reg_set): New global variable.
+ (save_slots_num, save_slots): New variables.
+ (reg_save_code, reg_restore_code, add_stored_regs): Add
+ prototypes.
+ (init_caller_save): Set up no_caller_save_reg_set.
+ (init_save_areas): Reset save_slots_num.
+ (saved_hard_reg): New structure.
+ (hard_reg_map, saved_regs_num, all_saved_regs): New variables.
+ (initiate_saved_hard_regs, new_saved_hard_reg,
+ finish_saved_hard_regs, saved_hard_reg_compare_func): New
+ functions.
+ (setup_save_areas): Add code for sharing stack slots.
+ (all_blocks): New variable.
+ (save_call_clobbered_regs): Process pseudo-register too.
+ (mark_set_regs): Process pseudo-register too.
+ (insert_one_insn): Put the insn after bb note in a empty basic
+ block. Add insn check.
+
+ * global.c (eliminable_regset): Make it external.
+ (mark_elimination): Use DF_LR_IN for IRA.
+ (pseudo_for_reload_consideration_p): New.
+ (build_insn_chain): Make it external. Don't ignore spilled
+ pseudos for IRA. Use pseudo_for_reload_consideration_p.
+ (gate_handle_global_alloc): New function.
+ (pass_global_alloc): Add the gate function.
+
+ * opts.c (decode_options): Set up flag_ira. Print the warning for
+ -fira.
+ (common_handle_option): Process -fira-algorithm and -fira-verbose.
+
+ * timevar.def (TV_IRA, TV_RELOAD): New passes.
+
+ * regmove.c (regmove_optimize): Don't do replacement of output for
+ IRA.
+
+ * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses):
+ New external variable declarations.
+
+ * local-alloc.c (update_equiv_regs): Make it external. Return
+ true if jump label rebuilding should be done. Rescan new_insn for
+ notes.
+ (gate_handle_local_alloc): New function.
+ (pass_local_alloc): Add the gate function.
+
+ * alias.c (value_addr_p, stack_addr_p): New functions.
+ (nonoverlapping_memrefs_p): Use them for IRA.
+
+ * common.opt (fira, fira-algorithm, fira-coalesce,
+ fira-move-spills, fira-share-save-slots, fira-share-spill-slots,
+ fira-verbose): New options.
+
+ * regclass.c (reg_class_subclasses, contains_reg_of_mode,
+ move_cost, may_move_in_cost, may_move_out_cost): Make the
+ variables external.
+ (move_table): Remove typedef.
+ (init_move_cost): Make it external.
+ (allocate_reg_info, resize_reg_info, setup_reg_classes): New
+ functions.
+
+ * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info,
+ setup_reg_classes): New function prototypes.
+ (eliminable_regset): New external variable declaration.
+ (build_insn_chain, update_equiv_regs): New function prototypes.
+
+ * Makefile.in (IRA_INT_H): New definition.
+ (OBJS-common): Add ira.o, ira-build.o, ira-costs.o,
+ ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o.
+ (reload1.o, toplev.o): Add dependence on ira.h.
+ (cfgloopanal.o): Add PARAMS_H.
+ (caller-save.o): Add dependence on output.h and ira.h.
+ (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o,
+ ira-emit.o, ira-lives.o): New entries.
+
+ * passes.c (pass_ira): New pass.
+
+ * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter.
+
+ * reload1.c (ira.h): Include the header.
+ (changed_allocation_pseudos): New bitmap.
+ (init_reload): Initiate the bitmap.
+ (compute_use_by_pseudos): Permits spilled registers in FROM.
+ (temp_pseudo_reg_arr): New variable.
+ (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for
+ IRA. Call alter_reg with the additional parameter. Don't clear
+ spilled_pseudos for IRA. Restore original insn chain for IRA.
+ Clear changed_allocation_pseudos at the end of reload.
+ (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion.
+ (hard_regno_to_pseudo_regno): New variable.
+ (count_pseudo): Check spilled pseudos. Set up
+ hard_regno_to_pseudo_regno.
+ (count_spilled_pseudo): Check spilled pseudos. Update
+ hard_regno_to_pseudo_regno.
+ (find_reg): Use better_spill_reload_regno_p. Check
+ hard_regno_to_pseudo_regno.
+ (alter_reg): Set up spilled_pseudos. Add a new parameter. Add
+ code for IRA.
+ (eliminate_regs_1): Use additional parameter for alter_reg.
+ (finish_spills): Set up pseudo_previous_regs only for spilled
+ pseudos. Call reassign_pseudos once for all spilled pseudos, pass
+ more arguments. Don't clear live_throughout and dead_or_set for
+ spilled pseudos. Use additional parameter for alter_reg. Call
+ mark_allocation_change. Set up changed_allocation_pseudos.
+ Remove sanity check.
+ (emit_input_reload_insns, delete_output_reload): Use additional
+ parameter for alter_reg. Call mark_allocation_change.
+ (substitute, gen_reload_chain_without_interm_reg_p): New
+ functions.
+ (reloads_conflict): Use gen_reload_chain_without_interm_reg_p.
+
+ * testsuite/gcc.dg/20080410-1.c: New file.
+
+ * config/s390/s390.h (IRA_COVER_CLASSES,
+ IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define.
+
+ * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro.
+
+ * config/i386/i386.h (IRA_COVER_CLASSES): Ditto.
+
+ * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto.
+
+ * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto.
+
+ * config/arm/arm.h (IRA_COVER_CLASSES): Ditto.
+
+ * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto.
+
+ 2008-08-24 Jeff Law <law@redhat.com>
+ * ira.c (setup_reg_class_intersect_union): Prefer smallest class
+ when ignoring unavailable registers.
+
+ 2008-08-24 Jeff Law <law@redhat.com>
+ * ira-color.c (coalesced_pseudo_reg_slot_compare): Check
+ FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD.
+ * ira.c (setup_eliminable_regset): Check stack_realign_needed.
+ * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro.
+
+ 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com>
+ * ira-build.c (allocno_range_compare_func): Stabilize sort.
+
+ 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com>
+ * config/avr/avr.h (IRA_COVER_CLASSES): New macro.
+ * reload1.c (find_reg): Process registers in register allocation order.
+
+ 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk>
+ * toplev.c (backend_init_target): Move ira_init call from
+ here...
+ (lang_dependent_init_target): ...to here.
+
+ 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk>
+ * ira.c (setup_class_subset_and_memory_move_costs): Don't
+ calculate memory move costs for NO_REGS.
+
+ 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org>
+ * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if
+ STACK_REGS is defined.
+
+ 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com>
+ * config/spu/spu.h (IRA_COVER_CLASSES): New macro.
+
+ 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com>
+ * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro.
+
+ 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org>
+ * config/sh/sh.h (IRA_COVER_CLASSES): Define.
+ * config/sh/sh.md (movsicc_true+3): Check if emit returns a
+ barrier.
+
+2008-08-26 Victor Kaplansky <victork@il.ibm.com>
+ Dorit Nuzman <dorit@il.ibm.com>
+
+ * gcc/config/spu/spu.md (vec_extract_evenv4si,
+ vec_extract_evenv4sf, vec_extract_evenv8hi,
+ vec_extract_evenv16qi, vec_extract_oddv4si,
+ vec_extract_oddv4sf, vec_extract_oddv8hi, vec_extract_oddv16qi,
+ vec_interleave_highv4sf, vec_interleave_lowv4sf,
+ vec_interleave_highv4si, vec_interleave_lowv4si,
+ vec_interleave_highv8hi, vec_interleave_lowv8hi,
+ vec_interleave_highv16qi, vec_interleave_lowv16qi,
+ vec_pack_trunc_v8hi, vec_pack_trunc_v4si): Implement.S
+
+2008-08-25 Janis Johnson <janis187@us.ibm.com>
+
+ PR target/36756
+ * config/rs6000/rs6000.c (optimization_options): Don't default to
+ section anchors without toplevel reorder.
+
+2008-08-25 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/spu/spu_mfcio.h (mfc_begin_critical_section): New function.
+ (mfc_end_critical_section): Likewise.
+
+2008-08-25 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+
+ * config/rs6000/rs6000.c (rs6000_handle_altivec_attribute): Propagate
+ all type qualifiers from element type to vector type.
+
+2008-08-25 David Daney <ddaney@avtrex.com>
+
+ * config/mips/mips.md (immediate_insn): Move up in file, fix
+ comment typo, reformat.
+ (fetchop_bit, atomic_hiqi_op memory_barrier,
+ sync_compare_and_swap<mode>, compare_and_swap_12, sync_add<mode>,
+ sync_<optab><mode>, sync_<optab>_12, sync_old_<optab><mode>,
+ sync_old_<optab>_12, sync_new_<optab><mode>, sync_new_<optab>_12,
+ sync_nand<mode>, sync_nand_12, sync_old_nand<mode>,
+ sync_old_nand_12, sync_new_nand<mode>, sync_new_nand_12,
+ sync_sub<mode>, sync_old_add<mode>, sync_old_sub<mode>,
+ sync_new_add<mode>, sync_new_sub<mode>, sync_<optab><mode>,
+ sync_old_<optab><mode>, sync_new_<optab><mode>, sync_nand<mode>,
+ sync_old_nand<mode>, sync_new_nand<mode>,
+ sync_lock_test_and_set<mode>, sync_lock_test_and_set<mode>,
+ test_and_set_12): Moved to sync.md.
+ (sync.md): Include.
+ * config/mips/sync.md: New file.
+
+2008-08-25 Richard Henderson <rth@redhat.com>
+
+ * dwarf2out.c (def_cfa_1): Don't scale by DWARF_CIE_DATA_ALIGNMENT.
+ (regsave): Likewise.
+ (lookup_cfa_1): Don't rescale by DWARF_CIE_DATA_ALIGNMENT.
+ (output_cfi_directive): Likewise.
+ (div_data_align): New.
+ (output_cfi): Use it.
+
+2008-08-24 Adam Nemet <anemet@caviumnetworks.com>
+
+ * config.gcc (mips64*-*-linux*): Handle mips64octeon*-*-linux*.
+ * config/mips/mips.h (enum processor_type): Add PROCESSOR_OCTEON.
+ (TARGET_OCTEON): New macro.
+ (TARGET_CPU_CPP_BUILTINS): Define __OCTEON__ for Octeon.
+ (MIPS_ISA_LEVEL_SPEC, MIPS_ARCH_FLOAT_SPEC): Handle -march=octeon.
+ (ISA_HAS_POP): New macro.
+ * config/mips/driver-native.c (host_detect_local_cpu): Handle
+ Octeon.
+ * config/mips/mips.c (mips_cpu_info_table, mips_rtx_cost_data):
+ Handle Octeon.
+ * config/mips/mips.md (cpu): Add octeon.
+ (type): Add pop attribute value.
+ (popcount<mode>2): New pattern.
+ * doc/invoke.texi (-march=@var{arch}): Add octeon.
+
+2008-08-24 Jan Hubicka <jh@suse.cz>
+
+ * doc/invoke.texi (-fipa-cp-clone): New option.
+ (-fipa-cp): Update docs.
+ (--param ipcp-unit-growth):New.
+ * ipa-cp.c: Include fibheap.h, params.h
+ (ipcp_initialize_node_lattices): When not cloning, all externally
+ visible functions are bottom.
+ (ipcp_need_redirect_p): Accept clones.
+ (ipcp_insert_stage): Use cost driven heuristics.
+ (max_count, dead_nodes): New static vars.
+ (ipcp_need_original_clone_p, ipcp_estimate_cloning_cost,
+ ipcp_const_param_count): New functions.
+ * common.opt (ipa-cp-clone): New command line option.
+ * params.def (ipcp-unit-growth): New.
+
+2008-08-24 Jan Hubicka <jh@suse.cz>
+
+ * tree-inline.c (tree_function_versioning): Look harder
+ for referenced vars.
+
+2008-08-24 Razya Ladelsky <razya@il.ibm.com>
+
+ PR tree-optimization/37185
+ * matrix-reorg.c (transform_access_sites): Update changed stmt.
+
+2008-08-23 Jan Hubicka <jh@suse.cz>
+
+ * ipa-cp.c (ipcp_analyze_node): New function.
+ (ipcp_update_cloned_node): Use it.
+ (ipcp_init_stage): Likewise.
+ * ipa-inline.c (function_insertion_hook_holder): New static var.
+ (analyze_function): Break out from ....
+ (inline_generate_summary): Here; register insertion hook.
+ (cgraph_decide_inlining): Remove hook.
+ (add_new_function): New function.
+
+2008-08-23 Jan Hubicka <jh@suse.cz>
+
+ * opts.c (decode_options): Revert accidental change enabling ipa-cp.
+
+2008-08-23 Jan Hubicka <jh@suse.cz>
+
+ * ipa-cp.c (constant_val_insert): Remove.
+ (ipcp_propagate_one_const): Remove.
+ (ipcp_create_replace_map): Always insert replacements to the map.
+ (ipcp_insert_stage): Do not try to insert statements by hand.
+ * tree-inline.c (insert_init_stmt): Break out from ...
+ (setup_one_parameter): ... here; allow NULL BB pointer.
+ (tree_function_versioning): Use setup_one_parameter to process
+ replacement map.
+
+2008-08-23 Jan Hubicka <jh@suse.cz>
+
+ * tree.c (decl_address_ip_invariant_p): New function.
+ * tree.h (decl_address_ip_invariant_p): Declare.
+ * gimple.c (strip_invariant_refs): Break out from ...
+ (is_gimple_invariant_address): ... here
+ (is_gimple_ip_invariant_address): New function.
+ (is_gimple_ip_invariant): New function.
+ * gimple.h (is_gimple_ip_invariant_address, is_gimple_ip_invariant):
+ Declare.
+
+ * ipa-cp.c (ipcp_lat_is_const): Remove handling of IPA_CONST_VALUE_REF.
+ (ipcp_lat_is_insertable): All constants are insertable.
+ (ipcp_lattice_from_jfunc, ipcp_print_all_lattices): Remove handling of
+ IPA_CONST_VALUE_REF.
+ (ipcp_initialize_node_lattices): Propagate all types of operands.
+ (build_const_val): Do not handle IPA_CONST_VALUE_REF.
+ (ipcp_create_replace_map): Reformat.
+ (ipcp_need_redirect_p): Simplify.
+ (ipcp_insert_stage): Check that argument is used before clonning.
+ * ipa-prop.c (ipa_print_node_jump_functions): Do not handle IPA_CONST_REF.
+ (compute_scalar_jump_functions): Simplify using is_gimple_ip_invariat.
+ (determine_cst_member_ptr): Keep wrapping ADDR_EXPR of members.
+ (update_call_notes_after_inlining): Expect ADDR_EXPR in operand.
+ * ipa-prop.h (jump_func_type): Remove IPA_CONST_REF.
+ (jump_func_type): Remove IPA_CONST_VALUE_REF.
+ * tree-inline.c (tree_function_versioning): Add variables referenced by
+ replacing trees.
+
+2008-08-23 Jan Hubicka <jh@suse.cz>
+
+ PR target/37094
+ * i386.c (standard_80387_constant_p): Use optimize_size.
+
+2008-08-23 Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/37161
+ * tree-vectorizer.h (vect_get_smallest_scalar_type): Declare.
+ * tree-vect-analyze.c (vect_get_smallest_scalar_type): New function.
+ (vect_determine_vectorization_factor): Move the scalar type
+ retrieval to vect_get_smallest_scalar_type.
+ (vect_build_slp_tree): Call vect_get_smallest_scalar_type to get
+ scalar type. Remove redundant computation.
+ * tree-vect-transform.c (vect_get_constant_vectors): Add argument.
+ (vect_get_slp_defs): Take the type of RHS into account if
+ necessary by calling vect_get_smallest_scalar_type. Call
+ vect_get_constant_vectors with additional argument.
+
+2008-08-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 35648
+ * doc/invoke.texi (Wwrite-strings): Clarify description.
+
+2008-08-23 Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/37174
+ * tree-vect-analyze.c (vect_get_and_check_slp_defs): Check that the
+ def stmt is a part of the loop before accessing its stmt_vec_info.
+
+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
+ * dwarf2out.c (dwarf2out_args_size_adjust): New.
+ (dwarf2out_stack_adjust): Use it.
+ (dwarf2out_frame_debug_expr): Likewise.
+
+2008-07-31 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36978
+ * tree-ssa-loop-unswitch.c (tree_may_unswitch_on): Do not fold
+ the generated condition.
+
+2008-07-31 Richard Guenther <rguenther@suse.de>
+
+ * passes.c (init_optimization_passes): Always call
+ pass_early_warn_uninitialized.
+ * 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.
+
+2008-07-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/36970
+ * builtins.c (maybe_emit_free_warning): New function.
+ (expand_builtin): Process BUILT_IN_FREE even at -O0. Call
+ maybe_emit_free_warning for BUILT_IN_FREE.
+
+ PR debug/36278
+ * dwarf2out.c (get_context_die): New function.
+ (force_decl_die, force_type_die): Use it.
+ (dwarf2out_imported_module_or_decl): Likewise. If base_type_die
+ returns NULL, force generation of DW_TAG_typedef and put that into
+ DW_AT_import.
+
+ PR preprocessor/36649
+ * c-pch.c (c_common_read_pch): Save and restore
+ line_table->trace_includes across PCH restore.
+
+2008-07-30 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/36554
+ * dwarf2out.c (is_subrange_type): Deal with BOOLEAN_TYPE.
+
+2008-07-30 Rafael Avila de Espindola <espindola@google.com>
+
+ PR 36974
+ * final.c (call_from_call_insn): Handle COND_EXEC.
+
+2008-07-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ * builtins.c (std_gimplify_va_arg_expr): Replace
+ PREFERRED_STACK_BOUNDARY with MAX_SUPPORTED_STACK_ALIGNMENT.
+ * config/i386/i386.c (ix86_gimplify_va_arg): Likewise.
+
+2008-07-30 Joey Ye <joey.ye@intel.com>
+ H.J. Lu <hongjiu.lu@intel.com>
+
+ * builtins.c (expand_builtin_setjmp_receiver): Replace
+ virtual_incoming_args_rtx with crtl->args.internal_arg_pointer.
+ (expand_builtin_apply_args_1): Likewise.
+ (expand_builtin_longjmp): Need DRAP for stack alignment.
+ (expand_builtin_apply): Likewise.
+
+ * caller-save.c (setup_save_areas): Call assign_stack_local_1
+ instead of assign_stack_local to allow alignment reduction.
+
+ * calls.c (emit_call_1): Need DRAP for stack alignment if
+ return pops.
+ (expand_call): Replace virtual_incoming_args_rtx with
+ crtl->args.internal_arg_pointer.
+ * stmt.c (expand_nl_goto_receiver): Likewise.
+
+ * cfgexpand.c (get_decl_align_unit): Estimate stack variable
+ alignment and store to stack_alignment_estimated and
+ max_used_stack_slot_alignment.
+ (expand_one_var): Likewise.
+ (expand_stack_alignment): New function.
+ (tree_expand_cfg): Initialize max_used_stack_slot_alignment
+ and stack_alignment_estimated fields in rtl_data. Call
+ expand_stack_alignment at end.
+
+ * defaults.h (INCOMING_STACK_BOUNDARY): New.
+ (MAX_STACK_ALIGNMENT): Likewise.
+ (MAX_SUPPORTED_STACK_ALIGNMENT): Likewise.
+ (SUPPORTS_STACK_ALIGNMENT): Likewise.
+
+ * emit-rtl.c (gen_reg_rtx): Estimate stack alignment for
+ stack alignment when generating virtual registers.
+
+ * function.c (assign_stack_local): Renamed to ...
+ (assign_stack_local_1): This. Add a parameter to indicate
+ if it is OK to reduce alignment.
+ (assign_stack_local): Use it.
+ (instantiate_new_reg): Instantiate virtual incoming args rtx
+ to vDRAP if stack realignment and DRAP is needed.
+ (assign_parms): Collect parameter/return type alignment and
+ contribute to stack_alignment_estimated.
+ (locate_and_pad_parm): Likewise.
+ (get_arg_pointer_save_area): Replace virtual_incoming_args_rtx
+ with crtl->args.internal_arg_pointer.
+
+ * function.h (rtl_data): Add new field drap_reg,
+ max_used_stack_slot_alignment, stack_alignment_estimated,
+ stack_realign_needed, need_drap, stack_realign_processed and
+ stack_realign_finalized.
+ (stack_realign_fp): New macro.
+ (stack_realign_drap): Likewise.
+
+ * global.c (compute_regsets): Frame pointer is needed when
+ stack is realigned. Can eliminate frame pointer when stack is
+ realigned and dynamic realigned argument pointer isn't used.
+
+ * reload1.c (update_eliminables): Frame pointer is needed
+ when stack is realigned.
+ (init_elim_table): Can eliminate frame pointer when stack is
+ realigned and dynamic realigned argument pointer isn't used.
+
+ * rtl.h (assign_stack_local_1): Declare new funtion.
+
+ * target-def.h (TARGET_UPDATE_STACK_BOUNDARY): New.
+ (TARGET_GET_DRAP_RTX): Likewise.
+ (TARGET_CALLS): Add TARGET_UPDATE_STACK_BOUNDARY and
+ TARGET_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.
+
+2008-07-30 Xuepeng Guo <xuepeng.guo@intel.com>
+ H.J. Lu <hongjiu.lu@intel.com>
+
+ * dwarf2out.c (dw_fde_struct): Add stack_realignment, drap_reg,
+ vdrap_reg, stack_realign and drap_reg_saved.
+ (add_cfi): Don't allow redefining CFA when DRAP is used.
+ (reg_save): Handle stack alignment.
+ (dwarf2out_frame_debug_expr): Add rules 16-20 to handle stack
+ alignment. Don't generate DWARF information for (set fp sp)
+ when DRAP is used.
+ (dwarf2out_begin_prologue): Initialize drap_reg and vdrap_reg
+ to INVALID_REGNUM.
+ (int_loc_descriptor): Move prototype forward. Also define if
+ DWARF2_UNWIND_INFO is true.
+ (output_cfa_loc): Handle DW_CFA_expression.
+ (build_cfa_aligned_loc): New.
+ (based_loc_descr): Update assert for stack realign. For local
+ variables, use sp+offset when stack is aligned without drap and
+ fp+offset when stack is aligned with drap. For arguments, use
+ cfa+offset when drap is used to align stack.
+
+2008-07-30 Joey Ye <joey.ye@intel.com>
+ H.J. Lu <hongjiu.lu@intel.com>
+
+ * config/i386/i386.c (ix86_force_align_arg_pointer_string):
+ Break long line.
+ (ix86_gen_andsp): New.
+ (ix86_user_incoming_stack_boundary): Likewise.
+ (ix86_default_incoming_stack_boundary): Likewise.
+ (ix86_incoming_stack_boundary): Likewise.
+ (ix86_can_eliminate): Likewise.
+ (find_drap_reg): Likewise.
+ (ix86_update_stack_boundary): Likewise.
+ (ix86_get_drap_rtx): Likewise.
+ (ix86_finalize_stack_realign_flags): Likewise.
+ (TARGET_UPDATE_STACK_BOUNDARY): Likewise.
+ (TARGET_GET_DRAP_RTX): Likewise.
+ (override_options): Overide option value for new options.
+ (ix86_function_ok_for_sibcall): Remove check for
+ force_align_arg_pointer.
+ (ix86_handle_cconv_attribute): Likewise.
+ (ix86_function_regparm): Likewise.
+ (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_expand_prologue): Decide if stack realignment is needed
+ and generate prologue code accordingly.
+ (ix86_expand_epilogue): Generate epilogue code wrt stack
+ realignment is really needed or not.
+
+ * config/i386/i386.h (MAIN_STACK_BOUNDARY): New.
+ (ABI_STACK_BOUNDARY): Likewise.
+ (PREFERRED_STACK_BOUNDARY_DEFAULT): Likewise.
+ (STACK_REALIGN_DEFAULT): Likewise.
+ (INCOMING_STACK_BOUNDARY): Likewise.
+ (MAX_STACK_ALIGNMENT): Likewise.
+ (ix86_incoming_stack_boundary): Likewise.
+ (FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN): Removed.
+ (REAL_PIC_OFFSET_TABLE_REGNUM): Updated to use BX_REG.
+ (CAN_ELIMINATE): Defined with ix86_can_eliminate.
+ (machine_function): Remove force_align_arg_pointer.
+
+ * config/i386/i386.md (BX_REG): New.
+ (R13_REG): Likewise.
+
+ * config/i386/i386.opt (mforce_drap): New.
+ (mincoming-stack-boundary): Likewise.
+ (mstackrealign): Add Init(-1).
+
+ * config/i386/i386-protos.h (ix86_can_eliminate): New
+
+2008-07-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ * doc/extend.texi: Update force_align_arg_pointer.
+
+ * doc/invoke.texi: Document -mincoming-stack-boundary. Update
+ -mstackrealign.
+
+ * doc/tm.texi (MAX_STACK_ALIGNMENT): Add macro.
+ (INCOMING_STACK_BOUNDARY): Likewise.
+ (TARGET_UPDATE_STACK_BOUNDARY): New target hook.
+ (TARGET_GET_DRAP_RTX): Likewise.
+
+2008-07-30 Andreas Schwab <schwab@suse.de>
+
+ PR rtl-optimization/36929
+ * dse.c (replace_inc_dec): Use emit_insn_before instead of
+ add_insn_before and fix argument order.
+ (replace_inc_dec_mem): Handle NULL rtx.
+
+2008-07-30 Andrew Jenner <andrew@codesourcery.com>
+
+ * config/arm/arm.c (arm_compute_static_chain_stack_bytes): New
+ function.
+ (arm_compute_initial_elimination_offset): Use it.
+ (arm_compute_save_reg_mask): Include static chain save slot when
+ calculating alignment.
+ (arm_get_frame_offsets): Ditto.
+ (thumb1_compute_save_reg_mask): Ensure we have a low register saved
+ that we can use to decrement the stack when the stack decrement
+ could be too big for an immediate value in a single insn.
+ (thumb1_expand_prologue): Avoid using r12 for stack decrement.
+
+2008-07-30 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36967
+ * tree-predcom.c (remove_stmt): Use gimple_assign_ssa_name_copy_p.
+ Release defs of statements we remove.
+
+2008-07-30 Nathan Froyd <froydnj@codesourcery.com>
+
+ * config/arm/arm.c (arm_expand_prologue): Use 0-length rtvec
+ instead of NULL_RTVEC.
+
+2008-07-30 Nathan Froyd <froydnj@codesourcery.com>
+
+ PR target/35866
+
+ * config/rs6000/rs6000.h (SLOW_UNALIGNED_ACCESS): Add clause for
+ vector modes.
+
+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.
+
+2008-07-30 Paolo Bonzini <bonzini@gnu.org>
+
+ * configure.ac: Substitute ADA_CFLAGS.
+ * configure: Regenerate.
+ * config.host: Remove mention of pa/x-ada and pa/x-ada-hpux10 files.
+ * Makefile.in: Remove mention of X_* variables.
+ * config/pa/x-ada-hpux10: Remove.
+ * config/pa/x-ada: Remove.
+
+ * doc/fragments.texi: Update.
+
+2008-07-30 Olivier Hainque <hainque@adacore.com>
+
+ * config/mips/irix-crti.asm: .hide __gcc_init and __gcc_fini.
+ * config/mips/iris6.h (IRIX_SUBTARGET_LINK_SPEC, irix ld): Hide
+ __dso_handle explicitly here.
+
+2008-07-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 34389
+ * c-typeck.c (build_binary_op): Encapsulate code into...
+ * c-common.c (shorten_binary_op): ...this new function.
+ (conversion_warning): Use the new function. Handle non-negative
+ constant in bitwise-and.
+ * c-common.h (shorten_binary_op): Declare.
+
+2008-07-30 Olivier Hainque <hainque@adacore.com>
+
+ * scan.c (make_sstring_space): Add explicit conversions of
+ allocator's return value.
+ * fix-header.c (recognized_function): Likewise.
+
+2008-07-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ * doc/cpp.texi: Update to GFDL 1.2.
+ * doc/gcc.texi: Do not list GPL as Invariant Section.
+ * doc/gccint.texi: Likewise. Update copyright years.
+ * doc/install.texi: Update copyright years.
+
+2008-07-30 Alan Modra <amodra@bigpond.net.au>
+
+ PR target/36955
+ * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Add
+ a use of pic_offset_table_rtx for -msecure-plt __tls_get_addr calls.
+
+2008-07-29 Jan Hubicka <jh@suse.cz>
+
+ * c-decl.c (merge_decls): Do not handle DECL_INLINE.
+ (grokdeclarator): Likewise.
+ * langhooks.c (lhd_warn_unused_global_decl): Use
+ DECL_DECLARED_INLINE_P.
+ * print-tree.c (print_node): Remove DECL_INLINE check.
+
+2008-07-29 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36945
+ * tree-ssa-sccvn.h (copy_reference_ops_from_ref): Declare.
+ * tree-ssa-sccvn.c (copy_reference_ops_from_ref): Export.
+ Record invariant addresses un-decomposed.
+ (copy_reference_ops_from_call): Record reference call
+ arguments properly. Simplify.
+ * tree-ssa-pre.c (create_component_ref_by_pieces_1): New
+ helper split out from ...
+ (create_component_ref_by_pieces): ... here. Simplify.
+ Prepare for recursive invocation for call arguments.
+ (create_expression_by_pieces): Adjust call to
+ create_component_ref_by_pieces.
+ (compute_avail): Process operand 2 of reference ops.
+
+2008-07-29 Richard Guenther <rguenther@suse.de>
+
+ * gimplify.c (gimplify_expr): Clear TREE_SIDE_EFFECTS for OBJ_TYPE_REF.
+
+2008-07-29 Jakub Jelinek <jakub@redhat.com>
+
+ * c-format.c (check_format_types): Revert unwanted checkin.
+
+2008-07-29 Jan Hubicka <jh@suse.cz>
+
+ * flags.h (flag_really_no_inline): Remove.
+ * cgraph.c (cgraph_function_possibly_inlined_p): Simplify.
+ * toplev.c (flag_really_no_inline): Remove.
+ * c-cppbuiltin.c (c_cpp_builtins): Use flag_no_inline.
+ * ipa-inline.c (cgraph_decide_inlining): Do not check flag_no_inline.
+ (cgraph_decide_inlining_incrementally): Likewise.
+ (compute_inline_parameters): Likewise.
+ * opts.c (decode_options): Simplify.
+ * c-opts.c (c_common_post_options): Do not set flag_no_inline.
+ * common.opt (finline): Initialize to 1.
+ * tree-inline.c (inlinable_function_p): Check flag_no_inline.
+
+2008-07-29 Jan Hubicka <jh@suse.cz>
+
+ * predict.c (always_optimize_for_size_p): New function.
+ (optimize_bb_for_size_p, optimize_bb_for_speed_p,
+ optimize_edge_for_size_p, optimize_edge_for_speed_p,
+ optimize_insn_for_size_p, optimize_insn_for_speed_p): New global
+ functions.
+ (rtl_profile_for_bb, rtl_profile_for_edge, rtl_default_profile): New.
+ * function.c (prepare_function_start): Set default profile.
+ * function.h (rtl_data): Add maybe_hot_insn_p.
+ * cfgexpand.c (expand_gimple_basic_block): Set RTL profile.
+ (construct_exit_block): Likewise.
+ (tree_expand_cfg): Likewise.
+ * basic-block.h
+ (optimize_bb_for_size_p, optimize_bb_for_speed_p,
+ optimize_edge_for_size_p, optimize_edge_for_speed_p,
+ optimize_insn_for_size_p, optimize_insn_for_speed_p): Declare.
+ (rtl_profile_for_bb, rtl_profile_for_edge, default_rtl_profile):
+ Declare.
+
+2008-07-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 34985
+ * c-decl.c (merge_decls): Merge USED flags.
+
+2008-07-29 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * config/sh/sh.c (sh_gimplify_va_arg_expr): Unshare the addr,
+ valist, next_fp, next_fp_tmp, next_fp_limit, next_o, next_o_limit,
+ next_stack, lab_false and lab_over trees.
+
+2008-07-28 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36957
+ * tree-flow.h (tree_ssa_useless_type_conversion): Remove.
+ (useless_type_conversion_p): Remove.
+ (types_compatible_p): Remove.
+ * gimple.h (tree_ssa_useless_type_conversion): Declare.
+ (useless_type_conversion_p): Declare.
+ (types_compatible_p): Declare.
+ (gimple_expr_type): Return the base type only if it is
+ trivially convertible to the subtype.
+
+2008-07-28 Andreas Tobler <a.tobler@schweiz.org>
+
+ * configure.ac: Use the m4_do macro to concatenate the warnings into
+ one string in ACX_PROG_CC_WARNING_OPTS,
+ ACX_PROG_CC_WARNING_ALMOST_PEDANTIC and ACX_PROG_CC_WARNINGS_ARE_ERRORS.
+ * configure: Regenerate.
+
+2008-07-28 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-pre.c (insert_into_preds_of_block): Remove dead code.
+ (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.
+ (find_func_aliases): Deal with it here instead.
+ Re-enable gcc_unreachable call.
+
+2008-07-28 Richard Guenther <rguenther@suse.de>
+
+ Merge from gimple-tuples-branch.
+
+ * ChangeLog.tuples: ChangeLog from gimple-tuples-branch.
+ * gimple.def: New file.
+ * gsstruct.def: Likewise.
+ * gimple-iterator.c: Likewise.
+ * gimple-pretty-print.c: Likewise.
+ * tree-gimple.c: Removed. Merged into ...
+ * gimple.c: ... here. New file.
+ * tree-gimple.h: Removed. Merged into ...
+ * gimple.h: ... here. New file.
+
+ * Makefile.in: Add dependencies on GIMPLE_H and tree-iterator.h.
+ * configure.ac: Added support for ENABLE_GIMPLE_CHECKING and the
+ --enable-checking=gimple flag.
+ * config.in: Likewise.
+ * configure: Regenerated.
+
+ * tree-ssa-operands.h: Tuplified.
+ * tree-vrp.c: Likewise.
+ * tree-loop-linear.c: Likewise.
+ * tree-into-ssa.c: Likewise.
+ * tree-ssa-loop-im.c: Likewise.
+ * tree-dump.c: Likewise.
+ * tree-complex.c: Likewise.
+ * cgraphbuild.c: Likewise.
+ * tree-ssa-threadupdate.c: Likewise.
+ * tree-ssa-loop-niter.c: Likewise.
+ * tree-pretty-print.c: Likewise.
+ * tracer.c: Likewise.
+ * gengtype.c: Likewise.
+ * tree-loop-distribution.c: Likewise.
+ * tree-ssa-loop-unswitch.c: Likewise.
+ * cgraph.c: Likewise.
+ * cgraph.h: Likewise.
+ * tree-ssa-loop-manip.c: Likewise.
+ * value-prof.c: Likewise.
+ * tree-ssa-loop-ch.c: Likewise.
+ * tree-tailcall.c: Likewise.
+ * value-prof.h: Likewise.
+ * tree.c: Likewise.
+ * tree.h: Likewise.
+ * tree-pass.h: Likewise.
+ * ipa-cp.c: Likewise.
+ * tree-scalar-evolution.c: Likewise.
+ * tree-scalar-evolution.h: Likewise.
+ * target.h: Likewise.
+ * lambda-mat.c: Likewise.
+ * tree-phinodes.c: Likewise.
+ * diagnostic.h: Likewise.
+ * builtins.c: Likewise.
+ * tree-ssa-alias-warnings.c: Likewise.
+ * cfghooks.c: Likewise.
+ * fold-const.c: Likewise.
+ * cfghooks.h: Likewise.
+ * omp-low.c: Likewise.
+ * tree-ssa-dse.c: Likewise.
+ * ipa-reference.c: Likewise.
+ * tree-ssa-uncprop.c: Likewise.
+ * toplev.c: Likewise.
+ * tree-gimple.c: Likewise.
+ * tree-gimple.h: Likewise.
+ * tree-chrec.c: Likewise.
+ * tree-chrec.h: Likewise.
+ * tree-ssa-sccvn.c: Likewise.
+ * tree-ssa-sccvn.h: Likewise.
+ * cgraphunit.c: Likewise.
+ * tree-ssa-copyrename.c: Likewise.
+ * tree-ssa-ccp.c: Likewise.
+ * tree-ssa-loop-ivopts.c: Likewise.
+ * tree-nomudflap.c: Likewise.
+ * tree-call-cdce.c: Likewise.
+ * ipa-pure-const.c: Likewise.
+ * c-format.c: Likewise.
+ * tree-stdarg.c: Likewise.
+ * tree-ssa-math-opts.c: Likewise.
+ * tree-ssa-dom.c: Likewise.
+ * tree-nrv.c: Likewise.
+ * tree-ssa-propagate.c: Likewise.
+ * ipa-utils.c: Likewise.
+ * tree-ssa-propagate.h: Likewise.
+ * tree-ssa-alias.c: Likewise.
+ * gimple-low.c: Likewise.
+ * tree-ssa-sink.c: Likewise.
+ * ipa-inline.c: Likewise.
+ * c-semantics.c: Likewise.
+ * dwarf2out.c: Likewise.
+ * expr.c: Likewise.
+ * tree-ssa-loop-ivcanon.c: Likewise.
+ * predict.c: Likewise.
+ * tree-ssa-loop.c: Likewise.
+ * tree-parloops.c: Likewise.
+ * tree-ssa-address.c: Likewise.
+ * tree-ssa-ifcombine.c: Likewise.
+ * matrix-reorg.c: Likewise.
+ * c-decl.c: Likewise.
+ * tree-eh.c: Likewise.
+ * c-pretty-print.c: Likewise.
+ * lambda-trans.c: Likewise.
+ * function.c: Likewise.
+ * langhooks.c: Likewise.
+ * ebitmap.h: Likewise.
+ * tree-vectorizer.c: Likewise.
+ * function.h: Likewise.
+ * langhooks.h: Likewise.
+ * tree-vectorizer.h: Likewise.
+ * ipa-type-escape.c: Likewise.
+ * ipa-type-escape.h: Likewise.
+ * domwalk.c: Likewise.
+ * tree-if-conv.c: Likewise.
+ * profile.c: Likewise.
+ * domwalk.h: Likewise.
+ * tree-data-ref.c: Likewise.
+ * tree-data-ref.h: Likewise.
+ * tree-flow-inline.h: Likewise.
+ * tree-affine.c: Likewise.
+ * tree-vect-analyze.c: Likewise.
+ * c-typeck.c: Likewise.
+ * gimplify.c: Likewise.
+ * coretypes.h: Likewise.
+ * tree-ssa-phiopt.c: Likewise.
+ * calls.c: Likewise.
+ * tree-ssa-coalesce.c: Likewise.
+ * tree.def: Likewise.
+ * tree-dfa.c: Likewise.
+ * except.c: Likewise.
+ * except.h: Likewise.
+ * cfgexpand.c: Likewise.
+ * tree-cfgcleanup.c: Likewise.
+ * tree-ssa-pre.c: Likewise.
+ * tree-ssa-live.c: Likewise.
+ * tree-sra.c: Likewise.
+ * tree-ssa-live.h: Likewise.
+ * tree-predcom.c: Likewise.
+ * lambda.h: Likewise.
+ * tree-mudflap.c: Likewise.
+ * ipa-prop.c: Likewise.
+ * print-tree.c: Likewise.
+ * tree-ssa-copy.c: Likewise.
+ * ipa-prop.h: Likewise.
+ * tree-ssa-forwprop.c: Likewise.
+ * ggc-page.c: Likewise.
+ * c-omp.c: Likewise.
+ * tree-ssa-dce.c: Likewise.
+ * tree-vect-patterns.c: Likewise.
+ * tree-ssa-ter.c: Likewise.
+ * tree-nested.c: Likewise.
+ * tree-ssa.c: Likewise.
+ * lambda-code.c: Likewise.
+ * tree-ssa-loop-prefetch.c: Likewise.
+ * tree-inline.c: Likewise.
+ * tree-inline.h: Likewise.
+ * tree-iterator.c: Likewise.
+ * tree-optimize.c: Likewise.
+ * tree-ssa-phiprop.c: Likewise.
+ * tree-vect-transform.c: Likewise.
+ * tree-object-size.c: Likewise.
+ * tree-outof-ssa.c: Likewise.
+ * cfgloop.c: Likewise.
+ * system.h: Likewise.
+ * tree-profile.c: Likewise.
+ * cfgloop.h: Likewise.
+ * c-gimplify.c: Likewise.
+ * c-common.c: Likewise.
+ * tree-vect-generic.c: Likewise.
+ * tree-flow.h: Likewise.
+ * c-common.h: Likewise.
+ * basic-block.h: Likewise.
+ * tree-ssa-structalias.c: Likewise.
+ * tree-switch-conversion.c: Likewise.
+ * tree-ssa-structalias.h: Likewise.
+ * tree-cfg.c: Likewise.
+ * passes.c: Likewise.
+ * ipa-struct-reorg.c: Likewise.
+ * ipa-struct-reorg.h: Likewise.
+ * tree-ssa-reassoc.c: Likewise.
+ * cfgrtl.c: Likewise.
+ * varpool.c: Likewise.
+ * stmt.c: Likewise.
+ * tree-ssanames.c: Likewise.
+ * tree-ssa-threadedge.c: Likewise.
+ * langhooks-def.h: Likewise.
+ * tree-ssa-operands.c: Likewise.
+ * config/alpha/alpha.c: Likewise.
+ * config/frv/frv.c: Likewise.
+ * config/s390/s390.c: Likewise.
+ * config/m32c/m32c.c: Likewise.
+ * config/m32c/m32c-protos.h: Likewise.
+ * config/spu/spu.c: Likewise.
+ * config/sparc/sparc.c: Likewise.
+ * config/i386/i386.c: Likewise.
+ * config/sh/sh.c: Likewise.
+ * config/xtensa/xtensa.c: Likewise.
+ * config/stormy16/stormy16.c: Likewise.
+ * config/ia64/ia64.c: Likewise.
+ * config/rs6000/rs6000.c: Likewise.
+ * config/pa/pa.c: Likewise.
+ * config/mips/mips.c: Likewise.
+
+2008-07-28 Simon Baldwin <simonb@google.com>
+
+ * c-pragma.c (handle_pragma_message): New function.
+ (init_pragma): Register handle_pragma_message.
+ * doc/extend.texi (Diagnostic Pragmas): Added #pragma message
+ documentation.
+
+2008-07-27 Victor Kaplansky <victork@il.ibm.com>
+
+ PR tree-optimization/35252
+ * tree-vect-analyze.c (vect_build_slp_tree): Make IMAGPART_EXPR and
+ REALPART_EXPR to be considered as same load operation.
+
+2008-07-27 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR tree-optimization/36830
+ * tree-ssa-sccvn.c (vn_reference_op_compute_hash): Hash operand #2.
+ (expressions_equal_p): Return false if only one operand is null.
+
+2008-07-26 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * doc/install.texi (powerpc-*-netbsd*): Remove redundant texinfo
+ version requirements.
+
+2008-07-26 Olivier Hainque <hainque@adacore.com>
+
+ * collect2.c (symkind): New enum. Symbol kinds we care about.
+ (is_ctor_dtor): Return symkind instead of int. Adjust prototype,
+ code and head comment accordingly.
+ (scan_prog_file): Use symkind names instead of bare integers.
+
+2008-07-25 Jan Hubicka <jh@suse.cz>
+
+ * 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.
+ * print-tree.c (print_node): Ignore DECL_INLINE.
+ * tree-inline.c (inlinable_function_p): Likewise.
+
+2008-07-25 Michael Meissner <gnu@the-meissners.org>
+
+ * doc/extend.texi (hot attribute): Document that the hot attribute
+ turns on -O3 for some ports.
+ (cold attribute): Document that the cold attribute turns on -Os
+ for some ports
+
+ * doc/tm.texi (OPTIMIZATION_OPTIONS): Update documentation to
+ reflect function specific option support.
+
+ * target.h (struct target_option_hooks): Add fields to say whether
+ the cold attribute implies -Os and the hot attribute implies -O3.
+
+ * target-def.h (TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION):
+ By default, do not turn on -Os for cold functions.
+ (TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION): By default, do
+ not turn on -O3 for hot functions.
+
+ * c-common.c (handle_hot_attribute): Use target hook to determine
+ if hot functions should enable -O3.
+ (handle_cold_attribute): Use target hook to determine if cold
+ functions should enable -Os.
+
+ * config/i386/i386.c (ix86_target_string): Add -m3dnowa support.
+ (override_options): Move disable scheduling to
+ optimization_options.
+ (optimization_options): Disable scheduling here, not
+ override_options.
+ (TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION): Define.
+ (TARGET_OPTION_HOT_ATTRIBUTE_SETS_OPTIMIZATION): Define.
+
+ * config/ia64/ia64.c (ia64_override_options): Move setting
+ scheduling flags to ia64_optimization_options.
+ (ia64_optimization_options): Disable scheduling options here, and
+ not in ia64_override_options.
+ (TARGET_OPTION_COLD_ATTRIBUTE_SETS_OPTIMIZATION): Define.
+ (TARGET_OPTION_HOT_ATTRIBUTE_SETS_OPTIMIZATION): Define.
+
+2008-07-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/36936
+ * config/i386/i386.c (override_options): Don't clear TARGET_CMOVE.
+
+2008-07-25 Martin Jambor <mjambor@suse.cz>
+
+ PR tree-optimization/36926
+ * ipa-prop.c (ipa_analyze_call_uses): Call
+ ipa_is_ssa_with_stmt_def instead of SSA_NAME_IS_DEFAULT_DEF.
+
+2008-07-25 Joseph Myers <joseph@codesourcery.com>
+
+ * config/arm/iwmmxt.md (movv8qi_internal, movv4hi_internal,
+ movv2si_internal): Add mem = reg alternative.
+
+2008-07-25 Andreas Tobler <a.tobler@schweiz.org>
+
+ PR bootstrap/36918
+ * config/sparc/sparc.h (DEFAULT_PCC_STRUCT_RETURN): Define
+ DEFAULT_PCC_STRUCT_RETURN to 127.
+
+2008-07-24 Jan Hubicka <jh@suse.cz>
+
+ * cgraphbuild.c (record_reference): Drop non-unit-at-a-time code.
+ (build_cgraph_edges): Likewise.
+ * cgraph.c (cgraph_node): Do not update assembler hash.
+ (cgraph_remove_node): Drop non-unit-at-a-time code.
+ * tree-pass.h (pass_O0_always_inline): Remove.
+ * ipa-reference.c (gate_reference): Remove unit-at-a-time check.
+ * toplev.c (process_options): Flag unit-at-a-time does not imply
+ no section anchors.
+ * cgraphunit.c: Update comments.
+ (decide_is_function_needed): Drop non-unit-at-a-time mode.
+ (cgraph_assemble_pending_functions): Remove.
+ (cgraph_reset_node): Drop non-unit-at-a-time code.
+ (cgraph_finalize_function): Likewise.
+ (cgraph_analyze_function): Likewise.
+ (cgraph_finalize_compilation_unit): Likewise.
+ (cgraph_expand_function): Likewise.
+ (cgraph_optimize): Likesise.
+ (save_inline_function_body): Likewise.
+ * ipa-pure-const.c (gate_pure_const): Drop flag_unit_at_a_time check.
+ * tree-ssa-alias.c (maybe_be_aliased): Likewise.
+ * ipa-inline.c: Update comments.
+ (enum inlining_mode): remove INLINE_SPEED.
+ (cgraph_clone_inlined_nodes): Drop unit-at-a-time check.
+ (cgraph_mark_inline_edge): Likewise.
+ (try_inline): Likewise.
+ (cgraph_decide_inlining_incrementally): Likewise.
+ (cgraph_gate_inlining): Remove.
+ (cgraph_early_inlining): Remove flag_unit_at_a_time checks.
+ (cgraph_gate_early_inlining): Likewise.
+ (gate_inline_passes): Remove.
+ (pass_inline_parameters, pass_ipa_inline): Remove gates.
+ (cgraph_gate_O0_always_inline, cgraph_O0_always_inline,
+ pass_O0_always_inline): Remove.
+ * c-pch.c (c_pch_matching): Remove -funit-at-a-time.
+ * dwarf2out.c (reference_to_unused): Remove flag_unit_at_a_time check.
+ * opts.c (no_unit_at_a_time_default): Remove.
+ (decode_options): Remove flag_unit_at_a_time reset and warning.
+ * opts.h (no_unit_at_a_time_default): Remove.
+ * c-decl.c (diagnose_mismatched_decls): Do not require inline keyword
+ early in GNU dialect.
+ (merge_decls): Update comment; drop unit-at-a-time check.
+ (finish_decl): Likewise.
+ (grok_declaration): Remove flag_inline_trees code.
+ (finish_functions): Return on function returning non-void on all
+ statics.
+ * ipa-tye-escape.c (gate_type_escape_vars): Remove.
+ * cfgexpand.c (expand_one_static_var): Remove.
+ (expand_one_var): Remove expand_one_static_var call.
+ (expand_used_vars_for_block): Remove flag_unit_a_time check.
+ * c-opts.c (c_common_post_options): Remove flag_inline_trees code
+ and flag_unit_at_a-time compatibility checks.
+ * varasm.c (assemble_alias): Remove flag_unit_at_a_time check.
+ * tree-inline.c (flag_inline_trees): Remove.
+ (inlinable_function_p): Don't check it.
+ (expand_call_inline): Remove non-unit-at-a-time code.
+ * tree-inline.h (flag_inline_trees): Remove.
+ * tree-optimize.c (execute_early_local_optimizations): Remove
+ unit-at-a-time checks.
+ (tree_rest_of_compilation): Likewise.
+ * combine.c (setup_incoming_promotions): Likewise.
+ * tree-profile.c (tree_gen_ic_func_profiler): Likewise.
+ * tree-ssa-structalias.c (delete_points_to_sets): Likewise.
+ * passes.c (pass_inline_parameters): Update comments; remove
+ O0_alwaysinline pass.
+ (execute_one_ipa_transform_pass): Do not reset in_gimple_form.
+ (execute_one_pass): Likewise.
+ * i386.c (ix86_function_regparm): Remove unit-at-a-time check.
+ (ix86_function_sseregparm): Likewise.
+ * arm.c (arm_function_in_section_p): Likewise.
+ * bfin.c (bfin_load_pic_reg, bfin_function_ok_for_sibcall): Likewise.
+ * varpool.c: Update comments.
+ (decide_is_variable_needed): Remove unit-at-a-time checks.
+ (varpool_finalize_decl): Likewise.
+
+2008-07-24 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ * 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.
+
+2008-07-24 Kai Tietz <kai.tietz@onevision.com>
+
+ * config/i386/i386.c (get_dllimport_decl): Treat user_label_prefix for
+ imp symbol extension.
+
+ 2008-07-23 Ian Lance Taylor <iant@google.com>
+
+ * tree-vrp.c (infer_value_range): Ignore asm statements when
+ looking for memory accesses for -fdelete-null-pointer-checks.
+
+2008-07-24 Ben Elliston <bje@au.ibm.com>
+
+ * config/spu/spu-c.c (__vector_keyword): New variable.
+ (vector_keyword): Likewise.
+ (spu_categorize_keyword): New function.
+ (spu_macro_to_expand): Likewise.
+ (spu_cpu_cpp_builtins): Enable context-sensitive macros if not
+ compiling an ISO C dialect.
+
+2008-07-24 Ben Elliston <bje@au.ibm.com>
+
+ * config/rs6000/rs6000-c.c: Move GTY(()) markers to match
+ conventional usage.
+
+2008-07-23 Aaron W. LaFramboise <aaronavay62@aaronwl.com>
+
+ * configure: Regenerate.
+ * configure.ac: Require texinfo 4.7.
+ * doc/install.texi: Document texinfo 4.7 requirement.
+
+2008-07-23 Martin Jambor <mjambor@suse.cz>
+
+ * ipa-cp.c (ipcp_print_edge_profiles): Test for node->analyzed
+ rather than for DECL_SAVED_TREE.
+ * ipa-prop.c: Include diagnostic.h.
+ (ipa_check_stmt_modifications): Check LHS of GIMPLE_MODIFY_EXPRs
+ thoroughly.
+ (ipa_detect_param_modifications): Function rewritten from scratch.
+ (ipa_compute_jump_functions): Changed accesses to modification flags.
+ (ipa_free_node_params_substructures): Update flags destruction.
+ (ipa_node_duplication_hook): Update flags duplication.
+ (ipa_print_all_params_modified): Updated flag access.
+ * ipa-prop.h (struct ipa_param_flags): New structure.
+ (struct ipa_node_params): New field modification_analysis_done,
+ modified_flags changed into param_flags.
+ (ipa_is_ith_param_modified): Changed to use new flags.
+ * Makefile.in (ipa-prop.o): Add $(DIAGNOSTIC_H) to dependencies.
+
+ * ipa-prop.c (ipa_print_all_jump_functions): Moved here from
+ ipa-cp.c and split into two functions.
+ (ipa_print_node_jump_functions): New function.
+ (compute_scalar_jump_functions): New function.
+ (type_like_member_ptr_p): New function.
+ (compute_pass_through_member_ptrs): New function.
+ (fill_member_ptr_cst_jump_function): New function.
+ (determine_cst_member_ptr): New function.
+ (compute_cst_member_ptr_arguments): New function.
+ (ipa_compute_jump_functions): Complete rewrite.
+ * ipa-prop.h (enum jump_func_type): Make explicit that we depend
+ on IPA_UNKNOWN being zero. Added value IPA_CONST_MEMBER_PTR.
+ (struct ipa_member_ptr_cst): New structure.
+ (union jump_func_value): New field member_cst.
+ * ipa-cp.c (ipcp_lat_is_insertable): New function.
+ (ipcp_lattice_from_jfunc): Produces bottom lattices for unhandled
+ jump function types.
+ (ipcp_print_all_lattices): Slight fprintf rearrangement.
+ (ipcp_print_all_structures): Call ipa_print_all_jump_functions
+ instead of ipcp_print_all_jump_functions.
+ (ipcp_insert_stage): Use ipcp_lat_is_insertable, create replace maps
+ only for replacable scalars.
+
+ * doc/invoke.texi (Optimize options): Add description of
+ -findirect-inlining.
+ * common.opt (flag_indirect_inlining): New flag.
+ * opts.c (decode_options): Set flag_indirect_inlining when
+ optimize >= 3.
+
+ * ipa-inline.c: Include ipa-prop.h.
+ (inline_indirect_intraprocedural_analysis): New function.
+ (inline_generate_summary): Allocate parameter and argument info
+ structures, call inline_indirect_intraprocedural_analysis on each
+ node when doing indirect inlining and deallocate indirect inlining
+ data structures in the end.
+ * ipa-prop.c (ipa_create_param_decls_array): Return if already done.
+ (free_all_ipa_structures_after_iinln): New function.
+ (free_all_ipa_structures_after_ipa_cp): Checks whether iinln will be
+ done.
+ * Makefile.in (ipa-inline.o): Added $(IPA_PROP_H) to dependencies.
+
+ * cgraphbuild.c (compute_call_stmt_bb_frequency): New function.
+ (build_cgraph_edges): Call compute_call_stmt_bb_frequency instead
+ of computing the frequency separately.
+ (rebuild_cgraph_edges): Call compute_call_stmt_bb_frequency instead
+ of computing the frequency separately.
+ * ipa-cp.c (ipcp_print_all_structures): Replace a call to
+ ipa_print_all_param_modified with a call to ipa_print_all_param_flags.
+ * ipa-prop.c (ipa_get_member_ptr_load_param): New function.
+ (ipa_get_stmt_member_ptr_load_param): New function.
+ (ipa_is_ssa_with_stmt_def): New function.
+ (ipa_note_param_call): New function.
+ (ipa_analyze_call_uses): New function.
+ (ipa_analyze_stmt_uses): New function.
+ (ipa_analyze_params_uses): New function.
+ (ipa_free_node_params_substructures): Also free the param_calls linked
+ list.
+ (ipa_node_duplication_hook): Also duplicate the param_calls linked list.
+ (ipa_print_node_param_flags): New function.
+ (ipa_print_all_params_modified): Renamed to ipa_print_all_param_flags.
+ (ipa_print_all_param_flags): Calls ipa_print_node_param_flags.
+ * ipa-prop.h (struct ipa_param_flags): New field called.
+ (struct ipa_param_call_note): New structure.
+ (struct ipa_node_params): New fields param_calls and
+ uses_analysis_done.
+ (ipa_is_ith_param_called): New function.
+ * ipa-inline.c (inline_indirect_intraprocedural_analysis): Call
+ ipa_analyze_params_uses and dump parameter flags.
+
+ * ipa-inline.c (cgraph_decide_recursive_inlining): Call
+ ipa_propagate_indirect_call_infos if performing indirect inlining,
+ pass a new parameter new_edges to it.
+ (add_new_edges_to_heap): New fucntion.
+ (cgraph_decide_inlining_of_small_functions): New vector
+ new_indirect_edges for newly found indirect edges , call
+ ipa_propagate_indirect_call_infos after inlining.
+ (cgraph_decide_inlining): Call ipa_propagate_indirect_call_infos after
+ inlining if performing indirect inlining. Call
+ free_all_ipa_structures_after_iinln when doing so too.
+ (inline_generate_summary): Do not call
+ free_all_ipa_structures_after_iinln here.
+ * ipa-prop.c (update_jump_functions_after_inlining): New function.
+ (print_edge_addition_message): New function.
+ (update_call_notes_after_inlining): New function.
+ (propagate_info_to_inlined_callees): New function.
+ (ipa_propagate_indirect_call_infos): New function.
+ * ipa-prop.h: Include cgraph.h
+ (struct ipa_param_call_note): Fields reordered, new field processed.
+ * cgraph.h (cgraph_edge): Shrink loop_nest field to 31 bits, add a new
+ flag indirect_call.
+ * cgraphunit.c (verify_cgraph_node): Allow indirect edges not to have
+ rediscovered call statements.
+ * cgraph.c (cgraph_create_edge): Initialize indirect_call to zero.
+ (dump_cgraph_node): Dump also the indirect_call flag.
+ (cgraph_clone_edge): Copy also the indirect_call flag.
+ * tree-inline.c (copy_bb): Do not check for fndecls from call
+ expressions, check for edge availability when moving clones.
+ (get_indirect_callee_fndecl): New function.
+ (expand_call_inline): If callee declaration is not apprent from
+ the statement, try calling get_indirect_callee_fndecl. Do not
+ issue warnings or call sorry when not inlinings an indirect edge.
+ * Makefile.in (IPA_PROP_H): Added $(CGRAPH_H) to dependencies.
+
+ * ipa-prop.c (ipa_print_node_param_flags): Make the dump format a
+ bit more frandly to matching.
+ * testsuite/g++.dg/ipa/iinline-1.C: New testcase.
+ * testsuite/gcc.dg/ipa/iinline-1.c: New testcase.
+ * testsuite/gcc.dg/ipa/modif-1.c: New testcase.
+
+2008-07-23 Michael Meissner <gnu@the-meissners.org>
+
+ PR 36907
+ * opth-gen.awk: Suppress function specific features when building
+ target libraries.
+ * optc-gen.awk: Ditto.
+
+2008-07-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 35058
+ * diagnostic.c (pedwarn): Add opt parameter.
+ (pedwarn0): New.
+ * c-tree.h (pedwarn_init): Add opt parameter.
+ (pedwarn_c90): Likewise.
+ (pedwarn_c99): Likewise.
+ * c-errors.c (pedwarn_c99): Likewise.
+ (pedwarn_c90): Likewise.
+ * toplev.h (pedwarn): Update declaration.
+ (pedwarn0): Declare.
+ * c-lex.c: All calls to pedwarn changed.
+ * builtins.c: All calls to pedwarn changed.
+ * toplev.c: All calls to pedwarn changed.
+ * c-decl.c: All calls to pedwarn changed.
+ * c-typeck.c: All calls to pedwarn changed.
+ * c-common.c: All calls to pedwarn changed.
+ * c-parser.c: All calls to pedwarn changed.
+
2008-07-23 Michael Meissner <gnu@the-meissners.org>
Karthik Kumar <karthikkumar@gmail.com>
@@ -177,15 +5164,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.
@@ -203,12 +5188,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.
@@ -222,8 +5205,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.
@@ -238,8 +5220,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.
@@ -310,8 +5291,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.
@@ -324,8 +5304,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
@@ -335,8 +5314,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.
@@ -346,8 +5324,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
@@ -374,8 +5351,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,
@@ -403,8 +5379,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>
@@ -464,7 +5440,7 @@
PR tree-opt/36879
* tree-switch-conversion.c (build_one_array): Call
- varpool_mark_needed_node and varpool_finalize_decl
+ varpool_mark_needed_node and varpool_finalize_decl
instead of assemble_variable.
2008-07-19 Jan Hubicka <jh@suse.cz>
@@ -555,7 +5531,7 @@
(gen_array_type_die): Factorize comments about the MIPS_DEBUG_INFO
issues, centralize the nested array types collapsing control and
disable the transformation for Ada.
-
+
2008-07-18 Uros Bizjak <ubizjak@gmail.com>
PR target/36786
@@ -726,8 +5702,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>
@@ -747,10 +5723,10 @@
* config/sh/sh.md (symGOT_load): Don't add REG_EQUAL note.
2008-07-15 Bob Wilson <bob.wilson@acm.org>
-
+
* config/xtensa/libgcc-xtensa.ver: New file.
* config/xtensa/t-linux (SHLIB_MAPFILES): Append libgcc-xtensa.ver.
-
+
2008-07-15 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* df-problems.c (df_set_note): Avoid C++ keywords.
@@ -1002,7 +5978,7 @@
* config/h8300/h8300.md (length): Fix branch offset limit.
-2008-07-11 Anatoly Sokolov <aesok@post.ru>
+2008-07-11 Anatoly Sokolov <aesok@post.ru>
* config/avr/avr-protos.h (avr_peep2_scratch_safe): Remove prototype.
* config/avr/avr.c (avr_peep2_scratch_safe): Remove.
@@ -1141,7 +6117,7 @@
callers.
* omp-low.c (lower_omp_sections, lower_omp_single, lower_omp_master,
lower_omp_ordered, lower_omp_critical, lower_omp_for,
- create_task_copyfn, lower_omp_taskreg, execute_lower_omp):
+ create_task_copyfn, lower_omp_taskreg, execute_lower_omp):
* tree-ssa-ccp.c (convert_to_gimple_builtin): Likewise.
* tree-sra.c (generate_element_init): Likewise.
* tree-mudflap.c (execute_mudflap_function_ops,
@@ -1250,7 +6226,7 @@
* tree-sra.c (sra_build_assignment): Handle CONVERT_EXPR_P dst.
2008-07-05 Daniel Berlin <dberlin@dberlin.org>
-
+
Fix PR tree-optimization/23455
Fix PR tree-optimization/35286
Fix PR tree-optimization/35287
@@ -1303,7 +6279,7 @@
(vn_nary_op_compute_hash): De-staticify.
(vn_nary_op_eq): Ditto.
(vn_nary_op_lookup_pieces): New function.
- (vn_nary_op_lookup): Add new argument.
+ (vn_nary_op_lookup): Add new argument.
(vn_nary_op_insert_pieces): New function.
(vn_nary_op_insert): Add return type. Modify to deal with value ids.
(vn_phi_insert): Ditto.
@@ -1312,7 +6288,7 @@
(visit_reference_op_load): Ditto.
(visit_reference_op_store): Ditto.
(init_scc_vn): Init next_value_id, constant_to_value_id and
- constant_value_ids.
+ constant_value_ids.
(free_scc_vn): Free them.
(set_hashtable_value_ids): New function.
(run_scc_vn): Use it.
@@ -1325,7 +6301,7 @@
above).
* tree.c (iterative_hash_hashval_t): Made non-static
* tree.h (iterative_hash_hashval_t): Declare it.
-
+
2008-07-08 Martin Jambor <mjambor@suse.cz>
* ipa-cp.c (ipcp_init_cloned_node): Call ipa_check_create_node_params
@@ -1357,7 +6333,7 @@
(ipa_register_cgraph_hooks): New function.
(ipa_unregister_cgraph_hooks): New function.
(free_all_ipa_structures_after_ipa_cp): New function.
-
+
* ipa-prop.h: Include vec.h.
(ipa_node_params_t): New typedef with vector types for it.
(ipa_edge_args_t): New typedef with vector types for it.
@@ -1365,10 +6341,10 @@
(IPA_EDGE_REF): Changed to access an on-the-side vector.
(ipa_check_create_node_params): New function.
(ipa_check_create_edge_args): New function.
-
+
* Makefile.in (IPA_PROP_H): New variable for ipa-prop.h. Converted
all users.
-
+
2008-07-07 Tom Tromey <tromey@redhat.com>
* configure, config.in: Rebuilt.
@@ -1451,7 +6427,7 @@
-print-sysroot option.
(main): Print the sysroot if requested.
* doc/invoke.texi (Debugging Options): Document -print-sysroot.
-
+
2008-07-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR target/34780
@@ -1504,7 +6480,7 @@
2008-07-07 Maxim Kuvyrkov <maxim@codesourcery.com>
* config/m68k/m68k.c (m68k_return_in_memory): Fix arguments types.
-
+
2008-07-07 Mark Shinwell <shinwell@codesourcery.com>
* config/m68k/lb1sf68.asm: Add PIC macros for Linux targets.
@@ -1902,7 +6878,7 @@
2008-07-02 Martin Jambor <mjambor@suse.cz>
* tree-switch-conversion.c: Included timevar.h which I forgot before.
-
+
2008-07-02 Martin Jambor <mjambor@suse.cz>
* tree-switch-conversion.c: Included timevar.h
@@ -2030,7 +7006,7 @@
2008-06-30 Kenneth Zadeck <zadeck@naturalbridge.com>
* ifcvt.c (cond_move_process_if_block): Free vectors on false return.
-
+
2008-06-30 Kenneth Zadeck <zadeck@naturalbridge.com>
PR rtl-optimization/34744
@@ -2059,7 +7035,7 @@
(ix86_init_builtins): Here.
(ix86_scalar_mode_supported_p): Always return true for TFmode.
(ix86_c_mode_for_suffix): Always return TFmode and XFmode for
- 'q' and 'w', respectively.
+ 'q' and 'w', respectively.
* config/i386/i386.md (movtf): Check TARGET_SSE2 instead of
TARGET_64BIT.
@@ -2943,7 +7919,7 @@
2008-06-22 Andy Hutchinson <hutchinsonandy@aim.com>
* config/avr/avr.h (SUPPORTS_INIT_PRIORITY): Define.
-
+
2008-06-22 Laurynas Biveinis <laurynas.biveinis@gmail.com>
PR middle-end/34906
@@ -3091,7 +8067,7 @@
* tree-ssa-loop-im.c (mem_ref_in_stmt, memref_hash, memref_eq,
memref_free, gather_mem_refs_stmt, vtoe_hash, vtoe_eq, vtoe_free,
record_vop_access, get_vop_accesses, get_vop_stores): Likewise.
- * tree-ssa-loop-prefetch.c (determine_loop_nest_reuse): Likewise.
+ * tree-ssa-loop-prefetch.c (determine_loop_nest_reuse): Likewise.
* tree-ssa-sccvn.c (VN_INFO_GET, free_phi, free_reference,
vn_nary_op_insert): Likewise.
* tree-ssa.c (redirect_edge_var_map_add,
@@ -3417,20 +8393,20 @@
2008-06-17 Eric B. Weddington <eric.weddington@atmel.com>
* config/avr/avr.c (avr_mcu_t): Remove atmega32hvb.
- * config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): Likewise.
- * config/avr/t-avr (MULTILIB_MATCHES): Likewise.
+ * config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): Likewise.
+ * config/avr/t-avr (MULTILIB_MATCHES): Likewise.
2008-06-17 Eric B. Weddington <eric.weddington@atmel.com>
* config/avr/avr.c (avr_mcu_t): Add attiny167.
- * config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): Likewise.
- * gcc/config/avr/t-avr (MULTILIB_MATCHES): Likewise.
+ * config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): Likewise.
+ * gcc/config/avr/t-avr (MULTILIB_MATCHES): Likewise.
2008-06-17 Eric B. Weddington <eric.weddington@atmel.com>
* config/avr/avr.c (avr_mcu_t): Add atmega32u4.
- * config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): Likewise.
- * config/avr/t-avr (MULTILIB_MATCHES): Likewise.
+ * config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): Likewise.
+ * config/avr/t-avr (MULTILIB_MATCHES): Likewise.
2008-06-17 Bernhard Fischer <aldot@gcc.gnu.org>
@@ -3491,7 +8467,7 @@
(delete_unmarked_insns): Don't handle libcall blocks.
(preserve_libcall_for_dce): Remove.
(prescan_insns_for_dce): Don't special-case libcall block insns.
- * reload1 (reload): Don't handle libcall notes.
+ * reload1 (reload): Don't handle libcall notes.
* doc/rtl.texi (REG_LIBCALL, REG_RETVAL, REG_LIBCALL_ID): Remove
documentation.
@@ -3505,7 +8481,7 @@
* config/avr/avr.c (avr_mcu_t): Add atmega32m1.
* config/avr/avr.h (LINK_SPEC, CRT_BINUTILS_SPECS): Likewise.
- * config/avr/t-avr (MULTILIB_MATCHES): Likewise.
+ * config/avr/t-avr (MULTILIB_MATCHES): Likewise.
2008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
@@ -3526,7 +8502,7 @@
2008-06-015 Andy Hutchinson <hutchinsonandy@aim.com>
PR target/36336
- * config/avr/avr.h (LEGITIMIZE_RELOAD_ADDRESS): Add check for
+ * config/avr/avr.h (LEGITIMIZE_RELOAD_ADDRESS): Add check for
reg_equiv_constant.
2008-06-15 Maxim Kuvyrkov <maxim@codesourcery.com>
@@ -3602,7 +8578,7 @@
Nathan Sidwell <nathan@codesourcery.com>
Maxim Kuvyrkov <maxim@codesourcery.com>
Richard Sandiford <rdsandiford@googlemail.com>
-
+
* config/mips/mips-modes.def: Add V8QI, V4HI and V2SI modes.
* config/mips/mips-protos.h (mips_expand_vector_init): New.
* config/mips/mips-ftypes.def: Add function types for Loongson-2E/2F
@@ -3905,7 +8881,7 @@
2008-06-09 Andy Hutchinson <hutchinsonandy@aim.com>
PR middle-end/36447
- * simplify-rtx.c (simplify_subreg): Add check for shift count
+ * simplify-rtx.c (simplify_subreg): Add check for shift count
greater than size.
2008-06-09 Richard Sandiford <rdsandiford@googlemail.com>
@@ -4020,7 +8996,7 @@
* doc/invoke.texi (Wenum-compare): Mention that it is enabled by
default.
-
+
2008-06-08 Joseph Myers <joseph@codesourcery.com>
PR tree-optimization/36218
@@ -4034,8 +9010,8 @@
PR target/36424
* config/avr/avr.h (HARD_REGNO_RENAME_OK): Define.
- * config/avr/avr.c (avr_hard_regno_rename_ok): New function.
- * config/avr/avr-protos.h (avr_hard_regno_rename_ok): New prototype.
+ * config/avr/avr.c (avr_hard_regno_rename_ok): New function.
+ * config/avr/avr-protos.h (avr_hard_regno_rename_ok): New prototype.
2008-06-07 Danny Smith <dannysmith@users.sourceforge.net>
@@ -4363,7 +9339,7 @@
Rename parallel_nesting_level to taskreg_nesting_level.
(scan_omp_task): New function.
(lower_rec_input_clauses): Don't run constructors for firstprivate
- explicit task vars which are initialized by *_omp_cpyfn*.
+ explicit task vars which are initialized by *_omp_cpyfn*.
Pass outer var ref to omp_clause_default_ctor hook if
OMP_CLAUSE_PRIVATE_OUTER_REF or OMP_CLAUSE_LASTPRIVATE.
Replace OMP_CLAUSE_REDUCTION_PLACEHOLDER decls in
@@ -4637,11 +9613,11 @@
PR target/30243
* builtins.c (expand_builtin_signbit): Don't take lowpart when
- register is already smaller or equal to required mode.
+ register is already smaller or equal to required mode.
2008-06-04 Xinliang David Li <davidxl@google.com>
- * tree-call-cdce.c: New file.
+ * tree-call-cdce.c: New file.
(cond_dead_built_in_calls): New static variable.
(input_domain): New struct.
(check_pow): New function.
@@ -4816,7 +9792,7 @@
* config/i386/mingw32.h (EXTRA_OS_CPP_BUILTINS): Replace
TARGET_64BIT_MS_ABI by DEFAULT_ABI compare to MS_ABI.
-2008-06-02 Andy Hutchinson <hutchinsonandy@aim.com>
+2008-06-02 Andy Hutchinson <hutchinsonandy@aim.com>
PR target/34879
* config/avr/avr.c (TARGET_BUILTIN_SETJMP_FRAME_VALUE): Redefine.
@@ -4952,10 +9928,10 @@
* config/avr/avr.md (UNSPECV_WRITE_SP_IRQ_ON): New constants.
(UNSPECV_WRITE_SP_IRQ_OFF): (Ditto.).
(movhi_sp_r_irq_off, movhi_sp_r_irq_on): New insn.
- * config/avr/avr.c (expand_prologue, expand_epilogue): Use
- movhi_sp_r_irq_off and movhi_sp_r_irq_on insns for writing to the
+ * config/avr/avr.c (expand_prologue, expand_epilogue): Use
+ movhi_sp_r_irq_off and movhi_sp_r_irq_on insns for writing to the
stack pointer register.
- (output_movhi): Remove code for interrupt specific writing to the
+ (output_movhi): Remove code for interrupt specific writing to the
stack pointer register.
2008-05-31 Richard Guenther <rguenther@suse.de>
@@ -5084,7 +10060,7 @@
call clobber check for NMTs.
2008-05-28 Seongbae Park <seongbae.park@gmail.com>
-
+
* value-prof.c (tree_ic_transform): Use HOST_WIDEST_INT_PRINT_DEC
for printing gcov_type.
@@ -5322,9 +10298,9 @@
that the bitfield is of integral type before testing its precision.
2008-05-27 Trevor Smigiel <trevor_smigiel@playstation.sony.com>
- Sa Liu <saliu@de.ibm.com>
+ Sa Liu <saliu@de.ibm.com>
- * config/spu/spu.c (spu_init_libfuncs): Add __multi3, __divti3,
+ * config/spu/spu.c (spu_init_libfuncs): Add __multi3, __divti3,
__modti3, __udivti3, __umodti3 and __udivmodti4.
* config/spu/t-spu-elf (LIB2FUNCS_STATIC_EXTRA): Add files
that implement TImode mul and div functions.
@@ -5363,7 +10339,7 @@
* config/avr/avr.md ("call_prologue_saves"): Use hi8(gs())/lo8(gs())
instead of pm_lo8/pm_hi8 to makes this call working on avr6.
- * config/avr/avr.c (expand_prologue): Tune "call_prologue"
+ * config/avr/avr.c (expand_prologue): Tune "call_prologue"
optimization for 'avr6' architecture.
2008-05-26 Andy Hutchinson <hutchinsonandy@aim.com>
@@ -5901,7 +10877,7 @@
* tree-data-ref.c (dr_analyze_indices): Replace resolve_mixers with
instantiate_scev.
(analyze_siv_subscript): Pass in the loop nest number.
- Call evolution_function_is_affine_in_loop instead of
+ Call evolution_function_is_affine_in_loop instead of
evolution_function_is_affine_p.
(analyze_overlapping_iterations): Pass in the loop nest number.
@@ -5967,7 +10943,7 @@
2008-05-19 Xinliang David Li <davidxl@google.com>
- * tree-ssa-dce.c: Revert patches of 2008-05-17 and 2008-05-18.
+ * tree-ssa-dce.c: Revert patches of 2008-05-17 and 2008-05-18.
* opts.c: Ditto.
* common.opt: Ditto.
* doc/invoke.texi: Ditto.
@@ -6026,7 +11002,7 @@
2008-05-18 Xinliang David Li <davidxl@google.com>
* gcc/tree-ssa-dce.c: Coding style fix.
- (check_pow): Documentation comment.
+ (check_pow): Documentation comment.
(check_log): Documenation comment. Coding style fix.
(is_unnecessary_except_errno_call): Ditto.
(gen_conditions_for_pow): Ditto.
@@ -6034,7 +11010,7 @@
(gen_shrink_wrap_conditions): Ditto.
(shrink_wrap_one_built_in_calls): Ditto.
* gcc/doc/invoke.texi: Better documentation string.
- * ChangeLog: Fix wrong change log entries from
+ * ChangeLog: Fix wrong change log entries from
May 17 checkin on function call DCE.
2008-05-17 Kaz Kojima <kkojima@gcc.gnu.org>
@@ -6046,7 +11022,7 @@
* doc/rtl.texi (RTL_CONST_CALL_P, RTL_PURE_CALL_P): Fixed typos.
* df-problems.c (simulation routines): Fixed block comment to
properly say how to add forwards scanning functions.
-
+
2008-05-17 Eric Botcazou <ebotcazou@adacore.com>
* tree-inline.c (setup_one_parameter): Remove dead code.
@@ -6059,8 +11035,8 @@
2008-05-17 Xinliang David Li <davidxl@google.com>
* gcc/tree-ssa-dce.c (cond_dead_built_in_calls): New static variable.
- (check_pow, check_log, is_unnecessary_except_errno_call): New
- functions to check for eliminating math functions that are pure
+ (check_pow, check_log, is_unnecessary_except_errno_call): New
+ functions to check for eliminating math functions that are pure
except for setting errno.
(gen_conditions_for_pow, gen_conditionas_for_log): New functions to
general condition expressions for shrink-wrapping pow/log calls.
@@ -6123,7 +11099,7 @@
2008-05-16 Kenneth Zadeck <zadeck@naturalbridge.com>
* tree-ssa-dse (max_stmt_uid): Removed.
- (get_stmt_uid, dse_possible_dead_store_p, dse_optimize_stmt,
+ (get_stmt_uid, dse_possible_dead_store_p, dse_optimize_stmt,
tree_ssa_dse): Encapsulate all uses of stmt_ann->uid.
* tree-ssa-sccvn.c (compare_ops, init_scc_vn): Ditto.
* function.h (cfun.last_stmt_uid): New field.
@@ -6202,7 +11178,7 @@
write_summary, read_summary.
* cgraphunit.c (cgraph_process_new_functions): Changed call from
pass_ipa_inline.function_generate_summary, to
- compute_inline_parameters.
+ compute_inline_parameters.
* ipa-inline.c (compute_inline_parameters): Made public and added
node parameter.
(compute_inline_parameters_for_current): New function.
@@ -6212,19 +11188,19 @@
(pass_ipa_inline): Updated for new IPA_PASS structure.
* passes.c (execute_ipa_summary_passes): Now is called once per
pass rather than once per node*pass.
-
+
2008-05-15 Anatoly Sokolov <aesok@post.ru>
- * config/avr/avr.c (avr_base_arch_macro, avr_have_movw_lpmx_p,
+ * config/avr/avr.c (avr_base_arch_macro, avr_have_movw_lpmx_p,
avr_have_mul_p, avr_asm_only_p): Remove variables.
(avr_override_options): Remove initialization of removed variables.
- (avr_file_start): Convert removed variables to fields of
- 'struct base_arch_s *avr_current_arch'.
+ (avr_file_start): Convert removed variables to fields of
+ 'struct base_arch_s *avr_current_arch'.
* config/avr/avr.h (TARGET_CPU_CPP_BUILTINS): (Ditto.).
(AVR_HAVE_MUL): (Ditto.).
(AVR_HAVE_MOVW): (Ditto.).
- (AVR_HAVE_LPMX): (Ditto.).
- (avr_base_arch_macro, avr_have_movw_lpmx_p, avr_have_mul_p,
+ (AVR_HAVE_LPMX): (Ditto.).
+ (avr_base_arch_macro, avr_have_movw_lpmx_p, avr_have_mul_p,
avr_asm_only_p): Remove declaration.
2008-05-15 Diego Novillo <dnovillo@google.com>
@@ -6240,7 +11216,7 @@
(record_truncated_value): Turn it into a for_each_rtx callback.
(record_truncated_values): New function.
(combine_instructions): Call note_uses with record_truncated_values.
- Change name of check_conversion to check_promoted_subreg.
+ Change name of check_conversion to check_promoted_subreg.
2008-05-15 Janis Johnson <janis187@us.ibm.com>
@@ -6524,14 +11500,14 @@
* optabs.c (prepare_cmp_insn): Changed LCT_PURE_MAKE_BLOCK to
LCT_PURE and LCT_CONST_MAKE_BLOCK to LCT_CONST in calls to
- emit_library_call_value.
+ emit_library_call_value.
* builtins.c (expand_builtin_powi, expand_builtin_memcmp): Ditto.
* tree.h (ECF_LIBCALL_BLOCK): Removed.
- * calls.c (initialize_argument_information, precompute_arguments,
+ * calls.c (initialize_argument_information, precompute_arguments,
expand_call, emit_library_call_value_1): Remove ECF_LIBCALL_BLOCK.
(precompute_arguments): Removed flags parameter.
* rtl.h (LCT_CONST_MAKE_BLOCK, LCT_PURE_MAKE_BLOCK): Removed.
-
+
2008-05-14 Richard Guenther <rguenther@suse.de>
* tree-ssa-dse.c (dse_possible_dead_store_p): Remove dead code.
@@ -6719,7 +11695,7 @@
2008-05-10 Kenneth Zadeck <zadeck@naturalbridge.com>
* gcse.c (store_killed_in_insn): Negated call to RTL_CONST_CALL_P.
-
+
2008-05-10 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.c (bdesc_ptest): Removed.
@@ -6862,7 +11838,7 @@
CONVERT_EXPR_P.
(CONVERT_EXPR_P): Define.
(CASE_CONVERT): Define.
-
+
2008-05-08 Kenneth Zadeck <zadeck@naturalbridge.com>
PR middle-end/36117
@@ -6946,7 +11922,7 @@
2008-05-08 David Daney <ddaney@avtrex.com>
Richard Sandiford <rsandifo@nildram.co.uk>
-
+
* config/mips/mips.md (mips_expand_compare_and_swap_12): Handle
special case of constant zero operands.
* config/mips/mips.c (mips_expand_compare_and_swap_12): Zero extend
@@ -7171,9 +12147,9 @@
(analyze_function): Rename DECL_IS_PURE to DECL_PURE_P.
(static_execute): Set looping true for recursive functions.
Undo setting state to IPA_NEITHER for recursive functions.
- * cse.c (cse_insn):
+ * cse.c (cse_insn):
* ifcvt.c (noce_can_store_speculate_p): Changed
- CONST_OR_PURE_CALL_P and pure_call_p to RTL_CONST_CALL_P or
+ CONST_OR_PURE_CALL_P and pure_call_p to RTL_CONST_CALL_P or
RTL_CONST_OR_PURE_CALL_P.
* dse.c (scan_insn): Ditto.
* local-alloc.c (validate_equiv_mem, memref_used_between_p): Ditto.
@@ -7215,7 +12191,7 @@
DECL_PURE_P.
* tree-cfg.c (update_call_expr_flags): Do not clear tree side
effects for looping pure or const calls.
- (verify_gimple_expr): Added verification code.
+ (verify_gimple_expr): Added verification code.
* config/alpha/alpha.c (alpha_legitimize_address,
alpha_emit_xfloating_libcall): Changed CONST_OR_PURE_CALL_P to
RTL_CONST_CALL_P.
@@ -7509,14 +12485,14 @@
(ipcp_redirect): Removed newly unused local variable callee.
(ipcp_redirect): Removed (a bit confusing) local variable type.
(ipcp_insert_stage): Added local variable info.
- (ipcp_cval_changed): Renamed to ipcp_lattice_changed, parameters
+ (ipcp_cval_changed): Renamed to ipcp_lattice_changed, parameters
renamed too
(ipcp_formal_create): Removed.
(ipcp_method_cval_set): Removed.
(ipcp_propagate_stage): Renamed lattice variables.
(ipcp_method_cval_set_cvalue_type): Removed.
(ipcp_method_cval_print): Renamed to ipcp_print_all_lattices
- (ipcp_print_all_lattices): Changed printed strings to refer to
+ (ipcp_print_all_lattices): Changed printed strings to refer to
lattices rather than cvals.
(ipcp_method_cval_init): Renamed to ipcp_initialize_node_lattices
(ipcp_propagate_const): Changed formal parameters.
@@ -7527,7 +12503,7 @@
(ipcp_after_propagate): Renamed to ipcp_change_tops_to_bottom
(ipcp_callsite_param_print): Renamed to ipcp_print_all_jump_functions
(ipcp_profile_mt_count_print): Renamed to ipcp_print_func_profile_counts
- (ipcp_print_func_profile_counts): Changed string from "method" to
+ (ipcp_print_func_profile_counts): Changed string from "method" to
"function"
(ipcp_profile_cs_count_print): Renamed to ipcp_print_call_profile_counts
(ipcp_profile_edge_print): Renamed to ipcp_print_edge_profiles
@@ -7537,7 +12513,7 @@
(ipcp_lat_is_const): Changed parameters and made inline.
(ipcp_replace_map_create): Renamed to ipcp_create_replace_map
(ipcp_redirect): Renamed to ipcp_need_redirect_p
- (ipcp_need_redirect_p): Calls ipcp_lat_is_const instead of using
+ (ipcp_need_redirect_p): Calls ipcp_lat_is_const instead of using
the predicate condition directly
(ipcp_propagate_stage): Added local variable args. Removed local
variable callee. (Both are mere code simplifications.)
@@ -7664,13 +12640,13 @@
* gthr-single.h: Add in required interface elements as per gthr.h.
Add stub types for __gthread_key_t, __gthread_once_t. Add defines
for __GTHREAD_ONCE_INIT, __GTHREAD_RECURSIVE_MUTEX_INIT.
- Generalize UNUSED macro.
+ Generalize UNUSED macro.
(__gthread_once): Add.
(__gthread_key_create): Add.
(__gthread_key_delete): Add.
(__gthread_getspecific): Add.
(__gthread_setspecific): Add.
-
+
2008-05-05 Andrew Pinski <Andrew.Pinski@playstation.sony.com>
* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): If we have
@@ -7752,7 +12728,7 @@
* doc/invoke.texi (max-flow-memory-locations): Removed.
* params.def (PARAM_MAX_FLOW_MEMORY_LOCATIONS): Removed.
-
+
2008-05-03 Richard Guenther <rguenther@suse.de>
PR middle-end/34973
@@ -8034,13 +13010,13 @@
* ipa-cp.c (ipcp_init_stage): Calls ipa_set_called_with_variable_arg
instead of setting number of formal parameters to zero.
- (ipcp_init_stage): Do not set the number of actual parameters to zero
+ (ipcp_init_stage): Do not set the number of actual parameters to zero
either.
(ipcp_propagate_stage): Explicitly skipping all calls to nodes
which are called with variable number of arguments.
(ipcp_insert_stage): Explicitely skipping all nodes which are
called with variable number of arguments.
- (ipcp_callsite_param_print): Skipps callsites to nodes with varaible
+ (ipcp_callsite_param_print): Skipps callsites to nodes with varaible
number of parameters.
* ipa-prop.h (struct ipa_node_params): Added flag
@@ -8052,13 +13028,13 @@
(ipa_is_called_with_var_arguments): Added.
(ipa_get_ith_param): Added. All readers of param_decls converted
to use it instead.
- (ipa_set_cs_argument_count): Added, sole writer to argument_count
- changed to use it.
+ (ipa_set_cs_argument_count): Added, sole writer to argument_count
+ changed to use it.
(ipa_get_cs_argument_count): Added, all readers of argument_count
changed to cal it.
- (ipa_get_ith_jump_func): Added. Accessors of jump values changed
+ (ipa_get_ith_jump_func): Added. Accessors of jump values changed
to use it.
-
+
* ipa-prop.h (struct ipcp_formal): Renamed to ipcp_lattice
(struct ipcp_lattice): Renamed cval_type to type
(struct ipa_node_params): ipcp_cval renamed to ipcp_lattices
@@ -8070,9 +13046,9 @@
(build_const_val): Changed the type of parameter cvalue to tree
(ipcp_propagate_const): Changed the type of parameter cvalue to tree
(ipcp_method_cval_set_cvalue_type): Renamed parameter cval_type1 to type
-
- * ipa-prop.h (struct ipcp_formal): Replaced cvalue with tree called
- constant
+
+ * ipa-prop.h (struct ipcp_formal): Replaced cvalue with tree called
+ constant
* ipa-prop.c (ipa_methodlist_init): Renamed to ipa_init_func_list
(ipa_methodlist_not_empty): Removed, the sole user now checks directly
@@ -8090,7 +13066,7 @@
(ipa_method_tree_map_create): Removed.
(ipa_method_compute_tree_map): Renamed to ipa_create_param_decls_array
(ipa_create_param_decls_array): Creates the array itself
- (ipa_create_param_decls_array): Temporary variable info instead of
+ (ipa_create_param_decls_array): Temporary variable info instead of
a few dereferences.
(ipa_method_formal_compute_count): Renamed to ipa_count_formal_params
(ipa_method_compute_modify): Renamed to ipa_detect_param_modifications
@@ -8102,7 +13078,7 @@
(ipa_edges_create): Renamed to ipa_create_all_edge_args
(ipa_edges_free): Renamed to ipa_free_all_edge_args
(ipa_nodes_free): Integrated into ipa_free_all_node_params and removed
- (ipa_free_all_node_params): Deallocation to jump_functions moved to
+ (ipa_free_all_node_params): Deallocation to jump_functions moved to
ipa_free_all_edge_args
(ipa_method_tree_print): Renamed to ipa_print_all_tree_maps
(ipa_method_modify_print): Renamed to ipa_print_all_params_modified
@@ -8113,22 +13089,22 @@
(ipa_methodlist_next_method_set): Removed.
(ipa_method_is_modified): Removed.
(ipa_method_modify_create): Removed.
- (ipa_method_modify_init): Temporary variable info instead of a few
+ (ipa_method_modify_init): Temporary variable info instead of a few
dereferences.
- (ipa_detect_param_modifications): Temporary variable info instead of
+ (ipa_detect_param_modifications): Temporary variable info instead of
a few dereferences.
- (ipa_compute_jump_functions): Temporary variable info instead of
+ (ipa_compute_jump_functions): Temporary variable info instead of
a few dereferences.
(ipa_method_modify_set): Removed.
(ipa_method_tree_map): Renamed to ipa_get_param_decl_index
- (ipa_get_param_decl_index): Now accepts struct ipa_node_params rather
+ (ipa_get_param_decl_index): Now accepts struct ipa_node_params rather
than craph_node as the first parameter.
(ipa_method_modify_stmt): Renamed to ipa_check_stmt_modifications
(ipa_method_modify_init): Removed.
- (ipa_compute_jump_functions): Added a temp variable instead of
+ (ipa_compute_jump_functions): Added a temp variable instead of
repeatadly dereferencing the cgraph_edge.aux pointer
(ipa_callsite_param_set_type): Removed.
- (ipa_compute_jump_functions): i renamed to index and moved to
+ (ipa_compute_jump_functions): i renamed to index and moved to
an inner block
(ipa_callsite_param_set_info_type_formal): Removed.
(ipa_callsite_param_set_info_type): Removed.
@@ -8139,9 +13115,9 @@
* ipa-prop.h (enum cvalue_type): Renamed to ipa_lattice_type,
prefixed all values with IPA_. Changed all users.
- (enum jump_func_type): Rnamed UNKNOWN_IPATYPE to IPA_UNKNOWN,
- CONST_IPATYPE to IPA_CONST, CONST_IPATYPE_REF to IPA_CONST_REF
- and FORMAL_IPATYPE IPA_PASS_THROUGH.
+ (enum jump_func_type): Rnamed UNKNOWN_IPATYPE to IPA_UNKNOWN,
+ CONST_IPATYPE to IPA_CONST, CONST_IPATYPE_REF to IPA_CONST_REF
+ and FORMAL_IPATYPE IPA_PASS_THROUGH.
(union parameter_info): Renamed to jump_func_value.
(union jump_func_value): Renamed value to constant
(struct ipa_jump_func): Renamed info_type to value
@@ -8298,7 +13274,7 @@
* tree-ssa-loop-manip.c (find_uses_to_rename_use): Only record
uses outside of the loop.
(tree_duplicate_loop_to_header_edge): Only verify loop-closed SSA
- form if it is available.
+ form if it is available.
* tree-flow.h (tree_unroll_loops_completely): Add extra parameter.
* passes.c (init_optimization_passes): Schedule complete inner
loop unrolling pass before the first CCP pass after final inlining.
@@ -8640,9 +13616,9 @@
(init_elim_table): Update.
2008-04-25 Bob Wilson <bob.wilson@acm.org>
-
+
* optabs.c (expand_float): Fix REG_EQUAL for UNSIGNED_FLOAT libcall.
-
+
2008-04-25 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/sse.md (mov<mode>): Replace SSEMODEI with SSEMODE.
@@ -8713,7 +13689,7 @@
of code delimited by two edges in the CFG.
(separate_decls_in_loop_name): Renamed separate_decls_in_region_name.
(separate_decls_in_loop_stmt): Renamed separate_decls_in_region_stmt.
- (separate_decls_in_loop): Renamed separate_decls_in_region. Isolate
+ (separate_decls_in_loop): Renamed separate_decls_in_region. Isolate
the case of parallelisation of reductions.
(expr_invariant_in_region_p): New.
@@ -8880,7 +13856,7 @@
PR middle-end/36003
* passes.c (init_optimization_passes): Remove
pass_fast_rtl_byte_dce.
-
+
2008-04-22 Uros Bizjak <ubizjak@gmail.com>
PR target/29096
@@ -8971,14 +13947,14 @@
* dbgcnt.def (ra_byte_scan): Added.
* dbgcnt.c (dbg_cnt): Added code to print message to dump_file
- when the last hit happens for a counter.
+ when the last hit happens for a counter.
* timevar.def (TV_DF_BYTE_LR): New variable.
* tree-pass.h (pass_fast_rtl_byte_dce): New pass.
* passes.c (pass_fast_rtl_byte_dce): New pass.
* fwprop.c (update_df): Added mode to call df_ref_create.
Renamed DF_REF_WIDTH and DF_REF_OFFSET to DF_REF_EXTRACT_WIDTH and
DF_REF_EXTRACT_OFFSET.
- * df.h (DF_BYTE_LR, DF_BYTE_LR_BB_INFO, DF_BYTE_LR_IN,
+ * df.h (DF_BYTE_LR, DF_BYTE_LR_BB_INFO, DF_BYTE_LR_IN,
DF_BYTE_LR_OUT, df_byte_lr): New macro.
(df_mm): New enum.
(df_ref_extract): Added mode field.
@@ -8986,7 +13962,7 @@
DF_REF_EXTRACT_OFFSET.
(DF_REF_EXTRACT_MODE): New macro.
(df_byte_lr_bb_info): New structure.
- (df_print_byte_regset, df_compute_accessed_bytes,
+ (df_print_byte_regset, df_compute_accessed_bytes,
df_byte_lr_add_problem, df_byte_lr_get_regno_start,
df_byte_lr_get_regno_len, df_byte_lr_simulate_defs,
df_byte_lr_simulate_uses,
@@ -8997,9 +13973,9 @@
(df_byte_lr_get_bb_info): New inline function.
* df-scan.c (df_ref_record, df_uses_record,
df_ref_create_structure): Added mode parameter.
- (df_ref_create, df_notes_rescan, df_ref_record, df_def_record_1,
+ (df_ref_create, df_notes_rescan, df_ref_record, df_def_record_1,
df_defs_record, df_uses_record, df_get_conditional_uses,
- df_get_call_refs, df_insn_refs_collect, df_bb_refs_collect,
+ df_get_call_refs, df_insn_refs_collect, df_bb_refs_collect,
df_entry_block_defs_collect, df_exit_block_uses_collect):
Added mode parameter to calls to df_ref_record, df_uses_record,
df_ref_create_structure.
@@ -9010,25 +13986,25 @@
* df-core.c (df_print_byte_regset): New function.
* df-byte-scan.c: New file.
* df-problems.c (df_rd_transfer_function): Removed unnecessary
- calls to BITMAP_FREE.
+ calls to BITMAP_FREE.
(df_byte_lr_problem_data, df_problem problem_BYTE_LR): New structure.
(df_byte_lr_get_regno_start, df_byte_lr_get_regno_len,
- df_byte_lr_set_bb_info, df_byte_lr_free_bb_info,
- df_byte_lr_check_regs, df_byte_lr_expand_bitmap,
+ df_byte_lr_set_bb_info, df_byte_lr_free_bb_info,
+ df_byte_lr_check_regs, df_byte_lr_expand_bitmap,
df_byte_lr_alloc, df_byte_lr_reset, df_byte_lr_bb_local_compute,
df_byte_lr_local_compute, df_byte_lr_init,
- df_byte_lr_confluence_0, df_byte_lr_confluence_n,
- df_byte_lr_transfer_function, df_byte_lr_free,
+ df_byte_lr_confluence_0, df_byte_lr_confluence_n,
+ df_byte_lr_transfer_function, df_byte_lr_free,
df_byte_lr_top_dump, df_byte_lr_bottom_dump,
- df_byte_lr_add_problem, df_byte_lr_simulate_defs,
+ df_byte_lr_add_problem, df_byte_lr_simulate_defs,
df_byte_lr_simulate_uses,
df_byte_lr_simulate_artificial_refs_at_top,
df_byte_lr_simulate_artificial_refs_at_end): New function.
* dce.c (byte_dce_process_block): New function.
(dce_process_block): au is now passed in rather than computed
locally. Changed loops that look at artificial defs to not look
- for conditional or partial ones, because there never are any.
- (fast_dce): Now is able to drive byte_dce_process_block or
+ for conditional or partial ones, because there never are any.
+ (fast_dce): Now is able to drive byte_dce_process_block or
dce_process_block depending on the kind of dce being done.
(rest_of_handle_fast_dce): Add parameter to fast_dce.
(rest_of_handle_fast_byte_dce): New function.
@@ -9076,14 +14052,14 @@
pointer_may_wrap_p to disable some false positives.
2008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
-
+
* c-common.c (CHAR16_TYPE, CHAR32_TYPE): New macros.
(fname_as_string): Match updated cpp_interpret_string prototype.
(fix_string_type): Support char16_t* and char32_t*.
(c_common_nodes_and_builtins): Add char16_t and char32_t (and
derivative) nodes. Register as builtin if C++0x.
(c_parse_error): Support CPP_CHAR{16,32}.
- * c-common.h (RID_CHAR16, RID_CHAR32): New elements.
+ * c-common.h (RID_CHAR16, RID_CHAR32): New elements.
(enum c_tree_index) <CTI_CHAR16_TYPE, CTI_SIGNED_CHAR16_TYPE,
CTI_UNSIGNED_CHAR16_TYPE, CTI_CHAR32_TYPE, CTI_SIGNED_CHAR32_TYPE,
CTI_UNSIGNED_CHAR32_TYPE, CTI_CHAR16_ARRAY_TYPE,
@@ -9249,7 +14225,7 @@
* config/sh/sh.c (expand_cbranchdi4): Use original operands for
msw_skip comparison.
-
+
2008-04-16 Jakub Jelinek <jakub@redhat.com>
PR c/35739
@@ -9305,7 +14281,7 @@
unused.
Move filter, exc_ptr, ttype_data, ehspec_data, action_record_data and
exception_handler_label_map, ehr_stackadj, ehr_handler, ehr_label,
- sjlj_fc, sjlj_exit_after to rth_eh in function.h.
+ sjlj_fc, sjlj_exit_after to rth_eh in function.h.
Remove call_site_data_used, call_site_data_size.
Turn call_site_record into vector in function.h.
(note_current_region_may_contain_throw): Remove.
@@ -9315,7 +14291,7 @@
add_ttypes_entry, add_ehspec_entry, assign_filter_values,
build_post_landing_pads, dw2_build_landing_pads,
sjlj_assign_call_site_values, sjlj_mark_call_sites,
- sjlj_emit_function_enter, sjlj_emit_function_enter,
+ sjlj_emit_function_enter, sjlj_emit_function_enter,
sjlj_emit_function_exit, sjlj_emit_dispatch_table,
sjlj_build_landing_pads, finish_eh_generation,
remove_exception_handler_label, remove_eh_handler,
@@ -9541,7 +14517,7 @@
(*<code>extendsfdf2): Macroize insn pattern from *absextendsfdf2 and
*negextendsfdf2 patterns using absneg code iterator.
* config/i386/sse.md (<code><mode>2): Macroize expander from
- abs<mode>2 and neg<mode>2 patterns using absneg code iterator.
+ abs<mode>2 and neg<mode>2 patterns using absneg code iterator.
2008-04-10 Andreas Krebbel <krebbel1@de.ibm.com>
@@ -9781,10 +14757,10 @@
2008-04-08 Anatoly Sokolov <aesok@post.ru>
- * config/avr/avr.h (TARGET_CPU_CPP_BUILTINS): Define
- __AVR_HAVE_EIJMP_EICALL__ macro if device have EIJMP and EICALL
+ * config/avr/avr.h (TARGET_CPU_CPP_BUILTINS): Define
+ __AVR_HAVE_EIJMP_EICALL__ macro if device have EIJMP and EICALL
instructions.
- * config/avr/avr.c (avr_mcu_types): Set AVR31 architecture for
+ * config/avr/avr.c (avr_mcu_types): Set AVR31 architecture for
atmega103 device.
2008-04-07 Jan Hubicka <jh@suse.cz>
@@ -9805,7 +14781,7 @@
(assign_stack_local): Update
(expand_function_end): Update.
(get_art_pointer_save_area): Update
- * function.h
+ * function.h
* emit-rtl.c (rtl): Declare.
(regno_reg_rtx): Declare.
(first_insn, last_insn, cur_insn_uid, last_location, first_label_num):
@@ -9900,7 +14876,7 @@
(avr_asm_init_sections): (Ditto.).
(avr_rtx_costs): (Ditto.).
* config/avr/avr.md: (Ditto.).
- * config/avr/avr.h: Use '__AVR_HAVE_JMP_CALL__' instead of
+ * config/avr/avr.h: Use '__AVR_HAVE_JMP_CALL__' instead of
'__AVR_MEGA__'.
2008-04-06 Richard Guenther <rguenther@suse.de>
@@ -10068,7 +15044,7 @@
* c-objc-common.h (LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P):
Rename to LANG_HOOKS_MISSING_NORETURN_OK_P.
-
+
2008-04-04 Jakub Jelinek <jakub@redhat.com>
PR c/35440
@@ -10264,10 +15240,10 @@
2008-04-02 Anatoly Sokolov <aesok@post.ru>
- * config/avr/predicates.md (io_address_operand): New predicate.
+ * config/avr/predicates.md (io_address_operand): New predicate.
* config/avr/avr-protos.h (avr_io_address_p): Remove declaration.
* config/avr/avr.c (avr_io_address_p): Remove function.
- (out_movqi_r_mr): Use 'io_address_operand' predicate instead of
+ (out_movqi_r_mr): Use 'io_address_operand' predicate instead of
'avr_io_address_p' function.
(out_movhi_r_mr): (Ditto.).
(out_movqi_mr_r): (Ditto.).
@@ -10964,7 +15940,7 @@
* config/alpha/x-vms (EXTRA_PROGRAMS): Remove.
* config/t-openbsd-thread: Remove commented out lines.
-
+
* config/x-interix: Remove.
* config/m68hc11/t-m68hc11-gas: Rename to...
@@ -11088,7 +16064,7 @@
(reload_reg_rtx_for_input): New variable.
(reload_reg_rtx_for_output): Likewise.
(emit_input_reload_insns): Use reloadreg rather than rl->reg_rtx
- when reassigning a pseudo register. Load reloadreg from
+ when reassigning a pseudo register. Load reloadreg from
reload_reg_rtx_for_input, moving the mode and register
calculation to...
(do_input_reload): ...here. Use the mode-adjusted reg_rtx
@@ -11130,12 +16106,12 @@
(build/genflags.o): Likewise.
2008-03-25 Bob Wilson <bob.wilson@acm.org>
-
+
* config/xtensa/xtensa.c (xtensa_va_start): Use build_int_cst
instead of size_int for integer types.
(xtensa_gimplify_va_arg_expr): Likewise. Convert index to sizetype
to match type of MINUS_EXPR.
-
+
2008-03-25 Tom Tromey <tromey@redhat.com>
* configure: Rebuilt.
@@ -11253,7 +16229,7 @@
2008-03-25 Naveen.H.S <naveen.hs@kpitcummins.com>
* config/sh/sh.md (prefetch): Add condition for SH2A target.
- (prefetch_sh2a): New.
+ (prefetch_sh2a): New.
2008-03-25 Jayant Sonar <Jayant.sonar@kpitcummins.com>
Naveen.H.S <naveen.hs@kpitcummins.com>
@@ -11306,7 +16282,7 @@
* diagnostic.c (diagnostic_count_diagnostic): Delete.
(diagnostic_report_diagnostic): Update. Handle ICEs here.
-
+
2008-03-24 Nathan Sidwell <nathan@codesourcery.com>
* gthr-vxworks.h (UNUSED): Define.
@@ -11319,7 +16295,7 @@
* doc/extend.texi (Function Attributes): Add missing comma in the
example of the "alloc_size" attribute.
-
+
2008-03-23 Uros Bizjak <ubizjak@gmail.com>
Revert:
@@ -11616,7 +16592,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.
@@ -11797,22 +16773,22 @@
* 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.).
(avr_output_addr_vec_elt): (Ditto.).
(print_operand): Handle "!" code.
- * config/avr/avr.h (TARGET_CPU_CPP_BUILTINS): Add
+ * config/avr/avr.h (TARGET_CPU_CPP_BUILTINS): Add
__AVR_3_BYTE_PC__, __AVR_2_BYTE_PC__ and __AVR_HAVE_JMP_CALL__.
(AVR_HAVE_EIJMP_EICALL): Define.
(AVR_3_BYTE_PC): Redefine.
(AVR_2_BYTE_PC): (Ditto.).
(PRINT_OPERAND_PUNCT_VALID_P): Add '!' code.
(LINK_SPEC): Add atmega2560 and atmega2561.
- (CRT_BINUTILS_SPEC): Add atmega2560 (crtm2560.o) and atmega2561
+ (CRT_BINUTILS_SPEC): Add atmega2560 (crtm2560.o) and atmega2561
(crtm2561.o).
- * config/avr/avr.md (call_insn): Use eicall instead of icall
+ * config/avr/avr.md (call_insn): Use eicall instead of icall
for 3 byte PC devices.
(call_value_insn): (Ditto.).
(*tablejump_enh): Use eijmp instead of ijmp for 3 byte PC devices.
@@ -11820,11 +16796,11 @@
(*tablejump): (Ditto.).
(*indirect_jump_avr6): Add insn.
(*tablejump_rjmp): Don't use for 3 byte PC devices.
- * config/avr/libgcc.S (__prologue_saves__): Use eijmp
+ * config/avr/libgcc.S (__prologue_saves__): Use eijmp
instead of ijmp for 3 byte PC devices.
(__tablejump2__): (Ditto.).
* config/avr/t-avr (MULITLIB_OPTIONS): Add avr6 architecture.
- (MULITLIB_DIRNAMES): (Ditto.).
+ (MULITLIB_DIRNAMES): (Ditto.).
(MULTILIB_MATCHES): Add atmega2560 and atmega2561 to list.
2008-03-15 Uros Bizjak <ubizjak@gmail.com>
@@ -11851,7 +16827,7 @@
being a PHI_NODE.
2008-03-14 Bob Wilson <bob.wilson@acm.org>
-
+
* doc/invoke.texi (Option Summary, Xtensa Options): Document
-mserialize-volatile and -mno-serialize-volatile Xtensa options.
* config/xtensa/xtensa.c (print_operand): Do not emit MEMW instructions
@@ -12469,7 +17445,7 @@
(df_ref_create_structure): Allocate df_ref_extract if offset and
width fields are used.
(df_def_record_1): Get offset and width from ZERO_EXTRACT.
- (df_uses_record): Get offset and width from ZERO_EXTRACT
+ (df_uses_record): Get offset and width from ZERO_EXTRACT
and SIGN_EXTRACT.
* global.c (build_insn_chain): Change DF_REF_EXTRACT to either
DF_REF_ZERO_EXTRACT or DF_REF_SIGN_EXTRACT. Change
@@ -12480,7 +17456,7 @@
(df_ref_extract): New structure.
(DF_REF_WIDTH, DF_REF_OFFSET): New macros.
(df_ref_create): Add width and offset parameters.
-
+
2008-03-05 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (get_constraint_for_component_ref):
@@ -12711,7 +17687,7 @@
* Makefile.in (OBJS-common): Remove struct-equiv.o.
(struct-equiv.o): Remove rule.
* basic-block.h (struct_equiv_checkpoint, STRUCT_EQUIV_*,
- insns_match_p, struct_equiv_block_eq, struct_equiv_init,
+ insns_match_p, struct_equiv_block_eq, struct_equiv_init,
rtx_equiv_p, condjump_equiv_p): Remove prototypes.
2008-03-01 Alexandre Oliva <aoliva@redhat.com>
@@ -12898,7 +17874,7 @@
* tree-vect-analyze.c: Remove unused static decls.
* lambda.h (dependence_level): New.
* common.opt (ftree-loop-distribution): New.
- * tree-flow.h (mark_virtual_ops_in_bb,
+ * tree-flow.h (mark_virtual_ops_in_bb,
slpeel_tree_duplicate_loop_to_edge_cfg,
rename_variables_in_loop): Declared.
* Makefile.in (TREE_DATA_REF_H): Depend on tree-chrec.h.
@@ -13108,7 +18084,7 @@
2008-02-26 Jason Merrill <jason@redhat.com>
PR c++/35315
- * attribs.c (decl_attributes): Leave ATTR_FLAG_TYPE_IN_PLACE
+ * attribs.c (decl_attributes): Leave ATTR_FLAG_TYPE_IN_PLACE
alone if it's the naming decl for the type's main variant.
2008-02-26 Tom Tromey <tromey@redhat.com>
@@ -13202,7 +18178,7 @@
* builtins.c (expand_builtin): Remove BUILT_IN_STDARG_START.
* tree-stdarg.c (execute_optimize_stdarg): Likewise.
* tree-inline.c (inline_forbidden_p_1): Likewise.
-
+
2008-02-26 Richard Guenther <rguenther@suse.de>
* tree-flow.h (uid_decl_map_hash, uid_decl_map_eq): Move ...
@@ -13271,7 +18247,7 @@
Wvolatile-register-var.
* common.opt: Move Wvolatile-register-var to...
* c.opt: ...here.
-
+
2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* common.opt (Wlarger-than=): New.
@@ -13282,7 +18258,7 @@
* opth-gen.awk: Likewise.
* stor-layout.c (layout_decl): Use -Wlarger-than= for warning.
* tree-optimize.c (tree_rest_of_compilation): Likewise.
-
+
2008-02-26 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* c-common.c (match_case_to_enum_1): Add appropriate
@@ -13305,7 +18281,7 @@
(print_ignored_options): New.
(handle_option): Postpone errors for unknown -Wno-* options.
* opts.h (print_ignored_options): Declare.
-
+
2008-02-25 Richard Sandiford <rsandifo@nildram.co.uk>
* config/mips/mips.md (loadgp_blockage, blockage): Change type
@@ -13384,7 +18360,7 @@
PR c/35162
* doc/invoke.texi (-fcx-limited-range): Correct to be in line with
actual behaviour and C99.
-
+
2008-02-26 Ben Elliston <bje@au.ibm.com>
* config/rs6000/rs6000.h (ASM_CPU_POWER5_SPEC): Define.
@@ -13487,7 +18463,7 @@
unused local variable `has_hot_blocks'.
(fix_crossing_conditional_branches): Remove unused local variable
`prev_bb'.
-
+
2008-02-25 Uros Bizjak <ubizjak@gmail.com>
PR middle-end/19984
@@ -13579,7 +18555,7 @@
2008-02-23 Uros Bizjak <ubizjak@gmail.com>
PR target/22076
- PR target/34256
+ PR target/34256
* config/i386/mmx.md (*mov<mode>_internal_rex64): Use "!y" to
prevent reload from using MMX registers.
(*mov<mode>_internal): Ditto.
@@ -13714,7 +18690,7 @@
* config/h8300/h8300.c (h8300_expand_epilogue): Emit return insn
as a jump, not as a plain insn.
-
+
2008-02-20 Seongbae Park <seongbae.park@gmail.com>
* doc/invoke.texi (Warning Options): Add new option
@@ -13767,7 +18743,7 @@
* doc/install.texi: Correct references to CFLAGS, replacing them
with BOOT_CFLAGS. Document flags used during bootstrap for
target libraries.
-
+
2008-02-20 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.h (SSE_VEC_FLOAT_MODE_P): New define.
@@ -13900,7 +18876,7 @@
cannot be disambiguated.
* c.opt (v): Pass on to the common option handler.
-2008-02-19 Revital Eres <eres@il.ibm.com>
+2008-02-19 Revital Eres <eres@il.ibm.com>
* modulo-sched.c (sms_schedule): Change dump message when
create_ddg function fails.
@@ -14022,7 +18998,7 @@
2008-02-17 Uros Bizjak <ubizjak@gmail.com>
Revert:
- 2008-02-15 Uros Bizjak <ubizjak@gmail.com>
+ 2008-02-15 Uros Bizjak <ubizjak@gmail.com>
* config/i386/sfp-machine.h (CMPtype): Define as typedef using
libgcc_cmp_return mode.
@@ -14198,7 +19174,7 @@
Add -fdump-ipa-inline.
* tree-dump.c (dump_files): Remove tree-inlined dump.
* tree-pass.h (tree_dump_index): Remove TDI_inlined.
-
+
2008-02-12 Richard Guenther <rguenther@suse.de>
PR tree-optimization/35171
@@ -14288,7 +19264,7 @@
2008-02-08 Sa Liu <saliu@de.ibm.com>
- * config/spu/spu-builtins.def: Fixed wrong parameter type in spu
+ * config/spu/spu-builtins.def: Fixed wrong parameter type in spu
intrinsics spu_convts, spu_convtu, spu_convtf.
2008-02-08 Hans-Peter Nilsson <hp@axis.com>
@@ -14303,7 +19279,7 @@
optc-gen.awk.
* opts-common.c: Likewise.
* optc-gen.awk: Likewise.
-
+
2008-02-07 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/s390.h (FUNCTION_ARG_REGNO_P): Fix fprs for 64 bit.
@@ -14312,7 +19288,7 @@
PR rtl-opt/33410
* config/alpha/alpha.c (alpha_emit_xfloating_compare): Use an
- EXPR_LIST for the REG_EQUAL instead of a comparison with a
+ EXPR_LIST for the REG_EQUAL instead of a comparison with a
funny mode.
2008-02-07 Uros Bizjak <ubizjak@gmail.com>
@@ -14349,7 +19325,7 @@
2008-02-06 Ralf Corsepius <ralf.corsepius@rtems.org>
- * config/arm/rtems-elf.h (TARGET_OS_CPP_BUILTINS): Add
+ * config/arm/rtems-elf.h (TARGET_OS_CPP_BUILTINS): Add
builtin_define ("__USE_INIT_FINI__").
* config/h8300/t-rtems (MULTILIB_OPTION,MULTILIB_DIRNAMES): Add
-msx multilibs.
@@ -14482,16 +19458,16 @@
* doc/c-tree.texi (Types): Fix grammar.
(Expression trees): Ditto.
* doc/passes.texi (Tree-SSA passes): Ditto.
-
+
* doc/configterms.texi (Configure Terms): Fix typo.
* doc/cpp.texi (Common Predefined Macros): Ditto.
* doc/md.texi (Machine Constraints): Ditto.
-
+
* doc/makefile.texi (Makefile): Add comma.
2008-01-31 Tom Browder <tom.browder@gmail.com>
Gerald Pfeifer <gerald@pfeifer.com>
-
+
* doc/sourcebuild.texi (Front End): Remove references to CVS
and CVSROOT/modules.
(Texinfo Manuals): Replace reference to CVS by one to SVN.
@@ -14512,7 +19488,7 @@
options. Minor fixes.
(-std): Move reference to standards closer to where language
standards are first mentioned.
-
+
2008-01-31 Richard Sandiford <rsandifo@nildram.co.uk>
PR rtl-optimization/34995
@@ -14608,7 +19584,7 @@
2008-01-28 Andy Hutchinson <hutchinsonandy@netscape.net>
PR target/34412
- * config/avr/avr.c (expand_prologue): Use correct QI mode frame
+ * config/avr/avr.c (expand_prologue): Use correct QI mode frame
pointer for tiny stack.
2008-01-28 Bernhard Fischer <aldot@gcc.gnu.org>
@@ -14693,7 +19669,7 @@
Change type of cost to comp_cost.
(determine_iv_cost): Increase cost of non-original ivs, instead
of decreasing the cost of original ones.
- (get_address_cost): Indicate the complexity of the addressing mode
+ (get_address_cost): Indicate the complexity of the addressing mode
in comp_cost.
(try_add_cand_for): Prefer using ivs not specific to some object.
* tree-flow.h (force_expr_to_var_cost): Declaration removed.
@@ -14936,10 +19912,10 @@
* ipa-struct-reorg.c (remove_str_allocs_in_func, remove_str_allocs):
New functions.
(remove_structure): Update allocations list before removing structure.
-
+
2008-01-25 Golovanevsky Olga <olga@il.ibm.com>
- * ipa-struct-reorg.c (is_safe_cond_expr,
+ * ipa-struct-reorg.c (is_safe_cond_expr,
create_new_stmts_for_cond_expr): Use integer_zerop function,
that recognize not only zero-pointer, but zero-integer too.
@@ -14995,7 +19971,7 @@
PR c++/25701
* doc/gcc.texi (Software development): Add a direntry for g++.
-
+
2008-01-23 Hans-Peter Nilsson <hp@axis.com>
* config/cris/cris.h (CC1PLUS_SPEC, OPTIMIZATION_OPTIONS): Drop
@@ -15023,18 +19999,18 @@
(avr_arch_types): Add 'avr31' and 'avr51' entries.
(avr_arch): Add 'ARCH_AVR31' and 'ARCH_AVR51'.
(avr_mcu_types): Add 'avr31' and 'avr51' architectures.
- (avr_override_options): Init 'avr_current_arch'.
+ (avr_override_options): Init 'avr_current_arch'.
(base_arch_s): Move from here...
- * config/avr/avr.h (base_arch_s): ... here. Add new members
- 'have_elpm', 'have_elpmx', 'have_eijmp_eicall', 'reserved'. Rename
+ * config/avr/avr.h (base_arch_s): ... here. Add new members
+ '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__"
+ (TARGET_CPU_CPP_BUILTINS): Define "__AVR_HAVE_JMP_CALL__",
+ "__AVR_HAVE_RAMPZ__", "__AVR_HAVE_ELPM__" and "__AVR_HAVE_ELPMX__"
macros.
- (LINK_SPEC, CRT_BINUTILS_SPECS, ASM_SPEC): Add 'avr31' and 'avr51'
+ (LINK_SPEC, CRT_BINUTILS_SPECS, ASM_SPEC): Add 'avr31' and 'avr51'
architectures.
- * config/avr/t-avr (MULTILIB_OPTIONS, MULTILIB_DIRNAMES,
- MULTILIB_MATCHES): (Ditto.).
+ * config/avr/t-avr (MULTILIB_OPTIONS, MULTILIB_DIRNAMES,
+ MULTILIB_MATCHES): Ditto.
2008-01-23 Richard Guenther <rguenther@suse.de>
@@ -15203,7 +20179,7 @@
2008-01-21 Alon Dayan <alond@il.ibm.com>
Olga Golovanevsky <olga@il.ibm.com>
-
+
PR tree-optimization/34701
* ipa-struct-reorg.c (gen_size): Fix the malloc parameter calculation
when the structure size is not a power of 2.
@@ -15211,7 +20187,7 @@
2008-01-20 Kenneth Zadeck <zadeck@naturalbridge.com>
* doc/install.texi: Add doc for --enable-checking=df.
-
+
2008-01-20 Kaz Kojima <kkojima@gcc.gnu.org>
PR rtl-optimization/34808
@@ -15285,7 +20261,7 @@
(df_live_init): Init the df_live sets only with the variables
found live by df_lr.
(df_live_transfer_function): Use the df_lr sets to prune the
- df_live sets as they are being computed.
+ df_live sets as they are being computed.
(df_live_free): Free df_live_scratch.
2008-01-18 Ian Lance Taylor <iant@google.com>
@@ -15467,7 +20443,7 @@
2008-01-16 Sebastian Pop <sebastian.pop@amd.com>
- * tree-data-ref.c (subscript_dependence_tester_1): Call
+ * tree-data-ref.c (subscript_dependence_tester_1): Call
free_conflict_function.
(compute_self_dependence): Same.
@@ -15506,7 +20482,7 @@
PR c++/24924
* c-opts (c_common_post_options): Do not enable CPP
flag_pedantic_errors by default.
-
+
2008-01-14 Eric Botcazou <ebotcazou@adacore.com>
PR rtl-optimization/31944
@@ -15568,9 +20544,9 @@
correct type.
2008-01-11 Bob Wilson <bob.wilson@acm.org>
-
+
* config/xtensa/xtensa.c (override_options): Set flag_shlib.
-
+
2008-01-11 James E. Wilson <wilson@specifix.com>
PR target/26015
@@ -15578,8 +20554,8 @@
2008-01-11 Anatoly Sokolov <aesok@post.ru>
- * config/avr/avr.c (expand_prologue, expand_epilogue): Don't
- save/restore frame pointer register and don't use 'call-prologues'
+ * config/avr/avr.c (expand_prologue, expand_epilogue): Don't
+ save/restore frame pointer register and don't use 'call-prologues'
optimization in function with "OS_task" attribute.
2008-01-11 Eric Botcazou <ebotcazou@adacore.com>
@@ -15705,13 +20681,13 @@
2008-01-05 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.c (ix86_builtin_reciprocal): Remove check
- for TARGET_RECIP.
-
+ for TARGET_RECIP.
+
2008-01-08 Jan Sjodin <jan.sjodin@amd.com>
-
+
* config/i386/i386.c (k8_cost, amdfam10_cost): Branch costs
for vectorization tuned.
-
+
2008-01-08 Richard Guenther <rguenther@suse.de>
PR tree-optimization/34683
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 89cea871ac7..503b9d23ba3 100644
--- a/gcc/DATESTAMP
+++ b/gcc/DATESTAMP
@@ -1 +1 @@
-20080723
+20080831
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 28d4f5bdcfc..e27d04c8af4 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -113,15 +113,6 @@ VPATH = @srcdir@
vpath %.texi $(gcc_docdir)
vpath %.texi $(gcc_docdir)/include
-# ----
-# Default values for variables overridden in Makefile fragments.
-# These need to be quite early in the Makefile so as to avoid
-# trouble induced by changes in fragment ordering.
-# ----
-
-# For ada/Make-lang.in; overridden in, for example, config/pa/x-ada.
-X_ADA_CFLAGS =
-
# --------
# UNSORTED
# --------
@@ -136,9 +127,11 @@ SUBDIRS =@subdirs@ build
CONFIG_LANGUAGES = @all_selected_languages@
LANGUAGES = c gcov$(exeext) gcov-dump$(exeext) $(CONFIG_LANGUAGES)
-# Various ways of specifying flags for compilations:
+# Default values for variables overridden in Makefile fragments.
# CFLAGS is for the user to override to, e.g., do a cross build with -O2.
# TCFLAGS is used for compilations with the GCC just built.
+# T_CFLAGS is used for all compilations and is overridden by t-* files.
+T_CFLAGS =
TCFLAGS =
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
@@ -198,9 +191,6 @@ WARN_CFLAGS = @warn_cflags@
CPPFLAGS = @CPPFLAGS@
-# These exists to be overridden by the x-* and t-* files, respectively.
-T_CFLAGS =
-
AWK = @AWK@
CC = @CC@
BISON = @BISON@
@@ -269,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)))
# --------
@@ -798,6 +788,8 @@ TREE_H = tree.h all-tree.def tree.def c-common.def $(lang_tree_files) \
BASIC_BLOCK_H = basic-block.h $(BITMAP_H) sbitmap.h varray.h $(PARTITION_H) \
hard-reg-set.h $(PREDICT_H) vec.h $(FUNCTION_H) \
cfghooks.h $(OBSTACK_H)
+GIMPLE_H = gimple.h gimple.def gsstruct.def pointer-set.h vec.h \
+ $(GGC_H) $(BASIC_BLOCK_H) $(TM_H) $(TARGET_H) tree-ssa-operands.h
GCOV_IO_H = gcov-io.h gcov-iov.h auto-host.h
COVERAGE_H = coverage.h $(GCOV_IO_H)
DEMANGLE_H = $(srcdir)/../include/demangle.h
@@ -844,9 +836,8 @@ SYMTAB_H = $(srcdir)/../libcpp/include/symtab.h $(OBSTACK_H)
CPP_ID_DATA_H = $(CPPLIB_H) $(srcdir)/../libcpp/include/cpp-id-data.h
CPP_INTERNAL_H = $(srcdir)/../libcpp/internal.h $(CPP_ID_DATA_H)
TREE_DUMP_H = tree-dump.h $(SPLAY_TREE_H) tree-pass.h
-TREE_GIMPLE_H = tree-gimple.h tree-iterator.h
TREE_FLOW_H = tree-flow.h tree-flow-inline.h tree-ssa-operands.h \
- $(BITMAP_H) $(BASIC_BLOCK_H) hard-reg-set.h $(TREE_GIMPLE_H) \
+ $(BITMAP_H) $(BASIC_BLOCK_H) hard-reg-set.h $(GIMPLE_H) \
$(HASHTAB_H) $(CGRAPH_H) $(IPA_REFERENCE_H)
TREE_SSA_LIVE_H = tree-ssa-live.h $(PARTITION_H) vecprim.h
PRETTY_PRINT_H = pretty-print.h $(INPUT_H) $(OBSTACK_H)
@@ -858,9 +849,10 @@ TREE_DATA_REF_H = tree-data-ref.h $(LAMBDA_H) omega.h graphds.h tree-chrec.h
VARRAY_H = varray.h $(MACHMODE_H) $(SYSTEM_H) coretypes.h $(TM_H)
TREE_INLINE_H = tree-inline.h $(VARRAY_H) pointer-set.h
REAL_H = real.h $(MACHMODE_H)
+IRA_INT_H = ira.h ira-int.h $(CFGLOOP_H) alloc-pool.h
DBGCNT_H = dbgcnt.h dbgcnt.def
EBIMAP_H = ebitmap.h sbitmap.h
-IPA_PROP_H = ipa-prop.h $(TREE_H) vec.h
+IPA_PROP_H = ipa-prop.h $(TREE_H) vec.h $(CGRAPH_H)
GSTAB_H = gstab.h stab.def
BITMAP_H = bitmap.h $(HASHTAB_H) statistics.h
@@ -1091,7 +1083,10 @@ OBJS-common = \
gcse.o \
genrtl.o \
ggc-common.o \
+ gimple.o \
+ gimple-iterator.o \
gimple-low.o \
+ gimple-pretty-print.o \
gimplify.o \
global.o \
graph.o \
@@ -1103,6 +1098,13 @@ OBJS-common = \
init-regs.o \
integrate.o \
intl.o \
+ ira.o \
+ ira-build.o \
+ ira-costs.o \
+ ira-conflicts.o \
+ ira-color.o \
+ ira-emit.o \
+ ira-lives.o \
jump.o \
lambda-code.o \
lambda-mat.o \
@@ -1118,6 +1120,7 @@ OBJS-common = \
loop-unroll.o \
loop-unswitch.o \
lower-subreg.o \
+ mcf.o \
mode-switching.o \
modulo-sched.o \
omega.o \
@@ -1182,7 +1185,6 @@ OBJS-common = \
tree-dfa.o \
tree-dump.o \
tree-eh.o \
- tree-gimple.o \
tree-if-conv.o \
tree-into-ssa.o \
tree-iterator.o \
@@ -1687,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
@@ -1794,12 +1797,12 @@ c-decl.o : c-decl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(EXPR_H) debug.h $(TOPLEV_H) intl.h $(TM_P_H) $(TREE_INLINE_H) $(TIMEVAR_H) \
opts.h $(C_PRAGMA_H) gt-c-decl.h $(CGRAPH_H) $(HASHTAB_H) libfuncs.h \
except.h $(LANGHOOKS_DEF_H) $(TREE_DUMP_H) $(C_COMMON_H) $(CPPLIB_H) \
- $(DIAGNOSTIC_H) $(INPUT_H) langhooks.h $(TREE_GIMPLE_H) tree-mudflap.h \
- pointer-set.h $(BASIC_BLOCK_H)
+ $(DIAGNOSTIC_H) $(INPUT_H) langhooks.h $(GIMPLE_H) tree-mudflap.h \
+ pointer-set.h $(BASIC_BLOCK_H) $(GIMPLE_H) tree-iterator.h
c-typeck.o : c-typeck.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(C_TREE_H) $(TARGET_H) $(FLAGS_H) intl.h output.h $(EXPR_H) \
$(RTL_H) $(TOPLEV_H) $(TM_P_H) langhooks.h $(GGC_H) $(TREE_FLOW_H) \
- $(TREE_GIMPLE_H) tree-iterator.h
+ $(GIMPLE_H) tree-iterator.h
c-lang.o : c-lang.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(C_TREE_H) $(DIAGNOSTIC_H) \
$(GGC_H) langhooks.h $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-c.h \
@@ -1860,7 +1863,8 @@ c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(DIAGNOSTIC_H) gt-c-common.h langhooks.h $(VARRAY_H) $(RTL_H) \
$(TARGET_H) $(C_TREE_H) tree-iterator.h langhooks.h tree-mudflap.h \
intl.h opts.h $(REAL_H) $(CPPLIB_H) $(TREE_INLINE_H) $(HASHTAB_H) \
- $(BUILTINS_DEF) $(CGRAPH_H) $(BASIC_BLOCK_H) $(TARGET_DEF_H)
+ $(BUILTINS_DEF) $(CGRAPH_H) $(BASIC_BLOCK_H) $(TARGET_DEF_H) \
+ $(GIMPLE_H)
c-pretty-print.o : c-pretty-print.c $(C_PRETTY_PRINT_H) \
$(C_TREE_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(REAL_H) \
@@ -1875,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)
@@ -1893,8 +1898,8 @@ c-format.o : c-format.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) la
c-semantics.o : c-semantics.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(FLAGS_H) $(TOPLEV_H) output.h $(RTL_H) $(GGC_H) \
$(PREDICT_H) $(TREE_INLINE_H) $(C_COMMON_H) except.h $(FUNCTION_H) \
- langhooks.h $(SPLAY_TREE_H) $(TIMEVAR_H) $(TREE_GIMPLE_H) \
- $(VARRAY_H)
+ langhooks.h $(SPLAY_TREE_H) $(TIMEVAR_H) $(GIMPLE_H) \
+ $(VARRAY_H) tree-iterator.h
c-dump.o : c-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(C_TREE_H) $(TREE_DUMP_H)
@@ -1907,7 +1912,7 @@ c-pch.o : c-pch.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(CPPLIB_H) $(TREE_H) \
$< $(OUTPUT_OPTION)
c-omp.o : c-omp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- $(FUNCTION_H) $(C_COMMON_H) $(TOPLEV_H) $(TREE_GIMPLE_H) $(BITMAP_H) \
+ $(FUNCTION_H) $(C_COMMON_H) $(TOPLEV.H) $(GIMPLE_H) $(BITMAP_H) \
langhooks.h
# Language-independent files.
@@ -2022,7 +2027,7 @@ double-int.o: double-int.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H)
langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(TOPLEV_H) $(TREE_INLINE_H) $(RTL_H) insn-config.h $(INTEGRATE_H) \
langhooks.h $(TARGET_H) $(LANGHOOKS_DEF_H) $(FLAGS_H) $(GGC_H) $(DIAGNOSTIC_H) \
- intl.h $(TREE_GIMPLE_H)
+ intl.h $(GIMPLE_H)
tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
all-tree.def $(FLAGS_H) $(FUNCTION_H) $(PARAMS_H) \
$(TOPLEV_H) $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h \
@@ -2034,11 +2039,12 @@ tree-dump.o: tree-dump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
tree-inline.o : tree-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(RTL_H) $(EXPR_H) $(FLAGS_H) $(PARAMS_H) $(INPUT_H) insn-config.h \
$(VARRAY_H) $(HASHTAB_H) $(TOPLEV_H) langhooks.h $(TREE_INLINE_H) $(CGRAPH_H) \
- intl.h $(FUNCTION_H) $(GGC_H) $(TREE_GIMPLE_H) \
+ intl.h $(FUNCTION_H) $(GGC_H) $(GIMPLE_H) \
debug.h $(DIAGNOSTIC_H) except.h $(TREE_FLOW_H) tree-iterator.h tree-mudflap.h \
$(IPA_PROP_H) value-prof.h tree-pass.h $(TARGET_H) $(INTEGRATE_H)
print-tree.o : print-tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- $(GGC_H) langhooks.h $(REAL_H) tree-iterator.h fixed-value.h $(TREE_FLOW_H)
+ $(GGC_H) langhooks.h $(REAL_H) tree-iterator.h fixed-value.h \
+ $(DIAGNOSTIC_H) $(TREE_FLOW_H)
stor-layout.o : stor-layout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(PARAMS_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) output.h $(RTL_H) \
$(GGC_H) $(TM_P_H) $(TARGET_H) langhooks.h $(REGS_H) gt-stor-layout.h \
@@ -2047,7 +2053,7 @@ tree-ssa-structalias.o: tree-ssa-structalias.c tree-ssa-structalias.h \
$(SYSTEM_H) $(CONFIG_H) coretypes.h $(TM_H) $(GGC_H) $(OBSTACK_H) $(BITMAP_H) \
$(FLAGS_H) $(RTL_H) $(TM_P_H) hard-reg-set.h $(BASIC_BLOCK_H) output.h errors.h \
$(DIAGNOSTIC_H) $(TREE_H) $(C_COMMON_H) $(TREE_FLOW_H) $(TREE_INLINE_H) varray.h \
- $(C_TREE_H) $(TREE_GIMPLE_H) $(HASHTAB_H) $(FUNCTION_H) $(CGRAPH_H) tree-pass.h \
+ $(C_TREE_H) $(GIMPLE_H) $(HASHTAB_H) $(FUNCTION_H) $(CGRAPH_H) tree-pass.h \
$(TIMEVAR_H) alloc-pool.h $(SPLAY_TREE_H) $(PARAMS_H) gt-tree-ssa-structalias.h \
$(CGRAPH_H) $(ALIAS_H) pointer-set.h
tree-ssa.o : tree-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
@@ -2055,13 +2061,13 @@ tree-ssa.o : tree-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(TOPLEV_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \
$(TREE_DUMP_H) langhooks.h tree-pass.h $(BASIC_BLOCK_H) $(BITMAP_H) \
$(FLAGS_H) $(GGC_H) hard-reg-set.h $(HASHTAB_H) pointer-set.h \
- $(TREE_GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H)
+ $(GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H)
tree-into-ssa.o : tree-into-ssa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) output.h $(DIAGNOSTIC_H) \
$(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
langhooks.h domwalk.h tree-pass.h $(GGC_H) $(PARAMS_H) $(BASIC_BLOCK_H) \
$(BITMAP_H) $(CFGLOOP_H) $(FLAGS_H) hard-reg-set.h $(HASHTAB_H) \
- $(TREE_GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) vecprim.h
+ $(GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) vecprim.h
tree-ssa-ter.o : tree-ssa-ter.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(TREE_H) $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
$(TREE_SSA_LIVE_H) $(BITMAP_H)
@@ -2078,7 +2084,7 @@ tree-ssa-dse.o : tree-ssa-dse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
tree-ssa-forwprop.o : tree-ssa-forwprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) \
$(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \
- langhooks.h $(FLAGS_H)
+ langhooks.h $(FLAGS_H) $(GIMPLE_H)
tree-ssa-phiprop.o : tree-ssa-phiprop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(TM_P_H) $(BASIC_BLOCK_H) \
$(TREE_FLOW_H) tree-pass.h $(TREE_DUMP_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \
@@ -2103,7 +2109,7 @@ tree-ssa-propagate.o : tree-ssa-propagate.c $(TREE_FLOW_H) $(CONFIG_H) \
$(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \
$(TREE_DUMP_H) $(BASIC_BLOCK_H) tree-pass.h langhooks.h \
tree-ssa-propagate.h vec.h value-prof.h gt-tree-ssa-propagate.h $(FLAGS_H) \
- $(VARRAY_H)
+ $(VARRAY_H) $(GIMPLE_H)
tree-ssa-dom.o : tree-ssa-dom.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h $(DIAGNOSTIC_H) \
$(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
@@ -2127,7 +2133,7 @@ tree-ssanames.o : tree-ssanames.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(VARRAY_H) $(GGC_H) $(TREE_FLOW_H)
tree-phinodes.o : tree-phinodes.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(VARRAY_H) $(GGC_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) \
- gt-tree-phinodes.h $(RTL_H) $(TOPLEV_H)
+ gt-tree-phinodes.h $(RTL_H) $(TOPLEV.H) $(GIMPLE_H)
domwalk.o : domwalk.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) domwalk.h $(GGC_H)
tree-ssa-live.o : tree-ssa-live.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
@@ -2136,18 +2142,18 @@ tree-ssa-live.o : tree-ssa-live.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
tree-ssa-copyrename.o : tree-ssa-copyrename.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(TREE_H) $(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) tree-pass.h \
$(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_SSA_LIVE_H) $(BASIC_BLOCK_H) \
- $(BITMAP_H) $(FLAGS_H) $(HASHTAB_H) langhooks.h $(TREE_GIMPLE_H) \
- $(TREE_INLINE_H)
+ $(BITMAP_H) $(FLAGS_H) $(HASHTAB_H) langhooks.h $(GIMPLE_H) \
+ $(TREE_INLINE_H) $(GIMPLE_H)
tree-ssa-pre.o : tree-ssa-pre.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) $(FIBHEAP_H) \
$(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) langhooks.h $(CFGLOOP_H) \
- alloc-pool.h $(BASIC_BLOCK_H) $(BITMAP_H) $(HASHTAB_H) $(TREE_GIMPLE_H) \
+ alloc-pool.h $(BASIC_BLOCK_H) $(BITMAP_H) $(HASHTAB_H) $(GIMPLE_H) \
$(TREE_INLINE_H) tree-iterator.h tree-ssa-sccvn.h $(PARAMS_H) \
$(DBGCNT_H)
tree-ssa-sccvn.o : tree-ssa-sccvn.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) $(FIBHEAP_H) \
$(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) $(CFGLOOP_H) \
- alloc-pool.h $(BASIC_BLOCK_H) $(BITMAP_H) langhooks.h $(HASHTAB_H) $(TREE_GIMPLE_H) \
+ alloc-pool.h $(BASIC_BLOCK_H) $(BITMAP_H) langhooks.h $(HASHTAB_H) $(GIMPLE_H) \
$(TREE_INLINE_H) tree-iterator.h tree-ssa-propagate.h tree-ssa-sccvn.h \
$(PARAMS_H)
tree-vrp.o : tree-vrp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
@@ -2178,10 +2184,10 @@ tree-ssa-sink.o : tree-ssa-sink.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \
$(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) alloc-pool.h \
$(BASIC_BLOCK_H) $(BITMAP_H) $(CFGLOOP_H) $(FIBHEAP_H) $(HASHTAB_H) \
- langhooks.h $(REAL_H) $(TREE_GIMPLE_H) $(TREE_INLINE_H) tree-iterator.h
+ langhooks.h $(REAL_H) $(GIMPLE_H) $(TREE_INLINE_H) tree-iterator.h
tree-nested.o: tree-nested.c $(CONFIG_H) $(SYSTEM_H) $(TM_H) $(TREE_H) \
$(RTL_H) $(TM_P_H) $(FUNCTION_H) $(TREE_DUMP_H) $(TREE_INLINE_H) \
- tree-iterator.h $(TREE_GIMPLE_H) $(CGRAPH_H) $(EXPR_H) langhooks.h \
+ tree-iterator.h $(GIMPLE_H) $(CGRAPH_H) $(EXPR_H) langhooks.h \
$(GGC_H) gt-tree-nested.h coretypes.h $(TREE_FLOW_H) pointer-set.h
tree-if-conv.o: tree-if-conv.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(FLAGS_H) $(TIMEVAR_H) $(BASIC_BLOCK_H) $(TREE_FLOW_H) \
@@ -2189,13 +2195,13 @@ tree-if-conv.o: tree-if-conv.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(SCEV_H) tree-pass.h $(DIAGNOSTIC_H) $(TARGET_H) $(TREE_DUMP_H) \
$(VARRAY_H)
tree-iterator.o : tree-iterator.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
- coretypes.h $(GGC_H) tree-iterator.h $(TREE_GIMPLE_H) gt-tree-iterator.h
+ coretypes.h $(GGC_H) tree-iterator.h $(GIMPLE_H) gt-tree-iterator.h
tree-dfa.o : tree-dfa.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h $(DIAGNOSTIC_H) \
$(TREE_INLINE_H) $(HASHTAB_H) pointer-set.h $(FLAGS_H) $(FUNCTION_H) \
$(TIMEVAR_H) convert.h $(TM_H) coretypes.h langhooks.h $(TREE_DUMP_H) \
tree-pass.h $(PARAMS_H) $(CGRAPH_H) $(BASIC_BLOCK_H) hard-reg-set.h \
- $(TREE_GIMPLE_H)
+ $(GIMPLE_H)
tree-ssa-operands.o : tree-ssa-operands.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) $(TREE_INLINE_H) \
$(FLAGS_H) $(FUNCTION_H) $(TM_H) $(TIMEVAR_H) tree-pass.h $(TOPLEV_H) \
@@ -2250,7 +2256,7 @@ tree-ssa-loop-ivopts.o : tree-ssa-loop-ivopts.c $(TREE_FLOW_H) $(CONFIG_H) \
$(CFGLOOP_H) $(PARAMS_H) langhooks.h $(BASIC_BLOCK_H) hard-reg-set.h \
tree-chrec.h $(VARRAY_H) tree-affine.h pointer-set.h $(TARGET_H)
tree-affine.o : tree-affine.c tree-affine.h $(CONFIG_H) pointer-set.h \
- $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) hard-reg-set.h $(TREE_GIMPLE_H) \
+ $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) hard-reg-set.h $(GIMPLE_H) \
output.h $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H) $(FLAGS_H)
tree-ssa-loop-manip.o : tree-ssa-loop-manip.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) $(TM_P_H) hard-reg-set.h \
@@ -2274,12 +2280,12 @@ tree-ssa-alias.o : tree-ssa-alias.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) $(TREE_INLINE_H) $(FLAGS_H) \
$(FUNCTION_H) $(TIMEVAR_H) convert.h $(TM_H) coretypes.h langhooks.h \
$(TREE_DUMP_H) tree-pass.h $(PARAMS_H) $(BASIC_BLOCK_H) $(DIAGNOSTIC_H) \
- hard-reg-set.h $(TREE_GIMPLE_H) vec.h tree-ssa-structalias.h \
+ hard-reg-set.h $(GIMPLE_H) vec.h tree-ssa-structalias.h \
$(IPA_TYPE_ESCAPE_H) vecprim.h pointer-set.h alloc-pool.h
tree-ssa-reassoc.o : tree-ssa-reassoc.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(TREE_H) $(GGC_H) $(DIAGNOSTIC_H) errors.h $(TIMEVAR_H) \
$(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) tree-iterator.h\
- $(BASIC_BLOCK_H) $(TREE_GIMPLE_H) $(TREE_INLINE_H) vec.h langhooks.h \
+ $(BASIC_BLOCK_H) $(GIMPLE_H) $(TREE_INLINE_H) vec.h langhooks.h \
alloc-pool.h pointer-set.h $(CFGLOOP_H)
tree-optimize.o : tree-optimize.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_P_H) hard-reg-set.h $(EXPR_H) $(GGC_H) output.h \
@@ -2289,25 +2295,28 @@ tree-optimize.o : tree-optimize.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(CFGLOOP_H) except.h
c-gimplify.o : c-gimplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
- $(C_TREE_H) $(C_COMMON_H) $(DIAGNOSTIC_H) $(TREE_GIMPLE_H) $(VARRAY_H) \
+ $(C_TREE_H) $(C_COMMON_H) $(DIAGNOSTIC_H) $(GIMPLE_H) $(VARRAY_H) \
$(FLAGS_H) langhooks.h $(TOPLEV_H) $(RTL_H) $(TREE_FLOW_H) $(LANGHOOKS_DEF_H) \
$(TM_H) coretypes.h $(C_PRETTY_PRINT_H) $(CGRAPH_H) $(BASIC_BLOCK_H) \
hard-reg-set.h $(TREE_DUMP_H) $(TREE_INLINE_H)
-gimplify.o : gimplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
- $(DIAGNOSTIC_H) $(TREE_GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) langhooks.h \
+gimplify.o : gimplify.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(GIMPLE_H) \
+ $(DIAGNOSTIC_H) $(GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) langhooks.h \
$(LANGHOOKS_DEF_H) $(TREE_FLOW_H) $(CGRAPH_H) $(TIMEVAR_H) $(TM_H) \
coretypes.h except.h $(FLAGS_H) $(RTL_H) $(FUNCTION_H) $(EXPR_H) output.h \
$(GGC_H) gt-gimplify.h $(HASHTAB_H) $(TARGET_H) $(TOPLEV_H) $(OPTABS_H) \
- $(REAL_H) $(SPLAY_TREE_H)
+ $(REAL_H) $(SPLAY_TREE_H) vec.h tree-iterator.h
+gimple-iterator.o : gimple-iterator.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TREE_H) $(GIMPLE_H) $(TREE_FLOW_H) value-prof.h
gimple-low.o : gimple-low.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
- $(DIAGNOSTIC_H) $(TREE_GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) langhooks.h \
+ $(DIAGNOSTIC_H) $(GIMPLE_H) $(TREE_INLINE_H) $(VARRAY_H) langhooks.h \
$(LANGHOOKS_DEF_H) $(TREE_FLOW_H) $(TIMEVAR_H) $(TM_H) coretypes.h \
except.h $(FLAGS_H) $(RTL_H) $(FUNCTION_H) $(EXPR_H) tree-pass.h \
- $(HASHTAB_H) $(TOPLEV_H)
+ $(HASHTAB_H) $(TOPLEV.H) tree-iterator.h
omp-low.o : omp-low.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- $(RTL_H) $(TREE_GIMPLE_H) $(TREE_INLINE_H) langhooks.h $(DIAGNOSTIC_H) \
+ $(RTL_H) $(GIMPLE_H) $(TREE_INLINE_H) langhooks.h $(DIAGNOSTIC_H) \
$(TREE_FLOW_H) $(TIMEVAR_H) $(FLAGS_H) $(EXPR_H) $(TOPLEV_H) tree-pass.h \
- $(GGC_H) except.h $(SPLAY_TREE_H) $(OPTABS_H) $(CFGLOOP_H)
+ $(GGC_H) except.h $(SPLAY_TREE_H) $(OPTABS_H) $(CFGLOOP_H) \
+ tree-iterator.h
tree-browser.o : tree-browser.c tree-browser.def $(CONFIG_H) $(SYSTEM_H) \
$(TREE_H) $(TREE_INLINE_H) $(DIAGNOSTIC_H) $(HASHTAB_H) \
$(TM_H) coretypes.h
@@ -2344,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) \
@@ -2365,16 +2374,19 @@ tree-stdarg.o: tree-stdarg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
tree-object-size.o: tree-object-size.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(TOPLEV_H) $(DIAGNOSTIC_H) $(TREE_FLOW_H) tree-pass.h \
tree-ssa-propagate.h
-tree-gimple.o : tree-gimple.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(EXPR_H) \
- $(RTL_H) $(TREE_GIMPLE_H) $(TM_H) coretypes.h $(BITMAP_H) $(GGC_H) \
- output.h $(TREE_FLOW_H)
+gimple.o : gimple.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \
+ $(GGC_H) $(GIMPLE_H) $(GIMPLE_H) $(DIAGNOSTIC_H) gt-gimple.h \
+ $(TREE_FLOW_H) value-prof.h $(FLAGS_H)
+gimple-pretty-print.o : gimple-pretty-print.c $(CONFIG_H) $(SYSTEM_H) \
+ $(TREE_H) $(DIAGNOSTIC_H) $(REAL_H) $(HASHTAB_H) $(TREE_FLOW_H) \
+ $(TM_H) coretypes.h tree-pass.h $(GIMPLE_H) value-prof.h
tree-mudflap.o : $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TREE_INLINE_H) \
- $(TREE_GIMPLE_H) $(DIAGNOSTIC_H) $(HASHTAB_H) langhooks.h tree-mudflap.h \
+ $(GIMPLE_H) $(DIAGNOSTIC_H) $(HASHTAB_H) langhooks.h tree-mudflap.h \
$(TM_H) coretypes.h $(TREE_DUMP_H) tree-pass.h $(CGRAPH_H) $(GGC_H) \
gt-tree-mudflap.h $(BASIC_BLOCK_H) $(FLAGS_H) $(FUNCTION_H) hard-reg-set.h \
- $(RTL_H) $(TM_P_H) $(TREE_FLOW_H) $(TOPLEV_H)
+ $(RTL_H) $(TM_P_H) $(TREE_FLOW_H) $(TOPLEV.H) $(GIMPLE_H) tree-iterator.h
tree-nomudflap.o : $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(TREE_INLINE_H) \
- $(C_TREE_H) $(C_COMMON_H) $(TREE_GIMPLE_H) $(DIAGNOSTIC_H) $(HASHTAB_H) \
+ $(C_TREE_H) $(C_COMMON_H) $(GIMPLE_H) $(DIAGNOSTIC_H) $(HASHTAB_H) \
output.h $(VARRAY_H) langhooks.h tree-mudflap.h $(TM_H) coretypes.h \
$(GGC_H) gt-tree-mudflap.h tree-pass.h $(TOPLEV_H)
tree-pretty-print.o : tree-pretty-print.c $(CONFIG_H) $(SYSTEM_H) \
@@ -2383,12 +2395,13 @@ tree-pretty-print.o : tree-pretty-print.c $(CONFIG_H) $(SYSTEM_H) \
value-prof.h fixed-value.h output.h
fold-const.o : fold-const.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(FLAGS_H) $(REAL_H) $(TOPLEV_H) $(HASHTAB_H) $(EXPR_H) $(RTL_H) \
- $(GGC_H) $(TM_P_H) langhooks.h $(MD5_H) intl.h fixed-value.h $(TARGET_H)
+ $(GGC_H) $(TM_P_H) langhooks.h $(MD5_H) intl.h fixed-value.h $(TARGET_H) \
+ $(GIMPLE_H)
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) \
@@ -2403,10 +2416,10 @@ toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(INSN_ATTR_H) output.h $(DIAGNOSTIC_H) debug.h insn-config.h intl.h \
$(RECOG_H) Makefile $(TOPLEV_H) dwarf2out.h sdbout.h dbxout.h $(EXPR_H) \
hard-reg-set.h $(BASIC_BLOCK_H) graph.h except.h $(REGS_H) $(TIMEVAR_H) \
- value-prof.h $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \
+ value-prof.h $(PARAMS_H) $(TM_P_H) reload.h ira.h dwarf2asm.h $(TARGET_H) \
langhooks.h insn-flags.h $(CFGLAYOUT_H) $(CFGLOOP_H) hosthooks.h \
$(CGRAPH_H) $(COVERAGE_H) alloc-pool.h $(GGC_H) $(INTEGRATE_H) \
- opts.h params.def tree-mudflap.h $(REAL_H) tree-pass.h
+ opts.h params.def tree-mudflap.h $(REAL_H) tree-pass.h $(GIMPLE_H)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
-DTARGET_NAME=\"$(target_noncanonical)\" \
-c $(srcdir)/toplev.c $(OUTPUT_OPTION)
@@ -2448,7 +2461,7 @@ varasm.o : varasm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(HASHTAB_H) $(TARGET_H) langhooks.h gt-varasm.h $(BASIC_BLOCK_H) \
$(CFGLAYOUT_H) $(CGRAPH_H) targhooks.h tree-mudflap.h $(REAL_H) tree-iterator.h
function.o : function.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(TREE_H) $(CFGLAYOUT_H) $(TREE_GIMPLE_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) \
+ $(TREE_H) $(CFGLAYOUT_H) $(GIMPLE_H) $(FLAGS_H) $(FUNCTION_H) $(EXPR_H) \
$(OPTABS_H) libfuncs.h $(REGS_H) hard-reg-set.h insn-config.h $(RECOG_H) \
output.h $(TOPLEV_H) except.h $(HASHTAB_H) $(GGC_H) $(TM_P_H) langhooks.h \
gt-function.h $(TARGET_H) $(BASIC_BLOCK_H) $(INTEGRATE_H) $(PREDICT_H) \
@@ -2475,9 +2488,9 @@ expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
tree-pass.h $(DF_H) $(DIAGNOSTIC_H) vecprim.h
dojump.o : dojump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
$(FLAGS_H) $(FUNCTION_H) $(EXPR_H) $(OPTABS_H) $(INSN_ATTR_H) insn-config.h \
- langhooks.h $(GGC_H) gt-dojump.h vecprim.h
+ langhooks.h $(GGC_H) gt-dojump.h vecprim.h $(BASIC_BLOCK_H)
builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
- $(TREE_H) $(TREE_GIMPLE_H) $(FLAGS_H) $(TARGET_H) $(FUNCTION_H) $(REGS_H) \
+ $(TREE_H) $(GIMPLE_H) $(FLAGS_H) $(TARGET_H) $(FUNCTION_H) $(REGS_H) \
$(EXPR_H) $(OPTABS_H) insn-config.h $(RECOG_H) output.h typeclass.h \
hard-reg-set.h $(TOPLEV_H) hard-reg-set.h except.h $(TM_P_H) $(PREDICT_H) \
libfuncs.h $(REAL_H) langhooks.h $(BASIC_BLOCK_H) tree-mudflap.h \
@@ -2485,13 +2498,13 @@ builtins.o : builtins.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
calls.o : calls.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(TREE_H) $(FLAGS_H) $(EXPR_H) $(OPTABS_H) langhooks.h $(TARGET_H) \
libfuncs.h $(REGS_H) $(TOPLEV_H) output.h $(FUNCTION_H) $(TIMEVAR_H) $(TM_P_H) \
- $(CGRAPH_H) except.h sbitmap.h $(DBGCNT_H)
+ $(CGRAPH_H) except.h sbitmap.h $(DBGCNT_H) $(TREE_FLOW_H)
expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
$(FLAGS_H) insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) $(REAL_H) \
$(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 \
@@ -2551,21 +2564,21 @@ cgraph.o : cgraph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(TREE_INLINE_H) $(VARRAY_H) $(TREE_DUMP_H) $(TREE_FLOW_H)
cgraphunit.o : cgraphunit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) langhooks.h $(TREE_INLINE_H) $(TOPLEV_H) $(FLAGS_H) $(GGC_H) \
- $(TARGET_H) $(CGRAPH_H) intl.h pointer-set.h $(FUNCTION_H) $(TREE_GIMPLE_H) \
+ $(TARGET_H) $(CGRAPH_H) intl.h pointer-set.h $(FUNCTION_H) $(GIMPLE_H) \
$(TREE_FLOW_H) tree-pass.h $(C_COMMON_H) debug.h $(DIAGNOSTIC_H) \
$(FIBHEAP_H) output.h $(PARAMS_H) $(RTL_H) $(TIMEVAR_H) $(IPA_PROP_H) \
- gt-cgraphunit.h
+ gt-cgraphunit.h tree-iterator.h
cgraphbuild.o : cgraphbuild.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) langhooks.h $(CGRAPH_H) intl.h pointer-set.h $(TREE_GIMPLE_H) \
+ $(TREE_H) langhooks.h $(CGRAPH_H) intl.h pointer-set.h $(GIMPLE_H) \
$(TREE_FLOW_H) tree-pass.h
varpool.o : varpool.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(CGRAPH_H) langhooks.h $(DIAGNOSTIC_H) $(HASHTAB_H) \
- $(GGC_H) $(TIMEVAR_H) debug.h $(TARGET_H) output.h $(TREE_GIMPLE_H) \
+ $(GGC_H) $(TIMEVAR_H) debug.h $(TARGET_H) output.h $(GIMPLE_H) \
$(TREE_FLOW_H) gt-varpool.h
ipa.o : ipa.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(CGRAPH_H) \
tree-pass.h $(TIMEVAR_H)
-ipa-prop.o : ipa-prop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
- langhooks.h $(GGC_H) $(TARGET_H) $(CGRAPH_H) $(IPA_PROP_H) \
+ipa-prop.o : ipa-prop.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ langhooks.h $(GGC_H) $(TARGET_H) $(CGRAPH_H) $(IPA_PROP_H) $(DIAGNOSTIC_H) \
$(TREE_FLOW_H) $(TM_H) tree-pass.h $(FLAGS_H) $(TREE_H) $(TREE_INLINE_H) \
$(TIMEVAR_H)
ipa-cp.o : ipa-cp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
@@ -2581,33 +2594,34 @@ matrix-reorg.o : matrix-reorg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
ipa-inline.o : ipa-inline.c gt-ipa-inline.h $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) langhooks.h $(TREE_INLINE_H) $(FLAGS_H) $(CGRAPH_H) intl.h \
$(DIAGNOSTIC_H) $(FIBHEAP_H) $(PARAMS_H) $(TIMEVAR_H) tree-pass.h \
- $(HASHTAB_H) $(COVERAGE_H) $(GGC_H) $(TREE_FLOW_H) $(RTL_H)
+ $(HASHTAB_H) $(COVERAGE_H) $(GGC_H) $(TREE_FLOW_H) $(RTL_H) $(IPA_PROP_H)
ipa-utils.o : ipa-utils.c $(IPA_UTILS_H) $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
- pointer-set.h $(GGC_H) $(C_COMMON_H) $(TREE_GIMPLE_H) \
+ pointer-set.h $(GGC_H) $(C_COMMON_H) $(GIMPLE_H) \
$(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h $(TIMEVAR_H) $(DIAGNOSTIC_H)
ipa-reference.o : ipa-reference.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
pointer-set.h $(GGC_H) $(IPA_REFERENCE_H) $(IPA_UTILS_H) $(C_COMMON_H) \
- $(TREE_GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h \
+ $(GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h \
$(TIMEVAR_H) $(DIAGNOSTIC_H) $(FUNCTION_H)
ipa-pure-const.o : ipa-pure-const.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
pointer-set.h $(GGC_H) $(IPA_UTILS_H) $(C_COMMON_H) $(TARGET_H) \
- $(TREE_GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h $(TIMEVAR_H) \
+ $(GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h $(TIMEVAR_H) \
$(DIAGNOSTIC_H)
ipa-type-escape.o : ipa-type-escape.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
pointer-set.h $(GGC_H) $(IPA_TYPE_ESCAPE_H) $(IPA_UTILS_H) $(C_COMMON_H) \
- $(TREE_GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h \
+ $(GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h \
$(TIMEVAR_H) $(DIAGNOSTIC_H) $(FUNCTION_H)
ipa-struct-reorg.o: ipa-struct-reorg.c ipa-struct-reorg.h $(CONFIG_H) $(SYSTEM_H) \
- coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(TREE_GIMPLE_H) tree-inline.h \
+ coretypes.h $(TM_H) $(GGC_H) $(TREE_H) $(RTL_H) $(GIMPLE_H) tree-inline.h \
$(TREE_FLOW_H) langhooks.h pointer-set.h $(HASHTAB_H) $(C_TREE_H) $(TOPLEV_H) \
$(FLAGS_H) debug.h $(TARGET_H) $(CGRAPH_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) \
$(PARAMS_H) $(FIBHEAP_H) intl.h $(FUNCTION_H) $(BASIC_BLOCK_H) tree-iterator.h \
- tree-pass.h opts.h $(IPA_TYPE_ESCAPE_H) $(TREE_DUMP_H) $(C_COMMON_H)
+ tree-pass.h opts.h $(IPA_TYPE_ESCAPE_H) $(TREE_DUMP_H) $(C_COMMON_H) \
+ $(GIMPLE_H)
coverage.o : coverage.c $(GCOV_IO_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) \
@@ -2658,12 +2672,12 @@ mode-switching.o : mode-switching.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
tree-ssa-dce.o : tree-ssa-dce.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
$(RTL_H) $(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) \
coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) $(BASIC_BLOCK_H) \
- $(GGC_H) hard-reg-set.h $(OBSTACK_H) $(TREE_GIMPLE_H) $(CFGLOOP_H) \
+ $(GGC_H) hard-reg-set.h $(OBSTACK_H) $(GIMPLE_H) $(CFGLOOP_H) \
tree-scalar-evolution.h
tree-call-cdce.o : tree-call-cdce.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
$(RTL_H) $(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) \
coretypes.h $(TREE_DUMP_H) tree-pass.h $(FLAGS_H) $(BASIC_BLOCK_H) \
- $(GGC_H) hard-reg-set.h $(OBSTACK_H) $(TREE_GIMPLE_H)
+ $(GGC_H) hard-reg-set.h $(OBSTACK_H) $(GIMPLE_H)
tree-ssa-ccp.o : tree-ssa-ccp.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h \
$(DIAGNOSTIC_H) $(FUNCTION_H) $(TIMEVAR_H) $(TM_H) coretypes.h \
@@ -2671,19 +2685,19 @@ tree-ssa-ccp.o : tree-ssa-ccp.c $(TREE_FLOW_H) $(CONFIG_H) \
tree-ssa-propagate.h value-prof.h $(FLAGS_H) $(TARGET_H) $(TOPLEV_H)
tree-sra.o : tree-sra.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(RTL_H) \
$(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TREE_INLINE_H) \
- $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_GIMPLE_H) \
+ $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) $(GIMPLE_H) \
langhooks.h tree-pass.h $(FLAGS_H) $(EXPR_H) $(BASIC_BLOCK_H) \
$(BITMAP_H) $(GGC_H) hard-reg-set.h $(OBSTACK_H) $(PARAMS_H) $(TARGET_H)
tree-switch-conversion.o : tree-switch-conversion.c $(CONFIG_H) $(SYSTEM_H) \
$(TREE_H) $(TM_P_H) $(TREE_FLOW_H) $(DIAGNOSTIC_H) $(TREE_INLINE_H) \
- $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) $(TREE_GIMPLE_H) \
+ $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) $(GIMPLE_H) \
tree-pass.h $(FLAGS_H) $(EXPR_H) $(BASIC_BLOCK_H) output.h \
$(GGC_H) $(OBSTACK_H) $(PARAMS_H) $(CPPLIB_H) $(PARAMS_H)
tree-complex.o : tree-complex.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TREE_H) \
- $(TM_H) $(RTL_H) $(REAL_H) $(FLAGS_H) $(TREE_FLOW_H) $(TREE_GIMPLE_H) \
+ $(TM_H) $(RTL_H) $(REAL_H) $(FLAGS_H) $(TREE_FLOW_H) $(GIMPLE_H) \
tree-iterator.h tree-pass.h tree-ssa-propagate.h $(DIAGNOSTIC_H)
tree-vect-generic.o : tree-vect-generic.c $(CONFIG_H) $(SYSTEM_H) $(TREE_H) \
- $(TM_H) $(TREE_FLOW_H) $(TREE_GIMPLE_H) tree-iterator.h tree-pass.h \
+ $(TM_H) $(TREE_FLOW_H) $(GIMPLE_H) tree-iterator.h tree-pass.h \
$(FLAGS_H) $(OPTABS_H) $(RTL_H) $(MACHMODE_H) $(EXPR_H) \
langhooks.h $(FLAGS_H) $(DIAGNOSTIC_H) gt-tree-vect-generic.h $(GGC_H) \
coretypes.h insn-codes.h
@@ -2712,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) \
@@ -2763,7 +2779,7 @@ cfgloop.o : cfgloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) coretypes.h $(TM_H) \
$(GGC_H)
cfgloopanal.o : cfgloopanal.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \
$(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(EXPR_H) coretypes.h $(TM_H) \
- $(OBSTACK_H) output.h graphds.h
+ $(OBSTACK_H) output.h graphds.h $(PARAMS_H)
graphds.o : graphds.c graphds.h $(CONFIG_H) $(SYSTEM_H) $(BITMAP_H) $(OBSTACK_H) \
coretypes.h vec.h vecprim.h
loop-iv.o : loop-iv.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(BASIC_BLOCK_H) \
@@ -2827,7 +2843,7 @@ reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \
$(BASIC_BLOCK_H) $(RECOG_H) output.h $(FUNCTION_H) $(TOPLEV_H) $(TM_P_H) \
addresses.h except.h $(TREE_H) $(REAL_H) $(FLAGS_H) $(MACHMODE_H) \
- $(OBSTACK_H) $(DF_H) $(TARGET_H) dse.h
+ $(OBSTACK_H) $(DF_H) $(TARGET_H) dse.h ira.h
rtlhooks.o : rtlhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
rtlhooks-def.h $(EXPR_H) $(RECOG_H)
postreload.o : postreload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
@@ -2843,7 +2859,7 @@ postreload-gcse.o : postreload-gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
caller-save.o : caller-save.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(FLAGS_H) $(REGS_H) hard-reg-set.h insn-config.h $(BASIC_BLOCK_H) $(FUNCTION_H) \
addresses.h $(RECOG_H) reload.h $(EXPR_H) $(TOPLEV_H) $(TM_P_H) $(DF_H) \
- gt-caller-save.h $(GGC_H)
+ output.h ira.h gt-caller-save.h $(GGC_H)
bt-load.o : bt-load.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) except.h \
$(RTL_H) hard-reg-set.h $(REGS_H) $(TM_P_H) $(FIBHEAP_H) output.h $(EXPR_H) \
$(TARGET_H) $(FLAGS_H) $(INSN_ATTR_H) $(FUNCTION_H) tree-pass.h $(TOPLEV_H) \
@@ -2864,6 +2880,37 @@ stack-ptr-mod.o : stack-ptr-mod.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
init-regs.o : init-regs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(TREE_H) $(RTL_H) $(REGS_H) $(EXPR_H) tree-pass.h \
$(BASIC_BLOCK_H) $(FLAGS_H) $(DF_H)
+ira-build.o: ira-build.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(TARGET_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) \
+ insn-config.h $(RECOG_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) \
+ $(PARAMS_H) $(DF_H) sparseset.h $(IRA_INT_H)
+ira-costs.o: ira-costs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(TARGET_H) $(RTL_H) insn-config.h $(RECOG_H) \
+ $(REGS_H) hard-reg-set.h $(FLAGS_H) errors.h \
+ $(EXPR_H) $(BASIC_BLOCK_H) $(TM_P_H) \
+ $(IRA_INT_H)
+ira-conflicts.o: ira-conflicts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(TARGET_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) \
+ insn-config.h $(RECOG_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) $(PARAMS_H) \
+ $(DF_H) sparseset.h $(IRA_INT_H)
+ira-color.o: ira-color.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(TARGET_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) \
+ $(EXPR_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) $(PARAMS_H) \
+ $(DF_H) $(SPLAY_TREE_H) $(IRA_INT_H)
+ira-emit.o: ira-emit.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(TARGET_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) \
+ $(EXPR_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) $(PARAMS_H) \
+ $(IRA_INT_H)
+ira-lives.o: ira-lives.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(TARGET_H) $(RTL_H) $(REGS_H) hard-reg-set.h $(FLAGS_H) \
+ insn-config.h $(RECOG_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) $(PARAMS_H) \
+ $(DF_H) sparseset.h $(IRA_INT_H)
+ira.o: ira.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TARGET_H) $(TM_H) $(RTL_H) $(RECOG_H) \
+ $(REGS_H) hard-reg-set.h $(FLAGS_H) $(OBSTACK_H) \
+ $(EXPR_H) $(BASIC_BLOCK_H) $(TOPLEV_H) $(TM_P_H) \
+ $(DF_H) $(IRA_INT_H) $(PARAMS_H) $(TIMEVAR_H) $(INTEGRATE_H) \
+ tree-pass.h output.h
regmove.o : regmove.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
insn-config.h $(TIMEVAR_H) tree-pass.h $(DF_H)\
$(RECOG_H) output.h $(REGS_H) hard-reg-set.h $(FLAGS_H) $(FUNCTION_H) \
@@ -2953,9 +3000,9 @@ ifcvt.o : ifcvt.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
$(REAL_H) $(OPTABS_H) $(CFGLOOP_H) hard-reg-set.h $(TIMEVAR_H) tree-pass.h \
$(DF_H) $(DBGCNT_H)
lambda-mat.o : lambda-mat.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \
- $(TM_H) coretypes.h $(TREE_H)
+ $(TM_H) coretypes.h $(TREE_H) $(TREE_FLOW_H)
lambda-trans.o: lambda-trans.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \
- $(TM_H) coretypes.h $(TARGET_H) $(TREE_H)
+ $(TM_H) coretypes.h $(TARGET_H) $(TREE_H) $(TREE_FLOW_H)
lambda-code.o: lambda-code.c $(LAMBDA_H) $(GGC_H) $(SYSTEM_H) $(CONFIG_H) \
$(TM_H) $(OPTABS_H) $(TREE_H) $(RTL_H) $(BASIC_BLOCK_H) \
$(DIAGNOSTIC_H) $(TREE_FLOW_H) $(TREE_DUMP_H) $(TIMEVAR_H) $(CFGLOOP_H) \
@@ -2978,7 +3025,7 @@ $(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) $(REGS_H) hard-reg-set.h insn-config.h conditions.h \
output.h $(INSN_ATTR_H) $(SYSTEM_H) $(TOPLEV_H) $(TARGET_H) libfuncs.h \
$(TARGET_DEF_H) $(FUNCTION_H) $(SCHED_INT_H) $(TM_P_H) $(EXPR_H) \
- langhooks.h $(GGC_H) $(OPTABS_H) $(REAL_H) tm-constrs.h
+ langhooks.h $(GGC_H) $(OPTABS_H) $(REAL_H) tm-constrs.h $(GIMPLE_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) \
$(out_file) $(OUTPUT_OPTION)
@@ -3203,26 +3250,33 @@ GTFILES = $(CPP_ID_DATA_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \
$(srcdir)/ipa-prop.c $(srcdir)/ipa-cp.c $(srcdir)/ipa-inline.c $(srcdir)/matrix-reorg.c \
$(srcdir)/dbxout.c $(srcdir)/ipa-struct-reorg.c $(srcdir)/dwarf2out.c $(srcdir)/dwarf2asm.c \
+ $(srcdir)/tree-vect-generic.c \
$(srcdir)/dojump.c \
$(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 \
- $(srcdir)/tree-mudflap.c $(srcdir)/tree-flow.h $(srcdir)/tree-scalar-evolution.c \
+ $(srcdir)/gimple.h $(srcdir)/gimple.c \
+ $(srcdir)/tree-mudflap.c $(srcdir)/tree-flow.h \
$(srcdir)/tree-ssanames.c $(srcdir)/tree-eh.c $(srcdir)/tree-ssa-address.c \
- $(srcdir)/tree-phinodes.c $(srcdir)/tree-cfg.c \
- $(srcdir)/tree-dfa.c $(srcdir)/tree-ssa-propagate.c \
+ $(srcdir)/tree-cfg.c \
+ $(srcdir)/tree-dfa.c \
$(srcdir)/tree-iterator.c $(srcdir)/gimplify.c \
- $(srcdir)/tree-chrec.h $(srcdir)/tree-vect-generic.c \
+ $(srcdir)/tree-chrec.h \
+ $(srcdir)/tree-scalar-evolution.c \
$(srcdir)/tree-ssa-operands.h \
$(srcdir)/tree-profile.c $(srcdir)/tree-nested.c \
- $(srcdir)/ipa-reference.c $(srcdir)/tree-ssa-structalias.h \
- $(srcdir)/tree-ssa-structalias.c $(srcdir)/tree-parloops.c \
- $(srcdir)/omp-low.c $(srcdir)/varpool.c \
+ $(srcdir)/varpool.c \
+ $(srcdir)/tree-parloops.c \
+ $(srcdir)/omp-low.c \
$(srcdir)/targhooks.c $(out_file) $(srcdir)/passes.c $(srcdir)/cgraphunit.c \
+ $(srcdir)/tree-ssa-propagate.c \
+ $(srcdir)/tree-phinodes.c \
+ $(srcdir)/ipa-reference.c $(srcdir)/tree-ssa-structalias.h \
+ $(srcdir)/tree-ssa-structalias.c \
@all_gtfiles@
# Compute the list of GT header files from the corresponding C sources,
@@ -3301,7 +3355,7 @@ build/genautomata.o : genautomata.c $(RTL_BASE_H) $(OBSTACK_H) \
$(BCONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) errors.h vec.h \
$(HASHTAB_H) gensupport.h
build/gencheck.o : gencheck.c tree.def $(BCONFIG_H) $(GTM_H) \
- $(SYSTEM_H) coretypes.h $(lang_tree_files)
+ $(SYSTEM_H) coretypes.h $(lang_tree_files) gimple.def
build/genchecksum.o : genchecksum.c $(BCONFIG_H) $(SYSTEM_H) $(MD5_H)
build/gencodes.o : gencodes.c $(RTL_BASE_H) $(BCONFIG_H) $(SYSTEM_H) \
coretypes.h $(GTM_H) errors.h gensupport.h
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 bb42b64460a..745c8431e5d 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,9 +1,2415 @@
+2008-08-30 Thomas Quinot <quinot@adacore.com>
+
+ * gcc-interface/Make-lang.in: Allow s-oscons.{o,ali} to
+ be built even without a separate libada directory.
+
+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.
+
+2008-07-31 Jose Ruiz <ruiz@adacore.com>
+
+ * system-rtx-rtss.ads
+ Change the default stack size. It is important to set the commit part.
+
+ * s-taprop-rtx.adb
+ (Initialize): Get the clock resolution.
+ (RT_Resolution): Return the clock resolution that is indicated by the
+ system.
+
+ * s-parame-vxworks.adb
+ Document that this body is used for RTX in RTSS (kernel) mode.
+
+ * gcc-interface/Makefile.in
+ (LIBGNAT_TARGET_PAIRS for the rtx_rtss run time): Use the
+ s-parame-vxworks.adb body in order to have reasonable stack sizes in
+ RTX RTSS kernel mode. Virtual memory is not used in that case, so we
+ cannot ask for too big values.
+
+2008-07-31 Robert Dewar <dewar@adacore.com>
+
+ * exp_aggr.adb: Minor reformatting
+
+ * makeutl.adb: Minor reformatting
+
+ * prj-env.adb: Minor reformatting
+
+2008-07-31 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_disp.adb (Prim_Op_Kind): Retrieve the full view when a private
+ tagged type is completed by a concurrent type.
+
+2008-07-31 Gary Dismukes <dismukes@adacore.com>
+
+ * sem_aggr.adb:
+ (Resolve_Record_Aggregate): Bypass error that a type without
+ components must have a "null record" aggregate when compiling for Ada
+ 2005, since it's legal to give an aggregate of form (others => <>)
+ for such a type.
+
+2008-07-31 Javier Miranda <miranda@adacore.com>
+
+ * sem_ch4.adb (Valid_First_Argument_Of): Complete its functionality to
+ handle synchronized types. Required to handle well the object.operation
+ notation applied to synchronized types.
+
+2008-07-31 Quentin Ochem <ochem@adacore.com>
+
+ * s-stausa.adb (Fill_Stack): Stack_Used_When_Filling is now stored
+ anymore - just used internally.
+ Added handling of very small tasks - when the theoretical size is
+ already full at the point of the call.
+ (Report_Result): Fixed result computation, Stack_Used_When_Filling does
+ not need to be added to the result.
+
+2008-07-31 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_ch6.adb (Disambiguate_Spec): Continue the disambiguation if the
+ corresponding spec is a primitive wrapper. Update comment.
+
+2008-07-31 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * bindgen.adb Comment reformatting. Update the list of run-time globals.
+ (Gen_Adainit_Ada): Add the declaration, import and value set for
+ configuration flag Canonical_Streams.
+ (Gen_Adainit_C): Add the declaration and initial value of external
+ symbol __gl_canonical_streams.
+
+ * init.c: Update the list of global values computed by the binder.
+
+ * opt.ads: Add flag Canonical_Streams.
+
+ * par-prag.adb (Prag): Include Pragma_Canonical_Streams to the list of
+ semantically handled pragmas.
+
+ * sem_prag.adb: Add an entry into enumeration type Sig_Flags.
+ (Analyze_Pragma): Add case for pragma Canonical_Streams.
+
+ * snames.adb: Add character value for name Canonical_Streams.
+
+ * snames.ads:
+ Add Name_Canonical_Streams to the list of configuration pragmas.
+ Add Pragma_Canonical_Streams to enumeration type Pragma_Id.
+
+ * snames.h: Add a definition for Pragma_Canonical_Streams.
+
+ * s-ststop.adb:
+ Add a flag and import to seize the value of external symbol
+ __gl_canonical_streams. Update comment and initial value of constant
+ Use_Block_IO.
+
+ * gnat_rm.texi: Add section of pragma Canonical_Streams.
+
+ * gnat_ugn.texi:
+ Add pragma Canonical_Streams to the list of configuration pragmas.
+
+2008-07-31 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch10.adb (Build_Unit_Name): If the unit name in a with_clause
+ has the form A.B.C and B is a unit renaming, analyze its compilation
+ unit and add a with_clause on A.b to the context.
+
+2008-07-31 Vincent Celier <celier@adacore.com>
+
+ * makeutl.adb (Executable_Prefix_Path): If Locate_Exec_On_Path fails,
+ return the empty string, instead of raising Constraint_Error.
+
+2008-07-31 Gary Dismukes <dismukes@adacore.com>
+
+ * checks.ads (Apply_Accessibility_Check): Add parameter Insert_Node.
+
+ * checks.adb (Apply_Accessibility_Check): Insert the check on
+ Insert_Node.
+
+ * exp_attr.adb:
+ (Expand_N_Attribute_Refernce, Attribute_Access): Pass attribute node
+ to new parameter Insert_Node on call to Apply_Accessibility_Check.
+ Necessary to distinguish the insertion node because the dereferenced
+ formal may come from a rename, but the check must be inserted in
+ front of the attribute.
+
+ * exp_ch4.adb:
+ (Expand_N_Allocator): Pass actual for new Insert_Node parameter on
+ call to Apply_Accessibility_Check.
+ (Expand_N_Type_Conversion): Pass actual for new Insert_Node parameter
+ on call to Apply_Accessibility_Check.
+ Minor reformatting
+
+2008-07-31 Javier Miranda <miranda@adacore.com>
+
+ * sem_type.adb (Has_Compatible_Type): Complete support for synchronized
+ types when the candidate type is a synchronized type.
+
+ * sem_res.adb (Resolve_Actuals): Reorganize code handling synchronized
+ types, and complete management of synchronized types adding missing
+ code to handle formal that is a synchronized type.
+
+ * sem_ch4.adb (Try_Primitive_Operation): Avoid testing attributes that
+ are not available and cause the compiler to blowup. Found compiling
+ test with switch -gnatc
+
+ * sem_ch6.adb (Check_Synchronized_Overriding): Remove local subprogram
+ Has_Correct_Formal_Mode plus code cleanup.
+
+2008-07-31 Bob Duff <duff@adacore.com>
+
+ * sinput.adb (Skip_Line_Terminators): Fix handling of LF/CR -- it was
+ recognized as two end-of-lines, but it should be just one.
+
+2008-07-31 Thomas Quinot <quinot@adacore.com>
+
+ * exp_ch9.adb: Minor reformatting
+
+ * tbuild.ads: Fix several occurrences of incorrectly referring to
+ Name_Find as Find_Name.
+
+2008-07-31 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_aggr.adb (Aggr_Size_OK): If the aggregate has a single component
+ and the context is an object declaration with non-static bounds, treat
+ the aggregate as non-static.
+
+2008-07-31 Vincent Celier <celier@adacore.com>
+
+ * prj-part.adb, prj-part.ads, prj.adb, prj.ads, prj-env.adb:
+ Move back spec of Parse_Single_Project to body, as it is not called
+ outside of package Prj.Part.
+ (Project_Data): Remove components Linker_Name, Linker_Path and
+ Minimum_Linker_Options as they are no longer set.
+ Remove function There_Are_Ada_Sources from package Prj and move code
+ in the only place it was used, in Prj.Env.Set_Ada_Paths.
+
+2008-07-31 Arnaud Charlet <charlet@adacore.com>
+
+ * mlib-utl.ads: Fix typo.
+
+2008-07-31 Robert Dewar <dewar@adacore.com>
+
+ * sem_ch12.adb: Minor reformatting
+
+2008-07-31 Sergey Rybin <rybin@adacore.com>
+
+ * gnat_ugn.texi: Change the description of the
+ Overly_Nested_Control_Structures: now the rule always requires a
+ positive parameter for '+R' option
+
+2008-07-31 Thomas Quinot <quinot@adacore.com>
+
+ * g-pehage.adb: Minor reformatting
+
+2008-07-31 Pascal Obry <obry@adacore.com>
+
+ * s-finimp.ads: Minor reformatting.
+
+2008-07-31 Vincent Celier <celier@adacore.com>
+
+ * s-regexp.ads: Minor comment fix
+
+2008-07-31 Arnaud Charlet <charlet@adacore.com>
+
+ * s-direio.adb (Reset): Replace pragma Unmodified by Warnings (Off),
+ so that we can compile this file successfully with -gnatc.
+
+2008-07-31 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * exp_attr.adb (Find_Stream_Subprogram): Check the base type instead
+ of the type when looking for stream subprograms for type String,
+ Wide_String and Wide_Wide_String.
+
+ * s-ststop.adb: Change the initialization expression of constant
+ Use_Block_IO.
+
+2008-07-31 Geert Bosch <bosch@adacore.com>
+
+ * arit64.c:
+ New file implementing __gnat_mulv64 signed integer multiplication with
+ overflow checking
+
+ * fe.h (Backend_Overflow_Checks_On_Target): Define for use by Gigi
+
+ * gcc-interface/gigi.h:
+ (standard_types): Add ADT_mulv64_decl
+ (mulv64_decl): Define subprogram declaration for __gnat_mulv64
+
+ * gcc-interface/utils.c:
+ (init_gigi_decls): Add initialization of mulv64_decl
+
+ * gcc-interface/trans.c:
+ (build_unary_op_trapv): New function
+ (build_binary_op_trapv): New function
+ (gnat_to_gnu): Use the above functions instead of
+ build_{unary,binary}_op
+
+ * gcc-interface/Makefile.in
+ (LIBGNAT_SRCS): Add arit64.c
+ (LIBGNAT_OBJS): Add arit64.o
+
+2008-07-31 Vincent Celier <celier@adacore.com>
+
+ * prj-nmsc.adb (Check_Library_Attributes): Check if Linker'Switches or
+ Linker'Default_Switches are declared. Warn if they are declared.
+
+2008-07-31 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch6.adb (Make_Build_In_Place_Call_In_Object_Declaration): Use
+ Insert_Actions to place the pointer declaration in the code, rather
+ than Insert_Before_And_Analyze, so that insertions of temporaries are
+ kept in the proper order when transient scopes are present.
+
+
+2008-07-31 Robert Dewar <dewar@adacore.com>
+
+ * einfo.adb (Spec_PPC): Now defined for generic subprograms
+
+ * einfo.ads (Spec_PPC): Now defined for generic subprograms
+
+ * sem_prag.adb (Check_Precondition_Postcondition): Handle generic
+ subprogram case
+
+2008-07-31 Vincent Celier <celier@adacore.com>
+
+ * s-os_lib.adb: Minor comment fix
+
+2008-07-31 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch6.adb (Analyze_Generic_Subprogram_Body): After analysis,
+ transfer pre/postconditions from generic copy to original tree, so that
+ they will appear in each instance.
+ (Process_PPCs): Do not transform postconditions into a procedure in a
+ generic context, to prevent double expansion of check pragmas.
+
+ * sem_attr.adb: In an instance, the prefix of the 'result attribute
+ can be the renaming of the
+ current instance, so check validity of the name accordingly.
+
+2008-07-31 Robert Dewar <dewar@adacore.com>
+
+ * mlib-utl.ads: Minor reformatting
+
+2008-07-31 Ed Schonberg <schonberg@adacore.com>
+
+ sem_attr.adb: 'Result can have an ambiguous prefix, and is resolved
+ from context. This attribute must be usable in Ada95 mode.
+ The attribute can appear in the body of a function marked
+ Inline_Always, but in this case the postocondition is not enforced.
+
+ sem_prag.adb (Check_Precondition_Postcondition): within the expansion
+ of an inlined call pre- and postconditions are legal
+
+2008-07-31 Vincent Celier <celier@adacore.com>
+
+ * prj.adb, prj.ads, clean.adb, prj-nmsc.adb: Remove declarations that
+ were for gprmake only
+
+2008-07-31 Robert Dewar <dewar@adacore.com>
+
+ * gnat_ugn.texi: Update -gnatN documentation.
+
+ * gnat_rm.texi: Add note about pre/postcondition
+ pragmas not checked in conjunction with front-end inlining.
+
+2008-07-31 Robert Dewar <dewar@adacore.com>
+
+ * g-pehage.adb, g-pehage.ads: Minor reformatting
+
+2008-07-31 Arnaud Charlet <charlet@adacore.com>
+
+ * mlib-utl.ads, prj-makr.ads: Add comments.
+
+2008-07-30 Aaron W. LaFramboise <aaronavay62@aaronwl.com>
+
+ * gcc-interface/Makefile.in (EXTRA_GNATRTL_NONTASKING_OBJS)
+ [WINDOWS]: Add s-winext.o.
+
+2008-07-30 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/36554
+ * back_end.adb (Call_Back_End): Pass Standard_Boolean to gigi.
+ * gcc-interface/gigi.h (gigi): Take new standard_boolean parameter.
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Enumeration_Subtype>:
+ Set precision to 1 for subtype of BOOLEAN_TYPE.
+ (set_rm_size): Set TYPE_RM_SIZE_NUM for BOOLEAN_TYPE.
+ (make_type_from_size): Deal with BOOLEAN_TYPE.
+ * gcc-interface/misc.c (gnat_print_type): Likewise.
+ * gcc-interface/trans.c (gigi): Take new standard_boolean parameter.
+ Set boolean_type_node as its translation in the table, as well
+ as boolean_false_node for False and boolean_true_node for True.
+ * gcc-interface/utils.c (gnat_init_decl_processing): Create custom
+ 8-bit boolean_type_node and set its TYPE_RM_SIZE_NUM.
+ (create_param_decl): Deal with BOOLEAN_TYPE.
+ (build_vms_descriptor): Likewise.
+ (build_vms_descriptor64): Likewise.
+ (convert): Deal with BOOLEAN_TYPE like with ENUMERAL_TYPE.
+
+2008-07-30 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch9.adb: Minor reformatting
+
+ * exp_util.ads (Find_Prim_Op): Document that Program_Error is raised
+ if no primitive operation is found.
+
+ * exp_util.adb: (Find_Prim_Op): Add comments for previous change
+
+ * sem_ch8.adb: Minor reformatting
+
+2008-07-30 Laurent Pautet <pautet@adacore.com>
+
+ * g-pehage.adb:
+ Remove a limitation on the length of the words handled by the minimal
+ perfect hash function generator.
+
+ * g-pehage.ads:
+ Detail the use of subprograms Insert, Initialize, Compute and Finalize.
+ Fix some typos.
+
+2008-07-30 Robert Dewar <dewar@adacore.com>
+
+ * gnatlink.adb: Minor reformatting
+
+2008-07-30 Thomas Quinot <quinot@adacore.com>
+
+ * rtsfind.adb (Check_RPC): Check version consistency even when not
+ generating RCI stubs. Provide more detailed error message in case of
+ mismatch.
+
+2008-07-30 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch8.adb (Analyze_Subprogram_Renaming): When renaming an attribute
+ as a actual in an instance, check for a missing attribute to prevent
+ program_error on an illegal program.
+
+ * exp_util.adb (Find_Prim_Op): Rather than Assert (False), raise program
+ error if primitive is not found, so that exception can be handled
+ elsewhere on illegal programs.
+
+2008-07-30 Robert Dewar <dewar@adacore.com>
+
+ * uintp.adb (UI_GCD): Fix potential overflow
+
+2008-07-30 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * einfo.adb: Flag245 is now used.
+ (Is_Primitive_Wrapper, Set_Is_Primitive_Wrapper): Relax the assertion
+ check to include functions.
+ (Is_Private_Primitive, Set_Is_Private_Primitive): New subprograms.
+ (Wrapped_Entity, Set_Wrapped_Entity): Relax the assertion check to
+ include functions.
+ (Write_Entity_Flags): Move flag Is_Primitive, add Is_Private_Primitive
+ to the list of displayed flags.
+
+ * einfo.ads: Update comment on the usage of Is_Primitive_Wrapper and
+ Wrapped_Entity. These two flags are now present in functions.
+ New flag Is_Private_Primitive.
+ (Is_Private_Primitive, Set_Is_Private_Primitive): New subprograms.
+
+ * exp_ch9.adb:
+ (Build_Wrapper_Bodies): New subprogram.
+ (Build_Wrapper_Body): The spec and body have been moved to in
+ Build_Wrapper_ Bodies. Code cleanup.
+ (Build_Wrapper_Spec): Moved to the spec of Exp_Ch9. Code cleanup.
+ Wrappers are now generated for primitives declared between the private
+ and full view of a concurrent type that implements an interface.
+ (Build_Wrapper_Specs): New subprogram.
+ (Expand_N_Protected_Body): Code reformatting. Replace the wrapper body
+ creation mechanism with a call to Build_Wrapper_Bodies.
+ (Expand_N_Protected_Type_Declaration): Code reformatting. Replace the
+ wrapper spec creation mechanism with a call to Build_Wrapper_Specs.
+ (Expand_N_Task_Body): Replace the wrapper body creation
+ mechanism with a call to Build_Wrapper_Bodies.
+ (Expand_N_Task_Type_Declaration): Replace the wrapper spec
+ creation mechanism with a call to Build_Wrapper_Specs.
+ (Is_Private_Primitive_Subprogram): New subprogram.
+ (Overriding_Possible): Code cleanup.
+ (Replicate_Entry_Formals): Renamed to Replicate_Formals, code cleanup.
+
+ * exp_ch9.ads (Build_Wrapper_Spec): Moved from the body of Exp_Ch9.
+
+ * sem_ch3.adb: Add with and use clause for Exp_Ch9.
+ (Process_Full_View): Build wrapper specs for all primitives
+ that belong to a private view completed by a concurrent type
+ implementing an interface.
+
+ * sem_ch6.adb (Analyze_Subprogram_Body): When the current subprogram
+ is a primitive of a
+ concurrent type with a private view that implements an interface, try to
+ find the proper spec.
+ (Analyze_Subprogram_Declaration): Mark a subprogram as a private
+ primitive if the type of its first parameter is a non-generic tagged
+ private type.
+ (Analyze_Subprogram_Specification): Code reformatting.
+ (Disambiguate_Spec): New routine.
+ (Find_Corresponding_Spec): Add a flag to controll the output of errors.
+ (Is_Private_Concurrent_Primitive): New routine.
+
+ * sem_ch6.ads:
+ (Find_Corresponding_Spec): Add a formal to control the output of errors.
+
+2008-07-30 Doug Rupp <rupp@adacore.com>
+
+ * gigi.h (build_vms_descriptor64): New function prototype.
+ (fill_vms_descriptor): Modified function prototype.
+
+ * utils.c (build_vms_descriptor64): New function.
+
+ * utils2.c (fill_vms_descriptor): Fix handling on 32bit systems.
+
+ * trans.c (call_to_gnu): Call fill_vms_descriptor with new third
+ argument.
+
+ * decl.c (gnat_to_gnu_tree): For By_Descriptor mech, build both a
+ 64bit and 32bit descriptor and save the 64bit version as an alternate
+ TREE_TYPE in the parameter.
+ (make_type_from_size) <RECORD_TYPE>: Use the appropriate mode for the
+ thin pointer.
+
+ * ada-tree.h (DECL_PARM_ALT, SET_DECL_PARM_ALT): New macros.
+
+2008-07-30 Robert Dewar <dewar@adacore.com>
+
+ * make.adb: Minor reformatting
+
+ * mlib-utl.adb: Minor reformatting
+
+ * osint.ads: Minor reformatting
+
+2008-07-30 Jose Ruiz <ruiz@adacore.com>
+
+ * adaint.c
+ (__gnat_file_exists): Do not use __gnat_stat for RTX.
+ (__main for RTX in RTSS mode): Create this dummy procedure symbol to
+ avoid the use of this symbol from libgcc.a in RTX kernel mode.
+
+ * cio.c
+ (put_int, put_int_stderr, put_char, put_char_stderr): For RTX we call
+ the function RtPrintf for console output.
+
+ * argv.c Do not use the environ variable for RTX.
+
+ * gnatlink.adb (gnatlink): The part that handles the --RTS option has
+ been moved before the call to Osint.Add_Default_Search_Dirs in order
+ to take into account the flags in system.ads (RTX_RTSS_Kernel_Module)
+ from the appropriate run time.
+
+ * targparm.ads
+ (RTX_RTSS_Kernel_Module_On_Target): Add this flag that is set to True if
+ target is a RTSS module for RTX.
+
+ * targparm.adb (Targparm_Tags, RTX_Str, Targparm_Str): Add tag RTX for
+ RTX_RTSS_Kernel_Module
+ (Get_Target_Parameters): Add processing of RTX_RTSS_Kernel_Module flag.
+
+ * gcc-interface/Makefile.in (LIBGNAT_TARGET_PAIRS for RTX): Use gcc
+ exception handling mechanism for Windows and RTX in Win32 mode, but
+ not for RTX in kernel mode (RTSS).
+ (LIBGNAT_SRCS): Remove ada.h
+
+2008-07-30 Paolo Bonzini <bonzini@gnu.org>
+
+ * gcc-interface/Make-lang.in (ALL_ADAFLAGS): Remove X_ADAFLAGS and
+ T_ADAFLAGS, replace ALL_ADA_CFLAGS with ADA_CFLAGS.
+ (ALL_ADA_CFLAGS): Remove, replace throughout with ADA_CFLAGS.
+ * gcc-interface/Makefile.in (XCFLAGS, X_CFLAGS, X_CPPFLAGS, T_CPPFLAGS,
+ X_ADA_CFLAGS, T_ADA_CFLAGS, X_ADAFLAGS, T_ADAFLAGS, ADA_CFLAGS,
+ ALL_ADA_CFLAGS): Remove.
+ (ALL_ADAFLAGS, MOST_ADAFLAGS): Remove X_ADAFLAGS and T_ADAFLAGS,
+ replace ALL_ADA_CFLAGS with ADA_CFLAGS.
+ (GCC_CFLAGS): Remove X_CFLAGS.
+ (LOOSE_CFLAGS): Remove X_CFLAGS and XCFLAGS.
+ (ALL_CPPFLAGS): Remove X_CPPFLAGS and T_CPPFLAGS.
+ (ADA_CFLAGS): Substitute.
+
+2008-07-30 Laurent Guerby <laurent@guerby.net>
+
+ PR ada/5911
+ * gcc-interface/Makefile.in (MULTISUBDIR, RTSDIR): New variables.
+ Pass MULTISUBDIR to recursive make. Use $(RTSDIR) instead of rts.
+ Replace stamp-gnatlib* by stamp-gnatlib*-rts.
+ * gcc-interface/Make-lang.in: Replace stamp-gnatlib2
+ by stamp-gnatlib2-rts.
+
+2008-07-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ PR documentation/15479
+ * gnat-style.texi: Remove AdaCore copyright statement and GPL
+ statement for GNAT. Add @copying stanza, use it. Update to
+ GFDL 1.2. Do not list GFDL as Invariant Section, do not list
+ title as Front-Cover Text.
+ * gnat_rm.texi: Likewise.
+ * gnat_ugn.texi: Likewise.
+
+2008-07-29 Jan Hubicka <jh@suse.cz>
+
+ * trans.c (process_inlined_subprograms): Remove tree_really_inline
+ check.
+
+2008-07-29 Arnaud Charlet <charlet@adacore.com>
+
+ * gcc-interface: New directory.
+
+ * ada-tree.def, cuintp.c, gigi.h, Makefile.in, targtyps.c, ada.h,
+ utils.c, ada-tree.h, decl.c, lang.opt, Make-lang.in, trans.c,
+ config-lang.in, deftarg.c, lang-specs.h, misc.c, utils2.c: Moved
+ to gcc-interface subdirectory.
+
+2008-07-29 Aaron W. LaFramboise <aaronavay62@aaronwl.com>
+
+ * Makefile.in (EXTRA_GNATRTL_NONTASKING_OBJS): Remove extra s-win32.o.
+
+2008-07-28 Jan Hubicka <jh@suse.cz>
+
+ * misc.c (gnat_post_options): Do not set flag_no_inline.
+
+2008-07-28 Richard Guenther <rguenther@suse.de>
+
+ Merge from gimple-tuples-branch.
+
+ 2008-07-22 Olivier Hainque <hainque@adacore.com>
+
+ * gigi.h (end_subprog_body): New ELAB_P argument, saying if
+ this is called for an elab proc to be discarded if empty.
+ * utils.c (end_subprog_body): Honor ELAB_P.
+ (build_function_stub): Adjust call to end_subprog_body.
+ * trans.c (Subprogram_Body_to_gnu): Likewise.
+ (gigi): Reorganize processing of elab procs to prevent
+ gimplifying twice, using the new end_subprog_body argument.
+
+ 2008-07-19 Richard Guenther <rguenther@suse.de>
+
+ * Make-lang.in (trans.o): Add tree-iterator.h dependency.
+ (utils.o): Likewise.
+ * trans.c: Include tree-iterator.h.
+ (gnat_gimplify_expr): Adjust prototype. Fix typo.
+ (gnat_gimplify_stmt): Use SET_EXPR_LOCATION.
+ (set_expr_location_from_node): Likewise.
+ (gigi): Tuplify.
+ * ada-tree.h (union lang_tree_node): Use TREE_CHAIN instead
+ of GENERIC_NEXT.
+ * utils.c: Include tree-iterator.h.
+ * gigi.h (gnat_gimplify_expr): Adjust prototype.
+
+ 2008-07-18 Aldy Hernandez <aldyh@redhat.com>
+
+ * trans.c: Include gimple.h instead of tree-gimple.h.
+ * utils.c: Same.
+
+ 2008-07-14 Aldy Hernandez <aldyh@redhat.com>
+
+ * trans.c (gnat_gimplify_expr): Use gimplify_assign.
+
+2008-07-25 Jan Hubicka <jh@suse.cz>
+
+ * utils.c (end_subprog_body): Remove inline trees check.
+ * misc.c (gnat_post_options): Do not set flag_inline_trees.
+
+2008-07-25 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * raise-gcc.c: Move tsystem.h before tm.h.
+
2008-07-20 Arnaud Charlet <charlet@adacore.com>
* gnathtml.pl: New file.
2008-07-19 Olivier Hainque <hainque@adacore.com>
-
+
* targtyps.c (get_target_default_allocator_alignment): Use
MALLOC_ABI_ALIGNMENT.
@@ -16684,7 +19090,7 @@ PR ada/10768
* utils.c (create_var_decl): Use have_global_bss_p when deciding
whether to make the decl common.
-2006-02-20 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
+2006-02-20 Rafael �vila de Esp�ndola <rafael.espindola@gmail.com>
* Make-lang.in (Ada): Remove.
(.PHONY): Remove Ada
@@ -19142,11 +21548,11 @@ PR ada/10768
* s-bitops.adb: Clarify comment for Bits_Array
-2005-12-07 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
+2005-12-07 Rafael �vila de Esp�ndola <rafael.espindola@gmail.com>
* Make-lang.in (ada.install-normal): Remove.
-2005-12-07 Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
+2005-12-07 Rafael �vila de Esp�ndola <rafael.espindola@gmail.com>
* Make-lang.in: Remove all dependencies on s-gtype.
diff --git a/gcc/ada/Makefile.in b/gcc/ada/Makefile.in
index b3b4d080ef0..9f223c4195c 100644
--- a/gcc/ada/Makefile.in
+++ b/gcc/ada/Makefile.in
@@ -1,2296 +1,3 @@
-# Makefile for GNU Ada Compiler (GNAT).
-# Copyright (C) 1994-2008 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/>.
-
-# The makefile built from this file lives in the language subdirectory.
-# Its purpose is to provide support for:
-#
-# 1) recursion where necessary, and only then (building .o's), and
-# 2) building and debugging cc1 from the language subdirectory, and
-# 3) nothing else.
-#
-# The parent makefile handles all other chores, with help from the
-# language makefile fragment, of course.
-#
-# The targets for external use are:
-# all, TAGS, ???mostlyclean, ???clean.
-
-# This makefile will only work with Gnu make.
-# The rules are written assuming a minimum subset of tools are available:
-#
-# Required:
-# MAKE: Only Gnu make will work.
-# MV: Must accept (at least) one, maybe wildcard, source argument,
-# a file or directory destination, and support creation/
-# modification date preservation. Gnu mv -f works.
-# RM: Must accept an arbitrary number of space separated file
-# arguments, or one wildcard argument. Gnu rm works.
-# RMDIR: Must delete a directory and all its contents. Gnu rm -rf works.
-# ECHO: Must support command line redirection. Any Unix-like
-# shell will typically provide this, otherwise a custom version
-# is trivial to write.
-# AR: Gnu ar works.
-# MKDIR: Gnu mkdir works.
-# CHMOD: Gnu chmod works.
-# true: Does nothing and returns a normal successful return code.
-# pwd: Prints the current directory on stdout.
-# cd: Change directory.
-#
-# Optional:
-# BISON: Gnu bison works.
-# FLEX: Gnu flex works.
-# Other miscellaneous tools for obscure targets.
-
-# Suppress smart makes who think they know how to automake Yacc files
-.y.c:
-
-# Variables that exist for you to override.
-# See below for how to change them for certain systems.
-
-# Various ways of specifying flags for compilations:
-# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
-# BOOT_CFLAGS is the value of CFLAGS to pass
-# to the stage2 and stage3 compilations
-# XCFLAGS is used for most compilations but not when using the GCC just built.
-XCFLAGS =
-CFLAGS = -g
-BOOT_CFLAGS = -O $(CFLAGS)
-# These exists to be overridden by the x-* and t-* files, respectively.
-X_CFLAGS =
-T_CFLAGS =
-
-X_CPPFLAGS =
-T_CPPFLAGS =
-
-X_ADA_CFLAGS =
-T_ADA_CFLAGS =
-
-X_ADAFLAGS =
-T_ADAFLAGS =
-
-CC = cc
-BISON = bison
-BISONFLAGS =
-ECHO = echo
-LEX = flex
-LEXFLAGS =
-CHMOD = chmod
-LN = ln
-LN_S = ln -s
-CP = cp -p
-MV = mv -f
-RM = rm -f
-RMDIR = rm -rf
-MKDIR = mkdir -p
-AR = ar
-AR_FLAGS = rc
-LS = ls
-RANLIB = @RANLIB@
-RANLIB_FLAGS = @ranlib_flags@
-
-SHELL = @SHELL@
-PWD_COMMAND = $${PWDCMD-pwd}
-# How to copy preserving the date
-INSTALL_DATA_DATE = cp -p
-MAKEINFO = makeinfo
-TEXI2DVI = texi2dvi
-TEXI2PDF = texi2pdf
-GNATBIND_FLAGS = -static -x
-ADA_CFLAGS =
-ADAFLAGS = -W -Wall -gnatpg -gnata
-SOME_ADAFLAGS =-gnata
-FORCE_DEBUG_ADAFLAGS = -g
-GNATLIBFLAGS = -gnatpg -nostdinc
-GNATLIBCFLAGS = -g -O2
-GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \
- -DIN_RTS
-ALL_ADA_CFLAGS = $(X_ADA_CFLAGS) $(T_ADA_CFLAGS) $(ADA_CFLAGS)
-ALL_ADAFLAGS = $(CFLAGS) $(ALL_ADA_CFLAGS) $(X_ADAFLAGS) $(T_ADAFLAGS) \
- $(ADAFLAGS)
-MOST_ADAFLAGS = $(CFLAGS) $(ALL_ADA_CFLAGS) $(X_ADAFLAGS) $(T_ADAFLAGS) \
- $(SOME_ADAFLAGS)
-THREAD_KIND = native
-THREADSLIB =
-GMEM_LIB =
-MISCLIB =
-SYMDEPS = $(LIBINTL_DEP)
-OUTPUT_OPTION = @OUTPUT_OPTION@
-
-objext = .o
-exeext =
-arext = .a
-soext = .so
-shext =
-hyphen = -
-
-# Define this as & to perform parallel make on a Sequent.
-# Note that this has some bugs, and it seems currently necessary
-# to compile all the gen* files first by hand to avoid erroneous results.
-P =
-
-# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
-# It omits XCFLAGS, and specifies -B./.
-# It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
-GCC_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(CFLAGS)
-
-# Tools to use when building a cross-compiler.
-# These are used because `configure' appends `cross-make'
-# to the makefile when making a cross-compiler.
-
-# We don't use cross-make. Instead we use the tools from the build tree,
-# if they are available.
-# program_transform_name and objdir are set by configure.in.
-program_transform_name =
-objdir = .
-
-target_alias=@target_alias@
-target=@target@
-xmake_file = @xmake_file@
-tmake_file = @tmake_file@
-host_canonical=@host@
-#version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
-#mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
-
-# Directory where sources are, from where we are.
srcdir = @srcdir@
-VPATH = $(srcdir)
-
-fsrcdir := $(shell cd $(srcdir);${PWD_COMMAND})
-fsrcpfx := $(shell cd $(srcdir);${PWD_COMMAND})/
-fcurdir := $(shell ${PWD_COMMAND})
-fcurpfx := $(shell ${PWD_COMMAND})/
-
-# Top build directory, relative to here.
-top_builddir = ../..
-
-# Internationalization library.
-LIBINTL = @LIBINTL@
-LIBINTL_DEP = @LIBINTL_DEP@
-
-# Any system libraries needed just for GNAT.
-SYSLIBS = @GNAT_LIBEXC@
-
-# List of extra object files linked in with various programs.
-EXTRA_GNATTOOLS_OBJS = ../../prefix.o ../../version.o
-
-# List of target dependent sources, overridden below as necessary
-TARGET_ADA_SRCS =
-
-# Type of tools build we are doing; default is not compiling tools.
-TOOLSCASE =
-
-# End of variables for you to override.
-
-all: all.indirect
-
-# This tells GNU Make version 3 not to put all variables in the environment.
-.NOEXPORT:
-
-# tmake_file and xmake_file expand to lists with entries of the form
-# $(srcdir)/config/... but here $(srcdir) is the ada subdirectory so we
-# need to adjust the paths. There can't be spaces in the subst arguments
-# or we get spurious spaces in the actual list of files to include.
-
-# target overrides
-ifneq ($(tmake_file),)
-include $(subst /config,/../config,$(tmake_file))
-endif
-
-# host overrides
-ifneq ($(xmake_file),)
-include $(subst /config,/../config,$(xmake_file))
-endif
-
-# Now figure out from those variables how to compile and link.
-
-all.indirect: Makefile ../gnat1$(exeext)
-
-# IN_GCC distinguishes between code compiled into GCC itself and other
-# programs built during a bootstrap.
-# autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a cross
-# compiler which does not use the native libraries and headers.
-INTERNAL_CFLAGS = @CROSS@ -DIN_GCC
-
-# This is the variable actually used when we compile.
-LOOSE_CFLAGS = `echo $(CFLAGS) $(WARN2_CFLAGS)|sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'`
-ALL_CFLAGS = $(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(LOOSE_CFLAGS) \
- $(XCFLAGS)
-
-# Likewise.
-ALL_CPPFLAGS = $(CPPFLAGS) $(X_CPPFLAGS) $(T_CPPFLAGS)
-
-# This is where we get libiberty.a from.
-LIBIBERTY = ../../libiberty/libiberty.a
-
-# How to link with both our special library facilities
-# and the system's installed libraries.
-LIBS = $(LIBINTL) $(LIBIBERTY) $(SYSLIBS)
-LIBDEPS = $(LIBINTL_DEP) $(LIBIBERTY)
-# Default is no TGT_LIB; one might be passed down or something
-TGT_LIB =
-TOOLS_LIBS = $(EXTRA_GNATTOOLS_OBJS) targext.o link.o $(LIBGNAT) ../../../libiberty/libiberty.a $(SYSLIBS) $(TGT_LIB)
-
-# Specify the directories to be searched for header files.
-# Both . and srcdir are used, in that order,
-# so that tm.h and config.h will be found in the compilation
-# subdirectory rather than in the source directory.
-INCLUDES = -I- -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config \
- -I$(srcdir)/../../include
-
-ADA_INCLUDES = -I- -I. -I$(srcdir)
-
-INCLUDES_FOR_SUBDIR = -I. -I.. -I../.. -I$(fsrcdir) -I$(fsrcdir)/../config \
- -I$(fsrcdir)/../../include -I$(fsrcdir)/..
-ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir)
-
-# Avoid a lot of time thinking about remaking Makefile.in and *.def.
-.SUFFIXES: .in .def
-
-# Say how to compile Ada programs.
-.SUFFIXES: .ada .adb .ads .asm
-
-# Always use -I$(srcdir)/config when compiling.
-.asm.o:
- $(CC) -c -x assembler $< $(OUTPUT_OPTION)
-
-.c.o:
- $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< \
- $(OUTPUT_OPTION)
-
-.adb.o:
- $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
-
-.ads.o:
- $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
-
-# how to regenerate this file
-Makefile: ../config.status $(srcdir)/Makefile.in $(srcdir)/../version.c
- cd ..; \
- LANGUAGES="$(CONFIG_LANGUAGES)" \
- CONFIG_HEADERS= \
- CONFIG_FILES=ada/Makefile $(SHELL) config.status
-
-# This tells GNU make version 3 not to export all the variables
-# defined in this file into the environment.
-.NOEXPORT:
-
-# Lists of files for various purposes.
-
-GNATLINK_OBJS = gnatlink.o \
- a-except.o ali.o alloc.o butil.o casing.o csets.o debug.o fmap.o fname.o \
- gnatvsn.o hostparm.o indepsw.o interfac.o i-c.o i-cstrin.o namet.o opt.o \
- osint.o output.o rident.o s-exctab.o s-secsta.o s-stalib.o s-stoele.o \
- sdefault.o snames.o stylesw.o switch.o system.o table.o targparm.o tree_io.o \
- types.o validsw.o widechar.o
-
-GNATMAKE_OBJS = a-except.o ali.o ali-util.o s-casuti.o \
- alloc.o atree.o binderr.o butil.o casing.o csets.o debug.o elists.o einfo.o\
- erroutc.o errutil.o err_vars.o fmap.o fname.o fname-uf.o fname-sf.o \
- gnatmake.o gnatvsn.o hostparm.o interfac.o i-c.o i-cstrin.o krunch.o lib.o \
- make.o makeusg.o makeutl.o mlib.o mlib-fil.o mlib-prj.o mlib-tgt.o \
- mlib-tgt-specific.o mlib-utl.o namet.o nlists.o opt.o osint.o osint-m.o output.o \
- prj.o prj-attr.o prj-attr-pm.o prj-com.o prj-dect.o prj-env.o prj-err.o prj-ext.o prj-nmsc.o \
- prj-pars.o prj-part.o prj-proc.o prj-strt.o prj-tree.o prj-util.o \
- rident.o s-exctab.o s-secsta.o s-stalib.o s-stoele.o \
- scans.o scng.o sdefault.o sfn_scan.o s-purexc.o s-htable.o \
- sinfo.o sinput.o sinput-c.o sinput-p.o \
- snames.o stand.o stringt.o styleg.o stylesw.o system.o validsw.o switch.o switch-m.o \
- table.o targparm.o tempdir.o tree_io.o types.o \
- uintp.o uname.o urealp.o usage.o widechar.o \
- $(EXTRA_GNATMAKE_OBJS)
-
-# Convert the target variable into a space separated list of architecture,
-# manufacturer, and operating system and assign each of those to its own
-# variable.
-
-host:=$(subst -, ,$(host_canonical))
-targ:=$(subst -, ,$(target))
-arch:=$(word 1,$(targ))
-ifeq ($(words $(targ)),2)
- manu:=
- osys:=$(word 2,$(targ))
-else
- manu:=$(word 2,$(targ))
- osys:=$(word 3,$(targ))
-endif
-
-# LIBGNAT_TARGET_PAIRS is a list of pairs of filenames.
-# The members of each pair must be separated by a '<' and no whitespace.
-# Each pair must be separated by some amount of whitespace from the following
-# pair.
-
-# Non-tasking case:
-
-LIBGNAT_TARGET_PAIRS = \
-a-intnam.ads<a-intnam-dummy.ads \
-s-inmaop.adb<s-inmaop-dummy.adb \
-s-intman.adb<s-intman-dummy.adb \
-s-osinte.ads<s-osinte-dummy.ads \
-s-osprim.adb<s-osprim-posix.adb \
-s-taprop.adb<s-taprop-dummy.adb \
-s-taspri.ads<s-taspri-dummy.ads
-
-# When using the GCC exception handling mechanism, we need to use an
-# alternate body for a-exexpr.adb (a-exexpr-gcc.adb)
-
-EH_MECHANISM=
-
-# Default shared object option. Note that we rely on the fact that the "soname"
-# option will always be present and last in this flag, so that we can have
-# $(SO_OPTS)libgnat-x.xx
-
-SO_OPTS = -Wl,-soname,
-
-# Default gnatlib-shared target.
-# By default, equivalent to gnatlib.
-# Set to gnatlib-shared-default, gnatlib-shared-dual, or a platform specific
-# target when supported.
-GNATLIB_SHARED = gnatlib
-
-# default value for gnatmake's target dependent file
-MLIB_TGT = mlib-tgt
-
-# By default, do not distribute prefix.o (in libgccprefix), since it is only
-# needed by external GNAT tools such as gnatdist and Glide.
-# Override this variable on native platforms when needed.
-PREFIX_OBJS =
-
-# To avoid duplicate code, use this variable to set PREFIX_OBJS when needed:
-PREFIX_REAL_OBJS = ../prefix.o \
- ../../libiberty/concat.o \
- ../../libiberty/xmalloc.o \
- ../../libiberty/xstrdup.o \
- ../../libiberty/xexit.o
-
-LIB_VERSION = $(strip $(shell grep ' Library_Version :' $(fsrcpfx)gnatvsn.ads | sed -e 's/.*"\(.*\)".*/\1/'))
-
-# $(filter-out PATTERN...,TEXT) removes all PATTERN words from TEXT.
-# $(strip STRING) removes leading and trailing spaces from STRING.
-# If what's left is null then it's a match.
-
-ifeq ($(strip $(filter-out m68k% wrs vx%,$(targ))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-vxworks.ads \
- a-numaux.ads<a-numaux-vxworks.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-interr.adb<s-interr-vxworks.adb \
- s-intman.ads<s-intman-vxworks.ads \
- s-intman.adb<s-intman-vxworks.adb \
- s-osinte.adb<s-osinte-vxworks.adb \
- s-osinte.ads<s-osinte-vxworks.ads \
- s-osprim.adb<s-osprim-vxworks.adb \
- s-parame.ads<s-parame-vxworks.ads \
- s-parame.adb<s-parame-vxworks.adb \
- s-stchop.ads<s-stchop-limit.ads \
- s-stchop.adb<s-stchop-vxworks.adb \
- s-taprop.adb<s-taprop-vxworks.adb \
- 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 \
- g-sttsne.adb<g-sttsne-vxworks.adb \
- g-sttsne.ads<g-sttsne-locking.ads \
- system.ads<system-vxworks-m68k.ads
-
- TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
-
- EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
- EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
-
- EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
- EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
-
- ifeq ($(strip $(filter-out yes,$(TRACE))),)
- LIBGNAT_TARGET_PAIRS += \
- s-traces.adb<s-traces-default.adb \
- s-tratas.adb<s-tratas-default.adb \
- s-trafor.adb<s-trafor-default.adb \
- s-trafor.ads<s-trafor-default.ads \
- s-tfsetr.adb<s-tfsetr-vxworks.adb
- endif
-endif
-
-ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(targ))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-vxworks.ads \
- a-numaux.ads<a-numaux-vxworks.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.ads<s-intman-vxworks.ads \
- s-intman.adb<s-intman-vxworks.adb \
- s-osprim.adb<s-osprim-vxworks.adb \
- s-parame.ads<s-parame-vxworks.ads \
- s-parame.adb<s-parame-vxworks.adb \
- s-stchop.ads<s-stchop-limit.ads \
- s-stchop.adb<s-stchop-vxworks.adb \
- 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 \
- g-sttsne.adb<g-sttsne-vxworks.adb \
- g-sttsne.ads<g-sttsne-locking.ads
-
- TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
-
- ifeq ($(strip $(filter-out yes,$(TRACE))),)
- LIBGNAT_TARGET_PAIRS += \
- s-traces.adb<s-traces-default.adb \
- s-trafor.adb<s-trafor-default.adb \
- s-trafor.ads<s-trafor-default.ads \
- s-tratas.adb<s-tratas-default.adb \
- s-tfsetr.adb<s-tfsetr-vxworks.adb
- endif
-
- ifeq ($(strip $(filter-out rtp,$(THREAD_KIND))),)
- LIBGNAT_TARGET_PAIRS += \
- s-osinte.adb<s-osinte-vxworks-rtp.adb \
- s-osinte.ads<s-osinte-vxworks6.ads \
- s-tpopsp.adb<s-tpopsp-vxworks-rtp.adb \
- system.ads<system-vxworks-ppc-rtp.ads
-
- EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
- else
- LIBGNAT_TARGET_PAIRS += \
- s-interr.adb<s-interr-vxworks.adb \
- s-tpopsp.adb<s-tpopsp-vxworks.adb \
- system.ads<system-vxworks-ppc.ads
-
- ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),)
- LIBGNAT_TARGET_PAIRS += \
- s-osinte.ads<s-osinte-vxworks6.ads \
- s-osinte.adb<s-osinte-vxworks-kernel.adb
- else
- LIBGNAT_TARGET_PAIRS += \
- s-osinte.ads<s-osinte-vxworks.ads \
- s-osinte.adb<s-osinte-vxworks.adb
- endif
-
- EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
- endif
-
- EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
-
- EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
- EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
-endif
-
-# vxworksae / vxworks 653
-ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(targ))),)
- # target pairs for kernel + vthreads runtime
- LIBGNAT_TARGET_PAIRS = \
- a-elchha.adb<a-elchha-vxworks-ppc-full.adb \
- a-intnam.ads<a-intnam-vxworks.ads \
- a-numaux.ads<a-numaux-vxworks.ads \
- g-io.adb<g-io-vxworks-ppc-cert.adb \
- g-io.ads<g-io-vxworks-ppc-cert.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-interr.adb<s-interr-vxworks.adb \
- s-intman.ads<s-intman-vxworks.ads \
- s-intman.adb<s-intman-vxworks.adb \
- s-osinte.adb<s-osinte-vxworks.adb \
- s-osinte.ads<s-osinte-vxworks.ads \
- s-osprim.adb<s-osprim-vxworks.adb \
- s-parame.ads<s-parame-ae653.ads \
- s-parame.adb<s-parame-vxworks.adb \
- s-taprop.adb<s-taprop-vxworks.adb \
- 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 \
- g-sttsne.adb<g-sttsne-vxworks.adb \
- g-sttsne.ads<g-sttsne-locking.ads \
- system.ads<system-vxworks-ppc-vthread.ads
-
- TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
-
- EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
- EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
-
- # Extra pairs for the vthreads runtime
- ifeq ($(strip $(filter-out vthreads,$(THREAD_KIND))),)
- LIBGNAT_TARGET_PAIRS += \
- s-thread.adb<s-thread-ae653.adb
- EXTRA_GNATRTL_NONTASKING_OBJS += s-thread.o
- endif
-
- ifeq ($(strip $(filter-out yes,$(TRACE))),)
- LIBGNAT_TARGET_PAIRS += \
- s-traces.adb<s-traces-default.adb \
- s-trafor.adb<s-trafor-default.adb \
- s-trafor.ads<s-trafor-default.ads \
- s-tratas.adb<s-tratas-default.adb \
- s-tfsetr.adb<s-tfsetr-vxworks.adb
- endif
-endif
-
-ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-vxworks.ads \
- a-numaux.ads<a-numaux-vxworks.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-interr.adb<s-interr-vxworks.adb \
- s-intman.ads<s-intman-vxworks.ads \
- s-intman.adb<s-intman-vxworks.adb \
- s-osinte.adb<s-osinte-vxworks.adb \
- s-osinte.ads<s-osinte-vxworks.ads \
- s-osprim.adb<s-osprim-vxworks.adb \
- s-parame.ads<s-parame-vxworks.ads \
- s-parame.adb<s-parame-vxworks.adb \
- s-stchop.ads<s-stchop-limit.ads \
- s-stchop.adb<s-stchop-vxworks.adb \
- s-taprop.adb<s-taprop-vxworks.adb \
- 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 \
- g-sttsne.adb<g-sttsne-vxworks.adb \
- g-sttsne.ads<g-sttsne-locking.ads \
- system.ads<system-vxworks-sparcv9.ads \
-
- TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
-
- EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
- EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
-
- EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
- EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
-endif
-
-ifeq ($(strip $(filter-out %86 wrs vxworks,$(targ))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-vxworks.ads \
- i-vxwork.ads<i-vxwork-x86.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.ads<s-intman-vxworks.ads \
- s-intman.adb<s-intman-vxworks.adb \
- a-numaux.adb<a-numaux-x86.adb \
- a-numaux.ads<a-numaux-x86.ads \
- s-osprim.adb<s-osprim-vxworks.adb \
- s-parame.ads<s-parame-vxworks.ads \
- s-parame.adb<s-parame-vxworks.adb \
- s-stchop.ads<s-stchop-limit.ads \
- s-stchop.adb<s-stchop-vxworks.adb \
- s-taprop.adb<s-taprop-vxworks.adb \
- 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 \
- g-sttsne.adb<g-sttsne-vxworks.adb \
- g-sttsne.ads<g-sttsne-locking.ads
-
- TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
-
- ifeq ($(strip $(filter-out yes,$(TRACE))),)
- LIBGNAT_TARGET_PAIRS += \
- s-traces.adb<s-traces-default.adb \
- s-trafor.adb<s-trafor-default.adb \
- s-trafor.ads<s-trafor-default.ads \
- s-tratas.adb<s-tratas-default.adb \
- s-tfsetr.adb<s-tfsetr-vxworks.adb
- endif
-
- ifeq ($(strip $(filter-out rtp,$(THREAD_KIND))),)
- LIBGNAT_TARGET_PAIRS += \
- s-osinte.adb<s-osinte-vxworks-rtp.adb \
- s-osinte.ads<s-osinte-vxworks6.ads \
- s-tpopsp.adb<s-tpopsp-vxworks-rtp.adb \
- system.ads<system-vxworks-x86-rtp.ads
-
- EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
- else
- LIBGNAT_TARGET_PAIRS += \
- s-interr.adb<s-interr-vxworks.adb \
- s-tpopsp.adb<s-tpopsp-vxworks.adb \
- system.ads<system-vxworks-x86.ads
-
- ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),)
- LIBGNAT_TARGET_PAIRS += \
- s-osinte.ads<s-osinte-vxworks6.ads \
- s-osinte.adb<s-osinte-vxworks-kernel.adb
- else
- LIBGNAT_TARGET_PAIRS += \
- s-osinte.ads<s-osinte-vxworks.ads \
- s-osinte.adb<s-osinte-vxworks.adb
- endif
-
- EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
- endif
-
- EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
-
- EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
- EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
-endif
-
-ifeq ($(strip $(filter-out arm% coff wrs vx%,$(targ))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-vxworks.ads \
- a-numaux.ads<a-numaux-vxworks.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-interr.adb<s-interr-vxworks.adb \
- s-intman.ads<s-intman-vxworks.ads \
- s-intman.adb<s-intman-vxworks.adb \
- s-osinte.adb<s-osinte-vxworks.adb \
- s-osinte.ads<s-osinte-vxworks.ads \
- s-osprim.adb<s-osprim-vxworks.adb \
- s-parame.ads<s-parame-vxworks.ads \
- s-parame.adb<s-parame-vxworks.adb \
- s-stchop.ads<s-stchop-limit.ads \
- s-stchop.adb<s-stchop-vxworks.adb \
- s-taprop.adb<s-taprop-vxworks.adb \
- 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 \
- g-sttsne.adb<g-sttsne-vxworks.adb \
- g-sttsne.ads<g-sttsne-locking.ads \
- system.ads<system-vxworks-arm.ads
-
- TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
-
- EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
- EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
-
- EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
- EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
-endif
-
-ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-vxworks.ads \
- a-numaux.ads<a-numaux-vxworks.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-interr.adb<s-interr-vxworks.adb \
- s-intman.ads<s-intman-vxworks.ads \
- s-intman.adb<s-intman-vxworks.adb \
- s-osinte.adb<s-osinte-vxworks.adb \
- s-osinte.ads<s-osinte-vxworks.ads \
- s-osprim.adb<s-osprim-vxworks.adb \
- s-parame.ads<s-parame-vxworks.ads \
- s-parame.adb<s-parame-vxworks.adb \
- s-stchop.ads<s-stchop-limit.ads \
- s-stchop.adb<s-stchop-vxworks.adb \
- s-taprop.adb<s-taprop-vxworks.adb \
- 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 \
- g-sttsne.adb<g-sttsne-vxworks.adb \
- g-sttsne.ads<g-sttsne-locking.ads \
- system.ads<system-vxworks-mips.ads
-
- TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
-
- EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
- EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
-
- EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
- EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
-endif
-
-ifeq ($(strip $(filter-out sparc% sun solaris%,$(targ))),)
- LIBGNAT_TARGET_PAIRS_32 = \
- a-intnam.ads<a-intnam-solaris.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-solaris.adb \
- s-osinte.adb<s-osinte-solaris.adb \
- s-osinte.ads<s-osinte-solaris.ads \
- s-osprim.adb<s-osprim-solaris.adb \
- s-taprop.adb<s-taprop-solaris.adb \
- s-tasinf.adb<s-tasinf-solaris.adb \
- 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
-
- LIBGNAT_TARGET_PAIRS_64 = \
- a-intnam.ads<a-intnam-solaris.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-solaris.adb \
- s-osinte.adb<s-osinte-solaris.adb \
- s-osinte.ads<s-osinte-solaris.ads \
- s-osprim.adb<s-osprim-solaris.adb \
- s-taprop.adb<s-taprop-solaris.adb \
- s-tasinf.adb<s-tasinf-solaris.adb \
- 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
-
- ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
- LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_32)
- else
- LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64)
- endif
-
- TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-solaris.adb
-
- EH_MECHANISM=-gcc
- THREADSLIB = -lposix4 -lthread
- MISCLIB = -lposix4 -lnsl -lsocket
- SO_OPTS = -Wl,-h,
- GNATLIB_SHARED = gnatlib-shared-dual
- GMEM_LIB = gmemlib
- PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(LIB_VERSION)
-
- ifeq ($(strip $(filter-out pthread PTHREAD,$(THREAD_KIND))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-solaris.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-osinte.adb<s-osinte-posix.adb \
- s-osinte.ads<s-osinte-solaris-posix.ads \
- s-osprim.adb<s-osprim-solaris.adb \
- 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
-
- THREADSLIB = -lposix4 -lpthread
- endif
-
- ifeq ($(strip $(filter-out m64,$(THREAD_KIND))),)
- LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64)
- endif
-endif
-
-ifeq ($(strip $(filter-out %86 solaris2%,$(arch) $(osys))),)
- LIBGNAT_TARGET_PAIRS = \
- a-numaux.adb<a-numaux-x86.adb \
- a-numaux.ads<a-numaux-x86.ads \
- a-intnam.ads<a-intnam-solaris.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-solaris.adb \
- s-osinte.adb<s-osinte-solaris.adb \
- s-osinte.ads<s-osinte-solaris.ads \
- s-osprim.adb<s-osprim-solaris.adb \
- s-taprop.adb<s-taprop-solaris.adb \
- s-tasinf.adb<s-tasinf-solaris.adb \
- s-tasinf.ads<s-tasinf-solaris.ads \
- 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
-
- TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-solaris.adb
-
- EH_MECHANISM=-gcc
- THREADSLIB = -lposix4 -lthread
- MISCLIB = -lposix4 -lnsl -lsocket
- SO_OPTS = -Wl,-h,
- GNATLIB_SHARED = gnatlib-shared-dual
- GMEM_LIB = gmemlib
- PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(LIB_VERSION)
-endif
-
-ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-linux.ads \
- a-numaux.adb<a-numaux-x86.adb \
- a-numaux.ads<a-numaux-x86.ads \
- g-bytswa.adb<g-bytswa-x86.adb \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-osprim.adb<s-osprim-posix.adb \
- s-taspri.ads<s-taspri-posix.ads \
- s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- g-sercom.adb<g-sercom-linux.adb \
- system.ads<system-linux-x86.ads
-
- ifeq ($(strip $(filter-out marte,$(THREAD_KIND))),)
- LIBGNAT_TARGET_PAIRS += \
- a-exetim.adb<a-exetim-linux-marte.adb \
- a-exetim.ads<a-exetim-linux-marte.ads \
- a-extiti.adb<a-extiti-linux-marte.adb \
- 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
-
- EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o a-extiti.o
-
- EH_MECHANISM=
- 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
-
- EH_MECHANISM=-gcc
- THREADSLIB = -lpthread
- EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
- endif
-
- TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
- indepsw.adb<indepsw-gnu.adb
-
- GNATLIB_SHARED = gnatlib-shared-dual
- GMEM_LIB = gmemlib
- PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(LIB_VERSION)
-endif
-
-ifeq ($(strip $(filter-out %86 kfreebsd%,$(arch) $(osys))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-freebsd.ads \
- a-numaux.adb<a-numaux-x86.adb \
- 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 \
- s-taprop.adb<s-taprop-linux.adb \
- s-tasinf.ads<s-tasinf-linux.ads \
- s-tasinf.adb<s-tasinf-linux.adb \
- s-taspri.ads<s-taspri-posix.ads \
- s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- system.ads<system-freebsd-x86.ads
-
- TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
- indepsw.adb<indepsw-gnu.adb
-
- EH_MECHANISM=-gcc
- THREADSLIB = -lpthread
- GNATLIB_SHARED = gnatlib-shared-dual
- GMEM_LIB = gmemlib
- PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(LIB_VERSION)
-endif
-
-ifeq ($(strip $(filter-out %86 freebsd%,$(arch) $(osys))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-freebsd.ads \
- 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 \
- s-osinte.ads<s-osinte-freebsd.ads \
- s-osprim.adb<s-osprim-posix.adb \
- s-taprop.adb<s-taprop-posix.adb \
- s-taspri.ads<s-taspri-posix.ads \
- s-tpopsp.adb<s-tpopsp-posix.adb \
- system.ads<system-freebsd-x86.ads
-
- TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
- GNATLIB_SHARED = gnatlib-shared-dual
-
- EH_MECHANISM=-gcc
- THREADSLIB= -lpthread
- GMEM_LIB = gmemlib
- PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(LIB_VERSION)
-endif
-
-ifeq ($(strip $(filter-out s390% linux%,$(arch) $(osys))),)
- ifeq ($(strip $(filter-out s390x,$(arch))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-linux.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-linux.ads<s-linux.ads \
- s-osinte.adb<s-osinte-posix.adb \
- s-osinte.ads<s-osinte-linux.ads \
- s-osprim.adb<s-osprim-posix.adb \
- s-taprop.adb<s-taprop-linux.adb \
- s-tasinf.ads<s-tasinf-linux.ads \
- s-tasinf.adb<s-tasinf-linux.adb \
- s-taspri.ads<s-taspri-posix-noaltstack.ads \
- s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- system.ads<system-linux-s390x.ads
- else
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-linux.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-linux.ads<s-linux.ads \
- s-osinte.adb<s-osinte-posix.adb \
- s-osinte.ads<s-osinte-linux.ads \
- s-osprim.adb<s-osprim-posix.adb \
- s-taprop.adb<s-taprop-linux.adb \
- s-tasinf.ads<s-tasinf-linux.ads \
- s-tasinf.adb<s-tasinf-linux.adb \
- s-taspri.ads<s-taspri-posix-noaltstack.ads \
- s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- system.ads<system-linux-s390.ads
- endif
-
- TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
-
- EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
- EH_MECHANISM=-gcc
- THREADSLIB = -lpthread
- GNATLIB_SHARED = gnatlib-shared-dual
- PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(LIB_VERSION)
-endif
-
-ifeq ($(strip $(filter-out mips sgi irix%,$(targ))),)
- ifeq ($(strip $(filter-out mips sgi irix6%,$(targ))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-irix.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-irix.adb \
- s-mastop.adb<s-mastop-irix.adb \
- s-osinte.adb<s-osinte-irix.adb \
- s-osinte.ads<s-osinte-irix.ads \
- s-osprim.adb<s-osprim-posix.adb \
- s-proinf.adb<s-proinf-irix-athread.adb \
- s-proinf.ads<s-proinf-irix-athread.ads \
- s-taprop.adb<s-taprop-irix.adb \
- s-tasinf.ads<s-tasinf-irix.ads \
- 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
- GNATLIB_SHARED = gnatlib-shared-default
-
- else
- LIBGNAT_TARGET_PAIRS += \
- 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
-
- EH_MECHANISM=-gcc
- TOOLS_TARGET_PAIRS = mlib-tgt-specific.adb<mlib-tgt-specific-irix.adb
- TGT_LIB = -lexc
- MISCLIB = -lexc
- PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(LIB_VERSION)
- GMEM_LIB = gmemlib
-endif
-
-ifeq ($(strip $(filter-out hppa% hp hpux10%,$(targ))),)
- LIBGNAT_TARGET_PAIRS = \
- a-excpol.adb<a-excpol-abort.adb \
- a-intnam.ads<a-intnam-hpux.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-interr.adb<s-interr-sigaction.adb \
- s-intman.adb<s-intman-posix.adb \
- s-osinte.adb<s-osinte-hpux-dce.adb \
- s-osinte.ads<s-osinte-hpux-dce.ads \
- s-parame.ads<s-parame-hpux.ads \
- s-osprim.adb<s-osprim-posix.adb \
- 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
- PREFIX_OBJS = $(PREFIX_REAL_OBJS)
-endif
-
-ifeq ($(strip $(filter-out hppa% hp hpux11%,$(targ))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-hpux.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-osinte.adb<s-osinte-posix.adb \
- s-osinte.ads<s-osinte-hpux.ads \
- s-parame.ads<s-parame-hpux.ads \
- s-osprim.adb<s-osprim-posix.adb \
- s-traceb.adb<s-traceb-hpux.adb \
- 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
- EH_MECHANISM=-gcc
- TGT_LIB = /usr/lib/libcl.a
- THREADSLIB = -lpthread
- GMEM_LIB = gmemlib
- soext = .sl
- SO_OPTS = -Wl,+h,
- PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- GNATLIB_SHARED = gnatlib-shared-dual
- LIBRARY_VERSION := $(LIB_VERSION)
-endif
-
-ifeq ($(strip $(filter-out ibm aix%,$(manu) $(osys))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-aix.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-osinte.adb<s-osinte-aix.adb \
- s-osinte.ads<s-osinte-aix.ads \
- s-osprim.adb<s-osprim-posix.adb \
- 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
- PREFIX_OBJS=$(PREFIX_REAL_OBJS)
-
- TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-specific-aix.adb \
- indepsw.adb<indepsw-aix.adb
-
- GMEM_LIB = gmemlib
-endif
-
-ifeq ($(strip $(filter-out lynxos,$(osys))),)
- TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-specific-lynxos.adb \
- indepsw.adb<indepsw-gnu.adb
-
- ifeq ($(strip $(filter-out %86 lynxos,$(arch) $(osys))),)
- LIBGNAT_TARGET_PAIRS = \
- a-numaux.adb<a-numaux-x86.adb \
- 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 \
- s-intman.adb<s-intman-posix.adb \
- s-osinte.adb<s-osinte-lynxos.adb \
- s-osinte.ads<s-osinte-lynxos.ads \
- s-osprim.adb<s-osprim-posix.adb \
- s-taprop.adb<s-taprop-lynxos.adb \
- s-taspri.ads<s-taspri-lynxos.ads \
- s-tpopsp.adb<s-tpopsp-lynxos.adb \
- system.ads<system-lynxos-x86.ads
-
- PREFIX_OBJS=$(PREFIX_REAL_OBJS)
-
- 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 \
- s-intman.adb<s-intman-posix.adb \
- s-osinte.adb<s-osinte-lynxos.adb \
- s-osinte.ads<s-osinte-lynxos.ads \
- s-osprim.adb<s-osprim-posix.adb \
- s-taprop.adb<s-taprop-lynxos.adb \
- s-taspri.ads<s-taspri-lynxos.ads \
- s-tpopsp.adb<s-tpopsp-lynxos.adb \
- system.ads<system-lynxos-ppc.ads
- endif
-endif
-
-ifeq ($(strip $(filter-out rtems%,$(osys))),)
- LIBGNAT_TARGET_PAIRS = \
- system.ads<system-rtems.ads \
- a-intnam.ads<a-intnam-rtems.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-osinte.adb<s-osinte-rtems.adb \
- s-osinte.ads<s-osinte-rtems.ads \
- s-osprim.adb<s-osprim-posix.adb \
- s-parame.adb<s-parame-rtems.adb \
- 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
-
-ifeq ($(strip $(filter-out alpha% dec osf%,$(targ))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-tru64.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-mastop.adb<s-mastop-tru64.adb \
- s-osinte.adb<s-osinte-tru64.adb \
- s-osinte.ads<s-osinte-tru64.ads \
- s-osprim.adb<s-osprim-unix.adb \
- s-taprop.adb<s-taprop-tru64.adb \
- s-tasinf.ads<s-tasinf-tru64.ads \
- 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
-
- EH_MECHANISM=-gcc
- GMEM_LIB=gmemlib
- THREADSLIB = -lpthread -lmach -lexc -lrt
- PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- GNATLIB_SHARED = gnatlib-shared-default
- LIBRARY_VERSION := $(LIB_VERSION)
-endif
-
-ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(host))),)
-
-soext = .exe
-hyphen = _
-LN = cp -p
-LN_S = cp -p
-
-.SUFFIXES: .sym
-
-.o.sym:
- @ gnu:[bin]vmssymvec $<
-endif
-
-ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(targ))),)
-ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
- LIBGNAT_TARGET_PAIRS_AUX1 = \
- g-enblsp.adb<g-enblsp-vms-ia64.adb \
- g-trasym.adb<g-trasym-vms-ia64.adb \
- s-asthan.adb<s-asthan-vms-ia64.adb \
- s-osinte.adb<s-osinte-vms-ia64.adb \
- s-osinte.ads<s-osinte-vms-ia64.ads \
- s-vaflop.adb<s-vaflop-vms-ia64.adb \
- system.ads<system-vms-ia64.ads
-
- LIBGNAT_TARGET_PAIRS_AUX2 = \
- s-parame.ads<s-parame-vms-ia64.ads
-else
-ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
- LIBGNAT_TARGET_PAIRS_AUX1 = \
- g-enblsp.adb<g-enblsp-vms-alpha.adb \
- g-trasym.adb<g-trasym-vms-alpha.adb \
- s-traent.adb<s-traent-vms.adb \
- s-traent.ads<s-traent-vms.ads \
- s-asthan.adb<s-asthan-vms-alpha.adb \
- s-osinte.adb<s-osinte-vms.adb \
- s-osinte.ads<s-osinte-vms.ads \
- s-vaflop.adb<s-vaflop-vms-alpha.adb \
- system.ads<system-vms_64.ads
-
-ifeq ($(strip $(filter-out express EXPRESS,$(THREAD_KIND))),)
- LIBGNAT_TARGET_PAIRS_AUX2 = \
- s-parame.ads<s-parame-vms-restrict.ads
-else
- LIBGNAT_TARGET_PAIRS_AUX2 = \
- s-parame.ads<s-parame-vms-alpha.ads
-endif
-endif
-endif
-
- LIBGNAT_TARGET_PAIRS = \
- a-caldel.adb<a-caldel-vms.adb \
- a-calend.adb<a-calend-vms.adb \
- a-calend.ads<a-calend-vms.ads \
- a-dirval.adb<a-dirval-vms.adb \
- a-excpol.adb<a-excpol-abort.adb \
- 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 \
- g-sttsne.adb<g-sttsne-locking.adb \
- g-sttsne.ads<g-sttsne-locking.ads \
- i-c.ads<i-c-vms_64.ads \
- i-cstrin.ads<i-cstrin-vms_64.ads \
- i-cstrin.adb<i-cstrin-vms_64.adb \
- i-cpoint.ads<i-cpoint-vms_64.ads \
- i-cpoint.adb<i-cpoint-vms_64.adb \
- i-cstrea.adb<i-cstrea-vms.adb \
- memtrack.adb<memtrack-vms_64.adb \
- s-auxdec.ads<s-auxdec-vms_64.ads \
- s-crtl.ads<s-crtl-vms_64.ads \
- s-inmaop.adb<s-inmaop-vms.adb \
- s-interr.adb<s-interr-vms.adb \
- s-intman.adb<s-intman-vms.adb \
- s-intman.ads<s-intman-vms.ads \
- s-memory.adb<s-memory-vms_64.adb \
- s-memory.ads<s-memory-vms_64.ads \
- s-osprim.adb<s-osprim-vms.adb \
- s-osprim.ads<s-osprim-vms.ads \
- s-taprop.adb<s-taprop-vms.adb \
- s-taspri.ads<s-taspri-vms.ads \
- s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- s-tpopde.adb<s-tpopde-vms.adb \
- s-tpopde.ads<s-tpopde-vms.ads \
- $(LIBGNAT_TARGET_PAIRS_AUX1) \
- $(LIBGNAT_TARGET_PAIRS_AUX2)
-
-ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
- TOOLS_TARGET_PAIRS= \
- mlib-tgt-specific.adb<mlib-tgt-specific-vms-ia64.adb \
- symbols.adb<symbols-vms.adb \
- symbols-processing.adb<symbols-processing-vms-ia64.adb
-else
- TOOLS_TARGET_PAIRS= \
- mlib-tgt-specific.adb<mlib-tgt-specific-vms-alpha.adb \
- symbols.adb<symbols-vms.adb \
- symbols-processing.adb<symbols-processing-vms-alpha.adb
-endif
-
-adamsg.o: adamsg.msg
- -$(DECC) --cc=message adamsg.msg -o adamsg.o
-
- EXTRA_GNATMAKE_OBJS = mlib-tgt-vms_common.o
-
- GMEM_LIB = gmemlib
- EH_MECHANISM=-gcc
- GNATLIB_SHARED=gnatlib-shared-vms
-ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
- EXTRA_LIBGNAT_SRCS=vmshandler.asm
- EXTRA_LIBGNAT_OBJS=vmshandler.o
-endif
- EXTRA_LIBGNAT_SRCS+=adamsg.msg
- EXTRA_LIBGNAT_OBJS+=adamsg.o
- EXTRA_GNATRTL_TASKING_OBJS=s-tpopde.o
- EXTRA_GNATTOOLS = \
- ../../gnatlbr$(exeext) \
- ../../gnatsym$(exeext) \
- ../../vms_help$(exeext) \
- ../../gnat.hlp
- # This command transforms (YYYYMMDD) into YY,MMDD
- GSMATCH_VERSION := $(shell grep "^ *Gnat_Static_Version_String" $(fsrcpfx)gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\).*/\2,\3/')
- TOOLS_LIBS_LO := --for-linker=sys\\$$\$$library:trace.exe
- LIBRARY_VERSION := $(subst .,_,$(LIB_VERSION))
-endif
-
-ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
- LIBGNAT_TARGET_PAIRS = \
- a-dirval.adb<a-dirval-mingw.adb \
- a-excpol.adb<a-excpol-abort.adb \
- a-numaux.adb<a-numaux-x86.adb \
- a-numaux.ads<a-numaux-x86.ads \
- s-gloloc.adb<s-gloloc-mingw.adb \
- s-inmaop.adb<s-inmaop-dummy.adb \
- s-memory.adb<s-memory-mingw.adb \
- s-taspri.ads<s-taspri-mingw.ads \
- s-tasinf.adb<s-tasinf-mingw.adb \
- s-tasinf.ads<s-tasinf-mingw.ads \
- g-bytswa.adb<g-bytswa-x86.adb \
- 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))),)
- LIBGNAT_TARGET_PAIRS += \
- s-intman.adb<s-intman-dummy.adb \
- s-osinte.ads<s-osinte-rtx.ads \
- s-osprim.adb<s-osprim-rtx.adb \
- s-taprop.adb<s-taprop-rtx.adb \
- system.ads<system-rtx.ads
-
- EXTRA_GNATRTL_NONTASKING_OBJS = s-win32.o
-
- MISCLIB = -lwsock32 -lrtapi_w32
- THREADSLIB=-lrtapi_w32
- else
- LIBGNAT_TARGET_PAIRS += \
- a-exetim.adb<a-exetim-mingw.adb \
- a-exetim.ads<a-exetim-mingw.ads \
- a-intnam.ads<a-intnam-mingw.ads \
- g-sercom.adb<g-sercom-mingw.adb \
- s-interr.adb<s-interr-sigaction.adb \
- 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
-
- EXTRA_GNATRTL_NONTASKING_OBJS = s-win32.o s-win32.o g-regist.o
- EXTRA_GNATRTL_TASKING_OBJS = a-exetim.o
-
- MISCLIB = -lwsock32
-
- # ??? This will be replaced by gnatlib-shared-dual-win32 when GNAT
- # auto-import support for array/record will be done.
- GNATLIB_SHARED = gnatlib-shared-win32
- endif
-
- TOOLS_TARGET_PAIRS= \
- mlib-tgt-specific.adb<mlib-tgt-specific-mingw.adb \
- indepsw.adb<indepsw-mingw.adb
-
- EH_MECHANISM=-gcc
- GMEM_LIB = gmemlib
- PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- EXTRA_GNATTOOLS = ../../gnatdll$(exeext)
- EXTRA_GNATMAKE_OBJS = mdll.o mdll-utl.o mdll-fil.o
- soext = .dll
- LIBRARY_VERSION := $(LIB_VERSION)
-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 \
- s-osinte.adb<s-osinte-posix.adb \
- s-osinte.ads<s-osinte-linux.ads \
- s-osprim.adb<s-osprim-posix.adb \
- s-taprop.adb<s-taprop-linux.adb \
- s-tasinf.ads<s-tasinf-linux.ads \
- s-tasinf.adb<s-tasinf-linux.adb \
- s-taspri.ads<s-taspri-posix.ads \
- s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- system.ads<system-linux-mips.ads
-
- EH_MECHANISM=-gcc
- THREADSLIB = -lpthread
- GNATLIB_SHARED = gnatlib-shared-dual
- GMEM_LIB = gmemlib
- PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(LIB_VERSION)
-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 \
- s-osinte.adb<s-osinte-posix.adb \
- s-osinte.ads<s-osinte-linux.ads \
- s-osprim.adb<s-osprim-posix.adb \
- s-taprop.adb<s-taprop-linux.adb \
- s-tasinf.ads<s-tasinf-linux.ads \
- s-tasinf.adb<s-tasinf-linux.adb \
- s-taspri.ads<s-taspri-posix.ads \
- s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- system.ads<system-linux-mipsel.ads
-
- EH_MECHANISM=-gcc
- THREADSLIB = -lpthread
- GNATLIB_SHARED = gnatlib-shared-dual
- GMEM_LIB = gmemlib
- PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(LIB_VERSION)
-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 \
- s-osinte.adb<s-osinte-posix.adb \
- s-osinte.ads<s-osinte-linux.ads \
- s-osprim.adb<s-osprim-posix.adb \
- s-taprop.adb<s-taprop-linux.adb \
- s-tasinf.ads<s-tasinf-linux.ads \
- s-tasinf.adb<s-tasinf-linux.adb \
- s-taspri.ads<s-taspri-posix-noaltstack.ads \
- s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- g-sercom.adb<g-sercom-linux.adb \
- system.ads<system-linux-ppc.ads
-
- TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
- indepsw.adb<indepsw-gnu.adb
-
- EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
- EH_MECHANISM=-gcc
- THREADSLIB = -lpthread
- GNATLIB_SHARED = gnatlib-shared-dual
- GMEM_LIB = gmemlib
- PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(LIB_VERSION)
-endif
-
-ifeq ($(strip $(filter-out sparc% linux%,$(arch) $(osys))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-linux.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-linux.ads<s-linux.ads \
- s-osinte.adb<s-osinte-posix.adb \
- s-osinte.ads<s-osinte-linux.ads \
- s-osprim.adb<s-osprim-posix.adb \
- s-taprop.adb<s-taprop-linux.adb \
- s-tasinf.ads<s-tasinf-linux.ads \
- s-tasinf.adb<s-tasinf-linux.adb \
- s-taspri.ads<s-taspri-posix-noaltstack.ads \
- s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- system.ads<system-linux-sparc.ads
-
- TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
- indepsw.adb<indepsw-gnu.adb
-
- EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
- EH_MECHANISM=-gcc
- THREADSLIB = -lpthread
- GNATLIB_SHARED = gnatlib-shared-dual
- GMEM_LIB = gmemlib
- PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(LIB_VERSION)
-endif
-
-ifeq ($(strip $(filter-out hppa% linux%,$(arch) $(osys))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-linux.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-linux.ads<s-linux-hppa.ads \
- s-osinte.adb<s-osinte-posix.adb \
- s-osinte.ads<s-osinte-linux.ads \
- s-osprim.adb<s-osprim-posix.adb \
- s-taprop.adb<s-taprop-linux.adb \
- s-tasinf.ads<s-tasinf-linux.ads \
- s-tasinf.adb<s-tasinf-linux.adb \
- s-taspri.ads<s-taspri-posix-noaltstack.ads \
- s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- system.ads<system-linux-hppa.ads
-
- TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
- indepsw.adb<indepsw-gnu.adb
-
- EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
- EH_MECHANISM=-gcc
- THREADSLIB = -lpthread
- GNATLIB_SHARED = gnatlib-shared-dual
- GMEM_LIB = gmemlib
- PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(LIB_VERSION)
-endif
-
-ifeq ($(strip $(filter-out sh4% linux%,$(arch) $(osys))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-linux.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-linux.ads<s-linux.ads \
- s-osinte.adb<s-osinte-posix.adb \
- s-osinte.ads<s-osinte-linux.ads \
- s-osprim.adb<s-osprim-posix.adb \
- s-taprop.adb<s-taprop-linux.adb \
- s-tasinf.ads<s-tasinf-linux.ads \
- s-tasinf.adb<s-tasinf-linux.adb \
- s-taspri.ads<s-taspri-posix-noaltstack.ads \
- s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- system.ads<system-linux-sh4.ads
-
- TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
- indepsw.adb<indepsw-linux.adb
-
- EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
- EH_MECHANISM=-gcc
- MISCLIB=
- THREADSLIB = -lpthread
- GNATLIB_SHARED = gnatlib-shared-dual
- GMEM_LIB = gmemlib
- PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(LIB_VERSION)
-endif
-
-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 \
- s-osinte.ads<s-osinte-linux.ads \
- s-osinte.adb<s-osinte-posix.adb \
- s-osprim.adb<s-osprim-posix.adb \
- s-taprop.adb<s-taprop-linux.adb \
- s-tasinf.ads<s-tasinf-linux.ads \
- s-tasinf.adb<s-tasinf-linux.adb \
- s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- s-taspri.ads<s-taspri-posix-noaltstack.ads \
- g-sercom.adb<g-sercom-linux.adb \
- system.ads<system-linux-ia64.ads
-
- TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
- indepsw.adb<indepsw-gnu.adb
-
- EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
- EH_MECHANISM=-gcc
- MISCLIB=
- THREADSLIB=-lpthread
- GNATLIB_SHARED=gnatlib-shared-dual
- GMEM_LIB = gmemlib
- PREFIX_OBJS=$(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(LIB_VERSION)
-endif
-
-ifeq ($(strip $(filter-out alpha% linux%,$(arch) $(osys))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-linux.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-linux.ads<s-linux-alpha.ads \
- s-osinte.ads<s-osinte-linux.ads \
- s-osinte.adb<s-osinte-posix.adb \
- s-osprim.adb<s-osprim-posix.adb \
- s-taprop.adb<s-taprop-linux.adb \
- s-tasinf.ads<s-tasinf-linux.ads \
- s-tasinf.adb<s-tasinf-linux.adb \
- s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- s-taspri.ads<s-taspri-posix-noaltstack.ads \
- system.ads<system-linux-alpha.ads
-
- TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
- indepsw.adb<indepsw-gnu.adb
-
- EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
- EH_MECHANISM=-gcc
- MISCLIB=
- THREADSLIB=-lpthread
- GNATLIB_SHARED=gnatlib-shared-dual
- PREFIX_OBJS=$(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(LIB_VERSION)
-endif
-
-ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),)
- LIBGNAT_TARGET_PAIRS = \
- 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 \
- s-osinte.ads<s-osinte-linux.ads \
- s-osinte.adb<s-osinte-posix.adb \
- s-osprim.adb<s-osprim-posix.adb \
- s-taprop.adb<s-taprop-linux.adb \
- s-tasinf.ads<s-tasinf-linux.ads \
- s-tasinf.adb<s-tasinf-linux.adb \
- s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
- s-taspri.ads<s-taspri-posix.ads \
- g-sercom.adb<g-sercom-linux.adb \
- system.ads<system-linux-x86_64.ads
-
- TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
- indepsw.adb<indepsw-gnu.adb
-
- EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
- EH_MECHANISM=-gcc
- THREADSLIB=-lpthread
- GNATLIB_SHARED=gnatlib-shared-dual
- GMEM_LIB = gmemlib
- PREFIX_OBJS=$(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(LIB_VERSION)
-endif
-
-ifeq ($(strip $(filter-out darwin%,$(osys))),)
- ifeq ($(strip $(filter-out %86,$(arch))),)
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-darwin.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-osinte.adb<s-osinte-darwin.adb \
- s-osinte.ads<s-osinte-darwin.ads \
- s-osprim.adb<s-osprim-posix.adb \
- 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
- else
- LIBGNAT_TARGET_PAIRS = \
- a-intnam.ads<a-intnam-darwin.ads \
- s-inmaop.adb<s-inmaop-posix.adb \
- s-intman.adb<s-intman-posix.adb \
- s-osinte.adb<s-osinte-darwin.adb \
- s-osinte.ads<s-osinte-darwin.ads \
- s-osprim.adb<s-osprim-posix.adb \
- 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
- endif
-
- TOOLS_TARGET_PAIRS = \
- mlib-tgt-specific.adb<mlib-tgt-specific-darwin.adb
-
- EH_MECHANISM=-gcc
- GNATLIB_SHARED = gnatlib-shared-darwin
- SO_OPTS = -Wl,-flat_namespace -shared-libgcc
- RANLIB = ranlib -c
- GMEM_LIB = gmemlib
- PREFIX_OBJS=$(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(LIB_VERSION)
- soext = .dylib
-endif
-
-ifneq ($(EH_MECHANISM),)
- LIBGNAT_TARGET_PAIRS += a-exexpr.adb<a-exexpr$(EH_MECHANISM).adb
- EXTRA_LIBGNAT_SRCS+=raise$(EH_MECHANISM).c
- EXTRA_LIBGNAT_OBJS+=raise$(EH_MECHANISM).o
-endif
-
-# Use the Ada 2005 version of Ada.Exceptions by default, unless specified
-# explicitly already. The base files (a-except.ad?) are used only for building
-# the compiler and other basic tools.
-# These base versions lack Ada 2005 additions which would cause bootstrap
-# problems if included in the compiler and other basic tools.
-
-ifeq ($(filter-out a-except%,$(LIBGNAT_TARGET_PAIRS)),$(LIBGNAT_TARGET_PAIRS))
- LIBGNAT_TARGET_PAIRS += \
- a-except.ads<a-except-2005.ads \
- a-except.adb<a-except-2005.adb
-endif
-
-# The runtime library for gnat comprises two directories. One contains the
-# Ada source files that the compiler (gnat1) needs -- these files are listed
-# by ADA_INCLUDE_SRCS -- and the other contains the object files and their
-# corresponding .ali files for the parts written in Ada, libgnat.a for
-# the parts of the runtime written in C, and libgthreads.a for the pthreads
-# emulation library. LIBGNAT_OBJS lists the objects that go into libgnat.a,
-# while GNATRTL_OBJS lists the object files compiled from Ada sources that
-# go into the directory. The pthreads emulation is built in the threads
-# subdirectory and copied.
-LIBGNAT_SRCS = ada.h adaint.c adaint.h argv.c cio.c cstreams.c \
- errno.c exit.c cal.c ctrl_c.c env.c env.h \
- raise.h raise.c sysdep.c aux-io.c init.c initialize.c seh_init.c \
- final.c tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c expect.c mkdir.c \
- socket.c gsocket.h targext.c $(EXTRA_LIBGNAT_SRCS)
-
-LIBGNAT_OBJS = adaint.o argv.o cio.o cstreams.o ctrl_c.o errno.o exit.o env.o \
- raise.o sysdep.o aux-io.o init.o initialize.o seh_init.o cal.o \
- final.o tracebak.o expect.o mkdir.o socket.o targext.o $(EXTRA_LIBGNAT_OBJS)
-
-# NOTE ??? - when the -I option for compiling Ada code is made to work,
-# the library installation will change and there will be a
-# GNAT_RTL_SRCS. Right now we count on being able to build GNATRTL_OBJS
-# from ADA_INCLUDE_SRCS.
-
-# GNATRTL_NONTASKING_OBJS and GNATRTL_TASKING_OBJS can be found in
-# the following include file:
-
-include $(fsrcdir)/Makefile.rtl
-
-GNATRTL_LINEARALGEBRA_OBJS = a-nlcoar.o a-nllcar.o a-nllrar.o a-nlrear.o \
- a-nucoar.o a-nurear.o i-forbla.o i-forlap.o s-gearop.o
-
-GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) \
- $(GNATRTL_LINEARALGEBRA_OBJS) g-trasym.o memtrack.o
-
-# Default run time files
-
-ADA_INCLUDE_SRCS =\
- ada.ads calendar.ads directio.ads gnat.ads interfac.ads ioexcept.ads \
- machcode.ads text_io.ads unchconv.ads unchdeal.ads \
- sequenio.ads system.ads memtrack.adb \
- a-[a-o]*.adb a-[p-z]*.adb a-[a-o]*.ads a-[p-z]*.ads g-*.ad? i-*.ad? \
- s-[a-o]*.adb s-[p-z]*.adb s-[a-o]*.ads s-[p-z]*.ads
-
-LIBGNAT=../rts/libgnat.a
-
-GCC_LINK=$(CC) -static-libgcc $(ADA_INCLUDES)
-
-# when compiling the tools, the runtime has to be first on the path so that
-# it hides the runtime files lying with the rest of the sources
-ifeq ($(TOOLSCASE),native)
- vpath %.ads ../rts ../
- vpath %.adb ../rts ../
- vpath %.c ../rts ../
- vpath %.h ../rts ../
-endif
-
-# in the cross tools case, everything is compiled with the native
-# gnatmake/link. Therefore only -I needs to be modified in ADA_INCLUDES
-ifeq ($(TOOLSCASE),cross)
- vpath %.ads ../
- vpath %.adb ../
- vpath %.c ../
- vpath %.h ../
-endif
-
-common-tools:
- $(GNATMAKE) -c -b $(ADA_INCLUDES) \
- --GNATBIND="$(GNATBIND)" --GCC="$(CC) $(ALL_ADAFLAGS)" \
- gnatchop gnatcmd gnatkr gnatls gnatprep gnatxref gnatfind gnatname \
- gnatclean -bargs $(ADA_INCLUDES) $(GNATBIND_FLAGS)
- $(GNATLINK) -v gnatcmd -o ../../gnat$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
- $(GNATLINK) -v gnatchop -o ../../gnatchop$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
- $(GNATLINK) -v gnatkr -o ../../gnatkr$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
- $(GNATLINK) -v gnatls -o ../../gnatls$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
- $(GNATLINK) -v gnatprep -o ../../gnatprep$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
- $(GNATLINK) -v gnatxref -o ../../gnatxref$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
- $(GNATLINK) -v gnatfind -o ../../gnatfind$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
- $(GNATLINK) -v gnatname -o ../../gnatname$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
- $(GNATLINK) -v gnatclean -o ../../gnatclean$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
-
-../../gnatsym$(exeext):
- $(GNATMAKE) -c $(ADA_INCLUDES) gnatsym --GCC="$(CC) $(ALL_ADAFLAGS)"
- $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatsym
- $(GNATLINK) -v gnatsym -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
-
-../../gnatdll$(exeext):
- $(GNATMAKE) -c $(ADA_INCLUDES) gnatdll --GCC="$(CC) $(ALL_ADAFLAGS)"
- $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatdll
- $(GNATLINK) -v gnatdll -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
-
-../../vxaddr2line$(exeext): targext.o
- $(GNATMAKE) -c $(ADA_INCLUDES) vxaddr2line --GCC="$(CC) $(ALL_ADAFLAGS)"
- $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vxaddr2line
- $(GNATLINK) -v vxaddr2line -o $@ --GCC="$(GCC_LINK)" targext.o $(CLIB)
-
-gnatmake-re: link.o targext.o
- $(GNATMAKE) $(ADA_INCLUDES) -u sdefault --GCC="$(CC) $(MOST_ADA_FLAGS)"
- $(GNATMAKE) -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
- $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake
- $(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
-
-# Note the use of the "mv" command in order to allow gnatlink to be linked with
-# with the former version of gnatlink itself which cannot override itself.
-gnatlink-re: link.o targext.o
- $(GNATMAKE) -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
- $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink
- $(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
- --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
- $(MV) ../../gnatlinknew$(exeext) ../../gnatlink$(exeext)
-
-# Needs to be built with CC=gcc
-# Since the RTL should be built with the latest compiler, remove the
-# stamp target in the parent directory whenever gnat1 is rebuilt
-
-# Likewise for the tools
-../../gnatmake$(exeext): $(P) b_gnatm.o link.o targext.o $(GNATMAKE_OBJS)
- $(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) \
- $(TOOLS_LIBS)
-
-../../gnatlink$(exeext): $(P) b_gnatl.o link.o targext.o $(GNATLINK_OBJS)
- $(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) \
- $(TOOLS_LIBS)
-
-../stamp-gnatlib:
- @if [ ! -f stamp-gnatlib ] ; \
- then \
- $(ECHO) You must first build the GNAT library: make gnatlib; \
- false; \
- else \
- true; \
- fi
-
-install-gnatlib: ../stamp-gnatlib
-# Create the directory before deleting it, in case the directory is
-# a list of directories (as it may be on VMS). This ensures we are
-# deleting the right one.
- -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
- -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
- $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
- $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
- -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
- -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
- for file in rts/*.ali; do \
- $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
- done
- -$(INSTALL_DATA) rts/g-trasym$(objext) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
- -cd rts; for file in *$(arext);do \
- $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
- $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_RTL_OBJ_DIR)/$$file; \
- done
- -$(foreach file, $(EXTRA_ADALIB_FILES), \
- $(INSTALL_DATA_DATE) rts/$(file) $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
- ) true
-# Install the shared libraries, if any, using $(INSTALL) instead
-# of $(INSTALL_DATA). The latter may force a mode inappropriate
-# for shared libraries on some targets, e.g. on HP-UX where the x
-# permission is required.
- for file in gnat gnarl; do \
- if [ -f rts/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
- $(INSTALL) rts/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
- fi; \
- if [ -f rts/lib$${file}$(soext) ]; then \
- $(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(DESTDIR)$(ADA_RTL_OBJ_DIR)/lib$${file}$(soext); \
- fi; \
- done
-# This copy must be done preserving the date on the original file.
- for file in rts/*.ad?; do \
- $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
- done
- cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
- cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
-
-../stamp-gnatlib2:
- $(RM) rts/s-*.ali
- $(RM) rts/s-*$(objext)
- $(RM) rts/a-*.ali
- $(RM) rts/a-*$(objext)
- $(RM) rts/*.ali
- $(RM) rts/*$(objext)
- $(RM) rts/*$(arext)
- $(RM) rts/*$(soext)
- touch ../stamp-gnatlib2
- $(RM) ../stamp-gnatlib
-
-# NOTE: The $(foreach ...) commands assume ";" is the valid separator between
-# successive target commands. Although the Gnu make documentation
-# implies this is true on all systems, I suspect it may not be, So care
-# has been taken to allow a sed script to look for ";)" and substitue
-# for ";" the appropriate character in the range of lines below
-# beginning with "GNULLI Begin" and ending with "GNULLI End"
-
-# GNULLI Begin ###########################################################
-
-../stamp-gnatlib1: Makefile ../stamp-gnatlib2
- $(RMDIR) rts
- $(MKDIR) rts
- $(CHMOD) u+w rts
-# Copy target independent sources
- $(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
- $(LN_S) $(fsrcpfx)$(f) rts ;) true
-# Remove files to be replaced by target dependent sources
- $(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
- rts/$(word 1,$(subst <, ,$(PAIR))))
- $(RM) rts/*-*-*.ads rts/*-*-*.adb
-# Copy new target dependent sources
- $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
- $(LN_S) $(fsrcpfx)$(word 2,$(subst <, ,$(PAIR))) \
- rts/$(word 1,$(subst <, ,$(PAIR)));)
- $(RM) ../stamp-gnatlib
- touch ../stamp-gnatlib1
-
-# GNULLI End #############################################################
-
-# Don't use semicolon separated shell commands that involve list expansions.
-# The semicolon triggers a call to DCL on VMS and DCL can't handle command
-# line lengths in excess of 256 characters.
-# Example: cd rts; ar rc libfoo.a $(LONG_LIST_OF_OBJS)
-# is guaranteed to overflow the buffer.
-
-gnatlib: ../stamp-gnatlib1 ../stamp-gnatlib2
- $(MAKE) -C rts \
- CC="`echo \"$(GCC_FOR_TARGET)\" \
- | sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
- INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
- CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
- FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
- srcdir=$(fsrcdir) \
- -f ../Makefile $(LIBGNAT_OBJS)
- $(MAKE) -C rts \
- CC="`echo \"$(GCC_FOR_TARGET)\" \
- | sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
- ADA_INCLUDES="" \
- CFLAGS="$(GNATLIBCFLAGS)" \
- ADAFLAGS="$(GNATLIBFLAGS)" \
- FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
- srcdir=$(fsrcdir) \
- -f ../Makefile \
- $(GNATRTL_OBJS)
- $(RM) rts/libgnat$(arext) rts/libgnarl$(arext)
- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnat$(arext) \
- $(addprefix rts/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS))
- ifneq ($(PREFIX_OBJS),)
- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgccprefix$(arext) \
- $(PREFIX_OBJS);
- $(RANLIB_FOR_TARGET) rts/libgccprefix$(arext)
- endif
- $(RANLIB_FOR_TARGET) rts/libgnat$(arext)
- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnarl$(arext) \
- $(addprefix rts/,$(GNATRTL_TASKING_OBJS))
- $(RANLIB_FOR_TARGET) rts/libgnarl$(arext)
- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgnala$(arext) \
- $(addprefix rts/,$(GNATRTL_LINEARALGEBRA_OBJS))
- $(RANLIB_FOR_TARGET) rts/libgnala$(arext)
- ifeq ($(GMEM_LIB),gmemlib)
- $(AR_FOR_TARGET) $(AR_FLAGS) rts/libgmem$(arext) \
- rts/memtrack.o
- $(RANLIB_FOR_TARGET) rts/libgmem$(arext)
- endif
- $(CHMOD) a-wx rts/*.ali
- touch ../stamp-gnatlib
-
-# Warning: this target assumes that LIBRARY_VERSION has been set correctly.
-gnatlib-shared-default:
- $(MAKE) $(FLAGS_TO_PASS) \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
- THREAD_KIND="$(THREAD_KIND)" \
- gnatlib
- $(RM) rts/libgna*$(soext)
- cd rts; ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
- $(TARGET_LIBGCC2_CFLAGS) \
- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
- $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(MISCLIB) -lm
- cd rts; ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
- $(TARGET_LIBGCC2_CFLAGS) \
- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(GNATRTL_TASKING_OBJS) \
- $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(THREADSLIB)
- cd rts; $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
- libgnat$(soext)
- cd rts; $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
- libgnarl$(soext)
-
-gnatlib-shared-dual:
- $(MAKE) $(FLAGS_TO_PASS) \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
- THREAD_KIND="$(THREAD_KIND)" \
- gnatlib-shared-default
- $(MV) rts/libgna*$(soext) .
- $(RM) ../stamp-gnatlib2
- $(MAKE) $(FLAGS_TO_PASS) \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
- THREAD_KIND="$(THREAD_KIND)" \
- gnatlib
- $(MV) libgna*$(soext) rts
-
-gnatlib-shared-dual-win32:
- $(MAKE) $(FLAGS_TO_PASS) \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
- THREAD_KIND="$(THREAD_KIND)" \
- gnatlib-shared-win32
- $(MV) rts/libgna*$(soext) .
- $(RM) ../stamp-gnatlib2
- $(MAKE) $(FLAGS_TO_PASS) \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
- THREAD_KIND="$(THREAD_KIND)" \
- gnatlib
- $(MV) libgna*$(soext) rts
-
-# ??? we need to add the option to support auto-import of arrays/records to
-# the GNATLIBFLAGS when this will be supported by GNAT. At this point we will
-# use the gnatlib-shared-dual-win32 target to build the GNAT runtimes on
-# Windows.
-gnatlib-shared-win32:
- $(MAKE) $(FLAGS_TO_PASS) \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
- THREAD_KIND="$(THREAD_KIND)" \
- gnatlib
- $(RM) rts/libgna*$(soext)
- cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
- $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
- cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(GNATRTL_TASKING_OBJS) \
- $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
-
-gnatlib-shared-darwin:
- $(MAKE) $(FLAGS_TO_PASS) \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) \
- -fno-common" \
- THREAD_KIND="$(THREAD_KIND)" \
- gnatlib
- $(RM) rts/libgnat$(soext) rts/libgnarl$(soext)
- cd rts; ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
- $(SO_OPTS) \
- $(MISCLIB) -lm
- cd rts; ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
- $(GNATRTL_TASKING_OBJS) \
- $(SO_OPTS) \
- $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
- cd rts; $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
- libgnat$(soext)
- cd rts; $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
- libgnarl$(soext)
-
-gnatlib-shared-vms:
- $(MAKE) $(FLAGS_TO_PASS) \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
- THREAD_KIND="$(THREAD_KIND)" \
- gnatlib
- $(RM) rts/libgna*$(soext)
- cd rts && \
- ../../gnatsym -s SYMVEC_$$$$.opt \
- $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) && \
- ../../xgcc -g -B../../ -shared -shared-libgcc \
- -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) libgnat.a \
- sys\$$library:trace.exe \
- --for-linker=/noinform \
- --for-linker=SYMVEC_$$$$.opt \
- --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
- cd rts && \
- ../../gnatsym -s SYMVEC_$$$$.opt \
- $(GNATRTL_TASKING_OBJS) && \
- ../../xgcc -g -B../../ -shared -shared-libgcc \
- -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
- libgnarl.a libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
- sys\$$library:trace.exe \
- --for-linker=/noinform \
- --for-linker=SYMVEC_$$$$.opt \
- --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
-
-gnatlib-shared:
- $(MAKE) $(FLAGS_TO_PASS) \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
- THREAD_KIND="$(THREAD_KIND)" \
- TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
- $(GNATLIB_SHARED)
-
-gnatlib-sjlj:
- $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="" ../stamp-gnatlib1
- sed -e 's/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := False;/' rts/system.ads > rts/s.ads
- $(MV) rts/s.ads rts/system.ads
- $(MAKE) $(FLAGS_TO_PASS) \
- EH_MECHANISM="" \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
- THREAD_KIND="$(THREAD_KIND)" \
- TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
-
-gnatlib-zcx:
- $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="-gcc" ../stamp-gnatlib1
- sed -e 's/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := True;/' rts/system.ads > rts/s.ads
- $(MV) rts/s.ads rts/system.ads
- $(MAKE) $(FLAGS_TO_PASS) \
- EH_MECHANISM="-gcc" \
- GNATLIBFLAGS="$(GNATLIBFLAGS)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
- THREAD_KIND="$(THREAD_KIND)" \
- TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
-
-# .s files for cross-building
-gnat-cross: force
- make $(GNAT1_ADA_OBJS) CC="gcc -B../stage1/" CFLAGS="-S -gnatp"
-
-# Compiling object files from source files.
-
-# Note that dependencies on obstack.h are not written
-# because that file is not part of GCC.
-# Dependencies on gvarargs.h are not written
-# because all that file does, when not compiling with GCC,
-# is include the system varargs.h.
-
-b_gnatl.c : $(GNATLINK_OBJS)
- $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatl.c gnatlink.ali
-b_gnatl.o : b_gnatl.c
-
-b_gnatm.c : $(GNATMAKE_OBJS)
- $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatm.c gnatmake.ali
-b_gnatm.o : b_gnatm.c
-
-ADA_INCLUDE_DIR = $(libsubdir)/adainclude
-ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
-
-# force no sibling call optimization on s-traceb.o so the number of stack
-# frames to be skipped when computing a call chain is not modified by
-# optimization. However we can do that only when building the runtime
-# (not the compiler) because the -fno-optimize-sibling-calls option exists
-# only in GCC 3 and above.
-
-ifneq (,$(findstring xgcc,$(CC)))
-NO_SIBLING_ADAFLAGS=-fno-optimize-sibling-calls
-else
-NO_SIBLING_ADAFLAGS=
-endif
-
-s-traceb.o : s-traceb.adb
- $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) \
- $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) \
- $< $(OUTPUT_OPTION)
-
-# force debugging information on s-tasdeb.o so that it is always
-# possible to set conditional breakpoints on tasks.
-
-s-tasdeb.o : s-tasdeb.adb s-tasdeb.ads
- $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
- $< $(OUTPUT_OPTION)
-
-# force no function reordering on a-except.o because of the exclusion bounds
-# mechanism (see the source file for more detailed information). However we
-# can do that only when building the runtime (not the compiler) because the
-# -fno-toplevel-reorder option exists only in GCC 4.2 and above.
-
-ifneq (,$(findstring xgcc,$(CC)))
-NO_REORDER_ADAFLAGS=-fno-toplevel-reorder
-else
-NO_REORDER_ADAFLAGS=
-endif
-
-# force debugging information on a-except.o so that it is always
-# possible to set conditional breakpoints on exceptions.
-# use -O1 otherwise gdb isn't able to get a full backtrace on mips targets.
-
-a-except.o : a-except.adb a-except.ads
- $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \
- $(NO_REORDER_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
-
-# compile s-except.o without optimization and with debug info to let the
-# debugger set breakpoints and inspect subprogram parameters on exception
-# related events.
-
-s-except.o : s-except.adb s-except.ads
- $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
- $< $(OUTPUT_OPTION)
-
-# force debugging information on s-assert.o so that it is always
-# possible to set breakpoint on assert failures.
-
-s-assert.o : s-assert.adb s-assert.ads a-except.ads
- $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O2 $(ADA_INCLUDES) \
- $< $(OUTPUT_OPTION)
-
-adadecode.o : adadecode.c adadecode.h
-aux-io.o : aux-io.c
-argv.o : argv.c
-cal.o : cal.c
-deftarg.o : deftarg.c
-errno.o : errno.c
-exit.o : adaint.h exit.c
-expect.o : expect.c
-final.o : final.c
-gmem.o : gmem.c
-link.o : link.c
-mkdir.o : mkdir.c
-socket.o : socket.c gsocket.h
-sysdep.o : sysdep.c
-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)
-
-init.o : init.c adaint.h raise.h
- $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
- $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
-
-initialize.o : initialize.c raise.h
- $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
- $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
-
-targext.o : targext.c
- $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
- $(ALL_CPPFLAGS) $(INCLUDES_FOR_SUBDIR) \
- $< $(OUTPUT_OPTION)
-
-# No optimization to compile this file as optimizations (-O1 or above) breaks
-# the SEH handling on Windows. The reasons are not clear.
-seh_init.o : seh_init.c raise.h
- $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) -O0 \
- $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
-
-# Need to keep the frame pointer in this file to pop the stack properly on
-# some targets.
-tracebak.o : tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c
- $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
- -fno-omit-frame-pointer $< $(OUTPUT_OPTION)
-
-# In GNU Make, ignore whether `stage*' exists.
-.PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
-.PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
-
-force:
-
-# Gnatlbr, Vms_help, and Gnat.hlp are only used on VMS
-
-../../gnatlbr$(exeext): ../../prefix.o
- $(GNATMAKE) -c $(ADA_INCLUDES) gnatlbr --GCC="$(CC) $(ALL_ADAFLAGS)"
- $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlbr
- $(GNATLINK) -v gnatlbr -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
-
-../../vms_help$(exeext):
- $(GNATMAKE) -c $(ADA_INCLUDES) vms_help --GCC="$(CC) $(ALL_ADAFLAGS)"
- $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vms_help
- $(GNATLINK) -v vms_help -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
-
-../../gnat.hlp: ../../vms_help$(exeext)
- ../../vms_help$(exeext) $(fsrcdir)/gnat.help_in \
- $(fsrcdir)/vms_data.ads ../../gnat.hlp
+-include ./gcc-interface/Makefile
+-include ../gcc-interface/Makefile
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 8f7bcab516f..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;
@@ -1061,6 +1071,7 @@ __gnat_readdir (DIR *dirp, char *buffer, int *len)
/* Not supported in RTX */
return NULL;
+
#elif defined (__MINGW32__)
struct _tdirent *dirent = _treaddir ((_TDIR*)dirp);
@@ -1503,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. */
@@ -1606,7 +1613,7 @@ __gnat_stat (char *name, struct stat *statbuf)
int
__gnat_file_exists (char *name)
{
-#if defined (__MINGW32__) && !defined (RTX)
+#ifdef __MINGW32__
/* On Windows do not use __gnat_stat() because a bug in Microsoft
_stat() routine. When the system time-zone is set with a negative
offset the _stat() routine fails on specific files like CON: */
@@ -1676,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
}
@@ -1868,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
{
@@ -1905,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
@@ -1923,9 +2157,9 @@ remove_handle (HANDLE h)
Process_List *pl;
Process_List *prev = NULL;
- plist_enter();
-
/* -------------------- critical section -------------------- */
+ (*Lock_Task) ();
+
pl = PLIST;
while (pl)
{
@@ -1946,9 +2180,9 @@ remove_handle (HANDLE h)
}
--plist_length;
- /* -------------------- critical section -------------------- */
- plist_leave();
+ (*Unlock_Task) ();
+ /* -------------------- critical section -------------------- */
}
static int
@@ -2033,6 +2267,7 @@ win32_wait (int *status)
DWORD res;
int k;
Process_List *pl;
+ int hl_len;
if (plist_length == 0)
{
@@ -2040,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);
@@ -3004,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);
@@ -3015,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
}
@@ -3048,11 +3291,14 @@ __gnat_sals_init_using_constructors ()
#endif
}
+#ifdef RTX
+
/* In RTX mode, the procedure to get the time (as file time) is different
in RTSS mode and Win32 mode. In order to avoid duplicating an Ada file,
we introduce an intermediate procedure to link against the corresponding
one in each situation. */
-#ifdef RTX
+
+extern void GetTimeAsFileTime(LPFILETIME pTime);
void GetTimeAsFileTime(LPFILETIME pTime)
{
@@ -3062,6 +3308,16 @@ void GetTimeAsFileTime(LPFILETIME pTime)
GetSystemTimeAsFileTime (pTime); /* w32 interface */
#endif
}
+
+#ifdef RTSS
+/* Add symbol that is required to link. It would otherwise be taken from
+ libgcc.a and it would try to use the gcc constructors that are not
+ supported by Microsoft linker. */
+
+extern void __main (void);
+
+void __main (void) {}
+#endif
#endif
#if defined (linux) || defined(__GLIBC__)
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 276edf7e0f2..ae5bd476578 100644
--- a/gcc/ada/argv.c
+++ b/gcc/ada/argv.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- *
@@ -61,7 +61,7 @@ int gnat_argc = 0;
const char **gnat_argv = (const char **) 0;
const char **gnat_envp = (const char **) 0;
-#ifdef _WIN32
+#if defined (_WIN32) && !defined (RTX)
/* Note that on Windows environment the environ point to a buffer that could
be reallocated if needed. It means that gnat_envp needs to be updated
before using gnat_envp to point to the right environment space */
diff --git a/gcc/ada/back_end.adb b/gcc/ada/back_end.adb
index a6600764988..7a4e4dadf0f 100644
--- a/gcc/ada/back_end.adb
+++ b/gcc/ada/back_end.adb
@@ -76,6 +76,7 @@ package body Back_End is
number_file : Nat;
file_info_ptr : Address;
+ gigi_standard_boolean : Entity_Id;
gigi_standard_integer : Entity_Id;
gigi_standard_long_long_float : Entity_Id;
gigi_standard_exception_type : Entity_Id;
@@ -112,6 +113,7 @@ package body Back_End is
number_file => Num_Source_Files,
file_info_ptr => File_Info_Array'Address,
+ gigi_standard_boolean => Standard_Boolean,
gigi_standard_integer => Standard_Integer,
gigi_standard_long_long_float => Standard_Long_Long_Float,
gigi_standard_exception_type => Standard_Exception_Type,
diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb
index d29857fb5fc..7f3f6274327 100644
--- a/gcc/ada/bindgen.adb
+++ b/gcc/ada/bindgen.adb
@@ -127,38 +127,37 @@ package body Bindgen is
-- Default_Stack_Size : Integer;
-- Leap_Seconds_Support : 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.
-
- -- Time_Slice_Value is the time slice value set by pragma Time_Slice
- -- in the main program, or by the use of a -Tnnn parameter for the
- -- binder (if both are present, the binder value overrides). The
- -- value is in milliseconds. A value of zero indicates that time
- -- slicing should be suppressed. If no pragma is present, and no
- -- -T switch was used, the value is -1.
-
- -- WC_Encoding shows the wide character encoding method used for
- -- the main program. This is one of the encoding letters defined
- -- in System.WCh_Con.WC_Encoding_Letters.
-
- -- Locking_Policy is a space if no locking policy was specified
- -- for the partition. If a locking policy was specified, the value
- -- is the upper case first character of the locking policy name,
- -- for example, 'C' for Ceiling_Locking.
-
- -- Queuing_Policy is a space if no queuing policy was specified
- -- for the partition. If a queuing policy was specified, the value
- -- is the upper case first character of the queuing policy name
- -- for example, 'F' for FIFO_Queuing.
-
- -- Task_Dispatching_Policy is a space if no task dispatching policy
- -- was specified for the partition. If a task dispatching policy
- -- was specified, the value is the upper case first character of
- -- the policy name, e.g. 'F' for FIFO_Within_Priorities.
-
- -- Priority_Specific_Dispatching is the address of a string used to
- -- store the task dispatching policy specified for the different priorities
- -- in the partition. The length of this string is determined by the last
+ -- Main_Priority is the priority value set by pragma Priority in the main
+ -- program. If no such pragma is present, the value is -1.
+
+ -- Time_Slice_Value is the time slice value set by pragma Time_Slice in the
+ -- main program, or by the use of a -Tnnn parameter for the binder (if both
+ -- are present, the binder value overrides). The value is in milliseconds.
+ -- A value of zero indicates that time slicing should be suppressed. If no
+ -- pragma is present, and no -T switch was used, the value is -1.
+
+ -- WC_Encoding shows the wide character encoding method used for the main
+ -- program. This is one of the encoding letters defined in
+ -- System.WCh_Con.WC_Encoding_Letters.
+
+ -- Locking_Policy is a space if no locking policy was specified for the
+ -- partition. If a locking policy was specified, the value is the upper
+ -- case first character of the locking policy name, for example, 'C' for
+ -- Ceiling_Locking.
+
+ -- Queuing_Policy is a space if no queuing policy was specified for the
+ -- partition. If a queuing policy was specified, the value is the upper
+ -- case first character of the queuing policy name for example, 'F' for
+ -- FIFO_Queuing.
+
+ -- Task_Dispatching_Policy is a space if no task dispatching policy was
+ -- specified for the partition. If a task dispatching policy was specified,
+ -- the value is the upper case first character of the policy name, e.g. 'F'
+ -- for FIFO_Within_Priorities.
+
+ -- Priority_Specific_Dispatching is the address of a string used to store
+ -- the task dispatching policy specified for the different priorities in
+ -- the partition. The length of this string is determined by the last
-- priority for which such a pragma applies (the string will be a null
-- string if no specific dispatching policies were used). If pragma were
-- present, the entries apply to the priorities in sequence from the first
@@ -182,12 +181,12 @@ package body Bindgen is
-- such a pragma is given (the string will be a null string if no pragmas
-- were used). If pragma were present the entries apply to the interrupts
-- in sequence from the first interrupt, and are set to one of four
- -- possible settings: 'n' for not specified, 'u' for user, 'r' for
- -- run time, 's' for system, see description of Interrupt_State pragma
- -- for further details.
+ -- possible settings: 'n' for not specified, 'u' for user, 'r' for run
+ -- time, 's' for system, see description of Interrupt_State pragma for
+ -- further details.
- -- Num_Interrupt_States is the length of the Interrupt_States string.
- -- It will be set to zero if no Interrupt_State pragmas are present.
+ -- Num_Interrupt_States is the length of the Interrupt_States string. It
+ -- will be set to zero if no Interrupt_State pragmas are present.
-- Unreserve_All_Interrupts is set to one if at least one unit in the
-- partition had a pragma Unreserve_All_Interrupts, and zero otherwise.
@@ -201,13 +200,12 @@ package body Bindgen is
-- this partition, and to zero if longjmp/setjmp exceptions are used.
-- the use of zero
- -- Detect_Blocking indicates whether pragma Detect_Blocking is
- -- active or not. A value of zero indicates that the pragma is not
- -- present, while a value of 1 signals its presence in the
- -- partition.
+ -- Detect_Blocking indicates whether pragma Detect_Blocking is active or
+ -- not. A value of zero indicates that the pragma is not present, while a
+ -- value of 1 signals its presence in the partition.
- -- Default_Stack_Size is the default stack size used when creating an
- -- Ada task with no explicit Storize_Size clause.
+ -- Default_Stack_Size is the default stack size used when creating an Ada
+ -- task with no explicit Storize_Size clause.
-- Leap_Seconds_Support denotes whether leap seconds have been enabled or
-- disabled. A value of zero indicates that leap seconds are turned "off",
@@ -606,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,6 +779,15 @@ package body Bindgen is
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
@@ -1050,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
@@ -2269,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 ("");
@@ -2599,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 aea61397dc9..12c5b64a9fc 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -470,7 +470,11 @@ package body Checks is
-- Apply_Accessibility_Check --
-------------------------------
- procedure Apply_Accessibility_Check (N : Node_Id; Typ : Entity_Id) is
+ procedure Apply_Accessibility_Check
+ (N : Node_Id;
+ Typ : Entity_Id;
+ Insert_Node : Node_Id)
+ is
Loc : constant Source_Ptr := Sloc (N);
Param_Ent : constant Entity_Id := Param_Entity (N);
Param_Level : Node_Id;
@@ -501,7 +505,7 @@ package body Checks is
-- Raise Program_Error if the accessibility level of the the access
-- parameter is deeper than the level of the target access type.
- Insert_Action (N,
+ Insert_Action (Insert_Node,
Make_Raise_Program_Error (Loc,
Condition =>
Make_Op_Gt (Loc,
@@ -1629,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
@@ -2013,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
@@ -2320,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);
@@ -2842,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)",
@@ -2996,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;
@@ -3091,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
@@ -4536,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
@@ -4591,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 =>
@@ -4623,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
@@ -5277,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;
@@ -6776,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 0c9049471b4..4a721021823 100644
--- a/gcc/ada/checks.ads
+++ b/gcc/ada/checks.ads
@@ -102,11 +102,15 @@ package Checks is
-- Determines whether an expression node requires a runtime access
-- check and if so inserts the appropriate run-time check.
- procedure Apply_Accessibility_Check (N : Node_Id; Typ : Entity_Id);
+ procedure Apply_Accessibility_Check
+ (N : Node_Id;
+ Typ : Entity_Id;
+ Insert_Node : Node_Id);
-- Given a name N denoting an access parameter, emits a run-time
-- accessibility check (if necessary), checking that the level of
-- the object denoted by the access parameter is not deeper than the
-- level of the type Typ. Program_Error is raised if the check fails.
+ -- Insert_Node indicates the node where the check should be inserted.
procedure Apply_Address_Clause_Check (E : Entity_Id; N : Node_Id);
-- E is the entity for an object which has an address clause. If checks
@@ -132,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/cio.c b/gcc/ada/cio.c
index 6fba5a0b0cb..67dcfc3dd36 100644
--- a/gcc/ada/cio.c
+++ b/gcc/ada/cio.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- *
@@ -56,6 +56,11 @@
#undef getchar
#endif
+#ifdef RTX
+#include <windows.h>
+#include <Rtapi.h>
+#endif
+
int
get_char (void)
{
@@ -78,27 +83,43 @@ get_int (void)
void
put_int (int x)
{
+#ifdef RTX
+ RtPrintf ("%d", x);
+#else
/* Use fprintf rather than printf, since the latter is unbuffered
on vxworks */
fprintf (stdout, "%d", x);
+#endif
}
void
put_int_stderr (int x)
{
+#ifdef RTX
+ RtPrintf ("%d", x);
+#else
fprintf (stderr, "%d", x);
+#endif
}
void
put_char (int c)
{
+#ifdef RTX
+ RtPrintf ("%c", c);
+#else
putchar (c);
+#endif
}
void
put_char_stderr (int c)
{
+#ifdef RTX
+ RtPrintf ("%c", c);
+#else
fputc (c, stderr);
+#endif
}
#ifdef __vxworks
diff --git a/gcc/ada/clean.adb b/gcc/ada/clean.adb
index 5db4c4efc67..30aa9a45c41 100644
--- a/gcc/ada/clean.adb
+++ b/gcc/ada/clean.adb
@@ -826,9 +826,6 @@ package body Clean is
Index2 : Int;
Lib_File : File_Name_Type;
- Source_Id : Other_Source_Id;
- Source : Other_Source;
-
Global_Archive : Boolean := False;
begin
@@ -881,7 +878,7 @@ package body Clean is
-- Source_Dirs or Source_Files is specified as an empty list,
-- so always look for Ada units in extending projects.
- if Data.Langs (Ada_Language_Index)
+ if Data.Ada_Sources_Present
or else Data.Extends /= No_Project
then
for Unit in Unit_Table.First ..
@@ -1044,40 +1041,6 @@ package body Clean is
end if;
end if;
- if Data.Other_Sources_Present then
-
- -- There is non-Ada code: delete the object files and
- -- the dependency files if they exist.
-
- Source_Id := Data.First_Other_Source;
- while Source_Id /= No_Other_Source loop
- Source :=
- Project_Tree.Other_Sources.Table (Source_Id);
-
- if Is_Regular_File
- (Get_Name_String (Source.Object_Name))
- then
- Delete (Obj_Dir, Get_Name_String (Source.Object_Name));
- end if;
-
- if
- Is_Regular_File (Get_Name_String (Source.Dep_Name))
- then
- Delete (Obj_Dir, Get_Name_String (Source.Dep_Name));
- end if;
-
- Source_Id := Source.Next;
- end loop;
-
- -- If it is a library with only non Ada sources, delete
- -- the fake archive and the dependency file, if they exist.
-
- if Data.Library
- and then not Data.Langs (Ada_Language_Index)
- then
- Clean_Archive (Project, Global => False);
- end if;
- end if;
end;
end if;
diff --git a/gcc/ada/config-lang.in b/gcc/ada/config-lang.in
index e5922d5c905..ad76864cd61 100644
--- a/gcc/ada/config-lang.in
+++ b/gcc/ada/config-lang.in
@@ -1,11 +1,11 @@
# Top level configure fragment for GNU Ada (GNAT).
-# Copyright (C) 1994-2003, 2007 Free Software Foundation, Inc.
+# Copyright (C) 1994-2008 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)
+#the Free Software Foundation; either version 2, or (at your option)
#any later version.
#GCC is distributed in the hope that it will be useful,
@@ -14,28 +14,15 @@
#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/>.
-
-# Configure looks for the existence of this file to auto-config each language.
-# We define several parameters used by configure:
-#
-# language - name of language as it would appear in $(LANGUAGES)
-# boot_language - "yes" if we need to build this language in stage1
-# compilers - value to add to $(COMPILERS)
+#along with GCC; see the file COPYING. If not, write to
+#the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+#Boston, MA 02110-1301, USA.
language="ada"
-boot_language=yes
-boot_language_boot_flags='ADAFLAGS="$(BOOT_ADAFLAGS)"'
-
-compilers="gnat1\$(exeext)"
-
-gtfiles="\$(srcdir)/ada/ada-tree.h \$(srcdir)/ada/gigi.h \$(srcdir)/ada/decl.c \$(srcdir)/ada/trans.c \$(srcdir)/ada/utils.c"
-
-outputs=ada/Makefile
-
-target_libs="target-libada"
-lang_dirs="gnattools"
+gcc_subdir="ada/gcc-interface"
-# Ada will not work until the front end starts emitting GIMPLE trees.
-build_by_default=no
+if [ -f ${srcdir}/gcc/ada/gcc-interface/config-lang.in ]; then
+ . ${srcdir}/gcc/ada/gcc-interface/config-lang.in
+else
+ . ${srcdir}/ada/gcc-interface/config-lang.in
+fi
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.adb b/gcc/ada/einfo.adb
index 49dffae047b..255b7a0cdcc 100644
--- a/gcc/ada/einfo.adb
+++ b/gcc/ada/einfo.adb
@@ -504,9 +504,8 @@ package body Einfo is
-- Optimize_Alignment_Time Flag242
-- Overlays_Constant Flag243
-- Is_RACW_Stub_Type Flag244
+ -- Is_Private_Primitive Flag245
- -- (unused) Flag169
- -- (unused) Flag245
-- (unused) Flag246
-- (unused) Flag247
@@ -1929,7 +1928,8 @@ package body Einfo is
function Is_Primitive_Wrapper (Id : E) return B is
begin
- pragma Assert (Ekind (Id) = E_Procedure);
+ pragma Assert (Ekind (Id) = E_Function
+ or else Ekind (Id) = E_Procedure);
return Flag195 (Id);
end Is_Primitive_Wrapper;
@@ -1944,6 +1944,13 @@ package body Einfo is
return Flag53 (Id);
end Is_Private_Descendant;
+ function Is_Private_Primitive (Id : E) return B is
+ begin
+ pragma Assert (Ekind (Id) = E_Function
+ or else Ekind (Id) = E_Procedure);
+ return Flag245 (Id);
+ end Is_Private_Primitive;
+
function Is_Protected_Interface (Id : E) return B is
begin
pragma Assert (Is_Interface (Id));
@@ -2572,7 +2579,7 @@ package body Einfo is
function Spec_PPC_List (Id : E) return N is
begin
- pragma Assert (Is_Subprogram (Id));
+ pragma Assert (Is_Subprogram (Id) or else Is_Generic_Subprogram (Id));
return Node24 (Id);
end Spec_PPC_List;
@@ -2702,8 +2709,9 @@ package body Einfo is
function Wrapped_Entity (Id : E) return E is
begin
- pragma Assert (Ekind (Id) = E_Procedure
- and then Is_Primitive_Wrapper (Id));
+ pragma Assert ((Ekind (Id) = E_Function
+ or else Ekind (Id) = E_Procedure)
+ and then Is_Primitive_Wrapper (Id));
return Node27 (Id);
end Wrapped_Entity;
@@ -4372,7 +4380,8 @@ package body Einfo is
procedure Set_Is_Primitive_Wrapper (Id : E; V : B := True) is
begin
- pragma Assert (Ekind (Id) = E_Procedure);
+ pragma Assert (Ekind (Id) = E_Function
+ or else Ekind (Id) = E_Procedure);
Set_Flag195 (Id, V);
end Set_Is_Primitive_Wrapper;
@@ -4387,6 +4396,13 @@ package body Einfo is
Set_Flag53 (Id, V);
end Set_Is_Private_Descendant;
+ procedure Set_Is_Private_Primitive (Id : E; V : B := True) is
+ begin
+ pragma Assert (Ekind (Id) = E_Function
+ or else Ekind (Id) = E_Procedure);
+ Set_Flag245 (Id, V);
+ end Set_Is_Private_Primitive;
+
procedure Set_Is_Protected_Interface (Id : E; V : B := True) is
begin
pragma Assert (Is_Interface (Id));
@@ -5028,7 +5044,7 @@ package body Einfo is
procedure Set_Spec_PPC_List (Id : E; V : N) is
begin
- pragma Assert (Is_Subprogram (Id));
+ pragma Assert (Is_Subprogram (Id) or else Is_Generic_Subprogram (Id));
Set_Node24 (Id, V);
end Set_Spec_PPC_List;
@@ -5168,8 +5184,9 @@ package body Einfo is
procedure Set_Wrapped_Entity (Id : E; V : E) is
begin
- pragma Assert (Ekind (Id) = E_Procedure
- and then Is_Primitive_Wrapper (Id));
+ pragma Assert ((Ekind (Id) = E_Function
+ or else Ekind (Id) = E_Procedure)
+ and then Is_Primitive_Wrapper (Id));
Set_Node27 (Id, V);
end Set_Wrapped_Entity;
@@ -7597,9 +7614,11 @@ package body Einfo is
W ("Is_Packed_Array_Type", Flag138 (Id));
W ("Is_Potentially_Use_Visible", Flag9 (Id));
W ("Is_Preelaborated", Flag59 (Id));
+ W ("Is_Primitive", Flag218 (Id));
W ("Is_Primitive_Wrapper", Flag195 (Id));
W ("Is_Private_Composite", Flag107 (Id));
W ("Is_Private_Descendant", Flag53 (Id));
+ W ("Is_Private_Primitive", Flag245 (Id));
W ("Is_Protected_Interface", Flag198 (Id));
W ("Is_Public", Flag10 (Id));
W ("Is_Pure", Flag44 (Id));
@@ -7666,7 +7685,6 @@ package body Einfo is
W ("Suppress_Init_Proc", Flag105 (Id));
W ("Suppress_Style_Checks", Flag165 (Id));
W ("Suppress_Value_Tracking_On_Call", Flag217 (Id));
- W ("Is_Primitive", Flag218 (Id));
W ("Treat_As_Volatile", Flag41 (Id));
W ("Universal_Aliasing", Flag216 (Id));
W ("Used_As_Generic_Actual", Flag222 (Id));
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index 43e0e17ab1d..a7058747149 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -2513,9 +2513,9 @@ package Einfo is
-- indicators in bodies.
-- Is_Primitive_Wrapper (Flag195)
--- Present in all entities. Set for procedure entries that are used as
--- primitive wrappers. which are generated by the expander to wrap
--- entries of protected or task types implementing a limited interface.
+-- Present in functions and procedures created by the expander to serve
+-- as an indirection mechanism to overriding primitives of concurrent
+-- types, entries and protected procedures.
-- Is_Prival (synthesized)
-- Applies to all entities, true for renamings of private protected
@@ -2533,6 +2533,10 @@ package Einfo is
-- functions, procedures). Set if the library unit is itself a private
-- child unit, or if it is the descendent of a private child unit.
+-- Is_Private_Primitive (Flag245)
+-- Present in subprograms. Set if the first parameter of the subprogram
+-- is of concurrent tagged type with a private view.
+
-- Is_Private_Type (synthesized)
-- Applies to all entities, true for private types and subtypes,
-- as well as for record with private types as subtypes
@@ -3523,10 +3527,11 @@ package Einfo is
-- the corresponding parameter entities in the spec.
-- Spec_PPC_List (Node24)
--- Present in subprogram entities. Points to a list of Precondition
--- and Postcondition N_Pragma nodes for preconditions and postconditions
--- declared in the spec. The last pragma encountered is at the head of
--- this list, so it is in reverse order of textual appearance.
+-- Present in subprogram and generic subprogram entities. Points to a
+-- list of Precondition and Postcondition pragma nodes for preconditions
+-- and postconditions declared in the spec. The last pragma encountered
+-- is at the head of this list, so it is in reverse order of textual
+-- appearance.
-- Storage_Size_Variable (Node15) [implementation base type only]
-- Present in access types and task type entities. This flag is set
@@ -3723,8 +3728,8 @@ package Einfo is
-- attribute when the limited-view is installed (Ada 2005: AI-217).
-- Wrapped_Entity (Node27)
--- Present in an E_Procedure classified as an Is_Primitive_Wrapper. Set
--- to the entity that is being wrapped.
+-- Present in functions and procedures which have been classified as
+-- Is_Primitive_Wrapper. Set to the entity being wrapper.
------------------
-- Access Kinds --
@@ -5011,8 +5016,10 @@ 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)
-- Extra_Formals (Node28)
-- Body_Needed_For_SAL (Flag40)
-- Elaboration_Entity_Required (Flag174)
@@ -5039,7 +5046,9 @@ package Einfo is
-- Is_Machine_Code_Subprogram (Flag137) (non-generic case only)
-- Is_Overriding_Operation (Flag39) (non-generic case only)
-- Is_Primitive (Flag218)
+ -- Is_Primitive_Wrapper (Flag195) (non-generic case only)
-- Is_Private_Descendant (Flag53)
+ -- Is_Private_Primitive (Flag245) (non-generic case only)
-- Is_Pure (Flag44)
-- Is_Thunk (Flag225)
-- Is_Visible_Child_Unit (Flag116)
@@ -5270,7 +5279,7 @@ package Einfo is
-- Generic_Renamings (Elist23) (for instance)
-- Inner_Instances (Elist23) (for generic proc)
-- Protection_Object (Node23) (for concurrent kind)
- -- Spec_PPC_List (Node24) (non-generic case only)
+ -- Spec_PPC_List (Node24)
-- Interface_Alias (Node25)
-- Static_Initialization (Node26) (init_proc only)
-- Overridden_Operation (Node26)
@@ -5305,6 +5314,7 @@ package Einfo is
-- Is_Primitive (Flag218)
-- Is_Primitive_Wrapper (Flag195) (non-generic case only)
-- Is_Private_Descendant (Flag53)
+ -- Is_Private_Primitive (Flag245) (non-generic case only)
-- Is_Pure (Flag44)
-- Is_Thunk (Flag225)
-- Is_Valued_Procedure (Flag127)
@@ -5974,6 +5984,7 @@ package Einfo is
function Is_Primitive_Wrapper (Id : E) return B;
function Is_Private_Composite (Id : E) return B;
function Is_Private_Descendant (Id : E) return B;
+ function Is_Private_Primitive (Id : E) return B;
function Is_Protected_Interface (Id : E) return B;
function Is_Public (Id : E) return B;
function Is_Pure (Id : E) return B;
@@ -6538,6 +6549,7 @@ package Einfo is
procedure Set_Is_Primitive_Wrapper (Id : E; V : B := True);
procedure Set_Is_Private_Composite (Id : E; V : B := True);
procedure Set_Is_Private_Descendant (Id : E; V : B := True);
+ procedure Set_Is_Private_Primitive (Id : E; V : B := True);
procedure Set_Is_Protected_Interface (Id : E; V : B := True);
procedure Set_Is_Public (Id : E; V : B := True);
procedure Set_Is_Pure (Id : E; V : B := True);
@@ -7216,6 +7228,7 @@ package Einfo is
pragma Inline (Is_Primitive_Wrapper);
pragma Inline (Is_Private_Composite);
pragma Inline (Is_Private_Descendant);
+ pragma Inline (Is_Private_Primitive);
pragma Inline (Is_Private_Type);
pragma Inline (Is_Protected_Interface);
pragma Inline (Is_Protected_Type);
@@ -7609,6 +7622,7 @@ package Einfo is
pragma Inline (Set_Is_Primitive_Wrapper);
pragma Inline (Set_Is_Private_Composite);
pragma Inline (Set_Is_Private_Descendant);
+ pragma Inline (Set_Is_Private_Primitive);
pragma Inline (Set_Is_Protected_Interface);
pragma Inline (Set_Is_Public);
pragma Inline (Set_Is_Pure);
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 40ff3796671..df5617a09fc 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -28,6 +28,7 @@ with Checks; use Checks;
with Debug; use Debug;
with Einfo; use Einfo;
with Elists; use Elists;
+with Errout; use Errout;
with Expander; use Expander;
with Exp_Util; use Exp_Util;
with Exp_Ch3; use Exp_Ch3;
@@ -169,12 +170,15 @@ package body Exp_Aggr is
-- Local Subprograms for Array Aggregate Expansion --
-----------------------------------------------------
- function Aggr_Size_OK (Typ : Entity_Id) return Boolean;
+ function Aggr_Size_OK (N : Node_Id; Typ : Entity_Id) return Boolean;
-- Very large static aggregates present problems to the back-end, and
-- are transformed into assignments and loops. This function verifies
-- that the total number of components of an aggregate is acceptable
-- for transformation into a purely positional static form. It is called
-- prior to calling Flatten.
+ -- This function also detects and warns about one-component aggregates
+ -- that appear in a non-static context. Even if the component value is
+ -- static, such an aggregate must be expanded into an assignment.
procedure Convert_Array_Aggr_In_Allocator
(Decl : Node_Id;
@@ -291,7 +295,7 @@ package body Exp_Aggr is
-- Aggr_Size_OK --
------------------
- function Aggr_Size_OK (Typ : Entity_Id) return Boolean is
+ function Aggr_Size_OK (N : Node_Id; Typ : Entity_Id) return Boolean is
Lo : Node_Id;
Hi : Node_Id;
Indx : Node_Id;
@@ -399,6 +403,43 @@ package body Exp_Aggr is
return True;
end if;
+ -- One-component aggregates are suspicious, and if the context type
+ -- is an object declaration with non-static bounds it will trip gcc;
+ -- such an aggregate must be expanded into a single assignment.
+
+ if Hiv = Lov
+ and then Nkind (Parent (N)) = N_Object_Declaration
+ then
+ declare
+ Index_Type : constant Entity_Id :=
+ Etype
+ (First_Index
+ (Etype (Defining_Identifier (Parent (N)))));
+ Indx : Node_Id;
+
+ begin
+ if not Compile_Time_Known_Value (Type_Low_Bound (Index_Type))
+ or else not Compile_Time_Known_Value
+ (Type_High_Bound (Index_Type))
+ then
+ if Present (Component_Associations (N)) then
+ Indx :=
+ First (Choices (First (Component_Associations (N))));
+ if Is_Entity_Name (Indx)
+ and then not Is_Type (Entity (Indx))
+ then
+ Error_Msg_N
+ ("single component aggregate in non-static context?",
+ Indx);
+ Error_Msg_N ("\maybe subtype name was meant?", Indx);
+ end if;
+ end if;
+
+ return False;
+ end if;
+ end;
+ end if;
+
declare
Rng : constant Uint := Hiv - Lov + 1;
@@ -932,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
@@ -1096,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),
@@ -1118,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
@@ -1182,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)
@@ -2126,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
@@ -2395,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
@@ -2600,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,
@@ -2809,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 (
@@ -2982,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,
@@ -3847,7 +3892,7 @@ package body Exp_Aggr is
-- assignments to the target anyway, but it is conceivable that
-- it will eventually be able to treat such aggregates statically???
- if Aggr_Size_OK (Typ)
+ if Aggr_Size_OK (N, Typ)
and then Flatten (N, First_Index (Typ), First_Index (Base_Type (Typ)))
then
if Static_Components then
@@ -4916,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
@@ -6383,7 +6428,7 @@ package body Exp_Aggr is
elsif Nkind (Expression (Expr)) /= N_Integer_Literal then
return False;
- elsif not Aggr_Size_OK (Typ) then
+ elsif not Aggr_Size_OK (N, Typ) then
return False;
end if;
@@ -6396,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);
@@ -6413,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 1637863cf45..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,10 +661,62 @@ 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
+ -- component, or slice), returns the name of the outermost
+ -- such enclosing object. Otherwise returns N. If the object
+ -- is a renaming, then the renamed object is returned.
+
+ ----------------------
+ -- Enclosing_Object --
+ ----------------------
+
+ function Enclosing_Object (N : Node_Id) return Node_Id is
+ Obj_Name : Node_Id;
+
+ begin
+ Obj_Name := N;
+ while Nkind_In (Obj_Name, N_Selected_Component,
+ N_Indexed_Component,
+ N_Slice)
+ loop
+ Obj_Name := Prefix (Obj_Name);
+ end loop;
+
+ return Get_Referenced_Object (Obj_Name);
+ end Enclosing_Object;
+
+ -- Local declarations
+
+ Enc_Object : constant Node_Id := Enclosing_Object (Ref_Object);
+
+ -- 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
@@ -800,35 +865,31 @@ package body Exp_Attr is
end;
-- If the prefix of an Access attribute is a dereference of an
- -- access parameter (or a renaming of such a dereference) and
- -- the context is a general access type (but not an anonymous
- -- access type), then rewrite the attribute as a conversion of
- -- the access parameter to the context access type. This will
- -- result in an accessibility check being performed, if needed.
-
- -- (X.all'Access => Acc_Type (X))
-
- -- Note: Limit the expansion of an attribute applied to a
- -- dereference of an access parameter so that it's only done
- -- for 'Access. This fixes a problem with 'Unrestricted_Access
- -- that leads to errors in the case where the attribute type
- -- is access-to-variable and the access parameter is
- -- access-to-constant. The conversion is only done to get
- -- accessibility checks, so it makes sense to limit it to
- -- 'Access.
-
- elsif Nkind (Ref_Object) = N_Explicit_Dereference
- and then Is_Entity_Name (Prefix (Ref_Object))
+ -- access parameter (or a renaming of such a dereference, or a
+ -- subcomponent of such a dereference) and the context is a
+ -- general access type (but not an anonymous access type), then
+ -- apply an accessibility check to the access parameter. We used
+ -- to rewrite the access parameter as a type conversion, but that
+ -- could only be done if the immediate prefix of the Access
+ -- attribute was the dereference, and didn't handle cases where
+ -- the attribute is applied to a subcomponent of the dereference,
+ -- since there's generally no available, appropriate access type
+ -- to convert to in that case. The attribute is passed as the
+ -- point to insert the check, because the access parameter may
+ -- come from a renaming, possibly in a different scope, and the
+ -- check must be associated with the attribute itself.
+
+ elsif Id = Attribute_Access
+ and then Nkind (Enc_Object) = N_Explicit_Dereference
+ and then Is_Entity_Name (Prefix (Enc_Object))
and then Ekind (Btyp) = E_General_Access_Type
- and then Ekind (Entity (Prefix (Ref_Object))) in Formal_Kind
- and then Ekind (Etype (Entity (Prefix (Ref_Object))))
+ and then Ekind (Entity (Prefix (Enc_Object))) in Formal_Kind
+ and then Ekind (Etype (Entity (Prefix (Enc_Object))))
= E_Anonymous_Access_Type
and then Present (Extra_Accessibility
- (Entity (Prefix (Ref_Object))))
+ (Entity (Prefix (Enc_Object))))
then
- Rewrite (N,
- Convert_To (Typ, New_Copy_Tree (Prefix (Ref_Object))));
- Analyze_And_Resolve (N, Typ);
+ Apply_Accessibility_Check (Prefix (Enc_Object), Typ, N);
-- Ada 2005 (AI-251): If the designated type is an interface we
-- add an implicit conversion to force the displacement of the
@@ -846,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
@@ -2048,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 --
--------------
@@ -4369,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 --
----------------
@@ -4382,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 --
-----------------------
@@ -5314,7 +5419,8 @@ package body Exp_Attr is
(Typ : Entity_Id;
Nam : TSS_Name_Type) return Entity_Id
is
- Ent : constant Entity_Id := TSS (Typ, Nam);
+ Base_Typ : constant Entity_Id := Base_Type (Typ);
+ Ent : constant Entity_Id := TSS (Typ, Nam);
begin
if Present (Ent) then
@@ -5337,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 Typ = Standard_String then
- if Nam = TSS_Stream_Input then
- return RTE (RE_String_Input);
+ if Base_Typ = Standard_String then
+ 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 Typ = Standard_Wide_String then
- if Nam = TSS_Stream_Input then
- return RTE (RE_Wide_String_Input);
+ elsif Base_Typ = Standard_Wide_String then
+ 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);
+
+ 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_Output then
- return RTE (RE_Wide_String_Output);
+ elsif Nam = TSS_Stream_Output then
+ return RTE (RE_Wide_String_Output_Blk_IO);
- elsif Nam = TSS_Stream_Read then
- return RTE (RE_Wide_String_Read);
+ 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);
+ 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 Typ = Standard_Wide_Wide_String then
- if Nam = TSS_Stream_Input then
- return RTE (RE_Wide_Wide_String_Input);
+ elsif Base_Typ = Standard_Wide_Wide_String then
+ 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);
+ 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);
+
+ 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 798da67036e..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)
@@ -3440,7 +3444,8 @@ package body Exp_Ch4 is
and then
Ekind (Etype (Nod)) = E_Anonymous_Access_Type
then
- Apply_Accessibility_Check (Nod, Typ);
+ Apply_Accessibility_Check
+ (Nod, Typ, Insert_Node => Nod);
end if;
Next_Elmt (Discr);
@@ -3497,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.
@@ -3586,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
@@ -3645,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));
@@ -3822,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
@@ -3873,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;
@@ -3886,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;
@@ -3902,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;
@@ -3919,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;
@@ -3937,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;
@@ -5460,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
@@ -5934,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;
@@ -5982,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);
@@ -6005,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;
@@ -6491,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;
@@ -6663,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
@@ -6722,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));
@@ -7552,9 +7596,9 @@ package body Exp_Ch4 is
-- Apply an accessibility check when the conversion operand is an
-- access parameter (or a renaming thereof), unless conversion was
- -- expanded from an unchecked or unrestricted access attribute. Note
- -- that other checks may still need to be applied below (such as
- -- tagged type checks).
+ -- expanded from an Unchecked_ or Unrestricted_Access attribute.
+ -- Note that other checks may still need to be applied below (such
+ -- as tagged type checks).
if Is_Entity_Name (Operand)
and then
@@ -7568,9 +7612,10 @@ package body Exp_Ch4 is
and then (Nkind (Original_Node (N)) /= N_Attribute_Reference
or else Attribute_Name (Original_Node (N)) = Name_Access)
then
- Apply_Accessibility_Check (Operand, Target_Type);
+ Apply_Accessibility_Check
+ (Operand, Target_Type, Insert_Node => Operand);
- -- If the level of the operand type is statically deeper then the
+ -- If the level of the operand type is statically deeper than the
-- level of the target type, then force Program_Error. Note that this
-- can only occur for cases where the attribute is within the body of
-- an instantiation (otherwise the conversion will already have been
@@ -8352,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
@@ -8369,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));
@@ -8979,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 cddc0210241..a84b0255ad8 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -1,4 +1,4 @@
------------------------------------------------------------------------------
+------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
@@ -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.
@@ -2070,16 +2060,16 @@ package body Exp_Ch6 is
if Ekind (Etype (Prev)) in Private_Kind
and then not Has_Discriminants (Base_Type (Etype (Prev)))
then
- Add_Extra_Actual (
- New_Occurrence_Of (Standard_False, Loc),
- Extra_Constrained (Formal));
+ Add_Extra_Actual
+ (New_Occurrence_Of (Standard_False, Loc),
+ Extra_Constrained (Formal));
elsif Is_Constrained (Etype (Formal))
or else not Has_Discriminants (Etype (Prev))
then
- Add_Extra_Actual (
- New_Occurrence_Of (Standard_True, Loc),
- Extra_Constrained (Formal));
+ Add_Extra_Actual
+ (New_Occurrence_Of (Standard_True, Loc),
+ Extra_Constrained (Formal));
-- Do not produce extra actuals for Unchecked_Union parameters.
-- Jump directly to the end of the loop.
@@ -2220,7 +2210,7 @@ package body Exp_Ch6 is
else
Add_Extra_Actual
(Make_Integer_Literal (Loc,
- Intval => Scope_Depth (Standard_Standard)),
+ Intval => Scope_Depth (Standard_Standard)),
Extra_Accessibility (Formal));
end if;
end;
@@ -2231,11 +2221,25 @@ package body Exp_Ch6 is
else
Add_Extra_Actual
(Make_Integer_Literal (Loc,
- Intval => Type_Access_Level (Etype (Prev_Orig))),
+ Intval => Type_Access_Level (Etype (Prev_Orig))),
Extra_Accessibility (Formal));
end if;
- -- All cases other than thunks
+ -- If the actual is an access discriminant, then pass the level
+ -- of the enclosing object (RM05-3.10.2(12.4/2)).
+
+ elsif Nkind (Prev_Orig) = N_Selected_Component
+ and then Ekind (Entity (Selector_Name (Prev_Orig))) =
+ E_Discriminant
+ and then Ekind (Etype (Entity (Selector_Name (Prev_Orig)))) =
+ E_Anonymous_Access_Type
+ then
+ Add_Extra_Actual
+ (Make_Integer_Literal (Loc,
+ Intval => Object_Access_Level (Prefix (Prev_Orig))),
+ Extra_Accessibility (Formal));
+
+ -- All other cases
else
case Nkind (Prev_Orig) is
@@ -2246,20 +2250,20 @@ package body Exp_Ch6 is
-- For X'Access, pass on the level of the prefix X
when Attribute_Access =>
- Add_Extra_Actual (
- Make_Integer_Literal (Loc,
- Intval =>
- Object_Access_Level (Prefix (Prev_Orig))),
- Extra_Accessibility (Formal));
+ Add_Extra_Actual
+ (Make_Integer_Literal (Loc,
+ Intval =>
+ Object_Access_Level (Prefix (Prev_Orig))),
+ Extra_Accessibility (Formal));
-- Treat the unchecked attributes as library-level
when Attribute_Unchecked_Access |
Attribute_Unrestricted_Access =>
- Add_Extra_Actual (
- Make_Integer_Literal (Loc,
- Intval => Scope_Depth (Standard_Standard)),
- Extra_Accessibility (Formal));
+ Add_Extra_Actual
+ (Make_Integer_Literal (Loc,
+ Intval => Scope_Depth (Standard_Standard)),
+ Extra_Accessibility (Formal));
-- No other cases of attributes returning access
-- values that can be passed to access parameters
@@ -2274,19 +2278,21 @@ package body Exp_Ch6 is
-- current scope level.
when N_Allocator =>
- Add_Extra_Actual (
- Make_Integer_Literal (Loc,
- Scope_Depth (Current_Scope) + 1),
- Extra_Accessibility (Formal));
+ Add_Extra_Actual
+ (Make_Integer_Literal (Loc,
+ 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))),
- Extra_Accessibility (Formal));
+ Add_Extra_Actual
+ (Make_Integer_Literal (Loc,
+ Intval => Type_Access_Level (Etype (Prev))),
+ Extra_Accessibility (Formal));
end case;
end if;
@@ -3027,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
@@ -4269,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;
@@ -4896,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;
@@ -5496,7 +5502,7 @@ package body Exp_Ch6 is
if Is_Constrained (Underlying_Type (Result_Subt)) then
Insert_After_And_Analyze (Object_Decl, Ptr_Typ_Decl);
else
- Insert_Before_And_Analyze (Object_Decl, Ptr_Typ_Decl);
+ Insert_Action (Object_Decl, Ptr_Typ_Decl);
end if;
-- Finally, create an access object initialized to a reference to the
@@ -5585,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 572dae04ea0..53de7a0e9d5 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -152,29 +152,25 @@ package body Exp_Ch9 is
-- <formalN> : AnnN;
-- end record;
- function Build_Wrapper_Body
- (Loc : Source_Ptr;
- Proc_Nam : Entity_Id;
- Obj_Typ : Entity_Id;
- Formals : List_Id) return Node_Id;
- -- Ada 2005 (AI-345): Build the body that wraps a primitive operation
- -- associated with a protected or task type. This is required to implement
- -- dispatching calls through interfaces. Proc_Nam is the entry name to be
- -- wrapped, Obj_Typ is the type of the newly added formal parameter to
- -- handle object notation, Formals are the original entry formals that will
- -- be explicitly replicated.
-
- function Build_Wrapper_Spec
- (Loc : Source_Ptr;
- Proc_Nam : Entity_Id;
- Obj_Typ : Entity_Id;
- Formals : List_Id) return Node_Id;
- -- Ada 2005 (AI-345): Build the specification of a primitive operation
- -- associated with a protected or task type. This is required implement
- -- dispatching calls through interfaces. Proc_Nam is the entry name to be
- -- wrapped, Obj_Typ is the type of the newly added formal parameter to
- -- handle object notation, Formals are the original entry formals that will
- -- be explicitly replicated.
+ procedure Build_Wrapper_Bodies
+ (Loc : Source_Ptr;
+ Typ : Entity_Id;
+ N : Node_Id);
+ -- Ada 2005 (AI-345): Typ is either a concurrent type or the corresponding
+ -- record of a concurrent type. N is the insertion node where all bodies
+ -- will be placed. This routine builds the bodies of the subprograms which
+ -- serve as an indirection mechanism to overriding primitives of concurrent
+ -- types, entries and protected procedures. Any new body is analyzed.
+
+ procedure Build_Wrapper_Specs
+ (Loc : Source_Ptr;
+ Typ : Entity_Id;
+ N : in out Node_Id);
+ -- Ada 2005 (AI-345): Typ is either a concurrent type or the corresponding
+ -- record of a concurrent type. N is the insertion node where all specs
+ -- will be placed. This routine builds the specs of the subprograms which
+ -- serve as an indirection mechanism to overriding primitives of concurrent
+ -- types, entries and protected procedures. Any new spec is analyzed.
function Build_Find_Body_Index (Typ : Entity_Id) return Node_Id;
-- Build the function that translates the entry index in the call
@@ -359,6 +355,10 @@ package body Exp_Ch9 is
Lo : Node_Id;
Hi : Node_Id) return Boolean;
+ function Is_Private_Primitive_Subprogram (Id : Entity_Id) return Boolean;
+ -- Determine whether Id is a function or a procedure and is marked as a
+ -- private primitive.
+
function Null_Statements (Stats : List_Id) return Boolean;
-- Used to check DO-END sequence. Checks for equivalent of DO NULL; END.
-- Allows labels, and pragma Warnings/Unreferenced in the sequence as
@@ -1541,144 +1541,241 @@ package body Exp_Ch9 is
return Rec_Nam;
end Build_Parameter_Block;
- ------------------------
- -- Build_Wrapper_Body --
- ------------------------
+ --------------------------
+ -- Build_Wrapper_Bodies --
+ --------------------------
- function Build_Wrapper_Body
- (Loc : Source_Ptr;
- Proc_Nam : Entity_Id;
- Obj_Typ : Entity_Id;
- Formals : List_Id) return Node_Id
+ procedure Build_Wrapper_Bodies
+ (Loc : Source_Ptr;
+ Typ : Entity_Id;
+ N : Node_Id)
is
- Actuals : List_Id := No_List;
- Body_Spec : Node_Id;
- Conv_Id : Node_Id;
- First_Formal : Node_Id;
- Formal : Node_Id;
-
- begin
- Body_Spec := Build_Wrapper_Spec (Loc, Proc_Nam, Obj_Typ, Formals);
+ Rec_Typ : Entity_Id;
- -- If we did not generate the specification do have nothing else to do
+ function Build_Wrapper_Body
+ (Loc : Source_Ptr;
+ Subp_Id : Entity_Id;
+ Obj_Typ : Entity_Id;
+ Formals : List_Id) return Node_Id;
+ -- Ada 2005 (AI-345): Build the body that wraps a primitive operation
+ -- associated with a protected or task type. Subp_Id is the subprogram
+ -- name which will be wrapped. Obj_Typ is the type of the new formal
+ -- parameter which handles dispatching and object notation. Formals are
+ -- the original formals of Subp_Id which will be explicitly replicated.
+
+ ------------------------
+ -- Build_Wrapper_Body --
+ ------------------------
+
+ function Build_Wrapper_Body
+ (Loc : Source_Ptr;
+ Subp_Id : Entity_Id;
+ Obj_Typ : Entity_Id;
+ Formals : List_Id) return Node_Id
+ is
+ Body_Spec : Node_Id;
- if Body_Spec = Empty then
- return Empty;
- end if;
+ begin
+ Body_Spec := Build_Wrapper_Spec (Loc, Subp_Id, Obj_Typ, Formals);
- -- Map formals to actuals. Use the list built for the wrapper spec,
- -- skipping the object notation parameter.
+ -- The subprogram is not overriding or is not a primitive declared
+ -- between two views.
- First_Formal := First (Parameter_Specifications (Body_Spec));
+ if No (Body_Spec) then
+ return Empty;
+ end if;
- Formal := First_Formal;
- Next (Formal);
+ declare
+ Actuals : List_Id := No_List;
+ Conv_Id : Node_Id;
+ First_Formal : Node_Id;
+ Formal : Node_Id;
+ Nam : Node_Id;
- if Present (Formal) then
- Actuals := New_List;
+ begin
+ -- Map formals to actuals. Use the list built for the wrapper
+ -- spec, skipping the object notation parameter.
- while Present (Formal) loop
- Append_To (Actuals,
- Make_Identifier (Loc, Chars =>
- Chars (Defining_Identifier (Formal))));
+ First_Formal := First (Parameter_Specifications (Body_Spec));
+ Formal := First_Formal;
Next (Formal);
- end loop;
- end if;
- -- An access-to-variable first parameter will require an explicit
- -- dereference in the unchecked conversion. This case occurs when
- -- a protected entry wrapper must override an interface-level
- -- procedure with interface access as first parameter.
+ if Present (Formal) then
+ Actuals := New_List;
- -- SubprgName (O.all).Proc_Nam (Formal_1 .. Formal_N)
+ while Present (Formal) loop
+ Append_To (Actuals,
+ Make_Identifier (Loc, Chars =>
+ Chars (Defining_Identifier (Formal))));
- if Nkind (Parameter_Type (First_Formal)) = N_Access_Definition then
- Conv_Id :=
- Make_Explicit_Dereference (Loc,
- Prefix =>
- Make_Identifier (Loc, Chars => Name_uO));
+ Next (Formal);
+ end loop;
+ end if;
+
+ -- Special processing for primitives declared between a private
+ -- type and its completion.
+
+ if Is_Private_Primitive_Subprogram (Subp_Id) then
+ if No (Actuals) then
+ Actuals := New_List;
+ end if;
+
+ Prepend_To (Actuals,
+ Unchecked_Convert_To (
+ Corresponding_Concurrent_Type (Obj_Typ),
+ Make_Identifier (Loc, Name_uO)));
+
+ Nam := New_Reference_To (Subp_Id, Loc);
+
+ else
+ -- An access-to-variable object parameter requires an explicit
+ -- dereference in the unchecked conversion. This case occurs
+ -- when a protected entry wrapper must override an interface
+ -- level procedure with interface access as first parameter.
+
+ -- O.all.Subp_Id (Formal_1, ..., Formal_N)
+
+ if Nkind (Parameter_Type (First_Formal)) =
+ N_Access_Definition
+ then
+ Conv_Id :=
+ Make_Explicit_Dereference (Loc,
+ Prefix => Make_Identifier (Loc, Name_uO));
+ else
+ Conv_Id := Make_Identifier (Loc, Name_uO);
+ end if;
+
+ Nam :=
+ Make_Selected_Component (Loc,
+ Prefix =>
+ Unchecked_Convert_To (
+ Corresponding_Concurrent_Type (Obj_Typ),
+ Conv_Id),
+ Selector_Name =>
+ New_Reference_To (Subp_Id, Loc));
+ end if;
+
+ -- Create the subprogram body
+
+ if Ekind (Subp_Id) = E_Function then
+ return
+ Make_Subprogram_Body (Loc,
+ Specification => Body_Spec,
+ Declarations => Empty_List,
+ Handled_Statement_Sequence =>
+ Make_Handled_Sequence_Of_Statements (Loc,
+ Statements => New_List (
+ Make_Simple_Return_Statement (Loc,
+ Make_Function_Call (Loc,
+ Name => Nam,
+ Parameter_Associations => Actuals)))));
+
+ else
+ return
+ Make_Subprogram_Body (Loc,
+ Specification => Body_Spec,
+ Declarations => Empty_List,
+ Handled_Statement_Sequence =>
+ Make_Handled_Sequence_Of_Statements (Loc,
+ Statements => New_List (
+ Make_Procedure_Call_Statement (Loc,
+ Name => Nam,
+ Parameter_Associations => Actuals))));
+ end if;
+ end;
+ end Build_Wrapper_Body;
+
+ -- Start of processing for Build_Wrapper_Bodies
+
+ begin
+ if Is_Concurrent_Type (Typ) then
+ Rec_Typ := Corresponding_Record_Type (Typ);
else
- Conv_Id :=
- Make_Identifier (Loc, Chars => Name_uO);
+ Rec_Typ := Typ;
end if;
- if Ekind (Proc_Nam) = E_Function then
- return
- Make_Subprogram_Body (Loc,
- Specification => Body_Spec,
- Declarations => Empty_List,
- Handled_Statement_Sequence =>
- Make_Handled_Sequence_Of_Statements (Loc,
- Statements =>
- New_List (
- Make_Simple_Return_Statement (Loc,
- Make_Function_Call (Loc,
- Name =>
- Make_Selected_Component (Loc,
- Prefix =>
- Unchecked_Convert_To (
- Corresponding_Concurrent_Type (Obj_Typ),
- Conv_Id),
- Selector_Name =>
- New_Reference_To (Proc_Nam, Loc)),
- Parameter_Associations => Actuals)))));
- else
- return
- Make_Subprogram_Body (Loc,
- Specification => Body_Spec,
- Declarations => Empty_List,
- Handled_Statement_Sequence =>
- Make_Handled_Sequence_Of_Statements (Loc,
- Statements =>
- New_List (
- Make_Procedure_Call_Statement (Loc,
- Name =>
- Make_Selected_Component (Loc,
- Prefix =>
- Unchecked_Convert_To (
- Corresponding_Concurrent_Type (Obj_Typ),
- Conv_Id),
- Selector_Name =>
- New_Reference_To (Proc_Nam, Loc)),
- Parameter_Associations => Actuals))));
+ -- Generate wrapper bodies for a concurrent type which implements an
+ -- interface.
+
+ if Present (Interfaces (Rec_Typ)) then
+ declare
+ Insert_Nod : Node_Id;
+ Prim : Entity_Id;
+ Prim_Elmt : Elmt_Id;
+ Prim_Decl : Node_Id;
+ Subp : Entity_Id;
+ Wrap_Body : Node_Id;
+ Wrap_Id : Entity_Id;
+
+ begin
+ Insert_Nod := N;
+
+ -- Examine all primitive operations of the corresponding record
+ -- type, looking for wrapper specs. Generate bodies in order to
+ -- complete them.
+
+ Prim_Elmt := First_Elmt (Primitive_Operations (Rec_Typ));
+ while Present (Prim_Elmt) loop
+ Prim := Node (Prim_Elmt);
+
+ if (Ekind (Prim) = E_Function
+ or else Ekind (Prim) = E_Procedure)
+ and then Is_Primitive_Wrapper (Prim)
+ then
+ Subp := Wrapped_Entity (Prim);
+ Prim_Decl := Parent (Parent (Prim));
+
+ Wrap_Body :=
+ Build_Wrapper_Body (Loc,
+ Subp_Id => Subp,
+ Obj_Typ => Rec_Typ,
+ Formals => Parameter_Specifications (Parent (Subp)));
+ Wrap_Id := Defining_Unit_Name (Specification (Wrap_Body));
+
+ Set_Corresponding_Spec (Wrap_Body, Prim);
+ Set_Corresponding_Body (Prim_Decl, Wrap_Id);
+
+ Insert_After (Insert_Nod, Wrap_Body);
+ Insert_Nod := Wrap_Body;
+
+ Analyze (Wrap_Body);
+ end if;
+
+ Next_Elmt (Prim_Elmt);
+ end loop;
+ end;
end if;
- end Build_Wrapper_Body;
+ end Build_Wrapper_Bodies;
------------------------
-- Build_Wrapper_Spec --
------------------------
function Build_Wrapper_Spec
- (Loc : Source_Ptr;
- Proc_Nam : Entity_Id;
- Obj_Typ : Entity_Id;
- Formals : List_Id) return Node_Id
+ (Loc : Source_Ptr;
+ Subp_Id : Entity_Id;
+ Obj_Typ : Entity_Id;
+ Formals : List_Id) return Node_Id
is
- New_Name_Id : constant Entity_Id :=
- Make_Defining_Identifier (Loc, Chars (Proc_Nam));
-
- First_Param : Node_Id := Empty;
- Iface : Entity_Id;
- Iface_Elmt : Elmt_Id := No_Elmt;
- New_Formals : List_Id;
- Obj_Param : Node_Id;
- Obj_Param_Typ : Node_Id;
- Iface_Prim_Op : Entity_Id;
- Iface_Prim_Op_Elmt : Elmt_Id;
+ First_Param : Node_Id;
+ Iface : Entity_Id;
+ Iface_Elmt : Elmt_Id;
+ Iface_Op : Entity_Id;
+ Iface_Op_Elmt : Elmt_Id;
function Overriding_Possible
- (Iface_Prim_Op : Entity_Id;
- Proc_Nam : Entity_Id) return Boolean;
- -- Determine whether a primitive operation can be overridden by the
- -- wrapper. Iface_Prim_Op is the candidate primitive operation of an
- -- abstract interface type, Proc_Nam is the generated entry wrapper.
+ (Iface_Op : Entity_Id;
+ Wrapper : Entity_Id) return Boolean;
+ -- Determine whether a primitive operation can be overridden by Wrapper.
+ -- Iface_Op is the candidate primitive operation of an interface type,
+ -- Wrapper is the generated entry wrapper.
- function Replicate_Entry_Formals
+ function Replicate_Formals
(Loc : Source_Ptr;
Formals : List_Id) return List_Id;
- -- An explicit parameter replication is required due to the
- -- Is_Entry_Formal flag being set for all the formals. The explicit
+ -- An explicit parameter replication is required due to the Is_Entry_
+ -- Formal flag being set for all the formals of an entry. The explicit
-- replication removes the flag that would otherwise cause a different
-- path of analysis.
@@ -1687,18 +1784,15 @@ package body Exp_Ch9 is
-------------------------
function Overriding_Possible
- (Iface_Prim_Op : Entity_Id;
- Proc_Nam : Entity_Id) return Boolean
+ (Iface_Op : Entity_Id;
+ Wrapper : Entity_Id) return Boolean
is
- Prim_Op_Spec : constant Node_Id := Parent (Iface_Prim_Op);
- Proc_Spec : constant Node_Id := Parent (Proc_Nam);
-
- Is_Access_To_Variable : Boolean;
- Is_Out_Present : Boolean;
+ Iface_Op_Spec : constant Node_Id := Parent (Iface_Op);
+ Wrapper_Spec : constant Node_Id := Parent (Wrapper);
function Type_Conformant_Parameters
- (Prim_Op_Param_Specs : List_Id;
- Proc_Param_Specs : List_Id) return Boolean;
+ (Iface_Op_Params : List_Id;
+ Wrapper_Params : List_Id) return Boolean;
-- Determine whether the parameters of the generated entry wrapper
-- and those of a primitive operation are type conformant. During
-- this check, the first parameter of the primitive operation is
@@ -1709,40 +1803,40 @@ package body Exp_Ch9 is
--------------------------------
function Type_Conformant_Parameters
- (Prim_Op_Param_Specs : List_Id;
- Proc_Param_Specs : List_Id) return Boolean
+ (Iface_Op_Params : List_Id;
+ Wrapper_Params : List_Id) return Boolean
is
- Prim_Op_Param : Node_Id;
- Prim_Op_Typ : Entity_Id;
- Proc_Param : Node_Id;
- Proc_Typ : Entity_Id;
+ Iface_Op_Param : Node_Id;
+ Iface_Op_Typ : Entity_Id;
+ Wrapper_Param : Node_Id;
+ Wrapper_Typ : Entity_Id;
begin
-- Skip the first parameter of the primitive operation
- Prim_Op_Param := Next (First (Prim_Op_Param_Specs));
- Proc_Param := First (Proc_Param_Specs);
- while Present (Prim_Op_Param)
- and then Present (Proc_Param)
+ Iface_Op_Param := Next (First (Iface_Op_Params));
+ Wrapper_Param := First (Wrapper_Params);
+ while Present (Iface_Op_Param)
+ and then Present (Wrapper_Param)
loop
- Prim_Op_Typ := Find_Parameter_Type (Prim_Op_Param);
- Proc_Typ := Find_Parameter_Type (Proc_Param);
+ Iface_Op_Typ := Find_Parameter_Type (Iface_Op_Param);
+ Wrapper_Typ := Find_Parameter_Type (Wrapper_Param);
-- The two parameters must be mode conformant
if not Conforming_Types
- (Prim_Op_Typ, Proc_Typ, Mode_Conformant)
+ (Iface_Op_Typ, Wrapper_Typ, Mode_Conformant)
then
return False;
end if;
- Next (Prim_Op_Param);
- Next (Proc_Param);
+ Next (Iface_Op_Param);
+ Next (Wrapper_Param);
end loop;
-- One of the lists is longer than the other
- if Present (Prim_Op_Param) or else Present (Proc_Param) then
+ if Present (Iface_Op_Param) or else Present (Wrapper_Param) then
return False;
end if;
@@ -1752,47 +1846,41 @@ package body Exp_Ch9 is
-- Start of processing for Overriding_Possible
begin
- if Chars (Iface_Prim_Op) /= Chars (Proc_Nam) then
+ if Chars (Iface_Op) /= Chars (Wrapper) then
return False;
end if;
- -- Special check for protected procedures: If an inherited subprogram
- -- is implemented by a protected procedure or an entry, then the
- -- first parameter of the inherited subprogram shall be of mode OUT
- -- or IN OUT, or an access-to-variable parameter.
-
- if Ekind (Iface_Prim_Op) = E_Procedure then
-
- Is_Out_Present :=
- Present (Parameter_Specifications (Prim_Op_Spec))
- and then
- Out_Present (First (Parameter_Specifications (Prim_Op_Spec)));
+ -- If an inherited subprogram is implemented by a protected procedure
+ -- or an entry, then the first parameter of the inherited subprogram
+ -- shall be of mode OUT or IN OUT, or access-to-variable parameter.
- Is_Access_To_Variable :=
- Present (Parameter_Specifications (Prim_Op_Spec))
- and then
- Nkind (Parameter_Type
- (First
- (Parameter_Specifications (Prim_Op_Spec)))) =
- N_Access_Definition;
-
- if not Is_Out_Present
- and then not Is_Access_To_Variable
- then
- return False;
- end if;
+ if Ekind (Iface_Op) = E_Procedure
+ and then Present (Parameter_Specifications (Iface_Op_Spec))
+ then
+ declare
+ Obj_Param : constant Node_Id :=
+ First (Parameter_Specifications (Iface_Op_Spec));
+ begin
+ if not Out_Present (Obj_Param)
+ and then Nkind (Parameter_Type (Obj_Param)) /=
+ N_Access_Definition
+ then
+ return False;
+ end if;
+ end;
end if;
- return Type_Conformant_Parameters (
- Parameter_Specifications (Prim_Op_Spec),
- Parameter_Specifications (Proc_Spec));
+ return
+ Type_Conformant_Parameters (
+ Parameter_Specifications (Iface_Op_Spec),
+ Parameter_Specifications (Wrapper_Spec));
end Overriding_Possible;
- -----------------------------
- -- Replicate_Entry_Formals --
- -----------------------------
+ -----------------------
+ -- Replicate_Formals --
+ -----------------------
- function Replicate_Entry_Formals
+ function Replicate_Formals
(Loc : Source_Ptr;
Formals : List_Id) return List_Id
is
@@ -1802,6 +1890,14 @@ package body Exp_Ch9 is
begin
Formal := First (Formals);
+
+ -- Skip the object parameter when dealing with primitives declared
+ -- between two views.
+
+ if Is_Private_Primitive_Subprogram (Subp_Id) then
+ Formal := Next (Formal);
+ end if;
+
while Present (Formal) loop
-- Create an explicit copy of the entry parameter
@@ -1835,166 +1931,229 @@ package body Exp_Ch9 is
end loop;
return New_Formals;
- end Replicate_Entry_Formals;
+ end Replicate_Formals;
-- Start of processing for Build_Wrapper_Spec
begin
- -- The mode is determined by the first parameter of the interface-level
- -- procedure that the current entry is trying to override.
+ -- There is no point in building wrappers for non-tagged concurrent
+ -- types.
- pragma Assert (Is_Non_Empty_List (Abstract_Interface_List (Obj_Typ)));
+ pragma Assert (Is_Tagged_Type (Obj_Typ));
- -- We must examine all the protected operations of the implemented
- -- interfaces in order to discover a possible overriding candidate.
+ -- An entry or a protected procedure can override a routine where the
+ -- controlling formal is either IN OUT, OUT or is of access-to-variable
+ -- type. Since the wrapper must have the exact same signature as that of
+ -- the overridden subprogram, we try to find the overriding candidate
+ -- and use its controlling formal.
- Iface := Etype (First (Abstract_Interface_List (Obj_Typ)));
+ First_Param := Empty;
- Examine_Parents : loop
- if Present (Primitive_Operations (Iface)) then
- Iface_Prim_Op_Elmt := First_Elmt (Primitive_Operations (Iface));
- while Present (Iface_Prim_Op_Elmt) loop
- Iface_Prim_Op := Node (Iface_Prim_Op_Elmt);
-
- if not Is_Predefined_Dispatching_Operation (Iface_Prim_Op) then
- while Present (Alias (Iface_Prim_Op)) loop
- Iface_Prim_Op := Alias (Iface_Prim_Op);
- end loop;
+ -- Check every implemented interface
- -- The current primitive operation can be overridden by the
- -- generated entry wrapper.
-
- if Overriding_Possible (Iface_Prim_Op, Proc_Nam) then
- First_Param := First (Parameter_Specifications
- (Parent (Iface_Prim_Op)));
-
- goto Found;
- end if;
- end if;
-
- Next_Elmt (Iface_Prim_Op_Elmt);
- end loop;
- end if;
-
- exit Examine_Parents when Etype (Iface) = Iface;
-
- Iface := Etype (Iface);
- end loop Examine_Parents;
-
- if Present (Interfaces
- (Corresponding_Record_Type (Scope (Proc_Nam))))
- then
- Iface_Elmt := First_Elmt
- (Interfaces
- (Corresponding_Record_Type (Scope (Proc_Nam))));
- Examine_Interfaces : while Present (Iface_Elmt) loop
+ if Present (Interfaces (Obj_Typ)) then
+ Iface_Elmt := First_Elmt (Interfaces (Obj_Typ));
+ Search : while Present (Iface_Elmt) loop
Iface := Node (Iface_Elmt);
+ -- Check every interface primitive
+
if Present (Primitive_Operations (Iface)) then
- Iface_Prim_Op_Elmt := First_Elmt (Primitive_Operations (Iface));
- while Present (Iface_Prim_Op_Elmt) loop
- Iface_Prim_Op := Node (Iface_Prim_Op_Elmt);
+ Iface_Op_Elmt := First_Elmt (Primitive_Operations (Iface));
+ while Present (Iface_Op_Elmt) loop
+ Iface_Op := Node (Iface_Op_Elmt);
- if not Is_Predefined_Dispatching_Operation
- (Iface_Prim_Op)
- then
- while Present (Alias (Iface_Prim_Op)) loop
- Iface_Prim_Op := Alias (Iface_Prim_Op);
- end loop;
+ -- Ignore predefined primitives
+
+ if not Is_Predefined_Dispatching_Operation (Iface_Op) then
+ Iface_Op := Ultimate_Alias (Iface_Op);
-- The current primitive operation can be overridden by
-- the generated entry wrapper.
- if Overriding_Possible (Iface_Prim_Op, Proc_Nam) then
- First_Param := First (Parameter_Specifications
- (Parent (Iface_Prim_Op)));
+ if Overriding_Possible (Iface_Op, Subp_Id) then
+ First_Param :=
+ First (Parameter_Specifications (Parent (Iface_Op)));
- goto Found;
+ exit Search;
end if;
end if;
- Next_Elmt (Iface_Prim_Op_Elmt);
+ Next_Elmt (Iface_Op_Elmt);
end loop;
end if;
Next_Elmt (Iface_Elmt);
- end loop Examine_Interfaces;
+ end loop Search;
end if;
- -- Return if no interface primitive can be overridden
+ -- If the subprogram to be wrapped is not overriding anything or is not
+ -- a primitive declared between two views, do not produce anything. This
+ -- avoids spurious errors involving overriding.
- return Empty;
+ if No (First_Param)
+ and then not Is_Private_Primitive_Subprogram (Subp_Id)
+ then
+ return Empty;
+ end if;
- <<Found>>
+ declare
+ Wrapper_Id : constant Entity_Id :=
+ Make_Defining_Identifier (Loc, Chars (Subp_Id));
+ New_Formals : List_Id;
+ Obj_Param : Node_Id;
+ Obj_Param_Typ : Entity_Id;
- New_Formals := Replicate_Entry_Formals (Loc, Formals);
+ begin
+ -- Minimum decoration is needed to catch the entity in
+ -- Sem_Ch6.Override_Dispatching_Operation.
- -- ??? Certain source packages contain protected or task types that do
- -- not implement any interfaces and are compiled with the -gnat05
- -- switch. In this case, a default first parameter is created.
+ if Ekind (Subp_Id) = E_Function then
+ Set_Ekind (Wrapper_Id, E_Function);
+ else
+ Set_Ekind (Wrapper_Id, E_Procedure);
+ end if;
- -- If the interface operation has an access parameter, create a copy
- -- of it, with the same null exclusion indicator if present.
+ Set_Is_Primitive_Wrapper (Wrapper_Id);
+ Set_Wrapped_Entity (Wrapper_Id, Subp_Id);
+ Set_Is_Private_Primitive (Wrapper_Id,
+ Is_Private_Primitive_Subprogram (Subp_Id));
- if Present (First_Param) then
- if Nkind (Parameter_Type (First_Param)) = N_Access_Definition then
- Obj_Param_Typ :=
- Make_Access_Definition (Loc,
- Subtype_Mark =>
- New_Reference_To (Obj_Typ, Loc));
- Set_Null_Exclusion_Present (Obj_Param_Typ,
- Null_Exclusion_Present (Parameter_Type (First_Param)));
+ -- Process the formals
+
+ New_Formals := Replicate_Formals (Loc, Formals);
+
+ -- Routine Subp_Id has been found to override an interface primitive.
+ -- If the interface operation has an access parameter, create a copy
+ -- of it, with the same null exclusion indicator if present.
+
+ if Present (First_Param) then
+ if Nkind (Parameter_Type (First_Param)) = N_Access_Definition then
+ Obj_Param_Typ :=
+ Make_Access_Definition (Loc,
+ Subtype_Mark =>
+ New_Reference_To (Obj_Typ, Loc));
+ Set_Null_Exclusion_Present (Obj_Param_Typ,
+ Null_Exclusion_Present (Parameter_Type (First_Param)));
+
+ else
+ Obj_Param_Typ := New_Reference_To (Obj_Typ, Loc);
+ end if;
+
+ Obj_Param :=
+ Make_Parameter_Specification (Loc,
+ Defining_Identifier =>
+ Make_Defining_Identifier (Loc,
+ Chars => Name_uO),
+ In_Present => In_Present (First_Param),
+ Out_Present => Out_Present (First_Param),
+ Parameter_Type => Obj_Param_Typ);
+
+ -- If we are dealing with a primitive declared between two views,
+ -- create a default parameter.
+
+ else pragma Assert (Is_Private_Primitive_Subprogram (Subp_Id));
+ Obj_Param :=
+ Make_Parameter_Specification (Loc,
+ Defining_Identifier =>
+ Make_Defining_Identifier (Loc, Name_uO),
+ In_Present => True,
+ Out_Present => Ekind (Subp_Id) /= E_Function,
+ Parameter_Type => New_Reference_To (Obj_Typ, Loc));
+ end if;
+
+ Prepend_To (New_Formals, Obj_Param);
+
+ -- Build the final spec
+ if Ekind (Subp_Id) = E_Function then
+ return
+ Make_Function_Specification (Loc,
+ Defining_Unit_Name => Wrapper_Id,
+ Parameter_Specifications => New_Formals,
+ Result_Definition =>
+ New_Copy (Result_Definition (Parent (Subp_Id))));
else
- Obj_Param_Typ := New_Reference_To (Obj_Typ, Loc);
+ return
+ Make_Procedure_Specification (Loc,
+ Defining_Unit_Name => Wrapper_Id,
+ Parameter_Specifications => New_Formals);
end if;
+ end;
+ end Build_Wrapper_Spec;
- Obj_Param :=
- Make_Parameter_Specification (Loc,
- Defining_Identifier =>
- Make_Defining_Identifier (Loc, Name_uO),
- In_Present => In_Present (First_Param),
- Out_Present => Out_Present (First_Param),
- Parameter_Type => Obj_Param_Typ);
+ -------------------------
+ -- Build_Wrapper_Specs --
+ -------------------------
- else
- Obj_Param :=
- Make_Parameter_Specification (Loc,
- Defining_Identifier =>
- Make_Defining_Identifier (Loc, Name_uO),
- In_Present => True,
- Out_Present => True,
- Parameter_Type => New_Reference_To (Obj_Typ, Loc));
+ procedure Build_Wrapper_Specs
+ (Loc : Source_Ptr;
+ Typ : Entity_Id;
+ N : in out Node_Id)
+ is
+ Def : Node_Id;
+ Rec_Typ : Entity_Id;
+
+ begin
+ if Is_Protected_Type (Typ) then
+ Def := Protected_Definition (Parent (Typ));
+ else pragma Assert (Is_Task_Type (Typ));
+ Def := Task_Definition (Parent (Typ));
end if;
- Prepend_To (New_Formals, Obj_Param);
+ Rec_Typ := Corresponding_Record_Type (Typ);
- -- Minimum decoration needed to catch the entity in
- -- Sem_Ch6.Override_Dispatching_Operation
+ -- Generate wrapper specs for a concurrent type which implements an
+ -- interface and has visible entries and/or protected procedures.
- if Ekind (Proc_Nam) = E_Procedure
- or else Ekind (Proc_Nam) = E_Entry
+ if Present (Interfaces (Rec_Typ))
+ and then Present (Def)
+ and then Present (Visible_Declarations (Def))
then
- Set_Ekind (New_Name_Id, E_Procedure);
- Set_Is_Primitive_Wrapper (New_Name_Id);
- Set_Wrapped_Entity (New_Name_Id, Proc_Nam);
+ declare
+ Decl : Node_Id;
+ Wrap_Decl : Node_Id;
+ Wrap_Spec : Node_Id;
- return
- Make_Procedure_Specification (Loc,
- Defining_Unit_Name => New_Name_Id,
- Parameter_Specifications => New_Formals);
+ begin
+ Decl := First (Visible_Declarations (Def));
+ while Present (Decl) loop
+ Wrap_Spec := Empty;
- else pragma Assert (Ekind (Proc_Nam) = E_Function);
- Set_Ekind (New_Name_Id, E_Function);
+ if Nkind (Decl) = N_Entry_Declaration
+ and then Ekind (Defining_Identifier (Decl)) = E_Entry
+ then
+ Wrap_Spec :=
+ Build_Wrapper_Spec (Loc,
+ Subp_Id => Defining_Identifier (Decl),
+ Obj_Typ => Rec_Typ,
+ Formals => Parameter_Specifications (Decl));
- return
- Make_Function_Specification (Loc,
- Defining_Unit_Name => New_Name_Id,
- Parameter_Specifications => New_Formals,
- Result_Definition =>
- New_Copy (Result_Definition (Parent (Proc_Nam))));
+ elsif Nkind (Decl) = N_Subprogram_Declaration then
+ Wrap_Spec :=
+ Build_Wrapper_Spec (Loc,
+ Subp_Id => Defining_Unit_Name (Specification (Decl)),
+ Obj_Typ => Rec_Typ,
+ Formals =>
+ Parameter_Specifications (Specification (Decl)));
+ end if;
+
+ if Present (Wrap_Spec) then
+ Wrap_Decl :=
+ Make_Subprogram_Declaration (Loc,
+ Specification => Wrap_Spec);
+
+ Insert_After (N, Wrap_Decl);
+ N := Wrap_Decl;
+
+ Analyze (Wrap_Decl);
+ end if;
+
+ Next (Decl);
+ end loop;
+ end;
end if;
- end Build_Wrapper_Spec;
+ end Build_Wrapper_Specs;
---------------------------
-- Build_Find_Body_Index --
@@ -4574,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,
@@ -4594,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.
@@ -4627,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;
@@ -6903,13 +7062,17 @@ 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);
- Op_Body : Node_Id;
- Op_Decl : Node_Id;
- Op_Id : Entity_Id;
+
+ Current_Node : Node_Id;
Disp_Op_Body : Node_Id;
New_Op_Body : Node_Id;
- Current_Node : Node_Id;
Num_Entries : Natural := 0;
+ Op_Body : Node_Id;
+ 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;
@@ -7002,14 +7165,12 @@ package body Exp_Ch9 is
return;
end if;
- if Nkind (Parent (N)) = N_Subunit then
-
- -- This is the proper body corresponding to a stub. The declarations
- -- must be inserted at the point of the stub, which is in the decla-
- -- rative part of the parent unit.
+ -- This is the proper body corresponding to a stub. The declarations
+ -- must be inserted at the point of the stub, which in turn is in the
+ -- declarative part of the parent unit.
+ if Nkind (Parent (N)) = N_Subunit then
Current_Node := Corresponding_Stub (Parent (N));
-
else
Current_Node := N;
end if;
@@ -7046,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;
@@ -7171,63 +7332,12 @@ package body Exp_Ch9 is
Analyze (New_Op_Body);
end if;
- -- Ada 2005 (AI-345): Construct the primitive entry wrapper bodies after
- -- the protected body. At this point the entry specs have been created,
+ -- Ada 2005 (AI-345): Construct the primitive wrapper bodies after the
+ -- protected body. At this point all wrapper specs have been created,
-- frozen and included in the dispatch table for the protected type.
- pragma Assert (Present (Corresponding_Record_Type (Pid)));
-
- if Ada_Version >= Ada_05
- and then Present (Protected_Definition (Parent (Pid)))
- and then Present (Interfaces (Corresponding_Record_Type (Pid)))
- then
- declare
- Vis_Decl : Node_Id :=
- First (Visible_Declarations
- (Protected_Definition (Parent (Pid))));
- Wrap_Body : Node_Id;
-
- begin
- -- Examine the visible declarations of the protected type, looking
- -- for an entry declaration. We do not consider entry families
- -- since they cannot have dispatching operations, thus they do not
- -- need entry wrappers.
-
- while Present (Vis_Decl) loop
- if Nkind (Vis_Decl) = N_Entry_Declaration then
- Wrap_Body :=
- Build_Wrapper_Body (Loc,
- Proc_Nam => Defining_Identifier (Vis_Decl),
- Obj_Typ => Corresponding_Record_Type (Pid),
- Formals => Parameter_Specifications (Vis_Decl));
-
- if Wrap_Body /= Empty then
- Insert_After (Current_Node, Wrap_Body);
- Current_Node := Wrap_Body;
-
- Analyze (Wrap_Body);
- end if;
-
- elsif Nkind (Vis_Decl) = N_Subprogram_Declaration then
- Wrap_Body :=
- Build_Wrapper_Body (Loc,
- Proc_Nam => Defining_Unit_Name
- (Specification (Vis_Decl)),
- Obj_Typ => Corresponding_Record_Type (Pid),
- Formals => Parameter_Specifications
- (Specification (Vis_Decl)));
-
- if Wrap_Body /= Empty then
- Insert_After (Current_Node, Wrap_Body);
- Current_Node := Wrap_Body;
-
- Analyze (Wrap_Body);
- end if;
- end if;
-
- Next (Vis_Decl);
- end loop;
- end;
+ if Ada_Version >= Ada_05 then
+ Build_Wrapper_Bodies (Loc, Pid, Current_Node);
end if;
end Expand_N_Protected_Body;
@@ -7625,67 +7735,11 @@ package body Exp_Ch9 is
Analyze (Rec_Decl, Suppress => All_Checks);
-- Ada 2005 (AI-345): Construct the primitive entry wrappers before
- -- the corresponding record is frozen
-
- if Ada_Version >= Ada_05
- and then Present (Visible_Declarations (Pdef))
- and then Present (Corresponding_Record_Type
- (Defining_Identifier (Parent (Pdef))))
- and then Present (Interfaces
- (Corresponding_Record_Type
- (Defining_Identifier (Parent (Pdef)))))
- then
- declare
- Current_Node : Node_Id := Rec_Decl;
- Vis_Decl : Node_Id;
- Wrap_Spec : Node_Id;
- New_N : Node_Id;
-
- begin
- -- Examine the visible declarations of the protected type, looking
- -- for declarations of entries, and subprograms. We do not
- -- consider entry families since they cannot have dispatching
- -- operations, thus they do not need entry wrappers.
-
- Vis_Decl := First (Visible_Declarations (Pdef));
-
- while Present (Vis_Decl) loop
-
- Wrap_Spec := Empty;
-
- if Nkind (Vis_Decl) = N_Entry_Declaration
- and then No (Discrete_Subtype_Definition (Vis_Decl))
- then
- Wrap_Spec :=
- Build_Wrapper_Spec (Loc,
- Proc_Nam => Defining_Identifier (Vis_Decl),
- Obj_Typ => Defining_Identifier (Rec_Decl),
- Formals => Parameter_Specifications (Vis_Decl));
-
- elsif Nkind (Vis_Decl) = N_Subprogram_Declaration then
- Wrap_Spec :=
- Build_Wrapper_Spec (Loc,
- Proc_Nam => Defining_Unit_Name
- (Specification (Vis_Decl)),
- Obj_Typ => Defining_Identifier (Rec_Decl),
- Formals => Parameter_Specifications
- (Specification (Vis_Decl)));
-
- end if;
-
- if Wrap_Spec /= Empty then
- New_N := Make_Subprogram_Declaration (Loc,
- Specification => Wrap_Spec);
-
- Insert_After (Current_Node, New_N);
- Current_Node := New_N;
+ -- the corresponding record is frozen. If any wrappers are generated,
+ -- Current_Node is updated accordingly.
- Analyze (New_N);
- end if;
-
- Next (Vis_Decl);
- end loop;
- end;
+ if Ada_Version >= Ada_05 then
+ Build_Wrapper_Specs (Loc, Prot_Typ, Current_Node);
end if;
-- Collect pointers to entry bodies and their barriers, to be placed
@@ -7694,9 +7748,7 @@ package body Exp_Ch9 is
-- this array. The array is declared after all protected subprograms.
if Has_Entries (Prot_Typ) then
- Entries_Aggr :=
- Make_Aggregate (Loc, Expressions => New_List);
-
+ Entries_Aggr := Make_Aggregate (Loc, Expressions => New_List);
else
Entries_Aggr := Empty;
end if;
@@ -9461,6 +9513,9 @@ package body Exp_Ch9 is
Call : Node_Id;
New_N : Node_Id;
+ Insert_Nod : Node_Id;
+ -- Used to determine the proper location of wrapper body insertions
+
begin
-- Add renaming declarations for discriminals and a declaration for the
-- entry family index (if applicable).
@@ -9527,56 +9582,17 @@ package body Exp_Ch9 is
end if;
-- Ada 2005 (AI-345): Construct the primitive entry wrapper bodies after
- -- the task body. At this point the entry specs have been created,
+ -- the task body. At this point all wrapper specs have been created,
-- frozen and included in the dispatch table for the task type.
- pragma Assert (Present (Corresponding_Record_Type (Ttyp)));
-
- if Ada_Version >= Ada_05
- and then Present (Task_Definition (Parent (Ttyp)))
- and then Present (Interfaces (Corresponding_Record_Type (Ttyp)))
- then
- declare
- Current_Node : Node_Id;
- Vis_Decl : Node_Id :=
- First (Visible_Declarations (Task_Definition (Parent (Ttyp))));
- Wrap_Body : Node_Id;
-
- begin
- if Nkind (Parent (N)) = N_Subunit then
- Current_Node := Corresponding_Stub (Parent (N));
- else
- Current_Node := N;
- end if;
-
- -- Examine the visible declarations of the task type, looking for
- -- an entry declaration. We do not consider entry families since
- -- they cannot have dispatching operations, thus they do not need
- -- entry wrappers.
-
- while Present (Vis_Decl) loop
- if Nkind (Vis_Decl) = N_Entry_Declaration
- and then Ekind (Defining_Identifier (Vis_Decl)) = E_Entry
- then
- -- Create the specification of the wrapper
-
- Wrap_Body :=
- Build_Wrapper_Body (Loc,
- Proc_Nam => Defining_Identifier (Vis_Decl),
- Obj_Typ => Corresponding_Record_Type (Ttyp),
- Formals => Parameter_Specifications (Vis_Decl));
-
- if Wrap_Body /= Empty then
- Insert_After (Current_Node, Wrap_Body);
- Current_Node := Wrap_Body;
-
- Analyze (Wrap_Body);
- end if;
- end if;
+ if Ada_Version >= Ada_05 then
+ if Nkind (Parent (N)) = N_Subunit then
+ Insert_Nod := Corresponding_Stub (Parent (N));
+ else
+ Insert_Nod := N;
+ end if;
- Next (Vis_Decl);
- end loop;
- end;
+ Build_Wrapper_Bodies (Loc, Ttyp, Insert_Nod);
end if;
end Expand_N_Task_Body;
@@ -10025,51 +10041,8 @@ package body Exp_Ch9 is
-- Ada 2005 (AI-345): Construct the primitive entry wrapper specs before
-- the corresponding record has been frozen.
- if Ada_Version >= Ada_05
- and then Present (Taskdef)
- and then Present (Corresponding_Record_Type
- (Defining_Identifier (Parent (Taskdef))))
- and then Present (Interfaces
- (Corresponding_Record_Type
- (Defining_Identifier (Parent (Taskdef)))))
- then
- declare
- Current_Node : Node_Id := Rec_Decl;
- Vis_Decl : Node_Id := First (Visible_Declarations (Taskdef));
- Wrap_Spec : Node_Id;
- New_N : Node_Id;
-
- begin
- -- Examine the visible declarations of the task type, looking for
- -- an entry declaration. We do not consider entry families since
- -- they cannot have dispatching operations, thus they do not need
- -- entry wrappers.
-
- while Present (Vis_Decl) loop
- if Nkind (Vis_Decl) = N_Entry_Declaration
- and then Ekind (Defining_Identifier (Vis_Decl)) = E_Entry
- then
- Wrap_Spec :=
- Build_Wrapper_Spec (Loc,
- Proc_Nam => Defining_Identifier (Vis_Decl),
- Obj_Typ => Etype (Rec_Ent),
- Formals => Parameter_Specifications (Vis_Decl));
-
- if Wrap_Spec /= Empty then
- New_N :=
- Make_Subprogram_Declaration (Loc,
- Specification => Wrap_Spec);
-
- Insert_After (Current_Node, New_N);
- Current_Node := New_N;
-
- Analyze (New_N);
- end if;
- end if;
-
- Next (Vis_Decl);
- end loop;
- end;
+ if Ada_Version >= Ada_05 then
+ Build_Wrapper_Specs (Loc, Tasktyp, Rec_Decl);
end if;
-- Ada 2005 (AI-345): We must defer freezing to allow further
@@ -11408,6 +11381,17 @@ package body Exp_Ch9 is
or else Denotes_Discriminant (Hi, True));
end Is_Potentially_Large_Family;
+ -------------------------------------
+ -- Is_Private_Primitive_Subprogram --
+ -------------------------------------
+
+ function Is_Private_Primitive_Subprogram (Id : Entity_Id) return Boolean is
+ begin
+ return
+ (Ekind (Id) = E_Function or else Ekind (Id) = E_Procedure)
+ and then Is_Private_Primitive (Id);
+ end Is_Private_Primitive_Subprogram;
+
------------------
-- Index_Object --
------------------
diff --git a/gcc/ada/exp_ch9.ads b/gcc/ada/exp_ch9.ads
index a4c618a61cb..1cfa74d3635 100644
--- a/gcc/ada/exp_ch9.ads
+++ b/gcc/ada/exp_ch9.ads
@@ -153,6 +153,18 @@ package Exp_Ch9 is
-- aggregate. It replaces the call to Init (Args) done by
-- Build_Task_Allocate_Block.
+ function Build_Wrapper_Spec
+ (Loc : Source_Ptr;
+ Subp_Id : Entity_Id;
+ Obj_Typ : Entity_Id;
+ Formals : List_Id) return Node_Id;
+ -- Ada 2005 (AI-345): Build the specification of a primitive operation
+ -- associated with a protected or task type. This is required to implement
+ -- dispatching calls through interfaces. Subp_Id is the primitive to be
+ -- wrapped, Obj_Typ is the type of the newly added formal parameter to
+ -- handle object notation, Formals are the original entry formals that
+ -- will be explicitly replicated.
+
function Concurrent_Ref (N : Node_Id) return Node_Id;
-- Given the name of a concurrent object (task or protected object), or
-- the name of an access to a concurrent object, this function returns an
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 864206951f6..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;
@@ -6042,6 +6054,13 @@ package body Exp_Disp is
Full_Typ := Corresponding_Concurrent_Type (Typ);
end if;
+ -- When a private tagged type is completed by a concurrent type,
+ -- retrieve the full view.
+
+ if Is_Private_Type (Full_Typ) then
+ Full_Typ := Full_View (Full_Typ);
+ end if;
+
if Ekind (Prim_Op) = E_Function then
-- Protected function
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 d41a6bc383c..8e367e1d79d 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -1581,7 +1581,12 @@ package body Exp_Util is
or else Etype (First_Entity (Op)) = Etype (Last_Entity (Op)));
Next_Elmt (Prim);
- pragma Assert (Present (Prim));
+
+ -- Raise Program_Error if no primitive found
+
+ if No (Prim) then
+ raise Program_Error;
+ end if;
end loop;
return Node (Prim);
@@ -1608,7 +1613,12 @@ package body Exp_Util is
Prim := First_Elmt (Primitive_Operations (Typ));
while not Is_TSS (Node (Prim), Name) loop
Next_Elmt (Prim);
- pragma Assert (Present (Prim));
+
+ -- Raise program error if no primitive found
+
+ if No (Prim) then
+ raise Program_Error;
+ end if;
end loop;
return Node (Prim);
@@ -4523,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/exp_util.ads b/gcc/ada/exp_util.ads
index 5e57147b720..5848d5d7171 100644
--- a/gcc/ada/exp_util.ads
+++ b/gcc/ada/exp_util.ads
@@ -360,7 +360,10 @@ package Exp_Util is
-- Find the first primitive operation of type T whose name is 'Name'.
-- This function allows the use of a primitive operation which is not
-- directly visible. If T is a class wide type, then the reference is
- -- to an operation of the corresponding root type.
+ -- to an operation of the corresponding root type. Raises Program_Error
+ -- exception if no primitive operation is found. This is normally an
+ -- internal error, but in some cases is an expected consequence of
+ -- illegalities elsewhere.
function Find_Prim_Op
(T : Entity_Id;
@@ -370,6 +373,9 @@ package Exp_Util is
-- with the indicated suffix). This function allows use of a primitive
-- operation which is not directly visible. If T is a class wide type,
-- then the reference is to an operation of the corresponding root type.
+ -- Raises Program_Error exception if no primitive operation is found.
+ -- This is normally an internal error, but in some cases is an expected
+ -- consequence of illegalities elsewhere.
function Find_Protection_Object (Scop : Entity_Id) return Entity_Id;
-- Traverse the scope stack starting from Scop and look for an entry,
diff --git a/gcc/ada/fe.h b/gcc/ada/fe.h
index 2e21af503de..e69f798db5d 100644
--- a/gcc/ada/fe.h
+++ b/gcc/ada/fe.h
@@ -219,8 +219,10 @@ extern void Set_Has_No_Elaboration_Code (Node_Id, Boolean);
/* targparm: */
+#define Backend_Overflow_Checks_On_Target targparm__backend_overflow_checks_on_target
#define Stack_Check_Probes_On_Target targparm__stack_check_probes_on_target
#define Stack_Check_Limits_On_Target targparm__stack_check_limits_on_target
+extern Boolean Backend_Overflow_Checks_On_Target;
extern Boolean Stack_Check_Probes_On_Target;
extern Boolean Stack_Check_Limits_On_Target;
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-pehage.adb b/gcc/ada/g-pehage.adb
index 8d4733334d6..129cecc7659 100644
--- a/gcc/ada/g-pehage.adb
+++ b/gcc/ada/g-pehage.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2002-2007, 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- --
@@ -49,10 +49,10 @@ package body GNAT.Perfect_Hash_Generators is
-- h (w) = (g (f1 (w)) + g (f2 (w))) mod m
- -- where f1 and f2 are functions that map strings into integers, and g is a
- -- function that maps integers into [0, m-1]. h can be order preserving.
- -- For instance, let W = {w_0, ..., w_i, ...,
- -- w_m-1}, h can be defined such that h (w_i) = i.
+ -- where f1 and f2 are functions that map strings into integers, and g is
+ -- a function that maps integers into [0, m-1]. h can be order preserving.
+ -- For instance, let W = {w_0, ..., w_i, ..., w_m-1}, h can be defined
+ -- such that h (w_i) = i.
-- This algorithm defines two possible constructions of f1 and f2. Method
-- b) stores the hash function in less memory space at the expense of
@@ -82,10 +82,10 @@ package body GNAT.Perfect_Hash_Generators is
-- probability of generating an acyclic graph, n >= 2m. If it is not
-- acyclic, Tk have to be regenerated.
- -- In the assignment step, the algorithm builds function g. As is acyclic,
- -- there is a vertex v1 with only one neighbor v2. Let w_i be the word such
- -- that v1 = f1 (w_i) and v2 = f2 (w_i). Let g (v1) = 0 by construction and
- -- g (v2) = (i - g (v1)) mod n (or to be general, (h (i) - g (v1) mod n).
+ -- In the assignment step, the algorithm builds function g. As G is
+ -- acyclic, there is a vertex v1 with only one neighbor v2. Let w_i be
+ -- the word such that v1 = f1 (w_i) and v2 = f2 (w_i). Let g (v1) = 0 by
+ -- construction and g (v2) = (i - g (v1)) mod n (or h (i) - g (v1) mod n).
-- If word w_j is such that v2 = f1 (w_j) and v3 = f2 (w_j), g (v3) = (j -
-- g (v2)) mod (or to be general, (h (j) - g (v2)) mod n). If w_i has no
-- neighbor, then another vertex is selected. The algorithm traverses G to
@@ -102,11 +102,12 @@ package body GNAT.Perfect_Hash_Generators is
No_Edge : constant Edge_Id := -1;
No_Table : constant Table_Id := -1;
- Max_Word_Length : constant := 32;
- subtype Word_Type is String (1 .. Max_Word_Length);
- Null_Word : constant Word_Type := (others => ASCII.NUL);
- -- Store keyword in a word. Note that the length of word is limited to 32
- -- characters.
+ type Word_Type is new String_Access;
+ procedure Free_Word (W : in out Word_Type);
+ function New_Word (S : String) return Word_Type;
+
+ procedure Resize_Word (W : in out Word_Type; Len : Natural);
+ -- Resize string W to have a length Len
type Key_Type is record
Edge : Edge_Id;
@@ -130,8 +131,12 @@ package body GNAT.Perfect_Hash_Generators is
package WT is new GNAT.Table (Word_Type, Word_Id, 0, 32, 32);
package IT is new GNAT.Table (Integer, Integer, 0, 32, 32);
- -- The two main tables. IT is used to store several tables of components
- -- containing only integers.
+ -- The two main tables. WT is used to store the words in their initial
+ -- version and in their reduced version (that is words reduced to their
+ -- significant characters). As an instance of GNAT.Table, WT does not
+ -- initialize string pointers to null. This initialization has to be done
+ -- manually when the table is allocated. IT is used to store several
+ -- tables of components containing only integers.
function Image (Int : Integer; W : Natural := 0) return String;
function Image (Str : String; W : Natural := 0) return String;
@@ -298,9 +303,6 @@ package body GNAT.Perfect_Hash_Generators is
function Allocate (N : Natural; S : Natural := 1) return Table_Id;
-- Allocate N * S ints from IT table
- procedure Free_Tmp_Tables;
- -- Deallocate the tables used by the algorithm (but not the keys table)
-
----------
-- Keys --
----------
@@ -408,7 +410,7 @@ package body GNAT.Perfect_Hash_Generators is
-- Optimization mode (memory vs CPU)
Max_Key_Len : Natural := 0;
- Min_Key_Len : Natural := Max_Word_Length;
+ Min_Key_Len : Natural := 0;
-- Maximum and minimum of all the word length
S : Natural;
@@ -530,26 +532,27 @@ package body GNAT.Perfect_Hash_Generators is
procedure Apply_Position_Selection is
begin
- WT.Set_Last (2 * NK);
for J in 0 .. NK - 1 loop
declare
- I_Word : constant Word_Type := WT.Table (Initial (J));
- R_Word : Word_Type := Null_Word;
- Index : Natural := I_Word'First - 1;
+ IW : constant String := WT.Table (Initial (J)).all;
+ RW : String (1 .. IW'Length) := (others => ASCII.NUL);
+ N : Natural := IW'First - 1;
begin
-- Select the characters of Word included in the position
-- selection.
for C in 0 .. Char_Pos_Set_Len - 1 loop
- exit when I_Word (Get_Char_Pos (C)) = ASCII.NUL;
- Index := Index + 1;
- R_Word (Index) := I_Word (Get_Char_Pos (C));
+ exit when IW (Get_Char_Pos (C)) = ASCII.NUL;
+ N := N + 1;
+ RW (N) := IW (Get_Char_Pos (C));
end loop;
- -- Build the new table with the reduced word
+ -- Build the new table with the reduced word. Be careful
+ -- to deallocate the old version to avoid memory leaks.
- WT.Table (Reduced (J)) := R_Word;
+ Free_Word (WT.Table (Reduced (J)));
+ WT.Table (Reduced (J)) := New_Word (RW);
Set_Key (J, (Edge => No_Edge));
end;
end loop;
@@ -628,9 +631,9 @@ package body GNAT.Perfect_Hash_Generators is
Success : Boolean := False;
begin
- NV := Natural (K2V * Float (NK));
-
- Keys := Allocate (NK);
+ if NK = 0 then
+ raise Program_Error with "keywords set cannot be empty";
+ end if;
if Verbose then
Put_Initial_Keys (Output, "Initial Key Table");
@@ -861,23 +864,16 @@ package body GNAT.Perfect_Hash_Generators is
procedure Finalize is
begin
- Free_Tmp_Tables;
+ -- Deallocate all the WT components (both initial and reduced
+ -- ones) to avoid memory leaks.
+ for W in 0 .. WT.Last loop
+ Free_Word (WT.Table (W));
+ end loop;
WT.Release;
IT.Release;
- NK := 0;
- Max_Key_Len := 0;
- Min_Key_Len := Max_Word_Length;
- end Finalize;
-
- ---------------------
- -- Free_Tmp_Tables --
- ---------------------
-
- procedure Free_Tmp_Tables is
- begin
- IT.Init;
+ -- Reset all variables for next usage
Keys := No_Table;
@@ -901,7 +897,22 @@ package body GNAT.Perfect_Hash_Generators is
Vertices := No_Table;
NV := 0;
- end Free_Tmp_Tables;
+
+ NK := 0;
+ Max_Key_Len := 0;
+ Min_Key_Len := 0;
+ end Finalize;
+
+ ---------------
+ -- Free_Word --
+ ---------------
+
+ procedure Free_Word (W : in out Word_Type) is
+ begin
+ if W /= null then
+ Free (W);
+ end if;
+ end Free_Word;
----------------------------
-- Generate_Mapping_Table --
@@ -1130,20 +1141,75 @@ package body GNAT.Perfect_Hash_Generators is
Tries : Positive := Default_Tries)
is
begin
- -- Free previous tables (the settings may have changed between two runs)
+ -- Deallocate the part of the table concerning the reduced words.
+ -- Initial words are already present in the table. We may have reduced
+ -- words already there because a previous computation failed. We are
+ -- currently retrying and the reduced words have to be deallocated.
- Free_Tmp_Tables;
+ for W in NK .. WT.Last loop
+ Free_Word (WT.Table (W));
+ end loop;
+ IT.Init;
- if K_To_V <= 2.0 then
- Put (Output, "K to V ratio cannot be lower than 2.0");
- New_Line (Output);
- raise Program_Error;
- end if;
+ -- Initialize of computation variables
+
+ Keys := No_Table;
+
+ Char_Pos_Set := No_Table;
+ Char_Pos_Set_Len := 0;
+
+ Used_Char_Set := No_Table;
+ Used_Char_Set_Len := 0;
+
+ T1 := No_Table;
+ T2 := No_Table;
+
+ T1_Len := 0;
+ T2_Len := 0;
+
+ G := No_Table;
+ G_Len := 0;
+
+ Edges := No_Table;
+ Edges_Len := 0;
+
+ Vertices := No_Table;
+ NV := 0;
S := Seed;
K2V := K_To_V;
Opt := Optim;
NT := Tries;
+
+ if K2V <= 2.0 then
+ raise Program_Error with "K to V ratio cannot be lower than 2.0";
+ end if;
+
+ -- Do not accept a value of K2V too close to 2.0 such that once
+ -- rounded up, NV = 2 * NK because the algorithm would not converge.
+
+ NV := Natural (Float (NK) * K2V);
+ if NV <= 2 * NK then
+ NV := 2 * NK + 1;
+ end if;
+
+ Keys := Allocate (NK);
+
+ -- Resize initial words to have all of them at the same size
+ -- (so the size of the largest one).
+
+ for K in 0 .. NK - 1 loop
+ Resize_Word (WT.Table (Initial (K)), Max_Key_Len);
+ end loop;
+
+ -- Allocated the table to store the reduced words. As WT is a
+ -- GNAT.Table (using C memory management), pointers have to be
+ -- explicitly initialized to null.
+
+ WT.Set_Last (Reduced (NK - 1));
+ for W in 0 .. NK - 1 loop
+ WT.Table (Reduced (W)) := null;
+ end loop;
end Initialize;
------------
@@ -1151,28 +1217,18 @@ package body GNAT.Perfect_Hash_Generators is
------------
procedure Insert (Value : String) is
- Word : Word_Type := Null_Word;
Len : constant Natural := Value'Length;
begin
- Word (1 .. Len) := Value (Value'First .. Value'First + Len - 1);
WT.Set_Last (NK);
- WT.Table (NK) := Word;
+ WT.Table (NK) := New_Word (Value);
NK := NK + 1;
- NV := Natural (Float (NK) * K2V);
-
- -- Do not accept a value of K2V too close to 2.0 such that once rounded
- -- up, NV = 2 * NK because the algorithm would not converge.
-
- if NV <= 2 * NK then
- NV := 2 * NK + 1;
- end if;
if Max_Key_Len < Len then
Max_Key_Len := Len;
end if;
- if Len < Min_Key_Len then
+ if Min_Key_Len = 0 or else Len < Min_Key_Len then
Min_Key_Len := Len;
end if;
end Insert;
@@ -1188,6 +1244,15 @@ package body GNAT.Perfect_Hash_Generators is
end if;
end New_Line;
+ --------------
+ -- New_Word --
+ --------------
+
+ function New_Word (S : String) return Word_Type is
+ begin
+ return new String'(S);
+ end New_Word;
+
------------------------------
-- Parse_Position_Selection --
------------------------------
@@ -1761,7 +1826,7 @@ package body GNAT.Perfect_Hash_Generators is
K := Get_Key (J);
Put (File, Image (J, M), F1, L1, J, 1, 3, 1);
Put (File, Image (K.Edge, M), F1, L1, J, 1, 3, 2);
- Put (File, WT.Table (Initial (J)), F1, L1, J, 1, 3, 3);
+ Put (File, WT.Table (Initial (J)).all, F1, L1, J, 1, 3, 3);
end loop;
end Put_Initial_Keys;
@@ -1842,7 +1907,7 @@ package body GNAT.Perfect_Hash_Generators is
K := Get_Key (J);
Put (File, Image (J, M), F1, L1, J, 1, 3, 1);
Put (File, Image (K.Edge, M), F1, L1, J, 1, 3, 2);
- Put (File, WT.Table (Reduced (J)), F1, L1, J, 1, 3, 3);
+ Put (File, WT.Table (Reduced (J)).all, F1, L1, J, 1, 3, 3);
end loop;
end Put_Reduced_Keys;
@@ -1920,6 +1985,22 @@ package body GNAT.Perfect_Hash_Generators is
return K + NK + 1;
end Reduced;
+ -----------------
+ -- Resize_Word --
+ -----------------
+
+ procedure Resize_Word (W : in out Word_Type; Len : Natural) is
+ S1 : constant String := W.all;
+ S2 : String (1 .. Len) := (others => ASCII.NUL);
+ L : constant Natural := S1'Length;
+ begin
+ if L /= Len then
+ Free_Word (W);
+ S2 (1 .. L) := S1;
+ W := New_Word (S2);
+ end if;
+ end Resize_Word;
+
--------------------------
-- Select_Char_Position --
--------------------------
@@ -1985,11 +2066,11 @@ package body GNAT.Perfect_Hash_Generators is
begin
if L = 0 then
- Left := Reduced (0) - 1;
+ Left := NK;
Right := Offset + R;
elsif R = 0 then
Left := Offset + L;
- Right := Reduced (0) - 1;
+ Right := NK;
else
Left := Offset + L;
Right := Offset + R;
@@ -2007,17 +2088,18 @@ package body GNAT.Perfect_Hash_Generators is
begin
if From = 0 then
- Source := Reduced (0) - 1;
+ Source := NK;
Target := Offset + To;
elsif To = 0 then
Source := Offset + From;
- Target := Reduced (0) - 1;
+ Target := NK;
else
Source := Offset + From;
Target := Offset + To;
end if;
WT.Table (Target) := WT.Table (Source);
+ WT.Table (Source) := null;
end Move;
package Sorting is new GNAT.Heap_Sort_G (Move, Lt);
@@ -2120,9 +2202,8 @@ package body GNAT.Perfect_Hash_Generators is
begin
-- Initialize the reduced words set
- WT.Set_Last (2 * NK);
for K in 0 .. NK - 1 loop
- WT.Table (Reduced (K)) := WT.Table (Initial (K));
+ WT.Table (Reduced (K)) := New_Word (WT.Table (Initial (K)).all);
end loop;
declare
@@ -2220,7 +2301,7 @@ package body GNAT.Perfect_Hash_Generators is
Same_Keys_Sets_Table (J).First ..
Same_Keys_Sets_Table (J).Last
loop
- Put (Output, WT.Table (Reduced (K)));
+ Put (Output, WT.Table (Reduced (K)).all);
New_Line (Output);
end loop;
Put (Output, "--");
diff --git a/gcc/ada/g-pehage.ads b/gcc/ada/g-pehage.ads
index b2aea490eed..8b75f2e8803 100644
--- a/gcc/ada/g-pehage.ads
+++ b/gcc/ada/g-pehage.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2002-2005, 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- --
@@ -60,7 +60,7 @@
-- The hash table size corresponds to the exact size of W and *no larger*.
-- This represents the "minimal" property.
--- The functions generated by this package require the key set to be known in
+-- The functions generated by this package require the words to be known in
-- advance (they are "static" hash functions). The hash functions are also
-- order preserving. If w2 is inserted after w1 in the generator, then (w1)
-- < f (w2). These hashing functions are convenient for use with realtime
@@ -101,25 +101,31 @@ package GNAT.Perfect_Hash_Generators is
Tries : Positive := Default_Tries);
-- Initialize the generator and its internal structures. Set the ratio of
-- vertices over keys in the random graphs. This value has to be greater
- -- than 2.0 in order for the algorithm to succeed. The key set is not
+ -- than 2.0 in order for the algorithm to succeed. The word set is not
-- modified (in particular when it is already set). For instance, it is
-- possible to run several times the generator with different settings on
- -- the same key set.
+ -- the same words.
+ --
+ -- A classical way of doing is to Insert all the words and then to invoke
+ -- Initialize and Compute. If Compute fails to find a perfect hash
+ -- function, invoke Initialize another time with other configuration
+ -- parameters (probably with a greater K_To_V ratio). Once successful,
+ -- invoke Produce and Finalize.
procedure Finalize;
- -- Deallocate the internal structures and the key table
+ -- Deallocate the internal structures and the words table
procedure Insert (Value : String);
- -- Insert a new key in the table
+ -- Insert a new word in the table
Too_Many_Tries : exception;
-- Raised after Tries unsuccessful runs
procedure Compute (Position : String := Default_Position);
-- Compute the hash function. Position allows to define selection of
- -- character positions used in the keywords hash function. Positions can be
+ -- character positions used in the word hash function. Positions can be
-- separated by commas and range like x-y may be used. Character '$'
- -- represents the final character of a key. With an empty position, the
+ -- represents the final character of a word. With an empty position, the
-- generator automatically produces positions to reduce the memory usage.
-- Raise Too_Many_Tries in case that the algorithm does not succeed in less
-- than Tries attempts (see Initialize).
@@ -144,7 +150,7 @@ package GNAT.Perfect_Hash_Generators is
-- F1 and F2 are two functions based on two function tables T1 and T2.
-- Their definition depends on the chosen optimization mode.
- -- Only some character positions are used in the keys because they are
+ -- Only some character positions are used in the words because they are
-- significant. They are listed in a character position table (P in the
-- pseudo-code below). For instance, in {"jan", "feb", "mar", "apr", "jun",
-- "jul", "aug", "sep", "oct", "nov", "dec"}, only positions 2 and 3 are
@@ -152,7 +158,7 @@ package GNAT.Perfect_Hash_Generators is
-- {2, 3}
-- When Optimization is CPU_Time, the first dimension of T1 and T2
- -- corresponds to the character position in the key and the second to the
+ -- corresponds to the character position in the word and the second to the
-- character set. As all the character set is not used, we define a used
-- character table which associates a distinct index to each used character
-- (unused characters are mapped to zero). In this case, the second
@@ -177,7 +183,7 @@ package GNAT.Perfect_Hash_Generators is
-- end Hash;
-- When Optimization is Memory_Space, the first dimension of T1 and T2
- -- corresponds to the character position in the key and the second
+ -- corresponds to the character position in the word and the second
-- dimension is ignored. T1 and T2 are no longer matrices but vectors.
-- Therefore, the used character table is not available. The hash function
-- has the following form:
@@ -213,8 +219,8 @@ package GNAT.Perfect_Hash_Generators is
Length_2 : out Natural);
-- Return the definition of the table Name. This includes the length of
-- dimensions 1 and 2 and the size of an unsigned integer item. When
- -- Length_2 is zero, the table has only one dimension. All the ranges start
- -- from zero.
+ -- Length_2 is zero, the table has only one dimension. All the ranges
+ -- start from zero.
function Value
(Name : Table_Name;
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.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-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.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-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/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 4136ebe5dca..c0b417f68f9 100644
--- a/gcc/ada/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -55,12 +55,10 @@ else
ADAFLAGS= $(COMMON_ADAFLAGS)
endif
-ALL_ADAFLAGS = $(CFLAGS) $(ALL_ADA_CFLAGS) $(X_ADAFLAGS) $(T_ADAFLAGS) \
- $(ADAFLAGS)
+ALL_ADAFLAGS = $(CFLAGS) $(ADA_CFLAGS) $(ADAFLAGS)
FORCE_DEBUG_ADAFLAGS = -g
ADA_CFLAGS =
-ALL_ADA_CFLAGS = $(X_ADA_CFLAGS) $(T_ADA_CFLAGS) $(ADA_CFLAGS)
-ADA_INCLUDES = -nostdinc -I- -I. -Iada -I$(srcdir)/ada
+ADA_INCLUDES = -nostdinc -I- -I. -Iada -I$(srcdir)/ada -I$(srcdir)/ada/gcc-interface
ADA_INCLUDE_DIR = $(libsubdir)/adainclude
ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
ADA_FLAGS_TO_PASS = \
@@ -76,9 +74,9 @@ ADA_FLAGS_TO_PASS = \
# Say how to compile Ada programs.
.SUFFIXES: .ada .adb .ads
-# FIXME: need to add $(ALL_ADA_CFLAGS) to .c.o suffix rule
+# FIXME: need to add $(ADA_CFLAGS) to .c.o suffix rule
# Use loose warnings for this front end, but add some special flags
-ada-warn = $(ALL_ADA_CFLAGS) $(WERROR)
+ada-warn = $(ADA_CFLAGS) $(WERROR)
# unresolved warnings in a couple of files
ada/tracebak.o-warn = -Wno-error
ada/b_gnat1.o-warn = -Wno-error
@@ -301,8 +299,8 @@ TARGET_ADA_SRCS =
# Since the RTL should be built with the latest compiler, remove the
# stamp target in the parent directory whenever gnat1 is rebuilt
gnat1$(exeext): $(TARGET_ADA_SRCS) $(GNAT1_OBJS) $(ADA_BACKEND) $(LIBDEPS)
- $(GCC_LINK) -o $@ $(GNAT1_OBJS) $(ADA_BACKEND) $(ALL_CFLAGS) $(LIBS) $(SYSLIBS) $(GMPLIBS)
- $(RM) stamp-gnatlib2 stamp-tools
+ $(GCC_LINK) -o $@ $(GNAT1_OBJS) $(ADA_BACKEND) $(LIBS) $(SYSLIBS) $(GMPLIBS)
+ $(RM) stamp-gnatlib2-rts stamp-tools
gnatbind$(exeext): ada/b_gnatb.o $(CONFIG_H) $(GNATBIND_OBJS)
$(GCC_LINK) -o $@ ada/b_gnatb.o $(GNATBIND_OBJS) $(ALL_CFLAGS) $(LIBS) $(SYSLIBS)
@@ -311,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:
@@ -924,18 +911,47 @@ 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_CC=`echo "$(GCC_FOR_TARGET)" \
+ | sed -e 's^\./xgcc^../../../xgcc^' -e 's^-B./^-B../../../^'`
+OSCONS_CPP=$(OSCONS_CC) $(CFLAGS_FOR_TARGET) -E -C \
+ -DTARGET=\"$(target)\" s-oscons-tmplt.c > s-oscons-tmplt.i
+OSCONS_EXTRACT=$(OSCONS_CC) $(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 $^))
@@ -980,7 +996,7 @@ ada/sdefault.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/s-wchcon.ads ada/system.ads ada/table.adb ada/table.ads ada/tree_io.ads \
ada/types.ads ada/unchdeal.ads ada/unchconv.ads
-ADA_TREE_H = ada/ada-tree.h
+ADA_TREE_H = ada/gcc-interface/ada-tree.h
# force debugging information on s-tasdeb.o so that it is always
# possible to set conditional breakpoints on tasks.
@@ -1058,66 +1074,85 @@ ada/targext.o : ada/targext.c $(SYSTEM_H) coretypes.h $(TM_H)
$< $(OUTPUT_OPTION)
ada/cio.o : ada/cio.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h
- $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) \
+ $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
$(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
ada/init.o : ada/init.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h ada/raise.h
- $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) \
+ $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
$(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
ada/initialize.o : ada/initialize.c
- $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) \
+ $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
$(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
ada/raise.o : ada/raise.c $(CONFIG_H) $(SYSTEM_H) ada/adaint.h ada/raise.h
- $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) \
+ $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
$(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
# Need to keep the frame pointer in this file to pop the stack properly on
# some targets.
ada/tracebak.o : ada/tracebak.c $(CONFIG_H) $(SYSTEM_H)
- $(CC) -c $(ALL_CFLAGS) $(ALL_ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+ $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-fno-omit-frame-pointer $< $(OUTPUT_OPTION)
-ada/cuintp.o : ada/cuintp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) ada/ada.h ada/types.h ada/uintp.h ada/atree.h ada/stringt.h \
- ada/elists.h ada/nlists.h ada/fe.h ada/gigi.h
+ada/cuintp.o : ada/gcc-interface/cuintp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(TREE_H) ada/gcc-interface/ada.h ada/types.h ada/uintp.h ada/atree.h ada/stringt.h \
+ ada/elists.h ada/nlists.h ada/fe.h ada/gcc-interface/gigi.h
+ $(CC) -c $(ALL_CFLAGS) -I.. $(ALL_CPPFLAGS) $< -o $@
-ada/decl.o : ada/decl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- $(FLAGS_H) toplev.h convert.h $(TARGET_H) ada/ada.h ada/types.h ada/atree.h \
+ada/decl.o : ada/gcc-interface/decl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(TREE_H) $(FLAGS_H) toplev.h convert.h $(TARGET_H) \
+ ada/gcc-interface/ada.h ada/types.h ada/atree.h \
ada/nlists.h ada/elists.h ada/uintp.h ada/sinfo.h ada/einfo.h ada/snames.h \
- ada/namet.h ada/stringt.h ada/repinfo.h ada/fe.h $(ADA_TREE_H) ada/gigi.h \
+ ada/namet.h ada/stringt.h ada/repinfo.h ada/fe.h $(ADA_TREE_H) \
+ ada/gcc-interface/gigi.h \
$(EXPR_H) gt-ada-decl.h
+ $(CC) -c $(ALL_CFLAGS) -I.. $(ALL_CPPFLAGS) $< -o $@
-ada/misc.o : ada/misc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
+ada/misc.o : ada/gcc-interface/misc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(TREE_H) \
$(RTL_H) $(EXPR_H) insn-codes.h insn-flags.h insn-config.h recog.h \
$(FLAGS_H) $(DIAGNOSTIC_H) output.h except.h $(TM_P_H) langhooks.h debug.h \
- $(LANGHOOKS_DEF_H) libfuncs.h $(OPTABS_H) ada/ada.h ada/types.h \
+ $(LANGHOOKS_DEF_H) libfuncs.h $(OPTABS_H) ada/gcc-interface/ada.h \
+ ada/types.h \
ada/atree.h ada/nlists.h ada/elists.h ada/sinfo.h ada/einfo.h ada/namet.h \
- ada/stringt.h ada/uintp.h ada/fe.h $(ADA_TREE_H) ada/gigi.h \
+ ada/stringt.h ada/uintp.h ada/fe.h $(ADA_TREE_H) ada/gcc-interface/gigi.h \
ada/adadecode.h opts.h options.h $(TARGET_H) $(REAL_H)
+ $(CC) -c $(ALL_CFLAGS) -I.. $(ALL_CPPFLAGS) $< -o $@
-ada/targtyps.o : ada/targtyps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) ada/ada.h ada/types.h ada/atree.h ada/nlists.h ada/elists.h \
+ada/targtyps.o : ada/gcc-interface/targtyps.c $(CONFIG_H) $(SYSTEM_H) \
+ coretypes.h $(TM_H) \
+ $(TREE_H) ada/gcc-interface/ada.h ada/types.h ada/atree.h ada/nlists.h \
+ ada/elists.h \
ada/uintp.h ada/sinfo.h ada/einfo.h ada/namet.h ada/snames.h ada/stringt.h \
- ada/urealp.h ada/fe.h $(ADA_TREE_H) ada/gigi.h
+ ada/urealp.h ada/fe.h $(ADA_TREE_H) ada/gcc-interface/gigi.h
+ $(CC) -c $(ALL_CFLAGS) -I.. $(ALL_CPPFLAGS) $< -o $@
-ada/trans.o : ada/trans.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) $(RTL_H) $(EXPR_H) $(FLAGS_H) $(FUNCTION_H) ada/ada.h except.h \
+ada/trans.o : ada/gcc-interface/trans.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) \
+ $(TREE_H) $(RTL_H) $(EXPR_H) $(FLAGS_H) $(FUNCTION_H) \
+ ada/gcc-interface/ada.h except.h \
ada/types.h ada/atree.h ada/nlists.h ada/elists.h ada/uintp.h ada/sinfo.h \
ada/einfo.h ada/namet.h ada/snames.h ada/stringt.h ada/urealp.h ada/fe.h \
- $(ADA_TREE_H) ada/gigi.h gt-ada-trans.h
+ $(ADA_TREE_H) ada/gcc-interface/gigi.h gt-ada-trans.h tree-iterator.h
+ $(CC) -c $(ALL_CFLAGS) -I.. $(ALL_CPPFLAGS) $< -o $@
-ada/utils.o : ada/utils.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ada/utils.o : ada/gcc-interface/utils.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) \
$(TREE_H) $(FLAGS_H) $(EXPR_H) convert.h defaults.h langhooks.h \
- ada/ada.h ada/types.h ada/atree.h ada/nlists.h ada/elists.h ada/sinfo.h \
+ ada/gcc-interface/ada.h ada/types.h \
+ ada/atree.h ada/nlists.h ada/elists.h ada/sinfo.h \
ada/einfo.h ada/namet.h ada/stringt.h ada/uintp.h ada/fe.h $(ADA_TREE_H) \
- ada/gigi.h gt-ada-utils.h gtype-ada.h $(TARGET_H)
+ ada/gcc-interface/gigi.h gt-ada-utils.h \
+ gtype-ada.h $(TARGET_H) tree-iterator.h
+ $(CC) -c $(ALL_CFLAGS) -I.. $(ALL_CPPFLAGS) $< -o $@
-ada/utils2.o : ada/utils2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(TREE_H) $(FLAGS_H) ada/ada.h ada/types.h ada/atree.h ada/nlists.h \
- ada/elists.h ada/sinfo.h ada/einfo.h ada/namet.h ada/snames.h \
- ada/stringt.h ada/uintp.h ada/fe.h $(ADA_TREE_H) ada/gigi.h
+ada/utils2.o : ada/gcc-interface/utils2.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
+ $(TM_H) $(TREE_H) $(FLAGS_H) ada/gcc-interface/ada.h ada/types.h \
+ ada/atree.h ada/nlists.h ada/elists.h ada/sinfo.h ada/einfo.h ada/namet.h \
+ ada/snames.h ada/stringt.h ada/uintp.h ada/fe.h $(ADA_TREE_H) \
+ ada/gcc-interface/gigi.h
+ $(CC) -c $(ALL_CFLAGS) -I.. $(ALL_CPPFLAGS) $< -o $@
#
# DO NOT PUT SPECIAL RULES BELOW, THIS SECTION IS UPDATED AUTOMATICALLY
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
new file mode 100644
index 00000000000..28763d7872f
--- /dev/null
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -0,0 +1,2303 @@
+# Makefile for GNU Ada Compiler (GNAT).
+# Copyright (C) 1994-2008 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/>.
+
+# The makefile built from this file lives in the language subdirectory.
+# Its purpose is to provide support for:
+#
+# 1) recursion where necessary, and only then (building .o's), and
+# 2) building and debugging cc1 from the language subdirectory, and
+# 3) nothing else.
+#
+# The parent makefile handles all other chores, with help from the
+# language makefile fragment, of course.
+#
+# The targets for external use are:
+# all, TAGS, ???mostlyclean, ???clean.
+
+# This makefile will only work with Gnu make.
+# The rules are written assuming a minimum subset of tools are available:
+#
+# Required:
+# MAKE: Only Gnu make will work.
+# MV: Must accept (at least) one, maybe wildcard, source argument,
+# a file or directory destination, and support creation/
+# modification date preservation. Gnu mv -f works.
+# RM: Must accept an arbitrary number of space separated file
+# arguments, or one wildcard argument. Gnu rm works.
+# RMDIR: Must delete a directory and all its contents. Gnu rm -rf works.
+# ECHO: Must support command line redirection. Any Unix-like
+# shell will typically provide this, otherwise a custom version
+# is trivial to write.
+# AR: Gnu ar works.
+# MKDIR: Gnu mkdir works.
+# CHMOD: Gnu chmod works.
+# true: Does nothing and returns a normal successful return code.
+# pwd: Prints the current directory on stdout.
+# cd: Change directory.
+#
+# Optional:
+# BISON: Gnu bison works.
+# FLEX: Gnu flex works.
+# Other miscellaneous tools for obscure targets.
+
+# Suppress smart makes who think they know how to automake Yacc files
+.y.c:
+
+# Variables that exist for you to override.
+# See below for how to change them for certain systems.
+
+# Various ways of specifying flags for compilations:
+# CFLAGS is for the user to override to, e.g., do a bootstrap with -O2.
+# BOOT_CFLAGS is the value of CFLAGS to pass
+# to the stage2 and stage3 compilations
+CFLAGS = -g
+BOOT_CFLAGS = -O $(CFLAGS)
+# These exists to be overridden by the t-* files, respectively.
+T_CFLAGS =
+
+CC = cc
+BISON = bison
+BISONFLAGS =
+ECHO = echo
+LEX = flex
+LEXFLAGS =
+CHMOD = chmod
+LN = ln
+LN_S = ln -s
+CP = cp -p
+MV = mv -f
+RM = rm -f
+RMDIR = rm -rf
+MKDIR = mkdir -p
+AR = ar
+AR_FLAGS = rc
+LS = ls
+RANLIB = @RANLIB@
+RANLIB_FLAGS = @ranlib_flags@
+
+SHELL = @SHELL@
+PWD_COMMAND = $${PWDCMD-pwd}
+# How to copy preserving the date
+INSTALL_DATA_DATE = cp -p
+MAKEINFO = makeinfo
+TEXI2DVI = texi2dvi
+TEXI2PDF = texi2pdf
+GNATBIND_FLAGS = -static -x
+ADA_CFLAGS =
+ADAFLAGS = -W -Wall -gnatpg -gnata
+SOME_ADAFLAGS =-gnata
+FORCE_DEBUG_ADAFLAGS = -g
+GNATLIBFLAGS = -gnatpg -nostdinc
+GNATLIBCFLAGS = -g -O2
+GNATLIBCFLAGS_FOR_C = $(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -fexceptions \
+ -DIN_RTS
+ALL_ADAFLAGS = $(CFLAGS) $(ADA_CFLAGS) $(ADAFLAGS)
+MOST_ADAFLAGS = $(CFLAGS) $(ADA_CFLAGS) $(SOME_ADAFLAGS)
+THREAD_KIND = native
+THREADSLIB =
+GMEM_LIB =
+MISCLIB =
+SYMDEPS = $(LIBINTL_DEP)
+OUTPUT_OPTION = @OUTPUT_OPTION@
+
+objext = .o
+exeext =
+arext = .a
+soext = .so
+shext =
+hyphen = -
+
+# Define this as & to perform parallel make on a Sequent.
+# Note that this has some bugs, and it seems currently necessary
+# to compile all the gen* files first by hand to avoid erroneous results.
+P =
+
+# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
+# It specifies -B./.
+# It also specifies -B$(tooldir)/ to find as and ld for a cross compiler.
+GCC_CFLAGS = $(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS)
+
+# Tools to use when building a cross-compiler.
+# These are used because `configure' appends `cross-make'
+# to the makefile when making a cross-compiler.
+
+# We don't use cross-make. Instead we use the tools from the build tree,
+# if they are available.
+# program_transform_name and objdir are set by configure.in.
+program_transform_name =
+objdir = .
+
+target_alias=@target_alias@
+target=@target@
+xmake_file = @xmake_file@
+tmake_file = @tmake_file@
+host_canonical=@host@
+#version=`sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/' < $(srcdir)/version.c`
+#mainversion=`sed -e 's/.*\"\([0-9]*\.[0-9]*\).*/\1/' < $(srcdir)/version.c`
+
+# Directory where sources are, from where we are.
+VPATH = $(srcdir)
+
+fsrcdir := $(shell cd $(srcdir);${PWD_COMMAND})
+fsrcpfx := $(shell cd $(srcdir);${PWD_COMMAND})/
+fcurdir := $(shell ${PWD_COMMAND})
+fcurpfx := $(shell ${PWD_COMMAND})/
+
+# Top build directory, relative to here.
+top_builddir = ../..
+
+# Internationalization library.
+LIBINTL = @LIBINTL@
+LIBINTL_DEP = @LIBINTL_DEP@
+
+# Any system libraries needed just for GNAT.
+SYSLIBS = @GNAT_LIBEXC@
+
+# List of extra object files linked in with various programs.
+EXTRA_GNATTOOLS_OBJS = ../../prefix.o ../../version.o
+
+# List of target dependent sources, overridden below as necessary
+TARGET_ADA_SRCS =
+
+# Type of tools build we are doing; default is not compiling tools.
+TOOLSCASE =
+
+# Multilib handling
+MULTISUBDIR =
+RTSDIR = rts$(subst /,_,$(MULTISUBDIR))
+
+# End of variables for you to override.
+
+all: all.indirect
+
+# This tells GNU Make version 3 not to put all variables in the environment.
+.NOEXPORT:
+
+# tmake_file and xmake_file expand to lists with entries of the form
+# $(srcdir)/config/... but here $(srcdir) is the ada subdirectory so we
+# need to adjust the paths. There can't be spaces in the subst arguments
+# or we get spurious spaces in the actual list of files to include.
+
+# target overrides
+ifneq ($(tmake_file),)
+include $(subst /config,/../config,$(tmake_file))
+endif
+
+# host overrides
+ifneq ($(xmake_file),)
+include $(subst /config,/../config,$(xmake_file))
+endif
+
+# Now figure out from those variables how to compile and link.
+
+all.indirect: Makefile ../gnat1$(exeext)
+
+# IN_GCC distinguishes between code compiled into GCC itself and other
+# programs built during a bootstrap.
+# autoconf inserts -DCROSS_DIRECTORY_STRUCTURE if we are building a cross
+# compiler which does not use the native libraries and headers.
+INTERNAL_CFLAGS = @CROSS@ -DIN_GCC
+
+# This is the variable actually used when we compile.
+LOOSE_CFLAGS = `echo $(CFLAGS) $(WARN2_CFLAGS)|sed -e 's/-pedantic//g' -e 's/-Wtraditional//g'`
+ALL_CFLAGS = $(INTERNAL_CFLAGS) $(T_CFLAGS) $(LOOSE_CFLAGS)
+
+# Likewise.
+ALL_CPPFLAGS = $(CPPFLAGS)
+
+# This is where we get libiberty.a from.
+LIBIBERTY = ../../libiberty/libiberty.a
+
+# How to link with both our special library facilities
+# and the system's installed libraries.
+LIBS = $(LIBINTL) $(LIBIBERTY) $(SYSLIBS)
+LIBDEPS = $(LIBINTL_DEP) $(LIBIBERTY)
+# Default is no TGT_LIB; one might be passed down or something
+TGT_LIB =
+TOOLS_LIBS = $(EXTRA_GNATTOOLS_OBJS) targext.o link.o $(LIBGNAT) ../../../libiberty/libiberty.a $(SYSLIBS) $(TGT_LIB)
+
+# Specify the directories to be searched for header files.
+# Both . and srcdir are used, in that order,
+# so that tm.h and config.h will be found in the compilation
+# subdirectory rather than in the source directory.
+INCLUDES = -I- -I. -I.. -I$(srcdir) -I$(srcdir)/.. -I$(srcdir)/../config \
+ -I$(srcdir)/../../include
+
+ADA_INCLUDES = -I- -I. -I$(srcdir)
+
+INCLUDES_FOR_SUBDIR = -I. -I.. -I../.. -I$(fsrcdir) -I$(fsrcdir)/../config \
+ -I$(fsrcdir)/../../include -I$(fsrcdir)/..
+ADA_INCLUDES_FOR_SUBDIR = -I. -I$(fsrcdir) -I$(fsrcdir)/gcc
+
+# Avoid a lot of time thinking about remaking Makefile.in and *.def.
+.SUFFIXES: .in .def
+
+# Say how to compile Ada programs.
+.SUFFIXES: .ada .adb .ads .asm
+
+# Always use -I$(srcdir)/config when compiling.
+.asm.o:
+ $(CC) -c -x assembler $< $(OUTPUT_OPTION)
+
+.c.o:
+ $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< \
+ $(OUTPUT_OPTION)
+
+.adb.o:
+ $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
+
+.ads.o:
+ $(CC) -c $(ALL_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
+
+# how to regenerate this file
+Makefile: ../config.status $(srcdir)/gcc-interface/Makefile.in $(srcdir)/Makefile.in $(srcdir)/../version.c
+ cd ..; \
+ LANGUAGES="$(CONFIG_LANGUAGES)" \
+ CONFIG_HEADERS= \
+ CONFIG_FILES="ada/gcc-interface/Makefile ada/Makefile" $(SHELL) config.status
+
+# This tells GNU make version 3 not to export all the variables
+# defined in this file into the environment.
+.NOEXPORT:
+
+# Lists of files for various purposes.
+
+GNATLINK_OBJS = gnatlink.o \
+ a-except.o ali.o alloc.o butil.o casing.o csets.o debug.o fmap.o fname.o \
+ gnatvsn.o hostparm.o indepsw.o interfac.o i-c.o i-cstrin.o namet.o opt.o \
+ osint.o output.o rident.o s-exctab.o s-secsta.o s-stalib.o s-stoele.o \
+ sdefault.o snames.o stylesw.o switch.o system.o table.o targparm.o tree_io.o \
+ types.o validsw.o widechar.o
+
+GNATMAKE_OBJS = a-except.o ali.o ali-util.o s-casuti.o \
+ alloc.o atree.o binderr.o butil.o casing.o csets.o debug.o elists.o einfo.o\
+ erroutc.o errutil.o err_vars.o fmap.o fname.o fname-uf.o fname-sf.o \
+ gnatmake.o gnatvsn.o hostparm.o interfac.o i-c.o i-cstrin.o krunch.o lib.o \
+ make.o makeusg.o makeutl.o mlib.o mlib-fil.o mlib-prj.o mlib-tgt.o \
+ mlib-tgt-specific.o mlib-utl.o namet.o nlists.o opt.o osint.o osint-m.o output.o \
+ prj.o prj-attr.o prj-attr-pm.o prj-com.o prj-dect.o prj-env.o prj-err.o prj-ext.o prj-nmsc.o \
+ prj-pars.o prj-part.o prj-proc.o prj-strt.o prj-tree.o prj-util.o \
+ rident.o s-exctab.o s-secsta.o s-stalib.o s-stoele.o \
+ scans.o scng.o sdefault.o sfn_scan.o s-purexc.o s-htable.o \
+ sinfo.o sinput.o sinput-c.o sinput-p.o \
+ snames.o stand.o stringt.o styleg.o stylesw.o system.o validsw.o switch.o switch-m.o \
+ table.o targparm.o tempdir.o tree_io.o types.o \
+ uintp.o uname.o urealp.o usage.o widechar.o \
+ $(EXTRA_GNATMAKE_OBJS)
+
+# Convert the target variable into a space separated list of architecture,
+# manufacturer, and operating system and assign each of those to its own
+# variable.
+
+host:=$(subst -, ,$(host_canonical))
+targ:=$(subst -, ,$(target))
+arch:=$(word 1,$(targ))
+ifeq ($(words $(targ)),2)
+ manu:=
+ osys:=$(word 2,$(targ))
+else
+ manu:=$(word 2,$(targ))
+ osys:=$(word 3,$(targ))
+endif
+
+# LIBGNAT_TARGET_PAIRS is a list of pairs of filenames.
+# The members of each pair must be separated by a '<' and no whitespace.
+# Each pair must be separated by some amount of whitespace from the following
+# pair.
+
+# Non-tasking case:
+
+LIBGNAT_TARGET_PAIRS = \
+a-intnam.ads<a-intnam-dummy.ads \
+s-inmaop.adb<s-inmaop-dummy.adb \
+s-intman.adb<s-intman-dummy.adb \
+s-osinte.ads<s-osinte-dummy.ads \
+s-osprim.adb<s-osprim-posix.adb \
+s-taprop.adb<s-taprop-dummy.adb \
+s-taspri.ads<s-taspri-dummy.ads
+
+# When using the GCC exception handling mechanism, we need to use an
+# alternate body for a-exexpr.adb (a-exexpr-gcc.adb)
+
+EH_MECHANISM=
+
+# Default shared object option. Note that we rely on the fact that the "soname"
+# option will always be present and last in this flag, so that we can have
+# $(SO_OPTS)libgnat-x.xx
+
+SO_OPTS = -Wl,-soname,
+
+# Default gnatlib-shared target.
+# By default, equivalent to gnatlib.
+# Set to gnatlib-shared-default, gnatlib-shared-dual, or a platform specific
+# target when supported.
+GNATLIB_SHARED = gnatlib
+
+# default value for gnatmake's target dependent file
+MLIB_TGT = mlib-tgt
+
+# By default, do not distribute prefix.o (in libgccprefix), since it is only
+# needed by external GNAT tools such as gnatdist and Glide.
+# Override this variable on native platforms when needed.
+PREFIX_OBJS =
+
+# To avoid duplicate code, use this variable to set PREFIX_OBJS when needed:
+PREFIX_REAL_OBJS = ../prefix.o \
+ ../../libiberty/concat.o \
+ ../../libiberty/xmalloc.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.
+# $(strip STRING) removes leading and trailing spaces from STRING.
+# If what's left is null then it's a match.
+
+ifeq ($(strip $(filter-out m68k% wrs vx%,$(targ))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-vxworks.ads \
+ a-numaux.ads<a-numaux-vxworks.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-interr.adb<s-interr-vxworks.adb \
+ s-intman.ads<s-intman-vxworks.ads \
+ s-intman.adb<s-intman-vxworks.adb \
+ s-osinte.adb<s-osinte-vxworks.adb \
+ s-osinte.ads<s-osinte-vxworks.ads \
+ s-osprim.adb<s-osprim-vxworks.adb \
+ s-parame.ads<s-parame-vxworks.ads \
+ s-parame.adb<s-parame-vxworks.adb \
+ s-stchop.ads<s-stchop-limit.ads \
+ s-stchop.adb<s-stchop-vxworks.adb \
+ s-taprop.adb<s-taprop-vxworks.adb \
+ s-taspri.ads<s-taspri-vxworks.ads \
+ s-tpopsp.adb<s-tpopsp-vxworks.adb \
+ s-vxwork.ads<s-vxwork-m68k.ads \
+ g-socthi.ads<g-socthi-vxworks.ads \
+ g-socthi.adb<g-socthi-vxworks.adb \
+ g-stsifd.adb<g-stsifd-sockets.adb \
+ g-sttsne.adb<g-sttsne-vxworks.adb \
+ g-sttsne.ads<g-sttsne-locking.ads \
+ system.ads<system-vxworks-m68k.ads
+
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
+
+ EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
+ EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
+
+ EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
+ EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
+
+ ifeq ($(strip $(filter-out yes,$(TRACE))),)
+ LIBGNAT_TARGET_PAIRS += \
+ s-traces.adb<s-traces-default.adb \
+ s-tratas.adb<s-tratas-default.adb \
+ s-trafor.adb<s-trafor-default.adb \
+ s-trafor.ads<s-trafor-default.ads \
+ s-tfsetr.adb<s-tfsetr-vxworks.adb
+ endif
+endif
+
+ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(targ))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-vxworks.ads \
+ a-numaux.ads<a-numaux-vxworks.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.ads<s-intman-vxworks.ads \
+ s-intman.adb<s-intman-vxworks.adb \
+ s-osprim.adb<s-osprim-vxworks.adb \
+ s-parame.ads<s-parame-vxworks.ads \
+ s-parame.adb<s-parame-vxworks.adb \
+ s-stchop.ads<s-stchop-limit.ads \
+ s-stchop.adb<s-stchop-vxworks.adb \
+ s-taprop.adb<s-taprop-vxworks.adb \
+ s-taspri.ads<s-taspri-vxworks.ads \
+ s-vxwork.ads<s-vxwork-ppc.ads \
+ g-socthi.ads<g-socthi-vxworks.ads \
+ g-socthi.adb<g-socthi-vxworks.adb \
+ g-stsifd.adb<g-stsifd-sockets.adb \
+ g-sttsne.adb<g-sttsne-vxworks.adb \
+ g-sttsne.ads<g-sttsne-locking.ads
+
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
+
+ ifeq ($(strip $(filter-out yes,$(TRACE))),)
+ LIBGNAT_TARGET_PAIRS += \
+ s-traces.adb<s-traces-default.adb \
+ s-trafor.adb<s-trafor-default.adb \
+ s-trafor.ads<s-trafor-default.ads \
+ s-tratas.adb<s-tratas-default.adb \
+ s-tfsetr.adb<s-tfsetr-vxworks.adb
+ endif
+
+ ifeq ($(strip $(filter-out rtp,$(THREAD_KIND))),)
+ LIBGNAT_TARGET_PAIRS += \
+ s-osinte.adb<s-osinte-vxworks-rtp.adb \
+ s-osinte.ads<s-osinte-vxworks6.ads \
+ s-tpopsp.adb<s-tpopsp-vxworks-rtp.adb \
+ system.ads<system-vxworks-ppc-rtp.ads
+
+ EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
+ else
+ LIBGNAT_TARGET_PAIRS += \
+ s-interr.adb<s-interr-vxworks.adb \
+ s-tpopsp.adb<s-tpopsp-vxworks.adb \
+ system.ads<system-vxworks-ppc.ads
+
+ ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),)
+ LIBGNAT_TARGET_PAIRS += \
+ s-osinte.ads<s-osinte-vxworks6.ads \
+ s-osinte.adb<s-osinte-vxworks-kernel.adb
+ else
+ LIBGNAT_TARGET_PAIRS += \
+ s-osinte.ads<s-osinte-vxworks.ads \
+ s-osinte.adb<s-osinte-vxworks.adb
+ endif
+
+ EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
+ endif
+
+ EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
+
+ EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
+ EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
+endif
+
+# vxworksae / vxworks 653
+ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(targ))),)
+ # target pairs for kernel + vthreads runtime
+ LIBGNAT_TARGET_PAIRS = \
+ a-elchha.adb<a-elchha-vxworks-ppc-full.adb \
+ a-intnam.ads<a-intnam-vxworks.ads \
+ a-numaux.ads<a-numaux-vxworks.ads \
+ g-io.adb<g-io-vxworks-ppc-cert.adb \
+ g-io.ads<g-io-vxworks-ppc-cert.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-interr.adb<s-interr-vxworks.adb \
+ s-intman.ads<s-intman-vxworks.ads \
+ s-intman.adb<s-intman-vxworks.adb \
+ s-osinte.adb<s-osinte-vxworks.adb \
+ s-osinte.ads<s-osinte-vxworks.ads \
+ s-osprim.adb<s-osprim-vxworks.adb \
+ s-parame.ads<s-parame-ae653.ads \
+ s-parame.adb<s-parame-vxworks.adb \
+ s-taprop.adb<s-taprop-vxworks.adb \
+ s-taspri.ads<s-taspri-vxworks.ads \
+ s-tpopsp.adb<s-tpopsp-vxworks.adb \
+ s-vxwork.ads<s-vxwork-ppc.ads \
+ g-socthi.ads<g-socthi-vxworks.ads \
+ g-socthi.adb<g-socthi-vxworks.adb \
+ g-stsifd.adb<g-stsifd-sockets.adb \
+ g-sttsne.adb<g-sttsne-vxworks.adb \
+ g-sttsne.ads<g-sttsne-locking.ads \
+ system.ads<system-vxworks-ppc-vthread.ads
+
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
+
+ EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
+ EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
+
+ # Extra pairs for the vthreads runtime
+ ifeq ($(strip $(filter-out vthreads,$(THREAD_KIND))),)
+ LIBGNAT_TARGET_PAIRS += \
+ s-thread.adb<s-thread-ae653.adb
+ EXTRA_GNATRTL_NONTASKING_OBJS += s-thread.o
+ endif
+
+ ifeq ($(strip $(filter-out yes,$(TRACE))),)
+ LIBGNAT_TARGET_PAIRS += \
+ s-traces.adb<s-traces-default.adb \
+ s-trafor.adb<s-trafor-default.adb \
+ s-trafor.ads<s-trafor-default.ads \
+ s-tratas.adb<s-tratas-default.adb \
+ s-tfsetr.adb<s-tfsetr-vxworks.adb
+ endif
+endif
+
+ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-vxworks.ads \
+ a-numaux.ads<a-numaux-vxworks.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-interr.adb<s-interr-vxworks.adb \
+ s-intman.ads<s-intman-vxworks.ads \
+ s-intman.adb<s-intman-vxworks.adb \
+ s-osinte.adb<s-osinte-vxworks.adb \
+ s-osinte.ads<s-osinte-vxworks.ads \
+ s-osprim.adb<s-osprim-vxworks.adb \
+ s-parame.ads<s-parame-vxworks.ads \
+ s-parame.adb<s-parame-vxworks.adb \
+ s-stchop.ads<s-stchop-limit.ads \
+ s-stchop.adb<s-stchop-vxworks.adb \
+ s-taprop.adb<s-taprop-vxworks.adb \
+ s-taspri.ads<s-taspri-vxworks.ads \
+ s-tpopsp.adb<s-tpopsp-vxworks.adb \
+ s-vxwork.ads<s-vxwork-sparcv9.ads \
+ g-socthi.ads<g-socthi-vxworks.ads \
+ g-socthi.adb<g-socthi-vxworks.adb \
+ g-stsifd.adb<g-stsifd-sockets.adb \
+ g-sttsne.adb<g-sttsne-vxworks.adb \
+ g-sttsne.ads<g-sttsne-locking.ads \
+ system.ads<system-vxworks-sparcv9.ads \
+
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
+
+ EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
+ EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
+
+ EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
+ EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
+endif
+
+ifeq ($(strip $(filter-out %86 wrs vxworks,$(targ))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-vxworks.ads \
+ i-vxwork.ads<i-vxwork-x86.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.ads<s-intman-vxworks.ads \
+ s-intman.adb<s-intman-vxworks.adb \
+ a-numaux.adb<a-numaux-x86.adb \
+ a-numaux.ads<a-numaux-x86.ads \
+ s-osprim.adb<s-osprim-vxworks.adb \
+ s-parame.ads<s-parame-vxworks.ads \
+ s-parame.adb<s-parame-vxworks.adb \
+ s-stchop.ads<s-stchop-limit.ads \
+ s-stchop.adb<s-stchop-vxworks.adb \
+ s-taprop.adb<s-taprop-vxworks.adb \
+ s-taspri.ads<s-taspri-vxworks.ads \
+ s-vxwork.ads<s-vxwork-x86.ads \
+ g-bytswa.adb<g-bytswa-x86.adb \
+ g-socthi.ads<g-socthi-vxworks.ads \
+ g-socthi.adb<g-socthi-vxworks.adb \
+ g-stsifd.adb<g-stsifd-sockets.adb \
+ g-sttsne.adb<g-sttsne-vxworks.adb \
+ g-sttsne.ads<g-sttsne-locking.ads
+
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
+
+ ifeq ($(strip $(filter-out yes,$(TRACE))),)
+ LIBGNAT_TARGET_PAIRS += \
+ s-traces.adb<s-traces-default.adb \
+ s-trafor.adb<s-trafor-default.adb \
+ s-trafor.ads<s-trafor-default.ads \
+ s-tratas.adb<s-tratas-default.adb \
+ s-tfsetr.adb<s-tfsetr-vxworks.adb
+ endif
+
+ ifeq ($(strip $(filter-out rtp,$(THREAD_KIND))),)
+ LIBGNAT_TARGET_PAIRS += \
+ s-osinte.adb<s-osinte-vxworks-rtp.adb \
+ s-osinte.ads<s-osinte-vxworks6.ads \
+ s-tpopsp.adb<s-tpopsp-vxworks-rtp.adb \
+ system.ads<system-vxworks-x86-rtp.ads
+
+ EXTRA_GNATRTL_NONTASKING_OBJS=s-vxwexc.o
+ else
+ LIBGNAT_TARGET_PAIRS += \
+ s-interr.adb<s-interr-vxworks.adb \
+ s-tpopsp.adb<s-tpopsp-vxworks.adb \
+ system.ads<system-vxworks-x86.ads
+
+ ifeq ($(strip $(filter-out kernel,$(THREAD_KIND))),)
+ LIBGNAT_TARGET_PAIRS += \
+ s-osinte.ads<s-osinte-vxworks6.ads \
+ s-osinte.adb<s-osinte-vxworks-kernel.adb
+ else
+ LIBGNAT_TARGET_PAIRS += \
+ s-osinte.ads<s-osinte-vxworks.ads \
+ s-osinte.adb<s-osinte-vxworks.adb
+ endif
+
+ EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o s-vxwexc.o
+ endif
+
+ EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
+
+ EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
+ EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
+endif
+
+ifeq ($(strip $(filter-out arm% coff wrs vx%,$(targ))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-vxworks.ads \
+ a-numaux.ads<a-numaux-vxworks.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-interr.adb<s-interr-vxworks.adb \
+ s-intman.ads<s-intman-vxworks.ads \
+ s-intman.adb<s-intman-vxworks.adb \
+ s-osinte.adb<s-osinte-vxworks.adb \
+ s-osinte.ads<s-osinte-vxworks.ads \
+ s-osprim.adb<s-osprim-vxworks.adb \
+ s-parame.ads<s-parame-vxworks.ads \
+ s-parame.adb<s-parame-vxworks.adb \
+ s-stchop.ads<s-stchop-limit.ads \
+ s-stchop.adb<s-stchop-vxworks.adb \
+ s-taprop.adb<s-taprop-vxworks.adb \
+ s-taspri.ads<s-taspri-vxworks.ads \
+ s-tpopsp.adb<s-tpopsp-vxworks.adb \
+ s-vxwork.ads<s-vxwork-arm.ads \
+ g-socthi.ads<g-socthi-vxworks.ads \
+ g-socthi.adb<g-socthi-vxworks.adb \
+ g-stsifd.adb<g-stsifd-sockets.adb \
+ g-sttsne.adb<g-sttsne-vxworks.adb \
+ g-sttsne.ads<g-sttsne-locking.ads \
+ system.ads<system-vxworks-arm.ads
+
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
+
+ EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
+ EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
+
+ EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
+ EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
+endif
+
+ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-vxworks.ads \
+ a-numaux.ads<a-numaux-vxworks.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-interr.adb<s-interr-vxworks.adb \
+ s-intman.ads<s-intman-vxworks.ads \
+ s-intman.adb<s-intman-vxworks.adb \
+ s-osinte.adb<s-osinte-vxworks.adb \
+ s-osinte.ads<s-osinte-vxworks.ads \
+ s-osprim.adb<s-osprim-vxworks.adb \
+ s-parame.ads<s-parame-vxworks.ads \
+ s-parame.adb<s-parame-vxworks.adb \
+ s-stchop.ads<s-stchop-limit.ads \
+ s-stchop.adb<s-stchop-vxworks.adb \
+ s-taprop.adb<s-taprop-vxworks.adb \
+ s-taspri.ads<s-taspri-vxworks.ads \
+ s-tpopsp.adb<s-tpopsp-vxworks.adb \
+ s-vxwork.ads<s-vxwork-mips.ads \
+ g-socthi.ads<g-socthi-vxworks.ads \
+ g-socthi.adb<g-socthi-vxworks.adb \
+ g-stsifd.adb<g-stsifd-sockets.adb \
+ g-sttsne.adb<g-sttsne-vxworks.adb \
+ g-sttsne.ads<g-sttsne-locking.ads \
+ system.ads<system-vxworks-mips.ads
+
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-vxworks.adb
+
+ EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
+ EXTRA_GNATRTL_TASKING_OBJS=s-vxwork.o
+
+ EXTRA_LIBGNAT_SRCS+=vx_stack_info.c
+ EXTRA_LIBGNAT_OBJS+=vx_stack_info.o
+endif
+
+ifeq ($(strip $(filter-out sparc% sun solaris%,$(targ))),)
+ LIBGNAT_TARGET_PAIRS_32 = \
+ a-intnam.ads<a-intnam-solaris.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-solaris.adb \
+ s-osinte.adb<s-osinte-solaris.adb \
+ s-osinte.ads<s-osinte-solaris.ads \
+ s-osprim.adb<s-osprim-solaris.adb \
+ s-taprop.adb<s-taprop-solaris.adb \
+ s-tasinf.adb<s-tasinf-solaris.adb \
+ s-tasinf.ads<s-tasinf-solaris.ads \
+ s-taspri.ads<s-taspri-solaris.ads \
+ s-tpopsp.adb<s-tpopsp-solaris.adb \
+ g-soliop.ads<g-soliop-solaris.ads \
+ system.ads<system-solaris-sparc.ads
+
+ LIBGNAT_TARGET_PAIRS_64 = \
+ a-intnam.ads<a-intnam-solaris.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-solaris.adb \
+ s-osinte.adb<s-osinte-solaris.adb \
+ s-osinte.ads<s-osinte-solaris.ads \
+ s-osprim.adb<s-osprim-solaris.adb \
+ s-taprop.adb<s-taprop-solaris.adb \
+ s-tasinf.adb<s-tasinf-solaris.adb \
+ s-tasinf.ads<s-tasinf-solaris.ads \
+ s-taspri.ads<s-taspri-solaris.ads \
+ s-tpopsp.adb<s-tpopsp-solaris.adb \
+ g-soliop.ads<g-soliop-solaris.ads \
+ system.ads<system-solaris-sparcv9.ads
+
+ ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
+ LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_32)
+ else
+ LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64)
+ endif
+
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-solaris.adb
+
+ EH_MECHANISM=-gcc
+ THREADSLIB = -lposix4 -lthread
+ MISCLIB = -lposix4 -lnsl -lsocket
+ SO_OPTS = -Wl,-h,
+ GNATLIB_SHARED = gnatlib-shared-dual
+ GMEM_LIB = gmemlib
+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
+
+ ifeq ($(strip $(filter-out pthread PTHREAD,$(THREAD_KIND))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-solaris.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-osinte.adb<s-osinte-posix.adb \
+ s-osinte.ads<s-osinte-solaris-posix.ads \
+ s-osprim.adb<s-osprim-solaris.adb \
+ s-taprop.adb<s-taprop-posix.adb \
+ s-taspri.ads<s-taspri-posix.ads \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ g-soliop.ads<g-soliop-solaris.ads \
+ system.ads<system-solaris-sparc.ads
+
+ THREADSLIB = -lposix4 -lpthread
+ endif
+
+ ifeq ($(strip $(filter-out m64,$(THREAD_KIND))),)
+ LIBGNAT_TARGET_PAIRS = $(LIBGNAT_TARGET_PAIRS_64)
+ endif
+endif
+
+ifeq ($(strip $(filter-out %86 solaris2%,$(arch) $(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-numaux.adb<a-numaux-x86.adb \
+ a-numaux.ads<a-numaux-x86.ads \
+ a-intnam.ads<a-intnam-solaris.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-solaris.adb \
+ s-osinte.adb<s-osinte-solaris.adb \
+ s-osinte.ads<s-osinte-solaris.ads \
+ s-osprim.adb<s-osprim-solaris.adb \
+ s-taprop.adb<s-taprop-solaris.adb \
+ s-tasinf.adb<s-tasinf-solaris.adb \
+ s-tasinf.ads<s-tasinf-solaris.ads \
+ s-taspri.ads<s-taspri-solaris.ads \
+ s-tpopsp.adb<s-tpopsp-solaris.adb \
+ g-bytswa.adb<g-bytswa-x86.adb \
+ g-soliop.ads<g-soliop-solaris.ads \
+ system.ads<system-solaris-x86.ads
+
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-solaris.adb
+
+ EH_MECHANISM=-gcc
+ THREADSLIB = -lposix4 -lthread
+ MISCLIB = -lposix4 -lnsl -lsocket
+ SO_OPTS = -Wl,-h,
+ GNATLIB_SHARED = gnatlib-shared-dual
+ GMEM_LIB = gmemlib
+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-linux.ads \
+ a-numaux.adb<a-numaux-x86.adb \
+ a-numaux.ads<a-numaux-x86.ads \
+ g-bytswa.adb<g-bytswa-x86.adb \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taspri.ads<s-taspri-posix.ads \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ g-sercom.adb<g-sercom-linux.adb \
+ system.ads<system-linux-x86.ads
+
+ ifeq ($(strip $(filter-out marte,$(THREAD_KIND))),)
+ LIBGNAT_TARGET_PAIRS += \
+ a-exetim.adb<a-exetim-linux-marte.adb \
+ a-exetim.ads<a-exetim-linux-marte.ads \
+ a-extiti.adb<a-extiti-linux-marte.adb \
+ a-extiti.ads<a-extiti-linux-marte.ads \
+ a-rttiev.adb<a-rttiev-linux-marte.adb \
+ a-rttiev.ads<a-rttiev-linux-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
+
+ EXTRA_GNATRTL_TASKING_OBJS=a-exetim.o a-extiti.o
+
+ EH_MECHANISM=
+ THREADSLIB = -lmarte
+ else
+ LIBGNAT_TARGET_PAIRS += \
+ s-linux.ads<s-linux.ads \
+ 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
+
+ THREADSLIB = -lpthread
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
+ endif
+
+ TOOLS_TARGET_PAIRS = \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
+ indepsw.adb<indepsw-gnu.adb
+
+ GNATLIB_SHARED = gnatlib-shared-dual
+ GMEM_LIB = gmemlib
+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+ifeq ($(strip $(filter-out %86 kfreebsd%,$(arch) $(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-freebsd.ads \
+ a-numaux.adb<a-numaux-x86.adb \
+ a-numaux.ads<a-numaux-x86.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-osinte.adb<s-osinte-posix.adb \
+ s-osinte.ads<s-osinte-kfreebsd-gnu.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-linux.adb \
+ s-tasinf.ads<s-tasinf-linux.ads \
+ s-tasinf.adb<s-tasinf-linux.adb \
+ s-taspri.ads<s-taspri-posix.ads \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ system.ads<system-freebsd-x86.ads
+
+ TOOLS_TARGET_PAIRS = \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
+ indepsw.adb<indepsw-gnu.adb
+
+ EH_MECHANISM=-gcc
+ THREADSLIB = -lpthread
+ GNATLIB_SHARED = gnatlib-shared-dual
+ GMEM_LIB = gmemlib
+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+ifeq ($(strip $(filter-out %86 freebsd%,$(arch) $(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-freebsd.ads \
+ a-numaux.adb<a-numaux-x86.adb \
+ a-numaux.ads<a-numaux-x86.ads \
+ g-bytswa.adb<g-bytswa-x86.adb \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-osinte.adb<s-osinte-freebsd.adb \
+ s-osinte.ads<s-osinte-freebsd.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-posix.adb \
+ s-taspri.ads<s-taspri-posix.ads \
+ s-tpopsp.adb<s-tpopsp-posix.adb \
+ system.ads<system-freebsd-x86.ads
+
+ TOOLS_TARGET_PAIRS = \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
+ GNATLIB_SHARED = gnatlib-shared-dual
+
+ EH_MECHANISM=-gcc
+ THREADSLIB= -lpthread
+ GMEM_LIB = gmemlib
+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+ifeq ($(strip $(filter-out s390% linux%,$(arch) $(osys))),)
+ ifeq ($(strip $(filter-out s390x,$(arch))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-linux.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux.ads \
+ s-osinte.adb<s-osinte-posix.adb \
+ s-osinte.ads<s-osinte-linux.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-linux.adb \
+ s-tasinf.ads<s-tasinf-linux.ads \
+ s-tasinf.adb<s-tasinf-linux.adb \
+ s-taspri.ads<s-taspri-posix-noaltstack.ads \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ system.ads<system-linux-s390x.ads
+ else
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-linux.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux.ads \
+ s-osinte.adb<s-osinte-posix.adb \
+ s-osinte.ads<s-osinte-linux.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-linux.adb \
+ s-tasinf.ads<s-tasinf-linux.ads \
+ s-tasinf.adb<s-tasinf-linux.adb \
+ s-taspri.ads<s-taspri-posix-noaltstack.ads \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ system.ads<system-linux-s390.ads
+ endif
+
+ TOOLS_TARGET_PAIRS = \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb
+
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
+ EH_MECHANISM=-gcc
+ THREADSLIB = -lpthread
+ GNATLIB_SHARED = gnatlib-shared-dual
+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+ifeq ($(strip $(filter-out mips sgi irix%,$(targ))),)
+ ifeq ($(strip $(filter-out mips sgi irix6%,$(targ))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-irix.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-irix.adb \
+ s-mastop.adb<s-mastop-irix.adb \
+ s-osinte.adb<s-osinte-irix.adb \
+ s-osinte.ads<s-osinte-irix.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-proinf.adb<s-proinf-irix-athread.adb \
+ s-proinf.ads<s-proinf-irix-athread.ads \
+ s-taprop.adb<s-taprop-irix.adb \
+ s-tasinf.ads<s-tasinf-irix.ads \
+ s-taspri.ads<s-taspri-posix.ads \
+ s-tpopsp.adb<s-tpopsp-posix.adb \
+ s-traceb.adb<s-traceb-mastop.adb \
+ system.ads<system-irix-n32.ads
+
+ THREADSLIB = -lpthread
+ GNATLIB_SHARED = gnatlib-shared-default
+
+ else
+ LIBGNAT_TARGET_PAIRS += \
+ s-mastop.adb<s-mastop-irix.adb \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-traceb.adb<s-traceb-mastop.adb \
+ system.ads<system-irix-o32.ads
+ endif
+
+ EH_MECHANISM=-gcc
+ TOOLS_TARGET_PAIRS = mlib-tgt-specific.adb<mlib-tgt-specific-irix.adb
+ TGT_LIB = -lexc
+ MISCLIB = -lexc
+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
+ GMEM_LIB = gmemlib
+endif
+
+ifeq ($(strip $(filter-out hppa% hp hpux10%,$(targ))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-excpol.adb<a-excpol-abort.adb \
+ a-intnam.ads<a-intnam-hpux.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-interr.adb<s-interr-sigaction.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-osinte.adb<s-osinte-hpux-dce.adb \
+ s-osinte.ads<s-osinte-hpux-dce.ads \
+ s-parame.ads<s-parame-hpux.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-hpux-dce.adb \
+ s-taspri.ads<s-taspri-hpux-dce.ads \
+ s-tpopsp.adb<s-tpopsp-posix.adb \
+ system.ads<system-hpux.ads
+
+ EH_MECHANISM=-gcc
+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+endif
+
+ifeq ($(strip $(filter-out hppa% hp hpux11%,$(targ))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-hpux.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-osinte.adb<s-osinte-posix.adb \
+ s-osinte.ads<s-osinte-hpux.ads \
+ s-parame.ads<s-parame-hpux.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-traceb.adb<s-traceb-hpux.adb \
+ s-taprop.adb<s-taprop-posix.adb \
+ s-taspri.ads<s-taspri-posix.ads \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ system.ads<system-hpux.ads
+
+ TOOLS_TARGET_PAIRS = mlib-tgt-specific.adb<mlib-tgt-specific-hpux.adb
+ EH_MECHANISM=-gcc
+ TGT_LIB = /usr/lib/libcl.a
+ THREADSLIB = -lpthread
+ GMEM_LIB = gmemlib
+ soext = .sl
+ SO_OPTS = -Wl,+h,
+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+ GNATLIB_SHARED = gnatlib-shared-dual
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+ifeq ($(strip $(filter-out ibm aix%,$(manu) $(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-aix.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-osinte.adb<s-osinte-aix.adb \
+ s-osinte.ads<s-osinte-aix.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-posix.adb \
+ s-taspri.ads<s-taspri-posix.ads \
+ s-tpopsp.adb<s-tpopsp-posix.adb \
+ system.ads<system-aix.ads
+
+ THREADSLIB = -lpthreads
+ PREFIX_OBJS=$(PREFIX_REAL_OBJS)
+
+ TOOLS_TARGET_PAIRS = \
+ mlib-tgt-specific.adb<mlib-tgt-specific-aix.adb \
+ indepsw.adb<indepsw-aix.adb
+
+ GMEM_LIB = gmemlib
+endif
+
+ifeq ($(strip $(filter-out lynxos,$(osys))),)
+ TOOLS_TARGET_PAIRS = \
+ mlib-tgt-specific.adb<mlib-tgt-specific-lynxos.adb \
+ indepsw.adb<indepsw-gnu.adb
+
+ ifeq ($(strip $(filter-out %86 lynxos,$(arch) $(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-numaux.adb<a-numaux-x86.adb \
+ a-numaux.ads<a-numaux-x86.ads \
+ a-intnam.ads<a-intnam-lynxos.ads \
+ g-bytswa.adb<g-bytswa-x86.adb \
+ g-sttsne.adb<g-sttsne-locking.adb \
+ g-sttsne.ads<g-sttsne-locking.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-osinte.adb<s-osinte-lynxos.adb \
+ s-osinte.ads<s-osinte-lynxos.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-lynxos.adb \
+ s-taspri.ads<s-taspri-lynxos.ads \
+ s-tpopsp.adb<s-tpopsp-lynxos.adb \
+ system.ads<system-lynxos-x86.ads
+
+ PREFIX_OBJS=$(PREFIX_REAL_OBJS)
+
+ else
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-lynxos.ads \
+ g-sttsne.adb<g-sttsne-locking.adb \
+ g-sttsne.ads<g-sttsne-locking.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-osinte.adb<s-osinte-lynxos.adb \
+ s-osinte.ads<s-osinte-lynxos.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-lynxos.adb \
+ s-taspri.ads<s-taspri-lynxos.ads \
+ s-tpopsp.adb<s-tpopsp-lynxos.adb \
+ system.ads<system-lynxos-ppc.ads
+ endif
+endif
+
+ifeq ($(strip $(filter-out rtems%,$(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ system.ads<system-rtems.ads \
+ a-intnam.ads<a-intnam-rtems.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-osinte.adb<s-osinte-rtems.adb \
+ s-osinte.ads<s-osinte-rtems.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-parame.adb<s-parame-rtems.adb \
+ s-taprop.adb<s-taprop-posix.adb \
+ s-taspri.ads<s-taspri-posix.ads \
+ s-tpopsp.adb<s-tpopsp-rtems.adb \
+ s-stchop.adb<s-stchop-rtems.adb
+endif
+
+ifeq ($(strip $(filter-out alpha% dec osf%,$(targ))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-tru64.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-mastop.adb<s-mastop-tru64.adb \
+ s-osinte.adb<s-osinte-tru64.adb \
+ s-osinte.ads<s-osinte-tru64.ads \
+ s-osprim.adb<s-osprim-unix.adb \
+ s-taprop.adb<s-taprop-tru64.adb \
+ s-tasinf.ads<s-tasinf-tru64.ads \
+ s-taspri.ads<s-taspri-tru64.ads \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ s-traceb.adb<s-traceb-mastop.adb \
+ system.ads<system-tru64.ads
+
+ TOOLS_TARGET_PAIRS=mlib-tgt-specific.adb<mlib-tgt-specific-tru64.adb
+
+ EH_MECHANISM=-gcc
+ GMEM_LIB=gmemlib
+ THREADSLIB = -lpthread -lmach -lexc -lrt
+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+ GNATLIB_SHARED = gnatlib-shared-default
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(host))),)
+
+soext = .exe
+hyphen = _
+LN = cp -p
+LN_S = cp -p
+
+.SUFFIXES: .sym
+
+.o.sym:
+ @ gnu:[bin]vmssymvec $<
+endif
+
+ifeq ($(strip $(filter-out alpha64 ia64 dec hp vms% openvms% alphavms%,$(targ))),)
+ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
+ LIBGNAT_TARGET_PAIRS_AUX1 = \
+ g-enblsp.adb<g-enblsp-vms-ia64.adb \
+ g-trasym.adb<g-trasym-vms-ia64.adb \
+ s-asthan.adb<s-asthan-vms-ia64.adb \
+ s-osinte.adb<s-osinte-vms-ia64.adb \
+ s-osinte.ads<s-osinte-vms-ia64.ads \
+ s-vaflop.adb<s-vaflop-vms-ia64.adb \
+ system.ads<system-vms-ia64.ads
+
+ LIBGNAT_TARGET_PAIRS_AUX2 = \
+ s-parame.ads<s-parame-vms-ia64.ads
+else
+ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
+ LIBGNAT_TARGET_PAIRS_AUX1 = \
+ g-enblsp.adb<g-enblsp-vms-alpha.adb \
+ g-trasym.adb<g-trasym-vms-alpha.adb \
+ s-traent.adb<s-traent-vms.adb \
+ s-traent.ads<s-traent-vms.ads \
+ s-asthan.adb<s-asthan-vms-alpha.adb \
+ s-osinte.adb<s-osinte-vms.adb \
+ s-osinte.ads<s-osinte-vms.ads \
+ s-vaflop.adb<s-vaflop-vms-alpha.adb \
+ system.ads<system-vms_64.ads
+
+ifeq ($(strip $(filter-out express EXPRESS,$(THREAD_KIND))),)
+ LIBGNAT_TARGET_PAIRS_AUX2 = \
+ s-parame.ads<s-parame-vms-restrict.ads
+else
+ LIBGNAT_TARGET_PAIRS_AUX2 = \
+ s-parame.ads<s-parame-vms-alpha.ads
+endif
+endif
+endif
+
+ LIBGNAT_TARGET_PAIRS = \
+ a-caldel.adb<a-caldel-vms.adb \
+ a-calend.adb<a-calend-vms.adb \
+ a-calend.ads<a-calend-vms.ads \
+ a-dirval.adb<a-dirval-vms.adb \
+ a-excpol.adb<a-excpol-abort.adb \
+ a-intnam.ads<a-intnam-vms.ads \
+ a-numaux.ads<a-numaux-vms.ads \
+ g-expect.adb<g-expect-vms.adb \
+ g-socthi.ads<g-socthi-vms.ads \
+ g-socthi.adb<g-socthi-vms.adb \
+ g-stsifd.adb<g-stsifd-sockets.adb \
+ g-sttsne.adb<g-sttsne-locking.adb \
+ g-sttsne.ads<g-sttsne-locking.ads \
+ i-c.ads<i-c-vms_64.ads \
+ i-cstrin.ads<i-cstrin-vms_64.ads \
+ i-cstrin.adb<i-cstrin-vms_64.adb \
+ i-cpoint.ads<i-cpoint-vms_64.ads \
+ i-cpoint.adb<i-cpoint-vms_64.adb \
+ i-cstrea.adb<i-cstrea-vms.adb \
+ memtrack.adb<memtrack-vms_64.adb \
+ s-auxdec.ads<s-auxdec-vms_64.ads \
+ s-crtl.ads<s-crtl-vms_64.ads \
+ s-inmaop.adb<s-inmaop-vms.adb \
+ s-interr.adb<s-interr-vms.adb \
+ s-intman.adb<s-intman-vms.adb \
+ s-intman.ads<s-intman-vms.ads \
+ s-memory.adb<s-memory-vms_64.adb \
+ s-memory.ads<s-memory-vms_64.ads \
+ s-osprim.adb<s-osprim-vms.adb \
+ s-osprim.ads<s-osprim-vms.ads \
+ s-taprop.adb<s-taprop-vms.adb \
+ s-taspri.ads<s-taspri-vms.ads \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ s-tpopde.adb<s-tpopde-vms.adb \
+ s-tpopde.ads<s-tpopde-vms.ads \
+ $(LIBGNAT_TARGET_PAIRS_AUX1) \
+ $(LIBGNAT_TARGET_PAIRS_AUX2)
+
+ifeq ($(strip $(filter-out ia64 hp vms% openvms%,$(targ))),)
+ TOOLS_TARGET_PAIRS= \
+ mlib-tgt-specific.adb<mlib-tgt-specific-vms-ia64.adb \
+ symbols.adb<symbols-vms.adb \
+ symbols-processing.adb<symbols-processing-vms-ia64.adb
+else
+ TOOLS_TARGET_PAIRS= \
+ mlib-tgt-specific.adb<mlib-tgt-specific-vms-alpha.adb \
+ symbols.adb<symbols-vms.adb \
+ symbols-processing.adb<symbols-processing-vms-alpha.adb
+endif
+
+adamsg.o: adamsg.msg
+ -$(DECC) --cc=message adamsg.msg -o adamsg.o
+
+ EXTRA_GNATMAKE_OBJS = mlib-tgt-vms_common.o
+
+ GMEM_LIB = gmemlib
+ EH_MECHANISM=-gcc
+ GNATLIB_SHARED=gnatlib-shared-vms
+ifeq ($(strip $(filter-out alpha64 dec vms% openvms% alphavms%,$(targ))),)
+ EXTRA_LIBGNAT_SRCS=vmshandler.asm
+ EXTRA_LIBGNAT_OBJS=vmshandler.o
+endif
+ EXTRA_LIBGNAT_SRCS+=adamsg.msg
+ EXTRA_LIBGNAT_OBJS+=adamsg.o
+ EXTRA_GNATRTL_TASKING_OBJS=s-tpopde.o
+ EXTRA_GNATTOOLS = \
+ ../../gnatlbr$(exeext) \
+ ../../gnatsym$(exeext) \
+ ../../vms_help$(exeext) \
+ ../../gnat.hlp
+ # This command transforms (YYYYMMDD) into YY,MMDD
+ GSMATCH_VERSION := $(shell grep "^ *Gnat_Static_Version_String" $(fsrcpfx)gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\).*/\2,\3/')
+ TOOLS_LIBS_LO := --for-linker=sys\\$$\$$library:trace.exe
+ LIBRARY_VERSION := $(subst .,_,$(LIB_VERSION))
+endif
+
+ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-dirval.adb<a-dirval-mingw.adb \
+ a-excpol.adb<a-excpol-abort.adb \
+ a-numaux.adb<a-numaux-x86.adb \
+ a-numaux.ads<a-numaux-x86.ads \
+ s-gloloc.adb<s-gloloc-mingw.adb \
+ s-inmaop.adb<s-inmaop-dummy.adb \
+ s-memory.adb<s-memory-mingw.adb \
+ s-taspri.ads<s-taspri-mingw.ads \
+ s-tasinf.adb<s-tasinf-mingw.adb \
+ s-tasinf.ads<s-tasinf-mingw.ads \
+ g-bytswa.adb<g-bytswa-x86.adb \
+ g-socthi.ads<g-socthi-mingw.ads \
+ g-socthi.adb<g-socthi-mingw.adb \
+ g-stsifd.adb<g-stsifd-sockets.adb \
+ g-soliop.ads<g-soliop-mingw.ads
+
+ ifeq ($(strip $(filter-out rtx_w32 rtx_rtss,$(THREAD_KIND))),)
+ LIBGNAT_TARGET_PAIRS += \
+ s-intman.adb<s-intman-dummy.adb \
+ s-osinte.ads<s-osinte-rtx.ads \
+ s-osprim.adb<s-osprim-rtx.adb \
+ s-taprop.adb<s-taprop-rtx.adb
+
+ EXTRA_GNATRTL_NONTASKING_OBJS = s-win32.o
+
+ ifeq ($(strip $(filter-out rtx_w32,$(THREAD_KIND))),)
+ LIBGNAT_TARGET_PAIRS += system.ads<system-rtx.ads
+
+ EH_MECHANISM=-gcc
+ else
+ LIBGNAT_TARGET_PAIRS += \
+ system.ads<system-rtx-rtss.ads \
+ s-parame.adb<s-parame-vxworks.adb
+
+ EH_MECHANISM=
+ endif
+
+ else
+ LIBGNAT_TARGET_PAIRS += \
+ a-exetim.adb<a-exetim-mingw.adb \
+ a-exetim.ads<a-exetim-mingw.ads \
+ a-intnam.ads<a-intnam-mingw.ads \
+ g-sercom.adb<g-sercom-mingw.adb \
+ s-interr.adb<s-interr-sigaction.adb \
+ 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
+
+ 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
+
+ MISCLIB = -lwsock32
+
+ # ??? This will be replaced by gnatlib-shared-dual-win32 when GNAT
+ # auto-import support for array/record will be done.
+ GNATLIB_SHARED = gnatlib-shared-win32
+
+ EH_MECHANISM=-gcc
+ endif
+
+ TOOLS_TARGET_PAIRS= \
+ mlib-tgt-specific.adb<mlib-tgt-specific-mingw.adb \
+ indepsw.adb<indepsw-mingw.adb
+
+ GMEM_LIB = gmemlib
+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+ EXTRA_GNATTOOLS = ../../gnatdll$(exeext)
+ EXTRA_GNATMAKE_OBJS = mdll.o mdll-utl.o mdll-fil.o
+ soext = .dll
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+ifeq ($(strip $(filter-out mips linux%,$(arch) $(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-linux.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux.ads \
+ s-osinte.adb<s-osinte-posix.adb \
+ s-osinte.ads<s-osinte-linux.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-linux.adb \
+ s-tasinf.ads<s-tasinf-linux.ads \
+ s-tasinf.adb<s-tasinf-linux.adb \
+ s-taspri.ads<s-taspri-posix.ads \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ system.ads<system-linux-mips.ads
+
+ EH_MECHANISM=-gcc
+ THREADSLIB = -lpthread
+ GNATLIB_SHARED = gnatlib-shared-dual
+ GMEM_LIB = gmemlib
+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+ifeq ($(strip $(filter-out mipsel linux%,$(arch) $(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-linux.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux.ads \
+ s-osinte.adb<s-osinte-posix.adb \
+ s-osinte.ads<s-osinte-linux.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-linux.adb \
+ s-tasinf.ads<s-tasinf-linux.ads \
+ s-tasinf.adb<s-tasinf-linux.adb \
+ s-taspri.ads<s-taspri-posix.ads \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ system.ads<system-linux-mipsel.ads
+
+ EH_MECHANISM=-gcc
+ THREADSLIB = -lpthread
+ GNATLIB_SHARED = gnatlib-shared-dual
+ GMEM_LIB = gmemlib
+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+ifeq ($(strip $(filter-out powerpc% linux%,$(arch) $(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-linux.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux.ads \
+ s-osinte.adb<s-osinte-posix.adb \
+ s-osinte.ads<s-osinte-linux.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-linux.adb \
+ s-tasinf.ads<s-tasinf-linux.ads \
+ s-tasinf.adb<s-tasinf-linux.adb \
+ s-taspri.ads<s-taspri-posix-noaltstack.ads \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ g-sercom.adb<g-sercom-linux.adb \
+ system.ads<system-linux-ppc.ads
+
+ TOOLS_TARGET_PAIRS = \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
+ indepsw.adb<indepsw-gnu.adb
+
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
+ EH_MECHANISM=-gcc
+ THREADSLIB = -lpthread
+ GNATLIB_SHARED = gnatlib-shared-dual
+ GMEM_LIB = gmemlib
+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+ifeq ($(strip $(filter-out sparc% linux%,$(arch) $(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-linux.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux.ads \
+ s-osinte.adb<s-osinte-posix.adb \
+ s-osinte.ads<s-osinte-linux.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-linux.adb \
+ s-tasinf.ads<s-tasinf-linux.ads \
+ s-tasinf.adb<s-tasinf-linux.adb \
+ s-taspri.ads<s-taspri-posix-noaltstack.ads \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ system.ads<system-linux-sparc.ads
+
+ TOOLS_TARGET_PAIRS = \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
+ indepsw.adb<indepsw-gnu.adb
+
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
+ EH_MECHANISM=-gcc
+ THREADSLIB = -lpthread
+ GNATLIB_SHARED = gnatlib-shared-dual
+ GMEM_LIB = gmemlib
+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+ifeq ($(strip $(filter-out hppa% linux%,$(arch) $(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-linux.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux-hppa.ads \
+ s-osinte.adb<s-osinte-posix.adb \
+ s-osinte.ads<s-osinte-linux.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-linux.adb \
+ s-tasinf.ads<s-tasinf-linux.ads \
+ s-tasinf.adb<s-tasinf-linux.adb \
+ s-taspri.ads<s-taspri-posix-noaltstack.ads \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ system.ads<system-linux-hppa.ads
+
+ TOOLS_TARGET_PAIRS = \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
+ indepsw.adb<indepsw-gnu.adb
+
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
+ EH_MECHANISM=-gcc
+ THREADSLIB = -lpthread
+ GNATLIB_SHARED = gnatlib-shared-dual
+ GMEM_LIB = gmemlib
+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+ifeq ($(strip $(filter-out sh4% linux%,$(arch) $(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-linux.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux.ads \
+ s-osinte.adb<s-osinte-posix.adb \
+ s-osinte.ads<s-osinte-linux.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-linux.adb \
+ s-tasinf.ads<s-tasinf-linux.ads \
+ s-tasinf.adb<s-tasinf-linux.adb \
+ s-taspri.ads<s-taspri-posix-noaltstack.ads \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ system.ads<system-linux-sh4.ads
+
+ TOOLS_TARGET_PAIRS = \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
+ indepsw.adb<indepsw-linux.adb
+
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
+ EH_MECHANISM=-gcc
+ MISCLIB=
+ THREADSLIB = -lpthread
+ GNATLIB_SHARED = gnatlib-shared-dual
+ GMEM_LIB = gmemlib
+ PREFIX_OBJS = $(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+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 \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux.ads \
+ s-osinte.ads<s-osinte-linux.ads \
+ s-osinte.adb<s-osinte-posix.adb \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-linux.adb \
+ s-tasinf.ads<s-tasinf-linux.ads \
+ s-tasinf.adb<s-tasinf-linux.adb \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ s-taspri.ads<s-taspri-posix-noaltstack.ads \
+ g-sercom.adb<g-sercom-linux.adb \
+ system.ads<system-linux-ia64.ads
+
+ TOOLS_TARGET_PAIRS = \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
+ indepsw.adb<indepsw-gnu.adb
+
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
+ EH_MECHANISM=-gcc
+ MISCLIB=
+ THREADSLIB=-lpthread
+ GNATLIB_SHARED=gnatlib-shared-dual
+ GMEM_LIB = gmemlib
+ PREFIX_OBJS=$(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+ifeq ($(strip $(filter-out alpha% linux%,$(arch) $(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-linux.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux-alpha.ads \
+ s-osinte.ads<s-osinte-linux.ads \
+ s-osinte.adb<s-osinte-posix.adb \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-linux.adb \
+ s-tasinf.ads<s-tasinf-linux.ads \
+ s-tasinf.adb<s-tasinf-linux.adb \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ s-taspri.ads<s-taspri-posix-noaltstack.ads \
+ system.ads<system-linux-alpha.ads
+
+ TOOLS_TARGET_PAIRS = \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
+ indepsw.adb<indepsw-gnu.adb
+
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
+ EH_MECHANISM=-gcc
+ MISCLIB=
+ THREADSLIB=-lpthread
+ GNATLIB_SHARED=gnatlib-shared-dual
+ PREFIX_OBJS=$(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-linux.ads \
+ a-numaux.adb<a-numaux-x86.adb \
+ a-numaux.ads<a-numaux-x86.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-linux.ads<s-linux.ads \
+ s-osinte.ads<s-osinte-linux.ads \
+ s-osinte.adb<s-osinte-posix.adb \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-linux.adb \
+ s-tasinf.ads<s-tasinf-linux.ads \
+ s-tasinf.adb<s-tasinf-linux.adb \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ s-taspri.ads<s-taspri-posix.ads \
+ g-sercom.adb<g-sercom-linux.adb \
+ system.ads<system-linux-x86_64.ads
+
+ TOOLS_TARGET_PAIRS = \
+ mlib-tgt-specific.adb<mlib-tgt-specific-linux.adb \
+ indepsw.adb<indepsw-gnu.adb
+
+ EXTRA_GNATRTL_TASKING_OBJS=s-linux.o
+ EH_MECHANISM=-gcc
+ THREADSLIB=-lpthread
+ GNATLIB_SHARED=gnatlib-shared-dual
+ GMEM_LIB = gmemlib
+ PREFIX_OBJS=$(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+ifeq ($(strip $(filter-out darwin%,$(osys))),)
+ ifeq ($(strip $(filter-out %86,$(arch))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-darwin.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-osinte.adb<s-osinte-darwin.adb \
+ s-osinte.ads<s-osinte-darwin.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-posix.adb \
+ s-taspri.ads<s-taspri-posix.ads \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ a-numaux.ads<a-numaux-x86.ads \
+ a-numaux.adb<a-numaux-x86.adb \
+ system.ads<system-darwin-x86.ads
+ else
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<a-intnam-darwin.ads \
+ s-inmaop.adb<s-inmaop-posix.adb \
+ s-intman.adb<s-intman-posix.adb \
+ s-osinte.adb<s-osinte-darwin.adb \
+ s-osinte.ads<s-osinte-darwin.ads \
+ s-osprim.adb<s-osprim-posix.adb \
+ s-taprop.adb<s-taprop-posix.adb \
+ s-taspri.ads<s-taspri-posix.ads \
+ s-tpopsp.adb<s-tpopsp-posix-foreign.adb \
+ a-numaux.ads<a-numaux-darwin.ads \
+ a-numaux.adb<a-numaux-darwin.adb \
+ system.ads<system-darwin-ppc.ads
+ endif
+
+ TOOLS_TARGET_PAIRS = \
+ mlib-tgt-specific.adb<mlib-tgt-specific-darwin.adb
+
+ EH_MECHANISM=-gcc
+ GNATLIB_SHARED = gnatlib-shared-darwin
+ SO_OPTS = -Wl,-flat_namespace -shared-libgcc
+ RANLIB = ranlib -c
+ GMEM_LIB = gmemlib
+ PREFIX_OBJS=$(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
+ soext = .dylib
+endif
+
+ifneq ($(EH_MECHANISM),)
+ LIBGNAT_TARGET_PAIRS += a-exexpr.adb<a-exexpr$(EH_MECHANISM).adb
+ EXTRA_LIBGNAT_SRCS+=raise$(EH_MECHANISM).c
+ EXTRA_LIBGNAT_OBJS+=raise$(EH_MECHANISM).o
+endif
+
+# Use the Ada 2005 version of Ada.Exceptions by default, unless specified
+# explicitly already. The base files (a-except.ad?) are used only for building
+# the compiler and other basic tools.
+# These base versions lack Ada 2005 additions which would cause bootstrap
+# problems if included in the compiler and other basic tools.
+
+ifeq ($(filter-out a-except%,$(LIBGNAT_TARGET_PAIRS)),$(LIBGNAT_TARGET_PAIRS))
+ LIBGNAT_TARGET_PAIRS += \
+ a-except.ads<a-except-2005.ads \
+ a-except.adb<a-except-2005.adb
+endif
+
+# The runtime library for gnat comprises two directories. One contains the
+# Ada source files that the compiler (gnat1) needs -- these files are listed
+# by ADA_INCLUDE_SRCS -- and the other contains the object files and their
+# corresponding .ali files for the parts written in Ada, libgnat.a for
+# the parts of the runtime written in C, and libgthreads.a for the pthreads
+# emulation library. LIBGNAT_OBJS lists the objects that go into libgnat.a,
+# while GNATRTL_OBJS lists the object files compiled from Ada sources that
+# go into the directory. The pthreads emulation is built in the threads
+# subdirectory and copied.
+LIBGNAT_SRCS = adaint.c adaint.h argv.c cio.c cstreams.c \
+ errno.c exit.c cal.c ctrl_c.c env.c env.h arit64.c \
+ raise.h raise.c sysdep.c aux-io.c init.c initialize.c seh_init.c \
+ final.c tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c expect.c mkdir.c \
+ socket.c gsocket.h targext.c $(EXTRA_LIBGNAT_SRCS)
+
+LIBGNAT_OBJS = adaint.o argv.o cio.o cstreams.o ctrl_c.o errno.o exit.o env.o \
+ raise.o sysdep.o aux-io.o init.o initialize.o seh_init.o cal.o arit64.o \
+ final.o tracebak.o expect.o mkdir.o socket.o targext.o $(EXTRA_LIBGNAT_OBJS)
+
+# NOTE ??? - when the -I option for compiling Ada code is made to work,
+# the library installation will change and there will be a
+# GNAT_RTL_SRCS. Right now we count on being able to build GNATRTL_OBJS
+# from ADA_INCLUDE_SRCS.
+
+# GNATRTL_NONTASKING_OBJS and GNATRTL_TASKING_OBJS can be found in
+# the following include file:
+
+include $(fsrcdir)/Makefile.rtl
+
+GNATRTL_LINEARALGEBRA_OBJS = a-nlcoar.o a-nllcar.o a-nllrar.o a-nlrear.o \
+ a-nucoar.o a-nurear.o i-forbla.o i-forlap.o s-gearop.o
+
+GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) \
+ $(GNATRTL_LINEARALGEBRA_OBJS) g-trasym.o memtrack.o
+
+# Default run time files
+
+ADA_INCLUDE_SRCS =\
+ ada.ads calendar.ads directio.ads gnat.ads interfac.ads ioexcept.ads \
+ machcode.ads text_io.ads unchconv.ads unchdeal.ads \
+ sequenio.ads system.ads memtrack.adb \
+ a-[a-o]*.adb a-[p-z]*.adb a-[a-o]*.ads a-[p-z]*.ads g-*.ad? i-*.ad? \
+ s-[a-o]*.adb s-[p-z]*.adb s-[a-o]*.ads s-[p-z]*.ads
+
+LIBGNAT=../$(RTSDIR)/libgnat.a
+
+GCC_LINK=$(CC) -static-libgcc $(ADA_INCLUDES)
+
+# when compiling the tools, the runtime has to be first on the path so that
+# it hides the runtime files lying with the rest of the sources
+ifeq ($(TOOLSCASE),native)
+ vpath %.ads ../$(RTSDIR) ../
+ vpath %.adb ../$(RTSDIR) ../
+ vpath %.c ../$(RTSDIR) ../
+ vpath %.h ../$(RTSDIR) ../
+endif
+
+# in the cross tools case, everything is compiled with the native
+# gnatmake/link. Therefore only -I needs to be modified in ADA_INCLUDES
+ifeq ($(TOOLSCASE),cross)
+ vpath %.ads ../
+ vpath %.adb ../
+ vpath %.c ../
+ vpath %.h ../
+endif
+
+common-tools:
+ $(GNATMAKE) -c -b $(ADA_INCLUDES) \
+ --GNATBIND="$(GNATBIND)" --GCC="$(CC) $(ALL_ADAFLAGS)" \
+ gnatchop gnatcmd gnatkr gnatls gnatprep gnatxref gnatfind gnatname \
+ gnatclean -bargs $(ADA_INCLUDES) $(GNATBIND_FLAGS)
+ $(GNATLINK) -v gnatcmd -o ../../gnat$(exeext) \
+ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatchop -o ../../gnatchop$(exeext) \
+ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatkr -o ../../gnatkr$(exeext) \
+ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatls -o ../../gnatls$(exeext) \
+ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatprep -o ../../gnatprep$(exeext) \
+ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatxref -o ../../gnatxref$(exeext) \
+ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatfind -o ../../gnatfind$(exeext) \
+ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatname -o ../../gnatname$(exeext) \
+ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ $(GNATLINK) -v gnatclean -o ../../gnatclean$(exeext) \
+ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+
+../../gnatsym$(exeext):
+ $(GNATMAKE) -c $(ADA_INCLUDES) gnatsym --GCC="$(CC) $(ALL_ADAFLAGS)"
+ $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatsym
+ $(GNATLINK) -v gnatsym -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+
+../../gnatdll$(exeext):
+ $(GNATMAKE) -c $(ADA_INCLUDES) gnatdll --GCC="$(CC) $(ALL_ADAFLAGS)"
+ $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatdll
+ $(GNATLINK) -v gnatdll -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+
+../../vxaddr2line$(exeext): targext.o
+ $(GNATMAKE) -c $(ADA_INCLUDES) vxaddr2line --GCC="$(CC) $(ALL_ADAFLAGS)"
+ $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vxaddr2line
+ $(GNATLINK) -v vxaddr2line -o $@ --GCC="$(GCC_LINK)" targext.o $(CLIB)
+
+gnatmake-re: link.o targext.o
+ $(GNATMAKE) $(ADA_INCLUDES) -u sdefault --GCC="$(CC) $(MOST_ADA_FLAGS)"
+ $(GNATMAKE) -c $(ADA_INCLUDES) gnatmake --GCC="$(CC) $(ALL_ADAFLAGS)"
+ $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake
+ $(GNATLINK) -v gnatmake -o ../../gnatmake$(exeext) \
+ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+
+# Note the use of the "mv" command in order to allow gnatlink to be linked with
+# with the former version of gnatlink itself which cannot override itself.
+gnatlink-re: link.o targext.o
+ $(GNATMAKE) -c $(ADA_INCLUDES) gnatlink --GCC="$(CC) $(ALL_ADAFLAGS)"
+ $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink
+ $(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
+ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+ $(MV) ../../gnatlinknew$(exeext) ../../gnatlink$(exeext)
+
+# Needs to be built with CC=gcc
+# Since the RTL should be built with the latest compiler, remove the
+# stamp target in the parent directory whenever gnat1 is rebuilt
+
+# Likewise for the tools
+../../gnatmake$(exeext): $(P) b_gnatm.o link.o targext.o $(GNATMAKE_OBJS)
+ $(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) \
+ $(TOOLS_LIBS)
+
+../../gnatlink$(exeext): $(P) b_gnatl.o link.o targext.o $(GNATLINK_OBJS)
+ $(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) \
+ $(TOOLS_LIBS)
+
+../stamp-gnatlib-$(RTSDIR):
+ @if [ ! -f stamp-gnatlib-$(RTSDIR) ] ; \
+ then \
+ $(ECHO) You must first build the GNAT library: make gnatlib; \
+ false; \
+ else \
+ true; \
+ fi
+
+install-gnatlib: ../stamp-gnatlib-$(RTSDIR)
+# Create the directory before deleting it, in case the directory is
+# a list of directories (as it may be on VMS). This ensures we are
+# deleting the right one.
+ -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
+ -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
+ $(RMDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
+ $(RMDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
+ -$(MKDIR) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
+ -$(MKDIR) $(DESTDIR)$(ADA_INCLUDE_DIR)
+ for file in $(RTSDIR)/*.ali; do \
+ $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
+ done
+ -$(INSTALL_DATA) $(RTSDIR)/g-trasym$(objext) $(DESTDIR)$(ADA_RTL_OBJ_DIR)
+ -cd $(RTSDIR); for file in *$(arext);do \
+ $(INSTALL_DATA) $$file $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
+ $(RANLIB_FOR_TARGET) $(DESTDIR)$(ADA_RTL_OBJ_DIR)/$$file; \
+ done
+ -$(foreach file, $(EXTRA_ADALIB_FILES), \
+ $(INSTALL_DATA_DATE) $(RTSDIR)/$(file) $(DESTDIR)$(ADA_RTL_OBJ_DIR) && \
+ ) true
+# Install the shared libraries, if any, using $(INSTALL) instead
+# of $(INSTALL_DATA). The latter may force a mode inappropriate
+# for shared libraries on some targets, e.g. on HP-UX where the x
+# permission is required.
+ for file in gnat gnarl; do \
+ if [ -f $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) ]; then \
+ $(INSTALL) $(RTSDIR)/lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(DESTDIR)$(ADA_RTL_OBJ_DIR); \
+ fi; \
+ if [ -f $(RTSDIR)/lib$${file}$(soext) ]; then \
+ $(LN_S) lib$${file}$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(DESTDIR)$(ADA_RTL_OBJ_DIR)/lib$${file}$(soext); \
+ fi; \
+ done
+# This copy must be done preserving the date on the original file.
+ for file in $(RTSDIR)/*.ad?; do \
+ $(INSTALL_DATA_DATE) $$file $(DESTDIR)$(ADA_INCLUDE_DIR); \
+ done
+ cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.adb
+ cd $(DESTDIR)$(ADA_INCLUDE_DIR); $(CHMOD) a-wx *.ads
+
+../stamp-gnatlib2-$(RTSDIR):
+ $(RM) $(RTSDIR)/s-*.ali
+ $(RM) $(RTSDIR)/s-*$(objext)
+ $(RM) $(RTSDIR)/a-*.ali
+ $(RM) $(RTSDIR)/a-*$(objext)
+ $(RM) $(RTSDIR)/*.ali
+ $(RM) $(RTSDIR)/*$(objext)
+ $(RM) $(RTSDIR)/*$(arext)
+ $(RM) $(RTSDIR)/*$(soext)
+ touch ../stamp-gnatlib2-$(RTSDIR)
+ $(RM) ../stamp-gnatlib-$(RTSDIR)
+
+# NOTE: The $(foreach ...) commands assume ";" is the valid separator between
+# successive target commands. Although the Gnu make documentation
+# implies this is true on all systems, I suspect it may not be, So care
+# has been taken to allow a sed script to look for ";)" and substitue
+# for ";" the appropriate character in the range of lines below
+# beginning with "GNULLI Begin" and ending with "GNULLI End"
+
+# GNULLI Begin ###########################################################
+
+../stamp-gnatlib1-$(RTSDIR): Makefile ../stamp-gnatlib2-$(RTSDIR)
+ $(RMDIR) $(RTSDIR)
+ $(MKDIR) $(RTSDIR)
+ $(CHMOD) u+w $(RTSDIR)
+# Copy target independent sources
+ $(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
+ $(LN_S) $(fsrcpfx)$(f) $(RTSDIR) ;) true
+# Remove files to be replaced by target dependent sources
+ $(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
+ $(RTSDIR)/$(word 1,$(subst <, ,$(PAIR))))
+ $(RM) $(RTSDIR)/*-*-*.ads $(RTSDIR)/*-*-*.adb
+# Copy new target dependent sources
+ $(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)
+
+# GNULLI End #############################################################
+
+# Don't use semicolon separated shell commands that involve list expansions.
+# The semicolon triggers a call to DCL on VMS and DCL can't handle command
+# line lengths in excess of 256 characters.
+# Example: cd $(RTSDIR); ar rc libfoo.a $(LONG_LIST_OF_OBJS)
+# is guaranteed to overflow the buffer.
+
+gnatlib: ../stamp-gnatlib1-$(RTSDIR) ../stamp-gnatlib2-$(RTSDIR)
+ $(MAKE) -C $(RTSDIR) \
+ CC="`echo \"$(GCC_FOR_TARGET)\" \
+ | sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
+ INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
+ CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
+ FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
+ srcdir=$(fsrcdir) \
+ -f ../Makefile $(LIBGNAT_OBJS)
+ $(MAKE) -C $(RTSDIR) \
+ CC="`echo \"$(GCC_FOR_TARGET)\" \
+ | sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
+ ADA_INCLUDES="" \
+ CFLAGS="$(GNATLIBCFLAGS)" \
+ ADAFLAGS="$(GNATLIBFLAGS)" \
+ FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
+ srcdir=$(fsrcdir) \
+ -f ../Makefile \
+ $(GNATRTL_OBJS)
+ $(RM) $(RTSDIR)/libgnat$(arext) $(RTSDIR)/libgnarl$(arext)
+ $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnat$(arext) \
+ $(addprefix $(RTSDIR)/,$(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS))
+ ifneq ($(PREFIX_OBJS),)
+ $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgccprefix$(arext) \
+ $(PREFIX_OBJS);
+ $(RANLIB_FOR_TARGET) $(RTSDIR)/libgccprefix$(arext)
+ endif
+ $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnat$(arext)
+ $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnarl$(arext) \
+ $(addprefix $(RTSDIR)/,$(GNATRTL_TASKING_OBJS))
+ $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnarl$(arext)
+ $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgnala$(arext) \
+ $(addprefix $(RTSDIR)/,$(GNATRTL_LINEARALGEBRA_OBJS))
+ $(RANLIB_FOR_TARGET) $(RTSDIR)/libgnala$(arext)
+ ifeq ($(GMEM_LIB),gmemlib)
+ $(AR_FOR_TARGET) $(AR_FLAGS) $(RTSDIR)/libgmem$(arext) \
+ $(RTSDIR)/memtrack.o
+ $(RANLIB_FOR_TARGET) $(RTSDIR)/libgmem$(arext)
+ endif
+ $(CHMOD) a-wx $(RTSDIR)/*.ali
+ touch ../stamp-gnatlib-$(RTSDIR)
+
+# Warning: this target assumes that LIBRARY_VERSION has been set correctly.
+gnatlib-shared-default:
+ $(MAKE) $(FLAGS_TO_PASS) \
+ GNATLIBFLAGS="$(GNATLIBFLAGS)" \
+ GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ gnatlib
+ $(RM) $(RTSDIR)/libgna*$(soext)
+ cd $(RTSDIR); ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
+ $(TARGET_LIBGCC2_CFLAGS) \
+ -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
+ $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(MISCLIB) -lm
+ cd $(RTSDIR); ../../xgcc -B../../ -shared $(GNATLIBCFLAGS) \
+ $(TARGET_LIBGCC2_CFLAGS) \
+ -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(GNATRTL_TASKING_OBJS) \
+ $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(THREADSLIB)
+ cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ libgnat$(soext)
+ cd $(RTSDIR); $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ libgnarl$(soext)
+
+gnatlib-shared-dual:
+ $(MAKE) $(FLAGS_TO_PASS) \
+ GNATLIBFLAGS="$(GNATLIBFLAGS)" \
+ GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ gnatlib-shared-default
+ $(MV) $(RTSDIR)/libgna*$(soext) .
+ $(RM) ../stamp-gnatlib2-$(RTSDIR)
+ $(MAKE) $(FLAGS_TO_PASS) \
+ GNATLIBFLAGS="$(GNATLIBFLAGS)" \
+ GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ gnatlib
+ $(MV) libgna*$(soext) $(RTSDIR)
+
+gnatlib-shared-dual-win32:
+ $(MAKE) $(FLAGS_TO_PASS) \
+ GNATLIBFLAGS="$(GNATLIBFLAGS)" \
+ GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ gnatlib-shared-win32
+ $(MV) $(RTSDIR)/libgna*$(soext) .
+ $(RM) ../stamp-gnatlib2-$(RTSDIR)
+ $(MAKE) $(FLAGS_TO_PASS) \
+ GNATLIBFLAGS="$(GNATLIBFLAGS)" \
+ GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ gnatlib
+ $(MV) libgna*$(soext) $(RTSDIR)
+
+# ??? we need to add the option to support auto-import of arrays/records to
+# the GNATLIBFLAGS when this will be supported by GNAT. At this point we will
+# use the gnatlib-shared-dual-win32 target to build the GNAT runtimes on
+# Windows.
+gnatlib-shared-win32:
+ $(MAKE) $(FLAGS_TO_PASS) \
+ GNATLIBFLAGS="$(GNATLIBFLAGS)" \
+ GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ gnatlib
+ $(RM) $(RTSDIR)/libgna*$(soext)
+ cd $(RTSDIR); ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
+ -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
+ $(SO_OPTS)libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) $(MISCLIB)
+ cd $(RTSDIR); ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
+ -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(GNATRTL_TASKING_OBJS) \
+ $(SO_OPTS)libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
+
+gnatlib-shared-darwin:
+ $(MAKE) $(FLAGS_TO_PASS) \
+ GNATLIBFLAGS="$(GNATLIBFLAGS)" \
+ GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) \
+ -fno-common" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ gnatlib
+ $(RM) $(RTSDIR)/libgnat$(soext) $(RTSDIR)/libgnarl$(soext)
+ cd $(RTSDIR); ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
+ -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \
+ $(SO_OPTS) \
+ $(MISCLIB) -lm
+ cd $(RTSDIR); ../../xgcc -B../../ -dynamiclib $(TARGET_LIBGCC2_CFLAGS) \
+ -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ $(GNATRTL_TASKING_OBJS) \
+ $(SO_OPTS) \
+ $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext)
+ cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ libgnat$(soext)
+ cd $(RTSDIR); $(LN_S) libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ libgnarl$(soext)
+
+gnatlib-shared-vms:
+ $(MAKE) $(FLAGS_TO_PASS) \
+ GNATLIBFLAGS="$(GNATLIBFLAGS)" \
+ GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ gnatlib
+ $(RM) $(RTSDIR)/libgna*$(soext)
+ cd $(RTSDIR) && \
+ ../../gnatsym -s SYMVEC_$$$$.opt \
+ $(LIBGNAT_OBJS) $(GNATRTL_NONTASKING_OBJS) && \
+ ../../xgcc -g -B../../ -shared -shared-libgcc \
+ -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) libgnat.a \
+ sys\$$library:trace.exe \
+ --for-linker=/noinform \
+ --for-linker=SYMVEC_$$$$.opt \
+ --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
+ cd $(RTSDIR) && \
+ ../../gnatsym -s SYMVEC_$$$$.opt \
+ $(GNATRTL_TASKING_OBJS) && \
+ ../../xgcc -g -B../../ -shared -shared-libgcc \
+ -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ libgnarl.a libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \
+ sys\$$library:trace.exe \
+ --for-linker=/noinform \
+ --for-linker=SYMVEC_$$$$.opt \
+ --for-linker=gsmatch=equal,$(GSMATCH_VERSION)
+
+gnatlib-shared:
+ $(MAKE) $(FLAGS_TO_PASS) \
+ GNATLIBFLAGS="$(GNATLIBFLAGS)" \
+ GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
+ $(GNATLIB_SHARED)
+
+gnatlib-sjlj:
+ $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="" ../stamp-gnatlib1-$(RTSDIR)
+ sed -e 's/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := False;/' $(RTSDIR)/system.ads > $(RTSDIR)/s.ads
+ $(MV) $(RTSDIR)/s.ads $(RTSDIR)/system.ads
+ $(MAKE) $(FLAGS_TO_PASS) \
+ EH_MECHANISM="" \
+ GNATLIBFLAGS="$(GNATLIBFLAGS)" \
+ GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
+
+gnatlib-zcx:
+ $(MAKE) $(FLAGS_TO_PASS) EH_MECHANISM="-gcc" ../stamp-gnatlib1-$(RTSDIR)
+ sed -e 's/ZCX_By_Default.*/ZCX_By_Default : constant Boolean := True;/' $(RTSDIR)/system.ads > $(RTSDIR)/s.ads
+ $(MV) $(RTSDIR)/s.ads $(RTSDIR)/system.ads
+ $(MAKE) $(FLAGS_TO_PASS) \
+ EH_MECHANISM="-gcc" \
+ GNATLIBFLAGS="$(GNATLIBFLAGS)" \
+ GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
+ MULTISUBDIR="$(MULTISUBDIR)" \
+ THREAD_KIND="$(THREAD_KIND)" \
+ TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" gnatlib
+
+# .s files for cross-building
+gnat-cross: force
+ make $(GNAT1_ADA_OBJS) CC="gcc -B../stage1/" CFLAGS="-S -gnatp"
+
+# Compiling object files from source files.
+
+# Note that dependencies on obstack.h are not written
+# because that file is not part of GCC.
+# Dependencies on gvarargs.h are not written
+# because all that file does, when not compiling with GCC,
+# is include the system varargs.h.
+
+b_gnatl.c : $(GNATLINK_OBJS)
+ $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatl.c gnatlink.ali
+b_gnatl.o : b_gnatl.c
+
+b_gnatm.c : $(GNATMAKE_OBJS)
+ $(GNATBIND) -C $(ADA_INCLUDES) -o b_gnatm.c gnatmake.ali
+b_gnatm.o : b_gnatm.c
+
+ADA_INCLUDE_DIR = $(libsubdir)/adainclude
+ADA_RTL_OBJ_DIR = $(libsubdir)/adalib
+
+# force no sibling call optimization on s-traceb.o so the number of stack
+# frames to be skipped when computing a call chain is not modified by
+# optimization. However we can do that only when building the runtime
+# (not the compiler) because the -fno-optimize-sibling-calls option exists
+# only in GCC 3 and above.
+
+ifneq (,$(findstring xgcc,$(CC)))
+NO_SIBLING_ADAFLAGS=-fno-optimize-sibling-calls
+else
+NO_SIBLING_ADAFLAGS=
+endif
+
+s-traceb.o : s-traceb.adb
+ $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) \
+ $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) \
+ $< $(OUTPUT_OPTION)
+
+# force debugging information on s-tasdeb.o so that it is always
+# possible to set conditional breakpoints on tasks.
+
+s-tasdeb.o : s-tasdeb.adb s-tasdeb.ads
+ $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
+ $< $(OUTPUT_OPTION)
+
+# force no function reordering on a-except.o because of the exclusion bounds
+# mechanism (see the source file for more detailed information). However we
+# can do that only when building the runtime (not the compiler) because the
+# -fno-toplevel-reorder option exists only in GCC 4.2 and above.
+
+ifneq (,$(findstring xgcc,$(CC)))
+NO_REORDER_ADAFLAGS=-fno-toplevel-reorder
+else
+NO_REORDER_ADAFLAGS=
+endif
+
+# force debugging information on a-except.o so that it is always
+# possible to set conditional breakpoints on exceptions.
+# use -O1 otherwise gdb isn't able to get a full backtrace on mips targets.
+
+a-except.o : a-except.adb a-except.ads
+ $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 -fno-inline \
+ $(NO_REORDER_ADAFLAGS) $(ADA_INCLUDES) $< $(OUTPUT_OPTION)
+
+# compile s-except.o without optimization and with debug info to let the
+# debugger set breakpoints and inspect subprogram parameters on exception
+# related events.
+
+s-except.o : s-except.adb s-except.ads
+ $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O0 $(ADA_INCLUDES) \
+ $< $(OUTPUT_OPTION)
+
+# force debugging information on s-assert.o so that it is always
+# possible to set breakpoint on assert failures.
+
+s-assert.o : s-assert.adb s-assert.ads a-except.ads
+ $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O2 $(ADA_INCLUDES) \
+ $< $(OUTPUT_OPTION)
+
+adadecode.o : adadecode.c adadecode.h
+aux-io.o : aux-io.c
+argv.o : argv.c
+cal.o : cal.c
+deftarg.o : deftarg.c
+errno.o : errno.c
+exit.o : adaint.h exit.c
+expect.o : expect.c
+final.o : final.c
+gmem.o : gmem.c
+link.o : link.c
+mkdir.o : mkdir.c
+socket.o : socket.c gsocket.h
+sysdep.o : sysdep.c
+raise-gcc.o : raise-gcc.c raise.h
+raise.o : raise.c raise.h
+vx_stack_info.o : vx_stack_info.c
+
+cio.o : cio.c
+ $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
+ $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
+
+init.o : init.c adaint.h raise.h
+ $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
+ $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
+
+initialize.o : initialize.c raise.h
+ $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
+ $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
+
+targext.o : targext.c
+ $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) \
+ $(ALL_CPPFLAGS) $(INCLUDES_FOR_SUBDIR) \
+ $< $(OUTPUT_OPTION)
+
+# No optimization to compile this file as optimizations (-O1 or above) breaks
+# the SEH handling on Windows. The reasons are not clear.
+seh_init.o : seh_init.c raise.h
+ $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) -O0 \
+ $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
+
+# Need to keep the frame pointer in this file to pop the stack properly on
+# some targets.
+tracebak.o : tracebak.c tb-alvms.c tb-alvxw.c tb-gcc.c
+ $(CC) -c $(ALL_CFLAGS) $(ADA_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+ -fno-omit-frame-pointer $< $(OUTPUT_OPTION)
+
+# In GNU Make, ignore whether `stage*' exists.
+.PHONY: stage1 stage2 stage3 stage4 clean realclean TAGS bootstrap
+.PHONY: risky-stage1 risky-stage2 risky-stage3 risky-stage4
+
+force:
+
+# Gnatlbr, Vms_help, and Gnat.hlp are only used on VMS
+
+../../gnatlbr$(exeext): ../../prefix.o
+ $(GNATMAKE) -c $(ADA_INCLUDES) gnatlbr --GCC="$(CC) $(ALL_ADAFLAGS)"
+ $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlbr
+ $(GNATLINK) -v gnatlbr -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+
+../../vms_help$(exeext):
+ $(GNATMAKE) -c $(ADA_INCLUDES) vms_help --GCC="$(CC) $(ALL_ADAFLAGS)"
+ $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vms_help
+ $(GNATLINK) -v vms_help -o $@ --GCC="$(GCC_LINK)" $(TOOLS_LIBS)
+
+../../gnat.hlp: ../../vms_help$(exeext)
+ ../../vms_help$(exeext) $(fsrcdir)/gnat.help_in \
+ $(fsrcdir)/vms_data.ads ../../gnat.hlp
diff --git a/gcc/ada/ada-tree.def b/gcc/ada/gcc-interface/ada-tree.def
index 0a1949f6710..0a1949f6710 100644
--- a/gcc/ada/ada-tree.def
+++ b/gcc/ada/gcc-interface/ada-tree.def
diff --git a/gcc/ada/ada-tree.h b/gcc/ada/gcc-interface/ada-tree.h
index 044cea811b3..1db5ce28ecf 100644
--- a/gcc/ada/ada-tree.h
+++ b/gcc/ada/gcc-interface/ada-tree.h
@@ -26,7 +26,7 @@
/* Ada uses the lang_decl and lang_type fields to hold a tree. */
union lang_tree_node
GTY((desc ("0"),
- chain_next ("(union lang_tree_node *)GENERIC_NEXT (&%h.t)")))
+ chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.t)")))
{
union tree_node GTY((tag ("0"))) t;
};
@@ -294,6 +294,12 @@ 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_TYPE(NODE) \
+ GET_DECL_LANG_SPECIFIC (PARM_DECL_CHECK (NODE))
+#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
discriminant number. */
#define DECL_DISCRIMINANT_NUMBER(NODE) DECL_INITIAL (FIELD_DECL_CHECK (NODE))
diff --git a/gcc/ada/ada.h b/gcc/ada/gcc-interface/ada.h
index 5f2191fdec9..5f2191fdec9 100644
--- a/gcc/ada/ada.h
+++ b/gcc/ada/gcc-interface/ada.h
diff --git a/gcc/ada/gcc-interface/config-lang.in b/gcc/ada/gcc-interface/config-lang.in
new file mode 100644
index 00000000000..4eb979034a2
--- /dev/null
+++ b/gcc/ada/gcc-interface/config-lang.in
@@ -0,0 +1,43 @@
+# Top level configure fragment for GNU Ada (GNAT).
+# Copyright (C) 1994-2008 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/>.
+
+# Configure looks for the existence of this file to auto-config each language.
+# We define several parameters used by configure:
+#
+# language - name of language as it would appear in $(LANGUAGES)
+# boot_language - "yes" if we need to build this language in stage1
+# compilers - value to add to $(COMPILERS)
+
+language="ada"
+gcc_subdir="ada/gcc-interface"
+
+boot_language=yes
+boot_language_boot_flags='ADAFLAGS="$(BOOT_ADAFLAGS)"'
+
+compilers="gnat1\$(exeext)"
+
+gtfiles="\$(srcdir)/ada/gcc-interface/ada-tree.h \$(srcdir)/ada/gcc-interface/gigi.h \$(srcdir)/ada/gcc-interface/decl.c \$(srcdir)/ada/gcc-interface/trans.c \$(srcdir)/ada/gcc-interface/utils.c"
+
+outputs="ada/gcc-interface/Makefile ada/Makefile"
+
+target_libs="target-libada"
+lang_dirs="gnattools"
+
+# Ada will not work until the front end starts emitting GIMPLE trees.
+build_by_default=no
diff --git a/gcc/ada/cuintp.c b/gcc/ada/gcc-interface/cuintp.c
index 90ea342f6b5..90ea342f6b5 100644
--- a/gcc/ada/cuintp.c
+++ b/gcc/ada/gcc-interface/cuintp.c
diff --git a/gcc/ada/decl.c b/gcc/ada/gcc-interface/decl.c
index ebc2e5edd14..65dd02e7834 100644
--- a/gcc/ada/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,
@@ -1536,15 +1550,20 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnu_expr, 0);
gnu_type = make_node (INTEGER_TYPE);
+ TREE_TYPE (gnu_type) = get_unpadded_type (Etype (gnat_entity));
+
+ /* Set the precision to the Esize except for bit-packed arrays and
+ subtypes of Standard.Boolean. */
if (Is_Packed_Array_Type (gnat_entity)
&& Is_Bit_Packed_Array (Original_Array_Type (gnat_entity)))
{
esize = UI_To_Int (RM_Size (gnat_entity));
TYPE_PACKED_ARRAY_TYPE_P (gnu_type) = 1;
}
+ else if (TREE_CODE (TREE_TYPE (gnu_type)) == BOOLEAN_TYPE)
+ esize = 1;
TYPE_PRECISION (gnu_type) = esize;
- TREE_TYPE (gnu_type) = get_unpadded_type (Etype (gnat_entity));
TYPE_MIN_VALUE (gnu_type)
= convert (TREE_TYPE (gnu_type),
@@ -1596,7 +1615,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
are uninitialized. Both goals are accomplished by wrapping the
modular value in an enclosing struct. */
if (Is_Packed_Array_Type (gnat_entity)
- && Is_Bit_Packed_Array (Original_Array_Type (gnat_entity)))
+ && Is_Bit_Packed_Array (Original_Array_Type (gnat_entity)))
{
tree gnu_field_type = gnu_type;
tree gnu_field;
@@ -3057,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)
@@ -3867,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
@@ -3908,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,
@@ -4015,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);
@@ -4774,6 +4794,7 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech,
{
tree gnu_param_name = get_entity_name (gnat_param);
tree gnu_param_type = gnat_to_gnu_type (Etype (gnat_param));
+ tree gnu_param_type_alt = NULL_TREE;
bool in_param = (Ekind (gnat_param) == E_In_Parameter);
/* The parameter can be indirectly modified if its address is taken. */
bool ro_param = in_param && !Address_Taken (gnat_param);
@@ -4821,11 +4842,25 @@ gnat_to_gnu_param (Entity_Id gnat_param, Mechanism_Type mech,
= TREE_TYPE (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (gnu_param_type))));
/* VMS descriptors are themselves passed by reference. */
- if (mech == By_Descriptor)
+ if (mech == By_Short_Descriptor ||
+ (mech == By_Descriptor && TARGET_ABI_OPEN_VMS && !TARGET_MALLOC64))
gnu_param_type
- = build_pointer_type (build_vms_descriptor (gnu_param_type,
- Mechanism (gnat_param),
- gnat_subprog));
+ = 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_descriptor32 (gnu_param_type,
+ Mechanism (gnat_param),
+ gnat_subprog));
+ gnu_param_type
+ = build_pointer_type (build_vms_descriptor (gnu_param_type,
+ Mechanism (gnat_param),
+ gnat_subprog));
+ }
/* Arrays are passed as pointers to element type for foreign conventions. */
else if (foreign
@@ -4906,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))
@@ -4917,10 +4953,15 @@ 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 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. */
if (mech == Default)
@@ -7094,7 +7135,8 @@ set_rm_size (Uint uint_size, tree gnu_type, Entity_Id gnat_entity)
if (TREE_CODE (gnu_type) == INTEGER_TYPE
&& Is_Discrete_Or_Fixed_Point_Type (gnat_entity))
TYPE_RM_SIZE_NUM (gnu_type) = size;
- else if (TREE_CODE (gnu_type) == ENUMERAL_TYPE)
+ else if (TREE_CODE (gnu_type) == ENUMERAL_TYPE
+ || TREE_CODE (gnu_type) == BOOLEAN_TYPE)
TYPE_RM_SIZE_NUM (gnu_type) = size;
else if ((TREE_CODE (gnu_type) == RECORD_TYPE
|| TREE_CODE (gnu_type) == UNION_TYPE
@@ -7112,7 +7154,7 @@ static tree
make_type_from_size (tree type, tree size_tree, bool for_biased)
{
unsigned HOST_WIDE_INT size;
- bool biased_p;
+ bool biased_p, boolean_p;
tree new_type;
/* If size indicates an error, just return TYPE to avoid propagating
@@ -7126,13 +7168,23 @@ make_type_from_size (tree type, tree size_tree, bool for_biased)
{
case INTEGER_TYPE:
case ENUMERAL_TYPE:
+ case BOOLEAN_TYPE:
biased_p = (TREE_CODE (type) == INTEGER_TYPE
&& TYPE_BIASED_REPRESENTATION_P (type));
+ boolean_p = (TREE_CODE (type) == BOOLEAN_TYPE
+ || (TREE_CODE (type) == INTEGER_TYPE
+ && TREE_TYPE (type)
+ && TREE_CODE (TREE_TYPE (type)) == BOOLEAN_TYPE));
+
+ if (boolean_p)
+ size = round_up_to_align (size, BITS_PER_UNIT);
+
/* Only do something if the type is not a packed array type and
doesn't already have the proper size. */
if (TYPE_PACKED_ARRAY_TYPE_P (type)
- || (TYPE_PRECISION (type) == size && biased_p == for_biased))
+ || (biased_p == for_biased && TYPE_PRECISION (type) == size)
+ || (boolean_p && compare_tree_int (TYPE_SIZE (type), size) == 0))
break;
biased_p |= for_biased;
@@ -7142,22 +7194,33 @@ make_type_from_size (tree type, tree size_tree, bool for_biased)
new_type = make_unsigned_type (size);
else
new_type = make_signed_type (size);
+ if (boolean_p)
+ TYPE_PRECISION (new_type) = 1;
TREE_TYPE (new_type) = TREE_TYPE (type) ? TREE_TYPE (type) : type;
TYPE_MIN_VALUE (new_type)
= convert (TREE_TYPE (new_type), TYPE_MIN_VALUE (type));
TYPE_MAX_VALUE (new_type)
= convert (TREE_TYPE (new_type), TYPE_MAX_VALUE (type));
TYPE_BIASED_REPRESENTATION_P (new_type) = biased_p;
- TYPE_RM_SIZE_NUM (new_type) = bitsize_int (size);
+ if (boolean_p)
+ TYPE_RM_SIZE_NUM (new_type) = bitsize_int (1);
+ else
+ TYPE_RM_SIZE_NUM (new_type) = bitsize_int (size);
return new_type;
case RECORD_TYPE:
/* Do something if this is a fat pointer, in which case we
may need to return the thin pointer. */
if (TYPE_IS_FAT_POINTER_P (type) && size < POINTER_SIZE * 2)
- return
- build_pointer_type
- (TYPE_OBJECT_RECORD_TYPE (TYPE_UNCONSTRAINED_ARRAY (type)));
+ {
+ enum machine_mode p_mode = mode_for_size (size, MODE_INT, 0);
+ if (!targetm.valid_pointer_mode (p_mode))
+ p_mode = ptr_mode;
+ return
+ build_pointer_type_for_mode
+ (TYPE_OBJECT_RECORD_TYPE (TYPE_UNCONSTRAINED_ARRAY (type)),
+ p_mode, 0);
+ }
break;
case POINTER_TYPE:
diff --git a/gcc/ada/deftarg.c b/gcc/ada/gcc-interface/deftarg.c
index 28c7db5f702..28c7db5f702 100644
--- a/gcc/ada/deftarg.c
+++ b/gcc/ada/gcc-interface/deftarg.c
diff --git a/gcc/ada/gigi.h b/gcc/ada/gcc-interface/gigi.h
index 86ff090fdb0..e1c2fe923c9 100644
--- a/gcc/ada/gigi.h
+++ b/gcc/ada/gcc-interface/gigi.h
@@ -218,6 +218,7 @@ extern void gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
struct List_Header *list_headers_ptr,
Nat number_file,
struct File_Info_Type *file_info_ptr,
+ Entity_Id standard_boolean,
Entity_Id standard_integer,
Entity_Id standard_long_long_float,
Entity_Id standard_exception_type,
@@ -233,8 +234,8 @@ extern tree gnat_to_gnu (Node_Id gnat_node);
extern void gnat_expand_stmt (tree gnu_stmt);
/* ??? missing documentation */
-extern int gnat_gimplify_expr (tree *expr_p, tree *pre_p,
- tree *post_p ATTRIBUTE_UNUSED);
+extern int gnat_gimplify_expr (tree *expr_p, gimple_seq *pre_p,
+ gimple_seq *post_p ATTRIBUTE_UNUSED);
/* Do the processing for the declaration of a GNAT_ENTITY, a type. If
a separate Freeze node exists, delay the bulk of the processing. Otherwise
@@ -393,6 +394,9 @@ enum standard_datatypes
/* Likewise for freeing memory. */
ADT_free_decl,
+ /* Function decl node for 64-bit multiplication with overflow checking */
+ ADT_mulv64_decl,
+
/* Types and decls used by our temporary exception mechanism. See
init_gigi_decls for details. */
ADT_jmpbuf_type,
@@ -424,6 +428,7 @@ extern GTY(()) tree gnat_raise_decls[(int) LAST_REASON_CODE + 1];
#define malloc_decl gnat_std_decls[(int) ADT_malloc_decl]
#define malloc32_decl gnat_std_decls[(int) ADT_malloc32_decl]
#define free_decl gnat_std_decls[(int) ADT_free_decl]
+#define mulv64_decl gnat_std_decls[(int) ADT_mulv64_decl]
#define jmpbuf_type gnat_std_decls[(int) ADT_jmpbuf_type]
#define jmpbuf_ptr_type gnat_std_decls[(int) ADT_jmpbuf_ptr_type]
#define get_jmpbuf_decl gnat_std_decls[(int) ADT_get_jmpbuf_decl]
@@ -668,17 +673,17 @@ extern tree create_label_decl (tree label_name);
appearing in the subprogram. */
extern void begin_subprog_body (tree subprog_decl);
-/* Finish the definition of the current subprogram and compile it all the way
- to assembler language output. BODY is the tree corresponding to
- the subprogram. */
-extern void end_subprog_body (tree body);
+/* Finish the definition of the current subprogram BODY and compile it all the
+ way to assembler language output. ELAB_P tells if this is called for an
+ elaboration routine, to be entirely discarded if empty. */
+extern void end_subprog_body (tree body, bool elab_p);
/* Build a template of type TEMPLATE_TYPE from the array bounds of ARRAY_TYPE.
EXPR is an expression that we can use to locate any PLACEHOLDER_EXPRs.
Return a constructor for the template. */
extern tree build_template (tree template_type, tree array_type, tree expr);
-/* Build a 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
@@ -687,6 +692,10 @@ 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 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
and the GNAT node GNAT_SUBPROG. */
extern void build_function_stub (tree gnu_subprog, Entity_Id gnat_subprog);
@@ -844,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. */
-
-extern tree fill_vms_descriptor (tree expr, Entity_Id gnat_formal);
+ 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. */
@@ -903,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/lang-specs.h b/gcc/ada/gcc-interface/lang-specs.h
index 65326d4c5b2..65326d4c5b2 100644
--- a/gcc/ada/lang-specs.h
+++ b/gcc/ada/gcc-interface/lang-specs.h
diff --git a/gcc/ada/lang.opt b/gcc/ada/gcc-interface/lang.opt
index d10fc3ac087..d10fc3ac087 100644
--- a/gcc/ada/lang.opt
+++ b/gcc/ada/gcc-interface/lang.opt
diff --git a/gcc/ada/misc.c b/gcc/ada/gcc-interface/misc.c
index 85dd22e8bb3..7c7dc02f36f 100644
--- a/gcc/ada/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
@@ -340,13 +340,6 @@ gnat_post_options (const char **pfilename ATTRIBUTE_UNUSED)
/* ??? The warning machinery is outsmarted by Ada. */
warn_unused_parameter = 0;
- flag_inline_trees = 1;
-
- if (!flag_no_inline)
- flag_no_inline = 1;
- if (flag_inline_functions)
- flag_inline_trees = 2;
-
/* Force eliminate_unused_debug_types to 0 unless an explicit positive
-f has been passed. This forces the default to 0 for Ada, which might
differ from the common default. */
@@ -551,6 +544,7 @@ gnat_print_type (FILE *file, tree node, int indent)
break;
case ENUMERAL_TYPE:
+ case BOOLEAN_TYPE:
print_node (file, "RM size", TYPE_RM_SIZE_NUM (node), indent + 4);
break;
diff --git a/gcc/ada/targtyps.c b/gcc/ada/gcc-interface/targtyps.c
index c4e3299667d..c4e3299667d 100644
--- a/gcc/ada/targtyps.c
+++ b/gcc/ada/gcc-interface/targtyps.c
diff --git a/gcc/ada/trans.c b/gcc/ada/gcc-interface/trans.c
index 89b10c695da..a67476eae70 100644
--- a/gcc/ada/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -40,7 +40,8 @@
#include "except.h"
#include "debug.h"
#include "output.h"
-#include "tree-gimple.h"
+#include "tree-iterator.h"
+#include "gimple.h"
#include "ada.h"
#include "types.h"
#include "atree.h"
@@ -72,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;
@@ -204,6 +218,8 @@ static void process_decls (List_Id, List_Id, Node_Id, bool, bool);
static tree emit_range_check (tree, Node_Id);
static tree emit_index_check (tree, tree, tree, tree);
static tree emit_check (tree, tree, int);
+static tree build_unary_op_trapv (enum tree_code, tree, tree);
+static tree build_binary_op_trapv (enum tree_code, tree, tree, tree);
static tree convert_with_check (Entity_Id, tree, bool, bool, bool);
static bool smaller_packable_type_p (tree, tree);
static bool addressable_p (tree, tree);
@@ -230,12 +246,12 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
struct Elist_Header *elists_ptr, struct Elmt_Item *elmts_ptr,
struct String_Entry *strings_ptr, Char_Code *string_chars_ptr,
struct List_Header *list_headers_ptr, Nat number_file,
- struct File_Info_Type *file_info_ptr,
+ struct File_Info_Type *file_info_ptr, Entity_Id standard_boolean,
Entity_Id standard_integer, Entity_Id standard_long_long_float,
Entity_Id standard_exception_type, Int gigi_operating_mode)
{
- tree gnu_standard_long_long_float;
- tree gnu_standard_exception_type;
+ Entity_Id gnat_literal;
+ tree gnu_standard_long_long_float, gnu_standard_exception_type, t;
struct elab_info *info;
int i;
@@ -310,6 +326,8 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
/* Give names and make TYPE_DECLs for common types. */
create_type_decl (get_identifier (SIZE_TYPE), sizetype,
NULL, false, true, Empty);
+ create_type_decl (get_identifier ("boolean"), boolean_type_node,
+ NULL, false, true, Empty);
create_type_decl (get_identifier ("integer"), integer_type_node,
NULL, false, true, Empty);
create_type_decl (get_identifier ("unsigned char"), char_type_node,
@@ -317,6 +335,26 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
create_type_decl (get_identifier ("long integer"), long_integer_type_node,
NULL, false, true, Empty);
+ /* Save the type we made for boolean as the type for Standard.Boolean. */
+ save_gnu_tree (Base_Type (standard_boolean), TYPE_NAME (boolean_type_node),
+ false);
+ gnat_literal = First_Literal (Base_Type (standard_boolean));
+ t = UI_To_gnu (Enumeration_Rep (gnat_literal), boolean_type_node);
+ gcc_assert (t == boolean_false_node);
+ t = create_var_decl (get_entity_name (gnat_literal), NULL_TREE,
+ boolean_type_node, t, true, false, false, false,
+ NULL, gnat_literal);
+ DECL_IGNORED_P (t) = 1;
+ save_gnu_tree (gnat_literal, t, false);
+ gnat_literal = Next_Literal (gnat_literal);
+ t = UI_To_gnu (Enumeration_Rep (gnat_literal), boolean_type_node);
+ gcc_assert (t == boolean_true_node);
+ t = create_var_decl (get_entity_name (gnat_literal), NULL_TREE,
+ boolean_type_node, t, true, false, false, false,
+ NULL, gnat_literal);
+ DECL_IGNORED_P (t) = 1;
+ save_gnu_tree (gnat_literal, t, false);
+
/* Save the type we made for integer as the type for Standard.Integer.
Then make the rest of the standard types. Note that some of these
may be subtypes. */
@@ -356,7 +394,6 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
for (info = elab_info_list; info; info = info->next)
{
tree gnu_body = DECL_SAVED_TREE (info->elab_proc);
- tree gnu_stmts;
/* Unshare SAVE_EXPRs between subprograms. These are not unshared by
the gimplifier for obvious reasons, but it turns out that we need to
@@ -368,30 +405,14 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
an upstream bug for which we would not change the outcome. */
walk_tree_without_duplicates (&gnu_body, unshare_save_expr, NULL);
- /* Set the current function to be the elaboration procedure and gimplify
- what we have. */
- current_function_decl = info->elab_proc;
- gimplify_body (&gnu_body, info->elab_proc, true);
-
- /* We should have a BIND_EXPR, but it may or may not have any statements
- in it. If it doesn't have any, we have nothing to do. */
- gnu_stmts = gnu_body;
- if (TREE_CODE (gnu_stmts) == BIND_EXPR)
- gnu_stmts = BIND_EXPR_BODY (gnu_stmts);
+ /* Process the function as others, but for indicating this is an
+ elab proc, to be discarded if empty, then propagate the status
+ up to the GNAT tree node. */
+ begin_subprog_body (info->elab_proc);
+ end_subprog_body (gnu_body, true);
- /* If there are no statements, there is no elaboration code. */
- if (!gnu_stmts || !STATEMENT_LIST_HEAD (gnu_stmts))
- {
- Set_Has_No_Elaboration_Code (info->gnat_node, 1);
- cgraph_remove_node (cgraph_node (info->elab_proc));
- }
- else
- {
- /* Otherwise, compile the function. Note that we'll be gimplifying
- it twice, but that's fine for the nodes we use. */
- begin_subprog_body (info->elab_proc);
- end_subprog_body (gnu_body);
- }
+ if (empty_body_p (gimple_body (info->elab_proc)))
+ Set_Has_No_Elaboration_Code (info->gnat_node, 1);
}
/* We cannot track the location of errors past this point. */
@@ -2003,7 +2024,7 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
: Sloc (gnat_node)),
&DECL_STRUCT_FUNCTION (gnu_subprog_decl)->function_end_locus);
- end_subprog_body (gnu_result);
+ end_subprog_body (gnu_result, false);
/* Disconnect the trees for parameters that we made variables for from the
GNAT entities since these are unusable after we end the function. */
@@ -2241,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);
}
}
@@ -2384,7 +2405,8 @@ call_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p, tree gnu_target)
else
gnu_actual = build_unary_op (ADDR_EXPR, NULL_TREE,
fill_vms_descriptor (gnu_actual,
- gnat_formal));
+ gnat_formal,
+ gnat_actual));
}
else
{
@@ -2592,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);
@@ -3389,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;
@@ -3932,7 +3963,22 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_rhs = convert (gnu_type, gnu_rhs);
}
- gnu_result = build_binary_op (code, gnu_type, gnu_lhs, gnu_rhs);
+ /* Instead of expanding overflow checks for addition, subtraction
+ and multiplication itself, the front end will leave this to
+ the back end when Backend_Overflow_Checks_On_Target is set.
+ As the GCC back end itself does not know yet how to properly
+ do overflow checking, do it here. The goal is to push
+ the expansions further into the back end over time. */
+ if (Do_Overflow_Check (gnat_node) && Backend_Overflow_Checks_On_Target
+ && (Nkind (gnat_node) == N_Op_Add
+ || Nkind (gnat_node) == N_Op_Subtract
+ || Nkind (gnat_node) == N_Op_Multiply)
+ && !TYPE_UNSIGNED (gnu_type)
+ && !FLOAT_TYPE_P (gnu_type))
+ gnu_result
+ = build_binary_op_trapv (code, gnu_type, gnu_lhs, gnu_rhs);
+ else
+ gnu_result = build_binary_op (code, gnu_type, gnu_lhs, gnu_rhs);
/* If this is a logical shift with the shift count not verified,
we must return zero if it is too large. We cannot compensate
@@ -3997,8 +4043,14 @@ gnat_to_gnu (Node_Id gnat_node)
gnu_result_type = get_unpadded_type (Base_Type
(Full_View (Etype (gnat_node))));
- gnu_result = build_unary_op (gnu_codes[Nkind (gnat_node)],
- gnu_result_type, gnu_expr);
+ if (Do_Overflow_Check (gnat_node)
+ && !TYPE_UNSIGNED (gnu_result_type)
+ && !FLOAT_TYPE_P (gnu_result_type))
+ gnu_result = build_unary_op_trapv (gnu_codes[Nkind (gnat_node)],
+ gnu_result_type, gnu_expr);
+ else
+ gnu_result = build_unary_op (gnu_codes[Nkind (gnat_node)],
+ gnu_result_type, gnu_expr);
break;
case N_Allocator:
@@ -4512,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:
@@ -5334,7 +5387,8 @@ pop_stack (tree *gnu_stack_ptr)
/* Generate GIMPLE in place for the expression at *EXPR_P. */
int
-gnat_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p ATTRIBUTE_UNUSED)
+gnat_gimplify_expr (tree *expr_p, gimple_seq *pre_p,
+ gimple_seq *post_p ATTRIBUTE_UNUSED)
{
tree expr = *expr_p;
tree op;
@@ -5419,14 +5473,14 @@ gnat_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p ATTRIBUTE_UNUSED)
&& TREE_CODE_CLASS (TREE_CODE (op)) != tcc_constant)
{
tree new_var = create_tmp_var (TREE_TYPE (op), "A");
- tree mod = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (op), new_var, op);
+ gimple stmt;
TREE_ADDRESSABLE (new_var) = 1;
+ stmt = gimplify_assign (new_var, op, pre_p);
if (EXPR_HAS_LOCATION (op))
- SET_EXPR_LOCUS (mod, EXPR_LOCUS (op));
+ gimple_set_location (stmt, *EXPR_LOCUS (op));
- gimplify_and_add (mod, pre_p);
TREE_OPERAND (expr, 0) = new_var;
recompute_tree_invariant_for_addr_expr (expr);
return GS_ALL_DONE;
@@ -5494,7 +5548,7 @@ gnat_gimplify_stmt (tree *stmt_p)
append_to_statement_list (LOOP_STMT_UPDATE (stmt), stmt_p);
t = build1 (GOTO_EXPR, void_type_node, gnu_start_label);
- set_expr_location (t, DECL_SOURCE_LOCATION (gnu_end_label));
+ SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (gnu_end_label));
append_to_statement_list (t, stmt_p);
append_to_statement_list (build1 (LABEL_EXPR, void_type_node,
@@ -5716,9 +5770,9 @@ process_inlined_subprograms (Node_Id gnat_node)
Entity_Id gnat_entity;
Node_Id gnat_body;
- /* If we can inline, generate RTL for all the inlined subprograms.
+ /* If we can inline, generate Gimple for all the inlined subprograms.
Define the entity first so we set DECL_EXTERNAL. */
- if (optimize > 0 && !flag_really_no_inline)
+ if (optimize > 0)
for (gnat_entity = First_Inlined_Subprogram (gnat_node);
Present (gnat_entity);
gnat_entity = Next_Inlined_Subprogram (gnat_entity))
@@ -5867,6 +5921,159 @@ process_decls (List_Id gnat_decls, List_Id gnat_decls2,
}
}
+/* Make a unary operation of kind CODE using build_unary_op, but guard
+ the operation by an overflow check. CODE can be one of NEGATE_EXPR
+ or ABS_EXPR. GNU_TYPE is the type desired for the result.
+ Usually the operation is to be performed in that type. */
+
+static tree
+build_unary_op_trapv (enum tree_code code,
+ tree gnu_type,
+ tree operand)
+{
+ gcc_assert ((code == NEGATE_EXPR) || (code == ABS_EXPR));
+
+ operand = protect_multiple_eval (operand);
+
+ return emit_check (build_binary_op (EQ_EXPR, integer_type_node,
+ operand, TYPE_MIN_VALUE (gnu_type)),
+ build_unary_op (code, gnu_type, operand),
+ CE_Overflow_Check_Failed);
+}
+
+/* Make a binary operation of kind CODE using build_binary_op, but
+ guard the operation by an overflow check. CODE can be one of
+ PLUS_EXPR, MINUS_EXPR or MULT_EXPR. GNU_TYPE is the type desired
+ for the result. Usually the operation is to be performed in that type. */
+
+static tree
+build_binary_op_trapv (enum tree_code code,
+ tree gnu_type,
+ tree left,
+ tree 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;
+ tree tmp1, tmp2;
+ tree zero = convert (gnu_type, integer_zero_node);
+ tree rhs_ge_zero;
+ tree check_pos;
+ tree check_neg;
+
+ int precision = TYPE_PRECISION (gnu_type);
+
+ /* Prefer a constant rhs to simplify checks */
+
+ if (TREE_CONSTANT (lhs) && !TREE_CONSTANT (rhs)
+ && commutative_tree_code (code))
+ {
+ tree tmp = lhs;
+ lhs = rhs;
+ rhs = tmp;
+ }
+
+ /* In the case the right-hand size is still not constant, try to
+ use an exact operation in a wider type. */
+
+ if (!TREE_CONSTANT (rhs))
+ {
+ int needed_precision = code == MULT_EXPR ? 2 * precision : precision + 1;
+
+ if (code == MULT_EXPR && precision == 64)
+ {
+ return build_call_2_expr (mulv64_decl, lhs, rhs);
+ }
+ else if (needed_precision <= LONG_LONG_TYPE_SIZE)
+ {
+ tree calc_type = gnat_type_for_size (needed_precision, 0);
+ tree result;
+ tree check;
+
+ result = build_binary_op (code, calc_type,
+ convert (calc_type, lhs),
+ convert (calc_type, rhs));
+
+ check = build_binary_op
+ (TRUTH_ORIF_EXPR, integer_type_node,
+ build_binary_op (LT_EXPR, integer_type_node, result,
+ convert (calc_type, type_min)),
+ build_binary_op (GT_EXPR, integer_type_node, result,
+ convert (calc_type, type_max)));
+
+ result = convert (gnu_type, result);
+
+ return emit_check (check, result, CE_Overflow_Check_Failed);
+ }
+ }
+
+ gnu_expr = build_binary_op (code, gnu_type, lhs, rhs);
+ rhs_ge_zero = build_binary_op (GE_EXPR, integer_type_node, rhs, zero);
+
+ switch (code)
+ {
+ case PLUS_EXPR:
+ /* When rhs >= 0, overflow when lhs > type_max - rhs */
+ check_pos = build_binary_op (GT_EXPR, integer_type_node, lhs,
+ build_binary_op (MINUS_EXPR, gnu_type,
+ type_max, rhs)),
+
+ /* When rhs < 0, overflow when lhs < type_min - rhs */
+ check_neg = build_binary_op (LT_EXPR, integer_type_node, lhs,
+ build_binary_op (MINUS_EXPR, gnu_type,
+ type_min, rhs));
+ break;
+
+ case MINUS_EXPR:
+ /* When rhs >= 0, overflow when lhs < type_min + rhs */
+ check_pos = build_binary_op (LT_EXPR, integer_type_node, lhs,
+ build_binary_op (PLUS_EXPR, gnu_type,
+ type_min, rhs)),
+
+ /* When rhs < 0, overflow when lhs > type_max + rhs */
+ check_neg = build_binary_op (GT_EXPR, integer_type_node, lhs,
+ build_binary_op (PLUS_EXPR, gnu_type,
+ type_max, rhs));
+ break;
+
+ case MULT_EXPR:
+ /* The check here is designed to be efficient if the rhs is constant,
+ Four different check expressions determine wether X * C overflows,
+ depending on C.
+ C == 0 => false
+ C > 0 => X > type_max / C || X < type_min / C
+ C == -1 => X == type_min
+ C < -1 => X > type_min / C || X < type_max / C */
+
+ tmp1 = build_binary_op (TRUNC_DIV_EXPR, gnu_type, type_max, rhs);
+ tmp2 = build_binary_op (TRUNC_DIV_EXPR, gnu_type, type_min, rhs);
+
+ check_pos = build_binary_op (TRUTH_ANDIF_EXPR, integer_type_node,
+ build_binary_op (NE_EXPR, integer_type_node, zero, rhs),
+ build_binary_op (TRUTH_ORIF_EXPR, integer_type_node,
+ build_binary_op (GT_EXPR, integer_type_node, lhs, tmp1),
+ build_binary_op (LT_EXPR, integer_type_node, lhs, tmp2)));
+
+ check_neg = fold_build3 (COND_EXPR, integer_type_node,
+ build_binary_op (EQ_EXPR, integer_type_node, rhs,
+ build_int_cst (gnu_type, -1)),
+ build_binary_op (EQ_EXPR, integer_type_node, lhs, type_min),
+ build_binary_op (TRUTH_ORIF_EXPR, integer_type_node,
+ build_binary_op (GT_EXPR, integer_type_node, lhs, tmp2),
+ build_binary_op (LT_EXPR, integer_type_node, lhs, tmp1)));
+ break;
+
+ default:
+ gcc_unreachable();
+ }
+
+ return emit_check (fold_build3 (COND_EXPR, integer_type_node, rhs_ge_zero,
+ check_pos, check_neg),
+ gnu_expr, CE_Overflow_Check_Failed);
+}
+
/* Emit code for a range check. GNU_EXPR is the expression to be checked,
GNAT_RANGE_TYPE the gnat type or subtype containing the bounds against
which we have to check. */
@@ -6114,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))
@@ -6913,7 +7119,7 @@ set_expr_location_from_node (tree node, Node_Id gnat_node)
if (!Sloc_to_locus (Sloc (gnat_node), &locus))
return;
- set_expr_location (node, locus);
+ SET_EXPR_LOCATION (node, locus);
}
/* Return a colon-separated list of encodings contained in encoded Ada
diff --git a/gcc/ada/utils.c b/gcc/ada/gcc-interface/utils.c
index 27825595885..dcf0558ec9d 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/gcc-interface/utils.c
@@ -43,7 +43,8 @@
#include "function.h"
#include "cgraph.h"
#include "tree-inline.h"
-#include "tree-gimple.h"
+#include "tree-iterator.h"
+#include "gimple.h"
#include "tree-dump.h"
#include "pointer-set.h"
#include "langhooks.h"
@@ -522,6 +523,13 @@ gnat_init_decl_processing (void)
this before we can expand the GNAT types. */
size_type_node = gnat_type_for_size (GET_MODE_BITSIZE (Pmode), 0);
set_sizetype (size_type_node);
+
+ /* In Ada, we use an unsigned 8-bit type for the default boolean type. */
+ boolean_type_node = make_node (BOOLEAN_TYPE);
+ TYPE_PRECISION (boolean_type_node) = 1;
+ fixup_unsigned_type (boolean_type_node);
+ TYPE_RM_SIZE_NUM (boolean_type_node) = bitsize_int (1);
+
build_common_tree_nodes_2 (0);
ptr_void_type_node = build_pointer_type (void_type_node);
@@ -534,6 +542,7 @@ void
init_gigi_decls (tree long_long_float_type, tree exception_type)
{
tree endlink, decl;
+ tree int64_type = gnat_type_for_size (64, 0);
unsigned int i;
/* Set the types that GCC and Gigi use from the front end. We would like
@@ -622,6 +631,13 @@ init_gigi_decls (tree long_long_float_type, tree exception_type)
endlink)),
NULL_TREE, false, true, true, NULL, Empty);
+ /* This is used for 64-bit multiplication with overflow checking. */
+ mulv64_decl
+ = create_subprog_decl (get_identifier ("__gnat_mulv64"), NULL_TREE,
+ build_function_type_list (int64_type, int64_type,
+ int64_type, NULL_TREE),
+ NULL_TREE, false, true, true, NULL, Empty);
+
/* Make the types and functions used for exception processing. */
jmpbuf_type
= build_array_type (gnat_type_for_mode (Pmode, 0),
@@ -1739,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;
@@ -1761,7 +1777,8 @@ create_param_decl (tree param_name, tree param_type, bool readonly)
lead to various ABI violations. */
if (targetm.calls.promote_prototypes (param_type)
&& (TREE_CODE (param_type) == INTEGER_TYPE
- || TREE_CODE (param_type) == ENUMERAL_TYPE)
+ || TREE_CODE (param_type) == ENUMERAL_TYPE
+ || TREE_CODE (param_type) == BOOLEAN_TYPE)
&& TYPE_PRECISION (param_type) < TYPE_PRECISION (integer_type_node))
{
/* We have to be careful about biased types here. Make a subtype
@@ -2199,12 +2216,12 @@ gnat_genericize (tree fndecl)
pointer_set_destroy (p_set);
}
-/* Finish the definition of the current subprogram and compile it all the way
- to assembler language output. BODY is the tree corresponding to
- the subprogram. */
+/* Finish the definition of the current subprogram BODY and compile it all the
+ way to assembler language output. ELAB_P tells if this is called for an
+ elaboration routine, to be entirely discarded if empty. */
void
-end_subprog_body (tree body)
+end_subprog_body (tree body, bool elab_p)
{
tree fndecl = current_function_decl;
@@ -2217,8 +2234,7 @@ end_subprog_body (tree body)
/* Deal with inline. If declared inline or we should default to inline,
set the flag in the decl. */
- DECL_INLINE (fndecl)
- = DECL_DECLARED_INLINE_P (fndecl) || flag_inline_trees == 2;
+ DECL_INLINE (fndecl) = 1;
/* We handle pending sizes via the elaboration of types, so we don't
need to save them. */
@@ -2247,7 +2263,13 @@ end_subprog_body (tree body)
if (!DECL_CONTEXT (fndecl))
{
gnat_gimplify_function (fndecl);
- cgraph_finalize_function (fndecl, false);
+
+ /* If this is an empty elaboration proc, just discard the node.
+ Otherwise, compile further. */
+ if (elab_p && empty_body_p (gimple_body (fndecl)))
+ cgraph_remove_node (cgraph_node (fndecl));
+ else
+ cgraph_finalize_function (fndecl, false);
}
else
/* Register this function with cgraph just far enough to get it
@@ -2629,7 +2651,7 @@ build_template (tree template_type, tree array_type, tree expr)
return gnat_build_constructor (template_type, nreverse (template_elts));
}
-/* Build a VMS descriptor from a Mechanism_Type, which must specify
+/* Build a 32bit 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 an entity used
@@ -2637,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;
@@ -2667,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;
@@ -2684,6 +2706,7 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
{
case INTEGER_TYPE:
case ENUMERAL_TYPE:
+ case BOOLEAN_TYPE:
if (TYPE_VAX_FLOATING_POINT_P (type))
switch (tree_low_cst (TYPE_DIGITS_VALUE (type), 1))
{
@@ -2752,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;
@@ -2774,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",
@@ -2800,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
@@ -2819,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),
@@ -2836,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
@@ -2887,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,
@@ -2895,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;
}
@@ -2931,6 +2968,322 @@ build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
return record_type;
}
+/* 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 an entity used
+ to print out an error message if the mechanism cannot be applied to
+ an object of that type and also for the name. */
+
+tree
+build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
+{
+ tree record64_type = make_node (RECORD_TYPE);
+ tree pointer64_type;
+ tree field_list64 = 0;
+ int class;
+ int dtype = 0;
+ tree inner_type;
+ int ndim;
+ int i;
+ tree *idx_arr;
+ tree tem;
+
+ /* If TYPE is an unconstrained array, use the underlying array type. */
+ if (TREE_CODE (type) == UNCONSTRAINED_ARRAY_TYPE)
+ type = TREE_TYPE (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (type))));
+
+ /* If this is an array, compute the number of dimensions in the array,
+ get the index types, and point to the inner type. */
+ if (TREE_CODE (type) != ARRAY_TYPE)
+ ndim = 0;
+ else
+ for (ndim = 1, inner_type = type;
+ TREE_CODE (TREE_TYPE (inner_type)) == ARRAY_TYPE
+ && TYPE_MULTI_ARRAY_P (TREE_TYPE (inner_type));
+ ndim++, inner_type = TREE_TYPE (inner_type))
+ ;
+
+ idx_arr = (tree *) alloca (ndim * sizeof (tree));
+
+ if (mech != By_Descriptor_NCA
+ && TREE_CODE (type) == ARRAY_TYPE && TYPE_CONVENTION_FORTRAN_P (type))
+ for (i = ndim - 1, inner_type = type;
+ i >= 0;
+ i--, inner_type = TREE_TYPE (inner_type))
+ idx_arr[i] = TYPE_DOMAIN (inner_type);
+ else
+ for (i = 0, inner_type = type;
+ i < ndim;
+ i++, inner_type = TREE_TYPE (inner_type))
+ idx_arr[i] = TYPE_DOMAIN (inner_type);
+
+ /* Now get the DTYPE value. */
+ switch (TREE_CODE (type))
+ {
+ case INTEGER_TYPE:
+ case ENUMERAL_TYPE:
+ case BOOLEAN_TYPE:
+ if (TYPE_VAX_FLOATING_POINT_P (type))
+ switch (tree_low_cst (TYPE_DIGITS_VALUE (type), 1))
+ {
+ case 6:
+ dtype = 10;
+ break;
+ case 9:
+ dtype = 11;
+ break;
+ case 15:
+ dtype = 27;
+ break;
+ }
+ else
+ switch (GET_MODE_BITSIZE (TYPE_MODE (type)))
+ {
+ case 8:
+ dtype = TYPE_UNSIGNED (type) ? 2 : 6;
+ break;
+ case 16:
+ dtype = TYPE_UNSIGNED (type) ? 3 : 7;
+ break;
+ case 32:
+ dtype = TYPE_UNSIGNED (type) ? 4 : 8;
+ break;
+ case 64:
+ dtype = TYPE_UNSIGNED (type) ? 5 : 9;
+ break;
+ case 128:
+ dtype = TYPE_UNSIGNED (type) ? 25 : 26;
+ break;
+ }
+ break;
+
+ case REAL_TYPE:
+ dtype = GET_MODE_BITSIZE (TYPE_MODE (type)) == 32 ? 52 : 53;
+ break;
+
+ case COMPLEX_TYPE:
+ if (TREE_CODE (TREE_TYPE (type)) == INTEGER_TYPE
+ && TYPE_VAX_FLOATING_POINT_P (type))
+ switch (tree_low_cst (TYPE_DIGITS_VALUE (type), 1))
+ {
+ case 6:
+ dtype = 12;
+ break;
+ case 9:
+ dtype = 13;
+ break;
+ case 15:
+ dtype = 29;
+ }
+ else
+ dtype = GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (type))) == 32 ? 54: 55;
+ break;
+
+ case ARRAY_TYPE:
+ dtype = 14;
+ break;
+
+ default:
+ break;
+ }
+
+ /* Get the CLASS value. */
+ switch (mech)
+ {
+ case By_Descriptor_A:
+ class = 4;
+ break;
+ case By_Descriptor_NCA:
+ class = 10;
+ break;
+ case By_Descriptor_SB:
+ class = 15;
+ break;
+ case By_Descriptor:
+ case By_Descriptor_S:
+ default:
+ class = 1;
+ break;
+ }
+
+ /* Make the type for a 64bit descriptor for VMS. The first six fields
+ are the same for all types. */
+
+ field_list64 = chainon (field_list64,
+ make_descriptor_field ("MBO",
+ gnat_type_for_size (16, 1),
+ record64_type, size_int (1)));
+
+ field_list64 = chainon (field_list64,
+ make_descriptor_field ("DTYPE",
+ gnat_type_for_size (8, 1),
+ record64_type, size_int (dtype)));
+ field_list64 = chainon (field_list64,
+ make_descriptor_field ("CLASS",
+ gnat_type_for_size (8, 1),
+ record64_type, size_int (class)));
+
+ field_list64 = chainon (field_list64,
+ make_descriptor_field ("MBMO",
+ gnat_type_for_size (32, 1),
+ record64_type, ssize_int (-1)));
+
+ field_list64
+ = chainon (field_list64,
+ make_descriptor_field
+ ("LENGTH", gnat_type_for_size (64, 1), record64_type,
+ size_in_bytes (mech == By_Descriptor_A ? inner_type : type)));
+
+ pointer64_type = build_pointer_type_for_mode (type, DImode, false);
+
+ field_list64
+ = chainon (field_list64,
+ make_descriptor_field
+ ("POINTER", pointer64_type, record64_type,
+ build_unary_op (ADDR_EXPR,
+ pointer64_type,
+ build0 (PLACEHOLDER_EXPR, type))));
+
+ switch (mech)
+ {
+ case By_Descriptor:
+ case By_Descriptor_S:
+ break;
+
+ case By_Descriptor_SB:
+ field_list64
+ = chainon (field_list64,
+ make_descriptor_field
+ ("SB_L1", gnat_type_for_size (64, 1), record64_type,
+ TREE_CODE (type) == ARRAY_TYPE
+ ? TYPE_MIN_VALUE (TYPE_DOMAIN (type)) : size_zero_node));
+ field_list64
+ = chainon (field_list64,
+ make_descriptor_field
+ ("SB_U1", gnat_type_for_size (64, 1), record64_type,
+ TREE_CODE (type) == ARRAY_TYPE
+ ? TYPE_MAX_VALUE (TYPE_DOMAIN (type)) : size_zero_node));
+ break;
+
+ case By_Descriptor_A:
+ case By_Descriptor_NCA:
+ field_list64 = chainon (field_list64,
+ make_descriptor_field ("SCALE",
+ gnat_type_for_size (8, 1),
+ record64_type,
+ size_zero_node));
+
+ field_list64 = chainon (field_list64,
+ make_descriptor_field ("DIGITS",
+ gnat_type_for_size (8, 1),
+ record64_type,
+ size_zero_node));
+
+ field_list64
+ = chainon (field_list64,
+ make_descriptor_field
+ ("AFLAGS", gnat_type_for_size (8, 1), record64_type,
+ size_int (mech == By_Descriptor_NCA
+ ? 0
+ /* Set FL_COLUMN, FL_COEFF, and FL_BOUNDS. */
+ : (TREE_CODE (type) == ARRAY_TYPE
+ && TYPE_CONVENTION_FORTRAN_P (type)
+ ? 224 : 192))));
+
+ field_list64 = chainon (field_list64,
+ make_descriptor_field ("DIMCT",
+ gnat_type_for_size (8, 1),
+ record64_type,
+ size_int (ndim)));
+
+ field_list64 = chainon (field_list64,
+ make_descriptor_field ("MBZ",
+ gnat_type_for_size (32, 1),
+ record64_type,
+ size_int (0)));
+ field_list64 = chainon (field_list64,
+ make_descriptor_field ("ARSIZE",
+ gnat_type_for_size (64, 1),
+ record64_type,
+ size_in_bytes (type)));
+
+ /* Now build a pointer to the 0,0,0... element. */
+ tem = build0 (PLACEHOLDER_EXPR, type);
+ for (i = 0, inner_type = type; i < ndim;
+ i++, inner_type = TREE_TYPE (inner_type))
+ tem = build4 (ARRAY_REF, TREE_TYPE (inner_type), tem,
+ convert (TYPE_DOMAIN (inner_type), size_zero_node),
+ NULL_TREE, NULL_TREE);
+
+ field_list64
+ = chainon (field_list64,
+ make_descriptor_field
+ ("A0",
+ build_pointer_type_for_mode (inner_type, DImode, false),
+ record64_type,
+ build1 (ADDR_EXPR,
+ build_pointer_type_for_mode (inner_type, DImode,
+ false),
+ tem)));
+
+ /* Next come the addressing coefficients. */
+ tem = size_one_node;
+ for (i = 0; i < ndim; i++)
+ {
+ char fname[3];
+ tree idx_length
+ = size_binop (MULT_EXPR, tem,
+ size_binop (PLUS_EXPR,
+ size_binop (MINUS_EXPR,
+ TYPE_MAX_VALUE (idx_arr[i]),
+ TYPE_MIN_VALUE (idx_arr[i])),
+ size_int (1)));
+
+ fname[0] = (mech == By_Descriptor_NCA ? 'S' : 'M');
+ fname[1] = '0' + i, fname[2] = 0;
+ field_list64
+ = chainon (field_list64,
+ make_descriptor_field (fname,
+ gnat_type_for_size (64, 1),
+ record64_type, idx_length));
+
+ if (mech == By_Descriptor_NCA)
+ tem = idx_length;
+ }
+
+ /* Finally here are the bounds. */
+ for (i = 0; i < ndim; i++)
+ {
+ char fname[3];
+
+ fname[0] = 'L', fname[1] = '0' + i, fname[2] = 0;
+ field_list64
+ = chainon (field_list64,
+ make_descriptor_field
+ (fname, gnat_type_for_size (64, 1), record64_type,
+ TYPE_MIN_VALUE (idx_arr[i])));
+
+ fname[0] = 'U';
+ field_list64
+ = chainon (field_list64,
+ make_descriptor_field
+ (fname, gnat_type_for_size (64, 1), record64_type,
+ TYPE_MAX_VALUE (idx_arr[i])));
+ }
+ break;
+
+ default:
+ post_error ("unsupported descriptor type for &", gnat_entity);
+ }
+
+ finish_record_type (record64_type, field_list64, 0, true);
+ create_type_decl (create_concat_name (gnat_entity, "DESC64"), record64_type,
+ NULL, true, false, gnat_entity);
+
+ return record64_type;
+}
+
/* Utility routine for above code to make a field. */
static tree
@@ -2944,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);
@@ -2959,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))
{
@@ -2977,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)
{
@@ -3033,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;
@@ -3052,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);
}
@@ -3062,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. */
@@ -3090,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;
@@ -3118,7 +3664,7 @@ build_function_stub (tree gnu_subprog, Entity_Id gnat_subprog)
gnat_poplevel ();
allocate_struct_function (gnu_stub_decl, false);
- end_subprog_body (gnu_body);
+ end_subprog_body (gnu_body, false);
}
/* Build a type to be used to represent an aliased object whose nominal
@@ -3323,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));
@@ -3363,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
@@ -3714,9 +4261,6 @@ convert (tree type, tree expr)
case VOID_TYPE:
return fold_build1 (CONVERT_EXPR, type, expr);
- case BOOLEAN_TYPE:
- return fold_convert (type, gnat_truthvalue_conversion (expr));
-
case INTEGER_TYPE:
if (TYPE_HAS_ACTUAL_BOUNDS_P (type)
&& (ecode == ARRAY_TYPE || ecode == UNCONSTRAINED_ARRAY_TYPE
@@ -3731,6 +4275,7 @@ convert (tree type, tree expr)
/* ... fall through ... */
case ENUMERAL_TYPE:
+ case BOOLEAN_TYPE:
/* If we are converting an additive expression to an integer type
with lower precision, be wary of the optimization that can be
applied by convert_to_integer. There are 2 problematic cases:
@@ -4211,7 +4756,7 @@ gnat_write_global_declarations (void)
* ************************************************************************ */
/* The general scheme is fairly simple:
-
+
For each builtin function/type to be declared, gnat_install_builtins calls
internal facilities which eventually get to gnat_push_decl, which in turn
tracks the so declared builtin function decls in the 'builtin_decls' global
@@ -4242,7 +4787,7 @@ builtin_decl_for (tree name)
??? This is a first implementation shot, still in rough shape. It is
heavily inspired from the "C" family implementation, with chunks copied
verbatim from there.
-
+
Two obvious TODO candidates are
o Use a more efficient name/decl mapping scheme
o Devise a middle-end infrastructure to avoid having to copy
@@ -4693,7 +5238,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args,
*no_add_attrs = true;
}
}
-
+
if (args)
{
tree position = TREE_VALUE (args);
@@ -4712,7 +5257,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args,
}
}
}
-
+
return NULL_TREE;
}
@@ -4763,7 +5308,7 @@ handle_malloc_attribute (tree *node, tree name, tree ARG_UNUSED (args),
}
/* Fake handler for attributes we don't properly support. */
-
+
tree
fake_attribute_handler (tree * ARG_UNUSED (node),
tree ARG_UNUSED (name),
@@ -4817,10 +5362,10 @@ def_builtin_1 (enum built_in_function fncode,
const char *libname;
/* Preserve an already installed decl. It most likely was setup in advance
- (e.g. as part of the internal builtins) for specific reasons. */
+ (e.g. as part of the internal builtins) for specific reasons. */
if (built_in_decls[(int) fncode] != NULL_TREE)
return;
-
+
gcc_assert ((!both_p && !fallback_p)
|| !strncmp (name, "__builtin_",
strlen ("__builtin_")));
diff --git a/gcc/ada/utils2.c b/gcc/ada/gcc-interface/utils2.c
index 300fbd37d01..5077e640121 100644
--- a/gcc/ada/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);
@@ -2151,25 +2163,52 @@ 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_FORMAL is how we find the descriptor record. GNAT_ACTUAL is
+ 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)
+fill_vms_descriptor (tree expr, Entity_Id gnat_formal, Node_Id gnat_actual)
{
- tree record_type = TREE_TYPE (TREE_TYPE (get_gnu_tree (gnat_formal)));
tree field;
+ tree parm_decl = get_gnu_tree (gnat_formal);
tree const_list = NULL_TREE;
+ tree record_type = TREE_TYPE (TREE_TYPE (parm_decl));
+ int do_range_check =
+ strcmp ("MBO",
+ IDENTIFIER_POINTER (DECL_NAME (TYPE_FIELDS (record_type))));
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-style.texi b/gcc/ada/gnat-style.texi
index 4600d1fd849..8af9fc9bb02 100644
--- a/gcc/ada/gnat-style.texi
+++ b/gcc/ada/gnat-style.texi
@@ -7,23 +7,23 @@
@c o
@c G N A T C O D I N G S T Y L E o
@c o
-@c Copyright (C) 1992-2007, AdaCore o
-@c o
-@c GNAT is free software; you can redistribute it and/or modify it under o
-@c terms of the GNU General Public License as published by the Free Soft- o
-@c ware Foundation; either version 2, or (at your option) any later ver- o
-@c sion. GNAT is distributed in the hope that it will be useful, but WITH- o
-@c OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY o
-@c or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License o
-@c for more details. You should have received a copy of the GNU General o
-@c Public License distributed with GNAT; see file COPYING. If not, write o
-@c to the Free Software Foundation, 51 Franklin Street, Fifth Floor, o
-@c Boston, MA 02110-1301, USA. o
+@c GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com). o
@c o
@c oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
@setfilename gnat-style.info
+@copying
+Copyright @copyright{} 1992-2007, Free Software Foundation, Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with no Front-Cover Texts and with no Back-Cover
+Texts. A copy of the license is included in the section entitled
+``GNU Free Documentation License''.
+@end copying
+
@settitle GNAT Coding Style
@setchapternewpage odd
@@ -49,17 +49,7 @@
@page
@vskip 0pt plus 1filll
-Copyright @copyright{} 1995-2007, Free Software Foundation
-
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1
-or any later version published by the Free Software Foundation;
-with the Invariant Sections being ``GNU Free Documentation License'', with the
-Front-Cover Texts being
-``GNAT Coding Style'' and ``A Guide for GNAT Developers'',
-and with no Back-Cover Texts.
-A copy of the license is included in the section entitled
-``GNU Free Documentation License''.
+@insertcopying
@end titlepage
@raisesections
@@ -76,15 +66,7 @@ A Guide for GNAT Developers
GNAT, The GNU Ada Compiler@*
@noindent
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1
-or any later version published by the Free Software Foundation;
-with the Invariant Sections being ``GNU Free Documentation License'', with the
-Front-Cover Texts being
-``GNAT Coding Style'' and ``A Guide for GNAT Developers''
-and with no Back-Cover Texts.
-A copy of the license is included in the section entitled
-``GNU Free Documentation License''.
+@insertcopying
@end ifnottex
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index 47152e4bfbe..a768528d40b 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -8,15 +8,23 @@
@c o
@c G N A T _ RM o
@c o
-@c Copyright (C) 1995-2008, Free Software Foundation o
-@c o
-@c o
@c GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com). o
@c o
@c oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
@setfilename gnat_rm.info
+@copying
+Copyright @copyright{} 1995-2008, Free Software Foundation, Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with the Front-Cover Texts being ``GNAT Reference
+Manual'', and with no Back-Cover Texts. A copy of the license is
+included in the section entitled ``GNU Free Documentation License''.
+@end copying
+
@set EDITION GNAT
@set DEFAULTLANGUAGEVERSION Ada 2005
@set NONDEFAULTLANGUAGEVERSION Ada 95
@@ -33,18 +41,6 @@
* GNAT Reference Manual: (gnat_rm). Reference Manual for GNU Ada tools.
@end direntry
-@copying
-Copyright @copyright{} 1995-2008, Free Software Foundation, Inc.
-
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.2
-or any later version published by the Free Software Foundation;
-with the Invariant Sections being ``GNU Free Documentation License'',
-with the Front-Cover Texts being ``GNAT Reference Manual'', and with
-no Back-Cover Texts. A copy of the license is included in the section
-entitled ``GNU Free Documentation License''.
-@end copying
-
@titlepage
@title GNAT Reference Manual
@subtitle GNAT, The GNU Ada Compiler
@@ -1833,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
@@ -1865,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
@@ -1934,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
@@ -1951,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
@@ -2016,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
@@ -2038,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
@@ -2464,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
@@ -2497,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
@@ -2570,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
@@ -2616,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
@@ -3400,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
@@ -3796,6 +3809,13 @@ package Sort is
end Sort;
@end smallexample
+@noindent
+Note: postcondition pragmas associated with subprograms that are
+marked as Inline_Always, or those marked as Inline with front-end
+inlining (-gnatN option set) are accepted and legality-checked
+by the compiler, but are ignored at run-time even if postcondition
+checking is enabled.
+
@node Pragma Precondition
@unnumberedsec Pragma Precondition
@cindex Preconditions
@@ -3830,13 +3850,22 @@ package Math_Functions is
end Math_Functions;
@end smallexample
-@code{Postcondition} pragmas may appear either immediate following the
+@noindent
+@code{Precondition} pragmas may appear either immediate following the
(separate) declaration of a subprogram, or at the start of the
declarations of a subprogram body. Only other pragmas may intervene
(that is appear between the subprogram declaration and its
postconditions, or appear before the postcondition in the
declaration sequence in a subprogram body).
+Note: postcondition pragmas associated with subprograms that are
+marked as Inline_Always, or those marked as Inline with front-end
+inlining (-gnatN option set) are accepted and legality-checked
+by the compiler, but are ignored at run-time even if postcondition
+checking is enabled.
+
+
+
@node Pragma Profile (Ravenscar)
@unnumberedsec Pragma Profile (Ravenscar)
@findex Ravenscar
@@ -4418,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 99f3c8631d4..204192c1223 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -1,26 +1,30 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
+
@c oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
@c o
@c GNAT DOCUMENTATION o
@c o
@c G N A T _ U G N o
@c o
-@c Copyright (C) 1992-2008, AdaCore o
-@c o
-@c GNAT is free software; you can redistribute it and/or modify it under o
-@c terms of the GNU General Public License as published by the Free Soft- o
-@c ware Foundation; either version 2, or (at your option) any later ver- o
-@c sion. GNAT is distributed in the hope that it will be useful, but WITH- o
-@c OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY o
-@c or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License o
-@c for more details. You should have received a copy of the GNU General o
-@c Public License distributed with GNAT; see file COPYING. If not, write o
-@c to the Free Software Foundation, 51 Franklin Street, Fifth Floor, o
-@c Boston, MA 02110-1301, USA. o
+@c GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com). o
@c o
@c oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
+@setfilename gnat_ugn.info
+
+@copying
+Copyright @copyright{} 1995-2005, 2006, 2007, 2008 Free Software Foundation,
+Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.2 or
+any later version published by the Free Software Foundation; with no
+Invariant Sections, with no Front-Cover Texts and with no Back-Cover
+Texts. A copy of the license is included in the section entitled
+``GNU Free Documentation License''.
+@end copying
+
@c oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
@c
@c GNAT_UGN Style Guide
@@ -76,8 +80,6 @@
@c
@c oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
-@setfilename gnat_ugn.info
-
@set NOW January 2007
@c This flag is used where the text refers to conditions that exist when the
@c text was entered into the document but which may change over time.
@@ -118,21 +120,6 @@
@syncodeindex fn cp
@c %**end of header
-@copying
-Copyright @copyright{} 1995-2005, 2006, 2007, 2008 Free Software Foundation,
-Inc.
-
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.2
-or any later version published by the Free Software Foundation;
-with the Invariant Sections being ``GNU Free Documentation License'', with the
-Front-Cover Texts being
-``@value{EDITION} User's Guide'',
-and with no Back-Cover Texts.
-A copy of the license is included in the section entitled
-``GNU Free Documentation License''.
-@end copying
-
@titlepage
@title @value{EDITION} User's Guide
@ifset vms
@@ -2381,7 +2368,7 @@ that for inlining to actually occur as a result of the use of this switch,
it is necessary to compile in optimizing mode.
@cindex @option{-gnatN} switch
-The use of @option{-gnatN} activates a more extensive inlining optimization
+The use of @option{-gnatN} activates inlining optimization
that is performed by the front end of the compiler. This inlining does
not require that the code generation be optimized. Like @option{-gnatn},
the use of this switch generates additional dependencies.
@@ -2389,6 +2376,12 @@ Note that
@option{-gnatN} automatically implies @option{-gnatn} so it is not necessary
to specify both options.
+When using a gcc-based back end (in practice this means using any version
+of GNAT other than the JGNAT, .NET or GNAAMP versions), then the use of
+@option{-gnatN} is deprecated, and the use of @option{-gnatn} is preferred.
+Historically front end inlining was more extensive than the gcc back end
+inlining, but that is no longer the case.
+
@item
If an object file @file{O} depends on the proper body of a subunit through
inlining or instantiation, it depends on the parent unit of the subunit.
@@ -3911,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
@@ -4025,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})
@@ -4041,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})
@@ -4839,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})
@@ -6210,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!
@@ -6226,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
@@ -6246,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;
@@ -6259,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
@@ -6323,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}.
@@ -7194,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
@@ -9524,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})
@@ -20277,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
@@ -20352,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})
@@ -20517,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::
@@ -21018,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.
+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.
-This rule has the following parameters:
+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.
-@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.
-
-By default no metrics checks are ON, so the @option{+R} option without
-parameters actually does not specify any check.
-
-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
@@ -21085,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
@@ -21096,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})
@@ -21548,7 +21561,7 @@ The control structures checked are the following:
@end itemize
@noindent
-The rule may have the following parameter for the @option{+R} option:
+The rule has the following parameter for the @option{+R} option:
@table @emph
@item N
@@ -21557,18 +21570,12 @@ level that is not flagged
@end table
@noindent
-If the parameter for the @option{+R} option is not a positive integer,
-the parameter is ignored and the rule is turned ON with the most recently
-specified maximal non-flagged nesting level.
+If the parameter for the @option{+R} option is not specified or
+if it is not a positive integer, @option{+R} option is ignored.
If more then one option is specified for the gnatcheck call, the later option and
new parameter override the previous one(s).
-A @option{+R} option with no parameter turns the rule ON using the maximal
-non-flagged nesting level specified by the most recent @option{+R} option with
-a parameter, or the value 4 if there is no such previous @option{+R} option.
-
-
@node Parameters_Out_Of_Order
@subsection @code{Parameters_Out_Of_Order}
@@ -22532,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
@@ -25521,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
@@ -25631,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
@@ -25855,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/gnatlink.adb b/gcc/ada/gnatlink.adb
index 99898223cf2..4da260d67d1 100644
--- a/gcc/ada/gnatlink.adb
+++ b/gcc/ada/gnatlink.adb
@@ -1484,25 +1484,11 @@ begin
Exit_Program (E_Fatal);
end if;
- -- Get target parameters
+ -- Initialize packages to be used
Namet.Initialize;
Csets.Initialize;
Snames.Initialize;
- Osint.Add_Default_Search_Dirs;
- Targparm.Get_Target_Parameters;
-
- if VM_Target /= No_VM then
- case VM_Target is
- when JVM_Target => Gcc := new String'("jgnat");
- when CLI_Target => Gcc := new String'("dotnet-gnatcompile");
- when No_VM => raise Program_Error;
- end case;
-
- Ada_Bind_File := True;
- Begin_Info := "-- BEGIN Object file/option list";
- End_Info := "-- END Object file/option list ";
- end if;
-- We always compile with -c
@@ -1510,50 +1496,6 @@ begin
Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
new String'("-c");
- -- If the main program is in Ada it is compiled with the following
- -- switches:
-
- -- -gnatA stops reading gnat.adc, since we don't know what
- -- pragmas would work, and we do not need it anyway.
-
- -- -gnatWb allows brackets coding for wide characters
-
- -- -gnatiw allows wide characters in identifiers. This is needed
- -- because bindgen uses brackets encoding for all upper
- -- half and wide characters in identifier names.
-
- if Ada_Bind_File then
- Binder_Options_From_ALI.Increment_Last;
- Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
- new String'("-gnatA");
- Binder_Options_From_ALI.Increment_Last;
- Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
- new String'("-gnatWb");
- Binder_Options_From_ALI.Increment_Last;
- Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
- new String'("-gnatiw");
- end if;
-
- -- Locate all the necessary programs and verify required files are present
-
- Gcc_Path := System.OS_Lib.Locate_Exec_On_Path (Gcc.all);
-
- if Gcc_Path = null then
- Exit_With_Error ("Couldn't locate " & Gcc.all);
- end if;
-
- if Linker_Path = null then
- if VM_Target = CLI_Target then
- Linker_Path := System.OS_Lib.Locate_Exec_On_Path ("ilasm");
-
- if Linker_Path = null then
- Exit_With_Error ("Couldn't locate ilasm");
- end if;
- else
- Linker_Path := Gcc_Path;
- end if;
- end if;
-
if Ali_File_Name = null then
Exit_With_Error ("no ali file given for link");
end if;
@@ -1624,6 +1566,18 @@ begin
:= String_Access (Arg);
end if;
+ -- Set the RTS_*_Path_Name variables, so that the
+ -- correct directories will be set when
+ -- Osint.Add_Default_Search_Dirs will be called later.
+
+ Opt.RTS_Src_Path_Name :=
+ Get_RTS_Search_Dir
+ (Arg (Arg'First + 6 .. Arg'Last), Include);
+
+ Opt.RTS_Lib_Path_Name :=
+ Get_RTS_Search_Dir
+ (Arg (Arg'First + 6 .. Arg'Last), Objects);
+
-- GNAT doesn't support the GCC multilib mechanism.
-- This means that, when a multilib switch is used
-- to request a particular compilation mode, the
@@ -1635,8 +1589,7 @@ begin
-- Pass -mrtp to the linker if --RTS=rtp was passed
- if Linker_Path = Gcc_Path
- and then Arg'Length > 8
+ if Arg'Length > 8
and then Arg (Arg'First + 6 .. Arg'First + 8) = "rtp"
then
Linker_Options.Increment_Last;
@@ -1645,8 +1598,7 @@ begin
-- Pass -fsjlj to the linker if --RTS=sjlj was passed
- elsif Linker_Path = Gcc_Path
- and then Arg'Length > 9
+ elsif Arg'Length > 9
and then Arg (Arg'First + 6 .. Arg'First + 9) = "sjlj"
then
Linker_Options.Increment_Last;
@@ -1660,6 +1612,78 @@ begin
end;
end if;
+ -- Get target parameters
+
+ Osint.Add_Default_Search_Dirs;
+ Targparm.Get_Target_Parameters;
+
+ if VM_Target /= No_VM then
+ case VM_Target is
+ when JVM_Target => Gcc := new String'("jgnat");
+ when CLI_Target => Gcc := new String'("dotnet-gnatcompile");
+ when No_VM => raise Program_Error;
+ end case;
+
+ Ada_Bind_File := True;
+ Begin_Info := "-- BEGIN Object file/option list";
+ End_Info := "-- END Object file/option list ";
+ end if;
+
+ -- If the main program is in Ada it is compiled with the following
+ -- switches:
+
+ -- -gnatA stops reading gnat.adc, since we don't know what
+ -- pragmas would work, and we do not need it anyway.
+
+ -- -gnatWb allows brackets coding for wide characters
+
+ -- -gnatiw allows wide characters in identifiers. This is needed
+ -- because bindgen uses brackets encoding for all upper
+ -- half and wide characters in identifier names.
+
+ if Ada_Bind_File then
+ Binder_Options_From_ALI.Increment_Last;
+ Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
+ new String'("-gnatA");
+ Binder_Options_From_ALI.Increment_Last;
+ Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
+ new String'("-gnatWb");
+ Binder_Options_From_ALI.Increment_Last;
+ Binder_Options_From_ALI.Table (Binder_Options_From_ALI.Last) :=
+ new String'("-gnatiw");
+ end if;
+
+ -- Locate all the necessary programs and verify required files are present
+
+ Gcc_Path := System.OS_Lib.Locate_Exec_On_Path (Gcc.all);
+
+ if Gcc_Path = null then
+ Exit_With_Error ("Couldn't locate " & Gcc.all);
+ end if;
+
+ if Linker_Path = null then
+ if VM_Target = CLI_Target then
+ Linker_Path := System.OS_Lib.Locate_Exec_On_Path ("ilasm");
+
+ if Linker_Path = null then
+ Exit_With_Error ("Couldn't locate ilasm");
+ end if;
+
+ elsif RTX_RTSS_Kernel_Module_On_Target then
+
+ -- Use Microsoft linker for RTSS modules
+
+ Linker_Path := System.OS_Lib.Locate_Exec_On_Path ("link");
+
+ if Linker_Path = null then
+ Exit_With_Error ("Couldn't locate link");
+ end if;
+
+ else
+ Linker_Path := Gcc_Path;
+ end if;
+ end if;
+
Write_Header;
-- If no output name specified, then use the base name of .ali file name
@@ -1680,6 +1704,11 @@ begin
Linker_Options.Table (Linker_Options.Last) :=
new String'("/OUTPUT=" & Output_File_Name.all);
+ elsif RTX_RTSS_Kernel_Module_On_Target then
+ Linker_Options.Increment_Last;
+ Linker_Options.Table (Linker_Options.Last) :=
+ new String'("/OUT:" & Output_File_Name.all);
+
else
Linker_Options.Increment_Last;
Linker_Options.Table (Linker_Options.Last) := new String'("-o");
@@ -1869,6 +1898,120 @@ begin
Num_Args := Num_Args - 1;
end if;
end loop;
+
+ elsif RTX_RTSS_Kernel_Module_On_Target then
+
+ -- Remove flags not relevant for Microsoft linker and adapt some
+ -- others.
+
+ for J in reverse Linker_Options.First .. Linker_Options.Last loop
+
+ -- Remove flags that are not accepted
+ if Linker_Options.Table (J)'Length = 0
+ or else Linker_Options.Table (J) (1 .. 2) = "-l"
+ or else Linker_Options.Table (J) (1 .. 3) = "-Wl"
+ or else Linker_Options.Table (J) (1 .. 3) = "-sh"
+ or else Linker_Options.Table (J) (1 .. 8) = "-Xlinker"
+ or else Linker_Options.Table (J) (1 .. 9) = "-mthreads"
+ then
+ Linker_Options.Table (J .. Linker_Options.Last - 1) :=
+ Linker_Options.Table (J + 1 .. Linker_Options.Last);
+ Linker_Options.Decrement_Last;
+ Num_Args := Num_Args - 1;
+
+ -- Replace "-L" by its counterpart "/LIBPATH:" and UNIX "/" by
+ -- Windows "\".
+ elsif Linker_Options.Table (J) (1 .. 2) = "-L" then
+ declare
+ Libpath_Option : constant String_Access := new String'
+ ("/LIBPATH:" &
+ Linker_Options.Table (J)
+ (3 .. Linker_Options.Table (J).all'Last));
+ begin
+ for Index in 10 .. Libpath_Option'Last loop
+ if Libpath_Option (Index) = '/' then
+ Libpath_Option (Index) := '\';
+ end if;
+ end loop;
+
+ Linker_Options.Table (J) := Libpath_Option;
+ end;
+
+ -- Replace "-g" by "/DEBUG"
+ elsif Linker_Options.Table (J) (1 .. 2) = "-g" then
+ Linker_Options.Table (J) := new String'("/DEBUG");
+
+ -- Replace "-o" by "/OUT:"
+ elsif Linker_Options.Table (J) (1 .. 2) = "-o" then
+ Linker_Options.Table (J + 1) := new String'
+ ("/OUT:" & Linker_Options.Table (J + 1).all);
+
+ Linker_Options.Table (J .. Linker_Options.Last - 1) :=
+ Linker_Options.Table (J + 1 .. Linker_Options.Last);
+ Linker_Options.Decrement_Last;
+ Num_Args := Num_Args - 1;
+
+ -- Replace "--stack=" by "/STACK:"
+ elsif Linker_Options.Table (J) (1 .. 8) = "--stack=" then
+ Linker_Options.Table (J) := new String'
+ ("/STACK:" &
+ Linker_Options.Table (J)
+ (9 .. Linker_Options.Table (J).all'Last));
+
+ -- Replace "-v" by its counterpart "/VERBOSE"
+ elsif Linker_Options.Table (J) (1 .. 2) = "-v" then
+ Linker_Options.Table (J) := new String'("/VERBOSE");
+ end if;
+ end loop;
+
+ -- Add some required flags to create RTSS modules
+
+ declare
+ Flags_For_Linker : constant array (1 .. 17) of String_Access :=
+ (new String'("/NODEFAULTLIB"),
+ new String'("/INCREMENTAL:NO"),
+ new String'("/NOLOGO"),
+ new String'("/DRIVER"),
+ new String'("/ALIGN:0x20"),
+ new String'("/SUBSYSTEM:NATIVE"),
+ new String'("/ENTRY:_RtapiProcessEntryCRT@8"),
+ new String'("/RELEASE"),
+ new String'("startupCRT.obj"),
+ new String'("rtxlibcmt.lib"),
+ new String'("oldnames.lib"),
+ new String'("rtapi_rtss.lib"),
+ new String'("Rtx_Rtss.lib"),
+ new String'("libkernel32.a"),
+ new String'("libws2_32.a"),
+ new String'("libmswsock.a"),
+ new String'("libadvapi32.a"));
+ -- These flags need to be passed to Microsoft linker. They
+ -- come from the RTX documentation.
+
+ Gcc_Lib_Path : constant String_Access := new String'
+ ("/LIBPATH:" & Include_Dir_Default_Prefix & "\..\");
+ -- Place to look for gcc related libraries, such as libgcc
+
+ begin
+ -- Replace UNIX "/" by Windows "\" in the path
+
+ for Index in 10 .. Gcc_Lib_Path.all'Last loop
+ if Gcc_Lib_Path (Index) = '/' then
+ Gcc_Lib_Path (Index) := '\';
+ end if;
+ end loop;
+
+ Linker_Options.Increment_Last;
+ Linker_Options.Table (Linker_Options.Last) := Gcc_Lib_Path;
+ Num_Args := Num_Args + 1;
+
+ for Index in Flags_For_Linker'Range loop
+ Linker_Options.Increment_Last;
+ Linker_Options.Table (Linker_Options.Last) :=
+ Flags_For_Linker (Index);
+ Num_Args := Num_Args + 1;
+ end loop;
+ end;
end if;
-- Remove duplicate stack size setting from the Linker_Options
@@ -1978,6 +2121,15 @@ begin
Linker_Options.Table (Linker_Options.Last) := Static_Libgcc;
Num_Args := Num_Args + 1;
end if;
+
+ elsif RTX_RTSS_Kernel_Module_On_Target then
+
+ -- Force the use of the static libgcc for RTSS modules
+
+ Linker_Options.Increment_Last;
+ Linker_Options.Table (Linker_Options.Last) :=
+ new String'("libgcc.a");
+ Num_Args := Num_Args + 1;
end if;
end Clean_Link_Option_Set;
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 24a6437f26b..c4e260104ad 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -102,6 +102,7 @@ int __gl_zero_cost_exceptions = 0;
int __gl_detect_blocking = 0;
int __gl_default_stack_size = -1;
int __gl_leap_seconds_support = 0;
+int __gl_canonical_streams = 0;
/* Indication of whether synchronous signal handler has already been
installed by a previous call to adainit. */
@@ -216,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)
{
@@ -261,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);
}
@@ -463,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)
@@ -513,8 +477,6 @@ __gnat_error_handler
msg = "unhandled signal";
}
- __gnat_adjust_context_for_raise (sig, ucontext);
-
Raise_From_Signal_Handler (exception, msg);
}
@@ -616,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
@@ -650,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,
@@ -730,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);
@@ -745,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
@@ -1027,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)
{
@@ -1047,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))
{
@@ -1142,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
@@ -1655,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 */
/*******************/
@@ -1666,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)),
@@ -1714,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);
}
@@ -1800,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
@@ -1910,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);
}
@@ -2181,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
@@ -2214,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 3ae13fc84ae..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;
@@ -659,21 +670,21 @@ package body Make is
-- Compiler, Binder & Linker Data and Subprograms --
----------------------------------------------------
- Gcc : String_Access := Program_Name ("gcc", "gnatmake");
- Gnatbind : String_Access := Program_Name ("gnatbind", "gnatmake");
- Gnatlink : String_Access := Program_Name ("gnatlink", "gnatmake");
+ Gcc : String_Access := Program_Name ("gcc", "gnatmake");
+ Gnatbind : String_Access := Program_Name ("gnatbind", "gnatmake");
+ Gnatlink : String_Access := Program_Name ("gnatlink", "gnatmake");
-- Default compiler, binder, linker programs
- Saved_Gcc : String_Access := null;
- Saved_Gnatbind : String_Access := null;
- Saved_Gnatlink : String_Access := null;
+ Saved_Gcc : String_Access := null;
+ Saved_Gnatbind : String_Access := null;
+ Saved_Gnatlink : String_Access := null;
-- Given by the command line. Will be used, if non null
- Gcc_Path : String_Access :=
+ Gcc_Path : String_Access :=
GNAT.OS_Lib.Locate_Exec_On_Path (Gcc.all);
- Gnatbind_Path : String_Access :=
+ Gnatbind_Path : String_Access :=
GNAT.OS_Lib.Locate_Exec_On_Path (Gnatbind.all);
- Gnatlink_Path : String_Access :=
+ Gnatlink_Path : String_Access :=
GNAT.OS_Lib.Locate_Exec_On_Path (Gnatlink.all);
-- Path for compiler, binder, linker programs, defaulted now for gnatdist.
-- Changed later if overridden on command line.
@@ -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/makeutl.adb b/gcc/ada/makeutl.adb
index 1755ade229c..3d0ee62eaed 100644
--- a/gcc/ada/makeutl.adb
+++ b/gcc/ada/makeutl.adb
@@ -246,7 +246,15 @@ package body Makeutl is
-- If we get here, the user has typed the executable name with no
-- directory prefix.
- return Get_Install_Dir (Locate_Exec_On_Path (Exec_Name).all);
+ declare
+ Path : constant String_Access := Locate_Exec_On_Path (Exec_Name);
+ begin
+ if Path = null then
+ return "";
+ else
+ return Get_Install_Dir (Path.all);
+ end if;
+ end;
end Executable_Prefix_Path;
----------
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 d743bb138e8..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
@@ -408,7 +412,7 @@ package body MLib.Utl is
if Driver_Name = No_Name then
if Gcc_Exec = null then
if Gcc_Name = null then
- Gcc_Name := Osint.Program_Name ("gcc", "gnatmake");
+ Gcc_Name := Osint.Program_Name ("gcc", "gnatmake");
end if;
Gcc_Exec := Locate_Exec_On_Path (Gcc_Name.all);
@@ -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 fc5894f70e2..f91eebf7f51 100644
--- a/gcc/ada/mlib-utl.ads
+++ b/gcc/ada/mlib-utl.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- --
@@ -47,12 +47,21 @@ package MLib.Utl is
procedure Ar
(Output_File : String;
Objects : Argument_List);
- -- Run ar to move all the binaries inside the archive. If ranlib is on the
- -- path, run it also. Output_File is the path name of the archive to
+ -- Run ar to move all the binaries inside the archive. If ranlib is on
+ -- the path, run it also. Output_File is the path name of the archive to
-- create. Objects is the list of the path names of the object files to be
- -- put in the archive.
+ -- put in the archive. This procedure currently assumes that it is always
+ -- called in the context of gnatmake. If other executables start using this
+ -- procedure, an additional parameter would need to be added, and calls to
+ -- Osint.Program_Name updated accordingly in the body.
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 600231c737a..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
@@ -528,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
@@ -1235,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
@@ -1403,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
@@ -1601,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/osint.ads b/gcc/ada/osint.ads
index 6cf7530f7fe..897779b178e 100644
--- a/gcc/ada/osint.ads
+++ b/gcc/ada/osint.ads
@@ -113,13 +113,13 @@ package Osint is
-- to "<target>-gcc". In the specific case where AAMP_On_Target is set, the
-- name "gcc" is mapped to "gnaamp", and names of the form "gnat*" are
-- mapped to "gnaamp*". This function clobbers Name_Buffer and Name_Len.
- -- Also look at any suffix, e.g. gnatmake-4.1 -> "gcc-4.1".
- -- Prog is the default name of the current program being executed, e.g.
- -- "gnatmake", "gnatlink".
+ -- Also look at any suffix, e.g. gnatmake-4.1 -> "gcc-4.1". Prog is the
+ -- default name of the current program being executed, e.g. "gnatmake",
+ -- "gnatlink".
procedure Write_Program_Name;
- -- Writes name of program as invoked to the current output
- -- (normally standard output).
+ -- Writes name of program as invoked to the current output (normally
+ -- standard output).
procedure Fail (S1 : String; S2 : String := ""; S3 : String := "");
pragma No_Return (Fail);
@@ -243,8 +243,8 @@ package Osint is
-- modified by update_path.
procedure Add_Default_Search_Dirs;
- -- This routine adds the default search dirs indicated by the
- -- environment variables and sdefault package.
+ -- This routine adds the default search dirs indicated by the environment
+ -- variables and sdefault package.
procedure Add_Lib_Search_Dir (Dir : String);
-- Add Dir at the end of the library file search path
@@ -256,11 +256,11 @@ package Osint is
(Search_Path : String_Access);
function Get_Next_Dir_In_Path
(Search_Path : String_Access) return String_Access;
- -- These subprograms are used to parse out the directory names in a
- -- search path specified by a Search_Path argument. The procedure
- -- initializes an internal pointer to point to the initial directory
- -- name, and calls to the function return successive directory names,
- -- with a null pointer marking the end of the list.
+ -- These subprograms are used to parse out the directory names in a search
+ -- path specified by a Search_Path argument. The procedure initializes an
+ -- internal pointer to point to the initial directory name, and calls to
+ -- the function return successive directory names, with a null pointer
+ -- marking the end of the list.
type Search_File_Type is (Include, Objects);
@@ -347,10 +347,9 @@ package Osint is
-- LF/CR
-- LF
- -- The source is terminated by an EOF (16#1A#) character, which is
- -- the last character of the returned source buffer (note that any
- -- EOF characters in positions other than the last source character
- -- are treated as representing blanks).
+ -- The source is terminated by an EOF (16#1A#) character, which is the last
+ -- character of the returned source buffer (note that any EOF characters in
+ -- positions other than the last source character are treated as blanks).
--
-- The logical lower bound of the source buffer is the input value of Lo,
-- and on exit Hi is set to the logical upper bound of the source buffer.
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 c8b84ab189e..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 |
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-env.adb b/gcc/ada/prj-env.adb
index dd52f353287..1744716342d 100644
--- a/gcc/ada/prj-env.adb
+++ b/gcc/ada/prj-env.adb
@@ -2353,18 +2353,38 @@ package body Prj.Env is
(Data.Object_Directory.Name, In_Tree);
end if;
- -- For a non-library project, add the object
- -- directory, if it is not a virtual project, and if
- -- there are Ada sources or if the project is an
- -- extending project. If there are no Ada sources,
- -- adding the object directory could disrupt the order
- -- of the object dirs in the path.
-
- elsif not Data.Virtual
- and then There_Are_Ada_Sources (In_Tree, Project)
- then
- Add_To_Object_Path
- (Data.Object_Directory.Name, In_Tree);
+ -- For a non-library project, add object directory if
+ -- it is not a virtual project, and if there are Ada
+ -- sources in the project or one of the projects it
+ -- extends. If there are no Ada sources, adding the
+ -- object directory could disrupt the order of the
+ -- object dirs in the path.
+
+ elsif not Data.Virtual then
+ declare
+ Add_Object_Dir : Boolean := False;
+ Prj : Project_Id := Project;
+
+ begin
+ while not Add_Object_Dir
+ and then Prj /= No_Project
+ loop
+ if In_Tree.Projects.Table
+ (Prj).Ada_Sources /= Nil_String
+ then
+ Add_Object_Dir := True;
+
+ else
+ Prj :=
+ In_Tree.Projects.Table (Prj).Extends;
+ end if;
+ end loop;
+
+ if Add_Object_Dir then
+ Add_To_Object_Path
+ (Data.Object_Directory.Name, In_Tree);
+ end if;
+ end;
end if;
end if;
end if;
diff --git a/gcc/ada/prj-makr.ads b/gcc/ada/prj-makr.ads
index 50a97e93b51..b3a658fc3e9 100644
--- a/gcc/ada/prj-makr.ads
+++ b/gcc/ada/prj-makr.ads
@@ -73,6 +73,11 @@ package Prj.Makr is
-- check for non Ada sources.
--
-- At least one of Name_Patterns and Foreign_Patterns is not empty
+ --
+ -- Note that this procedure currently assumes that it is only used by
+ -- gnatname. If other processes start using it, then an additional
+ -- parameter would need to be added, and call to Osint.Program_Name
+ -- updated accordingly in the body.
procedure Finalize;
-- Write the configuration pragmas file or the project file indicated in a
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb
index d84ba7fbbf7..db6a70cd7b0 100644
--- a/gcc/ada/prj-nmsc.adb
+++ b/gcc/ada/prj-nmsc.adb
@@ -65,9 +65,6 @@ package body Prj.Nmsc is
ALI_Suffix : constant String := ".ali";
-- File suffix for ali files
- Object_Suffix : constant String := Get_Target_Object_Suffix.all;
- -- File suffix for object files
-
type Name_Location is record
Name : File_Name_Type;
Location : Source_Ptr;
@@ -267,20 +264,6 @@ package body Prj.Nmsc is
Data : in out Project_Data);
-- Check the configuration attributes for the project
- procedure Check_For_Source
- (File_Name : File_Name_Type;
- Path_Name : Path_Name_Type;
- Project : Project_Id;
- In_Tree : Project_Tree_Ref;
- Data : in out Project_Data;
- Location : Source_Ptr;
- Language : Language_Index;
- Suffix : String;
- Naming_Exception : Boolean);
- -- Check if a file, with name File_Name and path Path_Name, in a source
- -- directory is a source for language Language in project Project of
- -- project tree In_Tree. ???
-
procedure Check_If_Externally_Built
(Project : Project_Id;
In_Tree : Project_Tree_Ref;
@@ -369,15 +352,6 @@ package body Prj.Nmsc is
-- Current_Dir should represent the current directory, and is passed for
-- efficiency to avoid system calls to recompute it.
- procedure Find_Sources
- (Project : Project_Id;
- In_Tree : Project_Tree_Ref;
- Data : in out Project_Data;
- For_Language : Language_Index;
- Current_Dir : String);
- -- Find all the sources in all of the source directories of a project for
- -- a specified language.
-
procedure Search_Directories
(Project : Project_Id;
In_Tree : Project_Tree_Ref;
@@ -467,8 +441,7 @@ package body Prj.Nmsc is
-- Source_Names.
procedure Find_Explicit_Sources
- (Lang : Language_Index;
- Current_Dir : String;
+ (Current_Dir : String;
Project : Project_Id;
In_Tree : Project_Tree_Ref;
Data : in out Project_Data);
@@ -566,16 +539,6 @@ package body Prj.Nmsc is
-- Current_Dir should represent the current directory, and is passed for
-- efficiency to avoid system calls to recompute it.
- procedure Record_Other_Sources
- (Project : Project_Id;
- In_Tree : Project_Tree_Ref;
- Data : in out Project_Data;
- Language : Language_Index;
- Naming_Exceptions : Boolean);
- -- Record the sources of a language in a project. When Naming_Exceptions is
- -- True, mark the found sources as such, to later remove those that are not
- -- named in a list of sources.
-
procedure Remove_Source
(Id : Source_Id;
Replaced_By : Source_Id;
@@ -597,13 +560,6 @@ package body Prj.Nmsc is
(Data : Project_Data; In_Tree : Project_Tree_Ref);
-- List all the source directories of a project
- function Suffix_For
- (Language : Language_Index;
- Naming : Naming_Data;
- In_Tree : Project_Tree_Ref) return File_Name_Type;
- -- Get the suffix for the source of a language from a package naming. If
- -- not specified, return the default for the language.
-
procedure Warn_If_Not_Sources
(Project : Project_Id;
In_Tree : Project_Tree_Ref;
@@ -1339,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>)
@@ -1386,7 +1344,8 @@ package body Prj.Nmsc is
when others =>
null;
- end case;
+ end case;
+ end if;
end if;
Element_Id := Element.Next;
@@ -1449,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 :=
@@ -1482,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;
@@ -1533,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 =>
@@ -1543,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>)
@@ -1624,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);
@@ -1635,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 =>
@@ -1643,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 =>
@@ -1651,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 =>
@@ -1668,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 =>
@@ -1677,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 =>
@@ -1699,7 +1676,8 @@ package body Prj.Nmsc is
when others =>
null;
- end case;
+ end case;
+ end if;
end if;
Element_Id := Element.Next;
@@ -1722,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
@@ -2449,287 +2426,6 @@ package body Prj.Nmsc is
end loop;
end Check_Configuration;
- ----------------------
- -- Check_For_Source --
- ----------------------
-
- procedure Check_For_Source
- (File_Name : File_Name_Type;
- Path_Name : Path_Name_Type;
- Project : Project_Id;
- In_Tree : Project_Tree_Ref;
- Data : in out Project_Data;
- Location : Source_Ptr;
- Language : Language_Index;
- Suffix : String;
- Naming_Exception : Boolean)
- is
- Name : String := Get_Name_String (File_Name);
- Real_Location : Source_Ptr := Location;
-
- begin
- Canonical_Case_File_Name (Name);
-
- -- A file is a source of a language if Naming_Exception is True (case
- -- of naming exceptions) or if its file name ends with the suffix.
-
- if Naming_Exception
- or else
- (Name'Length > Suffix'Length
- and then
- Name (Name'Last - Suffix'Length + 1 .. Name'Last) = Suffix)
- then
- if Real_Location = No_Location then
- Real_Location := Data.Location;
- end if;
-
- declare
- Path_Id : Path_Name_Type;
- C_Path_Id : Path_Name_Type;
- -- The path name id (in canonical case)
-
- File_Id : File_Name_Type;
- -- The file name id (in canonical case)
-
- Obj_Id : File_Name_Type;
- -- The object file name
-
- Obj_Path_Id : Path_Name_Type;
- -- The object path name
-
- Dep_Id : File_Name_Type;
- -- The dependency file name
-
- Dep_Path_Id : Path_Name_Type;
- -- The dependency path name
-
- Dot_Pos : Natural := 0;
- -- Position of the last dot in Name
-
- Source : Other_Source;
- Source_Id : Other_Source_Id := Data.First_Other_Source;
-
- begin
- -- Get the file name id
-
- if Osint.File_Names_Case_Sensitive then
- File_Id := File_Name;
- else
- Name_Len := Name'Length;
- Name_Buffer (1 .. Name_Len) := Name;
- File_Id := Name_Find;
- end if;
-
- -- Get the path name id
-
- Path_Id := Path_Name;
-
- if Osint.File_Names_Case_Sensitive then
- C_Path_Id := Path_Name;
- else
- declare
- C_Path : String := Get_Name_String (Path_Name);
- begin
- Canonical_Case_File_Name (C_Path);
- Name_Len := C_Path'Length;
- Name_Buffer (1 .. Name_Len) := C_Path;
- C_Path_Id := Name_Find;
- end;
- end if;
-
- -- Find the position of the last dot
-
- for J in reverse Name'Range loop
- if Name (J) = '.' then
- Dot_Pos := J;
- exit;
- end if;
- end loop;
-
- if Dot_Pos <= Name'First then
- Dot_Pos := Name'Last + 1;
- end if;
-
- -- Compute the object file name
-
- Get_Name_String (File_Id);
- Name_Len := Dot_Pos - Name'First;
-
- for J in Object_Suffix'Range loop
- Name_Len := Name_Len + 1;
- Name_Buffer (Name_Len) := Object_Suffix (J);
- end loop;
-
- Obj_Id := Name_Find;
-
- -- Compute the object path name
-
- Get_Name_String (Data.Object_Directory.Display_Name);
-
- if Name_Buffer (Name_Len) /= Directory_Separator
- and then Name_Buffer (Name_Len) /= '/'
- then
- Name_Len := Name_Len + 1;
- Name_Buffer (Name_Len) := Directory_Separator;
- end if;
-
- Add_Str_To_Name_Buffer (Get_Name_String (Obj_Id));
- Obj_Path_Id := Name_Find;
-
- -- Compute the dependency file name
-
- Get_Name_String (File_Id);
- Name_Len := Dot_Pos - Name'First + 1;
- Name_Buffer (Name_Len) := '.';
- Name_Len := Name_Len + 1;
- Name_Buffer (Name_Len) := 'd';
- Dep_Id := Name_Find;
-
- -- Compute the dependency path name
-
- Get_Name_String (Data.Object_Directory.Display_Name);
-
- if Name_Buffer (Name_Len) /= Directory_Separator
- and then Name_Buffer (Name_Len) /= '/'
- then
- Name_Len := Name_Len + 1;
- Name_Buffer (Name_Len) := Directory_Separator;
- end if;
-
- Add_Str_To_Name_Buffer (Get_Name_String (Dep_Id));
- Dep_Path_Id := Name_Find;
-
- -- Check if source is already in the list of source for this
- -- project: it may have already been specified as a naming
- -- exception for the same language or an other language, or
- -- they may be two identical file names in different source
- -- directories.
-
- while Source_Id /= No_Other_Source loop
- Source := In_Tree.Other_Sources.Table (Source_Id);
-
- if Source.File_Name = File_Id then
- -- Two sources of different languages cannot have the same
- -- file name.
-
- if Source.Language /= Language then
- Error_Msg_File_1 := File_Name;
- Error_Msg
- (Project, In_Tree,
- "{ cannot be a source of several languages",
- Real_Location);
- return;
-
- -- No problem if a file has already been specified as
- -- a naming exception of this language.
-
- elsif Source.Path_Name = C_Path_Id then
-
- -- Reset the naming exception flag, if this is not a
- -- naming exception.
-
- if not Naming_Exception then
- In_Tree.Other_Sources.Table
- (Source_Id).Naming_Exception := False;
- end if;
-
- return;
-
- -- There are several files with the same names, but the
- -- order of the source directories is known (no /**):
- -- only the first one encountered is kept, the other ones
- -- are ignored.
-
- elsif Data.Known_Order_Of_Source_Dirs then
- return;
-
- -- But it is an error if the order of the source directories
- -- is not known.
-
- else
- Error_Msg_File_1 := File_Name;
- Error_Msg
- (Project, In_Tree,
- "{ is found in several source directories",
- Real_Location);
- return;
- end if;
-
- -- Two sources with different file names cannot have the same
- -- object file name.
-
- elsif Source.Object_Name = Obj_Id then
- Error_Msg_File_1 := File_Id;
- Error_Msg_File_2 := Source.File_Name;
- Error_Msg_File_3 := Obj_Id;
- Error_Msg
- (Project, In_Tree,
- "{ and { have the same object file {",
- Real_Location);
- return;
- end if;
-
- Source_Id := Source.Next;
- end loop;
-
- if Current_Verbosity = High then
- Write_Str (" found ");
- Display_Language_Name (Language);
- Write_Str (" source """);
- Write_Str (Get_Name_String (File_Name));
- Write_Line ("""");
- Write_Str (" object path = ");
- Write_Line (Get_Name_String (Obj_Path_Id));
- end if;
-
- -- Create the Other_Source record
-
- Source :=
- (Language => Language,
- File_Name => File_Id,
- Path_Name => Path_Id,
- Source_TS => File_Stamp (Path_Id),
- Object_Name => Obj_Id,
- Object_Path => Obj_Path_Id,
- Object_TS => File_Stamp (Obj_Path_Id),
- Dep_Name => Dep_Id,
- Dep_Path => Dep_Path_Id,
- Dep_TS => File_Stamp (Dep_Path_Id),
- Naming_Exception => Naming_Exception,
- Next => No_Other_Source);
-
- -- And add it to the Other_Sources table
-
- Other_Source_Table.Increment_Last (In_Tree.Other_Sources);
- In_Tree.Other_Sources.Table
- (Other_Source_Table.Last (In_Tree.Other_Sources)) := Source;
-
- -- There are sources of languages other than Ada in this project
-
- Data.Other_Sources_Present := True;
-
- -- And there are sources of this language in this project
-
- Set (Language, True, Data, In_Tree);
-
- -- Add this source to the list of sources of languages other than
- -- Ada of the project.
-
- if Data.First_Other_Source = No_Other_Source then
- Data.First_Other_Source :=
- Other_Source_Table.Last (In_Tree.Other_Sources);
-
- else
- In_Tree.Other_Sources.Table (Data.Last_Other_Source).Next :=
- Other_Source_Table.Last (In_Tree.Other_Sources);
- end if;
-
- Data.Last_Other_Source :=
- Other_Source_Table.Last (In_Tree.Other_Sources);
- end;
- end if;
- end Check_For_Source;
-
-------------------------------
-- Check_If_Externally_Built --
-------------------------------
@@ -4429,6 +4125,47 @@ package body Prj.Nmsc is
end if;
end if;
+ -- Check if Linker'Switches or Linker'Default_Switches are declared.
+ -- Warn if they are declared, as it is a common error to think that
+ -- library are "linked" with Linker switches.
+
+ if Data.Library then
+ declare
+ Linker_Package_Id : constant Package_Id :=
+ Util.Value_Of
+ (Name_Linker, Data.Decl.Packages, In_Tree);
+ Linker_Package : Package_Element;
+ Switches : Array_Element_Id := No_Array_Element;
+
+ begin
+ if Linker_Package_Id /= No_Package then
+ Linker_Package := In_Tree.Packages.Table (Linker_Package_Id);
+
+ Switches :=
+ Value_Of
+ (Name => Name_Switches,
+ In_Arrays => Linker_Package.Decl.Arrays,
+ In_Tree => In_Tree);
+
+ if Switches = No_Array_Element then
+ Switches :=
+ Value_Of
+ (Name => Name_Default_Switches,
+ In_Arrays => Linker_Package.Decl.Arrays,
+ In_Tree => In_Tree);
+ end if;
+
+ if Switches /= No_Array_Element then
+ Error_Msg
+ (Project, In_Tree,
+ "?Linker switches not taken into account in library " &
+ "projects",
+ No_Location);
+ end if;
+ end if;
+ end;
+ end if;
+
if Data.Extends /= No_Project then
In_Tree.Projects.Table (Data.Extends).Library := False;
end if;
@@ -4683,11 +4420,8 @@ package body Prj.Nmsc is
(Name => Name_Ada, Next => No_Name_List);
-- Attribute Languages is not specified. So, it defaults to
- -- a project of language Ada only.
-
- Data.Langs (Ada_Language_Index) := True;
-
- -- No sources of languages other than Ada
+ -- a project of language Ada only. No sources of languages
+ -- other than Ada
Data.Other_Sources_Present := False;
@@ -4757,13 +4491,10 @@ package body Prj.Nmsc is
NL_Id : Name_List_Index := No_Name_List;
begin
- if Get_Mode = Ada_Only then
-
- -- Assume that there is no language specified yet
+ -- Assume there are no language declared
- Data.Other_Sources_Present := False;
- Data.Ada_Sources_Present := False;
- end if;
+ Data.Ada_Sources_Present := False;
+ Data.Other_Sources_Present := False;
-- If there are no languages declared, there are no sources
@@ -4820,21 +4551,9 @@ package body Prj.Nmsc is
(Lang_Name, No_Name_List);
if Get_Mode = Ada_Only then
- Index := Language_Indexes.Get (Lang_Name);
-
- if Index = No_Language_Index then
- Add_Language_Name (Lang_Name);
- Index := Last_Language_Index;
- end if;
-
- Set (Index, True, Data, In_Tree);
- Set (Language_Processing =>
- Default_Language_Processing_Data,
- For_Language => Index,
- In_Project => Data,
- In_Tree => In_Tree);
+ -- Check for language Ada
- if Index = Ada_Language_Index then
+ if Lang_Name = Name_Ada then
Data.Ada_Sources_Present := True;
else
@@ -5936,155 +5655,6 @@ package body Prj.Nmsc is
end Find_Ada_Sources;
- ------------------
- -- Find_Sources --
- ------------------
-
- procedure Find_Sources
- (Project : Project_Id;
- In_Tree : Project_Tree_Ref;
- Data : in out Project_Data;
- For_Language : Language_Index;
- Current_Dir : String)
- is
- Source_Dir : String_List_Id;
- Element : String_Element;
- Dir : Dir_Type;
- Current_Source : String_List_Id := Nil_String;
- Source_Recorded : Boolean := False;
-
- begin
- if Current_Verbosity = High then
- Write_Line ("Looking for sources:");
- end if;
-
- -- Loop through subdirectories
-
- Source_Dir := Data.Source_Dirs;
- while Source_Dir /= Nil_String loop
- begin
- Source_Recorded := False;
- Element := In_Tree.String_Elements.Table (Source_Dir);
-
- if Element.Value /= No_Name then
- Get_Name_String (Element.Display_Value);
-
- declare
- Source_Directory : constant String :=
- Name_Buffer (1 .. Name_Len) &
- Directory_Separator;
-
- Dir_Last : constant Natural :=
- Compute_Directory_Last (Source_Directory);
-
- begin
- if Current_Verbosity = High then
- Write_Str ("Source_Dir = ");
- Write_Line (Source_Directory);
- end if;
-
- -- We look to every entry in the source directory
-
- Open (Dir, Source_Directory
- (Source_Directory'First .. Dir_Last));
-
- loop
- Read (Dir, Name_Buffer, Name_Len);
-
- if Current_Verbosity = High then
- Write_Str (" Checking ");
- Write_Line (Name_Buffer (1 .. Name_Len));
- end if;
-
- exit when Name_Len = 0;
-
- declare
- File_Name : constant File_Name_Type := Name_Find;
- Path : constant String :=
- Normalize_Pathname
- (Name => Name_Buffer (1 .. Name_Len),
- Directory => Source_Directory
- (Source_Directory'First .. Dir_Last),
- Resolve_Links => Opt.Follow_Links_For_Files,
- Case_Sensitive => True);
- Path_Name : Path_Name_Type;
-
- begin
- Name_Len := Path'Length;
- Name_Buffer (1 .. Name_Len) := Path;
- Path_Name := Name_Find;
-
- if For_Language = Ada_Language_Index then
-
- -- We attempt to register it as a source. However,
- -- there is no error if the file does not contain
- -- a valid source. But there is an error if we have
- -- a duplicate unit name.
-
- Record_Ada_Source
- (File_Name => File_Name,
- Path_Name => Path_Name,
- Project => Project,
- In_Tree => In_Tree,
- Data => Data,
- Location => No_Location,
- Current_Source => Current_Source,
- Source_Recorded => Source_Recorded,
- Current_Dir => Current_Dir);
-
- else
- Check_For_Source
- (File_Name => File_Name,
- Path_Name => Path_Name,
- Project => Project,
- In_Tree => In_Tree,
- Data => Data,
- Location => No_Location,
- Language => For_Language,
- Suffix =>
- Body_Suffix_Of (For_Language, Data, In_Tree),
- Naming_Exception => False);
- end if;
- end;
- end loop;
-
- Close (Dir);
- end;
- end if;
-
- exception
- when Directory_Error =>
- null;
- end;
-
- if Source_Recorded then
- In_Tree.String_Elements.Table (Source_Dir).Flag :=
- True;
- end if;
-
- Source_Dir := Element.Next;
- end loop;
-
- if Current_Verbosity = High then
- Write_Line ("end Looking for sources.");
- end if;
-
- if For_Language = Ada_Language_Index then
-
- -- If we have looked for sources and found none, then it is an error,
- -- except if it is an extending project. If a non extending project
- -- is not supposed to contain any source files, then never call
- -- Find_Sources.
-
- if Current_Source /= Nil_String then
- Data.Ada_Sources_Present := True;
-
- elsif Data.Extends = No_Project then
- Report_No_Sources (Project, "Ada", In_Tree, Data.Location);
- end if;
- end if;
- end Find_Sources;
-
--------------------------------
-- Free_Ada_Naming_Exceptions --
--------------------------------
@@ -6556,7 +6126,7 @@ package body Prj.Nmsc is
-- We set the object directory to its default
- Data.Object_Directory := Data.Directory;
+ Data.Object_Directory := Data.Directory;
if Object_Dir.Value /= Empty_String then
Get_Name_String (Object_Dir.Value);
@@ -6621,7 +6191,7 @@ package body Prj.Nmsc is
(Project,
In_Tree,
Name_Find,
- Data.Directory.Name,
+ Data.Directory.Display_Name,
Data.Object_Directory.Name,
Data.Object_Directory.Display_Name,
Create => "object",
@@ -6664,7 +6234,7 @@ package body Prj.Nmsc is
(Project,
In_Tree,
File_Name_Type (Exec_Dir.Value),
- Data.Directory.Name,
+ Data.Directory.Display_Name,
Data.Exec_Directory.Name,
Data.Exec_Directory.Display_Name,
Create => "exec",
@@ -6762,7 +6332,7 @@ package body Prj.Nmsc is
Data.Object_Directory := No_Path_Information;
end if;
- Data.Source_Dirs := Nil_String;
+ Data.Source_Dirs := Nil_String;
else
declare
@@ -6774,8 +6344,7 @@ package body Prj.Nmsc is
Source_Dir := Source_Dirs.Values;
while Source_Dir /= Nil_String loop
- Element :=
- In_Tree.String_Elements.Table (Source_Dir);
+ Element := In_Tree.String_Elements.Table (Source_Dir);
Find_Source_Dirs
(File_Name_Type (Element.Value), Element.Location);
Source_Dir := Element.Next;
@@ -6795,8 +6364,7 @@ package body Prj.Nmsc is
Source_Dir := Excluded_Source_Dirs.Values;
while Source_Dir /= Nil_String loop
- Element :=
- In_Tree.String_Elements.Table (Source_Dir);
+ Element := In_Tree.String_Elements.Table (Source_Dir);
Find_Source_Dirs
(File_Name_Type (Element.Value),
Element.Location,
@@ -6900,6 +6468,7 @@ package body Prj.Nmsc is
if not Prj.Util.Is_Valid (File) then
Error_Msg (Project, In_Tree, "file does not exist", Location);
+
else
-- Read the lines one by one
@@ -7005,9 +6574,9 @@ package body Prj.Nmsc is
Last : Natural := File'Last;
Standard_GNAT : Boolean;
Spec : constant File_Name_Type :=
- Spec_Suffix_Id_Of (In_Tree, Name_Ada, Naming);
+ Spec_Suffix_Id_Of (In_Tree, Name_Ada, Naming);
Body_Suff : constant File_Name_Type :=
- Body_Suffix_Id_Of (In_Tree, Name_Ada, Naming);
+ Body_Suffix_Id_Of (In_Tree, Name_Ada, Naming);
begin
Standard_GNAT := Spec = Default_Ada_Spec_Suffix
@@ -7606,8 +7175,7 @@ package body Prj.Nmsc is
---------------------------
procedure Find_Explicit_Sources
- (Lang : Language_Index;
- Current_Dir : String;
+ (Current_Dir : String;
Project : Project_Id;
In_Tree : Project_Tree_Ref;
Data : in out Project_Data)
@@ -7654,18 +7222,9 @@ package body Prj.Nmsc is
Data.Ada_Sources_Present := Current /= Nil_String;
end if;
- -- If we are processing other languages in the case of gprmake,
- -- we should not reset the list of sources, which was already
- -- initialized for the Ada files.
-
- if Get_Mode /= Ada_Only or else Lang /= Ada_Language_Index then
+ if Get_Mode = Multi_Language then
if Current = Nil_String then
- case Get_Mode is
- when Ada_Only =>
- Data.Source_Dirs := Nil_String;
- when Multi_Language =>
- Data.First_Language_Processing := No_Language_Index;
- end case;
+ Data.First_Language_Processing := No_Language_Index;
-- This project contains no source. For projects that
-- don't extend other projects, this also means that
@@ -7743,17 +7302,8 @@ package body Prj.Nmsc is
end loop;
if Get_Mode = Ada_Only then
- if Lang = Ada_Language_Index then
- Get_Path_Names_And_Record_Ada_Sources
- (Project, In_Tree, Data, Current_Dir);
- else
- Record_Other_Sources
- (Project => Project,
- In_Tree => In_Tree,
- Data => Data,
- Language => Lang,
- Naming_Exceptions => False);
- end if;
+ Get_Path_Names_And_Record_Ada_Sources
+ (Project, In_Tree, Data, Current_Dir);
end if;
end;
@@ -7787,18 +7337,8 @@ package body Prj.Nmsc is
if Get_Mode = Ada_Only then
-- Look in the source directories to find those sources
- if Lang = Ada_Language_Index then
- Get_Path_Names_And_Record_Ada_Sources
- (Project, In_Tree, Data, Current_Dir);
-
- else
- Record_Other_Sources
- (Project => Project,
- In_Tree => In_Tree,
- Data => Data,
- Language => Lang,
- Naming_Exceptions => False);
- end if;
+ Get_Path_Names_And_Record_Ada_Sources
+ (Project, In_Tree, Data, Current_Dir);
end if;
end if;
end;
@@ -7808,22 +7348,9 @@ package body Prj.Nmsc is
-- specified. Find all the files that satisfy the naming
-- scheme in all the source directories.
- case Get_Mode is
- when Ada_Only =>
- if Lang = Ada_Language_Index then
- Find_Ada_Sources (Project, In_Tree, Data, Current_Dir);
- else
- -- Find all the files that satisfy the naming scheme in
- -- all the source directories. All the naming exceptions
- -- that effectively exist are also part of the source
- -- of this language.
-
- Find_Sources (Project, In_Tree, Data, Lang, Current_Dir);
- end if;
-
- when Multi_Language =>
- null;
- end case;
+ if Get_Mode = Ada_Only then
+ Find_Ada_Sources (Project, In_Tree, Data, Current_Dir);
+ end if;
end if;
if Get_Mode = Multi_Language then
@@ -7888,7 +7415,6 @@ package body Prj.Nmsc is
end if;
if Get_Mode = Ada_Only
- and then Lang = Ada_Language_Index
and then Data.Extends = No_Project
then
-- We should have found at least one source, if not report an error
@@ -8194,6 +7720,9 @@ package body Prj.Nmsc is
end if;
end loop;
+ when Mixed_Case =>
+ null;
+
when others =>
OK := False;
end case;
@@ -8637,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,
@@ -8829,9 +8360,6 @@ package body Prj.Nmsc is
procedure Remove_Locally_Removed_Files_From_Units;
-- Mark all locally removed sources as such in the Units table
- procedure Process_Other_Sources_In_Ada_Only_Mode;
- -- Find sources for language other than Ada when in Ada_Only mode
-
procedure Process_Sources_In_Multi_Language_Mode;
-- Find all source files when in multi language mode
@@ -8896,116 +8424,6 @@ package body Prj.Nmsc is
end Remove_Locally_Removed_Files_From_Units;
--------------------------------------------
- -- Process_Other_Sources_In_Ada_Only_Mode --
- --------------------------------------------
-
- procedure Process_Other_Sources_In_Ada_Only_Mode is
- begin
- -- Set Source_Present to False. It will be set back to True
- -- whenever a source is found.
-
- Data.Other_Sources_Present := False;
- for Lang in Ada_Language_Index + 1 .. Last_Language_Index loop
-
- -- For each language (other than Ada) in the project file
-
- if Is_Present (Lang, Data, In_Tree) then
-
- -- Reset the indication that there are sources of this
- -- language. It will be set back to True whenever we find
- -- a source of the language.
-
- Set (Lang, False, Data, In_Tree);
-
- -- First, get the source suffix for the language
-
- Set (Suffix => Suffix_For (Lang, Data.Naming, In_Tree),
- For_Language => Lang,
- In_Project => Data,
- In_Tree => In_Tree);
-
- -- Then, deal with the naming exceptions, if any
-
- Source_Names.Reset;
-
- declare
- Naming_Exceptions : constant Variable_Value :=
- Value_Of
- (Index => Language_Names.Table (Lang),
- Src_Index => 0,
- In_Array => Data.Naming.Implementation_Exceptions,
- In_Tree => In_Tree);
- Element_Id : String_List_Id;
- Element : String_Element;
- File_Id : File_Name_Type;
- Source_Found : Boolean := False;
-
- begin
- -- If there are naming exceptions, look through them one
- -- by one.
-
- if Naming_Exceptions /= Nil_Variable_Value then
- Element_Id := Naming_Exceptions.Values;
-
- while Element_Id /= Nil_String loop
- Element := In_Tree.String_Elements.Table (Element_Id);
-
- if Osint.File_Names_Case_Sensitive then
- File_Id := File_Name_Type (Element.Value);
- else
- Get_Name_String (Element.Value);
- Canonical_Case_File_Name
- (Name_Buffer (1 .. Name_Len));
- File_Id := Name_Find;
- end if;
-
- -- Put each naming exception in the Source_Names hash
- -- table, but if there are repetition, don't bother
- -- after the first instance.
-
- if Source_Names.Get (File_Id) = No_Name_Location then
- Source_Found := True;
- Source_Names.Set
- (File_Id,
- (Name => File_Id,
- Location => Element.Location,
- Source => No_Source,
- Except => False,
- Found => False));
- end if;
-
- Element_Id := Element.Next;
- end loop;
-
- -- If there is at least one naming exception, record
- -- those that are found in the source directories.
-
- if Source_Found then
- Record_Other_Sources
- (Project => Project,
- In_Tree => In_Tree,
- Data => Data,
- Language => Lang,
- Naming_Exceptions => True);
- end if;
-
- end if;
- end;
-
- -- Now, check if a list of sources is declared either through
- -- a string list (attribute Source_Files) or a text file
- -- (attribute Source_List_File). If a source list is declared,
- -- we will consider only those naming exceptions that are
- -- on the list.
-
- Source_Names.Reset;
- Find_Explicit_Sources
- (Lang, Current_Dir, Project, In_Tree, Data);
- end if;
- end loop;
- end Process_Other_Sources_In_Ada_Only_Mode;
-
- --------------------------------------------
-- Process_Sources_In_Multi_Language_Mode --
--------------------------------------------
@@ -9077,7 +8495,7 @@ package body Prj.Nmsc is
end loop;
Find_Explicit_Sources
- (Ada_Language_Index, Current_Dir, Project, In_Tree, Data);
+ (Current_Dir, Project, In_Tree, Data);
-- Mark as such the sources that are declared as excluded
@@ -9219,15 +8637,10 @@ package body Prj.Nmsc is
case Get_Mode is
when Ada_Only =>
if Is_A_Language (In_Tree, Data, Name_Ada) then
- Find_Explicit_Sources
- (Ada_Language_Index, Current_Dir, Project, In_Tree, Data);
+ Find_Explicit_Sources (Current_Dir, Project, In_Tree, Data);
Remove_Locally_Removed_Files_From_Units;
end if;
- if Data.Other_Sources_Present then
- Process_Other_Sources_In_Ada_Only_Mode;
- end if;
-
when Multi_Language =>
if Data.First_Language_Processing /= No_Language_Index then
Process_Sources_In_Multi_Language_Mode;
@@ -9456,7 +8869,6 @@ package body Prj.Nmsc is
if Current_Source = Nil_String then
Data.Ada_Sources :=
String_Element_Table.Last (In_Tree.String_Elements);
- Data.Sources := Data.Ada_Sources;
else
In_Tree.String_Elements.Table (Current_Source).Next :=
String_Element_Table.Last (In_Tree.String_Elements);
@@ -9531,7 +8943,6 @@ package body Prj.Nmsc is
then
if Previous_Source = Nil_String then
Data.Ada_Sources := Nil_String;
- Data.Sources := Nil_String;
else
In_Tree.String_Elements.Table (Previous_Source).Next :=
Nil_String;
@@ -9624,179 +9035,6 @@ package body Prj.Nmsc is
end if;
end Record_Ada_Source;
- --------------------------
- -- Record_Other_Sources --
- --------------------------
-
- procedure Record_Other_Sources
- (Project : Project_Id;
- In_Tree : Project_Tree_Ref;
- Data : in out Project_Data;
- Language : Language_Index;
- Naming_Exceptions : Boolean)
- is
- Source_Dir : String_List_Id;
- Element : String_Element;
- Path : Path_Name_Type;
- Dir : Dir_Type;
- Canonical_Name : File_Name_Type;
- Name_Str : String (1 .. 1_024);
- Last : Natural := 0;
- NL : Name_Location;
- First_Error : Boolean := True;
- Suffix : constant String :=
- Body_Suffix_Of (Language, Data, In_Tree);
-
- begin
- Source_Dir := Data.Source_Dirs;
- while Source_Dir /= Nil_String loop
- Element := In_Tree.String_Elements.Table (Source_Dir);
-
- declare
- Dir_Path : constant String :=
- Get_Name_String (Element.Display_Value);
- begin
- if Current_Verbosity = High then
- Write_Str ("checking directory """);
- Write_Str (Dir_Path);
- Write_Str (""" for ");
-
- if Naming_Exceptions then
- Write_Str ("naming exceptions");
- else
- Write_Str ("sources");
- end if;
-
- Write_Str (" of Language ");
- Display_Language_Name (Language);
- end if;
-
- Open (Dir, Dir_Path);
-
- loop
- Read (Dir, Name_Str, Last);
- exit when Last = 0;
-
- if Is_Regular_File
- (Dir_Path & Directory_Separator & Name_Str (1 .. Last))
- then
- Name_Len := Last;
- Name_Buffer (1 .. Name_Len) := Name_Str (1 .. Last);
- Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len));
- Canonical_Name := Name_Find;
- NL := Source_Names.Get (Canonical_Name);
-
- if NL /= No_Name_Location then
- if NL.Found then
- if not Data.Known_Order_Of_Source_Dirs then
- Error_Msg_File_1 := Canonical_Name;
- Error_Msg
- (Project, In_Tree,
- "{ is found in several source directories",
- NL.Location);
- end if;
-
- else
- NL.Found := True;
- Source_Names.Set (Canonical_Name, NL);
- Name_Len := Dir_Path'Length;
- Name_Buffer (1 .. Name_Len) := Dir_Path;
- Add_Char_To_Name_Buffer (Directory_Separator);
- Add_Str_To_Name_Buffer (Name_Str (1 .. Last));
- Path := Name_Find;
-
- Check_For_Source
- (File_Name => Canonical_Name,
- Path_Name => Path,
- Project => Project,
- In_Tree => In_Tree,
- Data => Data,
- Location => NL.Location,
- Language => Language,
- Suffix => Suffix,
- Naming_Exception => Naming_Exceptions);
- end if;
- end if;
- end if;
- end loop;
-
- Close (Dir);
- end;
-
- Source_Dir := Element.Next;
- end loop;
-
- if not Naming_Exceptions then
- NL := Source_Names.Get_First;
-
- -- It is an error if a source file name in a source list or
- -- in a source list file is not found.
-
- while NL /= No_Name_Location loop
- if not NL.Found then
- Err_Vars.Error_Msg_File_1 := NL.Name;
-
- if First_Error then
- Error_Msg
- (Project, In_Tree, "source file { cannot be found",
- NL.Location);
- First_Error := False;
-
- else
- Error_Msg
- (Project, In_Tree, "\source file { cannot be found",
- NL.Location);
- end if;
- end if;
-
- NL := Source_Names.Get_Next;
- end loop;
-
- -- Any naming exception of this language that is not in a list
- -- of sources must be removed.
-
- declare
- Source_Id : Other_Source_Id;
- Prev_Id : Other_Source_Id;
- Source : Other_Source;
-
- begin
- Prev_Id := No_Other_Source;
- Source_Id := Data.First_Other_Source;
- while Source_Id /= No_Other_Source loop
- Source := In_Tree.Other_Sources.Table (Source_Id);
-
- if Source.Language = Language
- and then Source.Naming_Exception
- then
- if Current_Verbosity = High then
- Write_Str ("Naming exception """);
- Write_Str (Get_Name_String (Source.File_Name));
- Write_Str (""" is not in the list of sources,");
- Write_Line (" so it is removed.");
- end if;
-
- if Prev_Id = No_Other_Source then
- Data.First_Other_Source := Source.Next;
- else
- In_Tree.Other_Sources.Table (Prev_Id).Next := Source.Next;
- end if;
-
- Source_Id := Source.Next;
-
- if Source_Id = No_Other_Source then
- Data.Last_Other_Source := Prev_Id;
- end if;
-
- else
- Prev_Id := Source_Id;
- Source_Id := Source.Next;
- end if;
- end loop;
- end;
- end if;
- end Record_Other_Sources;
-
-------------------
-- Remove_Source --
-------------------
@@ -9971,52 +9209,6 @@ package body Prj.Nmsc is
Write_Line ("end Source_Dirs.");
end Show_Source_Dirs;
- ----------------
- -- Suffix_For --
- ----------------
-
- function Suffix_For
- (Language : Language_Index;
- Naming : Naming_Data;
- In_Tree : Project_Tree_Ref) return File_Name_Type
- is
- Suffix : constant Variable_Value :=
- Value_Of
- (Index => Language_Names.Table (Language),
- Src_Index => 0,
- In_Array => Naming.Body_Suffix,
- In_Tree => In_Tree);
-
- begin
- -- If no suffix for this language in package Naming, use the default
-
- if Suffix = Nil_Variable_Value then
- Name_Len := 0;
-
- case Language is
- when Ada_Language_Index =>
- Add_Str_To_Name_Buffer (".adb");
-
- when C_Language_Index =>
- Add_Str_To_Name_Buffer (".c");
-
- when C_Plus_Plus_Language_Index =>
- Add_Str_To_Name_Buffer (".cpp");
-
- when others =>
- return No_File;
- end case;
-
- -- Otherwise use the one specified
-
- else
- Get_Name_String (Suffix.Value);
- end if;
-
- Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len));
- return Name_Find;
- end Suffix_For;
-
-------------------------
-- Warn_If_Not_Sources --
-------------------------
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 67c913378dd..5e0b14f0151 100644
--- a/gcc/ada/prj-part.adb
+++ b/gcc/ada/prj-part.adb
@@ -149,6 +149,29 @@ package body Prj.Part is
-- does not (because it is already extended), but other projects that it
-- imports may need to be virtually extended.
+ type Extension_Origin is (None, Extending_Simple, Extending_All);
+ -- Type of parameter From_Extended for procedures Parse_Single_Project and
+ -- Post_Parse_Context_Clause. Extending_All means that we are parsing the
+ -- tree rooted at an extending all project.
+
+ procedure Parse_Single_Project
+ (In_Tree : Project_Node_Tree_Ref;
+ Project : out Project_Node_Id;
+ Extends_All : out Boolean;
+ Path_Name : String;
+ Extended : Boolean;
+ From_Extended : Extension_Origin;
+ In_Limited : Boolean;
+ Packages_To_Check : String_List_Access;
+ Depth : Natural;
+ Current_Dir : String);
+ -- 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;
Context_Clause : out With_Id);
diff --git a/gcc/ada/prj-part.ads b/gcc/ada/prj-part.ads
index 8e366bc4fff..e1c69c5ab83 100644
--- a/gcc/ada/prj-part.ads
+++ b/gcc/ada/prj-part.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- --
@@ -49,28 +49,4 @@ package Prj.Part is
-- Current_Directory is used for optimization purposes only, avoiding extra
-- system calls.
- type Extension_Origin is (None, Extending_Simple, Extending_All);
- -- Type of parameter From_Extended for procedures Parse_Single_Project and
- -- Post_Parse_Context_Clause. Extending_All means that we are parsing the
- -- tree rooted at an extending all project.
-
- procedure Parse_Single_Project
- (In_Tree : Project_Node_Tree_Ref;
- Project : out Project_Node_Id;
- Extends_All : out Boolean;
- Path_Name : String;
- Extended : Boolean;
- From_Extended : Extension_Origin;
- In_Limited : Boolean;
- 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.
-
end Prj.Part;
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-util.ads b/gcc/ada/prj-util.ads
index e2a9558e5eb..0efdfbb5b03 100644
--- a/gcc/ada/prj-util.ads
+++ b/gcc/ada/prj-util.ads
@@ -146,14 +146,14 @@ package Prj.Util is
-- the last character of each line, if possible.
type Text_File is limited private;
- -- Represents a text file. Default is invalid text file
+ -- Represents a text file (default is invalid text file)
function Is_Valid (File : Text_File) return Boolean;
- -- Returns True if File designates an open text file that
- -- has not yet been closed.
+ -- Returns True if File designates an open text file that has not yet been
+ -- closed.
procedure Open (File : out Text_File; Name : String);
- -- Open a text file. If this procedure fails, File is invalid
+ -- Open a text file to read (file is invalid if text file cannot be opened)
function End_Of_File (File : Text_File) return Boolean;
-- Returns True if the end of the text file File has been reached. Fails if
@@ -163,7 +163,7 @@ package Prj.Util is
(File : Text_File;
Line : out String;
Last : out Natural);
- -- Reads a line from an open text file. Fails if File is invalid
+ -- Reads a line from an open text file (fails if file is invalid)
procedure Close (File : in out Text_File);
-- Close an open text file. File becomes invalid. Fails if File is already
diff --git a/gcc/ada/prj.adb b/gcc/ada/prj.adb
index d838b114442..505e2dad3d1 100644
--- a/gcc/ada/prj.adb
+++ b/gcc/ada/prj.adb
@@ -32,9 +32,11 @@ with Prj.Attr;
with Prj.Env;
with Prj.Err; use Prj.Err;
with Snames; use Snames;
+with Table;
with Uintp; use Uintp;
with System.Case_Util; use System.Case_Util;
+with System.HTable;
package body Prj is
@@ -50,8 +52,6 @@ package body Prj is
The_Empty_String : Name_Id;
- Name_C_Plus_Plus : Name_Id;
-
Default_Ada_Spec_Suffix_Id : File_Name_Type;
Default_Ada_Body_Suffix_Id : File_Name_Type;
Slash_Id : Path_Name_Type;
@@ -83,9 +83,7 @@ package body Prj is
Specs => No_Array_Element,
Bodies => No_Array_Element,
Specification_Exceptions => No_Array_Element,
- Implementation_Exceptions => No_Array_Element,
- Impl_Suffixes => No_Impl_Suffixes,
- Supp_Suffixes => No_Supp_Language_Index);
+ Implementation_Exceptions => No_Array_Element);
Project_Empty : constant Project_Data :=
(Qualifier => Unspecified,
@@ -113,8 +111,9 @@ package body Prj is
Lib_Auto_Init => False,
Libgnarl_Needed => Unknown,
Symbol_Data => No_Symbols,
+ Ada_Sources_Present => True,
+ Other_Sources_Present => True,
Ada_Sources => Nil_String,
- Sources => Nil_String,
First_Source => No_Source,
Last_Source => No_Source,
Interfaces_Defined => False,
@@ -144,25 +143,12 @@ package body Prj is
Objects_Path_File_Without_Libs => No_Path,
Config_File_Name => No_Path,
Config_File_Temp => False,
- Linker_Name => No_File,
- Linker_Path => No_Path,
- Minimum_Linker_Options => No_Name_List,
Config_Checked => False,
Checked => False,
Seen => False,
Need_To_Build_Lib => False,
Depth => 0,
- Unkept_Comments => False,
- Langs => No_Languages,
- Supp_Languages => No_Supp_Language_Index,
- Ada_Sources_Present => True,
- Other_Sources_Present => True,
- First_Other_Source => No_Other_Source,
- Last_Other_Source => No_Other_Source,
- First_Lang_Processing =>
- Default_First_Language_Processing_Data,
- Supp_Language_Processing =>
- No_Supp_Language_Index);
+ Unkept_Comments => False);
package Temp_Files is new Table.Table
(Table_Component_Type => Path_Name_Type,
@@ -174,18 +160,6 @@ package body Prj is
-- Table to store the path name of all the created temporary files, so that
-- they can be deleted at the end, or when the program is interrupted.
- -----------------------
- -- Add_Language_Name --
- -----------------------
-
- procedure Add_Language_Name (Name : Name_Id) is
- begin
- Last_Language_Index := Last_Language_Index + 1;
- Language_Indexes.Set (Name, Last_Language_Index);
- Language_Names.Increment_Last;
- Language_Names.Table (Last_Language_Index) := Name;
- end Add_Language_Name;
-
-------------------
-- Add_To_Buffer --
-------------------
@@ -341,21 +315,6 @@ package body Prj is
return "";
end Body_Suffix_Of;
- function Body_Suffix_Of
- (Language : Language_Index;
- In_Project : Project_Data;
- In_Tree : Project_Tree_Ref) return String
- is
- Suffix_Id : constant File_Name_Type :=
- Suffix_Of (Language, In_Project, In_Tree);
- begin
- if Suffix_Id /= No_File then
- return Get_Name_String (Suffix_Id);
- else
- return "." & Get_Name_String (Language_Names.Table (Language));
- end if;
- end Body_Suffix_Of;
-
-----------------------------
-- Default_Ada_Body_Suffix --
-----------------------------
@@ -430,17 +389,6 @@ package body Prj is
Write_Str (Name_Buffer (1 .. Name_Len));
end Display_Language_Name;
- ---------------------------
- -- Display_Language_Name --
- ---------------------------
-
- procedure Display_Language_Name (Language : Language_Index) is
- begin
- Get_Name_String (Language_Names.Table (Language));
- To_Upper (Name_Buffer (1 .. 1));
- Write_Str (Name_Buffer (1 .. Name_Len));
- end Display_Language_Name;
-
----------------
-- Empty_File --
----------------
@@ -638,22 +586,12 @@ package body Prj is
Name_Len := 1;
Name_Buffer (1) := '/';
Slash_Id := Name_Find;
- Name_Len := 3;
- Name_Buffer (1 .. 3) := "c++";
- Name_C_Plus_Plus := Name_Find;
Prj.Env.Initialize;
Prj.Attr.Initialize;
Set_Name_Table_Byte (Name_Project, Token_Type'Pos (Tok_Project));
Set_Name_Table_Byte (Name_Extends, Token_Type'Pos (Tok_Extends));
Set_Name_Table_Byte (Name_External, Token_Type'Pos (Tok_External));
-
- Language_Indexes.Reset;
- Last_Language_Index := No_Language_Index;
- Language_Names.Init;
- Add_Language_Name (Name_Ada);
- Add_Language_Name (Name_C);
- Add_Language_Name (Name_C_Plus_Plus);
end if;
if Tree /= No_Project_Tree then
@@ -729,84 +667,6 @@ package body Prj is
return False;
end Is_Extending;
- ----------------
- -- Is_Present --
- ----------------
-
- function Is_Present
- (Language : Language_Index;
- In_Project : Project_Data;
- In_Tree : Project_Tree_Ref) return Boolean
- is
- begin
- case Language is
- when No_Language_Index =>
- return False;
-
- when First_Language_Indexes =>
- return In_Project.Langs (Language);
-
- when others =>
- declare
- Supp : Supp_Language;
- Supp_Index : Supp_Language_Index;
-
- begin
- Supp_Index := In_Project.Supp_Languages;
- while Supp_Index /= No_Supp_Language_Index loop
- Supp := In_Tree.Present_Languages.Table (Supp_Index);
-
- if Supp.Index = Language then
- return Supp.Present;
- end if;
-
- Supp_Index := Supp.Next;
- end loop;
-
- return False;
- end;
- end case;
- end Is_Present;
-
- ---------------------------------
- -- Language_Processing_Data_Of --
- ---------------------------------
-
- function Language_Processing_Data_Of
- (Language : Language_Index;
- In_Project : Project_Data;
- In_Tree : Project_Tree_Ref) return Language_Processing_Data
- is
- begin
- case Language is
- when No_Language_Index =>
- return Default_Language_Processing_Data;
-
- when First_Language_Indexes =>
- return In_Project.First_Lang_Processing (Language);
-
- when others =>
- declare
- Supp : Supp_Language_Data;
- Supp_Index : Supp_Language_Index;
-
- begin
- Supp_Index := In_Project.Supp_Language_Processing;
- while Supp_Index /= No_Supp_Language_Index loop
- Supp := In_Tree.Supp_Languages.Table (Supp_Index);
-
- if Supp.Index = Language then
- return Supp.Data;
- end if;
-
- Supp_Index := Supp.Next;
- end loop;
-
- return Default_Language_Processing_Data;
- end;
- end case;
- end Language_Processing_Data_Of;
-
-----------------------
-- Objects_Exist_For --
-----------------------
@@ -830,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;
@@ -980,13 +840,6 @@ package body Prj is
begin
Prj.Env.Initialize;
- -- gprmake tables
-
- Present_Language_Table.Init (Tree.Present_Languages);
- Supp_Suffix_Table.Init (Tree.Supp_Suffixes);
- Supp_Language_Table.Init (Tree.Supp_Languages);
- Other_Source_Table.Init (Tree.Other_Sources);
-
-- Visible tables
Language_Data_Table.Init (Tree.Languages_Data);
@@ -1040,144 +893,6 @@ package body Prj is
and then Left.Separate_Suffix = Right.Separate_Suffix;
end Same_Naming_Scheme;
- ---------
- -- Set --
- ---------
-
- procedure Set
- (Language : Language_Index;
- Present : Boolean;
- In_Project : in out Project_Data;
- In_Tree : Project_Tree_Ref)
- is
- begin
- case Language is
- when No_Language_Index =>
- null;
-
- when First_Language_Indexes =>
- In_Project.Langs (Language) := Present;
-
- when others =>
- declare
- Supp : Supp_Language;
- Supp_Index : Supp_Language_Index;
-
- begin
- Supp_Index := In_Project.Supp_Languages;
- while Supp_Index /= No_Supp_Language_Index loop
- Supp := In_Tree.Present_Languages.Table (Supp_Index);
-
- if Supp.Index = Language then
- In_Tree.Present_Languages.Table (Supp_Index).Present :=
- Present;
- return;
- end if;
-
- Supp_Index := Supp.Next;
- end loop;
-
- Supp := (Index => Language, Present => Present,
- Next => In_Project.Supp_Languages);
- Present_Language_Table.Increment_Last
- (In_Tree.Present_Languages);
- Supp_Index :=
- Present_Language_Table.Last (In_Tree.Present_Languages);
- In_Tree.Present_Languages.Table (Supp_Index) :=
- Supp;
- In_Project.Supp_Languages := Supp_Index;
- end;
- end case;
- end Set;
-
- procedure Set
- (Language_Processing : Language_Processing_Data;
- For_Language : Language_Index;
- In_Project : in out Project_Data;
- In_Tree : Project_Tree_Ref)
- is
- begin
- case For_Language is
- when No_Language_Index =>
- null;
-
- when First_Language_Indexes =>
- In_Project.First_Lang_Processing (For_Language) :=
- Language_Processing;
-
- when others =>
- declare
- Supp : Supp_Language_Data;
- Supp_Index : Supp_Language_Index;
-
- begin
- Supp_Index := In_Project.Supp_Language_Processing;
- while Supp_Index /= No_Supp_Language_Index loop
- Supp := In_Tree.Supp_Languages.Table (Supp_Index);
-
- if Supp.Index = For_Language then
- In_Tree.Supp_Languages.Table
- (Supp_Index).Data := Language_Processing;
- return;
- end if;
-
- Supp_Index := Supp.Next;
- end loop;
-
- Supp := (Index => For_Language, Data => Language_Processing,
- Next => In_Project.Supp_Language_Processing);
- Supp_Language_Table.Increment_Last
- (In_Tree.Supp_Languages);
- Supp_Index := Supp_Language_Table.Last
- (In_Tree.Supp_Languages);
- In_Tree.Supp_Languages.Table (Supp_Index) := Supp;
- In_Project.Supp_Language_Processing := Supp_Index;
- end;
- end case;
- end Set;
-
- procedure Set
- (Suffix : File_Name_Type;
- For_Language : Language_Index;
- In_Project : in out Project_Data;
- In_Tree : Project_Tree_Ref)
- is
- begin
- case For_Language is
- when No_Language_Index =>
- null;
-
- when First_Language_Indexes =>
- In_Project.Naming.Impl_Suffixes (For_Language) := Suffix;
-
- when others =>
- declare
- Supp : Supp_Suffix;
- Supp_Index : Supp_Language_Index;
-
- begin
- Supp_Index := In_Project.Naming.Supp_Suffixes;
- while Supp_Index /= No_Supp_Language_Index loop
- Supp := In_Tree.Supp_Suffixes.Table (Supp_Index);
-
- if Supp.Index = For_Language then
- In_Tree.Supp_Suffixes.Table (Supp_Index).Suffix := Suffix;
- return;
- end if;
-
- Supp_Index := Supp.Next;
- end loop;
-
- Supp := (Index => For_Language, Suffix => Suffix,
- Next => In_Project.Naming.Supp_Suffixes);
- Supp_Suffix_Table.Increment_Last (In_Tree.Supp_Suffixes);
- Supp_Index := Supp_Suffix_Table.Last (In_Tree.Supp_Suffixes);
- In_Tree.Supp_Suffixes.Table (Supp_Index) := Supp;
- In_Project.Naming.Supp_Suffixes := Supp_Index;
- end;
- end case;
- end Set;
-
---------------------
-- Set_Body_Suffix --
---------------------
@@ -1426,45 +1141,6 @@ package body Prj is
end if;
end Standard_Naming_Data;
- ---------------
- -- Suffix_Of --
- ---------------
-
- function Suffix_Of
- (Language : Language_Index;
- In_Project : Project_Data;
- In_Tree : Project_Tree_Ref) return File_Name_Type
- is
- begin
- case Language is
- when No_Language_Index =>
- return No_File;
-
- when First_Language_Indexes =>
- return In_Project.Naming.Impl_Suffixes (Language);
-
- when others =>
- declare
- Supp : Supp_Suffix;
- Supp_Index : Supp_Language_Index;
-
- begin
- Supp_Index := In_Project.Naming.Supp_Suffixes;
- while Supp_Index /= No_Supp_Language_Index loop
- Supp := In_Tree.Supp_Suffixes.Table (Supp_Index);
-
- if Supp.Index = Language then
- return Supp.Suffix;
- end if;
-
- Supp_Index := Supp.Next;
- end loop;
-
- return No_File;
- end;
- end case;
- end Suffix_Of;
-
-------------------
-- Switches_Name --
-------------------
@@ -1476,29 +1152,6 @@ package body Prj is
return Extend_Name (Source_File_Name, Switches_Dependency_Suffix);
end Switches_Name;
- ---------------------------
- -- There_Are_Ada_Sources --
- ---------------------------
-
- function There_Are_Ada_Sources
- (In_Tree : Project_Tree_Ref;
- Project : Project_Id) return Boolean
- is
- Prj : Project_Id;
-
- begin
- Prj := Project;
- while Prj /= No_Project loop
- if In_Tree.Projects.Table (Prj).Ada_Sources /= Nil_String then
- return True;
- end if;
-
- Prj := In_Tree.Projects.Table (Prj).Extends;
- end loop;
-
- return False;
- end There_Are_Ada_Sources;
-
-----------
-- Value --
-----------
diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads
index 5d8caa79cd3..d06138e1bdf 100644
--- a/gcc/ada/prj.ads
+++ b/gcc/ada/prj.ads
@@ -32,21 +32,21 @@
with Casing; use Casing;
with Namet; use Namet;
with Scans; use Scans;
-with Table;
with Types; use Types;
with GNAT.Dynamic_HTables; use GNAT.Dynamic_HTables;
with GNAT.Dynamic_Tables;
with GNAT.OS_Lib; use GNAT.OS_Lib;
-with System.HTable;
-
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=...
@@ -64,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
@@ -253,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.
@@ -402,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
@@ -426,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,
@@ -528,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
@@ -544,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,
@@ -570,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;
@@ -838,164 +843,6 @@ package Prj is
-- Similar to 'Value (but avoid use of this attribute in compiler)
-- Raises Constraint_Error if not a Casing_Type image.
- -- Declarations for gprmake:
-
- First_Language_Index : constant Language_Index := 1;
- First_Language_Indexes_Last : constant Language_Index := 5;
-
- Ada_Language_Index : constant Language_Index :=
- First_Language_Index;
- C_Language_Index : constant Language_Index :=
- Ada_Language_Index + 1;
- C_Plus_Plus_Language_Index : constant Language_Index :=
- C_Language_Index + 1;
-
- Last_Language_Index : Language_Index := No_Language_Index;
-
- subtype First_Language_Indexes is Language_Index
- range First_Language_Index .. First_Language_Indexes_Last;
-
- package Language_Indexes is new System.HTable.Simple_HTable
- (Header_Num => Header_Num,
- Element => Language_Index,
- No_Element => No_Language_Index,
- Key => Name_Id,
- Hash => Hash,
- Equal => "=");
- -- Mapping of language names to language indexes
-
- package Language_Names is new Table.Table
- (Table_Component_Type => Name_Id,
- Table_Index_Type => Language_Index,
- Table_Low_Bound => 1,
- Table_Initial => 4,
- Table_Increment => 100,
- Table_Name => "Prj.Language_Names");
- -- The table for the name of programming languages
-
- procedure Add_Language_Name (Name : Name_Id);
-
- procedure Display_Language_Name (Language : Language_Index);
-
- type Languages_In_Project is array (First_Language_Indexes) of Boolean;
- -- Set of supported languages used in a project
-
- No_Languages : constant Languages_In_Project := (others => False);
- -- No supported languages are used
-
- type Supp_Language_Index is new Nat;
- No_Supp_Language_Index : constant Supp_Language_Index := 0;
-
- type Supp_Language is record
- Index : Language_Index := No_Language_Index;
- Present : Boolean := False;
- Next : Supp_Language_Index := No_Supp_Language_Index;
- end record;
-
- package Present_Language_Table is new GNAT.Dynamic_Tables
- (Table_Component_Type => Supp_Language,
- Table_Index_Type => Supp_Language_Index,
- Table_Low_Bound => 1,
- Table_Initial => 4,
- Table_Increment => 100);
- -- The table for the presence of languages with an index that is outside
- -- of First_Language_Indexes.
-
- type Impl_Suffix_Array is array (First_Language_Indexes) of File_Name_Type;
- -- Suffixes for the non spec sources of the different supported languages
- -- in a project.
-
- No_Impl_Suffixes : constant Impl_Suffix_Array := (others => No_File);
- -- A default value for the non spec source suffixes
-
- type Supp_Suffix is record
- Index : Language_Index := No_Language_Index;
- Suffix : File_Name_Type := No_File;
- Next : Supp_Language_Index := No_Supp_Language_Index;
- end record;
-
- package Supp_Suffix_Table is new GNAT.Dynamic_Tables
- (Table_Component_Type => Supp_Suffix,
- Table_Index_Type => Supp_Language_Index,
- Table_Low_Bound => 1,
- Table_Initial => 4,
- Table_Increment => 100);
- -- The table for the presence of languages with an index that is outside
- -- of First_Language_Indexes.
-
- type Lang_Kind is (GNU, Other);
-
- type Language_Processing_Data is record
- Compiler_Drivers : Name_List_Index := No_Name_List;
- Compiler_Paths : Name_Id := No_Name;
- Compiler_Kinds : Lang_Kind := GNU;
- Dependency_Options : Name_List_Index := No_Name_List;
- Compute_Dependencies : Name_List_Index := No_Name_List;
- Include_Options : Name_List_Index := No_Name_List;
- Binder_Drivers : Name_Id := No_Name;
- Binder_Driver_Paths : Name_Id := No_Name;
- end record;
-
- Default_Language_Processing_Data :
- constant Language_Processing_Data :=
- (Compiler_Drivers => No_Name_List,
- Compiler_Paths => No_Name,
- Compiler_Kinds => GNU,
- Dependency_Options => No_Name_List,
- Compute_Dependencies => No_Name_List,
- Include_Options => No_Name_List,
- Binder_Drivers => No_Name,
- Binder_Driver_Paths => No_Name);
-
- type First_Language_Processing_Data is
- array (First_Language_Indexes) of Language_Processing_Data;
-
- Default_First_Language_Processing_Data :
- constant First_Language_Processing_Data :=
- (others => Default_Language_Processing_Data);
-
- type Supp_Language_Data is record
- Index : Language_Index := No_Language_Index;
- Data : Language_Processing_Data := Default_Language_Processing_Data;
- Next : Supp_Language_Index := No_Supp_Language_Index;
- end record;
-
- package Supp_Language_Table is new GNAT.Dynamic_Tables
- (Table_Component_Type => Supp_Language_Data,
- Table_Index_Type => Supp_Language_Index,
- Table_Low_Bound => 1,
- Table_Initial => 4,
- Table_Increment => 100);
- -- The table for language data when there are more languages than
- -- in First_Language_Indexes.
-
- type Other_Source_Id is new Nat;
- No_Other_Source : constant Other_Source_Id := 0;
-
- type Other_Source is record
- Language : Language_Index; -- language of the source
- File_Name : File_Name_Type; -- source file simple name
- Path_Name : Path_Name_Type; -- source full path name
- Source_TS : Time_Stamp_Type; -- source file time stamp
- Object_Name : File_Name_Type; -- object file simple name
- Object_Path : Path_Name_Type; -- object full path name
- Object_TS : Time_Stamp_Type; -- object file time stamp
- Dep_Name : File_Name_Type; -- dependency file simple name
- Dep_Path : Path_Name_Type; -- dependency full path name
- Dep_TS : Time_Stamp_Type; -- dependency file time stamp
- Naming_Exception : Boolean := False; -- True if a naming exception
- Next : Other_Source_Id := No_Other_Source;
- end record;
- -- Data for a source in a language other than Ada
-
- package Other_Source_Table is new GNAT.Dynamic_Tables
- (Table_Component_Type => Other_Source,
- Table_Index_Type => Other_Source_Id,
- Table_Low_Bound => 1,
- Table_Initial => 200,
- Table_Increment => 100);
- -- The table for sources of languages other than Ada
-
-- The following record contains data for a naming scheme
type Naming_Data is record
@@ -1044,10 +891,6 @@ package Prj is
-- An associative array listing body file names that do not have the
-- body suffix. Not used by Ada. Indexed by programming language name.
- -- For gprmake:
-
- Impl_Suffixes : Impl_Suffix_Array := No_Impl_Suffixes;
- Supp_Suffixes : Supp_Language_Index := No_Supp_Language_Index;
end record;
function Spec_Suffix_Of
@@ -1407,12 +1250,15 @@ package Prj is
-- Sources --
-------------
+ Ada_Sources_Present : Boolean := True;
+ -- True if there are Ada sources in the project
+
+ Other_Sources_Present : Boolean := True;
+ -- True if there are non-Ada sources in the project
+
Ada_Sources : String_List_Id := Nil_String;
-- The list of all the Ada source file names (gnatmake only)
- Sources : String_List_Id := Nil_String;
- -- Identical to Ada_Sources (for upward compatibility with GPS)
-
First_Source : Source_Id := No_Source;
Last_Source : Source_Id := No_Source;
-- Head and tail of the list of sources
@@ -1451,20 +1297,6 @@ package Prj is
-- use this field directly outside of the project manager, use
-- Prj.Env.Ada_Include_Path instead.
- -------------
- -- Linking --
- -------------
-
- Linker_Name : File_Name_Type := No_File;
- -- Value of attribute Language_Processing'Linker in the project file
-
- Linker_Path : Path_Name_Type := No_Path;
- -- Path of linker when attribute Language_Processing'Linker is specified
-
- Minimum_Linker_Options : Name_List_Index := No_Name_List;
- -- List of options specified in attribute
- -- Language_Processing'Minimum_Linker_Options.
-
-------------------
-- Miscellaneous --
-------------------
@@ -1515,32 +1347,6 @@ package Prj is
-- True if there are comments in the project sources that cannot be kept
-- in the project tree.
- ------------------
- -- For gprmake --
- ------------------
-
- Langs : Languages_In_Project := No_Languages;
- Supp_Languages : Supp_Language_Index := No_Supp_Language_Index;
- -- Indicate the different languages of the source of this project
-
- Ada_Sources_Present : Boolean := True;
- -- True if there are Ada sources in the project
-
- Other_Sources_Present : Boolean := True;
- -- True if there are sources from languages other than Ada in the
- -- project.
-
- First_Other_Source : Other_Source_Id := No_Other_Source;
- -- First source of a language other than Ada
-
- Last_Other_Source : Other_Source_Id := No_Other_Source;
- -- Last source of a language other than Ada
-
- First_Lang_Processing : First_Language_Processing_Data :=
- Default_First_Language_Processing_Data;
- Supp_Language_Processing : Supp_Language_Index :=
- No_Supp_Language_Index;
- -- Language configurations
end record;
function Empty_Project (Tree : Project_Tree_Ref) return Project_Data;
@@ -1560,12 +1366,6 @@ package Prj is
-- Return True when Language_Name (which must be lower case) is one of the
-- languages used for the project.
- function There_Are_Ada_Sources
- (In_Tree : Project_Tree_Ref;
- Project : Project_Id) return Boolean;
- -- ??? needs comment
- -- ??? Name sounds strange, suggested replacement: Ada_Sources_Present
-
Project_Error : exception;
-- Raised by some subprograms in Prj.Attr
@@ -1664,13 +1464,6 @@ package Prj is
Files_HT : Files_Htable.Instance;
Source_Paths_HT : Source_Paths_Htable.Instance;
- -- For gprmake:
-
- Present_Languages : Present_Language_Table.Instance;
- Supp_Suffixes : Supp_Suffix_Table.Instance;
- Supp_Languages : Supp_Language_Table.Instance;
- Other_Sources : Other_Source_Table.Instance;
-
-- Private part
Private_Part : Private_Project_Tree_Data;
@@ -1743,59 +1536,6 @@ package Prj is
(Source_File_Name : File_Name_Type) return File_Name_Type;
-- Returns the switches file name corresponding to a source file name
- -- For gprmake
-
- function Body_Suffix_Of
- (Language : Language_Index;
- In_Project : Project_Data;
- In_Tree : Project_Tree_Ref) return String;
- -- Returns the suffix of sources of language Language in project In_Project
- -- in project tree In_Tree.
-
- function Is_Present
- (Language : Language_Index;
- In_Project : Project_Data;
- In_Tree : Project_Tree_Ref) return Boolean;
- -- Return True when Language is one of the languages used in
- -- project In_Project.
-
- procedure Set
- (Language : Language_Index;
- Present : Boolean;
- In_Project : in out Project_Data;
- In_Tree : Project_Tree_Ref);
- -- Indicate if Language is or not a language used in project In_Project
-
- function Language_Processing_Data_Of
- (Language : Language_Index;
- In_Project : Project_Data;
- In_Tree : Project_Tree_Ref) return Language_Processing_Data;
- -- Return the Language_Processing_Data for language Language in project
- -- In_Project. Return the default when no Language_Processing_Data are
- -- defined for the language.
-
- procedure Set
- (Language_Processing : Language_Processing_Data;
- For_Language : Language_Index;
- In_Project : in out Project_Data;
- In_Tree : Project_Tree_Ref);
- -- Set the Language_Processing_Data for language Language in project
- -- In_Project.
-
- function Suffix_Of
- (Language : Language_Index;
- In_Project : Project_Data;
- In_Tree : Project_Tree_Ref) return File_Name_Type;
- -- Return the suffix for language Language in project In_Project. Return
- -- No_Name when no suffix is defined for the language.
-
- procedure Set
- (Suffix : File_Name_Type;
- For_Language : Language_Index;
- In_Project : in out Project_Data;
- In_Tree : Project_Tree_Ref);
- -- Set the suffix for language Language in project In_Project
-
----------------
-- Temp Files --
----------------
diff --git a/gcc/ada/raise-gcc.c b/gcc/ada/raise-gcc.c
index bb25ea631d1..434213b7d89 100644
--- a/gcc/ada/raise-gcc.c
+++ b/gcc/ada/raise-gcc.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- *
@@ -35,6 +35,7 @@
#ifdef IN_RTS
#include "tconfig.h"
+#include "tsystem.h"
/* In the top-of-tree GCC, tconfig does not include tm.h, but in GCC 3.2
it does. To avoid branching raise.c just for that purpose, we kludge by
looking for a symbol always defined by tm.h and if it's not defined,
@@ -43,7 +44,6 @@
#include "coretypes.h"
#include "tm.h"
#endif
-#include "tsystem.h"
#include <sys/stat.h>
#include <stdarg.h>
typedef char bool;
@@ -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.adb b/gcc/ada/rtsfind.adb
index a0efccc3f06..fda3b2ff082 100644
--- a/gcc/ada/rtsfind.adb
+++ b/gcc/ada/rtsfind.adb
@@ -914,25 +914,6 @@ package body Rtsfind is
---------------
procedure Check_RPC is
-
- procedure Check_RPC_Failure (Msg : String);
- pragma No_Return (Check_RPC_Failure);
- -- Display Msg on standard error and raise Unrecoverable_Error
-
- -----------------------
- -- Check_RPC_Failure --
- -----------------------
-
- procedure Check_RPC_Failure (Msg : String) is
- begin
- Set_Standard_Error;
- Write_Str (Msg);
- Write_Eol;
- raise Unrecoverable_Error;
- end Check_RPC_Failure;
-
- -- Start of processing for Check_RPC
-
begin
-- Bypass this check if debug flag -gnatdR set
@@ -940,30 +921,44 @@ package body Rtsfind is
return;
end if;
- -- Otherwise we need the check if we are going after one of
- -- the critical entities in System.RPC in stubs mode.
-
- -- ??? Should we do this for other s-parint entities too?
-
- if (Distribution_Stub_Mode = Generate_Receiver_Stub_Body
- or else
- Distribution_Stub_Mode = Generate_Caller_Stub_Body)
- and then (E = RE_Do_Rpc
- or else
- E = RE_Do_Apc
- or else
- E = RE_Params_Stream_Type
- or else
- E = RE_Request_Access)
+ -- Otherwise we need the check if we are going after one of the
+ -- critical entities in System.RPC / System.Partition_Interface.
+
+ if E = RE_Do_Rpc
+ or else
+ E = RE_Do_Apc
+ or else
+ E = RE_Params_Stream_Type
+ or else
+ E = RE_Request_Access
then
- if Get_PCS_Name = Name_No_DSA then
- Check_RPC_Failure ("distribution feature not supported");
+ -- If generating RCI stubs, check that we have a real PCS
+
+ if (Distribution_Stub_Mode = Generate_Receiver_Stub_Body
+ or else
+ Distribution_Stub_Mode = Generate_Caller_Stub_Body)
+ and then Get_PCS_Name = Name_No_DSA
+ then
+ Set_Standard_Error;
+ Write_Str ("distribution feature not supported");
+ Write_Eol;
+ raise Unrecoverable_Error;
+
+ -- In all cases, check Exp_Dist and System.Partition_Interface
+ -- consistency.
elsif Get_PCS_Version /=
Exp_Dist.PCS_Version_Number (Get_PCS_Name)
then
- Check_RPC_Failure ("PCS version mismatch");
-
+ Set_Standard_Error;
+ Write_Str ("PCS version mismatch: expander ");
+ Write_Int (Exp_Dist.PCS_Version_Number (Get_PCS_Name));
+ Write_Str (", PCS (");
+ Write_Name (Get_PCS_Name);
+ Write_Str (") ");
+ Write_Int (Get_PCS_Version);
+ Write_Eol;
+ raise Unrecoverable_Error;
end if;
end if;
end Check_RPC;
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-direio.adb b/gcc/ada/s-direio.adb
index c764a1c658e..8a6dd435e7c 100644
--- a/gcc/ada/s-direio.adb
+++ b/gcc/ada/s-direio.adb
@@ -251,9 +251,12 @@ package body System.Direct_IO is
-----------
procedure Reset (File : in out File_Type; Mode : FCB.File_Mode) is
- pragma Unmodified (File);
+ pragma Warnings (Off, File);
-- File is actually modified via Unrestricted_Access below, but
-- GNAT will generate a warning anyway.
+ -- Note that we do not use pragma Unmodified here, since in -gnatc
+ -- mode, GNAT will complain that File is modified for
+ -- "File.Index := 1;"
begin
FIO.Reset (AP (File)'Unrestricted_Access, Mode);
@@ -262,9 +265,8 @@ package body System.Direct_IO is
end Reset;
procedure Reset (File : in out File_Type) is
- pragma Unmodified (File);
- -- File is actually modified via Unrestricted_Access below, but
- -- GNAT will generate a warning anyway.
+ pragma Warnings (Off, File);
+ -- See above (other Reset procedure) for explanations on this pragma
begin
FIO.Reset (AP (File)'Unrestricted_Access);
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-finimp.ads b/gcc/ada/s-finimp.ads
index 5bd1be1f8fd..7895326f85f 100644
--- a/gcc/ada/s-finimp.ads
+++ b/gcc/ada/s-finimp.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- --
@@ -66,7 +66,7 @@ package System.Finalization_Implementation is
-- packages. They will be finalized after the main program completion.
procedure Finalize_Global_List;
- -- The procedure to be called in order to finalize the global list;
+ -- The procedure to be called in order to finalize the global list
procedure Attach_To_Final_List
(L : in out SFR.Finalizable_Ptr;
@@ -102,7 +102,7 @@ package System.Finalization_Implementation is
-- return object to the caller's finalization list.
procedure Finalize_List (L : SFR.Finalizable_Ptr);
- -- Call Finalize on each element of the list L;
+ -- Call Finalize on each element of the list L
procedure Finalize_One (Obj : in out SFR.Finalizable);
-- Call Finalize on Obj and remove its final list
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 5655b3c0d7c..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);
@@ -792,9 +790,9 @@ package body System.OS_Lib is
-- If it is not a digit, then there are no available
-- temp file names. Return Invalid_FD. There is almost
- -- no that this code will be ever be executed, since
- -- it would mean that there are one million temp files
- -- in the same directory!
+ -- no chance that this code will be ever be executed,
+ -- since it would mean that there are one million temp
+ -- files in the same directory!
SSL.Unlock_Task.all;
FD := Invalid_FD;
@@ -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-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.adb b/gcc/ada/s-parame-vxworks.adb
index 240a9d8f716..21838ddcc41 100644
--- a/gcc/ada/s-parame-vxworks.adb
+++ b/gcc/ada/s-parame-vxworks.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- --
@@ -31,7 +31,7 @@
-- --
------------------------------------------------------------------------------
--- Version used on all VxWorks and Nucleus targets
+-- Version used on all VxWorks, Nucleus, and RTX RTSS targets
package body System.Parameters is
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-regexp.ads b/gcc/ada/s-regexp.ads
index d114f0d0ae6..a1f9bf732cf 100755
--- a/gcc/ada/s-regexp.ads
+++ b/gcc/ada/s-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- --
@@ -109,7 +109,7 @@ package System.Regexp is
Glob : Boolean := False;
Case_Sensitive : Boolean := True) return Regexp;
-- Compiles a regular expression S. If the syntax of the given
- -- expression is invalid (does not match above grammar, Error_In_Regexp
+ -- expression is invalid (does not match above grammar), Error_In_Regexp
-- is raised. If Glob is True, the pattern is considered as a 'globbing
-- pattern', that is a pattern as given by the second grammar above.
-- As a special case, if Pattern is the empty string it will always
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 700c685ea27..ff5f86e1668 100644
--- a/gcc/ada/s-stausa.adb
+++ b/gcc/ada/s-stausa.adb
@@ -258,20 +258,29 @@ package body System.Stack_Usage is
-- big, the more an "instrumentation threshold at writing" error is
-- likely to happen.
- Current_Stack_Level : aliased Integer;
+ Stack_Used_When_Filling : Integer;
+ Current_Stack_Level : aliased Integer;
begin
-- Readjust the pattern size. When we arrive in this function, there is
-- already a given amount of stack used, that we won't analyze.
- Analyzer.Stack_Used_When_Filling :=
+ Stack_Used_When_Filling :=
Stack_Size
(Analyzer.Bottom_Of_Stack,
To_Stack_Address (Current_Stack_Level'Address))
+ Natural (Current_Stack_Level'Size);
- Analyzer.Pattern_Size :=
- Analyzer.Pattern_Size - Analyzer.Stack_Used_When_Filling;
+ if Stack_Used_When_Filling > Analyzer.Pattern_Size then
+ -- In this case, the known size of the stack is too small, we've
+ -- already taken more than expected, so there's no possible
+ -- computation
+
+ Analyzer.Pattern_Size := 0;
+ else
+ Analyzer.Pattern_Size :=
+ Analyzer.Pattern_Size - Stack_Used_When_Filling;
+ end if;
declare
Stack : aliased Stack_Slots
@@ -282,17 +291,23 @@ package body System.Stack_Usage is
Analyzer.Stack_Overlay_Address := Stack'Address;
- Analyzer.Bottom_Pattern_Mark :=
- To_Stack_Address (Stack (Bottom_Slot_Index_In (Stack))'Address);
- Analyzer.Top_Pattern_Mark :=
- To_Stack_Address (Stack (Top_Slot_Index_In (Stack))'Address);
+ if Analyzer.Pattern_Size /= 0 then
+ Analyzer.Bottom_Pattern_Mark :=
+ To_Stack_Address (Stack (Bottom_Slot_Index_In (Stack))'Address);
+ Analyzer.Top_Pattern_Mark :=
+ To_Stack_Address (Stack (Top_Slot_Index_In (Stack))'Address);
+ else
+ 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
-- add the size of the element whose address 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;
@@ -367,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.
@@ -539,20 +558,31 @@ package body System.Stack_Usage is
-------------------
procedure Report_Result (Analyzer : Stack_Analyzer) is
- Measure : constant Natural :=
- Stack_Size
- (Analyzer.Topmost_Touched_Mark,
- Analyzer.Bottom_Of_Stack)
- + Analyzer.Stack_Used_When_Filling;
-
- Result : constant Task_Result :=
+ Result : Task_Result :=
(Task_Name => Analyzer.Task_Name,
Max_Size => Analyzer.Stack_Size,
- Min_Measure => Measure,
- Max_Measure => Measure + Analyzer.Stack_Size
- - Analyzer.Pattern_Size);
+ 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 - 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 + Overflow_Guard;
+ end if;
+
if Analyzer.Result_Id in Result_Array'Range then
-- If the result can be stored, then store it in Result_Array
diff --git a/gcc/ada/s-stausa.ads b/gcc/ada/s-stausa.ads
index 8a6e2b67cb5..2aa9dd70d2d 100644
--- a/gcc/ada/s-stausa.ads
+++ b/gcc/ada/s-stausa.ads
@@ -304,10 +304,6 @@ private
Result_Id : Positive;
-- Id of the result. If less than value given to gnatbind -u corresponds
-- to the location in the result array of result for the current task.
-
- Stack_Used_When_Filling : Natural := 0;
- -- Amount of stack that was already used when actually filling the
- -- memory, and therefore not analyzed.
end record;
Environment_Task_Analyzer : Stack_Analyzer;
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 8d181087e97..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,18 +108,6 @@ package body System.Strings.Stream_Ops is
subtype String_Block is String_Type (1 .. C_In_Default_Block);
- -- Block IO is used in the following two scenarios:
-
- -- 1) When the size of the character type equals that of the stream
- -- element type, regardless of endianness.
-
- -- 2) When using the standard stream IO routines for elementary
- -- types which guarantees the same endianness over partitions.
-
- Use_Block_IO : constant Boolean :=
- C_Size = SE_Size
- or else Stream_Attributes.Block_IO_OK;
-
-- Conversions to and from Default_Block
function To_Default_Block is
@@ -112,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
@@ -131,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.
@@ -215,7 +284,7 @@ package body System.Strings.Stream_Ops is
end if;
end;
- -- Character-by-character IO
+ -- Byte IO
else
declare
@@ -236,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
@@ -249,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.
@@ -303,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
@@ -313,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
@@ -338,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 --
@@ -374,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 --
@@ -397,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 --
------------------
@@ -409,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 --
@@ -457,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 --
@@ -480,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 --
-----------------------
@@ -492,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 --
@@ -540,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 --
@@ -563,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 --
----------------------------
@@ -575,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 4f50dc01789..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
@@ -2770,7 +2781,17 @@ package body Sem_Aggr is
Error_Msg_N ("record aggregate cannot be null", N);
return;
- elsif No (First_Entity (Typ)) then
+ -- If the type has no components, then the aggregate should either
+ -- have "null record", or in Ada 2005 it could instead have a single
+ -- component association given by "others => <>". For Ada 95 we flag
+ -- an error at this point, but for Ada 2005 we proceed with checking
+ -- the associations below, which will catch the case where it's not
+ -- an aggregate with "others => <>". Note that the legality of a <>
+ -- aggregate for a null record type was established by AI05-016.
+
+ elsif No (First_Entity (Typ))
+ and then Ada_Version < Ada_05
+ then
Error_Msg_N ("record aggregate must be null", N);
return;
end if;
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 14f9102d369..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
@@ -1898,6 +1929,7 @@ package body Sem_Attr is
and then Aname /= Name_Address
and then Aname /= Name_Code_Address
and then Aname /= Name_Count
+ and then Aname /= Name_Result
and then Aname /= Name_Unchecked_Access
then
Error_Attr ("ambiguous prefix for % attribute", P);
@@ -1988,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);
@@ -2975,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 --
-----------------------
@@ -3737,10 +3784,20 @@ 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
+ -- postcondition will not be propagated to the expanded call.
+
+ if Has_Pragma_Inline_Always (PS)
+ and then Warn_On_Redundant_Constructs
+ then
+ Error_Msg_N
+ ("postconditions on inlined functions not enforced?", N);
+ end if;
+
-- If we are in the scope of a function and in Spec_Expression mode,
-- this is likely the prescan of the postcondition pragma, and we
-- just set the proper type. If there is an error it will be caught
@@ -3768,30 +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 Chars (P) /= Chars (PS)
+ if Chars (CS) = Name_uPostconditions
+ and then Ekind (PS) = E_Function
then
- Error_Msg_NE
- ("incorrect prefix for % attribute, expected &", P, PS);
- Error_Attr;
- end if;
+ -- Check OK prefix
- Rewrite (N,
- Make_Identifier (Sloc (N),
- Chars => Name_uResult));
- Analyze_And_Resolve (N, Etype (PS));
+ if Nkind_In (P, N_Identifier, N_Operator_Symbol)
+ and then Chars (P) = Chars (PS)
+ then
+ null;
- else
- Error_Attr
- ("% attribute can only appear in function Postcondition pragma",
- P);
+ -- Within an instance, the prefix designates the local renaming
+ -- of the original generic.
+
+ 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;
+
+ else
+ Error_Msg_NE
+ ("incorrect prefix for % attribute, expected &", P, PS);
+ Error_Attr;
+ end if;
+
+ 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;
@@ -4213,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 --
----------------
@@ -4232,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 --
-----------------
@@ -7228,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
@@ -7463,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 540b2a6d85d..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
@@ -2660,13 +2656,18 @@ package body Sem_Ch10 is
P : Node_Id;
function Build_Unit_Name (Nam : Node_Id) return Node_Id;
- -- Comment required here ???
+ -- 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
+ -- with clause is the renamed unit, but the identifier is the one from
+ -- the source, which allows us to recover the unit renaming.
---------------------
-- Build_Unit_Name --
---------------------
function Build_Unit_Name (Nam : Node_Id) return Node_Id is
+ Ent : Entity_Id;
Renaming : Entity_Id;
Result : Node_Id;
@@ -2695,12 +2696,33 @@ package body Sem_Ch10 is
end if;
else
+ Ent := Entity (Nam);
+
+ if Present (Entity (Selector_Name (Nam)))
+ and then Chars (Entity (Selector_Name (Nam))) /= Chars (Ent)
+ and then
+ 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
+ -- in lib-load with the unit it renames. We have to make A.B
+ -- visible, so analyze the declaration for B now, in case it
+ -- has not been done yet.
+
+ Ent := Entity (Selector_Name (Nam));
+ Analyze
+ (Parent
+ (Unit_Declaration_Node (Entity (Selector_Name (Nam)))));
+ end if;
+
Result :=
Make_Expanded_Name (Loc,
Chars => Chars (Entity (Nam)),
Prefix => Build_Unit_Name (Prefix (Nam)),
- Selector_Name => New_Occurrence_Of (Entity (Nam), Loc));
- Set_Entity (Result, Entity (Nam));
+ Selector_Name => New_Occurrence_Of (Ent, Loc));
+ Set_Entity (Result, Ent);
return Result;
end if;
end Build_Unit_Name;
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index cae84097d1a..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
@@ -2413,10 +2427,9 @@ package body Sem_Ch12 is
Error_Msg_N ("no visible entity matches specification", Def);
end if;
- else
-
- -- Several interpretations. Disambiguate as for a renaming.
+ -- More than one interpretation, so disambiguate as for a renaming
+ else
declare
I : Interp_Index;
I1 : Interp_Index := 0;
@@ -2427,7 +2440,6 @@ package body Sem_Ch12 is
Subp := Any_Id;
Get_First_Interp (Def, I, It);
while Present (It.Nam) loop
-
if Entity_Matches_Spec (It.Nam, Nam) then
if Subp /= Any_Id then
It1 := Disambiguate (Def, I1, I, Etype (Subp));
@@ -3755,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 --
--------------------------------------
@@ -4146,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);
@@ -5173,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;
@@ -8351,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);
@@ -8383,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);
@@ -8701,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.
@@ -9223,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);
@@ -10855,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 b6ccb6028fc..18538c878be 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -31,6 +31,7 @@ with Einfo; use Einfo;
with Errout; use Errout;
with Eval_Fat; use Eval_Fat;
with Exp_Ch3; use Exp_Ch3;
+with Exp_Ch9; use Exp_Ch9;
with Exp_Disp; use Exp_Disp;
with Exp_Dist; use Exp_Dist;
with Exp_Tss; use Exp_Tss;
@@ -934,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
@@ -1041,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))
@@ -1103,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;
@@ -1146,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);
@@ -1629,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
@@ -2517,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.
@@ -2526,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;
@@ -4427,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;
@@ -4438,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;
@@ -4471,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,
@@ -4479,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);
@@ -4566,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;
@@ -7554,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;
@@ -12839,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
@@ -13136,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
@@ -15294,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
@@ -15811,48 +15916,117 @@ package body Sem_Ch3 is
-- If the private view was tagged, copy the new primitive operations
-- from the private view to the full view.
- -- Note: Subprograms covering interface primitives were previously
- -- propagated to the full view by Derive_Progenitor_Primitives
-
- if Is_Tagged_Type (Full_T)
- and then not Is_Concurrent_Type (Full_T)
- then
+ if Is_Tagged_Type (Full_T) then
declare
- Priv_List : Elist_Id;
- Full_List : constant Elist_Id := Primitive_Operations (Full_T);
- P1, P2 : Elmt_Id;
+ Disp_Typ : Entity_Id;
+ Full_List : Elist_Id;
Prim : Entity_Id;
- D_Type : Entity_Id;
+ Prim_Elmt : Elmt_Id;
+ Priv_List : Elist_Id;
+
+ function Contains
+ (E : Entity_Id;
+ L : Elist_Id) return Boolean;
+ -- Determine whether list L contains element E
+
+ --------------
+ -- Contains --
+ --------------
+
+ function Contains
+ (E : Entity_Id;
+ L : Elist_Id) return Boolean
+ is
+ List_Elmt : Elmt_Id;
+
+ begin
+ List_Elmt := First_Elmt (L);
+ while Present (List_Elmt) loop
+ if Node (List_Elmt) = E then
+ return True;
+ end if;
+
+ Next_Elmt (List_Elmt);
+ end loop;
+
+ return False;
+ end Contains;
+
+ -- Start of processing
begin
if Is_Tagged_Type (Priv_T) then
Priv_List := Primitive_Operations (Priv_T);
+ Prim_Elmt := First_Elmt (Priv_List);
+
+ -- In the case of a concurrent type completing a private tagged
+ -- type, primivies may have been declared in between the two
+ -- views. These subprograms need to be wrapped the same way
+ -- entries and protected procedures are handled because they
+ -- cannot be directly shared by the two views.
- P1 := First_Elmt (Priv_List);
- while Present (P1) loop
- Prim := Node (P1);
+ if Is_Concurrent_Type (Full_T) then
+ declare
+ Conc_Typ : constant Entity_Id :=
+ Corresponding_Record_Type (Full_T);
+ Loc : constant Source_Ptr := Sloc (Conc_Typ);
+ Curr_Nod : Node_Id := Parent (Conc_Typ);
+ Wrap_Spec : Node_Id;
- -- Transfer explicit primitives, not those inherited from
- -- parent of partial view, which will be re-inherited on
- -- the full view.
+ begin
+ while Present (Prim_Elmt) loop
+ Prim := Node (Prim_Elmt);
- if Comes_From_Source (Prim) then
- P2 := First_Elmt (Full_List);
- while Present (P2) and then Node (P2) /= Prim loop
- Next_Elmt (P2);
+ if Comes_From_Source (Prim)
+ and then not Is_Abstract_Subprogram (Prim)
+ then
+ Wrap_Spec :=
+ Make_Subprogram_Declaration (Loc,
+ Specification =>
+ Build_Wrapper_Spec (Loc,
+ Subp_Id => Prim,
+ Obj_Typ => Conc_Typ,
+ Formals =>
+ Parameter_Specifications (
+ Parent (Prim))));
+
+ Insert_After (Curr_Nod, Wrap_Spec);
+ Curr_Nod := Wrap_Spec;
+
+ Analyze (Wrap_Spec);
+ end if;
+
+ Next_Elmt (Prim_Elmt);
end loop;
- -- If not found, that is a new one
+ return;
+ end;
+
+ -- For non-concurrent types, transfer explicit primitives, but
+ -- omit those inherited from the parent of the private view
+ -- since they will be re-inherited later on.
+
+ else
+ Full_List := Primitive_Operations (Full_T);
+
+ while Present (Prim_Elmt) loop
+ Prim := Node (Prim_Elmt);
- if No (P2) then
+ if Comes_From_Source (Prim)
+ and then not Contains (Prim, Full_List)
+ then
Append_Elmt (Prim, Full_List);
end if;
- end if;
- Next_Elmt (P1);
- end loop;
+ Next_Elmt (Prim_Elmt);
+ end loop;
+ end if;
+
+ -- Untagged private view
else
+ Full_List := Primitive_Operations (Full_T);
+
-- In this case the partial view is untagged, so here we locate
-- all of the earlier primitives that need to be treated as
-- dispatching (those that appear between the two views). Note
@@ -15871,10 +16045,9 @@ package body Sem_Ch3 is
or else
Ekind (Prim) = E_Function
then
+ Disp_Typ := Find_Dispatching_Type (Prim);
- D_Type := Find_Dispatching_Type (Prim);
-
- if D_Type = Full_T
+ if Disp_Typ = Full_T
and then (Chars (Prim) /= Name_Op_Ne
or else Comes_From_Source (Prim))
then
@@ -15887,13 +16060,13 @@ package body Sem_Ch3 is
end if;
elsif Is_Dispatching_Operation (Prim)
- and then D_Type /= Full_T
+ and then Disp_Typ /= Full_T
then
-- Verify that it is not otherwise controlled by a
-- formal or a return value of type T.
- Check_Controlling_Formals (D_Type, Prim);
+ Check_Controlling_Formals (Disp_Typ, Prim);
end if;
end if;
@@ -16381,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);
@@ -16426,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 e14fb436d6b..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
@@ -6380,9 +6434,15 @@ package body Sem_Ch4 is
-----------------------------
function Valid_First_Argument_Of (Op : Entity_Id) return Boolean is
- Typ : constant Entity_Id := Etype (First_Formal (Op));
+ Typ : Entity_Id := Etype (First_Formal (Op));
begin
+ if Is_Concurrent_Type (Typ)
+ and then Present (Corresponding_Record_Type (Typ))
+ then
+ Typ := Corresponding_Record_Type (Typ);
+ end if;
+
-- Simple case. Object may be a subtype of the tagged type or
-- may be the corresponding record of a synchronized type.
@@ -6414,6 +6474,10 @@ package body Sem_Ch4 is
-- corresponding record (base) type.
if Is_Concurrent_Type (Obj_Type) then
+ if not Present (Corresponding_Record_Type (Obj_Type)) then
+ return False;
+ end if;
+
Corr_Type := Base_Type (Corresponding_Record_Type (Obj_Type));
Elmt := First_Elmt (Primitive_Operations (Corr_Type));
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 0116a83517c..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
@@ -891,6 +913,37 @@ package body Sem_Ch6 is
end if;
Set_Actual_Subtypes (N, Current_Scope);
+ Process_PPCs (N, Gen_Id, Body_Id);
+
+ -- If the generic unit carries pre- or post-conditions, copy them
+ -- to the original generic tree, so that they are properly added
+ -- to any instantiation.
+
+ declare
+ Orig : constant Node_Id := Original_Node (N);
+ Cond : Node_Id;
+
+ begin
+ Cond := First (Declarations (N));
+ while Present (Cond) loop
+ if Nkind (Cond) = N_Pragma
+ and then Pragma_Name (Cond) = Name_Check
+ then
+ Prepend (New_Copy_Tree (Cond), Declarations (Orig));
+
+ elsif Nkind (Cond) = N_Pragma
+ and then Pragma_Name (Cond) = Name_Postcondition
+ then
+ Set_Ekind (Defining_Entity (Orig), Ekind (Gen_Id));
+ Prepend (New_Copy_Tree (Cond), Declarations (Orig));
+ else
+ exit;
+ end if;
+
+ Next (Cond);
+ end loop;
+ end;
+
Analyze_Declarations (Declarations (N));
Check_Completion;
Analyze (Handled_Statement_Sequence (N));
@@ -1209,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);
@@ -1306,6 +1372,17 @@ package body Sem_Ch6 is
-- If pragma does not appear after the body, check whether there is
-- an inline pragma before any local declarations.
+ function Disambiguate_Spec return Entity_Id;
+ -- When a primitive is declared between the private view and the full
+ -- view of a concurrent type which implements an interface, a special
+ -- mechanism is used to find the corresponding spec of the primitive
+ -- body.
+
+ function Is_Private_Concurrent_Primitive
+ (Subp_Id : Entity_Id) return Boolean;
+ -- Determine whether subprogram Subp_Id is a primitive of a concurrent
+ -- type that implements an interface and has a private view.
+
procedure Set_Trivial_Subprogram (N : Node_Id);
-- Sets the Is_Trivial_Subprogram flag in both spec and body of the
-- subprogram whose body is being analyzed. N is the statement node
@@ -1457,6 +1534,134 @@ package body Sem_Ch6 is
end if;
end Check_Inline_Pragma;
+ -----------------------
+ -- Disambiguate_Spec --
+ -----------------------
+
+ function Disambiguate_Spec return Entity_Id is
+ Priv_Spec : Entity_Id;
+ Spec_N : Entity_Id;
+
+ procedure Replace_Types (To_Corresponding : Boolean);
+ -- Depending on the flag, replace the type of formal parameters of
+ -- Body_Id if it is a concurrent type implementing interfaces with
+ -- the corresponding record type or the other way around.
+
+ procedure Replace_Types (To_Corresponding : Boolean) is
+ Formal : Entity_Id;
+ Formal_Typ : Entity_Id;
+
+ begin
+ Formal := First_Formal (Body_Id);
+ while Present (Formal) loop
+ Formal_Typ := Etype (Formal);
+
+ -- From concurrent type to corresponding record
+
+ if To_Corresponding then
+ if Is_Concurrent_Type (Formal_Typ)
+ and then Present (Corresponding_Record_Type (Formal_Typ))
+ and then Present (Interfaces (
+ Corresponding_Record_Type (Formal_Typ)))
+ then
+ Set_Etype (Formal,
+ Corresponding_Record_Type (Formal_Typ));
+ end if;
+
+ -- From corresponding record to concurrent type
+
+ else
+ if Is_Concurrent_Record_Type (Formal_Typ)
+ and then Present (Interfaces (Formal_Typ))
+ then
+ Set_Etype (Formal,
+ Corresponding_Concurrent_Type (Formal_Typ));
+ end if;
+ end if;
+
+ Next_Formal (Formal);
+ end loop;
+ end Replace_Types;
+
+ -- Start of processing for Disambiguate_Spec
+
+ begin
+ -- Try to retrieve the specification of the body as is. All error
+ -- messages are suppressed because the body may not have a spec in
+ -- its current state.
+
+ Spec_N := Find_Corresponding_Spec (N, False);
+
+ -- It is possible that this is the body of a primitive declared
+ -- between a private and a full view of a concurrent type. The
+ -- controlling parameter of the spec carries the concurrent type,
+ -- not the corresponding record type as transformed by Analyze_
+ -- 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
+ -- original concurrent status.
+
+ if No (Spec_N)
+ or else Is_Primitive_Wrapper (Spec_N)
+ then
+ -- Restore all references of corresponding record types to the
+ -- original concurrent types.
+
+ Replace_Types (To_Corresponding => False);
+ Priv_Spec := Find_Corresponding_Spec (N, False);
+
+ -- The current body truly belongs to a primitive declared between
+ -- a private and a full view. We leave the modified body as is,
+ -- and return the true spec.
+
+ if Present (Priv_Spec)
+ and then Is_Private_Primitive (Priv_Spec)
+ then
+ return Priv_Spec;
+ end if;
+
+ -- In case that this is some sort of error, restore the original
+ -- state of the body.
+
+ Replace_Types (To_Corresponding => True);
+ end if;
+
+ return Spec_N;
+ end Disambiguate_Spec;
+
+ -------------------------------------
+ -- Is_Private_Concurrent_Primitive --
+ -------------------------------------
+
+ function Is_Private_Concurrent_Primitive
+ (Subp_Id : Entity_Id) return Boolean
+ is
+ Formal_Typ : Entity_Id;
+
+ begin
+ if Present (First_Formal (Subp_Id)) then
+ Formal_Typ := Etype (First_Formal (Subp_Id));
+
+ if Is_Concurrent_Record_Type (Formal_Typ) then
+ Formal_Typ := Corresponding_Concurrent_Type (Formal_Typ);
+ end if;
+
+ -- The type of the first formal is a concurrent tagged type with
+ -- a private view.
+
+ return
+ Is_Concurrent_Type (Formal_Typ)
+ and then Is_Tagged_Type (Formal_Typ)
+ and then Has_Private_Declaration (Formal_Typ);
+ end if;
+
+ return False;
+ end Is_Private_Concurrent_Primitive;
+
----------------------------
-- Set_Trivial_Subprogram --
----------------------------
@@ -1519,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;
@@ -1581,7 +1792,11 @@ package body Sem_Ch6 is
if Nkind (N) = N_Subprogram_Body_Stub
or else No (Corresponding_Spec (N))
then
- Spec_Id := Find_Corresponding_Spec (N);
+ if Is_Private_Concurrent_Primitive (Body_Id) then
+ Spec_Id := Disambiguate_Spec;
+ else
+ Spec_Id := Find_Corresponding_Spec (N);
+ end if;
-- If this is a duplicate body, no point in analyzing it
@@ -1595,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
@@ -1737,6 +1959,10 @@ package body Sem_Ch6 is
end if;
end if;
+ if Chars (Body_Id) = Name_uPostconditions then
+ Set_Has_Postconditions (Current_Scope);
+ end if;
+
-- Place subprogram on scope stack, and make formals visible. If there
-- is a spec, the visible entity remains that of the spec.
@@ -2228,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;
@@ -2322,6 +2537,22 @@ package body Sem_Ch6 is
New_Overloaded_Entity (Designator);
Check_Delayed_Subprogram (Designator);
+ -- If the type of the first formal of the current subprogram is a non
+ -- generic tagged private type , mark the subprogram as being a private
+ -- primitive.
+
+ if Present (First_Formal (Designator)) then
+ declare
+ Formal_Typ : constant Entity_Id :=
+ Etype (First_Formal (Designator));
+ begin
+ Set_Is_Private_Primitive (Designator,
+ Is_Tagged_Type (Formal_Typ)
+ and then Is_Private_Type (Formal_Typ)
+ and then not Is_Generic_Actual_Type (Formal_Typ));
+ end;
+ end if;
+
-- Ada 2005 (AI-251): Abstract interface primitives must be abstract
-- or null.
@@ -2435,8 +2666,6 @@ package body Sem_Ch6 is
function Analyze_Subprogram_Specification (N : Node_Id) return Entity_Id is
Designator : constant Entity_Id := Defining_Entity (N);
Formals : constant List_Id := Parameter_Specifications (N);
- Formal : Entity_Id;
- Formal_Typ : Entity_Id;
-- Start of processing for Analyze_Subprogram_Specification
@@ -2466,21 +2695,29 @@ package body Sem_Ch6 is
-- record, to match the proper signature of an overriding operation.
if Ada_Version >= Ada_05 then
- Formal := First_Formal (Designator);
- while Present (Formal) loop
- Formal_Typ := Etype (Formal);
+ declare
+ Formal : Entity_Id;
+ Formal_Typ : Entity_Id;
+ Rec_Typ : Entity_Id;
- if Is_Concurrent_Type (Formal_Typ)
- and then Present (Corresponding_Record_Type (Formal_Typ))
- and then Present (Interfaces
- (Corresponding_Record_Type (Formal_Typ)))
- then
- Set_Etype (Formal,
- Corresponding_Record_Type (Formal_Typ));
- end if;
+ begin
+ Formal := First_Formal (Designator);
+ while Present (Formal) loop
+ Formal_Typ := Etype (Formal);
- Formal := Next_Formal (Formal);
- end loop;
+ if Is_Concurrent_Type (Formal_Typ)
+ and then Present (Corresponding_Record_Type (Formal_Typ))
+ then
+ Rec_Typ := Corresponding_Record_Type (Formal_Typ);
+
+ if Present (Interfaces (Rec_Typ)) then
+ Set_Etype (Formal, Rec_Typ);
+ end if;
+ end if;
+
+ Next_Formal (Formal);
+ end loop;
+ end;
end if;
End_Scope;
@@ -2881,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);
@@ -3690,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;
@@ -3936,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
@@ -3959,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
@@ -5020,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),
@@ -5161,7 +5405,10 @@ package body Sem_Ch6 is
-- Find_Corresponding_Spec --
-----------------------------
- function Find_Corresponding_Spec (N : Node_Id) return Entity_Id is
+ function Find_Corresponding_Spec
+ (N : Node_Id;
+ Post_Error : Boolean := True) return Entity_Id
+ is
Spec : constant Node_Id := Specification (N);
Designator : constant Entity_Id := Defining_Entity (Spec);
@@ -5205,7 +5452,6 @@ package body Sem_Ch6 is
end if;
if not Has_Completion (E) then
-
if Nkind (N) /= N_Subprogram_Body_Stub then
Set_Corresponding_Spec (N, E);
end if;
@@ -5250,14 +5496,15 @@ package body Sem_Ch6 is
return Empty;
end if;
- -- If body already exists, this is an error unless the
- -- previous declaration is the implicit declaration of
- -- a derived subprogram, or this is a spurious overloading
- -- in an instance.
+ -- If the body already exists, then this is an error unless
+ -- the previous declaration is the implicit declaration of a
+ -- derived subprogram, or this is a spurious overloading in an
+ -- instance.
elsif No (Alias (E))
and then not Is_Intrinsic_Subprogram (E)
and then not In_Instance
+ and then Post_Error
then
Error_Msg_Sloc := Sloc (E);
if Is_Imported (E) then
@@ -5269,16 +5516,17 @@ package body Sem_Ch6 is
end if;
end if;
+ -- Child units cannot be overloaded, so a conformance mismatch
+ -- between body and a previous spec is an error.
+
elsif Is_Child_Unit (E)
and then
Nkind (Unit_Declaration_Node (Designator)) = N_Subprogram_Body
and then
Nkind (Parent (Unit_Declaration_Node (Designator))) =
- N_Compilation_Unit
+ N_Compilation_Unit
+ and then Post_Error
then
- -- Child units cannot be overloaded, so a conformance mismatch
- -- between body and a previous spec is an error.
-
Error_Msg_N
("body of child unit does not match previous declaration", N);
end if;
@@ -6246,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
@@ -6331,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
@@ -6401,12 +6648,6 @@ package body Sem_Ch6 is
In_Scope : Boolean;
Typ : Entity_Id;
- function Has_Correct_Formal_Mode
- (Tag_Typ : Entity_Id;
- Subp : Entity_Id) return Boolean;
- -- For an overridden subprogram Subp, check whether the mode of its
- -- first parameter is correct depending on the kind of Tag_Typ.
-
function Matches_Prefixed_View_Profile
(Prim_Params : List_Id;
Iface_Params : List_Id) return Boolean;
@@ -6415,39 +6656,6 @@ package body Sem_Ch6 is
-- Iface_Params. Also determine if the type of first parameter of
-- Iface_Params is an implemented interface.
- -----------------------------
- -- Has_Correct_Formal_Mode --
- -----------------------------
-
- function Has_Correct_Formal_Mode
- (Tag_Typ : Entity_Id;
- Subp : Entity_Id) return Boolean
- is
- Formal : constant Node_Id := First_Formal (Subp);
-
- begin
- -- In order for an entry or a protected procedure to override, the
- -- first parameter of the overridden routine must be of mode
- -- "out", "in out" or access-to-variable.
-
- if (Ekind (Subp) = E_Entry
- or else Ekind (Subp) = E_Procedure)
- and then Is_Protected_Type (Tag_Typ)
- and then Ekind (Formal) /= E_In_Out_Parameter
- and then Ekind (Formal) /= E_Out_Parameter
- and then Nkind (Parameter_Type (Parent (Formal))) /=
- N_Access_Definition
- then
- return False;
- end if;
-
- -- All other cases are OK since a task entry or routine does not
- -- have a restriction on the mode of the first parameter of the
- -- overridden interface routine.
-
- return True;
- end Has_Correct_Formal_Mode;
-
-----------------------------------
-- Matches_Prefixed_View_Profile --
-----------------------------------
@@ -6525,15 +6733,15 @@ package body Sem_Ch6 is
Iface_Id := Defining_Identifier (Iface_Param);
Iface_Typ := Find_Parameter_Type (Iface_Param);
- if Is_Access_Type (Iface_Typ) then
- Iface_Typ := Directly_Designated_Type (Iface_Typ);
- end if;
-
Prim_Id := Defining_Identifier (Prim_Param);
Prim_Typ := Find_Parameter_Type (Prim_Param);
- if Is_Access_Type (Prim_Typ) then
- Prim_Typ := Directly_Designated_Type (Prim_Typ);
+ if Ekind (Iface_Typ) = E_Anonymous_Access_Type
+ and then Ekind (Prim_Typ) = E_Anonymous_Access_Type
+ and then Is_Concurrent_Type (Designated_Type (Prim_Typ))
+ then
+ Iface_Typ := Designated_Type (Iface_Typ);
+ Prim_Typ := Designated_Type (Prim_Typ);
end if;
-- Case of multiple interface types inside a parameter profile
@@ -6666,60 +6874,63 @@ package body Sem_Ch6 is
while Present (Hom) loop
Subp := Hom;
- -- Entries can override abstract or null interface
- -- procedures
-
- if Ekind (Def_Id) = E_Entry
- and then Ekind (Subp) = E_Procedure
- and then Nkind (Parent (Subp)) = N_Procedure_Specification
- and then (Is_Abstract_Subprogram (Subp)
- or else Null_Present (Parent (Subp)))
+ if Subp = Def_Id
+ or else not Is_Overloadable (Subp)
+ or else not Is_Primitive (Subp)
+ or else not Is_Dispatching_Operation (Subp)
+ or else not Is_Interface (Find_Dispatching_Type (Subp))
then
- while Present (Alias (Subp)) loop
- Subp := Alias (Subp);
- end loop;
-
- if Matches_Prefixed_View_Profile
- (Parameter_Specifications (Parent (Def_Id)),
- Parameter_Specifications (Parent (Subp)))
- then
- Candidate := Subp;
-
- -- Absolute match
-
- if Has_Correct_Formal_Mode (Typ, Candidate) then
- Overridden_Subp := Candidate;
- return;
- end if;
- end if;
+ null;
- -- Procedures can override abstract or null interface
- -- procedures
+ -- Entries and procedures can override abstract or null
+ -- interface procedures
- elsif Ekind (Def_Id) = E_Procedure
+ elsif (Ekind (Def_Id) = E_Procedure
+ or else Ekind (Def_Id) = E_Entry)
and then Ekind (Subp) = E_Procedure
- and then Nkind (Parent (Subp)) = N_Procedure_Specification
- and then (Is_Abstract_Subprogram (Subp)
- or else Null_Present (Parent (Subp)))
and then Matches_Prefixed_View_Profile
(Parameter_Specifications (Parent (Def_Id)),
Parameter_Specifications (Parent (Subp)))
then
Candidate := Subp;
- -- Absolute match
+ -- For an overridden subprogram Subp, check whether the mode
+ -- of its first parameter is correct depending on the kind
+ -- of synchronized type.
- if Has_Correct_Formal_Mode (Typ, Candidate) then
- Overridden_Subp := Candidate;
- return;
- end if;
+ declare
+ Formal : constant Node_Id := First_Formal (Candidate);
+
+ begin
+ -- In order for an entry or a protected procedure to
+ -- override, the first parameter of the overridden
+ -- routine must be of mode "out", "in out" or
+ -- access-to-variable.
+
+ if (Ekind (Candidate) = E_Entry
+ or else Ekind (Candidate) = E_Procedure)
+ and then Is_Protected_Type (Typ)
+ and then Ekind (Formal) /= E_In_Out_Parameter
+ and then Ekind (Formal) /= E_Out_Parameter
+ and then Nkind (Parameter_Type (Parent (Formal)))
+ /= N_Access_Definition
+ then
+ null;
+
+ -- All other cases are OK since a task entry or routine
+ -- does not have a restriction on the mode of the first
+ -- parameter of the overridden interface routine.
+
+ else
+ Overridden_Subp := Candidate;
+ return;
+ end if;
+ end;
-- Functions can override abstract interface functions
elsif Ekind (Def_Id) = E_Function
and then Ekind (Subp) = E_Function
- and then Nkind (Parent (Subp)) = N_Function_Specification
- and then Is_Abstract_Subprogram (Subp)
and then Matches_Prefixed_View_Profile
(Parameter_Specifications (Parent (Def_Id)),
Parameter_Specifications (Parent (Subp)))
@@ -7590,8 +7801,17 @@ package body Sem_Ch6 is
-- 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.
+
Set_Analyzed (CP, False);
+ if Nam = Name_Postcondition
+ and then not Expander_Active
+ then
+ return CP;
+ end if;
+
-- Change pragma into corresponding pragma Check
Prepend_To (Pragma_Argument_Associations (CP),
@@ -7609,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
@@ -7664,7 +7890,15 @@ package body Sem_Ch6 is
end if;
Analyze (Prag);
- Append (Grab_PPC (Name_Postcondition), Plist);
+
+ -- If expansion is disabled, as in a generic unit,
+ -- save pragma for later expansion.
+
+ if not Expander_Active then
+ Prepend (Grab_PPC (Name_Postcondition), Declarations (N));
+ else
+ Append (Grab_PPC (Name_Postcondition), Plist);
+ end if;
end if;
Next (Prag);
@@ -7697,16 +7931,23 @@ package body Sem_Ch6 is
Plist := Empty_List;
end if;
- Append (Grab_PPC (Name_Postcondition), Plist);
+ if not Expander_Active then
+ Prepend (Grab_PPC (Name_Postcondition), Declarations (N));
+ else
+ Append (Grab_PPC (Name_Postcondition), Plist);
+ end if;
end if;
Prag := Next_Pragma (Prag);
end loop;
end if;
- -- If we had any postconditions, build the procedure
+ -- If we had any postconditions and expansion is enabled, build
+ -- the Postconditions procedure.
- if Present (Plist) then
+ if Present (Plist)
+ and then Expander_Active
+ then
Subp := Defining_Entity (N);
if Etype (Subp) /= Standard_Void_Type then
diff --git a/gcc/ada/sem_ch6.ads b/gcc/ada/sem_ch6.ads
index 689ac8b690a..e54c1e1117c 100644
--- a/gcc/ada/sem_ch6.ads
+++ b/gcc/ada/sem_ch6.ads
@@ -136,8 +136,8 @@ package Sem_Ch6 is
Get_Inst : Boolean := False) return Boolean;
-- Check that the types of two formal parameters are conforming. In most
-- cases this is just a name comparison, but within an instance it involves
- -- generic actual types, and in the presence of anonymous access types
- -- it must examine the designated types.
+ -- generic actual types, and in the presence of anonymous access types it
+ -- must examine the designated types.
procedure Create_Extra_Formals (E : Entity_Id);
-- For each parameter of a subprogram or entry that requires an additional
@@ -147,7 +147,9 @@ package Sem_Ch6 is
-- the end of Subp's parameter list (with each subsequent extra formal
-- being attached to the preceding extra formal).
- function Find_Corresponding_Spec (N : Node_Id) return Entity_Id;
+ function Find_Corresponding_Spec
+ (N : Node_Id;
+ Post_Error : Boolean := True) return Entity_Id;
-- Use the subprogram specification in the body to retrieve the previous
-- subprogram declaration, if any.
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 c5edce6d085..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;
@@ -1578,25 +1594,45 @@ package body Sem_Ch8 is
-- an abstract formal subprogram must be dispatching
-- operation).
- case Attribute_Name (Nam) is
- when Name_Input =>
- Stream_Prim :=
- Find_Prim_Op (Prefix_Type, TSS_Stream_Input);
- when Name_Output =>
- Stream_Prim :=
- Find_Prim_Op (Prefix_Type, TSS_Stream_Output);
- when Name_Read =>
- Stream_Prim :=
- Find_Prim_Op (Prefix_Type, TSS_Stream_Read);
- when Name_Write =>
- Stream_Prim :=
- Find_Prim_Op (Prefix_Type, TSS_Stream_Write);
- when others =>
- Error_Msg_N
- ("attribute must be a primitive dispatching operation",
- Nam);
- return;
- end case;
+ begin
+ case Attribute_Name (Nam) is
+ when Name_Input =>
+ Stream_Prim :=
+ Find_Prim_Op (Prefix_Type, TSS_Stream_Input);
+ when Name_Output =>
+ Stream_Prim :=
+ Find_Prim_Op (Prefix_Type, TSS_Stream_Output);
+ when Name_Read =>
+ Stream_Prim :=
+ Find_Prim_Op (Prefix_Type, TSS_Stream_Read);
+ when Name_Write =>
+ Stream_Prim :=
+ Find_Prim_Op (Prefix_Type, TSS_Stream_Write);
+ when others =>
+ Error_Msg_N
+ ("attribute must be a primitive"
+ & " dispatching operation", Nam);
+ return;
+ end case;
+
+ exception
+
+ -- If no operation was found, and the type is limited,
+ -- the user should have defined one.
+
+ when Program_Error =>
+ if Is_Limited_Type (Prefix_Type) then
+ Error_Msg_NE
+ ("stream operation not defined for type&",
+ N, Prefix_Type);
+ return;
+
+ -- Otherwise, compiler should have generated default
+
+ else
+ raise;
+ end if;
+ end;
-- Rewrite the attribute into the name of its corresponding
-- primitive dispatching subprogram. We can then proceed with
@@ -1786,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)
@@ -1929,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)));
@@ -2897,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);
@@ -6609,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
@@ -7015,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);
@@ -7076,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 3feba8002d9..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;
@@ -583,6 +584,7 @@ package body Sem_Prag is
-- expression, returns True if so, False if non-static or not String.
procedure Pragma_Misplaced;
+ pragma No_Return (Pragma_Misplaced);
-- Issue fatal error message for misplaced pragma
procedure Process_Atomic_Shared_Volatile;
@@ -1279,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;
@@ -1350,9 +1352,54 @@ package body Sem_Prag is
procedure Check_Precondition_Postcondition (In_Body : out Boolean) is
P : Node_Id;
- S : Entity_Id;
PO : Node_Id;
+ procedure Chain_PPC (PO : Node_Id);
+ -- If PO is a subprogram declaration node (or a generic subprogram
+ -- declaration node), then the precondition/postcondition applies
+ -- to this subprogram and the processing for the pragma is completed.
+ -- Otherwise the pragma is misplaced.
+
+ ---------------
+ -- Chain_PPC --
+ ---------------
+
+ procedure Chain_PPC (PO : Node_Id) is
+ S : Node_Id;
+
+ begin
+ if not Nkind_In (PO, N_Subprogram_Declaration,
+ N_Generic_Subprogram_Declaration)
+ then
+ Pragma_Misplaced;
+ end if;
+
+ -- Here if we have subprogram or generic subprogram declaration
+
+ S := Defining_Unit_Name (Specification (PO));
+
+ -- Analyze the pragma unless it appears within a package spec,
+ -- which is the case where we delay the analysis of the PPC until
+ -- the end of the package declarations (for details, see
+ -- Analyze_Package_Specification.Analyze_PPCs).
+
+ if not Is_Package_Or_Generic_Package (Scope (S)) then
+ Analyze_PPC_In_Decl_Part (N, S);
+ end if;
+
+ -- Chain spec PPC pragma to list for subprogram
+
+ Set_Next_Pragma (N, Spec_PPC_List (S));
+ Set_Spec_PPC_List (S, N);
+
+ -- Return indicating spec case
+
+ In_Body := False;
+ return;
+ end Chain_PPC;
+
+ -- Start of processing for Check_Precondition_Postcondition
+
begin
if not Is_List_Member (N) then
Pragma_Misplaced;
@@ -1362,12 +1409,31 @@ package body Sem_Prag is
Set_PPC_Enabled (N, Check_Enabled (Pname));
+ -- If we are within an inlined body, the legality of the pragma
+ -- has been checked already.
+
+ if In_Inlined_Body then
+ In_Body := True;
+ return;
+ end if;
+
-- Search prior declarations
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
@@ -1379,37 +1445,11 @@ package body Sem_Prag is
elsif not Comes_From_Source (PO) then
null;
- -- Here if we hit a subprogram declaration
-
- elsif Nkind (PO) = N_Subprogram_Declaration then
- S := Defining_Unit_Name (Specification (PO));
-
- -- Analyze the pragma unless it appears within a package spec,
- -- which is the case where we delay the analysis of the PPC
- -- until 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
- Analyze_PPC_In_Decl_Part (N, S);
- end if;
-
- -- Chain spec PPC pragma to list for subprogram
-
- Set_Next_Pragma (N, Spec_PPC_List (S));
- Set_Spec_PPC_List (S, N);
-
- -- Return indicating spec case
-
- In_Body := False;
- return;
-
- -- If we encounter any other declaration moving back, misplaced
+ -- Only remaining possibility is subprogram declaration
else
- Pragma_Misplaced;
+ Chain_PPC (PO);
+ return;
end if;
end loop;
@@ -1419,14 +1459,28 @@ 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;
- -- If not, it was misplaced
+ -- See if it is in the pragmas after a library level subprogram
- else
- Pragma_Misplaced;
+ elsif Nkind (Parent (N)) = N_Compilation_Unit_Aux then
+ Chain_PPC (Unit (Parent (Parent (N))));
+ return;
end if;
+
+ -- If we fall through, pragma was misplaced
+
+ Pragma_Misplaced;
end Check_Precondition_Postcondition;
-----------------------------
@@ -2185,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);
@@ -2441,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);
@@ -2570,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))
@@ -2602,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)");
@@ -2661,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;
@@ -2914,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"
@@ -3279,7 +3328,6 @@ package body Sem_Prag is
Exp : Node_Id;
begin
- GNAT_Pragma;
Check_No_Identifiers;
Check_At_Least_N_Arguments (1);
@@ -3454,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);
@@ -3490,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
@@ -3716,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;
@@ -3834,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;
@@ -3857,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;
@@ -3910,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;
@@ -3939,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;
@@ -3955,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
@@ -4223,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);
@@ -4586,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
@@ -4619,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
@@ -4635,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);
@@ -4643,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
@@ -4668,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
@@ -4676,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
@@ -4689,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;
@@ -5147,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 --
---------------
@@ -5667,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 --
@@ -5692,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;
--------------------------
@@ -5702,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;
-------------------
@@ -6076,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 " &
@@ -6089,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 " &
@@ -6167,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;
@@ -6198,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
@@ -6207,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);
@@ -6216,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;
@@ -6608,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;
@@ -7077,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);
@@ -7410,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
@@ -7695,6 +7868,7 @@ package body Sem_Prag is
-- pragma Inline_Always ( NAME {, NAME} );
when Pragma_Inline_Always =>
+ GNAT_Pragma;
Process_Inline (True);
--------------------
@@ -7704,6 +7878,7 @@ package body Sem_Prag is
-- pragma Inline_Generic (NAME {, NAME});
when Pragma_Inline_Generic =>
+ GNAT_Pragma;
Process_Generic_List;
----------------------
@@ -8734,6 +8909,7 @@ package body Sem_Prag is
-- it was misplaced.
when Pragma_No_Body =>
+ GNAT_Pragma;
Pragma_Misplaced;
---------------
@@ -8800,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
@@ -8830,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 --
@@ -8865,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.
@@ -8885,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
@@ -9011,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;
@@ -9038,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 --
--------------
@@ -9317,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 --
--------------------
@@ -9388,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 --
-------------------
@@ -10904,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);
@@ -11152,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);
@@ -11519,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);
-------------------
@@ -11843,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
@@ -12041,6 +12221,7 @@ 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,
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index a6d42f73637..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,
@@ -3218,16 +3237,48 @@ package body Sem_Res is
-- or because it is a generic actual, so use base type to
-- locate concurrent type.
- if Is_Concurrent_Type (Etype (A))
- and then Etype (F) =
- Corresponding_Record_Type (Base_Type (Etype (A)))
- then
- Rewrite (A,
- Unchecked_Convert_To
- (Corresponding_Record_Type (Etype (A)), A));
- end if;
+ A_Typ := Base_Type (Etype (A));
+ F_Typ := Base_Type (Etype (F));
+
+ declare
+ Full_A_Typ : Entity_Id;
- Resolve (A, Etype (F));
+ begin
+ if Present (Full_View (A_Typ)) then
+ Full_A_Typ := Base_Type (Full_View (A_Typ));
+ else
+ Full_A_Typ := A_Typ;
+ end if;
+
+ -- Tagged synchronized type (case 1): the actual is a
+ -- concurrent type
+
+ if Is_Concurrent_Type (A_Typ)
+ and then Corresponding_Record_Type (A_Typ) = F_Typ
+ then
+ Rewrite (A,
+ Unchecked_Convert_To
+ (Corresponding_Record_Type (A_Typ), A));
+ Resolve (A, Etype (F));
+
+ -- Tagged synchronized type (case 2): the formal is a
+ -- concurrent type
+
+ elsif Ekind (Full_A_Typ) = E_Record_Type
+ and then Present
+ (Corresponding_Concurrent_Type (Full_A_Typ))
+ and then Is_Concurrent_Type (F_Typ)
+ and then Present (Corresponding_Record_Type (F_Typ))
+ and then Full_A_Typ = Corresponding_Record_Type (F_Typ)
+ then
+ Resolve (A, Corresponding_Record_Type (F_Typ));
+
+ -- Common case
+
+ else
+ Resolve (A, Etype (F));
+ end if;
+ end;
end if;
A_Typ := Etype (A);
@@ -4645,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
@@ -4698,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.
@@ -4713,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
@@ -5151,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
@@ -6506,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
@@ -6572,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.
@@ -6600,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.
@@ -9427,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
@@ -9440,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 4a170d82ce3..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,16 +2101,23 @@ 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.
or else
- (Is_Concurrent_Type (Etype (N))
+ (Is_Record_Type (Typ)
+ and then Is_Concurrent_Type (Etype (N))
and then Present (Corresponding_Record_Type (Etype (N)))
and then Covers (Typ, Corresponding_Record_Type (Etype (N))))
or else
+ (Is_Concurrent_Type (Typ)
+ and then Is_Record_Type (Etype (N))
+ and then Present (Corresponding_Record_Type (Typ))
+ and then Covers (Corresponding_Record_Type (Typ), Etype (N)))
+
+ or else
(not Is_Tagged_Type (Typ)
and then Ekind (Typ) /= E_Anonymous_Access_Type
and then Covers (Etype (N), Typ));
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 957dfae2625..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
@@ -657,7 +657,7 @@ package body Sinput is
end if;
elsif Chr = LF then
- if Source (P) = CR then
+ if Source (P + 1) = CR then
P := P + 2;
else
P := P + 1;
diff --git a/gcc/ada/sinput.ads b/gcc/ada/sinput.ads
index 6d3144092cf..82d03e75d23 100644
--- a/gcc/ada/sinput.ads
+++ b/gcc/ada/sinput.ads
@@ -565,12 +565,12 @@ package Sinput is
procedure Skip_Line_Terminators
(P : in out Source_Ptr;
Physical : out Boolean);
- -- On entry, P points to a line terminator that has been encountered,
- -- which is one of FF,LF,VT,CR or a wide character sequence whose value is
- -- in category Separator,Line or Separator,Paragraph. The purpose of this
- -- P points just past the character that was scanned. The purpose of this
- -- routine is to distinguish physical and logical line endings. A physical
- -- line ending is one of:
+ -- On entry, P points to a line terminator that has been encountered, which
+ -- is one of FF,LF,VT,CR or a wide character sequence whose value is in
+ -- category Separator,Line or Separator,Paragraph. P points just past the
+ -- character that was scanned. The purpose of this routine is to
+ -- distinguish physical and logical line endings. A physical line ending is
+ -- one of:
--
-- CR on its own (MAC System 7)
-- LF on its own (Unix and unix-like systems)
diff --git a/gcc/ada/snames.adb b/gcc/ada/snames.adb
index 7d4cdddc479..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,6 +179,7 @@ package body Snames is
"ada_05#" &
"ada_2005#" &
"assertion_policy#" &
+ "assume_no_invalid_values#" &
"c_pass_by_copy#" &
"check_name#" &
"check_policy#" &
@@ -414,6 +412,7 @@ package body Snames is
"secondary_stack_size#" &
"section#" &
"semaphore#" &
+ "short_descriptor#" &
"simple_barriers#" &
"spec_file_name#" &
"state#" &
@@ -556,6 +555,7 @@ package body Snames is
"copy_sign#" &
"floor#" &
"fraction#" &
+ "from_any#" &
"image#" &
"input#" &
"machine#" &
@@ -566,7 +566,9 @@ package body Snames is
"remainder#" &
"rounding#" &
"succ#" &
+ "to_any#" &
"truncation#" &
+ "typecode#" &
"value#" &
"wide_image#" &
"wide_wide_image#" &
@@ -726,6 +728,7 @@ package body Snames is
"extends#" &
"externally_built#" &
"finder#" &
+ "global_compilation_switches#" &
"global_configuration_pragmas#" &
"global_config_file#" &
"gnatls#" &
@@ -778,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 c2001e68aa4..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,31 +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_Check_Name : constant Name_Id := N + 125; -- GNAT
- Name_Check_Policy : constant Name_Id := N + 126; -- GNAT
- Name_Compile_Time_Error : constant Name_Id := N + 127; -- GNAT
- Name_Compile_Time_Warning : constant Name_Id := N + 128; -- GNAT
- Name_Compiler_Unit : constant Name_Id := N + 129; -- GNAT
- Name_Component_Alignment : constant Name_Id := N + 130; -- GNAT
- Name_Convention_Identifier : constant Name_Id := N + 131; -- GNAT
- Name_Debug_Policy : constant Name_Id := N + 132; -- GNAT
- Name_Detect_Blocking : constant Name_Id := N + 133; -- Ada 05
- Name_Discard_Names : constant Name_Id := N + 134;
- Name_Elaboration_Checks : constant Name_Id := N + 135; -- GNAT
- Name_Eliminate : constant Name_Id := N + 136; -- GNAT
- Name_Extend_System : constant Name_Id := N + 137; -- GNAT
- Name_Extensions_Allowed : constant Name_Id := N + 138; -- GNAT
- Name_External_Name_Casing : constant Name_Id := N + 139; -- 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
@@ -363,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 + 140; -- GNAT
- Name_Float_Representation : constant Name_Id := N + 141; -- GNAT
- Name_Implicit_Packing : constant Name_Id := N + 142; -- GNAT
- Name_Initialize_Scalars : constant Name_Id := N + 143; -- GNAT
- Name_Interrupt_State : constant Name_Id := N + 144; -- GNAT
- Name_License : constant Name_Id := N + 145; -- GNAT
- Name_Locking_Policy : constant Name_Id := N + 146;
- Name_Long_Float : constant Name_Id := N + 147; -- VMS
- Name_No_Run_Time : constant Name_Id := N + 148; -- GNAT
- Name_No_Strict_Aliasing : constant Name_Id := N + 149; -- GNAT
- Name_Normalize_Scalars : constant Name_Id := N + 150;
- Name_Optimize_Alignment : constant Name_Id := N + 151; -- GNAT
- Name_Persistent_BSS : constant Name_Id := N + 152; -- GNAT
- Name_Polling : constant Name_Id := N + 153; -- GNAT
- Name_Priority_Specific_Dispatching : constant Name_Id := N + 154; -- Ada 05
- Name_Profile : constant Name_Id := N + 155; -- Ada 05
- Name_Profile_Warnings : constant Name_Id := N + 156; -- GNAT
- Name_Propagate_Exceptions : constant Name_Id := N + 157; -- GNAT
- Name_Queuing_Policy : constant Name_Id := N + 158;
- Name_Ravenscar : constant Name_Id := N + 159; -- GNAT
- Name_Restricted_Run_Time : constant Name_Id := N + 160; -- GNAT
- Name_Restrictions : constant Name_Id := N + 161;
- Name_Restriction_Warnings : constant Name_Id := N + 162; -- GNAT
- Name_Reviewable : constant Name_Id := N + 163;
- Name_Source_File_Name : constant Name_Id := N + 164; -- GNAT
- Name_Source_File_Name_Project : constant Name_Id := N + 165; -- GNAT
- Name_Style_Checks : constant Name_Id := N + 166; -- GNAT
- Name_Suppress : constant Name_Id := N + 167;
- Name_Suppress_Exception_Locations : constant Name_Id := N + 168; -- GNAT
- Name_Task_Dispatching_Policy : constant Name_Id := N + 169;
- Name_Universal_Data : constant Name_Id := N + 170; -- AAMP
- Name_Unsuppress : constant Name_Id := N + 171; -- GNAT
- Name_Use_VADS_Size : constant Name_Id := N + 172; -- GNAT
- Name_Validity_Checks : constant Name_Id := N + 173; -- GNAT
- Name_Warnings : constant Name_Id := N + 174; -- GNAT
- Name_Wide_Character_Encoding : constant Name_Id := N + 175; -- GNAT
- Last_Configuration_Pragma_Name : constant Name_Id := N + 175;
+ 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 + 176; -- GNAT
- Name_All_Calls_Remote : constant Name_Id := N + 177;
- Name_Annotate : constant Name_Id := N + 178; -- 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
@@ -413,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 + 179; -- Ada 05
- Name_Asynchronous : constant Name_Id := N + 180;
- Name_Atomic : constant Name_Id := N + 181;
- Name_Atomic_Components : constant Name_Id := N + 182;
- Name_Attach_Handler : constant Name_Id := N + 183;
- Name_Check : constant Name_Id := N + 184; -- GNAT
- Name_CIL_Constructor : constant Name_Id := N + 185; -- GNAT
- Name_Comment : constant Name_Id := N + 186; -- GNAT
- Name_Common_Object : constant Name_Id := N + 187; -- GNAT
- Name_Complete_Representation : constant Name_Id := N + 188; -- GNAT
- Name_Complex_Representation : constant Name_Id := N + 189; -- GNAT
- Name_Controlled : constant Name_Id := N + 190;
- Name_Convention : constant Name_Id := N + 191;
- Name_CPP_Class : constant Name_Id := N + 192; -- GNAT
- Name_CPP_Constructor : constant Name_Id := N + 193; -- GNAT
- Name_CPP_Virtual : constant Name_Id := N + 194; -- GNAT
- Name_CPP_Vtable : constant Name_Id := N + 195; -- GNAT
- Name_Debug : constant Name_Id := N + 196; -- GNAT
- Name_Elaborate : constant Name_Id := N + 197; -- Ada 83
- Name_Elaborate_All : constant Name_Id := N + 198;
- Name_Elaborate_Body : constant Name_Id := N + 199;
- Name_Export : constant Name_Id := N + 200;
- Name_Export_Exception : constant Name_Id := N + 201; -- VMS
- Name_Export_Function : constant Name_Id := N + 202; -- GNAT
- Name_Export_Object : constant Name_Id := N + 203; -- GNAT
- Name_Export_Procedure : constant Name_Id := N + 204; -- GNAT
- Name_Export_Value : constant Name_Id := N + 205; -- GNAT
- Name_Export_Valued_Procedure : constant Name_Id := N + 206; -- GNAT
- Name_External : constant Name_Id := N + 207; -- GNAT
- Name_Finalize_Storage_Only : constant Name_Id := N + 208; -- GNAT
- Name_Ident : constant Name_Id := N + 209; -- VMS
- Name_Implemented_By_Entry : constant Name_Id := N + 210; -- Ada 05
- Name_Import : constant Name_Id := N + 211;
- Name_Import_Exception : constant Name_Id := N + 212; -- VMS
- Name_Import_Function : constant Name_Id := N + 213; -- GNAT
- Name_Import_Object : constant Name_Id := N + 214; -- GNAT
- Name_Import_Procedure : constant Name_Id := N + 215; -- GNAT
- Name_Import_Valued_Procedure : constant Name_Id := N + 216; -- GNAT
- Name_Inline : constant Name_Id := N + 217;
- Name_Inline_Always : constant Name_Id := N + 218; -- GNAT
- Name_Inline_Generic : constant Name_Id := N + 219; -- GNAT
- Name_Inspection_Point : constant Name_Id := N + 220;
- Name_Interface_Name : constant Name_Id := N + 221; -- GNAT
- Name_Interrupt_Handler : constant Name_Id := N + 222;
- Name_Interrupt_Priority : constant Name_Id := N + 223;
- Name_Java_Constructor : constant Name_Id := N + 224; -- GNAT
- Name_Java_Interface : constant Name_Id := N + 225; -- GNAT
- Name_Keep_Names : constant Name_Id := N + 226; -- GNAT
- Name_Link_With : constant Name_Id := N + 227; -- GNAT
- Name_Linker_Alias : constant Name_Id := N + 228; -- GNAT
- Name_Linker_Constructor : constant Name_Id := N + 229; -- GNAT
- Name_Linker_Destructor : constant Name_Id := N + 230; -- GNAT
- Name_Linker_Options : constant Name_Id := N + 231;
- Name_Linker_Section : constant Name_Id := N + 232; -- GNAT
- Name_List : constant Name_Id := N + 233;
- Name_Machine_Attribute : constant Name_Id := N + 234; -- GNAT
- Name_Main : constant Name_Id := N + 235; -- GNAT
- Name_Main_Storage : constant Name_Id := N + 236; -- GNAT
- Name_Memory_Size : constant Name_Id := N + 237; -- Ada 83
- Name_No_Body : constant Name_Id := N + 238; -- GNAT
- Name_No_Return : constant Name_Id := N + 239; -- GNAT
- Name_Obsolescent : constant Name_Id := N + 240; -- GNAT
- Name_Optimize : constant Name_Id := N + 241;
- Name_Pack : constant Name_Id := N + 242;
- Name_Page : constant Name_Id := N + 243;
- Name_Passive : constant Name_Id := N + 244; -- GNAT
- Name_Postcondition : constant Name_Id := N + 245; -- GNAT
- Name_Precondition : constant Name_Id := N + 246; -- GNAT
- Name_Preelaborable_Initialization : constant Name_Id := N + 247; -- Ada 05
- Name_Preelaborate : constant Name_Id := N + 248;
- Name_Preelaborate_05 : constant Name_Id := N + 249; -- 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
@@ -491,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 + 250; -- VMS
- Name_Pure : constant Name_Id := N + 251;
- Name_Pure_05 : constant Name_Id := N + 252; -- GNAT
- Name_Pure_Function : constant Name_Id := N + 253; -- GNAT
- Name_Relative_Deadline : constant Name_Id := N + 254; -- Ada 05
- Name_Remote_Call_Interface : constant Name_Id := N + 255;
- Name_Remote_Types : constant Name_Id := N + 256;
- Name_Share_Generic : constant Name_Id := N + 257; -- GNAT
- Name_Shared : constant Name_Id := N + 258; -- Ada 83
- Name_Shared_Passive : constant Name_Id := N + 259;
+ 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,
@@ -511,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 + 260; -- GNAT
- Name_Static_Elaboration_Desired : constant Name_Id := N + 261; -- GNAT
- Name_Stream_Convert : constant Name_Id := N + 262; -- GNAT
- Name_Subtitle : constant Name_Id := N + 263; -- GNAT
- Name_Suppress_All : constant Name_Id := N + 264; -- GNAT
- Name_Suppress_Debug_Info : constant Name_Id := N + 265; -- GNAT
- Name_Suppress_Initialization : constant Name_Id := N + 266; -- GNAT
- Name_System_Name : constant Name_Id := N + 267; -- Ada 83
- Name_Task_Info : constant Name_Id := N + 268; -- GNAT
- Name_Task_Name : constant Name_Id := N + 269; -- GNAT
- Name_Task_Storage : constant Name_Id := N + 270; -- VMS
- Name_Time_Slice : constant Name_Id := N + 271; -- GNAT
- Name_Title : constant Name_Id := N + 272; -- GNAT
- Name_Unchecked_Union : constant Name_Id := N + 273; -- GNAT
- Name_Unimplemented_Unit : constant Name_Id := N + 274; -- GNAT
- Name_Universal_Aliasing : constant Name_Id := N + 275; -- GNAT
- Name_Unmodified : constant Name_Id := N + 276; -- GNAT
- Name_Unreferenced : constant Name_Id := N + 277; -- GNAT
- Name_Unreferenced_Objects : constant Name_Id := N + 278; -- GNAT
- Name_Unreserve_All_Interrupts : constant Name_Id := N + 279; -- GNAT
- Name_Volatile : constant Name_Id := N + 280;
- Name_Volatile_Components : constant Name_Id := N + 281;
- Name_Weak_External : constant Name_Id := N + 282; -- GNAT
- Last_Pragma_Name : constant Name_Id := N + 282;
+ 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
@@ -545,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 + 283;
- Name_Ada : constant Name_Id := N + 283;
- Name_Assembler : constant Name_Id := N + 284;
- Name_CIL : constant Name_Id := N + 285;
- Name_COBOL : constant Name_Id := N + 286;
- Name_CPP : constant Name_Id := N + 287;
- Name_Fortran : constant Name_Id := N + 288;
- Name_Intrinsic : constant Name_Id := N + 289;
- Name_Java : constant Name_Id := N + 290;
- Name_Stdcall : constant Name_Id := N + 291;
- Name_Stubbed : constant Name_Id := N + 292;
- Last_Convention_Name : constant Name_Id := N + 292;
+ 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 + 293;
- Name_Assembly : constant Name_Id := N + 294;
+ 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 + 295;
+ 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 + 296;
+ Name_C_Plus_Plus : constant Name_Id := N + 294;
-- The following names are present as synonyms for Stdcall
- Name_DLL : constant Name_Id := N + 297;
- Name_Win32 : constant Name_Id := N + 298;
+ 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 + 299;
- Name_Assertion : constant Name_Id := N + 300;
- Name_Attribute_Name : constant Name_Id := N + 301;
- Name_Body_File_Name : constant Name_Id := N + 302;
- Name_Boolean_Entry_Barriers : constant Name_Id := N + 303;
- Name_Casing : constant Name_Id := N + 304;
- Name_Code : constant Name_Id := N + 305;
- Name_Component : constant Name_Id := N + 306;
- Name_Component_Size_4 : constant Name_Id := N + 307;
- Name_Copy : constant Name_Id := N + 308;
- Name_D_Float : constant Name_Id := N + 309;
- Name_Descriptor : constant Name_Id := N + 310;
- Name_Dot_Replacement : constant Name_Id := N + 311;
- Name_Dynamic : constant Name_Id := N + 312;
- Name_Entity : constant Name_Id := N + 313;
- Name_Entry_Count : constant Name_Id := N + 314;
- Name_External_Name : constant Name_Id := N + 315;
- Name_First_Optional_Parameter : constant Name_Id := N + 316;
- Name_Form : constant Name_Id := N + 317;
- Name_G_Float : constant Name_Id := N + 318;
- Name_Gcc : constant Name_Id := N + 319;
- Name_Gnat : constant Name_Id := N + 320;
- Name_GPL : constant Name_Id := N + 321;
- Name_IEEE_Float : constant Name_Id := N + 322;
- Name_Ignore : constant Name_Id := N + 323;
- Name_Info : constant Name_Id := N + 324;
- Name_Internal : constant Name_Id := N + 325;
- Name_Link_Name : constant Name_Id := N + 326;
- Name_Lowercase : constant Name_Id := N + 327;
- Name_Max_Entry_Queue_Depth : constant Name_Id := N + 328;
- Name_Max_Entry_Queue_Length : constant Name_Id := N + 329;
- Name_Max_Size : constant Name_Id := N + 330;
- Name_Mechanism : constant Name_Id := N + 331;
- Name_Message : constant Name_Id := N + 332;
- Name_Mixedcase : constant Name_Id := N + 333;
- Name_Modified_GPL : constant Name_Id := N + 334;
- Name_Name : constant Name_Id := N + 335;
- Name_NCA : constant Name_Id := N + 336;
- Name_No : constant Name_Id := N + 337;
- Name_No_Dependence : constant Name_Id := N + 338;
- Name_No_Dynamic_Attachment : constant Name_Id := N + 339;
- Name_No_Dynamic_Interrupts : constant Name_Id := N + 340;
- Name_No_Requeue : constant Name_Id := N + 341;
- Name_No_Requeue_Statements : constant Name_Id := N + 342;
- Name_No_Task_Attributes : constant Name_Id := N + 343;
- Name_No_Task_Attributes_Package : constant Name_Id := N + 344;
- Name_On : constant Name_Id := N + 345;
- Name_Parameter_Types : constant Name_Id := N + 346;
- Name_Reference : constant Name_Id := N + 347;
- Name_Restricted : constant Name_Id := N + 348;
- Name_Result_Mechanism : constant Name_Id := N + 349;
- Name_Result_Type : constant Name_Id := N + 350;
- Name_Runtime : constant Name_Id := N + 351;
- Name_SB : constant Name_Id := N + 352;
- Name_Secondary_Stack_Size : constant Name_Id := N + 353;
- Name_Section : constant Name_Id := N + 354;
- Name_Semaphore : constant Name_Id := N + 355;
- Name_Simple_Barriers : constant Name_Id := N + 356;
- Name_Spec_File_Name : constant Name_Id := N + 357;
- Name_State : constant Name_Id := N + 358;
- Name_Static : constant Name_Id := N + 359;
- Name_Stack_Size : constant Name_Id := N + 360;
- Name_Subunit_File_Name : constant Name_Id := N + 361;
- Name_Task_Stack_Size_Default : constant Name_Id := N + 362;
- Name_Task_Type : constant Name_Id := N + 363;
- Name_Time_Slicing_Enabled : constant Name_Id := N + 364;
- Name_Top_Guard : constant Name_Id := N + 365;
- Name_UBA : constant Name_Id := N + 366;
- Name_UBS : constant Name_Id := N + 367;
- Name_UBSB : constant Name_Id := N + 368;
- Name_Unit_Name : constant Name_Id := N + 369;
- Name_Unknown : constant Name_Id := N + 370;
- Name_Unrestricted : constant Name_Id := N + 371;
- Name_Uppercase : constant Name_Id := N + 372;
- Name_User : constant Name_Id := N + 373;
- Name_VAX_Float : constant Name_Id := N + 374;
- Name_VMS : constant Name_Id := N + 375;
- Name_Vtable_Ptr : constant Name_Id := N + 376;
- Name_Working_Storage : constant Name_Id := N + 377;
+ 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
@@ -671,133 +673,134 @@ 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 + 378;
- Name_Abort_Signal : constant Name_Id := N + 378; -- GNAT
- Name_Access : constant Name_Id := N + 379;
- Name_Address : constant Name_Id := N + 380;
- Name_Address_Size : constant Name_Id := N + 381; -- GNAT
- Name_Aft : constant Name_Id := N + 382;
- Name_Alignment : constant Name_Id := N + 383;
- Name_Asm_Input : constant Name_Id := N + 384; -- GNAT
- Name_Asm_Output : constant Name_Id := N + 385; -- GNAT
- Name_AST_Entry : constant Name_Id := N + 386; -- VMS
- Name_Bit : constant Name_Id := N + 387; -- GNAT
- Name_Bit_Order : constant Name_Id := N + 388;
- Name_Bit_Position : constant Name_Id := N + 389; -- GNAT
- Name_Body_Version : constant Name_Id := N + 390;
- Name_Callable : constant Name_Id := N + 391;
- Name_Caller : constant Name_Id := N + 392;
- Name_Code_Address : constant Name_Id := N + 393; -- GNAT
- Name_Component_Size : constant Name_Id := N + 394;
- Name_Compose : constant Name_Id := N + 395;
- Name_Constrained : constant Name_Id := N + 396;
- Name_Count : constant Name_Id := N + 397;
- Name_Default_Bit_Order : constant Name_Id := N + 398; -- GNAT
- Name_Definite : constant Name_Id := N + 399;
- Name_Delta : constant Name_Id := N + 400;
- Name_Denorm : constant Name_Id := N + 401;
- Name_Digits : constant Name_Id := N + 402;
- Name_Elaborated : constant Name_Id := N + 403; -- GNAT
- Name_Emax : constant Name_Id := N + 404; -- Ada 83
- Name_Enabled : constant Name_Id := N + 405; -- GNAT
- Name_Enum_Rep : constant Name_Id := N + 406; -- GNAT
- Name_Enum_Val : constant Name_Id := N + 407; -- GNAT
- Name_Epsilon : constant Name_Id := N + 408; -- Ada 83
- Name_Exponent : constant Name_Id := N + 409;
- Name_External_Tag : constant Name_Id := N + 410;
- Name_Fast_Math : constant Name_Id := N + 411; -- GNAT
- Name_First : constant Name_Id := N + 412;
- Name_First_Bit : constant Name_Id := N + 413;
- Name_Fixed_Value : constant Name_Id := N + 414; -- GNAT
- Name_Fore : constant Name_Id := N + 415;
- Name_Has_Access_Values : constant Name_Id := N + 416; -- GNAT
- Name_Has_Discriminants : constant Name_Id := N + 417; -- GNAT
- Name_Has_Tagged_Values : constant Name_Id := N + 418; -- GNAT
- Name_Identity : constant Name_Id := N + 419;
- Name_Img : constant Name_Id := N + 420; -- GNAT
- Name_Integer_Value : constant Name_Id := N + 421; -- GNAT
- Name_Invalid_Value : constant Name_Id := N + 422; -- GNAT
- Name_Large : constant Name_Id := N + 423; -- Ada 83
- Name_Last : constant Name_Id := N + 424;
- Name_Last_Bit : constant Name_Id := N + 425;
- Name_Leading_Part : constant Name_Id := N + 426;
- Name_Length : constant Name_Id := N + 427;
- Name_Machine_Emax : constant Name_Id := N + 428;
- Name_Machine_Emin : constant Name_Id := N + 429;
- Name_Machine_Mantissa : constant Name_Id := N + 430;
- Name_Machine_Overflows : constant Name_Id := N + 431;
- Name_Machine_Radix : constant Name_Id := N + 432;
- Name_Machine_Rounding : constant Name_Id := N + 433; -- Ada 05
- Name_Machine_Rounds : constant Name_Id := N + 434;
- Name_Machine_Size : constant Name_Id := N + 435; -- GNAT
- Name_Mantissa : constant Name_Id := N + 436; -- Ada 83
- Name_Max_Size_In_Storage_Elements : constant Name_Id := N + 437;
- Name_Maximum_Alignment : constant Name_Id := N + 438; -- GNAT
- Name_Mechanism_Code : constant Name_Id := N + 439; -- GNAT
- Name_Mod : constant Name_Id := N + 440; -- Ada 05
- Name_Model_Emin : constant Name_Id := N + 441;
- Name_Model_Epsilon : constant Name_Id := N + 442;
- Name_Model_Mantissa : constant Name_Id := N + 443;
- Name_Model_Small : constant Name_Id := N + 444;
- Name_Modulus : constant Name_Id := N + 445;
- Name_Null_Parameter : constant Name_Id := N + 446; -- GNAT
- Name_Object_Size : constant Name_Id := N + 447; -- GNAT
- Name_Old : constant Name_Id := N + 448; -- GNAT
- Name_Partition_ID : constant Name_Id := N + 449;
- Name_Passed_By_Reference : constant Name_Id := N + 450; -- GNAT
- Name_Pool_Address : constant Name_Id := N + 451;
- Name_Pos : constant Name_Id := N + 452;
- Name_Position : constant Name_Id := N + 453;
- Name_Priority : constant Name_Id := N + 454; -- Ada 05
- Name_Range : constant Name_Id := N + 455;
- Name_Range_Length : constant Name_Id := N + 456; -- GNAT
- Name_Result : constant Name_Id := N + 457; -- GNAT
- Name_Round : constant Name_Id := N + 458;
- Name_Safe_Emax : constant Name_Id := N + 459; -- Ada 83
- Name_Safe_First : constant Name_Id := N + 460;
- Name_Safe_Large : constant Name_Id := N + 461; -- Ada 83
- Name_Safe_Last : constant Name_Id := N + 462;
- Name_Safe_Small : constant Name_Id := N + 463; -- Ada 83
- Name_Scale : constant Name_Id := N + 464;
- Name_Scaling : constant Name_Id := N + 465;
- Name_Signed_Zeros : constant Name_Id := N + 466;
- Name_Size : constant Name_Id := N + 467;
- Name_Small : constant Name_Id := N + 468;
- Name_Storage_Size : constant Name_Id := N + 469;
- Name_Storage_Unit : constant Name_Id := N + 470; -- GNAT
- Name_Stream_Size : constant Name_Id := N + 471; -- Ada 05
- Name_Tag : constant Name_Id := N + 472;
- Name_Target_Name : constant Name_Id := N + 473; -- GNAT
- Name_Terminated : constant Name_Id := N + 474;
- Name_To_Address : constant Name_Id := N + 475; -- GNAT
- Name_Type_Class : constant Name_Id := N + 476; -- GNAT
- Name_UET_Address : constant Name_Id := N + 477; -- GNAT
- Name_Unbiased_Rounding : constant Name_Id := N + 478;
- Name_Unchecked_Access : constant Name_Id := N + 479;
- Name_Unconstrained_Array : constant Name_Id := N + 480;
- Name_Universal_Literal_String : constant Name_Id := N + 481; -- GNAT
- Name_Unrestricted_Access : constant Name_Id := N + 482; -- GNAT
- Name_VADS_Size : constant Name_Id := N + 483; -- GNAT
- Name_Val : constant Name_Id := N + 484;
- Name_Valid : constant Name_Id := N + 485;
- Name_Value_Size : constant Name_Id := N + 486; -- GNAT
- Name_Version : constant Name_Id := N + 487;
- Name_Wchar_T_Size : constant Name_Id := N + 488; -- GNAT
- Name_Wide_Wide_Width : constant Name_Id := N + 489; -- Ada 05
- Name_Wide_Width : constant Name_Id := N + 490;
- Name_Width : constant Name_Id := N + 491;
- Name_Word_Size : constant Name_Id := N + 492; -- 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 + 493;
- Name_Adjacent : constant Name_Id := N + 493;
- Name_Ceiling : constant Name_Id := N + 494;
- Name_Copy_Sign : constant Name_Id := N + 495;
- Name_Floor : constant Name_Id := N + 496;
- Name_Fraction : constant Name_Id := N + 497;
+ 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;
@@ -808,38 +811,40 @@ package Snames is
Name_Remainder : constant Name_Id := N + 505;
Name_Rounding : constant Name_Id := N + 506;
Name_Succ : constant Name_Id := N + 507;
- Name_Truncation : constant Name_Id := N + 508;
- Name_Value : constant Name_Id := N + 509;
- Name_Wide_Image : constant Name_Id := N + 510;
- Name_Wide_Wide_Image : constant Name_Id := N + 511;
- Name_Wide_Value : constant Name_Id := N + 512;
- Name_Wide_Wide_Value : constant Name_Id := N + 513;
- Last_Renamable_Function_Attribute : constant Name_Id := N + 513;
+ Name_To_Any : constant Name_Id := N + 508; -- GNAT
+ Name_Truncation : constant Name_Id := N + 509;
+ 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 + 514;
- Name_Output : constant Name_Id := N + 514;
- Name_Read : constant Name_Id := N + 515;
- Name_Write : constant Name_Id := N + 516;
- Last_Procedure_Attribute : constant Name_Id := N + 516;
+ 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 + 517;
- Name_Elab_Body : constant Name_Id := N + 517; -- GNAT
- Name_Elab_Spec : constant Name_Id := N + 518; -- GNAT
- Name_Storage_Pool : constant Name_Id := N + 519;
+ 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 + 520;
- Name_Base : constant Name_Id := N + 520;
- Name_Class : constant Name_Id := N + 521;
- Name_Stub_Type : constant Name_Id := N + 522;
- Last_Type_Attribute_Name : constant Name_Id := N + 522;
- Last_Entity_Attribute_Name : constant Name_Id := N + 522;
- Last_Attribute_Name : constant Name_Id := N + 522;
+ 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
@@ -847,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 + 523;
- Name_Ceiling_Locking : constant Name_Id := N + 523;
- Name_Inheritance_Locking : constant Name_Id := N + 524;
- Last_Locking_Policy_Name : constant Name_Id := N + 524;
+ 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
@@ -858,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 + 525;
- Name_FIFO_Queuing : constant Name_Id := N + 525;
- Name_Priority_Queuing : constant Name_Id := N + 526;
- Last_Queuing_Policy_Name : constant Name_Id := N + 526;
+ 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
@@ -869,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 + 527;
- Name_EDF_Across_Priorities : constant Name_Id := N + 527;
- Name_FIFO_Within_Priorities : constant Name_Id := N + 528;
- Name_Non_Preemptive_Within_Priorities : constant Name_Id := N + 529;
- Name_Round_Robin_Within_Priorities : constant Name_Id := N + 530;
- Last_Task_Dispatching_Policy_Name : constant Name_Id := N + 530;
+ 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 + 531;
- Name_Access_Check : constant Name_Id := N + 531;
- Name_Accessibility_Check : constant Name_Id := N + 532;
- Name_Alignment_Check : constant Name_Id := N + 533; -- GNAT
- Name_Discriminant_Check : constant Name_Id := N + 534;
- Name_Division_Check : constant Name_Id := N + 535;
- Name_Elaboration_Check : constant Name_Id := N + 536;
- Name_Index_Check : constant Name_Id := N + 537;
- Name_Length_Check : constant Name_Id := N + 538;
- Name_Overflow_Check : constant Name_Id := N + 539;
- Name_Range_Check : constant Name_Id := N + 540;
- Name_Storage_Check : constant Name_Id := N + 541;
- Name_Tag_Check : constant Name_Id := N + 542;
- Name_Validity_Check : constant Name_Id := N + 543; -- GNAT
- Name_All_Checks : constant Name_Id := N + 544;
- Last_Check_Name : constant Name_Id := N + 544;
+ 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 + 545;
- Name_Abs : constant Name_Id := N + 546;
- Name_Accept : constant Name_Id := N + 547;
- Name_And : constant Name_Id := N + 548;
- Name_All : constant Name_Id := N + 549;
- Name_Array : constant Name_Id := N + 550;
- Name_At : constant Name_Id := N + 551;
- Name_Begin : constant Name_Id := N + 552;
- Name_Body : constant Name_Id := N + 553;
- Name_Case : constant Name_Id := N + 554;
- Name_Constant : constant Name_Id := N + 555;
- Name_Declare : constant Name_Id := N + 556;
- Name_Delay : constant Name_Id := N + 557;
- Name_Do : constant Name_Id := N + 558;
- Name_Else : constant Name_Id := N + 559;
- Name_Elsif : constant Name_Id := N + 560;
- Name_End : constant Name_Id := N + 561;
- Name_Entry : constant Name_Id := N + 562;
- Name_Exception : constant Name_Id := N + 563;
- Name_Exit : constant Name_Id := N + 564;
- Name_For : constant Name_Id := N + 565;
- Name_Function : constant Name_Id := N + 566;
- Name_Generic : constant Name_Id := N + 567;
- Name_Goto : constant Name_Id := N + 568;
- Name_If : constant Name_Id := N + 569;
- Name_In : constant Name_Id := N + 570;
- Name_Is : constant Name_Id := N + 571;
- Name_Limited : constant Name_Id := N + 572;
- Name_Loop : constant Name_Id := N + 573;
- Name_New : constant Name_Id := N + 574;
- Name_Not : constant Name_Id := N + 575;
- Name_Null : constant Name_Id := N + 576;
- Name_Of : constant Name_Id := N + 577;
- Name_Or : constant Name_Id := N + 578;
- Name_Others : constant Name_Id := N + 579;
- Name_Out : constant Name_Id := N + 580;
- Name_Package : constant Name_Id := N + 581;
- Name_Pragma : constant Name_Id := N + 582;
- Name_Private : constant Name_Id := N + 583;
- Name_Procedure : constant Name_Id := N + 584;
- Name_Raise : constant Name_Id := N + 585;
- Name_Record : constant Name_Id := N + 586;
- Name_Rem : constant Name_Id := N + 587;
- Name_Renames : constant Name_Id := N + 588;
- Name_Return : constant Name_Id := N + 589;
- Name_Reverse : constant Name_Id := N + 590;
- Name_Select : constant Name_Id := N + 591;
- Name_Separate : constant Name_Id := N + 592;
- Name_Subtype : constant Name_Id := N + 593;
- Name_Task : constant Name_Id := N + 594;
- Name_Terminate : constant Name_Id := N + 595;
- Name_Then : constant Name_Id := N + 596;
- Name_Type : constant Name_Id := N + 597;
- Name_Use : constant Name_Id := N + 598;
- Name_When : constant Name_Id := N + 599;
- Name_While : constant Name_Id := N + 600;
- Name_With : constant Name_Id := N + 601;
- Name_Xor : constant Name_Id := N + 602;
+ 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 + 603;
- Name_Divide : constant Name_Id := N + 603;
- Name_Enclosing_Entity : constant Name_Id := N + 604;
- Name_Exception_Information : constant Name_Id := N + 605;
- Name_Exception_Message : constant Name_Id := N + 606;
- Name_Exception_Name : constant Name_Id := N + 607;
- Name_File : constant Name_Id := N + 608;
- Name_Generic_Dispatching_Constructor : constant Name_Id := N + 609;
- Name_Import_Address : constant Name_Id := N + 610;
- Name_Import_Largest_Value : constant Name_Id := N + 611;
- Name_Import_Value : constant Name_Id := N + 612;
- Name_Is_Negative : constant Name_Id := N + 613;
- Name_Line : constant Name_Id := N + 614;
- Name_Rotate_Left : constant Name_Id := N + 615;
- Name_Rotate_Right : constant Name_Id := N + 616;
- Name_Shift_Left : constant Name_Id := N + 617;
- Name_Shift_Right : constant Name_Id := N + 618;
- Name_Shift_Right_Arithmetic : constant Name_Id := N + 619;
- Name_Source_Location : constant Name_Id := N + 620;
- Name_Unchecked_Conversion : constant Name_Id := N + 621;
- Name_Unchecked_Deallocation : constant Name_Id := N + 622;
- Name_To_Pointer : constant Name_Id := N + 623;
- Last_Intrinsic_Name : constant Name_Id := N + 623;
+ 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 + 624;
+ Name_Free : constant Name_Id := N + 626;
-- Reserved words used only in Ada 95
- First_95_Reserved_Word : constant Name_Id := N + 625;
- Name_Abstract : constant Name_Id := N + 625;
- Name_Aliased : constant Name_Id := N + 626;
- Name_Protected : constant Name_Id := N + 627;
- Name_Until : constant Name_Id := N + 628;
- Name_Requeue : constant Name_Id := N + 629;
- Name_Tagged : constant Name_Id := N + 630;
- Last_95_Reserved_Word : constant Name_Id := N + 630;
+ 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 + 631;
+ 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 + 632;
- Name_Aggregate : constant Name_Id := N + 633;
- Name_Archive_Builder : constant Name_Id := N + 634;
- Name_Archive_Builder_Append_Option : constant Name_Id := N + 635;
- Name_Archive_Indexer : constant Name_Id := N + 636;
- Name_Archive_Suffix : constant Name_Id := N + 637;
- Name_Binder : constant Name_Id := N + 638;
- Name_Binder_Prefix : constant Name_Id := N + 639;
- Name_Body_Suffix : constant Name_Id := N + 640;
- Name_Builder : constant Name_Id := N + 641;
- Name_Builder_Switches : constant Name_Id := N + 642;
- Name_Compiler : constant Name_Id := N + 643;
- Name_Compiler_Kind : constant Name_Id := N + 644;
- Name_Config_Body_File_Name : constant Name_Id := N + 645;
- Name_Config_Body_File_Name_Pattern : constant Name_Id := N + 646;
- Name_Config_File_Switches : constant Name_Id := N + 647;
- Name_Config_File_Unique : constant Name_Id := N + 648;
- Name_Config_Spec_File_Name : constant Name_Id := N + 649;
- Name_Config_Spec_File_Name_Pattern : constant Name_Id := N + 650;
- Name_Configuration : constant Name_Id := N + 651;
- Name_Cross_Reference : constant Name_Id := N + 652;
- Name_Default_Language : constant Name_Id := N + 653;
- Name_Default_Switches : constant Name_Id := N + 654;
- Name_Dependency_Driver : constant Name_Id := N + 655;
- Name_Dependency_File_Kind : constant Name_Id := N + 656;
- Name_Dependency_Switches : constant Name_Id := N + 657;
- Name_Driver : constant Name_Id := N + 658;
- Name_Excluded_Source_Dirs : constant Name_Id := N + 659;
- Name_Excluded_Source_Files : constant Name_Id := N + 660;
- Name_Excluded_Source_List_File : constant Name_Id := N + 661;
- Name_Exec_Dir : constant Name_Id := N + 662;
- Name_Executable : constant Name_Id := N + 663;
- Name_Executable_Suffix : constant Name_Id := N + 664;
- Name_Extends : constant Name_Id := N + 665;
- Name_Externally_Built : constant Name_Id := N + 666;
- Name_Finder : constant Name_Id := N + 667;
- Name_Global_Configuration_Pragmas : constant Name_Id := N + 668;
- Name_Global_Config_File : constant Name_Id := N + 669;
- Name_Gnatls : constant Name_Id := N + 670;
- Name_Gnatstub : constant Name_Id := N + 671;
- Name_Implementation : constant Name_Id := N + 672;
- Name_Implementation_Exceptions : constant Name_Id := N + 673;
- Name_Implementation_Suffix : constant Name_Id := N + 674;
- Name_Include_Switches : constant Name_Id := N + 675;
- Name_Include_Path : constant Name_Id := N + 676;
- Name_Include_Path_File : constant Name_Id := N + 677;
- Name_Inherit_Source_Path : constant Name_Id := N + 678;
- Name_Language_Kind : constant Name_Id := N + 679;
- Name_Language_Processing : constant Name_Id := N + 680;
- Name_Languages : constant Name_Id := N + 681;
- Name_Library : constant Name_Id := N + 682;
- Name_Library_Ali_Dir : constant Name_Id := N + 683;
- Name_Library_Auto_Init : constant Name_Id := N + 684;
- Name_Library_Auto_Init_Supported : constant Name_Id := N + 685;
- Name_Library_Builder : constant Name_Id := N + 686;
- Name_Library_Dir : constant Name_Id := N + 687;
- Name_Library_GCC : constant Name_Id := N + 688;
- Name_Library_Interface : constant Name_Id := N + 689;
- Name_Library_Kind : constant Name_Id := N + 690;
- Name_Library_Name : constant Name_Id := N + 691;
- Name_Library_Major_Minor_Id_Supported : constant Name_Id := N + 692;
- Name_Library_Options : constant Name_Id := N + 693;
- Name_Library_Partial_Linker : constant Name_Id := N + 694;
- Name_Library_Reference_Symbol_File : constant Name_Id := N + 695;
- Name_Library_Src_Dir : constant Name_Id := N + 696;
- Name_Library_Support : constant Name_Id := N + 697;
- Name_Library_Symbol_File : constant Name_Id := N + 698;
- Name_Library_Symbol_Policy : constant Name_Id := N + 699;
- Name_Library_Version : constant Name_Id := N + 700;
- Name_Library_Version_Switches : constant Name_Id := N + 701;
- Name_Linker : constant Name_Id := N + 702;
- Name_Linker_Executable_Option : constant Name_Id := N + 703;
- Name_Linker_Lib_Dir_Option : constant Name_Id := N + 704;
- Name_Linker_Lib_Name_Option : constant Name_Id := N + 705;
- Name_Local_Config_File : constant Name_Id := N + 706;
- Name_Local_Configuration_Pragmas : constant Name_Id := N + 707;
- Name_Locally_Removed_Files : constant Name_Id := N + 708;
- Name_Map_File_Option : constant Name_Id := N + 709;
- Name_Mapping_File_Switches : constant Name_Id := N + 710;
- Name_Mapping_Spec_Suffix : constant Name_Id := N + 711;
- Name_Mapping_Body_Suffix : constant Name_Id := N + 712;
- Name_Metrics : constant Name_Id := N + 713;
- Name_Naming : constant Name_Id := N + 714;
- Name_Object_Generated : constant Name_Id := N + 715;
- Name_Objects_Linked : constant Name_Id := N + 716;
- Name_Objects_Path : constant Name_Id := N + 717;
- Name_Objects_Path_File : constant Name_Id := N + 718;
- Name_Object_Dir : constant Name_Id := N + 719;
- Name_Pic_Option : constant Name_Id := N + 720;
- Name_Pretty_Printer : constant Name_Id := N + 721;
- Name_Prefix : constant Name_Id := N + 722;
- Name_Project : constant Name_Id := N + 723;
- Name_Roots : constant Name_Id := N + 724;
- Name_Required_Switches : constant Name_Id := N + 725;
- Name_Run_Path_Option : constant Name_Id := N + 726;
- Name_Runtime_Project : constant Name_Id := N + 727;
- Name_Shared_Library_Minimum_Switches : constant Name_Id := N + 728;
- Name_Shared_Library_Prefix : constant Name_Id := N + 729;
- Name_Shared_Library_Suffix : constant Name_Id := N + 730;
- Name_Separate_Suffix : constant Name_Id := N + 731;
- Name_Source_Dirs : constant Name_Id := N + 732;
- Name_Source_Files : constant Name_Id := N + 733;
- Name_Source_List_File : constant Name_Id := N + 734;
- Name_Spec : constant Name_Id := N + 735;
- Name_Spec_Suffix : constant Name_Id := N + 736;
- Name_Specification : constant Name_Id := N + 737;
- Name_Specification_Exceptions : constant Name_Id := N + 738;
- Name_Specification_Suffix : constant Name_Id := N + 739;
- Name_Stack : constant Name_Id := N + 740;
- Name_Switches : constant Name_Id := N + 741;
- Name_Symbolic_Link_Supported : constant Name_Id := N + 742;
- Name_Sync : constant Name_Id := N + 743;
- Name_Synchronize : constant Name_Id := N + 744;
- Name_Toolchain_Description : constant Name_Id := N + 745;
- Name_Toolchain_Version : constant Name_Id := N + 746;
- Name_Runtime_Library_Dir : constant Name_Id := N + 747;
+ 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 + 748;
+ Name_Unaligned_Valid : constant Name_Id := N + 752;
-- Ada 2005 reserved words
- First_2005_Reserved_Word : constant Name_Id := N + 749;
- Name_Interface : constant Name_Id := N + 749;
- Name_Overriding : constant Name_Id := N + 750;
- Name_Synchronized : constant Name_Id := N + 751;
- Last_2005_Reserved_Word : constant Name_Id := N + 751;
+ 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 + 751;
+ Last_Predefined_Name : constant Name_Id := N + 755;
---------------------------------------
-- Subtypes Defining Name Categories --
@@ -1285,6 +1292,7 @@ package Snames is
Attribute_Copy_Sign,
Attribute_Floor,
Attribute_Fraction,
+ Attribute_From_Any,
Attribute_Image,
Attribute_Input,
Attribute_Machine,
@@ -1295,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,
@@ -1385,6 +1395,7 @@ package Snames is
Pragma_Ada_05,
Pragma_Ada_2005,
Pragma_Assertion_Policy,
+ Pragma_Assume_No_Invalid_Values,
Pragma_C_Pass_By_Copy,
Pragma_Check_Name,
Pragma_Check_Policy,
diff --git a/gcc/ada/snames.h b/gcc/ada/snames.h
index 80ed0392a30..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,170 +229,171 @@ 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_Check_Name 6
-#define Pragma_Check_Policy 7
-#define Pragma_Compile_Time_Error 8
-#define Pragma_Compile_Time_Warning 9
-#define Pragma_Compiler_Unit 10
-#define Pragma_Component_Alignment 11
-#define Pragma_Convention_Identifier 12
-#define Pragma_Debug_Policy 13
-#define Pragma_Detect_Blocking 14
-#define Pragma_Discard_Names 15
-#define Pragma_Elaboration_Checks 16
-#define Pragma_Eliminate 17
-#define Pragma_Extend_System 18
-#define Pragma_Extensions_Allowed 19
-#define Pragma_External_Name_Casing 20
-#define Pragma_Favor_Top_Level 21
-#define Pragma_Float_Representation 22
-#define Pragma_Implicit_Packing 23
-#define Pragma_Initialize_Scalars 24
-#define Pragma_Interrupt_State 25
-#define Pragma_License 26
-#define Pragma_Locking_Policy 27
-#define Pragma_Long_Float 28
-#define Pragma_No_Run_Time 29
-#define Pragma_No_Strict_Aliasing 30
-#define Pragma_Normalize_Scalars 31
-#define Pragma_Optimize_Alignment 32
-#define Pragma_Polling 33
+#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
+#define Pragma_Compile_Time_Warning 10
+#define Pragma_Compiler_Unit 11
+#define Pragma_Component_Alignment 12
+#define Pragma_Convention_Identifier 13
+#define Pragma_Debug_Policy 14
+#define Pragma_Detect_Blocking 15
+#define Pragma_Discard_Names 16
+#define Pragma_Elaboration_Checks 17
+#define Pragma_Eliminate 18
+#define Pragma_Extend_System 19
+#define Pragma_Extensions_Allowed 20
+#define Pragma_External_Name_Casing 21
+#define Pragma_Favor_Top_Level 22
+#define Pragma_Float_Representation 23
+#define Pragma_Implicit_Packing 24
+#define Pragma_Initialize_Scalars 25
+#define Pragma_Interrupt_State 26
+#define Pragma_License 27
+#define Pragma_Locking_Policy 28
+#define Pragma_Long_Float 29
+#define Pragma_No_Run_Time 30
+#define Pragma_No_Strict_Aliasing 31
+#define Pragma_Normalize_Scalars 32
+#define Pragma_Optimize_Alignment 33
#define Pragma_Persistent_BSS 34
-#define Pragma_Priority_Specific_Dispatching 35
-#define Pragma_Profile 36
-#define Pragma_Profile_Warnings 37
-#define Pragma_Propagate_Exceptions 38
-#define Pragma_Queuing_Policy 39
-#define Pragma_Ravenscar 40
-#define Pragma_Restricted_Run_Time 41
-#define Pragma_Restrictions 42
-#define Pragma_Restriction_Warnings 43
-#define Pragma_Reviewable 44
-#define Pragma_Source_File_Name 45
-#define Pragma_Source_File_Name_Project 46
-#define Pragma_Style_Checks 47
-#define Pragma_Suppress 48
-#define Pragma_Suppress_Exception_Locations 49
-#define Pragma_Task_Dispatching_Policy 50
-#define Pragma_Universal_Data 51
-#define Pragma_Unsuppress 52
-#define Pragma_Use_VADS_Size 53
-#define Pragma_Validity_Checks 54
-#define Pragma_Warnings 55
-#define Pragma_Wide_Character_Encoding 56
-#define Pragma_Abort_Defer 57
-#define Pragma_All_Calls_Remote 58
-#define Pragma_Annotate 59
-#define Pragma_Assert 60
-#define Pragma_Asynchronous 61
-#define Pragma_Atomic 62
-#define Pragma_Atomic_Components 63
-#define Pragma_Attach_Handler 64
-#define Pragma_Check 65
-#define Pragma_CIL_Constructor 66
-#define Pragma_Comment 67
-#define Pragma_Common_Object 68
-#define Pragma_Complete_Representation 69
-#define Pragma_Complex_Representation 70
-#define Pragma_Controlled 71
-#define Pragma_Convention 72
-#define Pragma_CPP_Class 73
-#define Pragma_CPP_Constructor 74
-#define Pragma_CPP_Virtual 75
-#define Pragma_CPP_Vtable 76
-#define Pragma_Debug 77
-#define Pragma_Elaborate 78
-#define Pragma_Elaborate_All 79
-#define Pragma_Elaborate_Body 80
-#define Pragma_Export 81
-#define Pragma_Export_Exception 82
-#define Pragma_Export_Function 83
-#define Pragma_Export_Object 84
-#define Pragma_Export_Procedure 85
-#define Pragma_Export_Value 86
-#define Pragma_Export_Valued_Procedure 87
-#define Pragma_External 88
-#define Pragma_Finalize_Storage_Only 89
-#define Pragma_Ident 90
-#define Pragma_Implemented_By_Entry 91
-#define Pragma_Import 92
-#define Pragma_Import_Exception 93
-#define Pragma_Import_Function 94
-#define Pragma_Import_Object 95
-#define Pragma_Import_Procedure 96
-#define Pragma_Import_Valued_Procedure 97
-#define Pragma_Inline 98
-#define Pragma_Inline_Always 99
-#define Pragma_Inline_Generic 100
-#define Pragma_Inspection_Point 101
-#define Pragma_Interface_Name 102
-#define Pragma_Interrupt_Handler 103
-#define Pragma_Interrupt_Priority 104
-#define Pragma_Java_Constructor 105
-#define Pragma_Java_Interface 106
-#define Pragma_Keep_Names 107
-#define Pragma_Link_With 108
-#define Pragma_Linker_Alias 109
-#define Pragma_Linker_Constructor 110
-#define Pragma_Linker_Destructor 111
-#define Pragma_Linker_Options 112
-#define Pragma_Linker_Section 113
-#define Pragma_List 114
-#define Pragma_Machine_Attribute 115
-#define Pragma_Main 116
-#define Pragma_Main_Storage 117
-#define Pragma_Memory_Size 118
-#define Pragma_No_Body 119
-#define Pragma_No_Return 120
-#define Pragma_Obsolescent 121
-#define Pragma_Optimize 122
-#define Pragma_Pack 123
-#define Pragma_Page 124
-#define Pragma_Passive 125
-#define Pragma_Postcondition 126
-#define Pragma_Precondition 127
-#define Pragma_Preelaborable_Initialization 128
-#define Pragma_Preelaborate 129
-#define Pragma_Preelaborate_05 130
-#define Pragma_Psect_Object 131
-#define Pragma_Pure 132
-#define Pragma_Pure_05 133
-#define Pragma_Pure_Function 134
-#define Pragma_Relative_Deadline 135
-#define Pragma_Remote_Call_Interface 136
-#define Pragma_Remote_Types 137
-#define Pragma_Share_Generic 138
-#define Pragma_Shared 139
-#define Pragma_Shared_Passive 140
-#define Pragma_Source_Reference 141
-#define Pragma_Static_Elaboration_Desired 142
-#define Pragma_Stream_Convert 143
-#define Pragma_Subtitle 144
-#define Pragma_Suppress_All 145
-#define Pragma_Suppress_Debug_Info 146
-#define Pragma_Suppress_Initialization 147
-#define Pragma_System_Name 148
-#define Pragma_Task_Info 149
-#define Pragma_Task_Name 150
-#define Pragma_Task_Storage 151
-#define Pragma_Time_Slice 152
-#define Pragma_Title 153
-#define Pragma_Unchecked_Union 154
-#define Pragma_Unimplemented_Unit 155
-#define Pragma_Universal_Aliasing 156
-#define Pragma_Unmodified 157
-#define Pragma_Unreferenced 158
-#define Pragma_Unreferenced_Objects 159
-#define Pragma_Unreserve_All_Interrupts 160
-#define Pragma_Volatile 161
-#define Pragma_Volatile_Components 162
-#define Pragma_Weak_External 163
-#define Pragma_AST_Entry 164
-#define Pragma_Fast_Math 165
-#define Pragma_Interface 166
-#define Pragma_Priority 167
-#define Pragma_Storage_Size 168
-#define Pragma_Storage_Unit 169
+#define Pragma_Polling 35
+#define Pragma_Priority_Specific_Dispatching 36
+#define Pragma_Profile 37
+#define Pragma_Profile_Warnings 38
+#define Pragma_Propagate_Exceptions 39
+#define Pragma_Queuing_Policy 40
+#define Pragma_Ravenscar 41
+#define Pragma_Restricted_Run_Time 42
+#define Pragma_Restrictions 43
+#define Pragma_Restriction_Warnings 44
+#define Pragma_Reviewable 45
+#define Pragma_Source_File_Name 46
+#define Pragma_Source_File_Name_Project 47
+#define Pragma_Style_Checks 48
+#define Pragma_Suppress 49
+#define Pragma_Suppress_Exception_Locations 50
+#define Pragma_Task_Dispatching_Policy 51
+#define Pragma_Universal_Data 52
+#define Pragma_Unsuppress 53
+#define Pragma_Use_VADS_Size 54
+#define Pragma_Validity_Checks 55
+#define Pragma_Warnings 56
+#define Pragma_Wide_Character_Encoding 57
+#define Pragma_Abort_Defer 58
+#define Pragma_All_Calls_Remote 59
+#define Pragma_Annotate 60
+#define Pragma_Assert 61
+#define Pragma_Asynchronous 62
+#define Pragma_Atomic 63
+#define Pragma_Atomic_Components 64
+#define Pragma_Attach_Handler 65
+#define Pragma_Check 66
+#define Pragma_CIL_Constructor 67
+#define Pragma_Comment 68
+#define Pragma_Common_Object 69
+#define Pragma_Complete_Representation 70
+#define Pragma_Complex_Representation 71
+#define Pragma_Controlled 72
+#define Pragma_Convention 73
+#define Pragma_CPP_Class 74
+#define Pragma_CPP_Constructor 75
+#define Pragma_CPP_Virtual 76
+#define Pragma_CPP_Vtable 77
+#define Pragma_Debug 78
+#define Pragma_Elaborate 79
+#define Pragma_Elaborate_All 80
+#define Pragma_Elaborate_Body 81
+#define Pragma_Export 82
+#define Pragma_Export_Exception 83
+#define Pragma_Export_Function 84
+#define Pragma_Export_Object 85
+#define Pragma_Export_Procedure 86
+#define Pragma_Export_Value 87
+#define Pragma_Export_Valued_Procedure 88
+#define Pragma_External 89
+#define Pragma_Finalize_Storage_Only 90
+#define Pragma_Ident 91
+#define Pragma_Implemented_By_Entry 92
+#define Pragma_Import 93
+#define Pragma_Import_Exception 94
+#define Pragma_Import_Function 95
+#define Pragma_Import_Object 96
+#define Pragma_Import_Procedure 97
+#define Pragma_Import_Valued_Procedure 98
+#define Pragma_Inline 99
+#define Pragma_Inline_Always 100
+#define Pragma_Inline_Generic 101
+#define Pragma_Inspection_Point 102
+#define Pragma_Interface_Name 103
+#define Pragma_Interrupt_Handler 104
+#define Pragma_Interrupt_Priority 105
+#define Pragma_Java_Constructor 106
+#define Pragma_Java_Interface 107
+#define Pragma_Keep_Names 108
+#define Pragma_Link_With 109
+#define Pragma_Linker_Alias 110
+#define Pragma_Linker_Constructor 111
+#define Pragma_Linker_Destructor 112
+#define Pragma_Linker_Options 113
+#define Pragma_Linker_Section 114
+#define Pragma_List 115
+#define Pragma_Machine_Attribute 116
+#define Pragma_Main 117
+#define Pragma_Main_Storage 118
+#define Pragma_Memory_Size 119
+#define Pragma_No_Body 120
+#define Pragma_No_Return 121
+#define Pragma_Obsolescent 122
+#define Pragma_Optimize 123
+#define Pragma_Pack 124
+#define Pragma_Page 125
+#define Pragma_Passive 126
+#define Pragma_Postcondition 127
+#define Pragma_Precondition 128
+#define Pragma_Preelaborable_Initialization 129
+#define Pragma_Preelaborate 130
+#define Pragma_Preelaborate_05 131
+#define Pragma_Psect_Object 132
+#define Pragma_Pure 133
+#define Pragma_Pure_05 134
+#define Pragma_Pure_Function 135
+#define Pragma_Relative_Deadline 136
+#define Pragma_Remote_Call_Interface 137
+#define Pragma_Remote_Types 138
+#define Pragma_Share_Generic 139
+#define Pragma_Shared 140
+#define Pragma_Shared_Passive 141
+#define Pragma_Source_Reference 142
+#define Pragma_Static_Elaboration_Desired 143
+#define Pragma_Stream_Convert 144
+#define Pragma_Subtitle 145
+#define Pragma_Suppress_All 146
+#define Pragma_Suppress_Debug_Info 147
+#define Pragma_Suppress_Initialization 148
+#define Pragma_System_Name 149
+#define Pragma_Task_Info 150
+#define Pragma_Task_Name 151
+#define Pragma_Task_Storage 152
+#define Pragma_Time_Slice 153
+#define Pragma_Title 154
+#define Pragma_Unchecked_Union 155
+#define Pragma_Unimplemented_Unit 156
+#define Pragma_Universal_Aliasing 157
+#define Pragma_Unmodified 158
+#define Pragma_Unreferenced 159
+#define Pragma_Unreferenced_Objects 160
+#define Pragma_Unreserve_All_Interrupts 161
+#define Pragma_Volatile 162
+#define Pragma_Volatile_Components 163
+#define Pragma_Weak_External 164
+#define Pragma_AST_Entry 165
+#define Pragma_Fast_Math 166
+#define Pragma_Interface 167
+#define Pragma_Priority 168
+#define Pragma_Storage_Size 169
+#define Pragma_Storage_Unit 170
/* End of snames.h (C version of Snames package spec) */
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-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/targparm.adb b/gcc/ada/targparm.adb
index 6039cf7406b..52bbbcb953c 100644
--- a/gcc/ada/targparm.adb
+++ b/gcc/ada/targparm.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- --
@@ -54,6 +54,7 @@ package body Targparm is
MOV, -- Machine_Overflows
MRN, -- Machine_Rounds
PAS, -- Preallocated_Stacks
+ RTX, -- RTX_RTSS_Kernel_Module
S64, -- Support_64_Bit_Divides
SAG, -- Support_Aggregates
SCA, -- Support_Composite_Assign
@@ -90,6 +91,7 @@ package body Targparm is
MOV_Str : aliased constant Source_Buffer := "Machine_Overflows";
MRN_Str : aliased constant Source_Buffer := "Machine_Rounds";
PAS_Str : aliased constant Source_Buffer := "Preallocated_Stacks";
+ RTX_Str : aliased constant Source_Buffer := "RTX_RTSS_Kernel_Module";
S64_Str : aliased constant Source_Buffer := "Support_64_Bit_Divides";
SAG_Str : aliased constant Source_Buffer := "Support_Aggregates";
SCA_Str : aliased constant Source_Buffer := "Support_Composite_Assign";
@@ -126,6 +128,7 @@ package body Targparm is
MOV_Str'Access,
MRN_Str'Access,
PAS_Str'Access,
+ RTX_Str'Access,
S64_Str'Access,
SAG_Str'Access,
SCA_Str'Access,
@@ -573,6 +576,7 @@ package body Targparm is
when MOV => Machine_Overflows_On_Target := Result;
when MRN => Machine_Rounds_On_Target := Result;
when PAS => Preallocated_Stacks_On_Target := Result;
+ when RTX => RTX_RTSS_Kernel_Module_On_Target := Result;
when S64 => Support_64_Bit_Divides_On_Target := Result;
when SAG => Support_Aggregates_On_Target := Result;
when SCA => Support_Composite_Assign_On_Target := Result;
diff --git a/gcc/ada/targparm.ads b/gcc/ada/targparm.ads
index c40d6d81adc..97192a56143 100644
--- a/gcc/ada/targparm.ads
+++ b/gcc/ada/targparm.ads
@@ -216,6 +216,9 @@ package Targparm is
OpenVMS_On_Target : Boolean := False;
-- Set to True if target is OpenVMS
+ RTX_RTSS_Kernel_Module_On_Target : Boolean := False;
+ -- Set to True if target is RTSS module for RTX
+
type Virtual_Machine_Kind is (No_VM, JVM_Target, CLI_Target);
VM_Target : Virtual_Machine_Kind := No_VM;
-- Kind of virtual machine targetted
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 14028630021..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
@@ -214,7 +215,7 @@ package Tbuild is
-- Suffix is also a single upper case letter other than O,Q,U,W,X and is a
-- required parameter (T is permitted). The constructed name is stored
- -- using Find_Name so that it can be located using a subsequent Find_Name
+ -- using Name_Find so that it can be located using a subsequent Name_Find
-- operation (i.e. it is properly hashed into the names table). The upper
-- case letter given as the Suffix argument ensures that the name does
-- not clash with any Ada identifier name. These generated names are
@@ -228,7 +229,7 @@ package Tbuild is
-- Suffix & Suffix_Index'Image
-- where Suffix is a single upper case letter other than O,Q,U,W,X and is
-- a required parameter (T is permitted). The constructed name is stored
- -- using Find_Name so that it can be located using a subsequent Find_Name
+ -- using Name_Find so that it can be located using a subsequent Name_Find
-- operation (i.e. it is properly hashed into the names table). The upper
-- case letter given as the Suffix argument ensures that the name does
-- not clash with any Ada identifier name. These generated names are
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/uintp.adb b/gcc/ada/uintp.adb
index 416d5d88681..b1f05993608 100644
--- a/gcc/ada/uintp.adb
+++ b/gcc/ada/uintp.adb
@@ -1832,7 +1832,7 @@ package body Uintp is
Den1 := V_Hat + C;
Den2 := V_Hat + D;
- exit when (Den1 * Den2) = Int_0;
+ exit when Den1 = Int_0 or else Den2 = Int_0;
-- Compute Q, the trial quotient
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/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/alias.c b/gcc/alias.c
index 684205cd89e..56660ec38d9 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -1975,6 +1975,34 @@ adjust_offset_for_component_ref (tree x, rtx offset)
return GEN_INT (ioffset);
}
+/* The function returns nonzero if X is an address containg VALUE. */
+static int
+value_addr_p (rtx x)
+{
+ if (GET_CODE (x) == VALUE)
+ return 1;
+ if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 0)) == VALUE)
+ return 1;
+ return 0;
+}
+
+/* The function returns nonzero if X is a stack address. */
+static int
+stack_addr_p (rtx x)
+{
+ if (x == hard_frame_pointer_rtx || x == frame_pointer_rtx
+ || x == arg_pointer_rtx || x == stack_pointer_rtx)
+ return 1;
+ if (GET_CODE (x) == PLUS
+ && (XEXP (x, 0) == hard_frame_pointer_rtx
+ || XEXP (x, 0) == frame_pointer_rtx
+ || XEXP (x, 0) == arg_pointer_rtx
+ || XEXP (x, 0) == stack_pointer_rtx)
+ && CONSTANT_P (XEXP (x, 1)))
+ return 1;
+ return 0;
+}
+
/* Return nonzero if we can determine the exprs corresponding to memrefs
X and Y and they do not overlap. */
@@ -1984,9 +2012,27 @@ nonoverlapping_memrefs_p (const_rtx x, const_rtx y)
tree exprx = MEM_EXPR (x), expry = MEM_EXPR (y);
rtx rtlx, rtly;
rtx basex, basey;
+ rtx x_addr, y_addr;
rtx moffsetx, moffsety;
HOST_WIDE_INT offsetx = 0, offsety = 0, sizex, sizey, tem;
+ if (flag_ira && optimize && reload_completed)
+ {
+ /* We need this code for IRA because of stack slot sharing. RTL
+ in decl can be different than RTL used in insns. It is a
+ safe code although it can be conservative sometime. */
+ x_addr = canon_rtx (get_addr (XEXP (x, 0)));
+ y_addr = canon_rtx (get_addr (XEXP (y, 0)));
+
+ if (value_addr_p (x_addr) || value_addr_p (y_addr))
+ return 0;
+
+ if (stack_addr_p (x_addr) && stack_addr_p (y_addr)
+ && memrefs_conflict_p (SIZE_FOR_MODE (y), y_addr,
+ SIZE_FOR_MODE (x), x_addr, 0))
+ return 0;
+ }
+
/* Unless both have exprs, we can't tell anything. */
if (exprx == 0 || expry == 0)
return 0;
diff --git a/gcc/attribs.c b/gcc/attribs.c
index ba6a9e294c8..dbce1815e68 100644
--- a/gcc/attribs.c
+++ b/gcc/attribs.c
@@ -252,18 +252,18 @@ decl_attributes (tree *node, tree attributes, int flags)
&& !DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node))
DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node) = optimization_current_node;
- /* If this is a function and the user used #pragma GCC option, add the
- options to the attribute((option(...))) list. */
+ /* If this is a function and the user used #pragma GCC target, add the
+ options to the attribute((target(...))) list. */
if (TREE_CODE (*node) == FUNCTION_DECL
- && current_option_pragma
+ && current_target_pragma
&& targetm.target_option.valid_attribute_p (*node, NULL_TREE,
- current_option_pragma, 0))
+ current_target_pragma, 0))
{
- tree cur_attr = lookup_attribute ("option", attributes);
- tree opts = copy_list (current_option_pragma);
+ tree cur_attr = lookup_attribute ("target", attributes);
+ tree opts = copy_list (current_target_pragma);
if (! cur_attr)
- attributes = tree_cons (get_identifier ("option"), opts, attributes);
+ attributes = tree_cons (get_identifier ("target"), opts, attributes);
else
TREE_VALUE (cur_attr) = chainon (opts, TREE_VALUE (cur_attr));
}
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index 4aa864d66cf..e1d13ea27c6 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -122,7 +122,7 @@ struct edge_def GTY(())
/* Instructions queued on the edge. */
union edge_def_insns {
- tree GTY ((tag ("true"))) t;
+ gimple_seq GTY ((tag ("true"))) g;
rtx GTY ((tag ("false"))) r;
} GTY ((desc ("current_ir_type () == IR_GIMPLE"))) insns;
@@ -231,7 +231,7 @@ struct basic_block_def GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb")
struct basic_block_def *next_bb;
union basic_block_il_dependent {
- struct tree_bb_info * GTY ((tag ("0"))) tree;
+ struct gimple_bb_info * GTY ((tag ("0"))) gimple;
struct rtl_bb_info * GTY ((tag ("1"))) rtl;
} GTY ((desc ("((%1.flags & BB_RTL) != 0)"))) il;
@@ -266,13 +266,13 @@ struct rtl_bb_info GTY(())
int visited;
};
-struct tree_bb_info GTY(())
+struct gimple_bb_info GTY(())
{
- /* Pointers to the first and last trees of the block. */
- tree stmt_list;
+ /* Sequence of statements in this block. */
+ gimple_seq seq;
- /* Chain of PHI nodes for this block. */
- tree phi_nodes;
+ /* PHI nodes for this block. */
+ gimple_seq phi_nodes;
};
typedef struct basic_block_def *basic_block;
@@ -383,7 +383,7 @@ struct control_flow_graph GTY(())
int x_last_basic_block;
/* Mapping of labels to their associated blocks. At present
- only used for the tree CFG. */
+ only used for the gimple CFG. */
VEC(basic_block,gc) *x_label_to_block_map;
enum profile_status {
@@ -831,15 +831,28 @@ extern bool maybe_hot_bb_p (const_basic_block);
extern bool maybe_hot_edge_p (edge);
extern bool probably_cold_bb_p (const_basic_block);
extern bool probably_never_executed_bb_p (const_basic_block);
-extern bool tree_predicted_by_p (const_basic_block, enum br_predictor);
+extern bool optimize_bb_for_size_p (const_basic_block);
+extern bool optimize_bb_for_speed_p (const_basic_block);
+extern bool optimize_edge_for_size_p (edge);
+extern bool optimize_edge_for_speed_p (edge);
+extern bool optimize_insn_for_size_p (void);
+extern bool optimize_insn_for_speed_p (void);
+extern bool optimize_function_for_size_p (struct function *);
+extern bool optimize_function_for_speed_p (struct function *);
+extern bool optimize_loop_for_size_p (struct loop *);
+extern bool optimize_loop_for_speed_p (struct loop *);
+extern bool optimize_loop_nest_for_size_p (struct loop *);
+extern bool optimize_loop_nest_for_speed_p (struct loop *);
+extern bool gimple_predicted_by_p (const_basic_block, enum br_predictor);
extern bool rtl_predicted_by_p (const_basic_block, enum br_predictor);
-extern void tree_predict_edge (edge, enum br_predictor, int);
+extern void gimple_predict_edge (edge, enum br_predictor, int);
extern void rtl_predict_edge (edge, enum br_predictor, int);
extern void predict_edge_def (edge, enum br_predictor, enum prediction);
extern void guess_outgoing_edge_probabilities (basic_block);
extern void remove_predictions_associated_with_edge (edge);
extern bool edge_probability_reliable_p (const_edge);
extern bool br_prob_note_reliable_p (const_rtx);
+extern bool predictable_edge_p (edge);
/* In cfg.c */
extern void dump_regset (regset, FILE *);
@@ -988,6 +1001,11 @@ bb_has_abnormal_pred (basic_block bb)
/* In cfgloopmanip.c. */
extern edge mfb_kj_edge;
-bool mfb_keep_just (edge);
+extern bool mfb_keep_just (edge);
+
+/* In cfgexpand.c. */
+extern void rtl_profile_for_bb (basic_block);
+extern void rtl_profile_for_edge (edge);
+extern void default_rtl_profile (void);
#endif /* GCC_BASIC_BLOCK_H */
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index ae24c0c3245..b636c1e3a1d 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -648,7 +648,8 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th,
/* The loop has less than 4 iterations. */
if (single_succ_p (bb)
- && copy_bb_p (best_edge->dest, !optimize_size))
+ && copy_bb_p (best_edge->dest,
+ optimize_edge_for_speed_p (best_edge)))
{
bb = copy_bb (best_edge->dest, best_edge, bb,
*n_traces);
@@ -1102,7 +1103,7 @@ connect_traces (int n_traces, struct trace *traces)
edge is traversed frequently enough. */
if (try_copy
&& copy_bb_p (best->dest,
- !optimize_size
+ optimize_edge_for_speed_p (best)
&& EDGE_FREQUENCY (best) >= freq_threshold
&& best->count >= count_threshold))
{
@@ -1173,7 +1174,7 @@ copy_bb_p (const_basic_block bb, int code_may_grow)
if (EDGE_COUNT (bb->succs) > 8)
return false;
- if (code_may_grow && maybe_hot_bb_p (bb))
+ if (code_may_grow && optimize_bb_for_speed_p (bb))
max_size *= PARAM_VALUE (PARAM_MAX_GROW_COPY_BB_INSNS);
FOR_BB_INSNS (bb, insn)
@@ -1984,7 +1985,7 @@ gate_duplicate_computed_gotos (void)
{
if (targetm.cannot_modify_jumps_p ())
return false;
- return (optimize > 0 && flag_expensive_optimizations && !optimize_size);
+ return (optimize > 0 && flag_expensive_optimizations);
}
@@ -2075,6 +2076,9 @@ duplicate_computed_gotos (void)
|| single_pred_p (single_succ (bb)))
continue;
+ if (!optimize_bb_for_size_p (bb))
+ continue;
+
/* The successor block has to be a duplication candidate. */
if (!bitmap_bit_p (candidates, single_succ (bb)->index))
continue;
@@ -2221,7 +2225,15 @@ rest_of_handle_reorder_blocks (void)
splitting possibly introduced more crossjumping opportunities. */
cfg_layout_initialize (CLEANUP_EXPENSIVE);
- if (flag_reorder_blocks || flag_reorder_blocks_and_partition)
+ if ((flag_reorder_blocks || flag_reorder_blocks_and_partition)
+ /* Don't reorder blocks when optimizing for size because extra jump insns may
+ be created; also barrier may create extra padding.
+
+ More correctly we should have a block reordering mode that tried to
+ minimize the combined size of all the jumps. This would more or less
+ automatically remove extra jumps, but would also try to use more short
+ jumps instead of long jumps. */
+ && optimize_function_for_speed_p (cfun))
{
reorder_basic_blocks ();
cleanup_cfg (CLEANUP_EXPENSIVE);
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 630d978528e..81d0ab1dfa1 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -27,7 +27,7 @@ along with GCC; see the file COPYING3. If not see
#include "real.h"
#include "rtl.h"
#include "tree.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "flags.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -207,6 +207,7 @@ static rtx expand_builtin_memory_chk (tree, rtx, enum machine_mode,
enum built_in_function);
static void maybe_emit_chk_warning (tree, enum built_in_function);
static void maybe_emit_sprintf_chk_warning (tree, enum built_in_function);
+static void maybe_emit_free_warning (tree);
static tree fold_builtin_object_size (tree, tree);
static tree fold_builtin_strcat_chk (tree, tree, tree, tree);
static tree fold_builtin_strncat_chk (tree, tree, tree, tree, tree);
@@ -743,7 +744,7 @@ expand_builtin_setjmp_receiver (rtx receiver_label ATTRIBUTE_UNUSED)
{
/* Now restore our arg pointer from the address at which it
was saved in our stack frame. */
- emit_move_insn (virtual_incoming_args_rtx,
+ emit_move_insn (crtl->args.internal_arg_pointer,
copy_to_reg (get_arg_pointer_save_area ()));
}
}
@@ -778,6 +779,11 @@ expand_builtin_longjmp (rtx buf_addr, rtx value)
rtx fp, lab, stack, insn, last;
enum machine_mode sa_mode = STACK_SAVEAREA_MODE (SAVE_NONLOCAL);
+ /* DRAP is needed for stack realign if longjmp is expanded to current
+ function */
+ if (SUPPORTS_STACK_ALIGNMENT)
+ crtl->need_drap = true;
+
if (setjmp_alias_set == -1)
setjmp_alias_set = new_alias_set ();
@@ -1345,7 +1351,7 @@ expand_builtin_apply_args_1 (void)
}
/* Save the arg pointer to the block. */
- tem = copy_to_reg (virtual_incoming_args_rtx);
+ tem = copy_to_reg (crtl->args.internal_arg_pointer);
#ifdef STACK_GROWS_DOWNWARD
/* We need the pointer as the caller actually passed them to us, not
as we might have pretended they were passed. Make sure it's a valid
@@ -1453,6 +1459,14 @@ expand_builtin_apply (rtx function, rtx arguments, rtx argsize)
/* Allocate a block of memory onto the stack and copy the memory
arguments to the outgoing arguments address. */
allocate_dynamic_stack_space (argsize, 0, BITS_PER_UNIT);
+
+ /* Set DRAP flag to true, even though allocate_dynamic_stack_space
+ may have already set current_function_calls_alloca to true.
+ current_function_calls_alloca won't be set if argsize is zero,
+ so we have to guarantee need_drap is true here. */
+ if (SUPPORTS_STACK_ALIGNMENT)
+ crtl->need_drap = true;
+
dest = virtual_outgoing_args_rtx;
#ifndef STACK_GROWS_DOWNWARD
if (GET_CODE (argsize) == CONST_INT)
@@ -2897,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);
@@ -2921,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))
{
@@ -2966,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))
{
@@ -3028,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);
@@ -3287,6 +3301,7 @@ expand_builtin_memcpy (tree exp, rtx target, enum machine_mode mode)
false, /*endp=*/0);
HOST_WIDE_INT expected_size = -1;
unsigned int expected_align = 0;
+ tree_ann_common_t ann;
if (result)
{
@@ -3308,7 +3323,10 @@ expand_builtin_memcpy (tree exp, rtx target, enum machine_mode mode)
if (src_align == 0)
return NULL_RTX;
- stringop_block_profile (exp, &expected_align, &expected_size);
+ ann = tree_common_ann (exp);
+ if (ann)
+ stringop_block_profile (ann->stmt, &expected_align, &expected_size);
+
if (expected_align < dest_align)
expected_align = dest_align;
dest_mem = get_memory_rtx (dest, len);
@@ -3883,6 +3901,7 @@ expand_builtin_memset_args (tree dest, tree val, tree len,
rtx dest_mem, dest_addr, len_rtx;
HOST_WIDE_INT expected_size = -1;
unsigned int expected_align = 0;
+ tree_ann_common_t ann;
dest_align = get_pointer_alignment (dest, BIGGEST_ALIGNMENT);
@@ -3890,7 +3909,10 @@ expand_builtin_memset_args (tree dest, tree val, tree len,
if (dest_align == 0)
return NULL_RTX;
- stringop_block_profile (orig_exp, &expected_align, &expected_size);
+ ann = tree_common_ann (orig_exp);
+ if (ann)
+ stringop_block_profile (ann->stmt, &expected_align, &expected_size);
+
if (expected_align < dest_align)
expected_align = dest_align;
@@ -4442,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,
@@ -4755,7 +4777,8 @@ expand_builtin_va_start (tree exp)
current (padded) address and increment by the (padded) size. */
tree
-std_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p)
+std_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
+ gimple_seq *post_p)
{
tree addr, t, type_size, rounded_size, valist_tmp;
unsigned HOST_WIDE_INT align, boundary;
@@ -4776,11 +4799,11 @@ std_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p)
boundary = FUNCTION_ARG_BOUNDARY (TYPE_MODE (type), type);
/* When we align parameter on stack for caller, if the parameter
- alignment is beyond PREFERRED_STACK_BOUNDARY, it will be
- aligned at PREFERRED_STACK_BOUNDARY. We will match callee
+ alignment is beyond MAX_SUPPORTED_STACK_ALIGNMENT, it will be
+ aligned at MAX_SUPPORTED_STACK_ALIGNMENT. We will match callee
here with caller. */
- if (boundary > PREFERRED_STACK_BOUNDARY)
- boundary = PREFERRED_STACK_BOUNDARY;
+ if (boundary > MAX_SUPPORTED_STACK_ALIGNMENT)
+ boundary = MAX_SUPPORTED_STACK_ALIGNMENT;
boundary /= BITS_PER_UNIT;
@@ -4875,7 +4898,7 @@ dummy_object (tree type)
builtin function, but a very special sort of operator. */
enum gimplify_status
-gimplify_va_arg_expr (tree *expr_p, tree *pre_p, tree *post_p)
+gimplify_va_arg_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
{
tree promoted_type, have_va_type;
tree valist = TREE_OPERAND (*expr_p, 0);
@@ -4900,24 +4923,26 @@ gimplify_va_arg_expr (tree *expr_p, tree *pre_p, tree *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);
- append_to_statement_list (t, pre_p);
+ gimplify_and_add (t, pre_p);
/* This is dead code, but go ahead and finish so that the
mode of the result comes out right. */
@@ -4939,13 +4964,14 @@ gimplify_va_arg_expr (tree *expr_p, tree *pre_p, tree *post_p)
tree p1 = build_pointer_type (TREE_TYPE (have_va_type));
valist = build_fold_addr_expr_with_type (valist, p1);
}
+
gimplify_expr (&valist, pre_p, post_p, is_gimple_val, fb_rvalue);
}
else
gimplify_expr (&valist, pre_p, post_p, is_gimple_min_lval, fb_lvalue);
if (!targetm.gimplify_va_arg_expr)
- /* FIXME:Once most targets are converted we should merely
+ /* FIXME: Once most targets are converted we should merely
assert this is non-null. */
return GS_ALL_DONE;
@@ -5552,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);
@@ -6107,7 +6133,8 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
if (!optimize
&& !called_as_built_in (fndecl)
&& DECL_ASSEMBLER_NAME_SET_P (fndecl)
- && fcode != BUILT_IN_ALLOCA)
+ && fcode != BUILT_IN_ALLOCA
+ && fcode != BUILT_IN_FREE)
return expand_call (exp, target, ignore);
/* The built-in function expanders test for target == const0_rtx
@@ -6984,6 +7011,10 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
maybe_emit_sprintf_chk_warning (exp, fcode);
break;
+ case BUILT_IN_FREE:
+ maybe_emit_free_warning (exp);
+ break;
+
default: /* just do library call, if unknown builtin */
break;
}
@@ -7248,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 ("target format does not support infinity");
+ pedwarn (input_location, 0, "target format does not support infinity");
real_inf (&real);
return build_real (type, real);
@@ -7292,7 +7323,7 @@ integer_valued_real_p (tree t)
case COMPOUND_EXPR:
case MODIFY_EXPR:
case BIND_EXPR:
- return integer_valued_real_p (GENERIC_TREE_OPERAND (t, 1));
+ return integer_valued_real_p (TREE_OPERAND (t, 1));
case PLUS_EXPR:
case MINUS_EXPR:
@@ -7484,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),
@@ -7500,7 +7530,7 @@ fold_builtin_cabs (tree arg, tree type, tree fndecl)
/* Don't do this when optimizing for size. */
if (flag_unsafe_math_optimizations
- && optimize && !optimize_size)
+ && optimize && optimize_function_for_speed_p (cfun))
{
tree sqrtfn = mathfn_built_in (type, BUILT_IN_SQRT);
@@ -7568,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);
@@ -7621,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));
@@ -7637,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);
@@ -7660,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);
@@ -7680,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);
@@ -8229,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);
}
@@ -8262,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):
@@ -8291,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). */
@@ -8351,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));
@@ -8417,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))
{
@@ -8485,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);
@@ -8857,7 +8882,7 @@ fold_builtin_strcpy (tree fndecl, tree dest, tree src, tree len)
if (operand_equal_p (src, dest, 0))
return fold_convert (TREE_TYPE (TREE_TYPE (fndecl)), dest);
- if (optimize_size)
+ if (optimize_function_for_size_p (cfun))
return NULL_TREE;
fn = implicit_built_in_decls[BUILT_IN_MEMCPY];
@@ -10572,7 +10597,7 @@ fold_builtin_n (tree fndecl, tree *args, int nargs, bool ignore)
}
if (ret)
{
- ret = build1 (NOP_EXPR, GENERIC_TREE_TYPE (ret), ret);
+ ret = build1 (NOP_EXPR, TREE_TYPE (ret), ret);
TREE_NO_WARNING (ret) = 1;
return ret;
}
@@ -10833,6 +10858,61 @@ validate_arg (const_tree arg, enum tree_code code)
/* This function validates the types of a function call argument list
against a specified list of tree_codes. If the last specifier is a 0,
that represents an ellipses, otherwise the last specifier must be a
+ VOID_TYPE.
+
+ This is the GIMPLE version of validate_arglist. Eventually we want to
+ completely convert builtins.c to work from GIMPLEs and the tree based
+ validate_arglist will then be removed. */
+
+bool
+validate_gimple_arglist (const_gimple call, ...)
+{
+ enum tree_code code;
+ bool res = 0;
+ va_list ap;
+ const_tree arg;
+ size_t i;
+
+ va_start (ap, call);
+ i = 0;
+
+ do
+ {
+ code = va_arg (ap, enum tree_code);
+ switch (code)
+ {
+ case 0:
+ /* This signifies an ellipses, any further arguments are all ok. */
+ res = true;
+ goto end;
+ case VOID_TYPE:
+ /* This signifies an endlink, if no arguments remain, return
+ true, otherwise return false. */
+ res = (i == gimple_call_num_args (call));
+ goto end;
+ default:
+ /* If no parameters remain or the parameter's code does not
+ match the specified code, return false. Otherwise continue
+ checking any remaining arguments. */
+ arg = gimple_call_arg (call, i++);
+ if (!validate_arg (arg, code))
+ goto end;
+ break;
+ }
+ }
+ while (1);
+
+ /* We need gotos here since we can only have one VA_CLOSE in a
+ function. */
+ end: ;
+ va_end (ap);
+
+ return res;
+}
+
+/* This function validates the types of a function call argument list
+ against a specified list of tree_codes. If the last specifier is a 0,
+ that represents an ellipses, otherwise the last specifier must be a
VOID_TYPE. */
bool
@@ -11421,7 +11501,7 @@ fold_builtin_fputs (tree arg0, tree arg1, bool ignore, bool unlocked, tree len)
case 1: /* length is greater than 1, call fwrite. */
{
/* If optimizing for size keep fputs. */
- if (optimize_size)
+ if (optimize_function_for_size_p (cfun))
return NULL_TREE;
/* New argument list transforming fputs(string, stream) to
fwrite(string, 1, len, stream). */
@@ -11439,6 +11519,7 @@ fold_builtin_fputs (tree arg0, tree arg1, bool ignore, bool unlocked, tree len)
/* Fold the next_arg or va_start call EXP. Returns true if there was an error
produced. False otherwise. This is done so that we don't output the error
or warning twice or three times. */
+
bool
fold_builtin_next_arg (tree exp, bool va_start_p)
{
@@ -11505,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:
@@ -11902,6 +11994,27 @@ maybe_emit_sprintf_chk_warning (tree exp, enum built_in_function fcode)
}
}
+/* Emit warning if a free is called with address of a variable. */
+
+static void
+maybe_emit_free_warning (tree exp)
+{
+ tree arg = CALL_EXPR_ARG (exp, 0);
+
+ STRIP_NOPS (arg);
+ if (TREE_CODE (arg) != ADDR_EXPR)
+ return;
+
+ arg = get_base_address (TREE_OPERAND (arg, 0));
+ if (arg == NULL || INDIRECT_REF_P (arg))
+ return;
+
+ if (SSA_VAR_P (arg))
+ warning (0, "%Kattempt to free a non-heap object %qD", exp, arg);
+ else
+ warning (0, "%Kattempt to free a non-heap object", exp);
+}
+
/* Fold a call to __builtin_object_size with arguments PTR and OST,
if possible. */
@@ -12759,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);
}
@@ -12801,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;
@@ -12809,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);
}
@@ -12847,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;
@@ -12856,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);
}
@@ -12890,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;
@@ -12898,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);
@@ -12963,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);
}
@@ -13004,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;
@@ -13013,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);
@@ -13081,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;
@@ -13089,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)
@@ -13113,3 +13240,303 @@ do_mpfr_lgamma_r (tree arg, tree arg_sg, tree type)
return result;
}
#endif
+
+/* FIXME tuples.
+ The functions below provide an alternate interface for folding
+ builtin function calls presented as GIMPLE_CALL statements rather
+ than as CALL_EXPRs. The folded result is still expressed as a
+ tree. There is too much code duplication in the handling of
+ varargs functions, and a more intrusive re-factoring would permit
+ better sharing of code between the tree and statement-based
+ versions of these functions. */
+
+/* Construct a new CALL_EXPR using the tail of the argument list of STMT
+ along with N new arguments specified as the "..." parameters. SKIP
+ is the number of arguments in STMT to be omitted. This function is used
+ to do varargs-to-varargs transformations. */
+
+static tree
+gimple_rewrite_call_expr (gimple stmt, int skip, tree fndecl, int n, ...)
+{
+ int oldnargs = gimple_call_num_args (stmt);
+ int nargs = oldnargs - skip + n;
+ tree fntype = TREE_TYPE (fndecl);
+ tree fn = build1 (ADDR_EXPR, build_pointer_type (fntype), fndecl);
+ tree *buffer;
+ int i, j;
+ va_list ap;
+
+ buffer = XALLOCAVEC (tree, nargs);
+ va_start (ap, n);
+ for (i = 0; i < n; i++)
+ buffer[i] = va_arg (ap, tree);
+ va_end (ap);
+ for (j = skip; j < oldnargs; j++, i++)
+ buffer[i] = gimple_call_arg (stmt, j);
+
+ return fold (build_call_array (TREE_TYPE (fntype), fn, nargs, buffer));
+}
+
+/* Fold a call STMT to __{,v}sprintf_chk. Return NULL_TREE if
+ a normal call should be emitted rather than expanding the function
+ inline. FCODE is either BUILT_IN_SPRINTF_CHK or BUILT_IN_VSPRINTF_CHK. */
+
+static tree
+gimple_fold_builtin_sprintf_chk (gimple stmt, enum built_in_function fcode)
+{
+ tree dest, size, len, fn, fmt, flag;
+ const char *fmt_str;
+ int nargs = gimple_call_num_args (stmt);
+
+ /* Verify the required arguments in the original call. */
+ if (nargs < 4)
+ return NULL_TREE;
+ dest = gimple_call_arg (stmt, 0);
+ if (!validate_arg (dest, POINTER_TYPE))
+ return NULL_TREE;
+ flag = gimple_call_arg (stmt, 1);
+ if (!validate_arg (flag, INTEGER_TYPE))
+ return NULL_TREE;
+ size = gimple_call_arg (stmt, 2);
+ if (!validate_arg (size, INTEGER_TYPE))
+ return NULL_TREE;
+ fmt = gimple_call_arg (stmt, 3);
+ if (!validate_arg (fmt, POINTER_TYPE))
+ return NULL_TREE;
+
+ if (! host_integerp (size, 1))
+ return NULL_TREE;
+
+ len = NULL_TREE;
+
+ if (!init_target_chars ())
+ return NULL_TREE;
+
+ /* Check whether the format is a literal string constant. */
+ fmt_str = c_getstr (fmt);
+ if (fmt_str != NULL)
+ {
+ /* If the format doesn't contain % args or %%, we know the size. */
+ if (strchr (fmt_str, target_percent) == 0)
+ {
+ if (fcode != BUILT_IN_SPRINTF_CHK || nargs == 4)
+ len = build_int_cstu (size_type_node, strlen (fmt_str));
+ }
+ /* If the format is "%s" and first ... argument is a string literal,
+ we know the size too. */
+ else if (fcode == BUILT_IN_SPRINTF_CHK
+ && strcmp (fmt_str, target_percent_s) == 0)
+ {
+ tree arg;
+
+ if (nargs == 5)
+ {
+ arg = gimple_call_arg (stmt, 4);
+ if (validate_arg (arg, POINTER_TYPE))
+ {
+ len = c_strlen (arg, 1);
+ if (! len || ! host_integerp (len, 1))
+ len = NULL_TREE;
+ }
+ }
+ }
+ }
+
+ if (! integer_all_onesp (size))
+ {
+ if (! len || ! tree_int_cst_lt (len, size))
+ return NULL_TREE;
+ }
+
+ /* Only convert __{,v}sprintf_chk to {,v}sprintf if flag is 0
+ or if format doesn't contain % chars or is "%s". */
+ if (! integer_zerop (flag))
+ {
+ if (fmt_str == NULL)
+ return NULL_TREE;
+ if (strchr (fmt_str, target_percent) != NULL
+ && strcmp (fmt_str, target_percent_s))
+ return NULL_TREE;
+ }
+
+ /* If __builtin_{,v}sprintf_chk is used, assume {,v}sprintf is available. */
+ fn = built_in_decls[fcode == BUILT_IN_VSPRINTF_CHK
+ ? BUILT_IN_VSPRINTF : BUILT_IN_SPRINTF];
+ if (!fn)
+ return NULL_TREE;
+
+ return gimple_rewrite_call_expr (stmt, 4, fn, 2, dest, fmt);
+}
+
+/* Fold a call STMT to {,v}snprintf. Return NULL_TREE if
+ a normal call should be emitted rather than expanding the function
+ inline. FCODE is either BUILT_IN_SNPRINTF_CHK or
+ BUILT_IN_VSNPRINTF_CHK. If MAXLEN is not NULL, it is maximum length
+ passed as second argument. */
+
+tree
+gimple_fold_builtin_snprintf_chk (gimple stmt, tree maxlen,
+ enum built_in_function fcode)
+{
+ tree dest, size, len, fn, fmt, flag;
+ const char *fmt_str;
+
+ /* Verify the required arguments in the original call. */
+ if (gimple_call_num_args (stmt) < 5)
+ return NULL_TREE;
+ dest = gimple_call_arg (stmt, 0);
+ if (!validate_arg (dest, POINTER_TYPE))
+ return NULL_TREE;
+ len = gimple_call_arg (stmt, 1);
+ if (!validate_arg (len, INTEGER_TYPE))
+ return NULL_TREE;
+ flag = gimple_call_arg (stmt, 2);
+ if (!validate_arg (flag, INTEGER_TYPE))
+ return NULL_TREE;
+ size = gimple_call_arg (stmt, 3);
+ if (!validate_arg (size, INTEGER_TYPE))
+ return NULL_TREE;
+ fmt = gimple_call_arg (stmt, 4);
+ if (!validate_arg (fmt, POINTER_TYPE))
+ return NULL_TREE;
+
+ if (! host_integerp (size, 1))
+ return NULL_TREE;
+
+ if (! integer_all_onesp (size))
+ {
+ if (! host_integerp (len, 1))
+ {
+ /* If LEN is not constant, try MAXLEN too.
+ For MAXLEN only allow optimizing into non-_ocs function
+ if SIZE is >= MAXLEN, never convert to __ocs_fail (). */
+ if (maxlen == NULL_TREE || ! host_integerp (maxlen, 1))
+ return NULL_TREE;
+ }
+ else
+ maxlen = len;
+
+ if (tree_int_cst_lt (size, maxlen))
+ return NULL_TREE;
+ }
+
+ if (!init_target_chars ())
+ return NULL_TREE;
+
+ /* Only convert __{,v}snprintf_chk to {,v}snprintf if flag is 0
+ or if format doesn't contain % chars or is "%s". */
+ if (! integer_zerop (flag))
+ {
+ fmt_str = c_getstr (fmt);
+ if (fmt_str == NULL)
+ return NULL_TREE;
+ if (strchr (fmt_str, target_percent) != NULL
+ && strcmp (fmt_str, target_percent_s))
+ return NULL_TREE;
+ }
+
+ /* If __builtin_{,v}snprintf_chk is used, assume {,v}snprintf is
+ available. */
+ fn = built_in_decls[fcode == BUILT_IN_VSNPRINTF_CHK
+ ? BUILT_IN_VSNPRINTF : BUILT_IN_SNPRINTF];
+ if (!fn)
+ return NULL_TREE;
+
+ return gimple_rewrite_call_expr (stmt, 5, fn, 3, dest, len, fmt);
+}
+
+/* Builtins with folding operations that operate on "..." arguments
+ need special handling; we need to store the arguments in a convenient
+ data structure before attempting any folding. Fortunately there are
+ only a few builtins that fall into this category. FNDECL is the
+ function, EXP is the CALL_EXPR for the call, and IGNORE is true if the
+ result of the function call is ignored. */
+
+static tree
+gimple_fold_builtin_varargs (tree fndecl, gimple stmt, bool ignore ATTRIBUTE_UNUSED)
+{
+ enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
+ tree ret = NULL_TREE;
+
+ switch (fcode)
+ {
+ case BUILT_IN_SPRINTF_CHK:
+ case BUILT_IN_VSPRINTF_CHK:
+ ret = gimple_fold_builtin_sprintf_chk (stmt, fcode);
+ break;
+
+ case BUILT_IN_SNPRINTF_CHK:
+ case BUILT_IN_VSNPRINTF_CHK:
+ ret = gimple_fold_builtin_snprintf_chk (stmt, NULL_TREE, fcode);
+
+ default:
+ break;
+ }
+ if (ret)
+ {
+ ret = build1 (NOP_EXPR, TREE_TYPE (ret), ret);
+ TREE_NO_WARNING (ret) = 1;
+ return ret;
+ }
+ return NULL_TREE;
+}
+
+/* A wrapper function for builtin folding that prevents warnings for
+ "statement without effect" and the like, caused by removing the
+ call node earlier than the warning is generated. */
+
+tree
+fold_call_stmt (gimple stmt, bool ignore)
+{
+ tree ret = NULL_TREE;
+ tree fndecl = gimple_call_fndecl (stmt);
+ if (fndecl
+ && TREE_CODE (fndecl) == FUNCTION_DECL
+ && DECL_BUILT_IN (fndecl)
+ && !gimple_call_va_arg_pack_p (stmt))
+ {
+ int nargs = gimple_call_num_args (stmt);
+
+ /* FIXME: Don't use a list in this interface. */
+ if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD)
+ {
+ tree arglist = NULL_TREE;
+ int i;
+ for (i = nargs - 1; i >= 0; i--)
+ arglist = tree_cons (NULL_TREE, gimple_call_arg (stmt, i), arglist);
+ return targetm.fold_builtin (fndecl, arglist, ignore);
+ }
+ else
+ {
+ if (nargs <= MAX_ARGS_TO_FOLD_BUILTIN)
+ {
+ tree args[MAX_ARGS_TO_FOLD_BUILTIN];
+ int i;
+ for (i = 0; i < nargs; i++)
+ args[i] = gimple_call_arg (stmt, i);
+ ret = fold_builtin_n (fndecl, args, nargs, ignore);
+ }
+ if (!ret)
+ ret = gimple_fold_builtin_varargs (fndecl, stmt, ignore);
+ if (ret)
+ {
+ /* Propagate location information from original call to
+ expansion of builtin. Otherwise things like
+ maybe_emit_chk_warning, that operate on the expansion
+ of a builtin, will use the wrong location information. */
+ if (gimple_has_location (stmt))
+ {
+ tree realret = ret;
+ if (TREE_CODE (ret) == NOP_EXPR)
+ realret = TREE_OPERAND (ret, 0);
+ if (CAN_HAVE_LOCATION_P (realret)
+ && !EXPR_HAS_LOCATION (realret))
+ SET_EXPR_LOCATION (realret, gimple_location (stmt));
+ return realret;
+ }
+ return ret;
+ }
+ }
+ }
+ return NULL_TREE;
+}
diff --git a/gcc/c-common.c b/gcc/c-common.c
index afdcac65f95..748ab52e1c4 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -48,6 +48,7 @@ along with GCC; see the file COPYING3. If not see
#include "real.h"
#include "cgraph.h"
#include "target-def.h"
+#include "gimple.h"
#include "fixed-value.h"
cpp_reader *parse_in; /* Declared in c-pragma.h. */
@@ -341,10 +342,6 @@ int flag_isoc99;
int flag_hosted = 1;
-/* Warn if main is suspicious. */
-
-int warn_main;
-
/* ObjC language option variables. */
@@ -574,7 +571,7 @@ static tree handle_warn_unused_result_attribute (tree *, tree, tree, int,
static tree handle_sentinel_attribute (tree *, tree, tree, int, bool *);
static tree handle_type_generic_attribute (tree *, tree, tree, int, bool *);
static tree handle_alloc_size_attribute (tree *, tree, tree, int, bool *);
-static tree handle_option_attribute (tree *, tree, tree, int, bool *);
+static tree handle_target_attribute (tree *, tree, tree, int, bool *);
static tree handle_optimize_attribute (tree *, tree, tree, int, bool *);
static void check_function_nonnull (tree, int, tree *);
@@ -597,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[] =
{
@@ -664,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 },
@@ -714,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 },
@@ -859,8 +856,8 @@ const struct attribute_spec c_common_attribute_table[] =
handle_error_attribute },
{ "error", 1, 1, true, false, false,
handle_error_attribute },
- { "option", 1, -1, true, false, false,
- handle_option_attribute },
+ { "target", 1, -1, true, false, false,
+ handle_target_attribute },
{ "optimize", 1, -1, true, false, false,
handle_optimize_attribute },
{ NULL, 0, 0, false, false, false, NULL }
@@ -1047,7 +1044,7 @@ fname_decl (unsigned int rid, tree id)
input_location = saved_location;
}
if (!ix && !current_function_decl)
- pedwarn ("%qD is not defined outside of function scope", decl);
+ pedwarn (input_location, 0, "%qD is not defined outside of function scope", decl);
return decl;
}
@@ -1096,7 +1093,8 @@ 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 ("string length %qd is greater than the length %qd "
+ 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);
}
@@ -1143,7 +1141,7 @@ constant_expression_warning (tree value)
|| TREE_CODE (value) == VECTOR_CST
|| TREE_CODE (value) == COMPLEX_CST)
&& TREE_OVERFLOW (value))
- pedwarn ("overflow in constant expression");
+ pedwarn (input_location, OPT_Woverflow, "overflow in constant expression");
}
/* The same as above but print an unconditional error. */
@@ -1361,7 +1359,8 @@ check_main_parameter_types (tree decl)
{
case 1:
if (TYPE_MAIN_VARIANT (type) != integer_type_node)
- pedwarn ("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:
@@ -1369,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 ("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:
@@ -1378,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 ("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;
}
}
@@ -1388,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 ("%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
@@ -1437,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");
}
@@ -1445,6 +1444,110 @@ vector_types_convertible_p (const_tree t1, const_tree t2, bool emit_lax_note)
return false;
}
+/* This is a helper function of build_binary_op.
+
+ For certain operations if both args were extended from the same
+ smaller type, do the arithmetic in that type and then extend.
+
+ BITWISE indicates a bitwise operation.
+ For them, this optimization is safe only if
+ both args are zero-extended or both are sign-extended.
+ Otherwise, we might change the result.
+ Eg, (short)-1 | (unsigned short)-1 is (int)-1
+ but calculated in (unsigned short) it would be (unsigned short)-1.
+*/
+tree shorten_binary_op (tree result_type, tree op0, tree op1, bool bitwise)
+{
+ int unsigned0, unsigned1;
+ tree arg0, arg1;
+ int uns;
+ tree type;
+
+ /* Cast OP0 and OP1 to RESULT_TYPE. Doing so prevents
+ excessive narrowing when we call get_narrower below. For
+ example, suppose that OP0 is of unsigned int extended
+ from signed char and that RESULT_TYPE is long long int.
+ If we explicitly cast OP0 to RESULT_TYPE, OP0 would look
+ like
+
+ (long long int) (unsigned int) signed_char
+
+ which get_narrower would narrow down to
+
+ (unsigned int) signed char
+
+ If we do not cast OP0 first, get_narrower would return
+ signed_char, which is inconsistent with the case of the
+ explicit cast. */
+ op0 = convert (result_type, op0);
+ op1 = convert (result_type, op1);
+
+ arg0 = get_narrower (op0, &unsigned0);
+ arg1 = get_narrower (op1, &unsigned1);
+
+ /* UNS is 1 if the operation to be done is an unsigned one. */
+ uns = TYPE_UNSIGNED (result_type);
+
+ /* Handle the case that OP0 (or OP1) does not *contain* a conversion
+ but it *requires* conversion to FINAL_TYPE. */
+
+ if ((TYPE_PRECISION (TREE_TYPE (op0))
+ == TYPE_PRECISION (TREE_TYPE (arg0)))
+ && TREE_TYPE (op0) != result_type)
+ unsigned0 = TYPE_UNSIGNED (TREE_TYPE (op0));
+ if ((TYPE_PRECISION (TREE_TYPE (op1))
+ == TYPE_PRECISION (TREE_TYPE (arg1)))
+ && TREE_TYPE (op1) != result_type)
+ unsigned1 = TYPE_UNSIGNED (TREE_TYPE (op1));
+
+ /* Now UNSIGNED0 is 1 if ARG0 zero-extends to FINAL_TYPE. */
+
+ /* For bitwise operations, signedness of nominal type
+ does not matter. Consider only how operands were extended. */
+ if (bitwise)
+ uns = unsigned0;
+
+ /* Note that in all three cases below we refrain from optimizing
+ an unsigned operation on sign-extended args.
+ That would not be valid. */
+
+ /* Both args variable: if both extended in same way
+ from same width, do it in that width.
+ Do it unsigned if args were zero-extended. */
+ if ((TYPE_PRECISION (TREE_TYPE (arg0))
+ < TYPE_PRECISION (result_type))
+ && (TYPE_PRECISION (TREE_TYPE (arg1))
+ == TYPE_PRECISION (TREE_TYPE (arg0)))
+ && unsigned0 == unsigned1
+ && (unsigned0 || !uns))
+ return c_common_signed_or_unsigned_type
+ (unsigned0, common_type (TREE_TYPE (arg0), TREE_TYPE (arg1)));
+
+ else if (TREE_CODE (arg0) == INTEGER_CST
+ && (unsigned1 || !uns)
+ && (TYPE_PRECISION (TREE_TYPE (arg1))
+ < TYPE_PRECISION (result_type))
+ && (type
+ = c_common_signed_or_unsigned_type (unsigned1,
+ TREE_TYPE (arg1)))
+ && !POINTER_TYPE_P (type)
+ && int_fits_type_p (arg0, type))
+ return type;
+
+ else if (TREE_CODE (arg1) == INTEGER_CST
+ && (unsigned0 || !uns)
+ && (TYPE_PRECISION (TREE_TYPE (arg0))
+ < TYPE_PRECISION (result_type))
+ && (type
+ = c_common_signed_or_unsigned_type (unsigned0,
+ TREE_TYPE (arg0)))
+ && !POINTER_TYPE_P (type)
+ && int_fits_type_p (arg1, type))
+ return type;
+
+ return result_type;
+}
+
/* Warns if the conversion of EXPR to TYPE may alter a value.
This is a helper function for warnings_for_convert_and_check. */
@@ -1453,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 (op && 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))
@@ -1493,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))
@@ -1505,48 +1643,114 @@ 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. */
- {
+ 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 (TREE_TYPE (expr)) == REAL_TYPE
+ if (TREE_CODE (expr_type) == REAL_TYPE
&& TREE_CODE (type) == INTEGER_TYPE)
give_warning = true;
- else if (TREE_CODE (TREE_TYPE (expr)) == INTEGER_TYPE
+ else if (TREE_CODE (expr_type) == INTEGER_TYPE
&& TREE_CODE (type) == INTEGER_TYPE)
{
/* Don't warn about unsigned char y = 0xff, x = (int) y; */
expr = get_unwidened (expr, 0);
+ expr_type = TREE_TYPE (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_XOR_EXPR)
+ {
+ /* 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 (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))))
+ 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 (TREE_TYPE (expr)))
+ 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 (TREE_TYPE (expr))
- && TYPE_UNSIGNED (TREE_TYPE (expr)) != TYPE_UNSIGNED (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 (TREE_TYPE (expr))))
- warning (OPT_Wsign_conversion,
- "conversion to %qT from %qT may change the sign of the result",
- type, TREE_TYPE (expr));
+ || (TYPE_UNSIGNED (type) && !TYPE_UNSIGNED (expr_type)))
+ warning (OPT_Wsign_conversion, "conversion to %qT from %qT "
+ "may change the sign of the result",
+ type, expr_type);
}
/* Warn for integer types converted to real types if and only if
all the range of values of the integer type cannot be
represented by the real type. */
- else if (TREE_CODE (TREE_TYPE (expr)) == INTEGER_TYPE
+ else if (TREE_CODE (expr_type) == INTEGER_TYPE
&& TREE_CODE (type) == REAL_TYPE)
{
- tree type_low_bound = TYPE_MIN_VALUE (TREE_TYPE (expr));
- tree type_high_bound = TYPE_MAX_VALUE (TREE_TYPE (expr));
- 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);
+ 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);
if (!exact_real_truncate (TYPE_MODE (type), &real_low_bound)
|| !exact_real_truncate (TYPE_MODE (type), &real_high_bound))
@@ -1554,16 +1758,16 @@ conversion_warning (tree type, tree expr)
}
/* Warn for real types converted to smaller real types. */
- else if (TREE_CODE (TREE_TYPE (expr)) == REAL_TYPE
+ else if (TREE_CODE (expr_type) == REAL_TYPE
&& TREE_CODE (type) == REAL_TYPE
- && formal_prec < TYPE_PRECISION (TREE_TYPE (expr)))
+ && TYPE_PRECISION (type) < TYPE_PRECISION (expr_type))
give_warning = true;
if (give_warning)
warning (OPT_Wconversion,
"conversion to %qT from %qT may alter its value",
- type, TREE_TYPE (expr));
+ type, expr_type);
}
}
@@ -1765,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;
}
@@ -1983,6 +2189,13 @@ verify_tree (tree x, struct tlist **pbefore_sp, struct tlist **pno_sp,
return;
}
+ case ADDR_EXPR:
+ x = TREE_OPERAND (x, 0);
+ if (DECL_P (x))
+ return;
+ writer = 0;
+ goto restart;
+
default:
/* For other expressions, simply recurse on their operands.
Manual tail recursion for unary expressions.
@@ -3079,20 +3292,20 @@ pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop)
if (TREE_CODE (TREE_TYPE (result_type)) == VOID_TYPE)
{
- if (pedantic || warn_pointer_arith)
- pedwarn ("pointer of type %<void *%> used in arithmetic");
+ 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)
{
- if (pedantic || warn_pointer_arith)
- pedwarn ("pointer to a function used in arithmetic");
+ 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)
{
- if (pedantic || warn_pointer_arith)
- pedwarn ("pointer to member function used in arithmetic");
+ pedwarn (input_location, pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ "pointer to member function used in arithmetic");
size_exp = integer_one_node;
}
else
@@ -3600,7 +3813,8 @@ c_sizeof_or_alignof_type (tree type, bool is_sizeof, int complain)
if (is_sizeof)
{
if (complain && (pedantic || warn_pointer_arith))
- pedwarn ("invalid application of %<sizeof%> to a function type");
+ pedwarn (input_location, pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ "invalid application of %<sizeof%> to a function type");
else if (!complain)
return error_mark_node;
value = size_one_node;
@@ -3612,7 +3826,8 @@ c_sizeof_or_alignof_type (tree type, bool is_sizeof, int complain)
{
if (type_code == VOID_TYPE
&& complain && (pedantic || warn_pointer_arith))
- pedwarn ("invalid application of %qs to a void type", op_name);
+ 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;
value = size_one_node;
@@ -4478,8 +4693,9 @@ c_add_case_label (splay_tree cases, tree cond, tree orig_type,
}
/* Case ranges are a GNU extension. */
- if (high_value && pedantic)
- pedwarn ("range expressions in switch statements are non-standard");
+ if (high_value)
+ pedwarn (input_location, OPT_pedantic,
+ "range expressions in switch statements are non-standard");
type = TREE_TYPE (cond);
if (low_value)
@@ -4719,6 +4935,8 @@ c_do_switch_warnings (splay_tree cases, location_t switch_location,
for (chain = TYPE_VALUES (type); chain; chain = TREE_CHAIN (chain))
{
tree value = TREE_VALUE (chain);
+ if (TREE_CODE (value) == CONST_DECL)
+ value = DECL_INITIAL (value);
node = splay_tree_lookup (cases, (splay_tree_key) value);
if (node)
{
@@ -4792,8 +5010,7 @@ finish_label_address_expr (tree label)
{
tree result;
- if (pedantic)
- pedwarn ("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;
@@ -5043,32 +5260,6 @@ handle_hot_attribute (tree *node, tree name, tree ARG_UNUSED (args),
name, "cold");
*no_add_attrs = true;
}
-
- else
- {
- tree old_opts = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node);
-
- /* If we are not at -O3, but are optimizing, turn on -O3
- optimizations just for this one function. */
- if (((optimize > 0 && optimize < 3) || optimize_size)
- && (!old_opts || old_opts == optimization_default_node))
- {
- /* Create the hot optimization node if needed. */
- if (!optimization_hot_node)
- {
- struct cl_optimization current_options;
- static const char *os_argv[] = { NULL, "-O3", NULL };
-
- cl_optimization_save (&current_options);
- decode_options (2, os_argv);
- optimization_hot_node = build_optimization_node ();
- cl_optimization_restore (&current_options);
- }
-
- DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node)
- = optimization_hot_node;
- }
- }
/* Most of the rest of the hot processing is done later with
lookup_attribute. */
}
@@ -5095,31 +5286,8 @@ handle_cold_attribute (tree *node, tree name, tree ARG_UNUSED (args),
name, "hot");
*no_add_attrs = true;
}
- else
- {
- tree old_opts = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node);
-
- /* If we are optimizing, but not optimizing for space, turn on -Os
- optimizations just for this one function. */
- if (optimize && !optimize_size
- && (!old_opts || old_opts == optimization_default_node))
- {
- /* Create the cold optimization node if needed. */
- if (!optimization_cold_node)
- {
- struct cl_optimization current_options;
- static const char *os_argv[] = { NULL, "-Os", NULL };
-
- cl_optimization_save (&current_options);
- decode_options (2, os_argv);
- optimization_cold_node = build_optimization_node ();
- cl_optimization_restore (&current_options);
- }
-
- DECL_FUNCTION_SPECIFIC_OPTIMIZATION (*node)
- = optimization_cold_node;
- }
- }
+ /* Most of the rest of the cold processing is done later with
+ lookup_attribute. */
}
else
{
@@ -6818,11 +6986,10 @@ handle_type_generic_attribute (tree *node, tree ARG_UNUSED (name),
return NULL_TREE;
}
-/* For handling "option" attribute. arguments as in
- struct attribute_spec.handler. */
+/* Handle a "target" attribute. */
static tree
-handle_option_attribute (tree *node, tree name, tree args, int flags,
+handle_target_attribute (tree *node, tree name, tree args, int flags,
bool *no_add_attrs)
{
/* Ensure we have a function type. */
@@ -6831,14 +6998,6 @@ handle_option_attribute (tree *node, tree name, tree args, int flags,
warning (OPT_Wattributes, "%qE attribute ignored", name);
*no_add_attrs = true;
}
- else if (targetm.target_option.valid_attribute_p
- == default_target_option_valid_attribute_p)
- {
- warning (OPT_Wattributes,
- "%qE attribute is not supported on this machine",
- name);
- *no_add_attrs = true;
- }
else if (! targetm.target_option.valid_attribute_p (*node, name, args,
flags))
*no_add_attrs = true;
@@ -7370,71 +7529,60 @@ c_parse_error (const char *gmsgid, enum cpp_ttype token, tree value)
inlining, so we don't have to worry about that. */
void
-c_warn_unused_result (tree *top_p)
+c_warn_unused_result (gimple_seq seq)
{
- tree t = *top_p;
- tree_stmt_iterator i;
tree fdecl, ftype;
+ gimple_stmt_iterator i;
- switch (TREE_CODE (t))
+ for (i = gsi_start (seq); !gsi_end_p (i); gsi_next (&i))
{
- case STATEMENT_LIST:
- for (i = tsi_start (*top_p); !tsi_end_p (i); tsi_next (&i))
- c_warn_unused_result (tsi_stmt_ptr (i));
- break;
+ gimple g = gsi_stmt (i);
- case COND_EXPR:
- c_warn_unused_result (&COND_EXPR_THEN (t));
- c_warn_unused_result (&COND_EXPR_ELSE (t));
- break;
- case BIND_EXPR:
- c_warn_unused_result (&BIND_EXPR_BODY (t));
- break;
- case TRY_FINALLY_EXPR:
- case TRY_CATCH_EXPR:
- c_warn_unused_result (&TREE_OPERAND (t, 0));
- c_warn_unused_result (&TREE_OPERAND (t, 1));
- break;
- case CATCH_EXPR:
- c_warn_unused_result (&CATCH_BODY (t));
- break;
- case EH_FILTER_EXPR:
- c_warn_unused_result (&EH_FILTER_FAILURE (t));
- break;
+ switch (gimple_code (g))
+ {
+ case GIMPLE_BIND:
+ c_warn_unused_result (gimple_bind_body (g));
+ break;
+ case GIMPLE_TRY:
+ c_warn_unused_result (gimple_try_eval (g));
+ c_warn_unused_result (gimple_try_cleanup (g));
+ break;
+ case GIMPLE_CATCH:
+ c_warn_unused_result (gimple_catch_handler (g));
+ break;
+ case GIMPLE_EH_FILTER:
+ c_warn_unused_result (gimple_eh_filter_failure (g));
+ break;
- case CALL_EXPR:
- if (TREE_USED (t))
- break;
+ case GIMPLE_CALL:
+ if (gimple_call_lhs (g))
+ break;
- /* This is a naked call, as opposed to a CALL_EXPR nested inside
- a MODIFY_EXPR. All calls whose value is ignored should be
- represented like this. Look for the attribute. */
- fdecl = get_callee_fndecl (t);
- if (fdecl)
- ftype = TREE_TYPE (fdecl);
- else
- {
- ftype = TREE_TYPE (CALL_EXPR_FN (t));
- /* Look past pointer-to-function to the function type itself. */
- ftype = TREE_TYPE (ftype);
- }
+ /* 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_fndecl (g);
+ ftype = TREE_TYPE (TREE_TYPE (gimple_call_fn (g)));
- if (lookup_attribute ("warn_unused_result", TYPE_ATTRIBUTES (ftype)))
- {
- if (fdecl)
- warning (0, "%Hignoring return value of %qD, "
- "declared with attribute warn_unused_result",
- EXPR_LOCUS (t), fdecl);
- else
- warning (0, "%Hignoring return value of function "
- "declared with attribute warn_unused_result",
- EXPR_LOCUS (t));
- }
- break;
+ if (lookup_attribute ("warn_unused_result", TYPE_ATTRIBUTES (ftype)))
+ {
+ location_t loc = gimple_location (g);
- default:
- /* Not a container, not a call, or a call whose value is used. */
- break;
+ if (fdecl)
+ warning (0, "%Hignoring return value of %qD, "
+ "declared with attribute warn_unused_result",
+ &loc, fdecl);
+ else
+ warning (0, "%Hignoring return value of function "
+ "declared with attribute warn_unused_result",
+ &loc);
+ }
+ break;
+
+ default:
+ /* Not a container, not a call, or a call whose value is used. */
+ break;
+ }
}
}
@@ -7483,6 +7631,7 @@ fold_offsetof_1 (tree expr, tree stop_ref)
return error_mark_node;
case CALL_EXPR:
+ case TARGET_EXPR:
error ("cannot apply %<offsetof%> when %<operator[]%> is overloaded");
return error_mark_node;
@@ -8064,4 +8213,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 9850dfa94d0..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. */
@@ -743,6 +738,9 @@ extern bool same_scalar_type_ignoring_signedness (tree, tree);
#define c_sizeof(T) c_sizeof_or_alignof_type (T, true, 1)
#define c_alignof(T) c_sizeof_or_alignof_type (T, false, 1)
+/* Subroutine of build_binary_op, used for certain operations. */
+extern tree shorten_binary_op (tree result_type, tree op0, tree op1, bool bitwise);
+
/* Subroutine of build_binary_op, used for comparison operations.
See if the operands have both been converted from subword integer types
and, if so, perhaps change them both back to their original type. */
@@ -897,7 +895,7 @@ extern void dump_time_statistics (void);
extern bool c_dump_tree (void *, tree);
-extern void c_warn_unused_result (tree *);
+extern void c_warn_unused_result (gimple_seq);
extern void verify_sequence_points (tree);
@@ -925,10 +923,14 @@ 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);
-extern int c_gimplify_expr (tree *, tree *, tree *);
+extern int c_gimplify_expr (tree *, gimple_seq *, gimple_seq *);
extern tree c_build_bind_expr (tree, tree);
/* In c-pch.c */
diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c
index 57d00580d24..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"
@@ -636,7 +637,7 @@ c_cpp_builtins (cpp_reader *pfile)
if (fast_math_flags_set_p ())
cpp_define (pfile, "__FAST_MATH__");
- if (flag_really_no_inline)
+ if (flag_no_inline)
cpp_define (pfile, "__NO_INLINE__");
if (flag_signaling_nans)
cpp_define (pfile, "__SUPPORT_SNAN__");
@@ -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 80ec48f61af..5a60063c2bd 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -52,7 +52,8 @@ along with GCC; see the file COPYING3. If not see
#include "c-pragma.h"
#include "langhooks.h"
#include "tree-mudflap.h"
-#include "tree-gimple.h"
+#include "gimple.h"
+#include "tree-iterator.h"
#include "diagnostic.h"
#include "tree-dump.h"
#include "cgraph.h"
@@ -61,6 +62,7 @@ along with GCC; see the file COPYING3. If not see
#include "except.h"
#include "langhooks-def.h"
#include "pointer-set.h"
+#include "gimple.h"
/* In grokdeclarator, distinguish syntactic contexts of declarators. */
enum decl_context
@@ -248,7 +250,7 @@ extern char C_SIZEOF_STRUCT_LANG_IDENTIFIER_isnt_accurate
union lang_tree_node
GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"),
- chain_next ("TREE_CODE (&%h.generic) == INTEGER_TYPE ? (union lang_tree_node *) TYPE_NEXT_VARIANT (&%h.generic) : ((union lang_tree_node *) GENERIC_NEXT (&%h.generic))")))
+ chain_next ("TREE_CODE (&%h.generic) == INTEGER_TYPE ? (union lang_tree_node *) TYPE_NEXT_VARIANT (&%h.generic) : ((union lang_tree_node *) TREE_CHAIN (&%h.generic))")))
{
union tree_node GTY ((tag ("0"),
desc ("tree_node_structure (&%h)")))
@@ -786,7 +788,7 @@ pop_scope (void)
&& TREE_PUBLIC (p)
&& !DECL_INITIAL (p)
&& !flag_gnu89_inline)
- pedwarn ("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;
@@ -1027,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;
}
@@ -1113,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.
@@ -1163,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",
@@ -1179,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;
}
@@ -1223,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 ("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). */
@@ -1236,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 ("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
{
@@ -1248,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;
}
}
@@ -1265,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;
}
@@ -1316,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;
}
}
@@ -1328,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
@@ -1352,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;
}
@@ -1362,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);
}
}
@@ -1410,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;
}
@@ -1418,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;
}
@@ -1439,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
@@ -1458,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;
}
}
@@ -1475,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;
@@ -1493,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)
@@ -1504,40 +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;
- }
-
- /* Inline declaration after use or definition.
- ??? Should we still warn about this now we have unit-at-a-time
- mode and can get it right?
- Definitely don't complain if the decls are in different translation
- units.
- C99 permits this, so don't warn in that case. (The function
- may not be inlined everywhere in function-at-a-time mode, but
- we still shouldn't warn.) */
- if (DECL_DECLARED_INLINE_P (newdecl) && !DECL_DECLARED_INLINE_P (olddecl)
- && same_translation_unit_p (olddecl, newdecl)
- && flag_gnu89_inline)
- {
- if (TREE_USED (olddecl))
- {
- warning (0, "%q+D declared inline after being called", olddecl);
- warned = true;
- }
- else if (DECL_INITIAL (olddecl))
- {
- warning (0, "%q+D declared inline after its definition", olddecl);
- warned = true;
- }
+ warned |= warning (OPT_Wattributes,
+ "declaration of %q+D with attribute "
+ "noinline follows inline declaration ", newdecl);
}
}
else /* PARM_DECL, VAR_DECL */
@@ -1555,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;
}
}
@@ -1581,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 ? pedwarn : warning0);
+ locate_old_decl (olddecl);
#undef DECL_EXTERN_INLINE
@@ -1801,14 +1777,13 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
if (new_is_definition && DECL_INITIAL (olddecl))
{
if (TREE_USED (olddecl)
- /* In unit-at-a-time mode we never inline re-defined extern
- inline functions. */
- && !flag_unit_at_a_time
+ /* We never inline re-defined extern inline functions.
+ FIXME: This would be better handled by keeping both functions
+ as separate declarations. */
&& cgraph_function_possibly_inlined_p (olddecl))
(*debug_hooks->outlining_inline_function) (olddecl);
/* The new defn must not be inline. */
- DECL_INLINE (newdecl) = 0;
DECL_UNINLINABLE (newdecl) = 1;
}
else
@@ -1860,29 +1835,24 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl);
DECL_STRUCT_FUNCTION (newdecl) = DECL_STRUCT_FUNCTION (olddecl);
DECL_SAVED_TREE (newdecl) = DECL_SAVED_TREE (olddecl);
+ gimple_set_body (newdecl, gimple_body (olddecl));
DECL_ARGUMENTS (newdecl) = DECL_ARGUMENTS (olddecl);
- /* Set DECL_INLINE on the declaration if we've got a body
- from which to instantiate. */
- if (DECL_INLINE (olddecl) && !DECL_UNINLINABLE (newdecl))
- {
- DECL_INLINE (newdecl) = 1;
- DECL_ABSTRACT_ORIGIN (newdecl)
- = DECL_ABSTRACT_ORIGIN (olddecl);
- }
- }
- else
- {
- /* If a previous declaration said inline, mark the
- definition as inlinable. */
- if (DECL_DECLARED_INLINE_P (newdecl)
- && !DECL_UNINLINABLE (newdecl))
- DECL_INLINE (newdecl) = 1;
+ /* See if we've got a function to instantiate from. */
+ if (DECL_SAVED_TREE (olddecl))
+ DECL_ABSTRACT_ORIGIN (newdecl)
+ = DECL_ABSTRACT_ORIGIN (olddecl);
}
}
extern_changed = DECL_EXTERNAL (olddecl) && !DECL_EXTERNAL (newdecl);
+ /* Merge the USED information. */
+ if (TREE_USED (olddecl))
+ TREE_USED (newdecl) = 1;
+ else if (TREE_USED (newdecl))
+ TREE_USED (olddecl) = 1;
+
/* Copy most of the decl-specific fields of NEWDECL into OLDDECL.
But preserve OLDDECL's DECL_UID and DECL_CONTEXT. */
{
@@ -1894,6 +1864,10 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
sizeof (struct tree_decl_common) - sizeof (struct tree_common));
switch (TREE_CODE (olddecl))
{
+ case FUNCTION_DECL:
+ gimple_set_body (olddecl, gimple_body (newdecl));
+ /* fall through */
+
case FIELD_DECL:
case VAR_DECL:
case PARM_DECL:
@@ -1901,7 +1875,6 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
case RESULT_DECL:
case CONST_DECL:
case TYPE_DECL:
- case FUNCTION_DECL:
memcpy ((char *) olddecl + sizeof (struct tree_decl_common),
(char *) newdecl + sizeof (struct tree_decl_common),
tree_code_size (TREE_CODE (olddecl)) - sizeof (struct tree_decl_common));
@@ -2355,13 +2328,16 @@ implicit_decl_warning (tree id, tree olddecl)
{
if (warn_implicit_function_declaration)
{
+ bool warned;
+
if (flag_isoc99)
- pedwarn (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);
}
}
@@ -2432,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);
@@ -2574,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;
@@ -2610,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)
@@ -2867,6 +2843,31 @@ c_builtin_function (tree decl)
return decl;
}
+
+tree
+c_builtin_function_ext_scope (tree decl)
+{
+ tree type = TREE_TYPE (decl);
+ tree id = DECL_NAME (decl);
+
+ const char *name = IDENTIFIER_POINTER (id);
+ C_DECL_BUILTIN_PROTOTYPE (decl) = (TYPE_ARG_TYPES (type) != 0);
+
+ /* Should never be called on a symbol with a preexisting meaning. */
+ gcc_assert (!I_SYMBOL_BINDING (id));
+
+ bind (id, decl, external_scope, /*invisible=*/false, /*nested=*/false);
+
+ /* Builtins in the implementation namespace are made visible without
+ needing to be explicitly declared. See push_file_scope. */
+ if (name[0] == '_' && (name[1] == '_' || ISUPPER (name[1])))
+ {
+ TREE_CHAIN (decl) = visible_builtins;
+ visible_builtins = decl;
+ }
+
+ return decl;
+}
/* Called when a declaration is seen that contains no names to declare.
If its type is a reference to a structure, union or enum inherited
@@ -2908,7 +2909,8 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
if (warned != 1 && code != ENUMERAL_TYPE)
/* Empty unnamed enum OK */
{
- pedwarn ("unnamed struct/union that defines no instances");
+ pedwarn (input_location, 0,
+ "unnamed struct/union that defines no instances");
warned = 1;
}
}
@@ -2916,7 +2918,8 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
&& declspecs->storage_class != csc_none)
{
if (warned != 1)
- pedwarn ("empty declaration with storage class specifier "
+ pedwarn (input_location, 0,
+ "empty declaration with storage class specifier "
"does not redeclare tag");
warned = 1;
pending_xref_error ();
@@ -2927,8 +2930,9 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
|| declspecs->restrict_p))
{
if (warned != 1)
- pedwarn ("empty declaration with type qualifier "
- "does not redeclare tag");
+ pedwarn (input_location, 0,
+ "empty declaration with type qualifier "
+ "does not redeclare tag");
warned = 1;
pending_xref_error ();
}
@@ -2948,14 +2952,15 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
{
if (warned != 1 && !in_system_header)
{
- pedwarn ("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 ("useless type name in empty declaration");
+ pedwarn (input_location, 0, "useless type name in empty declaration");
warned = 1;
}
@@ -3002,7 +3007,7 @@ shadow_tag_warned (const struct c_declspecs *declspecs, int warned)
if (warned != 1)
{
if (!found_tag)
- pedwarn ("empty declaration");
+ pedwarn (input_location, 0, "empty declaration");
}
}
@@ -3065,13 +3070,15 @@ build_array_declarator (tree expr, struct c_declspecs *quals, bool static_p,
}
declarator->u.array.static_p = static_p;
declarator->u.array.vla_unspec_p = vla_unspec_p;
- if (pedantic && !flag_isoc99)
+ if (!flag_isoc99)
{
if (static_p || quals != NULL)
- pedwarn ("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 ("ISO C90 does not support %<[*]%> array declarators");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C90 does not support %<[*]%> array declarators");
}
if (vla_unspec_p)
{
@@ -3179,8 +3186,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)
@@ -3327,7 +3333,8 @@ 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 ("%q+D is static but declared in inline function %qD "
+ 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.
@@ -3617,10 +3624,6 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
}
}
- /* If this was marked 'used', be sure it will be output. */
- if (!flag_unit_at_a_time && lookup_attribute ("used", DECL_ATTRIBUTES (decl)))
- mark_decl_referenced (decl);
-
if (TREE_CODE (decl) == TYPE_DECL)
{
if (!DECL_FILE_SCOPE_P (decl)
@@ -3705,7 +3708,8 @@ mark_forward_parm_decls (void)
if (pedantic && !current_scope->warned_forward_parm_decls)
{
- pedwarn ("ISO C forbids forward parameter declarations");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids forward parameter declarations");
current_scope->warned_forward_parm_decls = true;
}
@@ -3852,12 +3856,12 @@ check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name)
}
type_mv = TYPE_MAIN_VARIANT (*type);
- if (pedantic
- && !in_system_header
+ if (!in_system_header
&& type_mv != integer_type_node
&& type_mv != unsigned_type_node
&& type_mv != boolean_type_node)
- pedwarn ("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);
@@ -3887,28 +3891,27 @@ check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name)
static void
warn_variable_length_array (const char *name, tree size)
{
- int ped = !flag_isoc99 && pedantic && warn_vla != 0;
int const_size = TREE_CONSTANT (size);
- if (ped)
+ if (!flag_isoc99 && pedantic && warn_vla != 0)
{
if (const_size)
{
if (name)
- pedwarn ("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 ("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 ("ISO C90 forbids variable length array %qs",
+ pedwarn (input_location, OPT_Wvla, "ISO C90 forbids variable length array %qs",
name);
else
- pedwarn ("ISO C90 forbids variable length array");
+ pedwarn (input_location, OPT_Wvla, "ISO C90 forbids variable length array");
}
}
else if (warn_vla > 0)
@@ -4069,8 +4072,9 @@ grokdeclarator (const struct c_declarator *declarator,
if ((warn_implicit_int || warn_return_type || flag_isoc99)
&& funcdef_flag)
warn_about_return_type = 1;
- else if (warn_implicit_int || flag_isoc99)
- pedwarn_c99 ("type defaults to %<int%> in declaration of %qs", name);
+ else
+ pedwarn_c99 (input_location, flag_isoc99 ? 0 : OPT_Wimplicit_int,
+ "type defaults to %<int%> in declaration of %qs", name);
}
/* Adjust the type if a bit-field is being declared,
@@ -4078,7 +4082,7 @@ grokdeclarator (const struct c_declarator *declarator,
"signed". */
if (bitfield && !flag_signed_bitfields && !declspecs->explicit_signed_p
&& TREE_CODE (type) == INTEGER_TYPE)
- type = c_common_unsigned_type (type);
+ type = unsigned_type_for (type);
/* Figure out the type qualifiers for the declaration. There are
two ways a declaration can become qualified. One is something
@@ -4098,11 +4102,11 @@ grokdeclarator (const struct c_declarator *declarator,
if (pedantic && !flag_isoc99)
{
if (constp > 1)
- pedwarn ("duplicate %<const%>");
+ pedwarn (input_location, OPT_pedantic, "duplicate %<const%>");
if (restrictp > 1)
- pedwarn ("duplicate %<restrict%>");
+ pedwarn (input_location, OPT_pedantic, "duplicate %<restrict%>");
if (volatilep > 1)
- pedwarn ("duplicate %<volatile%>");
+ pedwarn (input_location, OPT_pedantic, "duplicate %<volatile%>");
}
if (!flag_gen_aux_info && (TYPE_QUALS (element_type)))
type = TYPE_MAIN_VARIANT (type);
@@ -4119,9 +4123,10 @@ grokdeclarator (const struct c_declarator *declarator,
|| storage_class == csc_register
|| storage_class == csc_typedef))
{
- if (storage_class == csc_auto
- && (pedantic || current_scope == file_scope))
- pedwarn ("function definition declared %<auto%>");
+ if (storage_class == csc_auto)
+ pedwarn (input_location,
+ (current_scope == file_scope) ? 0 : OPT_pedantic,
+ "function definition declared %<auto%>");
if (storage_class == csc_register)
error ("function definition declared %<register%>");
if (storage_class == csc_typedef)
@@ -4177,7 +4182,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 ("file-scope declaration of %qs specifies %<register%>", name);
+ pedwarn (input_location, OPT_pedantic,
+ "file-scope declaration of %qs specifies %<register%>", name);
}
else
{
@@ -4290,7 +4296,8 @@ grokdeclarator (const struct c_declarator *declarator,
}
if (pedantic && !in_system_header && flexible_array_type_p (type))
- pedwarn ("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;
@@ -4315,7 +4322,8 @@ grokdeclarator (const struct c_declarator *declarator,
}
if (pedantic && integer_zerop (size))
- pedwarn ("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)
{
@@ -4387,7 +4395,8 @@ grokdeclarator (const struct c_declarator *declarator,
else if (decl_context == FIELD)
{
if (pedantic && !flag_isoc99 && !in_system_header)
- pedwarn ("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. */
@@ -4532,7 +4541,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 ("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");
@@ -4564,7 +4574,8 @@ grokdeclarator (const struct c_declarator *declarator,
if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
&& type_quals)
- pedwarn ("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;
@@ -4645,7 +4656,8 @@ grokdeclarator (const struct c_declarator *declarator,
tree decl;
if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
&& type_quals)
- pedwarn ("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);
@@ -4653,7 +4665,7 @@ grokdeclarator (const struct c_declarator *declarator,
if (declspecs->explicit_signed_p)
C_TYPEDEF_EXPLICITLY_SIGNED (decl) = 1;
if (declspecs->inline_p)
- pedwarn ("typedef %q+D declared %<inline%>", decl);
+ pedwarn (input_location, 0,"typedef %q+D declared %<inline%>", decl);
return decl;
}
@@ -4668,7 +4680,8 @@ grokdeclarator (const struct c_declarator *declarator,
&& !declspecs->inline_p);
if (pedantic && TREE_CODE (type) == FUNCTION_TYPE
&& type_quals)
- pedwarn ("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;
@@ -4678,7 +4691,8 @@ grokdeclarator (const struct c_declarator *declarator,
&& variably_modified_type_p (type, NULL_TREE))
{
/* C99 6.7.2.1p8 */
- pedwarn ("a member of a structure or union cannot have a variably modified type");
+ pedwarn (input_location, OPT_pedantic,
+ "a member of a structure or union cannot have a variably modified type");
}
/* Aside from typedefs and type names (handle above),
@@ -4731,8 +4745,9 @@ grokdeclarator (const struct c_declarator *declarator,
}
else if (TREE_CODE (type) == FUNCTION_TYPE)
{
- if (pedantic && type_quals)
- pedwarn ("ISO C forbids qualified function types");
+ if (type_quals)
+ 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);
@@ -4758,7 +4773,7 @@ grokdeclarator (const struct c_declarator *declarator,
DECL_ARG_TYPE (decl) = promoted_type;
if (declspecs->inline_p)
- pedwarn ("parameter %q+D declared %<inline%>", decl);
+ pedwarn (input_location, 0, "parameter %q+D declared %<inline%>", decl);
}
else if (decl_context == FIELD)
{
@@ -4804,10 +4819,7 @@ grokdeclarator (const struct c_declarator *declarator,
GCC allows 'auto', perhaps with 'inline', to support
nested functions. */
if (storage_class == csc_auto)
- {
- if (pedantic)
- pedwarn ("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);
@@ -4823,7 +4835,8 @@ grokdeclarator (const struct c_declarator *declarator,
decl = build_decl_attribute_variant (decl, decl_attr);
if (pedantic && type_quals && !DECL_IN_SYSTEM_HEADER (decl))
- pedwarn ("ISO C forbids qualified function types");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids qualified function types");
/* GNU C interprets a volatile-qualified function type to indicate
that the function does not return. */
@@ -4865,25 +4878,11 @@ grokdeclarator (const struct c_declarator *declarator,
if (flag_hosted && MAIN_NAME_P (declarator->u.id))
{
if (declspecs->inline_p)
- pedwarn ("cannot inline function %<main%>");
+ pedwarn (input_location, 0, "cannot inline function %<main%>");
}
else if (declspecs->inline_p)
- {
- /* Record that the function is declared `inline'. */
- DECL_DECLARED_INLINE_P (decl) = 1;
-
- /* Do not mark bare declarations as DECL_INLINE. Doing so
- in the presence of multiple declarations can result in
- the abstract origin pointing between the declarations,
- which will confuse dwarf2out. */
- if (initialized)
- DECL_INLINE (decl) = 1;
- }
- /* If -finline-functions, assume it can be inlined. This does
- two things: let the function be deferred until it is actually
- needed, and let dwarf2 know that the function is inlinable. */
- else if (flag_inline_trees == 2 && initialized)
- DECL_INLINE (decl) = 1;
+ /* Record that the function is declared `inline'. */
+ DECL_DECLARED_INLINE_P (decl) = 1;
}
else
{
@@ -4918,7 +4917,7 @@ grokdeclarator (const struct c_declarator *declarator,
C_DECL_VARIABLE_SIZE (decl) = 1;
if (declspecs->inline_p)
- pedwarn ("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
@@ -5026,7 +5025,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 ("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;
@@ -5389,12 +5388,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;
@@ -5440,11 +5442,10 @@ grokfield (struct c_declarator *declarator, struct c_declspecs *declspecs,
}
if (!ok)
{
- pedwarn ("declaration does not declare anything");
+ pedwarn (loc, 0, "declaration does not declare anything");
return NULL_TREE;
}
- if (pedantic)
- pedwarn ("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,
@@ -5543,16 +5544,16 @@ finish_struct (tree t, tree fieldlist, tree attributes)
if (TREE_CODE (t) == UNION_TYPE)
{
if (fieldlist)
- pedwarn ("union has no named members");
+ pedwarn (input_location, OPT_pedantic, "union has no named members");
else
- pedwarn ("union has no members");
+ pedwarn (input_location, OPT_pedantic, "union has no members");
}
else
{
if (fieldlist)
- pedwarn ("struct has no named members");
+ pedwarn (input_location, OPT_pedantic, "struct has no named members");
else
- pedwarn ("struct has no members");
+ pedwarn (input_location, OPT_pedantic, "struct has no members");
}
}
}
@@ -5631,7 +5632,8 @@ 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 ("%Jinvalid use of structure with flexible array member", x);
+ pedwarn (input_location, OPT_pedantic,
+ "%Jinvalid use of structure with flexible array member", x);
if (DECL_NAME (x))
saw_named_field = 1;
@@ -5923,11 +5925,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
@@ -5979,7 +5983,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;
@@ -6013,14 +6018,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 ("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,
@@ -6132,7 +6136,9 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
}
if (warn_about_return_type)
- pedwarn_c99 ("return type defaults to %<int%>");
+ pedwarn_c99 (input_location, flag_isoc99 ? 0
+ : (warn_return_type ? OPT_Wreturn_type : OPT_Wimplicit_int),
+ "return type defaults to %<int%>");
/* Make the init_value nonzero so pushdecl knows this is not tentative.
error_mark_node is replaced below (in pop_scope) with the BLOCK. */
@@ -6249,16 +6255,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 ("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 ("%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.
@@ -6406,7 +6412,7 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
warn_if_shadowing (decl);
if (flag_isoc99)
- pedwarn ("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);
}
@@ -6517,22 +6523,19 @@ store_parm_decls_oldstyle (tree fndecl, const struct c_arg_info *arg_info)
< TYPE_PRECISION (integer_type_node))
DECL_ARG_TYPE (parm) = integer_type_node;
- if (pedantic)
+ /* ??? Is it possible to get here with a
+ built-in prototype or will it always have
+ been diagnosed as conflicting with an
+ old-style definition and discarded? */
+ if (current_function_prototype_built_in)
+ warning (OPT_pedantic, "promoted argument %qD "
+ "doesn%'t match built-in prototype", parm);
+ else
{
- /* ??? Is it possible to get here with a
- built-in prototype or will it always have
- been diagnosed as conflicting with an
- old-style definition and discarded? */
- if (current_function_prototype_built_in)
- warning (0, "promoted argument %qD "
- "doesn%'t match built-in prototype", parm);
- else
- {
- pedwarn ("promoted argument %qD "
- "doesn%'t match prototype", parm);
- pedwarn ("%Hprototype declaration",
- &current_function_prototype_locus);
- }
+ pedwarn (input_location, OPT_pedantic, "promoted argument %qD "
+ "doesn%'t match prototype", parm);
+ pedwarn (current_function_prototype_locus, OPT_pedantic,
+ "prototype declaration");
}
}
else
@@ -6667,9 +6670,10 @@ static void
c_gimple_diagnostics_recursively (tree fndecl)
{
struct cgraph_node *cgn;
+ gimple_seq body = gimple_body (fndecl);
/* Handle attribute((warn_unused_result)). Relies on gimple input. */
- c_warn_unused_result (&DECL_SAVED_TREE (fndecl));
+ c_warn_unused_result (body);
/* Notice when OpenMP structured block constraints are violated. */
if (flag_openmp)
@@ -6716,30 +6720,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 ("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. */
@@ -6757,9 +6749,9 @@ finish_function (void)
&& !MAIN_NAME_P (DECL_NAME (fndecl))
/* Or if they didn't actually specify a return type. */
&& !C_FUNCTION_IMPLICIT_INT (fndecl)
- /* Normally, with -Wreturn-type, flow will complain. Unless we're an
- inline function, as we might never be compiled separately. */
- && DECL_INLINE (fndecl))
+ /* Normally, with -Wreturn-type, flow will complain, but we might
+ optimize out static functions. */
+ && !TREE_PUBLIC (fndecl))
{
warning (OPT_Wreturn_type,
"no return statement in function returning non-void");
@@ -6829,13 +6821,19 @@ check_for_loop_decls (void)
tree one_decl = NULL_TREE;
int n_decls = 0;
-
if (!flag_isoc99)
{
+ static bool hint = true;
/* If we get here, declarations have been used in a for loop without
the C99 for loop scope. This doesn't make much sense, so don't
allow it. */
- error ("%<for%> loop initial declaration used outside C99 mode");
+ error ("%<for%> loop initial declarations are only allowed in C99 mode");
+ if (hint)
+ {
+ inform (input_location,
+ "use option -std=c99 or -std=gnu99 to compile your code");
+ hint = false;
+ }
return NULL_TREE;
}
/* C99 subclause 6.8.5 paragraph 3:
@@ -7175,8 +7173,8 @@ declspecs_add_qual (struct c_declspecs *specs, tree qual)
default:
gcc_unreachable ();
}
- if (dupe && pedantic && !flag_isoc99)
- pedwarn ("duplicate %qE", qual);
+ if (dupe && !flag_isoc99)
+ pedwarn (input_location, OPT_pedantic, "duplicate %qE", qual);
return specs;
}
@@ -7224,9 +7222,8 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec)
"declaration specifiers");
break;
}
- if (pedantic && !flag_isoc99 && !in_system_header
- && warn_long_long)
- pedwarn ("ISO C90 does not support %<long long%>");
+ if (pedantic && !flag_isoc99 && !in_system_header)
+ pedwarn (input_location, OPT_Wlong_long, "ISO C90 does not support %<long long%>");
specs->long_long_p = 1;
break;
}
@@ -7349,8 +7346,8 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec)
break;
case RID_COMPLEX:
dupe = specs->complex_p;
- if (pedantic && !flag_isoc99 && !in_system_header)
- pedwarn ("ISO C90 does not support complex types");
+ if (!flag_isoc99 && !in_system_header)
+ 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");
@@ -7380,8 +7377,7 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec)
break;
case RID_SAT:
dupe = specs->saturating_p;
- if (pedantic)
- pedwarn ("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");
@@ -7578,8 +7574,8 @@ 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");
- if (pedantic)
- pedwarn ("ISO C does not support decimal floating point");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C does not support decimal floating point");
return specs;
case RID_FRACT:
case RID_ACCUM:
@@ -7599,8 +7595,8 @@ 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");
- if (pedantic)
- pedwarn ("ISO C does not support fixed-point types");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C does not support fixed-point types");
return specs;
default:
/* ObjC reserved word "id", handled below. */
@@ -7786,9 +7782,9 @@ finish_declspecs (struct c_declspecs *specs)
else if (specs->complex_p)
{
specs->typespec_word = cts_double;
- if (pedantic)
- pedwarn ("ISO C does not support plain %<complex%> meaning "
- "%<double complex%>");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C does not support plain %<complex%> meaning "
+ "%<double complex%>");
}
else
{
@@ -7831,8 +7827,8 @@ finish_declspecs (struct c_declspecs *specs)
specs->type = char_type_node;
if (specs->complex_p)
{
- if (pedantic)
- pedwarn ("ISO C does not support complex integer types");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C does not support complex integer types");
specs->type = build_complex_type (specs->type);
}
break;
@@ -7857,8 +7853,8 @@ finish_declspecs (struct c_declspecs *specs)
: integer_type_node);
if (specs->complex_p)
{
- if (pedantic)
- pedwarn ("ISO C does not support complex integer types");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C does not support complex integer types");
specs->type = build_complex_type (specs->type);
}
break;
@@ -8008,7 +8004,7 @@ c_write_global_declarations_1 (tree globals)
&& !TREE_PUBLIC (decl)
&& C_DECL_USED (decl))
{
- pedwarn ("%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 dc47b764f39..454585893e1 100644
--- a/gcc/c-errors.c
+++ b/gcc/c-errors.c
@@ -31,14 +31,15 @@ along with GCC; see the file COPYING3. If not see
/* Issue an ISO C99 pedantic warning MSGID. */
void
-pedwarn_c99 (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);
}
@@ -49,14 +50,15 @@ pedwarn_c99 (const char *gmsgid, ...)
(There is no flag_c90.) */
void
-pedwarn_c90 (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-gimplify.c b/gcc/c-gimplify.c
index 12292a7e591..342848acd29 100644
--- a/gcc/c-gimplify.c
+++ b/gcc/c-gimplify.c
@@ -31,7 +31,7 @@ along with GCC; see the file COPYING3. If not see
#include "varray.h"
#include "c-tree.h"
#include "c-common.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "hard-reg-set.h"
#include "basic-block.h"
#include "tree-flow.h"
@@ -104,7 +104,6 @@ c_genericize (tree fndecl)
/* Go ahead and gimplify for now. */
gimplify_function_tree (fndecl);
- /* Dump the genericized tree IR. */
dump_function (TDI_generic, fndecl);
/* Genericize all nested functions now. We do things in this order so
@@ -118,14 +117,16 @@ c_genericize (tree fndecl)
static void
add_block_to_enclosing (tree block)
{
+ unsigned i;
tree enclosing;
+ gimple bind;
+ VEC(gimple, heap) *stack = gimple_bind_expr_stack ();
- for (enclosing = gimple_current_bind_expr ();
- enclosing; enclosing = TREE_CHAIN (enclosing))
- if (BIND_EXPR_BLOCK (enclosing))
+ for (i = 0; VEC_iterate (gimple, stack, i, bind); i++)
+ if (gimple_bind_block (bind))
break;
- enclosing = BIND_EXPR_BLOCK (enclosing);
+ enclosing = gimple_bind_block (bind);
BLOCK_SUBBLOCKS (enclosing) = chainon (BLOCK_SUBBLOCKS (enclosing), block);
}
@@ -178,7 +179,7 @@ c_build_bind_expr (tree block, tree body)
decl instead. */
static enum gimplify_status
-gimplify_compound_literal_expr (tree *expr_p, tree *pre_p)
+gimplify_compound_literal_expr (tree *expr_p, gimple_seq *pre_p)
{
tree decl_s = COMPOUND_LITERAL_EXPR_DECL_STMT (*expr_p);
tree decl = DECL_EXPR_DECL (decl_s);
@@ -249,10 +250,12 @@ optimize_compound_literals_in_ctor (tree orig_ctor)
return ctor;
}
-/* Do C-specific gimplification. Args are as for gimplify_expr. */
+/* Do C-specific gimplification on *EXPR_P. PRE_P and POST_P are as in
+ gimplify_expr. */
int
-c_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p ATTRIBUTE_UNUSED)
+c_gimplify_expr (tree *expr_p, gimple_seq *pre_p,
+ gimple_seq *post_p ATTRIBUTE_UNUSED)
{
enum tree_code code = TREE_CODE (*expr_p);
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 94469162092..5b71c3b0d8f 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -587,7 +587,7 @@ 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 ("integer constant is too large for %qs type",
+ 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);
@@ -641,8 +641,8 @@ interpret_float (const cpp_token *token, unsigned int flags)
return error_mark_node;
}
- else if (pedantic)
- pedwarn ("non-standard suffix on floating constant");
+ else
+ 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 ("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-objc-common.h b/gcc/c-objc-common.h
index c48838ceb99..9c73fdd3c15 100644
--- a/gcc/c-objc-common.h
+++ b/gcc/c-objc-common.h
@@ -69,6 +69,8 @@ extern void c_initialize_diagnostics (diagnostic_context *);
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL c_dup_lang_specific_decl
#undef LANG_HOOKS_BUILTIN_FUNCTION
#define LANG_HOOKS_BUILTIN_FUNCTION c_builtin_function
+#undef LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE
+#define LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE c_builtin_function_ext_scope
/* Attribute hooks. */
#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
diff --git a/gcc/c-omp.c b/gcc/c-omp.c
index 1da71d27b9c..7da659cc9fb 100644
--- a/gcc/c-omp.c
+++ b/gcc/c-omp.c
@@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "function.h"
#include "c-common.h"
#include "toplev.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "bitmap.h"
#include "langhooks.h"
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index 33d0e6bed26..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:
@@ -1018,14 +1013,6 @@ c_common_post_options (const char **pfilename)
C_COMMON_OVERRIDE_OPTIONS;
#endif
- flag_inline_trees = 1;
-
- /* Use tree inlining. */
- if (!flag_no_inline)
- flag_no_inline = 1;
- if (flag_inline_functions)
- flag_inline_trees = 2;
-
/* By default we use C99 inline semantics in GNU99 or C99 mode. C99
inline semantics are not supported in GNU89 or C89 mode. */
if (flag_gnu89_inline == -1)
@@ -1033,14 +1020,6 @@ c_common_post_options (const char **pfilename)
else if (!flag_gnu89_inline && !flag_isoc99)
error ("-fno-gnu89-inline is only supported in GNU99 or C99 mode");
- /* If we are given more than one input file, we must use
- unit-at-a-time mode. */
- if (num_in_fnames > 1)
- flag_unit_at_a_time = 1;
-
- if (pch_file && !flag_unit_at_a_time)
- sorry ("Precompiled headers require -funit-at-a-time");
-
/* Default to ObjC sjlj exception handling if NeXT runtime. */
if (flag_objc_sjlj_exceptions < 0)
flag_objc_sjlj_exceptions = flag_next_runtime;
@@ -1087,17 +1066,14 @@ c_common_post_options (const char **pfilename)
if (warn_overlength_strings == -1 || c_dialect_cxx ())
warn_overlength_strings = 0;
- /* Adjust various flags for C++ based on command-line settings. */
- if (c_dialect_cxx ())
- {
- if (!flag_no_inline)
- {
- flag_inline_trees = 1;
- flag_no_inline = 1;
- }
- if (flag_inline_functions)
- flag_inline_trees = 2;
- }
+ /* 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++,
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index e89d7dfd466..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,9 +967,8 @@ c_parser_translation_unit (c_parser *parser)
{
if (c_parser_next_token_is (parser, CPP_EOF))
{
- if (pedantic)
- pedwarn ("%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
{
@@ -1046,9 +1052,8 @@ c_parser_external_declaration (c_parser *parser)
}
break;
case CPP_SEMICOLON:
- if (pedantic)
- pedwarn ("%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:
@@ -1162,7 +1167,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, bool empty_ok,
else
{
shadow_tag_warned (specs, 1);
- pedwarn ("%Hempty declaration", &here);
+ pedwarn (here, 0, "empty declaration");
}
c_parser_consume_token (parser);
return;
@@ -1198,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 ("%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. */
@@ -1268,8 +1272,7 @@ c_parser_declaration_or_fndef (c_parser *parser, bool fndef_ok, bool empty_ok,
/* Function definition (nested or otherwise). */
if (nested)
{
- if (pedantic)
- pedwarn ("%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))
@@ -1632,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");
@@ -1643,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;
@@ -1663,8 +1671,8 @@ c_parser_enum_specifier (c_parser *parser)
}
if (c_parser_next_token_is (parser, CPP_CLOSE_BRACE))
{
- if (seen_comma && pedantic && !flag_isoc99)
- pedwarn ("%Hcomma at end of enumerator list", &comma_loc);
+ if (seen_comma && !flag_isoc99)
+ pedwarn (comma_loc, OPT_pedantic, "comma at end of enumerator list");
c_parser_consume_token (parser);
break;
}
@@ -1695,8 +1703,8 @@ c_parser_enum_specifier (c_parser *parser)
if (pedantic && !COMPLETE_TYPE_P (ret.spec))
{
gcc_assert (ident);
- pedwarn ("%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))
{
- if (pedantic)
- pedwarn ("%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 ("%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)
{
- if (pedantic)
- pedwarn ("%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))
{
- if (pedantic)
- pedwarn ("%HISO C forbids empty initializer braces", &brace_loc);
+ pedwarn (brace_loc, OPT_pedantic, "ISO C forbids empty initializer braces");
}
else
{
@@ -3042,12 +3055,9 @@ c_parser_initelt (c_parser *parser)
{
/* Old-style structure member designator. */
set_init_label (c_parser_peek_token (parser)->value);
- if (pedantic)
- {
- /* Use the colon as the error location. */
- pedwarn ("%Hobsolete use of designated initializer with %<:%>",
- &c_parser_peek_2nd_token (parser)->location);
- }
+ /* Use the colon as the error 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);
}
@@ -3175,9 +3185,9 @@ c_parser_initelt (c_parser *parser)
{
c_parser_consume_token (parser);
set_init_index (first, second);
- if (pedantic && second)
- pedwarn ("%HISO C forbids specifying range of "
- "elements to initialize", &ellipsis_loc);
+ if (second)
+ 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 +3198,16 @@ c_parser_initelt (c_parser *parser)
{
if (c_parser_next_token_is (parser, CPP_EQ))
{
- if (pedantic && !flag_isoc99)
- pedwarn ("%HISO C90 forbids specifying subobject "
- "to initialize", &des_loc);
+ if (!flag_isoc99)
+ pedwarn (des_loc, OPT_pedantic,
+ "ISO C90 forbids specifying subobject to initialize");
c_parser_consume_token (parser);
}
else
{
if (des_seen == 1)
- {
- if (pedantic)
- pedwarn ("%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,8 +3357,7 @@ c_parser_compound_statement_nostart (c_parser *parser)
}
c_parser_skip_until_found (parser, CPP_SEMICOLON, "expected %<;%>");
}
- if (pedantic)
- pedwarn ("%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 +3387,12 @@ c_parser_compound_statement_nostart (c_parser *parser)
{
last_label = false;
c_parser_declaration_or_fndef (parser, true, true, true, true);
- if (last_stmt
- && ((pedantic && !flag_isoc99)
- || warn_declaration_after_statement))
- pedwarn_c90 ("%HISO C90 forbids mixed declarations and code",
- &loc);
+ if (last_stmt)
+ pedwarn_c90 (loc,
+ (pedantic && !flag_isoc99)
+ ? OPT_pedantic
+ : OPT_Wdeclaration_after_statement,
+ "ISO C90 forbids mixed declarations and code");
last_stmt = false;
}
else if (!last_label
@@ -3410,11 +3416,11 @@ c_parser_compound_statement_nostart (c_parser *parser)
/* Following the old parser, __extension__ does not
disable this diagnostic. */
restore_extension_diagnostics (ext);
- if (last_stmt
- && ((pedantic && !flag_isoc99)
- || warn_declaration_after_statement))
- pedwarn_c90 ("%HISO C90 forbids mixed declarations and code",
- &loc);
+ if (last_stmt)
+ pedwarn_c90 (loc, (pedantic && !flag_isoc99)
+ ? OPT_pedantic
+ : OPT_Wdeclaration_after_statement,
+ "ISO C90 forbids mixed declarations and code");
last_stmt = false;
}
else
@@ -3790,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:
@@ -3798,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;
}
@@ -4072,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);
@@ -4080,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. */
@@ -4420,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))
{
- if (pedantic)
- pedwarn ("%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);
@@ -5124,9 +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 %<)%>");
- if (pedantic)
- pedwarn ("%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;
}
@@ -5486,8 +5498,8 @@ c_parser_postfix_expression_after_paren_type (c_parser *parser,
finish_init ();
maybe_warn_string_init (type, init);
- if (pedantic && !flag_isoc99)
- pedwarn ("%HISO C90 forbids compound literals", &start_loc);
+ if (!flag_isoc99)
+ 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);
@@ -5788,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))
{
- if (pedantic)
- pedwarn ("%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;
}
@@ -6006,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);
- if (pedantic)
- pedwarn ("%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))
{
@@ -6044,10 +6054,8 @@ c_parser_objc_methodprotolist (c_parser *parser)
switch (c_parser_peek_token (parser)->type)
{
case CPP_SEMICOLON:
- if (pedantic)
- pedwarn ("%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 8273914f144..b4f70506e40 100644
--- a/gcc/c-pch.c
+++ b/gcc/c-pch.c
@@ -45,7 +45,6 @@ static const struct c_pch_matching
const char *flag_name;
} pch_matching[] = {
{ &flag_exceptions, "-fexceptions" },
- { &flag_unit_at_a_time, "-funit-at-a-time" }
};
enum {
@@ -368,6 +367,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name,
struct c_pch_header h;
struct save_macro_data *smd;
expanded_location saved_loc;
+ bool saved_trace_includes;
f = fdopen (fd, "rb");
if (f == NULL)
@@ -413,6 +413,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name,
/* Save the location and then restore it after reading the PCH. */
saved_loc = expand_location (line_table->highest_line);
+ saved_trace_includes = line_table->trace_includes;
cpp_prepare_state (pfile, &smd);
@@ -426,6 +427,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name,
fclose (f);
+ line_table->trace_includes = saved_trace_includes;
cpp_set_line_map (pfile, line_table);
linemap_add (line_table, LC_RENAME, 0, saved_loc.file, saved_loc.line);
@@ -461,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;
}
@@ -472,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 6e4043ae672..2f2095ec81a 100644
--- a/gcc/c-pragma.c
+++ b/gcc/c-pragma.c
@@ -866,15 +866,11 @@ handle_pragma_diagnostic(cpp_reader *ARG_UNUSED(dummy))
GCC_BAD ("unknown option after %<#pragma GCC diagnostic%> kind");
}
-/* Stack of the #pragma GCC options created with #pragma GCC option push. */
-static GTY(()) VEC(tree,gc) *option_stack;
-
-/* Parse #pragma GCC option (xxx) to set target specific options. */
+/* Parse #pragma GCC target (xxx) to set target specific options. */
static void
-handle_pragma_option(cpp_reader *ARG_UNUSED(dummy))
+handle_pragma_target(cpp_reader *ARG_UNUSED(dummy))
{
enum cpp_ttype token;
- const char *name;
tree x;
bool close_paren_needed_p = false;
@@ -884,12 +880,6 @@ handle_pragma_option(cpp_reader *ARG_UNUSED(dummy))
return;
}
- if (!targetm.target_option.pragma_parse)
- {
- error ("#pragma GCC option is not supported for this system");
- return;
- }
-
token = pragma_lex (&x);
if (token == CPP_OPEN_PAREN)
{
@@ -897,76 +887,9 @@ handle_pragma_option(cpp_reader *ARG_UNUSED(dummy))
token = pragma_lex (&x);
}
- if (token == CPP_NAME)
- {
- bool call_pragma_parse_p = false;
- bool ok_p;
-
- name = IDENTIFIER_POINTER (x);
- if (strcmp (name, "reset") == 0)
- {
- current_option_pragma = NULL_TREE;
- call_pragma_parse_p = true;
- }
-
- else if (strcmp (name, "push") == 0)
- VEC_safe_push (tree, gc, option_stack,
- copy_list (current_option_pragma));
-
- else if (strcmp (name, "pop") == 0)
- {
- int len = VEC_length (tree, option_stack);
- if (len == 0)
- {
- GCC_BAD ("%<#pragma GCC option pop%> without a %<#pragma GCC "
- "option push%>");
- return;
- }
- else
- {
- VEC_truncate (tree, option_stack, len-1);
- current_option_pragma = ((len > 1)
- ? VEC_last (tree, option_stack)
- : NULL_TREE);
-
- call_pragma_parse_p = true;
- }
- }
-
- else
- {
- GCC_BAD ("%<#pragma GCC option%> is not a string or "
- "push/pop/reset");
- return;
- }
-
- token = pragma_lex (&x);
- if (close_paren_needed_p)
- {
- if (token == CPP_CLOSE_PAREN)
- token = pragma_lex (&x);
- else
- GCC_BAD ("%<#pragma GCC option ([push|pop|reset])%> does not "
- "have a final %<)%>.");
- }
-
- if (token != CPP_EOF)
- {
- GCC_BAD ("%<#pragma GCC option [push|pop|reset]%> is badly "
- "formed");
- return;
- }
-
- /* See if we need to call the pragma_parse hook. This must occur at the
- end after processing all of the tokens, or we may get spurious errors
- when we define or undef macros. */
- ok_p = targetm.target_option.pragma_parse (current_option_pragma);
- gcc_assert (ok_p);
- }
-
- else if (token != CPP_STRING)
+ if (token != CPP_STRING)
{
- GCC_BAD ("%<#pragma GCC option%> is not a string or push/pop/reset");
+ GCC_BAD ("%<#pragma GCC option%> is not a string");
return;
}
@@ -993,34 +916,29 @@ handle_pragma_option(cpp_reader *ARG_UNUSED(dummy))
if (token == CPP_CLOSE_PAREN)
token = pragma_lex (&x);
else
- GCC_BAD ("%<#pragma GCC option (string [,string]...)%> does "
+ GCC_BAD ("%<#pragma GCC target (string [,string]...)%> does "
"not have a final %<)%>.");
}
if (token != CPP_EOF)
{
- error ("#pragma GCC option string... is badly formed");
+ error ("#pragma GCC target string... is badly formed");
return;
}
/* put arguments in the order the user typed them. */
args = nreverse (args);
- if (targetm.target_option.pragma_parse (args))
- current_option_pragma = args;
+ if (targetm.target_option.pragma_parse (args, NULL_TREE))
+ current_target_pragma = args;
}
}
-/* Stack of the #pragma GCC optimize options created with #pragma GCC optimize
- push. */
-static GTY(()) VEC(tree,gc) *optimize_stack;
-
/* Handle #pragma GCC optimize to set optimization options. */
static void
-handle_pragma_optimize(cpp_reader *ARG_UNUSED(dummy))
+handle_pragma_optimize (cpp_reader *ARG_UNUSED(dummy))
{
enum cpp_ttype token;
- const char *name;
tree x;
bool close_paren_needed_p = false;
tree optimization_previous_node = optimization_current_node;
@@ -1038,95 +956,9 @@ handle_pragma_optimize(cpp_reader *ARG_UNUSED(dummy))
token = pragma_lex (&x);
}
- if (token == CPP_NAME)
+ if (token != CPP_STRING && token != CPP_NUMBER)
{
- bool call_opt_p = false;
-
- name = IDENTIFIER_POINTER (x);
- if (strcmp (name, "reset") == 0)
- {
- struct cl_optimization *def
- = TREE_OPTIMIZATION (optimization_default_node);
- current_optimize_pragma = NULL_TREE;
- optimization_current_node = optimization_default_node;
- cl_optimization_restore (def);
- call_opt_p = true;
- }
-
- else if (strcmp (name, "push") == 0)
- VEC_safe_push (tree, gc, optimize_stack, current_optimize_pragma);
-
- else if (strcmp (name, "pop") == 0)
- {
- int len = VEC_length (tree, optimize_stack);
- if (len == 0)
- {
- GCC_BAD ("%<#pragma GCC optimize pop%> without a %<#pragma "
- "GCC optimize push%>");
- return;
- }
- else
- {
- VEC_truncate (tree, optimize_stack, len-1);
- current_optimize_pragma
- = ((len > 1)
- ? VEC_last (tree, optimize_stack)
- : NULL_TREE);
-
- call_opt_p = true;
- if (current_optimize_pragma)
- {
- bool ok_p
- = parse_optimize_options (current_optimize_pragma, false);
- gcc_assert (ok_p); /* should be parsed previously. */
- optimization_current_node = build_optimization_node ();
- }
- else
- {
- struct cl_optimization *opt
- = TREE_OPTIMIZATION (optimization_default_node);
- optimization_current_node = optimization_default_node;
- cl_optimization_restore (opt);
- }
- }
- }
-
- else
- {
- GCC_BAD ("%<#pragma GCC optimize%> is not a string or "
- "push/pop/reset");
- return;
- }
-
- token = pragma_lex (&x);
- if (close_paren_needed_p)
- {
- if (token == CPP_CLOSE_PAREN)
- token = pragma_lex (&x);
- else
- GCC_BAD ("%<#pragma GCC optimize ([push|pop|reset])%> does not "
- "have a final %<)%>.");
- }
-
- if (token != CPP_EOF)
- {
- GCC_BAD ("%<#pragma GCC optimize [push|pop|reset]%> is badly "
- "formed");
- return;
- }
-
- if (call_opt_p &&
- (optimization_previous_node != optimization_current_node))
- c_cpp_builtins_optimize_pragma (parse_in,
- optimization_previous_node,
- optimization_current_node);
-
- }
-
- else if (token != CPP_STRING && token != CPP_NUMBER)
- {
- GCC_BAD ("%<#pragma GCC optimize%> is not a string, number, or "
- "push/pop/reset");
+ GCC_BAD ("%<#pragma GCC optimize%> is not a string or number");
return;
}
@@ -1166,6 +998,7 @@ handle_pragma_optimize(cpp_reader *ARG_UNUSED(dummy))
args = nreverse (args);
parse_optimize_options (args, false);
+ current_optimize_pragma = chainon (current_optimize_pragma, args);
optimization_current_node = build_optimization_node ();
c_cpp_builtins_optimize_pragma (parse_in,
optimization_previous_node,
@@ -1173,6 +1006,166 @@ handle_pragma_optimize(cpp_reader *ARG_UNUSED(dummy))
}
}
+/* Stack of the #pragma GCC options created with #pragma GCC push_option. Save
+ both the binary representation of the options and the TREE_LIST of
+ strings that will be added to the function's attribute list. */
+typedef struct opt_stack GTY(())
+{
+ struct opt_stack *prev;
+ tree target_binary;
+ tree target_strings;
+ tree optimize_binary;
+ tree optimize_strings;
+} opt_stack;
+
+static GTY(()) struct opt_stack * options_stack;
+
+/* Handle #pragma GCC push_options to save the current target and optimization
+ options. */
+
+static void
+handle_pragma_push_options (cpp_reader *ARG_UNUSED(dummy))
+{
+ enum cpp_ttype token;
+ tree x = 0;
+ opt_stack *p;
+
+ token = pragma_lex (&x);
+ if (token != CPP_EOF)
+ {
+ warning (OPT_Wpragmas, "junk at end of %<#pragma push_options%>");
+ return;
+ }
+
+ p = GGC_NEW (opt_stack);
+ p->prev = options_stack;
+ options_stack = p;
+
+ /* Save optimization and target flags in binary format. */
+ p->optimize_binary = build_optimization_node ();
+ p->target_binary = build_target_option_node ();
+
+ /* Save optimization and target flags in string list format. */
+ p->optimize_strings = copy_list (current_optimize_pragma);
+ p->target_strings = copy_list (current_target_pragma);
+}
+
+/* Handle #pragma GCC pop_options to restore the current target and
+ optimization options from a previous push_options. */
+
+static void
+handle_pragma_pop_options (cpp_reader *ARG_UNUSED(dummy))
+{
+ enum cpp_ttype token;
+ tree x = 0;
+ opt_stack *p;
+
+ token = pragma_lex (&x);
+ if (token != CPP_EOF)
+ {
+ warning (OPT_Wpragmas, "junk at end of %<#pragma pop_options%>");
+ return;
+ }
+
+ if (! options_stack)
+ {
+ warning (OPT_Wpragmas,
+ "%<#pragma GCC pop_options%> without a corresponding "
+ "%<#pragma GCC push_options%>");
+ return;
+ }
+
+ p = options_stack;
+ options_stack = p->prev;
+
+ if (p->target_binary != target_option_current_node)
+ {
+ (void) targetm.target_option.pragma_parse (NULL_TREE, p->target_binary);
+ target_option_current_node = p->target_binary;
+ }
+
+ if (p->optimize_binary != optimization_current_node)
+ {
+ tree old_optimize = optimization_current_node;
+ cl_optimization_restore (TREE_OPTIMIZATION (p->optimize_binary));
+ c_cpp_builtins_optimize_pragma (parse_in, old_optimize,
+ p->optimize_binary);
+ optimization_current_node = p->optimize_binary;
+ }
+
+ current_target_pragma = p->target_strings;
+ current_optimize_pragma = p->optimize_strings;
+}
+
+/* Handle #pragma GCC reset_options to restore the current target and
+ optimization options to the original options used on the command line. */
+
+static void
+handle_pragma_reset_options (cpp_reader *ARG_UNUSED(dummy))
+{
+ enum cpp_ttype token;
+ tree x = 0;
+ tree new_optimize = optimization_default_node;
+ tree new_target = target_option_default_node;
+
+ token = pragma_lex (&x);
+ if (token != CPP_EOF)
+ {
+ warning (OPT_Wpragmas, "junk at end of %<#pragma reset_options%>");
+ return;
+ }
+
+ if (new_target != target_option_current_node)
+ {
+ (void) targetm.target_option.pragma_parse (NULL_TREE, new_target);
+ target_option_current_node = new_target;
+ }
+
+ if (new_optimize != optimization_current_node)
+ {
+ tree old_optimize = optimization_current_node;
+ cl_optimization_restore (TREE_OPTIMIZATION (new_optimize));
+ c_cpp_builtins_optimize_pragma (parse_in, old_optimize, new_optimize);
+ optimization_current_node = new_optimize;
+ }
+
+ current_target_pragma = NULL_TREE;
+ current_optimize_pragma = NULL_TREE;
+}
+
+/* Print a plain user-specified message. */
+
+static void
+handle_pragma_message (cpp_reader *ARG_UNUSED(dummy))
+{
+ enum cpp_ttype token;
+ tree x, message = 0;
+
+ token = pragma_lex (&x);
+ if (token == CPP_OPEN_PAREN)
+ {
+ token = pragma_lex (&x);
+ if (token == CPP_STRING)
+ message = x;
+ else
+ GCC_BAD ("expected a string after %<#pragma message%>");
+ if (pragma_lex (&x) != CPP_CLOSE_PAREN)
+ GCC_BAD ("malformed %<#pragma message%>, ignored");
+ }
+ else if (token == CPP_STRING)
+ message = x;
+ else
+ GCC_BAD ("expected a string after %<#pragma message%>");
+
+ gcc_assert (message);
+
+ if (pragma_lex (&x) != CPP_EOF)
+ warning (OPT_Wpragmas, "junk at end of %<#pragma message%>");
+
+ if (TREE_STRING_LENGTH (message) > 1)
+ inform (input_location, "#pragma message: %s", TREE_STRING_POINTER (message));
+}
+
/* A vector of registered pragma callbacks. */
DEF_VEC_O (pragma_handler);
@@ -1335,12 +1328,17 @@ init_pragma (void)
#endif
c_register_pragma ("GCC", "diagnostic", handle_pragma_diagnostic);
- c_register_pragma ("GCC", "option", handle_pragma_option);
+ c_register_pragma ("GCC", "target", handle_pragma_target);
c_register_pragma ("GCC", "optimize", handle_pragma_optimize);
+ c_register_pragma ("GCC", "push_options", handle_pragma_push_options);
+ c_register_pragma ("GCC", "pop_options", handle_pragma_pop_options);
+ c_register_pragma ("GCC", "reset_options", handle_pragma_reset_options);
c_register_pragma_with_expansion (0, "redefine_extname", handle_pragma_redefine_extname);
c_register_pragma (0, "extern_prefix", handle_pragma_extern_prefix);
+ c_register_pragma_with_expansion (0, "message", handle_pragma_message);
+
#ifdef REGISTER_TARGET_PRAGMAS
REGISTER_TARGET_PRAGMAS ();
#endif
diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c
index 4386c392c9f..67a466ba749 100644
--- a/gcc/c-pretty-print.c
+++ b/gcc/c-pretty-print.c
@@ -1852,14 +1852,13 @@ static void
pp_c_assignment_expression (c_pretty_printer *pp, tree e)
{
if (TREE_CODE (e) == MODIFY_EXPR
- || TREE_CODE (e) == GIMPLE_MODIFY_STMT
|| TREE_CODE (e) == INIT_EXPR)
{
- pp_c_unary_expression (pp, GENERIC_TREE_OPERAND (e, 0));
+ pp_c_unary_expression (pp, TREE_OPERAND (e, 0));
pp_c_whitespace (pp);
pp_equal (pp);
pp_space (pp);
- pp_c_expression (pp, GENERIC_TREE_OPERAND (e, 1));
+ pp_c_expression (pp, TREE_OPERAND (e, 1));
}
else
pp_c_conditional_expression (pp, e);
@@ -2007,7 +2006,6 @@ pp_c_expression (c_pretty_printer *pp, tree e)
break;
case MODIFY_EXPR:
- case GIMPLE_MODIFY_STMT:
case INIT_EXPR:
pp_assignment_expression (pp, e);
break;
diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c
index c7933beea1b..62faee54ea8 100644
--- a/gcc/c-semantics.c
+++ b/gcc/c-semantics.c
@@ -43,7 +43,8 @@ along with GCC; see the file COPYING3. If not see
#include "timevar.h"
#include "predict.h"
#include "tree-inline.h"
-#include "tree-gimple.h"
+#include "gimple.h"
+#include "tree-iterator.h"
#include "langhooks.h"
/* Create an empty statement tree rooted at T. */
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index 14df0444377..ab8b36b2e32 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);
@@ -488,6 +488,7 @@ extern void push_parm_decl (const struct c_parm *);
extern struct c_declarator *set_array_declarator_inner (struct c_declarator *,
struct c_declarator *);
extern tree c_builtin_function (tree);
+extern tree c_builtin_function_ext_scope (tree);
extern void shadow_tag (const struct c_declspecs *);
extern void shadow_tag_warned (const struct c_declspecs *, int);
extern tree start_enum (struct c_enum_contents *, tree);
@@ -563,7 +564,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 (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 +641,7 @@ extern void c_write_global_declarations (void);
#define ATTRIBUTE_GCC_CDIAG(m, n) ATTRIBUTE_NONNULL(m)
#endif
-extern void pedwarn_c90 (const char *, ...) ATTRIBUTE_GCC_CDIAG(1,2);
-extern void pedwarn_c99 (const char *, ...) ATTRIBUTE_GCC_CDIAG(1,2);
+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 a47d6324293..85a94443a6e 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -42,7 +42,7 @@ along with GCC; see the file COPYING3. If not see
#include "ggc.h"
#include "target.h"
#include "tree-iterator.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-flow.h"
/* Possible cases of implicit bad conversions. Used to select
@@ -470,8 +470,8 @@ composite_type (tree t1, tree t2)
{
TREE_VALUE (n) = composite_type (TREE_TYPE (memb),
TREE_VALUE (p2));
- if (pedantic)
- pedwarn ("function types not truly compatible in ISO C");
+ pedwarn (input_location, OPT_pedantic,
+ "function types not truly compatible in ISO C");
goto parm_done;
}
}
@@ -495,8 +495,8 @@ composite_type (tree t1, tree t2)
{
TREE_VALUE (n) = composite_type (TREE_TYPE (memb),
TREE_VALUE (p1));
- if (pedantic)
- pedwarn ("function types not truly compatible in ISO C");
+ pedwarn (input_location, OPT_pedantic,
+ "function types not truly compatible in ISO C");
goto parm_done;
}
}
@@ -1039,8 +1039,8 @@ comp_target_types (tree ttl, tree ttr)
mvr = TYPE_MAIN_VARIANT (mvr);
val = comptypes (mvl, mvr);
- if (val == 2 && pedantic)
- pedwarn ("types are not quite compatible");
+ if (val == 2)
+ 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 ("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,9 +2115,11 @@ 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 ("ISO C forbids subscripting %<register%> array");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids subscripting %<register%> array");
else if (!flag_isoc99 && !lvalue_p (foo))
- pedwarn ("ISO C90 forbids subscripting non-lvalue array");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C90 forbids subscripting non-lvalue array");
}
type = TREE_TYPE (TREE_TYPE (array));
@@ -2231,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 ("%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;
}
@@ -2406,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;
@@ -2456,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 ("initializer element is not constant");
+ pedwarn_init (input_location, 0, "initializer element is not constant");
}
else
result = fold_build_call_array (TREE_TYPE (fntype),
@@ -2800,13 +2801,12 @@ pointer_diff (tree op0, tree op1)
tree con0, con1, lit0, lit1;
tree orig_op1 = op1;
- if (pedantic || warn_pointer_arith)
- {
- if (TREE_CODE (target_type) == VOID_TYPE)
- pedwarn ("pointer of type %<void *%> used in subtraction");
- if (TREE_CODE (target_type) == FUNCTION_TYPE)
- pedwarn ("pointer to a function used in subtraction");
- }
+ if (TREE_CODE (target_type) == VOID_TYPE)
+ pedwarn (input_location, pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ "pointer of type %<void *%> used in subtraction");
+ if (TREE_CODE (target_type) == FUNCTION_TYPE)
+ 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
converting a partial to an integral mode, we get a convert_expression
@@ -2948,8 +2948,8 @@ build_unary_op (enum tree_code code, tree xarg, int flag)
else if (typecode == COMPLEX_TYPE)
{
code = CONJ_EXPR;
- if (pedantic)
- pedwarn ("ISO C does not support %<~%> for complex conjugation");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C does not support %<~%> for complex conjugation");
if (!noconvert)
arg = default_conversion (arg);
}
@@ -3020,9 +3020,8 @@ build_unary_op (enum tree_code code, tree xarg, int flag)
{
tree real, imag;
- if (pedantic)
- pedwarn ("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);
@@ -3067,14 +3066,15 @@ build_unary_op (enum tree_code code, tree xarg, int flag)
else
error ("decrement of pointer to unknown structure");
}
- else if ((pedantic || warn_pointer_arith)
- && (TREE_CODE (TREE_TYPE (result_type)) == FUNCTION_TYPE
- || TREE_CODE (TREE_TYPE (result_type)) == VOID_TYPE))
+ else if (TREE_CODE (TREE_TYPE (result_type)) == FUNCTION_TYPE
+ || TREE_CODE (TREE_TYPE (result_type)) == VOID_TYPE)
{
if (code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR)
- pedwarn ("wrong type argument to increment");
+ pedwarn (input_location, pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ "wrong type argument to increment");
else
- pedwarn ("wrong type argument to decrement");
+ pedwarn (input_location, pedantic ? OPT_pedantic : OPT_Wpointer_arith,
+ "wrong type argument to decrement");
}
inc = c_size_in_bytes (TREE_TYPE (result_type));
@@ -3349,7 +3349,7 @@ c_mark_addressable (tree exp)
("global register variable %qD used in nested function", x);
return false;
}
- pedwarn ("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))
{
@@ -3456,8 +3456,9 @@ build_conditional_expr (tree ifexp, tree op1, tree op2)
}
else if (code1 == VOID_TYPE || code2 == VOID_TYPE)
{
- if (pedantic && (code1 != VOID_TYPE || code2 != VOID_TYPE))
- pedwarn ("ISO C forbids conditional expr with only one void side");
+ if (code1 != VOID_TYPE || code2 != VOID_TYPE)
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids conditional expr with only one void side");
result_type = void_type_node;
}
else if (code1 == POINTER_TYPE && code2 == POINTER_TYPE)
@@ -3470,30 +3471,34 @@ build_conditional_expr (tree ifexp, tree op1, tree op2)
result_type = qualify_type (type1, type2);
else if (VOID_TYPE_P (TREE_TYPE (type1)))
{
- if (pedantic && TREE_CODE (TREE_TYPE (type2)) == FUNCTION_TYPE)
- pedwarn ("ISO C forbids conditional expr between "
+ if (TREE_CODE (TREE_TYPE (type2)) == FUNCTION_TYPE)
+ 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)));
}
else if (VOID_TYPE_P (TREE_TYPE (type2)))
{
- if (pedantic && TREE_CODE (TREE_TYPE (type1)) == FUNCTION_TYPE)
- pedwarn ("ISO C forbids conditional expr between "
+ if (TREE_CODE (TREE_TYPE (type1)) == FUNCTION_TYPE)
+ 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 ("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 ("pointer/integer type mismatch in conditional expression");
+ pedwarn (input_location, 0,
+ "pointer/integer type mismatch in conditional expression");
else
{
op2 = null_pointer_node;
@@ -3503,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 ("pointer/integer type mismatch in conditional expression");
+ pedwarn (input_location, 0,
+ "pointer/integer type mismatch in conditional expression");
else
{
op1 = null_pointer_node;
@@ -3614,12 +3620,10 @@ build_c_cast (tree type, tree expr)
if (type == TYPE_MAIN_VARIANT (TREE_TYPE (value)))
{
- if (pedantic)
- {
- if (TREE_CODE (type) == RECORD_TYPE
- || TREE_CODE (type) == UNION_TYPE)
- pedwarn ("ISO C forbids casting nonscalar to the same type");
- }
+ if (TREE_CODE (type) == RECORD_TYPE
+ || TREE_CODE (type) == UNION_TYPE)
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C forbids casting nonscalar to the same type");
}
else if (TREE_CODE (type) == UNION_TYPE)
{
@@ -3635,8 +3639,8 @@ build_c_cast (tree type, tree expr)
{
tree t;
- if (pedantic)
- pedwarn ("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);
@@ -3747,7 +3751,8 @@ 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 ("ISO C forbids conversion of function pointer to object pointer type");
+ pedwarn (input_location, OPT_pedantic, "ISO C forbids "
+ "conversion of function pointer to object pointer type");
if (pedantic
&& TREE_CODE (type) == POINTER_TYPE
@@ -3755,7 +3760,8 @@ 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 ("ISO C forbids conversion of object pointer to function pointer type");
+ pedwarn (input_location, OPT_pedantic, "ISO C forbids "
+ "conversion of object pointer to function pointer type");
ovalue = value;
value = convert (type, value);
@@ -3946,28 +3952,31 @@ 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) \
- do { \
- switch (errtype) \
- { \
- case ic_argpass: \
- pedwarn (AR, parmnum, rname); \
- break; \
- case ic_argpass_nonproto: \
- warning (0, AR, parmnum, rname); \
- break; \
- case ic_assign: \
- pedwarn (AS); \
- break; \
- case ic_init: \
- pedwarn (IN); \
- break; \
- case ic_return: \
- pedwarn (RE); \
- break; \
- default: \
- gcc_unreachable (); \
- } \
+#define WARN_FOR_ASSIGNMENT(LOCATION, OPT, AR, AS, IN, RE) \
+ do { \
+ switch (errtype) \
+ { \
+ case ic_argpass: \
+ if (pedwarn (LOCATION, OPT, AR, parmnum, rname)) \
+ inform (fundecl ? DECL_SOURCE_LOCATION (fundecl) : LOCATION, \
+ "expected %qT but argument is of type %qT", \
+ type, rhstype); \
+ break; \
+ case ic_argpass_nonproto: \
+ warning (OPT, AR, parmnum, rname); \
+ break; \
+ case ic_assign: \
+ pedwarn (LOCATION, OPT, AS); \
+ break; \
+ case ic_init: \
+ pedwarn (LOCATION, OPT, IN); \
+ break; \
+ case ic_return: \
+ pedwarn (LOCATION, OPT, RE); \
+ break; \
+ default: \
+ gcc_unreachable (); \
+ } \
} while (0)
STRIP_TYPE_NOPS (rhs);
@@ -4145,7 +4154,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, 0,
+ G_("passing argument %d of %qE "
"makes qualified function "
"pointer from unqualified"),
G_("assignment makes qualified "
@@ -4158,7 +4168,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, 0,
+ G_("passing argument %d of %qE discards "
"qualifiers from pointer target type"),
G_("assignment discards qualifiers "
"from pointer target type"),
@@ -4170,8 +4181,9 @@ convert_for_assignment (tree type, tree rhs, enum impl_conv errtype,
memb = marginal_memb;
}
- if (pedantic && (!fundecl || !DECL_IN_SYSTEM_HEADER (fundecl)))
- pedwarn ("ISO C prohibits argument conversion to union type");
+ if (!fundecl || !DECL_IN_SYSTEM_HEADER (fundecl))
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C prohibits argument conversion to union type");
rhs = fold_convert (TREE_TYPE (memb), rhs);
return build_constructor_single (type, memb, rhs);
@@ -4256,7 +4268,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, OPT_pedantic,
+ G_("ISO C forbids passing argument %d of "
"%qE between function pointer "
"and %<void *%>"),
G_("ISO C forbids assignment between "
@@ -4276,7 +4289,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, 0,
+ G_("passing argument %d of %qE discards "
"qualifiers from pointer target type"),
G_("assignment discards qualifiers "
"from pointer target type"),
@@ -4292,7 +4306,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, OPT_Wpointer_sign,
+ G_("pointer targets in passing argument "
"%d of %qE differ in signedness"),
G_("pointer targets in assignment "
"differ in signedness"),
@@ -4309,7 +4324,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, 0,
+ G_("passing argument %d of %qE makes "
"qualified function pointer "
"from unqualified"),
G_("assignment makes qualified function "
@@ -4323,7 +4339,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, 0,
+ G_("passing argument %d of %qE from "
"incompatible pointer type"),
G_("assignment from incompatible pointer type"),
G_("initialization from incompatible "
@@ -4345,7 +4362,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, 0,
+ G_("passing argument %d of %qE makes "
"pointer from integer without a cast"),
G_("assignment makes pointer from integer "
"without a cast"),
@@ -4358,7 +4376,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, 0,
+ G_("passing argument %d of %qE makes integer "
"from pointer without a cast"),
G_("assignment makes integer from pointer "
"without a cast"),
@@ -4616,19 +4635,20 @@ error_init (const char *msgid)
error ("(near initialization for %qs)", ofwhat);
}
-/* Issue a pedantic warning for a bad initializer component.
- MSGID identifies the message.
- The component name is taken from the spelling stack. */
+/* Issue a pedantic warning for a bad initializer component. OPT is
+ the option OPT_* (from options.h) controlling this warning or 0 if
+ it is unconditionally given. MSGID identifies the message. The
+ component name is taken from the spelling stack. */
void
-pedwarn_init (const char *msgid)
+pedwarn_init (location_t location, int opt, const char *msgid)
{
char *ofwhat;
- pedwarn ("%s", _(msgid));
+ pedwarn (location, opt, "%s", _(msgid));
ofwhat = print_spelling ((char *) alloca (spelling_length () + 1));
if (*ofwhat)
- pedwarn ("(near initialization for %qs)", ofwhat);
+ pedwarn (location, opt, "(near initialization for %qs)", ofwhat);
}
/* Issue a warning for a bad initializer component.
@@ -4659,7 +4679,8 @@ 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 ("array initialized from parenthesized string constant");
+ pedwarn_init (input_location, OPT_pedantic,
+ "array initialized from parenthesized string constant");
}
/* Digest the parser output INIT as an initializer for type TYPE.
@@ -4752,7 +4773,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 ("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;
}
@@ -4798,6 +4820,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. */
@@ -4867,7 +4892,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 ("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;
}
@@ -5540,8 +5566,9 @@ pop_init_level (int implicit)
if (constructor_depth > 2)
error_init ("initialization of flexible array member in a nested context");
- else if (pedantic)
- pedwarn_init ("initialization of a flexible array member");
+ else
+ 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.
@@ -6278,7 +6305,8 @@ output_init_element (tree value, bool strict_string, tree type, tree field,
value = error_mark_node;
}
else if (require_constant_elements)
- pedwarn ("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),
@@ -6605,7 +6633,8 @@ process_init_element (struct c_expr value)
if (constructor_fields == 0)
{
- pedwarn_init ("excess elements in struct initializer");
+ pedwarn_init (input_location, 0,
+ "excess elements in struct initializer");
break;
}
@@ -6688,7 +6717,8 @@ process_init_element (struct c_expr value)
if (constructor_fields == 0)
{
- pedwarn_init ("excess elements in union initializer");
+ pedwarn_init (input_location, 0,
+ "excess elements in union initializer");
break;
}
@@ -6775,7 +6805,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 ("excess elements in array initializer");
+ pedwarn_init (input_location, 0,
+ "excess elements in array initializer");
break;
}
@@ -6805,7 +6836,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 ("excess elements in vector initializer");
+ pedwarn_init (input_location, 0,
+ "excess elements in vector initializer");
break;
}
@@ -6829,7 +6861,8 @@ process_init_element (struct c_expr value)
else if (constructor_type != error_mark_node
&& constructor_fields == 0)
{
- pedwarn_init ("excess elements in scalar initializer");
+ pedwarn_init (input_location, 0,
+ "excess elements in scalar initializer");
break;
}
else
@@ -7060,8 +7093,7 @@ c_finish_goto_label (tree label)
tree
c_finish_goto_ptr (tree expr)
{
- if (pedantic)
- pedwarn ("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));
}
@@ -7084,7 +7116,8 @@ c_finish_return (tree retval)
if ((warn_return_type || flag_isoc99)
&& valtype != 0 && TREE_CODE (valtype) != VOID_TYPE)
{
- pedwarn_c99 ("%<return%> with no value, in "
+ pedwarn_c99 (input_location, flag_isoc99 ? 0 : OPT_Wreturn_type,
+ "%<return%> with no value, in "
"function returning non-void");
no_warning = true;
}
@@ -7093,9 +7126,11 @@ c_finish_return (tree retval)
{
current_function_returns_null = 1;
if (TREE_CODE (TREE_TYPE (retval)) != VOID_TYPE)
- pedwarn ("%<return%> with a value, in function returning void");
- else if (pedantic)
- pedwarn ("ISO C forbids %<return%> with expression, in function returning void");
+ pedwarn (input_location, 0,
+ "%<return%> with a value, in function returning void");
+ else
+ pedwarn (input_location, OPT_pedantic, "ISO C forbids "
+ "%<return%> with expression, in function returning void");
}
else
{
@@ -7162,6 +7197,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);
@@ -7239,6 +7277,9 @@ c_start_case (tree exp)
"converted to %<int%> in ISO C");
exp = default_conversion (exp);
+
+ if (warn_sequence_point)
+ verify_sequence_points (exp);
}
}
@@ -8165,20 +8206,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 ("ISO C forbids comparison of %<void *%>"
- " with function pointer");
+ 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 ("ISO C forbids comparison of %<void *%>"
- " with function pointer");
+ 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 ("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;
@@ -8202,12 +8244,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 ("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 ("comparison between pointer and integer");
+ pedwarn (input_location, 0, "comparison between pointer and integer");
}
break;
@@ -8228,38 +8270,44 @@ 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 ("comparison of complete and incomplete pointers");
- else if (pedantic
- && TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE)
- pedwarn ("ISO C forbids ordered comparisons of pointers to functions");
+ pedwarn (input_location, 0,
+ "comparison of complete and incomplete pointers");
+ else if (TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE)
+ pedwarn (input_location, OPT_pedantic, "ISO C forbids "
+ "ordered comparisons of pointers to functions");
}
else
{
result_type = ptr_type_node;
- pedwarn ("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 || extra_warnings)
- pedwarn ("ordered comparison of pointer with integer zero");
+ if (pedantic)
+ pedwarn (input_location, OPT_pedantic,
+ "ordered comparison of pointer with integer zero");
+ else if (extra_warnings)
+ warning (OPT_Wextra,
+ "ordered comparison of pointer with integer zero");
}
else if (code1 == POINTER_TYPE && null_pointer_constant_p (orig_op0))
{
result_type = type1;
- if (pedantic)
- pedwarn ("ordered comparison of pointer with integer zero");
+ pedwarn (input_location, OPT_pedantic,
+ "ordered comparison of pointer with integer zero");
}
else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE)
{
result_type = type0;
- pedwarn ("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 ("comparison between pointer and integer");
+ pedwarn (input_location, 0, "comparison between pointer and integer");
}
break;
@@ -8307,93 +8355,9 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
if (shorten && none_complex)
{
- int unsigned0, unsigned1;
- tree arg0, arg1;
- int uns;
- tree type;
-
- /* Cast OP0 and OP1 to RESULT_TYPE. Doing so prevents
- excessive narrowing when we call get_narrower below. For
- example, suppose that OP0 is of unsigned int extended
- from signed char and that RESULT_TYPE is long long int.
- If we explicitly cast OP0 to RESULT_TYPE, OP0 would look
- like
-
- (long long int) (unsigned int) signed_char
-
- which get_narrower would narrow down to
-
- (unsigned int) signed char
-
- If we do not cast OP0 first, get_narrower would return
- signed_char, which is inconsistent with the case of the
- explicit cast. */
- op0 = convert (result_type, op0);
- op1 = convert (result_type, op1);
-
- arg0 = get_narrower (op0, &unsigned0);
- arg1 = get_narrower (op1, &unsigned1);
-
- /* UNS is 1 if the operation to be done is an unsigned one. */
- uns = TYPE_UNSIGNED (result_type);
-
final_type = result_type;
-
- /* Handle the case that OP0 (or OP1) does not *contain* a conversion
- but it *requires* conversion to FINAL_TYPE. */
-
- if ((TYPE_PRECISION (TREE_TYPE (op0))
- == TYPE_PRECISION (TREE_TYPE (arg0)))
- && TREE_TYPE (op0) != final_type)
- unsigned0 = TYPE_UNSIGNED (TREE_TYPE (op0));
- if ((TYPE_PRECISION (TREE_TYPE (op1))
- == TYPE_PRECISION (TREE_TYPE (arg1)))
- && TREE_TYPE (op1) != final_type)
- unsigned1 = TYPE_UNSIGNED (TREE_TYPE (op1));
-
- /* Now UNSIGNED0 is 1 if ARG0 zero-extends to FINAL_TYPE. */
-
- /* For bitwise operations, signedness of nominal type
- does not matter. Consider only how operands were extended. */
- if (shorten == -1)
- uns = unsigned0;
-
- /* Note that in all three cases below we refrain from optimizing
- an unsigned operation on sign-extended args.
- That would not be valid. */
-
- /* Both args variable: if both extended in same way
- from same width, do it in that width.
- Do it unsigned if args were zero-extended. */
- if ((TYPE_PRECISION (TREE_TYPE (arg0))
- < TYPE_PRECISION (result_type))
- && (TYPE_PRECISION (TREE_TYPE (arg1))
- == TYPE_PRECISION (TREE_TYPE (arg0)))
- && unsigned0 == unsigned1
- && (unsigned0 || !uns))
- result_type
- = c_common_signed_or_unsigned_type
- (unsigned0, common_type (TREE_TYPE (arg0), TREE_TYPE (arg1)));
- else if (TREE_CODE (arg0) == INTEGER_CST
- && (unsigned1 || !uns)
- && (TYPE_PRECISION (TREE_TYPE (arg1))
- < TYPE_PRECISION (result_type))
- && (type
- = c_common_signed_or_unsigned_type (unsigned1,
- TREE_TYPE (arg1)))
- && !POINTER_TYPE_P (type)
- && int_fits_type_p (arg0, type))
- result_type = type;
- else if (TREE_CODE (arg1) == INTEGER_CST
- && (unsigned0 || !uns)
- && (TYPE_PRECISION (TREE_TYPE (arg0))
- < TYPE_PRECISION (result_type))
- && (type
- = c_common_signed_or_unsigned_type (unsigned0,
- TREE_TYPE (arg0)))
- && !POINTER_TYPE_P (type)
- && int_fits_type_p (arg1, type))
- result_type = type;
+ result_type = shorten_binary_op (result_type, op0, op1,
+ shorten == -1);
}
/* Shifts can be shortened if shifting right. */
@@ -8447,124 +8411,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/caller-save.c b/gcc/caller-save.c
index 233caca74f2..ee8a0dc6631 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -1,6 +1,6 @@
/* Save and restore call-clobbered registers which are live across a call.
Copyright (C) 1989, 1992, 1994, 1995, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
@@ -35,9 +35,14 @@ along with GCC; see the file COPYING3. If not see
#include "toplev.h"
#include "tm_p.h"
#include "addresses.h"
+#include "output.h"
#include "df.h"
#include "ggc.h"
+/* Call used hard registers which can not be saved because there is no
+ insn for this. */
+HARD_REG_SET no_caller_save_reg_set;
+
#ifndef MAX_MOVE_MAX
#define MAX_MOVE_MAX MOVE_MAX
#endif
@@ -62,6 +67,12 @@ static enum machine_mode
static rtx
regno_save_mem[FIRST_PSEUDO_REGISTER][MAX_MOVE_MAX / MIN_UNITS_PER_WORD + 1];
+/* The number of elements in the subsequent array. */
+static int save_slots_num;
+
+/* Allocated slots so far. */
+static rtx save_slots[FIRST_PSEUDO_REGISTER];
+
/* We will only make a register eligible for caller-save if it can be
saved in its widest mode with a simple SET insn as long as the memory
address is valid. We record the INSN_CODE is those insns here since
@@ -86,7 +97,17 @@ static int n_regs_saved;
static HARD_REG_SET referenced_regs;
+static int reg_save_code (int, enum machine_mode);
+static int reg_restore_code (int, enum machine_mode);
+
+struct saved_hard_reg;
+static void initiate_saved_hard_regs (void);
+static struct saved_hard_reg *new_saved_hard_reg (int, int);
+static void finish_saved_hard_regs (void);
+static int saved_hard_reg_compare_func (const void *, const void *);
+
static void mark_set_regs (rtx, const_rtx, void *);
+static void add_stored_regs (rtx, const_rtx, void *);
static void mark_referenced_regs (rtx);
static int insert_save (struct insn_chain *, int, int, HARD_REG_SET *,
enum machine_mode *);
@@ -95,7 +116,9 @@ static int insert_restore (struct insn_chain *, int, int, int,
static struct insn_chain *insert_one_insn (struct insn_chain *, int, int,
rtx);
static void add_stored_regs (rtx, const_rtx, void *);
+
+
static GTY(()) rtx savepat;
static GTY(()) rtx restpat;
static GTY(()) rtx test_reg;
@@ -180,6 +203,7 @@ init_caller_save (void)
rtx address;
int i, j;
+ CLEAR_HARD_REG_SET (no_caller_save_reg_set);
/* First find all the registers that we need to deal with and all
the modes that they can have. If we can't find a mode to use,
we can't have the register live over calls. */
@@ -217,7 +241,7 @@ init_caller_save (void)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (TEST_HARD_REG_BIT
(reg_class_contents
- [(int) base_reg_class (regno_save_mode [i][1], PLUS, CONST_INT)], i))
+ [(int) base_reg_class (regno_save_mode[i][1], PLUS, CONST_INT)], i))
break;
gcc_assert (i < FIRST_PSEUDO_REGISTER);
@@ -264,10 +288,14 @@ init_caller_save (void)
{
call_fixed_regs[i] = 1;
SET_HARD_REG_BIT (call_fixed_reg_set, i);
+ if (call_used_regs[i])
+ SET_HARD_REG_BIT (no_caller_save_reg_set, i);
}
}
}
+
+
/* Initialize save areas by showing that we haven't allocated any yet. */
void
@@ -278,6 +306,100 @@ init_save_areas (void)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
for (j = 1; j <= MOVE_MAX_WORDS; j++)
regno_save_mem[i][j] = 0;
+ save_slots_num = 0;
+
+}
+
+/* The structure represents a hard register which should be saved
+ through the call. It is used when the integrated register
+ allocator (IRA) is used and sharing save slots is on. */
+struct saved_hard_reg
+{
+ /* Order number starting with 0. */
+ int num;
+ /* The hard regno. */
+ int hard_regno;
+ /* Execution frequency of all calls through which given hard
+ register should be saved. */
+ int call_freq;
+ /* Stack slot reserved to save the hard register through calls. */
+ rtx slot;
+ /* True if it is first hard register in the chain of hard registers
+ sharing the same stack slot. */
+ int first_p;
+ /* Order number of the next hard register structure with the same
+ slot in the chain. -1 represents end of the chain. */
+ int next;
+};
+
+/* Map: hard register number to the corresponding structure. */
+static struct saved_hard_reg *hard_reg_map[FIRST_PSEUDO_REGISTER];
+
+/* The number of all structures representing hard registers should be
+ saved, in order words, the number of used elements in the following
+ array. */
+static int saved_regs_num;
+
+/* Pointers to all the structures. Index is the order number of the
+ corresponding structure. */
+static struct saved_hard_reg *all_saved_regs[FIRST_PSEUDO_REGISTER];
+
+/* First called function for work with saved hard registers. */
+static void
+initiate_saved_hard_regs (void)
+{
+ int i;
+
+ saved_regs_num = 0;
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ hard_reg_map[i] = NULL;
+}
+
+/* Allocate and return new saved hard register with given REGNO and
+ CALL_FREQ. */
+static struct saved_hard_reg *
+new_saved_hard_reg (int regno, int call_freq)
+{
+ struct saved_hard_reg *saved_reg;
+
+ saved_reg
+ = (struct saved_hard_reg *) xmalloc (sizeof (struct saved_hard_reg));
+ hard_reg_map[regno] = all_saved_regs[saved_regs_num] = saved_reg;
+ saved_reg->num = saved_regs_num++;
+ saved_reg->hard_regno = regno;
+ saved_reg->call_freq = call_freq;
+ saved_reg->first_p = FALSE;
+ saved_reg->next = -1;
+ return saved_reg;
+}
+
+/* Free memory allocated for the saved hard registers. */
+static void
+finish_saved_hard_regs (void)
+{
+ int i;
+
+ for (i = 0; i < saved_regs_num; i++)
+ free (all_saved_regs[i]);
+}
+
+/* The function is used to sort the saved hard register structures
+ according their frequency. */
+static int
+saved_hard_reg_compare_func (const void *v1p, const void *v2p)
+{
+ const struct saved_hard_reg *p1 = *(struct saved_hard_reg * const *) v1p;
+ const struct saved_hard_reg *p2 = *(struct saved_hard_reg * const *) v2p;
+
+ if (flag_omit_frame_pointer)
+ {
+ if (p1->call_freq - p2->call_freq != 0)
+ return p1->call_freq - p2->call_freq;
+ }
+ else if (p2->call_freq - p1->call_freq != 0)
+ return p2->call_freq - p1->call_freq;
+
+ return p1->num - p2->num;
}
/* Allocate save areas for any hard registers that might need saving.
@@ -286,6 +408,10 @@ init_save_areas (void)
overestimate slightly (especially if some of these registers are later
used as spill registers), but it should not be significant.
+ For IRA we use priority coloring to decrease stack slots needed for
+ saving hard registers through calls. We build conflicts for them
+ to do coloring.
+
Future work:
In the fallback case we should iterate backwards across all possible
@@ -317,59 +443,297 @@ setup_save_areas (void)
unsigned int regno = reg_renumber[i];
unsigned int endregno
= end_hard_regno (GET_MODE (regno_reg_rtx[i]), regno);
-
for (r = regno; r < endregno; r++)
if (call_used_regs[r])
SET_HARD_REG_BIT (hard_regs_used, r);
}
- /* Now run through all the call-used hard-registers and allocate
- space for them in the caller-save area. Try to allocate space
- in a manner which allows multi-register saves/restores to be done. */
-
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- for (j = MOVE_MAX_WORDS; j > 0; j--)
- {
- int do_save = 1;
-
- /* If no mode exists for this size, try another. Also break out
- if we have already saved this hard register. */
- if (regno_save_mode[i][j] == VOIDmode || regno_save_mem[i][1] != 0)
- continue;
-
- /* See if any register in this group has been saved. */
- for (k = 0; k < j; k++)
- if (regno_save_mem[i + k][1])
+ if (flag_ira && optimize && flag_ira_share_save_slots)
+ {
+ rtx insn, slot;
+ struct insn_chain *chain, *next;
+ char *saved_reg_conflicts;
+ unsigned int regno;
+ int next_k, freq;
+ struct saved_hard_reg *saved_reg, *saved_reg2, *saved_reg3;
+ int call_saved_regs_num;
+ struct saved_hard_reg *call_saved_regs[FIRST_PSEUDO_REGISTER];
+ HARD_REG_SET hard_regs_to_save, used_regs, this_insn_sets;
+ reg_set_iterator rsi;
+ int best_slot_num;
+ int prev_save_slots_num;
+ rtx prev_save_slots[FIRST_PSEUDO_REGISTER];
+
+ initiate_saved_hard_regs ();
+ /* Create hard reg saved regs. */
+ for (chain = reload_insn_chain; chain != 0; chain = next)
+ {
+ insn = chain->insn;
+ next = chain->next;
+ if (GET_CODE (insn) != CALL_INSN
+ || find_reg_note (insn, REG_NORETURN, NULL))
+ continue;
+ freq = REG_FREQ_FROM_BB (BLOCK_FOR_INSN (insn));
+ REG_SET_TO_HARD_REG_SET (hard_regs_to_save,
+ &chain->live_throughout);
+ COPY_HARD_REG_SET (used_regs, call_used_reg_set);
+
+ /* Record all registers set in this call insn. These don't
+ need to be saved. N.B. the call insn might set a subreg
+ of a multi-hard-reg pseudo; then the pseudo is considered
+ live during the call, but the subreg that is set
+ isn't. */
+ CLEAR_HARD_REG_SET (this_insn_sets);
+ note_stores (PATTERN (insn), mark_set_regs, &this_insn_sets);
+ /* Sibcalls are considered to set the return value. */
+ if (SIBLING_CALL_P (insn) && crtl->return_rtx)
+ mark_set_regs (crtl->return_rtx, NULL_RTX, &this_insn_sets);
+
+ AND_COMPL_HARD_REG_SET (used_regs, call_fixed_reg_set);
+ AND_COMPL_HARD_REG_SET (used_regs, this_insn_sets);
+ AND_HARD_REG_SET (hard_regs_to_save, used_regs);
+ for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
+ if (TEST_HARD_REG_BIT (hard_regs_to_save, regno))
+ {
+ if (hard_reg_map[regno] != NULL)
+ hard_reg_map[regno]->call_freq += freq;
+ else
+ saved_reg = new_saved_hard_reg (regno, freq);
+ }
+ /* Look through all live pseudos, mark their hard registers. */
+ EXECUTE_IF_SET_IN_REG_SET
+ (&chain->live_throughout, FIRST_PSEUDO_REGISTER, regno, rsi)
{
- do_save = 0;
- break;
+ int r = reg_renumber[regno];
+ int bound;
+
+ if (r < 0)
+ continue;
+
+ bound = r + hard_regno_nregs[r][PSEUDO_REGNO_MODE (regno)];
+ for (; r < bound; r++)
+ if (TEST_HARD_REG_BIT (used_regs, r))
+ {
+ if (hard_reg_map[r] != NULL)
+ hard_reg_map[r]->call_freq += freq;
+ else
+ saved_reg = new_saved_hard_reg (r, freq);
+ SET_HARD_REG_BIT (hard_regs_to_save, r);
+ }
}
- if (! do_save)
- continue;
+ }
+ /* Find saved hard register conflicts. */
+ saved_reg_conflicts = (char *) xmalloc (saved_regs_num * saved_regs_num);
+ memset (saved_reg_conflicts, 0, saved_regs_num * saved_regs_num);
+ for (chain = reload_insn_chain; chain != 0; chain = next)
+ {
+ call_saved_regs_num = 0;
+ insn = chain->insn;
+ next = chain->next;
+ if (GET_CODE (insn) != CALL_INSN
+ || find_reg_note (insn, REG_NORETURN, NULL))
+ continue;
+ REG_SET_TO_HARD_REG_SET (hard_regs_to_save,
+ &chain->live_throughout);
+ COPY_HARD_REG_SET (used_regs, call_used_reg_set);
+
+ /* Record all registers set in this call insn. These don't
+ need to be saved. N.B. the call insn might set a subreg
+ of a multi-hard-reg pseudo; then the pseudo is considered
+ live during the call, but the subreg that is set
+ isn't. */
+ CLEAR_HARD_REG_SET (this_insn_sets);
+ note_stores (PATTERN (insn), mark_set_regs, &this_insn_sets);
+ /* Sibcalls are considered to set the return value,
+ compare flow.c:propagate_one_insn. */
+ if (SIBLING_CALL_P (insn) && crtl->return_rtx)
+ mark_set_regs (crtl->return_rtx, NULL_RTX, &this_insn_sets);
+
+ AND_COMPL_HARD_REG_SET (used_regs, call_fixed_reg_set);
+ AND_COMPL_HARD_REG_SET (used_regs, this_insn_sets);
+ AND_HARD_REG_SET (hard_regs_to_save, used_regs);
+ for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
+ if (TEST_HARD_REG_BIT (hard_regs_to_save, regno))
+ {
+ gcc_assert (hard_reg_map[regno] != NULL);
+ call_saved_regs[call_saved_regs_num++] = hard_reg_map[regno];
+ }
+ /* Look through all live pseudos, mark their hard registers. */
+ EXECUTE_IF_SET_IN_REG_SET
+ (&chain->live_throughout, FIRST_PSEUDO_REGISTER, regno, rsi)
+ {
+ int r = reg_renumber[regno];
+ int bound;
+
+ if (r < 0)
+ continue;
- for (k = 0; k < j; k++)
- if (! TEST_HARD_REG_BIT (hard_regs_used, i + k))
+ bound = r + hard_regno_nregs[r][PSEUDO_REGNO_MODE (regno)];
+ for (; r < bound; r++)
+ if (TEST_HARD_REG_BIT (used_regs, r))
+ call_saved_regs[call_saved_regs_num++] = hard_reg_map[r];
+ }
+ for (i = 0; i < call_saved_regs_num; i++)
{
- do_save = 0;
- break;
+ saved_reg = call_saved_regs[i];
+ for (j = 0; j < call_saved_regs_num; j++)
+ if (i != j)
+ {
+ saved_reg2 = call_saved_regs[j];
+ saved_reg_conflicts[saved_reg->num * saved_regs_num
+ + saved_reg2->num]
+ = saved_reg_conflicts[saved_reg2->num * saved_regs_num
+ + saved_reg->num]
+ = TRUE;
+ }
}
- if (! do_save)
- continue;
-
- /* We have found an acceptable mode to store in. */
- regno_save_mem[i][j]
- = assign_stack_local (regno_save_mode[i][j],
- GET_MODE_SIZE (regno_save_mode[i][j]), 0);
-
- /* Setup single word save area just in case... */
- for (k = 0; k < j; k++)
- /* This should not depend on WORDS_BIG_ENDIAN.
- The order of words in regs is the same as in memory. */
- regno_save_mem[i + k][1]
- = adjust_address_nv (regno_save_mem[i][j],
- regno_save_mode[i + k][1],
- k * UNITS_PER_WORD);
- }
+ }
+ /* Sort saved hard regs. */
+ qsort (all_saved_regs, saved_regs_num, sizeof (struct saved_hard_reg *),
+ saved_hard_reg_compare_func);
+ /* Initiate slots available from the previous reload
+ iteration. */
+ prev_save_slots_num = save_slots_num;
+ memcpy (prev_save_slots, save_slots, save_slots_num * sizeof (rtx));
+ save_slots_num = 0;
+ /* Allocate stack slots for the saved hard registers. */
+ for (i = 0; i < saved_regs_num; i++)
+ {
+ saved_reg = all_saved_regs[i];
+ regno = saved_reg->hard_regno;
+ for (j = 0; j < i; j++)
+ {
+ saved_reg2 = all_saved_regs[j];
+ if (! saved_reg2->first_p)
+ continue;
+ slot = saved_reg2->slot;
+ for (k = j; k >= 0; k = next_k)
+ {
+ saved_reg3 = all_saved_regs[k];
+ next_k = saved_reg3->next;
+ if (saved_reg_conflicts[saved_reg->num * saved_regs_num
+ + saved_reg3->num])
+ break;
+ }
+ if (k < 0
+ && (GET_MODE_SIZE (regno_save_mode[regno][1])
+ <= GET_MODE_SIZE (regno_save_mode
+ [saved_reg2->hard_regno][1])))
+ {
+ saved_reg->slot
+ = adjust_address_nv
+ (slot, regno_save_mode[saved_reg->hard_regno][1], 0);
+ regno_save_mem[regno][1] = saved_reg->slot;
+ saved_reg->next = saved_reg2->next;
+ saved_reg2->next = i;
+ if (dump_file != NULL)
+ fprintf (dump_file, "%d uses slot of %d\n",
+ regno, saved_reg2->hard_regno);
+ break;
+ }
+ }
+ if (j == i)
+ {
+ saved_reg->first_p = TRUE;
+ for (best_slot_num = -1, j = 0; j < prev_save_slots_num; j++)
+ {
+ slot = prev_save_slots[j];
+ if (slot == NULL_RTX)
+ continue;
+ if (GET_MODE_SIZE (regno_save_mode[regno][1])
+ <= GET_MODE_SIZE (GET_MODE (slot))
+ && best_slot_num < 0)
+ best_slot_num = j;
+ if (GET_MODE (slot) == regno_save_mode[regno][1])
+ break;
+ }
+ if (best_slot_num >= 0)
+ {
+ saved_reg->slot = prev_save_slots[best_slot_num];
+ saved_reg->slot
+ = adjust_address_nv
+ (saved_reg->slot,
+ regno_save_mode[saved_reg->hard_regno][1], 0);
+ if (dump_file != NULL)
+ fprintf (dump_file,
+ "%d uses a slot from prev iteration\n", regno);
+ prev_save_slots[best_slot_num] = NULL_RTX;
+ if (best_slot_num + 1 == prev_save_slots_num)
+ prev_save_slots_num--;
+ }
+ else
+ {
+ saved_reg->slot
+ = assign_stack_local_1
+ (regno_save_mode[regno][1],
+ GET_MODE_SIZE (regno_save_mode[regno][1]), 0, true);
+ if (dump_file != NULL)
+ fprintf (dump_file, "%d uses a new slot\n", regno);
+ }
+ regno_save_mem[regno][1] = saved_reg->slot;
+ save_slots[save_slots_num++] = saved_reg->slot;
+ }
+ }
+ free (saved_reg_conflicts);
+ finish_saved_hard_regs ();
+ }
+ else
+ {
+ /* Now run through all the call-used hard-registers and allocate
+ space for them in the caller-save area. Try to allocate space
+ in a manner which allows multi-register saves/restores to be done. */
+
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ for (j = MOVE_MAX_WORDS; j > 0; j--)
+ {
+ int do_save = 1;
+
+ /* If no mode exists for this size, try another. Also break out
+ if we have already saved this hard register. */
+ if (regno_save_mode[i][j] == VOIDmode || regno_save_mem[i][1] != 0)
+ continue;
+
+ /* See if any register in this group has been saved. */
+ for (k = 0; k < j; k++)
+ if (regno_save_mem[i + k][1])
+ {
+ do_save = 0;
+ break;
+ }
+ if (! do_save)
+ continue;
+
+ for (k = 0; k < j; k++)
+ if (! TEST_HARD_REG_BIT (hard_regs_used, i + k))
+ {
+ do_save = 0;
+ break;
+ }
+ if (! do_save)
+ continue;
+
+ /* We have found an acceptable mode to store in. Since
+ hard register is always saved in the widest mode
+ available, the mode may be wider than necessary, it is
+ OK to reduce the alignment of spill space. We will
+ verify that it is equal to or greater than required
+ when we restore and save the hard register in
+ insert_restore and insert_save. */
+ regno_save_mem[i][j]
+ = assign_stack_local_1 (regno_save_mode[i][j],
+ GET_MODE_SIZE (regno_save_mode[i][j]),
+ 0, true);
+
+ /* Setup single word save area just in case... */
+ for (k = 0; k < j; k++)
+ /* This should not depend on WORDS_BIG_ENDIAN.
+ The order of words in regs is the same as in memory. */
+ regno_save_mem[i + k][1]
+ = adjust_address_nv (regno_save_mem[i][j],
+ regno_save_mode[i + k][1],
+ k * UNITS_PER_WORD);
+ }
+ }
/* Now loop again and set the alias set of any save areas we made to
the alias set used to represent frame objects. */
@@ -378,7 +742,9 @@ setup_save_areas (void)
if (regno_save_mem[i][j] != 0)
set_mem_alias_set (regno_save_mem[i][j], get_frame_alias_set ());
}
+
+
/* Find the places where hard regs are live across calls and save them. */
void
@@ -455,7 +821,8 @@ save_call_clobbered_regs (void)
int nregs;
enum machine_mode mode;
- gcc_assert (r >= 0);
+ if (r < 0)
+ continue;
nregs = hard_regno_nregs[r][PSEUDO_REGNO_MODE (regno)];
mode = HARD_REGNO_CALLER_SAVE_MODE
(r, nregs, PSEUDO_REGNO_MODE (regno));
@@ -491,7 +858,7 @@ save_call_clobbered_regs (void)
}
}
- if (chain->next == 0 || chain->next->block > chain->block)
+ if (chain->next == 0 || chain->next->block != chain->block)
{
int regno;
/* At the end of the basic block, we must restore any registers that
@@ -707,7 +1074,8 @@ insert_restore (struct insn_chain *chain, int before_p, int regno,
/* Verify that the alignment of spill space is equal to or greater
than required. */
- gcc_assert (GET_MODE_ALIGNMENT (GET_MODE (mem)) <= MEM_ALIGN (mem));
+ gcc_assert (MIN (MAX_SUPPORTED_STACK_ALIGNMENT,
+ GET_MODE_ALIGNMENT (GET_MODE (mem))) <= MEM_ALIGN (mem));
pat = gen_rtx_SET (VOIDmode,
gen_rtx_REG (GET_MODE (mem),
@@ -784,7 +1152,8 @@ insert_save (struct insn_chain *chain, int before_p, int regno,
/* Verify that the alignment of spill space is equal to or greater
than required. */
- gcc_assert (GET_MODE_ALIGNMENT (GET_MODE (mem)) <= MEM_ALIGN (mem));
+ gcc_assert (MIN (MAX_SUPPORTED_STACK_ALIGNMENT,
+ GET_MODE_ALIGNMENT (GET_MODE (mem))) <= MEM_ALIGN (mem));
pat = gen_rtx_SET (VOIDmode, mem,
gen_rtx_REG (GET_MODE (mem),
diff --git a/gcc/calls.c b/gcc/calls.c
index a4470fa1477..3f322445560 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h"
#include "rtl.h"
#include "tree.h"
+#include "gimple.h"
#include "flags.h"
#include "expr.h"
#include "optabs.h"
@@ -41,6 +42,7 @@ along with GCC; see the file COPYING3. If not see
#include "cgraph.h"
#include "except.h"
#include "dbgcnt.h"
+#include "tree-flow.h"
/* Like PREFERRED_STACK_BOUNDARY but in units of bytes, not bits. */
#define STACK_BYTES (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT)
@@ -380,7 +382,7 @@ emit_call_1 (rtx funexp, tree fntree, tree fndecl ATTRIBUTE_UNUSED,
add_reg_note (call_insn, REG_EH_REGION, const0_rtx);
else
{
- int rn = lookup_stmt_eh_region (fntree);
+ int rn = lookup_expr_eh_region (fntree);
/* If rn < 0, then either (1) tree-ssa not used or (2) doesn't
throw, which we already took care of. */
@@ -413,6 +415,10 @@ emit_call_1 (rtx funexp, tree fntree, tree fndecl ATTRIBUTE_UNUSED,
rounded_stack_size -= n_popped;
rounded_stack_size_rtx = GEN_INT (rounded_stack_size);
stack_pointer_delta -= n_popped;
+
+ /* If popup is needed, stack realign must use DRAP */
+ if (SUPPORTS_STACK_ALIGNMENT)
+ crtl->need_drap = true;
}
if (!ACCUMULATE_OUTGOING_ARGS)
@@ -542,7 +548,26 @@ setjmp_call_p (const_tree fndecl)
return special_function_p (fndecl, 0) & ECF_RETURNS_TWICE;
}
+
+/* Return true if STMT is an alloca call. */
+
+bool
+gimple_alloca_call_p (const_gimple stmt)
+{
+ tree fndecl;
+
+ if (!is_gimple_call (stmt))
+ return false;
+
+ fndecl = gimple_call_fndecl (stmt);
+ if (fndecl && (special_function_p (fndecl, 0) & ECF_MAY_BE_ALLOCA))
+ return true;
+
+ return false;
+}
+
/* Return true when exp contains alloca call. */
+
bool
alloca_call_p (const_tree exp)
{
@@ -1044,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. */
@@ -1852,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)
@@ -1863,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;
}
@@ -2251,7 +2276,7 @@ expand_call (tree exp, rtx target, int ignore)
if (currently_expanding_call++ != 0
|| !flag_optimize_sibling_calls
|| args_size.var
- || lookup_stmt_eh_region (exp) >= 0
+ || lookup_expr_eh_region (exp) >= 0
|| dbg_cnt (tail_call) == false)
try_tail_call = 0;
@@ -2294,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;
@@ -2384,7 +2412,7 @@ expand_call (tree exp, rtx target, int ignore)
incoming argument block. */
if (pass == 0)
{
- argblock = virtual_incoming_args_rtx;
+ argblock = crtl->args.internal_arg_pointer;
argblock
#ifdef STACK_GROWS_DOWNWARD
= plus_constant (argblock, crtl->args.pretend_args_size);
@@ -3229,7 +3257,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value,
#ifdef REG_PARM_STACK_SPACE
/* Define the boundary of the register parm stack space that needs to be
save, if any. */
- int low_to_save, high_to_save;
+ int low_to_save = 0, high_to_save = 0;
rtx save_area = 0; /* Place that it is saved. */
#endif
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index c5c7950f835..a778e28e386 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -1235,9 +1235,8 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
we require the existing branches to have probabilities that are
roughly similar. */
if (match
- && !optimize_size
- && maybe_hot_bb_p (bb1)
- && maybe_hot_bb_p (bb2))
+ && optimize_bb_for_speed_p (bb1)
+ && optimize_bb_for_speed_p (bb2))
{
int prob2;
@@ -1684,7 +1683,7 @@ try_crossjump_bb (int mode, basic_block bb)
/* Don't crossjump if this block ends in a computed jump,
unless we are optimizing for size. */
- if (!optimize_size
+ if (optimize_bb_for_size_p (bb)
&& bb != EXIT_BLOCK_PTR
&& computed_jump_p (BB_END (bb)))
return false;
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 6a48e1632d7..ac228f9b79f 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -42,6 +42,342 @@ along with GCC; see the file COPYING3. If not see
#include "value-prof.h"
#include "target.h"
+
+/* Return an expression tree corresponding to the RHS of GIMPLE
+ statement STMT. */
+
+tree
+gimple_assign_rhs_to_tree (gimple stmt)
+{
+ tree t;
+ enum gimple_rhs_class grhs_class;
+
+ grhs_class = get_gimple_rhs_class (gimple_expr_code (stmt));
+
+ 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 (grhs_class == GIMPLE_UNARY_RHS)
+ t = build1 (gimple_assign_rhs_code (stmt),
+ TREE_TYPE (gimple_assign_lhs (stmt)),
+ gimple_assign_rhs1 (stmt));
+ else if (grhs_class == GIMPLE_SINGLE_RHS)
+ t = gimple_assign_rhs1 (stmt);
+ else
+ gcc_unreachable ();
+
+ return t;
+}
+
+/* Return an expression tree corresponding to the PREDICATE of GIMPLE_COND
+ statement STMT. */
+
+static tree
+gimple_cond_pred_to_tree (gimple stmt)
+{
+ return build2 (gimple_cond_code (stmt), boolean_type_node,
+ gimple_cond_lhs (stmt), gimple_cond_rhs (stmt));
+}
+
+/* Helper for gimple_to_tree. Set EXPR_LOCATION for every expression
+ inside *TP. DATA is the location to set. */
+
+static tree
+set_expr_location_r (tree *tp, int *ws ATTRIBUTE_UNUSED, void *data)
+{
+ location_t *loc = (location_t *) data;
+ if (EXPR_P (*tp))
+ SET_EXPR_LOCATION (*tp, *loc);
+
+ return NULL_TREE;
+}
+
+
+/* RTL expansion has traditionally been done on trees, so the
+ transition to doing it on GIMPLE tuples is very invasive to the RTL
+ expander. To facilitate the transition, this function takes a
+ GIMPLE tuple STMT and returns the same statement in the form of a
+ tree. */
+
+static tree
+gimple_to_tree (gimple stmt)
+{
+ tree t;
+ int rn;
+ tree_ann_common_t ann;
+ location_t loc;
+
+ switch (gimple_code (stmt))
+ {
+ case GIMPLE_ASSIGN:
+ {
+ tree lhs = gimple_assign_lhs (stmt);
+
+ t = gimple_assign_rhs_to_tree (stmt);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (lhs), lhs, t);
+ if (gimple_assign_nontemporal_move_p (stmt))
+ MOVE_NONTEMPORAL (t) = true;
+ }
+ break;
+
+ case GIMPLE_COND:
+ t = gimple_cond_pred_to_tree (stmt);
+ t = build3 (COND_EXPR, void_type_node, t, NULL_TREE, NULL_TREE);
+ break;
+
+ case GIMPLE_GOTO:
+ t = build1 (GOTO_EXPR, void_type_node, gimple_goto_dest (stmt));
+ break;
+
+ case GIMPLE_LABEL:
+ t = build1 (LABEL_EXPR, void_type_node, gimple_label_label (stmt));
+ break;
+
+ case GIMPLE_RETURN:
+ {
+ tree retval = gimple_return_retval (stmt);
+
+ if (retval && retval != error_mark_node)
+ {
+ tree result = DECL_RESULT (current_function_decl);
+
+ /* If we are not returning the current function's RESULT_DECL,
+ build an assignment to it. */
+ if (retval != result)
+ {
+ /* I believe that a function's RESULT_DECL is unique. */
+ gcc_assert (TREE_CODE (retval) != RESULT_DECL);
+
+ retval = build2 (MODIFY_EXPR, TREE_TYPE (result),
+ result, retval);
+ }
+ }
+ t = build1 (RETURN_EXPR, void_type_node, retval);
+ }
+ break;
+
+ case GIMPLE_ASM:
+ {
+ size_t i, n;
+ tree out, in, cl;
+ const char *s;
+
+ out = NULL_TREE;
+ n = gimple_asm_noutputs (stmt);
+ if (n > 0)
+ {
+ t = out = gimple_asm_output_op (stmt, 0);
+ for (i = 1; i < n; i++)
+ {
+ TREE_CHAIN (t) = gimple_asm_output_op (stmt, i);
+ t = gimple_asm_output_op (stmt, i);
+ }
+ }
+
+ in = NULL_TREE;
+ n = gimple_asm_ninputs (stmt);
+ if (n > 0)
+ {
+ t = in = gimple_asm_input_op (stmt, 0);
+ for (i = 1; i < n; i++)
+ {
+ TREE_CHAIN (t) = gimple_asm_input_op (stmt, i);
+ t = gimple_asm_input_op (stmt, i);
+ }
+ }
+
+ cl = NULL_TREE;
+ n = gimple_asm_nclobbers (stmt);
+ if (n > 0)
+ {
+ t = cl = gimple_asm_clobber_op (stmt, 0);
+ for (i = 1; i < n; i++)
+ {
+ TREE_CHAIN (t) = gimple_asm_clobber_op (stmt, i);
+ t = gimple_asm_clobber_op (stmt, i);
+ }
+ }
+
+ s = gimple_asm_string (stmt);
+ t = build4 (ASM_EXPR, void_type_node, build_string (strlen (s), s),
+ out, in, cl);
+ ASM_VOLATILE_P (t) = gimple_asm_volatile_p (stmt);
+ ASM_INPUT_P (t) = gimple_asm_input_p (stmt);
+ }
+ break;
+
+ case GIMPLE_CALL:
+ {
+ size_t i;
+ tree fn;
+ tree_ann_common_t ann;
+
+ t = build_vl_exp (CALL_EXPR, gimple_call_num_args (stmt) + 3);
+
+ 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++)
+ CALL_EXPR_ARG (t, i) = gimple_call_arg (stmt, i);
+
+ if (!(gimple_call_flags (stmt) & (ECF_CONST | ECF_PURE)))
+ TREE_SIDE_EFFECTS (t) = 1;
+
+ if (gimple_call_flags (stmt) & ECF_NOTHROW)
+ TREE_NOTHROW (t) = 1;
+
+ CALL_EXPR_TAILCALL (t) = gimple_call_tail_p (stmt);
+ CALL_EXPR_RETURN_SLOT_OPT (t) = gimple_call_return_slot_opt_p (stmt);
+ CALL_FROM_THUNK_P (t) = gimple_call_from_thunk_p (stmt);
+ CALL_CANNOT_INLINE_P (t) = gimple_call_cannot_inline_p (stmt);
+ CALL_EXPR_VA_ARG_PACK (t) = gimple_call_va_arg_pack_p (stmt);
+
+ /* If the call has a LHS then create a MODIFY_EXPR to hold it. */
+ {
+ tree lhs = gimple_call_lhs (stmt);
+
+ if (lhs)
+ t = build2 (MODIFY_EXPR, TREE_TYPE (lhs), lhs, t);
+ }
+
+ /* Record the original call statement, as it may be used
+ to retrieve profile information during expansion. */
+
+ if ((fn = gimple_call_fndecl (stmt)) != NULL_TREE
+ && DECL_BUILT_IN (fn))
+ {
+ ann = get_tree_common_ann (t);
+ ann->stmt = stmt;
+ }
+ }
+ break;
+
+ case GIMPLE_SWITCH:
+ {
+ tree label_vec;
+ size_t i;
+ tree elt = gimple_switch_label (stmt, 0);
+
+ label_vec = make_tree_vec (gimple_switch_num_labels (stmt));
+
+ if (!CASE_LOW (elt) && !CASE_HIGH (elt))
+ {
+ for (i = 1; i < gimple_switch_num_labels (stmt); i++)
+ TREE_VEC_ELT (label_vec, i - 1) = gimple_switch_label (stmt, i);
+
+ /* The default case in a SWITCH_EXPR must be at the end of
+ the label vector. */
+ TREE_VEC_ELT (label_vec, i - 1) = gimple_switch_label (stmt, 0);
+ }
+ else
+ {
+ for (i = 0; i < gimple_switch_num_labels (stmt); i++)
+ TREE_VEC_ELT (label_vec, i) = gimple_switch_label (stmt, i);
+ }
+
+ t = build3 (SWITCH_EXPR, void_type_node, gimple_switch_index (stmt),
+ NULL, label_vec);
+ }
+ break;
+
+ case GIMPLE_NOP:
+ case GIMPLE_PREDICT:
+ t = build1 (NOP_EXPR, void_type_node, size_zero_node);
+ break;
+
+ case GIMPLE_RESX:
+ t = build_resx (gimple_resx_region (stmt));
+ break;
+
+ default:
+ if (errorcount == 0)
+ {
+ error ("Unrecognized GIMPLE statement during RTL expansion");
+ print_gimple_stmt (stderr, stmt, 4, 0);
+ gcc_unreachable ();
+ }
+ else
+ {
+ /* Ignore any bad gimple codes if we're going to die anyhow,
+ so we can at least set TREE_ASM_WRITTEN and have the rest
+ of compilation advance without sudden ICE death. */
+ t = build1 (NOP_EXPR, void_type_node, size_zero_node);
+ break;
+ }
+ }
+
+ /* If STMT is inside an exception region, record it in the generated
+ expression. */
+ rn = lookup_stmt_eh_region (stmt);
+ if (rn >= 0)
+ {
+ tree call = get_call_expr_in (t);
+
+ ann = get_tree_common_ann (t);
+ ann->rn = rn;
+
+ /* For a CALL_EXPR on the RHS of an assignment, calls.c looks up
+ the CALL_EXPR not the assignment statment for EH region number. */
+ if (call && call != t)
+ {
+ ann = get_tree_common_ann (call);
+ ann->rn = rn;
+ }
+ }
+
+ /* Set EXPR_LOCATION in all the embedded expressions. */
+ loc = gimple_location (stmt);
+ walk_tree (&t, set_expr_location_r, (void *) &loc, NULL);
+
+ TREE_BLOCK (t) = gimple_block (stmt);
+
+ return t;
+}
+
+
+/* Release back to GC memory allocated by gimple_to_tree. */
+
+static void
+release_stmt_tree (gimple stmt, tree stmt_tree)
+{
+ tree_ann_common_t ann;
+
+ switch (gimple_code (stmt))
+ {
+ case GIMPLE_ASSIGN:
+ if (get_gimple_rhs_class (gimple_expr_code (stmt)) != GIMPLE_SINGLE_RHS)
+ ggc_free (TREE_OPERAND (stmt_tree, 1));
+ break;
+ case GIMPLE_COND:
+ ggc_free (COND_EXPR_COND (stmt_tree));
+ break;
+ case GIMPLE_RETURN:
+ if (TREE_OPERAND (stmt_tree, 0)
+ && TREE_CODE (TREE_OPERAND (stmt_tree, 0)) == MODIFY_EXPR)
+ ggc_free (TREE_OPERAND (stmt_tree, 0));
+ break;
+ case GIMPLE_CALL:
+ if (gimple_call_lhs (stmt))
+ {
+ ann = tree_common_ann (TREE_OPERAND (stmt_tree, 1));
+ if (ann)
+ ggc_free (ann);
+ ggc_free (TREE_OPERAND (stmt_tree, 1));
+ }
+ break;
+ default:
+ break;
+ }
+ ann = tree_common_ann (stmt_tree);
+ if (ann)
+ ggc_free (ann);
+ ggc_free (stmt_tree);
+}
+
+
/* Verify that there is exactly single jump instruction since last and attach
REG_BR_PROB note specifying probability.
??? We really ought to pass the probability down to RTL expanders and let it
@@ -153,10 +489,25 @@ get_decl_align_unit (tree decl)
align = DECL_ALIGN (decl);
align = LOCAL_ALIGNMENT (TREE_TYPE (decl), align);
- if (align > PREFERRED_STACK_BOUNDARY)
- align = PREFERRED_STACK_BOUNDARY;
+
+ if (align > MAX_SUPPORTED_STACK_ALIGNMENT)
+ align = MAX_SUPPORTED_STACK_ALIGNMENT;
+
+ if (SUPPORTS_STACK_ALIGNMENT)
+ {
+ if (crtl->stack_alignment_estimated < align)
+ {
+ gcc_assert(!crtl->stack_realign_processed);
+ crtl->stack_alignment_estimated = align;
+ }
+ }
+
+ /* stack_alignment_needed > PREFERRED_STACK_BOUNDARY is permitted.
+ So here we only make sure stack_alignment_needed >= align. */
if (crtl->stack_alignment_needed < align)
crtl->stack_alignment_needed = align;
+ if (crtl->max_used_stack_slot_alignment < crtl->stack_alignment_needed)
+ crtl->max_used_stack_slot_alignment = crtl->stack_alignment_needed;
return align / BITS_PER_UNIT;
}
@@ -617,28 +968,6 @@ expand_one_stack_var (tree var)
expand_one_stack_var_at (var, offset);
}
-/* A subroutine of expand_one_var. Called to assign rtl
- to a TREE_STATIC VAR_DECL. */
-
-static void
-expand_one_static_var (tree var)
-{
- /* In unit-at-a-time all the static variables are expanded at the end
- of compilation process. */
- if (flag_unit_at_a_time)
- return;
- /* If this is an inlined copy of a static local variable,
- look up the original. */
- var = DECL_ORIGIN (var);
-
- /* If we've already processed this variable because of that, do nothing. */
- if (TREE_ASM_WRITTEN (var))
- return;
-
- /* Otherwise, just emit the variable. */
- rest_of_decl_compilation (var, 0, 0);
-}
-
/* A subroutine of expand_one_var. Called to assign rtl to a VAR_DECL
that will reside in a hard register. */
@@ -735,6 +1064,31 @@ defer_stack_allocation (tree var, bool toplevel)
static HOST_WIDE_INT
expand_one_var (tree var, bool toplevel, bool really_expand)
{
+ if (SUPPORTS_STACK_ALIGNMENT
+ && TREE_TYPE (var) != error_mark_node
+ && TREE_CODE (var) == VAR_DECL)
+ {
+ unsigned int align;
+
+ /* Because we don't know if VAR will be in register or on stack,
+ we conservatively assume it will be on stack even if VAR is
+ eventually put into register after RA pass. For non-automatic
+ variables, which won't be on stack, we collect alignment of
+ type and ignore user specified alignment. */
+ if (TREE_STATIC (var) || DECL_EXTERNAL (var))
+ align = TYPE_ALIGN (TREE_TYPE (var));
+ else
+ align = DECL_ALIGN (var);
+
+ if (crtl->stack_alignment_estimated < align)
+ {
+ /* stack_alignment_estimated shouldn't change after stack
+ realign decision made */
+ gcc_assert(!crtl->stack_realign_processed);
+ crtl->stack_alignment_estimated = align;
+ }
+ }
+
if (TREE_CODE (var) != VAR_DECL)
;
else if (DECL_EXTERNAL (var))
@@ -742,10 +1096,7 @@ expand_one_var (tree var, bool toplevel, bool really_expand)
else if (DECL_HAS_VALUE_EXPR_P (var))
;
else if (TREE_STATIC (var))
- {
- if (really_expand)
- expand_one_static_var (var);
- }
+ ;
else if (DECL_RTL_SET_P (var))
;
else if (TREE_TYPE (var) == error_mark_node)
@@ -790,12 +1141,7 @@ expand_used_vars_for_block (tree block, bool toplevel)
/* Expand all variables at this level. */
for (t = BLOCK_VARS (block); t ; t = TREE_CHAIN (t))
- if (TREE_USED (t)
- /* Force local static variables to be output when marked by
- used attribute. For unit-at-a-time, cgraph code already takes
- care of this. */
- || (!flag_unit_at_a_time && TREE_STATIC (t)
- && DECL_PRESERVE_P (t)))
+ if (TREE_USED (t))
expand_one_var (t, toplevel, true);
this_sv_num = stack_vars_num;
@@ -1211,12 +1557,12 @@ expand_used_vars (void)
generated for STMT should have been appended. */
static void
-maybe_dump_rtl_for_tree_stmt (tree stmt, rtx since)
+maybe_dump_rtl_for_gimple_stmt (gimple stmt, rtx since)
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "\n;; ");
- print_generic_expr (dump_file, stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
fprintf (dump_file, "\n");
print_rtl (dump_file, since ? NEXT_INSN (since) : since);
@@ -1230,10 +1576,11 @@ static struct pointer_map_t *lab_rtx_for_bb;
/* Returns the label_rtx expression for a label starting basic block BB. */
static rtx
-label_rtx_for_bb (basic_block bb)
+label_rtx_for_bb (basic_block bb ATTRIBUTE_UNUSED)
{
- tree_stmt_iterator tsi;
- tree lab, lab_stmt;
+ gimple_stmt_iterator gsi;
+ tree lab;
+ gimple lab_stmt;
void **elt;
if (bb->flags & BB_RTL)
@@ -1245,13 +1592,13 @@ label_rtx_for_bb (basic_block bb)
/* Find the tree label if it is present. */
- for (tsi = tsi_start (bb_stmt_list (bb)); !tsi_end_p (tsi); tsi_next (&tsi))
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- lab_stmt = tsi_stmt (tsi);
- if (TREE_CODE (lab_stmt) != LABEL_EXPR)
+ lab_stmt = gsi_stmt (gsi);
+ if (gimple_code (lab_stmt) != GIMPLE_LABEL)
break;
- lab = LABEL_EXPR_LABEL (lab_stmt);
+ lab = gimple_label_label (lab_stmt);
if (DECL_NONLOCAL (lab))
break;
@@ -1263,29 +1610,28 @@ label_rtx_for_bb (basic_block bb)
return (rtx) *elt;
}
-/* A subroutine of expand_gimple_basic_block. Expand one COND_EXPR.
+
+/* A subroutine of expand_gimple_basic_block. Expand one GIMPLE_COND.
Returns a new basic block if we've terminated the current basic
block and created a new one. */
static basic_block
-expand_gimple_cond_expr (basic_block bb, tree stmt)
+expand_gimple_cond (basic_block bb, gimple stmt)
{
basic_block new_bb, dest;
edge new_edge;
edge true_edge;
edge false_edge;
- tree pred = COND_EXPR_COND (stmt);
+ tree pred = gimple_cond_pred_to_tree (stmt);
rtx last2, last;
- gcc_assert (COND_EXPR_THEN (stmt) == NULL_TREE);
- gcc_assert (COND_EXPR_ELSE (stmt) == NULL_TREE);
last2 = last = get_last_insn ();
extract_true_false_edges_from_block (bb, &true_edge, &false_edge);
- if (EXPR_LOCUS (stmt))
+ if (gimple_has_location (stmt))
{
- set_curr_insn_source_location (*(EXPR_LOCUS (stmt)));
- set_curr_insn_block (TREE_BLOCK (stmt));
+ set_curr_insn_source_location (gimple_location (stmt));
+ set_curr_insn_block (gimple_block (stmt));
}
/* These flags have no purpose in RTL land. */
@@ -1298,20 +1644,22 @@ expand_gimple_cond_expr (basic_block bb, tree stmt)
{
jumpif (pred, label_rtx_for_bb (true_edge->dest));
add_reg_br_prob_note (last, true_edge->probability);
- maybe_dump_rtl_for_tree_stmt (stmt, last);
+ maybe_dump_rtl_for_gimple_stmt (stmt, last);
if (true_edge->goto_locus)
set_curr_insn_source_location (true_edge->goto_locus);
false_edge->flags |= EDGE_FALLTHRU;
+ ggc_free (pred);
return NULL;
}
if (true_edge->dest == bb->next_bb)
{
jumpifnot (pred, label_rtx_for_bb (false_edge->dest));
add_reg_br_prob_note (last, false_edge->probability);
- maybe_dump_rtl_for_tree_stmt (stmt, last);
+ maybe_dump_rtl_for_gimple_stmt (stmt, last);
if (false_edge->goto_locus)
set_curr_insn_source_location (false_edge->goto_locus);
true_edge->flags |= EDGE_FALLTHRU;
+ ggc_free (pred);
return NULL;
}
@@ -1338,15 +1686,16 @@ expand_gimple_cond_expr (basic_block bb, tree stmt)
BB_END (new_bb) = PREV_INSN (BB_END (new_bb));
update_bb_for_insn (new_bb);
- maybe_dump_rtl_for_tree_stmt (stmt, last2);
+ maybe_dump_rtl_for_gimple_stmt (stmt, last2);
if (false_edge->goto_locus)
set_curr_insn_source_location (false_edge->goto_locus);
+ ggc_free (pred);
return new_bb;
}
-/* A subroutine of expand_gimple_basic_block. Expand one CALL_EXPR
+/* A subroutine of expand_gimple_basic_block. Expand one GIMPLE_CALL
that has CALL_EXPR_TAILCALL set. Returns non-null if we actually
generated a tail call (something that might be denied by the ABI
rules governing the call; see calls.c).
@@ -1357,23 +1706,26 @@ expand_gimple_cond_expr (basic_block bb, tree stmt)
tailcall) and the normal result happens via a sqrt instruction. */
static basic_block
-expand_gimple_tailcall (basic_block bb, tree stmt, bool *can_fallthru)
+expand_gimple_tailcall (basic_block bb, gimple stmt, bool *can_fallthru)
{
rtx last2, last;
edge e;
edge_iterator ei;
int probability;
gcov_type count;
+ tree stmt_tree = gimple_to_tree (stmt);
last2 = last = get_last_insn ();
- expand_expr_stmt (stmt);
+ expand_expr_stmt (stmt_tree);
+
+ release_stmt_tree (stmt, stmt_tree);
for (last = NEXT_INSN (last); last; last = NEXT_INSN (last))
if (CALL_P (last) && SIBLING_CALL_P (last))
goto found;
- maybe_dump_rtl_for_tree_stmt (stmt, last2);
+ maybe_dump_rtl_for_gimple_stmt (stmt, last2);
*can_fallthru = true;
return NULL;
@@ -1448,7 +1800,7 @@ expand_gimple_tailcall (basic_block bb, tree stmt, bool *can_fallthru)
BB_END (bb) = PREV_INSN (last);
}
- maybe_dump_rtl_for_tree_stmt (stmt, last2);
+ maybe_dump_rtl_for_gimple_stmt (stmt, last2);
return bb;
}
@@ -1458,50 +1810,53 @@ expand_gimple_tailcall (basic_block bb, tree stmt, bool *can_fallthru)
static basic_block
expand_gimple_basic_block (basic_block bb)
{
- tree_stmt_iterator tsi;
- tree stmts = bb_stmt_list (bb);
- tree stmt = NULL;
+ gimple_stmt_iterator gsi;
+ gimple_seq stmts;
+ gimple stmt = NULL;
rtx note, last;
edge e;
edge_iterator ei;
void **elt;
if (dump_file)
- {
- fprintf (dump_file,
- "\n;; Generating RTL for tree basic block %d\n",
- bb->index);
- }
-
- bb->il.tree = NULL;
+ fprintf (dump_file, "\n;; Generating RTL for gimple basic block %d\n",
+ bb->index);
+
+ /* Note that since we are now transitioning from GIMPLE to RTL, we
+ cannot use the gsi_*_bb() routines because they expect the basic
+ block to be in GIMPLE, instead of RTL. Therefore, we need to
+ access the BB sequence directly. */
+ stmts = bb_seq (bb);
+ bb->il.gimple = NULL;
+ rtl_profile_for_bb (bb);
init_rtl_bb_info (bb);
bb->flags |= BB_RTL;
/* Remove the RETURN_EXPR if we may fall though to the exit
instead. */
- tsi = tsi_last (stmts);
- if (!tsi_end_p (tsi)
- && TREE_CODE (tsi_stmt (tsi)) == RETURN_EXPR)
+ gsi = gsi_last (stmts);
+ if (!gsi_end_p (gsi)
+ && gimple_code (gsi_stmt (gsi)) == GIMPLE_RETURN)
{
- tree ret_stmt = tsi_stmt (tsi);
+ gimple ret_stmt = gsi_stmt (gsi);
gcc_assert (single_succ_p (bb));
gcc_assert (single_succ (bb) == EXIT_BLOCK_PTR);
if (bb->next_bb == EXIT_BLOCK_PTR
- && !TREE_OPERAND (ret_stmt, 0))
+ && !gimple_return_retval (ret_stmt))
{
- tsi_delink (&tsi);
+ gsi_remove (&gsi, false);
single_succ_edge (bb)->flags |= EDGE_FALLTHRU;
}
}
- tsi = tsi_start (stmts);
- if (!tsi_end_p (tsi))
+ gsi = gsi_start (stmts);
+ if (!gsi_end_p (gsi))
{
- stmt = tsi_stmt (tsi);
- if (TREE_CODE (stmt) != LABEL_EXPR)
- stmt = NULL_TREE;
+ stmt = gsi_stmt (gsi);
+ if (gimple_code (stmt) != GIMPLE_LABEL)
+ stmt = NULL;
}
elt = pointer_map_contains (lab_rtx_for_bb, bb);
@@ -1512,8 +1867,10 @@ expand_gimple_basic_block (basic_block bb)
if (stmt)
{
- expand_expr_stmt (stmt);
- tsi_next (&tsi);
+ tree stmt_tree = gimple_to_tree (stmt);
+ expand_expr_stmt (stmt_tree);
+ release_stmt_tree (stmt, stmt_tree);
+ gsi_next (&gsi);
}
if (elt)
@@ -1526,7 +1883,7 @@ expand_gimple_basic_block (basic_block bb)
BB_HEAD (bb) = NEXT_INSN (BB_HEAD (bb));
note = emit_note_after (NOTE_INSN_BASIC_BLOCK, BB_HEAD (bb));
- maybe_dump_rtl_for_tree_stmt (stmt, last);
+ maybe_dump_rtl_for_gimple_stmt (stmt, last);
}
else
note = BB_HEAD (bb) = emit_note (NOTE_INSN_BASIC_BLOCK);
@@ -1547,36 +1904,22 @@ expand_gimple_basic_block (basic_block bb)
ei_next (&ei);
}
- for (; !tsi_end_p (tsi); tsi_next (&tsi))
+ for (; !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree stmt = tsi_stmt (tsi);
+ gimple stmt = gsi_stmt (gsi);
basic_block new_bb;
- if (!stmt)
- continue;
-
/* Expand this statement, then evaluate the resulting RTL and
fixup the CFG accordingly. */
- if (TREE_CODE (stmt) == COND_EXPR)
+ if (gimple_code (stmt) == GIMPLE_COND)
{
- new_bb = expand_gimple_cond_expr (bb, stmt);
+ new_bb = expand_gimple_cond (bb, stmt);
if (new_bb)
return new_bb;
}
else
{
- tree call = get_call_expr_in (stmt);
- int region;
- /* For the benefit of calls.c, converting all this to rtl,
- we need to record the call expression, not just the outer
- modify statement. */
- if (call && call != stmt)
- {
- if ((region = lookup_stmt_eh_region (stmt)) > 0)
- add_stmt_to_eh_region (call, region);
- gimple_duplicate_stmt_histograms (cfun, call, cfun, stmt);
- }
- if (call && CALL_EXPR_TAILCALL (call))
+ if (is_gimple_call (stmt) && gimple_call_tail_p (stmt))
{
bool can_fallthru;
new_bb = expand_gimple_tailcall (bb, stmt, &can_fallthru);
@@ -1590,9 +1933,11 @@ expand_gimple_basic_block (basic_block bb)
}
else
{
+ tree stmt_tree = gimple_to_tree (stmt);
last = get_last_insn ();
- expand_expr_stmt (stmt);
- maybe_dump_rtl_for_tree_stmt (stmt, last);
+ expand_expr_stmt (stmt_tree);
+ maybe_dump_rtl_for_gimple_stmt (stmt, last);
+ release_stmt_tree (stmt, stmt_tree);
}
}
}
@@ -1651,7 +1996,7 @@ construct_init_block (void)
otherwise we have to jump into proper target. */
if (e && e->dest != ENTRY_BLOCK_PTR->next_bb)
{
- tree label = tree_block_label (e->dest);
+ tree label = gimple_block_label (e->dest);
emit_jump (label_rtx (label));
flags = 0;
@@ -1706,6 +2051,8 @@ construct_exit_block (void)
edge_iterator ei;
rtx orig_end = BB_END (EXIT_BLOCK_PTR->prev_bb);
+ rtl_profile_for_bb (EXIT_BLOCK_PTR);
+
/* Make sure the locus is set to the end of the function, so that
epilogue line numbers and warnings are set properly. */
if (cfun->function_end_locus != UNKNOWN_LOCATION)
@@ -1809,13 +2156,84 @@ static void
discover_nonconstant_array_refs (void)
{
basic_block bb;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
FOR_EACH_BB (bb)
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
+ walk_gimple_op (stmt, discover_nonconstant_array_refs_r, NULL);
+ }
+}
+
+/* This function sets crtl->args.internal_arg_pointer to a virtual
+ register if DRAP is needed. Local register allocator will replace
+ virtual_incoming_args_rtx with the virtual register. */
+
+static void
+expand_stack_alignment (void)
+{
+ rtx drap_rtx;
+ unsigned int preferred_stack_boundary, incoming_stack_boundary;
+
+ if (! SUPPORTS_STACK_ALIGNMENT)
+ return;
+
+ if (cfun->calls_alloca
+ || cfun->has_nonlocal_label
+ || crtl->has_nonlocal_goto)
+ crtl->need_drap = true;
+
+ gcc_assert (crtl->stack_alignment_needed
+ <= crtl->stack_alignment_estimated);
+
+ /* Update stack boundary if needed. */
+ if (targetm.calls.update_stack_boundary)
+ targetm.calls.update_stack_boundary ();
+
+ /* Update crtl->stack_alignment_estimated and use it later to align
+ stack. We check PREFERRED_STACK_BOUNDARY if there may be non-call
+ exceptions since callgraph doesn't collect incoming stack alignment
+ in this case. */
+ if (flag_non_call_exceptions
+ && PREFERRED_STACK_BOUNDARY > crtl->preferred_stack_boundary)
+ preferred_stack_boundary = PREFERRED_STACK_BOUNDARY;
+ else
+ preferred_stack_boundary = crtl->preferred_stack_boundary;
+ if (preferred_stack_boundary > crtl->stack_alignment_estimated)
+ crtl->stack_alignment_estimated = preferred_stack_boundary;
+ 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;
+ crtl->stack_realign_tried = crtl->stack_realign_needed;
+
+ crtl->stack_realign_processed = true;
+
+ /* Target has to redefine TARGET_GET_DRAP_RTX to support stack
+ alignment. */
+ 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)
{
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- walk_tree (bsi_stmt_ptr (bsi), discover_nonconstant_array_refs_r,
- NULL , NULL);
+ crtl->args.internal_arg_pointer = drap_rtx;
+
+ /* Call fixup_tail_calls to clean up REG_EQUIV note if DRAP is
+ needed. */
+ fixup_tail_calls ();
}
}
@@ -1829,7 +2247,7 @@ discover_nonconstant_array_refs (void)
the expansion. */
static unsigned int
-tree_expand_cfg (void)
+gimple_expand_cfg (void)
{
basic_block bb, init_block;
sbitmap blocks;
@@ -1839,6 +2257,8 @@ tree_expand_cfg (void)
/* Some backends want to know that we are expanding to RTL. */
currently_expanding_to_rtl = 1;
+ rtl_profile_for_bb (ENTRY_BLOCK_PTR);
+
insn_locators_alloc ();
if (!DECL_BUILT_IN (current_function_decl))
set_curr_insn_source_location (DECL_SOURCE_LOCATION (current_function_decl));
@@ -1855,6 +2275,8 @@ tree_expand_cfg (void)
targetm.expand_to_rtl_hook ();
crtl->stack_alignment_needed = STACK_BOUNDARY;
+ crtl->max_used_stack_slot_alignment = STACK_BOUNDARY;
+ crtl->stack_alignment_estimated = STACK_BOUNDARY;
crtl->preferred_stack_boundary = STACK_BOUNDARY;
cfun->cfg->max_jumptable_ents = 0;
@@ -1902,6 +2324,9 @@ tree_expand_cfg (void)
lab_rtx_for_bb = pointer_map_create ();
FOR_BB_BETWEEN (bb, init_block->next_bb, EXIT_BLOCK_PTR, next_bb)
bb = expand_gimple_basic_block (bb);
+
+ /* Expansion is used by optimization passes too, set maybe_hot_insn_p
+ conservatively to true until they are all profile aware. */
pointer_map_destroy (lab_rtx_for_bb);
free_histograms ();
@@ -1926,6 +2351,9 @@ tree_expand_cfg (void)
sbitmap_free (blocks);
compact_blocks ();
+
+ expand_stack_alignment ();
+
#ifdef ENABLE_CHECKING
verify_flow_info ();
#endif
@@ -1970,6 +2398,7 @@ tree_expand_cfg (void)
/* Tag the blocks with a depth number so that change_scope can find
the common parent easily. */
set_block_levels (DECL_INITIAL (cfun->decl), 0);
+ default_rtl_profile ();
return 0;
}
@@ -1979,7 +2408,7 @@ struct rtl_opt_pass pass_expand =
RTL_PASS,
"expand", /* name */
NULL, /* gate */
- tree_expand_cfg, /* execute */
+ gimple_expand_cfg, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c
index 5815a7edd37..00d7151f6b8 100644
--- a/gcc/cfghooks.c
+++ b/gcc/cfghooks.c
@@ -51,9 +51,9 @@ cfg_layout_rtl_register_cfg_hooks (void)
/* Initialization of functions specific to the tree IR. */
void
-tree_register_cfg_hooks (void)
+gimple_register_cfg_hooks (void)
{
- cfg_hooks = &tree_cfg_hooks;
+ cfg_hooks = &gimple_cfg_hooks;
}
/* Returns current ir type. */
@@ -61,7 +61,7 @@ tree_register_cfg_hooks (void)
enum ir_type
current_ir_type (void)
{
- if (cfg_hooks == &tree_cfg_hooks)
+ if (cfg_hooks == &gimple_cfg_hooks)
return IR_GIMPLE;
else if (cfg_hooks == &rtl_cfg_hooks)
return IR_RTL_CFGRTL;
@@ -291,7 +291,7 @@ dump_bb (basic_block bb, FILE *outf, int indent)
putc ('\n', outf);
if (cfg_hooks->dump_bb)
- cfg_hooks->dump_bb (bb, outf, indent);
+ cfg_hooks->dump_bb (bb, outf, indent, 0);
}
/* Redirect edge E to the given basic block DEST and update underlying program
diff --git a/gcc/cfghooks.h b/gcc/cfghooks.h
index e581d9cd559..537c05f07ba 100644
--- a/gcc/cfghooks.h
+++ b/gcc/cfghooks.h
@@ -28,7 +28,7 @@ struct cfg_hooks
/* Debugging. */
int (*verify_flow_info) (void);
- void (*dump_bb) (basic_block, FILE *, int);
+ void (*dump_bb) (basic_block, FILE *, int, int);
/* Basic CFG manipulation. */
@@ -181,7 +181,7 @@ extern void lv_add_condition_to_bb (basic_block, basic_block, basic_block,
void *);
/* Hooks containers. */
-extern struct cfg_hooks tree_cfg_hooks;
+extern struct cfg_hooks gimple_cfg_hooks;
extern struct cfg_hooks rtl_cfg_hooks;
extern struct cfg_hooks cfg_layout_rtl_cfg_hooks;
@@ -189,6 +189,6 @@ extern struct cfg_hooks cfg_layout_rtl_cfg_hooks;
extern enum ir_type current_ir_type (void);
extern void rtl_register_cfg_hooks (void);
extern void cfg_layout_rtl_register_cfg_hooks (void);
-extern void tree_register_cfg_hooks (void);
+extern void gimple_register_cfg_hooks (void);
#endif /* GCC_CFGHOOKS_H */
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index f565708ae9e..4c9bbf0ab19 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -563,11 +563,13 @@ find_subloop_latch_edge_by_profile (VEC (edge, heap) *latches)
another edge. */
static edge
-find_subloop_latch_edge_by_ivs (struct loop *loop, VEC (edge, heap) *latches)
+find_subloop_latch_edge_by_ivs (struct loop *loop ATTRIBUTE_UNUSED, VEC (edge, heap) *latches)
{
edge e, latch = VEC_index (edge, latches, 0);
unsigned i;
- tree phi, lop;
+ gimple phi;
+ gimple_stmt_iterator psi;
+ tree lop;
basic_block bb;
/* Find the candidate for the latch edge. */
@@ -582,15 +584,16 @@ find_subloop_latch_edge_by_ivs (struct loop *loop, VEC (edge, heap) *latches)
/* Check for a phi node that would deny that this is a latch edge of
a subloop. */
- for (phi = phi_nodes (loop->header); phi; phi = PHI_CHAIN (phi))
+ for (psi = gsi_start_phis (loop->header); !gsi_end_p (psi); gsi_next (&psi))
{
+ phi = gsi_stmt (psi);
lop = PHI_ARG_DEF_FROM_EDGE (phi, latch);
/* Ignore the values that are not changed inside the subloop. */
if (TREE_CODE (lop) != SSA_NAME
|| SSA_NAME_DEF_STMT (lop) == phi)
continue;
- bb = bb_for_stmt (SSA_NAME_DEF_STMT (lop));
+ bb = gimple_bb (SSA_NAME_DEF_STMT (lop));
if (!bb || !flow_bb_inside_loop_p (loop, bb))
continue;
diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h
index 056e8f0b1e5..d21d50bebdd 100644
--- a/gcc/cfgloop.h
+++ b/gcc/cfgloop.h
@@ -49,7 +49,7 @@ struct lpt_decision GTY (())
struct nb_iter_bound GTY ((chain_next ("%h.next")))
{
/* The statement STMT is executed at most ... */
- tree stmt;
+ gimple stmt;
/* ... BOUND + 1 times (BOUND must be an unsigned constant).
The + 1 is added for the following reasons:
diff --git a/gcc/cfgloopanal.c b/gcc/cfgloopanal.c
index c00d1c501be..db5bd2a62b9 100644
--- a/gcc/cfgloopanal.c
+++ b/gcc/cfgloopanal.c
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "expr.h"
#include "output.h"
#include "graphds.h"
+#include "params.h"
/* Checks whether BB is executed exactly once in each LOOP iteration. */
@@ -372,6 +373,7 @@ init_set_costs (void)
unsigned
estimate_reg_pressure_cost (unsigned n_new, unsigned n_old)
{
+ unsigned cost;
unsigned regs_needed = n_new + n_old;
/* If we have enough registers, we should use them and not restrict
@@ -379,12 +381,25 @@ estimate_reg_pressure_cost (unsigned n_new, unsigned n_old)
if (regs_needed + target_res_regs <= target_avail_regs)
return 0;
- /* If we are close to running out of registers, try to preserve them. */
if (regs_needed <= target_avail_regs)
- return target_reg_cost * n_new;
-
- /* If we run out of registers, it is very expensive to add another one. */
- return target_spill_cost * n_new;
+ /* If we are close to running out of registers, try to preserve
+ them. */
+ cost = target_reg_cost * n_new;
+ else
+ /* If we run out of registers, it is very expensive to add another
+ one. */
+ cost = target_spill_cost * n_new;
+
+ if (optimize && flag_ira && (flag_ira_algorithm == IRA_ALGORITHM_REGIONAL
+ || flag_ira_algorithm == IRA_ALGORITHM_MIXED)
+ && number_of_loops () <= (unsigned) IRA_MAX_LOOPS_NUM)
+ /* IRA regional allocation deals with high register pressure
+ better. So decrease the cost (to do more accurate the cost
+ calculation for IRA, we need to know how many registers lives
+ through the loop transparently). */
+ cost /= 2;
+
+ return cost;
}
/* Sets EDGE_LOOP_EXIT flag for all loop exits. */
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 240455bca9d..f9e3e17e1a7 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -76,7 +76,7 @@ static void rtl_delete_block (basic_block);
static basic_block rtl_redirect_edge_and_branch_force (edge, basic_block);
static edge rtl_redirect_edge_and_branch (edge, basic_block);
static basic_block rtl_split_block (basic_block, void *);
-static void rtl_dump_bb (basic_block, FILE *, int);
+static void rtl_dump_bb (basic_block, FILE *, int, int);
static int rtl_verify_flow_info_1 (void);
static void rtl_make_forwarder_block (edge);
@@ -1510,7 +1510,7 @@ commit_edge_insertions (void)
at start and end). */
static void
-rtl_dump_bb (basic_block bb, FILE *outf, int indent)
+rtl_dump_bb (basic_block bb, FILE *outf, int indent, int flags ATTRIBUTE_UNUSED)
{
rtx insn;
rtx last;
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 3b3be13084e..fdc156dfe33 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -81,7 +81,7 @@ The callgraph:
#include "varray.h"
#include "output.h"
#include "intl.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-dump.h"
#include "tree-flow.h"
@@ -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)
@@ -412,17 +454,6 @@ cgraph_node (tree decl)
node->master_clone = node;
}
- /* This code can go away once flag_unit_at_a_mode is removed. */
- if (assembler_name_hash)
- {
- tree name = DECL_ASSEMBLER_NAME (node->decl);
- slot = ((struct cgraph_node **)
- htab_find_slot_with_hash (assembler_name_hash, name,
- decl_assembler_name_hash (name),
- INSERT));
- if (!*slot)
- *slot = node;
- }
return node;
}
@@ -514,9 +545,12 @@ edge_eq (const void *x, const void *y)
return ((const struct cgraph_edge *) x)->call_stmt == y;
}
-/* Return callgraph edge representing CALL_EXPR statement. */
+
+/* Return the callgraph edge representing the GIMPLE_CALL statement
+ CALL_STMT. */
+
struct cgraph_edge *
-cgraph_edge (struct cgraph_node *node, tree call_stmt)
+cgraph_edge (struct cgraph_node *node, gimple call_stmt)
{
struct cgraph_edge *e, *e2;
int n = 0;
@@ -524,7 +558,7 @@ cgraph_edge (struct cgraph_node *node, tree 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
@@ -537,6 +571,7 @@ cgraph_edge (struct cgraph_node *node, tree call_stmt)
break;
n++;
}
+
if (n > 100)
{
node->call_site_hash = htab_create_ggc (120, edge_hash, edge_eq, NULL);
@@ -551,13 +586,15 @@ cgraph_edge (struct cgraph_node *node, tree call_stmt)
*slot = e2;
}
}
+
return e;
}
-/* Change call_stmt of edge E to NEW_STMT. */
+
+/* Change field call_smt of edge E to NEW_STMT. */
void
-cgraph_set_call_stmt (struct cgraph_edge *e, tree new_stmt)
+cgraph_set_call_stmt (struct cgraph_edge *e, gimple new_stmt)
{
if (e->caller->call_site_hash)
{
@@ -582,7 +619,7 @@ cgraph_set_call_stmt (struct cgraph_edge *e, tree new_stmt)
struct cgraph_edge *
cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee,
- tree call_stmt, gcov_type count, int freq, int nest)
+ gimple call_stmt, gcov_type count, int freq, int nest)
{
struct cgraph_edge *edge = GGC_NEW (struct cgraph_edge);
#ifdef ENABLE_CHECKING
@@ -592,9 +629,9 @@ cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee,
gcc_assert (e->call_stmt != call_stmt);
#endif
- gcc_assert (get_call_expr_in (call_stmt));
+ gcc_assert (is_gimple_call (call_stmt));
- if (!DECL_SAVED_TREE (callee->decl))
+ if (!gimple_body (callee->decl))
edge->inline_failed = N_("function body not available");
else if (callee->local.redefined_extern_inline)
edge->inline_failed = N_("redefined extern inline functions are not "
@@ -625,6 +662,7 @@ cgraph_create_edge (struct cgraph_node *caller, struct cgraph_node *callee,
gcc_assert (freq >= 0);
gcc_assert (freq <= CGRAPH_FREQ_MAX);
edge->loop_nest = nest;
+ edge->indirect_call = 0;
edge->uid = cgraph_edge_max_uid++;
if (caller->call_site_hash)
{
@@ -701,14 +739,15 @@ cgraph_redirect_edge_callee (struct cgraph_edge *e, struct cgraph_node *n)
e->callee = n;
}
-/* Update or remove corresponding cgraph edge if a call OLD_CALL
- in OLD_STMT changed into NEW_STMT. */
+
+/* Update or remove the corresponding cgraph edge if a GIMPLE_CALL
+ OLD_STMT changed into NEW_STMT. */
void
-cgraph_update_edges_for_call_stmt (tree old_stmt, tree old_call,
- tree new_stmt)
+cgraph_update_edges_for_call_stmt (gimple old_stmt, gimple new_stmt)
{
- tree new_call = get_call_expr_in (new_stmt);
+ tree new_call = (is_gimple_call (new_stmt)) ? gimple_call_fn (new_stmt) : 0;
+ tree old_call = (is_gimple_call (old_stmt)) ? gimple_call_fn (old_stmt) : 0;
struct cgraph_node *node = cgraph_node (cfun->decl);
if (old_call != new_call)
@@ -726,7 +765,7 @@ cgraph_update_edges_for_call_stmt (tree old_stmt, tree old_call,
cgraph_remove_edge (e);
if (new_call)
{
- new_decl = get_callee_fndecl (new_call);
+ new_decl = gimple_call_fndecl (new_stmt);
if (new_decl)
{
ne = cgraph_create_edge (node, cgraph_node (new_decl),
@@ -746,6 +785,7 @@ cgraph_update_edges_for_call_stmt (tree old_stmt, tree old_call,
}
}
+
/* Remove all callees from the node. */
void
@@ -801,6 +841,7 @@ cgraph_release_function_body (struct cgraph_node *node)
delete_tree_ssa ();
delete_tree_cfg_annotations ();
cfun->eh = NULL;
+ gimple_set_body (node->decl, NULL);
current_function_decl = old_decl;
pop_cfun();
}
@@ -816,6 +857,7 @@ cgraph_remove_node (struct cgraph_node *node)
{
void **slot;
bool kill_body = false;
+ struct cgraph_node *n;
cgraph_call_node_removal_hooks (node);
cgraph_node_remove_callers (node);
@@ -824,8 +866,9 @@ cgraph_remove_node (struct cgraph_node *node)
/* Incremental inlining access removed nodes stored in the postorder list.
*/
node->needed = node->reachable = false;
- while (node->nested)
- cgraph_remove_node (node->nested);
+ for (n = node->nested; n; n = n->next_nested)
+ n->origin = NULL;
+ node->nested = NULL;
if (node->origin)
{
struct cgraph_node **node2 = &node->origin->nested;
@@ -893,7 +936,7 @@ cgraph_remove_node (struct cgraph_node *node)
htab_clear_slot (assembler_name_hash, slot);
}
- if (kill_body && flag_unit_at_a_time)
+ if (kill_body)
cgraph_release_function_body (node);
node->decl = NULL;
if (node->call_site_hash)
@@ -1016,8 +1059,8 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node)
fprintf (f, " needed");
else if (node->reachable)
fprintf (f, " reachable");
- if (DECL_SAVED_TREE (node->decl))
- fprintf (f, " tree");
+ if (gimple_body (node->decl))
+ fprintf (f, " body");
if (node->output)
fprintf (f, " output");
if (node->local.local)
@@ -1048,6 +1091,8 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node)
edge->frequency / (double)CGRAPH_FREQ_BASE);
if (!edge->inline_failed)
fprintf(f, "(inlined) ");
+ if (edge->indirect_call)
+ fprintf(f, "(indirect) ");
}
fprintf (f, "\n calls: ");
@@ -1057,6 +1102,8 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node)
edge->callee->uid);
if (!edge->inline_failed)
fprintf(f, "(inlined) ");
+ if (edge->indirect_call)
+ fprintf(f, "(indirect) ");
if (edge->count)
fprintf (f, "("HOST_WIDEST_INT_PRINT_DEC"x) ",
(HOST_WIDEST_INT)edge->count);
@@ -1146,34 +1193,35 @@ bool
cgraph_function_possibly_inlined_p (tree decl)
{
if (!cgraph_global_info_ready)
- return (DECL_INLINE (decl) && !flag_really_no_inline);
+ return !DECL_UNINLINABLE (decl);
return DECL_POSSIBLY_INLINED (decl);
}
/* Create clone of E in the node N represented by CALL_EXPR the callgraph. */
struct cgraph_edge *
cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n,
- tree call_stmt, gcov_type count_scale, int freq_scale,
+ 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_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
@@ -1183,28 +1231,33 @@ cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n,
function's profile to reflect the fact that part of execution is handled
by node. */
struct cgraph_node *
-cgraph_clone_node (struct cgraph_node *n, gcov_type count, int freq, int loop_nest,
- bool update_original)
+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)
@@ -1215,17 +1268,17 @@ cgraph_clone_node (struct cgraph_node *n, gcov_type count, int freq, int loop_ne
}
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). */
@@ -1340,8 +1393,8 @@ cgraph_add_new_function (tree fndecl, bool lowered)
{
push_cfun (DECL_STRUCT_FUNCTION (fndecl));
current_function_decl = fndecl;
- tree_register_cfg_hooks ();
- tree_lowering_passes (fndecl);
+ gimple_register_cfg_hooks ();
+ tree_lowering_passes (fndecl);
bitmap_obstack_initialize (NULL);
if (!gimple_in_ssa_p (DECL_STRUCT_FUNCTION (fndecl)))
execute_pass_list (pass_early_local_passes.pass.sub);
@@ -1362,7 +1415,7 @@ cgraph_add_new_function (tree fndecl, bool lowered)
to expansion. */
push_cfun (DECL_STRUCT_FUNCTION (fndecl));
current_function_decl = fndecl;
- tree_register_cfg_hooks ();
+ gimple_register_cfg_hooks ();
if (!lowered)
tree_lowering_passes (fndecl);
bitmap_obstack_initialize (NULL);
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index b817f87f7f0..eec56a53903 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -91,7 +91,7 @@ struct cgraph_local_info GTY(())
};
/* Information about the function that needs to be computed globally
- once compilation is finished. Available only with -funit-at-time. */
+ once compilation is finished. Available only with -funit-at-a-time. */
struct cgraph_global_info GTY(())
{
@@ -100,7 +100,8 @@ struct cgraph_global_info GTY(())
/* Expected offset of the stack frame of inlined function. */
HOST_WIDE_INT stack_frame_offset;
- /* For inline clones this points to the function they will be inlined into. */
+ /* For inline clones this points to the function they will be
+ inlined into. */
struct cgraph_node *inlined_to;
/* Estimated size of the function after inlining. */
@@ -196,7 +197,7 @@ struct cgraph_edge GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_call
struct cgraph_edge *next_caller;
struct cgraph_edge *prev_callee;
struct cgraph_edge *next_callee;
- tree call_stmt;
+ gimple call_stmt;
PTR GTY ((skip (""))) aux;
/* When NULL, inline this call. When non-NULL, points to the explanation
why function was not inlined. */
@@ -208,7 +209,9 @@ struct cgraph_edge GTY((chain_next ("%h.next_caller"), chain_prev ("%h.prev_call
per function call. The range is 0 to CGRAPH_FREQ_MAX. */
int frequency;
/* Depth of loop nest, 1 means no loop nest. */
- int loop_nest;
+ unsigned int loop_nest : 31;
+ /* Whether this edge describes a call that was originally indirect. */
+ unsigned int indirect_call : 1;
/* Unique id of the edge. */
int uid;
};
@@ -304,19 +307,19 @@ void cgraph_release_function_body (struct cgraph_node *);
void cgraph_node_remove_callees (struct cgraph_node *node);
struct cgraph_edge *cgraph_create_edge (struct cgraph_node *,
struct cgraph_node *,
- tree, gcov_type, int, int);
+ gimple, gcov_type, int, int);
struct cgraph_node *cgraph_node (tree);
struct cgraph_node *cgraph_node_for_asm (tree asmname);
-struct cgraph_edge *cgraph_edge (struct cgraph_node *, tree);
-void cgraph_set_call_stmt (struct cgraph_edge *, tree);
-void cgraph_update_edges_for_call_stmt (tree, tree, tree);
+struct cgraph_edge *cgraph_edge (struct cgraph_node *, gimple);
+void cgraph_set_call_stmt (struct cgraph_edge *, gimple);
+void cgraph_update_edges_for_call_stmt (gimple, gimple);
struct cgraph_local_info *cgraph_local_info (tree);
struct cgraph_global_info *cgraph_global_info (tree);
struct cgraph_rtl_info *cgraph_rtl_info (tree);
const char * cgraph_node_name (struct cgraph_node *);
struct cgraph_edge * cgraph_clone_edge (struct cgraph_edge *,
struct cgraph_node *,
- tree, gcov_type, int, int, bool);
+ gimple, gcov_type, int, int, bool);
struct cgraph_node * cgraph_clone_node (struct cgraph_node *, gcov_type, int,
int, bool);
@@ -348,7 +351,8 @@ void cgraph_reset_static_var_maps (void);
void init_cgraph (void);
struct cgraph_node *cgraph_function_versioning (struct cgraph_node *,
VEC(cgraph_edge_p,heap)*,
- varray_type);
+ varray_type,
+ bitmap);
void cgraph_analyze_function (struct cgraph_node *);
struct cgraph_node *save_inline_function_body (struct cgraph_node *);
void record_references_in_initializer (tree);
@@ -369,6 +373,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 *);
@@ -376,11 +384,14 @@ void cgraph_remove_node_duplication_hook (struct cgraph_2node_hook_list *);
/* In cgraphbuild.c */
unsigned int rebuild_cgraph_edges (void);
+int compute_call_stmt_bb_frequency (basic_block bb);
/* In ipa.c */
bool cgraph_remove_unreachable_nodes (bool, FILE *);
int cgraph_postorder (struct cgraph_node **);
+bool cgraph_maybe_hot_edge_p (struct cgraph_edge *e);
+
/* In varpool.c */
extern GTY(()) struct varpool_node *varpool_nodes_queue;
diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c
index 19e198344b6..958fed7b0cc 100644
--- a/gcc/cgraphbuild.c
+++ b/gcc/cgraphbuild.c
@@ -1,5 +1,6 @@
/* Callgraph construction.
- Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
+ Free Software Foundation, Inc.
Contributed by Jan Hubicka
This file is part of GCC.
@@ -28,7 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "pointer-set.h"
#include "cgraph.h"
#include "intl.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-pass.h"
/* Walk tree and record all calls and references to functions/variables.
@@ -38,6 +39,7 @@ static tree
record_reference (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
{
tree t = *tp;
+ tree decl;
switch (TREE_CODE (t))
{
@@ -52,32 +54,11 @@ record_reference (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
case FDESC_EXPR:
case ADDR_EXPR:
- if (flag_unit_at_a_time)
- {
- /* Record dereferences to the functions. This makes the
- functions reachable unconditionally. */
- tree decl = TREE_OPERAND (*tp, 0);
- if (TREE_CODE (decl) == FUNCTION_DECL)
- cgraph_mark_needed_node (cgraph_node (decl));
- }
- break;
-
- case OMP_PARALLEL:
- if (flag_unit_at_a_time)
- {
- if (OMP_PARALLEL_FN (*tp))
- cgraph_mark_needed_node (cgraph_node (OMP_PARALLEL_FN (*tp)));
- }
- break;
-
- case OMP_TASK:
- if (flag_unit_at_a_time)
- {
- if (OMP_TASK_FN (*tp))
- cgraph_mark_needed_node (cgraph_node (OMP_TASK_FN (*tp)));
- if (OMP_TASK_COPYFN (*tp))
- cgraph_mark_needed_node (cgraph_node (OMP_TASK_COPYFN (*tp)));
- }
+ /* Record dereferences to the functions. This makes the
+ functions reachable unconditionally. */
+ decl = TREE_OPERAND (*tp, 0);
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ cgraph_mark_needed_node (cgraph_node (decl));
break;
default:
@@ -115,13 +96,32 @@ initialize_inline_failed (struct cgraph_node *node)
"considered for inlining");
else if (!node->local.inlinable)
e->inline_failed = N_("function not inlinable");
- else if (CALL_STMT_CANNOT_INLINE_P (e->call_stmt))
+ else if (gimple_call_cannot_inline_p (e->call_stmt))
e->inline_failed = N_("mismatched arguments");
else
e->inline_failed = N_("function not considered for inlining");
}
}
+/* Computes the frequency of the call statement so that it can be stored in
+ cgraph_edge. BB is the basic block of the call statement. */
+int
+compute_call_stmt_bb_frequency (basic_block bb)
+{
+ int entry_freq = ENTRY_BLOCK_PTR->frequency;
+ int freq;
+
+ if (!entry_freq)
+ entry_freq = 1;
+
+ freq = (!bb->frequency && !entry_freq ? CGRAPH_FREQ_BASE
+ : bb->frequency * CGRAPH_FREQ_BASE / entry_freq);
+ if (freq > CGRAPH_FREQ_MAX)
+ freq = CGRAPH_FREQ_MAX;
+
+ return freq;
+}
+
/* Create cgraph edges for function calls.
Also look for functions and variables having addresses taken. */
@@ -131,42 +131,54 @@ build_cgraph_edges (void)
basic_block bb;
struct cgraph_node *node = cgraph_node (current_function_decl);
struct pointer_set_t *visited_nodes = pointer_set_create ();
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
tree step;
- int entry_freq = ENTRY_BLOCK_PTR->frequency;
-
- if (!entry_freq)
- entry_freq = 1;
/* Create the callgraph edges and record the nodes referenced by the function.
body. */
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))
{
- tree stmt = bsi_stmt (bsi);
- tree call = get_call_expr_in (stmt);
+ gimple stmt = gsi_stmt (gsi);
tree decl;
- if (call && (decl = get_callee_fndecl (call)))
+ if (is_gimple_call (stmt) && (decl = gimple_call_fndecl (stmt)))
{
- int i;
- int n = call_expr_nargs (call);
- int freq = (!bb->frequency && !entry_freq ? CGRAPH_FREQ_BASE
- : bb->frequency * CGRAPH_FREQ_BASE / entry_freq);
- if (freq > CGRAPH_FREQ_MAX)
- freq = CGRAPH_FREQ_MAX;
+ size_t i;
+ size_t n = gimple_call_num_args (stmt);
cgraph_create_edge (node, cgraph_node (decl), stmt,
- bb->count, freq,
+ bb->count, compute_call_stmt_bb_frequency (bb),
bb->loop_depth);
for (i = 0; i < n; i++)
- walk_tree (&CALL_EXPR_ARG (call, i),
- record_reference, node, visited_nodes);
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
- walk_tree (&GIMPLE_STMT_OPERAND (stmt, 0),
- record_reference, node, visited_nodes);
+ walk_tree (gimple_call_arg_ptr (stmt, i), record_reference,
+ node, visited_nodes);
+ if (gimple_call_lhs (stmt))
+ walk_tree (gimple_call_lhs_ptr (stmt), record_reference, node,
+ visited_nodes);
}
else
- walk_tree (bsi_stmt_ptr (bsi), record_reference, node, visited_nodes);
+ {
+ struct walk_stmt_info wi;
+ memset (&wi, 0, sizeof (wi));
+ wi.info = node;
+ wi.pset = visited_nodes;
+ walk_gimple_op (stmt, record_reference, &wi);
+ if (gimple_code (stmt) == GIMPLE_OMP_PARALLEL
+ && gimple_omp_parallel_child_fn (stmt))
+ {
+ tree fn = gimple_omp_parallel_child_fn (stmt);
+ cgraph_mark_needed_node (cgraph_node (fn));
+ }
+ if (gimple_code (stmt) == GIMPLE_OMP_TASK)
+ {
+ tree fn = gimple_omp_task_child_fn (stmt);
+ if (fn)
+ cgraph_mark_needed_node (cgraph_node (fn));
+ fn = gimple_omp_task_copy_fn (stmt);
+ if (fn)
+ cgraph_mark_needed_node (cgraph_node (fn));
+ }
+ }
}
/* Look for initializers of constant variables and private statics. */
@@ -176,8 +188,7 @@ build_cgraph_edges (void)
{
tree decl = TREE_VALUE (step);
if (TREE_CODE (decl) == VAR_DECL
- && (TREE_STATIC (decl) && !DECL_EXTERNAL (decl))
- && flag_unit_at_a_time)
+ && (TREE_STATIC (decl) && !DECL_EXTERNAL (decl)))
varpool_finalize_decl (decl);
else if (TREE_CODE (decl) == VAR_DECL && DECL_INITIAL (decl))
walk_tree (&DECL_INITIAL (decl), record_reference, node, visited_nodes);
@@ -226,32 +237,23 @@ rebuild_cgraph_edges (void)
{
basic_block bb;
struct cgraph_node *node = cgraph_node (current_function_decl);
- block_stmt_iterator bsi;
- int entry_freq = ENTRY_BLOCK_PTR->frequency;
-
- if (!entry_freq)
- entry_freq = 1;
+ gimple_stmt_iterator gsi;
cgraph_node_remove_callees (node);
node->count = ENTRY_BLOCK_PTR->count;
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))
{
- tree stmt = bsi_stmt (bsi);
- tree call = get_call_expr_in (stmt);
+ gimple stmt = gsi_stmt (gsi);
tree decl;
- if (call && (decl = get_callee_fndecl (call)))
- {
- int freq = (!bb->frequency && !entry_freq ? CGRAPH_FREQ_BASE
- : bb->frequency * CGRAPH_FREQ_BASE / entry_freq);
- if (freq > CGRAPH_FREQ_MAX)
- freq = CGRAPH_FREQ_MAX;
- cgraph_create_edge (node, cgraph_node (decl), stmt,
- bb->count, freq, bb->loop_depth);
- }
+ if (is_gimple_call (stmt) && (decl = gimple_call_fndecl (stmt)))
+ cgraph_create_edge (node, cgraph_node (decl), stmt,
+ bb->count, compute_call_stmt_bb_frequency (bb),
+ bb->loop_depth);
+
}
initialize_inline_failed (node);
gcc_assert (!node->global.inlined_to);
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 5994ad12a03..43cdfda3aa3 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -45,7 +45,7 @@ along with GCC; see the file COPYING3. If not see
This function is called once (source level) compilation unit is finalized
and it will no longer change.
- In the unit-at-a-time the call-graph construction and local function
+ In the the call-graph construction and local function
analysis takes place here. Bodies of unreachable functions are released
to conserve memory usage.
@@ -77,9 +77,7 @@ along with GCC; see the file COPYING3. If not see
??? On the tree-ssa genericizing should take place here and we will avoid
need for these hooks (replacing them by genericizing hook)
- We implement two compilation modes.
-
- - unit-at-a-time: In this mode analyzing of all functions is deferred
+ Analyzing of all functions is deferred
to cgraph_finalize_compilation_unit and expansion into cgraph_optimize.
In cgraph_finalize_compilation_unit the reachable functions are
@@ -105,23 +103,7 @@ along with GCC; see the file COPYING3. If not see
??? Reorganize code so variables are output very last and only if they
really has been referenced by produced code, so we catch more cases
- where reference has been optimized out.
-
- - non-unit-at-a-time
-
- All functions are variables are output as early as possible to conserve
- memory consumption. This may or may not result in less memory used but
- it is still needed for some legacy code that rely on particular ordering
- of things output from the compiler.
-
- Varpool data structures are not used and variables are output directly.
-
- Functions are output early using call of
- cgraph_assemble_pending_function from cgraph_finalize_function. The
- decision on whether function is needed is made more conservative so
- uninlinable static functions are needed too. During the call-graph
- construction the edge destinations are not marked as reachable and it
- is completely relied upon assemble_variable to mark them. */
+ where reference has been optimized out. */
#include "config.h"
@@ -148,7 +130,8 @@ along with GCC; see the file COPYING3. If not see
#include "intl.h"
#include "function.h"
#include "ipa-prop.h"
-#include "tree-gimple.h"
+#include "gimple.h"
+#include "tree-iterator.h"
#include "tree-pass.h"
#include "output.h"
@@ -190,7 +173,6 @@ record_cdtor_fn (tree fndecl)
VEC_safe_push (tree, gc, static_dtors, fndecl);
DECL_STATIC_DESTRUCTOR (fndecl) = 0;
}
- DECL_INLINE (fndecl) = 1;
node = cgraph_node (fndecl);
node->local.disregard_inline_limits = 1;
cgraph_mark_reachable_node (node);
@@ -326,13 +308,11 @@ cgraph_build_cdtor_fns (void)
/* Determine if function DECL is needed. That is, visible to something
either outside this translation unit, something magic in the system
- configury, or (if not doing unit-at-a-time) to something we haven't
- seen yet. */
+ configury. */
static bool
decide_is_function_needed (struct cgraph_node *node, tree decl)
{
- tree origin;
if (MAIN_NAME_P (DECL_NAME (decl))
&& TREE_PUBLIC (decl))
{
@@ -344,9 +324,6 @@ decide_is_function_needed (struct cgraph_node *node, tree decl)
if (node->local.externally_visible)
return true;
- if (!flag_unit_at_a_time && lookup_attribute ("used", DECL_ATTRIBUTES (decl)))
- return true;
-
/* ??? If the assembler name is set by hand, it is possible to assemble
the name later after finalizing the function and the fact is noticed
in assemble_name then. This is arguably a bug. */
@@ -389,32 +366,6 @@ decide_is_function_needed (struct cgraph_node *node, tree decl)
if (DECL_STATIC_CONSTRUCTOR (decl) || DECL_STATIC_DESTRUCTOR (decl))
return true;
- if (flag_unit_at_a_time)
- return false;
-
- /* If not doing unit at a time, then we'll only defer this function
- if its marked for inlining. Otherwise we want to emit it now. */
-
- /* "extern inline" functions are never output locally. */
- if (DECL_EXTERNAL (decl))
- return false;
- /* Nested functions of extern inline function shall not be emit unless
- we inlined the origin. */
- for (origin = decl_function_context (decl); origin;
- origin = decl_function_context (origin))
- if (DECL_EXTERNAL (origin))
- return false;
- /* We want to emit COMDAT functions only when absolutely necessary. */
- if (DECL_COMDAT (decl))
- return false;
- if (!DECL_INLINE (decl)
- || (!node->local.disregard_inline_limits
- /* When declared inline, defer even the uninlinable functions.
- This allows them to be eliminated when unused. */
- && !DECL_DECLARED_INLINE_P (decl)
- && (!node->local.inlinable || !cgraph_default_inline_p (node, NULL))))
- return true;
-
return false;
}
@@ -454,7 +405,7 @@ cgraph_process_new_functions (void)
transformations that has been already performed on the whole
cgraph but not on this function. */
- tree_register_cfg_hooks ();
+ gimple_register_cfg_hooks ();
if (!node->analyzed)
cgraph_analyze_function (node);
push_cfun (DECL_STRUCT_FUNCTION (fndecl));
@@ -483,43 +434,11 @@ cgraph_process_new_functions (void)
gcc_unreachable ();
break;
}
+ cgraph_call_function_insertion_hooks (node);
}
return output;
}
-/* When not doing unit-at-a-time, output all functions enqueued.
- Return true when such a functions were found. */
-
-static bool
-cgraph_assemble_pending_functions (void)
-{
- bool output = false;
-
- if (flag_unit_at_a_time || errorcount || sorrycount)
- return false;
-
- cgraph_output_pending_asms ();
-
- while (cgraph_nodes_queue)
- {
- struct cgraph_node *n = cgraph_nodes_queue;
-
- cgraph_nodes_queue = cgraph_nodes_queue->next_needed;
- n->next_needed = NULL;
- if (!n->global.inlined_to
- && !n->alias
- && !DECL_EXTERNAL (n->decl))
- {
- cgraph_expand_function (n);
- output = true;
- }
- output |= cgraph_process_new_functions ();
- }
-
- return output;
-}
-
-
/* As an GCC extension we allow redefinition of the function. The
semantics when both copies of bodies differ is not well defined.
We replace the old body with new body so in unit at a time mode
@@ -533,12 +452,11 @@ cgraph_assemble_pending_functions (void)
static void
cgraph_reset_node (struct cgraph_node *node)
{
- /* If node->output is set, then this is a unit-at-a-time compilation
- and we have already begun whole-unit analysis. This is *not*
- testing for whether we've already emitted the function. That
- case can be sort-of legitimately seen with real function
- redefinition errors. I would argue that the front end should
- never present us with such a case, but don't enforce that for now. */
+ /* If node->output is set, then we have already begun whole-unit analysis.
+ This is *not* testing for whether we've already emitted the function.
+ That case can be sort-of legitimately seen with real function redefinition
+ errors. I would argue that the front end should never present us with
+ such a case, but don't enforce that for now. */
gcc_assert (!node->output);
/* Reset our data structures so we can analyze the function again. */
@@ -549,18 +467,6 @@ cgraph_reset_node (struct cgraph_node *node)
node->local.redefined_extern_inline = true;
node->local.finalized = false;
- if (!flag_unit_at_a_time)
- {
- struct cgraph_node *n, *next;
-
- for (n = cgraph_nodes; n; n = next)
- {
- next = n->next;
- if (n->global.inlined_to == node)
- cgraph_remove_node (n);
- }
- }
-
cgraph_node_remove_callees (node);
/* We may need to re-queue the node for assembling in case
@@ -609,11 +515,6 @@ cgraph_finalize_function (tree decl, bool nested)
lower_nested_functions (decl);
gcc_assert (!node->nested);
- /* If not unit at a time, then we need to create the call graph
- now, so that called functions can be queued and emitted now. */
- if (!flag_unit_at_a_time)
- cgraph_analyze_function (node);
-
if (decide_is_function_needed (node, decl))
cgraph_mark_needed_node (node);
@@ -623,14 +524,6 @@ cgraph_finalize_function (tree decl, bool nested)
if ((TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl)))
cgraph_mark_reachable_node (node);
- /* If not unit at a time, go ahead and emit everything we've found
- to be reachable at this time. */
- if (!nested)
- {
- if (!cgraph_assemble_pending_functions ())
- ggc_collect ();
- }
-
/* If we've not yet emitted decl, tell the debug info about it. */
if (!TREE_ASM_WRITTEN (decl))
(*debug_hooks->deferred_inline_function) (decl);
@@ -638,6 +531,9 @@ cgraph_finalize_function (tree decl, bool nested)
/* Possibly warn about unused parameters. */
if (warn_unused_parameter)
do_warn_unused_parameter (decl);
+
+ if (!nested)
+ ggc_collect ();
}
/* C99 extern inline keywords allow changing of declaration after function
@@ -661,7 +557,7 @@ verify_cgraph_node (struct cgraph_node *node)
struct function *this_cfun = DECL_STRUCT_FUNCTION (node->decl);
struct function *saved_cfun = cfun;
basic_block this_block;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
bool error_found = false;
if (errorcount || sorrycount)
@@ -743,7 +639,8 @@ verify_cgraph_node (struct cgraph_node *node)
}
if (node->analyzed
- && DECL_SAVED_TREE (node->decl) && !TREE_ASM_WRITTEN (node->decl)
+ && gimple_body (node->decl)
+ && !TREE_ASM_WRITTEN (node->decl)
&& (!DECL_EXTERNAL (node->decl) || node->global.inlined_to))
{
if (this_cfun->cfg)
@@ -754,12 +651,13 @@ verify_cgraph_node (struct cgraph_node *node)
/* Reach the trees by walking over the CFG, and note the
enclosing basic-blocks in the call edges. */
FOR_EACH_BB_FN (this_block, this_cfun)
- for (bsi = bsi_start (this_block); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (gsi = gsi_start_bb (this_block);
+ !gsi_end_p (gsi);
+ gsi_next (&gsi))
{
- tree stmt = bsi_stmt (bsi);
- tree call = get_call_expr_in (stmt);
+ gimple stmt = gsi_stmt (gsi);
tree decl;
- if (call && (decl = get_callee_fndecl (call)))
+ if (is_gimple_call (stmt) && (decl = gimple_call_fndecl (stmt)))
{
struct cgraph_edge *e = cgraph_edge (node, stmt);
if (e)
@@ -767,7 +665,7 @@ verify_cgraph_node (struct cgraph_node *node)
if (e->aux)
{
error ("shared call_stmt:");
- debug_generic_stmt (stmt);
+ debug_gimple_stmt (stmt);
error_found = true;
}
if (e->callee->decl != cgraph_node (decl)->decl
@@ -783,7 +681,7 @@ verify_cgraph_node (struct cgraph_node *node)
else
{
error ("missing callgraph edge for call stmt:");
- debug_generic_stmt (stmt);
+ debug_gimple_stmt (stmt);
error_found = true;
}
}
@@ -796,12 +694,12 @@ verify_cgraph_node (struct cgraph_node *node)
for (e = node->callees; e; e = e->next_callee)
{
- if (!e->aux)
+ if (!e->aux && !e->indirect_call)
{
error ("edge %s->%s has no corresponding call_stmt",
cgraph_node_name (e->caller),
cgraph_node_name (e->callee));
- debug_generic_stmt (e->call_stmt);
+ debug_gimple_stmt (e->call_stmt);
error_found = true;
}
e->aux = 0;
@@ -855,16 +753,6 @@ cgraph_analyze_function (struct cgraph_node *node)
cgraph_lower_function (node);
node->analyzed = true;
- if (!flag_unit_at_a_time && !sorrycount && !errorcount)
- {
- bitmap_obstack_initialize (NULL);
- tree_register_cfg_hooks ();
- execute_pass_list (pass_early_local_passes.pass.sub);
- free_dominance_info (CDI_POST_DOMINATORS);
- free_dominance_info (CDI_DOMINATORS);
- bitmap_obstack_release (NULL);
- }
-
pop_cfun ();
current_function_decl = NULL;
}
@@ -972,7 +860,7 @@ cgraph_analyze_functions (void)
{
fprintf (cgraph_dump_file, "Initial entry points:");
for (node = cgraph_nodes; node != first_analyzed; node = node->next)
- if (node->needed && DECL_SAVED_TREE (node->decl))
+ if (node->needed && gimple_body (node->decl))
fprintf (cgraph_dump_file, " %s", cgraph_node_name (node));
fprintf (cgraph_dump_file, "\n");
}
@@ -994,14 +882,14 @@ cgraph_analyze_functions (void)
/* ??? It is possible to create extern inline function and later using
weak alias attribute to kill its body. See
gcc.c-torture/compile/20011119-1.c */
- if (!DECL_SAVED_TREE (decl))
+ if (!DECL_STRUCT_FUNCTION (decl))
{
cgraph_reset_node (node);
continue;
}
gcc_assert (!node->analyzed && node->reachable);
- gcc_assert (DECL_SAVED_TREE (decl));
+ gcc_assert (gimple_body (decl));
cgraph_analyze_function (node);
@@ -1024,7 +912,7 @@ cgraph_analyze_functions (void)
{
fprintf (cgraph_dump_file, "Unit entry points:");
for (node = cgraph_nodes; node != first_analyzed; node = node->next)
- if (node->needed && DECL_SAVED_TREE (node->decl))
+ if (node->needed && gimple_body (node->decl))
fprintf (cgraph_dump_file, " %s", cgraph_node_name (node));
fprintf (cgraph_dump_file, "\n\nInitial ");
dump_cgraph (cgraph_dump_file);
@@ -1038,10 +926,10 @@ cgraph_analyze_functions (void)
tree decl = node->decl;
next = node->next;
- if (node->local.finalized && !DECL_SAVED_TREE (decl))
+ if (node->local.finalized && !gimple_body (decl))
cgraph_reset_node (node);
- if (!node->reachable && DECL_SAVED_TREE (decl))
+ if (!node->reachable && gimple_body (decl))
{
if (cgraph_dump_file)
fprintf (cgraph_dump_file, " %s", cgraph_node_name (node));
@@ -1050,7 +938,7 @@ cgraph_analyze_functions (void)
}
else
node->next_needed = NULL;
- gcc_assert (!node->local.finalized || DECL_SAVED_TREE (decl));
+ gcc_assert (!node->local.finalized || gimple_body (decl));
gcc_assert (node->analyzed == node->local.finalized);
}
if (cgraph_dump_file)
@@ -1072,14 +960,6 @@ cgraph_finalize_compilation_unit (void)
finish_aliases_1 ();
- if (!flag_unit_at_a_time)
- {
- cgraph_output_pending_asms ();
- cgraph_assemble_pending_functions ();
- varpool_output_debug_info ();
- return;
- }
-
if (!quiet_flag)
{
fprintf (stderr, "\nAnalyzing compilation unit\n");
@@ -1111,7 +991,7 @@ cgraph_mark_functions_to_output (void)
/* We need to output all local functions that are used and not
always inlined, as well as those that are reachable from
outside the current compilation unit. */
- if (DECL_SAVED_TREE (decl)
+ if (gimple_body (decl)
&& !node->global.inlined_to
&& (node->needed
|| (e && node->reachable))
@@ -1122,14 +1002,16 @@ cgraph_mark_functions_to_output (void)
{
/* We should've reclaimed all functions that are not needed. */
#ifdef ENABLE_CHECKING
- if (!node->global.inlined_to && DECL_SAVED_TREE (decl)
+ if (!node->global.inlined_to
+ && gimple_body (decl)
&& !DECL_EXTERNAL (decl))
{
dump_cgraph_node (stderr, node);
internal_error ("failed to reclaim unneeded function");
}
#endif
- gcc_assert (node->global.inlined_to || !DECL_SAVED_TREE (decl)
+ gcc_assert (node->global.inlined_to
+ || !gimple_body (decl)
|| DECL_EXTERNAL (decl));
}
@@ -1147,8 +1029,7 @@ cgraph_expand_function (struct cgraph_node *node)
/* We ought to not compile any inline clones. */
gcc_assert (!node->global.inlined_to);
- if (flag_unit_at_a_time)
- announce_function (decl);
+ announce_function (decl);
gcc_assert (node->lowered);
@@ -1160,7 +1041,6 @@ cgraph_expand_function (struct cgraph_node *node)
/* Make sure that BE didn't give up on compiling. */
/* ??? Can happen with nested function of extern inline. */
gcc_assert (TREE_ASM_WRITTEN (decl));
-
current_function_decl = NULL;
if (!cgraph_preserve_function_body_p (decl))
{
@@ -1335,10 +1215,8 @@ bool
cgraph_preserve_function_body_p (tree decl)
{
struct cgraph_node *node;
- if (!cgraph_global_info_ready)
- return (flag_really_no_inline
- ? DECL_DISREGARD_INLINE_LIMITS (decl)
- : DECL_INLINE (decl));
+
+ gcc_assert (cgraph_global_info_ready);
/* Look if there is any clone around. */
for (node = cgraph_node (decl); node; node = node->next_clone)
if (node->global.inlined_to)
@@ -1351,7 +1229,7 @@ ipa_passes (void)
{
set_cfun (NULL);
current_function_decl = NULL;
- tree_register_cfg_hooks ();
+ gimple_register_cfg_hooks ();
bitmap_obstack_initialize (NULL);
execute_ipa_pass_list (all_ipa_passes);
bitmap_obstack_release (NULL);
@@ -1372,16 +1250,6 @@ cgraph_optimize (void)
/* Call functions declared with the "constructor" or "destructor"
attribute. */
cgraph_build_cdtor_fns ();
- if (!flag_unit_at_a_time)
- {
- cgraph_assemble_pending_functions ();
- cgraph_process_new_functions ();
- cgraph_state = CGRAPH_STATE_FINISHED;
- cgraph_output_pending_asms ();
- varpool_assemble_pending_decls ();
- varpool_output_debug_info ();
- return;
- }
/* Frontend may output common variables after the unit has been finalized.
It is safe to deal with them here as they are always zero initialized. */
@@ -1453,8 +1321,7 @@ cgraph_optimize (void)
verify_cgraph ();
/* Double check that all inline clones are gone and that all
function bodies have been released from memory. */
- if (flag_unit_at_a_time
- && !(sorrycount || errorcount))
+ if (!(sorrycount || errorcount))
{
struct cgraph_node *node;
bool error_found = false;
@@ -1462,7 +1329,7 @@ cgraph_optimize (void)
for (node = cgraph_nodes; node; node = node->next)
if (node->analyzed
&& (node->global.inlined_to
- || DECL_SAVED_TREE (node->decl)))
+ || gimple_body (node->decl)))
{
error_found = true;
dump_cgraph_node (stderr, node);
@@ -1551,10 +1418,10 @@ update_call_expr (struct cgraph_node *new_version)
struct cgraph_edge *e;
gcc_assert (new_version);
+
+ /* Update the call expr on the edges to call the new version. */
for (e = new_version->callers; e; e = e->next_caller)
- /* Update the call expr on the edges
- to call the new version. */
- TREE_OPERAND (CALL_EXPR_FN (get_call_expr_in (e->call_stmt)), 0) = new_version->decl;
+ gimple_call_set_fndecl (e->call_stmt, new_version->decl);
}
@@ -1629,12 +1496,15 @@ cgraph_copy_node_for_versioning (struct cgraph_node *old_version,
TREE_MAP is a mapping of tree nodes we want to replace with
new ones (according to results of prior analysis).
OLD_VERSION_NODE is the node that is versioned.
- It returns the new version's cgraph node. */
+ It returns the new version's cgraph node.
+ ARGS_TO_SKIP lists arguments to be omitted from functions
+ */
struct cgraph_node *
cgraph_function_versioning (struct cgraph_node *old_version_node,
VEC(cgraph_edge_p,heap) *redirect_callers,
- varray_type tree_map)
+ varray_type tree_map,
+ bitmap args_to_skip)
{
tree old_decl = old_version_node->decl;
struct cgraph_node *new_version_node = NULL;
@@ -1645,7 +1515,10 @@ cgraph_function_versioning (struct cgraph_node *old_version_node,
/* Make a new FUNCTION_DECL tree node for the
new version. */
- new_decl = copy_node (old_decl);
+ if (!args_to_skip)
+ new_decl = copy_node (old_decl);
+ else
+ new_decl = build_function_decl_skip_args (old_decl, args_to_skip);
/* Create the new version's call-graph node.
and update the edges of the new node. */
@@ -1654,7 +1527,7 @@ cgraph_function_versioning (struct cgraph_node *old_version_node,
redirect_callers);
/* Copy the OLD_VERSION_NODE function tree to the new version. */
- tree_function_versioning (old_decl, new_decl, tree_map, false);
+ tree_function_versioning (old_decl, new_decl, tree_map, false, args_to_skip);
/* Update the call_expr on the edges to call the new version node. */
update_call_expr (new_version_node);
@@ -1669,6 +1542,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;
}
@@ -1683,35 +1557,16 @@ save_inline_function_body (struct cgraph_node *node)
cgraph_lower_function (node);
- /* In non-unit-at-a-time we construct full fledged clone we never output to
- assembly file. This clone is pointed out by inline_decl of original function
- and inlining infrastructure knows how to deal with this. */
- if (!flag_unit_at_a_time)
- {
- struct cgraph_edge *e;
-
- first_clone = cgraph_clone_node (node, node->count, 0, CGRAPH_FREQ_BASE,
- false);
- first_clone->needed = 0;
- first_clone->reachable = 1;
- /* Recursively clone all bodies. */
- for (e = first_clone->callees; e; e = e->next_callee)
- if (!e->inline_failed)
- cgraph_clone_inlined_nodes (e, true, false);
- }
- else
- first_clone = node->next_clone;
+ first_clone = node->next_clone;
first_clone->decl = copy_node (node->decl);
node->next_clone = NULL;
- if (!flag_unit_at_a_time)
- node->inline_decl = first_clone->decl;
first_clone->prev_clone = NULL;
cgraph_insert_node_to_hashtable (first_clone);
gcc_assert (first_clone == cgraph_node (first_clone->decl));
/* Copy the OLD_VERSION_NODE function tree to the new version. */
- tree_function_versioning (node->decl, first_clone->decl, NULL, true);
+ tree_function_versioning (node->decl, first_clone->decl, NULL, true, NULL);
DECL_EXTERNAL (first_clone->decl) = 0;
DECL_ONE_ONLY (first_clone->decl) = 0;
diff --git a/gcc/collect2.c b/gcc/collect2.c
index 713c8f2d562..cdfe4e6be6d 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -236,8 +236,21 @@ static struct path_prefix *libpaths[3] = {&cmdline_lib_dirs,
&libpath_lib_dirs, NULL};
#endif
+/* Special kinds of symbols that a name may denote. */
+
+typedef enum {
+ SYM_REGULAR = 0, /* nothing special */
+
+ SYM_CTOR = 1, /* constructor */
+ SYM_DTOR = 2, /* destructor */
+ SYM_INIT = 3, /* shared object routine that calls all the ctors */
+ SYM_FINI = 4, /* shared object routine that calls all the dtors */
+ SYM_DWEH = 5 /* DWARF exception handling table */
+} symkind;
+
+static symkind is_ctor_dtor (const char *);
+
static void handler (int);
-static int is_ctor_dtor (const char *);
static char *find_a_file (struct path_prefix *, const char *);
static void add_prefix (struct path_prefix *, const char *);
static void prefix_from_env (const char *, struct path_prefix *);
@@ -519,12 +532,9 @@ dump_file (const char *name, FILE *to)
fclose (stream);
}
-/* Decide whether the given symbol is: a constructor (1), a destructor
- (2), a routine in a shared object that calls all the constructors
- (3) or destructors (4), a DWARF exception-handling table (5), or
- nothing special (0). */
+/* Return the kind of symbol denoted by name S. */
-static int
+static symkind
is_ctor_dtor (const char *s)
{
struct names { const char *const name; const int len; const int ret;
@@ -536,27 +546,27 @@ is_ctor_dtor (const char *s)
static const struct names special[] = {
#ifndef NO_DOLLAR_IN_LABEL
- { "GLOBAL__I$", sizeof ("GLOBAL__I$")-1, 1, 0 },
- { "GLOBAL__D$", sizeof ("GLOBAL__D$")-1, 2, 0 },
+ { "GLOBAL__I$", sizeof ("GLOBAL__I$")-1, SYM_CTOR, 0 },
+ { "GLOBAL__D$", sizeof ("GLOBAL__D$")-1, SYM_DTOR, 0 },
#else
#ifndef NO_DOT_IN_LABEL
- { "GLOBAL__I.", sizeof ("GLOBAL__I.")-1, 1, 0 },
- { "GLOBAL__D.", sizeof ("GLOBAL__D.")-1, 2, 0 },
+ { "GLOBAL__I.", sizeof ("GLOBAL__I.")-1, SYM_CTOR, 0 },
+ { "GLOBAL__D.", sizeof ("GLOBAL__D.")-1, SYM_DTOR, 0 },
#endif /* NO_DOT_IN_LABEL */
#endif /* NO_DOLLAR_IN_LABEL */
- { "GLOBAL__I_", sizeof ("GLOBAL__I_")-1, 1, 0 },
- { "GLOBAL__D_", sizeof ("GLOBAL__D_")-1, 2, 0 },
- { "GLOBAL__F_", sizeof ("GLOBAL__F_")-1, 5, 0 },
- { "GLOBAL__FI_", sizeof ("GLOBAL__FI_")-1, 3, 0 },
- { "GLOBAL__FD_", sizeof ("GLOBAL__FD_")-1, 4, 0 },
- { NULL, 0, 0, 0 }
+ { "GLOBAL__I_", sizeof ("GLOBAL__I_")-1, SYM_CTOR, 0 },
+ { "GLOBAL__D_", sizeof ("GLOBAL__D_")-1, SYM_DTOR, 0 },
+ { "GLOBAL__F_", sizeof ("GLOBAL__F_")-1, SYM_DWEH, 0 },
+ { "GLOBAL__FI_", sizeof ("GLOBAL__FI_")-1, SYM_INIT, 0 },
+ { "GLOBAL__FD_", sizeof ("GLOBAL__FD_")-1, SYM_FINI, 0 },
+ { NULL, 0, SYM_REGULAR, 0 }
};
while ((ch = *s) == '_')
++s;
if (s == orig_s)
- return 0;
+ return SYM_REGULAR;
for (p = &special[0]; p->len > 0; p++)
{
@@ -567,7 +577,7 @@ is_ctor_dtor (const char *s)
return p->ret;
}
}
- return 0;
+ return SYM_REGULAR;
}
/* We maintain two prefix lists: one from COMPILER_PATH environment variable
@@ -2171,17 +2181,17 @@ scan_prog_file (const char *prog_name, enum pass which_pass)
*end = '\0';
switch (is_ctor_dtor (name))
{
- case 1:
+ case SYM_CTOR:
if (which_pass != PASS_LIB)
add_to_list (&constructors, name);
break;
- case 2:
+ case SYM_DTOR:
if (which_pass != PASS_LIB)
add_to_list (&destructors, name);
break;
- case 3:
+ case SYM_INIT:
if (which_pass != PASS_LIB)
fatal ("init function found in object %s", prog_name);
#ifndef LD_INIT_SWITCH
@@ -2189,7 +2199,7 @@ scan_prog_file (const char *prog_name, enum pass which_pass)
#endif
break;
- case 4:
+ case SYM_FINI:
if (which_pass != PASS_LIB)
fatal ("fini function found in object %s", prog_name);
#ifndef LD_FINI_SWITCH
@@ -2197,7 +2207,7 @@ scan_prog_file (const char *prog_name, enum pass which_pass)
#endif
break;
- case 5:
+ case SYM_DWEH:
if (which_pass != PASS_LIB)
add_to_list (&frame_tables, name);
break;
@@ -2516,7 +2526,7 @@ scan_prog_file (const char *prog_name, enum pass which_pass)
switch (is_ctor_dtor (name))
{
- case 1:
+ case SYM_CTOR:
if (! is_shared)
add_to_list (&constructors, name);
#if defined (COLLECT_EXPORT_LIST) && !defined (LD_INIT_SWITCH)
@@ -2525,7 +2535,7 @@ scan_prog_file (const char *prog_name, enum pass which_pass)
#endif
break;
- case 2:
+ case SYM_DTOR:
if (! is_shared)
add_to_list (&destructors, name);
#if defined (COLLECT_EXPORT_LIST) && !defined (LD_INIT_SWITCH)
@@ -2535,14 +2545,14 @@ scan_prog_file (const char *prog_name, enum pass which_pass)
break;
#ifdef COLLECT_EXPORT_LIST
- case 3:
+ case SYM_INIT:
#ifndef LD_INIT_SWITCH
if (is_shared)
add_to_list (&constructors, name);
#endif
break;
- case 4:
+ case SYM_FINI:
#ifndef LD_INIT_SWITCH
if (is_shared)
add_to_list (&destructors, name);
@@ -2550,7 +2560,7 @@ scan_prog_file (const char *prog_name, enum pass which_pass)
break;
#endif
- case 5:
+ case SYM_DWEH:
if (! is_shared)
add_to_list (&frame_tables, name);
#if defined (COLLECT_EXPORT_LIST) && !defined (LD_INIT_SWITCH)
diff --git a/gcc/combine.c b/gcc/combine.c
index 706ee0689f3..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 ();
@@ -1340,8 +1342,7 @@ setup_incoming_promotions (rtx first)
function lie within the current compilation unit. (This does
take into account the exporting of a function via taking its
address, and so forth.) */
- if (flag_unit_at_a_time)
- strictly_local = cgraph_local_info (current_function_decl)->local;
+ strictly_local = cgraph_local_info (current_function_decl)->local;
/* The mode and signedness of the argument before any promotions happen
(equal to the mode of the pseudo holding it at that stage). */
diff --git a/gcc/common.opt b/gcc/common.opt
index 2196f749b35..b2c66433f56 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
@@ -459,6 +459,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
@@ -571,13 +575,17 @@ finhibit-size-directive
Common Report Var(flag_inhibit_size_directive)
Do not generate .size directives
+findirect-inlining
+Common Report Var(flag_indirect_inlining)
+Perform indirect inlining
+
; Nonzero means that functions declared `inline' will be treated
; as `static'. Prevents generation of zillions of copies of unused
; static inline functions; instead, `inlines' are written out
; only when actually used. Used in conjunction with -g. Also
; does the right thing with #pragma interface.
finline
-Common Report Var(flag_no_inline,0) Init(2)
+Common Report Var(flag_no_inline,0) Init(0)
Pay attention to the \"inline\" keyword
finline-small-functions
@@ -615,6 +623,10 @@ fipa-cp
Common Report Var(flag_ipa_cp) Optimization
Perform Interprocedural constant propagation
+fipa-cp-clone
+Common Report Var(flag_ipa_cp_clone) Optimization
+Perform cloning to make Interprocedural constant propagation stronger
+
fipa-pure-const
Common Report Var(flag_ipa_pure_const) Init(0) Optimization
Discover pure and const functions
@@ -641,6 +653,30 @@ Common Report Var(flag_ipa_struct_reorg)
Perform structure layout optimizations based
on profiling information.
+fira
+Common Report Var(flag_ira) Init(0)
+Use integrated register allocator.
+
+fira-algorithm=
+Common Joined RejectNegative
+-fira-algorithm=[regional|CB|mixed] Set the used IRA algorithm
+
+fira-coalesce
+Common Report Var(flag_ira_coalesce) Init(0)
+Do optimistic coalescing.
+
+fira-share-save-slots
+Common Report Var(flag_ira_share_save_slots) Init(1)
+Share slots for saving different hard registers.
+
+fira-share-spill-slots
+Common Report Var(flag_ira_share_spill_slots) Init(1)
+Share stack slots for spilled pseudo-registers.
+
+fira-verbose=
+Common RejectNegative Joined UInteger
+-fira-verbose=<number> Control IRA's level of diagnostic messages.
+
fivopts
Common Report Var(flag_ivopts) Init(1) Optimization
Optimize induction variables on trees
@@ -813,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
@@ -984,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
@@ -1069,8 +1111,8 @@ Common Report Var(flag_tree_ccp) Optimization
Enable SSA-CCP optimization on trees
ftree-store-ccp
-Common Report Var(flag_tree_store_ccp) Optimization
-Enable SSA-CCP optimization for stores and loads
+Common
+Does nothing. Preserved for backward compatibility.
ftree-ch
Common Report Var(flag_tree_ch) Optimization
diff --git a/gcc/config.gcc b/gcc/config.gcc
index bc818e6f585..877761bfe78 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -299,7 +299,7 @@ i[34567]86-*-*)
extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
nmmintrin.h bmmintrin.h mmintrin-common.h
- wmmintrin.h cross-stdarg.h"
+ wmmintrin.h gmmintrin.h cross-stdarg.h"
;;
x86_64-*-*)
cpu_type=i386
@@ -308,7 +308,7 @@ x86_64-*-*)
extra_headers="cpuid.h mmintrin.h mm3dnow.h xmmintrin.h emmintrin.h
pmmintrin.h tmmintrin.h ammintrin.h smmintrin.h
nmmintrin.h bmmintrin.h mmintrin-common.h
- wmmintrin.h cross-stdarg.h"
+ wmmintrin.h gmmintrin.h cross-stdarg.h"
need_64bit_hwint=yes
;;
ia64-*-*)
@@ -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
@@ -739,7 +739,7 @@ arm*-*-uclinux*) # ARM ucLinux
tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/linux-gas.h arm/uclinux-elf.h"
tmake_file="arm/t-arm arm/t-arm-elf"
case ${target} in
- arm*-*-uclinux-*eabi)
+ arm*-*-uclinux*eabi)
tm_file="$tm_file arm/bpabi.h arm/uclinux-eabi.h"
tmake_file="$tmake_file arm/t-bpabi"
# The BPABI long long divmod functions return a 128-bit value in
@@ -1542,15 +1542,22 @@ 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"
;;
+ mips64octeon*-*-linux*)
+ tm_defines="${tm_defines} MIPS_CPU_STRING_DEFAULT=\\\"octeon\\\""
+ target_cpu_default=MASK_SOFT_FLOAT_ABI
+ ;;
+ mipsisa64r2*-*-linux*)
+ tm_defines="${tm_defines} MIPS_ISA_DEFAULT=65"
+ ;;
esac
gnu_ld=yes
gas=yes
@@ -1558,6 +1565,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 +2353,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 +2783,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 +2830,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 +2862,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 +3097,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.host b/gcc/config.host
index d6efc6d730b..1d2462911df 100644
--- a/gcc/config.host
+++ b/gcc/config.host
@@ -141,26 +141,14 @@ case ${host} in
prefix=/gnu
local_prefix=/gnu
;;
- hppa1.1-*-pro*)
- host_xmake_file="${host_xmake_file} pa/x-ada"
- ;;
- hppa1.1-*-osf*)
- host_xmake_file="${host_xmake_file} pa/x-ada"
- ;;
- hppa1.1-*-rtems*)
- host_xmake_file="${host_xmake_file} pa/x-ada"
- ;;
- hppa1.1-*-bsd*)
- host_xmake_file="${host_xmake_file} pa/x-ada"
- ;;
hppa1.0-*-hpux10* | hppa1.1-*-hpux10* | hppa2*-*-hpux10*)
out_host_hook_obj=host-hpux.o
- host_xmake_file="${host_xmake_file} pa/x-ada-hpux10 x-hpux"
+ host_xmake_file="${host_xmake_file} x-hpux"
;;
hppa1.0-*-hpux11* | hppa1.1-*-hpux11* | hppa2*-*-hpux11* | \
hppa*64*-*-hpux11*)
out_host_hook_obj=host-hpux.o
- host_xmake_file="${host_xmake_file} pa/x-ada x-hpux"
+ host_xmake_file="${host_xmake_file} x-hpux"
;;
hppa*-*-linux*)
out_host_hook_obj=host-hpux.o
diff --git a/gcc/config.in b/gcc/config.in
index ec20c1cdab0..f4604d25719 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -93,6 +93,14 @@
#endif
+/* Define if you want operations on GIMPLE (the basic data structure of the
+ high-level optimizers) to be checked for dynamic type safety at runtime.
+ This is moderately expensive. */
+#ifndef USED_FOR_TARGET
+#undef ENABLE_GIMPLE_CHECKING
+#endif
+
+
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#ifndef USED_FOR_TARGET
@@ -369,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
@@ -813,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 350994234cd..cba9370f629 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -1,6 +1,6 @@
/* Subroutines used for code generation on the DEC Alpha.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
This file is part of GCC.
@@ -51,7 +51,7 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include <splay-tree.h>
#include "cfglayout.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-flow.h"
#include "tree-stdarg.h"
#include "tm-constrs.h"
@@ -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);
@@ -5817,11 +5817,11 @@ va_list_skip_additions (tree lhs)
if (TREE_CODE (stmt) == PHI_NODE)
return stmt;
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT
- || GIMPLE_STMT_OPERAND (stmt, 0) != lhs)
+ if (TREE_CODE (stmt) != MODIFY_EXPR
+ || TREE_OPERAND (stmt, 0) != lhs)
return lhs;
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ rhs = TREE_OPERAND (stmt, 1);
if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
rhs = TREE_OPERAND (rhs, 0);
@@ -5856,11 +5856,17 @@ va_list_skip_additions (tree lhs)
current statement. */
static bool
-alpha_stdarg_optimize_hook (struct stdarg_info *si, const_tree lhs, const_tree rhs)
+alpha_stdarg_optimize_hook (struct stdarg_info *si, const_gimple stmt)
{
tree base, offset, arg1, arg2;
int offset_arg = 1;
+#if 1
+ /* FIXME tuples. */
+ (void) si;
+ (void) stmt;
+ return false;
+#else
while (handled_component_p (rhs))
rhs = TREE_OPERAND (rhs, 0);
if (TREE_CODE (rhs) != INDIRECT_REF
@@ -5953,6 +5959,7 @@ alpha_stdarg_optimize_hook (struct stdarg_info *si, const_tree lhs, const_tree r
escapes:
si->va_list_escapes = true;
return false;
+#endif
}
#endif
@@ -6087,7 +6094,7 @@ alpha_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
{
nextarg = plus_constant (nextarg, offset);
nextarg = plus_constant (nextarg, NUM_ARGS * UNITS_PER_WORD);
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (valist), valist,
+ t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist,
make_tree (ptr_type_node, nextarg));
TREE_SIDE_EFFECTS (t) = 1;
@@ -6106,20 +6113,20 @@ alpha_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
t = make_tree (ptr_type_node, virtual_incoming_args_rtx);
t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t,
size_int (offset));
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (base_field), base_field, t);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (base_field), base_field, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
t = build_int_cst (NULL_TREE, NUM_ARGS * UNITS_PER_WORD);
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (offset_field),
- offset_field, t);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (offset_field), offset_field, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
}
static tree
-alpha_gimplify_va_arg_1 (tree type, tree base, tree offset, tree *pre_p)
+alpha_gimplify_va_arg_1 (tree type, tree base, gimple_seq offset,
+ gimple_seq *pre_p)
{
tree type_size, ptr_type, addend, t, addr, internal_post;
@@ -6128,9 +6135,9 @@ alpha_gimplify_va_arg_1 (tree type, tree base, tree offset, tree *pre_p)
if (targetm.calls.must_pass_in_stack (TYPE_MODE (type), type))
{
t = build_int_cst (TREE_TYPE (offset), 6*8);
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (offset), offset,
- build2 (MAX_EXPR, TREE_TYPE (offset), offset, t));
- gimplify_and_add (t, pre_p);
+ gimplify_assign (offset,
+ build2 (MAX_EXPR, TREE_TYPE (offset), offset, t),
+ pre_p);
}
addend = offset;
@@ -6182,15 +6189,15 @@ alpha_gimplify_va_arg_1 (tree type, tree base, tree offset, tree *pre_p)
t = size_binop (MULT_EXPR, t, size_int (8));
}
t = fold_convert (TREE_TYPE (offset), t);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, offset,
- build2 (PLUS_EXPR, TREE_TYPE (offset), offset, t));
- gimplify_and_add (t, pre_p);
+ gimplify_assign (offset, build2 (PLUS_EXPR, TREE_TYPE (offset), offset, t),
+ pre_p);
return build_va_arg_indirect_ref (addr);
}
static tree
-alpha_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
+alpha_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
+ gimple_seq *post_p)
{
tree offset_field, base_field, offset, base, t, r;
bool indirect;
@@ -6222,9 +6229,8 @@ alpha_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
r = alpha_gimplify_va_arg_1 (type, base, offset, pre_p);
/* Stuff the offset temporary back into its field. */
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, offset_field,
- fold_convert (TREE_TYPE (offset_field), offset));
- gimplify_and_add (t, pre_p);
+ gimplify_assign (offset_field,
+ fold_convert (TREE_TYPE (offset_field), offset), pre_p);
if (indirect)
r = build_va_arg_indirect_ref (r);
@@ -8255,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 ());
@@ -8264,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. */
@@ -8275,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. */
@@ -8292,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;
@@ -8314,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 5f2431e2978..8e022d6a5f8 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. */
@@ -557,6 +553,19 @@ enum reg_class {
{0x00000000, 0x7fffffff}, /* FLOAT_REGS */ \
{0xffffffff, 0xffffffff} }
+/* The following macro defines cover classes for Integrated Register
+ Allocator. Cover classes is a set of non-intersected register
+ classes covering all hard registers used for register allocation
+ purpose. Any move between two registers of a cover class should be
+ cheaper than load or store of the registers. The macro value is
+ array of register classes with LIM_REG_CLASSES used as the end
+ marker. */
+
+#define IRA_COVER_CLASSES \
+{ \
+ GENERAL_REGS, FLOAT_REGS, LIM_REG_CLASSES \
+}
+
/* The same information, inverted:
Return the class number of the smallest class containing
reg number REGNO. This could be a conditional expression
@@ -631,7 +640,7 @@ extern int alpha_memory_latency;
#define MEMORY_MOVE_COST(MODE,CLASS,IN) (2*alpha_memory_latency)
/* Provide the cost of a branch. Exact meaning under development. */
-#define BRANCH_COST 5
+#define BRANCH_COST(speed_p, predictable_p) 5
/* Stack layout; function entry, exit and calling. */
diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
index ea40fb23ab7..ff473c3f73e 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -824,7 +824,7 @@ arc_select_cc_mode (OP, X, Y)
/* The cost of a branch insn. */
/* ??? What's the right value here? Branches are certainly more
expensive than reg->reg moves. */
-#define BRANCH_COST 2
+#define BRANCH_COST(speed_p, predictable_p) 2
/* Nonzero if access to memory by bytes is slow and undesirable.
For RISC chips, it means that access to memory by bytes is no
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..d0e408ccf1d 100644
--- a/gcc/config/arm/arm-protos.h
+++ b/gcc/config/arm/arm-protos.h
@@ -24,6 +24,7 @@
#define GCC_ARM_PROTOS_H
extern void arm_override_options (void);
+extern void arm_optimization_options (int, int);
extern int use_return_insn (int, rtx);
extern int arm_regno_class (int);
extern void arm_load_pic_register (unsigned long);
@@ -208,4 +209,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 d64b6fda34f..4de60bb67f1 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -62,6 +62,7 @@ const struct attribute_spec arm_attribute_table[];
void (*arm_lang_output_object_attributes_hook)(void);
/* Forward function declarations. */
+static int arm_compute_static_chain_stack_bytes (void);
static arm_stack_offsets *arm_get_frame_offsets (void);
static void arm_add_gc_roots (void);
static int arm_gen_constant (enum rtx_code, enum machine_mode, rtx,
@@ -366,6 +367,15 @@ static bool arm_allocate_stack_slots_for_args (void);
#undef TARGET_CANNOT_FORCE_CONST_MEM
#define TARGET_CANNOT_FORCE_CONST_MEM arm_cannot_force_const_mem
+#undef TARGET_MAX_ANCHOR_OFFSET
+#define TARGET_MAX_ANCHOR_OFFSET 4095
+
+/* The minimum is set such that the total size of the block
+ for a particular anchor is -4088 + 1 + 4095 bytes, which is
+ divisible by eight, ensuring natural spacing of anchors. */
+#undef TARGET_MIN_ANCHOR_OFFSET
+#define TARGET_MIN_ANCHOR_OFFSET -4088
+
#undef TARGET_SCHED_ISSUE_RATE
#define TARGET_SCHED_ISSUE_RATE arm_issue_rate
@@ -699,6 +709,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}
};
@@ -715,6 +727,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 */
};
@@ -1263,6 +1276,27 @@ arm_override_options (void)
arm_arch_iwmmxt = (insn_flags & FL_IWMMXT) != 0;
arm_arch_hwdiv = (insn_flags & FL_DIV) != 0;
+ /* If we are not using the default (ARM mode) section anchor offset
+ ranges, then set the correct ranges now. */
+ if (TARGET_THUMB1)
+ {
+ /* Thumb-1 LDR instructions cannot have negative offsets.
+ Permissible positive offset ranges are 5-bit (for byte loads),
+ 6-bit (for halfword loads), or 7-bit (for word loads).
+ Empirical results suggest a 7-bit anchor range gives the best
+ overall code size. */
+ targetm.min_anchor_offset = 0;
+ targetm.max_anchor_offset = 127;
+ }
+ else if (TARGET_THUMB2)
+ {
+ /* The minimum is set such that the total size of the block
+ for a particular anchor is 248 + 1 + 4095 bytes, which is
+ divisible by eight, ensuring natural spacing of anchors. */
+ targetm.min_anchor_offset = -248;
+ targetm.max_anchor_offset = 4095;
+ }
+
/* V5 code we generate is completely interworking capable, so we turn off
TARGET_INTERWORK here to avoid many tests later on. */
@@ -3267,11 +3301,6 @@ arm_function_in_section_p (tree decl, section *section)
/* If DECL_SECTION_NAME is set, assume it is trustworthy. */
if (!DECL_SECTION_NAME (decl))
{
- /* Only cater for unit-at-a-time mode, where we know that the user
- cannot later specify a section for DECL. */
- if (!flag_unit_at_a_time)
- return false;
-
/* Make sure that we will not create a unique section for DECL. */
if (flag_function_sections || DECL_ONE_ONLY (decl))
return false;
@@ -3494,10 +3523,22 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
&& XEXP (XEXP (orig, 0), 0) == cfun->machine->pic_reg)
return orig;
+ /* Handle the case where we have: const (UNSPEC_TLS). */
if (GET_CODE (XEXP (orig, 0)) == UNSPEC
&& XINT (XEXP (orig, 0), 1) == UNSPEC_TLS)
return orig;
+ /* Handle the case where we have:
+ const (plus (UNSPEC_TLS) (ADDEND)). The ADDEND must be a
+ CONST_INT. */
+ if (GET_CODE (XEXP (orig, 0)) == PLUS
+ && GET_CODE (XEXP (XEXP (orig, 0), 0)) == UNSPEC
+ && XINT (XEXP (XEXP (orig, 0), 0), 1) == UNSPEC_TLS)
+ {
+ gcc_assert (GET_CODE (XEXP (XEXP (orig, 0), 1)) == CONST_INT);
+ return orig;
+ }
+
if (reg == 0)
{
gcc_assert (can_create_pseudo_p ());
@@ -8773,17 +8814,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;
@@ -10284,7 +10328,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;
@@ -10307,25 +10351,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" : "",
@@ -10336,37 +10380,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;
@@ -10393,7 +10435,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;
@@ -10436,12 +10478,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 "";
@@ -10797,6 +10839,24 @@ arm_compute_save_reg0_reg12_mask (void)
}
+/* Compute the number of bytes used to store the static chain register on the
+ stack, above the stack frame. We need to know this accurately to get the
+ alignment of the rest of the stack frame correct. */
+
+static int arm_compute_static_chain_stack_bytes (void)
+{
+ unsigned long func_type = arm_current_func_type ();
+ int static_chain_stack_bytes = 0;
+
+ if (TARGET_APCS_FRAME && frame_pointer_needed && TARGET_ARM &&
+ IS_NESTED (func_type) &&
+ df_regs_ever_live_p (3) && crtl->args.pretend_args_size == 0)
+ static_chain_stack_bytes = 4;
+
+ return static_chain_stack_bytes;
+}
+
+
/* Compute a bit mask of which registers need to be
saved on the stack for the current function.
This is used by arm_get_frame_offsets, which may add extra registers. */
@@ -10849,7 +10909,9 @@ arm_compute_save_reg_mask (void)
if (TARGET_REALLY_IWMMXT
&& ((bit_count (save_reg_mask)
- + ARM_NUM_INTS (crtl->args.pretend_args_size)) % 2) != 0)
+ + ARM_NUM_INTS (crtl->args.pretend_args_size +
+ arm_compute_static_chain_stack_bytes())
+ ) % 2) != 0)
{
/* The total number of registers that are going to be pushed
onto the stack is odd. We need to ensure that the stack
@@ -10934,6 +10996,26 @@ thumb1_compute_save_reg_mask (void)
mask |= 1 << reg;
}
+ /* The 504 below is 8 bytes less than 512 because there are two possible
+ alignment words. We can't tell here if they will be present or not so we
+ have to play it safe and assume that they are. */
+ if ((CALLER_INTERWORKING_SLOT_SIZE +
+ ROUND_UP_WORD (get_frame_size ()) +
+ crtl->outgoing_args_size) >= 504)
+ {
+ /* This is the same as the code in thumb1_expand_prologue() which
+ determines which register to use for stack decrement. */
+ for (reg = LAST_ARG_REGNUM + 1; reg <= LAST_LO_REGNUM; reg++)
+ if (mask & (1 << reg))
+ break;
+
+ if (reg > LAST_LO_REGNUM)
+ {
+ /* Make sure we have a register available for stack decrement. */
+ mask |= 1 << LAST_LO_REGNUM;
+ }
+ }
+
return mask;
}
@@ -12069,7 +12151,8 @@ arm_get_frame_offsets (void)
offsets->saved_args = crtl->args.pretend_args_size;
/* In Thumb mode this is incorrect, but never used. */
- offsets->frame = offsets->saved_args + (frame_pointer_needed ? 4 : 0);
+ offsets->frame = offsets->saved_args + (frame_pointer_needed ? 4 : 0) +
+ arm_compute_static_chain_stack_bytes();
if (TARGET_32BIT)
{
@@ -12116,7 +12199,8 @@ arm_get_frame_offsets (void)
}
/* Saved registers include the stack frame. */
- offsets->saved_regs = offsets->saved_args + saved;
+ offsets->saved_regs = offsets->saved_args + saved +
+ arm_compute_static_chain_stack_bytes();
offsets->soft_frame = offsets->saved_regs + CALLER_INTERWORKING_SLOT_SIZE;
/* A leaf function does not need any stack alignment if it has nothing
on the stack. */
@@ -12208,14 +12292,9 @@ arm_compute_initial_elimination_offset (unsigned int from, unsigned int to)
return offsets->soft_frame - offsets->saved_args;
case ARM_HARD_FRAME_POINTER_REGNUM:
- /* If there is no stack frame then the hard
- frame pointer and the arg pointer coincide. */
- if (offsets->frame == offsets->saved_regs)
- return 0;
- /* FIXME: Not sure about this. Maybe we should always return 0 ? */
- return (frame_pointer_needed
- && cfun->static_chain_decl != NULL
- && ! cfun->machine->uses_anonymous_args) ? 4 : 0;
+ /* This is only non-zero in the case where the static chain register
+ is stored above the frame. */
+ return offsets->frame - offsets->saved_args - 4;
case STACK_POINTER_REGNUM:
/* If nothing has been pushed on the stack at all
@@ -12443,7 +12522,9 @@ arm_expand_prologue (void)
r0 = gen_rtx_REG (SImode, 0);
r1 = gen_rtx_REG (SImode, 1);
- dwarf = gen_rtx_UNSPEC (SImode, NULL_RTVEC, UNSPEC_STACK_ALIGN);
+ /* Use a real rtvec rather than NULL_RTVEC so the rest of the
+ compiler won't choke. */
+ dwarf = gen_rtx_UNSPEC (SImode, rtvec_alloc (0), UNSPEC_STACK_ALIGN);
dwarf = gen_rtx_SET (VOIDmode, r0, dwarf);
insn = gen_movsi (r0, stack_pointer_rtx);
RTX_FRAME_RELATED_P (insn) = 1;
@@ -12501,6 +12582,9 @@ arm_expand_prologue (void)
insn = emit_set_insn (gen_rtx_REG (SImode, 3), ip_rtx);
else if (args_to_push == 0)
{
+ gcc_assert(arm_compute_static_chain_stack_bytes() == 4);
+ saved_regs += 4;
+
rtx dwarf;
insn = gen_rtx_PRE_DEC (SImode, stack_pointer_rtx);
@@ -13285,28 +13369,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);
}
@@ -17011,62 +17083,25 @@ thumb1_expand_prologue (void)
been pushed at the start of the prologue and so we can corrupt
it now. */
for (regno = LAST_ARG_REGNUM + 1; regno <= LAST_LO_REGNUM; regno++)
- if (live_regs_mask & (1 << regno)
- && !(frame_pointer_needed
- && (regno == THUMB_HARD_FRAME_POINTER_REGNUM)))
+ if (live_regs_mask & (1 << regno))
break;
- if (regno > LAST_LO_REGNUM) /* Very unlikely. */
- {
- rtx spare = gen_rtx_REG (SImode, IP_REGNUM);
+ gcc_assert(regno <= LAST_LO_REGNUM);
- /* Choose an arbitrary, non-argument low register. */
- reg = gen_rtx_REG (SImode, LAST_LO_REGNUM);
+ reg = gen_rtx_REG (SImode, regno);
- /* Save it by copying it into a high, scratch register. */
- emit_insn (gen_movsi (spare, reg));
- /* Add a USE to stop propagate_one_insn() from barfing. */
- emit_insn (gen_prologue_use (spare));
+ emit_insn (gen_movsi (reg, GEN_INT (- amount)));
- /* Decrement the stack. */
- emit_insn (gen_movsi (reg, GEN_INT (- amount)));
- insn = emit_insn (gen_addsi3 (stack_pointer_rtx,
- stack_pointer_rtx, reg));
- RTX_FRAME_RELATED_P (insn) = 1;
- dwarf = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
- -amount));
- RTX_FRAME_RELATED_P (dwarf) = 1;
- REG_NOTES (insn)
- = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
- REG_NOTES (insn));
-
- /* Restore the low register's original value. */
- emit_insn (gen_movsi (reg, spare));
-
- /* Emit a USE of the restored scratch register, so that flow
- analysis will not consider the restore redundant. The
- register won't be used again in this function and isn't
- restored by the epilogue. */
- emit_insn (gen_prologue_use (reg));
- }
- else
- {
- reg = gen_rtx_REG (SImode, regno);
-
- emit_insn (gen_movsi (reg, GEN_INT (- amount)));
-
- insn = emit_insn (gen_addsi3 (stack_pointer_rtx,
- stack_pointer_rtx, reg));
- RTX_FRAME_RELATED_P (insn) = 1;
- dwarf = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
- plus_constant (stack_pointer_rtx,
- -amount));
- RTX_FRAME_RELATED_P (dwarf) = 1;
- REG_NOTES (insn)
- = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
- REG_NOTES (insn));
- }
+ insn = emit_insn (gen_addsi3 (stack_pointer_rtx,
+ stack_pointer_rtx, reg));
+ RTX_FRAME_RELATED_P (insn) = 1;
+ dwarf = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ plus_constant (stack_pointer_rtx,
+ -amount));
+ RTX_FRAME_RELATED_P (dwarf) = 1;
+ REG_NOTES (insn)
+ = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
+ REG_NOTES (insn));
}
}
@@ -17737,8 +17772,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:
@@ -19045,4 +19084,39 @@ 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));
+}
+
+/* Set default optimization options. */
+void
+arm_optimization_options (int level, int size ATTRIBUTE_UNUSED)
+{
+ /* Enable section anchors by default at -O1 or higher.
+ Use 2 to distinguish from an explicit -fsection-anchors
+ given on the command line. */
+ if (level > 0)
+ flag_section_anchors = 2;
+}
+
#include "gt-arm.h"
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 9f662f31297..4132b06b024 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. */
@@ -420,6 +427,9 @@ extern int arm_arch_hwdiv;
#define OVERRIDE_OPTIONS arm_override_options ()
+#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \
+ arm_optimization_options ((LEVEL), (SIZE))
+
/* Nonzero if PIC code requires explicit qualifiers to generate
PLT and GOT relocs rather than the assembler doing so implicitly.
Subtargets can override these if required. */
@@ -945,7 +955,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 +1090,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. */
@@ -1175,6 +1188,20 @@ enum reg_class
or could index an array. */
#define REGNO_REG_CLASS(REGNO) arm_regno_class (REGNO)
+/* The following macro defines cover classes for Integrated Register
+ Allocator. Cover classes is a set of non-intersected register
+ classes covering all hard registers used for register allocation
+ purpose. Any move between two registers of a cover class should be
+ cheaper than load or store of the registers. The macro value is
+ array of register classes with LIM_REG_CLASSES used as the end
+ marker. */
+
+#define IRA_COVER_CLASSES \
+{ \
+ GENERAL_REGS, FPA_REGS, CIRRUS_REGS, VFP_REGS, IWMMXT_GR_REGS, IWMMXT_REGS,\
+ LIM_REG_CLASSES \
+}
+
/* FPA registers can't do subreg as all values are reformatted to internal
precision. VFP registers may only be accessed in the mode they
were set. */
@@ -2270,7 +2297,7 @@ do { \
/* Try to generate sequences that don't involve branches, we can then use
conditional instructions */
-#define BRANCH_COST \
+#define BRANCH_COST(speed_p, predictable_p) \
(TARGET_32BIT ? 4 : (optimize > 0 ? 2 : 0))
/* Position Independent Code. */
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 9cd6e7262a2..0ef91c6a003 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -193,6 +193,8 @@
; scheduling of writes.
; Classification of each insn
+; Note: vfp.md has different meanings for some of these, and some further
+; types as well. See that file for details.
; alu any alu instruction that doesn't hit memory or fp
; regs or have a shifted source operand
; alu_shift any data instruction that doesn't hit memory or fp
@@ -351,6 +353,7 @@
(include "arm1136jfs.md")
(include "cortex-a8.md")
(include "cortex-r4.md")
+(include "vfp11.md")
;;---------------------------------------------------------------------------
@@ -5286,12 +5289,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/arm1020e.md b/gcc/config/arm/arm1020e.md
index bec8766c287..ed170c4b170 100644
--- a/gcc/config/arm/arm1020e.md
+++ b/gcc/config/arm/arm1020e.md
@@ -265,18 +265,6 @@
(eq_attr "fpu" "vfp"))
(const_string "yes") (const_string "no"))))
-;; The VFP "type" attributes differ from those used in the FPA model.
-;; ffarith Fast floating point insns, e.g. abs, neg, cpy, cmp.
-;; farith Most arithmetic insns.
-;; fmul Double precision multiply.
-;; fdivs Single precision sqrt or division.
-;; fdivd Double precision sqrt or division.
-;; f_flag fmstat operation
-;; f_load Floating point load from memory.
-;; f_store Floating point store to memory.
-;; f_2_r Transfer vfp to arm reg.
-;; r_2_f Transfer arm to vfp reg.
-
;; Note, no instruction can issue to the VFP if the core is stalled in the
;; first execute state. We model this by using 1020a_e in the first cycle.
(define_insn_reservation "v10_ffarith" 5
@@ -296,7 +284,7 @@
(define_insn_reservation "v10_fmul" 6
(and (eq_attr "vfp10" "yes")
- (eq_attr "type" "fmul"))
+ (eq_attr "type" "fmuls,fmacs,fmuld,fmacd"))
"1020a_e+v10_fmac*2")
(define_insn_reservation "v10_fdivs" 18
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/cortex-r4.md b/gcc/config/arm/cortex-r4.md
index d912f205994..34467345acb 100644
--- a/gcc/config/arm/cortex-r4.md
+++ b/gcc/config/arm/cortex-r4.md
@@ -4,15 +4,19 @@
;; 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 COPYING. If not, write to
-;; the Free Software Foundation, 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GCC; see the file COPYING3. If not see
+;; <http://www.gnu.org/licenses/>.
(define_automaton "cortex_r4")
diff --git a/gcc/config/arm/iwmmxt.md b/gcc/config/arm/iwmmxt.md
index 633aaaa875f..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")
- (match_operand:V8QI 1 "general_operand" "y,y,mi,y,r,r,mi"))]
+(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)
@@ -183,68 +183,10 @@
default: return output_move_double (operands);
}"
[(set_attr "predicable" "yes")
- (set_attr "length" "4, 4, 4,4,4,8, 8")
- (set_attr "type" "*,store1,load1,*,*,*,load1")
- (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")
- (match_operand:V4HI 1 "general_operand" "y,y,mi,y,r,r,mi"))]
- "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")
- (set_attr "type" "*,store1,load1,*,*,*,load1")
- (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")
- (match_operand:V2SI 1 "general_operand" "y,y,mi,y,r,r,mi"))]
- "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")
- (set_attr "type" "*,store1,load1,*,*,*,load1")
- (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")])
+ (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,*")])
;; Vector add/subtract
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/arm/t-arm-coff b/gcc/config/arm/t-arm-coff
index 4fa1929bb4b..04880833e85 100644
--- a/gcc/config/arm/t-arm-coff
+++ b/gcc/config/arm/t-arm-coff
@@ -1,5 +1,5 @@
LIB1ASMSRC = arm/lib1funcs.asm
-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func _call_via_rX _interwork_call_via_rX clzsi2 _clzdi2
+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func _call_via_rX _interwork_call_via_rX _clzsi2 _clzdi2
# We want fine grained libraries, so use the new code to build the
# floating point emulation libraries.
diff --git a/gcc/config/arm/t-linux b/gcc/config/arm/t-linux
index 0e5c0b2501b..ea328951984 100644
--- a/gcc/config/arm/t-linux
+++ b/gcc/config/arm/t-linux
@@ -3,7 +3,7 @@
TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
LIB1ASMSRC = arm/lib1funcs.asm
-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx clzsi2 _clzdi2
+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2
# MULTILIB_OPTIONS = mhard-float/msoft-float
# MULTILIB_DIRNAMES = hard-float soft-float
diff --git a/gcc/config/arm/vfp.md b/gcc/config/arm/vfp.md
index 23aa202778f..64bb9564d9c 100644
--- a/gcc/config/arm/vfp.md
+++ b/gcc/config/arm/vfp.md
@@ -1,6 +1,6 @@
-;; ARM VFP coprocessor Machine Description
-;; Copyright (C) 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
-;; Written by CodeSourcery, LLC.
+;; ARM VFP instruction patterns
+;; Copyright (C) 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Written by CodeSourcery.
;;
;; This file is part of GCC.
;;
@@ -23,45 +23,13 @@
[(VFPCC_REGNUM 127)]
)
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Pipeline description
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
-(define_automaton "vfp11")
-
-;; There are 3 pipelines in the VFP11 unit.
-;;
-;; - A 8-stage FMAC pipeline (7 execute + writeback) with forward from
-;; fourth stage for simple operations.
-;;
-;; - A 5-stage DS pipeline (4 execute + writeback) for divide/sqrt insns.
-;; These insns also uses first execute stage of FMAC pipeline.
-;;
-;; - A 4-stage LS pipeline (execute + 2 memory + writeback) with forward from
-;; second memory stage for loads.
-
-;; We do not model Write-After-Read hazards.
-;; We do not do write scheduling with the arm core, so it is only necessary
-;; to model the first stage of each pipeline
-;; ??? Need to model LS pipeline properly for load/store multiple?
-;; We do not model fmstat properly. This could be done by modeling pipelines
-;; properly and defining an absence set between a dummy fmstat unit and all
-;; other vfp units.
-
-(define_cpu_unit "fmac" "vfp11")
-
-(define_cpu_unit "ds" "vfp11")
-
-(define_cpu_unit "vfp_ls" "vfp11")
-
-(define_cpu_unit "fmstat" "vfp11")
-
-(exclusion_set "fmac,ds" "fmstat")
-
;; The VFP "type" attributes differ from those used in the FPA model.
;; ffarith Fast floating point insns, e.g. abs, neg, cpy, cmp.
;; farith Most arithmetic insns.
-;; fmul Double precision multiply.
+;; fmuls Single precision multiply.
+;; fmuld Double precision multiply.
+;; fmacs Single precision multiply-accumulate.
+;; fmacd Double precision multiply-accumulate.
;; fdivs Single precision sqrt or division.
;; fdivd Double precision sqrt or division.
;; f_flag fmstat operation
@@ -71,51 +39,6 @@
;; r_2_f Transfer arm to vfp reg.
;; f_cvt Convert floating<->integral
-(define_insn_reservation "vfp_ffarith" 4
- (and (eq_attr "generic_vfp" "yes")
- (eq_attr "type" "ffarith"))
- "fmac")
-
-(define_insn_reservation "vfp_farith" 8
- (and (eq_attr "generic_vfp" "yes")
- (eq_attr "type" "farith,f_cvt"))
- "fmac")
-
-(define_insn_reservation "vfp_fmul" 9
- (and (eq_attr "generic_vfp" "yes")
- (eq_attr "type" "fmul"))
- "fmac*2")
-
-(define_insn_reservation "vfp_fdivs" 19
- (and (eq_attr "generic_vfp" "yes")
- (eq_attr "type" "fdivs"))
- "ds*15")
-
-(define_insn_reservation "vfp_fdivd" 33
- (and (eq_attr "generic_vfp" "yes")
- (eq_attr "type" "fdivd"))
- "fmac+ds*29")
-
-;; Moves to/from arm regs also use the load/store pipeline.
-(define_insn_reservation "vfp_fload" 4
- (and (eq_attr "generic_vfp" "yes")
- (eq_attr "type" "f_loads,f_loadd,r_2_f"))
- "vfp_ls")
-
-(define_insn_reservation "vfp_fstore" 4
- (and (eq_attr "generic_vfp" "yes")
- (eq_attr "type" "f_stores,f_stored,f_2_r"))
- "vfp_ls")
-
-(define_insn_reservation "vfp_to_cpsr" 4
- (and (eq_attr "generic_vfp" "yes")
- (eq_attr "type" "f_flag"))
- "fmstat,vfp_ls*3")
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; Insn pattern
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
;; SImode moves
;; ??? For now do not allow loading constants into vfp regs. This causes
;; problems because small constants get converted into adds.
@@ -653,7 +576,7 @@
"TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
"fmuls%?\\t%0, %1, %2"
[(set_attr "predicable" "yes")
- (set_attr "type" "farith")]
+ (set_attr "type" "fmuls")]
)
(define_insn "*muldf3_vfp"
@@ -663,7 +586,7 @@
"TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
"fmuld%?\\t%P0, %P1, %P2"
[(set_attr "predicable" "yes")
- (set_attr "type" "fmul")]
+ (set_attr "type" "fmuld")]
)
@@ -674,7 +597,7 @@
"TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
"fnmuls%?\\t%0, %1, %2"
[(set_attr "predicable" "yes")
- (set_attr "type" "farith")]
+ (set_attr "type" "fmuls")]
)
(define_insn "*muldf3negdf_vfp"
@@ -684,7 +607,7 @@
"TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
"fnmuld%?\\t%P0, %P1, %P2"
[(set_attr "predicable" "yes")
- (set_attr "type" "fmul")]
+ (set_attr "type" "fmuld")]
)
@@ -699,7 +622,7 @@
"TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
"fmacs%?\\t%0, %2, %3"
[(set_attr "predicable" "yes")
- (set_attr "type" "farith")]
+ (set_attr "type" "fmacs")]
)
(define_insn "*muldf3adddf_vfp"
@@ -710,7 +633,7 @@
"TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
"fmacd%?\\t%P0, %P2, %P3"
[(set_attr "predicable" "yes")
- (set_attr "type" "fmul")]
+ (set_attr "type" "fmacd")]
)
;; 0 = 1 * 2 - 0
@@ -722,7 +645,7 @@
"TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
"fmscs%?\\t%0, %2, %3"
[(set_attr "predicable" "yes")
- (set_attr "type" "farith")]
+ (set_attr "type" "fmacs")]
)
(define_insn "*muldf3subdf_vfp"
@@ -733,7 +656,7 @@
"TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
"fmscd%?\\t%P0, %P2, %P3"
[(set_attr "predicable" "yes")
- (set_attr "type" "fmul")]
+ (set_attr "type" "fmacd")]
)
;; 0 = -(1 * 2) + 0
@@ -745,7 +668,7 @@
"TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
"fnmacs%?\\t%0, %2, %3"
[(set_attr "predicable" "yes")
- (set_attr "type" "farith")]
+ (set_attr "type" "fmacs")]
)
(define_insn "*fmuldf3negdfadddf_vfp"
@@ -756,7 +679,7 @@
"TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
"fnmacd%?\\t%P0, %P2, %P3"
[(set_attr "predicable" "yes")
- (set_attr "type" "fmul")]
+ (set_attr "type" "fmacd")]
)
@@ -770,7 +693,7 @@
"TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
"fnmscs%?\\t%0, %2, %3"
[(set_attr "predicable" "yes")
- (set_attr "type" "farith")]
+ (set_attr "type" "fmacs")]
)
(define_insn "*muldf3negdfsubdf_vfp"
@@ -782,7 +705,7 @@
"TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
"fnmscd%?\\t%P0, %P2, %P3"
[(set_attr "predicable" "yes")
- (set_attr "type" "fmul")]
+ (set_attr "type" "fmacd")]
)
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 2b72112822c..74409851805 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -291,6 +291,19 @@ enum reg_class {
#define REGNO_REG_CLASS(R) avr_regno_reg_class(R)
+/* The following macro defines cover classes for Integrated Register
+ Allocator. Cover classes is a set of non-intersected register
+ classes covering all hard registers used for register allocation
+ purpose. Any move between two registers of a cover class should be
+ cheaper than load or store of the registers. The macro value is
+ array of register classes with LIM_REG_CLASSES used as the end
+ marker. */
+
+#define IRA_COVER_CLASSES \
+{ \
+ GENERAL_REGS, LIM_REG_CLASSES \
+}
+
#define BASE_REG_CLASS (reload_completed ? BASE_POINTER_REGS : POINTER_REGS)
#define INDEX_REG_CLASS NO_REGS
@@ -498,7 +511,7 @@ do { \
(MODE)==SImode ? 8 : \
(MODE)==SFmode ? 8 : 16)
-#define BRANCH_COST 0
+#define BRANCH_COST(speed_p, predictable_p) 0
#define SLOW_BYTE_ACCESS 0
@@ -931,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 a6e4c3e0237..371ca76c7dd 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -54,6 +54,7 @@
(UNSPEC_INDEX_JMP 1)
(UNSPEC_SEI 2)
(UNSPEC_CLI 3)
+ (UNSPEC_SWAP 4)
(UNSPECV_PROLOGUE_SAVES 0)
(UNSPECV_EPILOGUE_RESTORES 1)
@@ -1261,6 +1262,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
@@ -1389,10 +1403,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")))]
@@ -1421,6 +1482,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" "")
@@ -1536,7 +1632,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")))]
@@ -1565,6 +1697,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 05a5e495cea..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. */
@@ -1129,8 +1129,7 @@ bfin_load_pic_reg (rtx dest)
struct cgraph_local_info *i = NULL;
rtx addr, insn;
- if (flag_unit_at_a_time)
- i = cgraph_local_info (current_function_decl);
+ i = cgraph_local_info (current_function_decl);
/* Functions local to the translation unit don't need to reload the
pic reg, since the caller always passes a usable one. */
@@ -1906,6 +1905,7 @@ static bool
bfin_function_ok_for_sibcall (tree decl ATTRIBUTE_UNUSED,
tree exp ATTRIBUTE_UNUSED)
{
+ struct cgraph_local_info *this_func, *called_func;
e_funkind fkind = funkind (TREE_TYPE (current_function_decl));
if (fkind != SUBROUTINE)
return false;
@@ -1917,17 +1917,10 @@ bfin_function_ok_for_sibcall (tree decl ATTRIBUTE_UNUSED,
not need to reload P5 in the prologue, but the sibcall wil pop P5 in the
sibcall epilogue, and we end up with the wrong value in P5. */
- if (!flag_unit_at_a_time || decl == NULL)
- /* Not enough information. */
- return false;
-
- {
- struct cgraph_local_info *this_func, *called_func;
- this_func = cgraph_local_info (current_function_decl);
- called_func = cgraph_local_info (decl);
- return !called_func->local || this_func->local;
- }
+ this_func = cgraph_local_info (current_function_decl);
+ called_func = cgraph_local_info (decl);
+ return !called_func->local || this_func->local;
}
/* Emit RTL insns to initialize the variable parts of a trampoline at
@@ -2163,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;
@@ -2239,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;
@@ -2287,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
@@ -2304,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)
{
@@ -2325,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;
@@ -5134,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);
@@ -5182,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/bfin/bfin.h b/gcc/config/bfin/bfin.h
index 6f2d16c98d6..826e60b9e02 100644
--- a/gcc/config/bfin/bfin.h
+++ b/gcc/config/bfin/bfin.h
@@ -711,6 +711,19 @@ enum reg_class
: (REGNO) >= REG_RETS ? PROLOGUE_REGS \
: NO_REGS)
+/* The following macro defines cover classes for Integrated Register
+ Allocator. Cover classes is a set of non-intersected register
+ classes covering all hard registers used for register allocation
+ purpose. Any move between two registers of a cover class should be
+ cheaper than load or store of the registers. The macro value is
+ array of register classes with LIM_REG_CLASSES used as the end
+ marker. */
+
+#define IRA_COVER_CLASSES \
+{ \
+ MOST_REGS, AREGS, CCREGS, LIM_REG_CLASSES \
+}
+
/* When defined, the compiler allows registers explicitly used in the
rtl to be used as spill registers but prevents the compiler from
extending the lifetime of these registers. */
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/crx/crx.h b/gcc/config/crx/crx.h
index c3e1e203113..91c5f31d1e1 100644
--- a/gcc/config/crx/crx.h
+++ b/gcc/config/crx/crx.h
@@ -420,7 +420,7 @@ struct cumulative_args
/* Moving to processor register flushes pipeline - thus asymmetric */
#define REGISTER_MOVE_COST(MODE, FROM, TO) ((TO != GENERAL_REGS) ? 8 : 2)
/* Assume best case (branch predicted) */
-#define BRANCH_COST 2
+#define BRANCH_COST(speed_p, predictable_p) 2
#define SLOW_BYTE_ACCESS 1
diff --git a/gcc/config/fr30/fr30.h b/gcc/config/fr30/fr30.h
index 95bdcc33d46..cca71245eb5 100644
--- a/gcc/config/fr30/fr30.h
+++ b/gcc/config/fr30/fr30.h
@@ -1,7 +1,7 @@
/*{{{ Comment. */
/* Definitions of FR30 target.
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2007
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2007, 2008
Free Software Foundation, Inc.
Contributed by Cygnus Solutions.
@@ -282,6 +282,11 @@ enum reg_class
#define GENERAL_REGS REAL_REGS
#define N_REG_CLASSES ((int) LIM_REG_CLASSES)
+#define IRA_COVER_CLASSES \
+{ \
+ REAL_REGS, MULTIPLY_64_REG, LIM_REG_CLASSES \
+}
+
/* An initializer containing the names of the register classes as C string
constants. These names are used in writing some of the debugging dumps. */
#define REG_CLASS_NAMES \
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 6ba924b1df7..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++)
@@ -2207,7 +2207,7 @@ frv_expand_builtin_va_start (tree valist, rtx nextarg)
debug_rtx (nextarg);
}
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (valist), valist,
+ t = build2 (MODIFY_EXPR, TREE_TYPE (valist), valist,
fold_convert (TREE_TYPE (valist),
make_tree (sizetype, nextarg)));
TREE_SIDE_EFFECTS (t) = 1;
@@ -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/frv/frv.h b/gcc/config/frv/frv.h
index 6c86ef569f2..8a71337fcc1 100644
--- a/gcc/config/frv/frv.h
+++ b/gcc/config/frv/frv.h
@@ -2193,7 +2193,7 @@ do { \
/* A C expression for the cost of a branch instruction. A value of 1 is the
default; other values are interpreted relative to that. */
-#define BRANCH_COST frv_branch_cost_int
+#define BRANCH_COST(speed_p, predictable_p) frv_branch_cost_int
/* Define this macro as a C expression which is nonzero if accessing less than
a word of memory (i.e. a `char' or a `short') is no faster than accessing a
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/h8300/h8300.h b/gcc/config/h8300/h8300.h
index 5ed4205dcd3..7305fc32f85 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -1004,7 +1004,7 @@ struct cum_arg
#define DELAY_SLOT_LENGTH(JUMP) \
(NEXT_INSN (PREV_INSN (JUMP)) == JUMP ? 0 : 2)
-#define BRANCH_COST 0
+#define BRANCH_COST(speed_p, predictable_p) 0
/* Tell final.c how to eliminate redundant test instructions. */
diff --git a/gcc/config/i386/cpuid.h b/gcc/config/i386/cpuid.h
index ce406c5404a..90a28137afb 100644
--- a/gcc/config/i386/cpuid.h
+++ b/gcc/config/i386/cpuid.h
@@ -35,11 +35,15 @@
#define bit_SSE3 (1 << 0)
#define bit_PCLMUL (1 << 1)
#define bit_SSSE3 (1 << 9)
+#define bit_FMA (1 << 12)
#define bit_CMPXCHG16B (1 << 13)
#define bit_SSE4_1 (1 << 19)
#define bit_SSE4_2 (1 << 20)
#define bit_POPCNT (1 << 23)
#define bit_AES (1 << 25)
+#define bit_XSAVE (1 << 26)
+#define bit_OSXSAVE (1 << 27)
+#define bit_AVX (1 << 28)
/* %edx */
#define bit_CMPXCHG8B (1 << 8)
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/driver-i386.c b/gcc/config/i386/driver-i386.c
index 44845cd8c2e..013fe93b631 100644
--- a/gcc/config/i386/driver-i386.c
+++ b/gcc/config/i386/driver-i386.c
@@ -75,7 +75,7 @@ detect_caches_amd (unsigned max_ext_level)
{
unsigned eax, ebx, ecx, edx;
unsigned l1_sizekb, l1_line, l1_assoc;
- unsigned l2_sizekb, l2_line, l2_assoc;
+ unsigned l2_sizekb = 0, l2_line = 0, l2_assoc = 0;
if (max_ext_level < 0x80000005)
return "";
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/gas.h b/gcc/config/i386/gas.h
index 07d8e771a52..bf8ac483338 100644
--- a/gcc/config/i386/gas.h
+++ b/gcc/config/i386/gas.h
@@ -86,6 +86,7 @@ along with GCC; see the file COPYING3. If not see
GAS version 1.38.1 doesn't understand the `repz' opcode mnemonic.
So use `repe' instead. */
+#undef ASM_OUTPUT_OPCODE
#define ASM_OUTPUT_OPCODE(STREAM, PTR) \
{ \
if ((PTR)[0] == 'r' \
@@ -103,6 +104,8 @@ along with GCC; see the file COPYING3. If not see
(PTR) += 5; \
} \
} \
+ else \
+ ASM_OUTPUT_AVX_PREFIX ((STREAM), (PTR)); \
}
/* Define macro used to output shift-double opcodes when the shift
diff --git a/gcc/config/i386/i386-c.c b/gcc/config/i386/i386-c.c
index f0a3a17f9f6..3d17c104e39 100644
--- a/gcc/config/i386/i386-c.c
+++ b/gcc/config/i386/i386-c.c
@@ -33,7 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "cpplib.h"
#include "c-pragma.h"
-static bool ix86_pragma_option_parse (tree);
+static bool ix86_pragma_target_parse (tree, tree);
static void ix86_target_macros_internal
(int, enum processor_type, enum processor_type, enum fpmath_unit,
void (*def_or_undef) (cpp_reader *, const char *));
@@ -217,6 +217,10 @@ ix86_target_macros_internal (int isa_flag,
def_or_undef (parse_in, "__AES__");
if (isa_flag & OPTION_MASK_ISA_PCLMUL)
def_or_undef (parse_in, "__PCLMUL__");
+ if (isa_flag & OPTION_MASK_ISA_AVX)
+ def_or_undef (parse_in, "__AVX__");
+ if (isa_flag & OPTION_MASK_ISA_FMA)
+ def_or_undef (parse_in, "__FMA__");
if (isa_flag & OPTION_MASK_ISA_SSE4A)
def_or_undef (parse_in, "__SSE4A__");
if (isa_flag & OPTION_MASK_ISA_SSE5)
@@ -228,11 +232,12 @@ ix86_target_macros_internal (int isa_flag,
}
-/* Hook to validate the current #pragma option and set the state, and update
- the macros based on what was changed. */
+/* Hook to validate the current #pragma GCC target and set the state, and
+ update the macros based on what was changed. If ARGS is NULL, then
+ POP_TARGET is used to reset the options. */
static bool
-ix86_pragma_option_parse (tree args)
+ix86_pragma_target_parse (tree args, tree pop_target)
{
tree prev_tree = build_target_option_node ();
tree cur_tree;
@@ -248,12 +253,14 @@ ix86_pragma_option_parse (tree args)
if (! args)
{
- cur_tree = target_option_default_node;
+ cur_tree = ((pop_target)
+ ? pop_target
+ : target_option_default_node);
cl_target_option_restore (TREE_TARGET_OPTION (cur_tree));
}
else
{
- cur_tree = ix86_valid_option_attribute_tree (args);
+ cur_tree = ix86_valid_target_attribute_tree (args);
if (!cur_tree)
return false;
}
@@ -335,8 +342,8 @@ ix86_target_macros (void)
void
ix86_register_pragmas (void)
{
- /* Update pragma hook to allow parsing #pragma GCC option. */
- targetm.target_option.pragma_parse = ix86_pragma_option_parse;
+ /* Update pragma hook to allow parsing #pragma GCC target. */
+ targetm.target_option.pragma_parse = ix86_pragma_target_parse;
#ifdef REGISTER_SUBTARGET_PRAGMAS
REGISTER_SUBTARGET_PRAGMAS ();
diff --git a/gcc/config/i386/i386-modes.def b/gcc/config/i386/i386-modes.def
index 9be74982180..f5fb906ecea 100644
--- a/gcc/config/i386/i386-modes.def
+++ b/gcc/config/i386/i386-modes.def
@@ -73,17 +73,20 @@ CC_MODE (CCFPU);
VECTOR_MODES (INT, 4); /* V4QI V2HI */
VECTOR_MODES (INT, 8); /* V8QI V4HI V2SI */
VECTOR_MODES (INT, 16); /* V16QI V8HI V4SI V2DI */
+VECTOR_MODES (INT, 32); /* V32QI V16HI V8SI V4DI */
VECTOR_MODES (FLOAT, 8); /* V4HF V2SF */
VECTOR_MODES (FLOAT, 16); /* V8HF V4SF V2DF */
+VECTOR_MODES (FLOAT, 32); /* V16HF V8SF V4DF */
VECTOR_MODE (INT, DI, 1); /* V1DI */
VECTOR_MODE (INT, SI, 1); /* V1SI */
VECTOR_MODE (INT, QI, 2); /* V2QI */
-VECTOR_MODE (INT, DI, 4); /* V4DI */
-VECTOR_MODE (INT, SI, 8); /* V8SI */
-VECTOR_MODE (INT, HI, 16); /* V16HI */
-VECTOR_MODE (INT, QI, 32); /* V32QI */
-VECTOR_MODE (FLOAT, DF, 4); /* V4DF */
-VECTOR_MODE (FLOAT, SF, 8); /* V8SF */
+VECTOR_MODE (INT, DI, 8); /* V8DI */
+VECTOR_MODE (INT, HI, 32); /* V32HI */
+VECTOR_MODE (INT, QI, 64); /* V64QI */
+VECTOR_MODE (FLOAT, DF, 8); /* V8DF */
+VECTOR_MODE (FLOAT, SF, 16); /* V16SF */
+
+INT_MODE (OI, 32);
/* The symbol Pmode stands for one of the above machine modes (usually SImode).
The tm.h file specifies which one. It is not a distinct mode. */
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index 3ebfd3cd9a9..de024581e80 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -28,6 +28,7 @@ extern int ix86_frame_pointer_required (void);
extern void ix86_setup_frame_addresses (void);
extern void ix86_file_end (void);
+extern int ix86_can_eliminate (int, int);
extern HOST_WIDE_INT ix86_initial_elimination_offset (int, int);
extern void ix86_expand_prologue (void);
extern void ix86_expand_epilogue (int);
@@ -127,6 +128,7 @@ extern int ix86_check_movabs (rtx, int);
extern rtx assign_386_stack_local (enum machine_mode, enum ix86_stack_slot);
extern int ix86_attr_length_immediate_default (rtx, int);
extern int ix86_attr_length_address_default (rtx);
+extern int ix86_attr_length_vex_default (rtx, int, int);
extern enum machine_mode ix86_fp_compare_mode (enum rtx_code);
@@ -202,7 +204,7 @@ extern int ix86_constant_alignment (tree, int);
extern tree ix86_handle_shared_attribute (tree *, tree, tree, int, bool *);
extern tree ix86_handle_selectany_attribute (tree *, tree, tree, int, bool *);
extern int x86_field_alignment (tree, int);
-extern tree ix86_valid_option_attribute_tree (tree);
+extern tree ix86_valid_target_attribute_tree (tree);
#endif
extern rtx ix86_tls_get_addr (void);
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index fbe4bb6b227..b240b7d6b86 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -48,7 +48,7 @@ along with GCC; see the file COPYING3. If not see
#include "target-def.h"
#include "langhooks.h"
#include "cgraph.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "dwarf2.h"
#include "df.h"
#include "tm-constrs.h"
@@ -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 */
@@ -1708,7 +1708,8 @@ static int ix86_regparm;
/* -mstackrealign option */
extern int ix86_force_align_arg_pointer;
-static const char ix86_force_align_arg_pointer_string[] = "force_align_arg_pointer";
+static const char ix86_force_align_arg_pointer_string[]
+ = "force_align_arg_pointer";
static rtx (*ix86_gen_leave) (void);
static rtx (*ix86_gen_pop1) (rtx);
@@ -1717,10 +1718,21 @@ static rtx (*ix86_gen_sub3) (rtx, rtx, rtx);
static rtx (*ix86_gen_sub3_carry) (rtx, rtx, rtx, rtx);
static rtx (*ix86_gen_one_cmpl2) (rtx, rtx);
static rtx (*ix86_gen_monitor) (rtx, rtx, rtx);
+static rtx (*ix86_gen_andsp) (rtx, rtx, rtx);
/* Preferred alignment for stack boundary in bits. */
unsigned int ix86_preferred_stack_boundary;
+/* Alignment for incoming stack boundary in bits specified at
+ command line. */
+static unsigned int ix86_user_incoming_stack_boundary;
+
+/* Default alignment for incoming stack boundary in bits. */
+static unsigned int ix86_default_incoming_stack_boundary;
+
+/* Alignment for incoming stack boundary in bits. */
+unsigned int ix86_incoming_stack_boundary;
+
/* Values 1-5: see jump.c */
int ix86_branch_cost;
@@ -1752,6 +1764,7 @@ enum x86_64_reg_class
X86_64_NO_CLASS,
X86_64_INTEGER_CLASS,
X86_64_INTEGERSI_CLASS,
+ X86_64_AVX_CLASS,
X86_64_SSE_CLASS,
X86_64_SSESF_CLASS,
X86_64_SSEDF_CLASS,
@@ -1780,6 +1793,7 @@ static int ix86_function_regparm (const_tree, const_tree);
static void ix86_compute_frame_layout (struct ix86_frame *);
static bool ix86_expand_vector_init_one_nonzero (bool, enum machine_mode,
rtx, rtx, int);
+static void ix86_add_new_builtins (int);
enum ix86_function_specific_strings
{
@@ -1796,8 +1810,8 @@ static void ix86_function_specific_save (struct cl_target_option *);
static void ix86_function_specific_restore (struct cl_target_option *);
static void ix86_function_specific_print (FILE *, int,
struct cl_target_option *);
-static bool ix86_valid_option_attribute_p (tree, tree, tree, int);
-static bool ix86_valid_option_attribute_inner_p (tree, char *[]);
+static bool ix86_valid_target_attribute_p (tree, tree, tree, int);
+static bool ix86_valid_target_attribute_inner_p (tree, char *[]);
static bool ix86_can_inline_p (tree, tree);
static void ix86_set_current_function (tree);
@@ -1837,6 +1851,10 @@ static int ix86_isa_flags_explicit;
(OPTION_MASK_ISA_SSE4_1 | OPTION_MASK_ISA_SSSE3_SET)
#define OPTION_MASK_ISA_SSE4_2_SET \
(OPTION_MASK_ISA_SSE4_2 | OPTION_MASK_ISA_SSE4_1_SET)
+#define OPTION_MASK_ISA_AVX_SET \
+ (OPTION_MASK_ISA_AVX | OPTION_MASK_ISA_SSE4_2_SET)
+#define OPTION_MASK_ISA_FMA_SET \
+ (OPTION_MASK_ISA_FMA | OPTION_MASK_ISA_AVX_SET)
/* SSE4 includes both SSE4.1 and SSE4.2. -msse4 should be the same
as -msse4.2. */
@@ -1880,7 +1898,11 @@ static int ix86_isa_flags_explicit;
(OPTION_MASK_ISA_SSSE3 | OPTION_MASK_ISA_SSE4_1_UNSET)
#define OPTION_MASK_ISA_SSE4_1_UNSET \
(OPTION_MASK_ISA_SSE4_1 | OPTION_MASK_ISA_SSE4_2_UNSET)
-#define OPTION_MASK_ISA_SSE4_2_UNSET OPTION_MASK_ISA_SSE4_2
+#define OPTION_MASK_ISA_SSE4_2_UNSET \
+ (OPTION_MASK_ISA_SSE4_2 | OPTION_MASK_ISA_AVX_UNSET )
+#define OPTION_MASK_ISA_AVX_UNSET \
+ (OPTION_MASK_ISA_AVX | OPTION_MASK_ISA_FMA_UNSET)
+#define OPTION_MASK_ISA_FMA_UNSET OPTION_MASK_ISA_FMA
/* SSE4 includes both SSE4.1 and SSE4.2. -mno-sse4 should the same
as -mno-sse4.1. */
@@ -2069,6 +2091,32 @@ ix86_handle_option (size_t code, const char *arg ATTRIBUTE_UNUSED, int value)
}
return true;
+ case OPT_mavx:
+ if (value)
+ {
+ ix86_isa_flags |= OPTION_MASK_ISA_AVX_SET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_AVX_SET;
+ }
+ else
+ {
+ ix86_isa_flags &= ~OPTION_MASK_ISA_AVX_UNSET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_AVX_UNSET;
+ }
+ return true;
+
+ case OPT_mfma:
+ if (value)
+ {
+ ix86_isa_flags |= OPTION_MASK_ISA_FMA_SET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_FMA_SET;
+ }
+ else
+ {
+ ix86_isa_flags &= ~OPTION_MASK_ISA_FMA_UNSET;
+ ix86_isa_flags_explicit |= OPTION_MASK_ISA_FMA_UNSET;
+ }
+ return true;
+
case OPT_msse4:
ix86_isa_flags |= OPTION_MASK_ISA_SSE4_SET;
ix86_isa_flags_explicit |= OPTION_MASK_ISA_SSE4_SET;
@@ -2215,6 +2263,7 @@ ix86_target_string (int isa, int flags, const char *arch, const char *tune,
{ "-msse2", OPTION_MASK_ISA_SSE2 },
{ "-msse", OPTION_MASK_ISA_SSE },
{ "-m3dnow", OPTION_MASK_ISA_3DNOW },
+ { "-m3dnowa", OPTION_MASK_ISA_3DNOW_A },
{ "-mmmx", OPTION_MASK_ISA_MMX },
{ "-mabm", OPTION_MASK_ISA_ABM },
{ "-mpopcnt", OPTION_MASK_ISA_POPCNT },
@@ -2434,7 +2483,9 @@ override_options (bool main_args_p)
PTA_SSE4_2 = 1 << 15,
PTA_SSE5 = 1 << 16,
PTA_AES = 1 << 17,
- PTA_PCLMUL = 1 << 18
+ PTA_PCLMUL = 1 << 18,
+ PTA_AVX = 1 << 19,
+ PTA_FMA = 1 << 20
};
static struct pta
@@ -2533,7 +2584,7 @@ override_options (bool main_args_p)
int const pta_size = ARRAY_SIZE (processor_alias_table);
/* Set up prefix/suffix so the error messages refer to either the command
- line argument, or the attribute(option). */
+ line argument, or the attribute(target). */
if (main_args_p)
{
prefix = "-m";
@@ -2752,6 +2803,12 @@ override_options (bool main_args_p)
if (processor_alias_table[i].flags & PTA_SSE4_2
&& !(ix86_isa_flags_explicit & OPTION_MASK_ISA_SSE4_2))
ix86_isa_flags |= OPTION_MASK_ISA_SSE4_2;
+ if (processor_alias_table[i].flags & PTA_AVX
+ && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_AVX))
+ ix86_isa_flags |= OPTION_MASK_ISA_AVX;
+ if (processor_alias_table[i].flags & PTA_FMA
+ && !(ix86_isa_flags_explicit & OPTION_MASK_ISA_FMA))
+ ix86_isa_flags |= OPTION_MASK_ISA_FMA;
if (processor_alias_table[i].flags & PTA_SSE4A
&& !(ix86_isa_flags_explicit & OPTION_MASK_ISA_SSE4A))
ix86_isa_flags |= OPTION_MASK_ISA_SSE4A;
@@ -2828,7 +2885,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;
@@ -3014,11 +3071,9 @@ override_options (bool main_args_p)
if (TARGET_SSE4_2 || TARGET_ABM)
ix86_isa_flags |= OPTION_MASK_ISA_POPCNT & ~ix86_isa_flags_explicit;
- /* Validate -mpreferred-stack-boundary= value, or provide default.
- The default of 128 bits is for Pentium III's SSE __m128. We can't
- change it because of optimize_size. Otherwise, we can't mix object
- files compiled with -Os and -On. */
- ix86_preferred_stack_boundary = 128;
+ /* Validate -mpreferred-stack-boundary= value or default it to
+ PREFERRED_STACK_BOUNDARY_DEFAULT. */
+ ix86_preferred_stack_boundary = PREFERRED_STACK_BOUNDARY_DEFAULT;
if (ix86_preferred_stack_boundary_string)
{
i = atoi (ix86_preferred_stack_boundary_string);
@@ -3029,6 +3084,31 @@ override_options (bool main_args_p)
ix86_preferred_stack_boundary = (1 << i) * BITS_PER_UNIT;
}
+ /* Set the default value for -mstackrealign. */
+ if (ix86_force_align_arg_pointer == -1)
+ ix86_force_align_arg_pointer = STACK_REALIGN_DEFAULT;
+
+ /* Validate -mincoming-stack-boundary= value or default it to
+ MIN_STACK_BOUNDARY/PREFERRED_STACK_BOUNDARY. */
+ if (ix86_force_align_arg_pointer)
+ 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;
+ if (ix86_incoming_stack_boundary_string)
+ {
+ i = atoi (ix86_incoming_stack_boundary_string);
+ if (i < (TARGET_64BIT ? 4 : 2) || i > 12)
+ error ("-mincoming-stack-boundary=%d is not between %d and 12",
+ i, TARGET_64BIT ? 4 : 2);
+ else
+ {
+ ix86_user_incoming_stack_boundary = (1 << i) * BITS_PER_UNIT;
+ ix86_incoming_stack_boundary
+ = ix86_user_incoming_stack_boundary;
+ }
+ }
+
/* Accept -msseregparm only if at least SSE support is enabled. */
if (TARGET_SSEREGPARM
&& ! TARGET_SSE)
@@ -3123,8 +3203,6 @@ override_options (bool main_args_p)
target_flags |= MASK_ACCUMULATE_OUTGOING_ARGS;
}
- TARGET_CMOVE = 0;
-
/* For sane SSE instruction set generation we need fcomi instruction.
It is safe to enable all CMOVE instructions. */
if (TARGET_SSE)
@@ -3168,6 +3246,7 @@ override_options (bool main_args_p)
ix86_gen_sub3_carry = gen_subdi3_carry_rex64;
ix86_gen_one_cmpl2 = gen_one_cmpldi2;
ix86_gen_monitor = gen_sse3_monitor64;
+ ix86_gen_andsp = gen_anddi3;
}
else
{
@@ -3178,6 +3257,7 @@ override_options (bool main_args_p)
ix86_gen_sub3_carry = gen_subsi3_carry;
ix86_gen_one_cmpl2 = gen_one_cmplsi2;
ix86_gen_monitor = gen_sse3_monitor;
+ ix86_gen_andsp = gen_andsi3;
}
#ifdef USE_IX86_CLD
@@ -3287,12 +3367,12 @@ ix86_function_specific_print (FILE *file, int indent,
}
-/* Inner function to process the attribute((option(...))), take an argument and
+/* Inner function to process the attribute((target(...))), take an argument and
set the current options from the argument. If we have a list, recursively go
over the list. */
static bool
-ix86_valid_option_attribute_inner_p (tree args, char *p_strings[])
+ix86_valid_target_attribute_inner_p (tree args, char *p_strings[])
{
char *next_optstr;
bool ret = true;
@@ -3383,7 +3463,7 @@ ix86_valid_option_attribute_inner_p (tree args, char *p_strings[])
for (; args; args = TREE_CHAIN (args))
if (TREE_VALUE (args)
- && !ix86_valid_option_attribute_inner_p (TREE_VALUE (args), p_strings))
+ && !ix86_valid_target_attribute_inner_p (TREE_VALUE (args), p_strings))
ret = false;
return ret;
@@ -3452,7 +3532,7 @@ ix86_valid_option_attribute_inner_p (tree args, char *p_strings[])
/* Process the option. */
if (opt == N_OPTS)
{
- error ("attribute(option(\"%s\")) is unknown", orig_p);
+ error ("attribute(target(\"%s\")) is unknown", orig_p);
ret = false;
}
@@ -3491,7 +3571,7 @@ ix86_valid_option_attribute_inner_p (tree args, char *p_strings[])
/* Return a TARGET_OPTION_NODE tree of the target options listed or NULL. */
tree
-ix86_valid_option_attribute_tree (tree args)
+ix86_valid_target_attribute_tree (tree args)
{
const char *orig_arch_string = ix86_arch_string;
const char *orig_tune_string = ix86_tune_string;
@@ -3505,7 +3585,7 @@ ix86_valid_option_attribute_tree (tree args)
= TREE_TARGET_OPTION (target_option_default_node);
/* Process each of the options on the chain. */
- if (! ix86_valid_option_attribute_inner_p (args, option_strings))
+ if (! ix86_valid_target_attribute_inner_p (args, option_strings))
return NULL_TREE;
/* If the changed options are different from the default, rerun override_options,
@@ -3538,6 +3618,9 @@ ix86_valid_option_attribute_tree (tree args)
/* Do any overrides, such as arch=xxx, or tune=xxx support. */
override_options (false);
+ /* Add any builtin functions with the new isa if any. */
+ ix86_add_new_builtins (ix86_isa_flags);
+
/* Save the current options unless we are validating options for
#pragma. */
t = build_target_option_node ();
@@ -3555,27 +3638,47 @@ ix86_valid_option_attribute_tree (tree args)
return t;
}
-/* Hook to validate attribute((option("string"))). */
+/* Hook to validate attribute((target("string"))). */
static bool
-ix86_valid_option_attribute_p (tree fndecl,
+ix86_valid_target_attribute_p (tree fndecl,
tree ARG_UNUSED (name),
tree args,
int ARG_UNUSED (flags))
{
- struct cl_target_option cur_opts;
+ struct cl_target_option cur_target;
bool ret = true;
- tree new_opts;
-
- cl_target_option_save (&cur_opts);
- new_opts = ix86_valid_option_attribute_tree (args);
- if (!new_opts)
+ tree old_optimize = build_optimization_node ();
+ tree new_target, new_optimize;
+ tree func_optimize = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (fndecl);
+
+ /* If the function changed the optimization levels as well as setting target
+ options, start with the optimizations specified. */
+ if (func_optimize && func_optimize != old_optimize)
+ cl_optimization_restore (TREE_OPTIMIZATION (func_optimize));
+
+ /* The target attributes may also change some optimization flags, so update
+ the optimization options if necessary. */
+ cl_target_option_save (&cur_target);
+ new_target = ix86_valid_target_attribute_tree (args);
+ new_optimize = build_optimization_node ();
+
+ if (!new_target)
ret = false;
else if (fndecl)
- DECL_FUNCTION_SPECIFIC_TARGET (fndecl) = new_opts;
+ {
+ DECL_FUNCTION_SPECIFIC_TARGET (fndecl) = new_target;
+
+ if (old_optimize != new_optimize)
+ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (fndecl) = new_optimize;
+ }
+
+ cl_target_option_restore (&cur_target);
+
+ if (old_optimize != new_optimize)
+ cl_optimization_restore (TREE_OPTIMIZATION (old_optimize));
- cl_target_option_restore (&cur_opts);
return ret;
}
@@ -4003,11 +4106,6 @@ ix86_function_ok_for_sibcall (tree decl, tree exp)
&& ix86_function_regparm (TREE_TYPE (decl), NULL) >= 3)
return false;
- /* If we forced aligned the stack, then sibcalling would unalign the
- stack, which may break the called function. */
- if (cfun->machine->force_align_arg_pointer)
- return false;
-
/* Otherwise okay. That also includes certain types of indirect calls. */
return true;
}
@@ -4058,15 +4156,6 @@ ix86_handle_cconv_attribute (tree *node, tree name,
*no_add_attrs = true;
}
- if (!TARGET_64BIT
- && lookup_attribute (ix86_force_align_arg_pointer_string,
- TYPE_ATTRIBUTES (*node))
- && compare_tree_int (cst, REGPARM_MAX-1))
- {
- error ("%s functions limited to %d register parameters",
- ix86_force_align_arg_pointer_string, REGPARM_MAX-1);
- }
-
return NULL_TREE;
}
@@ -4210,7 +4299,7 @@ ix86_function_regparm (const_tree type, const_tree decl)
/* Use register calling convention for local functions when possible. */
if (decl && TREE_CODE (decl) == FUNCTION_DECL
- && flag_unit_at_a_time && !profile_flag)
+ && !profile_flag)
{
/* FIXME: remove this CONST_CAST when cgraph.[ch] is constified. */
struct cgraph_local_info *i = cgraph_local_info (CONST_CAST_TREE(decl));
@@ -4228,8 +4317,7 @@ ix86_function_regparm (const_tree type, const_tree decl)
/* We can't use regparm(3) for nested functions as these use
static chain pointer in third argument. */
if (local_regparm == 3
- && (decl_function_context (decl)
- || ix86_force_align_arg_pointer)
+ && decl_function_context (decl)
&& !DECL_NO_STATIC_CHAIN (decl))
local_regparm = 2;
@@ -4238,13 +4326,11 @@ ix86_function_regparm (const_tree type, const_tree decl)
the callee DECL_STRUCT_FUNCTION is gone, so we fall back to
scanning the attributes for the self-realigning property. */
f = DECL_STRUCT_FUNCTION (decl);
- if (local_regparm == 3
- && (f ? !!f->machine->force_align_arg_pointer
- : !!lookup_attribute (ix86_force_align_arg_pointer_string,
- TYPE_ATTRIBUTES (TREE_TYPE (decl)))))
- local_regparm = 2;
+ /* Since current internal arg pointer won't conflict with
+ parameter passing regs, so no need to change stack
+ realignment and adjust regparm number.
- /* Each fixed register usage increases register pressure,
+ Each fixed register usage increases register pressure,
so less registers should be used for argument passing.
This functionality can be overriden by an explicit
regparm value. */
@@ -4297,7 +4383,7 @@ ix86_function_sseregparm (const_tree type, const_tree decl, bool warn)
/* For local functions, pass up to SSE_REGPARM_MAX SFmode
(and DFmode for SSE2) arguments in SSE registers. */
- if (decl && TARGET_SSE_MATH && flag_unit_at_a_time && !profile_flag)
+ if (decl && TARGET_SSE_MATH && !profile_flag)
{
/* FIXME: remove this CONST_CAST when cgraph.[ch] is constified. */
struct cgraph_local_info *i = cgraph_local_info (CONST_CAST_TREE(decl));
@@ -4568,6 +4654,7 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */
}
if (TARGET_MMX)
cum->mmx_nregs = MMX_REGPARM_MAX;
+ cum->warn_avx = true;
cum->warn_sse = true;
cum->warn_mmx = true;
@@ -4592,6 +4679,7 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */
cum->nregs = 0;
cum->sse_nregs = 0;
cum->mmx_nregs = 0;
+ cum->warn_avx = 0;
cum->warn_sse = 0;
cum->warn_mmx = 0;
return;
@@ -4944,6 +5032,8 @@ classify_argument (enum machine_mode mode, const_tree type,
classes[0] = classes[1] = X86_64_INTEGER_CLASS;
return 2;
case CTImode:
+ case COImode:
+ case OImode:
return 0;
case SFmode:
if (!(bit_offset % 64))
@@ -4975,6 +5065,14 @@ classify_argument (enum machine_mode mode, const_tree type,
case TCmode:
/* This modes is larger than 16 bytes. */
return 0;
+ case V8SFmode:
+ case V8SImode:
+ case V32QImode:
+ case V16HImode:
+ case V4DFmode:
+ case V4DImode:
+ classes[0] = X86_64_AVX_CLASS;
+ return 1;
case V4SFmode:
case V4SImode:
case V16QImode:
@@ -5031,6 +5129,7 @@ examine_argument (enum machine_mode mode, const_tree type, int in_return,
case X86_64_INTEGERSI_CLASS:
(*int_nregs)++;
break;
+ case X86_64_AVX_CLASS:
case X86_64_SSE_CLASS:
case X86_64_SSESF_CLASS:
case X86_64_SSEDF_CLASS:
@@ -5129,6 +5228,7 @@ construct_container (enum machine_mode mode, enum machine_mode orig_mode,
case X86_64_INTEGER_CLASS:
case X86_64_INTEGERSI_CLASS:
return gen_rtx_REG (mode, intreg[0]);
+ case X86_64_AVX_CLASS:
case X86_64_SSE_CLASS:
case X86_64_SSESF_CLASS:
case X86_64_SSEDF_CLASS:
@@ -5262,6 +5362,13 @@ function_arg_advance_32 (CUMULATIVE_ARGS *cum, enum machine_mode mode,
break;
/* FALLTHRU */
+ case OImode:
+ case V8SFmode:
+ case V8SImode:
+ case V32QImode:
+ case V16HImode:
+ case V4DFmode:
+ case V4DImode:
case TImode:
case V16QImode:
case V8HImode:
@@ -5304,10 +5411,14 @@ function_arg_advance_32 (CUMULATIVE_ARGS *cum, enum machine_mode mode,
static void
function_arg_advance_64 (CUMULATIVE_ARGS *cum, enum machine_mode mode,
- tree type, HOST_WIDE_INT words)
+ tree type, HOST_WIDE_INT words, int named)
{
int int_nregs, sse_nregs;
+ /* Unnamed 256bit vector mode parameters are passed on stack. */
+ if (!named && VALID_AVX256_REG_MODE (mode))
+ return;
+
if (!examine_argument (mode, type, 0, &int_nregs, &sse_nregs))
cum->words += words;
else if (sse_nregs <= cum->sse_nregs && int_nregs <= cum->nregs)
@@ -5338,7 +5449,7 @@ function_arg_advance_ms_64 (CUMULATIVE_ARGS *cum, HOST_WIDE_INT bytes,
void
function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
- tree type, int named ATTRIBUTE_UNUSED)
+ tree type, int named)
{
HOST_WIDE_INT bytes, words;
@@ -5354,7 +5465,7 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
if (TARGET_64BIT && (cum ? cum->call_abi : DEFAULT_ABI) == MS_ABI)
function_arg_advance_ms_64 (cum, bytes, words);
else if (TARGET_64BIT)
- function_arg_advance_64 (cum, mode, type, words);
+ function_arg_advance_64 (cum, mode, type, words, named);
else
function_arg_advance_32 (cum, mode, type, bytes, words);
}
@@ -5377,7 +5488,7 @@ function_arg_32 (CUMULATIVE_ARGS *cum, enum machine_mode mode,
enum machine_mode orig_mode, tree type,
HOST_WIDE_INT bytes, HOST_WIDE_INT words)
{
- static bool warnedsse, warnedmmx;
+ static bool warnedavx, warnedsse, warnedmmx;
/* Avoid the AL settings for the Unix64 ABI. */
if (mode == VOIDmode)
@@ -5426,6 +5537,7 @@ function_arg_32 (CUMULATIVE_ARGS *cum, enum machine_mode mode,
break;
/* FALLTHRU */
case TImode:
+ /* In 32bit, we pass TImode in xmm registers. */
case V16QImode:
case V8HImode:
case V4SImode:
@@ -5446,6 +5558,28 @@ function_arg_32 (CUMULATIVE_ARGS *cum, enum machine_mode mode,
}
break;
+ case OImode:
+ /* In 32bit, we pass OImode in ymm registers. */
+ case V8SFmode:
+ case V8SImode:
+ case V32QImode:
+ case V16HImode:
+ case V4DFmode:
+ case V4DImode:
+ if (!type || !AGGREGATE_TYPE_P (type))
+ {
+ if (!TARGET_AVX && !warnedavx && cum->warn_avx)
+ {
+ warnedavx = true;
+ warning (0, "AVX vector argument without AVX enabled "
+ "changes the ABI");
+ }
+ if (cum->sse_nregs)
+ return gen_reg_or_parallel (mode, orig_mode,
+ cum->sse_regno + FIRST_SSE_REG);
+ }
+ break;
+
case V8QImode:
case V4HImode:
case V2SImode:
@@ -5471,8 +5605,10 @@ function_arg_32 (CUMULATIVE_ARGS *cum, enum machine_mode mode,
static rtx
function_arg_64 (CUMULATIVE_ARGS *cum, enum machine_mode mode,
- enum machine_mode orig_mode, tree type)
+ enum machine_mode orig_mode, tree type, int named)
{
+ static bool warnedavx;
+
/* Handle a hidden AL argument containing number of registers
for varargs x86-64 functions. */
if (mode == VOIDmode)
@@ -5485,6 +5621,35 @@ function_arg_64 (CUMULATIVE_ARGS *cum, enum machine_mode mode,
: cum->sse_regno)
: -1);
+ switch (mode)
+ {
+ default:
+ break;
+
+ case V8SFmode:
+ case V8SImode:
+ case V32QImode:
+ case V16HImode:
+ case V4DFmode:
+ case V4DImode:
+ /* In 64bit, we pass TImode in interger registers and OImode on
+ stack. */
+ if (!type || !AGGREGATE_TYPE_P (type))
+ {
+ if (!TARGET_AVX && !warnedavx && cum->warn_avx)
+ {
+ warnedavx = true;
+ warning (0, "AVX vector argument without AVX enabled "
+ "changes the ABI");
+ }
+ }
+
+ /* Unnamed 256bit vector mode parameters are passed on stack. */
+ if (!named)
+ return NULL;
+ break;
+ }
+
return construct_container (mode, orig_mode, type, 0, cum->nregs,
cum->sse_nregs,
&x86_64_int_parameter_registers [cum->regno],
@@ -5559,7 +5724,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode omode,
if (TARGET_64BIT && (cum ? cum->call_abi : DEFAULT_ABI) == MS_ABI)
return function_arg_ms_64 (cum, mode, omode, named, bytes);
else if (TARGET_64BIT)
- return function_arg_64 (cum, mode, omode, type);
+ return function_arg_64 (cum, mode, omode, type, named);
else
return function_arg_32 (cum, mode, omode, type, bytes, words);
}
@@ -6155,14 +6320,6 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum)
/* Indicate to allocate space on the stack for varargs save area. */
ix86_save_varrargs_registers = 1;
- /* We need 16-byte stack alignment to save SSE registers. If user
- asked for lower preferred_stack_boundary, lets just hope that he knows
- what he is doing and won't varargs SSE values.
-
- We also may end up assuming that only 64bit values are stored in SSE
- register let some floating point program work. */
- if (ix86_preferred_stack_boundary >= BIGGEST_ALIGNMENT)
- crtl->stack_alignment_needed = BIGGEST_ALIGNMENT;
save_area = frame_pointer_rtx;
set = get_varargs_alias_set ();
@@ -6191,27 +6348,37 @@ setup_incoming_varargs_64 (CUMULATIVE_ARGS *cum)
label_ref = gen_rtx_LABEL_REF (Pmode, label);
/* Compute address to jump to :
- label - eax*4 + nnamed_sse_arguments*4 */
+ label - eax*4 + nnamed_sse_arguments*4 Or
+ label - eax*5 + nnamed_sse_arguments*5 for AVX. */
tmp_reg = gen_reg_rtx (Pmode);
nsse_reg = gen_reg_rtx (Pmode);
emit_insn (gen_zero_extendqidi2 (nsse_reg, gen_rtx_REG (QImode, AX_REG)));
emit_insn (gen_rtx_SET (VOIDmode, tmp_reg,
gen_rtx_MULT (Pmode, nsse_reg,
GEN_INT (4))));
+
+ /* vmovaps is one byte longer than movaps. */
+ if (TARGET_AVX)
+ emit_insn (gen_rtx_SET (VOIDmode, tmp_reg,
+ gen_rtx_PLUS (Pmode, tmp_reg,
+ nsse_reg)));
+
if (cum->sse_regno)
emit_move_insn
(nsse_reg,
gen_rtx_CONST (DImode,
gen_rtx_PLUS (DImode,
label_ref,
- GEN_INT (cum->sse_regno * 4))));
+ GEN_INT (cum->sse_regno
+ * (TARGET_AVX ? 5 : 4)))));
else
emit_move_insn (nsse_reg, label_ref);
emit_insn (gen_subdi3 (nsse_reg, nsse_reg, tmp_reg));
/* Compute address of memory block we save into. We always use pointer
pointing 127 bytes after first byte to store - this is needed to keep
- instruction size limited by 4 bytes. */
+ instruction size limited by 4 bytes (5 bytes for AVX) with one
+ byte displacement. */
tmp_reg = gen_reg_rtx (Pmode);
emit_insn (gen_rtx_SET (VOIDmode, tmp_reg,
plus_constant (save_area,
@@ -6328,8 +6495,8 @@ ix86_va_start (tree valist, rtx nextarg)
if (cfun->va_list_gpr_size)
{
type = TREE_TYPE (gpr);
- t = build2 (GIMPLE_MODIFY_STMT, type, gpr,
- build_int_cst (type, n_gpr * 8));
+ t = build2 (MODIFY_EXPR, type,
+ gpr, build_int_cst (type, n_gpr * 8));
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
@@ -6337,7 +6504,7 @@ ix86_va_start (tree valist, rtx nextarg)
if (cfun->va_list_fpr_size)
{
type = TREE_TYPE (fpr);
- t = build2 (GIMPLE_MODIFY_STMT, type, fpr,
+ t = build2 (MODIFY_EXPR, type, fpr,
build_int_cst (type, n_fpr * 16 + 8*X86_64_REGPARM_MAX));
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -6345,11 +6512,11 @@ ix86_va_start (tree valist, rtx nextarg)
/* Find the overflow area. */
type = TREE_TYPE (ovf);
- t = make_tree (type, virtual_incoming_args_rtx);
+ t = make_tree (type, crtl->args.internal_arg_pointer);
if (words != 0)
t = build2 (POINTER_PLUS_EXPR, type, t,
size_int (words * UNITS_PER_WORD));
- t = build2 (GIMPLE_MODIFY_STMT, type, ovf, t);
+ t = build2 (MODIFY_EXPR, type, ovf, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -6359,7 +6526,7 @@ ix86_va_start (tree valist, rtx nextarg)
Prologue of the function save it right above stack frame. */
type = TREE_TYPE (sav);
t = make_tree (type, frame_pointer_rtx);
- t = build2 (GIMPLE_MODIFY_STMT, type, sav, t);
+ t = build2 (MODIFY_EXPR, type, sav, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
@@ -6368,7 +6535,8 @@ ix86_va_start (tree valist, rtx nextarg)
/* Implement va_arg. */
static tree
-ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
+ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
+ gimple_seq *post_p)
{
static const int intreg[6] = { 0, 1, 2, 3, 4, 5 };
tree f_gpr, f_fpr, f_ovf, f_sav;
@@ -6404,9 +6572,28 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
rsize = (size + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
nat_mode = type_natural_mode (type);
- container = construct_container (nat_mode, TYPE_MODE (type), type, 0,
- X86_64_REGPARM_MAX, X86_64_SSE_REGPARM_MAX,
- intreg, 0);
+ switch (nat_mode)
+ {
+ case V8SFmode:
+ case V8SImode:
+ case V32QImode:
+ case V16HImode:
+ case V4DFmode:
+ case V4DImode:
+ /* Unnamed 256bit vector mode parameters are passed on stack. */
+ if (ix86_cfun_abi () == SYSV_ABI)
+ {
+ container = NULL;
+ break;
+ }
+
+ default:
+ container = construct_container (nat_mode, TYPE_MODE (type),
+ type, 0, X86_64_REGPARM_MAX,
+ X86_64_SSE_REGPARM_MAX, intreg,
+ 0);
+ break;
+ }
/* Pull the value out of the saved registers. */
@@ -6498,16 +6685,14 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
/* int_addr = gpr + sav; */
t = fold_convert (sizetype, gpr);
t = build2 (POINTER_PLUS_EXPR, ptr_type_node, sav, t);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, int_addr, t);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (int_addr, t, pre_p);
}
if (needed_sseregs)
{
/* sse_addr = fpr + sav; */
t = fold_convert (sizetype, fpr);
t = build2 (POINTER_PLUS_EXPR, ptr_type_node, sav, t);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, sse_addr, t);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (sse_addr, t, pre_p);
}
if (need_temp)
{
@@ -6516,8 +6701,7 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
/* addr = &temp; */
t = build1 (ADDR_EXPR, build_pointer_type (type), temp);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (addr, t, pre_p);
for (i = 0; i < XVECLEN (container, 0); i++)
{
@@ -6550,8 +6734,7 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
size_int (INTVAL (XEXP (slot, 1))));
dest = build_va_arg_indirect_ref (dest_addr);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, dest, src);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (dest, src, pre_p);
}
}
@@ -6559,33 +6742,30 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
{
t = build2 (PLUS_EXPR, TREE_TYPE (gpr), gpr,
build_int_cst (TREE_TYPE (gpr), needed_intregs * 8));
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (gpr), gpr, t);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (gpr, t, pre_p);
}
+
if (needed_sseregs)
{
t = build2 (PLUS_EXPR, TREE_TYPE (fpr), fpr,
build_int_cst (TREE_TYPE (fpr), needed_sseregs * 16));
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (fpr), fpr, t);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (fpr, t, pre_p);
}
- t = build1 (GOTO_EXPR, void_type_node, lab_over);
- gimplify_and_add (t, pre_p);
+ gimple_seq_add_stmt (pre_p, gimple_build_goto (lab_over));
- t = build1 (LABEL_EXPR, void_type_node, lab_false);
- append_to_statement_list (t, pre_p);
+ gimple_seq_add_stmt (pre_p, gimple_build_label (lab_false));
}
/* ... otherwise out of the overflow area. */
/* When we align parameter on stack for caller, if the parameter
- alignment is beyond PREFERRED_STACK_BOUNDARY, it will be
- aligned at PREFERRED_STACK_BOUNDARY. We will match callee
+ alignment is beyond MAX_SUPPORTED_STACK_ALIGNMENT, it will be
+ aligned at MAX_SUPPORTED_STACK_ALIGNMENT. We will match callee
here with caller. */
arg_boundary = FUNCTION_ARG_BOUNDARY (VOIDmode, type);
- if ((unsigned int) arg_boundary > PREFERRED_STACK_BOUNDARY)
- arg_boundary = PREFERRED_STACK_BOUNDARY;
+ if ((unsigned int) arg_boundary > MAX_SUPPORTED_STACK_ALIGNMENT)
+ arg_boundary = MAX_SUPPORTED_STACK_ALIGNMENT;
/* Care for on-stack alignment if needed. */
if (arg_boundary <= 64
@@ -6602,20 +6782,14 @@ ix86_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
t = fold_convert (TREE_TYPE (ovf), t);
}
gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
-
- t2 = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
- gimplify_and_add (t2, pre_p);
+ gimplify_assign (addr, t, pre_p);
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (t), t,
size_int (rsize * UNITS_PER_WORD));
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (ovf), ovf, t);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (unshare_expr (ovf), t, pre_p);
if (container)
- {
- t = build1 (LABEL_EXPR, void_type_node, lab_over);
- append_to_statement_list (t, pre_p);
- }
+ gimple_seq_add_stmt (pre_p, gimple_build_label (lab_over));
ptrtype = build_pointer_type (type);
addr = fold_convert (ptrtype, addr);
@@ -6693,7 +6867,7 @@ standard_80387_constant_p (rtx x)
/* For XFmode constants, try to find a special 80387 instruction when
optimizing for size or on those CPUs that benefit from them. */
if (mode == XFmode
- && (optimize_size || TARGET_EXT_80387_CONSTANTS))
+ && (optimize_function_for_size_p (cfun) || TARGET_EXT_80387_CONSTANTS))
{
int i;
@@ -6794,8 +6968,10 @@ standard_sse_mode_p (enum machine_mode mode)
}
}
-/* Return 1 if X is FP constant we can load to SSE register w/o using memory.
- */
+/* Return 1 if X is all 0s. For all 1s, return 2 if X is in 128bit
+ SSE modes and SSE2 is enabled, return 3 if X is in 256bit AVX
+ modes and AVX is enabled. */
+
int
standard_sse_constant_p (rtx x)
{
@@ -6803,9 +6979,13 @@ standard_sse_constant_p (rtx x)
if (x == const0_rtx || x == CONST0_RTX (GET_MODE (x)))
return 1;
- if (vector_all_ones_operand (x, mode)
- && standard_sse_mode_p (mode))
- return TARGET_SSE2 ? 2 : -1;
+ if (vector_all_ones_operand (x, mode))
+ {
+ if (standard_sse_mode_p (mode))
+ return TARGET_SSE2 ? 2 : -2;
+ else if (VALID_AVX256_REG_MODE (mode))
+ return TARGET_AVX ? 3 : -3;
+ }
return 0;
}
@@ -6819,14 +6999,37 @@ standard_sse_constant_opcode (rtx insn, rtx x)
switch (standard_sse_constant_p (x))
{
case 1:
- if (get_attr_mode (insn) == MODE_V4SF)
- return "xorps\t%0, %0";
- else if (get_attr_mode (insn) == MODE_V2DF)
- return "xorpd\t%0, %0";
- else
- return "pxor\t%0, %0";
+ switch (get_attr_mode (insn))
+ {
+ case MODE_V4SF:
+ return TARGET_AVX ? "vxorps\t%0, %0, %0" : "xorps\t%0, %0";
+ case MODE_V2DF:
+ return TARGET_AVX ? "vxorpd\t%0, %0, %0" : "xorpd\t%0, %0";
+ case MODE_TI:
+ return TARGET_AVX ? "vpxor\t%0, %0, %0" : "pxor\t%0, %0";
+ case MODE_V8SF:
+ return "vxorps\t%x0, %x0, %x0";
+ case MODE_V4DF:
+ return "vxorpd\t%x0, %x0, %x0";
+ case MODE_OI:
+ return "vpxor\t%x0, %x0, %x0";
+ default:
+ gcc_unreachable ();
+ }
case 2:
- return "pcmpeqd\t%0, %0";
+ if (TARGET_AVX)
+ switch (get_attr_mode (insn))
+ {
+ case MODE_V4SF:
+ case MODE_V2DF:
+ case MODE_TI:
+ return "vpcmpeqd\t%0, %0, %0";
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ else
+ return "pcmpeqd\t%0, %0";
}
gcc_unreachable ();
}
@@ -7114,9 +7317,14 @@ ix86_select_alt_pic_regnum (void)
if (current_function_is_leaf && !crtl->profile
&& !ix86_current_function_calls_tls_descriptor)
{
- int i;
+ int i, drap;
+ /* Can't use the same register for both PIC and DRAP. */
+ if (crtl->drap_reg)
+ drap = REGNO (crtl->drap_reg);
+ else
+ drap = -1;
for (i = 2; i >= 0; --i)
- if (!df_regs_ever_live_p (i))
+ if (i != drap && !df_regs_ever_live_p (i))
return i;
}
@@ -7152,8 +7360,8 @@ ix86_save_reg (unsigned int regno, int maybe_eh_return)
}
}
- if (cfun->machine->force_align_arg_pointer
- && regno == REGNO (cfun->machine->force_align_arg_pointer))
+ if (crtl->drap_reg
+ && regno == REGNO (crtl->drap_reg))
return 1;
return (df_regs_ever_live_p (regno)
@@ -7176,6 +7384,24 @@ ix86_nsaved_regs (void)
return nregs;
}
+/* Given FROM and TO register numbers, say whether this elimination is
+ allowed. If stack alignment is needed, we can only replace argument
+ pointer with hard frame pointer, or replace frame pointer with stack
+ pointer. Otherwise, frame pointer elimination is automatically
+ handled and all other eliminations are valid. */
+
+int
+ix86_can_eliminate (int from, int to)
+{
+ if (stack_realign_fp)
+ return ((from == ARG_POINTER_REGNUM
+ && to == HARD_FRAME_POINTER_REGNUM)
+ || (from == FRAME_POINTER_REGNUM
+ && to == STACK_POINTER_REGNUM));
+ else
+ return to == STACK_POINTER_REGNUM ? !frame_pointer_needed : 1;
+}
+
/* Return the offset between two registers, one to be eliminated, and the other
its replacement, at the start of a routine. */
@@ -7219,11 +7445,15 @@ ix86_compute_frame_layout (struct ix86_frame *frame)
stack_alignment_needed = crtl->stack_alignment_needed / BITS_PER_UNIT;
preferred_alignment = crtl->preferred_stack_boundary / BITS_PER_UNIT;
+ gcc_assert (!size || stack_alignment_needed);
+ gcc_assert (preferred_alignment >= STACK_BOUNDARY / BITS_PER_UNIT);
+ gcc_assert (preferred_alignment <= stack_alignment_needed);
+
/* During reload iteration the amount of registers saved can change.
Recompute the value as needed. Do not recompute when amount of registers
didn't change as reload does multiple calls to the function and does not
expect the decision to change within single iteration. */
- if (!optimize_size
+ if (!optimize_function_for_size_p (cfun)
&& cfun->machine->use_fast_prologue_epilogue_nregs != frame->nregs)
{
int count = frame->nregs;
@@ -7261,18 +7491,10 @@ ix86_compute_frame_layout (struct ix86_frame *frame)
frame->hard_frame_pointer_offset = offset;
- /* Do some sanity checking of stack_alignment_needed and
- preferred_alignment, since i386 port is the only using those features
- that may break easily. */
-
- gcc_assert (!size || stack_alignment_needed);
- gcc_assert (preferred_alignment >= STACK_BOUNDARY / BITS_PER_UNIT);
- gcc_assert (preferred_alignment <= PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT);
- gcc_assert (stack_alignment_needed
- <= PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT);
-
- if (stack_alignment_needed < STACK_BOUNDARY / BITS_PER_UNIT)
- stack_alignment_needed = STACK_BOUNDARY / BITS_PER_UNIT;
+ /* Set offset to aligned because the realigned frame starts from
+ here. */
+ if (stack_realign_fp)
+ offset = (offset + stack_alignment_needed -1) & -stack_alignment_needed;
/* Register save area */
offset += frame->nregs * UNITS_PER_WORD;
@@ -7438,38 +7660,131 @@ pro_epilogue_adjust_stack (rtx dest, rtx src, rtx offset, int style)
RTX_FRAME_RELATED_P (insn) = 1;
}
-/* Handle the TARGET_INTERNAL_ARG_POINTER hook. */
+/* Find an available register to be used as dynamic realign argument
+ pointer regsiter. Such a register will be written in prologue and
+ used in begin of body, so it must not be
+ 1. parameter passing register.
+ 2. GOT pointer.
+ We reuse static-chain register if it is available. Otherwise, we
+ use DI for i386 and R13 for x86-64. We chose R13 since it has
+ shorter encoding.
+
+ Return: the regno of chosen register. */
+
+static unsigned int
+find_drap_reg (void)
+{
+ tree decl = cfun->decl;
+
+ if (TARGET_64BIT)
+ {
+ /* Use R13 for nested function or function need static chain.
+ Since function with tail call may use any caller-saved
+ registers in epilogue, DRAP must not use caller-saved
+ register in such case. */
+ if ((decl_function_context (decl)
+ && !DECL_NO_STATIC_CHAIN (decl))
+ || crtl->tail_call_emit)
+ return R13_REG;
+
+ return R10_REG;
+ }
+ else
+ {
+ /* Use DI for nested function or function need static chain.
+ Since function with tail call may use any caller-saved
+ registers in epilogue, DRAP must not use caller-saved
+ register in such case. */
+ if ((decl_function_context (decl)
+ && !DECL_NO_STATIC_CHAIN (decl))
+ || crtl->tail_call_emit)
+ return DI_REG;
+
+ /* Reuse static chain register if it isn't used for parameter
+ passing. */
+ if (ix86_function_regparm (TREE_TYPE (decl), decl) <= 2
+ && !lookup_attribute ("fastcall",
+ TYPE_ATTRIBUTES (TREE_TYPE (decl))))
+ return CX_REG;
+ else
+ return DI_REG;
+ }
+}
+
+/* Update incoming stack boundary and estimated stack alignment. */
+
+static void
+ix86_update_stack_boundary (void)
+{
+ /* Prefer the one specified at command line. */
+ ix86_incoming_stack_boundary
+ = (ix86_user_incoming_stack_boundary
+ ? ix86_user_incoming_stack_boundary
+ : ix86_default_incoming_stack_boundary);
+
+ /* 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 > MIN_STACK_BOUNDARY
+ && lookup_attribute (ix86_force_align_arg_pointer_string,
+ TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl))))
+ ix86_incoming_stack_boundary = MIN_STACK_BOUNDARY;
+
+ /* Stack at entrance of main is aligned by runtime. We use the
+ smallest incoming stack boundary. */
+ if (ix86_incoming_stack_boundary > MAIN_STACK_BOUNDARY
+ && DECL_NAME (current_function_decl)
+ && MAIN_NAME_P (DECL_NAME (current_function_decl))
+ && DECL_FILE_SCOPE_P (current_function_decl))
+ ix86_incoming_stack_boundary = MAIN_STACK_BOUNDARY;
+
+ /* x86_64 vararg needs 16byte stack alignment for register save
+ area. */
+ if (TARGET_64BIT
+ && cfun->stdarg
+ && crtl->stack_alignment_estimated < 128)
+ crtl->stack_alignment_estimated = 128;
+}
+
+/* Handle the TARGET_GET_DRAP_RTX hook. Return NULL if no DRAP is
+ needed or an rtx for DRAP otherwise. */
static rtx
-ix86_internal_arg_pointer (void)
+ix86_get_drap_rtx (void)
{
- bool has_force_align_arg_pointer =
- (0 != lookup_attribute (ix86_force_align_arg_pointer_string,
- TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl))));
- if ((FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN
- && DECL_NAME (current_function_decl)
- && MAIN_NAME_P (DECL_NAME (current_function_decl))
- && DECL_FILE_SCOPE_P (current_function_decl))
- || ix86_force_align_arg_pointer
- || has_force_align_arg_pointer)
- {
- /* Nested functions can't realign the stack due to a register
- conflict. */
- if (DECL_CONTEXT (current_function_decl)
- && TREE_CODE (DECL_CONTEXT (current_function_decl)) == FUNCTION_DECL)
- {
- if (ix86_force_align_arg_pointer)
- warning (0, "-mstackrealign ignored for nested functions");
- if (has_force_align_arg_pointer)
- error ("%s not supported for nested functions",
- ix86_force_align_arg_pointer_string);
- return virtual_incoming_args_rtx;
- }
- cfun->machine->force_align_arg_pointer = gen_rtx_REG (Pmode, CX_REG);
- return copy_to_reg (cfun->machine->force_align_arg_pointer);
+ if (ix86_force_drap || !ACCUMULATE_OUTGOING_ARGS)
+ crtl->need_drap = true;
+
+ if (stack_realign_drap)
+ {
+ /* Assign DRAP to vDRAP and returns vDRAP */
+ unsigned int regno = find_drap_reg ();
+ rtx drap_vreg;
+ rtx arg_ptr;
+ rtx seq, insn;
+
+ arg_ptr = gen_rtx_REG (Pmode, regno);
+ crtl->drap_reg = arg_ptr;
+
+ start_sequence ();
+ drap_vreg = copy_to_reg (arg_ptr);
+ seq = get_insns ();
+ end_sequence ();
+
+ insn = emit_insn_before (seq, NEXT_INSN (entry_of_function ()));
+ RTX_FRAME_RELATED_P (insn) = 1;
+ return drap_vreg;
}
else
- return virtual_incoming_args_rtx;
+ return NULL;
+}
+
+/* Handle the TARGET_INTERNAL_ARG_POINTER hook. */
+
+static rtx
+ix86_internal_arg_pointer (void)
+{
+ return virtual_incoming_args_rtx;
}
/* Handle the TARGET_DWARF_HANDLE_FRAME_UNSPEC hook.
@@ -7496,6 +7811,34 @@ ix86_dwarf_handle_frame_unspec (const char *label, rtx pattern, int index)
}
}
+/* Finalize stack_realign_needed flag, which will guide prologue/epilogue
+ to be generated in correct form. */
+static void
+ix86_finalize_stack_realign_flags (void)
+{
+ /* Check if stack realign is really needed after reload, and
+ stores result in cfun */
+ 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));
+
+ if (crtl->stack_realign_finalized)
+ {
+ /* After stack_realign_needed is finalized, we can't no longer
+ change it. */
+ gcc_assert (crtl->stack_realign_needed == stack_realign);
+ }
+ else
+ {
+ crtl->stack_realign_needed = stack_realign;
+ crtl->stack_realign_finalized = true;
+ }
+}
+
/* Expand the prologue into a bunch of separate insns. */
void
@@ -7506,52 +7849,56 @@ ix86_expand_prologue (void)
struct ix86_frame frame;
HOST_WIDE_INT allocate;
+ ix86_finalize_stack_realign_flags ();
+
+ /* DRAP should not coexist with stack_realign_fp */
+ gcc_assert (!(crtl->drap_reg && stack_realign_fp));
+
ix86_compute_frame_layout (&frame);
- if (cfun->machine->force_align_arg_pointer)
+ /* Emit prologue code to adjust stack alignment and setup DRAP, in case
+ of DRAP is needed and stack realignment is really needed after reload */
+ if (crtl->drap_reg && crtl->stack_realign_needed)
{
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 : UNITS_PER_WORD);
+
+ gcc_assert (stack_realign_drap);
/* Grab the argument pointer. */
- x = plus_constant (stack_pointer_rtx, 4);
- y = cfun->machine->force_align_arg_pointer;
- insn = emit_insn (gen_rtx_SET (VOIDmode, y, x));
- RTX_FRAME_RELATED_P (insn) = 1;
+ x = plus_constant (stack_pointer_rtx,
+ (UNITS_PER_WORD + param_ptr_offset));
+ y = crtl->drap_reg;
+
+ /* Only need to push parameter pointer reg if it is caller
+ saved reg */
+ if (!call_used_regs[REGNO (crtl->drap_reg)])
+ {
+ /* Push arg pointer reg */
+ insn = emit_insn (gen_push (y));
+ RTX_FRAME_RELATED_P (insn) = 1;
+ }
- /* The unwind info consists of two parts: install the fafp as the cfa,
- and record the fafp as the "save register" of the stack pointer.
- The later is there in order that the unwinder can see where it
- should restore the stack pointer across the and insn. */
- x = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, const0_rtx), UNSPEC_DEF_CFA);
- x = gen_rtx_SET (VOIDmode, y, x);
- RTX_FRAME_RELATED_P (x) = 1;
- y = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, stack_pointer_rtx),
- UNSPEC_REG_SAVE);
- y = gen_rtx_SET (VOIDmode, cfun->machine->force_align_arg_pointer, y);
- RTX_FRAME_RELATED_P (y) = 1;
- x = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, x, y));
- x = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, x, NULL);
- REG_NOTES (insn) = x;
+ insn = emit_insn (gen_rtx_SET (VOIDmode, y, x));
+ RTX_FRAME_RELATED_P (insn) = 1;
/* Align the stack. */
- emit_insn (gen_andsi3 (stack_pointer_rtx, stack_pointer_rtx,
- GEN_INT (-16)));
-
- /* And here we cheat like madmen with the unwind info. We force the
- cfa register back to sp+4, which is exactly what it was at the
- start of the function. Re-pushing the return address results in
- the return at the same spot relative to the cfa, and thus is
- correct wrt the unwind info. */
- x = cfun->machine->force_align_arg_pointer;
- x = gen_frame_mem (Pmode, plus_constant (x, -4));
- insn = emit_insn (gen_push (x));
+ insn = emit_insn ((*ix86_gen_andsp) (stack_pointer_rtx,
+ stack_pointer_rtx,
+ GEN_INT (-align_bytes)));
RTX_FRAME_RELATED_P (insn) = 1;
- x = GEN_INT (4);
- x = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, x), UNSPEC_DEF_CFA);
- x = gen_rtx_SET (VOIDmode, stack_pointer_rtx, x);
- x = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, x, NULL);
- REG_NOTES (insn) = x;
+ /* Replicate the return address on the stack so that return
+ address can be reached via (argp - 1) slot. This is needed
+ to implement macro RETURN_ADDR_RTX and intrinsic function
+ expand_builtin_return_addr etc. */
+ x = crtl->drap_reg;
+ x = gen_frame_mem (Pmode,
+ plus_constant (x, -UNITS_PER_WORD));
+ insn = emit_insn (gen_push (x));
+ RTX_FRAME_RELATED_P (insn) = 1;
}
/* Note: AT&T enter does NOT have reversed args. Enter is probably
@@ -7566,6 +7913,18 @@ ix86_expand_prologue (void)
RTX_FRAME_RELATED_P (insn) = 1;
}
+ if (stack_realign_fp)
+ {
+ int align_bytes = crtl->stack_alignment_needed / 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,
+ stack_pointer_rtx,
+ GEN_INT (-align_bytes)));
+ RTX_FRAME_RELATED_P (insn) = 1;
+ }
+
allocate = frame.to_allocate;
if (!frame.save_regs_using_mov)
@@ -7580,7 +7939,9 @@ ix86_expand_prologue (void)
a red zone location */
if (!TARGET_64BIT_MS_ABI && TARGET_RED_ZONE && frame.save_regs_using_mov
&& (! TARGET_STACK_PROBE || allocate < CHECK_STACK_LIMIT))
- ix86_emit_save_regs_using_mov (frame_pointer_needed ? hard_frame_pointer_rtx
+ ix86_emit_save_regs_using_mov ((frame_pointer_needed
+ && !crtl->stack_realign_needed)
+ ? hard_frame_pointer_rtx
: stack_pointer_rtx,
-frame.nregs * UNITS_PER_WORD);
@@ -7639,8 +8000,11 @@ ix86_expand_prologue (void)
&& !(!TARGET_64BIT_MS_ABI && TARGET_RED_ZONE
&& (! TARGET_STACK_PROBE || allocate < CHECK_STACK_LIMIT)))
{
- if (!frame_pointer_needed || !frame.to_allocate)
- ix86_emit_save_regs_using_mov (stack_pointer_rtx, frame.to_allocate);
+ if (!frame_pointer_needed
+ || !frame.to_allocate
+ || crtl->stack_realign_needed)
+ ix86_emit_save_regs_using_mov (stack_pointer_rtx,
+ frame.to_allocate);
else
ix86_emit_save_regs_using_mov (hard_frame_pointer_rtx,
-frame.nregs * UNITS_PER_WORD);
@@ -7691,6 +8055,16 @@ ix86_expand_prologue (void)
emit_insn (gen_blockage ());
}
+ if (crtl->drap_reg && !crtl->stack_realign_needed)
+ {
+ /* 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 = 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));
+ }
+
/* Emit cld instruction if stringops are used in the function. */
if (TARGET_CLD && ix86_current_function_needs_cld)
emit_insn (gen_cld ());
@@ -7732,10 +8106,17 @@ void
ix86_expand_epilogue (int style)
{
int regno;
- int sp_valid = !frame_pointer_needed || current_function_sp_is_unchanging;
+ int sp_valid;
struct ix86_frame frame;
HOST_WIDE_INT offset;
+ ix86_finalize_stack_realign_flags ();
+
+ /* When stack is realigned, SP must be valid. */
+ sp_valid = (!frame_pointer_needed
+ || current_function_sp_is_unchanging
+ || stack_realign_fp);
+
ix86_compute_frame_layout (&frame);
/* Calculate start of saved registers relative to ebp. Special care
@@ -7769,11 +8150,16 @@ ix86_expand_epilogue (int style)
{
/* Restore registers. We can use ebp or esp to address the memory
locations. If both are available, default to ebp, since offsets
- are known to be small. Only exception is esp pointing directly to the
- end of block of saved registers, where we may simplify addressing
- mode. */
+ are known to be small. Only exception is esp pointing directly
+ to the end of block of saved registers, where we may simplify
+ addressing mode.
+
+ If we are realigning stack with bp and sp, regs restore can't
+ be addressed by bp. sp must be used instead. */
- if (!frame_pointer_needed || (sp_valid && !frame.to_allocate))
+ if (!frame_pointer_needed
+ || (sp_valid && !frame.to_allocate)
+ || stack_realign_fp)
ix86_emit_restore_regs_using_mov (stack_pointer_rtx,
frame.to_allocate, style == 2);
else
@@ -7785,6 +8171,9 @@ ix86_expand_epilogue (int style)
{
rtx tmp, sa = EH_RETURN_STACKADJ_RTX;
+ /* Stack align doesn't work with eh_return. */
+ gcc_assert (!crtl->stack_realign_needed);
+
if (frame_pointer_needed)
{
tmp = gen_rtx_PLUS (Pmode, hard_frame_pointer_rtx, sa);
@@ -7811,7 +8200,7 @@ ix86_expand_epilogue (int style)
+ frame.nregs * UNITS_PER_WORD),
style);
/* If not an i386, mov & pop is faster than "leave". */
- else if (TARGET_USE_LEAVE || optimize_size
+ else if (TARGET_USE_LEAVE || optimize_function_for_size_p (cfun)
|| !cfun->machine->use_fast_prologue_epilogue)
emit_insn ((*ix86_gen_leave) ());
else
@@ -7826,10 +8215,16 @@ ix86_expand_epilogue (int style)
else
{
/* First step is to deallocate the stack frame so that we can
- pop the registers. */
+ pop the registers.
+
+ If we realign stack with frame pointer, then stack pointer
+ won't be able to recover via lea $offset(%bp), %sp, because
+ there is a padding area between bp and sp for realign.
+ "add $to_allocate, %sp" must be used instead. */
if (!sp_valid)
{
gcc_assert (frame_pointer_needed);
+ gcc_assert (!stack_realign_fp);
pro_epilogue_adjust_stack (stack_pointer_rtx,
hard_frame_pointer_rtx,
GEN_INT (offset), style);
@@ -7848,15 +8243,31 @@ ix86_expand_epilogue (int style)
if (TARGET_USE_LEAVE)
emit_insn ((*ix86_gen_leave) ());
else
- emit_insn ((*ix86_gen_pop1) (hard_frame_pointer_rtx));
+ {
+ /* For stack realigned really happens, recover stack
+ pointer to hard frame pointer is a must, if not using
+ leave. */
+ if (stack_realign_fp)
+ pro_epilogue_adjust_stack (stack_pointer_rtx,
+ hard_frame_pointer_rtx,
+ const0_rtx, style);
+ emit_insn ((*ix86_gen_pop1) (hard_frame_pointer_rtx));
+ }
}
}
- if (cfun->machine->force_align_arg_pointer)
+ if (crtl->drap_reg && crtl->stack_realign_needed)
{
- emit_insn (gen_addsi3 (stack_pointer_rtx,
- cfun->machine->force_align_arg_pointer,
- GEN_INT (-4)));
+ int param_ptr_offset = (call_used_regs[REGNO (crtl->drap_reg)]
+ ? 0 : UNITS_PER_WORD);
+ gcc_assert (stack_realign_drap);
+ emit_insn ((*ix86_gen_add3) (stack_pointer_rtx,
+ crtl->drap_reg,
+ GEN_INT (-(UNITS_PER_WORD
+ + param_ptr_offset))));
+ if (!call_used_regs[REGNO (crtl->drap_reg)])
+ emit_insn ((*ix86_gen_pop1) (crtl->drap_reg));
+
}
/* Sibcall epilogues don't want a return instruction. */
@@ -8048,8 +8459,10 @@ ix86_decompose_address (rtx addr, struct ix86_address *out)
disp = const0_rtx;
/* Special case: on K6, [%esi] makes the instruction vector decoded.
- Avoid this by transforming to [%esi+0]. */
- if (TARGET_K6 && !optimize_size
+ Avoid this by transforming to [%esi+0].
+ Reload calls address legitimization without cfun defined, so we need
+ to test cfun for being non-NULL. */
+ if (TARGET_K6 && cfun && optimize_function_for_speed_p (cfun)
&& base_reg && !index_reg && !disp
&& REG_P (base_reg)
&& REGNO_REG_CLASS (REGNO (base_reg)) == SIREG)
@@ -9123,7 +9536,8 @@ get_dllimport_decl (tree decl)
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
name = targetm.strip_name_encoding (name);
- prefix = name[0] == FASTCALL_PREFIX ? "*__imp_": "*__imp__";
+ prefix = name[0] == FASTCALL_PREFIX || user_label_prefix[0] == 0
+ ? "*__imp_" : "*__imp__";
namelen = strlen (name);
prefixlen = strlen (prefix);
imp_name = (char *) alloca (namelen + prefixlen + 1);
@@ -9827,12 +10241,19 @@ put_condition_code (enum rtx_code code, enum machine_mode mode, int reverse,
If CODE is 'b', pretend the mode is QImode.
If CODE is 'k', pretend the mode is SImode.
If CODE is 'q', pretend the mode is DImode.
+ If CODE is 'x', pretend the mode is V4SFmode.
+ If CODE is 't', pretend the mode is V8SFmode.
If CODE is 'h', pretend the reg is the 'high' byte register.
- If CODE is 'y', print "st(0)" instead of "st", if the reg is stack op. */
+ If CODE is 'y', print "st(0)" instead of "st", if the reg is stack op.
+ If CODE is 'd', duplicate the operand for AVX instruction.
+ */
void
print_reg (rtx x, int code, FILE *file)
{
+ const char *reg;
+ bool duplicated = code == 'd' && TARGET_AVX;
+
gcc_assert (x == pc_rtx
|| (REGNO (x) != ARG_POINTER_REGNUM
&& REGNO (x) != FRAME_POINTER_REGNUM
@@ -9862,6 +10283,10 @@ print_reg (rtx x, int code, FILE *file)
code = 3;
else if (code == 'h')
code = 0;
+ else if (code == 'x')
+ code = 16;
+ else if (code == 't')
+ code = 32;
else
code = GET_MODE_SIZE (GET_MODE (x));
@@ -9893,12 +10318,14 @@ print_reg (rtx x, int code, FILE *file)
}
return;
}
+
+ reg = NULL;
switch (code)
{
case 3:
if (STACK_TOP_P (x))
{
- fputs ("st(0)", file);
+ reg = "st(0)";
break;
}
/* FALLTHRU */
@@ -9911,21 +10338,39 @@ print_reg (rtx x, int code, FILE *file)
case 16:
case 2:
normal:
- fputs (hi_reg_name[REGNO (x)], file);
+ reg = hi_reg_name[REGNO (x)];
break;
case 1:
if (REGNO (x) >= ARRAY_SIZE (qi_reg_name))
goto normal;
- fputs (qi_reg_name[REGNO (x)], file);
+ reg = qi_reg_name[REGNO (x)];
break;
case 0:
if (REGNO (x) >= ARRAY_SIZE (qi_high_reg_name))
goto normal;
- fputs (qi_high_reg_name[REGNO (x)], file);
+ reg = qi_high_reg_name[REGNO (x)];
+ break;
+ case 32:
+ if (SSE_REG_P (x))
+ {
+ gcc_assert (!duplicated);
+ putc ('y', file);
+ fputs (hi_reg_name[REGNO (x)] + 1, file);
+ return;
+ }
break;
default:
gcc_unreachable ();
}
+
+ fputs (reg, file);
+ if (duplicated)
+ {
+ if (ASSEMBLER_DIALECT == ASM_ATT)
+ fprintf (file, ", %%%s", reg);
+ else
+ fprintf (file, ", %s", reg);
+ }
}
/* Locate some local-dynamic symbol still in use by this function
@@ -9983,8 +10428,11 @@ get_some_local_dynamic_name (void)
w -- likewise, print the HImode name of the register.
k -- likewise, print the SImode name of the register.
q -- likewise, print the DImode name of the register.
+ x -- likewise, print the V4SFmode name of the register.
+ t -- likewise, print the V8SFmode name of the register.
h -- print the QImode name for a "high" register, either ah, bh, ch or dh.
y -- print "st(0)" instead of "st" as a register.
+ d -- print duplicated register operand for AVX instruction.
D -- print condition for SSE cmp instruction.
P -- if PIC, print an @PLT suffix.
X -- don't print any sort of PIC '@' suffix for a symbol.
@@ -10135,12 +10583,15 @@ print_operand (FILE *file, rtx x, int code)
gcc_unreachable ();
}
+ case 'd':
case 'b':
case 'w':
case 'k':
case 'q':
case 'h':
+ case 't':
case 'y':
+ case 'x':
case 'X':
case 'P':
break;
@@ -10157,40 +10608,93 @@ print_operand (FILE *file, rtx x, int code)
/* Little bit of braindamage here. The SSE compare instructions
does use completely different names for the comparisons that the
fp conditional moves. */
- switch (GET_CODE (x))
+ if (TARGET_AVX)
{
- case EQ:
- case UNEQ:
- fputs ("eq", file);
- break;
- case LT:
- case UNLT:
- fputs ("lt", file);
- break;
- case LE:
- case UNLE:
- fputs ("le", file);
- break;
- case UNORDERED:
- fputs ("unord", file);
- break;
- case NE:
- case LTGT:
- fputs ("neq", file);
- break;
- case UNGE:
- case GE:
- fputs ("nlt", file);
- break;
- case UNGT:
- case GT:
- fputs ("nle", file);
- break;
- case ORDERED:
- fputs ("ord", file);
- break;
- default:
- gcc_unreachable ();
+ switch (GET_CODE (x))
+ {
+ case EQ:
+ fputs ("eq", file);
+ break;
+ case UNEQ:
+ fputs ("eq_us", file);
+ break;
+ case LT:
+ fputs ("lt", file);
+ break;
+ case UNLT:
+ fputs ("nge", file);
+ break;
+ case LE:
+ fputs ("le", file);
+ break;
+ case UNLE:
+ fputs ("ngt", file);
+ break;
+ case UNORDERED:
+ fputs ("unord", file);
+ break;
+ case NE:
+ fputs ("neq", file);
+ break;
+ case LTGT:
+ fputs ("neq_oq", file);
+ break;
+ case GE:
+ fputs ("ge", file);
+ break;
+ case UNGE:
+ fputs ("nlt", file);
+ break;
+ case GT:
+ fputs ("gt", file);
+ break;
+ case UNGT:
+ fputs ("nle", file);
+ break;
+ case ORDERED:
+ fputs ("ord", file);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ }
+ else
+ {
+ switch (GET_CODE (x))
+ {
+ case EQ:
+ case UNEQ:
+ fputs ("eq", file);
+ break;
+ case LT:
+ case UNLT:
+ fputs ("lt", file);
+ break;
+ case LE:
+ case UNLE:
+ fputs ("le", file);
+ break;
+ case UNORDERED:
+ fputs ("unord", file);
+ break;
+ case NE:
+ case LTGT:
+ fputs ("neq", file);
+ break;
+ case UNGE:
+ case GE:
+ fputs ("nlt", file);
+ break;
+ case UNGT:
+ case GT:
+ fputs ("nle", file);
+ break;
+ case ORDERED:
+ fputs ("ord", file);
+ break;
+ default:
+ gcc_unreachable ();
+ }
}
return;
case 'O':
@@ -10258,7 +10762,8 @@ print_operand (FILE *file, rtx x, int code)
{
rtx x;
- if (!optimize || optimize_size || !TARGET_BRANCH_PREDICTION_HINTS)
+ if (!optimize
+ || optimize_function_for_size_p (cfun) || !TARGET_BRANCH_PREDICTION_HINTS)
return;
x = find_reg_note (current_output_insn, REG_BR_PROB, 0);
@@ -10743,7 +11248,7 @@ split_ti (rtx operands[], int num, rtx lo_half[], rtx hi_half[])
const char *
output_387_binary_op (rtx insn, rtx *operands)
{
- static char buf[30];
+ static char buf[40];
const char *p;
const char *ssep;
int is_sse = SSE_REG_P (operands[0]) || SSE_REG_P (operands[1]) || SSE_REG_P (operands[2]);
@@ -10772,7 +11277,7 @@ output_387_binary_op (rtx insn, rtx *operands)
p = "fiadd";
else
p = "fadd";
- ssep = "add";
+ ssep = "vadd";
break;
case MINUS:
@@ -10781,7 +11286,7 @@ output_387_binary_op (rtx insn, rtx *operands)
p = "fisub";
else
p = "fsub";
- ssep = "sub";
+ ssep = "vsub";
break;
case MULT:
@@ -10790,7 +11295,7 @@ output_387_binary_op (rtx insn, rtx *operands)
p = "fimul";
else
p = "fmul";
- ssep = "mul";
+ ssep = "vmul";
break;
case DIV:
@@ -10799,7 +11304,7 @@ output_387_binary_op (rtx insn, rtx *operands)
p = "fidiv";
else
p = "fdiv";
- ssep = "div";
+ ssep = "vdiv";
break;
default:
@@ -10808,11 +11313,22 @@ output_387_binary_op (rtx insn, rtx *operands)
if (is_sse)
{
- strcpy (buf, ssep);
- if (GET_MODE (operands[0]) == SFmode)
- strcat (buf, "ss\t{%2, %0|%0, %2}");
- else
- strcat (buf, "sd\t{%2, %0|%0, %2}");
+ if (TARGET_AVX)
+ {
+ strcpy (buf, ssep);
+ if (GET_MODE (operands[0]) == SFmode)
+ strcat (buf, "ss\t{%2, %1, %0|%0, %1, %2}");
+ else
+ strcat (buf, "sd\t{%2, %1, %0|%0, %1, %2}");
+ }
+ else
+ {
+ strcpy (buf, ssep + 1);
+ if (GET_MODE (operands[0]) == SFmode)
+ strcat (buf, "ss\t{%2, %0|%0, %2}");
+ else
+ strcat (buf, "sd\t{%2, %0|%0, %2}");
+ }
return buf;
}
strcpy (buf, p);
@@ -11014,7 +11530,8 @@ emit_i387_cw_initialization (int mode)
emit_insn (gen_x86_fnstcw_1 (stored_mode));
emit_move_insn (reg, copy_rtx (stored_mode));
- if (TARGET_64BIT || TARGET_PARTIAL_REG_STALL || optimize_size)
+ if (TARGET_64BIT || TARGET_PARTIAL_REG_STALL
+ || optimize_function_for_size_p (cfun))
{
switch (mode)
{
@@ -11174,16 +11691,21 @@ output_fp_compare (rtx insn, rtx *operands, int eflags_p, int unordered_p)
if (is_sse)
{
+ static const char ucomiss[] = "vucomiss\t{%1, %0|%0, %1}";
+ static const char ucomisd[] = "vucomisd\t{%1, %0|%0, %1}";
+ static const char comiss[] = "vcomiss\t{%1, %0|%0, %1}";
+ static const char comisd[] = "vcomisd\t{%1, %0|%0, %1}";
+
if (GET_MODE (operands[0]) == SFmode)
if (unordered_p)
- return "ucomiss\t{%1, %0|%0, %1}";
+ return &ucomiss[TARGET_AVX ? 0 : 1];
else
- return "comiss\t{%1, %0|%0, %1}";
+ return &comiss[TARGET_AVX ? 0 : 1];
else
if (unordered_p)
- return "ucomisd\t{%1, %0|%0, %1}";
+ return &ucomisd[TARGET_AVX ? 0 : 1];
else
- return "comisd\t{%1, %0|%0, %1}";
+ return &comisd[TARGET_AVX ? 0 : 1];
}
gcc_assert (STACK_TOP_P (cmp_op0));
@@ -11333,7 +11855,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));
@@ -11597,10 +12119,62 @@ ix86_expand_vector_move_misalign (enum machine_mode mode, rtx operands[])
op0 = operands[0];
op1 = operands[1];
+ if (TARGET_AVX)
+ {
+ switch (GET_MODE_CLASS (mode))
+ {
+ case MODE_VECTOR_INT:
+ case MODE_INT:
+ switch (GET_MODE_SIZE (mode))
+ {
+ case 16:
+ op0 = gen_lowpart (V16QImode, op0);
+ op1 = gen_lowpart (V16QImode, op1);
+ emit_insn (gen_avx_movdqu (op0, op1));
+ break;
+ case 32:
+ op0 = gen_lowpart (V32QImode, op0);
+ op1 = gen_lowpart (V32QImode, op1);
+ emit_insn (gen_avx_movdqu256 (op0, op1));
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ break;
+ case MODE_VECTOR_FLOAT:
+ op0 = gen_lowpart (mode, op0);
+ op1 = gen_lowpart (mode, op1);
+
+ switch (mode)
+ {
+ case V4SFmode:
+ emit_insn (gen_avx_movups (op0, op1));
+ break;
+ case V8SFmode:
+ emit_insn (gen_avx_movups256 (op0, op1));
+ break;
+ case V2DFmode:
+ emit_insn (gen_avx_movupd (op0, op1));
+ break;
+ case V4DFmode:
+ emit_insn (gen_avx_movupd256 (op0, op1));
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
+ return;
+ }
+
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);
@@ -11682,7 +12256,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);
@@ -12586,6 +13160,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;
@@ -12886,7 +13464,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;
@@ -13371,7 +13949,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;
@@ -14082,7 +14660,8 @@ ix86_expand_int_movcc (rtx operands[])
*/
if ((!TARGET_CMOVE || (mode == QImode && TARGET_PARTIAL_REG_STALL))
- && BRANCH_COST >= 2)
+ && BRANCH_COST (optimize_insn_for_speed_p (),
+ false) >= 2)
{
if (cf == 0)
{
@@ -14167,7 +14746,7 @@ ix86_expand_int_movcc (rtx operands[])
optab op;
rtx var, orig_out, out, tmp;
- if (BRANCH_COST <= 2)
+ if (BRANCH_COST (optimize_insn_for_speed_p (), false) <= 2)
return 0; /* FAIL */
/* If one of the two operands is an interesting constant, load a
@@ -15423,7 +16002,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])
@@ -15454,7 +16033,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;
@@ -15537,7 +16116,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]);
@@ -15569,7 +16148,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);
@@ -16422,16 +17001,19 @@ decide_alg (HOST_WIDE_INT count, HOST_WIDE_INT expected_size, bool memset,
|| (alg != rep_prefix_1_byte \
&& alg != rep_prefix_4_byte \
&& alg != rep_prefix_8_byte))
+ const struct processor_costs *cost;
+
+ cost = optimize_insn_for_size_p () ? &ix86_size_cost : ix86_cost;
*dynamic_check = -1;
if (memset)
- algs = &ix86_cost->memset[TARGET_64BIT != 0];
+ algs = &cost->memset[TARGET_64BIT != 0];
else
- algs = &ix86_cost->memcpy[TARGET_64BIT != 0];
+ algs = &cost->memcpy[TARGET_64BIT != 0];
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;
@@ -17346,7 +17928,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;
@@ -17354,7 +17936,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));
@@ -17712,6 +18294,44 @@ ix86_attr_length_address_default (rtx insn)
}
return 0;
}
+
+/* Compute default value for "length_vex" attribute. It includes
+ 2 or 3 byte VEX prefix and 1 opcode byte. */
+
+int
+ix86_attr_length_vex_default (rtx insn, int has_0f_opcode,
+ int has_vex_w)
+{
+ int i;
+
+ /* Only 0f opcode can use 2 byte VEX prefix and VEX W bit uses 3
+ byte VEX prefix. */
+ if (!has_0f_opcode || has_vex_w)
+ return 3 + 1;
+
+ /* We can always use 2 byte VEX prefix in 32bit. */
+ if (!TARGET_64BIT)
+ return 2 + 1;
+
+ extract_insn_cached (insn);
+
+ for (i = recog_data.n_operands - 1; i >= 0; --i)
+ if (REG_P (recog_data.operand[i]))
+ {
+ /* REX.W bit uses 3 byte VEX prefix. */
+ if (GET_MODE (recog_data.operand[i]) == DImode)
+ return 3 + 1;
+ }
+ else
+ {
+ /* REX.X or REX.B bits use 3 byte VEX prefix. */
+ if (MEM_P (recog_data.operand[i])
+ && x86_extended_reg_mentioned_p (recog_data.operand[i]))
+ return 3 + 1;
+ }
+
+ return 2 + 1;
+}
/* Return the maximum number of instructions a cpu can issue. */
@@ -18518,6 +19138,8 @@ enum ix86_builtins
IX86_BUILTIN_MOVNTPD,
IX86_BUILTIN_MOVNTDQ,
+ IX86_BUILTIN_MOVQ128,
+
/* SSE2 MMX */
IX86_BUILTIN_MASKMOVDQU,
IX86_BUILTIN_MOVMSKPD,
@@ -18777,6 +19399,144 @@ enum ix86_builtins
/* PCLMUL instruction */
IX86_BUILTIN_PCLMULQDQ128,
+ /* AVX */
+ IX86_BUILTIN_ADDPD256,
+ IX86_BUILTIN_ADDPS256,
+ IX86_BUILTIN_ADDSUBPD256,
+ IX86_BUILTIN_ADDSUBPS256,
+ IX86_BUILTIN_ANDPD256,
+ IX86_BUILTIN_ANDPS256,
+ IX86_BUILTIN_ANDNPD256,
+ IX86_BUILTIN_ANDNPS256,
+ IX86_BUILTIN_BLENDPD256,
+ IX86_BUILTIN_BLENDPS256,
+ IX86_BUILTIN_BLENDVPD256,
+ IX86_BUILTIN_BLENDVPS256,
+ IX86_BUILTIN_DIVPD256,
+ IX86_BUILTIN_DIVPS256,
+ IX86_BUILTIN_DPPS256,
+ IX86_BUILTIN_HADDPD256,
+ IX86_BUILTIN_HADDPS256,
+ IX86_BUILTIN_HSUBPD256,
+ IX86_BUILTIN_HSUBPS256,
+ IX86_BUILTIN_MAXPD256,
+ IX86_BUILTIN_MAXPS256,
+ IX86_BUILTIN_MINPD256,
+ IX86_BUILTIN_MINPS256,
+ IX86_BUILTIN_MULPD256,
+ IX86_BUILTIN_MULPS256,
+ IX86_BUILTIN_ORPD256,
+ IX86_BUILTIN_ORPS256,
+ IX86_BUILTIN_SHUFPD256,
+ IX86_BUILTIN_SHUFPS256,
+ IX86_BUILTIN_SUBPD256,
+ IX86_BUILTIN_SUBPS256,
+ IX86_BUILTIN_XORPD256,
+ IX86_BUILTIN_XORPS256,
+ IX86_BUILTIN_CMPSD,
+ IX86_BUILTIN_CMPSS,
+ IX86_BUILTIN_CMPPD,
+ IX86_BUILTIN_CMPPS,
+ IX86_BUILTIN_CMPPD256,
+ IX86_BUILTIN_CMPPS256,
+ IX86_BUILTIN_CVTDQ2PD256,
+ IX86_BUILTIN_CVTDQ2PS256,
+ IX86_BUILTIN_CVTPD2PS256,
+ IX86_BUILTIN_CVTPS2DQ256,
+ IX86_BUILTIN_CVTPS2PD256,
+ IX86_BUILTIN_CVTTPD2DQ256,
+ IX86_BUILTIN_CVTPD2DQ256,
+ IX86_BUILTIN_CVTTPS2DQ256,
+ IX86_BUILTIN_EXTRACTF128PD256,
+ IX86_BUILTIN_EXTRACTF128PS256,
+ IX86_BUILTIN_EXTRACTF128SI256,
+ IX86_BUILTIN_VZEROALL,
+ IX86_BUILTIN_VZEROUPPER,
+ IX86_BUILTIN_VZEROUPPER_REX64,
+ IX86_BUILTIN_VPERMILVARPD,
+ IX86_BUILTIN_VPERMILVARPS,
+ IX86_BUILTIN_VPERMILVARPD256,
+ IX86_BUILTIN_VPERMILVARPS256,
+ IX86_BUILTIN_VPERMILPD,
+ IX86_BUILTIN_VPERMILPS,
+ IX86_BUILTIN_VPERMILPD256,
+ IX86_BUILTIN_VPERMILPS256,
+ IX86_BUILTIN_VPERMIL2PD,
+ IX86_BUILTIN_VPERMIL2PS,
+ IX86_BUILTIN_VPERMIL2PD256,
+ IX86_BUILTIN_VPERMIL2PS256,
+ IX86_BUILTIN_VPERM2F128PD256,
+ IX86_BUILTIN_VPERM2F128PS256,
+ IX86_BUILTIN_VPERM2F128SI256,
+ IX86_BUILTIN_VBROADCASTSS,
+ IX86_BUILTIN_VBROADCASTSD256,
+ IX86_BUILTIN_VBROADCASTSS256,
+ IX86_BUILTIN_VBROADCASTPD256,
+ IX86_BUILTIN_VBROADCASTPS256,
+ IX86_BUILTIN_VINSERTF128PD256,
+ IX86_BUILTIN_VINSERTF128PS256,
+ IX86_BUILTIN_VINSERTF128SI256,
+ IX86_BUILTIN_LOADUPD256,
+ IX86_BUILTIN_LOADUPS256,
+ IX86_BUILTIN_STOREUPD256,
+ IX86_BUILTIN_STOREUPS256,
+ IX86_BUILTIN_LDDQU256,
+ IX86_BUILTIN_LOADDQU256,
+ IX86_BUILTIN_STOREDQU256,
+ IX86_BUILTIN_MASKLOADPD,
+ IX86_BUILTIN_MASKLOADPS,
+ IX86_BUILTIN_MASKSTOREPD,
+ IX86_BUILTIN_MASKSTOREPS,
+ IX86_BUILTIN_MASKLOADPD256,
+ IX86_BUILTIN_MASKLOADPS256,
+ IX86_BUILTIN_MASKSTOREPD256,
+ IX86_BUILTIN_MASKSTOREPS256,
+ IX86_BUILTIN_MOVSHDUP256,
+ IX86_BUILTIN_MOVSLDUP256,
+ IX86_BUILTIN_MOVDDUP256,
+
+ IX86_BUILTIN_SQRTPD256,
+ IX86_BUILTIN_SQRTPS256,
+ IX86_BUILTIN_SQRTPS_NR256,
+ IX86_BUILTIN_RSQRTPS256,
+ IX86_BUILTIN_RSQRTPS_NR256,
+
+ IX86_BUILTIN_RCPPS256,
+
+ IX86_BUILTIN_ROUNDPD256,
+ IX86_BUILTIN_ROUNDPS256,
+
+ IX86_BUILTIN_UNPCKHPD256,
+ IX86_BUILTIN_UNPCKLPD256,
+ IX86_BUILTIN_UNPCKHPS256,
+ IX86_BUILTIN_UNPCKLPS256,
+
+ IX86_BUILTIN_SI256_SI,
+ IX86_BUILTIN_PS256_PS,
+ IX86_BUILTIN_PD256_PD,
+ IX86_BUILTIN_SI_SI256,
+ IX86_BUILTIN_PS_PS256,
+ IX86_BUILTIN_PD_PD256,
+
+ IX86_BUILTIN_VTESTZPD,
+ IX86_BUILTIN_VTESTCPD,
+ IX86_BUILTIN_VTESTNZCPD,
+ IX86_BUILTIN_VTESTZPS,
+ IX86_BUILTIN_VTESTCPS,
+ IX86_BUILTIN_VTESTNZCPS,
+ IX86_BUILTIN_VTESTZPD256,
+ IX86_BUILTIN_VTESTCPD256,
+ IX86_BUILTIN_VTESTNZCPD256,
+ IX86_BUILTIN_VTESTZPS256,
+ IX86_BUILTIN_VTESTCPS256,
+ IX86_BUILTIN_VTESTNZCPS256,
+ IX86_BUILTIN_PTESTZ256,
+ IX86_BUILTIN_PTESTC256,
+ IX86_BUILTIN_PTESTNZC256,
+
+ IX86_BUILTIN_MOVMSKPD256,
+ IX86_BUILTIN_MOVMSKPS256,
+
/* TFmode support builtins. */
IX86_BUILTIN_INFQ,
IX86_BUILTIN_FABSQ,
@@ -18799,6 +19559,7 @@ enum ix86_builtins
IX86_BUILTIN_FNMSUBSD,
IX86_BUILTIN_FNMSUBPS,
IX86_BUILTIN_FNMSUBPD,
+ IX86_BUILTIN_PCMOV,
IX86_BUILTIN_PCMOV_V2DI,
IX86_BUILTIN_PCMOV_V4SI,
IX86_BUILTIN_PCMOV_V8HI,
@@ -18998,17 +19759,35 @@ enum ix86_builtins
/* Table for the ix86 builtin decls. */
static GTY(()) tree ix86_builtins[(int) IX86_BUILTIN_MAX];
-/* Table to record which ISA options the builtin needs. */
-static int ix86_builtins_isa[(int) IX86_BUILTIN_MAX];
+/* Table of all of the builtin functions that are possible with different ISA's
+ but are waiting to be built until a function is declared to use that
+ ISA. */
+struct builtin_isa GTY(())
+{
+ tree type; /* builtin type to use in the declaration */
+ const char *name; /* function name */
+ int isa; /* isa_flags this builtin is defined for */
+ bool const_p; /* true if the declaration is constant */
+};
+
+static GTY(()) struct builtin_isa ix86_builtins_isa[(int) IX86_BUILTIN_MAX];
+
/* Add an ix86 target builtin function with CODE, NAME and TYPE. Save the MASK
* of which isa_flags to use in the ix86_builtins_isa array. Stores the
* function decl in the ix86_builtins array. Returns the function decl or
* NULL_TREE, if the builtin was not added.
*
- * Record all builtins, even if it isn't an instruction set in the current ISA
- * in case the user uses function specific options for a different ISA. When
- * the builtin is expanded, check at that time whether it is valid. */
+ * If the front end has a special hook for builtin functions, delay adding
+ * builtin functions that aren't in the current ISA until the ISA is changed
+ * with function specific optimization. Doing so, can save about 300K for the
+ * default compiler. When the builtin is expanded, check at that time whether
+ * it is valid.
+ *
+ * If the front end doesn't have a special hook, record all builtins, even if
+ * it isn't an instruction set in the current ISA in case the user uses
+ * function specific options for a different ISA, so that we don't get scope
+ * errors if a builtin is added in the middle of a function scope. */
static inline tree
def_builtin (int mask, const char *name, tree type, enum ix86_builtins code)
@@ -19017,10 +19796,25 @@ def_builtin (int mask, const char *name, tree type, enum ix86_builtins code)
if (!(mask & OPTION_MASK_ISA_64BIT) || TARGET_64BIT)
{
- decl = add_builtin_function (name, type, code, BUILT_IN_MD,
- NULL, NULL_TREE);
- ix86_builtins[(int) code] = decl;
- ix86_builtins_isa[(int) code] = mask;
+ ix86_builtins_isa[(int) code].isa = mask;
+
+ if ((mask & ix86_isa_flags) != 0
+ || (lang_hooks.builtin_function
+ == lang_hooks.builtin_function_ext_scope))
+
+ {
+ decl = add_builtin_function (name, type, code, BUILT_IN_MD, NULL,
+ NULL_TREE);
+ ix86_builtins[(int) code] = decl;
+ ix86_builtins_isa[(int) code].type = NULL_TREE;
+ }
+ else
+ {
+ ix86_builtins[(int) code] = NULL_TREE;
+ ix86_builtins_isa[(int) code].const_p = false;
+ ix86_builtins_isa[(int) code].type = type;
+ ix86_builtins_isa[(int) code].name = name;
+ }
}
return decl;
@@ -19035,9 +19829,40 @@ def_builtin_const (int mask, const char *name, tree type,
tree decl = def_builtin (mask, name, type, code);
if (decl)
TREE_READONLY (decl) = 1;
+ else
+ ix86_builtins_isa[(int) code].const_p = true;
+
return decl;
}
+/* Add any new builtin functions for a given ISA that may not have been
+ declared. This saves a bit of space compared to adding all of the
+ declarations to the tree, even if we didn't use them. */
+
+static void
+ix86_add_new_builtins (int isa)
+{
+ int i;
+ tree decl;
+
+ for (i = 0; i < (int)IX86_BUILTIN_MAX; i++)
+ {
+ if ((ix86_builtins_isa[i].isa & isa) != 0
+ && ix86_builtins_isa[i].type != NULL_TREE)
+ {
+ decl = add_builtin_function_ext_scope (ix86_builtins_isa[i].name,
+ ix86_builtins_isa[i].type,
+ i, BUILT_IN_MD, NULL,
+ NULL_TREE);
+
+ ix86_builtins[i] = decl;
+ ix86_builtins_isa[i].type = NULL_TREE;
+ if (ix86_builtins_isa[i].const_p)
+ TREE_READONLY (decl) = 1;
+ }
+ }
+}
+
/* Bits for builtin_description.flag. */
/* Set when we don't support the comparison natively, and should
@@ -19111,19 +19936,35 @@ enum ix86_special_builtin_type
{
SPECIAL_FTYPE_UNKNOWN,
VOID_FTYPE_VOID,
+ V32QI_FTYPE_PCCHAR,
V16QI_FTYPE_PCCHAR,
+ V8SF_FTYPE_PCV4SF,
+ V8SF_FTYPE_PCFLOAT,
+ V4DF_FTYPE_PCV2DF,
+ V4DF_FTYPE_PCDOUBLE,
V4SF_FTYPE_PCFLOAT,
V2DF_FTYPE_PCDOUBLE,
+ V8SF_FTYPE_PCV8SF_V8SF,
+ V4DF_FTYPE_PCV4DF_V4DF,
V4SF_FTYPE_V4SF_PCV2SF,
+ V4SF_FTYPE_PCV4SF_V4SF,
V2DF_FTYPE_V2DF_PCDOUBLE,
+ V2DF_FTYPE_PCV2DF_V2DF,
V2DI_FTYPE_PV2DI,
VOID_FTYPE_PV2SF_V4SF,
VOID_FTYPE_PV2DI_V2DI,
+ VOID_FTYPE_PCHAR_V32QI,
VOID_FTYPE_PCHAR_V16QI,
+ VOID_FTYPE_PFLOAT_V8SF,
VOID_FTYPE_PFLOAT_V4SF,
+ VOID_FTYPE_PDOUBLE_V4DF,
VOID_FTYPE_PDOUBLE_V2DF,
VOID_FTYPE_PDI_DI,
- VOID_FTYPE_PINT_INT
+ VOID_FTYPE_PINT_INT,
+ VOID_FTYPE_PV8SF_V8SF_V8SF,
+ VOID_FTYPE_PV4DF_V4DF_V4DF,
+ VOID_FTYPE_PV4SF_V4SF_V4SF,
+ VOID_FTYPE_PV2DF_V2DF_V2DF
};
/* Builtin types */
@@ -19133,25 +19974,45 @@ enum ix86_builtin_type
FLOAT128_FTYPE_FLOAT128,
FLOAT_FTYPE_FLOAT,
FLOAT128_FTYPE_FLOAT128_FLOAT128,
+ INT_FTYPE_V8SF_V8SF_PTEST,
+ INT_FTYPE_V4DI_V4DI_PTEST,
+ INT_FTYPE_V4DF_V4DF_PTEST,
+ INT_FTYPE_V4SF_V4SF_PTEST,
INT_FTYPE_V2DI_V2DI_PTEST,
+ INT_FTYPE_V2DF_V2DF_PTEST,
INT64_FTYPE_V4SF,
INT64_FTYPE_V2DF,
INT_FTYPE_V16QI,
INT_FTYPE_V8QI,
+ INT_FTYPE_V8SF,
+ INT_FTYPE_V4DF,
INT_FTYPE_V4SF,
INT_FTYPE_V2DF,
V16QI_FTYPE_V16QI,
+ V8SI_FTYPE_V8SF,
+ V8SI_FTYPE_V4SI,
V8HI_FTYPE_V8HI,
V8HI_FTYPE_V16QI,
V8QI_FTYPE_V8QI,
+ V8SF_FTYPE_V8SF,
+ V8SF_FTYPE_V8SI,
+ V8SF_FTYPE_V4SF,
V4SI_FTYPE_V4SI,
V4SI_FTYPE_V16QI,
+ V4SI_FTYPE_V8SI,
V4SI_FTYPE_V8HI,
+ V4SI_FTYPE_V4DF,
V4SI_FTYPE_V4SF,
V4SI_FTYPE_V2DF,
V4HI_FTYPE_V4HI,
+ V4DF_FTYPE_V4DF,
+ V4DF_FTYPE_V4SI,
+ V4DF_FTYPE_V4SF,
+ V4DF_FTYPE_V2DF,
+ V4SF_FTYPE_V4DF,
V4SF_FTYPE_V4SF,
V4SF_FTYPE_V4SF_VEC_MERGE,
+ V4SF_FTYPE_V8SF,
V4SF_FTYPE_V4SI,
V4SF_FTYPE_V2DF,
V2DI_FTYPE_V2DI,
@@ -19161,6 +20022,7 @@ enum ix86_builtin_type
V2DF_FTYPE_V2DF,
V2DF_FTYPE_V2DF_VEC_MERGE,
V2DF_FTYPE_V4SI,
+ V2DF_FTYPE_V4DF,
V2DF_FTYPE_V4SF,
V2DF_FTYPE_V2SI,
V2SI_FTYPE_V2SI,
@@ -19178,6 +20040,8 @@ enum ix86_builtin_type
V8HI_FTYPE_V16QI_V16QI,
V8HI_FTYPE_V4SI_V4SI,
V8HI_FTYPE_V8HI_SI_COUNT,
+ V8SF_FTYPE_V8SF_V8SF,
+ V8SF_FTYPE_V8SF_V8SI,
V4SI_FTYPE_V4SI_V4SI,
V4SI_FTYPE_V4SI_V4SI_COUNT,
V4SI_FTYPE_V8HI_V8HI,
@@ -19189,8 +20053,11 @@ enum ix86_builtin_type
V4HI_FTYPE_V8QI_V8QI,
V4HI_FTYPE_V2SI_V2SI,
V4HI_FTYPE_V4HI_SI_COUNT,
+ V4DF_FTYPE_V4DF_V4DF,
+ V4DF_FTYPE_V4DF_V4DI,
V4SF_FTYPE_V4SF_V4SF,
V4SF_FTYPE_V4SF_V4SF_SWAP,
+ V4SF_FTYPE_V4SF_V4SI,
V4SF_FTYPE_V4SF_V2SI,
V4SF_FTYPE_V4SF_V2DF,
V4SF_FTYPE_V4SF_DI,
@@ -19210,6 +20077,7 @@ enum ix86_builtin_type
V2DF_FTYPE_V2DF_V2DF,
V2DF_FTYPE_V2DF_V2DF_SWAP,
V2DF_FTYPE_V2DF_V4SF,
+ V2DF_FTYPE_V2DF_V2DI,
V2DF_FTYPE_V2DF_DI,
V2DF_FTYPE_V2DF_SI,
V2SF_FTYPE_V2SF_V2SF,
@@ -19225,21 +20093,38 @@ enum ix86_builtin_type
V8HI_FTYPE_V8HI_INT,
V4SI_FTYPE_V4SI_INT,
V4HI_FTYPE_V4HI_INT,
+ V8SF_FTYPE_V8SF_INT,
+ V4SI_FTYPE_V8SI_INT,
+ V4SF_FTYPE_V8SF_INT,
+ V2DF_FTYPE_V4DF_INT,
+ V4DF_FTYPE_V4DF_INT,
V4SF_FTYPE_V4SF_INT,
V2DI_FTYPE_V2DI_INT,
V2DI2TI_FTYPE_V2DI_INT,
V2DF_FTYPE_V2DF_INT,
V16QI_FTYPE_V16QI_V16QI_V16QI,
+ V8SF_FTYPE_V8SF_V8SF_V8SF,
+ V4DF_FTYPE_V4DF_V4DF_V4DF,
V4SF_FTYPE_V4SF_V4SF_V4SF,
V2DF_FTYPE_V2DF_V2DF_V2DF,
V16QI_FTYPE_V16QI_V16QI_INT,
+ V8SI_FTYPE_V8SI_V8SI_INT,
+ V8SI_FTYPE_V8SI_V4SI_INT,
V8HI_FTYPE_V8HI_V8HI_INT,
+ V8SF_FTYPE_V8SF_V8SF_INT,
+ V8SF_FTYPE_V8SF_V4SF_INT,
V4SI_FTYPE_V4SI_V4SI_INT,
+ V4DF_FTYPE_V4DF_V4DF_INT,
+ V4DF_FTYPE_V4DF_V2DF_INT,
V4SF_FTYPE_V4SF_V4SF_INT,
V2DI_FTYPE_V2DI_V2DI_INT,
V2DI2TI_FTYPE_V2DI_V2DI_INT,
V1DI2DI_FTYPE_V1DI_V1DI_INT,
V2DF_FTYPE_V2DF_V2DF_INT,
+ V8SF_FTYPE_V8SF_V8SF_V8SI_INT,
+ V4DF_FTYPE_V4DF_V4DF_V4DI_INT,
+ V4SF_FTYPE_V4SF_V4SF_V4SI_INT,
+ V2DF_FTYPE_V2DF_V2DF_V2DI_INT,
V2DI_FTYPE_V2DI_UINT_UINT,
V2DI_FTYPE_V2DI_V2DI_UINT_UINT
};
@@ -19290,6 +20175,34 @@ static const struct builtin_description bdesc_special_args[] =
/* SSE4A */
{ OPTION_MASK_ISA_SSE4A, CODE_FOR_sse4a_vmmovntv2df, "__builtin_ia32_movntsd", IX86_BUILTIN_MOVNTSD, UNKNOWN, (int) VOID_FTYPE_PDOUBLE_V2DF },
{ OPTION_MASK_ISA_SSE4A, CODE_FOR_sse4a_vmmovntv4sf, "__builtin_ia32_movntss", IX86_BUILTIN_MOVNTSS, UNKNOWN, (int) VOID_FTYPE_PFLOAT_V4SF },
+
+ /* AVX */
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vzeroall, "__builtin_ia32_vzeroall", IX86_BUILTIN_VZEROALL, UNKNOWN, (int) VOID_FTYPE_VOID },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vzeroupper, 0, IX86_BUILTIN_VZEROUPPER, UNKNOWN, (int) VOID_FTYPE_VOID },
+ { OPTION_MASK_ISA_AVX | OPTION_MASK_ISA_64BIT, CODE_FOR_avx_vzeroupper_rex64, 0, IX86_BUILTIN_VZEROUPPER_REX64, UNKNOWN, (int) VOID_FTYPE_VOID },
+
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vbroadcastss, "__builtin_ia32_vbroadcastss", IX86_BUILTIN_VBROADCASTSS, UNKNOWN, (int) V4SF_FTYPE_PCFLOAT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vbroadcastsd256, "__builtin_ia32_vbroadcastsd256", IX86_BUILTIN_VBROADCASTSD256, UNKNOWN, (int) V4DF_FTYPE_PCDOUBLE },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vbroadcastss256, "__builtin_ia32_vbroadcastss256", IX86_BUILTIN_VBROADCASTSS256, UNKNOWN, (int) V8SF_FTYPE_PCFLOAT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vbroadcastf128_pd256, "__builtin_ia32_vbroadcastf128_pd256", IX86_BUILTIN_VBROADCASTPD256, UNKNOWN, (int) V4DF_FTYPE_PCV2DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vbroadcastf128_ps256, "__builtin_ia32_vbroadcastf128_ps256", IX86_BUILTIN_VBROADCASTPS256, UNKNOWN, (int) V8SF_FTYPE_PCV4SF },
+
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_movupd256, "__builtin_ia32_loadupd256", IX86_BUILTIN_LOADUPD256, UNKNOWN, (int) V4DF_FTYPE_PCDOUBLE },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_movups256, "__builtin_ia32_loadups256", IX86_BUILTIN_LOADUPS256, UNKNOWN, (int) V8SF_FTYPE_PCFLOAT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_movupd256, "__builtin_ia32_storeupd256", IX86_BUILTIN_STOREUPD256, UNKNOWN, (int) VOID_FTYPE_PDOUBLE_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_movups256, "__builtin_ia32_storeups256", IX86_BUILTIN_STOREUPS256, UNKNOWN, (int) VOID_FTYPE_PFLOAT_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_movdqu256, "__builtin_ia32_loaddqu256", IX86_BUILTIN_LOADDQU256, UNKNOWN, (int) V32QI_FTYPE_PCCHAR },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_movdqu256, "__builtin_ia32_storedqu256", IX86_BUILTIN_STOREDQU256, UNKNOWN, (int) VOID_FTYPE_PCHAR_V32QI },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_lddqu256, "__builtin_ia32_lddqu256", IX86_BUILTIN_LDDQU256, UNKNOWN, (int) V32QI_FTYPE_PCCHAR },
+
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadpd, "__builtin_ia32_maskloadpd", IX86_BUILTIN_MASKLOADPD, UNKNOWN, (int) V2DF_FTYPE_PCV2DF_V2DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadps, "__builtin_ia32_maskloadps", IX86_BUILTIN_MASKLOADPS, UNKNOWN, (int) V4SF_FTYPE_PCV4SF_V4SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadpd256, "__builtin_ia32_maskloadpd256", IX86_BUILTIN_MASKLOADPD256, UNKNOWN, (int) V4DF_FTYPE_PCV4DF_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskloadps256, "__builtin_ia32_maskloadps256", IX86_BUILTIN_MASKLOADPS256, UNKNOWN, (int) V8SF_FTYPE_PCV8SF_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstorepd, "__builtin_ia32_maskstorepd", IX86_BUILTIN_MASKSTOREPD, UNKNOWN, (int) VOID_FTYPE_PV2DF_V2DF_V2DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstoreps, "__builtin_ia32_maskstoreps", IX86_BUILTIN_MASKSTOREPS, UNKNOWN, (int) VOID_FTYPE_PV4SF_V4SF_V4SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstorepd256, "__builtin_ia32_maskstorepd256", IX86_BUILTIN_MASKSTOREPD256, UNKNOWN, (int) VOID_FTYPE_PV4DF_V4DF_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_maskstoreps256, "__builtin_ia32_maskstoreps256", IX86_BUILTIN_MASKSTOREPS256, UNKNOWN, (int) VOID_FTYPE_PV8SF_V8SF_V8SF },
};
/* Builtins with variable number of arguments. */
@@ -19647,6 +20560,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 },
@@ -19772,6 +20687,124 @@ static const struct builtin_description bdesc_args[] =
/* PCLMUL */
{ OPTION_MASK_ISA_SSE2, CODE_FOR_pclmulqdq, 0, IX86_BUILTIN_PCLMULQDQ128, UNKNOWN, (int) V2DI_FTYPE_V2DI_V2DI_INT },
+
+ /* AVX */
+ { OPTION_MASK_ISA_AVX, CODE_FOR_addv4df3, "__builtin_ia32_addpd256", IX86_BUILTIN_ADDPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_addv8sf3, "__builtin_ia32_addps256", IX86_BUILTIN_ADDPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_addsubv4df3, "__builtin_ia32_addsubpd256", IX86_BUILTIN_ADDSUBPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_addsubv8sf3, "__builtin_ia32_addsubps256", IX86_BUILTIN_ADDSUBPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_andv4df3, "__builtin_ia32_andpd256", IX86_BUILTIN_ANDPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_andv8sf3, "__builtin_ia32_andps256", IX86_BUILTIN_ANDPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_nandv4df3, "__builtin_ia32_andnpd256", IX86_BUILTIN_ANDNPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_nandv8sf3, "__builtin_ia32_andnps256", IX86_BUILTIN_ANDNPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_divv4df3, "__builtin_ia32_divpd256", IX86_BUILTIN_DIVPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_divv8sf3, "__builtin_ia32_divps256", IX86_BUILTIN_DIVPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_haddv4df3, "__builtin_ia32_haddpd256", IX86_BUILTIN_HADDPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_hsubv8sf3, "__builtin_ia32_hsubps256", IX86_BUILTIN_HSUBPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_hsubv4df3, "__builtin_ia32_hsubpd256", IX86_BUILTIN_HSUBPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_haddv8sf3, "__builtin_ia32_haddps256", IX86_BUILTIN_HADDPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_smaxv4df3, "__builtin_ia32_maxpd256", IX86_BUILTIN_MAXPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_smaxv8sf3, "__builtin_ia32_maxps256", IX86_BUILTIN_MAXPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_sminv4df3, "__builtin_ia32_minpd256", IX86_BUILTIN_MINPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_sminv8sf3, "__builtin_ia32_minps256", IX86_BUILTIN_MINPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_mulv4df3, "__builtin_ia32_mulpd256", IX86_BUILTIN_MULPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_mulv8sf3, "__builtin_ia32_mulps256", IX86_BUILTIN_MULPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_iorv4df3, "__builtin_ia32_orpd256", IX86_BUILTIN_ORPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_iorv8sf3, "__builtin_ia32_orps256", IX86_BUILTIN_ORPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_subv4df3, "__builtin_ia32_subpd256", IX86_BUILTIN_SUBPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_subv8sf3, "__builtin_ia32_subps256", IX86_BUILTIN_SUBPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_xorv4df3, "__builtin_ia32_xorpd256", IX86_BUILTIN_XORPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_xorv8sf3, "__builtin_ia32_xorps256", IX86_BUILTIN_XORPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF },
+
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vpermilvarv2df3, "__builtin_ia32_vpermilvarpd", IX86_BUILTIN_VPERMILVARPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DI },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vpermilvarv4sf3, "__builtin_ia32_vpermilvarps", IX86_BUILTIN_VPERMILVARPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SI },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vpermilvarv4df3, "__builtin_ia32_vpermilvarpd256", IX86_BUILTIN_VPERMILVARPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DI },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vpermilvarv8sf3, "__builtin_ia32_vpermilvarps256", IX86_BUILTIN_VPERMILVARPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SI },
+
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_blendpd256, "__builtin_ia32_blendpd256", IX86_BUILTIN_BLENDPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_blendps256, "__builtin_ia32_blendps256", IX86_BUILTIN_BLENDPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_blendvpd256, "__builtin_ia32_blendvpd256", IX86_BUILTIN_BLENDVPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_blendvps256, "__builtin_ia32_blendvps256", IX86_BUILTIN_BLENDVPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_dpps256, "__builtin_ia32_dpps256", IX86_BUILTIN_DPPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_shufpd256, "__builtin_ia32_shufpd256", IX86_BUILTIN_SHUFPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_shufps256, "__builtin_ia32_shufps256", IX86_BUILTIN_SHUFPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_cmpsdv2df3, "__builtin_ia32_cmpsd", IX86_BUILTIN_CMPSD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_cmpssv4sf3, "__builtin_ia32_cmpss", IX86_BUILTIN_CMPSS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_cmppdv2df3, "__builtin_ia32_cmppd", IX86_BUILTIN_CMPPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_cmppsv4sf3, "__builtin_ia32_cmpps", IX86_BUILTIN_CMPPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_cmppdv4df3, "__builtin_ia32_cmppd256", IX86_BUILTIN_CMPPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_cmppsv8sf3, "__builtin_ia32_cmpps256", IX86_BUILTIN_CMPPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vextractf128v4df, "__builtin_ia32_vextractf128_pd256", IX86_BUILTIN_EXTRACTF128PD256, UNKNOWN, (int) V2DF_FTYPE_V4DF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vextractf128v8sf, "__builtin_ia32_vextractf128_ps256", IX86_BUILTIN_EXTRACTF128PS256, UNKNOWN, (int) V4SF_FTYPE_V8SF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vextractf128v8si, "__builtin_ia32_vextractf128_si256", IX86_BUILTIN_EXTRACTF128SI256, UNKNOWN, (int) V4SI_FTYPE_V8SI_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_cvtdq2pd256, "__builtin_ia32_cvtdq2pd256", IX86_BUILTIN_CVTDQ2PD256, UNKNOWN, (int) V4DF_FTYPE_V4SI },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_cvtdq2ps256, "__builtin_ia32_cvtdq2ps256", IX86_BUILTIN_CVTDQ2PS256, UNKNOWN, (int) V8SF_FTYPE_V8SI },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_cvtpd2ps256, "__builtin_ia32_cvtpd2ps256", IX86_BUILTIN_CVTPD2PS256, UNKNOWN, (int) V4SF_FTYPE_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_cvtps2dq256, "__builtin_ia32_cvtps2dq256", IX86_BUILTIN_CVTPS2DQ256, UNKNOWN, (int) V8SI_FTYPE_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_cvtps2pd256, "__builtin_ia32_cvtps2pd256", IX86_BUILTIN_CVTPS2PD256, UNKNOWN, (int) V4DF_FTYPE_V4SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_cvttpd2dq256, "__builtin_ia32_cvttpd2dq256", IX86_BUILTIN_CVTTPD2DQ256, UNKNOWN, (int) V4SI_FTYPE_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_cvtpd2dq256, "__builtin_ia32_cvtpd2dq256", IX86_BUILTIN_CVTPD2DQ256, UNKNOWN, (int) V4SI_FTYPE_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_cvttps2dq256, "__builtin_ia32_cvttps2dq256", IX86_BUILTIN_CVTTPS2DQ256, UNKNOWN, (int) V8SI_FTYPE_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vperm2f128v4df3, "__builtin_ia32_vperm2f128_pd256", IX86_BUILTIN_VPERM2F128PD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vperm2f128v8sf3, "__builtin_ia32_vperm2f128_ps256", IX86_BUILTIN_VPERM2F128PS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vperm2f128v8si3, "__builtin_ia32_vperm2f128_si256", IX86_BUILTIN_VPERM2F128SI256, UNKNOWN, (int) V8SI_FTYPE_V8SI_V8SI_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vpermilv2df, "__builtin_ia32_vpermilpd", IX86_BUILTIN_VPERMILPD, UNKNOWN, (int) V2DF_FTYPE_V2DF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vpermilv4sf, "__builtin_ia32_vpermilps", IX86_BUILTIN_VPERMILPS, UNKNOWN, (int) V4SF_FTYPE_V4SF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vpermilv4df, "__builtin_ia32_vpermilpd256", IX86_BUILTIN_VPERMILPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vpermilv8sf, "__builtin_ia32_vpermilps256", IX86_BUILTIN_VPERMILPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vpermil2v2df3, "__builtin_ia32_vpermil2pd", IX86_BUILTIN_VPERMIL2PD, UNKNOWN, (int) V2DF_FTYPE_V2DF_V2DF_V2DI_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vpermil2v4sf3, "__builtin_ia32_vpermil2ps", IX86_BUILTIN_VPERMIL2PS, UNKNOWN, (int) V4SF_FTYPE_V4SF_V4SF_V4SI_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vpermil2v4df3, "__builtin_ia32_vpermil2pd256", IX86_BUILTIN_VPERMIL2PD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF_V4DI_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vpermil2v8sf3, "__builtin_ia32_vpermil2ps256", IX86_BUILTIN_VPERMIL2PS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF_V8SI_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vinsertf128v4df, "__builtin_ia32_vinsertf128_pd256", IX86_BUILTIN_VINSERTF128PD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V2DF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vinsertf128v8sf, "__builtin_ia32_vinsertf128_ps256", IX86_BUILTIN_VINSERTF128PS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V4SF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vinsertf128v8si, "__builtin_ia32_vinsertf128_si256", IX86_BUILTIN_VINSERTF128SI256, UNKNOWN, (int) V8SI_FTYPE_V8SI_V4SI_INT },
+
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_movshdup256, "__builtin_ia32_movshdup256", IX86_BUILTIN_MOVSHDUP256, UNKNOWN, (int) V8SF_FTYPE_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_movsldup256, "__builtin_ia32_movsldup256", IX86_BUILTIN_MOVSLDUP256, UNKNOWN, (int) V8SF_FTYPE_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_movddup256, "__builtin_ia32_movddup256", IX86_BUILTIN_MOVDDUP256, UNKNOWN, (int) V4DF_FTYPE_V4DF },
+
+ { OPTION_MASK_ISA_AVX, CODE_FOR_sqrtv4df2, "__builtin_ia32_sqrtpd256", IX86_BUILTIN_SQRTPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_sqrtv8sf2, "__builtin_ia32_sqrtps256", IX86_BUILTIN_SQRTPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_sqrtv8sf2, "__builtin_ia32_sqrtps_nr256", IX86_BUILTIN_SQRTPS_NR256, UNKNOWN, (int) V8SF_FTYPE_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_rsqrtv8sf2, "__builtin_ia32_rsqrtps256", IX86_BUILTIN_RSQRTPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_rsqrtv8sf2, "__builtin_ia32_rsqrtps_nr256", IX86_BUILTIN_RSQRTPS_NR256, UNKNOWN, (int) V8SF_FTYPE_V8SF },
+
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_rcpv8sf2, "__builtin_ia32_rcpps256", IX86_BUILTIN_RCPPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF },
+
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_roundpd256, "__builtin_ia32_roundpd256", IX86_BUILTIN_ROUNDPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_INT },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_roundps256, "__builtin_ia32_roundps256", IX86_BUILTIN_ROUNDPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_INT },
+
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_unpckhpd256, "__builtin_ia32_unpckhpd256", IX86_BUILTIN_UNPCKHPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_unpcklpd256, "__builtin_ia32_unpcklpd256", IX86_BUILTIN_UNPCKLPD256, UNKNOWN, (int) V4DF_FTYPE_V4DF_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_unpckhps256, "__builtin_ia32_unpckhps256", IX86_BUILTIN_UNPCKHPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_unpcklps256, "__builtin_ia32_unpcklps256", IX86_BUILTIN_UNPCKLPS256, UNKNOWN, (int) V8SF_FTYPE_V8SF_V8SF },
+
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_si256_si, "__builtin_ia32_si256_si", IX86_BUILTIN_SI256_SI, UNKNOWN, (int) V8SI_FTYPE_V4SI },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_ps256_ps, "__builtin_ia32_ps256_ps", IX86_BUILTIN_PS256_PS, UNKNOWN, (int) V8SF_FTYPE_V4SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_pd256_pd, "__builtin_ia32_pd256_pd", IX86_BUILTIN_PD256_PD, UNKNOWN, (int) V4DF_FTYPE_V2DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_si_si256, "__builtin_ia32_si_si256", IX86_BUILTIN_SI_SI256, UNKNOWN, (int) V4SI_FTYPE_V8SI },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_ps_ps256, "__builtin_ia32_ps_ps256", IX86_BUILTIN_PS_PS256, UNKNOWN, (int) V4SF_FTYPE_V8SF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_pd_pd256, "__builtin_ia32_pd_pd256", IX86_BUILTIN_PD_PD256, UNKNOWN, (int) V2DF_FTYPE_V4DF },
+
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vtestpd, "__builtin_ia32_vtestzpd", IX86_BUILTIN_VTESTZPD, EQ, (int) INT_FTYPE_V2DF_V2DF_PTEST },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vtestpd, "__builtin_ia32_vtestcpd", IX86_BUILTIN_VTESTCPD, LTU, (int) INT_FTYPE_V2DF_V2DF_PTEST },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vtestpd, "__builtin_ia32_vtestnzcpd", IX86_BUILTIN_VTESTNZCPD, GTU, (int) INT_FTYPE_V2DF_V2DF_PTEST },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vtestps, "__builtin_ia32_vtestzps", IX86_BUILTIN_VTESTZPS, EQ, (int) INT_FTYPE_V4SF_V4SF_PTEST },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vtestps, "__builtin_ia32_vtestcps", IX86_BUILTIN_VTESTCPS, LTU, (int) INT_FTYPE_V4SF_V4SF_PTEST },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vtestps, "__builtin_ia32_vtestnzcps", IX86_BUILTIN_VTESTNZCPS, GTU, (int) INT_FTYPE_V4SF_V4SF_PTEST },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vtestpd256, "__builtin_ia32_vtestzpd256", IX86_BUILTIN_VTESTZPD256, EQ, (int) INT_FTYPE_V4DF_V4DF_PTEST },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vtestpd256, "__builtin_ia32_vtestcpd256", IX86_BUILTIN_VTESTCPD256, LTU, (int) INT_FTYPE_V4DF_V4DF_PTEST },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vtestpd256, "__builtin_ia32_vtestnzcpd256", IX86_BUILTIN_VTESTNZCPD256, GTU, (int) INT_FTYPE_V4DF_V4DF_PTEST },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vtestps256, "__builtin_ia32_vtestzps256", IX86_BUILTIN_VTESTZPS256, EQ, (int) INT_FTYPE_V8SF_V8SF_PTEST },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vtestps256, "__builtin_ia32_vtestcps256", IX86_BUILTIN_VTESTCPS256, LTU, (int) INT_FTYPE_V8SF_V8SF_PTEST },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_vtestps256, "__builtin_ia32_vtestnzcps256", IX86_BUILTIN_VTESTNZCPS256, GTU, (int) INT_FTYPE_V8SF_V8SF_PTEST },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_ptest256, "__builtin_ia32_ptestz256", IX86_BUILTIN_PTESTZ256, EQ, (int) INT_FTYPE_V4DI_V4DI_PTEST },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_ptest256, "__builtin_ia32_ptestc256", IX86_BUILTIN_PTESTC256, LTU, (int) INT_FTYPE_V4DI_V4DI_PTEST },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_ptest256, "__builtin_ia32_ptestnzc256", IX86_BUILTIN_PTESTNZC256, GTU, (int) INT_FTYPE_V4DI_V4DI_PTEST },
+
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_movmskpd256, "__builtin_ia32_movmskpd256", IX86_BUILTIN_MOVMSKPD256, UNKNOWN, (int) INT_FTYPE_V4DF },
+ { OPTION_MASK_ISA_AVX, CODE_FOR_avx_movmskps256, "__builtin_ia32_movmskps256", IX86_BUILTIN_MOVMSKPS256, UNKNOWN, (int) INT_FTYPE_V8SF },
};
/* SSE5 */
@@ -19843,7 +20876,7 @@ static const struct builtin_description bdesc_multi_arg[] =
{ OPTION_MASK_ISA_SSE5, CODE_FOR_sse5i_vmfnmsubv2df4, "__builtin_ia32_fnmsubsd", IX86_BUILTIN_FNMSUBSD, 0, (int)MULTI_ARG_3_DF },
{ OPTION_MASK_ISA_SSE5, CODE_FOR_sse5i_fnmsubv4sf4, "__builtin_ia32_fnmsubps", IX86_BUILTIN_FNMSUBPS, 0, (int)MULTI_ARG_3_SF },
{ OPTION_MASK_ISA_SSE5, CODE_FOR_sse5i_fnmsubv2df4, "__builtin_ia32_fnmsubpd", IX86_BUILTIN_FNMSUBPD, 0, (int)MULTI_ARG_3_DF },
- { OPTION_MASK_ISA_SSE5, CODE_FOR_sse5_pcmov_v2di, "__builtin_ia32_pcmov", IX86_BUILTIN_PCMOV_V2DI, 0, (int)MULTI_ARG_3_DI },
+ { OPTION_MASK_ISA_SSE5, CODE_FOR_sse5_pcmov_v2di, "__builtin_ia32_pcmov", IX86_BUILTIN_PCMOV, 0, (int)MULTI_ARG_3_DI },
{ OPTION_MASK_ISA_SSE5, CODE_FOR_sse5_pcmov_v2di, "__builtin_ia32_pcmov_v2di", IX86_BUILTIN_PCMOV_V2DI, 0, (int)MULTI_ARG_3_DI },
{ OPTION_MASK_ISA_SSE5, CODE_FOR_sse5_pcmov_v4si, "__builtin_ia32_pcmov_v4si", IX86_BUILTIN_PCMOV_V4SI, 0, (int)MULTI_ARG_3_SI },
{ OPTION_MASK_ISA_SSE5, CODE_FOR_sse5_pcmov_v8hi, "__builtin_ia32_pcmov_v8hi", IX86_BUILTIN_PCMOV_V8HI, 0, (int)MULTI_ARG_3_HI },
@@ -20568,6 +21601,276 @@ ix86_init_mmx_sse_builtins (void)
float_type_node,
NULL_TREE);
+ /* AVX builtins */
+ tree V32QI_type_node = build_vector_type_for_mode (char_type_node,
+ V32QImode);
+ tree V8SI_type_node = build_vector_type_for_mode (intSI_type_node,
+ V8SImode);
+ tree V8SF_type_node = build_vector_type_for_mode (float_type_node,
+ V8SFmode);
+ tree V4DI_type_node = build_vector_type_for_mode (long_long_integer_type_node,
+ V4DImode);
+ tree V4DF_type_node = build_vector_type_for_mode (double_type_node,
+ V4DFmode);
+ tree v8sf_ftype_v8sf
+ = build_function_type_list (V8SF_type_node,
+ V8SF_type_node,
+ NULL_TREE);
+ tree v8si_ftype_v8sf
+ = build_function_type_list (V8SI_type_node,
+ V8SF_type_node,
+ NULL_TREE);
+ tree v8sf_ftype_v8si
+ = build_function_type_list (V8SF_type_node,
+ V8SI_type_node,
+ NULL_TREE);
+ tree v4si_ftype_v4df
+ = build_function_type_list (V4SI_type_node,
+ V4DF_type_node,
+ NULL_TREE);
+ tree v4df_ftype_v4df
+ = build_function_type_list (V4DF_type_node,
+ V4DF_type_node,
+ NULL_TREE);
+ tree v4df_ftype_v4si
+ = build_function_type_list (V4DF_type_node,
+ V4SI_type_node,
+ NULL_TREE);
+ tree v4df_ftype_v4sf
+ = build_function_type_list (V4DF_type_node,
+ V4SF_type_node,
+ NULL_TREE);
+ tree v4sf_ftype_v4df
+ = build_function_type_list (V4SF_type_node,
+ V4DF_type_node,
+ NULL_TREE);
+ tree v8sf_ftype_v8sf_v8sf
+ = build_function_type_list (V8SF_type_node,
+ V8SF_type_node, V8SF_type_node,
+ NULL_TREE);
+ tree v4df_ftype_v4df_v4df
+ = build_function_type_list (V4DF_type_node,
+ V4DF_type_node, V4DF_type_node,
+ NULL_TREE);
+ tree v8sf_ftype_v8sf_int
+ = build_function_type_list (V8SF_type_node,
+ V8SF_type_node, integer_type_node,
+ NULL_TREE);
+ tree v4si_ftype_v8si_int
+ = build_function_type_list (V4SI_type_node,
+ V8SI_type_node, integer_type_node,
+ NULL_TREE);
+ tree v4df_ftype_v4df_int
+ = build_function_type_list (V4DF_type_node,
+ V4DF_type_node, integer_type_node,
+ NULL_TREE);
+ tree v4sf_ftype_v8sf_int
+ = build_function_type_list (V4SF_type_node,
+ V8SF_type_node, integer_type_node,
+ NULL_TREE);
+ tree v2df_ftype_v4df_int
+ = build_function_type_list (V2DF_type_node,
+ V4DF_type_node, integer_type_node,
+ NULL_TREE);
+ tree v8sf_ftype_v8sf_v8sf_int
+ = build_function_type_list (V8SF_type_node,
+ V8SF_type_node, V8SF_type_node,
+ integer_type_node,
+ NULL_TREE);
+ tree v8sf_ftype_v8sf_v8sf_v8sf
+ = build_function_type_list (V8SF_type_node,
+ V8SF_type_node, V8SF_type_node,
+ V8SF_type_node,
+ NULL_TREE);
+ tree v4df_ftype_v4df_v4df_v4df
+ = build_function_type_list (V4DF_type_node,
+ V4DF_type_node, V4DF_type_node,
+ V4DF_type_node,
+ NULL_TREE);
+ tree v8si_ftype_v8si_v8si_int
+ = build_function_type_list (V8SI_type_node,
+ V8SI_type_node, V8SI_type_node,
+ integer_type_node,
+ NULL_TREE);
+ tree v4df_ftype_v4df_v4df_int
+ = build_function_type_list (V4DF_type_node,
+ V4DF_type_node, V4DF_type_node,
+ integer_type_node,
+ NULL_TREE);
+ tree v8sf_ftype_v8sf_v8sf_v8si_int
+ = build_function_type_list (V8SF_type_node,
+ V8SF_type_node, V8SF_type_node,
+ V8SI_type_node, integer_type_node,
+ NULL_TREE);
+ tree v4df_ftype_v4df_v4df_v4di_int
+ = build_function_type_list (V4DF_type_node,
+ V4DF_type_node, V4DF_type_node,
+ V4DI_type_node, integer_type_node,
+ NULL_TREE);
+ tree v4sf_ftype_v4sf_v4sf_v4si_int
+ = build_function_type_list (V4SF_type_node,
+ V4SF_type_node, V4SF_type_node,
+ V4SI_type_node, integer_type_node,
+ NULL_TREE);
+ tree v2df_ftype_v2df_v2df_v2di_int
+ = build_function_type_list (V2DF_type_node,
+ V2DF_type_node, V2DF_type_node,
+ V2DI_type_node, integer_type_node,
+ NULL_TREE);
+ tree v8sf_ftype_pcfloat
+ = build_function_type_list (V8SF_type_node,
+ pcfloat_type_node,
+ NULL_TREE);
+ tree v4df_ftype_pcdouble
+ = build_function_type_list (V4DF_type_node,
+ pcdouble_type_node,
+ NULL_TREE);
+ tree pcv4sf_type_node
+ = build_pointer_type (build_type_variant (V4SF_type_node, 1, 0));
+ tree pcv2df_type_node
+ = build_pointer_type (build_type_variant (V2DF_type_node, 1, 0));
+ tree v8sf_ftype_pcv4sf
+ = build_function_type_list (V8SF_type_node,
+ pcv4sf_type_node,
+ NULL_TREE);
+ tree v4df_ftype_pcv2df
+ = build_function_type_list (V4DF_type_node,
+ pcv2df_type_node,
+ NULL_TREE);
+ tree v32qi_ftype_pcchar
+ = build_function_type_list (V32QI_type_node,
+ pcchar_type_node,
+ NULL_TREE);
+ tree void_ftype_pchar_v32qi
+ = build_function_type_list (void_type_node,
+ pchar_type_node, V32QI_type_node,
+ NULL_TREE);
+ tree v8si_ftype_v8si_v4si_int
+ = build_function_type_list (V8SI_type_node,
+ V8SI_type_node, V4SI_type_node,
+ integer_type_node,
+ NULL_TREE);
+ tree v8sf_ftype_v8sf_v4sf_int
+ = build_function_type_list (V8SF_type_node,
+ V8SF_type_node, V4SF_type_node,
+ integer_type_node,
+ NULL_TREE);
+ tree v4df_ftype_v4df_v2df_int
+ = build_function_type_list (V4DF_type_node,
+ V4DF_type_node, V2DF_type_node,
+ integer_type_node,
+ NULL_TREE);
+ tree void_ftype_pfloat_v8sf
+ = build_function_type_list (void_type_node,
+ pfloat_type_node, V8SF_type_node,
+ NULL_TREE);
+ tree void_ftype_pdouble_v4df
+ = build_function_type_list (void_type_node,
+ pdouble_type_node, V4DF_type_node,
+ NULL_TREE);
+ tree pv8sf_type_node = build_pointer_type (V8SF_type_node);
+ tree pv4sf_type_node = build_pointer_type (V4SF_type_node);
+ tree pv4df_type_node = build_pointer_type (V4DF_type_node);
+ tree pv2df_type_node = build_pointer_type (V2DF_type_node);
+ tree pcv8sf_type_node
+ = build_pointer_type (build_type_variant (V8SF_type_node, 1, 0));
+ tree pcv4df_type_node
+ = build_pointer_type (build_type_variant (V4DF_type_node, 1, 0));
+ tree v8sf_ftype_pcv8sf_v8sf
+ = build_function_type_list (V8SF_type_node,
+ pcv8sf_type_node, V8SF_type_node,
+ NULL_TREE);
+ tree v4df_ftype_pcv4df_v4df
+ = build_function_type_list (V4DF_type_node,
+ pcv4df_type_node, V4DF_type_node,
+ NULL_TREE);
+ tree v4sf_ftype_pcv4sf_v4sf
+ = build_function_type_list (V4SF_type_node,
+ pcv4sf_type_node, V4SF_type_node,
+ NULL_TREE);
+ tree v2df_ftype_pcv2df_v2df
+ = build_function_type_list (V2DF_type_node,
+ pcv2df_type_node, V2DF_type_node,
+ NULL_TREE);
+ tree void_ftype_pv8sf_v8sf_v8sf
+ = build_function_type_list (void_type_node,
+ pv8sf_type_node, V8SF_type_node,
+ V8SF_type_node,
+ NULL_TREE);
+ tree void_ftype_pv4df_v4df_v4df
+ = build_function_type_list (void_type_node,
+ pv4df_type_node, V4DF_type_node,
+ V4DF_type_node,
+ NULL_TREE);
+ tree void_ftype_pv4sf_v4sf_v4sf
+ = build_function_type_list (void_type_node,
+ pv4sf_type_node, V4SF_type_node,
+ V4SF_type_node,
+ NULL_TREE);
+ tree void_ftype_pv2df_v2df_v2df
+ = build_function_type_list (void_type_node,
+ pv2df_type_node, V2DF_type_node,
+ V2DF_type_node,
+ NULL_TREE);
+ tree v4df_ftype_v2df
+ = build_function_type_list (V4DF_type_node,
+ V2DF_type_node,
+ NULL_TREE);
+ tree v8sf_ftype_v4sf
+ = build_function_type_list (V8SF_type_node,
+ V4SF_type_node,
+ NULL_TREE);
+ tree v8si_ftype_v4si
+ = build_function_type_list (V8SI_type_node,
+ V4SI_type_node,
+ NULL_TREE);
+ tree v2df_ftype_v4df
+ = build_function_type_list (V2DF_type_node,
+ V4DF_type_node,
+ NULL_TREE);
+ tree v4sf_ftype_v8sf
+ = build_function_type_list (V4SF_type_node,
+ V8SF_type_node,
+ NULL_TREE);
+ tree v4si_ftype_v8si
+ = build_function_type_list (V4SI_type_node,
+ V8SI_type_node,
+ NULL_TREE);
+ tree int_ftype_v4df
+ = build_function_type_list (integer_type_node,
+ V4DF_type_node,
+ NULL_TREE);
+ tree int_ftype_v8sf
+ = build_function_type_list (integer_type_node,
+ V8SF_type_node,
+ NULL_TREE);
+ tree int_ftype_v8sf_v8sf
+ = build_function_type_list (integer_type_node,
+ V8SF_type_node, V8SF_type_node,
+ NULL_TREE);
+ tree int_ftype_v4di_v4di
+ = build_function_type_list (integer_type_node,
+ V4DI_type_node, V4DI_type_node,
+ NULL_TREE);
+ tree int_ftype_v4df_v4df
+ = build_function_type_list (integer_type_node,
+ V4DF_type_node, V4DF_type_node,
+ NULL_TREE);
+ tree v8sf_ftype_v8sf_v8si
+ = build_function_type_list (V8SF_type_node,
+ V8SF_type_node, V8SI_type_node,
+ NULL_TREE);
+ tree v4df_ftype_v4df_v4di
+ = build_function_type_list (V4DF_type_node,
+ V4DF_type_node, V4DI_type_node,
+ NULL_TREE);
+ tree v4sf_ftype_v4sf_v4si
+ = build_function_type_list (V4SF_type_node,
+ V4SF_type_node, V4SI_type_node, NULL_TREE);
+ tree v2df_ftype_v2df_v2di
+ = build_function_type_list (V2DF_type_node,
+ V2DF_type_node, V2DI_type_node, NULL_TREE);
+
tree ftype;
/* Add all special builtins with variable number of operands. */
@@ -20585,9 +21888,24 @@ ix86_init_mmx_sse_builtins (void)
case VOID_FTYPE_VOID:
type = void_ftype_void;
break;
+ case V32QI_FTYPE_PCCHAR:
+ type = v32qi_ftype_pcchar;
+ break;
case V16QI_FTYPE_PCCHAR:
type = v16qi_ftype_pcchar;
break;
+ case V8SF_FTYPE_PCV4SF:
+ type = v8sf_ftype_pcv4sf;
+ break;
+ case V8SF_FTYPE_PCFLOAT:
+ type = v8sf_ftype_pcfloat;
+ break;
+ case V4DF_FTYPE_PCV2DF:
+ type = v4df_ftype_pcv2df;
+ break;
+ case V4DF_FTYPE_PCDOUBLE:
+ type = v4df_ftype_pcdouble;
+ break;
case V4SF_FTYPE_PCFLOAT:
type = v4sf_ftype_pcfloat;
break;
@@ -20597,24 +21915,45 @@ ix86_init_mmx_sse_builtins (void)
case V2DF_FTYPE_PCDOUBLE:
type = v2df_ftype_pcdouble;
break;
+ case V8SF_FTYPE_PCV8SF_V8SF:
+ type = v8sf_ftype_pcv8sf_v8sf;
+ break;
+ case V4DF_FTYPE_PCV4DF_V4DF:
+ type = v4df_ftype_pcv4df_v4df;
+ break;
case V4SF_FTYPE_V4SF_PCV2SF:
type = v4sf_ftype_v4sf_pcv2sf;
break;
+ case V4SF_FTYPE_PCV4SF_V4SF:
+ type = v4sf_ftype_pcv4sf_v4sf;
+ break;
case V2DF_FTYPE_V2DF_PCDOUBLE:
type = v2df_ftype_v2df_pcdouble;
break;
+ case V2DF_FTYPE_PCV2DF_V2DF:
+ type = v2df_ftype_pcv2df_v2df;
+ break;
case VOID_FTYPE_PV2SF_V4SF:
type = void_ftype_pv2sf_v4sf;
break;
case VOID_FTYPE_PV2DI_V2DI:
type = void_ftype_pv2di_v2di;
break;
+ case VOID_FTYPE_PCHAR_V32QI:
+ type = void_ftype_pchar_v32qi;
+ break;
case VOID_FTYPE_PCHAR_V16QI:
type = void_ftype_pchar_v16qi;
break;
+ case VOID_FTYPE_PFLOAT_V8SF:
+ type = void_ftype_pfloat_v8sf;
+ break;
case VOID_FTYPE_PFLOAT_V4SF:
type = void_ftype_pfloat_v4sf;
break;
+ case VOID_FTYPE_PDOUBLE_V4DF:
+ type = void_ftype_pdouble_v4df;
+ break;
case VOID_FTYPE_PDOUBLE_V2DF:
type = void_ftype_pdouble_v2df;
break;
@@ -20624,6 +21963,18 @@ ix86_init_mmx_sse_builtins (void)
case VOID_FTYPE_PINT_INT:
type = void_ftype_pint_int;
break;
+ case VOID_FTYPE_PV8SF_V8SF_V8SF:
+ type = void_ftype_pv8sf_v8sf_v8sf;
+ break;
+ case VOID_FTYPE_PV4DF_V4DF_V4DF:
+ type = void_ftype_pv4df_v4df_v4df;
+ break;
+ case VOID_FTYPE_PV4SF_V4SF_V4SF:
+ type = void_ftype_pv4sf_v4sf_v4sf;
+ break;
+ case VOID_FTYPE_PV2DF_V2DF_V2DF:
+ type = void_ftype_pv2df_v2df_v2df;
+ break;
default:
gcc_unreachable ();
}
@@ -20646,9 +21997,24 @@ ix86_init_mmx_sse_builtins (void)
case FLOAT_FTYPE_FLOAT:
type = float_ftype_float;
break;
+ case INT_FTYPE_V8SF_V8SF_PTEST:
+ type = int_ftype_v8sf_v8sf;
+ break;
+ case INT_FTYPE_V4DI_V4DI_PTEST:
+ type = int_ftype_v4di_v4di;
+ break;
+ case INT_FTYPE_V4DF_V4DF_PTEST:
+ type = int_ftype_v4df_v4df;
+ break;
+ case INT_FTYPE_V4SF_V4SF_PTEST:
+ type = int_ftype_v4sf_v4sf;
+ break;
case INT_FTYPE_V2DI_V2DI_PTEST:
type = int_ftype_v2di_v2di;
break;
+ case INT_FTYPE_V2DF_V2DF_PTEST:
+ type = int_ftype_v2df_v2df;
+ break;
case INT64_FTYPE_V4SF:
type = int64_ftype_v4sf;
break;
@@ -20661,6 +22027,12 @@ ix86_init_mmx_sse_builtins (void)
case INT_FTYPE_V8QI:
type = int_ftype_v8qi;
break;
+ case INT_FTYPE_V8SF:
+ type = int_ftype_v8sf;
+ break;
+ case INT_FTYPE_V4DF:
+ type = int_ftype_v4df;
+ break;
case INT_FTYPE_V4SF:
type = int_ftype_v4sf;
break;
@@ -20670,6 +22042,12 @@ ix86_init_mmx_sse_builtins (void)
case V16QI_FTYPE_V16QI:
type = v16qi_ftype_v16qi;
break;
+ case V8SI_FTYPE_V8SF:
+ type = v8si_ftype_v8sf;
+ break;
+ case V8SI_FTYPE_V4SI:
+ type = v8si_ftype_v4si;
+ break;
case V8HI_FTYPE_V8HI:
type = v8hi_ftype_v8hi;
break;
@@ -20679,12 +22057,27 @@ ix86_init_mmx_sse_builtins (void)
case V8QI_FTYPE_V8QI:
type = v8qi_ftype_v8qi;
break;
+ case V8SF_FTYPE_V8SF:
+ type = v8sf_ftype_v8sf;
+ break;
+ case V8SF_FTYPE_V8SI:
+ type = v8sf_ftype_v8si;
+ break;
+ case V8SF_FTYPE_V4SF:
+ type = v8sf_ftype_v4sf;
+ break;
+ case V4SI_FTYPE_V4DF:
+ type = v4si_ftype_v4df;
+ break;
case V4SI_FTYPE_V4SI:
type = v4si_ftype_v4si;
break;
case V4SI_FTYPE_V16QI:
type = v4si_ftype_v16qi;
break;
+ case V4SI_FTYPE_V8SI:
+ type = v4si_ftype_v8si;
+ break;
case V4SI_FTYPE_V8HI:
type = v4si_ftype_v8hi;
break;
@@ -20697,13 +22090,31 @@ ix86_init_mmx_sse_builtins (void)
case V4HI_FTYPE_V4HI:
type = v4hi_ftype_v4hi;
break;
+ case V4DF_FTYPE_V4DF:
+ type = v4df_ftype_v4df;
+ break;
+ case V4DF_FTYPE_V4SI:
+ type = v4df_ftype_v4si;
+ break;
+ case V4DF_FTYPE_V4SF:
+ type = v4df_ftype_v4sf;
+ break;
+ case V4DF_FTYPE_V2DF:
+ type = v4df_ftype_v2df;
+ break;
case V4SF_FTYPE_V4SF:
case V4SF_FTYPE_V4SF_VEC_MERGE:
type = v4sf_ftype_v4sf;
break;
+ case V4SF_FTYPE_V8SF:
+ type = v4sf_ftype_v8sf;
+ break;
case V4SF_FTYPE_V4SI:
type = v4sf_ftype_v4si;
break;
+ case V4SF_FTYPE_V4DF:
+ type = v4sf_ftype_v4df;
+ break;
case V4SF_FTYPE_V2DF:
type = v4sf_ftype_v2df;
break;
@@ -20731,6 +22142,9 @@ ix86_init_mmx_sse_builtins (void)
case V2SI_FTYPE_V2SF:
type = v2si_ftype_v2sf;
break;
+ case V2DF_FTYPE_V4DF:
+ type = v2df_ftype_v4df;
+ break;
case V2DF_FTYPE_V4SF:
type = v2df_ftype_v4sf;
break;
@@ -20775,6 +22189,12 @@ ix86_init_mmx_sse_builtins (void)
case V8HI_FTYPE_V8HI_SI_COUNT:
type = v8hi_ftype_v8hi_int;
break;
+ case V8SF_FTYPE_V8SF_V8SF:
+ type = v8sf_ftype_v8sf_v8sf;
+ break;
+ case V8SF_FTYPE_V8SF_V8SI:
+ type = v8sf_ftype_v8sf_v8si;
+ break;
case V4SI_FTYPE_V4SI_V4SI:
case V4SI_FTYPE_V4SI_V4SI_COUNT:
type = v4si_ftype_v4si_v4si;
@@ -20804,10 +22224,19 @@ ix86_init_mmx_sse_builtins (void)
case V4HI_FTYPE_V4HI_SI_COUNT:
type = v4hi_ftype_v4hi_int;
break;
+ case V4DF_FTYPE_V4DF_V4DF:
+ type = v4df_ftype_v4df_v4df;
+ break;
+ case V4DF_FTYPE_V4DF_V4DI:
+ type = v4df_ftype_v4df_v4di;
+ break;
case V4SF_FTYPE_V4SF_V4SF:
case V4SF_FTYPE_V4SF_V4SF_SWAP:
type = v4sf_ftype_v4sf_v4sf;
break;
+ case V4SF_FTYPE_V4SF_V4SI:
+ type = v4sf_ftype_v4sf_v4si;
+ break;
case V4SF_FTYPE_V4SF_V2SI:
type = v4sf_ftype_v4sf_v2si;
break;
@@ -20859,6 +22288,9 @@ ix86_init_mmx_sse_builtins (void)
case V2DF_FTYPE_V2DF_V4SF:
type = v2df_ftype_v2df_v4sf;
break;
+ case V2DF_FTYPE_V2DF_V2DI:
+ type = v2df_ftype_v2df_v2di;
+ break;
case V2DF_FTYPE_V2DF_DI:
type = v2df_ftype_v2df_int64;
break;
@@ -20896,15 +22328,27 @@ ix86_init_mmx_sse_builtins (void)
case V8HI_FTYPE_V8HI_INT:
type = v8hi_ftype_v8hi_int;
break;
+ case V8SF_FTYPE_V8SF_INT:
+ type = v8sf_ftype_v8sf_int;
+ break;
case V4SI_FTYPE_V4SI_INT:
type = v4si_ftype_v4si_int;
break;
+ case V4SI_FTYPE_V8SI_INT:
+ type = v4si_ftype_v8si_int;
+ break;
case V4HI_FTYPE_V4HI_INT:
type = v4hi_ftype_v4hi_int;
break;
+ case V4DF_FTYPE_V4DF_INT:
+ type = v4df_ftype_v4df_int;
+ break;
case V4SF_FTYPE_V4SF_INT:
type = v4sf_ftype_v4sf_int;
break;
+ case V4SF_FTYPE_V8SF_INT:
+ type = v4sf_ftype_v8sf_int;
+ break;
case V2DI_FTYPE_V2DI_INT:
case V2DI2TI_FTYPE_V2DI_INT:
type = v2di_ftype_v2di_int;
@@ -20912,9 +22356,18 @@ ix86_init_mmx_sse_builtins (void)
case V2DF_FTYPE_V2DF_INT:
type = v2df_ftype_v2df_int;
break;
+ case V2DF_FTYPE_V4DF_INT:
+ type = v2df_ftype_v4df_int;
+ break;
case V16QI_FTYPE_V16QI_V16QI_V16QI:
type = v16qi_ftype_v16qi_v16qi_v16qi;
break;
+ case V8SF_FTYPE_V8SF_V8SF_V8SF:
+ type = v8sf_ftype_v8sf_v8sf_v8sf;
+ break;
+ case V4DF_FTYPE_V4DF_V4DF_V4DF:
+ type = v4df_ftype_v4df_v4df_v4df;
+ break;
case V4SF_FTYPE_V4SF_V4SF_V4SF:
type = v4sf_ftype_v4sf_v4sf_v4sf;
break;
@@ -20924,12 +22377,30 @@ ix86_init_mmx_sse_builtins (void)
case V16QI_FTYPE_V16QI_V16QI_INT:
type = v16qi_ftype_v16qi_v16qi_int;
break;
+ case V8SI_FTYPE_V8SI_V8SI_INT:
+ type = v8si_ftype_v8si_v8si_int;
+ break;
+ case V8SI_FTYPE_V8SI_V4SI_INT:
+ type = v8si_ftype_v8si_v4si_int;
+ break;
case V8HI_FTYPE_V8HI_V8HI_INT:
type = v8hi_ftype_v8hi_v8hi_int;
break;
+ case V8SF_FTYPE_V8SF_V8SF_INT:
+ type = v8sf_ftype_v8sf_v8sf_int;
+ break;
+ case V8SF_FTYPE_V8SF_V4SF_INT:
+ type = v8sf_ftype_v8sf_v4sf_int;
+ break;
case V4SI_FTYPE_V4SI_V4SI_INT:
type = v4si_ftype_v4si_v4si_int;
break;
+ case V4DF_FTYPE_V4DF_V4DF_INT:
+ type = v4df_ftype_v4df_v4df_int;
+ break;
+ case V4DF_FTYPE_V4DF_V2DF_INT:
+ type = v4df_ftype_v4df_v2df_int;
+ break;
case V4SF_FTYPE_V4SF_V4SF_INT:
type = v4sf_ftype_v4sf_v4sf_int;
break;
@@ -20949,6 +22420,18 @@ ix86_init_mmx_sse_builtins (void)
case V1DI2DI_FTYPE_V1DI_V1DI_INT:
type = v1di_ftype_v1di_v1di_int;
break;
+ case V8SF_FTYPE_V8SF_V8SF_V8SI_INT:
+ type = v8sf_ftype_v8sf_v8sf_v8si_int;
+ break;
+ case V4DF_FTYPE_V4DF_V4DF_V4DI_INT:
+ type = v4df_ftype_v4df_v4df_v4di_int;
+ break;
+ case V4SF_FTYPE_V4SF_V4SF_V4SI_INT:
+ type = v4sf_ftype_v4sf_v4sf_v4si_int;
+ break;
+ case V2DF_FTYPE_V2DF_V2DF_V2DI_INT:
+ type = v2df_ftype_v2df_v2df_v2di_int;
+ break;
default:
gcc_unreachable ();
}
@@ -21015,6 +22498,10 @@ ix86_init_mmx_sse_builtins (void)
/* PCLMUL */
def_builtin_const (OPTION_MASK_ISA_PCLMUL, "__builtin_ia32_pclmulqdq128", v2di_ftype_v2di_v2di_int, IX86_BUILTIN_PCLMULQDQ128);
+ /* AVX */
+ def_builtin (OPTION_MASK_ISA_AVX, "__builtin_ia32_vzeroupper", void_ftype_void,
+ TARGET_64BIT ? IX86_BUILTIN_VZEROUPPER_REX64 : IX86_BUILTIN_VZEROUPPER);
+
/* Access to the vec_init patterns. */
ftype = build_function_type_list (V2SI_type_node, integer_type_node,
integer_type_node, NULL_TREE);
@@ -21915,7 +23402,12 @@ ix86_expand_args_builtin (const struct builtin_description *d,
switch ((enum ix86_builtin_type) d->flag)
{
+ case INT_FTYPE_V8SF_V8SF_PTEST:
+ case INT_FTYPE_V4DI_V4DI_PTEST:
+ case INT_FTYPE_V4DF_V4DF_PTEST:
+ case INT_FTYPE_V4SF_V4SF_PTEST:
case INT_FTYPE_V2DI_V2DI_PTEST:
+ case INT_FTYPE_V2DF_V2DF_PTEST:
return ix86_expand_sse_ptest (d, exp, target);
case FLOAT128_FTYPE_FLOAT128:
case FLOAT_FTYPE_FLOAT:
@@ -21923,20 +23415,35 @@ ix86_expand_args_builtin (const struct builtin_description *d,
case INT64_FTYPE_V2DF:
case INT_FTYPE_V16QI:
case INT_FTYPE_V8QI:
+ case INT_FTYPE_V8SF:
+ case INT_FTYPE_V4DF:
case INT_FTYPE_V4SF:
case INT_FTYPE_V2DF:
case V16QI_FTYPE_V16QI:
+ case V8SI_FTYPE_V8SF:
+ case V8SI_FTYPE_V4SI:
case V8HI_FTYPE_V8HI:
case V8HI_FTYPE_V16QI:
case V8QI_FTYPE_V8QI:
+ case V8SF_FTYPE_V8SF:
+ case V8SF_FTYPE_V8SI:
+ case V8SF_FTYPE_V4SF:
case V4SI_FTYPE_V4SI:
case V4SI_FTYPE_V16QI:
case V4SI_FTYPE_V4SF:
+ case V4SI_FTYPE_V8SI:
case V4SI_FTYPE_V8HI:
+ case V4SI_FTYPE_V4DF:
case V4SI_FTYPE_V2DF:
case V4HI_FTYPE_V4HI:
+ case V4DF_FTYPE_V4DF:
+ case V4DF_FTYPE_V4SI:
+ case V4DF_FTYPE_V4SF:
+ case V4DF_FTYPE_V2DF:
case V4SF_FTYPE_V4SF:
case V4SF_FTYPE_V4SI:
+ case V4SF_FTYPE_V8SF:
+ case V4SF_FTYPE_V4DF:
case V4SF_FTYPE_V2DF:
case V2DI_FTYPE_V2DI:
case V2DI_FTYPE_V16QI:
@@ -21944,6 +23451,7 @@ ix86_expand_args_builtin (const struct builtin_description *d,
case V2DI_FTYPE_V4SI:
case V2DF_FTYPE_V2DF:
case V2DF_FTYPE_V4SI:
+ case V2DF_FTYPE_V4DF:
case V2DF_FTYPE_V4SF:
case V2DF_FTYPE_V2SI:
case V2SI_FTYPE_V2SI:
@@ -21965,6 +23473,8 @@ ix86_expand_args_builtin (const struct builtin_description *d,
case V8HI_FTYPE_V8HI_V8HI:
case V8HI_FTYPE_V16QI_V16QI:
case V8HI_FTYPE_V4SI_V4SI:
+ case V8SF_FTYPE_V8SF_V8SF:
+ case V8SF_FTYPE_V8SF_V8SI:
case V4SI_FTYPE_V4SI_V4SI:
case V4SI_FTYPE_V8HI_V8HI:
case V4SI_FTYPE_V4SF_V4SF:
@@ -21972,7 +23482,10 @@ ix86_expand_args_builtin (const struct builtin_description *d,
case V4HI_FTYPE_V4HI_V4HI:
case V4HI_FTYPE_V8QI_V8QI:
case V4HI_FTYPE_V2SI_V2SI:
+ case V4DF_FTYPE_V4DF_V4DF:
+ case V4DF_FTYPE_V4DF_V4DI:
case V4SF_FTYPE_V4SF_V4SF:
+ case V4SF_FTYPE_V4SF_V4SI:
case V4SF_FTYPE_V4SF_V2SI:
case V4SF_FTYPE_V4SF_V2DF:
case V4SF_FTYPE_V4SF_DI:
@@ -21987,6 +23500,7 @@ ix86_expand_args_builtin (const struct builtin_description *d,
case V2SI_FTYPE_V2SF_V2SF:
case V2DF_FTYPE_V2DF_V2DF:
case V2DF_FTYPE_V2DF_V4SF:
+ case V2DF_FTYPE_V2DF_V2DI:
case V2DF_FTYPE_V2DF_DI:
case V2DF_FTYPE_V2DF_SI:
case V2SF_FTYPE_V2SF_V2SF:
@@ -22030,22 +23544,35 @@ ix86_expand_args_builtin (const struct builtin_description *d,
nargs_constant = 1;
break;
case V8HI_FTYPE_V8HI_INT:
+ case V8SF_FTYPE_V8SF_INT:
case V4SI_FTYPE_V4SI_INT:
+ case V4SI_FTYPE_V8SI_INT:
case V4HI_FTYPE_V4HI_INT:
+ case V4DF_FTYPE_V4DF_INT:
case V4SF_FTYPE_V4SF_INT:
+ case V4SF_FTYPE_V8SF_INT:
case V2DI_FTYPE_V2DI_INT:
case V2DF_FTYPE_V2DF_INT:
+ case V2DF_FTYPE_V4DF_INT:
nargs = 2;
nargs_constant = 1;
break;
case V16QI_FTYPE_V16QI_V16QI_V16QI:
+ case V8SF_FTYPE_V8SF_V8SF_V8SF:
+ case V4DF_FTYPE_V4DF_V4DF_V4DF:
case V4SF_FTYPE_V4SF_V4SF_V4SF:
case V2DF_FTYPE_V2DF_V2DF_V2DF:
nargs = 3;
break;
case V16QI_FTYPE_V16QI_V16QI_INT:
case V8HI_FTYPE_V8HI_V8HI_INT:
+ case V8SI_FTYPE_V8SI_V8SI_INT:
+ case V8SI_FTYPE_V8SI_V4SI_INT:
+ case V8SF_FTYPE_V8SF_V8SF_INT:
+ case V8SF_FTYPE_V8SF_V4SF_INT:
case V4SI_FTYPE_V4SI_V4SI_INT:
+ case V4DF_FTYPE_V4DF_V4DF_INT:
+ case V4DF_FTYPE_V4DF_V2DF_INT:
case V4SF_FTYPE_V4SF_V4SF_INT:
case V2DI_FTYPE_V2DI_V2DI_INT:
case V2DF_FTYPE_V2DF_V2DF_INT:
@@ -22066,6 +23593,13 @@ ix86_expand_args_builtin (const struct builtin_description *d,
nargs = 3;
nargs_constant = 2;
break;
+ case V8SF_FTYPE_V8SF_V8SF_V8SI_INT:
+ case V4DF_FTYPE_V4DF_V4DF_V4DI_INT:
+ case V4SF_FTYPE_V4SF_V4SF_V4SI_INT:
+ case V2DF_FTYPE_V2DF_V2DF_V2DI_INT:
+ nargs = 4;
+ nargs_constant = 1;
+ break;
case V2DI_FTYPE_V2DI_V2DI_UINT_UINT:
nargs = 4;
nargs_constant = 2;
@@ -22126,13 +23660,40 @@ ix86_expand_args_builtin (const struct builtin_description *d,
case CODE_FOR_sse4_1_roundsd:
case CODE_FOR_sse4_1_roundss:
case CODE_FOR_sse4_1_blendps:
+ case CODE_FOR_avx_blendpd256:
+ case CODE_FOR_avx_vpermilv4df:
+ case CODE_FOR_avx_roundpd256:
+ case CODE_FOR_avx_roundps256:
error ("the last argument must be a 4-bit immediate");
return const0_rtx;
case CODE_FOR_sse4_1_blendpd:
+ case CODE_FOR_avx_vpermilv2df:
+ case CODE_FOR_avx_vpermil2v2df3:
+ case CODE_FOR_avx_vpermil2v4sf3:
+ case CODE_FOR_avx_vpermil2v4df3:
+ case CODE_FOR_avx_vpermil2v8sf3:
error ("the last argument must be a 2-bit immediate");
return const0_rtx;
+ case CODE_FOR_avx_vextractf128v4df:
+ case CODE_FOR_avx_vextractf128v8sf:
+ case CODE_FOR_avx_vextractf128v8si:
+ case CODE_FOR_avx_vinsertf128v4df:
+ case CODE_FOR_avx_vinsertf128v8sf:
+ case CODE_FOR_avx_vinsertf128v8si:
+ error ("the last argument must be a 1-bit immediate");
+ return const0_rtx;
+
+ case CODE_FOR_avx_cmpsdv2df3:
+ case CODE_FOR_avx_cmpssv4sf3:
+ case CODE_FOR_avx_cmppdv2df3:
+ case CODE_FOR_avx_cmppsv4sf3:
+ case CODE_FOR_avx_cmppdv4df3:
+ case CODE_FOR_avx_cmppsv8sf3:
+ error ("the last argument must be a 5-bit immediate");
+ return const0_rtx;
+
default:
switch (nargs_constant)
{
@@ -22223,7 +23784,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)
{
@@ -22231,38 +23792,63 @@ ix86_expand_special_args_builtin (const struct builtin_description *d,
emit_insn (GEN_FCN (icode) (target));
return 0;
case V2DI_FTYPE_PV2DI:
+ case V32QI_FTYPE_PCCHAR:
case V16QI_FTYPE_PCCHAR:
+ case V8SF_FTYPE_PCV4SF:
+ case V8SF_FTYPE_PCFLOAT:
case V4SF_FTYPE_PCFLOAT:
+ case V4DF_FTYPE_PCV2DF:
+ case V4DF_FTYPE_PCDOUBLE:
case V2DF_FTYPE_PCDOUBLE:
nargs = 1;
- class = load;
+ klass = load;
memory = 0;
break;
case VOID_FTYPE_PV2SF_V4SF:
case VOID_FTYPE_PV2DI_V2DI:
+ case VOID_FTYPE_PCHAR_V32QI:
case VOID_FTYPE_PCHAR_V16QI:
+ case VOID_FTYPE_PFLOAT_V8SF:
case VOID_FTYPE_PFLOAT_V4SF:
+ case VOID_FTYPE_PDOUBLE_V4DF:
case VOID_FTYPE_PDOUBLE_V2DF:
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;
+ case V8SF_FTYPE_PCV8SF_V8SF:
+ case V4DF_FTYPE_PCV4DF_V4DF:
+ case V4SF_FTYPE_PCV4SF_V4SF:
+ case V2DF_FTYPE_PCV2DF_V2DF:
+ nargs = 2;
+ klass = load;
+ memory = 0;
+ break;
+ case VOID_FTYPE_PV8SF_V8SF_V8SF:
+ case VOID_FTYPE_PV4DF_V4DF_V4DF:
+ case VOID_FTYPE_PV4SF_V4SF_V4SF:
+ case VOID_FTYPE_PV2DF_V2DF_V2DF:
+ nargs = 2;
+ klass = store;
+ /* Reserve memory operand for target. */
+ memory = ARRAY_SIZE (args);
+ break;
default:
gcc_unreachable ();
}
gcc_assert (nargs <= ARRAY_SIZE (args));
- if (class == store)
+ if (klass == store)
{
arg = CALL_EXPR_ARG (exp, 0);
op = expand_normal (arg);
@@ -22339,7 +23925,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
@@ -22489,10 +24075,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
current ISA based on the command line switches. With function specific
options, we need to check in the context of the function making the call
whether it is supported. */
- if (ix86_builtins_isa[fcode]
- && !(ix86_builtins_isa[fcode] & ix86_isa_flags))
+ if (ix86_builtins_isa[fcode].isa
+ && !(ix86_builtins_isa[fcode].isa & ix86_isa_flags))
{
- char *opts = ix86_target_string (ix86_builtins_isa[fcode], 0, NULL,
+ char *opts = ix86_target_string (ix86_builtins_isa[fcode].isa, 0, NULL,
NULL, NULL, false);
if (!opts)
@@ -22933,8 +24519,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)
@@ -22956,7 +24544,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;
@@ -22974,7 +24562,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;
@@ -23206,16 +24794,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;
@@ -23420,7 +25008,8 @@ inline_memory_move_cost (enum machine_mode mode, enum reg_class regclass,
{
if (!in)
return ix86_cost->int_store[0];
- if (TARGET_PARTIAL_REG_DEPENDENCY && !optimize_size)
+ if (TARGET_PARTIAL_REG_DEPENDENCY
+ && optimize_function_for_speed_p (cfun))
cost = ix86_cost->movzbl_load;
else
cost = ix86_cost->int_load[0];
@@ -23540,8 +25129,11 @@ ix86_hard_regno_mode_ok (int regno, enum machine_mode mode)
{
/* We implement the move patterns for all vector modes into and
out of SSE registers, even when no operation instructions
- are available. */
- return (VALID_SSE_REG_MODE (mode)
+ are available. OImode move is available only when AVX is
+ enabled. */
+ return ((TARGET_AVX && mode == OImode)
+ || VALID_AVX256_REG_MODE (mode)
+ || VALID_SSE_REG_MODE (mode)
|| VALID_SSE2_REG_MODE (mode)
|| VALID_MMX_REG_MODE (mode)
|| VALID_MMX_REG_MODE_3DNOW (mode));
@@ -24613,7 +26205,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))
@@ -24653,9 +26245,11 @@ ix86_pad_returns (void)
static void
ix86_reorg (void)
{
- if (TARGET_PAD_RETURNS && optimize && !optimize_size)
+ if (TARGET_PAD_RETURNS && optimize
+ && optimize_function_for_speed_p (cfun))
ix86_pad_returns ();
- if (TARGET_FOUR_JUMP_LIMIT && optimize && !optimize_size)
+ if (TARGET_FOUR_JUMP_LIMIT && optimize
+ && optimize_function_for_speed_p (cfun))
ix86_avoid_jump_misspredicts ();
}
@@ -24690,7 +26284,8 @@ extended_reg_mentioned_1 (rtx *p, void *data ATTRIBUTE_UNUSED)
bool
x86_extended_reg_mentioned_p (rtx insn)
{
- return for_each_rtx (&PATTERN (insn), extended_reg_mentioned_1, NULL);
+ return for_each_rtx (INSN_P (insn) ? &PATTERN (insn) : &insn,
+ extended_reg_mentioned_1, NULL);
}
/* Generate an unsigned DImode/SImode to FP conversion. This is the same code
@@ -24741,7 +26336,7 @@ static bool
ix86_expand_vector_init_duplicate (bool mmx_ok, enum machine_mode mode,
rtx target, rtx val)
{
- enum machine_mode smode, wsmode, wvmode;
+ enum machine_mode hmode, smode, wsmode, wvmode;
rtx x;
switch (mode)
@@ -24866,6 +26461,33 @@ ix86_expand_vector_init_duplicate (bool mmx_ok, enum machine_mode mode,
emit_move_insn (target, gen_lowpart (mode, x));
return true;
+ case V4DFmode:
+ hmode = V2DFmode;
+ goto half;
+ case V4DImode:
+ hmode = V2DImode;
+ goto half;
+ case V8SFmode:
+ hmode = V4SFmode;
+ goto half;
+ case V8SImode:
+ hmode = V4SImode;
+ goto half;
+ case V16HImode:
+ hmode = V8HImode;
+ goto half;
+ case V32QImode:
+ hmode = V16QImode;
+ goto half;
+half:
+ {
+ rtx tmp = gen_reg_rtx (hmode);
+ ix86_expand_vector_init_duplicate (mmx_ok, hmode, tmp, val);
+ emit_insn (gen_rtx_SET (VOIDmode, target,
+ gen_rtx_VEC_CONCAT (mode, tmp, tmp)));
+ }
+ return true;
+
default:
return false;
}
@@ -24887,7 +26509,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:
@@ -24900,6 +26528,14 @@ ix86_expand_vector_init_one_nonzero (bool mmx_ok, enum machine_mode mode,
case V4HImode:
use_vector_set = TARGET_SSE || TARGET_3DNOW_A;
break;
+ case V32QImode:
+ case V16HImode:
+ case V8SImode:
+ case V8SFmode:
+ case V4DImode:
+ case V4DFmode:
+ use_vector_set = TARGET_AVX;
+ break;
default:
break;
}
@@ -24967,7 +26603,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),
@@ -25038,6 +26674,12 @@ ix86_expand_vector_init_one_var (bool mmx_ok, enum machine_mode mode,
the general case. */
return false;
+ case V4DFmode:
+ case V4DImode:
+ case V8SFmode:
+ case V8SImode:
+ case V16HImode:
+ case V32QImode:
case V4SFmode:
case V4SImode:
case V8HImode:
@@ -25098,7 +26740,7 @@ ix86_expand_vector_init_concat (enum machine_mode mode,
rtx target, rtx *ops, int n)
{
enum machine_mode cmode, hmode = VOIDmode;
- rtx first[4], second[2];
+ rtx first[8], second[4];
rtvec v;
int i, j;
@@ -25107,6 +26749,18 @@ ix86_expand_vector_init_concat (enum machine_mode mode,
case 2:
switch (mode)
{
+ case V8SImode:
+ cmode = V4SImode;
+ break;
+ case V8SFmode:
+ cmode = V4SFmode;
+ break;
+ case V4DImode:
+ cmode = V2DImode;
+ break;
+ case V4DFmode:
+ cmode = V2DFmode;
+ break;
case V4SImode:
cmode = V2SImode;
break;
@@ -25141,6 +26795,12 @@ ix86_expand_vector_init_concat (enum machine_mode mode,
case 4:
switch (mode)
{
+ case V4DImode:
+ cmode = V2DImode;
+ break;
+ case V4DFmode:
+ cmode = V2DFmode;
+ break;
case V4SImode:
cmode = V2SImode;
break;
@@ -25152,6 +26812,22 @@ ix86_expand_vector_init_concat (enum machine_mode mode,
}
goto half;
+ case 8:
+ switch (mode)
+ {
+ case V8SImode:
+ cmode = V2SImode;
+ hmode = V4SImode;
+ break;
+ case V8SFmode:
+ cmode = V2SFmode;
+ hmode = V4SFmode;
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ goto half;
+
half:
/* FIXME: We process inputs backward to help RA. PR 36222. */
i = n - 1;
@@ -25304,7 +26980,8 @@ static void
ix86_expand_vector_init_general (bool mmx_ok, enum machine_mode mode,
rtx target, rtx vals)
{
- rtx ops[16];
+ rtx ops[32], op0, op1;
+ enum machine_mode half_mode = VOIDmode;
int n, i;
switch (mode)
@@ -25315,6 +26992,10 @@ ix86_expand_vector_init_general (bool mmx_ok, enum machine_mode mode,
break;
/* FALLTHRU */
+ case V8SFmode:
+ case V8SImode:
+ case V4DFmode:
+ case V4DImode:
case V4SFmode:
case V4SImode:
case V2DFmode:
@@ -25325,6 +27006,28 @@ ix86_expand_vector_init_general (bool mmx_ok, enum machine_mode mode,
ix86_expand_vector_init_concat (mode, target, ops, n);
return;
+ case V32QImode:
+ half_mode = V16QImode;
+ goto half;
+
+ case V16HImode:
+ half_mode = V8HImode;
+ goto half;
+
+half:
+ n = GET_MODE_NUNITS (mode);
+ for (i = 0; i < n; i++)
+ ops[i] = XVECEXP (vals, 0, i);
+ op0 = gen_reg_rtx (half_mode);
+ op1 = gen_reg_rtx (half_mode);
+ ix86_expand_vector_init_interleave (half_mode, op0, ops,
+ n >> 2);
+ ix86_expand_vector_init_interleave (half_mode, op1,
+ &ops [n >> 1], n >> 2);
+ emit_insn (gen_rtx_SET (VOIDmode, target,
+ gen_rtx_VEC_CONCAT (mode, op0, op1)));
+ return;
+
case V16QImode:
if (!TARGET_SSE4_1)
break;
@@ -25467,8 +27170,28 @@ ix86_expand_vector_set (bool mmx_ok, rtx target, rtx val, int elt)
{
enum machine_mode mode = GET_MODE (target);
enum machine_mode inner_mode = GET_MODE_INNER (mode);
+ enum machine_mode half_mode;
bool use_vec_merge = false;
rtx tmp;
+ static rtx (*gen_extract[6][2]) (rtx, rtx)
+ = {
+ { gen_vec_extract_lo_v32qi, gen_vec_extract_hi_v32qi },
+ { gen_vec_extract_lo_v16hi, gen_vec_extract_hi_v16hi },
+ { gen_vec_extract_lo_v8si, gen_vec_extract_hi_v8si },
+ { gen_vec_extract_lo_v4di, gen_vec_extract_hi_v4di },
+ { gen_vec_extract_lo_v8sf, gen_vec_extract_hi_v8sf },
+ { gen_vec_extract_lo_v4df, gen_vec_extract_hi_v4df }
+ };
+ static rtx (*gen_insert[6][2]) (rtx, rtx, rtx)
+ = {
+ { gen_vec_set_lo_v32qi, gen_vec_set_hi_v32qi },
+ { gen_vec_set_lo_v16hi, gen_vec_set_hi_v16hi },
+ { gen_vec_set_lo_v8si, gen_vec_set_hi_v8si },
+ { gen_vec_set_lo_v4di, gen_vec_set_hi_v4di },
+ { gen_vec_set_lo_v8sf, gen_vec_set_hi_v8sf },
+ { gen_vec_set_lo_v4df, gen_vec_set_hi_v4df }
+ };
+ int i, j, n;
switch (mode)
{
@@ -25531,7 +27254,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;
@@ -25542,7 +27265,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;
@@ -25553,7 +27276,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;
@@ -25616,6 +27339,62 @@ ix86_expand_vector_set (bool mmx_ok, rtx target, rtx val, int elt)
break;
case V8QImode:
+ break;
+
+ case V32QImode:
+ half_mode = V16QImode;
+ j = 0;
+ n = 16;
+ goto half;
+
+ case V16HImode:
+ half_mode = V8HImode;
+ j = 1;
+ n = 8;
+ goto half;
+
+ case V8SImode:
+ half_mode = V4SImode;
+ j = 2;
+ n = 4;
+ goto half;
+
+ case V4DImode:
+ half_mode = V2DImode;
+ j = 3;
+ n = 2;
+ goto half;
+
+ case V8SFmode:
+ half_mode = V4SFmode;
+ j = 4;
+ n = 4;
+ goto half;
+
+ case V4DFmode:
+ half_mode = V2DFmode;
+ j = 5;
+ n = 2;
+ goto half;
+
+half:
+ /* Compute offset. */
+ i = elt / n;
+ elt %= n;
+
+ gcc_assert (i <= 1);
+
+ /* Extract the half. */
+ tmp = gen_reg_rtx (half_mode);
+ emit_insn ((*gen_extract[j][i]) (tmp, target));
+
+ /* Put val in tmp at elt. */
+ ix86_expand_vector_set (false, tmp, val, elt);
+
+ /* Put it back. */
+ emit_insn ((*gen_insert[j][i]) (target, target, tmp));
+ return;
+
default:
break;
}
@@ -25674,7 +27453,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;
@@ -25791,7 +27570,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));
@@ -25817,6 +27596,8 @@ ix86_vector_mode_supported_p (enum machine_mode mode)
return true;
if (TARGET_SSE2 && VALID_SSE2_REG_MODE (mode))
return true;
+ if (TARGET_AVX && VALID_AVX256_REG_MODE (mode))
+ return true;
if (TARGET_MMX && VALID_MMX_REG_MODE (mode))
return true;
if (TARGET_3DNOW && VALID_MMX_REG_MODE_3DNOW (mode))
@@ -25926,7 +27707,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));
@@ -27284,6 +29065,10 @@ ix86_enum_va_list (int idx, const char **pname, tree *ptree)
#define TARGET_PASS_BY_REFERENCE ix86_pass_by_reference
#undef TARGET_INTERNAL_ARG_POINTER
#define TARGET_INTERNAL_ARG_POINTER ix86_internal_arg_pointer
+#undef TARGET_UPDATE_STACK_BOUNDARY
+#define TARGET_UPDATE_STACK_BOUNDARY ix86_update_stack_boundary
+#undef TARGET_GET_DRAP_RTX
+#define TARGET_GET_DRAP_RTX ix86_get_drap_rtx
#undef TARGET_DWARF_HANDLE_FRAME_UNSPEC
#define TARGET_DWARF_HANDLE_FRAME_UNSPEC ix86_dwarf_handle_frame_unspec
#undef TARGET_STRICT_ARGUMENT_NAMING
@@ -27330,7 +29115,7 @@ ix86_enum_va_list (int idx, const char **pname, tree *ptree)
#define TARGET_SET_CURRENT_FUNCTION ix86_set_current_function
#undef TARGET_OPTION_VALID_ATTRIBUTE_P
-#define TARGET_OPTION_VALID_ATTRIBUTE_P ix86_valid_option_attribute_p
+#define TARGET_OPTION_VALID_ATTRIBUTE_P ix86_valid_target_attribute_p
#undef TARGET_OPTION_SAVE
#define TARGET_OPTION_SAVE ix86_function_specific_save
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index c7d33c7eb05..d933c5e2389 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -46,6 +46,8 @@ along with GCC; see the file COPYING3. If not see
#define TARGET_SSSE3 OPTION_ISA_SSSE3
#define TARGET_SSE4_1 OPTION_ISA_SSE4_1
#define TARGET_SSE4_2 OPTION_ISA_SSE4_2
+#define TARGET_AVX OPTION_ISA_AVX
+#define TARGET_FMA OPTION_ISA_FMA
#define TARGET_SSE4A OPTION_ISA_SSE4A
#define TARGET_SSE5 OPTION_ISA_SSE5
#define TARGET_ROUND OPTION_ISA_ROUND
@@ -170,6 +172,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. */
@@ -648,16 +654,32 @@ enum target_cpu_default
#define STACK_BOUNDARY (TARGET_64BIT && DEFAULT_ABI == MS_ABI ? 128 \
: BITS_PER_WORD)
+/* Stack boundary of the main function guaranteed by OS. */
+#define MAIN_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
-/* As of July 2001, many runtimes do not align the stack properly when
- entering main. This causes expand_main_function to forcibly align
- the stack, which results in aligned frames for functions called from
- main, though it does nothing for the alignment of main itself. */
-#define FORCE_PREFERRED_STACK_BOUNDARY_IN_MAIN \
- (ix86_preferred_stack_boundary > STACK_BOUNDARY && !TARGET_64BIT)
+/* 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
+
+/* 1 if -mstackrealign should be turned on by default. It will
+ generate an alternate prologue and epilogue that realigns the
+ runtime stack if nessary. This supports mixing codes that keep a
+ 4-byte aligned stack, as specified by i386 psABI, with codes that
+ need a 16-byte aligned stack, as required by SSE instructions. If
+ STACK_REALIGN_DEFAULT is 1 and PREFERRED_STACK_BOUNDARY_DEFAULT is
+ 128, stacks for all functions may be realigned. */
+#define STACK_REALIGN_DEFAULT 0
+
+/* Boundary (in *bits*) on which the incoming stack is aligned. */
+#define INCOMING_STACK_BOUNDARY ix86_incoming_stack_boundary
/* Target OS keeps a vector-aligned (128-bit, 16-byte) stack. This is
mandatory for the 64-bit ABI, and may or may not be true for other
@@ -682,7 +704,10 @@ enum target_cpu_default
Pentium+ prefers DFmode values to be aligned to 64 bit boundary
and Pentium Pro XFmode values at 128 bit boundaries. */
-#define BIGGEST_ALIGNMENT 128
+#define BIGGEST_ALIGNMENT (TARGET_AVX ? 256: 128)
+
+/* Maximum stack alignment. */
+#define MAX_STACK_ALIGNMENT MAX_OFILE_ALIGNMENT
/* Decide whether a variable of mode MODE should be 128 bit aligned. */
#define ALIGN_MODE_128(MODE) \
@@ -973,6 +998,10 @@ do { \
#define HARD_REGNO_NREGS_WITH_PADDING(REGNO, MODE) ((MODE) == XFmode ? 4 : 8)
+#define VALID_AVX256_REG_MODE(MODE) \
+ ((MODE) == V32QImode || (MODE) == V16HImode || (MODE) == V8SImode \
+ || (MODE) == V4DImode || (MODE) == V8SFmode || (MODE) == V4DFmode)
+
#define VALID_SSE2_REG_MODE(MODE) \
((MODE) == V16QImode || (MODE) == V8HImode || (MODE) == V2DFmode \
|| (MODE) == V2DImode || (MODE) == DFmode)
@@ -990,8 +1019,14 @@ do { \
|| (MODE) == V4HImode || (MODE) == V8QImode)
/* ??? No autovectorization into MMX or 3DNOW until we can reliably
- place emms and femms instructions. */
-#define UNITS_PER_SIMD_WORD(MODE) (TARGET_SSE ? 16 : UNITS_PER_WORD)
+ place emms and femms instructions.
+ FIXME: AVX has 32byte floating point vector operations and 16byte
+ integer vector operations. But vectorizer doesn't support
+ different sizes for integer and floating point vectors. We limit
+ vector size to 16byte. */
+#define UNITS_PER_SIMD_WORD(MODE) \
+ (TARGET_AVX ? (((MODE) == DFmode || (MODE) == SFmode) ? 16 : 16) \
+ : (TARGET_SSE ? 16 : UNITS_PER_WORD))
#define VALID_DFP_MODE_P(MODE) \
((MODE) == SDmode || (MODE) == DDmode || (MODE) == TDmode)
@@ -1012,7 +1047,9 @@ do { \
#define SSE_REG_MODE_P(MODE) \
((MODE) == TImode || (MODE) == V16QImode || (MODE) == TFmode \
|| (MODE) == V8HImode || (MODE) == V2DFmode || (MODE) == V2DImode \
- || (MODE) == V4SFmode || (MODE) == V4SImode)
+ || (MODE) == V4SFmode || (MODE) == V4SImode || (MODE) == V32QImode \
+ || (MODE) == V16HImode || (MODE) == V8SImode || (MODE) == V4DImode \
+ || (MODE) == V8SFmode || (MODE) == V4DFmode)
/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */
@@ -1110,7 +1147,7 @@ do { \
the pic register when possible. The change is visible after the
prologue has been emitted. */
-#define REAL_PIC_OFFSET_TABLE_REGNUM 3
+#define REAL_PIC_OFFSET_TABLE_REGNUM BX_REG
#define PIC_OFFSET_TABLE_REGNUM \
((TARGET_64BIT && ix86_cmodel == CM_SMALL_PIC) \
@@ -1251,6 +1288,19 @@ enum reg_class
{ 0xffffffff,0x1fffff } \
}
+/* The following macro defines cover classes for Integrated Register
+ Allocator. Cover classes is a set of non-intersected register
+ classes covering all hard registers used for register allocation
+ purpose. Any move between two registers of a cover class should be
+ cheaper than load or store of the registers. The macro value is
+ array of register classes with LIM_REG_CLASSES used as the end
+ marker. */
+
+#define IRA_COVER_CLASSES \
+{ \
+ GENERAL_REGS, FLOAT_REGS, MMX_REGS, SSE_REGS, LIM_REG_CLASSES \
+}
+
/* The same information, inverted:
Return the class number of the smallest class containing
reg number REGNO. This could be a conditional expression
@@ -1303,6 +1353,19 @@ enum reg_class
#define SSE_VEC_FLOAT_MODE_P(MODE) \
((TARGET_SSE && (MODE) == V4SFmode) || (TARGET_SSE2 && (MODE) == V2DFmode))
+#define AVX_FLOAT_MODE_P(MODE) \
+ (TARGET_AVX && ((MODE) == SFmode || (MODE) == DFmode))
+
+#define AVX128_VEC_FLOAT_MODE_P(MODE) \
+ (TARGET_AVX && ((MODE) == V4SFmode || (MODE) == V2DFmode))
+
+#define AVX256_VEC_FLOAT_MODE_P(MODE) \
+ (TARGET_AVX && ((MODE) == V8SFmode || (MODE) == V4DFmode))
+
+#define AVX_VEC_FLOAT_MODE_P(MODE) \
+ (TARGET_AVX && ((MODE) == V4SFmode || (MODE) == V2DFmode \
+ || (MODE) == V8SFmode || (MODE) == V4DFmode))
+
#define MMX_REG_P(XOP) (REG_P (XOP) && MMX_REGNO_P (REGNO (XOP)))
#define MMX_REGNO_P(N) IN_RANGE ((N), FIRST_MMX_REG, LAST_MMX_REG)
@@ -1523,6 +1586,7 @@ typedef struct ix86_args {
int fastcall; /* fastcall calling convention is used */
int sse_words; /* # sse words passed so far */
int sse_nregs; /* # sse registers available for passing */
+ int warn_avx; /* True when we want to warn about AVX ABI. */
int warn_sse; /* True when we want to warn about SSE ABI. */
int warn_mmx; /* True when we want to warn about MMX ABI. */
int sse_regno; /* next available sse register number */
@@ -1629,12 +1693,9 @@ typedef struct ix86_args {
{ FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}} \
/* Given FROM and TO register numbers, say whether this elimination is
- allowed. Frame pointer elimination is automatically handled.
-
- All other eliminations are valid. */
+ allowed. */
-#define CAN_ELIMINATE(FROM, TO) \
- ((TO) == STACK_POINTER_REGNUM ? !frame_pointer_needed : 1)
+#define CAN_ELIMINATE(FROM, TO) ix86_can_eliminate ((FROM), (TO))
/* Define the offset between two registers, one to be eliminated, and the other
its replacement, at the start of a routine. */
@@ -1914,7 +1975,8 @@ do { \
/* A C expression for the cost of a branch instruction. A value of 1
is the default; other values are interpreted relative to that. */
-#define BRANCH_COST ix86_branch_cost
+#define BRANCH_COST(speed_p, predictable_p) \
+ (!(speed_p) ? 2 : (predictable_p) ? 0 : ix86_branch_cost)
/* Define this macro as a C expression which is nonzero if accessing
less than a word of memory (i.e. a `char' or a `short') is no
@@ -2100,6 +2162,29 @@ do { \
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
ix86_output_addr_diff_elt ((FILE), (VALUE), (REL))
+/* When we see %v, we will print the 'v' prefix if TARGET_AVX is
+ true. */
+
+#define ASM_OUTPUT_AVX_PREFIX(STREAM, PTR) \
+{ \
+ if ((PTR)[0] == '%' && (PTR)[1] == 'v') \
+ { \
+ if (TARGET_AVX) \
+ (PTR) += 1; \
+ else \
+ (PTR) += 2; \
+ } \
+}
+
+/* A C statement or statements which output an assembler instruction
+ opcode to the stdio stream STREAM. The macro-operand PTR is a
+ variable of type `char *' which points to the opcode name in
+ its "internal" form--the form that is written in the machine
+ description. */
+
+#define ASM_OUTPUT_OPCODE(STREAM, PTR) \
+ ASM_OUTPUT_AVX_PREFIX ((STREAM), (PTR))
+
/* Under some conditions we need jump tables in the text section,
because the assembler cannot handle label differences between
sections. This is the case for x86_64 on Mach-O for example. */
@@ -2203,6 +2288,7 @@ enum asm_dialect {
extern enum asm_dialect ix86_asm_dialect;
extern unsigned int ix86_preferred_stack_boundary;
+extern unsigned int ix86_incoming_stack_boundary;
extern int ix86_branch_cost, ix86_section_threshold;
/* Smallest class containing REGNO. */
@@ -2304,7 +2390,6 @@ struct machine_function GTY(())
{
struct stack_local_entry *stack_locals;
const char *some_ld_name;
- rtx force_align_arg_pointer;
int save_varrargs_registers;
int accesses_prev_frame;
int optimize_mode_switching[MAX_386_ENTITIES];
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index e7a9827c5b9..d952847b266 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -195,6 +195,16 @@
; For PCLMUL support
(UNSPEC_PCLMUL 165)
+
+ ; For AVX support
+ (UNSPEC_PCMP 166)
+ (UNSPEC_VPERMIL 167)
+ (UNSPEC_VPERMIL2 168)
+ (UNSPEC_VPERMIL2F128 169)
+ (UNSPEC_MASKLOAD 170)
+ (UNSPEC_MASKSTORE 171)
+ (UNSPEC_CAST 172)
+ (UNSPEC_VTESTP 173)
])
(define_constants
@@ -214,6 +224,8 @@
(UNSPECV_LOCK 13)
(UNSPECV_PROLOGUE_USE 14)
(UNSPECV_CLD 15)
+ (UNSPECV_VZEROALL 16)
+ (UNSPECV_VZEROUPPER 17)
])
;; Constants to represent pcomtrue/pcomfalse variants
@@ -245,6 +257,7 @@
[(AX_REG 0)
(DX_REG 1)
(CX_REG 2)
+ (BX_REG 3)
(SI_REG 4)
(DI_REG 5)
(BP_REG 6)
@@ -252,8 +265,25 @@
(FLAGS_REG 17)
(FPSR_REG 18)
(FPCR_REG 19)
+ (XMM0_REG 21)
+ (XMM1_REG 22)
+ (XMM2_REG 23)
+ (XMM3_REG 24)
+ (XMM4_REG 25)
+ (XMM5_REG 26)
+ (XMM6_REG 27)
+ (XMM7_REG 28)
(R10_REG 39)
(R11_REG 40)
+ (R13_REG 42)
+ (XMM8_REG 45)
+ (XMM9_REG 46)
+ (XMM10_REG 47)
+ (XMM11_REG 48)
+ (XMM12_REG 49)
+ (XMM13_REG 50)
+ (XMM14_REG 51)
+ (XMM15_REG 52)
])
;; Insns whose names begin with "x86_" are emitted by gen_FOO calls
@@ -289,7 +319,7 @@
;; Main data type used by the insn
(define_attr "mode"
- "unknown,none,QI,HI,SI,DI,TI,SF,DF,XF,TF,V4SF,V2DF,V2SF,V1DF"
+ "unknown,none,QI,HI,SI,DI,TI,OI,SF,DF,XF,TF,V8SF,V4DF,V4SF,V2DF,V2SF,V1DF"
(const_string "unknown"))
;; The CPU unit operations uses.
@@ -386,6 +416,28 @@
;; There are also additional prefixes in SSSE3.
(define_attr "prefix_extra" "" (const_int 0))
+;; Prefix used: original, VEX or maybe VEX.
+(define_attr "prefix" "orig,vex,maybe_vex"
+ (if_then_else (eq_attr "mode" "OI,V8SF,V4DF")
+ (const_string "vex")
+ (const_string "orig")))
+
+;; There is a 8bit immediate for VEX.
+(define_attr "prefix_vex_imm8" "" (const_int 0))
+
+;; VEX W bit is used.
+(define_attr "prefix_vex_w" "" (const_int 0))
+
+;; The length of VEX prefix
+(define_attr "length_vex" ""
+ (if_then_else (eq_attr "prefix_0f" "1")
+ (if_then_else (eq_attr "prefix_vex_w" "1")
+ (symbol_ref "ix86_attr_length_vex_default (insn, 1, 1)")
+ (symbol_ref "ix86_attr_length_vex_default (insn, 1, 0)"))
+ (if_then_else (eq_attr "prefix_vex_w" "1")
+ (symbol_ref "ix86_attr_length_vex_default (insn, 0, 1)")
+ (symbol_ref "ix86_attr_length_vex_default (insn, 0, 0)"))))
+
;; Set when modrm byte is used.
(define_attr "modrm" ""
(cond [(eq_attr "type" "str,leave")
@@ -431,7 +483,14 @@
(eq_attr "unit" "i387")
(plus (const_int 2)
(plus (attr "prefix_data16")
- (attr "length_address")))]
+ (attr "length_address")))
+ (ior (eq_attr "prefix" "vex")
+ (and (eq_attr "prefix" "maybe_vex")
+ (ne (symbol_ref "TARGET_AVX") (const_int 0))))
+ (plus (attr "length_vex")
+ (plus (attr "prefix_vex_imm8")
+ (plus (attr "modrm")
+ (attr "length_address"))))]
(plus (plus (attr "modrm")
(plus (attr "prefix_0f")
(plus (attr "prefix_rex")
@@ -570,6 +629,9 @@
;; Mapping of unsigned max and min
(define_code_iterator umaxmin [umax umin])
+;; Mapping of signed/unsigned max and min
+(define_code_iterator maxmin [smax smin umax umin])
+
;; Base name for integer and FP insn mnemonic
(define_code_attr maxminiprefix [(smax "maxs") (smin "mins")
(umax "maxu") (umin "minu")])
@@ -1174,7 +1236,7 @@
[(match_operand:X87MODEI12 2 "memory_operand" "m")]))]
UNSPEC_FNSTSW))]
"X87_FLOAT_MODE_P (GET_MODE (operands[1]))
- && (TARGET_USE_<MODE>MODE_FIOP || optimize_size)
+ && (TARGET_USE_<MODE>MODE_FIOP || optimize_function_for_size_p (cfun))
&& (GET_MODE (operands [3]) == GET_MODE (operands[1]))"
"* return output_fp_compare (insn, operands, 0, 0);"
[(set_attr "type" "multi")
@@ -1191,7 +1253,7 @@
(clobber (match_operand:HI 0 "register_operand" "=a"))]
"X87_FLOAT_MODE_P (GET_MODE (operands[1]))
&& TARGET_SAHF && !TARGET_CMOVE
- && (TARGET_USE_<MODE>MODE_FIOP || optimize_size)
+ && (TARGET_USE_<MODE>MODE_FIOP || optimize_function_for_size_p (cfun))
&& (GET_MODE (operands [3]) == GET_MODE (operands[1]))"
"#"
"&& reload_completed"
@@ -1252,6 +1314,7 @@
&& GET_MODE (operands[0]) == GET_MODE (operands[1])"
"* return output_fp_compare (insn, operands, 1, 0);"
[(set_attr "type" "fcmp,ssecomi")
+ (set_attr "prefix" "orig,maybe_vex")
(set (attr "mode")
(if_then_else (match_operand:SF 1 "" "")
(const_string "SF")
@@ -1268,6 +1331,7 @@
&& GET_MODE (operands[0]) == GET_MODE (operands[1])"
"* return output_fp_compare (insn, operands, 1, 0);"
[(set_attr "type" "ssecomi")
+ (set_attr "prefix" "maybe_vex")
(set (attr "mode")
(if_then_else (match_operand:SF 1 "" "")
(const_string "SF")
@@ -1304,6 +1368,7 @@
&& GET_MODE (operands[0]) == GET_MODE (operands[1])"
"* return output_fp_compare (insn, operands, 1, 1);"
[(set_attr "type" "fcmp,ssecomi")
+ (set_attr "prefix" "orig,maybe_vex")
(set (attr "mode")
(if_then_else (match_operand:SF 1 "" "")
(const_string "SF")
@@ -1320,6 +1385,7 @@
&& GET_MODE (operands[0]) == GET_MODE (operands[1])"
"* return output_fp_compare (insn, operands, 1, 1);"
[(set_attr "type" "ssecomi")
+ (set_attr "prefix" "maybe_vex")
(set (attr "mode")
(if_then_else (match_operand:SF 1 "" "")
(const_string "SF")
@@ -1417,7 +1483,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")
@@ -1428,8 +1494,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}";
@@ -1449,20 +1514,20 @@
{
case TYPE_SSELOG1:
if (get_attr_mode (insn) == MODE_TI)
- return "pxor\t%0, %0";
- return "xorps\t%0, %0";
+ return "%vpxor\t%0, %d0";
+ return "%vxorps\t%0, %d0";
case TYPE_SSEMOV:
switch (get_attr_mode (insn))
{
case MODE_TI:
- return "movdqa\t{%1, %0|%0, %1}";
+ return "%vmovdqa\t{%1, %0|%0, %1}";
case MODE_V4SF:
- return "movaps\t{%1, %0|%0, %1}";
+ return "%vmovaps\t{%1, %0|%0, %1}";
case MODE_SI:
- return "movd\t{%1, %0|%0, %1}";
+ return "%vmovd\t{%1, %0|%0, %1}";
case MODE_SF:
- return "movss\t{%1, %0|%0, %1}";
+ return "%vmovss\t{%1, %0|%0, %1}";
default:
gcc_unreachable ();
}
@@ -1496,6 +1561,10 @@
(const_string "lea")
]
(const_string "imov")))
+ (set (attr "prefix")
+ (if_then_else (eq_attr "alternative" "0,1,2,3,4,5")
+ (const_string "orig")
+ (const_string "maybe_vex")))
(set (attr "mode")
(cond [(eq_attr "alternative" "2,3")
(const_string "DI")
@@ -1596,7 +1665,7 @@
}
}
[(set (attr "type")
- (cond [(ne (symbol_ref "optimize_size") (const_int 0))
+ (cond [(ne (symbol_ref "optimize_function_for_size_p (cfun)") (const_int 0))
(const_string "imov")
(and (eq_attr "alternative" "0")
(ior (eq (symbol_ref "TARGET_PARTIAL_REG_STALL")
@@ -1664,7 +1733,7 @@
(match_operand:HI 1 "register_operand" "+r"))
(set (match_dup 1)
(match_dup 0))]
- "!TARGET_PARTIAL_REG_STALL || optimize_size"
+ "!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)"
"xchg{l}\t%k1, %k0"
[(set_attr "type" "imov")
(set_attr "mode" "SI")
@@ -1688,8 +1757,10 @@
(define_expand "movstricthi"
[(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" ""))
(match_operand:HI 1 "general_operand" ""))]
- "! TARGET_PARTIAL_REG_STALL || optimize_size"
+ ""
{
+ if (TARGET_PARTIAL_REG_STALL && optimize_function_for_speed_p (cfun))
+ FAIL;
/* Don't generate memory->memory moves, go through a register */
if (MEM_P (operands[0]) && MEM_P (operands[1]))
operands[1] = force_reg (HImode, operands[1]);
@@ -1698,7 +1769,7 @@
(define_insn "*movstricthi_1"
[(set (strict_low_part (match_operand:HI 0 "nonimmediate_operand" "+rm,r"))
(match_operand:HI 1 "general_operand" "rn,m"))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_size)
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"mov{w}\t{%1, %0|%0, %1}"
[(set_attr "type" "imov")
@@ -1708,8 +1779,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")
@@ -1773,7 +1843,7 @@
(cond [(and (eq_attr "alternative" "5")
(not (match_operand:QI 1 "aligned_operand" "")))
(const_string "imovx")
- (ne (symbol_ref "optimize_size") (const_int 0))
+ (ne (symbol_ref "optimize_function_for_size_p (cfun)") (const_int 0))
(const_string "imov")
(and (eq_attr "alternative" "3")
(ior (eq (symbol_ref "TARGET_PARTIAL_REG_STALL")
@@ -1800,7 +1870,7 @@
(and (eq_attr "alternative" "0,1")
(and (ne (symbol_ref "TARGET_PARTIAL_REG_DEPENDENCY")
(const_int 0))
- (and (eq (symbol_ref "optimize_size")
+ (and (eq (symbol_ref "optimize_function_for_size_p (cfun)")
(const_int 0))
(eq (symbol_ref "TARGET_PARTIAL_REG_STALL")
(const_int 0))))))
@@ -1821,7 +1891,7 @@
(match_operand:QI 1 "register_operand" "+r"))
(set (match_dup 1)
(match_dup 0))]
- "!TARGET_PARTIAL_REG_STALL || optimize_size"
+ "!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun)"
"xchg{l}\t%k1, %k0"
[(set_attr "type" "imov")
(set_attr "mode" "SI")
@@ -1845,8 +1915,10 @@
(define_expand "movstrictqi"
[(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" ""))
(match_operand:QI 1 "general_operand" ""))]
- "! TARGET_PARTIAL_REG_STALL || optimize_size"
+ ""
{
+ if (TARGET_PARTIAL_REG_STALL && optimize_function_for_speed_p (cfun))
+ FAIL;
/* Don't generate memory->memory moves, go through a register. */
if (MEM_P (operands[0]) && MEM_P (operands[1]))
operands[1] = force_reg (QImode, operands[1]);
@@ -1855,7 +1927,7 @@
(define_insn "*movstrictqi_1"
[(set (strict_low_part (match_operand:QI 0 "nonimmediate_operand" "+qm,q"))
(match_operand:QI 1 "general_operand" "*qn,m"))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_size)
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"mov{b}\t{%1, %0|%0, %1}"
[(set_attr "type" "imov")
@@ -1865,7 +1937,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")
@@ -2191,7 +2263,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")
@@ -2202,7 +2274,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"
{
@@ -2225,15 +2297,19 @@
pxor\t%0, %0
movq\t{%1, %0|%0, %1}
movq\t{%1, %0|%0, %1}
- pxor\t%0, %0
- movq\t{%1, %0|%0, %1}
- movdqa\t{%1, %0|%0, %1}
- movq\t{%1, %0|%0, %1}
+ %vpxor\t%0, %d0
+ %vmovq\t{%1, %0|%0, %1}
+ %vmovdqa\t{%1, %0|%0, %1}
+ %vmovq\t{%1, %0|%0, %1}
xorps\t%0, %0
movlps\t{%1, %0|%0, %1}
movaps\t{%1, %0|%0, %1}
movlps\t{%1, %0|%0, %1}"
[(set_attr "type" "*,*,mmx,mmxmov,mmxmov,sselog1,ssemov,ssemov,ssemov,sselog1,ssemov,ssemov,ssemov")
+ (set (attr "prefix")
+ (if_then_else (eq_attr "alternative" "5,6,7,8")
+ (const_string "vex")
+ (const_string "orig")))
(set_attr "mode" "DI,DI,DI,DI,DI,TI,DI,TI,DI,V4SF,V2SF,V4SF,V2SF")])
(define_split
@@ -2270,6 +2346,14 @@
return "movdq2q\t{%1, %0|%0, %1}";
case TYPE_SSEMOV:
+ if (TARGET_AVX)
+ {
+ if (get_attr_mode (insn) == MODE_TI)
+ return "vmovdqa\t{%1, %0|%0, %1}";
+ else
+ return "vmovq\t{%1, %0|%0, %1}";
+ }
+
if (get_attr_mode (insn) == MODE_TI)
return "movdqa\t{%1, %0|%0, %1}";
/* FALLTHRU */
@@ -2282,6 +2366,8 @@
return "movq\t{%1, %0|%0, %1}";
case TYPE_SSELOG1:
+ return "%vpxor\t%0, %d0";
+
case TYPE_MMXADD:
return "pxor\t%0, %0";
@@ -2320,6 +2406,10 @@
(const_string "imov")))
(set_attr "modrm" "*,0,0,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*")
(set_attr "length_immediate" "*,4,8,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*")
+ (set (attr "prefix")
+ (if_then_else (eq_attr "alternative" "11,12,13,14,15,16")
+ (const_string "maybe_vex")
+ (const_string "orig")))
(set_attr "mode" "SI,DI,DI,DI,SI,DI,DI,DI,DI,DI,DI,TI,TI,DI,DI,DI,DI,DI,DI")])
;; Stores and loads of ax to arbitrary constant address.
@@ -2402,6 +2492,37 @@
(set_attr "athlon_decode" "vector")
(set_attr "amdfam10_decode" "double")])
+(define_expand "movoi"
+ [(set (match_operand:OI 0 "nonimmediate_operand" "")
+ (match_operand:OI 1 "general_operand" ""))]
+ "TARGET_AVX"
+ "ix86_expand_move (OImode, operands); DONE;")
+
+(define_insn "*movoi_internal"
+ [(set (match_operand:OI 0 "nonimmediate_operand" "=x,x,m")
+ (match_operand:OI 1 "vector_move_operand" "C,xm,x"))]
+ "TARGET_AVX
+ && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
+{
+ switch (which_alternative)
+ {
+ case 0:
+ return "vxorps\t%0, %0, %0";
+ case 1:
+ case 2:
+ if (misaligned_operand (operands[0], OImode)
+ || misaligned_operand (operands[1], OImode))
+ return "vmovdqu\t{%1, %0|%0, %1}";
+ else
+ return "vmovdqa\t{%1, %0|%0, %1}";
+ default:
+ gcc_unreachable ();
+ }
+}
+ [(set_attr "type" "sselog1,ssemov,ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "OI")])
+
(define_expand "movti"
[(set (match_operand:TI 0 "nonimmediate_operand" "")
(match_operand:TI 1 "nonimmediate_operand" ""))]
@@ -2426,9 +2547,9 @@
{
case 0:
if (get_attr_mode (insn) == MODE_V4SF)
- return "xorps\t%0, %0";
+ return "%vxorps\t%0, %d0";
else
- return "pxor\t%0, %0";
+ return "%vpxor\t%0, %d0";
case 1:
case 2:
/* TDmode values are passed as TImode on the stack. Moving them
@@ -2437,25 +2558,26 @@
|| misaligned_operand (operands[1], TImode))
{
if (get_attr_mode (insn) == MODE_V4SF)
- return "movups\t{%1, %0|%0, %1}";
+ return "%vmovups\t{%1, %0|%0, %1}";
else
- return "movdqu\t{%1, %0|%0, %1}";
+ return "%vmovdqu\t{%1, %0|%0, %1}";
}
else
{
if (get_attr_mode (insn) == MODE_V4SF)
- return "movaps\t{%1, %0|%0, %1}";
+ return "%vmovaps\t{%1, %0|%0, %1}";
else
- return "movdqa\t{%1, %0|%0, %1}";
+ return "%vmovdqa\t{%1, %0|%0, %1}";
}
default:
gcc_unreachable ();
}
}
[(set_attr "type" "sselog1,ssemov,ssemov")
+ (set_attr "prefix" "maybe_vex")
(set (attr "mode")
(cond [(ior (eq (symbol_ref "TARGET_SSE2") (const_int 0))
- (ne (symbol_ref "optimize_size") (const_int 0)))
+ (ne (symbol_ref "optimize_function_for_size_p (cfun)") (const_int 0)))
(const_string "V4SF")
(and (eq_attr "alternative" "2")
(ne (symbol_ref "TARGET_SSE_TYPELESS_STORES")
@@ -2476,9 +2598,9 @@
return "#";
case 2:
if (get_attr_mode (insn) == MODE_V4SF)
- return "xorps\t%0, %0";
+ return "%vxorps\t%0, %d0";
else
- return "pxor\t%0, %0";
+ return "%vpxor\t%0, %d0";
case 3:
case 4:
/* TDmode values are passed as TImode on the stack. Moving them
@@ -2487,26 +2609,27 @@
|| misaligned_operand (operands[1], TImode))
{
if (get_attr_mode (insn) == MODE_V4SF)
- return "movups\t{%1, %0|%0, %1}";
+ return "%vmovups\t{%1, %0|%0, %1}";
else
- return "movdqu\t{%1, %0|%0, %1}";
+ return "%vmovdqu\t{%1, %0|%0, %1}";
}
else
{
if (get_attr_mode (insn) == MODE_V4SF)
- return "movaps\t{%1, %0|%0, %1}";
+ return "%vmovaps\t{%1, %0|%0, %1}";
else
- return "movdqa\t{%1, %0|%0, %1}";
+ return "%vmovdqa\t{%1, %0|%0, %1}";
}
default:
gcc_unreachable ();
}
}
[(set_attr "type" "*,*,sselog1,ssemov,ssemov")
+ (set_attr "prefix" "*,*,maybe_vex,maybe_vex,maybe_vex")
(set (attr "mode")
(cond [(eq_attr "alternative" "2,3")
(if_then_else
- (ne (symbol_ref "optimize_size")
+ (ne (symbol_ref "optimize_function_for_size_p (cfun)")
(const_int 0))
(const_string "V4SF")
(const_string "TI"))
@@ -2514,7 +2637,7 @@
(if_then_else
(ior (ne (symbol_ref "TARGET_SSE_TYPELESS_STORES")
(const_int 0))
- (ne (symbol_ref "optimize_size")
+ (ne (symbol_ref "optimize_function_for_size_p (cfun)")
(const_int 0)))
(const_string "V4SF")
(const_string "TI"))]
@@ -2609,7 +2732,7 @@
"!(MEM_P (operands[0]) && MEM_P (operands[1]))
&& (reload_in_progress || reload_completed
|| (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
- || (!TARGET_SSE_MATH && optimize_size
+ || (!TARGET_SSE_MATH && optimize_function_for_size_p (cfun)
&& standard_80387_constant_p (operands[1]))
|| GET_CODE (operands[1]) != CONST_DOUBLE
|| memory_operand (operands[0], SFmode))"
@@ -2628,20 +2751,27 @@
return "mov{l}\t{%1, %0|%0, %1}";
case 5:
if (get_attr_mode (insn) == MODE_TI)
- return "pxor\t%0, %0";
+ return "%vpxor\t%0, %d0";
else
- return "xorps\t%0, %0";
+ return "%vxorps\t%0, %d0";
case 6:
if (get_attr_mode (insn) == MODE_V4SF)
- return "movaps\t{%1, %0|%0, %1}";
+ return "%vmovaps\t{%1, %0|%0, %1}";
+ else
+ return "%vmovss\t{%1, %d0|%d0, %1}";
+ case 7:
+ if (TARGET_AVX)
+ return REG_P (operands[1]) ? "vmovss\t{%1, %0, %0|%0, %0, %1}"
+ : "vmovss\t{%1, %0|%0, %1}";
else
return "movss\t{%1, %0|%0, %1}";
- case 7: case 8:
- return "movss\t{%1, %0|%0, %1}";
+ case 8:
+ return "%vmovss\t{%1, %0|%0, %1}";
- case 9: case 10:
- case 12: case 13: case 14: case 15:
+ case 9: case 10: case 14: case 15:
return "movd\t{%1, %0|%0, %1}";
+ case 12: case 13:
+ return "%vmovd\t{%1, %0|%0, %1}";
case 11:
return "movq\t{%1, %0|%0, %1}";
@@ -2651,6 +2781,10 @@
}
}
[(set_attr "type" "fmov,fmov,fmov,imov,imov,sselog1,ssemov,ssemov,ssemov,mmxmov,mmxmov,mmxmov,ssemov,ssemov,mmxmov,mmxmov")
+ (set (attr "prefix")
+ (if_then_else (eq_attr "alternative" "5,6,7,8,12,13")
+ (const_string "maybe_vex")
+ (const_string "orig")))
(set (attr "mode")
(cond [(eq_attr "alternative" "3,4,9,10")
(const_string "SI")
@@ -2660,7 +2794,7 @@
(const_int 0))
(ne (symbol_ref "TARGET_SSE2")
(const_int 0)))
- (eq (symbol_ref "optimize_size")
+ (eq (symbol_ref "optimize_function_for_size_p (cfun)")
(const_int 0)))
(const_string "TI")
(const_string "V4SF"))
@@ -2762,14 +2896,16 @@
(match_operand:DF 1 "general_operand"
"fm,f,G,*roF,*Fr,C ,Y2*x,mY2*x,Y2*x"))]
"!(MEM_P (operands[0]) && MEM_P (operands[1]))
- && ((optimize_size || !TARGET_INTEGER_DFMODE_MOVES) && !TARGET_64BIT)
+ && ((optimize_function_for_size_p (cfun)
+ || !TARGET_INTEGER_DFMODE_MOVES) && !TARGET_64BIT)
&& (reload_in_progress || reload_completed
|| (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
- || (!(TARGET_SSE2 && TARGET_SSE_MATH) && optimize_size
+ || (!(TARGET_SSE2 && TARGET_SSE_MATH)
+ && optimize_function_for_size_p (cfun)
&& !memory_operand (operands[0], DFmode)
&& standard_80387_constant_p (operands[1]))
|| GET_CODE (operands[1]) != CONST_DOUBLE
- || ((optimize_size
+ || ((optimize_function_for_size_p (cfun)
|| !TARGET_MEMORY_MISMATCH_STALL
|| reload_in_progress || reload_completed)
&& memory_operand (operands[0], DFmode)))"
@@ -2790,11 +2926,11 @@
switch (get_attr_mode (insn))
{
case MODE_V4SF:
- return "xorps\t%0, %0";
+ return "%vxorps\t%0, %d0";
case MODE_V2DF:
- return "xorpd\t%0, %0";
+ return "%vxorpd\t%0, %d0";
case MODE_TI:
- return "pxor\t%0, %0";
+ return "%vpxor\t%0, %d0";
default:
gcc_unreachable ();
}
@@ -2804,19 +2940,43 @@
switch (get_attr_mode (insn))
{
case MODE_V4SF:
- return "movaps\t{%1, %0|%0, %1}";
+ return "%vmovaps\t{%1, %0|%0, %1}";
case MODE_V2DF:
- return "movapd\t{%1, %0|%0, %1}";
+ return "%vmovapd\t{%1, %0|%0, %1}";
case MODE_TI:
- return "movdqa\t{%1, %0|%0, %1}";
+ return "%vmovdqa\t{%1, %0|%0, %1}";
case MODE_DI:
- return "movq\t{%1, %0|%0, %1}";
+ return "%vmovq\t{%1, %0|%0, %1}";
case MODE_DF:
- return "movsd\t{%1, %0|%0, %1}";
+ if (TARGET_AVX)
+ {
+ if (REG_P (operands[0]) && REG_P (operands[1]))
+ return "vmovsd\t{%1, %0, %0|%0, %0, %1}";
+ else
+ return "vmovsd\t{%1, %0|%0, %1}";
+ }
+ else
+ return "movsd\t{%1, %0|%0, %1}";
case MODE_V1DF:
- return "movlpd\t{%1, %0|%0, %1}";
+ if (TARGET_AVX)
+ {
+ if (REG_P (operands[0]))
+ return "vmovlpd\t{%1, %0, %0|%0, %0, %1}";
+ else
+ return "vmovlpd\t{%1, %0|%0, %1}";
+ }
+ else
+ return "movlpd\t{%1, %0|%0, %1}";
case MODE_V2SF:
- return "movlps\t{%1, %0|%0, %1}";
+ if (TARGET_AVX)
+ {
+ if (REG_P (operands[0]))
+ return "vmovlps\t{%1, %0, %0|%0, %0, %1}";
+ else
+ return "vmovlps\t{%1, %0|%0, %1}";
+ }
+ else
+ return "movlps\t{%1, %0|%0, %1}";
default:
gcc_unreachable ();
}
@@ -2826,6 +2986,10 @@
}
}
[(set_attr "type" "fmov,fmov,fmov,multi,multi,sselog1,ssemov,ssemov,ssemov")
+ (set (attr "prefix")
+ (if_then_else (eq_attr "alternative" "0,1,2,3,4")
+ (const_string "orig")
+ (const_string "maybe_vex")))
(set (attr "mode")
(cond [(eq_attr "alternative" "0,1,2")
(const_string "DF")
@@ -2841,7 +3005,7 @@
/* xorps is one byte shorter. */
(eq_attr "alternative" "5")
- (cond [(ne (symbol_ref "optimize_size")
+ (cond [(ne (symbol_ref "optimize_function_for_size_p (cfun)")
(const_int 0))
(const_string "V4SF")
(ne (symbol_ref "TARGET_SSE_LOAD0_BY_PXOR")
@@ -2857,7 +3021,7 @@
movaps encodes one byte shorter. */
(eq_attr "alternative" "6")
(cond
- [(ne (symbol_ref "optimize_size")
+ [(ne (symbol_ref "optimize_function_for_size_p (cfun)")
(const_int 0))
(const_string "V4SF")
(ne (symbol_ref "TARGET_SSE_PARTIAL_REG_DEPENDENCY")
@@ -2885,7 +3049,8 @@
"TARGET_64BIT && !(MEM_P (operands[0]) && MEM_P (operands[1]))
&& (reload_in_progress || reload_completed
|| (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
- || (!(TARGET_SSE2 && TARGET_SSE_MATH) && optimize_size
+ || (!(TARGET_SSE2 && TARGET_SSE_MATH)
+ && optimize_function_for_size_p (cfun)
&& standard_80387_constant_p (operands[1]))
|| GET_CODE (operands[1]) != CONST_DOUBLE
|| memory_operand (operands[0], DFmode))"
@@ -2907,11 +3072,11 @@
switch (get_attr_mode (insn))
{
case MODE_V4SF:
- return "xorps\t%0, %0";
+ return "%vxorps\t%0, %d0";
case MODE_V2DF:
- return "xorpd\t%0, %0";
+ return "%vxorpd\t%0, %d0";
case MODE_TI:
- return "pxor\t%0, %0";
+ return "%vpxor\t%0, %d0";
default:
gcc_unreachable ();
}
@@ -2921,32 +3086,44 @@
switch (get_attr_mode (insn))
{
case MODE_V4SF:
- return "movaps\t{%1, %0|%0, %1}";
+ return "%vmovaps\t{%1, %0|%0, %1}";
case MODE_V2DF:
- return "movapd\t{%1, %0|%0, %1}";
+ return "%vmovapd\t{%1, %0|%0, %1}";
case MODE_TI:
- return "movdqa\t{%1, %0|%0, %1}";
+ return "%vmovdqa\t{%1, %0|%0, %1}";
case MODE_DI:
- return "movq\t{%1, %0|%0, %1}";
+ return "%vmovq\t{%1, %0|%0, %1}";
case MODE_DF:
- return "movsd\t{%1, %0|%0, %1}";
+ if (TARGET_AVX)
+ {
+ if (REG_P (operands[0]) && REG_P (operands[1]))
+ return "vmovsd\t{%1, %0, %0|%0, %0, %1}";
+ else
+ return "vmovsd\t{%1, %0|%0, %1}";
+ }
+ else
+ return "movsd\t{%1, %0|%0, %1}";
case MODE_V1DF:
- return "movlpd\t{%1, %0|%0, %1}";
+ return "%vmovlpd\t{%1, %d0|%d0, %1}";
case MODE_V2SF:
- return "movlps\t{%1, %0|%0, %1}";
+ return "%vmovlps\t{%1, %d0|%d0, %1}";
default:
gcc_unreachable ();
}
case 9:
case 10:
- return "movd\t{%1, %0|%0, %1}";
+ return "%vmovd\t{%1, %0|%0, %1}";
default:
gcc_unreachable();
}
}
[(set_attr "type" "fmov,fmov,fmov,multi,multi,sselog1,ssemov,ssemov,ssemov,ssemov,ssemov")
+ (set (attr "prefix")
+ (if_then_else (eq_attr "alternative" "0,1,2,3,4")
+ (const_string "orig")
+ (const_string "maybe_vex")))
(set (attr "mode")
(cond [(eq_attr "alternative" "0,1,2")
(const_string "DF")
@@ -2962,7 +3139,7 @@
/* xorps is one byte shorter. */
(eq_attr "alternative" "5")
- (cond [(ne (symbol_ref "optimize_size")
+ (cond [(ne (symbol_ref "optimize_function_for_size_p (cfun)")
(const_int 0))
(const_string "V4SF")
(ne (symbol_ref "TARGET_SSE_LOAD0_BY_PXOR")
@@ -2978,7 +3155,7 @@
movaps encodes one byte shorter. */
(eq_attr "alternative" "6")
(cond
- [(ne (symbol_ref "optimize_size")
+ [(ne (symbol_ref "optimize_function_for_size_p (cfun)")
(const_int 0))
(const_string "V4SF")
(ne (symbol_ref "TARGET_SSE_PARTIAL_REG_DEPENDENCY")
@@ -3004,10 +3181,12 @@
(match_operand:DF 1 "general_operand"
"fm,f,G,roF,Fr,C ,Y2*x,m ,Y2*x"))]
"!(MEM_P (operands[0]) && MEM_P (operands[1]))
- && !optimize_size && TARGET_INTEGER_DFMODE_MOVES
+ && optimize_function_for_speed_p (cfun)
+ && TARGET_INTEGER_DFMODE_MOVES
&& (reload_in_progress || reload_completed
|| (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
- || (!(TARGET_SSE2 && TARGET_SSE_MATH) && optimize_size
+ || (!(TARGET_SSE2 && TARGET_SSE_MATH)
+ && optimize_function_for_size_p (cfun)
&& standard_80387_constant_p (operands[1]))
|| GET_CODE (operands[1]) != CONST_DOUBLE
|| memory_operand (operands[0], DFmode))"
@@ -3080,7 +3259,7 @@
/* xorps is one byte shorter. */
(eq_attr "alternative" "5")
- (cond [(ne (symbol_ref "optimize_size")
+ (cond [(ne (symbol_ref "optimize_function_for_size_p (cfun)")
(const_int 0))
(const_string "V4SF")
(ne (symbol_ref "TARGET_SSE_LOAD0_BY_PXOR")
@@ -3096,7 +3275,7 @@
movaps encodes one byte shorter. */
(eq_attr "alternative" "6")
(cond
- [(ne (symbol_ref "optimize_size")
+ [(ne (symbol_ref "optimize_function_for_size_p (cfun)")
(const_int 0))
(const_string "V4SF")
(ne (symbol_ref "TARGET_SSE_PARTIAL_REG_DEPENDENCY")
@@ -3161,7 +3340,7 @@
(define_insn "*pushxf_nointeger"
[(set (match_operand:XF 0 "push_operand" "=X,X,X")
(match_operand:XF 1 "general_no_elim_operand" "f,Fo,*r"))]
- "optimize_size"
+ "optimize_function_for_size_p (cfun)"
{
/* This insn should be already split before reg-stack. */
gcc_unreachable ();
@@ -3173,7 +3352,7 @@
(define_insn "*pushxf_integer"
[(set (match_operand:XF 0 "push_operand" "=<,<")
(match_operand:XF 1 "general_no_elim_operand" "f,ro"))]
- "!optimize_size"
+ "optimize_function_for_speed_p (cfun)"
{
/* This insn should be already split before reg-stack. */
gcc_unreachable ();
@@ -3204,10 +3383,10 @@
(define_insn "*movxf_nointeger"
[(set (match_operand:XF 0 "nonimmediate_operand" "=f,m,f,*r,o")
(match_operand:XF 1 "general_operand" "fm,f,G,*roF,F*r"))]
- "optimize_size
+ "optimize_function_for_size_p (cfun)
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))
&& (reload_in_progress || reload_completed
- || (optimize_size && standard_80387_constant_p (operands[1]))
+ || standard_80387_constant_p (operands[1])
|| GET_CODE (operands[1]) != CONST_DOUBLE
|| memory_operand (operands[0], XFmode))"
{
@@ -3232,10 +3411,9 @@
(define_insn "*movxf_integer"
[(set (match_operand:XF 0 "nonimmediate_operand" "=f,m,f,r,o")
(match_operand:XF 1 "general_operand" "fm,f,G,roF,Fr"))]
- "!optimize_size
+ "optimize_function_for_speed_p (cfun)
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))
&& (reload_in_progress || reload_completed
- || (optimize_size && standard_80387_constant_p (operands[1]))
|| GET_CODE (operands[1]) != CONST_DOUBLE
|| memory_operand (operands[0], XFmode))"
{
@@ -3278,14 +3456,14 @@
case 0:
case 1:
if (get_attr_mode (insn) == MODE_V4SF)
- return "movaps\t{%1, %0|%0, %1}";
+ return "%vmovaps\t{%1, %0|%0, %1}";
else
- return "movdqa\t{%1, %0|%0, %1}";
+ return "%vmovdqa\t{%1, %0|%0, %1}";
case 2:
if (get_attr_mode (insn) == MODE_V4SF)
- return "xorps\t%0, %0";
+ return "%vxorps\t%0, %d0";
else
- return "pxor\t%0, %0";
+ return "%vpxor\t%0, %d0";
case 3:
case 4:
return "#";
@@ -3294,10 +3472,11 @@
}
}
[(set_attr "type" "ssemov,ssemov,sselog1,*,*")
+ (set_attr "prefix" "maybe_vex,maybe_vex,maybe_vex,*,*")
(set (attr "mode")
(cond [(eq_attr "alternative" "0,2")
(if_then_else
- (ne (symbol_ref "optimize_size")
+ (ne (symbol_ref "optimize_function_for_size_p (cfun)")
(const_int 0))
(const_string "V4SF")
(const_string "TI"))
@@ -3305,7 +3484,7 @@
(if_then_else
(ior (ne (symbol_ref "TARGET_SSE_TYPELESS_STORES")
(const_int 0))
- (ne (symbol_ref "optimize_size")
+ (ne (symbol_ref "optimize_function_for_size_p (cfun)")
(const_int 0)))
(const_string "V4SF")
(const_string "TI"))]
@@ -3468,7 +3647,7 @@
(zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "")))]
""
{
- if (TARGET_ZERO_EXTEND_WITH_AND && !optimize_size)
+ if (TARGET_ZERO_EXTEND_WITH_AND && optimize_function_for_speed_p (cfun))
{
operands[1] = force_reg (HImode, operands[1]);
emit_insn (gen_zero_extendhisi2_and (operands[0], operands[1]));
@@ -3480,7 +3659,7 @@
[(set (match_operand:SI 0 "register_operand" "=r")
(zero_extend:SI (match_operand:HI 1 "register_operand" "0")))
(clobber (reg:CC FLAGS_REG))]
- "TARGET_ZERO_EXTEND_WITH_AND && !optimize_size"
+ "TARGET_ZERO_EXTEND_WITH_AND && optimize_function_for_speed_p (cfun)"
"#"
[(set_attr "type" "alu1")
(set_attr "mode" "SI")])
@@ -3489,7 +3668,8 @@
[(set (match_operand:SI 0 "register_operand" "")
(zero_extend:SI (match_operand:HI 1 "register_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "reload_completed && TARGET_ZERO_EXTEND_WITH_AND && !optimize_size"
+ "reload_completed && TARGET_ZERO_EXTEND_WITH_AND
+ && optimize_function_for_speed_p (cfun)"
[(parallel [(set (match_dup 0) (and:SI (match_dup 0) (const_int 65535)))
(clobber (reg:CC FLAGS_REG))])]
"")
@@ -3497,7 +3677,8 @@
(define_insn "*zero_extendhisi2_movzwl"
[(set (match_operand:SI 0 "register_operand" "=r")
(zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "rm")))]
- "!TARGET_ZERO_EXTEND_WITH_AND || optimize_size"
+ "!TARGET_ZERO_EXTEND_WITH_AND
+ || optimize_function_for_size_p (cfun)"
"movz{wl|x}\t{%1, %0|%0, %1}"
[(set_attr "type" "imovx")
(set_attr "mode" "SI")])
@@ -3514,7 +3695,7 @@
[(set (match_operand:HI 0 "register_operand" "=r,?&q")
(zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "0,qm")))
(clobber (reg:CC FLAGS_REG))]
- "TARGET_ZERO_EXTEND_WITH_AND && !optimize_size"
+ "TARGET_ZERO_EXTEND_WITH_AND && optimize_function_for_speed_p (cfun)"
"#"
[(set_attr "type" "alu1")
(set_attr "mode" "HI")])
@@ -3523,7 +3704,7 @@
[(set (match_operand:HI 0 "register_operand" "=r,r")
(zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "qm,0")))
(clobber (reg:CC FLAGS_REG))]
- "!TARGET_ZERO_EXTEND_WITH_AND || optimize_size"
+ "!TARGET_ZERO_EXTEND_WITH_AND || optimize_function_for_size_p (cfun)"
"#"
[(set_attr "type" "imovx,alu1")
(set_attr "mode" "HI")])
@@ -3532,7 +3713,8 @@
(define_insn "*zero_extendqihi2_movzbl"
[(set (match_operand:HI 0 "register_operand" "=r")
(zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "qm")))]
- "(!TARGET_ZERO_EXTEND_WITH_AND || optimize_size) && reload_completed"
+ "(!TARGET_ZERO_EXTEND_WITH_AND || optimize_function_for_speed_p (cfun))
+ && reload_completed"
"movz{bl|x}\t{%1, %k0|%k0, %1}"
[(set_attr "type" "imovx")
(set_attr "mode" "SI")])
@@ -3543,7 +3725,8 @@
(zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "")))
(clobber (reg:CC FLAGS_REG))]
"reload_completed
- && (!TARGET_ZERO_EXTEND_WITH_AND || optimize_size)
+ && (!TARGET_ZERO_EXTEND_WITH_AND
+ || optimize_function_for_size_p (cfun))
&& (!REG_P (operands[1]) || ANY_QI_REG_P (operands[1]))"
[(set (match_operand:HI 0 "register_operand" "")
(zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "")))])
@@ -3556,7 +3739,8 @@
(clobber (reg:CC FLAGS_REG))]
"reload_completed
&& ANY_QI_REG_P (operands[0])
- && (TARGET_ZERO_EXTEND_WITH_AND && !optimize_size)
+ && (TARGET_ZERO_EXTEND_WITH_AND
+ && optimize_function_for_speed_p (cfun))
&& !reg_overlap_mentioned_p (operands[0], operands[1])"
[(set (match_dup 0) (const_int 0))
(set (strict_low_part (match_dup 2)) (match_dup 1))]
@@ -3585,7 +3769,7 @@
[(set (match_operand:SI 0 "register_operand" "=r,?&q")
(zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "0,qm")))
(clobber (reg:CC FLAGS_REG))]
- "TARGET_ZERO_EXTEND_WITH_AND && !optimize_size"
+ "TARGET_ZERO_EXTEND_WITH_AND && optimize_function_for_speed_p (cfun)"
"#"
[(set_attr "type" "alu1")
(set_attr "mode" "SI")])
@@ -3594,7 +3778,7 @@
[(set (match_operand:SI 0 "register_operand" "=r,r")
(zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "qm,0")))
(clobber (reg:CC FLAGS_REG))]
- "!TARGET_ZERO_EXTEND_WITH_AND || optimize_size"
+ "!TARGET_ZERO_EXTEND_WITH_AND || optimize_function_for_size_p (cfun)"
"#"
[(set_attr "type" "imovx,alu1")
(set_attr "mode" "SI")])
@@ -3602,7 +3786,8 @@
(define_insn "*zero_extendqisi2_movzbw"
[(set (match_operand:SI 0 "register_operand" "=r")
(zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "qm")))]
- "(!TARGET_ZERO_EXTEND_WITH_AND || optimize_size) && reload_completed"
+ "(!TARGET_ZERO_EXTEND_WITH_AND || optimize_function_for_size_p (cfun))
+ && reload_completed"
"movz{bl|x}\t{%1, %0|%0, %1}"
[(set_attr "type" "imovx")
(set_attr "mode" "SI")])
@@ -3613,7 +3798,7 @@
(zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))
(clobber (reg:CC FLAGS_REG))]
"reload_completed
- && (!TARGET_ZERO_EXTEND_WITH_AND || optimize_size)
+ && (!TARGET_ZERO_EXTEND_WITH_AND || optimize_function_for_size_p (cfun))
&& (!REG_P (operands[1]) || ANY_QI_REG_P (operands[1]))"
[(set (match_dup 0)
(zero_extend:SI (match_dup 1)))])
@@ -3627,7 +3812,7 @@
"reload_completed
&& ANY_QI_REG_P (operands[0])
&& (ANY_QI_REG_P (operands[1]) || MEM_P (operands[1]))
- && (TARGET_ZERO_EXTEND_WITH_AND && !optimize_size)
+ && (TARGET_ZERO_EXTEND_WITH_AND && optimize_function_for_speed_p (cfun))
&& !reg_overlap_mentioned_p (operands[0], operands[1])"
[(set (match_dup 0) (const_int 0))
(set (strict_low_part (match_dup 2)) (match_dup 1))]
@@ -3669,10 +3854,11 @@
#
movd\t{%1, %0|%0, %1}
movd\t{%1, %0|%0, %1}
- movd\t{%1, %0|%0, %1}
- movd\t{%1, %0|%0, %1}"
- [(set_attr "mode" "SI,SI,SI,DI,DI,TI,TI")
- (set_attr "type" "multi,multi,multi,mmxmov,mmxmov,ssemov,ssemov")])
+ %vmovd\t{%1, %0|%0, %1}
+ %vmovd\t{%1, %0|%0, %1}"
+ [(set_attr "type" "multi,multi,multi,mmxmov,mmxmov,ssemov,ssemov")
+ (set_attr "prefix" "*,*,*,orig,orig,maybe_vex,maybe_vex")
+ (set_attr "mode" "SI,SI,SI,DI,DI,TI,TI")])
(define_insn "zero_extendsidi2_rex64"
[(set (match_operand:DI 0 "nonimmediate_operand" "=r,o,?*Ym,?*y,?*Yi,*Y2")
@@ -3684,9 +3870,10 @@
#
movd\t{%1, %0|%0, %1}
movd\t{%1, %0|%0, %1}
- movd\t{%1, %0|%0, %1}
- movd\t{%1, %0|%0, %1}"
+ %vmovd\t{%1, %0|%0, %1}
+ %vmovd\t{%1, %0|%0, %1}"
[(set_attr "type" "imovx,imov,mmxmov,mmxmov,ssemov,ssemov")
+ (set_attr "prefix" "orig,*,orig,orig,maybe_vex,maybe_vex")
(set_attr "mode" "SI,DI,DI,DI,TI,TI")])
(define_split
@@ -3812,7 +3999,7 @@
emit_move_insn (operands[3], operands[1]);
/* Generate a cltd if possible and doing so it profitable. */
- if ((optimize_size || TARGET_USE_CLTD)
+ if ((optimize_function_for_size_p (cfun) || TARGET_USE_CLTD)
&& true_regnum (operands[1]) == AX_REG
&& true_regnum (operands[2]) == DX_REG)
{
@@ -3843,7 +4030,7 @@
emit_move_insn (operands[3], operands[1]);
/* Generate a cltd if possible and doing so it profitable. */
- if ((optimize_size || TARGET_USE_CLTD)
+ if ((optimize_function_for_size_p (cfun) || TARGET_USE_CLTD)
&& true_regnum (operands[3]) == AX_REG)
{
emit_insn (gen_ashrsi3_31 (operands[4], operands[3], GEN_INT (31)));
@@ -4026,7 +4213,8 @@
[(set (match_operand:DF 0 "register_operand" "")
(float_extend:DF
(match_operand:SF 1 "nonimmediate_operand" "")))]
- "(TARGET_USE_VECTOR_CONVERTS || TARGET_GENERIC) && !optimize_size
+ "(TARGET_USE_VECTOR_CONVERTS || TARGET_GENERIC)
+ && optimize_insn_for_speed_p ()
&& reload_completed && SSE_REG_P (operands[0])"
[(set (match_dup 2)
(float_extend:V2DF
@@ -4071,21 +4259,23 @@
return output_387_reg_move (insn, operands);
case 2:
- return "cvtss2sd\t{%1, %0|%0, %1}";
+ return "%vcvtss2sd\t{%1, %d0|%d0, %1}";
default:
gcc_unreachable ();
}
}
[(set_attr "type" "fmov,fmov,ssecvt")
+ (set_attr "prefix" "orig,orig,maybe_vex")
(set_attr "mode" "SF,XF,DF")])
(define_insn "*extendsfdf2_sse"
[(set (match_operand:DF 0 "nonimmediate_operand" "=x")
(float_extend:DF (match_operand:SF 1 "nonimmediate_operand" "xm")))]
"TARGET_SSE2 && TARGET_SSE_MATH"
- "cvtss2sd\t{%1, %0|%0, %1}"
+ "%vcvtss2sd\t{%1, %d0|%d0, %1}"
[(set_attr "type" "ssecvt")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "DF")])
(define_insn "*extendsfdf2_i387"
@@ -4163,7 +4353,8 @@
[(set (match_operand:SF 0 "register_operand" "")
(float_truncate:SF
(match_operand:DF 1 "nonimmediate_operand" "")))]
- "(TARGET_USE_VECTOR_CONVERTS || TARGET_GENERIC) && !optimize_size
+ "(TARGET_USE_VECTOR_CONVERTS || TARGET_GENERIC)
+ && optimize_insn_for_speed_p ()
&& reload_completed && SSE_REG_P (operands[0])"
[(set (match_dup 2)
(vec_concat:V4SF
@@ -4214,12 +4405,13 @@
case 0:
return output_387_reg_move (insn, operands);
case 1:
- return "cvtsd2ss\t{%1, %0|%0, %1}";
+ return "%vcvtsd2ss\t{%1, %d0|%d0, %1}";
default:
gcc_unreachable ();
}
}
[(set_attr "type" "fmov,ssecvt")
+ (set_attr "prefix" "orig,maybe_vex")
(set_attr "mode" "SF")])
;; Yes, this one doesn't depend on flag_unsafe_math_optimizations,
@@ -4229,8 +4421,9 @@
(float_truncate:SF
(match_operand:DF 1 "nonimmediate_operand" "xm")))]
"TARGET_SSE2 && TARGET_SSE_MATH"
- "cvtsd2ss\t{%1, %0|%0, %1}"
+ "%vcvtsd2ss\t{%1, %d0|%d0, %1}"
[(set_attr "type" "ssecvt")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "SF")])
(define_insn "*truncdfsf_fast_i387"
@@ -4257,13 +4450,14 @@
case 1:
return "#";
case 2:
- return "cvtsd2ss\t{%1, %0|%0, %1}";
+ return "%vcvtsd2ss\t{%1, %d0|%d0, %1}";
default:
gcc_unreachable ();
}
}
[(set_attr "type" "fmov,multi,ssecvt")
(set_attr "unit" "*,i387,*")
+ (set_attr "prefix" "orig,orig,maybe_vex")
(set_attr "mode" "SF")])
(define_insn "*truncdfsf_i387"
@@ -4500,13 +4694,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);
@@ -4520,7 +4717,8 @@
(use (match_operand:<ssevecmode> 4 "nonimmediate_operand" "m,x"))
(clobber (match_scratch:<ssevecmode> 1 "=x,&x"))
(clobber (match_scratch:<ssevecmode> 2 "=x,x"))]
- "!TARGET_64BIT && TARGET_SSE2 && TARGET_SSE_MATH && !optimize_size"
+ "!TARGET_64BIT && TARGET_SSE2 && TARGET_SSE_MATH
+ && optimize_function_for_speed_p (cfun)"
"#"
"&& reload_completed"
[(const_int 0)]
@@ -4547,8 +4745,9 @@
(fix:DI (match_operand:MODEF 1 "nonimmediate_operand" "x,m")))]
"TARGET_64BIT && SSE_FLOAT_MODE_P (<MODE>mode)
&& (!TARGET_FISTTP || TARGET_SSE_MATH)"
- "cvtts<ssemodefsuffix>2si{q}\t{%1, %0|%0, %1}"
+ "%vcvtts<ssemodefsuffix>2si{q}\t{%1, %0|%0, %1}"
[(set_attr "type" "sseicvt")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "<MODE>")
(set_attr "athlon_decode" "double,vector")
(set_attr "amdfam10_decode" "double,double")])
@@ -4558,8 +4757,9 @@
(fix:SI (match_operand:MODEF 1 "nonimmediate_operand" "x,m")))]
"SSE_FLOAT_MODE_P (<MODE>mode)
&& (!TARGET_FISTTP || TARGET_SSE_MATH)"
- "cvtts<ssemodefsuffix>2si\t{%1, %0|%0, %1}"
+ "%vcvtts<ssemodefsuffix>2si\t{%1, %0|%0, %1}"
[(set_attr "type" "sseicvt")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "<MODE>")
(set_attr "athlon_decode" "double,vector")
(set_attr "amdfam10_decode" "double,double")])
@@ -4580,7 +4780,7 @@
[(match_scratch:DF 2 "Y2")
(set (match_operand:SSEMODEI24 0 "register_operand" "")
(fix:SSEMODEI24 (match_operand:DF 1 "memory_operand" "")))]
- "TARGET_AVOID_VECTOR_DECODE && !optimize_size"
+ "TARGET_AVOID_VECTOR_DECODE && optimize_insn_for_speed_p ()"
[(set (match_dup 2) (match_dup 1))
(set (match_dup 0) (fix:SSEMODEI24 (match_dup 2)))]
"")
@@ -4589,7 +4789,7 @@
[(match_scratch:SF 2 "x")
(set (match_operand:SSEMODEI24 0 "register_operand" "")
(fix:SSEMODEI24 (match_operand:SF 1 "memory_operand" "")))]
- "TARGET_AVOID_VECTOR_DECODE && !optimize_size"
+ "TARGET_AVOID_VECTOR_DECODE && optimize_insn_for_speed_p ()"
[(set (match_dup 2) (match_dup 1))
(set (match_dup 0) (fix:SSEMODEI24 (match_dup 2)))]
"")
@@ -4932,9 +5132,11 @@
|| ((<SSEMODEI24:MODE>mode != DImode || TARGET_64BIT)
&& SSE_FLOAT_MODE_P (<X87MODEF:MODE>mode) && TARGET_SSE_MATH
&& ((<SSEMODEI24:MODE>mode == SImode
- && TARGET_SSE2 && TARGET_USE_VECTOR_CONVERTS && !optimize_size
+ && TARGET_SSE2 && TARGET_USE_VECTOR_CONVERTS
+ && optimize_function_for_speed_p (cfun)
&& flag_trapping_math)
- || !(TARGET_INTER_UNIT_CONVERSIONS || optimize_size))))
+ || !(TARGET_INTER_UNIT_CONVERSIONS
+ || optimize_function_for_size_p (cfun)))))
&& !(reload_completed || reload_in_progress)"
"#"
"&& 1"
@@ -4947,7 +5149,7 @@
by passing DImode value through XMM registers. */
if (<SSEMODEI24:MODE>mode == DImode && !TARGET_64BIT
&& TARGET_80387 && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES
- && !optimize_size)
+ && optimize_function_for_speed_p (cfun))
{
emit_insn (gen_floatdi<X87MODEF:mode>2_i387_with_xmm (operands[0],
operands[1],
@@ -4962,7 +5164,7 @@
(match_operand:SI 1 "nonimmediate_operand" "m,?r,r,m,!x")))
(clobber (match_operand:SI 2 "memory_operand" "=X,m,m,X,m"))]
"TARGET_SSE2 && TARGET_MIX_SSE_I387
- && TARGET_USE_VECTOR_CONVERTS && !optimize_size"
+ && TARGET_USE_VECTOR_CONVERTS && optimize_function_for_speed_p (cfun)"
"#"
[(set_attr "type" "fmov,multi,sseicvt,sseicvt,sseicvt")
(set_attr "mode" "<MODE>,<MODE>,<MODE>,<MODE>,<ssevecmode>")
@@ -4975,7 +5177,7 @@
[(set (match_operand:MODEF 0 "register_operand" "=f,x")
(float:MODEF (match_operand:SI 1 "memory_operand" "m,m")))]
"TARGET_SSE2 && TARGET_MIX_SSE_I387
- && TARGET_USE_VECTOR_CONVERTS && !optimize_size"
+ && TARGET_USE_VECTOR_CONVERTS && optimize_function_for_speed_p (cfun)"
"@
fild%z1\t%1
#"
@@ -5021,7 +5223,7 @@
(clobber (match_operand:SSEMODEI24 2 "memory_operand" ""))]
"(<SSEMODEI24:MODE>mode != DImode || TARGET_64BIT)
&& SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_MIX_SSE_I387
- && !(TARGET_INTER_UNIT_CONVERSIONS || optimize_size)
+ && !(TARGET_INTER_UNIT_CONVERSIONS || optimize_function_for_size_p (cfun))
&& reload_completed
&& (SSE_REG_P (operands[0])
|| (GET_CODE (operands[0]) == SUBREG
@@ -5036,12 +5238,13 @@
(match_operand:SSEMODEI24 1 "nonimmediate_operand" "m,r,m")))]
"(<SSEMODEI24:MODE>mode != DImode || TARGET_64BIT)
&& SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_MIX_SSE_I387
- && (TARGET_INTER_UNIT_CONVERSIONS || optimize_size)"
+ && (TARGET_INTER_UNIT_CONVERSIONS || optimize_function_for_size_p (cfun))"
"@
fild%z1\t%1
- cvtsi2s<MODEF:ssemodefsuffix><SSEMODEI24:rex64suffix>\t{%1, %0|%0, %1}
- cvtsi2s<MODEF:ssemodefsuffix><SSEMODEI24:rex64suffix>\t{%1, %0|%0, %1}"
+ %vcvtsi2s<MODEF:ssemodefsuffix><SSEMODEI24:rex64suffix>\t{%1, %d0|%d0, %1}
+ %vcvtsi2s<MODEF:ssemodefsuffix><SSEMODEI24:rex64suffix>\t{%1, %d0|%d0, %1}"
[(set_attr "type" "fmov,sseicvt,sseicvt")
+ (set_attr "prefix" "orig,maybe_vex,maybe_vex")
(set_attr "mode" "<MODEF:MODE>")
(set_attr "unit" "i387,*,*")
(set_attr "athlon_decode" "*,double,direct")
@@ -5054,11 +5257,12 @@
(match_operand:SSEMODEI24 1 "memory_operand" "m,m")))]
"(<SSEMODEI24:MODE>mode != DImode || TARGET_64BIT)
&& SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_MIX_SSE_I387
- && !(TARGET_INTER_UNIT_CONVERSIONS || optimize_size)"
+ && !(TARGET_INTER_UNIT_CONVERSIONS || optimize_function_for_size_p (cfun))"
"@
fild%z1\t%1
- cvtsi2s<MODEF:ssemodefsuffix><SSEMODEI24:rex64suffix>\t{%1, %0|%0, %1}"
+ %vcvtsi2s<MODEF:ssemodefsuffix><SSEMODEI24:rex64suffix>\t{%1, %d0|%d0, %1}"
[(set_attr "type" "fmov,sseicvt")
+ (set_attr "prefix" "orig,maybe_vex")
(set_attr "mode" "<MODEF:MODE>")
(set_attr "athlon_decode" "*,direct")
(set_attr "amdfam10_decode" "*,double")
@@ -5070,7 +5274,7 @@
(match_operand:SI 1 "nonimmediate_operand" "r,m,!x")))
(clobber (match_operand:SI 2 "memory_operand" "=m,X,m"))]
"TARGET_SSE2 && TARGET_SSE_MATH
- && TARGET_USE_VECTOR_CONVERTS && !optimize_size"
+ && TARGET_USE_VECTOR_CONVERTS && optimize_function_for_speed_p (cfun)"
"#"
[(set_attr "type" "sseicvt")
(set_attr "mode" "<MODE>,<MODE>,<ssevecmode>")
@@ -5082,7 +5286,7 @@
[(set (match_operand:MODEF 0 "register_operand" "=x")
(float:MODEF (match_operand:SI 1 "memory_operand" "m")))]
"TARGET_SSE2 && TARGET_SSE_MATH
- && TARGET_USE_VECTOR_CONVERTS && !optimize_size"
+ && TARGET_USE_VECTOR_CONVERTS && optimize_function_for_speed_p (cfun)"
"#"
[(set_attr "type" "sseicvt")
(set_attr "mode" "<MODE>")
@@ -5095,7 +5299,7 @@
(float:MODEF (match_operand:SI 1 "register_operand" "")))
(clobber (match_operand:SI 2 "memory_operand" ""))]
"TARGET_SSE2 && TARGET_SSE_MATH
- && TARGET_USE_VECTOR_CONVERTS && !optimize_size
+ && TARGET_USE_VECTOR_CONVERTS && optimize_function_for_speed_p (cfun)
&& reload_completed
&& (SSE_REG_P (operands[0])
|| (GET_CODE (operands[0]) == SUBREG
@@ -5136,7 +5340,7 @@
(float:MODEF (match_operand:SI 1 "memory_operand" "")))
(clobber (match_operand:SI 2 "memory_operand" ""))]
"TARGET_SSE2 && TARGET_SSE_MATH
- && TARGET_USE_VECTOR_CONVERTS && !optimize_size
+ && TARGET_USE_VECTOR_CONVERTS && optimize_function_for_speed_p (cfun)
&& reload_completed
&& (SSE_REG_P (operands[0])
|| (GET_CODE (operands[0]) == SUBREG
@@ -5158,7 +5362,7 @@
[(set (match_operand:MODEF 0 "register_operand" "")
(float:MODEF (match_operand:SI 1 "register_operand" "")))]
"TARGET_SSE2 && TARGET_SSE_MATH
- && TARGET_USE_VECTOR_CONVERTS && !optimize_size
+ && TARGET_USE_VECTOR_CONVERTS && optimize_function_for_speed_p (cfun)
&& reload_completed
&& (SSE_REG_P (operands[0])
|| (GET_CODE (operands[0]) == SUBREG
@@ -5190,7 +5394,7 @@
[(set (match_operand:MODEF 0 "register_operand" "")
(float:MODEF (match_operand:SI 1 "memory_operand" "")))]
"TARGET_SSE2 && TARGET_SSE_MATH
- && TARGET_USE_VECTOR_CONVERTS && !optimize_size
+ && TARGET_USE_VECTOR_CONVERTS && optimize_function_for_speed_p (cfun)
&& reload_completed
&& (SSE_REG_P (operands[0])
|| (GET_CODE (operands[0]) == SUBREG
@@ -5228,9 +5432,10 @@
(match_operand:SSEMODEI24 1 "nonimmediate_operand" "r,m")))]
"(<SSEMODEI24:MODE>mode != DImode || TARGET_64BIT)
&& SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_SSE_MATH
- && (TARGET_INTER_UNIT_CONVERSIONS || optimize_size)"
- "cvtsi2s<MODEF:ssemodefsuffix><SSEMODEI24:rex64suffix>\t{%1, %0|%0, %1}"
+ && (TARGET_INTER_UNIT_CONVERSIONS || optimize_function_for_size_p (cfun))"
+ "%vcvtsi2s<MODEF:ssemodefsuffix><SSEMODEI24:rex64suffix>\t{%1, %d0|%d0, %1}"
[(set_attr "type" "sseicvt")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "<MODEF:MODE>")
(set_attr "athlon_decode" "double,direct")
(set_attr "amdfam10_decode" "vector,double")
@@ -5242,7 +5447,7 @@
(clobber (match_operand:SSEMODEI24 2 "memory_operand" ""))]
"(<SSEMODEI24:MODE>mode != DImode || TARGET_64BIT)
&& SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_SSE_MATH
- && (TARGET_INTER_UNIT_CONVERSIONS || optimize_size)
+ && (TARGET_INTER_UNIT_CONVERSIONS || optimize_function_for_size_p (cfun))
&& reload_completed
&& (SSE_REG_P (operands[0])
|| (GET_CODE (operands[0]) == SUBREG
@@ -5256,9 +5461,10 @@
(match_operand:SSEMODEI24 1 "memory_operand" "m")))]
"(<SSEMODEI24:MODE>mode != DImode || TARGET_64BIT)
&& SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_SSE_MATH
- && !(TARGET_INTER_UNIT_CONVERSIONS || optimize_size)"
- "cvtsi2s<MODEF:ssemodefsuffix><SSEMODEI24:rex64suffix>\t{%1, %0|%0, %1}"
+ && !(TARGET_INTER_UNIT_CONVERSIONS || optimize_function_for_size_p (cfun))"
+ "%vcvtsi2s<MODEF:ssemodefsuffix><SSEMODEI24:rex64suffix>\t{%1, %d0|%d0, %1}"
[(set_attr "type" "sseicvt")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "<MODEF:MODE>")
(set_attr "athlon_decode" "direct")
(set_attr "amdfam10_decode" "double")
@@ -5270,7 +5476,7 @@
(clobber (match_operand:SSEMODEI24 2 "memory_operand" ""))]
"(<SSEMODEI24:MODE>mode != DImode || TARGET_64BIT)
&& SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_SSE_MATH
- && !(TARGET_INTER_UNIT_CONVERSIONS || optimize_size)
+ && !(TARGET_INTER_UNIT_CONVERSIONS || optimize_function_for_size_p (cfun))
&& reload_completed
&& (SSE_REG_P (operands[0])
|| (GET_CODE (operands[0]) == SUBREG
@@ -5348,7 +5554,7 @@
(clobber (match_scratch:V4SI 4 "=X,x"))
(clobber (match_operand:DI 2 "memory_operand" "=X,m"))]
"TARGET_80387 && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES
- && !TARGET_64BIT && !optimize_size"
+ && !TARGET_64BIT && optimize_function_for_speed_p (cfun)"
"#"
[(set_attr "type" "multi")
(set_attr "mode" "<X87MODEF:MODE>")
@@ -5362,7 +5568,7 @@
(clobber (match_scratch:V4SI 4 ""))
(clobber (match_operand:DI 2 "memory_operand" ""))]
"TARGET_80387 && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES
- && !TARGET_64BIT && !optimize_size
+ && !TARGET_64BIT && optimize_function_for_speed_p (cfun)
&& reload_completed
&& FP_REG_P (operands[0])"
[(set (match_dup 2) (match_dup 3))
@@ -5386,7 +5592,7 @@
(clobber (match_scratch:V4SI 4 ""))
(clobber (match_operand:DI 2 "memory_operand" ""))]
"TARGET_80387 && TARGET_SSE2 && TARGET_INTER_UNIT_MOVES
- && !TARGET_64BIT && !optimize_size
+ && !TARGET_64BIT && optimize_function_for_speed_p (cfun)
&& reload_completed
&& FP_REG_P (operands[0])"
[(set (match_dup 0) (float:X87MODEF (match_dup 1)))]
@@ -5751,7 +5957,7 @@
(match_operand 3 "immediate_operand" "i")))]
"(GET_MODE (operands[0]) == QImode || GET_MODE (operands[0]) == HImode
|| (TARGET_64BIT && GET_MODE (operands[0]) == SImode))
- && (!TARGET_PARTIAL_REG_STALL || optimize_size)
+ && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& GET_MODE (operands[0]) == GET_MODE (operands[1])
&& GET_MODE (operands[0]) == GET_MODE (operands[2])
&& (GET_MODE (operands[0]) == GET_MODE (operands[3])
@@ -5803,7 +6009,7 @@
(match_operand 3 "nonmemory_operand" "ri")))]
"(GET_MODE (operands[0]) == QImode || GET_MODE (operands[0]) == HImode
|| (TARGET_64BIT && GET_MODE (operands[0]) == SImode))
- && (!TARGET_PARTIAL_REG_STALL || optimize_size)
+ && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& GET_MODE (operands[0]) == GET_MODE (operands[1])
&& (GET_MODE (operands[0]) == GET_MODE (operands[3])
|| GET_MODE (operands[3]) == VOIDmode)"
@@ -5853,7 +6059,7 @@
(match_operand 4 "immediate_operand" "i")))]
"(GET_MODE (operands[0]) == QImode || GET_MODE (operands[0]) == HImode
|| (TARGET_64BIT && GET_MODE (operands[0]) == SImode))
- && (!TARGET_PARTIAL_REG_STALL || optimize_size)
+ && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& GET_MODE (operands[0]) == GET_MODE (operands[1])
&& GET_MODE (operands[0]) == GET_MODE (operands[3])"
"#"
@@ -6950,7 +7156,7 @@
(plus:QI (match_dup 0)
(match_operand:QI 1 "general_operand" "qn,qnm")))
(clobber (reg:CC FLAGS_REG))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_size)
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))"
{
switch (get_attr_type (insn))
@@ -7563,7 +7769,7 @@
(minus:QI (match_dup 0)
(match_operand:QI 1 "general_operand" "qn,qm")))
(clobber (reg:CC FLAGS_REG))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_size)
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"sub{b}\t{%1, %0|%0, %1}"
[(set_attr "type" "alu1")
@@ -8213,7 +8419,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)
{
@@ -8245,7 +8451,7 @@
(set (match_operand:DI 1 "register_operand" "=&d,&d")
(mod:DI (match_dup 2) (match_dup 3)))
(clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT && !optimize_size && !TARGET_USE_CLTD"
+ "TARGET_64BIT && optimize_function_for_speed_p (cfun) && !TARGET_USE_CLTD"
"#"
[(set_attr "type" "multi")])
@@ -8256,7 +8462,7 @@
(set (match_operand:DI 1 "register_operand" "=&d")
(mod:DI (match_dup 2) (match_dup 3)))
(clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT && (optimize_size || TARGET_USE_CLTD)"
+ "TARGET_64BIT && (optimize_function_for_size_p (cfun) || TARGET_USE_CLTD)"
"#"
[(set_attr "type" "multi")])
@@ -8292,7 +8498,7 @@
(clobber (reg:CC FLAGS_REG))])]
{
/* Avoid use of cltd in favor of a mov+shift. */
- if (!TARGET_USE_CLTD && !optimize_size)
+ if (!TARGET_USE_CLTD && optimize_function_for_speed_p (cfun))
{
if (true_regnum (operands[1]))
emit_move_insn (operands[0], operands[1]);
@@ -8328,7 +8534,7 @@
(set (match_operand:SI 1 "register_operand" "=&d,&d")
(mod:SI (match_dup 2) (match_dup 3)))
(clobber (reg:CC FLAGS_REG))]
- "!optimize_size && !TARGET_USE_CLTD"
+ "optimize_function_for_speed_p (cfun) && !TARGET_USE_CLTD"
"#"
[(set_attr "type" "multi")])
@@ -8339,7 +8545,7 @@
(set (match_operand:SI 1 "register_operand" "=&d")
(mod:SI (match_dup 2) (match_dup 3)))
(clobber (reg:CC FLAGS_REG))]
- "optimize_size || TARGET_USE_CLTD"
+ "optimize_function_for_size_p (cfun) || TARGET_USE_CLTD"
"#"
[(set_attr "type" "multi")])
@@ -8375,7 +8581,7 @@
(clobber (reg:CC FLAGS_REG))])]
{
/* Avoid use of cltd in favor of a mov+shift. */
- if (!TARGET_USE_CLTD && !optimize_size)
+ if (!TARGET_USE_CLTD && optimize_function_for_speed_p (cfun))
{
if (true_regnum (operands[1]))
emit_move_insn (operands[0], operands[1]);
@@ -8978,7 +9184,7 @@
(and (match_dup 0)
(const_int -65536)))
(clobber (reg:CC FLAGS_REG))]
- "optimize_size || (TARGET_FAST_PREFIX && !TARGET_PARTIAL_REG_STALL)"
+ "optimize_function_for_size_p (cfun) || (TARGET_FAST_PREFIX && !TARGET_PARTIAL_REG_STALL)"
[(set (strict_low_part (match_dup 1)) (const_int 0))]
"operands[1] = gen_lowpart (HImode, operands[0]);")
@@ -8987,7 +9193,7 @@
(and (match_dup 0)
(const_int -256)))
(clobber (reg:CC FLAGS_REG))]
- "(optimize_size || !TARGET_PARTIAL_REG_STALL) && reload_completed"
+ "(optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_REG_STALL) && reload_completed"
[(set (strict_low_part (match_dup 1)) (const_int 0))]
"operands[1] = gen_lowpart (QImode, operands[0]);")
@@ -8996,7 +9202,7 @@
(and (match_dup 0)
(const_int -65281)))
(clobber (reg:CC FLAGS_REG))]
- "(optimize_size || !TARGET_PARTIAL_REG_STALL) && reload_completed"
+ "(optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_REG_STALL) && reload_completed"
[(parallel [(set (zero_extract:SI (match_dup 0)
(const_int 8)
(const_int 8))
@@ -9119,7 +9325,7 @@
(and:QI (match_dup 0)
(match_operand:QI 1 "general_operand" "qn,qmn")))
(clobber (reg:CC FLAGS_REG))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_size)
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"and{b}\t{%1, %0|%0, %1}"
[(set_attr "type" "alu1")
@@ -9171,7 +9377,7 @@
(const_int 0)))
(set (strict_low_part (match_dup 0))
(and:QI (match_dup 0) (match_dup 1)))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_size)
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCNOmode)
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"and{b}\t{%1, %0|%0, %1}"
@@ -9295,7 +9501,7 @@
(clobber (reg:CC FLAGS_REG))]
"reload_completed
&& QI_REG_P (operands[0])
- && (!TARGET_PARTIAL_REG_STALL || optimize_size)
+ && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(~INTVAL (operands[2]) & ~(255 << 8))
&& GET_MODE (operands[0]) != QImode"
[(parallel [(set (zero_extract:SI (match_dup 0) (const_int 8) (const_int 8))
@@ -9316,7 +9522,7 @@
(clobber (reg:CC FLAGS_REG))]
"reload_completed
&& ANY_QI_REG_P (operands[0])
- && (!TARGET_PARTIAL_REG_STALL || optimize_size)
+ && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(~INTVAL (operands[2]) & ~255)
&& !(INTVAL (operands[2]) & 128)
&& GET_MODE (operands[0]) != QImode"
@@ -9539,7 +9745,7 @@
(ior:QI (match_dup 0)
(match_operand:QI 1 "general_operand" "qmn,qn")))
(clobber (reg:CC FLAGS_REG))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_size)
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"or{b}\t{%1, %0|%0, %1}"
[(set_attr "type" "alu1")
@@ -9565,7 +9771,7 @@
(const_int 0)))
(set (strict_low_part (match_dup 0))
(ior:QI (match_dup 0) (match_dup 1)))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_size)
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCNOmode)
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"or{b}\t{%1, %0|%0, %1}"
@@ -9584,7 +9790,7 @@
[(set_attr "type" "alu")
(set_attr "mode" "QI")])
-(define_insn "iorqi_ext_0"
+(define_insn "*iorqi_ext_0"
[(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
(const_int 8)
(const_int 8))
@@ -9595,7 +9801,7 @@
(const_int 8))
(match_operand 2 "const_int_operand" "n")))
(clobber (reg:CC FLAGS_REG))]
- "(!TARGET_PARTIAL_REG_STALL || optimize_size)"
+ "(!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))"
"or{b}\t{%2, %h0|%h0, %2}"
[(set_attr "type" "alu")
(set_attr "length_immediate" "1")
@@ -9614,7 +9820,7 @@
(match_operand:QI 2 "general_operand" "Qm"))))
(clobber (reg:CC FLAGS_REG))]
"!TARGET_64BIT
- && (!TARGET_PARTIAL_REG_STALL || optimize_size)"
+ && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))"
"or{b}\t{%2, %h0|%h0, %2}"
[(set_attr "type" "alu")
(set_attr "length_immediate" "0")
@@ -9633,7 +9839,7 @@
(match_operand 2 "ext_register_operand" "Q"))))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT
- && (!TARGET_PARTIAL_REG_STALL || optimize_size)"
+ && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))"
"or{b}\t{%2, %h0|%h0, %2}"
[(set_attr "type" "alu")
(set_attr "length_immediate" "0")
@@ -9651,7 +9857,7 @@
(const_int 8)
(const_int 8))))
(clobber (reg:CC FLAGS_REG))]
- "(!TARGET_PARTIAL_REG_STALL || optimize_size)"
+ "(!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))"
"ior{b}\t{%h2, %h0|%h0, %h2}"
[(set_attr "type" "alu")
(set_attr "length_immediate" "0")
@@ -9664,7 +9870,7 @@
(clobber (reg:CC FLAGS_REG))]
"reload_completed
&& QI_REG_P (operands[0])
- && (!TARGET_PARTIAL_REG_STALL || optimize_size)
+ && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(INTVAL (operands[2]) & ~(255 << 8))
&& GET_MODE (operands[0]) != QImode"
[(parallel [(set (zero_extract:SI (match_dup 0) (const_int 8) (const_int 8))
@@ -9685,7 +9891,7 @@
(clobber (reg:CC FLAGS_REG))]
"reload_completed
&& ANY_QI_REG_P (operands[0])
- && (!TARGET_PARTIAL_REG_STALL || optimize_size)
+ && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(INTVAL (operands[2]) & ~255)
&& (INTVAL (operands[2]) & 128)
&& GET_MODE (operands[0]) != QImode"
@@ -9908,13 +10114,13 @@
(xor:QI (match_dup 0)
(match_operand:QI 1 "general_operand" "qn,qmn")))
(clobber (reg:CC FLAGS_REG))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_size)
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"xor{b}\t{%1, %0|%0, %1}"
[(set_attr "type" "alu1")
(set_attr "mode" "QI")])
-(define_insn "xorqi_ext_0"
+(define_insn "*xorqi_ext_0"
[(set (zero_extract:SI (match_operand 0 "ext_register_operand" "=Q")
(const_int 8)
(const_int 8))
@@ -9925,7 +10131,7 @@
(const_int 8))
(match_operand 2 "const_int_operand" "n")))
(clobber (reg:CC FLAGS_REG))]
- "(!TARGET_PARTIAL_REG_STALL || optimize_size)"
+ "(!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))"
"xor{b}\t{%2, %h0|%h0, %2}"
[(set_attr "type" "alu")
(set_attr "length_immediate" "1")
@@ -9944,7 +10150,7 @@
(match_operand:QI 2 "general_operand" "Qm"))))
(clobber (reg:CC FLAGS_REG))]
"!TARGET_64BIT
- && (!TARGET_PARTIAL_REG_STALL || optimize_size)"
+ && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))"
"xor{b}\t{%2, %h0|%h0, %2}"
[(set_attr "type" "alu")
(set_attr "length_immediate" "0")
@@ -9963,7 +10169,7 @@
(match_operand 2 "ext_register_operand" "Q"))))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT
- && (!TARGET_PARTIAL_REG_STALL || optimize_size)"
+ && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))"
"xor{b}\t{%2, %h0|%h0, %2}"
[(set_attr "type" "alu")
(set_attr "length_immediate" "0")
@@ -9981,7 +10187,7 @@
(const_int 8)
(const_int 8))))
(clobber (reg:CC FLAGS_REG))]
- "(!TARGET_PARTIAL_REG_STALL || optimize_size)"
+ "(!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))"
"xor{b}\t{%h2, %h0|%h0, %h2}"
[(set_attr "type" "alu")
(set_attr "length_immediate" "0")
@@ -10008,7 +10214,7 @@
(const_int 0)))
(set (strict_low_part (match_dup 0))
(xor:QI (match_dup 0) (match_dup 1)))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_size)
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCNOmode)
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"xor{b}\t{%1, %0|%0, %1}"
@@ -10097,7 +10303,7 @@
(clobber (reg:CC FLAGS_REG))]
"reload_completed
&& QI_REG_P (operands[0])
- && (!TARGET_PARTIAL_REG_STALL || optimize_size)
+ && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(INTVAL (operands[2]) & ~(255 << 8))
&& GET_MODE (operands[0]) != QImode"
[(parallel [(set (zero_extract:SI (match_dup 0) (const_int 8) (const_int 8))
@@ -10118,7 +10324,7 @@
(clobber (reg:CC FLAGS_REG))]
"reload_completed
&& ANY_QI_REG_P (operands[0])
- && (!TARGET_PARTIAL_REG_STALL || optimize_size)
+ && (!TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(INTVAL (operands[2]) & ~255)
&& (INTVAL (operands[2]) & 128)
&& GET_MODE (operands[0]) != QImode"
@@ -10859,6 +11065,19 @@
;; This pattern must be defined before *ashlti3_1 to prevent
;; combine pass from converting sse2_ashlti3 to *ashlti3_1.
+(define_insn "*avx_ashlti3"
+ [(set (match_operand:TI 0 "register_operand" "=x")
+ (ashift:TI (match_operand:TI 1 "register_operand" "x")
+ (match_operand:SI 2 "const_0_to_255_mul_8_operand" "n")))]
+ "TARGET_AVX"
+{
+ operands[2] = GEN_INT (INTVAL (operands[2]) / 8);
+ return "vpslldq\t{%2, %1, %0|%0, %1, %2}";
+}
+ [(set_attr "type" "sseishft")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "sse2_ashlti3"
[(set (match_operand:TI 0 "register_operand" "=x")
(ashift:TI (match_operand:TI 1 "register_operand" "0")
@@ -10993,7 +11212,7 @@
if (REG_P (operands[2]))
return "sal{q}\t{%b2, %0|%0, %b2}";
else if (operands[2] == const1_rtx
- && (TARGET_SHIFT1 || optimize_size))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "sal{q}\t%0";
else
return "sal{q}\t{%2, %0|%0, %2}";
@@ -11036,7 +11255,7 @@
(set (match_operand:DI 0 "nonimmediate_operand" "=rm")
(ashift:DI (match_dup 1) (match_dup 2)))]
"TARGET_64BIT
- && (optimize_size
+ && (optimize_function_for_size_p (cfun)
|| !TARGET_PARTIAL_FLAG_REG_STALL
|| (operands[2] == const1_rtx
&& (TARGET_SHIFT1
@@ -11054,7 +11273,7 @@
if (REG_P (operands[2]))
return "sal{q}\t{%b2, %0|%0, %b2}";
else if (operands[2] == const1_rtx
- && (TARGET_SHIFT1 || optimize_size))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "sal{q}\t%0";
else
return "sal{q}\t{%2, %0|%0, %2}";
@@ -11078,7 +11297,7 @@
(const_int 0)))
(clobber (match_scratch:DI 0 "=r"))]
"TARGET_64BIT
- && (optimize_size
+ && (optimize_function_for_size_p (cfun)
|| !TARGET_PARTIAL_FLAG_REG_STALL
|| (operands[2] == const1_rtx
&& (TARGET_SHIFT1
@@ -11096,7 +11315,7 @@
if (REG_P (operands[2]))
return "sal{q}\t{%b2, %0|%0, %b2}";
else if (operands[2] == const1_rtx
- && (TARGET_SHIFT1 || optimize_size))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "sal{q}\t%0";
else
return "sal{q}\t{%2, %0|%0, %2}";
@@ -11233,7 +11452,7 @@
if (REG_P (operands[2]))
return "sal{l}\t{%b2, %0|%0, %b2}";
else if (operands[2] == const1_rtx
- && (TARGET_SHIFT1 || optimize_size))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "sal{l}\t%0";
else
return "sal{l}\t{%2, %0|%0, %2}";
@@ -11318,7 +11537,7 @@
if (REG_P (operands[2]))
return "sal{l}\t{%b2, %k0|%k0, %b2}";
else if (operands[2] == const1_rtx
- && (TARGET_SHIFT1 || optimize_size))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "sal{l}\t%k0";
else
return "sal{l}\t{%2, %k0|%k0, %2}";
@@ -11362,7 +11581,7 @@
(const_int 0)))
(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
(ashift:SI (match_dup 1) (match_dup 2)))]
- "(optimize_size
+ "(optimize_function_for_size_p (cfun)
|| !TARGET_PARTIAL_FLAG_REG_STALL
|| (operands[2] == const1_rtx
&& (TARGET_SHIFT1
@@ -11380,7 +11599,7 @@
if (REG_P (operands[2]))
return "sal{l}\t{%b2, %0|%0, %b2}";
else if (operands[2] == const1_rtx
- && (TARGET_SHIFT1 || optimize_size))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "sal{l}\t%0";
else
return "sal{l}\t{%2, %0|%0, %2}";
@@ -11403,7 +11622,7 @@
(match_operand:QI 2 "const_1_to_31_operand" "I"))
(const_int 0)))
(clobber (match_scratch:SI 0 "=r"))]
- "(optimize_size
+ "(optimize_function_for_size_p (cfun)
|| !TARGET_PARTIAL_FLAG_REG_STALL
|| (operands[2] == const1_rtx
&& (TARGET_SHIFT1
@@ -11421,7 +11640,7 @@
if (REG_P (operands[2]))
return "sal{l}\t{%b2, %0|%0, %b2}";
else if (operands[2] == const1_rtx
- && (TARGET_SHIFT1 || optimize_size))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "sal{l}\t%0";
else
return "sal{l}\t{%2, %0|%0, %2}";
@@ -11446,7 +11665,7 @@
(set (match_operand:DI 0 "register_operand" "=r")
(zero_extend:DI (ashift:SI (match_dup 1) (match_dup 2))))]
"TARGET_64BIT
- && (optimize_size
+ && (optimize_function_for_size_p (cfun)
|| !TARGET_PARTIAL_FLAG_REG_STALL
|| (operands[2] == const1_rtx
&& (TARGET_SHIFT1
@@ -11464,7 +11683,7 @@
if (REG_P (operands[2]))
return "sal{l}\t{%b2, %k0|%k0, %b2}";
else if (operands[2] == const1_rtx
- && (TARGET_SHIFT1 || optimize_size))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "sal{l}\t%k0";
else
return "sal{l}\t{%2, %k0|%k0, %2}";
@@ -11506,7 +11725,7 @@
if (REG_P (operands[2]))
return "sal{w}\t{%b2, %0|%0, %b2}";
else if (operands[2] == const1_rtx
- && (TARGET_SHIFT1 || optimize_size))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "sal{w}\t%0";
else
return "sal{w}\t{%2, %0|%0, %2}";
@@ -11542,7 +11761,7 @@
if (REG_P (operands[2]))
return "sal{w}\t{%b2, %0|%0, %b2}";
else if (operands[2] == const1_rtx
- && (TARGET_SHIFT1 || optimize_size))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "sal{w}\t%0";
else
return "sal{w}\t{%2, %0|%0, %2}";
@@ -11569,7 +11788,7 @@
(const_int 0)))
(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
(ashift:HI (match_dup 1) (match_dup 2)))]
- "(optimize_size
+ "(optimize_function_for_size_p (cfun)
|| !TARGET_PARTIAL_FLAG_REG_STALL
|| (operands[2] == const1_rtx
&& (TARGET_SHIFT1
@@ -11587,7 +11806,7 @@
if (REG_P (operands[2]))
return "sal{w}\t{%b2, %0|%0, %b2}";
else if (operands[2] == const1_rtx
- && (TARGET_SHIFT1 || optimize_size))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "sal{w}\t%0";
else
return "sal{w}\t{%2, %0|%0, %2}";
@@ -11610,7 +11829,7 @@
(match_operand:QI 2 "const_1_to_31_operand" "I"))
(const_int 0)))
(clobber (match_scratch:HI 0 "=r"))]
- "(optimize_size
+ "(optimize_function_for_size_p (cfun)
|| !TARGET_PARTIAL_FLAG_REG_STALL
|| (operands[2] == const1_rtx
&& (TARGET_SHIFT1
@@ -11628,7 +11847,7 @@
if (REG_P (operands[2]))
return "sal{w}\t{%b2, %0|%0, %b2}";
else if (operands[2] == const1_rtx
- && (TARGET_SHIFT1 || optimize_size))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "sal{w}\t%0";
else
return "sal{w}\t{%2, %0|%0, %2}";
@@ -11681,7 +11900,7 @@
return "sal{b}\t{%b2, %0|%0, %b2}";
}
else if (operands[2] == const1_rtx
- && (TARGET_SHIFT1 || optimize_size))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
{
if (get_attr_mode (insn) == MODE_SI)
return "sal{l}\t%0";
@@ -11735,7 +11954,7 @@
return "sal{b}\t{%b2, %0|%0, %b2}";
}
else if (operands[2] == const1_rtx
- && (TARGET_SHIFT1 || optimize_size))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
{
if (get_attr_mode (insn) == MODE_SI)
return "sal{l}\t%0";
@@ -11772,7 +11991,7 @@
(const_int 0)))
(set (match_operand:QI 0 "nonimmediate_operand" "=qm")
(ashift:QI (match_dup 1) (match_dup 2)))]
- "(optimize_size
+ "(optimize_function_for_size_p (cfun)
|| !TARGET_PARTIAL_FLAG_REG_STALL
|| (operands[2] == const1_rtx
&& (TARGET_SHIFT1
@@ -11790,7 +12009,7 @@
if (REG_P (operands[2]))
return "sal{b}\t{%b2, %0|%0, %b2}";
else if (operands[2] == const1_rtx
- && (TARGET_SHIFT1 || optimize_size))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "sal{b}\t%0";
else
return "sal{b}\t{%2, %0|%0, %2}";
@@ -11813,7 +12032,7 @@
(match_operand:QI 2 "const_1_to_31_operand" "I"))
(const_int 0)))
(clobber (match_scratch:QI 0 "=q"))]
- "(optimize_size
+ "(optimize_function_for_size_p (cfun)
|| !TARGET_PARTIAL_FLAG_REG_STALL
|| (operands[2] == const1_rtx
&& (TARGET_SHIFT1
@@ -11831,7 +12050,7 @@
if (REG_P (operands[2]))
return "sal{b}\t{%b2, %0|%0, %b2}";
else if (operands[2] == const1_rtx
- && (TARGET_SHIFT1 || optimize_size))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun)))
return "sal{b}\t%0";
else
return "sal{b}\t{%2, %0|%0, %2}";
@@ -11942,7 +12161,7 @@
(match_operand:DI 2 "const_int_operand" "i,i")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT && INTVAL (operands[2]) == 63
- && (TARGET_USE_CLTD || optimize_size)
+ && (TARGET_USE_CLTD || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (ASHIFTRT, DImode, operands)"
"@
{cqto|cqo}
@@ -11959,7 +12178,7 @@
(match_operand:QI 2 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT
- && (TARGET_SHIFT1 || optimize_size)
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (ASHIFTRT, DImode, operands)"
"sar{q}\t%0"
[(set_attr "type" "ishift")
@@ -11992,7 +12211,7 @@
(set (match_operand:DI 0 "nonimmediate_operand" "=rm")
(ashiftrt:DI (match_dup 1) (match_dup 2)))]
"TARGET_64BIT
- && (TARGET_SHIFT1 || optimize_size)
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (ASHIFTRT, DImode, operands)"
"sar{q}\t%0"
@@ -12010,7 +12229,7 @@
(const_int 0)))
(clobber (match_scratch:DI 0 "=r"))]
"TARGET_64BIT
- && (TARGET_SHIFT1 || optimize_size)
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (ASHIFTRT, DImode, operands)"
"sar{q}\t%0"
@@ -12029,7 +12248,7 @@
(set (match_operand:DI 0 "nonimmediate_operand" "=rm")
(ashiftrt:DI (match_dup 1) (match_dup 2)))]
"TARGET_64BIT
- && (optimize_size || !TARGET_PARTIAL_FLAG_REG_STALL)
+ && (optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_FLAG_REG_STALL)
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (ASHIFTRT, DImode, operands)"
"sar{q}\t{%2, %0|%0, %2}"
@@ -12044,7 +12263,7 @@
(const_int 0)))
(clobber (match_scratch:DI 0 "=r"))]
"TARGET_64BIT
- && (optimize_size || !TARGET_PARTIAL_FLAG_REG_STALL)
+ && (optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_FLAG_REG_STALL)
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (ASHIFTRT, DImode, operands)"
"sar{q}\t{%2, %0|%0, %2}"
@@ -12126,12 +12345,20 @@
DONE;
})
-(define_insn "ashrsi3_31"
+(define_expand "ashrsi3_31"
+ [(parallel [(set (match_operand:SI 0 "nonimmediate_operand" "=*d,rm")
+ (ashiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "*a,0")
+ (match_operand:SI 2 "const_int_operand" "i,i")))
+ (clobber (reg:CC FLAGS_REG))])]
+ "")
+
+(define_insn "*ashrsi3_31"
[(set (match_operand:SI 0 "nonimmediate_operand" "=*d,rm")
(ashiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "*a,0")
(match_operand:SI 2 "const_int_operand" "i,i")))
(clobber (reg:CC FLAGS_REG))]
- "INTVAL (operands[2]) == 31 && (TARGET_USE_CLTD || optimize_size)
+ "INTVAL (operands[2]) == 31
+ && (TARGET_USE_CLTD || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (ASHIFTRT, SImode, operands)"
"@
{cltd|cdq}
@@ -12147,7 +12374,7 @@
(zero_extend:DI (ashiftrt:SI (match_operand:SI 1 "register_operand" "*a,0")
(match_operand:SI 2 "const_int_operand" "i,i"))))
(clobber (reg:CC FLAGS_REG))]
- "TARGET_64BIT && (TARGET_USE_CLTD || optimize_size)
+ "TARGET_64BIT && (TARGET_USE_CLTD || optimize_function_for_size_p (cfun))
&& INTVAL (operands[2]) == 31
&& ix86_binary_operator_ok (ASHIFTRT, SImode, operands)"
"@
@@ -12171,7 +12398,7 @@
(ashiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "0")
(match_operand:QI 2 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (ASHIFTRT, SImode, operands)"
"sar{l}\t%0"
[(set_attr "type" "ishift")
@@ -12186,7 +12413,7 @@
(match_operand:QI 2 "const1_operand" ""))))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT
- && (TARGET_SHIFT1 || optimize_size)
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (ASHIFTRT, SImode, operands)"
"sar{l}\t%k0"
[(set_attr "type" "ishift")
@@ -12227,7 +12454,7 @@
(const_int 0)))
(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
(ashiftrt:SI (match_dup 1) (match_dup 2)))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (ASHIFTRT, SImode, operands)"
"sar{l}\t%0"
@@ -12244,7 +12471,7 @@
(match_operand:QI 2 "const1_operand" ""))
(const_int 0)))
(clobber (match_scratch:SI 0 "=r"))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (ASHIFTRT, SImode, operands)"
"sar{l}\t%0"
@@ -12260,7 +12487,7 @@
(set (match_operand:DI 0 "register_operand" "=r")
(zero_extend:DI (ashiftrt:SI (match_dup 1) (match_dup 2))))]
"TARGET_64BIT
- && (TARGET_SHIFT1 || optimize_size)
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCmode)
&& ix86_binary_operator_ok (ASHIFTRT, SImode, operands)"
"sar{l}\t%k0"
@@ -12278,7 +12505,7 @@
(const_int 0)))
(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
(ashiftrt:SI (match_dup 1) (match_dup 2)))]
- "(optimize_size || !TARGET_PARTIAL_FLAG_REG_STALL)
+ "(optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_FLAG_REG_STALL)
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (ASHIFTRT, SImode, operands)"
"sar{l}\t{%2, %0|%0, %2}"
@@ -12292,7 +12519,7 @@
(match_operand:QI 2 "const_1_to_31_operand" "I"))
(const_int 0)))
(clobber (match_scratch:SI 0 "=r"))]
- "(optimize_size || !TARGET_PARTIAL_FLAG_REG_STALL)
+ "(optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_FLAG_REG_STALL)
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (ASHIFTRT, SImode, operands)"
"sar{l}\t{%2, %0|%0, %2}"
@@ -12308,7 +12535,7 @@
(set (match_operand:DI 0 "register_operand" "=r")
(zero_extend:DI (ashiftrt:SI (match_dup 1) (match_dup 2))))]
"TARGET_64BIT
- && (optimize_size || !TARGET_PARTIAL_FLAG_REG_STALL)
+ && (optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_FLAG_REG_STALL)
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (ASHIFTRT, SImode, operands)"
"sar{l}\t{%2, %k0|%k0, %2}"
@@ -12327,7 +12554,7 @@
(ashiftrt:HI (match_operand:HI 1 "nonimmediate_operand" "0")
(match_operand:QI 2 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (ASHIFTRT, HImode, operands)"
"sar{w}\t%0"
[(set_attr "type" "ishift")
@@ -12359,7 +12586,7 @@
(const_int 0)))
(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
(ashiftrt:HI (match_dup 1) (match_dup 2)))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (ASHIFTRT, HImode, operands)"
"sar{w}\t%0"
@@ -12376,7 +12603,7 @@
(match_operand:QI 2 "const1_operand" ""))
(const_int 0)))
(clobber (match_scratch:HI 0 "=r"))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (ASHIFTRT, HImode, operands)"
"sar{w}\t%0"
@@ -12394,7 +12621,7 @@
(const_int 0)))
(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
(ashiftrt:HI (match_dup 1) (match_dup 2)))]
- "(optimize_size || !TARGET_PARTIAL_FLAG_REG_STALL)
+ "(optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_FLAG_REG_STALL)
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (ASHIFTRT, HImode, operands)"
"sar{w}\t{%2, %0|%0, %2}"
@@ -12408,7 +12635,7 @@
(match_operand:QI 2 "const_1_to_31_operand" "I"))
(const_int 0)))
(clobber (match_scratch:HI 0 "=r"))]
- "(optimize_size || !TARGET_PARTIAL_FLAG_REG_STALL)
+ "(optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_FLAG_REG_STALL)
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (ASHIFTRT, HImode, operands)"
"sar{w}\t{%2, %0|%0, %2}"
@@ -12427,7 +12654,7 @@
(ashiftrt:QI (match_operand:QI 1 "nonimmediate_operand" "0")
(match_operand:QI 2 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (ASHIFTRT, QImode, operands)"
"sar{b}\t%0"
[(set_attr "type" "ishift")
@@ -12441,8 +12668,8 @@
(ashiftrt:QI (match_dup 0)
(match_operand:QI 1 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_size)
- && (TARGET_SHIFT1 || optimize_size)
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (ASHIFTRT, QImode, operands)"
"sar{b}\t%0"
[(set_attr "type" "ishift1")
@@ -12468,7 +12695,7 @@
(ashiftrt:QI (match_dup 0)
(match_operand:QI 1 "nonmemory_operand" "I,c")))
(clobber (reg:CC FLAGS_REG))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_size)
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"@
sar{b}\t{%1, %0|%0, %1}
@@ -12487,7 +12714,7 @@
(const_int 0)))
(set (match_operand:QI 0 "nonimmediate_operand" "=qm")
(ashiftrt:QI (match_dup 1) (match_dup 2)))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (ASHIFTRT, QImode, operands)"
"sar{b}\t%0"
@@ -12504,7 +12731,7 @@
(match_operand:QI 2 "const1_operand" ""))
(const_int 0)))
(clobber (match_scratch:QI 0 "=q"))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (ASHIFTRT, QImode, operands)"
"sar{b}\t%0"
@@ -12522,7 +12749,7 @@
(const_int 0)))
(set (match_operand:QI 0 "nonimmediate_operand" "=qm")
(ashiftrt:QI (match_dup 1) (match_dup 2)))]
- "(optimize_size || !TARGET_PARTIAL_FLAG_REG_STALL)
+ "(optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_FLAG_REG_STALL)
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (ASHIFTRT, QImode, operands)"
"sar{b}\t{%2, %0|%0, %2}"
@@ -12536,7 +12763,7 @@
(match_operand:QI 2 "const_1_to_31_operand" "I"))
(const_int 0)))
(clobber (match_scratch:QI 0 "=q"))]
- "(optimize_size || !TARGET_PARTIAL_FLAG_REG_STALL)
+ "(optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_FLAG_REG_STALL)
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (ASHIFTRT, QImode, operands)"
"sar{b}\t{%2, %0|%0, %2}"
@@ -12558,6 +12785,19 @@
;; This pattern must be defined before *lshrti3_1 to prevent
;; combine pass from converting sse2_lshrti3 to *lshrti3_1.
+(define_insn "*avx_lshrti3"
+ [(set (match_operand:TI 0 "register_operand" "=x")
+ (lshiftrt:TI (match_operand:TI 1 "register_operand" "x")
+ (match_operand:SI 2 "const_0_to_255_mul_8_operand" "n")))]
+ "TARGET_AVX"
+{
+ operands[2] = GEN_INT (INTVAL (operands[2]) / 8);
+ return "vpsrldq\t{%2, %1, %0|%0, %1, %2}";
+}
+ [(set_attr "type" "sseishft")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "sse2_lshrti3"
[(set (match_operand:TI 0 "register_operand" "=x")
(lshiftrt:TI (match_operand:TI 1 "register_operand" "0")
@@ -12614,7 +12854,7 @@
(match_operand:QI 2 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT
- && (TARGET_SHIFT1 || optimize_size)
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{q}\t%0"
[(set_attr "type" "ishift")
@@ -12647,7 +12887,7 @@
(set (match_operand:DI 0 "nonimmediate_operand" "=rm")
(lshiftrt:DI (match_dup 1) (match_dup 2)))]
"TARGET_64BIT
- && (TARGET_SHIFT1 || optimize_size)
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{q}\t%0"
@@ -12665,7 +12905,7 @@
(const_int 0)))
(clobber (match_scratch:DI 0 "=r"))]
"TARGET_64BIT
- && (TARGET_SHIFT1 || optimize_size)
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{q}\t%0"
@@ -12684,7 +12924,7 @@
(set (match_operand:DI 0 "nonimmediate_operand" "=rm")
(lshiftrt:DI (match_dup 1) (match_dup 2)))]
"TARGET_64BIT
- && (optimize_size || !TARGET_PARTIAL_FLAG_REG_STALL)
+ && (optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_FLAG_REG_STALL)
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{q}\t{%2, %0|%0, %2}"
@@ -12699,7 +12939,7 @@
(const_int 0)))
(clobber (match_scratch:DI 0 "=r"))]
"TARGET_64BIT
- && (optimize_size || !TARGET_PARTIAL_FLAG_REG_STALL)
+ && (optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_FLAG_REG_STALL)
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{q}\t{%2, %0|%0, %2}"
@@ -12751,7 +12991,7 @@
(lshiftrt:SI (match_operand:SI 1 "nonimmediate_operand" "0")
(match_operand:QI 2 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{l}\t%0"
[(set_attr "type" "ishift")
@@ -12766,7 +13006,7 @@
(match_operand:QI 2 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT
- && (TARGET_SHIFT1 || optimize_size)
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{l}\t%k0"
[(set_attr "type" "ishift")
@@ -12808,7 +13048,7 @@
(const_int 0)))
(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
(lshiftrt:SI (match_dup 1) (match_dup 2)))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{l}\t%0"
@@ -12825,7 +13065,7 @@
(match_operand:QI 2 "const1_operand" ""))
(const_int 0)))
(clobber (match_scratch:SI 0 "=r"))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{l}\t%0"
@@ -12841,7 +13081,7 @@
(set (match_operand:DI 0 "register_operand" "=r")
(lshiftrt:DI (zero_extend:DI (match_dup 1)) (match_dup 2)))]
"TARGET_64BIT
- && (TARGET_SHIFT1 || optimize_size)
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{l}\t%k0"
@@ -12859,7 +13099,7 @@
(const_int 0)))
(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
(lshiftrt:SI (match_dup 1) (match_dup 2)))]
- "(optimize_size || !TARGET_PARTIAL_FLAG_REG_STALL)
+ "(optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_FLAG_REG_STALL)
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{l}\t{%2, %0|%0, %2}"
@@ -12873,7 +13113,7 @@
(match_operand:QI 2 "const_1_to_31_operand" "I"))
(const_int 0)))
(clobber (match_scratch:SI 0 "=r"))]
- "(optimize_size || !TARGET_PARTIAL_FLAG_REG_STALL)
+ "(optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_FLAG_REG_STALL)
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{l}\t{%2, %0|%0, %2}"
@@ -12889,7 +13129,7 @@
(set (match_operand:DI 0 "register_operand" "=r")
(lshiftrt:DI (zero_extend:DI (match_dup 1)) (match_dup 2)))]
"TARGET_64BIT
- && (optimize_size || !TARGET_PARTIAL_FLAG_REG_STALL)
+ && (optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_FLAG_REG_STALL)
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{l}\t{%2, %k0|%k0, %2}"
@@ -12908,7 +13148,7 @@
(lshiftrt:HI (match_operand:HI 1 "nonimmediate_operand" "0")
(match_operand:QI 2 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{w}\t%0"
[(set_attr "type" "ishift")
@@ -12940,7 +13180,7 @@
(const_int 0)))
(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
(lshiftrt:HI (match_dup 1) (match_dup 2)))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{w}\t%0"
@@ -12957,7 +13197,7 @@
(match_operand:QI 2 "const1_operand" ""))
(const_int 0)))
(clobber (match_scratch:HI 0 "=r"))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{w}\t%0"
@@ -12975,7 +13215,7 @@
(const_int 0)))
(set (match_operand:HI 0 "nonimmediate_operand" "=rm")
(lshiftrt:HI (match_dup 1) (match_dup 2)))]
- "(optimize_size || !TARGET_PARTIAL_FLAG_REG_STALL)
+ "(optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_FLAG_REG_STALL)
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{w}\t{%2, %0|%0, %2}"
@@ -12989,7 +13229,7 @@
(match_operand:QI 2 "const_1_to_31_operand" "I"))
(const_int 0)))
(clobber (match_scratch:HI 0 "=r"))]
- "(optimize_size || !TARGET_PARTIAL_FLAG_REG_STALL)
+ "(optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_FLAG_REG_STALL)
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (LSHIFTRT, HImode, operands)"
"shr{w}\t{%2, %0|%0, %2}"
@@ -13008,7 +13248,7 @@
(lshiftrt:QI (match_operand:QI 1 "nonimmediate_operand" "0")
(match_operand:QI 2 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (LSHIFTRT, QImode, operands)"
"shr{b}\t%0"
[(set_attr "type" "ishift")
@@ -13022,8 +13262,8 @@
(lshiftrt:QI (match_dup 0)
(match_operand:QI 1 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_size)
- && (TARGET_SHIFT1 || optimize_size)"
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))"
"shr{b}\t%0"
[(set_attr "type" "ishift1")
(set (attr "length")
@@ -13048,7 +13288,7 @@
(lshiftrt:QI (match_dup 0)
(match_operand:QI 1 "nonmemory_operand" "I,c")))
(clobber (reg:CC FLAGS_REG))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_size)
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"@
shr{b}\t{%1, %0|%0, %1}
@@ -13067,7 +13307,7 @@
(const_int 0)))
(set (match_operand:QI 0 "nonimmediate_operand" "=qm")
(lshiftrt:QI (match_dup 1) (match_dup 2)))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (LSHIFTRT, QImode, operands)"
"shr{b}\t%0"
@@ -13084,7 +13324,7 @@
(match_operand:QI 2 "const1_operand" ""))
(const_int 0)))
(clobber (match_scratch:QI 0 "=q"))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (LSHIFTRT, QImode, operands)"
"shr{b}\t%0"
@@ -13102,7 +13342,7 @@
(const_int 0)))
(set (match_operand:QI 0 "nonimmediate_operand" "=qm")
(lshiftrt:QI (match_dup 1) (match_dup 2)))]
- "(optimize_size || !TARGET_PARTIAL_FLAG_REG_STALL)
+ "(optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_FLAG_REG_STALL)
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (LSHIFTRT, QImode, operands)"
"shr{b}\t{%2, %0|%0, %2}"
@@ -13116,7 +13356,7 @@
(match_operand:QI 2 "const_1_to_31_operand" "I"))
(const_int 0)))
(clobber (match_scratch:QI 0 "=q"))]
- "(optimize_size || !TARGET_PARTIAL_FLAG_REG_STALL)
+ "(optimize_function_for_size_p (cfun) || !TARGET_PARTIAL_FLAG_REG_STALL)
&& ix86_match_ccmode (insn, CCGOCmode)
&& ix86_binary_operator_ok (LSHIFTRT, QImode, operands)"
"shr{b}\t{%2, %0|%0, %2}"
@@ -13174,7 +13414,7 @@
(match_operand:QI 2 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT
- && (TARGET_SHIFT1 || optimize_size)
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (ROTATE, DImode, operands)"
"rol{q}\t%0"
[(set_attr "type" "rotate")
@@ -13207,7 +13447,7 @@
(rotate:SI (match_operand:SI 1 "nonimmediate_operand" "0")
(match_operand:QI 2 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (ROTATE, SImode, operands)"
"rol{l}\t%0"
[(set_attr "type" "rotate")
@@ -13223,7 +13463,7 @@
(match_operand:QI 2 "const1_operand" ""))))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT
- && (TARGET_SHIFT1 || optimize_size)
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (ROTATE, SImode, operands)"
"rol{l}\t%k0"
[(set_attr "type" "rotate")
@@ -13266,7 +13506,7 @@
(rotate:HI (match_operand:HI 1 "nonimmediate_operand" "0")
(match_operand:QI 2 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (ROTATE, HImode, operands)"
"rol{w}\t%0"
[(set_attr "type" "rotate")
@@ -13309,8 +13549,8 @@
(rotate:QI (match_dup 0)
(match_operand:QI 1 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_size)
- && (TARGET_SHIFT1 || optimize_size)"
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))"
"rol{b}\t%0"
[(set_attr "type" "rotate1")
(set (attr "length")
@@ -13323,7 +13563,7 @@
(rotate:QI (match_operand:QI 1 "nonimmediate_operand" "0")
(match_operand:QI 2 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (ROTATE, QImode, operands)"
"rol{b}\t%0"
[(set_attr "type" "rotate")
@@ -13337,7 +13577,7 @@
(rotate:QI (match_dup 0)
(match_operand:QI 1 "nonmemory_operand" "I,c")))
(clobber (reg:CC FLAGS_REG))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_size)
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"@
rol{b}\t{%1, %0|%0, %1}
@@ -13406,7 +13646,7 @@
(match_operand:QI 2 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT
- && (TARGET_SHIFT1 || optimize_size)
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (ROTATERT, DImode, operands)"
"ror{q}\t%0"
[(set_attr "type" "rotate")
@@ -13439,7 +13679,7 @@
(rotatert:SI (match_operand:SI 1 "nonimmediate_operand" "0")
(match_operand:QI 2 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (ROTATERT, SImode, operands)"
"ror{l}\t%0"
[(set_attr "type" "rotate")
@@ -13455,7 +13695,7 @@
(match_operand:QI 2 "const1_operand" ""))))
(clobber (reg:CC FLAGS_REG))]
"TARGET_64BIT
- && (TARGET_SHIFT1 || optimize_size)
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (ROTATERT, SImode, operands)"
"ror{l}\t%k0"
[(set_attr "type" "rotate")
@@ -13501,7 +13741,7 @@
(rotatert:HI (match_operand:HI 1 "nonimmediate_operand" "0")
(match_operand:QI 2 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (ROTATERT, HImode, operands)"
"ror{w}\t%0"
[(set_attr "type" "rotate")
@@ -13544,7 +13784,7 @@
(rotatert:QI (match_operand:QI 1 "nonimmediate_operand" "0")
(match_operand:QI 2 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "(TARGET_SHIFT1 || optimize_size)
+ "(TARGET_SHIFT1 || optimize_function_for_size_p (cfun))
&& ix86_binary_operator_ok (ROTATERT, QImode, operands)"
"ror{b}\t%0"
[(set_attr "type" "rotate")
@@ -13558,8 +13798,8 @@
(rotatert:QI (match_dup 0)
(match_operand:QI 1 "const1_operand" "")))
(clobber (reg:CC FLAGS_REG))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_size)
- && (TARGET_SHIFT1 || optimize_size)"
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
+ && (TARGET_SHIFT1 || optimize_function_for_size_p (cfun))"
"ror{b}\t%0"
[(set_attr "type" "rotate1")
(set (attr "length")
@@ -13584,7 +13824,7 @@
(rotatert:QI (match_dup 0)
(match_operand:QI 1 "nonmemory_operand" "I,c")))
(clobber (reg:CC FLAGS_REG))]
- "(! TARGET_PARTIAL_REG_STALL || optimize_size)
+ "(! TARGET_PARTIAL_REG_STALL || optimize_function_for_size_p (cfun))
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"@
ror{b}\t{%1, %0|%0, %1}
@@ -13802,7 +14042,7 @@
(const_int 1)
(match_operand:DI 1 "nonmemory_operand" "rN"))
(const_int 0)))]
- "TARGET_64BIT && (TARGET_USE_BT || optimize_size)"
+ "TARGET_64BIT && (TARGET_USE_BT || optimize_function_for_size_p (cfun))"
"bt{q}\t{%1, %0|%0, %1}"
[(set_attr "type" "alu1")])
@@ -13814,7 +14054,7 @@
(const_int 1)
(match_operand:SI 1 "nonmemory_operand" "rN"))
(const_int 0)))]
- "TARGET_USE_BT || optimize_size"
+ "TARGET_USE_BT || optimize_function_for_size_p (cfun)"
"bt{l}\t{%1, %0|%0, %1}"
[(set_attr "type" "alu1")])
@@ -13932,6 +14172,17 @@
;; 0xffffffff is NaN, but not in normalized form, so we can't represent
;; it directly.
+(define_insn "*avx_setcc<mode>"
+ [(set (match_operand:MODEF 0 "register_operand" "=x")
+ (match_operator:MODEF 1 "avx_comparison_float_operator"
+ [(match_operand:MODEF 2 "register_operand" "x")
+ (match_operand:MODEF 3 "nonimmediate_operand" "xm")]))]
+ "TARGET_AVX"
+ "vcmp%D1s<ssemodefsuffix>\t{%3, %2, %0|%0, %2, %3}"
+ [(set_attr "type" "ssecmp")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<MODE>")])
+
(define_insn "*sse_setcc<mode>"
[(set (match_operand:MODEF 0 "register_operand" "=x")
(match_operator:MODEF 1 "sse_comparison_operator"
@@ -14148,7 +14399,7 @@
(const_int 0)])
(label_ref (match_operand 3 "" ""))
(pc)))]
- "TARGET_64BIT && (TARGET_USE_BT || optimize_size)"
+ "TARGET_64BIT && (TARGET_USE_BT || optimize_function_for_size_p (cfun))"
"#"
"&& 1"
[(set (reg:CCC FLAGS_REG)
@@ -14180,7 +14431,7 @@
(match_operand:SI 3 "const_int_operand" "n")))])
(label_ref (match_operand 4 "" ""))
(pc)))]
- "TARGET_64BIT && (TARGET_USE_BT || optimize_size)
+ "TARGET_64BIT && (TARGET_USE_BT || optimize_function_for_size_p (cfun))
&& (INTVAL (operands[3]) & 0x3f) == 0x3f"
"#"
"&& 1"
@@ -14212,7 +14463,7 @@
(const_int 0)])
(label_ref (match_operand 3 "" ""))
(pc)))]
- "TARGET_USE_BT || optimize_size"
+ "TARGET_USE_BT || optimize_function_for_size_p (cfun)"
"#"
"&& 1"
[(set (reg:CCC FLAGS_REG)
@@ -14244,7 +14495,7 @@
(match_operand:SI 3 "const_int_operand" "n")))])
(label_ref (match_operand 4 "" ""))
(pc)))]
- "(TARGET_USE_BT || optimize_size)
+ "(TARGET_USE_BT || optimize_function_for_size_p (cfun))
&& (INTVAL (operands[3]) & 0x1f) == 0x1f"
"#"
"&& 1"
@@ -14272,7 +14523,7 @@
(const_int 0)])
(label_ref (match_operand 3 "" ""))
(pc)))]
- "TARGET_USE_BT || optimize_size"
+ "TARGET_USE_BT || optimize_function_for_size_p (cfun)"
"#"
"&& 1"
[(set (reg:CCC FLAGS_REG)
@@ -14308,7 +14559,7 @@
(const_int 0)])
(label_ref (match_operand 4 "" ""))
(pc)))]
- "(TARGET_USE_BT || optimize_size)
+ "(TARGET_USE_BT || optimize_function_for_size_p (cfun))
&& (INTVAL (operands[3]) & 0x1f) == 0x1f"
"#"
"&& 1"
@@ -14522,7 +14773,7 @@
(clobber (reg:CCFP FLAGS_REG))
(clobber (match_scratch:HI 5 "=a,a"))]
"X87_FLOAT_MODE_P (GET_MODE (operands[3]))
- && (TARGET_USE_<MODE>MODE_FIOP || optimize_size)
+ && (TARGET_USE_<MODE>MODE_FIOP || optimize_function_for_size_p (cfun))
&& GET_MODE (operands[1]) == GET_MODE (operands[3])
&& !ix86_use_fcomi_compare (swap_condition (GET_CODE (operands[0])))
&& ix86_fp_compare_mode (swap_condition (GET_CODE (operands[0]))) == CCFPmode
@@ -15282,7 +15533,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}"
@@ -15302,7 +15553,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}"
@@ -15365,7 +15616,7 @@
[(set (strict_low_part (match_operand:HI 0 "register_operand" "+Q,r"))
(bswap:HI (match_dup 0)))
(clobber (reg:CC FLAGS_REG))]
- "TARGET_USE_XCHGB || optimize_size"
+ "TARGET_USE_XCHGB || optimize_function_for_size_p (cfun)"
"@
xchg{b}\t{%h0, %b0|%b0, %h0}
rol{w}\t{$8, %0|%0, 8}"
@@ -15409,7 +15660,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}"
@@ -15429,7 +15680,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}"
@@ -15470,7 +15721,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}"
@@ -15490,7 +15741,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}"
@@ -16010,6 +16261,26 @@
;; Gcc is slightly more smart about handling normal two address instructions
;; so use special patterns for add and mull.
+(define_insn "*fop_<mode>_comm_mixed_avx"
+ [(set (match_operand:MODEF 0 "register_operand" "=f,x")
+ (match_operator:MODEF 3 "binary_fp_operator"
+ [(match_operand:MODEF 1 "nonimmediate_operand" "%0,x")
+ (match_operand:MODEF 2 "nonimmediate_operand" "fm,xm")]))]
+ "AVX_FLOAT_MODE_P (<MODE>mode) && TARGET_MIX_SSE_I387
+ && COMMUTATIVE_ARITH_P (operands[3])
+ && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
+ "* return output_387_binary_op (insn, operands);"
+ [(set (attr "type")
+ (if_then_else (eq_attr "alternative" "1")
+ (if_then_else (match_operand:MODEF 3 "mult_operator" "")
+ (const_string "ssemul")
+ (const_string "sseadd"))
+ (if_then_else (match_operand:MODEF 3 "mult_operator" "")
+ (const_string "fmul")
+ (const_string "fop"))))
+ (set_attr "prefix" "orig,maybe_vex")
+ (set_attr "mode" "<MODE>")])
+
(define_insn "*fop_<mode>_comm_mixed"
[(set (match_operand:MODEF 0 "register_operand" "=f,x")
(match_operator:MODEF 3 "binary_fp_operator"
@@ -16029,6 +16300,22 @@
(const_string "fop"))))
(set_attr "mode" "<MODE>")])
+(define_insn "*fop_<mode>_comm_avx"
+ [(set (match_operand:MODEF 0 "register_operand" "=x")
+ (match_operator:MODEF 3 "binary_fp_operator"
+ [(match_operand:MODEF 1 "nonimmediate_operand" "%x")
+ (match_operand:MODEF 2 "nonimmediate_operand" "xm")]))]
+ "AVX_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
+ && COMMUTATIVE_ARITH_P (operands[3])
+ && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
+ "* return output_387_binary_op (insn, operands);"
+ [(set (attr "type")
+ (if_then_else (match_operand:MODEF 3 "mult_operator" "")
+ (const_string "ssemul")
+ (const_string "sseadd")))
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<MODE>")])
+
(define_insn "*fop_<mode>_comm_sse"
[(set (match_operand:MODEF 0 "register_operand" "=x")
(match_operator:MODEF 3 "binary_fp_operator"
@@ -16059,6 +16346,33 @@
(const_string "fop")))
(set_attr "mode" "<MODE>")])
+(define_insn "*fop_<mode>_1_mixed_avx"
+ [(set (match_operand:MODEF 0 "register_operand" "=f,f,x")
+ (match_operator:MODEF 3 "binary_fp_operator"
+ [(match_operand:MODEF 1 "nonimmediate_operand" "0,fm,x")
+ (match_operand:MODEF 2 "nonimmediate_operand" "fm,0,xm")]))]
+ "AVX_FLOAT_MODE_P (<MODE>mode) && TARGET_MIX_SSE_I387
+ && !COMMUTATIVE_ARITH_P (operands[3])
+ && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
+ "* return output_387_binary_op (insn, operands);"
+ [(set (attr "type")
+ (cond [(and (eq_attr "alternative" "2")
+ (match_operand:MODEF 3 "mult_operator" ""))
+ (const_string "ssemul")
+ (and (eq_attr "alternative" "2")
+ (match_operand:MODEF 3 "div_operator" ""))
+ (const_string "ssediv")
+ (eq_attr "alternative" "2")
+ (const_string "sseadd")
+ (match_operand:MODEF 3 "mult_operator" "")
+ (const_string "fmul")
+ (match_operand:MODEF 3 "div_operator" "")
+ (const_string "fdiv")
+ ]
+ (const_string "fop")))
+ (set_attr "prefix" "orig,orig,maybe_vex")
+ (set_attr "mode" "<MODE>")])
+
(define_insn "*fop_<mode>_1_mixed"
[(set (match_operand:MODEF 0 "register_operand" "=f,f,x")
(match_operator:MODEF 3 "binary_fp_operator"
@@ -16090,10 +16404,29 @@
(unspec:SF [(match_operand:SF 1 "nonimmediate_operand" "xm")]
UNSPEC_RCP))]
"TARGET_SSE_MATH"
- "rcpss\t{%1, %0|%0, %1}"
+ "%vrcpss\t{%1, %d0|%d0, %1}"
[(set_attr "type" "sse")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "SF")])
+(define_insn "*fop_<mode>_1_avx"
+ [(set (match_operand:MODEF 0 "register_operand" "=x")
+ (match_operator:MODEF 3 "binary_fp_operator"
+ [(match_operand:MODEF 1 "register_operand" "x")
+ (match_operand:MODEF 2 "nonimmediate_operand" "xm")]))]
+ "AVX_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
+ && !COMMUTATIVE_ARITH_P (operands[3])"
+ "* return output_387_binary_op (insn, operands);"
+ [(set (attr "type")
+ (cond [(match_operand:MODEF 3 "mult_operator" "")
+ (const_string "ssemul")
+ (match_operand:MODEF 3 "div_operator" "")
+ (const_string "ssediv")
+ ]
+ (const_string "sseadd")))
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<MODE>")])
+
(define_insn "*fop_<mode>_1_sse"
[(set (match_operand:MODEF 0 "register_operand" "=x")
(match_operator:MODEF 3 "binary_fp_operator"
@@ -16138,7 +16471,7 @@
(match_operand:X87MODEI12 1 "nonimmediate_operand" "m,?r"))
(match_operand:MODEF 2 "register_operand" "0,0")]))]
"TARGET_80387 && !(SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_SSE_MATH)
- && (TARGET_USE_<X87MODEI12:MODE>MODE_FIOP || optimize_size)"
+ && (TARGET_USE_<X87MODEI12:MODE>MODE_FIOP || optimize_function_for_size_p (cfun))"
"* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);"
[(set (attr "type")
(cond [(match_operand:MODEF 3 "mult_operator" "")
@@ -16157,7 +16490,7 @@
(float:MODEF
(match_operand:X87MODEI12 2 "nonimmediate_operand" "m,?r"))]))]
"TARGET_80387 && !(SSE_FLOAT_MODE_P (<MODEF:MODE>mode) && TARGET_SSE_MATH)
- && (TARGET_USE_<X87MODEI12:MODE>MODE_FIOP || optimize_size)"
+ && (TARGET_USE_<X87MODEI12:MODE>MODE_FIOP || optimize_function_for_size_p (cfun))"
"* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);"
[(set (attr "type")
(cond [(match_operand:MODEF 3 "mult_operator" "")
@@ -16259,7 +16592,7 @@
[(float:XF
(match_operand:X87MODEI12 1 "nonimmediate_operand" "m,?r"))
(match_operand:XF 2 "register_operand" "0,0")]))]
- "TARGET_80387 && (TARGET_USE_<MODE>MODE_FIOP || optimize_size)"
+ "TARGET_80387 && (TARGET_USE_<MODE>MODE_FIOP || optimize_function_for_size_p (cfun))"
"* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);"
[(set (attr "type")
(cond [(match_operand:XF 3 "mult_operator" "")
@@ -16277,7 +16610,7 @@
[(match_operand:XF 1 "register_operand" "0,0")
(float:XF
(match_operand:X87MODEI12 2 "nonimmediate_operand" "m,?r"))]))]
- "TARGET_80387 && (TARGET_USE_<MODE>MODE_FIOP || optimize_size)"
+ "TARGET_80387 && (TARGET_USE_<MODE>MODE_FIOP || optimize_function_for_size_p (cfun))"
"* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);"
[(set (attr "type")
(cond [(match_operand:XF 3 "mult_operator" "")
@@ -16422,8 +16755,9 @@
(unspec:SF [(match_operand:SF 1 "nonimmediate_operand" "xm")]
UNSPEC_RSQRT))]
"TARGET_SSE_MATH"
- "rsqrtss\t{%1, %0|%0, %1}"
+ "%vrsqrtss\t{%1, %d0|%d0, %1}"
[(set_attr "type" "sse")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "SF")])
(define_expand "rsqrtsf2"
@@ -16441,8 +16775,9 @@
(sqrt:MODEF
(match_operand:MODEF 1 "nonimmediate_operand" "xm")))]
"SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH"
- "sqrts<ssemodefsuffix>\t{%1, %0|%0, %1}"
+ "%vsqrts<ssemodefsuffix>\t{%1, %d0|%d0, %1}"
[(set_attr "type" "sse")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "<MODE>")
(set_attr "athlon_decode" "*")
(set_attr "amdfam10_decode" "*")])
@@ -16455,7 +16790,7 @@
|| (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)"
{
if (<MODE>mode == SFmode
- && TARGET_SSE_MATH && TARGET_RECIP && !optimize_size
+ && TARGET_SSE_MATH && TARGET_RECIP && !optimize_function_for_size_p (cfun)
&& flag_finite_math_only && !flag_trapping_math
&& flag_unsafe_math_optimizations)
{
@@ -16909,10 +17244,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);
@@ -16925,11 +17263,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));
@@ -16947,10 +17288,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);
@@ -16963,11 +17307,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));
@@ -17122,8 +17469,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;
})
@@ -17134,9 +17484,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]);
@@ -17204,10 +17559,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));
@@ -17220,10 +17580,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));
@@ -17268,10 +17633,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);
@@ -17282,9 +17650,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));
@@ -17297,10 +17670,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));
@@ -17312,9 +17690,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));
@@ -17327,10 +17710,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));
@@ -17342,9 +17730,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));
@@ -17357,10 +17750,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));
@@ -17392,10 +17790,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);
@@ -17411,10 +17812,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));
@@ -17433,8 +17839,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);
})
@@ -17446,10 +17855,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]));
@@ -17466,8 +17880,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);
})
@@ -17478,11 +17895,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]));
@@ -17498,9 +17920,10 @@
(match_operand:SI 2 "const_0_to_15_operand" "n")]
UNSPEC_ROUND))]
"TARGET_ROUND"
- "rounds<ssemodefsuffix>\t{%2, %1, %0|%0, %1, %2}"
+ "%vrounds<ssemodefsuffix>\t{%2, %1, %d0|%d0, %1, %2}"
[(set_attr "type" "ssecvt")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "<MODE>")])
(define_insn "rintxf2"
@@ -17521,13 +17944,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)));
@@ -17551,9 +17974,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
@@ -17704,9 +18128,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;
})
@@ -17754,8 +18179,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;
})
@@ -17766,15 +18193,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)));
@@ -17785,9 +18213,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));
@@ -17958,9 +18390,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;
})
@@ -17969,9 +18402,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;
})
@@ -18019,8 +18453,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;
})
@@ -18031,18 +18467,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
@@ -18050,9 +18487,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));
@@ -18282,8 +18723,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;
})
@@ -18294,18 +18737,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
@@ -18313,9 +18757,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));
@@ -18506,7 +18954,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],
@@ -18525,7 +18973,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"
@@ -18537,7 +18985,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")
@@ -18552,7 +19000,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")
@@ -18567,7 +19015,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")
@@ -18582,7 +19030,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")
@@ -18597,7 +19045,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")
@@ -18612,7 +19060,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")
@@ -18627,7 +19075,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")
@@ -18789,7 +19237,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]));
@@ -18802,7 +19250,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"
@@ -18811,7 +19259,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")
@@ -18823,7 +19271,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")
@@ -18835,7 +19283,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")
@@ -18847,7 +19295,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")
@@ -18859,7 +19307,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")
@@ -18871,7 +19319,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")
@@ -18883,7 +19331,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")
@@ -18988,10 +19436,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;
@@ -19573,6 +20024,17 @@
;; Since both the tree-level MAX_EXPR and the rtl-level SMAX operator
;; are undefined in this condition, we're certain this is correct.
+(define_insn "*avx_<code><mode>3"
+ [(set (match_operand:MODEF 0 "register_operand" "=x")
+ (smaxmin:MODEF
+ (match_operand:MODEF 1 "nonimmediate_operand" "%x")
+ (match_operand:MODEF 2 "nonimmediate_operand" "xm")))]
+ "AVX_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH"
+ "v<maxminfprefix>s<ssemodefsuffix>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<MODE>")])
+
(define_insn "<code><mode>3"
[(set (match_operand:MODEF 0 "register_operand" "=x")
(smaxmin:MODEF
@@ -19589,6 +20051,18 @@
;; Their operands are not commutative, and thus they may be used in the
;; presence of -0.0 and NaN.
+(define_insn "*avx_ieee_smin<mode>3"
+ [(set (match_operand:MODEF 0 "register_operand" "=x")
+ (unspec:MODEF
+ [(match_operand:MODEF 1 "register_operand" "x")
+ (match_operand:MODEF 2 "nonimmediate_operand" "xm")]
+ UNSPEC_IEEE_MIN))]
+ "AVX_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH"
+ "vmins<ssemodefsuffix>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<MODE>")])
+
(define_insn "*ieee_smin<mode>3"
[(set (match_operand:MODEF 0 "register_operand" "=x")
(unspec:MODEF
@@ -19600,6 +20074,18 @@
[(set_attr "type" "sseadd")
(set_attr "mode" "<MODE>")])
+(define_insn "*avx_ieee_smax<mode>3"
+ [(set (match_operand:MODEF 0 "register_operand" "=x")
+ (unspec:MODEF
+ [(match_operand:MODEF 1 "register_operand" "0")
+ (match_operand:MODEF 2 "nonimmediate_operand" "xm")]
+ UNSPEC_IEEE_MAX))]
+ "AVX_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH"
+ "vmaxs<ssemodefsuffix>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<MODE>")])
+
(define_insn "*ieee_smax<mode>3"
[(set (match_operand:MODEF 0 "register_operand" "=x")
(unspec:MODEF
@@ -19854,12 +20340,12 @@
(clobber (reg:CC FLAGS_REG))]
"! TARGET_PARTIAL_REG_STALL && reload_completed
&& ((GET_MODE (operands[0]) == HImode
- && ((!optimize_size && !TARGET_FAST_PREFIX)
+ && ((optimize_function_for_speed_p (cfun) && !TARGET_FAST_PREFIX)
/* ??? next two lines just !satisfies_constraint_K (...) */
|| !CONST_INT_P (operands[2])
|| satisfies_constraint_K (operands[2])))
|| (GET_MODE (operands[0]) == QImode
- && (TARGET_PROMOTE_QImode || optimize_size)))"
+ && (TARGET_PROMOTE_QImode || optimize_function_for_size_p (cfun))))"
[(parallel [(set (match_dup 0)
(match_op_dup 3 [(match_dup 1) (match_dup 2)]))
(clobber (reg:CC FLAGS_REG))])]
@@ -19882,7 +20368,7 @@
(set (match_operand 1 "register_operand" "")
(and (match_dup 3) (match_dup 4)))]
"! TARGET_PARTIAL_REG_STALL && reload_completed
- && ! optimize_size
+ && optimize_insn_for_speed_p ()
&& ((GET_MODE (operands[1]) == HImode && ! TARGET_FAST_PREFIX)
|| (GET_MODE (operands[1]) == QImode && TARGET_PROMOTE_QImode))
/* Ensure that the operand will remain sign-extended immediate. */
@@ -19912,7 +20398,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)
@@ -19932,7 +20418,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))])]
@@ -19945,7 +20432,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]);
@@ -19960,7 +20448,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]);
@@ -19976,7 +20465,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))]
@@ -19986,7 +20475,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))]
@@ -19998,7 +20487,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))]
@@ -20008,7 +20497,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))]
@@ -20018,7 +20507,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))]
@@ -20030,10 +20519,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))])
@@ -20044,10 +20533,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))])
@@ -20058,10 +20547,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))])
@@ -20072,9 +20561,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))]
"")
@@ -20083,9 +20572,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))]
"")
@@ -20094,9 +20583,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))]
"")
@@ -20108,7 +20597,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)]))]
"")
@@ -20127,7 +20616,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)))
@@ -20141,7 +20630,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)))
@@ -20155,7 +20644,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)))
@@ -20254,7 +20743,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)]))
@@ -20268,7 +20757,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)]))
@@ -20288,7 +20777,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)]))
@@ -20303,7 +20792,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)]))
@@ -20316,7 +20805,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))
@@ -20330,7 +20819,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))])])
@@ -20342,7 +20831,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))])]
@@ -20433,7 +20922,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)))])])
@@ -20443,7 +20932,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))
@@ -20454,7 +20943,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))])
@@ -20462,7 +20951,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))])
@@ -20473,7 +20962,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)))])]
@@ -20487,7 +20976,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)))])
@@ -20500,7 +20989,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)))])
@@ -20536,7 +21025,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)))
@@ -20565,7 +21054,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)))])])
@@ -20575,7 +21064,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))
@@ -20586,7 +21075,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))])
@@ -20594,7 +21083,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))])
@@ -20605,7 +21094,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)))])]
@@ -20619,7 +21108,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)))])
@@ -20632,7 +21121,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)))])
@@ -20668,7 +21157,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)))
@@ -20696,7 +21185,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)"
@@ -20728,7 +21217,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)"
@@ -20746,7 +21235,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)))
@@ -20759,7 +21248,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)))
@@ -20773,7 +21262,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))))
@@ -20790,7 +21279,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)))
@@ -20806,7 +21295,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)))
@@ -20822,7 +21311,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))])]
@@ -21064,6 +21553,10 @@
int i;
operands[0] = gen_rtx_MEM (Pmode,
gen_rtx_PLUS (Pmode, operands[0], operands[4]));
+ /* VEX instruction with a REX prefix will #UD. */
+ if (TARGET_AVX && GET_CODE (XEXP (operands[0], 0)) != PLUS)
+ gcc_unreachable ();
+
output_asm_insn ("jmp\t%A1", operands);
for (i = X86_64_SSE_REGPARM_MAX - 1; i >= INTVAL (operands[2]); i--)
{
@@ -21072,7 +21565,7 @@
PUT_MODE (operands[4], TImode);
if (GET_CODE (XEXP (operands[0], 0)) != PLUS)
output_asm_insn ("rex", operands);
- output_asm_insn ("movaps\t{%5, %4|%4, %5}", operands);
+ output_asm_insn ("%vmovaps\t{%5, %4|%4, %5}", operands);
}
(*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (operands[3]));
@@ -21081,9 +21574,14 @@
[(set_attr "type" "other")
(set_attr "length_immediate" "0")
(set_attr "length_address" "0")
- (set_attr "length" "34")
+ (set (attr "length")
+ (if_then_else
+ (eq (symbol_ref "TARGET_AVX") (const_int 0))
+ (const_string "34")
+ (const_string "42")))
(set_attr "memory" "store")
(set_attr "modrm" "0")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "DI")])
(define_expand "prefetch"
diff --git a/gcc/config/i386/i386.opt b/gcc/config/i386/i386.opt
index d5c0978dde5..f362ddeda26 100644
--- a/gcc/config/i386/i386.opt
+++ b/gcc/config/i386/i386.opt
@@ -112,6 +112,10 @@ mfancy-math-387
Target RejectNegative Report InverseMask(NO_FANCY_MATH_387, USE_FANCY_MATH_387) Save
Generate sin, cos, sqrt for FPU
+mforce-drap
+Target Report Var(ix86_force_drap)
+Always use Dynamic Realigned Argument Pointer (DRAP) to realign stack
+
mfp-ret-in-387
Target Report Mask(FLOAT_RETURNS) Save
Return values of functions in FPU registers
@@ -168,6 +172,10 @@ mpreferred-stack-boundary=
Target RejectNegative Joined Var(ix86_preferred_stack_boundary_string)
Attempt to keep stack aligned to this power of 2
+mincoming-stack-boundary=
+Target RejectNegative Joined Var(ix86_incoming_stack_boundary_string)
+Assume incoming stack aligned to this power of 2
+
mpush-args
Target Report InverseMask(NO_PUSH_ARGS, PUSH_ARGS) Save
Use push instructions to save outgoing arguments
@@ -193,7 +201,7 @@ Target RejectNegative Mask(SSEREGPARM) Save
Use SSE register passing conventions for SF and DF mode
mstackrealign
-Target Report Var(ix86_force_align_arg_pointer)
+Target Report Var(ix86_force_align_arg_pointer) Init(-1)
Realign stack in prologue
mstack-arg-probe
@@ -291,6 +299,14 @@ mno-sse4
Target RejectNegative Report InverseMask(ISA_SSE4_1) MaskExists Var(ix86_isa_flags) VarExists Save
Do not support SSE4.1 and SSE4.2 built-in functions and code generation
+mavx
+Target Report Mask(ISA_AVX) Var(ix86_isa_flags) VarExists
+Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2 and AVX built-in functions and code generation
+
+mfma
+Target Report Mask(ISA_FMA) Var(ix86_isa_flags) VarExists
+Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX and FMA built-in functions and code generation
+
msse4a
Target Report Mask(ISA_SSE4A) Var(ix86_isa_flags) VarExists Save
Support MMX, SSE, SSE2, SSE3 and SSE4A built-in functions and code generation
diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md
index 0a507e07a2f..16aaf2c0793 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]))"
"@
@@ -78,15 +78,45 @@
movq\t{%1, %0|%0, %1}
movdq2q\t{%1, %0|%0, %1}
movq2dq\t{%1, %0|%0, %1}
- pxor\t%0, %0
- movq\t{%1, %0|%0, %1}
- movq\t{%1, %0|%0, %1}
- movd\t{%1, %0|%0, %1}
- movd\t{%1, %0|%0, %1}"
+ %vpxor\t%0, %d0
+ %vmovq\t{%1, %0|%0, %1}
+ %vmovq\t{%1, %0|%0, %1}
+ %vmovq\t{%1, %0|%0, %1}
+ %vmovq\t{%1, %0|%0, %1}"
[(set_attr "type" "imov,imov,mmx,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,ssemov,ssemov")
(set_attr "unit" "*,*,*,*,*,mmx,mmx,*,*,*,*,*")
+ (set (attr "prefix")
+ (if_then_else (eq_attr "alternative" "7,8,9,10,11")
+ (const_string "maybe_vex")
+ (const_string "orig")))
(set_attr "mode" "DI")])
+(define_insn "*mov<mode>_internal_avx"
+ [(set (match_operand:MMXMODEI8 0 "nonimmediate_operand"
+ "=!?y,!?y,m ,!y ,*Y2,*Y2,*Y2 ,m ,r ,m")
+ (match_operand:MMXMODEI8 1 "vector_move_operand"
+ "C ,!ym,!?y,*Y2,!y ,C ,*Y2m,*Y2,irm,r"))]
+ "TARGET_AVX
+ && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
+ "@
+ pxor\t%0, %0
+ movq\t{%1, %0|%0, %1}
+ movq\t{%1, %0|%0, %1}
+ movdq2q\t{%1, %0|%0, %1}
+ movq2dq\t{%1, %0|%0, %1}
+ vpxor\t%0, %0, %0
+ vmovq\t{%1, %0|%0, %1}
+ vmovq\t{%1, %0|%0, %1}
+ #
+ #"
+ [(set_attr "type" "mmx,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,*,*")
+ (set_attr "unit" "*,*,*,mmx,mmx,*,*,*,*,*")
+ (set (attr "prefix")
+ (if_then_else (eq_attr "alternative" "5,6,7")
+ (const_string "vex")
+ (const_string "orig")))
+ (set_attr "mode" "DI,DI,DI,DI,DI,TI,DI,DI,DI,DI")])
+
(define_insn "*mov<mode>_internal"
[(set (match_operand:MMXMODEI8 0 "nonimmediate_operand"
"=!?y,!?y,m ,!y ,*Y2,*Y2,*Y2 ,m ,*x,*x,*x,m ,r ,m")
@@ -122,11 +152,40 @@
DONE;
})
-(define_insn "*movv2sf_internal_rex64"
+(define_insn "*movv2sf_internal_rex64_avx"
[(set (match_operand:V2SF 0 "nonimmediate_operand"
"=rm,r ,!?y,!?y ,m ,!y,Y2,x,x,x,m,r,x")
(match_operand:V2SF 1 "vector_move_operand"
"Cr ,m ,C ,!?ym,!y,Y2,!y,C,x,m,x,x,r"))]
+ "TARGET_64BIT && TARGET_AVX
+ && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
+ "@
+ mov{q}\t{%1, %0|%0, %1}
+ mov{q}\t{%1, %0|%0, %1}
+ pxor\t%0, %0
+ movq\t{%1, %0|%0, %1}
+ movq\t{%1, %0|%0, %1}
+ movdq2q\t{%1, %0|%0, %1}
+ movq2dq\t{%1, %0|%0, %1}
+ vxorps\t%0, %0, %0
+ vmovaps\t{%1, %0|%0, %1}
+ vmovlps\t{%1, %0, %0|%0, %0, %1}
+ vmovlps\t{%1, %0|%0, %1}
+ vmovq\t{%1, %0|%0, %1}
+ vmovq\t{%1, %0|%0, %1}"
+ [(set_attr "type" "imov,imov,mmx,mmxmov,mmxmov,ssecvt,ssecvt,ssemov,sselog1,ssemov,ssemov,ssemov,ssemov")
+ (set_attr "unit" "*,*,*,*,*,mmx,mmx,*,*,*,*,*,*")
+ (set (attr "prefix")
+ (if_then_else (eq_attr "alternative" "7,8,9,10,11,12")
+ (const_string "vex")
+ (const_string "orig")))
+ (set_attr "mode" "DI,DI,DI,DI,DI,DI,DI,V4SF,V4SF,V2SF,V2SF,DI,DI")])
+
+(define_insn "*movv2sf_internal_rex64"
+ [(set (match_operand:V2SF 0 "nonimmediate_operand"
+ "=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,Yi,r"))]
"TARGET_64BIT && TARGET_MMX
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"@
@@ -147,6 +206,33 @@
(set_attr "unit" "*,*,*,*,*,mmx,mmx,*,*,*,*,*,*")
(set_attr "mode" "DI,DI,DI,DI,DI,DI,DI,V4SF,V4SF,V2SF,V2SF,DI,DI")])
+(define_insn "*movv2sf_internal_avx"
+ [(set (match_operand:V2SF 0 "nonimmediate_operand"
+ "=!?y,!?y ,m ,!y ,*Y2,*x,*x,*x,m ,r ,m")
+ (match_operand:V2SF 1 "vector_move_operand"
+ "C ,!?ym,!?y,*Y2,!y ,C ,*x,m ,*x,irm,r"))]
+ "TARGET_AVX
+ && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
+ "@
+ pxor\t%0, %0
+ movq\t{%1, %0|%0, %1}
+ movq\t{%1, %0|%0, %1}
+ movdq2q\t{%1, %0|%0, %1}
+ movq2dq\t{%1, %0|%0, %1}
+ vxorps\t%0, %0, %0
+ vmovaps\t{%1, %0|%0, %1}
+ vmovlps\t{%1, %0, %0|%0, %0, %1}
+ vmovlps\t{%1, %0|%0, %1}
+ #
+ #"
+ [(set_attr "type" "mmx,mmxmov,mmxmov,ssecvt,ssecvt,sselog1,ssemov,ssemov,ssemov,*,*")
+ (set_attr "unit" "*,*,*,mmx,mmx,*,*,*,*,*,*")
+ (set (attr "prefix")
+ (if_then_else (eq_attr "alternative" "5,6,7,8")
+ (const_string "vex")
+ (const_string "orig")))
+ (set_attr "mode" "DI,DI,DI,DI,DI,V4SF,V4SF,V2SF,V2SF,DI,DI")])
+
(define_insn "*movv2sf_internal"
[(set (match_operand:V2SF 0 "nonimmediate_operand"
"=!?y,!?y ,m ,!y ,*Y2,*x,*x,*x,m ,r ,m")
@@ -535,10 +621,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 +642,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 +1307,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 +1328,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 +1341,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/predicates.md b/gcc/config/i386/predicates.md
index f36c6d4cc4a..36a1b3a7397 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -640,11 +640,31 @@
(and (match_code "const_int")
(match_test "IN_RANGE (INTVAL (op), 2, 3)")))
+;; Match 4 to 5.
+(define_predicate "const_4_to_5_operand"
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (INTVAL (op), 4, 5)")))
+
;; Match 4 to 7.
(define_predicate "const_4_to_7_operand"
(and (match_code "const_int")
(match_test "IN_RANGE (INTVAL (op), 4, 7)")))
+;; Match 6 to 7.
+(define_predicate "const_6_to_7_operand"
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (INTVAL (op), 6, 7)")))
+
+;; Match 8 to 11.
+(define_predicate "const_8_to_11_operand"
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (INTVAL (op), 8, 11)")))
+
+;; Match 12 to 15.
+(define_predicate "const_12_to_15_operand"
+ (and (match_code "const_int")
+ (match_test "IN_RANGE (INTVAL (op), 12, 15)")))
+
;; Match exactly one bit in 2-bit mask.
(define_predicate "const_pow2_1_to_2_operand"
(and (match_code "const_int")
@@ -914,6 +934,11 @@
(define_special_predicate "sse_comparison_operator"
(match_code "eq,lt,le,unordered,ne,unge,ungt,ordered"))
+;; Return 1 if OP is a comparison operator that can be issued by
+;; avx predicate generation instructions
+(define_predicate "avx_comparison_float_operator"
+ (match_code "ne,eq,ge,gt,le,lt,unordered,ordered,uneq,unge,ungt,unle,unlt,ltgt"))
+
;; Return 1 if OP is a comparison operator that can be issued by sse predicate
;; generation instructions
(define_predicate "sse5_comparison_float_operator"
@@ -1057,3 +1082,15 @@
(define_predicate "misaligned_operand"
(and (match_code "mem")
(match_test "MEM_ALIGN (op) < GET_MODE_ALIGNMENT (mode)")))
+
+;; Return 1 if OP is a vzeroall operation, known to be a PARALLEL.
+(define_predicate "vzeroall_operation"
+ (match_code "parallel")
+{
+ int nregs = TARGET_64BIT ? 16 : 8;
+
+ if (XVECLEN (op, 0) != nregs + 1)
+ return 0;
+
+ return 1;
+})
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index c1d306054ad..e35d8573869 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -26,6 +26,18 @@
;; All 16-byte vector modes handled by SSE
(define_mode_iterator SSEMODE [V16QI V8HI V4SI V2DI V4SF V2DF])
+;; 32 byte integral vector modes handled by AVX
+(define_mode_iterator AVX256MODEI [V32QI V16HI V8SI V4DI])
+
+;; All 32-byte vector modes handled by AVX
+(define_mode_iterator AVX256MODE [V32QI V16HI V8SI V4DI V8SF V4DF])
+
+;; All QI vector modes handled by AVX
+(define_mode_iterator AVXMODEQI [V32QI V16QI])
+
+;; All vector modes handled by AVX
+(define_mode_iterator AVXMODE [V16QI V8HI V4SI V2DI V4SF V2DF V32QI V16HI V8SI V4DI V8SF V4DF])
+
;; Mix-n-match
(define_mode_iterator SSEMODE12 [V16QI V8HI])
(define_mode_iterator SSEMODE24 [V8HI V4SI])
@@ -36,6 +48,19 @@
(define_mode_iterator SSEMODEF4 [SF DF V4SF V2DF])
(define_mode_iterator SSEMODEF2P [V4SF V2DF])
+(define_mode_iterator AVX256MODEF2P [V8SF V4DF])
+(define_mode_iterator AVX256MODE2P [V8SI V8SF V4DF])
+(define_mode_iterator AVX256MODE4P [V4DI V4DF])
+(define_mode_iterator AVX256MODE8P [V8SI V8SF])
+(define_mode_iterator AVXMODEF2P [V4SF V2DF V8SF V4DF])
+(define_mode_iterator AVXMODEF4P [V4SF V4DF])
+(define_mode_iterator AVXMODEDCVTDQ2PS [V4SF V8SF])
+(define_mode_iterator AVXMODEDCVTPS2DQ [V4SI V8SI])
+
+;; 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,13 +82,54 @@
(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")
(V4SI "4") (V2DI "2")])
+;; Mapping for AVX
+(define_mode_attr avxvecmode
+ [(V16QI "TI") (V8HI "TI") (V4SI "TI") (V2DI "TI") (V4SF "V4SF")
+ (V2DF "V2DF") (V32QI "OI") (V16HI "OI") (V8SI "OI") (V4DI "OI")
+ (V8SF "V8SF") (V4DF "V4DF")])
+(define_mode_attr avxvecpsmode
+ [(V16QI "V4SF") (V8HI "V4SF") (V4SI "V4SF") (V2DI "V4SF")
+ (V32QI "V8SF") (V16HI "V8SF") (V8SI "V8SF") (V4DI "V8SF")])
+(define_mode_attr avxhalfvecmode
+ [(V4SF "V2SF") (V32QI "V16QI") (V16HI "V8HI") (V8SI "V4SI")
+ (V4DI "V2DI") (V8SF "V4SF") (V4DF "V2DF")])
+(define_mode_attr avxscalarmode
+ [(V16QI "QI") (V8HI "HI") (V4SI "SI") (V4SF "SF") (V2DF "DF")
+ (V8SF "SF") (V4DF "DF")])
+(define_mode_attr avxcvtvecmode
+ [(V4SF "V4SI") (V8SF "V8SI") (V4SI "V4SF") (V8SI "V8SF")])
+(define_mode_attr avxpermvecmode
+ [(V2DF "V2DI") (V4SF "V4SI") (V4DF "V4DI") (V8SF "V8SI")])
+(define_mode_attr avxmodesuffixf2c
+ [(V4SF "s") (V2DF "d") (V8SF "s") (V4DF "d")])
+(define_mode_attr avxmodesuffixp
+ [(V2DF "pd") (V4SI "si") (V4SF "ps") (V8SF "ps") (V8SI "si")
+ (V4DF "pd")])
+(define_mode_attr avxmodesuffixs
+ [(V16QI "b") (V8HI "w") (V4SI "d")])
+(define_mode_attr avxmodesuffix
+ [(V16QI "") (V32QI "256") (V4SI "") (V4SF "") (V2DF "")
+ (V8SI "256") (V8SF "256") (V4DF "256")])
+
;; Mapping of immediate bits for blend instructions
-(define_mode_attr blendbits [(V4SF "15") (V2DF "3")])
+(define_mode_attr blendbits
+ [(V8SF "255") (V4SF "15") (V4DF "15") (V2DF "3")])
+
+;; Mapping of immediate bits for vpermil instructions
+(define_mode_attr vpermilbits
+ [(V8SF "255") (V4SF "255") (V4DF "15") (V2DF "3")])
+
+;; Mapping of immediate bits for pinsr instructions
+(define_mode_attr pinsrbits [(V16QI "32768") (V8HI "128") (V4SI "8")])
;; Patterns whose name begins with "sse{,2,3}_" are invoked by intrinsics.
@@ -73,6 +139,47 @@
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(define_expand "mov<mode>"
+ [(set (match_operand:AVX256MODE 0 "nonimmediate_operand" "")
+ (match_operand:AVX256MODE 1 "nonimmediate_operand" ""))]
+ "TARGET_AVX"
+{
+ ix86_expand_vector_move (<MODE>mode, operands);
+ DONE;
+})
+
+(define_insn "*avx_mov<mode>_internal"
+ [(set (match_operand:AVXMODE 0 "nonimmediate_operand" "=x,x ,m")
+ (match_operand:AVXMODE 1 "nonimmediate_or_sse_const_operand" "C ,xm,x"))]
+ "TARGET_AVX
+ && (register_operand (operands[0], <MODE>mode)
+ || register_operand (operands[1], <MODE>mode))"
+{
+ switch (which_alternative)
+ {
+ case 0:
+ return standard_sse_constant_opcode (insn, operands[1]);
+ case 1:
+ case 2:
+ switch (get_attr_mode (insn))
+ {
+ case MODE_V8SF:
+ case MODE_V4SF:
+ return "vmovaps\t{%1, %0|%0, %1}";
+ case MODE_V4DF:
+ case MODE_V2DF:
+ return "vmovapd\t{%1, %0|%0, %1}";
+ default:
+ return "vmovdqa\t{%1, %0|%0, %1}";
+ }
+ default:
+ gcc_unreachable ();
+ }
+}
+ [(set_attr "type" "sselog1,ssemov,ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")])
+
;; All of these patterns are enabled for SSE1 as well as SSE2.
;; This is essential for maintaining stable calling conventions.
@@ -113,7 +220,7 @@
}
[(set_attr "type" "sselog1,ssemov,ssemov")
(set (attr "mode")
- (cond [(ior (ior (ne (symbol_ref "optimize_size") (const_int 0))
+ (cond [(ior (ior (ne (symbol_ref "optimize_function_for_size_p (cfun)") (const_int 0))
(eq (symbol_ref "TARGET_SSE2") (const_int 0)))
(and (eq_attr "alternative" "2")
(ne (symbol_ref "TARGET_SSE_TYPELESS_STORES")
@@ -186,6 +293,14 @@
})
(define_expand "push<mode>1"
+ [(match_operand:AVX256MODE 0 "register_operand" "")]
+ "TARGET_AVX"
+{
+ ix86_expand_push (<MODE>mode, operands[0]);
+ DONE;
+})
+
+(define_expand "push<mode>1"
[(match_operand:SSEMODE 0 "register_operand" "")]
"TARGET_SSE"
{
@@ -194,6 +309,15 @@
})
(define_expand "movmisalign<mode>"
+ [(set (match_operand:AVX256MODE 0 "nonimmediate_operand" "")
+ (match_operand:AVX256MODE 1 "nonimmediate_operand" ""))]
+ "TARGET_AVX"
+{
+ ix86_expand_vector_move_misalign (<MODE>mode, operands);
+ DONE;
+})
+
+(define_expand "movmisalign<mode>"
[(set (match_operand:SSEMODE 0 "nonimmediate_operand" "")
(match_operand:SSEMODE 1 "nonimmediate_operand" ""))]
"TARGET_SSE"
@@ -202,6 +326,31 @@
DONE;
})
+(define_insn "avx_movup<avxmodesuffixf2c><avxmodesuffix>"
+ [(set (match_operand:AVXMODEF2P 0 "nonimmediate_operand" "=x,m")
+ (unspec:AVXMODEF2P
+ [(match_operand:AVXMODEF2P 1 "nonimmediate_operand" "xm,x")]
+ UNSPEC_MOVU))]
+ "AVX_VEC_FLOAT_MODE_P (<MODE>mode)
+ && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
+ "vmovup<avxmodesuffixf2c>\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<MODE>")])
+
+(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"
+ "%vmovq\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "maybe_vex")
+ (set_attr "mode" "TI")])
+
(define_insn "<sse>_movup<ssemodesuffixf2c>"
[(set (match_operand:SSEMODEF2P 0 "nonimmediate_operand" "=x,m")
(unspec:SSEMODEF2P
@@ -213,6 +362,17 @@
[(set_attr "type" "ssemov")
(set_attr "mode" "<MODE>")])
+(define_insn "avx_movdqu<avxmodesuffix>"
+ [(set (match_operand:AVXMODEQI 0 "nonimmediate_operand" "=x,m")
+ (unspec:AVXMODEQI
+ [(match_operand:AVXMODEQI 1 "nonimmediate_operand" "xm,x")]
+ UNSPEC_MOVU))]
+ "TARGET_AVX && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
+ "vmovdqu\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")])
+
(define_insn "sse2_movdqu"
[(set (match_operand:V16QI 0 "nonimmediate_operand" "=x,m")
(unspec:V16QI [(match_operand:V16QI 1 "nonimmediate_operand" "xm,x")]
@@ -229,8 +389,9 @@
[(match_operand:SSEMODEF2P 1 "register_operand" "x")]
UNSPEC_MOVNT))]
"SSE_VEC_FLOAT_MODE_P (<MODE>mode)"
- "movntp<ssemodesuffixf2c>\t{%1, %0|%0, %1}"
+ "%vmovntp<ssemodesuffixf2c>\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "<MODE>")])
(define_insn "sse2_movntv2di"
@@ -238,9 +399,10 @@
(unspec:V2DI [(match_operand:V2DI 1 "register_operand" "x")]
UNSPEC_MOVNT))]
"TARGET_SSE2"
- "movntdq\t{%1, %0|%0, %1}"
+ "%vmovntdq\t{%1, %0|%0, %1}"
[(set_attr "type" "ssecvt")
(set_attr "prefix_data16" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "sse2_movntsi"
@@ -252,6 +414,17 @@
[(set_attr "type" "ssecvt")
(set_attr "mode" "V2DF")])
+(define_insn "avx_lddqu<avxmodesuffix>"
+ [(set (match_operand:AVXMODEQI 0 "register_operand" "=x")
+ (unspec:AVXMODEQI
+ [(match_operand:AVXMODEQI 1 "memory_operand" "m")]
+ UNSPEC_LDDQU))]
+ "TARGET_AVX"
+ "vlddqu\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")])
+
(define_insn "sse3_lddqu"
[(set (match_operand:V16QI 0 "register_operand" "=x")
(unspec:V16QI [(match_operand:V16QI 1 "memory_operand" "m")]
@@ -310,6 +483,26 @@
"ix86_expand_fp_absneg_operator (<CODE>, <MODE>mode, operands); DONE;")
(define_expand "<plusminus_insn><mode>3"
+ [(set (match_operand:AVX256MODEF2P 0 "register_operand" "")
+ (plusminus:AVX256MODEF2P
+ (match_operand:AVX256MODEF2P 1 "nonimmediate_operand" "")
+ (match_operand:AVX256MODEF2P 2 "nonimmediate_operand" "")))]
+ "AVX256_VEC_FLOAT_MODE_P (<MODE>mode)"
+ "ix86_fixup_binary_operands_no_copy (<CODE>, <MODE>mode, operands);")
+
+(define_insn "*avx_<plusminus_insn><mode>3"
+ [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
+ (plusminus:AVXMODEF2P
+ (match_operand:AVXMODEF2P 1 "nonimmediate_operand" "<comm>x")
+ (match_operand:AVXMODEF2P 2 "nonimmediate_operand" "xm")))]
+ "AVX_VEC_FLOAT_MODE_P (<MODE>mode)
+ && ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
+ "v<plusminus_mnemonic>p<avxmodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")])
+
+(define_expand "<plusminus_insn><mode>3"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "")
(plusminus:SSEMODEF2P
(match_operand:SSEMODEF2P 1 "nonimmediate_operand" "")
@@ -328,6 +521,20 @@
[(set_attr "type" "sseadd")
(set_attr "mode" "<MODE>")])
+(define_insn "*avx_vm<plusminus_insn><mode>3"
+ [(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
+ (vec_merge:SSEMODEF2P
+ (plusminus:SSEMODEF2P
+ (match_operand:SSEMODEF2P 1 "register_operand" "x")
+ (match_operand:SSEMODEF2P 2 "nonimmediate_operand" "xm"))
+ (match_dup 1)
+ (const_int 1)))]
+ "AVX128_VEC_FLOAT_MODE_P (<MODE>mode)"
+ "v<plusminus_mnemonic>s<ssemodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<ssescalarmode>")])
+
(define_insn "<sse>_vm<plusminus_insn><mode>3"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
(vec_merge:SSEMODEF2P
@@ -342,6 +549,26 @@
(set_attr "mode" "<ssescalarmode>")])
(define_expand "mul<mode>3"
+ [(set (match_operand:AVX256MODEF2P 0 "register_operand" "")
+ (mult:AVX256MODEF2P
+ (match_operand:AVX256MODEF2P 1 "nonimmediate_operand" "")
+ (match_operand:AVX256MODEF2P 2 "nonimmediate_operand" "")))]
+ "AVX256_VEC_FLOAT_MODE_P (<MODE>mode)"
+ "ix86_fixup_binary_operands_no_copy (MULT, <MODE>mode, operands);")
+
+(define_insn "*avx_mul<mode>3"
+ [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
+ (mult:AVXMODEF2P
+ (match_operand:AVXMODEF2P 1 "nonimmediate_operand" "%x")
+ (match_operand:AVXMODEF2P 2 "nonimmediate_operand" "xm")))]
+ "AVX_VEC_FLOAT_MODE_P (<MODE>mode)
+ && ix86_binary_operator_ok (MULT, <MODE>mode, operands)"
+ "vmulp<avxmodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ssemul")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")])
+
+(define_expand "mul<mode>3"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "")
(mult:SSEMODEF2P
(match_operand:SSEMODEF2P 1 "nonimmediate_operand" "")
@@ -360,6 +587,20 @@
[(set_attr "type" "ssemul")
(set_attr "mode" "<MODE>")])
+(define_insn "*avx_vmmul<mode>3"
+ [(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
+ (vec_merge:SSEMODEF2P
+ (mult:SSEMODEF2P
+ (match_operand:SSEMODEF2P 1 "register_operand" "x")
+ (match_operand:SSEMODEF2P 2 "nonimmediate_operand" "xm"))
+ (match_dup 1)
+ (const_int 1)))]
+ "AVX_VEC_FLOAT_MODE_P (<MODE>mode)"
+ "vmuls<ssemodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ssemul")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<ssescalarmode>")])
+
(define_insn "<sse>_vmmul<mode>3"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
(vec_merge:SSEMODEF2P
@@ -373,13 +614,49 @@
[(set_attr "type" "ssemul")
(set_attr "mode" "<ssescalarmode>")])
+(define_expand "divv8sf3"
+ [(set (match_operand:V8SF 0 "register_operand" "")
+ (div:V8SF (match_operand:V8SF 1 "register_operand" "")
+ (match_operand:V8SF 2 "nonimmediate_operand" "")))]
+ "TARGET_AVX"
+{
+ ix86_fixup_binary_operands_no_copy (DIV, V8SFmode, operands);
+
+ if (TARGET_SSE_MATH && TARGET_RECIP && !optimize_size
+ && flag_finite_math_only && !flag_trapping_math
+ && flag_unsafe_math_optimizations)
+ {
+ ix86_emit_swdivsf (operands[0], operands[1],
+ operands[2], V8SFmode);
+ DONE;
+ }
+})
+
+(define_expand "divv4df3"
+ [(set (match_operand:V4DF 0 "register_operand" "")
+ (div:V4DF (match_operand:V4DF 1 "register_operand" "")
+ (match_operand:V4DF 2 "nonimmediate_operand" "")))]
+ "TARGET_AVX"
+ "ix86_fixup_binary_operands_no_copy (DIV, V4DFmode, operands);")
+
+(define_insn "avx_div<mode>3"
+ [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
+ (div:AVXMODEF2P
+ (match_operand:AVXMODEF2P 1 "register_operand" "x")
+ (match_operand:AVXMODEF2P 2 "nonimmediate_operand" "xm")))]
+ "AVX_VEC_FLOAT_MODE_P (<MODE>mode)"
+ "vdivp<avxmodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ssediv")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<MODE>")])
+
(define_expand "divv4sf3"
[(set (match_operand:V4SF 0 "register_operand" "")
(div:V4SF (match_operand:V4SF 1 "register_operand" "")
(match_operand:V4SF 2 "nonimmediate_operand" "")))]
"TARGET_SSE"
{
- 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)
{
@@ -396,6 +673,17 @@
"TARGET_SSE2"
"")
+(define_insn "*avx_div<mode>3"
+ [(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
+ (div:SSEMODEF2P
+ (match_operand:SSEMODEF2P 1 "register_operand" "x")
+ (match_operand:SSEMODEF2P 2 "nonimmediate_operand" "xm")))]
+ "AVX128_VEC_FLOAT_MODE_P (<MODE>mode)"
+ "vdivp<ssemodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ssediv")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<MODE>")])
+
(define_insn "<sse>_div<mode>3"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
(div:SSEMODEF2P
@@ -406,6 +694,20 @@
[(set_attr "type" "ssediv")
(set_attr "mode" "<MODE>")])
+(define_insn "*avx_vmdiv<mode>3"
+ [(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
+ (vec_merge:SSEMODEF2P
+ (div:SSEMODEF2P
+ (match_operand:SSEMODEF2P 1 "register_operand" "x")
+ (match_operand:SSEMODEF2P 2 "nonimmediate_operand" "xm"))
+ (match_dup 1)
+ (const_int 1)))]
+ "AVX128_VEC_FLOAT_MODE_P (<MODE>mode)"
+ "vdivs<ssemodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ssediv")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<ssescalarmode>")])
+
(define_insn "<sse>_vmdiv<mode>3"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
(vec_merge:SSEMODEF2P
@@ -419,15 +721,39 @@
[(set_attr "type" "ssediv")
(set_attr "mode" "<ssescalarmode>")])
+(define_insn "avx_rcpv8sf2"
+ [(set (match_operand:V8SF 0 "register_operand" "=x")
+ (unspec:V8SF
+ [(match_operand:V8SF 1 "nonimmediate_operand" "xm")] UNSPEC_RCP))]
+ "TARGET_AVX"
+ "vrcpps\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sse")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
(define_insn "sse_rcpv4sf2"
[(set (match_operand:V4SF 0 "register_operand" "=x")
(unspec:V4SF
[(match_operand:V4SF 1 "nonimmediate_operand" "xm")] UNSPEC_RCP))]
"TARGET_SSE"
- "rcpps\t{%1, %0|%0, %1}"
+ "%vrcpps\t{%1, %0|%0, %1}"
[(set_attr "type" "sse")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "V4SF")])
+(define_insn "*avx_vmrcpv4sf2"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (vec_merge:V4SF
+ (unspec:V4SF [(match_operand:V4SF 1 "nonimmediate_operand" "xm")]
+ UNSPEC_RCP)
+ (match_operand:V4SF 2 "register_operand" "x")
+ (const_int 1)))]
+ "TARGET_AVX"
+ "vrcpss\t{%1, %2, %0|%0, %2, %1}"
+ [(set_attr "type" "sse")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "SF")])
+
(define_insn "sse_vmrcpv4sf2"
[(set (match_operand:V4SF 0 "register_operand" "=x")
(vec_merge:V4SF
@@ -440,12 +766,35 @@
[(set_attr "type" "sse")
(set_attr "mode" "SF")])
+(define_expand "sqrtv8sf2"
+ [(set (match_operand:V8SF 0 "register_operand" "")
+ (sqrt:V8SF (match_operand:V8SF 1 "nonimmediate_operand" "")))]
+ "TARGET_AVX"
+{
+ if (TARGET_SSE_MATH && TARGET_RECIP && !optimize_size
+ && flag_finite_math_only && !flag_trapping_math
+ && flag_unsafe_math_optimizations)
+ {
+ ix86_emit_swsqrtsf (operands[0], operands[1], V8SFmode, 0);
+ DONE;
+ }
+})
+
+(define_insn "avx_sqrtv8sf2"
+ [(set (match_operand:V8SF 0 "register_operand" "=x")
+ (sqrt:V8SF (match_operand:V8SF 1 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX"
+ "vsqrtps\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sse")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
(define_expand "sqrtv4sf2"
[(set (match_operand:V4SF 0 "register_operand" "")
(sqrt:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "")))]
"TARGET_SSE"
{
- 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)
{
@@ -458,18 +807,42 @@
[(set (match_operand:V4SF 0 "register_operand" "=x")
(sqrt:V4SF (match_operand:V4SF 1 "nonimmediate_operand" "xm")))]
"TARGET_SSE"
- "sqrtps\t{%1, %0|%0, %1}"
+ "%vsqrtps\t{%1, %0|%0, %1}"
[(set_attr "type" "sse")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "V4SF")])
+(define_insn "sqrtv4df2"
+ [(set (match_operand:V4DF 0 "register_operand" "=x")
+ (sqrt:V4DF (match_operand:V4DF 1 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX"
+ "vsqrtpd\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sse")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4DF")])
+
(define_insn "sqrtv2df2"
[(set (match_operand:V2DF 0 "register_operand" "=x")
(sqrt:V2DF (match_operand:V2DF 1 "nonimmediate_operand" "xm")))]
"TARGET_SSE2"
- "sqrtpd\t{%1, %0|%0, %1}"
+ "%vsqrtpd\t{%1, %0|%0, %1}"
[(set_attr "type" "sse")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "V2DF")])
+(define_insn "*avx_vmsqrt<mode>2"
+ [(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
+ (vec_merge:SSEMODEF2P
+ (sqrt:SSEMODEF2P
+ (match_operand:SSEMODEF2P 1 "nonimmediate_operand" "xm"))
+ (match_operand:SSEMODEF2P 2 "register_operand" "x")
+ (const_int 1)))]
+ "AVX_VEC_FLOAT_MODE_P (<MODE>mode)"
+ "vsqrts<ssemodesuffixf2c>\t{%1, %2, %0|%0, %2, %1}"
+ [(set_attr "type" "sse")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<ssescalarmode>")])
+
(define_insn "<sse>_vmsqrt<mode>2"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
(vec_merge:SSEMODEF2P
@@ -482,6 +855,26 @@
[(set_attr "type" "sse")
(set_attr "mode" "<ssescalarmode>")])
+(define_expand "rsqrtv8sf2"
+ [(set (match_operand:V8SF 0 "register_operand" "")
+ (unspec:V8SF
+ [(match_operand:V8SF 1 "nonimmediate_operand" "")] UNSPEC_RSQRT))]
+ "TARGET_AVX && TARGET_SSE_MATH"
+{
+ ix86_emit_swsqrtsf (operands[0], operands[1], V8SFmode, 1);
+ DONE;
+})
+
+(define_insn "avx_rsqrtv8sf2"
+ [(set (match_operand:V8SF 0 "register_operand" "=x")
+ (unspec:V8SF
+ [(match_operand:V8SF 1 "nonimmediate_operand" "xm")] UNSPEC_RSQRT))]
+ "TARGET_AVX"
+ "vrsqrtps\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sse")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
(define_expand "rsqrtv4sf2"
[(set (match_operand:V4SF 0 "register_operand" "")
(unspec:V4SF
@@ -497,10 +890,24 @@
(unspec:V4SF
[(match_operand:V4SF 1 "nonimmediate_operand" "xm")] UNSPEC_RSQRT))]
"TARGET_SSE"
- "rsqrtps\t{%1, %0|%0, %1}"
+ "%vrsqrtps\t{%1, %0|%0, %1}"
[(set_attr "type" "sse")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "V4SF")])
+(define_insn "*avx_vmrsqrtv4sf2"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (vec_merge:V4SF
+ (unspec:V4SF [(match_operand:V4SF 1 "nonimmediate_operand" "xm")]
+ UNSPEC_RSQRT)
+ (match_operand:V4SF 2 "register_operand" "x")
+ (const_int 1)))]
+ "TARGET_AVX"
+ "vrsqrtss\t{%1, %2, %0|%0, %2, %1}"
+ [(set_attr "type" "sse")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "SF")])
+
(define_insn "sse_vmrsqrtv4sf2"
[(set (match_operand:V4SF 0 "register_operand" "=x")
(vec_merge:V4SF
@@ -518,6 +925,18 @@
;; applied to NaNs. Hopefully the optimizers won't get too smart on us.
(define_expand "<code><mode>3"
+ [(set (match_operand:AVX256MODEF2P 0 "register_operand" "")
+ (smaxmin:AVX256MODEF2P
+ (match_operand:AVX256MODEF2P 1 "nonimmediate_operand" "")
+ (match_operand:AVX256MODEF2P 2 "nonimmediate_operand" "")))]
+ "AVX256_VEC_FLOAT_MODE_P (<MODE>mode)"
+{
+ if (!flag_finite_math_only)
+ operands[1] = force_reg (<MODE>mode, operands[1]);
+ ix86_fixup_binary_operands_no_copy (<CODE>, <MODE>mode, operands);
+})
+
+(define_expand "<code><mode>3"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "")
(smaxmin:SSEMODEF2P
(match_operand:SSEMODEF2P 1 "nonimmediate_operand" "")
@@ -529,6 +948,18 @@
ix86_fixup_binary_operands_no_copy (<CODE>, <MODE>mode, operands);
})
+(define_insn "*avx_<code><mode>3_finite"
+ [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
+ (smaxmin:AVXMODEF2P
+ (match_operand:AVXMODEF2P 1 "nonimmediate_operand" "%x")
+ (match_operand:AVXMODEF2P 2 "nonimmediate_operand" "xm")))]
+ "AVX_VEC_FLOAT_MODE_P (<MODE>mode) && flag_finite_math_only
+ && ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
+ "v<maxminfprefix>p<ssemodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<MODE>")])
+
(define_insn "*<code><mode>3_finite"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
(smaxmin:SSEMODEF2P
@@ -540,6 +971,17 @@
[(set_attr "type" "sseadd")
(set_attr "mode" "<MODE>")])
+(define_insn "*avx_<code><mode>3"
+ [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
+ (smaxmin:AVXMODEF2P
+ (match_operand:AVXMODEF2P 1 "nonimmediate_operand" "%x")
+ (match_operand:AVXMODEF2P 2 "nonimmediate_operand" "xm")))]
+ "AVX_VEC_FLOAT_MODE_P (<MODE>mode)"
+ "v<maxminfprefix>p<avxmodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")])
+
(define_insn "*<code><mode>3"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
(smaxmin:SSEMODEF2P
@@ -550,6 +992,20 @@
[(set_attr "type" "sseadd")
(set_attr "mode" "<MODE>")])
+(define_insn "*avx_vm<code><mode>3"
+ [(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
+ (vec_merge:SSEMODEF2P
+ (smaxmin:SSEMODEF2P
+ (match_operand:SSEMODEF2P 1 "register_operand" "x")
+ (match_operand:SSEMODEF2P 2 "nonimmediate_operand" "xm"))
+ (match_dup 1)
+ (const_int 1)))]
+ "AVX128_VEC_FLOAT_MODE_P (<MODE>mode)"
+ "v<maxminfprefix>s<ssemodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sse")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<ssescalarmode>")])
+
(define_insn "<sse>_vm<code><mode>3"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
(vec_merge:SSEMODEF2P
@@ -569,6 +1025,30 @@
;; Their operands are not commutative, and thus they may be used in the
;; presence of -0.0 and NaN.
+(define_insn "*avx_ieee_smin<mode>3"
+ [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
+ (unspec:AVXMODEF2P
+ [(match_operand:AVXMODEF2P 1 "register_operand" "x")
+ (match_operand:AVXMODEF2P 2 "nonimmediate_operand" "xm")]
+ UNSPEC_IEEE_MIN))]
+ "AVX_VEC_FLOAT_MODE_P (<MODE>mode)"
+ "vminp<avxmodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")])
+
+(define_insn "*avx_ieee_smax<mode>3"
+ [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
+ (unspec:AVXMODEF2P
+ [(match_operand:AVXMODEF2P 1 "register_operand" "x")
+ (match_operand:AVXMODEF2P 2 "nonimmediate_operand" "xm")]
+ UNSPEC_IEEE_MAX))]
+ "AVX_VEC_FLOAT_MODE_P (<MODE>mode)"
+ "vmaxp<avxmodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")])
+
(define_insn "*ieee_smin<mode>3"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
(unspec:SSEMODEF2P
@@ -591,6 +1071,48 @@
[(set_attr "type" "sseadd")
(set_attr "mode" "<MODE>")])
+(define_insn "avx_addsubv8sf3"
+ [(set (match_operand:V8SF 0 "register_operand" "=x")
+ (vec_merge:V8SF
+ (plus:V8SF
+ (match_operand:V8SF 1 "register_operand" "x")
+ (match_operand:V8SF 2 "nonimmediate_operand" "xm"))
+ (minus:V8SF (match_dup 1) (match_dup 2))
+ (const_int 85)))]
+ "TARGET_AVX"
+ "vaddsubps\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "avx_addsubv4df3"
+ [(set (match_operand:V4DF 0 "register_operand" "=x")
+ (vec_merge:V4DF
+ (plus:V4DF
+ (match_operand:V4DF 1 "register_operand" "x")
+ (match_operand:V4DF 2 "nonimmediate_operand" "xm"))
+ (minus:V4DF (match_dup 1) (match_dup 2))
+ (const_int 5)))]
+ "TARGET_AVX"
+ "vaddsubpd\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4DF")])
+
+(define_insn "*avx_addsubv4sf3"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (vec_merge:V4SF
+ (plus:V4SF
+ (match_operand:V4SF 1 "register_operand" "x")
+ (match_operand:V4SF 2 "nonimmediate_operand" "xm"))
+ (minus:V4SF (match_dup 1) (match_dup 2))
+ (const_int 5)))]
+ "TARGET_AVX"
+ "vaddsubps\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4SF")])
+
(define_insn "sse3_addsubv4sf3"
[(set (match_operand:V4SF 0 "register_operand" "=x")
(vec_merge:V4SF
@@ -605,6 +1127,20 @@
(set_attr "prefix_rep" "1")
(set_attr "mode" "V4SF")])
+(define_insn "*avx_addsubv2df3"
+ [(set (match_operand:V2DF 0 "register_operand" "=x")
+ (vec_merge:V2DF
+ (plus:V2DF
+ (match_operand:V2DF 1 "register_operand" "x")
+ (match_operand:V2DF 2 "nonimmediate_operand" "xm"))
+ (minus:V2DF (match_dup 1) (match_dup 2))
+ (const_int 1)))]
+ "TARGET_AVX"
+ "vaddsubpd\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V2DF")])
+
(define_insn "sse3_addsubv2df3"
[(set (match_operand:V2DF 0 "register_operand" "=x")
(vec_merge:V2DF
@@ -618,6 +1154,103 @@
[(set_attr "type" "sseadd")
(set_attr "mode" "V2DF")])
+(define_insn "avx_h<plusminus_insn>v4df3"
+ [(set (match_operand:V4DF 0 "register_operand" "=x")
+ (vec_concat:V4DF
+ (vec_concat:V2DF
+ (plusminus:DF
+ (vec_select:DF
+ (match_operand:V4DF 1 "register_operand" "x")
+ (parallel [(const_int 0)]))
+ (vec_select:DF (match_dup 1) (parallel [(const_int 1)])))
+ (plusminus:DF
+ (vec_select:DF (match_dup 1) (parallel [(const_int 2)]))
+ (vec_select:DF (match_dup 1) (parallel [(const_int 3)]))))
+ (vec_concat:V2DF
+ (plusminus:DF
+ (vec_select:DF
+ (match_operand:V4DF 2 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)]))
+ (vec_select:DF (match_dup 2) (parallel [(const_int 1)])))
+ (plusminus:DF
+ (vec_select:DF (match_dup 2) (parallel [(const_int 2)]))
+ (vec_select:DF (match_dup 2) (parallel [(const_int 3)]))))))]
+ "TARGET_AVX"
+ "vh<plusminus_mnemonic>pd\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4DF")])
+
+(define_insn "avx_h<plusminus_insn>v8sf3"
+ [(set (match_operand:V8SF 0 "register_operand" "=x")
+ (vec_concat:V8SF
+ (vec_concat:V4SF
+ (vec_concat:V2SF
+ (plusminus:SF
+ (vec_select:SF
+ (match_operand:V8SF 1 "register_operand" "x")
+ (parallel [(const_int 0)]))
+ (vec_select:SF (match_dup 1) (parallel [(const_int 1)])))
+ (plusminus:SF
+ (vec_select:SF (match_dup 1) (parallel [(const_int 2)]))
+ (vec_select:SF (match_dup 1) (parallel [(const_int 3)]))))
+ (vec_concat:V2SF
+ (plusminus:SF
+ (vec_select:SF
+ (match_operand:V8SF 2 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)]))
+ (vec_select:SF (match_dup 2) (parallel [(const_int 1)])))
+ (plusminus:SF
+ (vec_select:SF (match_dup 2) (parallel [(const_int 2)]))
+ (vec_select:SF (match_dup 2) (parallel [(const_int 3)])))))
+ (vec_concat:V4SF
+ (vec_concat:V2SF
+ (plusminus:SF
+ (vec_select:SF (match_dup 1) (parallel [(const_int 4)]))
+ (vec_select:SF (match_dup 1) (parallel [(const_int 5)])))
+ (plusminus:SF
+ (vec_select:SF (match_dup 1) (parallel [(const_int 6)]))
+ (vec_select:SF (match_dup 1) (parallel [(const_int 7)]))))
+ (vec_concat:V2SF
+ (plusminus:SF
+ (vec_select:SF (match_dup 2) (parallel [(const_int 4)]))
+ (vec_select:SF (match_dup 2) (parallel [(const_int 5)])))
+ (plusminus:SF
+ (vec_select:SF (match_dup 2) (parallel [(const_int 6)]))
+ (vec_select:SF (match_dup 2) (parallel [(const_int 7)])))))))]
+ "TARGET_AVX"
+ "vh<plusminus_mnemonic>ps\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "*avx_h<plusminus_insn>v4sf3"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (vec_concat:V4SF
+ (vec_concat:V2SF
+ (plusminus:SF
+ (vec_select:SF
+ (match_operand:V4SF 1 "register_operand" "x")
+ (parallel [(const_int 0)]))
+ (vec_select:SF (match_dup 1) (parallel [(const_int 1)])))
+ (plusminus:SF
+ (vec_select:SF (match_dup 1) (parallel [(const_int 2)]))
+ (vec_select:SF (match_dup 1) (parallel [(const_int 3)]))))
+ (vec_concat:V2SF
+ (plusminus:SF
+ (vec_select:SF
+ (match_operand:V4SF 2 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)]))
+ (vec_select:SF (match_dup 2) (parallel [(const_int 1)])))
+ (plusminus:SF
+ (vec_select:SF (match_dup 2) (parallel [(const_int 2)]))
+ (vec_select:SF (match_dup 2) (parallel [(const_int 3)]))))))]
+ "TARGET_AVX"
+ "vh<plusminus_mnemonic>ps\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4SF")])
+
(define_insn "sse3_h<plusminus_insn>v4sf3"
[(set (match_operand:V4SF 0 "register_operand" "=x")
(vec_concat:V4SF
@@ -645,6 +1278,25 @@
(set_attr "prefix_rep" "1")
(set_attr "mode" "V4SF")])
+(define_insn "*avx_h<plusminus_insn>v2df3"
+ [(set (match_operand:V2DF 0 "register_operand" "=x")
+ (vec_concat:V2DF
+ (plusminus:DF
+ (vec_select:DF
+ (match_operand:V2DF 1 "register_operand" "x")
+ (parallel [(const_int 0)]))
+ (vec_select:DF (match_dup 1) (parallel [(const_int 1)])))
+ (plusminus:DF
+ (vec_select:DF
+ (match_operand:V2DF 2 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)]))
+ (vec_select:DF (match_dup 2) (parallel [(const_int 1)])))))]
+ "TARGET_AVX"
+ "vh<plusminus_mnemonic>pd\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V2DF")])
+
(define_insn "sse3_h<plusminus_insn>v2df3"
[(set (match_operand:V2DF 0 "register_operand" "=x")
(vec_concat:V2DF
@@ -712,6 +1364,48 @@
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(define_insn "avx_cmpp<avxmodesuffixf2c><mode>3"
+ [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
+ (unspec:AVXMODEF2P
+ [(match_operand:AVXMODEF2P 1 "register_operand" "x")
+ (match_operand:AVXMODEF2P 2 "nonimmediate_operand" "xm")
+ (match_operand:SI 3 "const_0_to_31_operand" "n")]
+ UNSPEC_PCMP))]
+ "TARGET_AVX"
+ "vcmpp<avxmodesuffixf2c>\t{%3, %2, %1, %0|%0, %1, %2, %3}"
+ [(set_attr "type" "ssecmp")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<MODE>")])
+
+(define_insn "avx_cmps<ssemodesuffixf2c><mode>3"
+ [(set (match_operand:SSEMODEF2P 0 "register_operand" "")
+ (vec_merge:SSEMODEF2P
+ (unspec:SSEMODEF2P
+ [(match_operand:SSEMODEF2P 1 "register_operand" "x")
+ (match_operand:SSEMODEF2P 2 "nonimmediate_operand" "xm")
+ (match_operand:SI 3 "const_0_to_31_operand" "n")]
+ UNSPEC_PCMP)
+ (match_dup 1)
+ (const_int 1)))]
+ "TARGET_AVX"
+ "vcmps<ssemodesuffixf2c>\t{%3, %2, %1, %0|%0, %1, %2, %3}"
+ [(set_attr "type" "ssecmp")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<ssescalarmode>")])
+
+;; We don't promote 128bit vector compare intrinsics. But vectorizer
+;; may generate 256bit vector compare instructions.
+(define_insn "*avx_maskcmp<mode>3"
+ [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
+ (match_operator:AVXMODEF2P 3 "avx_comparison_float_operator"
+ [(match_operand:AVXMODEF2P 1 "register_operand" "x")
+ (match_operand:AVXMODEF2P 2 "nonimmediate_operand" "xm")]))]
+ "AVX_VEC_FLOAT_MODE_P (<MODE>mode)"
+ "vcmp%D3p<avxmodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ssecmp")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")])
+
(define_insn "<sse>_maskcmp<mode>3"
[(set (match_operand:SSEMODEF4 0 "register_operand" "=x")
(match_operator:SSEMODEF4 3 "sse_comparison_operator"
@@ -746,8 +1440,9 @@
(match_operand:<ssevecmode> 1 "nonimmediate_operand" "xm")
(parallel [(const_int 0)]))))]
"SSE_FLOAT_MODE_P (<MODE>mode)"
- "comis<ssemodefsuffix>\t{%1, %0|%0, %1}"
+ "%vcomis<ssemodefsuffix>\t{%1, %0|%0, %1}"
[(set_attr "type" "ssecomi")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "<MODE>")])
(define_insn "<sse>_ucomi"
@@ -760,8 +1455,9 @@
(match_operand:<ssevecmode> 1 "nonimmediate_operand" "xm")
(parallel [(const_int 0)]))))]
"SSE_FLOAT_MODE_P (<MODE>mode)"
- "ucomis<ssemodefsuffix>\t{%1, %0|%0, %1}"
+ "%vucomis<ssemodefsuffix>\t{%1, %0|%0, %1}"
[(set_attr "type" "ssecomi")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "<MODE>")])
(define_expand "vcond<mode>"
@@ -786,6 +1482,18 @@
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(define_insn "avx_nand<mode>3"
+ [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
+ (and:AVXMODEF2P
+ (not:AVXMODEF2P
+ (match_operand:AVXMODEF2P 1 "register_operand" "x"))
+ (match_operand:AVXMODEF2P 2 "nonimmediate_operand" "xm")))]
+ "AVX_VEC_FLOAT_MODE_P (<MODE>mode)"
+ "vandnp<avxmodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")])
+
(define_insn "<sse>_nand<mode>3"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
(and:SSEMODEF2P
@@ -798,6 +1506,26 @@
(set_attr "mode" "<MODE>")])
(define_expand "<code><mode>3"
+ [(set (match_operand:AVX256MODEF2P 0 "register_operand" "")
+ (plogic:AVX256MODEF2P
+ (match_operand:AVX256MODEF2P 1 "nonimmediate_operand" "")
+ (match_operand:AVX256MODEF2P 2 "nonimmediate_operand" "")))]
+ "AVX256_VEC_FLOAT_MODE_P (<MODE>mode)"
+ "ix86_fixup_binary_operands_no_copy (<CODE>, <MODE>mode, operands);")
+
+(define_insn "*avx_<code><mode>3"
+ [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
+ (plogic:AVXMODEF2P
+ (match_operand:AVXMODEF2P 1 "nonimmediate_operand" "%x")
+ (match_operand:AVXMODEF2P 2 "nonimmediate_operand" "xm")))]
+ "AVX_VEC_FLOAT_MODE_P (<MODE>mode)
+ && ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
+ "v<plogicprefix>p<avxmodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")])
+
+(define_expand "<code><mode>3"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "")
(plogic:SSEMODEF2P
(match_operand:SSEMODEF2P 1 "nonimmediate_operand" "")
@@ -821,6 +1549,18 @@
;; allocation lossage. These patterns do not allow memory operands
;; because the native instructions read the full 128-bits.
+(define_insn "*avx_nand<mode>3"
+ [(set (match_operand:MODEF 0 "register_operand" "=x")
+ (and:MODEF
+ (not:MODEF
+ (match_operand:MODEF 1 "register_operand" "x"))
+ (match_operand:MODEF 2 "register_operand" "x")))]
+ "AVX_FLOAT_MODE_P (<MODE>mode)"
+ "vandnp<ssemodefsuffix>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<ssevecmode>")])
+
(define_insn "*nand<mode>3"
[(set (match_operand:MODEF 0 "register_operand" "=x")
(and:MODEF
@@ -832,6 +1572,17 @@
[(set_attr "type" "sselog")
(set_attr "mode" "<ssevecmode>")])
+(define_insn "*avx_<code><mode>3"
+ [(set (match_operand:MODEF 0 "register_operand" "=x")
+ (plogic:MODEF
+ (match_operand:MODEF 1 "register_operand" "x")
+ (match_operand:MODEF 2 "register_operand" "x")))]
+ "AVX_FLOAT_MODE_P (<MODE>mode)"
+ "v<plogicprefix>p<ssemodefsuffix>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<ssevecmode>")])
+
(define_insn "*<code><mode>3"
[(set (match_operand:MODEF 0 "register_operand" "=x")
(plogic:MODEF
@@ -1440,6 +2191,19 @@
(set_attr "unit" "mmx")
(set_attr "mode" "SF")])
+(define_insn "*avx_cvtsi2ss"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (vec_merge:V4SF
+ (vec_duplicate:V4SF
+ (float:SF (match_operand:SI 2 "nonimmediate_operand" "rm")))
+ (match_operand:V4SF 1 "register_operand" "x")
+ (const_int 1)))]
+ "TARGET_AVX"
+ "vcvtsi2ss\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseicvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "SF")])
+
(define_insn "sse_cvtsi2ss"
[(set (match_operand:V4SF 0 "register_operand" "=x,x")
(vec_merge:V4SF
@@ -1454,6 +2218,19 @@
(set_attr "amdfam10_decode" "vector,double")
(set_attr "mode" "SF")])
+(define_insn "*avx_cvtsi2ssq"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (vec_merge:V4SF
+ (vec_duplicate:V4SF
+ (float:SF (match_operand:DI 2 "nonimmediate_operand" "rm")))
+ (match_operand:V4SF 1 "register_operand" "x")
+ (const_int 1)))]
+ "TARGET_AVX && TARGET_64BIT"
+ "vcvtsi2ssq\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseicvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "SF")])
+
(define_insn "sse_cvtsi2ssq"
[(set (match_operand:V4SF 0 "register_operand" "=x,x")
(vec_merge:V4SF
@@ -1476,10 +2253,11 @@
(parallel [(const_int 0)]))]
UNSPEC_FIX_NOTRUNC))]
"TARGET_SSE"
- "cvtss2si\t{%1, %0|%0, %1}"
+ "%vcvtss2si\t{%1, %0|%0, %1}"
[(set_attr "type" "sseicvt")
(set_attr "athlon_decode" "double,vector")
(set_attr "prefix_rep" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "SI")])
(define_insn "sse_cvtss2si_2"
@@ -1487,11 +2265,12 @@
(unspec:SI [(match_operand:SF 1 "nonimmediate_operand" "x,m")]
UNSPEC_FIX_NOTRUNC))]
"TARGET_SSE"
- "cvtss2si\t{%1, %0|%0, %1}"
+ "%vcvtss2si\t{%1, %0|%0, %1}"
[(set_attr "type" "sseicvt")
(set_attr "athlon_decode" "double,vector")
(set_attr "amdfam10_decode" "double,double")
(set_attr "prefix_rep" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "SI")])
(define_insn "sse_cvtss2siq"
@@ -1502,10 +2281,11 @@
(parallel [(const_int 0)]))]
UNSPEC_FIX_NOTRUNC))]
"TARGET_SSE && TARGET_64BIT"
- "cvtss2siq\t{%1, %0|%0, %1}"
+ "%vcvtss2siq\t{%1, %0|%0, %1}"
[(set_attr "type" "sseicvt")
(set_attr "athlon_decode" "double,vector")
(set_attr "prefix_rep" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "DI")])
(define_insn "sse_cvtss2siq_2"
@@ -1513,11 +2293,12 @@
(unspec:DI [(match_operand:SF 1 "nonimmediate_operand" "x,m")]
UNSPEC_FIX_NOTRUNC))]
"TARGET_SSE && TARGET_64BIT"
- "cvtss2siq\t{%1, %0|%0, %1}"
+ "%vcvtss2siq\t{%1, %0|%0, %1}"
[(set_attr "type" "sseicvt")
(set_attr "athlon_decode" "double,vector")
(set_attr "amdfam10_decode" "double,double")
(set_attr "prefix_rep" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "DI")])
(define_insn "sse_cvttss2si"
@@ -1527,11 +2308,12 @@
(match_operand:V4SF 1 "nonimmediate_operand" "x,m")
(parallel [(const_int 0)]))))]
"TARGET_SSE"
- "cvttss2si\t{%1, %0|%0, %1}"
+ "%vcvttss2si\t{%1, %0|%0, %1}"
[(set_attr "type" "sseicvt")
(set_attr "athlon_decode" "double,vector")
(set_attr "amdfam10_decode" "double,double")
(set_attr "prefix_rep" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "SI")])
(define_insn "sse_cvttss2siq"
@@ -1541,13 +2323,24 @@
(match_operand:V4SF 1 "nonimmediate_operand" "x,m")
(parallel [(const_int 0)]))))]
"TARGET_SSE && TARGET_64BIT"
- "cvttss2siq\t{%1, %0|%0, %1}"
+ "%vcvttss2siq\t{%1, %0|%0, %1}"
[(set_attr "type" "sseicvt")
(set_attr "athlon_decode" "double,vector")
(set_attr "amdfam10_decode" "double,double")
(set_attr "prefix_rep" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "DI")])
+(define_insn "avx_cvtdq2ps<avxmodesuffix>"
+ [(set (match_operand:AVXMODEDCVTDQ2PS 0 "register_operand" "=x")
+ (float:AVXMODEDCVTDQ2PS
+ (match_operand:<avxcvtvecmode> 1 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX"
+ "vcvtdq2ps\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")])
+
(define_insn "sse2_cvtdq2ps"
[(set (match_operand:V4SF 0 "register_operand" "=x")
(float:V4SF (match_operand:V4SI 1 "nonimmediate_operand" "xm")))]
@@ -1556,6 +2349,17 @@
[(set_attr "type" "ssecvt")
(set_attr "mode" "V4SF")])
+(define_insn "avx_cvtps2dq<avxmodesuffix>"
+ [(set (match_operand:AVXMODEDCVTPS2DQ 0 "register_operand" "=x")
+ (unspec:AVXMODEDCVTPS2DQ
+ [(match_operand:<avxcvtvecmode> 1 "nonimmediate_operand" "xm")]
+ UNSPEC_FIX_NOTRUNC))]
+ "TARGET_AVX"
+ "vcvtps2dq\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")])
+
(define_insn "sse2_cvtps2dq"
[(set (match_operand:V4SI 0 "register_operand" "=x")
(unspec:V4SI [(match_operand:V4SF 1 "nonimmediate_operand" "xm")]
@@ -1566,6 +2370,16 @@
(set_attr "prefix_data16" "1")
(set_attr "mode" "TI")])
+(define_insn "avx_cvttps2dq<avxmodesuffix>"
+ [(set (match_operand:AVXMODEDCVTPS2DQ 0 "register_operand" "=x")
+ (fix:AVXMODEDCVTPS2DQ
+ (match_operand:<avxcvtvecmode> 1 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX"
+ "vcvttps2dq\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")])
+
(define_insn "sse2_cvttps2dq"
[(set (match_operand:V4SI 0 "register_operand" "=x")
(fix:V4SI (match_operand:V4SF 1 "nonimmediate_operand" "xm")))]
@@ -1611,6 +2425,19 @@
(set_attr "prefix_data16" "1")
(set_attr "mode" "TI")])
+(define_insn "*avx_cvtsi2sd"
+ [(set (match_operand:V2DF 0 "register_operand" "=x")
+ (vec_merge:V2DF
+ (vec_duplicate:V2DF
+ (float:DF (match_operand:SI 2 "nonimmediate_operand" "rm")))
+ (match_operand:V2DF 1 "register_operand" "x")
+ (const_int 1)))]
+ "TARGET_AVX"
+ "vcvtsi2sd\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseicvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "DF")])
+
(define_insn "sse2_cvtsi2sd"
[(set (match_operand:V2DF 0 "register_operand" "=x,x")
(vec_merge:V2DF
@@ -1625,6 +2452,19 @@
(set_attr "athlon_decode" "double,direct")
(set_attr "amdfam10_decode" "vector,double")])
+(define_insn "*avx_cvtsi2sdq"
+ [(set (match_operand:V2DF 0 "register_operand" "=x")
+ (vec_merge:V2DF
+ (vec_duplicate:V2DF
+ (float:DF (match_operand:DI 2 "nonimmediate_operand" "rm")))
+ (match_operand:V2DF 1 "register_operand" "x")
+ (const_int 1)))]
+ "TARGET_AVX && TARGET_64BIT"
+ "vcvtsi2sdq\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseicvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "DF")])
+
(define_insn "sse2_cvtsi2sdq"
[(set (match_operand:V2DF 0 "register_operand" "=x,x")
(vec_merge:V2DF
@@ -1647,10 +2487,11 @@
(parallel [(const_int 0)]))]
UNSPEC_FIX_NOTRUNC))]
"TARGET_SSE2"
- "cvtsd2si\t{%1, %0|%0, %1}"
+ "%vcvtsd2si\t{%1, %0|%0, %1}"
[(set_attr "type" "sseicvt")
(set_attr "athlon_decode" "double,vector")
(set_attr "prefix_rep" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "SI")])
(define_insn "sse2_cvtsd2si_2"
@@ -1658,11 +2499,12 @@
(unspec:SI [(match_operand:DF 1 "nonimmediate_operand" "x,m")]
UNSPEC_FIX_NOTRUNC))]
"TARGET_SSE2"
- "cvtsd2si\t{%1, %0|%0, %1}"
+ "%vcvtsd2si\t{%1, %0|%0, %1}"
[(set_attr "type" "sseicvt")
(set_attr "athlon_decode" "double,vector")
(set_attr "amdfam10_decode" "double,double")
(set_attr "prefix_rep" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "SI")])
(define_insn "sse2_cvtsd2siq"
@@ -1673,10 +2515,11 @@
(parallel [(const_int 0)]))]
UNSPEC_FIX_NOTRUNC))]
"TARGET_SSE2 && TARGET_64BIT"
- "cvtsd2siq\t{%1, %0|%0, %1}"
+ "%vcvtsd2siq\t{%1, %0|%0, %1}"
[(set_attr "type" "sseicvt")
(set_attr "athlon_decode" "double,vector")
(set_attr "prefix_rep" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "DI")])
(define_insn "sse2_cvtsd2siq_2"
@@ -1684,11 +2527,12 @@
(unspec:DI [(match_operand:DF 1 "nonimmediate_operand" "x,m")]
UNSPEC_FIX_NOTRUNC))]
"TARGET_SSE2 && TARGET_64BIT"
- "cvtsd2siq\t{%1, %0|%0, %1}"
+ "%vcvtsd2siq\t{%1, %0|%0, %1}"
[(set_attr "type" "sseicvt")
(set_attr "athlon_decode" "double,vector")
(set_attr "amdfam10_decode" "double,double")
(set_attr "prefix_rep" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "DI")])
(define_insn "sse2_cvttsd2si"
@@ -1698,9 +2542,10 @@
(match_operand:V2DF 1 "nonimmediate_operand" "x,m")
(parallel [(const_int 0)]))))]
"TARGET_SSE2"
- "cvttsd2si\t{%1, %0|%0, %1}"
+ "%vcvttsd2si\t{%1, %0|%0, %1}"
[(set_attr "type" "sseicvt")
(set_attr "prefix_rep" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "SI")
(set_attr "athlon_decode" "double,vector")
(set_attr "amdfam10_decode" "double,double")])
@@ -1712,13 +2557,23 @@
(match_operand:V2DF 1 "nonimmediate_operand" "x,m")
(parallel [(const_int 0)]))))]
"TARGET_SSE2 && TARGET_64BIT"
- "cvttsd2siq\t{%1, %0|%0, %1}"
+ "%vcvttsd2siq\t{%1, %0|%0, %1}"
[(set_attr "type" "sseicvt")
(set_attr "prefix_rep" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "DI")
(set_attr "athlon_decode" "double,vector")
(set_attr "amdfam10_decode" "double,double")])
+(define_insn "avx_cvtdq2pd256"
+ [(set (match_operand:V4DF 0 "register_operand" "=x")
+ (float:V4DF (match_operand:V4SI 1 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX"
+ "vcvtdq2pd\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4DF")])
+
(define_insn "sse2_cvtdq2pd"
[(set (match_operand:V2DF 0 "register_operand" "=x")
(float:V2DF
@@ -1726,10 +2581,21 @@
(match_operand:V4SI 1 "nonimmediate_operand" "xm")
(parallel [(const_int 0) (const_int 1)]))))]
"TARGET_SSE2"
- "cvtdq2pd\t{%1, %0|%0, %1}"
+ "%vcvtdq2pd\t{%1, %0|%0, %1}"
[(set_attr "type" "ssecvt")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "V2DF")])
+(define_insn "avx_cvtpd2dq256"
+ [(set (match_operand:V4SI 0 "register_operand" "=x")
+ (unspec:V4SI [(match_operand:V4DF 1 "nonimmediate_operand" "xm")]
+ UNSPEC_FIX_NOTRUNC))]
+ "TARGET_AVX"
+ "vcvtpd2dq{y}\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "OI")])
+
(define_expand "sse2_cvtpd2dq"
[(set (match_operand:V4SI 0 "register_operand" "")
(vec_concat:V4SI
@@ -1746,12 +2612,23 @@
UNSPEC_FIX_NOTRUNC)
(match_operand:V2SI 2 "const0_operand" "")))]
"TARGET_SSE2"
- "cvtpd2dq\t{%1, %0|%0, %1}"
+ "* return TARGET_AVX ? \"vcvtpd2dq{x}\t{%1, %0|%0, %1}\"
+ : \"cvtpd2dq\t{%1, %0|%0, %1}\";"
[(set_attr "type" "ssecvt")
(set_attr "prefix_rep" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")
(set_attr "amdfam10_decode" "double")])
+(define_insn "avx_cvttpd2dq256"
+ [(set (match_operand:V4SI 0 "register_operand" "=x")
+ (fix:V4SI (match_operand:V4DF 1 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX"
+ "vcvttpd2dq{y}\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "OI")])
+
(define_expand "sse2_cvttpd2dq"
[(set (match_operand:V4SI 0 "register_operand" "")
(vec_concat:V4SI
@@ -1766,12 +2643,28 @@
(fix:V2SI (match_operand:V2DF 1 "nonimmediate_operand" "xm"))
(match_operand:V2SI 2 "const0_operand" "")))]
"TARGET_SSE2"
- "cvttpd2dq\t{%1, %0|%0, %1}"
+ "* return TARGET_AVX ? \"vcvttpd2dq{x}\t{%1, %0|%0, %1}\"
+ : \"cvttpd2dq\t{%1, %0|%0, %1}\";"
[(set_attr "type" "ssecvt")
(set_attr "prefix_rep" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")
(set_attr "amdfam10_decode" "double")])
+(define_insn "*avx_cvtsd2ss"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (vec_merge:V4SF
+ (vec_duplicate:V4SF
+ (float_truncate:V2SF
+ (match_operand:V2DF 2 "nonimmediate_operand" "xm")))
+ (match_operand:V4SF 1 "register_operand" "x")
+ (const_int 1)))]
+ "TARGET_AVX"
+ "vcvtsd2ss\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "SF")])
+
(define_insn "sse2_cvtsd2ss"
[(set (match_operand:V4SF 0 "register_operand" "=x,x")
(vec_merge:V4SF
@@ -1787,6 +2680,21 @@
(set_attr "amdfam10_decode" "vector,double")
(set_attr "mode" "SF")])
+(define_insn "*avx_cvtss2sd"
+ [(set (match_operand:V2DF 0 "register_operand" "=x")
+ (vec_merge:V2DF
+ (float_extend:V2DF
+ (vec_select:V2SF
+ (match_operand:V4SF 2 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0) (const_int 1)])))
+ (match_operand:V2DF 1 "register_operand" "x")
+ (const_int 1)))]
+ "TARGET_AVX"
+ "vcvtss2sd\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "DF")])
+
(define_insn "sse2_cvtss2sd"
[(set (match_operand:V2DF 0 "register_operand" "=x,x")
(vec_merge:V2DF
@@ -1802,6 +2710,16 @@
(set_attr "amdfam10_decode" "vector,double")
(set_attr "mode" "DF")])
+(define_insn "avx_cvtpd2ps256"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (float_truncate:V4SF
+ (match_operand:V4DF 1 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX"
+ "vcvtpd2ps{y}\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4SF")])
+
(define_expand "sse2_cvtpd2ps"
[(set (match_operand:V4SF 0 "register_operand" "")
(vec_concat:V4SF
@@ -1818,12 +2736,24 @@
(match_operand:V2DF 1 "nonimmediate_operand" "xm"))
(match_operand:V2SF 2 "const0_operand" "")))]
"TARGET_SSE2"
- "cvtpd2ps\t{%1, %0|%0, %1}"
+ "* return TARGET_AVX ? \"vcvtpd2ps{x}\t{%1, %0|%0, %1}\"
+ : \"cvtpd2ps\t{%1, %0|%0, %1}\";"
[(set_attr "type" "ssecvt")
(set_attr "prefix_data16" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "V4SF")
(set_attr "amdfam10_decode" "double")])
+(define_insn "avx_cvtps2pd256"
+ [(set (match_operand:V4DF 0 "register_operand" "=x")
+ (float_extend:V4DF
+ (match_operand:V4SF 1 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX"
+ "vcvtps2pd\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4DF")])
+
(define_insn "sse2_cvtps2pd"
[(set (match_operand:V2DF 0 "register_operand" "=x")
(float_extend:V2DF
@@ -1831,8 +2761,9 @@
(match_operand:V4SF 1 "nonimmediate_operand" "xm")
(parallel [(const_int 0) (const_int 1)]))))]
"TARGET_SSE2"
- "cvtps2pd\t{%1, %0|%0, %1}"
+ "%vcvtps2pd\t{%1, %0|%0, %1}"
[(set_attr "type" "ssecvt")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "V2DF")
(set_attr "amdfam10_decode" "direct")])
@@ -2012,6 +2943,25 @@
"TARGET_SSE"
"ix86_fixup_binary_operands (UNKNOWN, V4SFmode, operands);")
+(define_insn "*avx_movhlps"
+ [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,m")
+ (vec_select:V4SF
+ (vec_concat:V8SF
+ (match_operand:V4SF 1 "nonimmediate_operand" " x,x,0")
+ (match_operand:V4SF 2 "nonimmediate_operand" " x,o,x"))
+ (parallel [(const_int 6)
+ (const_int 7)
+ (const_int 2)
+ (const_int 3)])))]
+ "TARGET_AVX && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
+ "@
+ vmovhlps\t{%2, %1, %0|%0, %1, %2}
+ vmovlps\t{%H2, %1, %0|%0, %1, %H2}
+ vmovhps\t{%2, %0|%0, %2}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4SF,V2SF,V2SF")])
+
(define_insn "sse_movhlps"
[(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,m")
(vec_select:V4SF
@@ -2043,6 +2993,25 @@
"TARGET_SSE"
"ix86_fixup_binary_operands (UNKNOWN, V4SFmode, operands);")
+(define_insn "*avx_movlhps"
+ [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,o")
+ (vec_select:V4SF
+ (vec_concat:V8SF
+ (match_operand:V4SF 1 "nonimmediate_operand" " x,x,0")
+ (match_operand:V4SF 2 "nonimmediate_operand" " x,m,x"))
+ (parallel [(const_int 0)
+ (const_int 1)
+ (const_int 4)
+ (const_int 5)])))]
+ "TARGET_AVX && ix86_binary_operator_ok (UNKNOWN, V4SFmode, operands)"
+ "@
+ vmovlhps\t{%2, %1, %0|%0, %1, %2}
+ vmovhps\t{%2, %1, %0|%0, %1, %2}
+ vmovlps\t{%2, %H0|%H0, %2}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4SF,V2SF,V2SF")])
+
(define_insn "sse_movlhps"
[(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,o")
(vec_select:V4SF
@@ -2061,6 +3030,36 @@
[(set_attr "type" "ssemov")
(set_attr "mode" "V4SF,V2SF,V2SF")])
+(define_insn "avx_unpckhps256"
+ [(set (match_operand:V8SF 0 "register_operand" "=x")
+ (vec_select:V8SF
+ (vec_concat:V16SF
+ (match_operand:V8SF 1 "register_operand" "x")
+ (match_operand:V8SF 2 "nonimmediate_operand" "xm"))
+ (parallel [(const_int 2) (const_int 6)
+ (const_int 3) (const_int 7)
+ (const_int 10) (const_int 14)
+ (const_int 11) (const_int 15)])))]
+ "TARGET_AVX"
+ "vunpckhps\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "*avx_unpckhps"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (vec_select:V4SF
+ (vec_concat:V8SF
+ (match_operand:V4SF 1 "register_operand" "x")
+ (match_operand:V4SF 2 "nonimmediate_operand" "xm"))
+ (parallel [(const_int 2) (const_int 6)
+ (const_int 3) (const_int 7)])))]
+ "TARGET_AVX"
+ "vunpckhps\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4SF")])
+
(define_insn "sse_unpckhps"
[(set (match_operand:V4SF 0 "register_operand" "=x")
(vec_select:V4SF
@@ -2074,6 +3073,36 @@
[(set_attr "type" "sselog")
(set_attr "mode" "V4SF")])
+(define_insn "avx_unpcklps256"
+ [(set (match_operand:V8SF 0 "register_operand" "=x")
+ (vec_select:V8SF
+ (vec_concat:V16SF
+ (match_operand:V8SF 1 "register_operand" "x")
+ (match_operand:V8SF 2 "nonimmediate_operand" "xm"))
+ (parallel [(const_int 0) (const_int 4)
+ (const_int 1) (const_int 5)
+ (const_int 8) (const_int 12)
+ (const_int 9) (const_int 13)])))]
+ "TARGET_AVX"
+ "vunpcklps\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "*avx_unpcklps"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (vec_select:V4SF
+ (vec_concat:V8SF
+ (match_operand:V4SF 1 "register_operand" "x")
+ (match_operand:V4SF 2 "nonimmediate_operand" "xm"))
+ (parallel [(const_int 0) (const_int 4)
+ (const_int 1) (const_int 5)])))]
+ "TARGET_AVX"
+ "vunpcklps\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4SF")])
+
(define_insn "sse_unpcklps"
[(set (match_operand:V4SF 0 "register_operand" "=x")
(vec_select:V4SF
@@ -2089,6 +3118,22 @@
;; These are modeled with the same vec_concat as the others so that we
;; capture users of shufps that can use the new instructions
+(define_insn "avx_movshdup256"
+ [(set (match_operand:V8SF 0 "register_operand" "=x")
+ (vec_select:V8SF
+ (vec_concat:V16SF
+ (match_operand:V8SF 1 "nonimmediate_operand" "xm")
+ (match_dup 1))
+ (parallel [(const_int 1) (const_int 1)
+ (const_int 3) (const_int 3)
+ (const_int 5) (const_int 5)
+ (const_int 7) (const_int 7)])))]
+ "TARGET_AVX"
+ "vmovshdup\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sse")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
(define_insn "sse3_movshdup"
[(set (match_operand:V4SF 0 "register_operand" "=x")
(vec_select:V4SF
@@ -2100,11 +3145,28 @@
(const_int 7)
(const_int 7)])))]
"TARGET_SSE3"
- "movshdup\t{%1, %0|%0, %1}"
+ "%vmovshdup\t{%1, %0|%0, %1}"
[(set_attr "type" "sse")
(set_attr "prefix_rep" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "V4SF")])
+(define_insn "avx_movsldup256"
+ [(set (match_operand:V8SF 0 "register_operand" "=x")
+ (vec_select:V8SF
+ (vec_concat:V16SF
+ (match_operand:V8SF 1 "nonimmediate_operand" "xm")
+ (match_dup 1))
+ (parallel [(const_int 0) (const_int 0)
+ (const_int 2) (const_int 2)
+ (const_int 4) (const_int 4)
+ (const_int 6) (const_int 6)])))]
+ "TARGET_AVX"
+ "vmovsldup\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sse")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
(define_insn "sse3_movsldup"
[(set (match_operand:V4SF 0 "register_operand" "=x")
(vec_select:V4SF
@@ -2116,11 +3178,66 @@
(const_int 6)
(const_int 6)])))]
"TARGET_SSE3"
- "movsldup\t{%1, %0|%0, %1}"
+ "%vmovsldup\t{%1, %0|%0, %1}"
[(set_attr "type" "sse")
(set_attr "prefix_rep" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "V4SF")])
+(define_expand "avx_shufps256"
+ [(match_operand:V8SF 0 "register_operand" "")
+ (match_operand:V8SF 1 "register_operand" "")
+ (match_operand:V8SF 2 "nonimmediate_operand" "")
+ (match_operand:SI 3 "const_int_operand" "")]
+ "TARGET_AVX"
+{
+ int mask = INTVAL (operands[3]);
+ emit_insn (gen_avx_shufps256_1 (operands[0], operands[1], operands[2],
+ GEN_INT ((mask >> 0) & 3),
+ GEN_INT ((mask >> 2) & 3),
+ GEN_INT (((mask >> 4) & 3) + 8),
+ GEN_INT (((mask >> 6) & 3) + 8),
+ GEN_INT (((mask >> 0) & 3) + 4),
+ GEN_INT (((mask >> 2) & 3) + 4),
+ GEN_INT (((mask >> 4) & 3) + 12),
+ GEN_INT (((mask >> 6) & 3) + 12)));
+ DONE;
+})
+
+;; One bit in mask selects 2 elements.
+(define_insn "avx_shufps256_1"
+ [(set (match_operand:V8SF 0 "register_operand" "=x")
+ (vec_select:V8SF
+ (vec_concat:V16SF
+ (match_operand:V8SF 1 "register_operand" "x")
+ (match_operand:V8SF 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_8_to_11_operand" "")
+ (match_operand 6 "const_8_to_11_operand" "")
+ (match_operand 7 "const_4_to_7_operand" "")
+ (match_operand 8 "const_4_to_7_operand" "")
+ (match_operand 9 "const_12_to_15_operand" "")
+ (match_operand 10 "const_12_to_15_operand" "")])))]
+ "TARGET_AVX
+ && (INTVAL (operands[3]) == (INTVAL (operands[7]) - 4)
+ && INTVAL (operands[4]) == (INTVAL (operands[8]) - 4)
+ && INTVAL (operands[5]) == (INTVAL (operands[9]) - 4)
+ && INTVAL (operands[6]) == (INTVAL (operands[10]) - 4))"
+{
+ int mask;
+ mask = INTVAL (operands[3]);
+ mask |= INTVAL (operands[4]) << 2;
+ mask |= (INTVAL (operands[5]) - 8) << 4;
+ mask |= (INTVAL (operands[6]) - 8) << 6;
+ operands[3] = GEN_INT (mask);
+
+ return "vshufps\t{%3, %2, %1, %0|%0, %1, %2, %3}";
+}
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
(define_expand "sse_shufps"
[(match_operand:V4SF 0 "register_operand" "")
(match_operand:V4SF 1 "register_operand" "")
@@ -2129,7 +3246,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 +3254,37 @@
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 "*avx_shufps_<mode>"
+ [(set (match_operand:SSEMODE4S 0 "register_operand" "=x")
+ (vec_select:SSEMODE4S
+ (vec_concat:<ssedoublesizemode>
+ (match_operand:SSEMODE4S 1 "register_operand" "x")
+ (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" "")
+ (match_operand 6 "const_4_to_7_operand" "")])))]
+ "TARGET_AVX"
+{
+ int mask = 0;
+ mask |= INTVAL (operands[3]) << 0;
+ mask |= INTVAL (operands[4]) << 2;
+ mask |= (INTVAL (operands[5]) - 4) << 4;
+ mask |= (INTVAL (operands[6]) - 4) << 6;
+ operands[3] = GEN_INT (mask);
+
+ return "vshufps\t{%3, %2, %1, %0|%0, %1, %2, %3}";
+}
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4SF")])
+
+(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" "")
@@ -2168,10 +3310,11 @@
(parallel [(const_int 2) (const_int 3)])))]
"TARGET_SSE"
"@
- movhps\t{%1, %0|%0, %1}
- movhlps\t{%1, %0|%0, %1}
- movlps\t{%H1, %0|%0, %H1}"
+ %vmovhps\t{%1, %0|%0, %1}
+ %vmovhlps\t{%1, %d0|%d0, %1}
+ %vmovlps\t{%H1, %d0|%d0, %H1}"
[(set_attr "type" "ssemov")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "V2SF,V4SF,V2SF")])
(define_expand "sse_loadhps_exp"
@@ -2184,6 +3327,22 @@
"TARGET_SSE"
"ix86_fixup_binary_operands (UNKNOWN, V4SFmode, operands);")
+(define_insn "*avx_loadhps"
+ [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,o")
+ (vec_concat:V4SF
+ (vec_select:V2SF
+ (match_operand:V4SF 1 "nonimmediate_operand" "x,x,0")
+ (parallel [(const_int 0) (const_int 1)]))
+ (match_operand:V2SF 2 "nonimmediate_operand" "m,x,x")))]
+ "TARGET_AVX"
+ "@
+ vmovhps\t{%2, %1, %0|%0, %1, %2}
+ vmovlhps\t{%2, %1, %0|%0, %1, %2}
+ vmovlps\t{%2, %H0|%H0, %2}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V2SF,V4SF,V2SF")])
+
(define_insn "sse_loadhps"
[(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,o")
(vec_concat:V4SF
@@ -2199,6 +3358,20 @@
[(set_attr "type" "ssemov")
(set_attr "mode" "V2SF,V4SF,V2SF")])
+(define_insn "*avx_storelps"
+ [(set (match_operand:V2SF 0 "nonimmediate_operand" "=m,x,x")
+ (vec_select:V2SF
+ (match_operand:V4SF 1 "nonimmediate_operand" "x,x,m")
+ (parallel [(const_int 0) (const_int 1)])))]
+ "TARGET_AVX"
+ "@
+ vmovlps\t{%1, %0|%0, %1}
+ vmovaps\t{%1, %0|%0, %1}
+ vmovlps\t{%1, %0, %0|%0, %0, %1}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V2SF,V2DF,V2SF")])
+
(define_insn "sse_storelps"
[(set (match_operand:V2SF 0 "nonimmediate_operand" "=m,x,x")
(vec_select:V2SF
@@ -2222,6 +3395,22 @@
"TARGET_SSE"
"ix86_fixup_binary_operands (UNKNOWN, V4SFmode, operands);")
+(define_insn "*avx_loadlps"
+ [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,m")
+ (vec_concat:V4SF
+ (match_operand:V2SF 2 "nonimmediate_operand" "x,m,x")
+ (vec_select:V2SF
+ (match_operand:V4SF 1 "nonimmediate_operand" "x,x,0")
+ (parallel [(const_int 2) (const_int 3)]))))]
+ "TARGET_AVX"
+ "@
+ shufps\t{$0xe4, %1, %2, %0|%0, %2, %1, 0xe4}
+ vmovlps\t{%2, %1, %0|%0, %1, %2}
+ vmovlps\t{%2, %0|%0, %2}"
+ [(set_attr "type" "sselog,ssemov,ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4SF,V2SF,V2SF")])
+
(define_insn "sse_loadlps"
[(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,m")
(vec_concat:V4SF
@@ -2237,6 +3426,18 @@
[(set_attr "type" "sselog,ssemov,ssemov")
(set_attr "mode" "V4SF,V2SF,V2SF")])
+(define_insn "*avx_movss"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (vec_merge:V4SF
+ (match_operand:V4SF 2 "register_operand" "x")
+ (match_operand:V4SF 1 "register_operand" "x")
+ (const_int 1)))]
+ "TARGET_AVX"
+ "vmovss\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "SF")])
+
(define_insn "sse_movss"
[(set (match_operand:V4SF 0 "register_operand" "=x")
(vec_merge:V4SF
@@ -2248,6 +3449,16 @@
[(set_attr "type" "ssemov")
(set_attr "mode" "SF")])
+(define_insn "*vec_dupv4sf_avx"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (vec_duplicate:V4SF
+ (match_operand:SF 1 "register_operand" "x")))]
+ "TARGET_AVX"
+ "vshufps\t{$0, %1, %1, %0|%0, %1, %1, 0}"
+ [(set_attr "type" "sselog1")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4SF")])
+
(define_insn "*vec_dupv4sf"
[(set (match_operand:V4SF 0 "register_operand" "=x")
(vec_duplicate:V4SF
@@ -2257,6 +3468,25 @@
[(set_attr "type" "sselog1")
(set_attr "mode" "V4SF")])
+(define_insn "*vec_concatv2sf_avx"
+ [(set (match_operand:V2SF 0 "register_operand" "=x,x,x,*y ,*y")
+ (vec_concat:V2SF
+ (match_operand:SF 1 "nonimmediate_operand" " x,x,m, x , m")
+ (match_operand:SF 2 "vector_move_operand" " x,m,C,*ym, C")))]
+ "TARGET_AVX"
+ "@
+ vunpcklps\t{%2, %1, %0|%0, %1, %2}
+ vinsertps\t{$0x10, %2, %1, %0|%0, %1, %2, 0x10}
+ vmovss\t{%1, %0|%0, %1}
+ punpckldq\t{%2, %0|%0, %2}
+ movd\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sselog,sselog,ssemov,mmxcvt,mmxmov")
+ (set (attr "prefix")
+ (if_then_else (eq_attr "alternative" "3,4")
+ (const_string "orig")
+ (const_string "vex")))
+ (set_attr "mode" "V4SF,V4SF,SF,DI,DI")])
+
;; Although insertps takes register source, we prefer
;; unpcklps with register source since it is shorter.
(define_insn "*vec_concatv2sf_sse4_1"
@@ -2292,6 +3522,19 @@
[(set_attr "type" "sselog,ssemov,mmxcvt,mmxmov")
(set_attr "mode" "V4SF,SF,DI,DI")])
+(define_insn "*vec_concatv4sf_avx"
+ [(set (match_operand:V4SF 0 "register_operand" "=x,x")
+ (vec_concat:V4SF
+ (match_operand:V2SF 1 "register_operand" " x,x")
+ (match_operand:V2SF 2 "nonimmediate_operand" " x,m")))]
+ "TARGET_AVX"
+ "@
+ vmovlhps\t{%2, %1, %0|%0, %1, %2}
+ vmovhps\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4SF,V2SF")])
+
(define_insn "*vec_concatv4sf_sse"
[(set (match_operand:V4SF 0 "register_operand" "=x,x")
(vec_concat:V4SF
@@ -2313,6 +3556,23 @@
DONE;
})
+(define_insn "*vec_setv4sf_0_avx"
+ [(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,x,m")
+ (vec_merge:V4SF
+ (vec_duplicate:V4SF
+ (match_operand:SF 2 "general_operand" " x,m,*r,x*rfF"))
+ (match_operand:V4SF 1 "vector_move_operand" " x,C,C ,0")
+ (const_int 1)))]
+ "TARGET_AVX"
+ "@
+ vmovss\t{%2, %1, %0|%0, %1, %2}
+ vmovss\t{%2, %0|%0, %2}
+ vmovd\t{%2, %0|%0, %2}
+ #"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "SF")])
+
(define_insn "vec_setv4sf_0"
[(set (match_operand:V4SF 0 "nonimmediate_operand" "=x,x,Y2,m")
(vec_merge:V4SF
@@ -2330,6 +3590,22 @@
(set_attr "mode" "SF")])
;; A subset is vec_setv4sf.
+(define_insn "*vec_setv4sf_avx"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (vec_merge:V4SF
+ (vec_duplicate:V4SF
+ (match_operand:SF 2 "nonimmediate_operand" "xm"))
+ (match_operand:V4SF 1 "register_operand" "x")
+ (match_operand:SI 3 "const_pow2_1_to_8_operand" "n")))]
+ "TARGET_AVX"
+{
+ operands[3] = GEN_INT (exact_log2 (INTVAL (operands[3])) << 4);
+ return "vinsertps\t{%3, %2, %1, %0|%0, %1, %2, %3}";
+}
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4SF")])
+
(define_insn "*vec_setv4sf_sse4_1"
[(set (match_operand:V4SF 0 "register_operand" "=x")
(vec_merge:V4SF
@@ -2346,6 +3622,18 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "V4SF")])
+(define_insn "*avx_insertps"
+ [(set (match_operand:V4SF 0 "register_operand" "=x")
+ (unspec:V4SF [(match_operand:V4SF 2 "nonimmediate_operand" "xm")
+ (match_operand:V4SF 1 "register_operand" "x")
+ (match_operand:SI 3 "const_0_to_255_operand" "n")]
+ UNSPEC_INSERTPS))]
+ "TARGET_AVX"
+ "vinsertps\t{%3, %2, %1, %0|%0, %1, %2, %3}";
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4SF")])
+
(define_insn "sse4_1_insertps"
[(set (match_operand:V4SF 0 "register_operand" "=x")
(unspec:V4SF [(match_operand:V4SF 2 "register_operand" "x")
@@ -2384,9 +3672,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]))"
"#"
@@ -2402,15 +3690,154 @@
DONE;
})
+(define_expand "avx_vextractf128<mode>"
+ [(match_operand:<avxhalfvecmode> 0 "nonimmediate_operand" "")
+ (match_operand:AVX256MODE 1 "register_operand" "")
+ (match_operand:SI 2 "const_0_to_1_operand" "")]
+ "TARGET_AVX"
+{
+ switch (INTVAL (operands[2]))
+ {
+ case 0:
+ emit_insn (gen_vec_extract_lo_<mode> (operands[0], operands[1]));
+ break;
+ case 1:
+ emit_insn (gen_vec_extract_hi_<mode> (operands[0], operands[1]));
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ DONE;
+})
+
+(define_insn "vec_extract_lo_<mode>"
+ [(set (match_operand:<avxhalfvecmode> 0 "nonimmediate_operand" "=x,m")
+ (vec_select:<avxhalfvecmode>
+ (match_operand:AVX256MODE4P 1 "register_operand" "x,x")
+ (parallel [(const_int 0) (const_int 1)])))]
+ "TARGET_AVX"
+ "vextractf128\t{$0x0, %1, %0|%0, %1, 0x0}"
+ [(set_attr "type" "sselog")
+ (set_attr "memory" "none,store")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "vec_extract_hi_<mode>"
+ [(set (match_operand:<avxhalfvecmode> 0 "nonimmediate_operand" "=x,m")
+ (vec_select:<avxhalfvecmode>
+ (match_operand:AVX256MODE4P 1 "register_operand" "x,x")
+ (parallel [(const_int 2) (const_int 3)])))]
+ "TARGET_AVX"
+ "vextractf128\t{$0x1, %1, %0|%0, %1, 0x1}"
+ [(set_attr "type" "sselog")
+ (set_attr "memory" "none,store")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "vec_extract_lo_<mode>"
+ [(set (match_operand:<avxhalfvecmode> 0 "nonimmediate_operand" "=x,m")
+ (vec_select:<avxhalfvecmode>
+ (match_operand:AVX256MODE8P 1 "register_operand" "x,x")
+ (parallel [(const_int 0) (const_int 1)
+ (const_int 2) (const_int 3)])))]
+ "TARGET_AVX"
+ "vextractf128\t{$0x1, %1, %0|%0, %1, 0x1}"
+ [(set_attr "type" "sselog")
+ (set_attr "memory" "none,store")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "vec_extract_hi_<mode>"
+ [(set (match_operand:<avxhalfvecmode> 0 "nonimmediate_operand" "=x,m")
+ (vec_select:<avxhalfvecmode>
+ (match_operand:AVX256MODE8P 1 "register_operand" "x,x")
+ (parallel [(const_int 4) (const_int 5)
+ (const_int 6) (const_int 7)])))]
+ "TARGET_AVX"
+ "vextractf128\t{$0x1, %1, %0|%0, %1, 0x1}"
+ [(set_attr "type" "sselog")
+ (set_attr "memory" "none,store")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "vec_extract_lo_v16hi"
+ [(set (match_operand:V8HI 0 "nonimmediate_operand" "=x,m")
+ (vec_select:V8HI
+ (match_operand:V16HI 1 "register_operand" "x,x")
+ (parallel [(const_int 0) (const_int 1)
+ (const_int 2) (const_int 3)
+ (const_int 4) (const_int 5)
+ (const_int 6) (const_int 7)])))]
+ "TARGET_AVX"
+ "vextractf128\t{$0x1, %1, %0|%0, %1, 0x1}"
+ [(set_attr "type" "sselog")
+ (set_attr "memory" "none,store")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "vec_extract_hi_v16hi"
+ [(set (match_operand:V8HI 0 "nonimmediate_operand" "=x,m")
+ (vec_select:V8HI
+ (match_operand:V16HI 1 "register_operand" "x,x")
+ (parallel [(const_int 8) (const_int 9)
+ (const_int 10) (const_int 11)
+ (const_int 12) (const_int 13)
+ (const_int 14) (const_int 15)])))]
+ "TARGET_AVX"
+ "vextractf128\t{$0x1, %1, %0|%0, %1, 0x1}"
+ [(set_attr "type" "sselog")
+ (set_attr "memory" "none,store")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "vec_extract_lo_v32qi"
+ [(set (match_operand:V16QI 0 "nonimmediate_operand" "=x,m")
+ (vec_select:V16QI
+ (match_operand:V32QI 1 "register_operand" "x,x")
+ (parallel [(const_int 0) (const_int 1)
+ (const_int 2) (const_int 3)
+ (const_int 4) (const_int 5)
+ (const_int 6) (const_int 7)
+ (const_int 8) (const_int 9)
+ (const_int 10) (const_int 11)
+ (const_int 12) (const_int 13)
+ (const_int 14) (const_int 15)])))]
+ "TARGET_AVX"
+ "vextractf128\t{$0x1, %1, %0|%0, %1, 0x1}"
+ [(set_attr "type" "sselog")
+ (set_attr "memory" "none,store")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "vec_extract_hi_v32qi"
+ [(set (match_operand:V16QI 0 "nonimmediate_operand" "=x,m")
+ (vec_select:V16QI
+ (match_operand:V32QI 1 "register_operand" "x,x")
+ (parallel [(const_int 16) (const_int 17)
+ (const_int 18) (const_int 19)
+ (const_int 20) (const_int 21)
+ (const_int 22) (const_int 23)
+ (const_int 24) (const_int 25)
+ (const_int 26) (const_int 27)
+ (const_int 28) (const_int 29)
+ (const_int 30) (const_int 31)])))]
+ "TARGET_AVX"
+ "vextractf128\t{$0x1, %1, %0|%0, %1, 0x1}"
+ [(set_attr "type" "sselog")
+ (set_attr "memory" "none,store")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
(define_insn "*sse4_1_extractps"
[(set (match_operand:SF 0 "nonimmediate_operand" "=rm")
(vec_select:SF
(match_operand:V4SF 1 "register_operand" "x")
(parallel [(match_operand:SI 2 "const_0_to_3_operand" "n")])))]
"TARGET_SSE4_1"
- "extractps\t{%2, %1, %0|%0, %1, %2}"
+ "%vextractps\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "V4SF")])
(define_insn_and_split "*vec_extract_v4sf_mem"
@@ -2446,6 +3873,20 @@
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(define_insn "avx_unpckhpd256"
+ [(set (match_operand:V4DF 0 "register_operand" "=x")
+ (vec_select:V4DF
+ (vec_concat:V8DF
+ (match_operand:V4DF 1 "register_operand" "x")
+ (match_operand:V4DF 2 "nonimmediate_operand" "xm"))
+ (parallel [(const_int 2) (const_int 6)
+ (const_int 3) (const_int 7)])))]
+ "TARGET_AVX"
+ "vunpckhpd\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4DF")])
+
(define_expand "sse2_unpckhpd_exp"
[(set (match_operand:V2DF 0 "nonimmediate_operand" "")
(vec_select:V2DF
@@ -2457,6 +3898,23 @@
"TARGET_SSE2"
"ix86_fixup_binary_operands (UNKNOWN, V2DFmode, operands);")
+(define_insn "*avx_unpckhpd"
+ [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,m")
+ (vec_select:V2DF
+ (vec_concat:V4DF
+ (match_operand:V2DF 1 "nonimmediate_operand" " x,o,x")
+ (match_operand:V2DF 2 "nonimmediate_operand" " x,x,0"))
+ (parallel [(const_int 1)
+ (const_int 3)])))]
+ "TARGET_AVX && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
+ "@
+ vunpckhpd\t{%2, %1, %0|%0, %1, %2}
+ vmovlpd\t{%H1, %2, %0|%0, %2, %H1}
+ vmovhpd\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sselog,ssemov,ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V2DF,V1DF,V1DF")])
+
(define_insn "sse2_unpckhpd"
[(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,m")
(vec_select:V2DF
@@ -2473,6 +3931,36 @@
[(set_attr "type" "sselog,ssemov,ssemov")
(set_attr "mode" "V2DF,V1DF,V1DF")])
+(define_insn "avx_movddup256"
+ [(set (match_operand:V4DF 0 "register_operand" "=x")
+ (vec_select:V4DF
+ (vec_concat:V8DF
+ (match_operand:V4DF 1 "nonimmediate_operand" "xm")
+ (match_dup 1))
+ (parallel [(const_int 0) (const_int 2)
+ (const_int 4) (const_int 6)])))]
+ "TARGET_AVX"
+ "vmovddup\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sselog1")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4DF")])
+
+(define_insn "*avx_movddup"
+ [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,o")
+ (vec_select:V2DF
+ (vec_concat:V4DF
+ (match_operand:V2DF 1 "nonimmediate_operand" "xm,x")
+ (match_dup 1))
+ (parallel [(const_int 0)
+ (const_int 2)])))]
+ "TARGET_AVX && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
+ "@
+ vmovddup\t{%1, %0|%0, %1}
+ #"
+ [(set_attr "type" "sselog1,ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V2DF")])
+
(define_insn "*sse3_movddup"
[(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,o")
(vec_select:V2DF
@@ -2505,6 +3993,20 @@
DONE;
})
+(define_insn "avx_unpcklpd256"
+ [(set (match_operand:V4DF 0 "register_operand" "=x")
+ (vec_select:V4DF
+ (vec_concat:V8DF
+ (match_operand:V4DF 1 "register_operand" "x")
+ (match_operand:V4DF 2 "nonimmediate_operand" "xm"))
+ (parallel [(const_int 0) (const_int 4)
+ (const_int 1) (const_int 5)])))]
+ "TARGET_AVX"
+ "vunpcklpd\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4DF")])
+
(define_expand "sse2_unpcklpd_exp"
[(set (match_operand:V2DF 0 "nonimmediate_operand" "")
(vec_select:V2DF
@@ -2516,6 +4018,23 @@
"TARGET_SSE2"
"ix86_fixup_binary_operands (UNKNOWN, V2DFmode, operands);")
+(define_insn "*avx_unpcklpd"
+ [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,o")
+ (vec_select:V2DF
+ (vec_concat:V4DF
+ (match_operand:V2DF 1 "nonimmediate_operand" " x,x,0")
+ (match_operand:V2DF 2 "nonimmediate_operand" " x,m,x"))
+ (parallel [(const_int 0)
+ (const_int 2)])))]
+ "TARGET_AVX && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
+ "@
+ vunpcklpd\t{%2, %1, %0|%0, %1, %2}
+ vmovhpd\t{%2, %1, %0|%0, %1, %2}
+ vmovlpd\t{%2, %H0|%H0, %2}"
+ [(set_attr "type" "sselog,ssemov,ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V2DF,V1DF,V1DF")])
+
(define_insn "sse2_unpcklpd"
[(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,o")
(vec_select:V2DF
@@ -2532,6 +4051,47 @@
[(set_attr "type" "sselog,ssemov,ssemov")
(set_attr "mode" "V2DF,V1DF,V1DF")])
+(define_expand "avx_shufpd256"
+ [(match_operand:V4DF 0 "register_operand" "")
+ (match_operand:V4DF 1 "register_operand" "")
+ (match_operand:V4DF 2 "nonimmediate_operand" "")
+ (match_operand:SI 3 "const_int_operand" "")]
+ "TARGET_AVX"
+{
+ int mask = INTVAL (operands[3]);
+ emit_insn (gen_avx_shufpd256_1 (operands[0], operands[1], operands[2],
+ GEN_INT (mask & 1),
+ GEN_INT (mask & 2 ? 5 : 4),
+ GEN_INT (mask & 4 ? 3 : 2),
+ GEN_INT (mask & 8 ? 7 : 6)));
+ DONE;
+})
+
+(define_insn "avx_shufpd256_1"
+ [(set (match_operand:V4DF 0 "register_operand" "=x")
+ (vec_select:V4DF
+ (vec_concat:V8DF
+ (match_operand:V4DF 1 "register_operand" "x")
+ (match_operand:V4DF 2 "nonimmediate_operand" "xm"))
+ (parallel [(match_operand 3 "const_0_to_1_operand" "")
+ (match_operand 4 "const_4_to_5_operand" "")
+ (match_operand 5 "const_2_to_3_operand" "")
+ (match_operand 6 "const_6_to_7_operand" "")])))]
+ "TARGET_AVX"
+{
+ int mask;
+ mask = INTVAL (operands[3]);
+ mask |= (INTVAL (operands[4]) - 4) << 1;
+ mask |= (INTVAL (operands[5]) - 2) << 2;
+ mask |= (INTVAL (operands[6]) - 6) << 3;
+ operands[3] = GEN_INT (mask);
+
+ return "vshufpd\t{%3, %2, %1, %0|%0, %1, %2, %3}";
+}
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4DF")])
+
(define_expand "sse2_shufpd"
[(match_operand:V2DF 0 "register_operand" "")
(match_operand:V2DF 1 "register_operand" "")
@@ -2540,18 +4100,140 @@
"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 "*avx_punpckhqdq"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (vec_select:V2DI
+ (vec_concat:V4DI
+ (match_operand:V2DI 1 "register_operand" "x")
+ (match_operand:V2DI 2 "nonimmediate_operand" "xm"))
+ (parallel [(const_int 1)
+ (const_int 3)])))]
+ "TARGET_AVX"
+ "vpunpckhqdq\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (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 "*avx_punpcklqdq"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (vec_select:V2DI
+ (vec_concat:V4DI
+ (match_operand:V2DI 1 "register_operand" "x")
+ (match_operand:V2DI 2 "nonimmediate_operand" "xm"))
+ (parallel [(const_int 0)
+ (const_int 2)])))]
+ "TARGET_AVX"
+ "vpunpcklqdq\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (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 "*avx_shufpd_<mode>"
+ [(set (match_operand:SSEMODE2D 0 "register_operand" "=x")
+ (vec_select:SSEMODE2D
+ (vec_concat:<ssedoublesizemode>
+ (match_operand:SSEMODE2D 1 "register_operand" "x")
+ (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_AVX"
+{
+ int mask;
+ mask = INTVAL (operands[3]);
+ mask |= (INTVAL (operands[4]) - 2) << 1;
+ operands[3] = GEN_INT (mask);
+
+ return "vshufpd\t{%3, %2, %1, %0|%0, %1, %2, %3}";
+}
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V2DF")])
+
+(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 +4248,38 @@
[(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 "*avx_storehpd"
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=m,x,x,*f,r")
+ (vec_select:DF
+ (match_operand:V2DF 1 "nonimmediate_operand" " x,x,o,o,o")
+ (parallel [(const_int 1)])))]
+ "TARGET_AVX && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
+ "@
+ vmovhpd\t{%1, %0|%0, %1}
+ vunpckhpd\t{%1, %1, %0|%0, %1, %1}
+ #
+ #
+ #"
+ [(set_attr "type" "ssemov,sselog1,ssemov,fmov,imov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V1DF,V2DF,DF,DF,DF")])
+
(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 +4292,23 @@
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}
+ %vmovlpd\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 "prefix" "maybe_vex")
+ (set_attr "mode" "V1DF,DF,DF,DF,DF")])
(define_split
[(set (match_operand:DF 0 "register_operand" "")
@@ -2630,21 +4337,43 @@
"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 "*avx_loadhpd"
+ [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,o,o,o")
+ (vec_concat:V2DF
+ (vec_select:DF
+ (match_operand:V2DF 1 "nonimmediate_operand" " x,x,0,0,0")
+ (parallel [(const_int 0)]))
+ (match_operand:DF 2 "nonimmediate_operand" " m,x,x,*f,r")))]
+ "TARGET_AVX && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
+ "@
+ vmovhpd\t{%2, %1, %0|%0, %1, %2}
+ vunpcklpd\t{%2, %1, %0|%0, %1, %2}
+ #
+ #
+ #"
+ [(set_attr "type" "ssemov,sselog,ssemov,fmov,imov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V1DF,V2DF,DF,DF,DF")])
+
(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 +4396,34 @@
"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 "*avx_loadlpd"
+ [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,x,x,m,m,m")
+ (vec_concat:V2DF
+ (match_operand:DF 2 "nonimmediate_operand" " m,m,x,x,x,*f,r")
+ (vec_select:DF
+ (match_operand:V2DF 1 "vector_move_operand" " C,x,x,o,0,0,0")
+ (parallel [(const_int 1)]))))]
+ "TARGET_AVX && !(MEM_P (operands[1]) && MEM_P (operands[2]))"
+ "@
+ vmovsd\t{%2, %0|%0, %2}
+ vmovlpd\t{%2, %1, %0|%0, %1, %2}
+ vmovsd\t{%2, %1, %0|%0, %1, %2}
+ vmovhpd\t{%H1, %2, %0|%0, %2, %H1}
+ #
+ #
+ #"
+ [(set_attr "type" "ssemov,ssemov,ssemov,ssemov,ssemov,fmov,imov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "DF,V1DF,V1DF,V1DF,DF,DF,DF")])
+
(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 +4432,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" "")
@@ -2726,6 +4479,23 @@
[(set_attr "type" "ssemov")
(set_attr "mode" "V2SF,V4SF,V2SF")])
+(define_insn "*avx_movsd"
+ [(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,m,x,o")
+ (vec_merge:V2DF
+ (match_operand:V2DF 2 "nonimmediate_operand" " x,m,x,x,0")
+ (match_operand:V2DF 1 "nonimmediate_operand" " x,x,0,o,x")
+ (const_int 1)))]
+ "TARGET_AVX"
+ "@
+ vmovsd\t{%2, %1, %0|%0, %1, %2}
+ vmovlpd\t{%2, %1, %0|%0, %1, %2}
+ vmovlpd\t{%2, %0|%0, %2}
+ vmovhps\t{%H1, %2, %0|%0, %2, %H1}
+ vmovhps\t{%1, %H0|%H0, %1}"
+ [(set_attr "type" "ssemov,ssemov,ssemov,ssemov,ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "DF,V1DF,V1DF,V1DF,V1DF")])
+
(define_insn "sse2_movsd"
[(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,m,x,x,o")
(vec_merge:V2DF
@@ -2748,8 +4518,9 @@
(vec_duplicate:V2DF
(match_operand:DF 1 "nonimmediate_operand" "xm")))]
"TARGET_SSE3"
- "movddup\t{%1, %0|%0, %1}"
+ "%vmovddup\t{%1, %0|%0, %1}"
[(set_attr "type" "sselog1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "DF")])
(define_insn "vec_dupv2df"
@@ -2767,10 +4538,25 @@
(match_operand:DF 1 "nonimmediate_operand" "xm")
(match_dup 1)))]
"TARGET_SSE3"
- "movddup\t{%1, %0|%0, %1}"
+ "%vmovddup\t{%1, %0|%0, %1}"
[(set_attr "type" "sselog1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "DF")])
+(define_insn "*vec_concatv2df_avx"
+ [(set (match_operand:V2DF 0 "register_operand" "=x,x,x")
+ (vec_concat:V2DF
+ (match_operand:DF 1 "nonimmediate_operand" " x,x,m")
+ (match_operand:DF 2 "vector_move_operand" " x,m,C")))]
+ "TARGET_AVX"
+ "@
+ vunpcklpd\t{%2, %1, %0|%0, %1, %2}
+ vmovhpd\t{%2, %1, %0|%0, %1, %2}
+ vmovsd\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "DF,V1DF,DF")])
+
(define_insn "*vec_concatv2df"
[(set (match_operand:V2DF 0 "register_operand" "=Y2,Y2,Y2,x,x")
(vec_concat:V2DF
@@ -2808,6 +4594,17 @@
"TARGET_SSE2"
"ix86_fixup_binary_operands_no_copy (<CODE>, <MODE>mode, operands);")
+(define_insn "*avx_<plusminus_insn><mode>3"
+ [(set (match_operand:SSEMODEI 0 "register_operand" "=x")
+ (plusminus:SSEMODEI
+ (match_operand:SSEMODEI 1 "nonimmediate_operand" "<comm>x")
+ (match_operand:SSEMODEI 2 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX && ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
+ "vp<plusminus_mnemonic><ssevecsize>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseiadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "*<plusminus_insn><mode>3"
[(set (match_operand:SSEMODEI 0 "register_operand" "=x")
(plusminus:SSEMODEI
@@ -2827,6 +4624,17 @@
"TARGET_SSE2"
"ix86_fixup_binary_operands_no_copy (<CODE>, <MODE>mode, operands);")
+(define_insn "*avx_<plusminus_insn><mode>3"
+ [(set (match_operand:SSEMODE12 0 "register_operand" "=x")
+ (sat_plusminus:SSEMODE12
+ (match_operand:SSEMODE12 1 "nonimmediate_operand" "<comm>x")
+ (match_operand:SSEMODE12 2 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX && ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
+ "vp<plusminus_mnemonic><ssevecsize>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseiadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "*sse2_<plusminus_insn><mode>3"
[(set (match_operand:SSEMODE12 0 "register_operand" "=x")
(sat_plusminus:SSEMODE12
@@ -2924,6 +4732,16 @@
"TARGET_SSE2"
"ix86_fixup_binary_operands_no_copy (MULT, V8HImode, operands);")
+(define_insn "*avx_mulv8hi3"
+ [(set (match_operand:V8HI 0 "register_operand" "=x")
+ (mult:V8HI (match_operand:V8HI 1 "nonimmediate_operand" "%x")
+ (match_operand:V8HI 2 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX && ix86_binary_operator_ok (MULT, V8HImode, operands)"
+ "vpmullw\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseimul")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "*mulv8hi3"
[(set (match_operand:V8HI 0 "register_operand" "=x")
(mult:V8HI (match_operand:V8HI 1 "nonimmediate_operand" "%0")
@@ -2947,6 +4765,22 @@
"TARGET_SSE2"
"ix86_fixup_binary_operands_no_copy (MULT, V8HImode, operands);")
+(define_insn "*avxv8hi3_highpart"
+ [(set (match_operand:V8HI 0 "register_operand" "=x")
+ (truncate:V8HI
+ (lshiftrt:V8SI
+ (mult:V8SI
+ (sign_extend:V8SI
+ (match_operand:V8HI 1 "nonimmediate_operand" "%x"))
+ (sign_extend:V8SI
+ (match_operand:V8HI 2 "nonimmediate_operand" "xm")))
+ (const_int 16))))]
+ "TARGET_AVX && ix86_binary_operator_ok (MULT, V8HImode, operands)"
+ "vpmulhw\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseimul")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "*smulv8hi3_highpart"
[(set (match_operand:V8HI 0 "register_operand" "=x")
(truncate:V8HI
@@ -2976,6 +4810,22 @@
"TARGET_SSE2"
"ix86_fixup_binary_operands_no_copy (MULT, V8HImode, operands);")
+(define_insn "*avx_umulv8hi3_highpart"
+ [(set (match_operand:V8HI 0 "register_operand" "=x")
+ (truncate:V8HI
+ (lshiftrt:V8SI
+ (mult:V8SI
+ (zero_extend:V8SI
+ (match_operand:V8HI 1 "nonimmediate_operand" "%x"))
+ (zero_extend:V8SI
+ (match_operand:V8HI 2 "nonimmediate_operand" "xm")))
+ (const_int 16))))]
+ "TARGET_AVX && ix86_binary_operator_ok (MULT, V8HImode, operands)"
+ "vpmulhuw\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseimul")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "*umulv8hi3_highpart"
[(set (match_operand:V8HI 0 "register_operand" "=x")
(truncate:V8HI
@@ -3006,6 +4856,23 @@
"TARGET_SSE2"
"ix86_fixup_binary_operands_no_copy (MULT, V4SImode, operands);")
+(define_insn "*avx_umulv2siv2di3"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (mult:V2DI
+ (zero_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 1 "nonimmediate_operand" "%x")
+ (parallel [(const_int 0) (const_int 2)])))
+ (zero_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 2 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0) (const_int 2)])))))]
+ "TARGET_AVX && ix86_binary_operator_ok (MULT, V4SImode, operands)"
+ "vpmuludq\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseimul")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "*sse2_umulv2siv2di3"
[(set (match_operand:V2DI 0 "register_operand" "=x")
(mult:V2DI
@@ -3036,7 +4903,24 @@
(parallel [(const_int 0) (const_int 2)])))))]
"TARGET_SSE4_1"
"ix86_fixup_binary_operands_no_copy (MULT, V4SImode, operands);")
-
+
+(define_insn "*avx_mulv2siv2di3"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (mult:V2DI
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 1 "nonimmediate_operand" "%x")
+ (parallel [(const_int 0) (const_int 2)])))
+ (sign_extend:V2DI
+ (vec_select:V2SI
+ (match_operand:V4SI 2 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0) (const_int 2)])))))]
+ "TARGET_AVX && ix86_binary_operator_ok (MULT, V4SImode, operands)"
+ "vpmuldq\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseimul")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "*sse4_1_mulv2siv2di3"
[(set (match_operand:V2DI 0 "register_operand" "=x")
(mult:V2DI
@@ -3088,6 +4972,43 @@
"TARGET_SSE2"
"ix86_fixup_binary_operands_no_copy (MULT, V8HImode, operands);")
+(define_insn "*avx_pmaddwd"
+ [(set (match_operand:V4SI 0 "register_operand" "=x")
+ (plus:V4SI
+ (mult:V4SI
+ (sign_extend:V4SI
+ (vec_select:V4HI
+ (match_operand:V8HI 1 "nonimmediate_operand" "%x")
+ (parallel [(const_int 0)
+ (const_int 2)
+ (const_int 4)
+ (const_int 6)])))
+ (sign_extend:V4SI
+ (vec_select:V4HI
+ (match_operand:V8HI 2 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)
+ (const_int 2)
+ (const_int 4)
+ (const_int 6)]))))
+ (mult:V4SI
+ (sign_extend:V4SI
+ (vec_select:V4HI (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 3)
+ (const_int 5)
+ (const_int 7)])))
+ (sign_extend:V4SI
+ (vec_select:V4HI (match_dup 2)
+ (parallel [(const_int 1)
+ (const_int 3)
+ (const_int 5)
+ (const_int 7)]))))))]
+ "TARGET_AVX && ix86_binary_operator_ok (MULT, V8HImode, operands)"
+ "vpmaddwd\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseiadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "*sse2_pmaddwd"
[(set (match_operand:V4SI 0 "register_operand" "=x")
(plus:V4SI
@@ -3135,6 +5056,16 @@
ix86_fixup_binary_operands_no_copy (MULT, V4SImode, operands);
})
+(define_insn "*avx_mulv4si3"
+ [(set (match_operand:V4SI 0 "register_operand" "=x")
+ (mult:V4SI (match_operand:V4SI 1 "nonimmediate_operand" "%x")
+ (match_operand:V4SI 2 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX && ix86_binary_operator_ok (MULT, V4SImode, operands)"
+ "vpmulld\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseimul")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "*sse4_1_mulv4si3"
[(set (match_operand:V4SI 0 "register_operand" "=x")
(mult:V4SI (match_operand:V4SI 1 "nonimmediate_operand" "%0")
@@ -3518,6 +5449,17 @@
DONE;
})
+(define_insn "*avx_ashr<mode>3"
+ [(set (match_operand:SSEMODE24 0 "register_operand" "=x")
+ (ashiftrt:SSEMODE24
+ (match_operand:SSEMODE24 1 "register_operand" "x")
+ (match_operand:SI 2 "nonmemory_operand" "xN")))]
+ "TARGET_AVX"
+ "vpsra<ssevecsize>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseishft")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "ashr<mode>3"
[(set (match_operand:SSEMODE24 0 "register_operand" "=x")
(ashiftrt:SSEMODE24
@@ -3529,6 +5471,17 @@
(set_attr "prefix_data16" "1")
(set_attr "mode" "TI")])
+(define_insn "*avx_lshr<mode>3"
+ [(set (match_operand:SSEMODE248 0 "register_operand" "=x")
+ (lshiftrt:SSEMODE248
+ (match_operand:SSEMODE248 1 "register_operand" "x")
+ (match_operand:SI 2 "nonmemory_operand" "xN")))]
+ "TARGET_AVX"
+ "vpsrl<ssevecsize>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseishft")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "lshr<mode>3"
[(set (match_operand:SSEMODE248 0 "register_operand" "=x")
(lshiftrt:SSEMODE248
@@ -3540,6 +5493,17 @@
(set_attr "prefix_data16" "1")
(set_attr "mode" "TI")])
+(define_insn "*avx_ashl<mode>3"
+ [(set (match_operand:SSEMODE248 0 "register_operand" "=x")
+ (ashift:SSEMODE248
+ (match_operand:SSEMODE248 1 "register_operand" "x")
+ (match_operand:SI 2 "nonmemory_operand" "xN")))]
+ "TARGET_AVX"
+ "vpsll<ssevecsize>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseishft")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "ashl<mode>3"
[(set (match_operand:SSEMODE248 0 "register_operand" "=x")
(ashift:SSEMODE248
@@ -3571,6 +5535,17 @@
operands[1] = gen_lowpart (TImode, operands[1]);
})
+(define_insn "*avx_<code><mode>3"
+ [(set (match_operand:SSEMODE124 0 "register_operand" "=x")
+ (maxmin:SSEMODE124
+ (match_operand:SSEMODE124 1 "nonimmediate_operand" "%x")
+ (match_operand:SSEMODE124 2 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX && ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
+ "vp<maxminiprefix><ssevecsize>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseiadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_expand "<code>v16qi3"
[(set (match_operand:V16QI 0 "register_operand" "")
(umaxmin:V16QI
@@ -3764,6 +5739,17 @@
"TARGET_SSE2 && !TARGET_SSE5"
"ix86_fixup_binary_operands_no_copy (EQ, <MODE>mode, operands);")
+(define_insn "*avx_eq<mode>3"
+ [(set (match_operand:SSEMODE1248 0 "register_operand" "=x")
+ (eq:SSEMODE1248
+ (match_operand:SSEMODE1248 1 "nonimmediate_operand" "%x")
+ (match_operand:SSEMODE1248 2 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX && ix86_binary_operator_ok (EQ, <MODE>mode, operands)"
+ "vpcmpeq<ssevecsize>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ssecmp")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "*sse2_eq<mode>3"
[(set (match_operand:SSEMODE124 0 "register_operand" "=x")
(eq:SSEMODE124
@@ -3795,6 +5781,17 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "TI")])
+(define_insn "*avx_gt<mode>3"
+ [(set (match_operand:SSEMODE1248 0 "register_operand" "=x")
+ (gt:SSEMODE1248
+ (match_operand:SSEMODE1248 1 "register_operand" "x")
+ (match_operand:SSEMODE1248 2 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX"
+ "vpcmpgt<ssevecsize>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ssecmp")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "sse2_gt<mode>3"
[(set (match_operand:SSEMODE124 0 "register_operand" "=x")
(gt:SSEMODE124
@@ -3869,6 +5866,17 @@
operands[2] = force_reg (<MODE>mode, gen_rtx_CONST_VECTOR (<MODE>mode, v));
})
+(define_insn "*avx_nand<mode>3"
+ [(set (match_operand:AVX256MODEI 0 "register_operand" "=x")
+ (and:AVX256MODEI
+ (not:AVX256MODEI (match_operand:AVX256MODEI 1 "register_operand" "x"))
+ (match_operand:AVX256MODEI 2 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX"
+ "vandnps\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecpsmode>")])
+
(define_insn "*sse_nand<mode>3"
[(set (match_operand:SSEMODEI 0 "register_operand" "=x")
(and:SSEMODEI
@@ -3879,6 +5887,17 @@
[(set_attr "type" "sselog")
(set_attr "mode" "V4SF")])
+(define_insn "*avx_nand<mode>3"
+ [(set (match_operand:SSEMODEI 0 "register_operand" "=x")
+ (and:SSEMODEI
+ (not:SSEMODEI (match_operand:SSEMODEI 1 "register_operand" "x"))
+ (match_operand:SSEMODEI 2 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX"
+ "vpandn\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "sse2_nand<mode>3"
[(set (match_operand:SSEMODEI 0 "register_operand" "=x")
(and:SSEMODEI
@@ -3909,6 +5928,18 @@
"TARGET_SSE"
"ix86_fixup_binary_operands_no_copy (<CODE>, <MODE>mode, operands);")
+(define_insn "*avx_<code><mode>3"
+ [(set (match_operand:AVX256MODEI 0 "register_operand" "=x")
+ (plogic:AVX256MODEI
+ (match_operand:AVX256MODEI 1 "nonimmediate_operand" "%x")
+ (match_operand:AVX256MODEI 2 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX
+ && ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
+ "v<plogicprefix>ps\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecpsmode>")])
+
(define_insn "*sse_<code><mode>3"
[(set (match_operand:SSEMODEI 0 "register_operand" "=x")
(plogic:SSEMODEI
@@ -3920,6 +5951,18 @@
[(set_attr "type" "sselog")
(set_attr "mode" "V4SF")])
+(define_insn "*avx_<code><mode>3"
+ [(set (match_operand:SSEMODEI 0 "register_operand" "=x")
+ (plogic:SSEMODEI
+ (match_operand:SSEMODEI 1 "nonimmediate_operand" "%x")
+ (match_operand:SSEMODEI 2 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX
+ && ix86_binary_operator_ok (<CODE>, <MODE>mode, operands)"
+ "vp<plogicprefix>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "*sse2_<code><mode>3"
[(set (match_operand:SSEMODEI 0 "register_operand" "=x")
(plogic:SSEMODEI
@@ -4195,6 +6238,59 @@
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 "*avx_packsswb"
+ [(set (match_operand:V16QI 0 "register_operand" "=x")
+ (vec_concat:V16QI
+ (ss_truncate:V8QI
+ (match_operand:V8HI 1 "register_operand" "x"))
+ (ss_truncate:V8QI
+ (match_operand:V8HI 2 "nonimmediate_operand" "xm"))))]
+ "TARGET_AVX"
+ "vpacksswb\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "sse2_packsswb"
[(set (match_operand:V16QI 0 "register_operand" "=x")
(vec_concat:V16QI
@@ -4208,6 +6304,19 @@
(set_attr "prefix_data16" "1")
(set_attr "mode" "TI")])
+(define_insn "*avx_packssdw"
+ [(set (match_operand:V8HI 0 "register_operand" "=x")
+ (vec_concat:V8HI
+ (ss_truncate:V4HI
+ (match_operand:V4SI 1 "register_operand" "x"))
+ (ss_truncate:V4HI
+ (match_operand:V4SI 2 "nonimmediate_operand" "xm"))))]
+ "TARGET_AVX"
+ "vpackssdw\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "sse2_packssdw"
[(set (match_operand:V8HI 0 "register_operand" "=x")
(vec_concat:V8HI
@@ -4221,6 +6330,19 @@
(set_attr "prefix_data16" "1")
(set_attr "mode" "TI")])
+(define_insn "*avx_packuswb"
+ [(set (match_operand:V16QI 0 "register_operand" "=x")
+ (vec_concat:V16QI
+ (us_truncate:V8QI
+ (match_operand:V8HI 1 "register_operand" "x"))
+ (us_truncate:V8QI
+ (match_operand:V8HI 2 "nonimmediate_operand" "xm"))))]
+ "TARGET_AVX"
+ "vpackuswb\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "sse2_packuswb"
[(set (match_operand:V16QI 0 "register_operand" "=x")
(vec_concat:V16QI
@@ -4234,6 +6356,26 @@
(set_attr "prefix_data16" "1")
(set_attr "mode" "TI")])
+(define_insn "*avx_punpckhbw"
+ [(set (match_operand:V16QI 0 "register_operand" "=x")
+ (vec_select:V16QI
+ (vec_concat:V32QI
+ (match_operand:V16QI 1 "register_operand" "x")
+ (match_operand:V16QI 2 "nonimmediate_operand" "xm"))
+ (parallel [(const_int 8) (const_int 24)
+ (const_int 9) (const_int 25)
+ (const_int 10) (const_int 26)
+ (const_int 11) (const_int 27)
+ (const_int 12) (const_int 28)
+ (const_int 13) (const_int 29)
+ (const_int 14) (const_int 30)
+ (const_int 15) (const_int 31)])))]
+ "TARGET_AVX"
+ "vpunpckhbw\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "sse2_punpckhbw"
[(set (match_operand:V16QI 0 "register_operand" "=x")
(vec_select:V16QI
@@ -4254,6 +6396,26 @@
(set_attr "prefix_data16" "1")
(set_attr "mode" "TI")])
+(define_insn "*avx_punpcklbw"
+ [(set (match_operand:V16QI 0 "register_operand" "=x")
+ (vec_select:V16QI
+ (vec_concat:V32QI
+ (match_operand:V16QI 1 "register_operand" "x")
+ (match_operand:V16QI 2 "nonimmediate_operand" "xm"))
+ (parallel [(const_int 0) (const_int 16)
+ (const_int 1) (const_int 17)
+ (const_int 2) (const_int 18)
+ (const_int 3) (const_int 19)
+ (const_int 4) (const_int 20)
+ (const_int 5) (const_int 21)
+ (const_int 6) (const_int 22)
+ (const_int 7) (const_int 23)])))]
+ "TARGET_AVX"
+ "vpunpcklbw\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "sse2_punpcklbw"
[(set (match_operand:V16QI 0 "register_operand" "=x")
(vec_select:V16QI
@@ -4274,6 +6436,22 @@
(set_attr "prefix_data16" "1")
(set_attr "mode" "TI")])
+(define_insn "*avx_punpckhwd"
+ [(set (match_operand:V8HI 0 "register_operand" "=x")
+ (vec_select:V8HI
+ (vec_concat:V16HI
+ (match_operand:V8HI 1 "register_operand" "x")
+ (match_operand:V8HI 2 "nonimmediate_operand" "xm"))
+ (parallel [(const_int 4) (const_int 12)
+ (const_int 5) (const_int 13)
+ (const_int 6) (const_int 14)
+ (const_int 7) (const_int 15)])))]
+ "TARGET_AVX"
+ "vpunpckhwd\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "sse2_punpckhwd"
[(set (match_operand:V8HI 0 "register_operand" "=x")
(vec_select:V8HI
@@ -4290,6 +6468,22 @@
(set_attr "prefix_data16" "1")
(set_attr "mode" "TI")])
+(define_insn "*avx_punpcklwd"
+ [(set (match_operand:V8HI 0 "register_operand" "=x")
+ (vec_select:V8HI
+ (vec_concat:V16HI
+ (match_operand:V8HI 1 "register_operand" "x")
+ (match_operand:V8HI 2 "nonimmediate_operand" "xm"))
+ (parallel [(const_int 0) (const_int 8)
+ (const_int 1) (const_int 9)
+ (const_int 2) (const_int 10)
+ (const_int 3) (const_int 11)])))]
+ "TARGET_AVX"
+ "vpunpcklwd\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "sse2_punpcklwd"
[(set (match_operand:V8HI 0 "register_operand" "=x")
(vec_select:V8HI
@@ -4306,6 +6500,20 @@
(set_attr "prefix_data16" "1")
(set_attr "mode" "TI")])
+(define_insn "*avx_punpckhdq"
+ [(set (match_operand:V4SI 0 "register_operand" "=x")
+ (vec_select:V4SI
+ (vec_concat:V8SI
+ (match_operand:V4SI 1 "register_operand" "x")
+ (match_operand:V4SI 2 "nonimmediate_operand" "xm"))
+ (parallel [(const_int 2) (const_int 6)
+ (const_int 3) (const_int 7)])))]
+ "TARGET_AVX"
+ "vpunpckhdq\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "sse2_punpckhdq"
[(set (match_operand:V4SI 0 "register_operand" "=x")
(vec_select:V4SI
@@ -4320,46 +6528,48 @@
(set_attr "prefix_data16" "1")
(set_attr "mode" "TI")])
-(define_insn "sse2_punpckldq"
+(define_insn "*avx_punpckldq"
[(set (match_operand:V4SI 0 "register_operand" "=x")
(vec_select:V4SI
(vec_concat:V8SI
- (match_operand:V4SI 1 "register_operand" "0")
+ (match_operand:V4SI 1 "register_operand" "x")
(match_operand:V4SI 2 "nonimmediate_operand" "xm"))
(parallel [(const_int 0) (const_int 4)
(const_int 1) (const_int 5)])))]
- "TARGET_SSE2"
- "punpckldq\t{%2, %0|%0, %2}"
+ "TARGET_AVX"
+ "vpunpckldq\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "sselog")
- (set_attr "prefix_data16" "1")
+ (set_attr "prefix" "vex")
(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)])))]
+(define_insn "sse2_punpckldq"
+ [(set (match_operand:V4SI 0 "register_operand" "=x")
+ (vec_select:V4SI
+ (vec_concat:V8SI
+ (match_operand:V4SI 1 "register_operand" "0")
+ (match_operand:V4SI 2 "nonimmediate_operand" "xm"))
+ (parallel [(const_int 0) (const_int 4)
+ (const_int 1) (const_int 5)])))]
"TARGET_SSE2"
- "punpckhqdq\t{%2, %0|%0, %2}"
+ "punpckldq\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}"
+(define_insn "*avx_pinsr<avxmodesuffixs>"
+ [(set (match_operand:SSEMODE124 0 "register_operand" "=x")
+ (vec_merge:SSEMODE124
+ (vec_duplicate:SSEMODE124
+ (match_operand:<avxscalarmode> 2 "nonimmediate_operand" "rm"))
+ (match_operand:SSEMODE124 1 "register_operand" "x")
+ (match_operand:SI 3 "const_pow2_1_to_<pinsrbits>_operand" "n")))]
+ "TARGET_AVX"
+{
+ operands[3] = GEN_INT (exact_log2 (INTVAL (operands[3])));
+ return "vpinsr<avxmodesuffixs>\t{%3, %k2, %1, %0|%0, %1, %k2, %3}";
+}
[(set_attr "type" "sselog")
- (set_attr "prefix_data16" "1")
+ (set_attr "prefix" "vex")
(set_attr "mode" "TI")])
(define_insn "*sse4_1_pinsrb"
@@ -4411,6 +6621,22 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "TI")])
+(define_insn "*avx_pinsrq"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (vec_merge:V2DI
+ (vec_duplicate:V2DI
+ (match_operand:DI 2 "nonimmediate_operand" "rm"))
+ (match_operand:V2DI 1 "register_operand" "x")
+ (match_operand:SI 3 "const_pow2_1_to_2_operand" "n")))]
+ "TARGET_AVX && TARGET_64BIT"
+{
+ operands[3] = GEN_INT (exact_log2 (INTVAL (operands[3])));
+ return "vpinsrq\t{%3, %2, %1, %0|%0, %1, %2, %3}";
+}
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "*sse4_1_pinsrq"
[(set (match_operand:V2DI 0 "register_operand" "=x")
(vec_merge:V2DI
@@ -4434,9 +6660,10 @@
(match_operand:V16QI 1 "register_operand" "x")
(parallel [(match_operand:SI 2 "const_0_to_15_operand" "n")]))))]
"TARGET_SSE4_1"
- "pextrb\t{%2, %1, %0|%0, %1, %2}"
+ "%vpextrb\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "*sse4_1_pextrb_memory"
@@ -4445,9 +6672,10 @@
(match_operand:V16QI 1 "register_operand" "x")
(parallel [(match_operand:SI 2 "const_0_to_15_operand" "n")])))]
"TARGET_SSE4_1"
- "pextrb\t{%2, %1, %0|%0, %1, %2}"
+ "%vpextrb\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "*sse2_pextrw"
@@ -4457,9 +6685,10 @@
(match_operand:V8HI 1 "register_operand" "x")
(parallel [(match_operand:SI 2 "const_0_to_7_operand" "n")]))))]
"TARGET_SSE2"
- "pextrw\t{%2, %1, %0|%0, %1, %2}"
+ "%vpextrw\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "sselog")
(set_attr "prefix_data16" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "*sse4_1_pextrw_memory"
@@ -4468,9 +6697,10 @@
(match_operand:V8HI 1 "register_operand" "x")
(parallel [(match_operand:SI 2 "const_0_to_7_operand" "n")])))]
"TARGET_SSE4_1"
- "pextrw\t{%2, %1, %0|%0, %1, %2}"
+ "%vpextrw\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "*sse4_1_pextrd"
@@ -4479,9 +6709,10 @@
(match_operand:V4SI 1 "register_operand" "x")
(parallel [(match_operand:SI 2 "const_0_to_3_operand" "n")])))]
"TARGET_SSE4_1"
- "pextrd\t{%2, %1, %0|%0, %1, %2}"
+ "%vpextrd\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
;; It must come before *vec_extractv2di_1_sse since it is preferred.
@@ -4491,9 +6722,10 @@
(match_operand:V2DI 1 "register_operand" "x")
(parallel [(match_operand:SI 2 "const_0_to_1_operand" "n")])))]
"TARGET_SSE4_1 && TARGET_64BIT"
- "pextrq\t{%2, %1, %0|%0, %1, %2}"
+ "%vpextrq\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "sselog")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_expand "sse2_pshufd"
@@ -4528,10 +6760,11 @@
mask |= INTVAL (operands[5]) << 6;
operands[2] = GEN_INT (mask);
- return "pshufd\t{%2, %1, %0|%0, %1, %2}";
+ return "%vpshufd\t{%2, %1, %0|%0, %1, %2}";
}
[(set_attr "type" "sselog1")
(set_attr "prefix_data16" "1")
+ (set_attr "prefix" "vex")
(set_attr "mode" "TI")])
(define_expand "sse2_pshuflw"
@@ -4570,10 +6803,11 @@
mask |= INTVAL (operands[5]) << 6;
operands[2] = GEN_INT (mask);
- return "pshuflw\t{%2, %1, %0|%0, %1, %2}";
+ return "%vpshuflw\t{%2, %1, %0|%0, %1, %2}";
}
[(set_attr "type" "sselog")
(set_attr "prefix_rep" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_expand "sse2_pshufhw"
@@ -4612,10 +6846,11 @@
mask |= (INTVAL (operands[5]) - 4) << 6;
operands[2] = GEN_INT (mask);
- return "pshufhw\t{%2, %1, %0|%0, %1, %2}";
+ return "%vpshufhw\t{%2, %1, %0|%0, %1, %2}";
}
[(set_attr "type" "sselog")
(set_attr "prefix_rep" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_expand "sse2_loadd"
@@ -4628,6 +6863,22 @@
"TARGET_SSE"
"operands[2] = CONST0_RTX (V4SImode);")
+(define_insn "*avx_loadld"
+ [(set (match_operand:V4SI 0 "register_operand" "=x,Yi,x")
+ (vec_merge:V4SI
+ (vec_duplicate:V4SI
+ (match_operand:SI 2 "nonimmediate_operand" "m ,r ,x"))
+ (match_operand:V4SI 1 "reg_or_0_operand" "C ,C ,x")
+ (const_int 1)))]
+ "TARGET_AVX"
+ "@
+ vmovd\t{%2, %0|%0, %2}
+ vmovd\t{%2, %0|%0, %2}
+ vmovss\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI,TI,V4SF")])
+
(define_insn "sse2_loadld"
[(set (match_operand:V4SI 0 "register_operand" "=Y2,Yi,x,x")
(vec_merge:V4SI
@@ -4685,7 +6936,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)])))]
@@ -4693,8 +6944,9 @@
"@
#
#
- mov{q}\t{%1, %0|%0, %1}"
+ %vmov{q}\t{%1, %0|%0, %1}"
[(set_attr "type" "*,*,imov")
+ (set_attr "prefix" "*,*,maybe_vex")
(set_attr "mode" "*,*,DI")])
(define_insn "*sse2_storeq"
@@ -4720,6 +6972,24 @@
operands[1] = gen_rtx_REG (DImode, REGNO (operands[1]));
})
+(define_insn "*vec_extractv2di_1_rex64_avx"
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=m,x,x,r")
+ (vec_select:DI
+ (match_operand:V2DI 1 "nonimmediate_operand" "x,x,o,o")
+ (parallel [(const_int 1)])))]
+ "TARGET_64BIT
+ && TARGET_AVX
+ && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
+ "@
+ vmovhps\t{%1, %0|%0, %1}
+ vpsrldq\t{$8, %1, %0|%0, %1, 8}
+ vmovq\t{%H1, %0|%0, %H1}
+ vmov{q}\t{%H1, %0|%0, %H1}"
+ [(set_attr "type" "ssemov,sseishft,ssemov,imov")
+ (set_attr "memory" "*,none,*,*")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V2SF,TI,TI,DI")])
+
(define_insn "*vec_extractv2di_1_rex64"
[(set (match_operand:DI 0 "nonimmediate_operand" "=m,x,x,r")
(vec_select:DI
@@ -4735,6 +7005,23 @@
(set_attr "memory" "*,none,*,*")
(set_attr "mode" "V2SF,TI,TI,DI")])
+(define_insn "*vec_extractv2di_1_avx"
+ [(set (match_operand:DI 0 "nonimmediate_operand" "=m,x,x")
+ (vec_select:DI
+ (match_operand:V2DI 1 "nonimmediate_operand" "x,x,o")
+ (parallel [(const_int 1)])))]
+ "!TARGET_64BIT
+ && TARGET_AVX
+ && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
+ "@
+ vmovhps\t{%1, %0|%0, %1}
+ vpsrldq\t{$8, %1, %0|%0, %1, 8}
+ vmovq\t{%H1, %0|%0, %H1}"
+ [(set_attr "type" "ssemov,sseishft,ssemov")
+ (set_attr "memory" "*,none,*")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V2SF,TI,TI")])
+
(define_insn "*vec_extractv2di_1_sse2"
[(set (match_operand:DI 0 "nonimmediate_operand" "=m,x,x")
(vec_select:DI
@@ -4771,11 +7058,22 @@
(match_operand:SI 1 "register_operand" " Y2,0")))]
"TARGET_SSE"
"@
- pshufd\t{$0, %1, %0|%0, %1, 0}
+ %vpshufd\t{$0, %1, %0|%0, %1, 0}
shufps\t{$0, %0, %0|%0, %0, 0}"
[(set_attr "type" "sselog1")
+ (set_attr "prefix" "maybe_vex,orig")
(set_attr "mode" "TI,V4SF")])
+(define_insn "*vec_dupv2di_avx"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (vec_duplicate:V2DI
+ (match_operand:DI 1 "register_operand" "x")))]
+ "TARGET_AVX"
+ "vpunpcklqdq\t{%1, %1, %0|%0, %1, %1}"
+ [(set_attr "type" "sselog1")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "*vec_dupv2di"
[(set (match_operand:V2DI 0 "register_operand" "=Y2,x")
(vec_duplicate:V2DI
@@ -4787,6 +7085,25 @@
[(set_attr "type" "sselog1,ssemov")
(set_attr "mode" "TI,V4SF")])
+(define_insn "*vec_concatv2si_avx"
+ [(set (match_operand:V2SI 0 "register_operand" "=x,x,x ,*y ,*y")
+ (vec_concat:V2SI
+ (match_operand:SI 1 "nonimmediate_operand" "x ,x,rm, 0 ,rm")
+ (match_operand:SI 2 "vector_move_operand" "rm,x,C ,*ym,C")))]
+ "TARGET_AVX"
+ "@
+ vpinsrd\t{$0x1, %2, %1, %0|%0, %1, %2, 0x1}
+ vpunpckldq\t{%2, %1, %0|%0, %1, %2}
+ vmovd\t{%1, %0|%0, %1}
+ punpckldq\t{%2, %0|%0, %2}
+ movd\t{%1, %0|%0, %1}"
+ [(set_attr "type" "sselog,sselog,ssemov,mmxcvt,mmxmov")
+ (set (attr "prefix")
+ (if_then_else (eq_attr "alternative" "3,4")
+ (const_string "orig")
+ (const_string "vex")))
+ (set_attr "mode" "TI,TI,TI,DI,DI")])
+
(define_insn "*vec_concatv2si_sse4_1"
[(set (match_operand:V2SI 0 "register_operand" "=x,x,x ,*y ,*y")
(vec_concat:V2SI
@@ -4834,6 +7151,19 @@
[(set_attr "type" "sselog,ssemov,mmxcvt,mmxmov")
(set_attr "mode" "V4SF,V4SF,DI,DI")])
+(define_insn "*vec_concatv4si_1_avx"
+ [(set (match_operand:V4SI 0 "register_operand" "=x,x")
+ (vec_concat:V4SI
+ (match_operand:V2SI 1 "register_operand" " x,x")
+ (match_operand:V2SI 2 "nonimmediate_operand" " x,m")))]
+ "TARGET_AVX"
+ "@
+ vpunpcklqdq\t{%2, %1, %0|%0, %1, %2}
+ vmovhps\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog,ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI,V2SF")])
+
(define_insn "*vec_concatv4si_1"
[(set (match_operand:V4SI 0 "register_operand" "=Y2,x,x")
(vec_concat:V4SI
@@ -4847,27 +7177,64 @@
[(set_attr "type" "sselog,ssemov,ssemov")
(set_attr "mode" "TI,V4SF,V2SF")])
+(define_insn "*vec_concatv2di_avx"
+ [(set (match_operand:V2DI 0 "register_operand" "=x,?x,x,x")
+ (vec_concat:V2DI
+ (match_operand:DI 1 "nonimmediate_operand" " m,*y,x,x")
+ (match_operand:DI 2 "vector_move_operand" " C, C,x,m")))]
+ "!TARGET_64BIT && TARGET_AVX"
+ "@
+ vmovq\t{%1, %0|%0, %1}
+ movq2dq\t{%1, %0|%0, %1}
+ vpunpcklqdq\t{%2, %1, %0|%0, %1, %2}
+ vmovhps\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ssemov,ssemov,sselog,ssemov")
+ (set (attr "prefix")
+ (if_then_else (eq_attr "alternative" "1")
+ (const_string "orig")
+ (const_string "vex")))
+ (set_attr "mode" "TI,TI,TI,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_avx"
+ [(set (match_operand:V2DI 0 "register_operand" "=x,x,Yi,!x,x,x")
+ (vec_concat:V2DI
+ (match_operand:DI 1 "nonimmediate_operand" " x,m,r ,*y,x,x")
+ (match_operand:DI 2 "vector_move_operand" "rm,C,C ,C ,x,m")))]
+ "TARGET_64BIT && TARGET_AVX"
+ "@
+ vpinsrq\t{$0x1, %2, %1, %0|%0, %1, %2, 0x1}
+ vmovq\t{%1, %0|%0, %1}
+ vmovq\t{%1, %0|%0, %1}
+ movq2dq\t{%1, %0|%0, %1}
+ vpunpcklqdq\t{%2, %1, %0|%0, %1, %2}
+ vmovhps\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog,ssemov,ssemov,ssemov,sselog,ssemov")
+ (set (attr "prefix")
+ (if_then_else (eq_attr "alternative" "3")
+ (const_string "orig")
+ (const_string "vex")))
+ (set_attr "mode" "TI,TI,TI,TI,TI,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 +7243,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 +7260,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" "")
@@ -5095,6 +7460,31 @@
"TARGET_SSE2"
"ix86_fixup_binary_operands_no_copy (PLUS, V16QImode, operands);")
+(define_insn "*avx_uavgv16qi3"
+ [(set (match_operand:V16QI 0 "register_operand" "=x")
+ (truncate:V16QI
+ (lshiftrt:V16HI
+ (plus:V16HI
+ (plus:V16HI
+ (zero_extend:V16HI
+ (match_operand:V16QI 1 "nonimmediate_operand" "%x"))
+ (zero_extend:V16HI
+ (match_operand:V16QI 2 "nonimmediate_operand" "xm")))
+ (const_vector:V16QI [(const_int 1) (const_int 1)
+ (const_int 1) (const_int 1)
+ (const_int 1) (const_int 1)
+ (const_int 1) (const_int 1)
+ (const_int 1) (const_int 1)
+ (const_int 1) (const_int 1)
+ (const_int 1) (const_int 1)
+ (const_int 1) (const_int 1)]))
+ (const_int 1))))]
+ "TARGET_AVX && ix86_binary_operator_ok (PLUS, V16QImode, operands)"
+ "vpavgb\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseiadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "*sse2_uavgv16qi3"
[(set (match_operand:V16QI 0 "register_operand" "=x")
(truncate:V16QI
@@ -5138,6 +7528,27 @@
"TARGET_SSE2"
"ix86_fixup_binary_operands_no_copy (PLUS, V8HImode, operands);")
+(define_insn "*avx_uavgv8hi3"
+ [(set (match_operand:V8HI 0 "register_operand" "=x")
+ (truncate:V8HI
+ (lshiftrt:V8SI
+ (plus:V8SI
+ (plus:V8SI
+ (zero_extend:V8SI
+ (match_operand:V8HI 1 "nonimmediate_operand" "%x"))
+ (zero_extend:V8SI
+ (match_operand:V8HI 2 "nonimmediate_operand" "xm")))
+ (const_vector:V8HI [(const_int 1) (const_int 1)
+ (const_int 1) (const_int 1)
+ (const_int 1) (const_int 1)
+ (const_int 1) (const_int 1)]))
+ (const_int 1))))]
+ "TARGET_AVX && ix86_binary_operator_ok (PLUS, V8HImode, operands)"
+ "vpavgw\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseiadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "*sse2_uavgv8hi3"
[(set (match_operand:V8HI 0 "register_operand" "=x")
(truncate:V8HI
@@ -5161,6 +7572,17 @@
;; The correct representation for this is absolutely enormous, and
;; surely not generally useful.
+(define_insn "*avx_psadbw"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (unspec:V2DI [(match_operand:V16QI 1 "register_operand" "x")
+ (match_operand:V16QI 2 "nonimmediate_operand" "xm")]
+ UNSPEC_PSADBW))]
+ "TARGET_AVX"
+ "vpsadbw\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseiadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "sse2_psadbw"
[(set (match_operand:V2DI 0 "register_operand" "=x")
(unspec:V2DI [(match_operand:V16QI 1 "register_operand" "0")
@@ -5172,14 +7594,26 @@
(set_attr "prefix_data16" "1")
(set_attr "mode" "TI")])
+(define_insn "avx_movmskp<avxmodesuffixf2c>256"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (unspec:SI
+ [(match_operand:AVX256MODEF2P 1 "register_operand" "x")]
+ UNSPEC_MOVMSK))]
+ "AVX256_VEC_FLOAT_MODE_P (<MODE>mode)"
+ "vmovmskp<avxmodesuffixf2c>\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<MODE>")])
+
(define_insn "<sse>_movmskp<ssemodesuffixf2c>"
[(set (match_operand:SI 0 "register_operand" "=r")
(unspec:SI
[(match_operand:SSEMODEF2P 1 "register_operand" "x")]
UNSPEC_MOVMSK))]
"SSE_VEC_FLOAT_MODE_P (<MODE>mode)"
- "movmskp<ssemodesuffixf2c>\t{%1, %0|%0, %1}"
+ "%vmovmskp<ssemodesuffixf2c>\t{%1, %0|%0, %1}"
[(set_attr "type" "ssecvt")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "<MODE>")])
(define_insn "sse2_pmovmskb"
@@ -5187,9 +7621,10 @@
(unspec:SI [(match_operand:V16QI 1 "register_operand" "x")]
UNSPEC_MOVMSK))]
"TARGET_SSE2"
- "pmovmskb\t{%1, %0|%0, %1}"
+ "%vpmovmskb\t{%1, %0|%0, %1}"
[(set_attr "type" "ssecvt")
(set_attr "prefix_data16" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "SI")])
(define_expand "sse2_maskmovdqu"
@@ -5209,9 +7644,10 @@
UNSPEC_MASKMOV))]
"TARGET_SSE2 && !TARGET_64BIT"
;; @@@ check ordering of operands in intel/nonintel syntax
- "maskmovdqu\t{%2, %1|%1, %2}"
+ "%vmaskmovdqu\t{%2, %1|%1, %2}"
[(set_attr "type" "ssecvt")
(set_attr "prefix_data16" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "*sse2_maskmovdqu_rex64"
@@ -5222,25 +7658,28 @@
UNSPEC_MASKMOV))]
"TARGET_SSE2 && TARGET_64BIT"
;; @@@ check ordering of operands in intel/nonintel syntax
- "maskmovdqu\t{%2, %1|%1, %2}"
+ "%vmaskmovdqu\t{%2, %1|%1, %2}"
[(set_attr "type" "ssecvt")
(set_attr "prefix_data16" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "sse_ldmxcsr"
[(unspec_volatile [(match_operand:SI 0 "memory_operand" "m")]
UNSPECV_LDMXCSR)]
"TARGET_SSE"
- "ldmxcsr\t%0"
+ "%vldmxcsr\t%0"
[(set_attr "type" "sse")
+ (set_attr "prefix" "maybe_vex")
(set_attr "memory" "load")])
(define_insn "sse_stmxcsr"
[(set (match_operand:SI 0 "memory_operand" "=m")
(unspec_volatile:SI [(const_int 0)] UNSPECV_STMXCSR))]
"TARGET_SSE"
- "stmxcsr\t%0"
+ "%vstmxcsr\t%0"
[(set_attr "type" "sse")
+ (set_attr "prefix" "maybe_vex")
(set_attr "memory" "store")])
(define_expand "sse_sfence"
@@ -5340,6 +7779,49 @@
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(define_insn "*avx_phaddwv8hi3"
+ [(set (match_operand:V8HI 0 "register_operand" "=x")
+ (vec_concat:V8HI
+ (vec_concat:V4HI
+ (vec_concat:V2HI
+ (plus:HI
+ (vec_select:HI
+ (match_operand:V8HI 1 "register_operand" "x")
+ (parallel [(const_int 0)]))
+ (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
+ (plus:HI
+ (vec_select:HI (match_dup 1) (parallel [(const_int 2)]))
+ (vec_select:HI (match_dup 1) (parallel [(const_int 3)]))))
+ (vec_concat:V2HI
+ (plus:HI
+ (vec_select:HI (match_dup 1) (parallel [(const_int 4)]))
+ (vec_select:HI (match_dup 1) (parallel [(const_int 5)])))
+ (plus:HI
+ (vec_select:HI (match_dup 1) (parallel [(const_int 6)]))
+ (vec_select:HI (match_dup 1) (parallel [(const_int 7)])))))
+ (vec_concat:V4HI
+ (vec_concat:V2HI
+ (plus:HI
+ (vec_select:HI
+ (match_operand:V8HI 2 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)]))
+ (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))
+ (plus:HI
+ (vec_select:HI (match_dup 2) (parallel [(const_int 2)]))
+ (vec_select:HI (match_dup 2) (parallel [(const_int 3)]))))
+ (vec_concat:V2HI
+ (plus:HI
+ (vec_select:HI (match_dup 2) (parallel [(const_int 4)]))
+ (vec_select:HI (match_dup 2) (parallel [(const_int 5)])))
+ (plus:HI
+ (vec_select:HI (match_dup 2) (parallel [(const_int 6)]))
+ (vec_select:HI (match_dup 2) (parallel [(const_int 7)])))))))]
+ "TARGET_AVX"
+ "vphaddw\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseiadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "ssse3_phaddwv8hi3"
[(set (match_operand:V8HI 0 "register_operand" "=x")
(vec_concat:V8HI
@@ -5411,6 +7893,33 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "DI")])
+(define_insn "*avx_phadddv4si3"
+ [(set (match_operand:V4SI 0 "register_operand" "=x")
+ (vec_concat:V4SI
+ (vec_concat:V2SI
+ (plus:SI
+ (vec_select:SI
+ (match_operand:V4SI 1 "register_operand" "x")
+ (parallel [(const_int 0)]))
+ (vec_select:SI (match_dup 1) (parallel [(const_int 1)])))
+ (plus:SI
+ (vec_select:SI (match_dup 1) (parallel [(const_int 2)]))
+ (vec_select:SI (match_dup 1) (parallel [(const_int 3)]))))
+ (vec_concat:V2SI
+ (plus:SI
+ (vec_select:SI
+ (match_operand:V4SI 2 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)]))
+ (vec_select:SI (match_dup 2) (parallel [(const_int 1)])))
+ (plus:SI
+ (vec_select:SI (match_dup 2) (parallel [(const_int 2)]))
+ (vec_select:SI (match_dup 2) (parallel [(const_int 3)]))))))]
+ "TARGET_AVX"
+ "vphaddd\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseiadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "ssse3_phadddv4si3"
[(set (match_operand:V4SI 0 "register_operand" "=x")
(vec_concat:V4SI
@@ -5458,6 +7967,49 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "DI")])
+(define_insn "*avx_phaddswv8hi3"
+ [(set (match_operand:V8HI 0 "register_operand" "=x")
+ (vec_concat:V8HI
+ (vec_concat:V4HI
+ (vec_concat:V2HI
+ (ss_plus:HI
+ (vec_select:HI
+ (match_operand:V8HI 1 "register_operand" "x")
+ (parallel [(const_int 0)]))
+ (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
+ (ss_plus:HI
+ (vec_select:HI (match_dup 1) (parallel [(const_int 2)]))
+ (vec_select:HI (match_dup 1) (parallel [(const_int 3)]))))
+ (vec_concat:V2HI
+ (ss_plus:HI
+ (vec_select:HI (match_dup 1) (parallel [(const_int 4)]))
+ (vec_select:HI (match_dup 1) (parallel [(const_int 5)])))
+ (ss_plus:HI
+ (vec_select:HI (match_dup 1) (parallel [(const_int 6)]))
+ (vec_select:HI (match_dup 1) (parallel [(const_int 7)])))))
+ (vec_concat:V4HI
+ (vec_concat:V2HI
+ (ss_plus:HI
+ (vec_select:HI
+ (match_operand:V8HI 2 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)]))
+ (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))
+ (ss_plus:HI
+ (vec_select:HI (match_dup 2) (parallel [(const_int 2)]))
+ (vec_select:HI (match_dup 2) (parallel [(const_int 3)]))))
+ (vec_concat:V2HI
+ (ss_plus:HI
+ (vec_select:HI (match_dup 2) (parallel [(const_int 4)]))
+ (vec_select:HI (match_dup 2) (parallel [(const_int 5)])))
+ (ss_plus:HI
+ (vec_select:HI (match_dup 2) (parallel [(const_int 6)]))
+ (vec_select:HI (match_dup 2) (parallel [(const_int 7)])))))))]
+ "TARGET_AVX"
+ "vphaddsw\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseiadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "ssse3_phaddswv8hi3"
[(set (match_operand:V8HI 0 "register_operand" "=x")
(vec_concat:V8HI
@@ -5529,6 +8081,49 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "DI")])
+(define_insn "*avx_phsubwv8hi3"
+ [(set (match_operand:V8HI 0 "register_operand" "=x")
+ (vec_concat:V8HI
+ (vec_concat:V4HI
+ (vec_concat:V2HI
+ (minus:HI
+ (vec_select:HI
+ (match_operand:V8HI 1 "register_operand" "x")
+ (parallel [(const_int 0)]))
+ (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
+ (minus:HI
+ (vec_select:HI (match_dup 1) (parallel [(const_int 2)]))
+ (vec_select:HI (match_dup 1) (parallel [(const_int 3)]))))
+ (vec_concat:V2HI
+ (minus:HI
+ (vec_select:HI (match_dup 1) (parallel [(const_int 4)]))
+ (vec_select:HI (match_dup 1) (parallel [(const_int 5)])))
+ (minus:HI
+ (vec_select:HI (match_dup 1) (parallel [(const_int 6)]))
+ (vec_select:HI (match_dup 1) (parallel [(const_int 7)])))))
+ (vec_concat:V4HI
+ (vec_concat:V2HI
+ (minus:HI
+ (vec_select:HI
+ (match_operand:V8HI 2 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)]))
+ (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))
+ (minus:HI
+ (vec_select:HI (match_dup 2) (parallel [(const_int 2)]))
+ (vec_select:HI (match_dup 2) (parallel [(const_int 3)]))))
+ (vec_concat:V2HI
+ (minus:HI
+ (vec_select:HI (match_dup 2) (parallel [(const_int 4)]))
+ (vec_select:HI (match_dup 2) (parallel [(const_int 5)])))
+ (minus:HI
+ (vec_select:HI (match_dup 2) (parallel [(const_int 6)]))
+ (vec_select:HI (match_dup 2) (parallel [(const_int 7)])))))))]
+ "TARGET_AVX"
+ "vphsubw\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseiadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "ssse3_phsubwv8hi3"
[(set (match_operand:V8HI 0 "register_operand" "=x")
(vec_concat:V8HI
@@ -5600,6 +8195,33 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "DI")])
+(define_insn "*avx_phsubdv4si3"
+ [(set (match_operand:V4SI 0 "register_operand" "=x")
+ (vec_concat:V4SI
+ (vec_concat:V2SI
+ (minus:SI
+ (vec_select:SI
+ (match_operand:V4SI 1 "register_operand" "x")
+ (parallel [(const_int 0)]))
+ (vec_select:SI (match_dup 1) (parallel [(const_int 1)])))
+ (minus:SI
+ (vec_select:SI (match_dup 1) (parallel [(const_int 2)]))
+ (vec_select:SI (match_dup 1) (parallel [(const_int 3)]))))
+ (vec_concat:V2SI
+ (minus:SI
+ (vec_select:SI
+ (match_operand:V4SI 2 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)]))
+ (vec_select:SI (match_dup 2) (parallel [(const_int 1)])))
+ (minus:SI
+ (vec_select:SI (match_dup 2) (parallel [(const_int 2)]))
+ (vec_select:SI (match_dup 2) (parallel [(const_int 3)]))))))]
+ "TARGET_AVX"
+ "vphsubd\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseiadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "ssse3_phsubdv4si3"
[(set (match_operand:V4SI 0 "register_operand" "=x")
(vec_concat:V4SI
@@ -5647,6 +8269,49 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "DI")])
+(define_insn "*avx_phsubswv8hi3"
+ [(set (match_operand:V8HI 0 "register_operand" "=x")
+ (vec_concat:V8HI
+ (vec_concat:V4HI
+ (vec_concat:V2HI
+ (ss_minus:HI
+ (vec_select:HI
+ (match_operand:V8HI 1 "register_operand" "x")
+ (parallel [(const_int 0)]))
+ (vec_select:HI (match_dup 1) (parallel [(const_int 1)])))
+ (ss_minus:HI
+ (vec_select:HI (match_dup 1) (parallel [(const_int 2)]))
+ (vec_select:HI (match_dup 1) (parallel [(const_int 3)]))))
+ (vec_concat:V2HI
+ (ss_minus:HI
+ (vec_select:HI (match_dup 1) (parallel [(const_int 4)]))
+ (vec_select:HI (match_dup 1) (parallel [(const_int 5)])))
+ (ss_minus:HI
+ (vec_select:HI (match_dup 1) (parallel [(const_int 6)]))
+ (vec_select:HI (match_dup 1) (parallel [(const_int 7)])))))
+ (vec_concat:V4HI
+ (vec_concat:V2HI
+ (ss_minus:HI
+ (vec_select:HI
+ (match_operand:V8HI 2 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)]))
+ (vec_select:HI (match_dup 2) (parallel [(const_int 1)])))
+ (ss_minus:HI
+ (vec_select:HI (match_dup 2) (parallel [(const_int 2)]))
+ (vec_select:HI (match_dup 2) (parallel [(const_int 3)]))))
+ (vec_concat:V2HI
+ (ss_minus:HI
+ (vec_select:HI (match_dup 2) (parallel [(const_int 4)]))
+ (vec_select:HI (match_dup 2) (parallel [(const_int 5)])))
+ (ss_minus:HI
+ (vec_select:HI (match_dup 2) (parallel [(const_int 6)]))
+ (vec_select:HI (match_dup 2) (parallel [(const_int 7)])))))))]
+ "TARGET_AVX"
+ "vphsubsw\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseiadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "ssse3_phsubswv8hi3"
[(set (match_operand:V8HI 0 "register_operand" "=x")
(vec_concat:V8HI
@@ -5718,6 +8383,59 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "DI")])
+(define_insn "*avx_pmaddubsw128"
+ [(set (match_operand:V8HI 0 "register_operand" "=x")
+ (ss_plus:V8HI
+ (mult:V8HI
+ (zero_extend:V8HI
+ (vec_select:V4QI
+ (match_operand:V16QI 1 "register_operand" "x")
+ (parallel [(const_int 0)
+ (const_int 2)
+ (const_int 4)
+ (const_int 6)
+ (const_int 8)
+ (const_int 10)
+ (const_int 12)
+ (const_int 14)])))
+ (sign_extend:V8HI
+ (vec_select:V8QI
+ (match_operand:V16QI 2 "nonimmediate_operand" "xm")
+ (parallel [(const_int 0)
+ (const_int 2)
+ (const_int 4)
+ (const_int 6)
+ (const_int 8)
+ (const_int 10)
+ (const_int 12)
+ (const_int 14)]))))
+ (mult:V8HI
+ (zero_extend:V8HI
+ (vec_select:V16QI (match_dup 1)
+ (parallel [(const_int 1)
+ (const_int 3)
+ (const_int 5)
+ (const_int 7)
+ (const_int 9)
+ (const_int 11)
+ (const_int 13)
+ (const_int 15)])))
+ (sign_extend:V8HI
+ (vec_select:V16QI (match_dup 2)
+ (parallel [(const_int 1)
+ (const_int 3)
+ (const_int 5)
+ (const_int 7)
+ (const_int 9)
+ (const_int 11)
+ (const_int 13)
+ (const_int 15)]))))))]
+ "TARGET_AVX"
+ "vpmaddubsw\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseiadd")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "ssse3_pmaddubsw128"
[(set (match_operand:V8HI 0 "register_operand" "=x")
(ss_plus:V8HI
@@ -5829,6 +8547,29 @@
"TARGET_SSSE3"
"ix86_fixup_binary_operands_no_copy (MULT, V8HImode, operands);")
+(define_insn "*avx_pmulhrswv8hi3"
+ [(set (match_operand:V8HI 0 "register_operand" "=x")
+ (truncate:V8HI
+ (lshiftrt:V8SI
+ (plus:V8SI
+ (lshiftrt:V8SI
+ (mult:V8SI
+ (sign_extend:V8SI
+ (match_operand:V8HI 1 "nonimmediate_operand" "%x"))
+ (sign_extend:V8SI
+ (match_operand:V8HI 2 "nonimmediate_operand" "xm")))
+ (const_int 14))
+ (const_vector:V8HI [(const_int 1) (const_int 1)
+ (const_int 1) (const_int 1)
+ (const_int 1) (const_int 1)
+ (const_int 1) (const_int 1)]))
+ (const_int 1))))]
+ "TARGET_AVX && ix86_binary_operator_ok (MULT, V8HImode, operands)"
+ "vpmulhrsw\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sseimul")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "*ssse3_pmulhrswv8hi3"
[(set (match_operand:V8HI 0 "register_operand" "=x")
(truncate:V8HI
@@ -5892,6 +8633,17 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "DI")])
+(define_insn "*avx_pshufbv16qi3"
+ [(set (match_operand:V16QI 0 "register_operand" "=x")
+ (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "x")
+ (match_operand:V16QI 2 "nonimmediate_operand" "xm")]
+ UNSPEC_PSHUFB))]
+ "TARGET_AVX"
+ "vpshufb\t{%2, %1, %0|%0, %1, %2}";
+ [(set_attr "type" "sselog1")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "ssse3_pshufbv16qi3"
[(set (match_operand:V16QI 0 "register_operand" "=x")
(unspec:V16QI [(match_operand:V16QI 1 "register_operand" "0")
@@ -5915,6 +8667,18 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "DI")])
+(define_insn "*avx_psign<mode>3"
+ [(set (match_operand:SSEMODE124 0 "register_operand" "=x")
+ (unspec:SSEMODE124
+ [(match_operand:SSEMODE124 1 "register_operand" "x")
+ (match_operand:SSEMODE124 2 "nonimmediate_operand" "xm")]
+ UNSPEC_PSIGN))]
+ "TARGET_AVX"
+ "vpsign<ssevecsize>\t{%2, %1, %0|%0, %1, %2}";
+ [(set_attr "type" "sselog1")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "ssse3_psign<mode>3"
[(set (match_operand:SSEMODE124 0 "register_operand" "=x")
(unspec:SSEMODE124
@@ -5940,6 +8704,21 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "DI")])
+(define_insn "*avx_palignrti"
+ [(set (match_operand:TI 0 "register_operand" "=x")
+ (unspec:TI [(match_operand:TI 1 "register_operand" "x")
+ (match_operand:TI 2 "nonimmediate_operand" "xm")
+ (match_operand:SI 3 "const_0_to_255_mul_8_operand" "n")]
+ UNSPEC_PALIGNR))]
+ "TARGET_AVX"
+{
+ operands[3] = GEN_INT (INTVAL (operands[3]) / 8);
+ return "vpalignr\t{%3, %2, %1, %0|%0, %1, %2, %3}";
+}
+ [(set_attr "type" "sseishft")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "ssse3_palignrti"
[(set (match_operand:TI 0 "register_operand" "=x")
(unspec:TI [(match_operand:TI 1 "register_operand" "0")
@@ -5975,10 +8754,11 @@
[(set (match_operand:SSEMODE124 0 "register_operand" "=x")
(abs:SSEMODE124 (match_operand:SSEMODE124 1 "nonimmediate_operand" "xm")))]
"TARGET_SSSE3"
- "pabs<ssevecsize>\t{%1, %0|%0, %1}";
+ "%vpabs<ssevecsize>\t{%1, %0|%0, %1}"
[(set_attr "type" "sselog1")
(set_attr "prefix_data16" "1")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "abs<mode>2"
@@ -6071,6 +8851,31 @@
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(define_insn "avx_blendp<avxmodesuffixf2c><avxmodesuffix>"
+ [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
+ (vec_merge:AVXMODEF2P
+ (match_operand:AVXMODEF2P 2 "nonimmediate_operand" "xm")
+ (match_operand:AVXMODEF2P 1 "register_operand" "x")
+ (match_operand:SI 3 "const_0_to_<blendbits>_operand" "n")))]
+ "TARGET_AVX"
+ "vblendp<avxmodesuffixf2c>\t{%3, %2, %1, %0|%0, %1, %2, %3}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")])
+
+(define_insn "avx_blendvp<avxmodesuffixf2c><avxmodesuffix>"
+ [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
+ (unspec:AVXMODEF2P
+ [(match_operand:AVXMODEF2P 1 "register_operand" "x")
+ (match_operand:AVXMODEF2P 2 "nonimmediate_operand" "xm")
+ (match_operand:AVXMODEF2P 3 "register_operand" "x")]
+ UNSPEC_BLENDV))]
+ "TARGET_AVX"
+ "vblendvp<avxmodesuffixf2c>\t{%3, %2, %1, %0|%0, %1, %2, %3}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")])
+
(define_insn "sse4_1_blendp<ssemodesuffixf2c>"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
(vec_merge:SSEMODEF2P
@@ -6096,6 +8901,19 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "<MODE>")])
+(define_insn "avx_dpp<avxmodesuffixf2c><avxmodesuffix>"
+ [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
+ (unspec:AVXMODEF2P
+ [(match_operand:AVXMODEF2P 1 "nonimmediate_operand" "%x")
+ (match_operand:AVXMODEF2P 2 "nonimmediate_operand" "xm")
+ (match_operand:SI 3 "const_0_to_255_operand" "n")]
+ UNSPEC_DP))]
+ "TARGET_AVX"
+ "vdpp<avxmodesuffixf2c>\t{%3, %2, %1, %0|%0, %1, %2, %3}"
+ [(set_attr "type" "ssemul")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")])
+
(define_insn "sse4_1_dpp<ssemodesuffixf2c>"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
(unspec:SSEMODEF2P
@@ -6114,9 +8932,22 @@
(unspec:V2DI [(match_operand:V2DI 1 "memory_operand" "m")]
UNSPEC_MOVNTDQA))]
"TARGET_SSE4_1"
- "movntdqa\t{%1, %0|%0, %1}"
+ "%vmovntdqa\t{%1, %0|%0, %1}"
[(set_attr "type" "ssecvt")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
+ (set_attr "mode" "TI")])
+
+(define_insn "*avx_mpsadbw"
+ [(set (match_operand:V16QI 0 "register_operand" "=x")
+ (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "x")
+ (match_operand:V16QI 2 "nonimmediate_operand" "xm")
+ (match_operand:SI 3 "const_0_to_255_operand" "n")]
+ UNSPEC_MPSADBW))]
+ "TARGET_AVX"
+ "vmpsadbw\t{%3, %2, %1, %0|%0, %1, %2, %3}"
+ [(set_attr "type" "sselog1")
+ (set_attr "prefix" "vex")
(set_attr "mode" "TI")])
(define_insn "sse4_1_mpsadbw"
@@ -6131,6 +8962,19 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "TI")])
+(define_insn "*avx_packusdw"
+ [(set (match_operand:V8HI 0 "register_operand" "=x")
+ (vec_concat:V8HI
+ (us_truncate:V4HI
+ (match_operand:V4SI 1 "register_operand" "x"))
+ (us_truncate:V4HI
+ (match_operand:V4SI 2 "nonimmediate_operand" "xm"))))]
+ "TARGET_AVX"
+ "vpackusdw\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "sse4_1_packusdw"
[(set (match_operand:V8HI 0 "register_operand" "=x")
(vec_concat:V8HI
@@ -6144,6 +8988,18 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "TI")])
+(define_insn "*avx_pblendvb"
+ [(set (match_operand:V16QI 0 "register_operand" "=x")
+ (unspec:V16QI [(match_operand:V16QI 1 "register_operand" "x")
+ (match_operand:V16QI 2 "nonimmediate_operand" "xm")
+ (match_operand:V16QI 3 "register_operand" "x")]
+ UNSPEC_BLENDV))]
+ "TARGET_AVX"
+ "vpblendvb\t{%3, %2, %1, %0|%0, %1, %2, %3}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "sse4_1_pblendvb"
[(set (match_operand:V16QI 0 "reg_not_xmm0_operand" "=x")
(unspec:V16QI [(match_operand:V16QI 1 "reg_not_xmm0_operand" "0")
@@ -6156,6 +9012,18 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "TI")])
+(define_insn "*avx_pblendw"
+ [(set (match_operand:V8HI 0 "register_operand" "=x")
+ (vec_merge:V8HI
+ (match_operand:V8HI 2 "nonimmediate_operand" "xm")
+ (match_operand:V8HI 1 "register_operand" "x")
+ (match_operand:SI 3 "const_0_to_255_operand" "n")))]
+ "TARGET_AVX"
+ "vpblendw\t{%3, %2, %1, %0|%0, %1, %2, %3}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "sse4_1_pblendw"
[(set (match_operand:V8HI 0 "register_operand" "=x")
(vec_merge:V8HI
@@ -6173,9 +9041,10 @@
(unspec:V8HI [(match_operand:V8HI 1 "nonimmediate_operand" "xm")]
UNSPEC_PHMINPOSUW))]
"TARGET_SSE4_1"
- "phminposuw\t{%1, %0|%0, %1}"
+ "%vphminposuw\t{%1, %0|%0, %1}"
[(set_attr "type" "sselog1")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "sse4_1_extendv8qiv8hi2"
@@ -6192,9 +9061,10 @@
(const_int 6)
(const_int 7)]))))]
"TARGET_SSE4_1"
- "pmovsxbw\t{%1, %0|%0, %1}"
+ "%vpmovsxbw\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "*sse4_1_extendv8qiv8hi2"
@@ -6212,9 +9082,10 @@
(const_int 6)
(const_int 7)]))))]
"TARGET_SSE4_1"
- "pmovsxbw\t{%1, %0|%0, %1}"
+ "%vpmovsxbw\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "sse4_1_extendv4qiv4si2"
@@ -6227,9 +9098,10 @@
(const_int 2)
(const_int 3)]))))]
"TARGET_SSE4_1"
- "pmovsxbd\t{%1, %0|%0, %1}"
+ "%vpmovsxbd\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "*sse4_1_extendv4qiv4si2"
@@ -6243,9 +9115,10 @@
(const_int 2)
(const_int 3)]))))]
"TARGET_SSE4_1"
- "pmovsxbd\t{%1, %0|%0, %1}"
+ "%vpmovsxbd\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "sse4_1_extendv2qiv2di2"
@@ -6256,9 +9129,10 @@
(parallel [(const_int 0)
(const_int 1)]))))]
"TARGET_SSE4_1"
- "pmovsxbq\t{%1, %0|%0, %1}"
+ "%vpmovsxbq\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "*sse4_1_extendv2qiv2di2"
@@ -6270,9 +9144,10 @@
(parallel [(const_int 0)
(const_int 1)]))))]
"TARGET_SSE4_1"
- "pmovsxbq\t{%1, %0|%0, %1}"
+ "%vpmovsxbq\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "sse4_1_extendv4hiv4si2"
@@ -6285,9 +9160,10 @@
(const_int 2)
(const_int 3)]))))]
"TARGET_SSE4_1"
- "pmovsxwd\t{%1, %0|%0, %1}"
+ "%vpmovsxwd\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "*sse4_1_extendv4hiv4si2"
@@ -6301,9 +9177,10 @@
(const_int 2)
(const_int 3)]))))]
"TARGET_SSE4_1"
- "pmovsxwd\t{%1, %0|%0, %1}"
+ "%vpmovsxwd\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "sse4_1_extendv2hiv2di2"
@@ -6314,9 +9191,10 @@
(parallel [(const_int 0)
(const_int 1)]))))]
"TARGET_SSE4_1"
- "pmovsxwq\t{%1, %0|%0, %1}"
+ "%vpmovsxwq\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "*sse4_1_extendv2hiv2di2"
@@ -6328,9 +9206,10 @@
(parallel [(const_int 0)
(const_int 1)]))))]
"TARGET_SSE4_1"
- "pmovsxwq\t{%1, %0|%0, %1}"
+ "%vpmovsxwq\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "sse4_1_extendv2siv2di2"
@@ -6341,9 +9220,10 @@
(parallel [(const_int 0)
(const_int 1)]))))]
"TARGET_SSE4_1"
- "pmovsxdq\t{%1, %0|%0, %1}"
+ "%vpmovsxdq\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "*sse4_1_extendv2siv2di2"
@@ -6355,9 +9235,10 @@
(parallel [(const_int 0)
(const_int 1)]))))]
"TARGET_SSE4_1"
- "pmovsxdq\t{%1, %0|%0, %1}"
+ "%vpmovsxdq\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "sse4_1_zero_extendv8qiv8hi2"
@@ -6374,9 +9255,10 @@
(const_int 6)
(const_int 7)]))))]
"TARGET_SSE4_1"
- "pmovzxbw\t{%1, %0|%0, %1}"
+ "%vpmovzxbw\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "*sse4_1_zero_extendv8qiv8hi2"
@@ -6394,9 +9276,10 @@
(const_int 6)
(const_int 7)]))))]
"TARGET_SSE4_1"
- "pmovzxbw\t{%1, %0|%0, %1}"
+ "%vpmovzxbw\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "sse4_1_zero_extendv4qiv4si2"
@@ -6409,9 +9292,10 @@
(const_int 2)
(const_int 3)]))))]
"TARGET_SSE4_1"
- "pmovzxbd\t{%1, %0|%0, %1}"
+ "%vpmovzxbd\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "*sse4_1_zero_extendv4qiv4si2"
@@ -6425,9 +9309,10 @@
(const_int 2)
(const_int 3)]))))]
"TARGET_SSE4_1"
- "pmovzxbd\t{%1, %0|%0, %1}"
+ "%vpmovzxbd\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "sse4_1_zero_extendv2qiv2di2"
@@ -6438,9 +9323,10 @@
(parallel [(const_int 0)
(const_int 1)]))))]
"TARGET_SSE4_1"
- "pmovzxbq\t{%1, %0|%0, %1}"
+ "%vpmovzxbq\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "*sse4_1_zero_extendv2qiv2di2"
@@ -6452,9 +9338,10 @@
(parallel [(const_int 0)
(const_int 1)]))))]
"TARGET_SSE4_1"
- "pmovzxbq\t{%1, %0|%0, %1}"
+ "%vpmovzxbq\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "sse4_1_zero_extendv4hiv4si2"
@@ -6467,9 +9354,10 @@
(const_int 2)
(const_int 3)]))))]
"TARGET_SSE4_1"
- "pmovzxwd\t{%1, %0|%0, %1}"
+ "%vpmovzxwd\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "*sse4_1_zero_extendv4hiv4si2"
@@ -6483,9 +9371,10 @@
(const_int 2)
(const_int 3)]))))]
"TARGET_SSE4_1"
- "pmovzxwd\t{%1, %0|%0, %1}"
+ "%vpmovzxwd\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "sse4_1_zero_extendv2hiv2di2"
@@ -6496,9 +9385,10 @@
(parallel [(const_int 0)
(const_int 1)]))))]
"TARGET_SSE4_1"
- "pmovzxwq\t{%1, %0|%0, %1}"
+ "%vpmovzxwq\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "*sse4_1_zero_extendv2hiv2di2"
@@ -6510,9 +9400,10 @@
(parallel [(const_int 0)
(const_int 1)]))))]
"TARGET_SSE4_1"
- "pmovzxwq\t{%1, %0|%0, %1}"
+ "%vpmovzxwq\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "sse4_1_zero_extendv2siv2di2"
@@ -6523,9 +9414,10 @@
(parallel [(const_int 0)
(const_int 1)]))))]
"TARGET_SSE4_1"
- "pmovzxdq\t{%1, %0|%0, %1}"
+ "%vpmovzxdq\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "*sse4_1_zero_extendv2siv2di2"
@@ -6537,24 +9429,62 @@
(parallel [(const_int 0)
(const_int 1)]))))]
"TARGET_SSE4_1"
- "pmovzxdq\t{%1, %0|%0, %1}"
+ "%vpmovzxdq\t{%1, %0|%0, %1}"
[(set_attr "type" "ssemov")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
+;; ptestps/ptestpd are very similar to comiss and ucomiss when
+;; setting FLAGS_REG. But it is not a really compare instruction.
+(define_insn "avx_vtestp<avxmodesuffixf2c><avxmodesuffix>"
+ [(set (reg:CC FLAGS_REG)
+ (unspec:CC [(match_operand:AVXMODEF2P 0 "register_operand" "x")
+ (match_operand:AVXMODEF2P 1 "nonimmediate_operand" "xm")]
+ UNSPEC_VTESTP))]
+ "TARGET_AVX"
+ "vtestp<avxmodesuffixf2c>\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecomi")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<MODE>")])
+
;; ptest is very similar to comiss and ucomiss when setting FLAGS_REG.
;; But it is not a really compare instruction.
+(define_insn "avx_ptest256"
+ [(set (reg:CC FLAGS_REG)
+ (unspec:CC [(match_operand:V4DI 0 "register_operand" "x")
+ (match_operand:V4DI 1 "nonimmediate_operand" "xm")]
+ UNSPEC_PTEST))]
+ "TARGET_AVX"
+ "vptest\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssecomi")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "OI")])
+
(define_insn "sse4_1_ptest"
[(set (reg:CC FLAGS_REG)
(unspec:CC [(match_operand:V2DI 0 "register_operand" "x")
(match_operand:V2DI 1 "nonimmediate_operand" "xm")]
UNSPEC_PTEST))]
"TARGET_SSE4_1"
- "ptest\t{%1, %0|%0, %1}"
+ "%vptest\t{%1, %0|%0, %1}"
[(set_attr "type" "ssecomi")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
+(define_insn "avx_roundp<avxmodesuffixf2c>256"
+ [(set (match_operand:AVX256MODEF2P 0 "register_operand" "=x")
+ (unspec:AVX256MODEF2P
+ [(match_operand:AVX256MODEF2P 1 "nonimmediate_operand" "xm")
+ (match_operand:SI 2 "const_0_to_15_operand" "n")]
+ UNSPEC_ROUND))]
+ "TARGET_AVX"
+ "vroundp<avxmodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<MODE>")])
+
(define_insn "sse4_1_roundp<ssemodesuffixf2c>"
[(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
(unspec:SSEMODEF2P
@@ -6562,9 +9492,25 @@
(match_operand:SI 2 "const_0_to_15_operand" "n")]
UNSPEC_ROUND))]
"TARGET_ROUND"
- "roundp<ssemodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ "%vroundp<ssemodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "ssecvt")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
+ (set_attr "mode" "<MODE>")])
+
+(define_insn "*avx_rounds<ssemodesuffixf2c>"
+ [(set (match_operand:SSEMODEF2P 0 "register_operand" "=x")
+ (vec_merge:SSEMODEF2P
+ (unspec:SSEMODEF2P
+ [(match_operand:SSEMODEF2P 2 "register_operand" "x")
+ (match_operand:SI 3 "const_0_to_15_operand" "n")]
+ UNSPEC_ROUND)
+ (match_operand:SSEMODEF2P 1 "register_operand" "x")
+ (const_int 1)))]
+ "TARGET_AVX"
+ "vrounds<ssemodesuffixf2c>\t{%3, %2, %1, %0|%0, %1, %2, %3}"
+ [(set_attr "type" "ssecvt")
+ (set_attr "prefix" "vex")
(set_attr "mode" "<MODE>")])
(define_insn "sse4_1_rounds<ssemodesuffixf2c>"
@@ -6662,10 +9608,11 @@
(match_dup 5)]
UNSPEC_PCMPESTR))]
"TARGET_SSE4_2"
- "pcmpestri\t{%5, %3, %1|%1, %3, %5}"
+ "%vpcmpestri\t{%5, %3, %1|%1, %3, %5}"
[(set_attr "type" "sselog")
(set_attr "prefix_data16" "1")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "memory" "none,load")
(set_attr "mode" "TI")])
@@ -6687,10 +9634,11 @@
(match_dup 5)]
UNSPEC_PCMPESTR))]
"TARGET_SSE4_2"
- "pcmpestrm\t{%5, %3, %1|%1, %3, %5}"
+ "%vpcmpestrm\t{%5, %3, %1|%1, %3, %5}"
[(set_attr "type" "sselog")
(set_attr "prefix_data16" "1")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "memory" "none,load")
(set_attr "mode" "TI")])
@@ -6707,14 +9655,15 @@
(clobber (match_scratch:SI 1 "= X, X,c,c"))]
"TARGET_SSE4_2"
"@
- pcmpestrm\t{%6, %4, %2|%2, %4, %6}
- pcmpestrm\t{%6, %4, %2|%2, %4, %6}
- pcmpestri\t{%6, %4, %2|%2, %4, %6}
- pcmpestri\t{%6, %4, %2|%2, %4, %6}"
+ %vpcmpestrm\t{%6, %4, %2|%2, %4, %6}
+ %vpcmpestrm\t{%6, %4, %2|%2, %4, %6}
+ %vpcmpestri\t{%6, %4, %2|%2, %4, %6}
+ %vpcmpestri\t{%6, %4, %2|%2, %4, %6}"
[(set_attr "type" "sselog")
(set_attr "prefix_data16" "1")
(set_attr "prefix_extra" "1")
(set_attr "memory" "none,load,none,load")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn_and_split "sse4_2_pcmpistr"
@@ -6778,10 +9727,11 @@
(match_dup 3)]
UNSPEC_PCMPISTR))]
"TARGET_SSE4_2"
- "pcmpistri\t{%3, %2, %1|%1, %2, %3}"
+ "%vpcmpistri\t{%3, %2, %1|%1, %2, %3}"
[(set_attr "type" "sselog")
(set_attr "prefix_data16" "1")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "memory" "none,load")
(set_attr "mode" "TI")])
@@ -6799,10 +9749,11 @@
(match_dup 3)]
UNSPEC_PCMPISTR))]
"TARGET_SSE4_2"
- "pcmpistrm\t{%3, %2, %1|%1, %2, %3}"
+ "%vpcmpistrm\t{%3, %2, %1|%1, %2, %3}"
[(set_attr "type" "sselog")
(set_attr "prefix_data16" "1")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "memory" "none,load")
(set_attr "mode" "TI")])
@@ -6817,14 +9768,15 @@
(clobber (match_scratch:SI 1 "= X, X,c,c"))]
"TARGET_SSE4_2"
"@
- pcmpistrm\t{%4, %3, %2|%2, %3, %4}
- pcmpistrm\t{%4, %3, %2|%2, %3, %4}
- pcmpistri\t{%4, %3, %2|%2, %3, %4}
- pcmpistri\t{%4, %3, %2|%2, %3, %4}"
+ %vpcmpistrm\t{%4, %3, %2|%2, %3, %4}
+ %vpcmpistrm\t{%4, %3, %2|%2, %3, %4}
+ %vpcmpistri\t{%4, %3, %2|%2, %3, %4}
+ %vpcmpistri\t{%4, %3, %2|%2, %3, %4}"
[(set_attr "type" "sselog")
(set_attr "prefix_data16" "1")
(set_attr "prefix_extra" "1")
(set_attr "memory" "none,load,none,load")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -8423,6 +11375,17 @@
[(set_attr "type" "ssecmp")
(set_attr "mode" "TI")])
+(define_insn "*avx_aesenc"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (unspec:V2DI [(match_operand:V2DI 1 "register_operand" "x")
+ (match_operand:V2DI 2 "nonimmediate_operand" "xm")]
+ UNSPEC_AESENC))]
+ "TARGET_AES && TARGET_AVX"
+ "vaesenc\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog1")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "aesenc"
[(set (match_operand:V2DI 0 "register_operand" "=x")
(unspec:V2DI [(match_operand:V2DI 1 "register_operand" "0")
@@ -8434,6 +11397,17 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "TI")])
+(define_insn "*avx_aesenclast"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (unspec:V2DI [(match_operand:V2DI 1 "register_operand" "x")
+ (match_operand:V2DI 2 "nonimmediate_operand" "xm")]
+ UNSPEC_AESENCLAST))]
+ "TARGET_AES && TARGET_AVX"
+ "vaesenclast\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog1")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "aesenclast"
[(set (match_operand:V2DI 0 "register_operand" "=x")
(unspec:V2DI [(match_operand:V2DI 1 "register_operand" "0")
@@ -8445,6 +11419,17 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "TI")])
+(define_insn "*avx_aesdec"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (unspec:V2DI [(match_operand:V2DI 1 "register_operand" "x")
+ (match_operand:V2DI 2 "nonimmediate_operand" "xm")]
+ UNSPEC_AESDEC))]
+ "TARGET_AES && TARGET_AVX"
+ "vaesdec\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog1")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "aesdec"
[(set (match_operand:V2DI 0 "register_operand" "=x")
(unspec:V2DI [(match_operand:V2DI 1 "register_operand" "0")
@@ -8456,6 +11441,17 @@
(set_attr "prefix_extra" "1")
(set_attr "mode" "TI")])
+(define_insn "*avx_aesdeclast"
+ [(set (match_operand:V2DI 0 "register_operand" "=x")
+ (unspec:V2DI [(match_operand:V2DI 1 "register_operand" "x")
+ (match_operand:V2DI 2 "nonimmediate_operand" "xm")]
+ UNSPEC_AESDECLAST))]
+ "TARGET_AES && TARGET_AVX"
+ "vaesdeclast\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog1")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "TI")])
+
(define_insn "aesdeclast"
[(set (match_operand:V2DI 0 "register_operand" "=x")
(unspec:V2DI [(match_operand:V2DI 1 "register_operand" "0")
@@ -8472,9 +11468,10 @@
(unspec:V2DI [(match_operand:V2DI 1 "nonimmediate_operand" "xm")]
UNSPEC_AESIMC))]
"TARGET_AES"
- "aesimc\t{%1, %0|%0, %1}"
+ "%vaesimc\t{%1, %0|%0, %1}"
[(set_attr "type" "sselog1")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "aeskeygenassist"
@@ -8483,9 +11480,10 @@
(match_operand:SI 2 "const_0_to_255_operand" "n")]
UNSPEC_AESKEYGENASSIST))]
"TARGET_AES"
- "aeskeygenassist\t{%2, %1, %0|%0, %1, %2}"
+ "%vaeskeygenassist\t{%2, %1, %0|%0, %1, %2}"
[(set_attr "type" "sselog1")
(set_attr "prefix_extra" "1")
+ (set_attr "prefix" "maybe_vex")
(set_attr "mode" "TI")])
(define_insn "pclmulqdq"
@@ -8499,3 +11497,463 @@
[(set_attr "type" "sselog1")
(set_attr "prefix_extra" "1")
(set_attr "mode" "TI")])
+
+(define_expand "avx_vzeroall"
+ [(match_par_dup 0 [(const_int 0)])]
+ "TARGET_AVX"
+{
+ int nregs = TARGET_64BIT ? 16 : 8;
+ int regno;
+
+ operands[0] = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (nregs + 1));
+
+ XVECEXP (operands[0], 0, 0)
+ = gen_rtx_UNSPEC_VOLATILE (VOIDmode, gen_rtvec (1, const0_rtx),
+ UNSPECV_VZEROALL);
+
+ for (regno = 0; regno < nregs; regno++)
+ XVECEXP (operands[0], 0, regno + 1)
+ = gen_rtx_SET (VOIDmode,
+ gen_rtx_REG (V8SImode, SSE_REGNO (regno)),
+ CONST0_RTX (V8SImode));
+})
+
+(define_insn "*avx_vzeroall"
+ [(match_parallel 0 "vzeroall_operation"
+ [(unspec_volatile [(const_int 0)] UNSPECV_VZEROALL)
+ (set (match_operand 1 "register_operand" "=x")
+ (match_operand 2 "const0_operand" "X"))])]
+ "TARGET_AVX"
+ "vzeroall"
+ [(set_attr "type" "sse")
+ (set_attr "memory" "none")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "OI")])
+
+;; vzeroupper clobbers the upper 128bits of AVX registers.
+(define_insn "avx_vzeroupper"
+ [(unspec_volatile [(const_int 0)] UNSPECV_VZEROUPPER)
+ (clobber (reg:V8SI XMM0_REG))
+ (clobber (reg:V8SI XMM1_REG))
+ (clobber (reg:V8SI XMM2_REG))
+ (clobber (reg:V8SI XMM3_REG))
+ (clobber (reg:V8SI XMM4_REG))
+ (clobber (reg:V8SI XMM5_REG))
+ (clobber (reg:V8SI XMM6_REG))
+ (clobber (reg:V8SI XMM7_REG))]
+ "TARGET_AVX && !TARGET_64BIT"
+ "vzeroupper"
+ [(set_attr "type" "sse")
+ (set_attr "memory" "none")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "OI")])
+
+(define_insn "avx_vzeroupper_rex64"
+ [(unspec_volatile [(const_int 0)] UNSPECV_VZEROUPPER)
+ (clobber (reg:V8SI XMM0_REG))
+ (clobber (reg:V8SI XMM1_REG))
+ (clobber (reg:V8SI XMM2_REG))
+ (clobber (reg:V8SI XMM3_REG))
+ (clobber (reg:V8SI XMM4_REG))
+ (clobber (reg:V8SI XMM5_REG))
+ (clobber (reg:V8SI XMM6_REG))
+ (clobber (reg:V8SI XMM7_REG))
+ (clobber (reg:V8SI XMM8_REG))
+ (clobber (reg:V8SI XMM9_REG))
+ (clobber (reg:V8SI XMM10_REG))
+ (clobber (reg:V8SI XMM11_REG))
+ (clobber (reg:V8SI XMM12_REG))
+ (clobber (reg:V8SI XMM13_REG))
+ (clobber (reg:V8SI XMM14_REG))
+ (clobber (reg:V8SI XMM15_REG))]
+ "TARGET_AVX && TARGET_64BIT"
+ "vzeroupper"
+ [(set_attr "type" "sse")
+ (set_attr "memory" "none")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "OI")])
+
+(define_insn "avx_vpermil<mode>"
+ [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
+ (unspec:AVXMODEF2P
+ [(match_operand:AVXMODEF2P 1 "register_operand" "xm")
+ (match_operand:SI 2 "const_0_to_<vpermilbits>_operand" "n")]
+ UNSPEC_VPERMIL))]
+ "TARGET_AVX"
+ "vpermilp<avxmodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<MODE>")])
+
+(define_insn "avx_vpermilvar<mode>3"
+ [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
+ (unspec:AVXMODEF2P
+ [(match_operand:AVXMODEF2P 1 "register_operand" "x")
+ (match_operand:<avxpermvecmode> 2 "nonimmediate_operand" "xm")]
+ UNSPEC_VPERMIL))]
+ "TARGET_AVX"
+ "vpermilp<avxmodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<MODE>")])
+
+(define_insn "avx_vpermil2<mode>3"
+ [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x,x")
+ (unspec:AVXMODEF2P
+ [(match_operand:AVXMODEF2P 1 "register_operand" "x,x")
+ (match_operand:AVXMODEF2P 2 "nonimmediate_operand" "x,xm")
+ (match_operand:<avxpermvecmode> 3 "nonimmediate_operand" "xm,x")
+ (match_operand:SI 4 "const_0_to_3_operand" "n,n")]
+ UNSPEC_VPERMIL2))]
+ "TARGET_AVX"
+ "vpermil2p<avxmodesuffixf2c>\t{%4, %3, %2, %1, %0|%0, %1, %2, %3, %4}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<MODE>")])
+
+(define_insn "avx_vperm2f128<mode>3"
+ [(set (match_operand:AVX256MODE2P 0 "register_operand" "=x")
+ (unspec:AVX256MODE2P
+ [(match_operand:AVX256MODE2P 1 "register_operand" "x")
+ (match_operand:AVX256MODE2P 2 "nonimmediate_operand" "xm")
+ (match_operand:SI 3 "const_0_to_255_operand" "n")]
+ UNSPEC_VPERMIL2F128))]
+ "TARGET_AVX"
+ "vperm2f128\t{%3, %2, %1, %0|%0, %1, %2, %3}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "avx_vbroadcasts<avxmodesuffixf2c><avxmodesuffix>"
+ [(set (match_operand:AVXMODEF4P 0 "register_operand" "=x")
+ (vec_concat:AVXMODEF4P
+ (vec_concat:<avxhalfvecmode>
+ (match_operand:<avxscalarmode> 1 "memory_operand" "m")
+ (match_dup 1))
+ (vec_concat:<avxhalfvecmode>
+ (match_dup 1)
+ (match_dup 1))))]
+ "TARGET_AVX"
+ "vbroadcasts<avxmodesuffixf2c>\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxscalarmode>")])
+
+(define_insn "avx_vbroadcastss256"
+ [(set (match_operand:V8SF 0 "register_operand" "=x")
+ (vec_concat:V8SF
+ (vec_concat:V4SF
+ (vec_concat:V2SF
+ (match_operand:SF 1 "memory_operand" "m")
+ (match_dup 1))
+ (vec_concat:V2SF
+ (match_dup 1)
+ (match_dup 1)))
+ (vec_concat:V4SF
+ (vec_concat:V2SF
+ (match_dup 1)
+ (match_dup 1))
+ (vec_concat:V2SF
+ (match_dup 1)
+ (match_dup 1)))))]
+ "TARGET_AVX"
+ "vbroadcastss\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "SF")])
+
+(define_insn "avx_vbroadcastf128_p<avxmodesuffixf2c>256"
+ [(set (match_operand:AVX256MODEF2P 0 "register_operand" "=x")
+ (vec_concat:AVX256MODEF2P
+ (match_operand:<avxhalfvecmode> 1 "memory_operand" "m")
+ (match_dup 1)))]
+ "TARGET_AVX"
+ "vbroadcastf128\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V4SF")])
+
+(define_expand "avx_vinsertf128<mode>"
+ [(match_operand:AVX256MODE 0 "register_operand" "")
+ (match_operand:AVX256MODE 1 "register_operand" "")
+ (match_operand:<avxhalfvecmode> 2 "nonimmediate_operand" "")
+ (match_operand:SI 3 "const_0_to_1_operand" "")]
+ "TARGET_AVX"
+{
+ switch (INTVAL (operands[3]))
+ {
+ case 0:
+ emit_insn (gen_vec_set_lo_<mode> (operands[0], operands[1],
+ operands[2]));
+ break;
+ case 1:
+ emit_insn (gen_vec_set_hi_<mode> (operands[0], operands[1],
+ operands[2]));
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ DONE;
+})
+
+(define_insn "vec_set_lo_<mode>"
+ [(set (match_operand:AVX256MODE4P 0 "register_operand" "=x")
+ (vec_concat:AVX256MODE4P
+ (match_operand:<avxhalfvecmode> 2 "nonimmediate_operand" "xm")
+ (vec_select:<avxhalfvecmode>
+ (match_operand:AVX256MODE4P 1 "register_operand" "x")
+ (parallel [(const_int 2) (const_int 3)]))))]
+ "TARGET_AVX"
+ "vinsertf128\t{$0x0, %2, %1, %0|%0, %1, %2, 0x0}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "vec_set_hi_<mode>"
+ [(set (match_operand:AVX256MODE4P 0 "register_operand" "=x")
+ (vec_concat:AVX256MODE4P
+ (vec_select:<avxhalfvecmode>
+ (match_operand:AVX256MODE4P 1 "register_operand" "x")
+ (parallel [(const_int 0) (const_int 1)]))
+ (match_operand:<avxhalfvecmode> 2 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX"
+ "vinsertf128\t{$0x1, %2, %1, %0|%0, %1, %2, 0x1}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "vec_set_lo_<mode>"
+ [(set (match_operand:AVX256MODE8P 0 "register_operand" "=x")
+ (vec_concat:AVX256MODE8P
+ (match_operand:<avxhalfvecmode> 2 "nonimmediate_operand" "xm")
+ (vec_select:<avxhalfvecmode>
+ (match_operand:AVX256MODE8P 1 "register_operand" "x")
+ (parallel [(const_int 4) (const_int 5)
+ (const_int 6) (const_int 7)]))))]
+ "TARGET_AVX"
+ "vinsertf128\t{$0x0, %2, %1, %0|%0, %1, %2, 0x0}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "vec_set_hi_<mode>"
+ [(set (match_operand:AVX256MODE8P 0 "register_operand" "=x")
+ (vec_concat:AVX256MODE8P
+ (vec_select:<avxhalfvecmode>
+ (match_operand:AVX256MODE8P 1 "register_operand" "x")
+ (parallel [(const_int 0) (const_int 1)
+ (const_int 2) (const_int 3)]))
+ (match_operand:<avxhalfvecmode> 2 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX"
+ "vinsertf128\t{$0x1, %2, %1, %0|%0, %1, %2, 0x1}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "vec_set_lo_v16hi"
+ [(set (match_operand:V16HI 0 "register_operand" "=x")
+ (vec_concat:V16HI
+ (match_operand:V8HI 2 "nonimmediate_operand" "xm")
+ (vec_select:V8HI
+ (match_operand:V16HI 1 "register_operand" "x")
+ (parallel [(const_int 8) (const_int 9)
+ (const_int 10) (const_int 11)
+ (const_int 12) (const_int 13)
+ (const_int 14) (const_int 15)]))))]
+ "TARGET_AVX"
+ "vinsertf128\t{$0x0, %2, %1, %0|%0, %1, %2, 0x0}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "vec_set_hi_v16hi"
+ [(set (match_operand:V16HI 0 "register_operand" "=x")
+ (vec_concat:V16HI
+ (vec_select:V8HI
+ (match_operand:V16HI 1 "register_operand" "x")
+ (parallel [(const_int 0) (const_int 1)
+ (const_int 2) (const_int 3)
+ (const_int 4) (const_int 5)
+ (const_int 6) (const_int 7)]))
+ (match_operand:V8HI 2 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX"
+ "vinsertf128\t{$0x1, %2, %1, %0|%0, %1, %2, 0x1}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "vec_set_lo_v32qi"
+ [(set (match_operand:V32QI 0 "register_operand" "=x")
+ (vec_concat:V32QI
+ (match_operand:V16QI 2 "nonimmediate_operand" "xm")
+ (vec_select:V16QI
+ (match_operand:V32QI 1 "register_operand" "x")
+ (parallel [(const_int 16) (const_int 17)
+ (const_int 18) (const_int 19)
+ (const_int 20) (const_int 21)
+ (const_int 22) (const_int 23)
+ (const_int 24) (const_int 25)
+ (const_int 26) (const_int 27)
+ (const_int 28) (const_int 29)
+ (const_int 30) (const_int 31)]))))]
+ "TARGET_AVX"
+ "vinsertf128\t{$0x0, %2, %1, %0|%0, %1, %2, 0x0}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "vec_set_hi_v32qi"
+ [(set (match_operand:V32QI 0 "register_operand" "=x")
+ (vec_concat:V32QI
+ (vec_select:V16QI
+ (match_operand:V32QI 1 "register_operand" "x")
+ (parallel [(const_int 0) (const_int 1)
+ (const_int 2) (const_int 3)
+ (const_int 4) (const_int 5)
+ (const_int 6) (const_int 7)
+ (const_int 8) (const_int 9)
+ (const_int 10) (const_int 11)
+ (const_int 12) (const_int 13)
+ (const_int 14) (const_int 15)]))
+ (match_operand:V16QI 2 "nonimmediate_operand" "xm")))]
+ "TARGET_AVX"
+ "vinsertf128\t{$0x1, %2, %1, %0|%0, %1, %2, 0x1}"
+ [(set_attr "type" "sselog")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "V8SF")])
+
+(define_insn "avx_maskloadp<avxmodesuffixf2c><avxmodesuffix>"
+ [(set (match_operand:AVXMODEF2P 0 "register_operand" "=x")
+ (unspec:AVXMODEF2P
+ [(match_operand:AVXMODEF2P 1 "memory_operand" "m")
+ (match_operand:AVXMODEF2P 2 "register_operand" "x")
+ (match_dup 0)]
+ UNSPEC_MASKLOAD))]
+ "TARGET_AVX"
+ "vmaskmovp<avxmodesuffixf2c>\t{%1, %2, %0|%0, %2, %1}"
+ [(set_attr "type" "sselog1")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<MODE>")])
+
+(define_insn "avx_maskstorep<avxmodesuffixf2c><avxmodesuffix>"
+ [(set (match_operand:AVXMODEF2P 0 "memory_operand" "=m")
+ (unspec:AVXMODEF2P
+ [(match_operand:AVXMODEF2P 1 "register_operand" "x")
+ (match_operand:AVXMODEF2P 2 "register_operand" "x")
+ (match_dup 0)]
+ UNSPEC_MASKSTORE))]
+ "TARGET_AVX"
+ "vmaskmovp<avxmodesuffixf2c>\t{%2, %1, %0|%0, %1, %2}"
+ [(set_attr "type" "sselog1")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<MODE>")])
+
+(define_insn "avx_<avxmodesuffixp><avxmodesuffix>_<avxmodesuffixp>"
+ [(set (match_operand:AVX256MODE2P 0 "register_operand" "=x,x")
+ (unspec:AVX256MODE2P
+ [(match_operand:<avxhalfvecmode> 1 "nonimmediate_operand" "0,xm")]
+ UNSPEC_CAST))]
+ "TARGET_AVX"
+{
+ switch (which_alternative)
+ {
+ case 0:
+ return "";
+ case 1:
+ switch (get_attr_mode (insn))
+ {
+ case MODE_V8SF:
+ return "vmovaps\t{%1, %x0|%x0, %1}";
+ case MODE_V4DF:
+ return "vmovapd\t{%1, %x0|%x0, %1}";
+ case MODE_OI:
+ return "vmovdqa\t{%1, %x0|%x0, %1}";
+ default:
+ break;
+ }
+ default:
+ break;
+ }
+ gcc_unreachable ();
+}
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")
+ (set (attr "length")
+ (if_then_else (eq_attr "alternative" "0")
+ (const_string "0")
+ (const_string "*")))])
+
+(define_insn "avx_<avxmodesuffixp>_<avxmodesuffixp><avxmodesuffix>"
+ [(set (match_operand:<avxhalfvecmode> 0 "register_operand" "=x,x")
+ (unspec:<avxhalfvecmode>
+ [(match_operand:AVX256MODE2P 1 "nonimmediate_operand" "0,xm")]
+ UNSPEC_CAST))]
+ "TARGET_AVX"
+{
+ switch (which_alternative)
+ {
+ case 0:
+ return "";
+ case 1:
+ switch (get_attr_mode (insn))
+ {
+ case MODE_V8SF:
+ return "vmovaps\t{%x1, %0|%0, %x1}";
+ case MODE_V4DF:
+ return "vmovapd\t{%x1, %0|%0, %x1}";
+ case MODE_OI:
+ return "vmovdqa\t{%x1, %0|%0, %x1}";
+ default:
+ break;
+ }
+ default:
+ break;
+ }
+ gcc_unreachable ();
+}
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")
+ (set (attr "length")
+ (if_then_else (eq_attr "alternative" "0")
+ (const_string "0")
+ (const_string "*")))])
+
+(define_expand "vec_init<mode>"
+ [(match_operand:AVX256MODE 0 "register_operand" "")
+ (match_operand 1 "" "")]
+ "TARGET_AVX"
+{
+ ix86_expand_vector_init (false, operands[0], operands[1]);
+ DONE;
+})
+
+(define_insn "*vec_concat<mode>_avx"
+ [(set (match_operand:AVX256MODE 0 "register_operand" "=x,x")
+ (vec_concat:AVX256MODE
+ (match_operand:<avxhalfvecmode> 1 "register_operand" "x,x")
+ (match_operand:<avxhalfvecmode> 2 "vector_move_operand" "xm,C")))]
+ "TARGET_AVX"
+{
+ switch (which_alternative)
+ {
+ case 0:
+ return "vinsertf128\t{$0x1, %2, %t1, %0|%0, %t1, %2, 0x1}";
+ case 1:
+ switch (get_attr_mode (insn))
+ {
+ case MODE_V8SF:
+ return "vmovaps\t{%1, %x0|%x0, %1}";
+ case MODE_V4DF:
+ return "vmovapd\t{%1, %x0|%x0, %1}";
+ default:
+ return "vmovdqa\t{%1, %x0|%x0, %1}";
+ }
+ default:
+ gcc_unreachable ();
+ }
+}
+ [(set_attr "type" "sselog,ssemov")
+ (set_attr "prefix" "vex")
+ (set_attr "mode" "<avxvecmode>")])
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 e93ae31b0bd..d9100e8d40b 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -50,7 +50,7 @@ along with GCC; see the file COPYING3. If not see
#include "hashtab.h"
#include "langhooks.h"
#include "cfglayout.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "intl.h"
#include "df.h"
#include "debug.h"
@@ -275,7 +275,7 @@ static tree ia64_handle_model_attribute (tree *, tree, tree, int, bool *);
static tree ia64_handle_version_id_attribute (tree *, tree, tree, int, bool *);
static void ia64_encode_section_info (tree, rtx, int);
static rtx ia64_struct_value_rtx (tree, int);
-static tree ia64_gimplify_va_arg (tree, tree, tree *, tree *);
+static tree ia64_gimplify_va_arg (tree, tree, gimple_seq *, gimple_seq *);
static bool ia64_scalar_mode_supported_p (enum machine_mode mode);
static bool ia64_vector_mode_supported_p (enum machine_mode mode);
static bool ia64_cannot_force_const_mem (rtx);
@@ -4336,7 +4336,8 @@ ia64_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
/* Implement va_arg. */
static tree
-ia64_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
+ia64_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
+ gimple_seq *post_p)
{
/* Variable sized types are passed by reference. */
if (pass_by_reference (NULL, TYPE_MODE (type), type, false))
@@ -4359,8 +4360,7 @@ ia64_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
t = build2 (BIT_AND_EXPR, TREE_TYPE (t), t,
size_int (-2 * UNITS_PER_WORD));
t = fold_convert (TREE_TYPE (valist), t);
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (valist), valist, t);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (unshare_expr (valist), t, pre_p);
}
return std_gimplify_va_arg_expr (valist, type, pre_p, post_p);
@@ -4952,13 +4952,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:
@@ -4983,16 +4983,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;
@@ -5000,7 +5000,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:
@@ -5232,9 +5232,6 @@ ia64_override_options (void)
TARGET_INLINE_SQRT = INL_MAX_THR;
}
- ia64_flag_schedule_insns2 = flag_schedule_insns_after_reload;
- flag_schedule_insns_after_reload = 0;
-
ia64_section_threshold = g_switch_set ? g_switch_value : IA64_DEFAULT_GVALUE;
init_machine_status = ia64_init_machine_status;
@@ -9568,7 +9565,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;
@@ -9597,7 +9594,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);
@@ -9607,11 +9604,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)
{
@@ -9621,7 +9618,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. */
@@ -9634,7 +9631,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));
@@ -9644,7 +9641,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)
{
@@ -9662,7 +9659,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. */
@@ -9927,6 +9924,13 @@ void
ia64_optimization_options (int level ATTRIBUTE_UNUSED,
int size ATTRIBUTE_UNUSED)
{
+ /* Disable the second machine independent scheduling pass and use one for the
+ IA-64. This needs to be here instead of in OVERRIDE_OPTIONS because this
+ is done whenever the optimization is changed via #pragma GCC optimize or
+ attribute((optimize(...))). */
+ ia64_flag_schedule_insns2 = flag_schedule_insns_after_reload;
+ flag_schedule_insns_after_reload = 0;
+
/* Let the scheduler form additional regions. */
set_param_value ("max-sched-extend-regions-iters", 2);
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index 60934f2f38b..e97bcf6e934 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -800,6 +800,19 @@ enum reg_class
0xFFFFFFFF, 0xFFFFFFFF, 0x3FFF }, \
}
+/* The following macro defines cover classes for Integrated Register
+ Allocator. Cover classes is a set of non-intersected register
+ classes covering all hard registers used for register allocation
+ purpose. Any move between two registers of a cover class should be
+ cheaper than load or store of the registers. The macro value is
+ array of register classes with LIM_REG_CLASSES used as the end
+ marker. */
+
+#define IRA_COVER_CLASSES \
+{ \
+ PR_REGS, BR_REGS, AR_M_REGS, AR_I_REGS, GR_REGS, FR_REGS, LIM_REG_CLASSES \
+}
+
/* A C expression whose value is a register class containing hard register
REGNO. In general there is more than one such class; choose a class which
is "minimal", meaning that no smaller class also contains the register. */
@@ -1371,7 +1384,7 @@ do { \
many additional insn groups we run into, vs how good the dynamic
branch predictor is. */
-#define BRANCH_COST 6
+#define BRANCH_COST(speed_p, predictable_p) 6
/* Define this macro as a C expression which is nonzero if accessing less than
a word of memory (i.e. a `char' or a `short') is no faster than accessing a
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..f6c7ec5edb6 100644
--- a/gcc/config/iq2000/iq2000.h
+++ b/gcc/config/iq2000/iq2000.h
@@ -1,6 +1,7 @@
/* Definitions of target machine for GNU compiler.
Vitesse IQ2000 processors
- Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
+ Free Software Foundation, Inc.
This file is part of GCC.
@@ -128,8 +129,6 @@
#define PCC_BITFIELD_TYPE_MATTERS 1
-#define TARGET_FLOAT_FORMAT IEEE_FLOAT_FORMAT
-
/* Layout of Source Language Data Types. */
@@ -203,6 +202,11 @@ enum reg_class
#define N_REG_CLASSES (int) LIM_REG_CLASSES
+#define IRA_COVER_CLASSES \
+{ \
+ GR_REGS, LIM_REG_CLASSES \
+}
+
#define REG_CLASS_NAMES \
{ \
"NO_REGS", \
@@ -620,7 +624,7 @@ typedef struct iq2000_args
#define MEMORY_MOVE_COST(MODE,CLASS,TO_P) \
(TO_P ? 2 : 16)
-#define BRANCH_COST 2
+#define BRANCH_COST(speed_p, predictable_p) 2
#define SLOW_BYTE_ACCESS 1
diff --git a/gcc/config/m32c/m32c-protos.h b/gcc/config/m32c/m32c-protos.h
index a63191c21ab..ec98d81f93c 100644
--- a/gcc/config/m32c/m32c-protos.h
+++ b/gcc/config/m32c/m32c-protos.h
@@ -1,5 +1,5 @@
/* Target Prototypes for R8C/M16C/M32C
- Copyright (C) 2005, 2007
+ Copyright (C) 2005, 2007, 2008
Free Software Foundation, Inc.
Contributed by Red Hat.
@@ -108,7 +108,7 @@ int m32c_split_psi_p (rtx *);
#ifdef TREE_CODE
void m32c_function_arg_advance (CUMULATIVE_ARGS *, MM, tree, int);
-tree m32c_gimplify_va_arg_expr (tree, tree, tree *, tree *);
+tree m32c_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *);
void m32c_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree, int);
bool m32c_promote_function_return (const_tree);
int m32c_special_page_vector_p (tree);
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index b0733dd8364..dcd5b374f93 100644
--- a/gcc/config/m32c/m32c.c
+++ b/gcc/config/m32c/m32c.c
@@ -47,7 +47,7 @@
#include "target-def.h"
#include "tm_p.h"
#include "langhooks.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "df.h"
/* Prototypes */
@@ -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/m32r/m32r.h b/gcc/config/m32r/m32r.h
index 0c9e31853ed..f2f7e891201 100644
--- a/gcc/config/m32r/m32r.h
+++ b/gcc/config/m32r/m32r.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler, Renesas M32R cpu.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
@@ -624,6 +624,11 @@ enum reg_class
NO_REGS, CARRY_REG, ACCUM_REGS, GENERAL_REGS, ALL_REGS, LIM_REG_CLASSES
};
+#define IRA_COVER_CLASSES \
+{ \
+ ACCUM_REGS, GENERAL_REGS, LIM_REG_CLASSES \
+}
+
#define N_REG_CLASSES ((int) LIM_REG_CLASSES)
/* Give names of register classes as strings for dump file. */
@@ -1067,7 +1072,7 @@ L2: .word STATIC
#define LEGITIMATE_CONSTANT_P(X) \
(! (GET_CODE (X) == CONST \
&& GET_CODE (XEXP (X, 0)) == PLUS \
- && GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF \
+ && (GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF || GET_CODE (XEXP (XEXP (X, 0), 0)) == LABEL_REF) \
&& GET_CODE (XEXP (XEXP (X, 0), 1)) == CONST_INT \
&& (unsigned HOST_WIDE_INT) INTVAL (XEXP (XEXP (X, 0), 1)) > 32767))
@@ -1219,7 +1224,7 @@ L2: .word STATIC
/* A value of 2 here causes GCC to avoid using branches in comparisons like
while (a < N && a). Branches aren't that expensive on the M32R so
we define this as 1. Defining it as 2 had a heavy hit in fp-bit.c. */
-#define BRANCH_COST ((TARGET_BRANCH_COST) ? 2 : 1)
+#define BRANCH_COST(speed_p, predictable_p) ((TARGET_BRANCH_COST) ? 2 : 1)
/* Nonzero if access to memory by bytes is slow and undesirable.
For RISC chips, it means that access to memory by bytes is no
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/m68hc11/m68hc11.h b/gcc/config/m68hc11/m68hc11.h
index 7034c93b30e..cae57e3a9fe 100644
--- a/gcc/config/m68hc11/m68hc11.h
+++ b/gcc/config/m68hc11/m68hc11.h
@@ -1266,7 +1266,7 @@ extern unsigned char m68hc11_reg_valid_for_index[FIRST_PSEUDO_REGISTER];
Pretend branches are cheap because GCC generates sub-optimal code
for the default value. */
-#define BRANCH_COST 0
+#define BRANCH_COST(speed_p, predictable_p) 0
/* Nonzero if access to memory by bytes is slow and undesirable. */
#define SLOW_BYTE_ACCESS 0
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/mcore/mcore.h b/gcc/config/mcore/mcore.h
index 7ea9ac41fe1..6e26d5e7b35 100644
--- a/gcc/config/mcore/mcore.h
+++ b/gcc/config/mcore/mcore.h
@@ -1,7 +1,7 @@
/* Definitions of target machine for GNU compiler,
for Motorola M*CORE Processor.
- Copyright (C) 1993, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1993, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007,
+ 2008 Free Software Foundation, Inc.
This file is part of GCC.
@@ -379,6 +379,12 @@ enum reg_class
#define N_REG_CLASSES (int) LIM_REG_CLASSES
+#define IRA_COVER_CLASSES \
+{ \
+ GENERAL_REGS, C_REGS, LIM_REG_CLASSES \
+}
+
+
/* Give names of register classes as strings for dump file. */
#define REG_CLASS_NAMES \
{ \
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/driver-native.c b/gcc/config/mips/driver-native.c
index 24831c654c8..1947d719862 100644
--- a/gcc/config/mips/driver-native.c
+++ b/gcc/config/mips/driver-native.c
@@ -67,6 +67,8 @@ host_detect_local_cpu (int argc, const char **argv)
cpu = "sb1";
else if (strstr (buf, "R5000") != NULL)
cpu = "r5000";
+ else if (strstr (buf, "Octeon") != NULL)
+ cpu = "octeon";
break;
}
diff --git a/gcc/config/mips/iris6.h b/gcc/config/mips/iris6.h
index 750eaa199fa..ffd918e8aaa 100644
--- a/gcc/config/mips/iris6.h
+++ b/gcc/config/mips/iris6.h
@@ -49,8 +49,32 @@ along with GCC; see the file COPYING3. If not see
#define IRIX_SUBTARGET_LINK_SPEC \
"%{mabi=32: -melf32bsmip}%{mabi=n32: -melf32bmipn32}%{mabi=64: -melf64bmip}"
#else
+ /* Explicitly hide crt symbols that would normally be marked with
+ a "hidden" visibility attribute.
+
+ We have traditionally disabled this attribute when using the
+ native linker because the native linker's visibility support is
+ not fully-compatible with the GNU linker's. In particular, the
+ native linker does not pull in archive objects purely to resolve
+ references to the object's hidden symbols, whereas the GNU
+ linker does.
+
+ The gcc build system currently hides symbols in some static
+ libraries (typically libgcov.a or libgcc.a) whenever visibility
+ attributes are supported. On targets with GNU semantics, this
+ makes sure that uses of libx.so symbols in one dynamic object are
+ not resolved to libx.a symbols in another dynamic object. But
+ on targets with IRIX semantics, hiding the symbols prevents the
+ static archive from working at all.
+
+ It would probably be better to enable visiblity attributes for
+ IRIX ld and disable the static archives versioning. It shouldn't
+ make anything worse, since libx.a symbols are global by default
+ anyway. However, no-one has volunteered to do this yet. */
+
#define IRIX_SUBTARGET_LINK_SPEC \
"%{w} -_SYSTYPE_SVR4 -woff 131 \
+ %{shared:-hidden_symbol __dso_handle} \
%{mabi=32: -32}%{mabi=n32: -n32}%{mabi=64: -64}%{!mabi*: -n32}"
#endif
diff --git a/gcc/config/mips/irix-crti.asm b/gcc/config/mips/irix-crti.asm
index d6888bbf014..992f8b695dc 100644
--- a/gcc/config/mips/irix-crti.asm
+++ b/gcc/config/mips/irix-crti.asm
@@ -49,3 +49,10 @@ __gcc_fini:
sd $31,0($sp)
sd $28,8($sp)
#endif
+
+/* This object will typically be included in the final link for both
+ shared libraries and executable, and we need to hide the symbols to
+ prevent possible symbol preemption warnings from the SGI linker. */
+.hidden __gcc_init
+.hidden __gcc_fini
+
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 d1def425576..8a2ba16c452 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -56,7 +56,7 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "cfglayout.h"
#include "sched-int.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "bitmap.h"
#include "diagnostic.h"
@@ -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 },
@@ -646,7 +652,10 @@ static const struct mips_cpu_info mips_cpu_info_table[] = {
{ "sb1", PROCESSOR_SB1, 64, PTF_AVOID_BRANCHLIKELY },
{ "sb1a", PROCESSOR_SB1A, 64, PTF_AVOID_BRANCHLIKELY },
{ "sr71000", PROCESSOR_SR71000, 64, PTF_AVOID_BRANCHLIKELY },
- { "xlr", PROCESSOR_XLR, 64, 0 }
+ { "xlr", PROCESSOR_XLR, 64, 0 },
+
+ /* MIPS64 Release 2 processors. */
+ { "octeon", PROCESSOR_OCTEON, 65, PTF_AVOID_BRANCHLIKELY }
};
/* Default costs. If these are used for a processor we should look
@@ -846,6 +855,16 @@ static const struct mips_rtx_cost_data mips_rtx_cost_data[PROCESSOR_MAX] = {
{ /* M4k */
DEFAULT_COSTS
},
+ /* Octeon */
+ {
+ SOFT_FP_COSTS,
+ COSTS_N_INSNS (5), /* int_mult_si */
+ COSTS_N_INSNS (5), /* int_mult_di */
+ COSTS_N_INSNS (72), /* int_div_si */
+ COSTS_N_INSNS (72), /* int_div_di */
+ 1, /* branch_cost */
+ 4 /* memory_latency */
+ },
{ /* R3900 */
COSTS_N_INSNS (2), /* fp_add */
COSTS_N_INSNS (4), /* fp_mult_sf */
@@ -1340,6 +1359,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 +1392,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 +1400,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 +1455,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 +1532,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 +1820,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 +2194,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 +2209,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 +2340,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 +2376,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 +2449,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 +2468,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 +2544,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)
- {
- if (!can_create_pseudo_p ())
- {
- emit_insn (gen_load_const_gp (temp));
- high = temp;
- }
- else
- high = mips16_gp_pseudo_reg ();
- }
- else
+ 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])
{
- 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 +2650,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 +2910,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);
}
@@ -4959,12 +5156,12 @@ mips_va_start (tree valist, rtx nextarg)
if (cum->stack_words > 0)
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ovfl), t,
size_int (cum->stack_words * UNITS_PER_WORD));
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (ovfl), ovfl, t);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (ovfl), ovfl, t);
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
/* Emit code to initialize GTOP, the top of the GPR save area. */
t = make_tree (TREE_TYPE (gtop), virtual_incoming_args_rtx);
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (gtop), gtop, t);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (gtop), gtop, t);
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
/* Emit code to initialize FTOP, the top of the FPR save area.
@@ -4976,18 +5173,18 @@ mips_va_start (tree valist, rtx nextarg)
if (fpr_offset)
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ftop), t,
size_int (-fpr_offset));
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (ftop), ftop, t);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (ftop), ftop, t);
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
/* Emit code to initialize GOFF, the offset from GTOP of the
next GPR argument. */
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (goff), goff,
+ t = build2 (MODIFY_EXPR, TREE_TYPE (goff), goff,
build_int_cst (TREE_TYPE (goff), gpr_save_area_size));
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
/* Likewise emit code to initialize FOFF, the offset from FTOP
of the next FPR argument. */
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (foff), foff,
+ t = build2 (MODIFY_EXPR, TREE_TYPE (foff), foff,
build_int_cst (TREE_TYPE (foff), fpr_save_area_size));
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
@@ -5001,7 +5198,8 @@ mips_va_start (tree valist, rtx nextarg)
/* Implement TARGET_GIMPLIFY_VA_ARG_EXPR. */
static tree
-mips_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p)
+mips_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
+ gimple_seq *post_p)
{
tree addr;
bool indirect_p;
@@ -5100,8 +5298,7 @@ mips_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p)
/* [1] Emit code for: off &= -rsize. */
t = build2 (BIT_AND_EXPR, TREE_TYPE (off), off,
build_int_cst (NULL_TREE, -rsize));
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (off), off, t);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (off, t, pre_p);
}
osize = rsize;
}
@@ -5137,7 +5334,7 @@ mips_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p)
u = size_int (-osize);
t = build2 (BIT_AND_EXPR, sizetype, t, u);
t = fold_convert (TREE_TYPE (ovfl), t);
- align = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (ovfl), ovfl, t);
+ align = build2 (MODIFY_EXPR, TREE_TYPE (ovfl), ovfl, t);
}
else
align = NULL;
@@ -5168,6 +5365,153 @@ mips_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_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 +5522,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 +5640,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 +5673,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 +5730,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 +5778,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 +5808,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 +5819,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 +5841,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 +5866,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 +5921,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 +5946,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 +5955,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 +6001,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 +6025,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 +6034,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 +6688,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 +6730,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 +6748,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 +6772,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 +7241,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 +7749,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 +8269,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 +8309,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;
- (set (reg:DF R1) (float:DF (reg:SI R2)))
+ /* We need to handle the following implicit gp references:
- 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.
+ - Reload can sometimes introduce constant pool references
+ into a function that otherwise didn't need them. For example,
+ suppose we have an instruction like:
- 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;
+ (set (reg:DF R1) (float:DF (reg:SI R2)))
+
+ 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 +8357,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 +8665,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 +8702,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 +8835,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 +8885,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 +8916,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 +8930,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 +8988,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 +9002,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 +9026,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 +9164,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 +9397,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 +9420,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 +9441,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 +9484,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 +9513,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 +9540,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 +9563,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 +9602,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 +9679,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 +9693,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 +9711,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 +9730,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 +9759,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 +11927,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 +12562,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 +12656,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 +12671,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 +12686,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 +12706,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 +12719,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 +12757,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 +12841,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 +12851,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 +13243,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..e008e804781 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -50,6 +50,7 @@ enum processor_type {
PROCESSOR_LOONGSON_2E,
PROCESSOR_LOONGSON_2F,
PROCESSOR_M4K,
+ PROCESSOR_OCTEON,
PROCESSOR_R3900,
PROCESSOR_R6000,
PROCESSOR_R4000,
@@ -148,6 +149,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 +210,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 +240,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)
@@ -237,14 +254,22 @@ enum mips_code_readable_setting {
#define TARGET_MIPS5500 (mips_arch == PROCESSOR_R5500)
#define TARGET_MIPS7000 (mips_arch == PROCESSOR_R7000)
#define TARGET_MIPS9000 (mips_arch == PROCESSOR_R9000)
+#define TARGET_OCTEON (mips_arch == PROCESSOR_OCTEON)
#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 +283,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 +467,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) \
{ \
@@ -510,6 +531,10 @@ enum mips_code_readable_setting {
if (TARGET_LOONGSON_VECTORS) \
builtin_define ("__mips_loongson_vector_rev"); \
\
+ /* Historical Octeon macro. */ \
+ if (TARGET_OCTEON) \
+ builtin_define ("__OCTEON__"); \
+ \
/* Macros dependent on the C dialect. */ \
if (preprocessing_asm_p ()) \
{ \
@@ -619,7 +644,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 +699,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|march=octeon: -mips64r2} \
%{!march=*: -" MULTILIB_ISA_DEFAULT "}}"
/* A spec that infers a -mhard-float or -msoft-float setting from an
@@ -679,7 +709,7 @@ enum mips_code_readable_setting {
#define MIPS_ARCH_FLOAT_SPEC \
"%{mhard-float|msoft-float|march=mips*:; \
march=vr41*|march=m4k|march=4k*|march=24kc|march=24kec \
- |march=34kc|march=74kc|march=5kc: -msoft-float; \
+ |march=34kc|march=74kc|march=5kc|march=octeon: -msoft-float; \
march=*: -mhard-float}"
/* A spec condition that matches 32-bit options. It only works if
@@ -703,7 +733,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 +757,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,15 +774,20 @@ enum mips_code_readable_setting {
|| TARGET_MAD \
|| ISA_MIPS32 \
|| ISA_MIPS32R2 \
- || ISA_MIPS64) \
+ || ISA_MIPS64 \
+ || ISA_MIPS64R2) \
&& !TARGET_MIPS16)
+/* ISA has a three-operand multiplication instruction. */
+#define ISA_HAS_DMUL3 (TARGET_64BIT && TARGET_OCTEON)
+
/* ISA has the floating-point conditional move instructions introduced
in mips4. */
#define ISA_HAS_FP_CONDMOVE ((ISA_MIPS4 \
|| ISA_MIPS32 \
|| ISA_MIPS32R2 \
- || ISA_MIPS64) \
+ || ISA_MIPS64 \
+ || ISA_MIPS64R2) \
&& !TARGET_MIPS5500 \
&& !TARGET_MIPS16)
@@ -766,18 +803,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 +825,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 +843,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 +856,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 +897,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 +908,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 +918,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 +928,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 +981,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)
@@ -953,6 +1005,12 @@ enum mips_code_readable_setting {
(target_flags_explicit & MASK_LLSC \
? TARGET_LLSC && !TARGET_MIPS16 \
: ISA_HAS_LL_SC)
+
+/* ISA includes the bbit* instructions. */
+#define ISA_HAS_BBIT TARGET_OCTEON
+
+/* ISA includes the pop instruction. */
+#define ISA_HAS_POP TARGET_OCTEON
/* Add -G xx support. */
@@ -1033,7 +1091,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 +1102,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 +1117,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 +1272,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 +1685,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 a MIPS16 PIC function needs access to _gp, it first loads
+ the value into MIPS16_PIC_TEMP and then copies it to $gp.
-/* 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. */
+ - 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 +1757,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 +1797,6 @@ enum reg_class
#define REG_CLASS_NAMES \
{ \
"NO_REGS", \
- "M16_NA_REGS", \
"M16_REGS", \
"T_REG", \
"M16_T_REGS", \
@@ -1770,7 +1840,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 +1996,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 +2241,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 +2256,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 +2299,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 +2326,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 +2356,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 +2457,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,
@@ -2454,7 +2557,7 @@ typedef struct mips_args {
/* A C expression for the cost of a branch instruction. A value of
1 is the default; other values are interpreted relative to that. */
-#define BRANCH_COST mips_branch_cost
+#define BRANCH_COST(speed_p, predictable_p) mips_branch_cost
#define LOGICAL_OP_NON_SHORT_CIRCUIT 0
/* If defined, modifies the length assigned to instruction INSN as a
@@ -2484,7 +2587,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 +2775,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 +3323,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..0aba384144d 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)
@@ -343,6 +344,7 @@
;; slt set less than instructions
;; signext sign extend instructions
;; clz the clz and clo instructions
+;; pop the pop instruction
;; trap trap if instructions
;; imul integer multiply 2 operands
;; imul3 integer multiply 3 operands
@@ -371,7 +373,7 @@
(define_attr "type"
"unknown,branch,jump,call,load,fpload,fpidxload,store,fpstore,fpidxstore,
prefetch,prefetchx,condmove,mtc,mfc,mthilo,mfhilo,const,arith,logical,
- shift,slt,signext,clz,trap,imul,imul3,imadd,idiv,move,fmove,fadd,fmul,
+ shift,slt,signext,clz,pop,trap,imul,imul3,imadd,idiv,move,fmove,fadd,fmul,
fmadd,fdiv,frdiv,frdiv1,frdiv2,fabs,fneg,fcmp,fcvt,fsqrt,frsqrt,frsqrt1,
frsqrt2,multi,nop,ghost"
(cond [(eq_attr "jal" "!unset") (const_string "call")
@@ -478,7 +480,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)
@@ -553,7 +557,7 @@
;; Attribute describing the processor. This attribute must match exactly
;; with the processor_type enumeration in mips.h.
(define_attr "cpu"
- "r3000,4kc,4kp,5kc,5kf,20kc,24kc,24kf2_1,24kf1_1,74kc,74kf2_1,74kf1_1,74kf3_2,loongson_2e,loongson_2f,m4k,r3900,r6000,r4000,r4100,r4111,r4120,r4130,r4300,r4600,r4650,r5000,r5400,r5500,r7000,r8000,r9000,sb1,sb1a,sr71000,xlr"
+ "r3000,4kc,4kp,5kc,5kf,20kc,24kc,24kf2_1,24kf1_1,74kc,74kf2_1,74kf1_1,74kf3_2,loongson_2e,loongson_2f,m4k,octeon,r3900,r6000,r4000,r4100,r4111,r4120,r4130,r4300,r4600,r4650,r5000,r5400,r5500,r7000,r8000,r9000,sb1,sb1a,sr71000,xlr"
(const (symbol_ref "mips_tune")))
;; The type of hardware hazard associated with this instruction.
@@ -595,12 +599,12 @@
(const_string "yes")
(const_string "no")))
-;; Attribute defining whether or not we can use the branch-likely instructions
+;; Attribute defining whether or not we can use the branch-likely
+;; instructions.
(define_attr "branch_likely" "no,yes"
- (const
- (if_then_else (ne (symbol_ref "GENERATE_BRANCHLIKELY") (const_int 0))
- (const_string "yes")
- (const_string "no"))))
+ (if_then_else (ne (symbol_ref "GENERATE_BRANCHLIKELY") (const_int 0))
+ (const_string "yes")
+ (const_string "no")))
;; True if an instruction might assign to hi or lo when reloaded.
;; This is used by the TUNE_MACC_CHAINS code.
@@ -681,6 +685,13 @@
(HA "") (SA "") (DA "d")
(UHA "") (USA "") (UDA "d")])
+;; Same as d but upper-case.
+(define_mode_attr D [(SI "") (DI "D")
+ (QQ "") (HQ "") (SQ "") (DQ "D")
+ (UQQ "") (UHQ "") (USQ "") (UDQ "D")
+ (HA "") (SA "") (DA "D")
+ (UHA "") (USA "") (UDA "D")])
+
;; This attribute gives the length suffix for a sign- or zero-extension
;; instruction.
(define_mode_attr size [(QI "b") (HI "h")])
@@ -777,6 +788,9 @@
;; by swapping the operands.
(define_code_iterator swapped_fcond [ge gt unge ungt])
+;; Equality operators.
+(define_code_iterator equality_op [eq ne])
+
;; These code iterators allow the signed and unsigned scc operations to use
;; the same template.
(define_code_iterator any_gt [gt gtu])
@@ -816,6 +830,12 @@
(plus "addu")
(minus "subu")])
+;; <immediate_insn> expands to the name of the insn that implements
+;; a particular code to operate on immediate values.
+(define_code_attr immediate_insn [(ior "ori")
+ (xor "xori")
+ (and "andi")])
+
;; <fcond> is the c.cond.fmt condition associated with a particular code.
(define_code_attr fcond [(unordered "un")
(uneq "ueq")
@@ -831,15 +851,12 @@
(unge "ule")
(ungt "ult")])
-;; Atomic fetch bitwise operations.
-(define_code_iterator fetchop_bit [ior xor and])
-
-;; <immediate_insn> expands to the name of the insn that implements
-;; a particular code to operate in immediate values.
-(define_code_attr immediate_insn [(ior "ori") (xor "xori") (and "andi")])
+;; The value of the bit when the branch is taken for branch_bit patterns.
+;; Comparison is always against zero so this depends on the operator.
+(define_code_attr bbv [(eq "0") (ne "1")])
-;; Atomic HI and QI operations
-(define_code_iterator atomic_hiqi_op [plus minus ior xor and])
+;; This is the inverse value of bbv.
+(define_code_attr bbinv [(eq "1") (ne "0")])
;; .........................
;;
@@ -848,11 +865,19 @@
;; .........................
(define_delay (and (eq_attr "type" "branch")
- (eq (symbol_ref "TARGET_MIPS16") (const_int 0)))
+ (eq (symbol_ref "TARGET_MIPS16") (const_int 0))
+ (eq_attr "branch_likely" "yes"))
+ [(eq_attr "can_delay" "yes")
+ (nil)
+ (eq_attr "can_delay" "yes")])
+
+;; Branches that don't have likely variants do not annul on false.
+(define_delay (and (eq_attr "type" "branch")
+ (eq (symbol_ref "TARGET_MIPS16") (const_int 0))
+ (eq_attr "branch_likely" "no"))
[(eq_attr "can_delay" "yes")
(nil)
- (and (eq_attr "branch_likely" "yes")
- (eq_attr "can_delay" "yes"))])
+ (nil)])
(define_delay (eq_attr "type" "jump")
[(eq_attr "can_delay" "yes")
@@ -1285,35 +1310,23 @@
;; These processors have PRId values of 0x00004220 and 0x00004300,
;; respectively.
-(define_expand "mulsi3"
- [(set (match_operand:SI 0 "register_operand")
- (mult:SI (match_operand:SI 1 "register_operand")
- (match_operand:SI 2 "register_operand")))]
+(define_expand "mul<mode>3"
+ [(set (match_operand:GPR 0 "register_operand")
+ (mult:GPR (match_operand:GPR 1 "register_operand")
+ (match_operand:GPR 2 "register_operand")))]
""
{
- if (ISA_HAS_MUL3)
- emit_insn (gen_mulsi3_mult3 (operands[0], operands[1], operands[2]));
+ if (ISA_HAS_<D>MUL3)
+ emit_insn (gen_mul<mode>3_mul3 (operands[0], operands[1], operands[2]));
else if (TARGET_FIX_R4000)
- emit_insn (gen_mulsi3_r4000 (operands[0], operands[1], operands[2]));
- else
- emit_insn (gen_mulsi3_internal (operands[0], operands[1], operands[2]));
- DONE;
-})
-
-(define_expand "muldi3"
- [(set (match_operand:DI 0 "register_operand")
- (mult:DI (match_operand:DI 1 "register_operand")
- (match_operand:DI 2 "register_operand")))]
- "TARGET_64BIT"
-{
- if (TARGET_FIX_R4000)
- emit_insn (gen_muldi3_r4000 (operands[0], operands[1], operands[2]));
+ emit_insn (gen_mul<mode>3_r4000 (operands[0], operands[1], operands[2]));
else
- emit_insn (gen_muldi3_internal (operands[0], operands[1], operands[2]));
+ emit_insn
+ (gen_mul<mode>3_internal (operands[0], operands[1], operands[2]));
DONE;
})
-(define_insn "mulsi3_mult3"
+(define_insn "mulsi3_mul3"
[(set (match_operand:SI 0 "register_operand" "=d,l")
(mult:SI (match_operand:SI 1 "register_operand" "d,d")
(match_operand:SI 2 "register_operand" "d,d")))
@@ -1329,6 +1342,20 @@
[(set_attr "type" "imul3,imul")
(set_attr "mode" "SI")])
+(define_insn "muldi3_mul3"
+ [(set (match_operand:DI 0 "register_operand" "=d,l")
+ (mult:DI (match_operand:DI 1 "register_operand" "d,d")
+ (match_operand:DI 2 "register_operand" "d,d")))
+ (clobber (match_scratch:DI 3 "=l,X"))]
+ "ISA_HAS_DMUL3"
+{
+ if (which_alternative == 1)
+ return "dmult\t%1,%2";
+ return "dmul\t%0,%1,%2";
+}
+ [(set_attr "type" "imul3,imul")
+ (set_attr "mode" "DI")])
+
;; If a register gets allocated to LO, and we spill to memory, the reload
;; will include a move from LO to a GPR. Merge it into the multiplication
;; if it can set the GPR directly.
@@ -2407,6 +2434,22 @@
"<d>clz\t%0,%1"
[(set_attr "type" "clz")
(set_attr "mode" "<MODE>")])
+
+;;
+;; ...................
+;;
+;; Count number of set bits.
+;;
+;; ...................
+;;
+
+(define_insn "popcount<mode>2"
+ [(set (match_operand:GPR 0 "register_operand" "=d")
+ (popcount:GPR (match_operand:GPR 1 "register_operand" "d")))]
+ "ISA_HAS_POP"
+ "<d>pop\t%0,%1"
+ [(set_attr "type" "pop")
+ (set_attr "mode" "<MODE>")])
;;
;; ....................
@@ -3590,15 +3633,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 +3646,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 +3670,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 +3696,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 +4569,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.
@@ -4592,502 +4652,6 @@
}
[(set_attr "length" "20")])
-;; Atomic memory operations.
-
-(define_insn "memory_barrier"
- [(set (mem:BLK (scratch))
- (unspec:BLK [(const_int 0)] UNSPEC_MEMORY_BARRIER))]
- "GENERATE_SYNC"
- "%|sync%-")
-
-(define_insn "sync_compare_and_swap<mode>"
- [(set (match_operand:GPR 0 "register_operand" "=&d,&d")
- (match_operand:GPR 1 "memory_operand" "+R,R"))
- (set (match_dup 1)
- (unspec_volatile:GPR [(match_operand:GPR 2 "reg_or_0_operand" "dJ,dJ")
- (match_operand:GPR 3 "arith_operand" "I,d")]
- UNSPEC_COMPARE_AND_SWAP))]
- "GENERATE_LL_SC"
-{
- if (which_alternative == 0)
- return MIPS_COMPARE_AND_SWAP ("<d>", "li");
- else
- return MIPS_COMPARE_AND_SWAP ("<d>", "move");
-}
- [(set_attr "length" "32")])
-
-(define_expand "sync_compare_and_swap<mode>"
- [(match_operand:SHORT 0 "register_operand")
- (match_operand:SHORT 1 "memory_operand")
- (match_operand:SHORT 2 "general_operand")
- (match_operand:SHORT 3 "general_operand")]
- "GENERATE_LL_SC"
-{
- union mips_gen_fn_ptrs generator;
- generator.fn_6 = gen_compare_and_swap_12;
- mips_expand_atomic_qihi (generator,
- operands[0], operands[1], operands[2], operands[3]);
- DONE;
-})
-
-;; Helper insn for mips_expand_atomic_qihi.
-(define_insn "compare_and_swap_12"
- [(set (match_operand:SI 0 "register_operand" "=&d,&d")
- (match_operand:SI 1 "memory_operand" "+R,R"))
- (set (match_dup 1)
- (unspec_volatile:SI [(match_operand:SI 2 "register_operand" "d,d")
- (match_operand:SI 3 "register_operand" "d,d")
- (match_operand:SI 4 "reg_or_0_operand" "dJ,dJ")
- (match_operand:SI 5 "reg_or_0_operand" "d,J")]
- UNSPEC_COMPARE_AND_SWAP_12))]
- "GENERATE_LL_SC"
-{
- if (which_alternative == 0)
- return MIPS_COMPARE_AND_SWAP_12 (MIPS_COMPARE_AND_SWAP_12_NONZERO_OP);
- else
- return MIPS_COMPARE_AND_SWAP_12 (MIPS_COMPARE_AND_SWAP_12_ZERO_OP);
-}
- [(set_attr "length" "40,36")])
-
-(define_insn "sync_add<mode>"
- [(set (match_operand:GPR 0 "memory_operand" "+R,R")
- (unspec_volatile:GPR
- [(plus:GPR (match_dup 0)
- (match_operand:GPR 1 "arith_operand" "I,d"))]
- UNSPEC_SYNC_OLD_OP))]
- "GENERATE_LL_SC"
-{
- if (which_alternative == 0)
- return MIPS_SYNC_OP ("<d>", "<d>addiu");
- else
- return MIPS_SYNC_OP ("<d>", "<d>addu");
-}
- [(set_attr "length" "28")])
-
-(define_expand "sync_<optab><mode>"
- [(set (match_operand:SHORT 0 "memory_operand")
- (unspec_volatile:SHORT
- [(atomic_hiqi_op:SHORT (match_dup 0)
- (match_operand:SHORT 1 "general_operand"))]
- UNSPEC_SYNC_OLD_OP))]
- "GENERATE_LL_SC"
-{
- union mips_gen_fn_ptrs generator;
- generator.fn_4 = gen_sync_<optab>_12;
- mips_expand_atomic_qihi (generator,
- NULL, operands[0], operands[1], NULL);
- DONE;
-})
-
-;; Helper insn for sync_<optab><mode>
-(define_insn "sync_<optab>_12"
- [(set (match_operand:SI 0 "memory_operand" "+R")
- (unspec_volatile:SI
- [(match_operand:SI 1 "register_operand" "d")
- (match_operand:SI 2 "register_operand" "d")
- (atomic_hiqi_op:SI (match_dup 0)
- (match_operand:SI 3 "register_operand" "dJ"))]
- UNSPEC_SYNC_OLD_OP_12))
- (clobber (match_scratch:SI 4 "=&d"))]
- "GENERATE_LL_SC"
-{
- return MIPS_SYNC_OP_12 ("<insn>", MIPS_SYNC_OP_12_NOT_NOP);
-}
- [(set_attr "length" "40")])
-
-(define_expand "sync_old_<optab><mode>"
- [(parallel [
- (set (match_operand:SHORT 0 "register_operand")
- (match_operand:SHORT 1 "memory_operand"))
- (set (match_dup 1)
- (unspec_volatile:SHORT [(atomic_hiqi_op:SHORT
- (match_dup 1)
- (match_operand:SHORT 2 "general_operand"))]
- UNSPEC_SYNC_OLD_OP))])]
- "GENERATE_LL_SC"
-{
- union mips_gen_fn_ptrs generator;
- generator.fn_5 = gen_sync_old_<optab>_12;
- mips_expand_atomic_qihi (generator,
- operands[0], operands[1], operands[2], NULL);
- DONE;
-})
-
-;; Helper insn for sync_old_<optab><mode>
-(define_insn "sync_old_<optab>_12"
- [(set (match_operand:SI 0 "register_operand" "=&d")
- (match_operand:SI 1 "memory_operand" "+R"))
- (set (match_dup 1)
- (unspec_volatile:SI
- [(match_operand:SI 2 "register_operand" "d")
- (match_operand:SI 3 "register_operand" "d")
- (atomic_hiqi_op:SI (match_dup 0)
- (match_operand:SI 4 "register_operand" "dJ"))]
- UNSPEC_SYNC_OLD_OP_12))
- (clobber (match_scratch:SI 5 "=&d"))]
- "GENERATE_LL_SC"
-{
- return MIPS_SYNC_OLD_OP_12 ("<insn>", MIPS_SYNC_OLD_OP_12_NOT_NOP,
- MIPS_SYNC_OLD_OP_12_NOT_NOP_REG);
-}
- [(set_attr "length" "40")])
-
-(define_expand "sync_new_<optab><mode>"
- [(parallel [
- (set (match_operand:SHORT 0 "register_operand")
- (unspec_volatile:SHORT [(atomic_hiqi_op:SHORT
- (match_operand:SHORT 1 "memory_operand")
- (match_operand:SHORT 2 "general_operand"))]
- UNSPEC_SYNC_NEW_OP))
- (set (match_dup 1)
- (unspec_volatile:SHORT [(match_dup 1) (match_dup 2)]
- UNSPEC_SYNC_NEW_OP))])]
- "GENERATE_LL_SC"
-{
- union mips_gen_fn_ptrs generator;
- generator.fn_5 = gen_sync_new_<optab>_12;
- mips_expand_atomic_qihi (generator,
- operands[0], operands[1], operands[2], NULL);
- DONE;
-})
-
-;; Helper insn for sync_new_<optab><mode>
-(define_insn "sync_new_<optab>_12"
- [(set (match_operand:SI 0 "register_operand" "=&d")
- (unspec_volatile:SI
- [(match_operand:SI 1 "memory_operand" "+R")
- (match_operand:SI 2 "register_operand" "d")
- (match_operand:SI 3 "register_operand" "d")
- (atomic_hiqi_op:SI (match_dup 0)
- (match_operand:SI 4 "register_operand" "dJ"))]
- UNSPEC_SYNC_NEW_OP_12))
- (set (match_dup 1)
- (unspec_volatile:SI
- [(match_dup 1)
- (match_dup 2)
- (match_dup 3)
- (match_dup 4)] UNSPEC_SYNC_NEW_OP_12))]
- "GENERATE_LL_SC"
-{
- return MIPS_SYNC_NEW_OP_12 ("<insn>", MIPS_SYNC_NEW_OP_12_NOT_NOP);
-}
- [(set_attr "length" "40")])
-
-(define_expand "sync_nand<mode>"
- [(set (match_operand:SHORT 0 "memory_operand")
- (unspec_volatile:SHORT
- [(match_dup 0)
- (match_operand:SHORT 1 "general_operand")]
- UNSPEC_SYNC_OLD_OP))]
- "GENERATE_LL_SC"
-{
- union mips_gen_fn_ptrs generator;
- generator.fn_4 = gen_sync_nand_12;
- mips_expand_atomic_qihi (generator,
- NULL, operands[0], operands[1], NULL);
- DONE;
-})
-
-;; Helper insn for sync_nand<mode>
-(define_insn "sync_nand_12"
- [(set (match_operand:SI 0 "memory_operand" "+R")
- (unspec_volatile:SI
- [(match_operand:SI 1 "register_operand" "d")
- (match_operand:SI 2 "register_operand" "d")
- (match_dup 0)
- (match_operand:SI 3 "register_operand" "dJ")]
- UNSPEC_SYNC_OLD_OP_12))
- (clobber (match_scratch:SI 4 "=&d"))]
- "GENERATE_LL_SC"
-{
- return MIPS_SYNC_OP_12 ("and", MIPS_SYNC_OP_12_NOT_NOT);
-}
- [(set_attr "length" "44")])
-
-(define_expand "sync_old_nand<mode>"
- [(parallel [
- (set (match_operand:SHORT 0 "register_operand")
- (match_operand:SHORT 1 "memory_operand"))
- (set (match_dup 1)
- (unspec_volatile:SHORT [(match_dup 1)
- (match_operand:SHORT 2 "general_operand")]
- UNSPEC_SYNC_OLD_OP))])]
- "GENERATE_LL_SC"
-{
- union mips_gen_fn_ptrs generator;
- generator.fn_5 = gen_sync_old_nand_12;
- mips_expand_atomic_qihi (generator,
- operands[0], operands[1], operands[2], NULL);
- DONE;
-})
-
-;; Helper insn for sync_old_nand<mode>
-(define_insn "sync_old_nand_12"
- [(set (match_operand:SI 0 "register_operand" "=&d")
- (match_operand:SI 1 "memory_operand" "+R"))
- (set (match_dup 1)
- (unspec_volatile:SI
- [(match_operand:SI 2 "register_operand" "d")
- (match_operand:SI 3 "register_operand" "d")
- (match_operand:SI 4 "register_operand" "dJ")]
- UNSPEC_SYNC_OLD_OP_12))
- (clobber (match_scratch:SI 5 "=&d"))]
- "GENERATE_LL_SC"
-{
- return MIPS_SYNC_OLD_OP_12 ("and", MIPS_SYNC_OLD_OP_12_NOT_NOT,
- MIPS_SYNC_OLD_OP_12_NOT_NOT_REG);
-}
- [(set_attr "length" "44")])
-
-(define_expand "sync_new_nand<mode>"
- [(parallel [
- (set (match_operand:SHORT 0 "register_operand")
- (unspec_volatile:SHORT [(match_operand:SHORT 1 "memory_operand")
- (match_operand:SHORT 2 "general_operand")]
- UNSPEC_SYNC_NEW_OP))
- (set (match_dup 1)
- (unspec_volatile:SHORT [(match_dup 1) (match_dup 2)]
- UNSPEC_SYNC_NEW_OP))])]
- "GENERATE_LL_SC"
-{
- union mips_gen_fn_ptrs generator;
- generator.fn_5 = gen_sync_new_nand_12;
- mips_expand_atomic_qihi (generator,
- operands[0], operands[1], operands[2], NULL);
- DONE;
-})
-
-;; Helper insn for sync_new_nand<mode>
-(define_insn "sync_new_nand_12"
- [(set (match_operand:SI 0 "register_operand" "=&d")
- (unspec_volatile:SI
- [(match_operand:SI 1 "memory_operand" "+R")
- (match_operand:SI 2 "register_operand" "d")
- (match_operand:SI 3 "register_operand" "d")
- (match_operand:SI 4 "register_operand" "dJ")]
- UNSPEC_SYNC_NEW_OP_12))
- (set (match_dup 1)
- (unspec_volatile:SI
- [(match_dup 1)
- (match_dup 2)
- (match_dup 3)
- (match_dup 4)] UNSPEC_SYNC_NEW_OP_12))]
- "GENERATE_LL_SC"
-{
- return MIPS_SYNC_NEW_OP_12 ("and", MIPS_SYNC_NEW_OP_12_NOT_NOT);
-}
- [(set_attr "length" "40")])
-
-(define_insn "sync_sub<mode>"
- [(set (match_operand:GPR 0 "memory_operand" "+R")
- (unspec_volatile:GPR
- [(minus:GPR (match_dup 0)
- (match_operand:GPR 1 "register_operand" "d"))]
- UNSPEC_SYNC_OLD_OP))]
- "GENERATE_LL_SC"
-{
- return MIPS_SYNC_OP ("<d>", "<d>subu");
-}
- [(set_attr "length" "28")])
-
-(define_insn "sync_old_add<mode>"
- [(set (match_operand:GPR 0 "register_operand" "=&d,&d")
- (match_operand:GPR 1 "memory_operand" "+R,R"))
- (set (match_dup 1)
- (unspec_volatile:GPR
- [(plus:GPR (match_dup 1)
- (match_operand:GPR 2 "arith_operand" "I,d"))]
- UNSPEC_SYNC_OLD_OP))]
- "GENERATE_LL_SC"
-{
- if (which_alternative == 0)
- return MIPS_SYNC_OLD_OP ("<d>", "<d>addiu");
- else
- return MIPS_SYNC_OLD_OP ("<d>", "<d>addu");
-}
- [(set_attr "length" "28")])
-
-(define_insn "sync_old_sub<mode>"
- [(set (match_operand:GPR 0 "register_operand" "=&d")
- (match_operand:GPR 1 "memory_operand" "+R"))
- (set (match_dup 1)
- (unspec_volatile:GPR
- [(minus:GPR (match_dup 1)
- (match_operand:GPR 2 "register_operand" "d"))]
- UNSPEC_SYNC_OLD_OP))]
- "GENERATE_LL_SC"
-{
- return MIPS_SYNC_OLD_OP ("<d>", "<d>subu");
-}
- [(set_attr "length" "28")])
-
-(define_insn "sync_new_add<mode>"
- [(set (match_operand:GPR 0 "register_operand" "=&d,&d")
- (plus:GPR (match_operand:GPR 1 "memory_operand" "+R,R")
- (match_operand:GPR 2 "arith_operand" "I,d")))
- (set (match_dup 1)
- (unspec_volatile:GPR
- [(plus:GPR (match_dup 1) (match_dup 2))]
- UNSPEC_SYNC_NEW_OP))]
- "GENERATE_LL_SC"
-{
- if (which_alternative == 0)
- return MIPS_SYNC_NEW_OP ("<d>", "<d>addiu");
- else
- return MIPS_SYNC_NEW_OP ("<d>", "<d>addu");
-}
- [(set_attr "length" "28")])
-
-(define_insn "sync_new_sub<mode>"
- [(set (match_operand:GPR 0 "register_operand" "=&d")
- (minus:GPR (match_operand:GPR 1 "memory_operand" "+R")
- (match_operand:GPR 2 "register_operand" "d")))
- (set (match_dup 1)
- (unspec_volatile:GPR
- [(minus:GPR (match_dup 1) (match_dup 2))]
- UNSPEC_SYNC_NEW_OP))]
- "GENERATE_LL_SC"
-{
- return MIPS_SYNC_NEW_OP ("<d>", "<d>subu");
-}
- [(set_attr "length" "28")])
-
-(define_insn "sync_<optab><mode>"
- [(set (match_operand:GPR 0 "memory_operand" "+R,R")
- (unspec_volatile:GPR
- [(fetchop_bit:GPR (match_operand:GPR 1 "uns_arith_operand" "K,d")
- (match_dup 0))]
- UNSPEC_SYNC_OLD_OP))]
- "GENERATE_LL_SC"
-{
- if (which_alternative == 0)
- return MIPS_SYNC_OP ("<d>", "<immediate_insn>");
- else
- return MIPS_SYNC_OP ("<d>", "<insn>");
-}
- [(set_attr "length" "28")])
-
-(define_insn "sync_old_<optab><mode>"
- [(set (match_operand:GPR 0 "register_operand" "=&d,&d")
- (match_operand:GPR 1 "memory_operand" "+R,R"))
- (set (match_dup 1)
- (unspec_volatile:GPR
- [(fetchop_bit:GPR (match_operand:GPR 2 "uns_arith_operand" "K,d")
- (match_dup 1))]
- UNSPEC_SYNC_OLD_OP))]
- "GENERATE_LL_SC"
-{
- if (which_alternative == 0)
- return MIPS_SYNC_OLD_OP ("<d>", "<immediate_insn>");
- else
- return MIPS_SYNC_OLD_OP ("<d>", "<insn>");
-}
- [(set_attr "length" "28")])
-
-(define_insn "sync_new_<optab><mode>"
- [(set (match_operand:GPR 0 "register_operand" "=&d,&d")
- (match_operand:GPR 1 "memory_operand" "+R,R"))
- (set (match_dup 1)
- (unspec_volatile:GPR
- [(fetchop_bit:GPR (match_operand:GPR 2 "uns_arith_operand" "K,d")
- (match_dup 1))]
- UNSPEC_SYNC_NEW_OP))]
- "GENERATE_LL_SC"
-{
- if (which_alternative == 0)
- return MIPS_SYNC_NEW_OP ("<d>", "<immediate_insn>");
- else
- return MIPS_SYNC_NEW_OP ("<d>", "<insn>");
-}
- [(set_attr "length" "28")])
-
-(define_insn "sync_nand<mode>"
- [(set (match_operand:GPR 0 "memory_operand" "+R,R")
- (unspec_volatile:GPR [(match_operand:GPR 1 "uns_arith_operand" "K,d")]
- UNSPEC_SYNC_OLD_OP))]
- "GENERATE_LL_SC"
-{
- if (which_alternative == 0)
- return MIPS_SYNC_NAND ("<d>", "andi");
- else
- return MIPS_SYNC_NAND ("<d>", "and");
-}
- [(set_attr "length" "32")])
-
-(define_insn "sync_old_nand<mode>"
- [(set (match_operand:GPR 0 "register_operand" "=&d,&d")
- (match_operand:GPR 1 "memory_operand" "+R,R"))
- (set (match_dup 1)
- (unspec_volatile:GPR [(match_operand:GPR 2 "uns_arith_operand" "K,d")]
- UNSPEC_SYNC_OLD_OP))]
- "GENERATE_LL_SC"
-{
- if (which_alternative == 0)
- return MIPS_SYNC_OLD_NAND ("<d>", "andi");
- else
- return MIPS_SYNC_OLD_NAND ("<d>", "and");
-}
- [(set_attr "length" "32")])
-
-(define_insn "sync_new_nand<mode>"
- [(set (match_operand:GPR 0 "register_operand" "=&d,&d")
- (match_operand:GPR 1 "memory_operand" "+R,R"))
- (set (match_dup 1)
- (unspec_volatile:GPR [(match_operand:GPR 2 "uns_arith_operand" "K,d")]
- UNSPEC_SYNC_NEW_OP))]
- "GENERATE_LL_SC"
-{
- if (which_alternative == 0)
- return MIPS_SYNC_NEW_NAND ("<d>", "andi");
- else
- return MIPS_SYNC_NEW_NAND ("<d>", "and");
-}
- [(set_attr "length" "32")])
-
-(define_insn "sync_lock_test_and_set<mode>"
- [(set (match_operand:GPR 0 "register_operand" "=&d,&d")
- (match_operand:GPR 1 "memory_operand" "+R,R"))
- (set (match_dup 1)
- (unspec_volatile:GPR [(match_operand:GPR 2 "arith_operand" "I,d")]
- UNSPEC_SYNC_EXCHANGE))]
- "GENERATE_LL_SC"
-{
- if (which_alternative == 0)
- return MIPS_SYNC_EXCHANGE ("<d>", "li");
- else
- return MIPS_SYNC_EXCHANGE ("<d>", "move");
-}
- [(set_attr "length" "24")])
-
-(define_expand "sync_lock_test_and_set<mode>"
- [(match_operand:SHORT 0 "register_operand")
- (match_operand:SHORT 1 "memory_operand")
- (match_operand:SHORT 2 "general_operand")]
- "GENERATE_LL_SC"
-{
- union mips_gen_fn_ptrs generator;
- generator.fn_5 = gen_test_and_set_12;
- mips_expand_atomic_qihi (generator,
- operands[0], operands[1], operands[2], NULL);
- DONE;
-})
-
-(define_insn "test_and_set_12"
- [(set (match_operand:SI 0 "register_operand" "=&d,&d")
- (match_operand:SI 1 "memory_operand" "+R,R"))
- (set (match_dup 1)
- (unspec_volatile:SI [(match_operand:SI 2 "register_operand" "d,d")
- (match_operand:SI 3 "register_operand" "d,d")
- (match_operand:SI 4 "arith_operand" "d,J")]
- UNSPEC_SYNC_EXCHANGE_12))]
- "GENERATE_LL_SC"
-{
- if (which_alternative == 0)
- return MIPS_SYNC_EXCHANGE_12 (MIPS_SYNC_EXCHANGE_12_NONZERO_OP);
- else
- return MIPS_SYNC_EXCHANGE_12 (MIPS_SYNC_EXCHANGE_12_ZERO_OP);
-}
- [(set_attr "length" "28,24")])
;; Block moves, see mips.c for more details.
;; Argument 0 is the destination
@@ -5505,6 +5069,50 @@
(if_then_else (match_operand 0)
(label_ref (match_operand 1))
(pc)))])
+
+;; Branch if bit is set/clear.
+
+(define_insn "*branch_bit<bbv><mode>"
+ [(set (pc)
+ (if_then_else
+ (equality_op (zero_extract:GPR
+ (match_operand:GPR 1 "register_operand" "d")
+ (const_int 1)
+ (match_operand 2 "const_int_operand" ""))
+ (const_int 0))
+ (label_ref (match_operand 0 ""))
+ (pc)))]
+ "ISA_HAS_BBIT && UINTVAL (operands[2]) < GET_MODE_BITSIZE (<MODE>mode)"
+{
+ return
+ mips_output_conditional_branch (insn, operands,
+ MIPS_BRANCH ("bbit<bbv>", "%1,%2,%0"),
+ MIPS_BRANCH ("bbit<bbinv>", "%1,%2,%0"));
+}
+ [(set_attr "type" "branch")
+ (set_attr "mode" "none")
+ (set_attr "branch_likely" "no")])
+
+(define_insn "*branch_bit<bbv><mode>_inverted"
+ [(set (pc)
+ (if_then_else
+ (equality_op (zero_extract:GPR
+ (match_operand:GPR 1 "register_operand" "d")
+ (const_int 1)
+ (match_operand 2 "const_int_operand" ""))
+ (const_int 0))
+ (pc)
+ (label_ref (match_operand 0 ""))))]
+ "ISA_HAS_BBIT && UINTVAL (operands[2]) < GET_MODE_BITSIZE (<MODE>mode)"
+{
+ return
+ mips_output_conditional_branch (insn, operands,
+ MIPS_BRANCH ("bbit<bbinv>", "%1,%2,%0"),
+ MIPS_BRANCH ("bbit<bbv>", "%1,%2,%0"));
+}
+ [(set_attr "type" "branch")
+ (set_attr "mode" "none")
+ (set_attr "branch_likely" "no")])
;;
;; ....................
@@ -5981,16 +5589,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 +5652,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 +5703,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 +5722,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 +5753,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 +5804,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 +5855,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 +5871,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 +5889,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 +5932,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")])
@@ -6543,6 +6194,10 @@
(set_attr "can_delay" "no")
(set_attr "mode" "<MODE>")])
+;; Synchronization instructions.
+
+(include "sync.md")
+
; The MIPS Paired-Single Floating Point and MIPS-3D Instructions.
(include "mips-ps-3d.md")
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..13c0ff72f2e 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "insn-attr.h"
#include "flags.h"
#include "recog.h"
+#include "reload.h"
#include "expr.h"
#include "optabs.h"
#include "function.h"
@@ -1319,25 +1320,30 @@ 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)
{
+ rtx inner = in;
+
+ /* Strip off any SUBREG expressions from IN. Basically we want
+ to know if IN is a pseudo or (subreg (pseudo)) as those can
+ turn into MEMs during reload. */
+ while (GET_CODE (inner) == SUBREG)
+ inner = SUBREG_REG (inner);
+
/* Memory loads less than a full word wide can't have an
address or stack pointer destination. They must use
a data register as an intermediate register. */
if ((GET_CODE (in) == MEM
- || (GET_CODE (in) == REG
- && REGNO (in) >= FIRST_PSEUDO_REGISTER)
- || (GET_CODE (in) == SUBREG
- && GET_CODE (SUBREG_REG (in)) == REG
- && REGNO (SUBREG_REG (in)) >= FIRST_PSEUDO_REGISTER))
+ || (GET_CODE (inner) == REG
+ && REGNO (inner) >= 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 +1352,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,13 +1369,22 @@ 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
- && GET_CODE (in) == MEM
- && ! (GET_CODE (in) == MEM && !CONSTANT_ADDRESS_P (XEXP (in, 0))))
+ if (TARGET_AM33_2
+ && rclass == FP_REGS)
{
- if (TARGET_AM33)
- return DATA_OR_EXTENDED_REGS;
- return DATA_REGS;
+ /* We can't load directly into an FP register from a
+ constant address. */
+ if (GET_CODE (in) == MEM
+ && CONSTANT_ADDRESS_P (XEXP (in, 0)))
+ return (TARGET_AM33 ? DATA_OR_EXTENDED_REGS : DATA_REGS);
+
+ /* Handle case were a pseudo may not get a hard register
+ but has an equivalent memory location defined. */
+ if (GET_CODE (inner) == REG
+ && REGNO (inner) >= FIRST_PSEUDO_REGISTER
+ && reg_equiv_mem [REGNO (inner)]
+ && CONSTANT_ADDRESS_P (XEXP (reg_equiv_mem [REGNO (inner)], 0)))
+ return (TARGET_AM33 ? DATA_OR_EXTENDED_REGS : DATA_REGS);
}
/* Otherwise assume no secondary reloads are needed. */
diff --git a/gcc/config/mn10300/mn10300.h b/gcc/config/mn10300/mn10300.h
index 1d2339b6b15..07035fbb06b 100644
--- a/gcc/config/mn10300/mn10300.h
+++ b/gcc/config/mn10300/mn10300.h
@@ -295,6 +295,19 @@ enum reg_class {
{ 0xffffffff, 0x3ffff } /* ALL_REGS */ \
}
+/* The following macro defines cover classes for Integrated Register
+ Allocator. Cover classes is a set of non-intersected register
+ classes covering all hard registers used for register allocation
+ purpose. Any move between two registers of a cover class should be
+ cheaper than load or store of the registers. The macro value is
+ array of register classes with LIM_REG_CLASSES used as the end
+ marker. */
+
+#define IRA_COVER_CLASSES \
+{ \
+ GENERAL_REGS, FP_REGS, LIM_REG_CLASSES \
+}
+
/* The same information, inverted:
Return the class number of the smallest class containing
reg number REGNO. This could be a conditional expression
diff --git a/gcc/config/mn10300/mn10300.md b/gcc/config/mn10300/mn10300.md
index 73043e99b1a..8fbbdc87df5 100644
--- a/gcc/config/mn10300/mn10300.md
+++ b/gcc/config/mn10300/mn10300.md
@@ -115,8 +115,8 @@
[(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
(define_insn ""
- [(set (match_operand:QI 0 "nonimmediate_operand" "=d*a,d,d*a,d,m")
- (match_operand:QI 1 "general_operand" "0,I,dai,m,d"))]
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=d*a,d,d,!*a,d*a,d,m")
+ (match_operand:QI 1 "general_operand" "0,I,i,i,da,m,d"))]
"register_operand (operands[0], QImode)
|| register_operand (operands[1], QImode)"
"*
@@ -128,6 +128,8 @@
case 1:
return \"clr %0\";
case 2:
+ case 3:
+ case 4:
if (GET_CODE (operands[1]) == CONST_DOUBLE)
{
rtx xoperands[2];
@@ -138,14 +140,14 @@
}
return \"mov %1,%0\";
- case 3:
- case 4:
+ case 5:
+ case 6:
return \"movbu %1,%0\";
default:
gcc_unreachable ();
}
}"
- [(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit")])
+ [(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
;; movhi
@@ -208,8 +210,8 @@
[(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
(define_insn ""
- [(set (match_operand:HI 0 "nonimmediate_operand" "=d*a,d,d*a,d,m")
- (match_operand:HI 1 "general_operand" "0,I,dai,m,d"))]
+ [(set (match_operand:HI 0 "nonimmediate_operand" "=d*a,d,d,!*a,d*a,d,m")
+ (match_operand:HI 1 "general_operand" "0,I,i,i,da,m,d"))]
"register_operand (operands[0], HImode)
|| register_operand (operands[1], HImode)"
"*
@@ -221,6 +223,8 @@
case 1:
return \"clr %0\";
case 2:
+ case 3:
+ case 4:
if (GET_CODE (operands[1]) == CONST_DOUBLE)
{
rtx xoperands[2];
@@ -230,14 +234,14 @@
return \"\";
}
return \"mov %1,%0\";
- case 3:
- case 4:
+ case 5:
+ case 6:
return \"movhu %1,%0\";
default:
gcc_unreachable ();
}
}"
- [(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit")])
+ [(set_attr "cc" "none,clobber,none_0hit,none_0hit,none_0hit,none_0hit,none_0hit")])
;; movsi and helpers
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 238d35276e4..9ff778b5b47 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -1,6 +1,6 @@
/* Subroutines for insn-output.c for HPPA.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
Contributed by Tim Moore (moore@cs.utah.edu), based on sparc.c
This file is part of GCC.
@@ -125,7 +125,7 @@ static void pa_asm_out_destructor (rtx, int);
static void pa_init_builtins (void);
static rtx hppa_builtin_saveregs (void);
static void hppa_va_start (tree, rtx);
-static tree hppa_gimplify_va_arg_expr (tree, tree, tree *, tree *);
+static tree hppa_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *);
static bool pa_scalar_mode_supported_p (enum machine_mode);
static bool pa_commutative_p (const_rtx x, int outer_code);
static void copy_fp_args (rtx) ATTRIBUTE_UNUSED;
@@ -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;
@@ -5998,7 +5998,8 @@ hppa_va_start (tree valist, rtx nextarg)
}
static tree
-hppa_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, tree *post_p)
+hppa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
+ gimple_seq *post_p)
{
if (TARGET_64BIT)
{
@@ -8830,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
@@ -8842,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))
{
@@ -8899,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)))
@@ -8911,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)))
@@ -8919,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))))
@@ -8961,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),
@@ -9020,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;
@@ -9033,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)
@@ -9651,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;
@@ -9673,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..5e272a2f346 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, \
@@ -1570,7 +1570,7 @@ do { \
: 2)
/* Adjust the cost of branches. */
-#define BRANCH_COST (pa_cpu == PROCESSOR_8000 ? 2 : 1)
+#define BRANCH_COST(speed_p, predictable_p) (pa_cpu == PROCESSOR_8000 ? 2 : 1)
/* Handling the special cases is going to get too complicated for a macro,
just call `pa_adjust_insn_length' to do the real work. */
diff --git a/gcc/config/pa/x-ada b/gcc/config/pa/x-ada
deleted file mode 100644
index b60b3d7925b..00000000000
--- a/gcc/config/pa/x-ada
+++ /dev/null
@@ -1,4 +0,0 @@
-# The ada virtual array implementation requires that indexing be disabled on
-# hosts such as hpux that use a segmented memory architecture. Both the c
-# and ada files need to be compiled with this option for correct operation.
-X_ADA_CFLAGS=-mdisable-indexing
diff --git a/gcc/config/pa/x-ada-hpux10 b/gcc/config/pa/x-ada-hpux10
deleted file mode 100644
index d2b70753088..00000000000
--- a/gcc/config/pa/x-ada-hpux10
+++ /dev/null
@@ -1,4 +0,0 @@
-# The ada virtual array implementation requires that indexing be disabled on
-# hosts such as hpux that use a segmented memory architecture. Both the c
-# and ada files need to be compiled with this option for correct operation.
-X_ADA_CFLAGS = -mdisable-indexing -D_X_HPUX10
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..e572d6cf9c3 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;
@@ -1059,7 +1057,7 @@ JMP FUNCTION 0x0058 0x0000 <- FUNCTION
/* there is no point in avoiding branches on a pdp,
since branches are really cheap - I just want to find out
how much difference the BRANCH_COST macro makes in code */
-#define BRANCH_COST (TARGET_BRANCH_CHEAP ? 0 : 1)
+#define BRANCH_COST(speed_p, predictable_p) (TARGET_BRANCH_CHEAP ? 0 : 1)
#define COMPARE_FLAG_MODE HImode
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 ce1ec4b9665..8cbace8a795 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -85,12 +85,12 @@ rs6000_pragma_longcall (cpp_reader *pfile ATTRIBUTE_UNUSED)
#define builtin_assert(TXT) cpp_assert (pfile, TXT)
/* Keep the AltiVec keywords handy for fast comparisons. */
-static tree __vector_keyword;
-static tree vector_keyword;
-static tree __pixel_keyword;
-static tree pixel_keyword;
-static tree __bool_keyword;
-static tree bool_keyword;
+static GTY(()) tree __vector_keyword;
+static GTY(()) tree vector_keyword;
+static GTY(()) tree __pixel_keyword;
+static GTY(()) tree pixel_keyword;
+static GTY(()) tree __bool_keyword;
+static GTY(()) tree bool_keyword;
/* Preserved across calls. */
static tree expand_bool_pixel;
@@ -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 5e2f7ac38a1..2124ea3c50d 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -52,7 +52,7 @@
#include "reload.h"
#include "cfglayout.h"
#include "sched-int.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-flow.h"
#include "intl.h"
#include "params.h"
@@ -862,6 +862,7 @@ static tree rs6000_builtin_mask_for_load (void);
static tree rs6000_builtin_mul_widen_even (tree);
static tree rs6000_builtin_mul_widen_odd (tree);
static tree rs6000_builtin_conversion (enum tree_code, tree);
+static tree rs6000_builtin_vec_perm (tree, tree *);
static void def_builtin (int, const char *, tree, int);
static bool rs6000_vector_alignment_reachable (const_tree, bool);
@@ -958,7 +959,7 @@ static void rs6000_darwin_file_start (void);
static tree rs6000_build_builtin_va_list (void);
static void rs6000_va_start (tree, rtx);
-static tree rs6000_gimplify_va_arg (tree, tree, tree *, tree *);
+static tree rs6000_gimplify_va_arg (tree, tree, gimple_seq *, gimple_seq *);
static bool rs6000_must_pass_in_stack (enum machine_mode, const_tree);
static bool rs6000_scalar_mode_supported_p (enum machine_mode);
static bool rs6000_vector_mode_supported_p (enum machine_mode);
@@ -1138,6 +1139,8 @@ static const char alt_reg_names[][8] =
#define TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD rs6000_builtin_mul_widen_odd
#undef TARGET_VECTORIZE_BUILTIN_CONVERSION
#define TARGET_VECTORIZE_BUILTIN_CONVERSION rs6000_builtin_conversion
+#undef TARGET_VECTORIZE_BUILTIN_VEC_PERM
+#define TARGET_VECTORIZE_BUILTIN_VEC_PERM rs6000_builtin_vec_perm
#undef TARGET_VECTOR_ALIGNMENT_REACHABLE
#define TARGET_VECTOR_ALIGNMENT_REACHABLE rs6000_vector_alignment_reachable
@@ -1507,6 +1510,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 +1966,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 +1979,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 +2016,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 +2039,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;
}
@@ -2061,6 +2083,40 @@ rs6000_vector_alignment_reachable (const_tree type ATTRIBUTE_UNUSED, bool is_pac
}
}
+/* Implement targetm.vectorize.builtin_vec_perm. */
+tree
+rs6000_builtin_vec_perm (tree type, tree *mask_element_type)
+{
+ tree d;
+
+ *mask_element_type = unsigned_char_type_node;
+
+ switch (TYPE_MODE (type))
+ {
+ case V16QImode:
+ d = rs6000_builtin_decls[ALTIVEC_BUILTIN_VPERM_16QI];
+ break;
+
+ case V8HImode:
+ d = rs6000_builtin_decls[ALTIVEC_BUILTIN_VPERM_8HI];
+ break;
+
+ case V4SImode:
+ d = rs6000_builtin_decls[ALTIVEC_BUILTIN_VPERM_4SI];
+ break;
+
+ case V4SFmode:
+ d = rs6000_builtin_decls[ALTIVEC_BUILTIN_VPERM_4SF];
+ break;
+
+ default:
+ return NULL_TREE;
+ }
+
+ gcc_assert (d);
+ return d;
+}
+
/* Handle generic options of the form -mfoo=yes/no.
NAME is the option name.
VALUE is the option value.
@@ -2109,8 +2165,11 @@ optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED)
/* Enable section anchors by default.
Skip section anchors for Objective C and Objective C++
- until front-ends fixed. */
- if (!TARGET_MACHO && lang_hooks.name[4] != 'O')
+ until front-ends fixed.
+ Do not enable section anchors without toplevel reorder. */
+ if (!TARGET_MACHO
+ && lang_hooks.name[4] != 'O'
+ && flag_toplevel_reorder != 0)
flag_section_anchors = 2;
}
@@ -2849,7 +2908,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 +2927,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 +2946,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
@@ -3948,6 +4007,8 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model)
insn = emit_call_insn (insn);
RTL_CONST_CALL_P (insn) = 1;
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), r3);
+ if (DEFAULT_ABI == ABI_V4 && TARGET_SECURE_PLT && flag_pic)
+ use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
insn = get_insns ();
end_sequence ();
emit_libcall_block (insn, dest, r3, addr);
@@ -3970,6 +4031,8 @@ rs6000_legitimize_tls_address (rtx addr, enum tls_model model)
insn = emit_call_insn (insn);
RTL_CONST_CALL_P (insn) = 1;
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), r3);
+ if (DEFAULT_ABI == ABI_V4 && TARGET_SECURE_PLT && flag_pic)
+ use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
insn = get_insns ();
end_sequence ();
tmp1 = gen_reg_rtx (Pmode);
@@ -6713,9 +6776,12 @@ rs6000_va_start (tree valist, rtx nextarg)
valist = build_va_arg_indirect_ref (valist);
gpr = build3 (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr, NULL_TREE);
- fpr = build3 (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr, NULL_TREE);
- ovf = build3 (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf, NULL_TREE);
- sav = build3 (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav, NULL_TREE);
+ fpr = build3 (COMPONENT_REF, TREE_TYPE (f_fpr), unshare_expr (valist),
+ f_fpr, NULL_TREE);
+ ovf = build3 (COMPONENT_REF, TREE_TYPE (f_ovf), unshare_expr (valist),
+ f_ovf, NULL_TREE);
+ sav = build3 (COMPONENT_REF, TREE_TYPE (f_sav), unshare_expr (valist),
+ f_sav, NULL_TREE);
/* Count number of gp and fp argument registers used. */
words = crtl->args.info.words;
@@ -6731,7 +6797,7 @@ rs6000_va_start (tree valist, rtx nextarg)
if (cfun->va_list_gpr_size)
{
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (gpr), gpr,
+ t = build2 (MODIFY_EXPR, TREE_TYPE (gpr), gpr,
build_int_cst (NULL_TREE, n_gpr));
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -6739,7 +6805,7 @@ rs6000_va_start (tree valist, rtx nextarg)
if (cfun->va_list_fpr_size)
{
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (fpr), fpr,
+ t = build2 (MODIFY_EXPR, TREE_TYPE (fpr), fpr,
build_int_cst (NULL_TREE, n_fpr));
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -6750,7 +6816,7 @@ rs6000_va_start (tree valist, rtx nextarg)
if (words != 0)
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ovf), t,
size_int (words * UNITS_PER_WORD));
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (ovf), ovf, t);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -6767,7 +6833,7 @@ rs6000_va_start (tree valist, rtx nextarg)
if (cfun->machine->varargs_save_offset)
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (sav), t,
size_int (cfun->machine->varargs_save_offset));
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (sav), sav, t);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (sav), sav, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
@@ -6775,7 +6841,8 @@ rs6000_va_start (tree valist, rtx nextarg)
/* Implement va_arg. */
tree
-rs6000_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
+rs6000_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
+ gimple_seq *post_p)
{
tree f_gpr, f_fpr, f_res, f_ovf, f_sav;
tree gpr, fpr, ovf, sav, reg, t, u;
@@ -6784,6 +6851,7 @@ rs6000_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
int align;
tree ptrtype = build_pointer_type (type);
int regalign = 0;
+ gimple stmt;
if (pass_by_reference (NULL, TYPE_MODE (type), type, false))
{
@@ -6802,14 +6870,14 @@ rs6000_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
if (elem_size < UNITS_PER_WORD)
{
tree real_part, imag_part;
- tree post = NULL_TREE;
+ gimple_seq post = NULL;
real_part = rs6000_gimplify_va_arg (valist, elem_type, pre_p,
&post);
/* Copy the value into a temporary, lest the formal temporary
be reused out from under us. */
real_part = get_initialized_tmp_var (real_part, pre_p, &post);
- append_to_statement_list (post, pre_p);
+ gimple_seq_add_seq (pre_p, post);
imag_part = rs6000_gimplify_va_arg (valist, elem_type, pre_p,
post_p);
@@ -6829,9 +6897,12 @@ rs6000_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
valist = build_va_arg_indirect_ref (valist);
gpr = build3 (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr, NULL_TREE);
- fpr = build3 (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr, NULL_TREE);
- ovf = build3 (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf, NULL_TREE);
- sav = build3 (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav, NULL_TREE);
+ fpr = build3 (COMPONENT_REF, TREE_TYPE (f_fpr), unshare_expr (valist),
+ f_fpr, NULL_TREE);
+ ovf = build3 (COMPONENT_REF, TREE_TYPE (f_ovf), unshare_expr (valist),
+ f_ovf, NULL_TREE);
+ sav = build3 (COMPONENT_REF, TREE_TYPE (f_sav), unshare_expr (valist),
+ f_sav, NULL_TREE);
size = int_size_in_bytes (type);
rsize = (size + 3) / 4;
@@ -6885,18 +6956,19 @@ rs6000_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
if (n_reg == 2 && reg == gpr)
{
regalign = 1;
- u = build2 (BIT_AND_EXPR, TREE_TYPE (reg), reg,
+ u = build2 (BIT_AND_EXPR, TREE_TYPE (reg), unshare_expr (reg),
build_int_cst (TREE_TYPE (reg), n_reg - 1));
- u = build2 (POSTINCREMENT_EXPR, TREE_TYPE (reg), reg, u);
+ u = build2 (POSTINCREMENT_EXPR, TREE_TYPE (reg),
+ unshare_expr (reg), u);
}
/* _Decimal128 is passed in even/odd fpr pairs; the stored
reg number is 0 for f1, so we want to make it odd. */
else if (reg == fpr && TYPE_MODE (type) == TDmode)
{
regalign = 1;
- t = build2 (BIT_IOR_EXPR, TREE_TYPE (reg), reg,
+ t = build2 (BIT_IOR_EXPR, TREE_TYPE (reg), unshare_expr (reg),
build_int_cst (TREE_TYPE (reg), 1));
- u = build2 (MODIFY_EXPR, void_type_node, reg, t);
+ u = build2 (MODIFY_EXPR, void_type_node, unshare_expr (reg), t);
}
t = fold_convert (TREE_TYPE (reg), size_int (8 - n_reg + 1));
@@ -6909,7 +6981,7 @@ rs6000_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
if (sav_ofs)
t = build2 (POINTER_PLUS_EXPR, ptr_type_node, sav, size_int (sav_ofs));
- u = build2 (POSTINCREMENT_EXPR, TREE_TYPE (reg), reg,
+ u = build2 (POSTINCREMENT_EXPR, TREE_TYPE (reg), unshare_expr (reg),
build_int_cst (TREE_TYPE (reg), n_reg));
u = fold_convert (sizetype, u);
u = build2 (MULT_EXPR, sizetype, u, size_int (sav_scale));
@@ -6922,22 +6994,18 @@ rs6000_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
&& TYPE_MODE (type) == SDmode)
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (t), t, size_int (size));
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (addr, t, pre_p);
- t = build1 (GOTO_EXPR, void_type_node, lab_over);
- gimplify_and_add (t, pre_p);
+ gimple_seq_add_stmt (pre_p, gimple_build_goto (lab_over));
- t = build1 (LABEL_EXPR, void_type_node, lab_false);
- append_to_statement_list (t, pre_p);
+ stmt = gimple_build_label (lab_false);
+ gimple_seq_add_stmt (pre_p, stmt);
if ((n_reg == 2 && !regalign) || n_reg > 2)
{
/* Ensure that we don't find any more args in regs.
Alignment has taken care of for special cases. */
- t = build_gimple_modify_stmt (reg,
- build_int_cst (TREE_TYPE (reg), 8));
- gimplify_and_add (t, pre_p);
+ gimplify_assign (reg, build_int_cst (TREE_TYPE (reg), 8), pre_p);
}
}
@@ -6955,17 +7023,15 @@ rs6000_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
}
gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
- u = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
- gimplify_and_add (u, pre_p);
+ gimplify_assign (unshare_expr (addr), t, pre_p);
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (t), t, size_int (size));
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (ovf), ovf, t);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (unshare_expr (ovf), t, pre_p);
if (lab_over)
{
- t = build1 (LABEL_EXPR, void_type_node, lab_over);
- append_to_statement_list (t, pre_p);
+ stmt = gimple_build_label (lab_over);
+ gimple_seq_add_stmt (pre_p, stmt);
}
if (STRICT_ALIGNMENT
@@ -9095,7 +9161,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),
@@ -11321,15 +11389,14 @@ rs6000_alloc_sdmode_stack_slot (void)
{
tree t;
basic_block bb;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
gcc_assert (cfun->machine->sdmode_stack_slot == NULL_RTX);
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))
{
- tree ret = walk_tree_without_duplicates (bsi_stmt_ptr (bsi),
- rs6000_check_sdmode, NULL);
+ tree ret = walk_gimple_op (gsi_stmt (gsi), rs6000_check_sdmode, NULL);
if (ret)
{
rtx stack = assign_stack_local (DDmode, GET_MODE_SIZE (DDmode), 0);
@@ -11364,11 +11431,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)
{
@@ -11387,7 +11454,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
@@ -11416,22 +11483,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;
@@ -17572,7 +17639,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;
@@ -17583,17 +17650,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. */
@@ -17602,7 +17669,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
@@ -17617,8 +17684,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. */
@@ -20267,8 +20334,10 @@ rs6000_handle_altivec_attribute (tree *node,
default: break;
}
- if (result && result != type && TYPE_READONLY (type))
- result = build_qualified_type (result, TYPE_QUAL_CONST);
+ /* Propagate qualifiers attached to the element type
+ onto the vector type. */
+ if (result && result != type && TYPE_QUALS (type))
+ result = build_qualified_type (result, TYPE_QUALS (type));
*no_add_attrs = true; /* No need to hang on to the attribute. */
@@ -20514,12 +20583,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] == '.'));
}
@@ -21807,17 +21876,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 8a926e43c44..2d5bbff39ab 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
@@ -644,12 +652,15 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
/* Define this macro to be the value 1 if unaligned accesses have a cost
many times greater than aligned accesses, for example if they are
emulated in a trap handler. */
+/* Altivec vector memory instructions simply ignore the low bits; SPE
+ vector memory instructions trap on unaligned accesses. */
#define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) \
(STRICT_ALIGNMENT \
|| (((MODE) == SFmode || (MODE) == DFmode || (MODE) == TFmode \
|| (MODE) == SDmode || (MODE) == DDmode || (MODE) == TDmode \
|| (MODE) == DImode) \
- && (ALIGN) < 32))
+ && (ALIGN) < 32) \
+ || (VECTOR_MODE_P ((MODE)) && (ALIGN) < GET_MODE_BITSIZE ((MODE))))
/* Standard register usage. */
@@ -956,7 +967,7 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
Set this to 3 on the RS/6000 since that is roughly the average cost of an
unscheduled conditional branch. */
-#define BRANCH_COST 3
+#define BRANCH_COST(speed_p, predictable_p) 3
/* Override BRANCH_COST heuristic which empirically produces worse
performance for removing short circuiting from the logical ops. */
@@ -1117,6 +1128,22 @@ enum reg_class
{ 0xffffffff, 0xffffffff, 0xffffffff, 0x0003ffff } /* ALL_REGS */ \
}
+/* The following macro defines cover classes for Integrated Register
+ Allocator. Cover classes is a set of non-intersected register
+ classes covering all hard registers used for register allocation
+ purpose. Any move between two registers of a cover class should be
+ cheaper than load or store of the registers. The macro value is
+ array of register classes with LIM_REG_CLASSES used as the end
+ marker. */
+
+#define IRA_COVER_CLASSES \
+{ \
+ GENERAL_REGS, SPECIAL_REGS, FLOAT_REGS, ALTIVEC_REGS, \
+ /*VRSAVE_REGS,*/ VSCR_REGS, SPE_ACC_REGS, SPEFSCR_REGS, \
+ /* MQ_REGS, LINK_REGS, CTR_REGS, */ \
+ CR_REGS, XER_REGS, LIM_REG_CLASSES \
+}
+
/* The same information, inverted:
Return the class number of the smallest class containing
reg number REGNO. This could be a conditional expression
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/s390.c b/gcc/config/s390/s390.c
index 936e0a0ead2..957707b8607 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -50,7 +50,7 @@ along with GCC; see the file COPYING3. If not see
#include "debug.h"
#include "langhooks.h"
#include "optabs.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "df.h"
@@ -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)
@@ -8424,15 +8425,15 @@ s390_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
if (cfun->va_list_gpr_size)
{
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (gpr), gpr,
- build_int_cst (NULL_TREE, n_gpr));
+ t = build2 (MODIFY_EXPR, TREE_TYPE (gpr), gpr,
+ build_int_cst (NULL_TREE, n_gpr));
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
if (cfun->va_list_fpr_size)
{
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (fpr), fpr,
+ t = build2 (MODIFY_EXPR, TREE_TYPE (fpr), fpr,
build_int_cst (NULL_TREE, n_fpr));
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -8452,7 +8453,7 @@ s390_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (ovf), t, size_int (off));
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (ovf), ovf, t);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (ovf), ovf, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
@@ -8465,7 +8466,7 @@ s390_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (sav), t,
size_int (-RETURN_REGNUM * UNITS_PER_WORD));
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (sav), sav, t);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (sav), sav, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
@@ -8496,8 +8497,8 @@ s390_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
} */
static tree
-s390_gimplify_va_arg (tree valist, tree type, tree *pre_p,
- tree *post_p ATTRIBUTE_UNUSED)
+s390_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
+ gimple_seq *post_p ATTRIBUTE_UNUSED)
{
tree f_gpr, f_fpr, f_ovf, f_sav;
tree gpr, fpr, ovf, sav, reg, t, u;
@@ -8512,9 +8513,13 @@ s390_gimplify_va_arg (tree valist, tree type, tree *pre_p,
valist = build_va_arg_indirect_ref (valist);
gpr = build3 (COMPONENT_REF, TREE_TYPE (f_gpr), valist, f_gpr, NULL_TREE);
fpr = build3 (COMPONENT_REF, TREE_TYPE (f_fpr), valist, f_fpr, NULL_TREE);
- ovf = build3 (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf, NULL_TREE);
sav = build3 (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav, NULL_TREE);
+ /* The tree for args* cannot be shared between gpr/fpr and ovf since
+ both appear on a lhs. */
+ valist = unshare_expr (valist);
+ ovf = build3 (COMPONENT_REF, TREE_TYPE (f_ovf), valist, f_ovf, NULL_TREE);
+
size = int_size_in_bytes (type);
if (pass_by_reference (NULL, TYPE_MODE (type), type, false))
@@ -8598,14 +8603,11 @@ s390_gimplify_va_arg (tree valist, tree type, tree *pre_p,
fold_convert (TREE_TYPE (reg), size_int (sav_scale)));
t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t, fold_convert (sizetype, u));
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (addr, t, pre_p);
- t = build1 (GOTO_EXPR, void_type_node, lab_over);
- gimplify_and_add (t, pre_p);
+ gimple_seq_add_stmt (pre_p, gimple_build_goto (lab_over));
- t = build1 (LABEL_EXPR, void_type_node, lab_false);
- append_to_statement_list (t, pre_p);
+ gimple_seq_add_stmt (pre_p, gimple_build_label (lab_false));
/* ... Otherwise out of the overflow area. */
@@ -8617,16 +8619,13 @@ s390_gimplify_va_arg (tree valist, tree type, tree *pre_p,
gimplify_expr (&t, pre_p, NULL, is_gimple_val, fb_rvalue);
- u = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
- gimplify_and_add (u, pre_p);
+ gimplify_assign (addr, t, pre_p);
t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t,
size_int (size));
- t = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, ovf, t);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (ovf, t, pre_p);
- t = build1 (LABEL_EXPR, void_type_node, lab_over);
- append_to_statement_list (t, pre_p);
+ gimple_seq_add_stmt (pre_p, gimple_build_label (lab_over));
/* Increment register save count. */
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index 79286d5a9bc..a31efd24a23 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -478,6 +478,30 @@ enum reg_class
{ 0xffffffff, 0x0000003f }, /* ALL_REGS */ \
}
+/* The following macro defines cover classes for Integrated Register
+ Allocator. Cover classes is a set of non-intersected register
+ classes covering all hard registers used for register allocation
+ purpose. Any move between two registers of a cover class should be
+ cheaper than load or store of the registers. The macro value is
+ array of register classes with LIM_REG_CLASSES used as the end
+ marker. */
+
+#define IRA_COVER_CLASSES \
+{ \
+ GENERAL_REGS, FP_REGS, CC_REGS, ACCESS_REGS, LIM_REG_CLASSES \
+}
+
+/* In some case register allocation order is not enough for IRA to
+ generate a good code. The following macro (if defined) increases
+ cost of REGNO for a pseudo approximately by pseudo usage frequency
+ multiplied by the macro value.
+
+ We avoid usage of BASE_REGNUM by nonzero macro value because the
+ reload can decide not to use the hard register because some
+ constant was forced to be in memory. */
+#define IRA_HARD_REGNO_ADD_COST_MULTIPLIER(regno) \
+ (regno == BASE_REGNUM ? 0.0 : 0.5)
+
/* Register -> class mapping. */
extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
#define REGNO_REG_CLASS(REGNO) (regclass_map[REGNO])
@@ -748,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)
@@ -804,7 +828,7 @@ extern struct rtx_def *s390_compare_op0, *s390_compare_op1, *s390_compare_emitte
/* A C expression for the cost of a branch instruction. A value of 1
is the default; other values are interpreted relative to that. */
-#define BRANCH_COST 1
+#define BRANCH_COST(speed_p, predictable_p) 1
/* Nonzero if access to memory by bytes is slow and undesirable. */
#define SLOW_BYTE_ACCESS 1
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..d9900a50214 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
@@ -795,7 +793,7 @@ typedef struct score_args
(4 + memory_move_secondary_cost ((MODE), (CLASS), (TO_P)))
/* Try to generate sequences that don't involve branches. */
-#define BRANCH_COST 2
+#define BRANCH_COST(speed_p, predictable_p) 2
/* Nonzero if access to memory by bytes is slow and undesirable. */
#define SLOW_BYTE_ACCESS 1
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 e311362de6c..74060738ee9 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -51,7 +51,7 @@ along with GCC; see the file COPYING3. If not see
#include "intl.h"
#include "sched-int.h"
#include "ggc.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "cfgloop.h"
#include "alloc-pool.h"
#include "tm-constrs.h"
@@ -260,9 +260,8 @@ 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, tree *, tree *);
+static tree sh_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *);
static bool sh_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
const_tree, bool);
static bool sh_callee_copies (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
@@ -7200,7 +7189,7 @@ sh_va_start (tree valist, rtx nextarg)
/* Call __builtin_saveregs. */
u = make_tree (sizetype, expand_builtin_saveregs ());
u = fold_convert (ptr_type_node, u);
- t = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, next_fp, u);
+ t = build2 (MODIFY_EXPR, ptr_type_node, next_fp, u);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -7211,11 +7200,11 @@ sh_va_start (tree valist, rtx nextarg)
nfp = 0;
u = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, u,
size_int (UNITS_PER_WORD * nfp));
- t = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, next_fp_limit, u);
+ t = build2 (MODIFY_EXPR, ptr_type_node, next_fp_limit, u);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
- t = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, next_o, u);
+ t = build2 (MODIFY_EXPR, ptr_type_node, next_o, u);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -7226,12 +7215,12 @@ sh_va_start (tree valist, rtx nextarg)
nint = 0;
u = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, u,
size_int (UNITS_PER_WORD * nint));
- t = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, next_o_limit, u);
+ t = build2 (MODIFY_EXPR, ptr_type_node, next_o_limit, u);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
u = make_tree (ptr_type_node, nextarg);
- t = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, next_stack, u);
+ t = build2 (MODIFY_EXPR, ptr_type_node, next_stack, u);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
@@ -7260,8 +7249,8 @@ find_sole_member (tree type)
/* Implement `va_arg'. */
static tree
-sh_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
- tree *post_p ATTRIBUTE_UNUSED)
+sh_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
+ gimple_seq *post_p ATTRIBUTE_UNUSED)
{
HOST_WIDE_INT size, rsize;
tree tmp, pptr_type_node;
@@ -7350,20 +7339,19 @@ sh_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
tree cmp;
bool is_double = size == 8 && TREE_CODE (eff_type) == REAL_TYPE;
- tmp = build1 (ADDR_EXPR, pptr_type_node, next_fp);
- tmp = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, tmp);
- gimplify_and_add (tmp, pre_p);
+ tmp = build1 (ADDR_EXPR, pptr_type_node, unshare_expr (next_fp));
+ gimplify_assign (unshare_expr (addr), tmp, pre_p);
- tmp = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, next_fp_tmp, valist);
- gimplify_and_add (tmp, pre_p);
+ gimplify_assign (unshare_expr (next_fp_tmp), valist, pre_p);
tmp = next_fp_limit;
if (size > 4 && !is_double)
- tmp = build2 (POINTER_PLUS_EXPR, TREE_TYPE (tmp), tmp,
- size_int (4 - size));
- tmp = build2 (GE_EXPR, boolean_type_node, next_fp_tmp, tmp);
+ tmp = build2 (POINTER_PLUS_EXPR, TREE_TYPE (tmp),
+ unshare_expr (tmp), size_int (4 - size));
+ tmp = build2 (GE_EXPR, boolean_type_node,
+ unshare_expr (next_fp_tmp), unshare_expr (tmp));
cmp = build3 (COND_EXPR, void_type_node, tmp,
- build1 (GOTO_EXPR, void_type_node, lab_false),
- NULL_TREE);
+ build1 (GOTO_EXPR, void_type_node,
+ unshare_expr (lab_false)), NULL_TREE);
if (!is_double)
gimplify_and_add (cmp, pre_p);
@@ -7374,10 +7362,8 @@ sh_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
tmp = build2 (BIT_AND_EXPR, sizetype, tmp,
size_int (UNITS_PER_WORD));
tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node,
- next_fp_tmp, tmp);
- tmp = build2 (GIMPLE_MODIFY_STMT, ptr_type_node,
- next_fp_tmp, tmp);
- gimplify_and_add (tmp, pre_p);
+ unshare_expr (next_fp_tmp), tmp);
+ gimplify_assign (unshare_expr (next_fp_tmp), tmp, pre_p);
}
if (is_double)
gimplify_and_add (cmp, pre_p);
@@ -7402,57 +7388,53 @@ sh_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
}
#endif /* FUNCTION_ARG_SCmode_WART */
- tmp = build1 (GOTO_EXPR, void_type_node, lab_over);
+ tmp = build1 (GOTO_EXPR, void_type_node, unshare_expr (lab_over));
gimplify_and_add (tmp, pre_p);
- tmp = build1 (LABEL_EXPR, void_type_node, lab_false);
+ tmp = build1 (LABEL_EXPR, void_type_node, unshare_expr (lab_false));
gimplify_and_add (tmp, pre_p);
- tmp = build1 (ADDR_EXPR, pptr_type_node, next_stack);
- tmp = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, tmp);
- gimplify_and_add (tmp, pre_p);
- tmp = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, next_fp_tmp, valist);
- gimplify_and_add (tmp, pre_p);
+ tmp = build1 (ADDR_EXPR, pptr_type_node, unshare_expr (next_stack));
+ gimplify_assign (unshare_expr (addr), tmp, pre_p);
+ gimplify_assign (unshare_expr (next_fp_tmp),
+ unshare_expr (valist), pre_p);
- tmp = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, valist, next_fp_tmp);
- gimplify_and_add (tmp, post_p);
+ gimplify_assign (unshare_expr (valist),
+ unshare_expr (next_fp_tmp), post_p);
valist = next_fp_tmp;
}
else
{
- tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node, next_o,
- size_int (rsize));
- tmp = build2 (GT_EXPR, boolean_type_node, tmp, next_o_limit);
+ tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node,
+ unshare_expr (next_o), size_int (rsize));
+ tmp = build2 (GT_EXPR, boolean_type_node, tmp,
+ unshare_expr (next_o_limit));
tmp = build3 (COND_EXPR, void_type_node, tmp,
- build1 (GOTO_EXPR, void_type_node, lab_false),
- NULL_TREE);
+ build1 (GOTO_EXPR, void_type_node,
+ unshare_expr (lab_false)),
+ NULL_TREE);
gimplify_and_add (tmp, pre_p);
- tmp = build1 (ADDR_EXPR, pptr_type_node, next_o);
- tmp = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, tmp);
- gimplify_and_add (tmp, pre_p);
+ tmp = build1 (ADDR_EXPR, pptr_type_node, unshare_expr (next_o));
+ gimplify_assign (unshare_expr (addr), tmp, pre_p);
- tmp = build1 (GOTO_EXPR, void_type_node, lab_over);
+ tmp = build1 (GOTO_EXPR, void_type_node, unshare_expr (lab_over));
gimplify_and_add (tmp, pre_p);
- tmp = build1 (LABEL_EXPR, void_type_node, lab_false);
+ tmp = build1 (LABEL_EXPR, void_type_node, unshare_expr (lab_false));
gimplify_and_add (tmp, pre_p);
if (size > 4 && ! (TARGET_SH4 || TARGET_SH2A))
- {
- tmp = build2 (GIMPLE_MODIFY_STMT, ptr_type_node,
- next_o, next_o_limit);
- gimplify_and_add (tmp, pre_p);
- }
+ gimplify_assign (unshare_expr (next_o),
+ unshare_expr (next_o_limit), pre_p);
- tmp = build1 (ADDR_EXPR, pptr_type_node, next_stack);
- tmp = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, tmp);
- gimplify_and_add (tmp, pre_p);
+ tmp = build1 (ADDR_EXPR, pptr_type_node, unshare_expr (next_stack));
+ gimplify_assign (unshare_expr (addr), tmp, pre_p);
}
if (!result)
{
- tmp = build1 (LABEL_EXPR, void_type_node, lab_over);
+ tmp = build1 (LABEL_EXPR, void_type_node, unshare_expr (lab_over));
gimplify_and_add (tmp, pre_p);
}
}
@@ -7463,10 +7445,9 @@ sh_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
tmp = std_gimplify_va_arg_expr (valist, type, pre_p, NULL);
if (result)
{
- tmp = build2 (GIMPLE_MODIFY_STMT, void_type_node, result, tmp);
- gimplify_and_add (tmp, pre_p);
+ gimplify_assign (result, tmp, pre_p);
- tmp = build1 (LABEL_EXPR, void_type_node, lab_over);
+ tmp = build1 (LABEL_EXPR, void_type_node, unshare_expr (lab_over));
gimplify_and_add (tmp, pre_p);
}
else
@@ -8794,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;
@@ -8810,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)
@@ -8833,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 != ':';
@@ -10253,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;
@@ -10390,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;
@@ -10418,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
@@ -10459,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))
@@ -10471,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)
@@ -10483,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))
@@ -10493,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);
}
@@ -10514,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. */
@@ -10549,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
@@ -10949,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;
}
@@ -11009,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;
}
@@ -11028,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;
}
}
@@ -11181,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))
@@ -11206,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;
@@ -11221,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))
@@ -11238,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
@@ -11263,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/sh/sh.h b/gcc/config/sh/sh.h
index 5204847abc5..d5ea6128876 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -463,7 +463,7 @@ do { \
do { \
if (LEVEL) \
{ \
- flag_omit_frame_pointer = -1; \
+ flag_omit_frame_pointer = 2; \
if (! SIZE) \
sh_div_str = "inv:minlat"; \
} \
@@ -690,7 +690,7 @@ do { \
if (! VALID_REGISTER_P (ADDREGNAMES_REGNO (regno))) \
sh_additional_register_names[regno][0] = '\0'; \
\
- if (flag_omit_frame_pointer < 0) \
+ if (flag_omit_frame_pointer == 2) \
{ \
/* The debugging information is sufficient, \
but gdb doesn't implement this yet */ \
@@ -1466,7 +1466,7 @@ enum reg_class
/* MAC_REGS: */ \
{ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00300000 }, \
/* FPUL_REGS: */ \
- { 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00400000 }, \
+ { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00400000 }, \
/* SIBCALL_REGS: Initialized in CONDITIONAL_REGISTER_USAGE. */ \
{ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, \
/* GENERAL_REGS: */ \
@@ -1499,6 +1499,20 @@ enum reg_class
extern enum reg_class regno_reg_class[FIRST_PSEUDO_REGISTER];
#define REGNO_REG_CLASS(REGNO) regno_reg_class[(REGNO)]
+/* The following macro defines cover classes for Integrated Register
+ Allocator. Cover classes is a set of non-intersected register
+ classes covering all hard registers used for register allocation
+ purpose. Any move between two registers of a cover class should be
+ cheaper than load or store of the registers. The macro value is
+ array of register classes with LIM_REG_CLASSES used as the end
+ marker. */
+
+#define IRA_COVER_CLASSES \
+{ \
+ GENERAL_REGS, FP_REGS, PR_REGS, T_REGS, MAC_REGS, TARGET_REGS, \
+ FPUL_REGS, LIM_REG_CLASSES \
+}
+
/* When defined, the compiler allows registers explicitly used in the
rtl to be used as spill registers but prevents the compiler from
extending the lifetime of these registers. */
@@ -2599,8 +2613,8 @@ struct sh_args {
if (TARGET_SH2E && MODE == SFmode) \
{ \
X = copy_rtx (X); \
- push_reload (index_rtx, NULL_RTX, &XEXP (X, 1), NULL, \
- R0_REGS, Pmode, VOIDmode, 0, 0, (OPNUM), \
+ push_reload (X, NULL_RTX, &X, NULL, \
+ BASE_REG_CLASS, Pmode, VOIDmode, 0, 0, (OPNUM), \
(TYPE)); \
goto WIN; \
} \
@@ -2833,7 +2847,8 @@ struct sh_args {
The SH1 does not have delay slots, hence we get a pipeline stall
at every branch. The SH4 is superscalar, so the single delay slot
is not sufficient to keep both pipelines filled. */
-#define BRANCH_COST (TARGET_SH5 ? 1 : ! TARGET_SH2 || TARGET_HARD_SH4 ? 2 : 1)
+#define BRANCH_COST(speed_p, predictable_p) \
+ (TARGET_SH5 ? 1 : ! TARGET_SH2 || TARGET_HARD_SH4 ? 2 : 1)
/* Assembler output control. */
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 6300054220a..b6e56aa5a5e 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -1143,7 +1143,7 @@
(set (match_dup 4) (match_dup 5))]
"
{
- rtx set1, set2;
+ rtx set1, set2, insn2;
rtx replacements[4];
/* We want to replace occurrences of operands[0] with operands[1] and
@@ -1173,7 +1173,10 @@
extract_insn (emit_insn (set1));
if (! constrain_operands (1))
goto failure;
- extract_insn (emit (set2));
+ insn2 = emit (set2);
+ if (GET_CODE (insn2) == BARRIER)
+ goto failure;
+ extract_insn (insn2);
if (! constrain_operands (1))
{
rtx tmp;
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 5e6f5748672..b74e81e9558 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -48,7 +48,7 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "target-def.h"
#include "cfglayout.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "langhooks.h"
#include "params.h"
#include "df.h"
@@ -410,7 +410,7 @@ static rtx sparc_struct_value_rtx (tree, int);
static bool sparc_return_in_memory (const_tree, const_tree);
static bool sparc_strict_argument_naming (CUMULATIVE_ARGS *);
static void sparc_va_start (tree, rtx);
-static tree sparc_gimplify_va_arg (tree, tree, tree *, tree *);
+static tree sparc_gimplify_va_arg (tree, tree, gimple_seq *, gimple_seq *);
static bool sparc_vector_mode_supported_p (enum machine_mode);
static bool sparc_pass_by_reference (CUMULATIVE_ARGS *,
enum machine_mode, const_tree, bool);
@@ -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)
@@ -5709,7 +5714,8 @@ sparc_va_start (tree valist, rtx nextarg)
/* Implement `va_arg' for stdarg. */
static tree
-sparc_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
+sparc_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
+ gimple_seq *post_p)
{
HOST_WIDE_INT size, rsize, align;
tree addr, incr;
@@ -5792,8 +5798,7 @@ sparc_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
addr = fold_convert (ptrtype, addr);
incr = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, incr, size_int (rsize));
- incr = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, valist, incr);
- gimplify_and_add (incr, post_p);
+ gimplify_assign (valist, incr, post_p);
return build_va_arg_indirect_ref (addr);
}
@@ -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/sparc/sparc.h b/gcc/config/sparc/sparc.h
index ef60292cef3..de5f52089a3 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -981,9 +981,12 @@ extern int sparc_mode_class[];
/* Pick a default value we can notice from override_options:
!v9: Default is on.
- v9: Default is off. */
+ v9: Default is off.
+ Originally it was -1, but later on the container of options changed to
+ unsigned byte, so we decided to pick 127 as default value, which does
+ reflect an undefined default value in case of 0/1. */
-#define DEFAULT_PCC_STRUCT_RETURN -1
+#define DEFAULT_PCC_STRUCT_RETURN 127
/* Functions which return large structures get the address
to place the wanted value at offset 64 from the frame.
@@ -1075,6 +1078,19 @@ enum reg_class { NO_REGS, FPCC_REGS, I64_REGS, GENERAL_REGS, FP_REGS,
{-1, -1, -1, 0x20}, /* GENERAL_OR_EXTRA_FP_REGS */ \
{-1, -1, -1, 0x3f}} /* ALL_REGS */
+/* The following macro defines cover classes for Integrated Register
+ Allocator. Cover classes is a set of non-intersected register
+ classes covering all hard registers used for register allocation
+ purpose. Any move between two registers of a cover class should be
+ cheaper than load or store of the registers. The macro value is
+ array of register classes with LIM_REG_CLASSES used as the end
+ marker. */
+
+#define IRA_COVER_CLASSES \
+{ \
+ GENERAL_REGS, EXTRA_FP_REGS, FPCC_REGS, LIM_REG_CLASSES \
+}
+
/* Defines invalid mode changes. Borrowed from pa64-regs.h.
SImode loads to floating-point registers are not zero-extended.
@@ -2180,7 +2196,7 @@ do { \
On Niagara-2, a not-taken branch costs 1 cycle whereas a taken
branch costs 6 cycles. */
-#define BRANCH_COST \
+#define BRANCH_COST (speed_p, predictable_p) \
((sparc_cpu == PROCESSOR_V9 \
|| sparc_cpu == PROCESSOR_ULTRASPARC) \
? 7 \
diff --git a/gcc/config/spu/spu-c.c b/gcc/config/spu/spu-c.c
index 0b0d2e8743a..96fe43e6e94 100644
--- a/gcc/config/spu/spu-c.c
+++ b/gcc/config/spu/spu-c.c
@@ -35,6 +35,64 @@
#include "spu-builtins.h"
+/* Keep the vector keywords handy for fast comparisons. */
+static GTY(()) tree __vector_keyword;
+static GTY(()) tree vector_keyword;
+
+static cpp_hashnode *
+spu_categorize_keyword (const cpp_token *tok)
+{
+ if (tok->type == CPP_NAME)
+ {
+ cpp_hashnode *ident = tok->val.node;
+
+ if (ident == C_CPP_HASHNODE (vector_keyword)
+ || ident == C_CPP_HASHNODE (__vector_keyword))
+ return C_CPP_HASHNODE (__vector_keyword);
+ else
+ return ident;
+ }
+ return 0;
+}
+
+/* Called to decide whether a conditional macro should be expanded.
+ Since we have exactly one such macro (i.e, 'vector'), we do not
+ need to examine the 'tok' parameter. */
+
+static cpp_hashnode *
+spu_macro_to_expand (cpp_reader *pfile, const cpp_token *tok)
+{
+ cpp_hashnode *expand_this = tok->val.node;
+ cpp_hashnode *ident;
+
+ ident = spu_categorize_keyword (tok);
+ if (ident == C_CPP_HASHNODE (__vector_keyword))
+ {
+ tok = cpp_peek_token (pfile, 0);
+ ident = spu_categorize_keyword (tok);
+
+ if (ident)
+ {
+ enum rid rid_code = (enum rid)(ident->rid_code);
+ if (ident->type == NT_MACRO)
+ {
+ (void) cpp_get_token (pfile);
+ tok = cpp_peek_token (pfile, 0);
+ ident = spu_categorize_keyword (tok);
+ if (ident)
+ rid_code = (enum rid)(ident->rid_code);
+ }
+
+ if (rid_code == RID_UNSIGNED || rid_code == RID_LONG
+ || rid_code == RID_SHORT || rid_code == RID_SIGNED
+ || rid_code == RID_INT || rid_code == RID_CHAR
+ || rid_code == RID_FLOAT || rid_code == RID_DOUBLE)
+ expand_this = C_CPP_HASHNODE (__vector_keyword);
+ }
+ }
+ return expand_this;
+}
+
/* target hook for resolve_overloaded_builtin(). Returns a function call
RTX if we can resolve the overloaded builtin */
tree
@@ -140,6 +198,22 @@ spu_cpu_cpp_builtins (struct cpp_reader *pfile)
if (spu_arch == PROCESSOR_CELLEDP)
builtin_define_std ("__SPU_EDP__");
builtin_define_std ("__vector=__attribute__((__spu_vector__))");
+
+ if (!flag_iso)
+ {
+ /* Define this when supporting context-sensitive keywords. */
+ cpp_define (pfile, "__VECTOR_KEYWORD_SUPPORTED__");
+ cpp_define (pfile, "vector=vector");
+
+ /* Initialize vector keywords. */
+ __vector_keyword = get_identifier ("__vector");
+ C_CPP_HASHNODE (__vector_keyword)->flags |= NODE_CONDITIONAL;
+ vector_keyword = get_identifier ("vector");
+ C_CPP_HASHNODE (vector_keyword)->flags |= NODE_CONDITIONAL;
+
+ /* Enable context-sensitive macros. */
+ cpp_get_callbacks (pfile)->macro_to_expand = spu_macro_to_expand;
+ }
}
void
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index e645adb2281..da99d3f108a 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2006, 2007, 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
@@ -50,7 +50,7 @@
#include "assert.h"
#include "c-common.h"
#include "machmode.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tm-constrs.h"
#include "spu-builtins.h"
#include "ddg.h"
@@ -118,8 +118,8 @@ static unsigned char spu_pass_by_reference (CUMULATIVE_ARGS *cum, enum machine_m
const_tree type, unsigned char named);
static tree spu_build_builtin_va_list (void);
static void spu_va_start (tree, rtx);
-static tree spu_gimplify_va_arg_expr (tree valist, tree type, tree * pre_p,
- tree * post_p);
+static tree spu_gimplify_va_arg_expr (tree valist, tree type,
+ gimple_seq * pre_p, gimple_seq * post_p);
static int regno_aligned_for_load (int regno);
static int store_with_one_insn_p (rtx mem);
static int mem_is_padded_component_ref (rtx x);
@@ -137,6 +137,7 @@ static tree spu_builtin_mul_widen_odd (tree);
static tree spu_builtin_mask_for_load (void);
static int spu_builtin_vectorization_cost (bool);
static bool spu_vector_alignment_reachable (const_tree, bool);
+static tree spu_builtin_vec_perm (tree, tree *);
static int spu_sms_res_mii (struct ddg *g);
extern const char *reg_names[];
@@ -288,6 +289,9 @@ const struct attribute_spec spu_attribute_table[];
#undef TARGET_VECTOR_ALIGNMENT_REACHABLE
#define TARGET_VECTOR_ALIGNMENT_REACHABLE spu_vector_alignment_reachable
+#undef TARGET_VECTORIZE_BUILTIN_VEC_PERM
+#define TARGET_VECTORIZE_BUILTIN_VEC_PERM spu_builtin_vec_perm
+
#undef TARGET_LIBGCC_CMP_RETURN_MODE
#define TARGET_LIBGCC_CMP_RETURN_MODE spu_libgcc_cmp_return_mode
@@ -352,6 +356,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 +425,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 +436,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 +1525,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 +1544,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:
@@ -3238,7 +3255,7 @@ spu_va_start (tree valist, rtx nextarg)
if (crtl->args.pretend_args_size > 0)
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (args), t,
size_int (-STACK_POINTER_OFFSET));
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (args), args, t);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (args), args, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -3247,7 +3264,7 @@ spu_va_start (tree valist, rtx nextarg)
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (skip), t,
size_int (crtl->args.pretend_args_size
- STACK_POINTER_OFFSET));
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (skip), skip, t);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (skip), skip, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
@@ -3270,8 +3287,8 @@ spu_va_start (tree valist, rtx nextarg)
ret = *(TYPE *)addr;
*/
static tree
-spu_gimplify_va_arg_expr (tree valist, tree type, tree * pre_p,
- tree * post_p ATTRIBUTE_UNUSED)
+spu_gimplify_va_arg_expr (tree valist, tree type, gimple_seq * pre_p,
+ gimple_seq * post_p ATTRIBUTE_UNUSED)
{
tree f_args, f_skip;
tree args, skip;
@@ -3303,22 +3320,21 @@ spu_gimplify_va_arg_expr (tree valist, tree type, tree * pre_p,
/* build conditional expression to calculate addr. The expression
will be gimplified later. */
paddedsize = size_int (rsize);
- tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node, args, paddedsize);
+ tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node, unshare_expr (args), paddedsize);
tmp = build2 (TRUTH_AND_EXPR, boolean_type_node,
- build2 (GT_EXPR, boolean_type_node, tmp, skip),
- build2 (LE_EXPR, boolean_type_node, args, skip));
+ build2 (GT_EXPR, boolean_type_node, tmp, unshare_expr (skip)),
+ build2 (LE_EXPR, boolean_type_node, unshare_expr (args),
+ unshare_expr (skip)));
tmp = build3 (COND_EXPR, ptr_type_node, tmp,
- build2 (POINTER_PLUS_EXPR, ptr_type_node, skip,
- size_int (32)), args);
+ build2 (POINTER_PLUS_EXPR, ptr_type_node, unshare_expr (skip),
+ size_int (32)), unshare_expr (args));
- tmp = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, addr, tmp);
- gimplify_and_add (tmp, pre_p);
+ gimplify_assign (addr, tmp, pre_p);
/* update VALIST.__args */
tmp = build2 (POINTER_PLUS_EXPR, ptr_type_node, addr, paddedsize);
- tmp = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (args), args, tmp);
- gimplify_and_add (tmp, pre_p);
+ gimplify_assign (unshare_expr (args), tmp, pre_p);
addr = fold_convert (build_pointer_type (type), addr);
@@ -4563,7 +4579,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
@@ -5531,6 +5547,60 @@ spu_vector_alignment_reachable (const_tree type ATTRIBUTE_UNUSED, bool is_packed
return true;
}
+/* Implement targetm.vectorize.builtin_vec_perm. */
+tree
+spu_builtin_vec_perm (tree type, tree *mask_element_type)
+{
+ struct spu_builtin_description *d;
+
+ *mask_element_type = unsigned_char_type_node;
+
+ switch (TYPE_MODE (type))
+ {
+ case V16QImode:
+ if (TYPE_UNSIGNED (type))
+ d = &spu_builtins[SPU_SHUFFLE_0];
+ else
+ d = &spu_builtins[SPU_SHUFFLE_1];
+ break;
+
+ case V8HImode:
+ if (TYPE_UNSIGNED (type))
+ d = &spu_builtins[SPU_SHUFFLE_2];
+ else
+ d = &spu_builtins[SPU_SHUFFLE_3];
+ break;
+
+ case V4SImode:
+ if (TYPE_UNSIGNED (type))
+ d = &spu_builtins[SPU_SHUFFLE_4];
+ else
+ d = &spu_builtins[SPU_SHUFFLE_5];
+ break;
+
+ case V2DImode:
+ if (TYPE_UNSIGNED (type))
+ d = &spu_builtins[SPU_SHUFFLE_6];
+ else
+ d = &spu_builtins[SPU_SHUFFLE_7];
+ break;
+
+ case V4SFmode:
+ d = &spu_builtins[SPU_SHUFFLE_8];
+ break;
+
+ case V2DFmode:
+ d = &spu_builtins[SPU_SHUFFLE_9];
+ break;
+
+ default:
+ return NULL_TREE;
+ }
+
+ gcc_assert (d);
+ return d->fndecl;
+}
+
/* Count the total number of instructions in each pipe and return the
maximum, which is used as the Minimum Iteration Interval (MII)
in the modulo scheduler. get_pipe() will return -2, -1, 0, or 1.
diff --git a/gcc/config/spu/spu.h b/gcc/config/spu/spu.h
index 729e0d707a8..f78eb73c429 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 */
@@ -224,6 +196,9 @@ enum reg_class {
LIM_REG_CLASSES
};
+/* SPU is simple, it really only has one class of registers. */
+#define IRA_COVER_CLASSES { GENERAL_REGS, LIM_REG_CLASSES }
+
#define N_REG_CLASSES (int) LIM_REG_CLASSES
#define REG_CLASS_NAMES \
@@ -263,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 { \
@@ -289,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)
@@ -456,7 +434,7 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin; \
/* Costs */
-#define BRANCH_COST spu_branch_cost
+#define BRANCH_COST(speed_p, predictable_p) spu_branch_cost
#define SLOW_BYTE_ACCESS 0
@@ -594,6 +572,11 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin; \
#undef TARG_VEC_STORE_COST
#define TARG_VEC_STORE_COST 1
+/* Cost of vector permutation. */
+#ifndef TARG_VEC_PERMUTE_COST
+#define TARG_VEC_PERMUTE_COST 1
+#endif
+
/* Misc */
diff --git a/gcc/config/spu/spu.md b/gcc/config/spu/spu.md
index c267efd29d1..89f2109ceb3 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" "")
@@ -4694,6 +4757,476 @@ DONE;
DONE;
})
+
+(define_expand "vec_extract_evenv4si"
+ [(set (match_operand:V4SI 0 "spu_reg_operand" "=r")
+ (vec_concat:V4SI
+ (vec_select:V2SI
+ (match_operand:V4SI 1 "spu_reg_operand" "r")
+ (parallel [(const_int 0)(const_int 2)]))
+ (vec_select:V2SI
+ (match_operand:V4SI 2 "spu_reg_operand" "r")
+ (parallel [(const_int 0)(const_int 2)]))))]
+
+ ""
+ "
+{
+ rtx mask = gen_reg_rtx (TImode);
+ unsigned char arr[16] = {
+ 0x00, 0x01, 0x02, 0x03,
+ 0x08, 0x09, 0x0A, 0x0B,
+ 0x10, 0x11, 0x12, 0x13,
+ 0x18, 0x19, 0x1A, 0x1B};
+
+ emit_move_insn (mask, array_to_constant (TImode, arr));
+ emit_insn (gen_shufb (operands[0], operands[1], operands[2], mask));
+ DONE;
+}")
+
+
+(define_expand "vec_extract_evenv4sf"
+ [(set (match_operand:V4SF 0 "spu_reg_operand" "=r")
+ (vec_concat:V4SF
+ (vec_select:V2SF
+ (match_operand:V4SF 1 "spu_reg_operand" "r")
+ (parallel [(const_int 0)(const_int 2)]))
+ (vec_select:V2SF
+ (match_operand:V4SF 2 "spu_reg_operand" "r")
+ (parallel [(const_int 0)(const_int 2)]))))]
+
+ ""
+ "
+{
+ rtx mask = gen_reg_rtx (TImode);
+ unsigned char arr[16] = {
+ 0x00, 0x01, 0x02, 0x03,
+ 0x08, 0x09, 0x0A, 0x0B,
+ 0x10, 0x11, 0x12, 0x13,
+ 0x18, 0x19, 0x1A, 0x1B};
+
+ emit_move_insn (mask, array_to_constant (TImode, arr));
+ emit_insn (gen_shufb (operands[0], operands[1], operands[2], mask));
+ DONE;
+}")
+
+(define_expand "vec_extract_evenv8hi"
+ [(set (match_operand:V8HI 0 "spu_reg_operand" "=r")
+ (vec_concat:V8HI
+ (vec_select:V4HI
+ (match_operand:V8HI 1 "spu_reg_operand" "r")
+ (parallel [(const_int 0)(const_int 2)(const_int 4)(const_int 6)]))
+ (vec_select:V4HI
+ (match_operand:V8HI 2 "spu_reg_operand" "r")
+ (parallel [(const_int 0)(const_int 2)(const_int 4)(const_int 6)]))))]
+
+ ""
+ "
+{
+ rtx mask = gen_reg_rtx (TImode);
+ unsigned char arr[16] = {
+ 0x00, 0x01, 0x04, 0x05,
+ 0x08, 0x09, 0x0C, 0x0D,
+ 0x10, 0x11, 0x14, 0x15,
+ 0x18, 0x19, 0x1C, 0x1D};
+
+ emit_move_insn (mask, array_to_constant (TImode, arr));
+ emit_insn (gen_shufb (operands[0], operands[1], operands[2], mask));
+ DONE;
+}")
+
+(define_expand "vec_extract_evenv16qi"
+ [(set (match_operand:V16QI 0 "spu_reg_operand" "=r")
+ (vec_concat:V16QI
+ (vec_select:V8QI
+ (match_operand:V16QI 1 "spu_reg_operand" "r")
+ (parallel [(const_int 0)(const_int 2)(const_int 4)(const_int 6)
+ (const_int 8)(const_int 10)(const_int 12)(const_int 14)]))
+ (vec_select:V8QI
+ (match_operand:V16QI 2 "spu_reg_operand" "r")
+ (parallel [(const_int 0)(const_int 2)(const_int 4)(const_int 6)
+ (const_int 8)(const_int 10)(const_int 12)(const_int 14)]))))]
+
+ ""
+ "
+{
+ rtx mask = gen_reg_rtx (TImode);
+ unsigned char arr[16] = {
+ 0x00, 0x02, 0x04, 0x06,
+ 0x08, 0x0A, 0x0C, 0x0E,
+ 0x10, 0x12, 0x14, 0x16,
+ 0x18, 0x1A, 0x1C, 0x1E};
+
+ emit_move_insn (mask, array_to_constant (TImode, arr));
+ emit_insn (gen_shufb (operands[0], operands[1], operands[2], mask));
+ DONE;
+}")
+
+(define_expand "vec_extract_oddv4si"
+ [(set (match_operand:V4SI 0 "spu_reg_operand" "=r")
+ (vec_concat:V4SI
+ (vec_select:V2SI
+ (match_operand:V4SI 1 "spu_reg_operand" "r")
+ (parallel [(const_int 1)(const_int 3)]))
+ (vec_select:V2SI
+ (match_operand:V4SI 2 "spu_reg_operand" "r")
+ (parallel [(const_int 1)(const_int 3)]))))]
+
+ ""
+ "
+{
+ rtx mask = gen_reg_rtx (TImode);
+ unsigned char arr[16] = {
+ 0x04, 0x05, 0x06, 0x07,
+ 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x14, 0x15, 0x16, 0x17,
+ 0x1C, 0x1D, 0x1E, 0x1F};
+
+ emit_move_insn (mask, array_to_constant (TImode, arr));
+ emit_insn (gen_shufb (operands[0], operands[1], operands[2], mask));
+ DONE;
+}")
+
+(define_expand "vec_extract_oddv4sf"
+ [(set (match_operand:V4SF 0 "spu_reg_operand" "=r")
+ (vec_concat:V4SF
+ (vec_select:V2SF
+ (match_operand:V4SF 1 "spu_reg_operand" "r")
+ (parallel [(const_int 1)(const_int 3)]))
+ (vec_select:V2SF
+ (match_operand:V4SF 2 "spu_reg_operand" "r")
+ (parallel [(const_int 1)(const_int 3)]))))]
+
+ ""
+ "
+{
+ rtx mask = gen_reg_rtx (TImode);
+ unsigned char arr[16] = {
+ 0x04, 0x05, 0x06, 0x07,
+ 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x14, 0x15, 0x16, 0x17,
+ 0x1C, 0x1D, 0x1E, 0x1F};
+
+ emit_move_insn (mask, array_to_constant (TImode, arr));
+ emit_insn (gen_shufb (operands[0], operands[1], operands[2], mask));
+ DONE;
+}")
+
+(define_expand "vec_extract_oddv8hi"
+ [(set (match_operand:V8HI 0 "spu_reg_operand" "=r")
+ (vec_concat:V8HI
+ (vec_select:V4HI
+ (match_operand:V8HI 1 "spu_reg_operand" "r")
+ (parallel [(const_int 1)(const_int 3)(const_int 5)(const_int 7)]))
+ (vec_select:V4HI
+ (match_operand:V8HI 2 "spu_reg_operand" "r")
+ (parallel [(const_int 1)(const_int 3)(const_int 5)(const_int 7)]))))]
+
+ ""
+ "
+{
+ rtx mask = gen_reg_rtx (TImode);
+ unsigned char arr[16] = {
+ 0x02, 0x03, 0x06, 0x07,
+ 0x0A, 0x0B, 0x0E, 0x0F,
+ 0x12, 0x13, 0x16, 0x17,
+ 0x1A, 0x1B, 0x1E, 0x1F};
+
+ emit_move_insn (mask, array_to_constant (TImode, arr));
+ emit_insn (gen_shufb (operands[0], operands[1], operands[2], mask));
+ DONE;
+}")
+
+(define_expand "vec_extract_oddv16qi"
+ [(set (match_operand:V16QI 0 "spu_reg_operand" "=r")
+ (vec_concat:V16QI
+ (vec_select:V8QI
+ (match_operand:V16QI 1 "spu_reg_operand" "r")
+ (parallel [(const_int 1)(const_int 3)(const_int 5)(const_int 7)
+ (const_int 9)(const_int 11)(const_int 13)(const_int 15)]))
+ (vec_select:V8QI
+ (match_operand:V16QI 2 "spu_reg_operand" "r")
+ (parallel [(const_int 1)(const_int 3)(const_int 5)(const_int 7)
+ (const_int 9)(const_int 11)(const_int 13)(const_int 15)]))))]
+
+ ""
+ "
+{
+ rtx mask = gen_reg_rtx (TImode);
+ unsigned char arr[16] = {
+ 0x01, 0x03, 0x05, 0x07,
+ 0x09, 0x0B, 0x0D, 0x0F,
+ 0x11, 0x13, 0x15, 0x17,
+ 0x19, 0x1B, 0x1D, 0x1F};
+
+ emit_move_insn (mask, array_to_constant (TImode, arr));
+ emit_insn (gen_shufb (operands[0], operands[1], operands[2], mask));
+ DONE;
+}")
+
+(define_expand "vec_interleave_highv4sf"
+ [(set (match_operand:V4SF 0 "spu_reg_operand" "=r")
+ (vec_select:V4SF
+ (vec_concat:V4SF
+ (vec_select:V2SF
+ (match_operand:V4SF 1 "spu_reg_operand" "r")
+ (parallel [(const_int 0)(const_int 1)]))
+ (vec_select:V2SF
+ (match_operand:V4SF 2 "spu_reg_operand" "r")
+ (parallel [(const_int 0)(const_int 1)])))
+ (parallel [(const_int 0)(const_int 2)(const_int 1)(const_int 3)])))]
+
+ ""
+ "
+{
+ rtx mask = gen_reg_rtx (TImode);
+ unsigned char arr[16] = {
+ 0x00, 0x01, 0x02, 0x03,
+ 0x10, 0x11, 0x12, 0x13,
+ 0x04, 0x05, 0x06, 0x07,
+ 0x14, 0x15, 0x16, 0x17};
+
+ emit_move_insn (mask, array_to_constant (TImode, arr));
+ emit_insn (gen_shufb (operands[0], operands[1], operands[2], mask));
+ DONE;
+}")
+
+(define_expand "vec_interleave_lowv4sf"
+ [(set (match_operand:V4SF 0 "spu_reg_operand" "=r")
+ (vec_select:V4SF
+ (vec_concat:V4SF
+ (vec_select:V2SF
+ (match_operand:V4SF 1 "spu_reg_operand" "r")
+ (parallel [(const_int 2)(const_int 3)]))
+ (vec_select:V2SF
+ (match_operand:V4SF 2 "spu_reg_operand" "r")
+ (parallel [(const_int 2)(const_int 3)])))
+ (parallel [(const_int 0)(const_int 2)(const_int 1)(const_int 3)])))]
+
+ ""
+ "
+{
+ rtx mask = gen_reg_rtx (TImode);
+ unsigned char arr[16] = {
+ 0x08, 0x09, 0x0A, 0x0B,
+ 0x18, 0x19, 0x1A, 0x1B,
+ 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x1C, 0x1D, 0x1E, 0x1F};
+
+ emit_move_insn (mask, array_to_constant (TImode, arr));
+ emit_insn (gen_shufb (operands[0], operands[1], operands[2], mask));
+ DONE;
+}")
+
+(define_expand "vec_interleave_highv4si"
+ [(set (match_operand:V4SI 0 "spu_reg_operand" "=r")
+ (vec_select:V4SI
+ (vec_concat:V4SI
+ (vec_select:V2SI
+ (match_operand:V4SI 1 "spu_reg_operand" "r")
+ (parallel [(const_int 0)(const_int 1)]))
+ (vec_select:V2SI
+ (match_operand:V4SI 2 "spu_reg_operand" "r")
+ (parallel [(const_int 0)(const_int 1)])))
+ (parallel [(const_int 0)(const_int 2)(const_int 1)(const_int 3)])))]
+
+ ""
+ "
+{
+ rtx mask = gen_reg_rtx (TImode);
+ unsigned char arr[16] = {
+ 0x00, 0x01, 0x02, 0x03,
+ 0x10, 0x11, 0x12, 0x13,
+ 0x04, 0x05, 0x06, 0x07,
+ 0x14, 0x15, 0x16, 0x17};
+
+ emit_move_insn (mask, array_to_constant (TImode, arr));
+ emit_insn (gen_shufb (operands[0], operands[1], operands[2], mask));
+ DONE;
+}")
+
+(define_expand "vec_interleave_lowv4si"
+ [(set (match_operand:V4SI 0 "spu_reg_operand" "=r")
+ (vec_select:V4SI
+ (vec_concat:V4SI
+ (vec_select:V2SI
+ (match_operand:V4SI 1 "spu_reg_operand" "r")
+ (parallel [(const_int 2)(const_int 3)]))
+ (vec_select:V2SI
+ (match_operand:V4SI 2 "spu_reg_operand" "r")
+ (parallel [(const_int 2)(const_int 3)])))
+ (parallel [(const_int 0)(const_int 2)(const_int 1)(const_int 3)])))]
+
+ ""
+ "
+{
+ rtx mask = gen_reg_rtx (TImode);
+ unsigned char arr[16] = {
+ 0x08, 0x09, 0x0A, 0x0B,
+ 0x18, 0x19, 0x1A, 0x1B,
+ 0x0C, 0x0D, 0x0E, 0x0F,
+ 0x1C, 0x1D, 0x1E, 0x1F};
+ emit_move_insn (mask, array_to_constant (TImode, arr));
+ emit_insn (gen_shufb (operands[0], operands[1], operands[2], mask));
+ DONE;
+}")
+
+(define_expand "vec_interleave_highv8hi"
+ [(set (match_operand:V8HI 0 "spu_reg_operand" "=r")
+ (vec_select:V8HI
+ (vec_concat:V8HI
+ (vec_select:V4HI
+ (match_operand:V8HI 1 "spu_reg_operand" "r")
+ (parallel [(const_int 0)(const_int 1)(const_int 2)(const_int 3)]))
+ (vec_select:V4HI
+ (match_operand:V8HI 2 "spu_reg_operand" "r")
+ (parallel [(const_int 0)(const_int 1)(const_int 2)(const_int 3)])))
+ (parallel [(const_int 0)(const_int 4)(const_int 1)(const_int 5)
+ (const_int 2)(const_int 6)(const_int 3)(const_int 7)])))]
+
+ ""
+ "
+{
+ rtx mask = gen_reg_rtx (TImode);
+ unsigned char arr[16] = {
+ 0x00, 0x01, 0x10, 0x11,
+ 0x02, 0x03, 0x12, 0x13,
+ 0x04, 0x05, 0x14, 0x15,
+ 0x06, 0x07, 0x16, 0x17};
+
+ emit_move_insn (mask, array_to_constant (TImode, arr));
+ emit_insn (gen_shufb (operands[0], operands[1], operands[2], mask));
+ DONE;
+ }")
+
+(define_expand "vec_interleave_lowv8hi"
+ [(set (match_operand:V8HI 0 "spu_reg_operand" "=r")
+ (vec_select:V8HI
+ (vec_concat:V8HI
+ (vec_select:V4HI
+ (match_operand:V8HI 1 "spu_reg_operand" "r")
+ (parallel [(const_int 4)(const_int 5)(const_int 6)(const_int 7)]))
+ (vec_select:V4HI
+ (match_operand:V8HI 2 "spu_reg_operand" "r")
+ (parallel [(const_int 4)(const_int 5)(const_int 6)(const_int 7)])))
+ (parallel [(const_int 0)(const_int 4)(const_int 1)(const_int 5)
+ (const_int 2)(const_int 6)(const_int 3)(const_int 7)])))]
+
+ ""
+ "
+{
+ rtx mask = gen_reg_rtx (TImode);
+ unsigned char arr[16] = {
+ 0x08, 0x09, 0x18, 0x19,
+ 0x0A, 0x0B, 0x1A, 0x1B,
+ 0x0C, 0x0D, 0x1C, 0x1D,
+ 0x0E, 0x0F, 0x1E, 0x1F};
+
+ emit_move_insn (mask, array_to_constant (TImode, arr));
+ emit_insn (gen_shufb (operands[0], operands[1], operands[2], mask));
+ DONE;
+}")
+
+(define_expand "vec_interleave_highv16qi"
+ [(set (match_operand:V16QI 0 "spu_reg_operand" "=r")
+ (vec_select:V16QI
+ (vec_concat:V16QI
+ (vec_select:V8QI
+ (match_operand:V16QI 1 "spu_reg_operand" "r")
+ (parallel [(const_int 0)(const_int 1)(const_int 2)(const_int 3)
+ (const_int 4)(const_int 5)(const_int 6)(const_int 7)]))
+ (vec_select:V8QI
+ (match_operand:V16QI 2 "spu_reg_operand" "r")
+ (parallel [(const_int 0)(const_int 1)(const_int 2)(const_int 3)
+ (const_int 4)(const_int 5)(const_int 6)(const_int 7)])))
+ (parallel [(const_int 0)(const_int 8)(const_int 1)(const_int 9)
+ (const_int 2)(const_int 10)(const_int 3)(const_int 11)
+ (const_int 4)(const_int 12)(const_int 5)(const_int 13)
+ (const_int 6)(const_int 14)(const_int 7)(const_int 15)])))]
+
+ ""
+ "
+{
+ rtx mask = gen_reg_rtx (TImode);
+ unsigned char arr[16] = {
+ 0x00, 0x10, 0x01, 0x11,
+ 0x02, 0x12, 0x03, 0x13,
+ 0x04, 0x14, 0x05, 0x15,
+ 0x06, 0x16, 0x07, 0x17};
+
+ emit_move_insn (mask, array_to_constant (TImode, arr));
+ emit_insn (gen_shufb (operands[0], operands[1], operands[2], mask));
+ DONE;
+}")
+
+(define_expand "vec_interleave_lowv16qi"
+ [(set (match_operand:V16QI 0 "spu_reg_operand" "=r")
+ (vec_select:V16QI
+ (vec_concat:V16QI
+ (vec_select:V8QI
+ (match_operand:V16QI 1 "spu_reg_operand" "r")
+ (parallel [(const_int 8)(const_int 9)(const_int 10)(const_int 11)
+ (const_int 12)(const_int 13)(const_int 14)(const_int 15)]))
+ (vec_select:V8QI
+ (match_operand:V16QI 2 "spu_reg_operand" "r")
+ (parallel [(const_int 8)(const_int 9)(const_int 10)(const_int 11)
+ (const_int 12)(const_int 13)(const_int 14)(const_int 15)])))
+ (parallel [(const_int 0)(const_int 8)(const_int 1)(const_int 9)
+ (const_int 2)(const_int 10)(const_int 3)(const_int 11)
+ (const_int 4)(const_int 12)(const_int 5)(const_int 13)
+ (const_int 6)(const_int 14)(const_int 7)(const_int 15)])))]
+
+ ""
+ "
+{
+ rtx mask = gen_reg_rtx (TImode);
+ unsigned char arr[16] = {
+ 0x08, 0x18, 0x09, 0x19,
+ 0x0A, 0x1A, 0x0B, 0x1B,
+ 0x0C, 0x1C, 0x0D, 0x1D,
+ 0x0E, 0x1E, 0x0F, 0x1F};
+
+ emit_move_insn (mask, array_to_constant (TImode, arr));
+ emit_insn (gen_shufb (operands[0], operands[1], operands[2], mask));
+ DONE;
+}")
+
+(define_expand "vec_pack_trunc_v8hi"
+ [(set (match_operand:V16QI 0 "spu_reg_operand" "=r")
+ (vec_concat:V16QI
+ (truncate:V8QI (match_operand:V8HI 1 "spu_reg_operand" "r"))
+ (truncate:V8QI (match_operand:V8HI 2 "spu_reg_operand" "r"))))]
+ ""
+ "
+{
+ rtx mask = gen_reg_rtx (TImode);
+ unsigned char arr[16] = {
+ 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F,
+ 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F};
+
+ emit_move_insn (mask, array_to_constant (TImode, arr));
+ emit_insn (gen_shufb (operands[0], operands[1], operands[2], mask));
+
+ DONE;
+}")
+
+(define_expand "vec_pack_trunc_v4si"
+ [(set (match_operand:V8HI 0 "spu_reg_operand" "=r")
+ (vec_concat:V8HI
+ (truncate:V4HI (match_operand:V4SI 1 "spu_reg_operand" "r"))
+ (truncate:V4HI (match_operand:V4SI 2 "spu_reg_operand" "r"))))]
+ ""
+ "
+{
+ rtx mask = gen_reg_rtx (TImode);
+ unsigned char arr[16] = {
+ 0x02, 0x03, 0x06, 0x07, 0x0A, 0x0B, 0x0E, 0x0F,
+ 0x12, 0x13, 0x16, 0x17, 0x1A, 0x1B, 0x1E, 0x1F};
+
+ emit_move_insn (mask, array_to_constant (TImode, arr));
+ emit_insn (gen_shufb (operands[0], operands[1], operands[2], mask));
+
+ DONE;
+}")
diff --git a/gcc/config/spu/spu_mfcio.h b/gcc/config/spu/spu_mfcio.h
index 7653c8d5b39..b0d3cd540f9 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,10 +285,38 @@ 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)
+/* Interrupt-Safe Critical Sections */
+
+static __inline__ unsigned int mfc_begin_critical_section (void)
+ __attribute__ ((__always_inline__));
+
+static __inline__ unsigned int
+mfc_begin_critical_section (void)
+{
+#ifdef SPU_MFCIO_INTERRUPT_SAFE
+ unsigned int __status = spu_read_machine_status ();
+ spu_idisable ();
+ return __status;
+#else
+ return 0;
+#endif
+}
+
+static __inline__ void mfc_end_critical_section (unsigned int)
+ __attribute__ ((__always_inline__));
+
+static __inline__ void
+mfc_end_critical_section (unsigned int __status __attribute__ ((__unused__)))
+{
+#ifdef SPU_MFCIO_INTERRUPT_SAFE
+ if (__status & 1)
+ spu_ienable ();
+#endif
+}
/* MFC Tag Manager */
@@ -291,4 +337,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 6cbe52d5048..77aedd6e01e 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -45,7 +45,7 @@ along with GCC; see the file COPYING3. If not see
#include "target-def.h"
#include "tm_p.h"
#include "langhooks.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "df.h"
#include "ggc.h"
@@ -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
@@ -1350,11 +1350,11 @@ xstormy16_expand_builtin_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
u = build_int_cst (NULL_TREE, INCOMING_FRAME_SP_OFFSET);
u = fold_convert (TREE_TYPE (count), u);
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (base), t, u);
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (base), base, t);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (base), base, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (count), count,
+ t = build2 (MODIFY_EXPR, TREE_TYPE (count), count,
build_int_cst (NULL_TREE,
crtl->args.info * UNITS_PER_WORD));
TREE_SIDE_EFFECTS (t) = 1;
@@ -1366,8 +1366,8 @@ xstormy16_expand_builtin_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
Note: This algorithm is documented in stormy-abi. */
static tree
-xstormy16_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
- tree *post_p ATTRIBUTE_UNUSED)
+xstormy16_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
+ gimple_seq *post_p ATTRIBUTE_UNUSED)
{
tree f_base, f_count;
tree base, count;
@@ -1408,8 +1408,7 @@ xstormy16_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
gimplify_and_add (t, pre_p);
t = build2 (POINTER_PLUS_EXPR, ptr_type_node, base, count_tmp);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (addr, t, pre_p);
t = build1 (GOTO_EXPR, void_type_node, lab_gotaddr);
gimplify_and_add (t, pre_p);
@@ -1427,7 +1426,7 @@ xstormy16_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
tree r, u;
r = size_int (NUM_ARGUMENT_REGISTERS * UNITS_PER_WORD);
- u = build2 (GIMPLE_MODIFY_STMT, void_type_node, count_tmp, r);
+ u = build2 (MODIFY_EXPR, TREE_TYPE (count_tmp), count_tmp, r);
t = fold_convert (TREE_TYPE (count), r);
t = build2 (GE_EXPR, boolean_type_node, count_tmp, t);
@@ -1444,16 +1443,14 @@ xstormy16_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
t = fold_convert (TREE_TYPE (t), fold (t));
t = fold_build1 (NEGATE_EXPR, TREE_TYPE (t), t);
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (base), base, t);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, addr, t);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (addr, t, pre_p);
t = build1 (LABEL_EXPR, void_type_node, lab_gotaddr);
gimplify_and_add (t, pre_p);
t = fold_convert (TREE_TYPE (count), size_tree);
t = build2 (PLUS_EXPR, TREE_TYPE (count), count_tmp, t);
- t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (count), count, t);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (count, t, pre_p);
addr = fold_convert (build_pointer_type (type), addr);
return build_va_arg_indirect_ref (addr);
diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h
index a75a776192c..005108de349 100644
--- a/gcc/config/stormy16/stormy16.h
+++ b/gcc/config/stormy16/stormy16.h
@@ -1,6 +1,6 @@
/* Xstormy16 cpu description.
- Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007
- Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007,
+ 2008 Free Software Foundation, Inc.
Contributed by Red Hat, Inc.
This file is part of GCC.
@@ -198,6 +198,11 @@ enum reg_class
#define N_REG_CLASSES ((int) LIM_REG_CLASSES)
+#define IRA_COVER_CLASSES \
+{ \
+ GENERAL_REGS, CARRY_REGS, LIM_REG_CLASSES \
+}
+
#define REG_CLASS_NAMES \
{ \
"NO_REGS", \
@@ -582,7 +587,7 @@ do { \
#define MEMORY_MOVE_COST(M,C,I) (5 + memory_move_secondary_cost (M, C, I))
-#define BRANCH_COST 5
+#define BRANCH_COST(speed_p, predictable_p) 5
#define SLOW_BYTE_ACCESS 0
diff --git a/gcc/config/stormy16/stormy16.md b/gcc/config/stormy16/stormy16.md
index 1872085718c..0c754364e74 100644
--- a/gcc/config/stormy16/stormy16.md
+++ b/gcc/config/stormy16/stormy16.md
@@ -265,9 +265,9 @@
mov.b %0, %1
shl %0,#8\n\tshr %0,#8"
[(set_attr "psw_operand" "nop,0")
- (set_attr_alternative "length"
- [(const_int 2)
- (const_int 4)])])
+ (set_attr_alternative "length"
+ [(const_int 4)
+ (const_int 8)])])
;; ::::::::::::::::::::
diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h
index b951b2cce41..c897b121380 100644
--- a/gcc/config/v850/v850.h
+++ b/gcc/config/v850/v850.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler. NEC V850 series
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2007 Free Software Foundation, Inc.
+ 2007, 2008 Free Software Foundation, Inc.
Contributed by Jeff Law (law@cygnus.com).
This file is part of GCC.
@@ -318,6 +318,11 @@ enum reg_class
#define N_REG_CLASSES (int) LIM_REG_CLASSES
+#define IRA_COVER_CLASSES \
+{ \
+ GENERAL_REGS, LIM_REG_CLASSES \
+}
+
/* Give names of register classes as strings for dump file. */
#define REG_CLASS_NAMES \
diff --git a/gcc/config/v850/v850.md b/gcc/config/v850/v850.md
index 504a748f496..79b47e64990 100644
--- a/gcc/config/v850/v850.md
+++ b/gcc/config/v850/v850.md
@@ -1563,7 +1563,7 @@
(define_insn "return"
[(return)]
- "reload_completed && compute_frame_size (get_frame_size (), (long *)0) == 0"
+ "reload_completed"
"jmp [r31]"
[(set_attr "length" "2")
(set_attr "cc" "none")])
diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h
index 68726ffcf2b..20d781bf27e 100644
--- a/gcc/config/vax/vax.h
+++ b/gcc/config/vax/vax.h
@@ -642,17 +642,13 @@ 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.
Branches are extremely cheap on the VAX while the shift insns often
used to replace branches can be expensive. */
-#define BRANCH_COST 0
+#define BRANCH_COST(speed_p, predictable_p) 0
/* Tell final.c how to eliminate redundant test instructions. */
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 38a621df0d0..f9979e61934 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -48,7 +48,7 @@ along with GCC; see the file COPYING3. If not see
#include "target.h"
#include "target-def.h"
#include "langhooks.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "df.h"
@@ -142,8 +142,9 @@ static section *xtensa_select_rtx_section (enum machine_mode, rtx,
static bool xtensa_rtx_costs (rtx, int, int, int *);
static tree xtensa_build_builtin_va_list (void);
static bool xtensa_return_in_memory (const_tree, const_tree);
+static tree xtensa_gimplify_va_arg_expr (tree, tree, gimple_seq *,
+ gimple_seq *);
static rtx xtensa_function_value (const_tree, const_tree, bool);
-static tree xtensa_gimplify_va_arg_expr (tree, tree, tree *, tree *);
static void xtensa_init_builtins (void);
static tree xtensa_fold_builtin (tree, tree, bool);
static rtx xtensa_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
@@ -1029,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;
@@ -1051,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 ();
@@ -1309,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;
@@ -1327,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. */
@@ -1336,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. */
@@ -1383,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);
@@ -1434,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,
@@ -1883,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++)
{
@@ -1891,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))
@@ -2532,20 +2540,22 @@ 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 ());
u = fold_convert (ptr_type_node, u);
- t = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, reg, u);
+ t = build2 (MODIFY_EXPR, ptr_type_node, reg, u);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
/* Set the __va_stk member to ($arg_ptr - 32). */
u = make_tree (ptr_type_node, virtual_incoming_args_rtx);
u = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node, u, size_int (-32));
- t = build2 (GIMPLE_MODIFY_STMT, ptr_type_node, stk, u);
+ t = build2 (MODIFY_EXPR, ptr_type_node, stk, u);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -2554,7 +2564,7 @@ xtensa_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
alignment offset for __va_stk. */
if (arg_words >= MAX_ARGS_IN_REGISTERS)
arg_words += 2;
- t = build2 (GIMPLE_MODIFY_STMT, integer_type_node, ndx,
+ t = build2 (MODIFY_EXPR, integer_type_node, ndx,
build_int_cst (integer_type_node, arg_words * UNITS_PER_WORD));
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -2564,8 +2574,8 @@ xtensa_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED)
/* Implement `va_arg'. */
static tree
-xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
- tree *post_p ATTRIBUTE_UNUSED)
+xtensa_gimplify_va_arg_expr (tree valist, tree type, gimple_seq *pre_p,
+ gimple_seq *post_p ATTRIBUTE_UNUSED)
{
tree f_stk, stk;
tree f_reg, reg;
@@ -2587,7 +2597,8 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *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);
@@ -2598,9 +2609,12 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *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);
@@ -2620,12 +2634,11 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *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));
- t = build2 (GIMPLE_MODIFY_STMT, integer_type_node, orig_ndx, t);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (unshare_expr (orig_ndx), t, pre_p);
}
@@ -2635,8 +2648,7 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
t = fold_convert (integer_type_node, va_size);
t = build2 (PLUS_EXPR, integer_type_node, orig_ndx, t);
- t = build2 (GIMPLE_MODIFY_STMT, integer_type_node, ndx, t);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (unshare_expr (ndx), t, pre_p);
/* Check if the argument is in registers:
@@ -2653,7 +2665,7 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *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,
@@ -2661,8 +2673,7 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p,
NULL_TREE);
gimplify_and_add (t, pre_p);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, array, reg);
- gimplify_and_add (t, 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);
@@ -2684,7 +2695,7 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *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,
@@ -2692,16 +2703,14 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *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);
- t = build2 (GIMPLE_MODIFY_STMT, integer_type_node, ndx, t);
- gimplify_and_add (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);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, array, stk);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (array, stk, pre_p);
if (lab_over)
{
@@ -2723,17 +2732,18 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *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)
@@ -2811,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;
@@ -2822,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)
{
@@ -2842,14 +2852,13 @@ xtensa_secondary_reload_class (enum reg_class class,
if (!isoutput)
{
- if ((class == FP_REGS || GET_MODE_SIZE (mode) < UNITS_PER_WORD)
- && constantpool_mem_p (x))
+ if (rclass == FP_REGS && 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/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
index 920f9d2ef18..fecb56996e3 100644
--- a/gcc/config/xtensa/xtensa.h
+++ b/gcc/config/xtensa/xtensa.h
@@ -479,6 +479,11 @@ enum reg_class
{ 0xffffffff, 0x0000000f } /* all registers */ \
}
+#define IRA_COVER_CLASSES \
+{ \
+ BR_REGS, FP_REGS, ACC_REG, AR_REGS, LIM_REG_CLASSES \
+}
+
/* A C expression whose value is a register class containing hard
register REGNO. In general there is more that one such class;
choose a class which is "minimal", meaning that no smaller class
@@ -882,7 +887,7 @@ typedef struct xtensa_args
#define MEMORY_MOVE_COST(MODE, CLASS, IN) 4
-#define BRANCH_COST 3
+#define BRANCH_COST(speed_p, predictable_p) 3
/* How to refer to registers in assembler output.
This sequence is indexed by compiler's hard-register-number (see above). */
diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
index 7d85956bfe4..cffbcd12f94 100644
--- a/gcc/config/xtensa/xtensa.md
+++ b/gcc/config/xtensa/xtensa.md
@@ -222,10 +222,11 @@
(any_extend:DI (match_operand:SI 2 "register_operand"))))]
"TARGET_MUL32_HIGH"
{
- emit_insn (gen_mulsi3 (gen_lowpart (SImode, operands[0]),
- operands[1], operands[2]));
+ rtx temp = gen_reg_rtx (SImode);
+ emit_insn (gen_mulsi3 (temp, operands[1], operands[2]));
emit_insn (gen_<u>mulsi3_highpart (gen_highpart (SImode, operands[0]),
operands[1], operands[2]));
+ emit_insn (gen_movsi (gen_lowpart (SImode, operands[0]), temp));
DONE;
})
diff --git a/gcc/configure b/gcc/configure
index 09d2768e669..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`
@@ -1017,7 +1017,7 @@ Optional Features:
enable expensive run-time checks. With LIST,
enable only specific categories of checks.
Categories are: yes,no,all,none,release.
- Flags are: assert,df,fold,gc,gcac,misc,
+ Flags are: assert,df,fold,gc,gcac,gimple,misc,
rtlflag,rtl,runtime,tree,valgrind,types.
--enable-coverage=LEVEL
enable compiler's code coverage collection.
@@ -7014,8 +7014,7 @@ fi
loose_warn=
save_CFLAGS="$CFLAGS"
-for option in -W -Wall -Wwrite-strings -Wstrict-prototypes \
- -Wmissing-prototypes -Wcast-qual; do
+for option in -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual; do
as_acx_Woption=`echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
echo "$as_me:$LINENO: checking whether $CC supports $option" >&5
@@ -7082,8 +7081,7 @@ CFLAGS="$save_CFLAGS"
strict_warn=
save_CFLAGS="$CFLAGS"
-for option in -Wold-style-definition -Wc++-compat \
- -Wmissing-format-attribute; do
+for option in -Wold-style-definition -Wc++-compat -Wmissing-format-attribute; do
as_acx_Woption=`echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
echo "$as_me:$LINENO: checking whether $CC supports $option" >&5
@@ -7149,16 +7147,13 @@ fi
CFLAGS="$save_CFLAGS"
if test "$GCC" = yes; then
- echo "$as_me:$LINENO: checking whether $CC supports -pedantic -Wno-long-long -Wno-variadic-macros \
- -Wno-overlength-strings" >&5
-echo $ECHO_N "checking whether $CC supports -pedantic -Wno-long-long -Wno-variadic-macros \
- -Wno-overlength-strings... $ECHO_C" >&6
-if test "${acx_cv_prog_cc_pedantic__Wno_long_long__Wno_variadic_macros_____________Wno_overlength_strings+set}" = set; then
+ echo "$as_me:$LINENO: checking whether $CC supports -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings" >&5
+echo $ECHO_N "checking whether $CC supports -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings... $ECHO_C" >&6
+if test "${acx_cv_prog_cc_pedantic_m4_do__Wno_long_long__Wno_variadic_macros_____________Wno_overlength_strings_+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
save_CFLAGS="$CFLAGS"
-CFLAGS="-pedantic -Wno-long-long -Wno-variadic-macros \
- -Wno-overlength-strings"
+CFLAGS="-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -7196,21 +7191,20 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- acx_cv_prog_cc_pedantic__Wno_long_long__Wno_variadic_macros_____________Wno_overlength_strings=yes
+ acx_cv_prog_cc_pedantic_m4_do__Wno_long_long__Wno_variadic_macros_____________Wno_overlength_strings_=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-acx_cv_prog_cc_pedantic__Wno_long_long__Wno_variadic_macros_____________Wno_overlength_strings=no
+acx_cv_prog_cc_pedantic_m4_do__Wno_long_long__Wno_variadic_macros_____________Wno_overlength_strings_=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$save_CFLAGS"
fi
-echo "$as_me:$LINENO: result: $acx_cv_prog_cc_pedantic__Wno_long_long__Wno_variadic_macros_____________Wno_overlength_strings" >&5
-echo "${ECHO_T}$acx_cv_prog_cc_pedantic__Wno_long_long__Wno_variadic_macros_____________Wno_overlength_strings" >&6
-if test $acx_cv_prog_cc_pedantic__Wno_long_long__Wno_variadic_macros_____________Wno_overlength_strings = yes; then
- strict_warn="$strict_warn${strict_warn:+ }-pedantic -Wno-long-long -Wno-variadic-macros \
- -Wno-overlength-strings"
+echo "$as_me:$LINENO: result: $acx_cv_prog_cc_pedantic_m4_do__Wno_long_long__Wno_variadic_macros_____________Wno_overlength_strings_" >&5
+echo "${ECHO_T}$acx_cv_prog_cc_pedantic_m4_do__Wno_long_long__Wno_variadic_macros_____________Wno_overlength_strings_" >&6
+if test $acx_cv_prog_cc_pedantic_m4_do__Wno_long_long__Wno_variadic_macros_____________Wno_overlength_strings_ = yes; then
+ strict_warn="$strict_warn${strict_warn:+ }-pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings"
fi
@@ -7266,25 +7260,25 @@ do
# these set all the flags to specific states
yes) ac_assert_checking=1 ; ac_checking=1 ; ac_df_checking= ;
ac_fold_checking= ; ac_gc_checking=1 ;
- ac_gc_always_collect= ; ac_rtl_checking= ;
+ ac_gc_always_collect= ; ac_gimple_checking=1 ; ac_rtl_checking= ;
ac_rtlflag_checking=1 ; ac_runtime_checking=1 ;
ac_tree_checking=1 ; ac_valgrind_checking= ;
ac_types_checking=1 ;;
no|none) ac_assert_checking= ; ac_checking= ; ac_df_checking= ;
ac_fold_checking= ; ac_gc_checking= ;
- ac_gc_always_collect= ; ac_rtl_checking= ;
+ ac_gc_always_collect= ; ac_gimple_checking= ; ac_rtl_checking= ;
ac_rtlflag_checking= ; ac_runtime_checking= ;
ac_tree_checking= ; ac_valgrind_checking= ;
ac_types_checking= ;;
all) ac_assert_checking=1 ; ac_checking=1 ; ac_df_checking=1 ;
ac_fold_checking=1 ; ac_gc_checking=1 ;
- ac_gc_always_collect=1 ; ac_rtl_checking=1 ;
+ ac_gc_always_collect=1 ; ac_gimple_checking=1 ; ac_rtl_checking=1 ;
ac_rtlflag_checking=1 ; ac_runtime_checking=1 ;
ac_tree_checking=1 ; ac_valgrind_checking= ;
ac_types_checking=1 ;;
release) ac_assert_checking=1 ; ac_checking= ; ac_df_checking= ;
ac_fold_checking= ; ac_gc_checking= ;
- ac_gc_always_collect= ; ac_rtl_checking= ;
+ ac_gc_always_collect= ; ac_gimple_checking= ; ac_rtl_checking= ;
ac_rtlflag_checking= ; ac_runtime_checking=1 ;
ac_tree_checking= ; ac_valgrind_checking= ;
ac_types_checking= ;;
@@ -7294,6 +7288,7 @@ do
fold) ac_fold_checking=1 ;;
gc) ac_gc_checking=1 ;;
gcac) ac_gc_always_collect=1 ;;
+ gimple) ac_gimple_checking=1 ;;
misc) ac_checking=1 ;;
rtl) ac_rtl_checking=1 ;;
rtlflag) ac_rtlflag_checking=1 ;;
@@ -7332,6 +7327,13 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
fi
+if test x$ac_gimple_checking != x ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define ENABLE_GIMPLE_CHECKING 1
+_ACEOF
+
+fi
if test x$ac_runtime_checking != x ; then
@@ -8541,7 +8543,7 @@ else
case $ac_prog_version in
'') gcc_cv_prog_makeinfo_modern=no;;
- 4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*) gcc_cv_prog_makeinfo_modern=yes;;
+ 4.[7-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*) gcc_cv_prog_makeinfo_modern=yes;;
*) gcc_cv_prog_makeinfo_modern=no;;
esac
@@ -13962,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"
@@ -14723,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:14726: $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:14729: $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:14732: 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"
@@ -15784,7 +15782,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 15787 "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=$?
@@ -16404,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:16407: $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:16411: \$? = $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.
@@ -16726,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:16729: $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:16733: \$? = $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.
@@ -16831,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:16834: $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:16838: \$? = $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
@@ -16886,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:16889: $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:16893: \$? = $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
@@ -19683,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 19686 "configure"
+#line 19684 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -19783,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 19786 "configure"
+#line 19784 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -20834,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
@@ -22540,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
@@ -22757,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"
;;
@@ -23585,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.
@@ -24612,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 d5244bd3800..a42ac5c6f1d 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -322,12 +322,15 @@ AC_CHECK_TYPES([__int64], [AC_CHECK_SIZEOF(__int64)])
# * overlong strings
# So, we only use -pedantic if we can disable those warnings.
-ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \
- -Wmissing-prototypes -Wcast-qual], [loose_warn])
-ACX_PROG_CC_WARNING_OPTS([-Wold-style-definition -Wc++-compat \
- -Wmissing-format-attribute], [strict_warn])
-ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long -Wno-variadic-macros \
- -Wno-overlength-strings], [strict_warn])
+ACX_PROG_CC_WARNING_OPTS(
+ [m4_do([-W -Wall -Wwrite-strings -Wstrict-prototypes ],
+ [-Wmissing-prototypes -Wcast-qual])], [loose_warn])
+ACX_PROG_CC_WARNING_OPTS(
+ [m4_do([-Wold-style-definition -Wc++-compat ],
+ [-Wmissing-format-attribute])], [strict_warn])
+ACX_PROG_CC_WARNING_ALMOST_PEDANTIC(
+ [m4_do([-Wno-long-long -Wno-variadic-macros ],
+ [-Wno-overlength-strings])], [strict_warn])
ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual], [strict_warn])
# The above macros do nothing if the compiler is not GCC. However, the
@@ -350,7 +353,7 @@ AC_ARG_ENABLE(checking,
enable expensive run-time checks. With LIST,
enable only specific categories of checks.
Categories are: yes,no,all,none,release.
- Flags are: assert,df,fold,gc,gcac,misc,
+ Flags are: assert,df,fold,gc,gcac,gimple,misc,
rtlflag,rtl,runtime,tree,valgrind,types.],
[ac_checking_flags="${enableval}"],[
# Determine the default checks.
@@ -366,25 +369,25 @@ do
# these set all the flags to specific states
yes) ac_assert_checking=1 ; ac_checking=1 ; ac_df_checking= ;
ac_fold_checking= ; ac_gc_checking=1 ;
- ac_gc_always_collect= ; ac_rtl_checking= ;
+ ac_gc_always_collect= ; ac_gimple_checking=1 ; ac_rtl_checking= ;
ac_rtlflag_checking=1 ; ac_runtime_checking=1 ;
ac_tree_checking=1 ; ac_valgrind_checking= ;
ac_types_checking=1 ;;
no|none) ac_assert_checking= ; ac_checking= ; ac_df_checking= ;
ac_fold_checking= ; ac_gc_checking= ;
- ac_gc_always_collect= ; ac_rtl_checking= ;
+ ac_gc_always_collect= ; ac_gimple_checking= ; ac_rtl_checking= ;
ac_rtlflag_checking= ; ac_runtime_checking= ;
ac_tree_checking= ; ac_valgrind_checking= ;
ac_types_checking= ;;
all) ac_assert_checking=1 ; ac_checking=1 ; ac_df_checking=1 ;
ac_fold_checking=1 ; ac_gc_checking=1 ;
- ac_gc_always_collect=1 ; ac_rtl_checking=1 ;
+ ac_gc_always_collect=1 ; ac_gimple_checking=1 ; ac_rtl_checking=1 ;
ac_rtlflag_checking=1 ; ac_runtime_checking=1 ;
ac_tree_checking=1 ; ac_valgrind_checking= ;
ac_types_checking=1 ;;
release) ac_assert_checking=1 ; ac_checking= ; ac_df_checking= ;
ac_fold_checking= ; ac_gc_checking= ;
- ac_gc_always_collect= ; ac_rtl_checking= ;
+ ac_gc_always_collect= ; ac_gimple_checking= ; ac_rtl_checking= ;
ac_rtlflag_checking= ; ac_runtime_checking=1 ;
ac_tree_checking= ; ac_valgrind_checking= ;
ac_types_checking= ;;
@@ -394,6 +397,7 @@ do
fold) ac_fold_checking=1 ;;
gc) ac_gc_checking=1 ;;
gcac) ac_gc_always_collect=1 ;;
+ gimple) ac_gimple_checking=1 ;;
misc) ac_checking=1 ;;
rtl) ac_rtl_checking=1 ;;
rtlflag) ac_rtlflag_checking=1 ;;
@@ -422,6 +426,12 @@ if test x$ac_assert_checking != x ; then
AC_DEFINE(ENABLE_ASSERT_CHECKING, 1,
[Define if you want assertions enabled. This is a cheap check.])
fi
+if test x$ac_gimple_checking != x ; then
+ AC_DEFINE(ENABLE_GIMPLE_CHECKING, 1,
+[Define if you want operations on GIMPLE (the basic data structure of
+the high-level optimizers) to be checked for dynamic type safety at
+runtime. This is moderately expensive.])
+fi
GCC_TARGET_TEMPLATE(ENABLE_RUNTIME_CHECKING)
if test x$ac_runtime_checking != x ; then
AC_DEFINE(ENABLE_RUNTIME_CHECKING, 1,
@@ -842,7 +852,7 @@ AC_CHECK_PROG(have_mktemp_command, mktemp, yes, no)
# that we can use it.
ACX_CHECK_PROG_VER(MAKEINFO, makeinfo, --version,
[GNU texinfo.* \([0-9][0-9.]*\)],
- [4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*])
+ [4.[7-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*])
if test $gcc_cv_prog_makeinfo_modern = no; then
AC_MSG_WARN([
*** Makeinfo is missing or too old.
@@ -1597,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"
@@ -2174,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,
@@ -3000,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],,
@@ -3064,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"
;;
@@ -3559,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/coretypes.h b/gcc/coretypes.h
index f5d62cab785..e1d66a52608 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -47,11 +47,20 @@ typedef struct rtvec_def *rtvec;
typedef const struct rtvec_def *const_rtvec;
union tree_node;
typedef union tree_node *tree;
+union gimple_statement_d;
+typedef union gimple_statement_d *gimple;
typedef const union tree_node *const_tree;
+typedef const union gimple_statement_d *const_gimple;
union section;
typedef union section section;
struct cl_target_option;
struct cl_optimization;
+struct gimple_seq_d;
+typedef struct gimple_seq_d *gimple_seq;
+typedef const struct gimple_seq_d *const_gimple_seq;
+struct gimple_seq_node_d;
+typedef struct gimple_seq_node_d *gimple_seq_node;
+typedef const struct gimple_seq_node_d *const_gimple_seq_node;
/* The major intermediate representations of GCC. */
enum ir_type {
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 da6a3773dcd..30c6aa6e4c9 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,602 @@
+2008-08-29 Michael Meissner <gnu@the-meissners.org>
+
+ * decl.c (builtin_function_1): Take a bool argument to decide
+ whether to use pushdecl or pushdecl_top_level.
+ (duplicate_decls): Copy function specific target and optimization
+ options on duplicate declarations.
+ (cxx_builtin_function): Update builtin_function_1 call.
+ (cxx_builtin_function_ext_scope): New function, guarantee that the
+ declaration is done at global scope.
+
+ * cp-objcp-common.h (LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE): New
+ macro, define builtin function hook for delayed machine specific
+ builtins.
+
+ * cp-tree.h (cxx_builtin_function_ext_scope): Add declaration.
+
+2008-08-30 Jason Merrill <jason@redhat.com>
+
+ PR c++/37288
+ * pt.c (dependent_type_p): Don't abort on auto outside of a template.
+
+2008-08-29 Jason Merrill <jason@redhat.com>
+
+ Implement C++0x 'auto' semantics.
+ * decl.c (start_decl_1): Don't complain about auto being incomplete.
+ (cp_finish_decl): Deduce auto.
+ * init.c (build_new): Handle 'new auto'.
+ * typeck2.c (cxx_incomplete_type_diagnostic): Give a different
+ message for auto than for normal template type parms.
+ * pt.c (type_dependent_expression_p): Handle { }.
+ (make_auto): New function.
+ (listify_autos): New function.
+ (do_auto_deduction): New function.
+ (is_auto): New function.
+ (type_uses_auto): New function.
+ * cp-tree.h: Declare them.
+ * parser.c (cp_parser_decl_specifier_seq): In C++0x mode, don't
+ treat auto as a declspec.
+ (cp_parser_simple_type_specifier): It's a type-specifier.
+
+2008-08-29 Mark Mitchell <mark@codesourcery.com>
+
+ * mangle.c (write_type): Add target-specific manglings for
+ non-fundamental types to the substitution table.
+ gcc/testsuite/
+
+2008-08-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/29635
+ PR fortran/23057
+ * name-lookup.c (do_using_directive, cp_emit_debug_info_for_using):
+ Adjust debug_hooks->imported_module_or_decl callers.
+
+2008-08-29 Jan Hubicka <jh@suse.cz>
+
+ * cp-gimplify.c (cp_gimplify_expr): Add PRED_CONTINUE heuristic.
+
+2008-08-28 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/37260
+ * decl.c (reshape_init_r): Check init for error_mark_node.
+
+2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c++/17880
+ * semantics.c (maybe_convert_cond): Call verify_sequence_points.
+ (finish_return_stmt): Likewise.
+ (finish_switch_condition): Likewise.
+
+2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ * cp-tree.h: Fix #error directive.
+
+2008-08-26 Douglas Gregor <doug.gregor@gmail.com>
+
+ * typeck.c (type_after_usual_arithmetic_conversions): Don't do the
+ usual arithmetic conversions on scoped enumeration types.
+ (common_type): Ditto.
+ (default_conversion): Don't perform integral promotions on scoped
+ enumeration types.
+ (build_array_ref): Scoped enumeration types can't be used as
+ subscripts.
+ * decl.c (start_enum): If building a C++0x scoped enumeration,
+ enter its scope. If provided with an underlying type, check that
+ underlying type and set up the enumeration type accordingly.
+ (finish_enum): Only compute an underlying type if the underlying
+ type isn't already fixed, and only convert the enumerator values
+ now if we've just computed the underlying type. Finish the scope
+ of C++0x scoped enumerations.
+ (build_enumerator): For enumerations with a fixed underlying type,
+ check the enumerator values when the enumerator is defined.
+ (lookup_enumerator): New.
+ * call.c (standard_conversion): Don't allow assignment from
+ integers to scoped enumeration types, even with -fpermissive.
+ Don't convert from scoped enumerations to bool or any arithmetic
+ types.
+ (build_conditional_expr): Don't per the usual arithmetic
+ conversions for scoped enumeration types.
+ (convert_like_real): Check complain to see if we should
+ produce warnings.
+ * error.c (class_key_or_enum_as_string): Print scoped enums.
+ * cp-tree.h (MAYBE_CLASS_TYPE_P): Check CLASS_TYPE_P, not
+ TYPE_LANG_FLAG_5.
+ (INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P): New.
+ (SCOPED_ENUM_P): New.
+ (UNSCOPED_ENUM_P): New.
+ (SET_SCOPED_ENUM_P): New.
+ (ENUM_UNDERLYING_TYPE): New.
+ * pt.c (lookup_template_class): Update the instantiation of enum
+ types to deal with C++0x scoped enumerations and underlying
+ types.
+ * name-lookup.c (begin_scope): Deal with scoped enumeration
+ scopes.
+ (lookup_qualified_name): Deal with lookup into enumeration types.
+ * name-lookup.h (enum scope_kind): Add sk_scoped_enum.
+ * parser.c (cp_parser_class_or_namespace_name): Rename to...
+ (cp_parser_qualifying_entity): ... this. Also, in C++0x mode,
+ parse a type-name that can be an enumeration type.
+ (cp_parser_nested_name_specifier_opt): Update with C++0x grammar.
+ (cp_parser_elaborated_type_specifier): Parse the
+ optional `struct' or `class' following enum (in C++0x).
+ (cp_parser_enum_specifier): Parse C++0x scoped enumerations and
+ enum-base clauses.
+
+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,
+ 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
+ * decl2.c (fix_temporary_vars_context_r): New function.
+ (one_static_initialization_or_destruction): Make sure temporary
+ variables part of the initialiser have their DECL_CONTEXT()
+ properly set.
+
+2008-07-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 34389
+ * typeck.c (build_binary_op): Encapsulate code into
+ shorten_binary_op.
+
+2008-07-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/36852
+ * tree.c (cplus_array_hash, build_cplus_array_type_1): Hash on
+ TYPE_UID instead of pointers.
+
+2008-07-29 Jan Hubicka <jh@suse.cz>
+
+ * optimize.c (maybe_clone_body): Remove DECL_INLINE.
+ * decl.c (duplicate_decls): Likewise.
+ (grokfndecl): Likewise.
+ (start_method): Likewise.
+ * method.c (make_thunk, make_alias_for, implicitly_declare_fn):
+ Likewise.
+ * pt.c (register_specialization, regenerate_decl_from_template):
+ Likewise.
+ * decl2.c (grokfield): Likewise.
+
+2008-07-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 34985
+ * decl.c (duplicate_decls): Merge USED flags.
+
+2008-07-27 Jason Merrill <jason@redhat.com>
+
+ PR c++/36943
+ * decl.c (reshape_init_r): Allow C++0x initializer lists.
+
+2008-07-28 Richard Guenther <rguenther@suse.de>
+
+ Merge from gimple-tuples-branch.
+
+ 2008-07-22 Aldy Hernandez <aldyh@redhat.com>
+
+ * cp-gimplify.c (gimplify_if_stmt): Set location on newly created
+ COND_EXPR.
+
+ 2008-07-18 Jakub Jelinek <jakub@redhat.com>
+
+ * decl.c (finish_function): Call gimple_body after cp_genericize.
+
+ 2008-07-18 Aldy Hernandez <aldyh@redhat.com>
+
+ * optimize.c: Include gimple.h instead of tree-gimple.h.
+ * Make-lang.in (cp-gimplify.o): Depend on tree-iterator.h.
+ * cp-gimplify.c: Rename tree-gimple.h to gimple.h. Include
+ tree-iterator.h.
+
+ 2008-07-16 Jakub Jelinek <jakub@redhat.com>
+
+ * optimize.c (maybe_clone_body): Clear DECL_SAVED_TREE for the clone.
+
+ 2008-07-14 Jakub Jelinek <jakub@redhat.com>
+
+ * cp-gimplify.c (cp_gimplify_expr): Update comment.
+
+ 2008-07-14 Aldy Hernandez <aldyh@redhat.com>
+
+ * cp-tree.h (union lang_tree_node): Rename GENERIC_NEXT to
+ TREE_CHAIN.
+ * cp-gimplify.c (cxx_omp_clause_apply_fn): Rename
+ GIMPLE_MODIFY_STMT to MODIFY_EXPR.
+ (cxx_omp_clause_copy_ctor): Same.
+ (cxx_omp_clause_assign_op): Same.
+
+ 2008-05-28 Jakub Jelinek <jakub@redhat.com>
+
+ * cp-gimplify.c (cp_gimplify_omp_for): Add pre_p argument. Tuplify.
+ (cp_gimplify_expr): Adjust caller.
+
+ 2008-05-11 Doug Kwan <dougkwan@google.com>
+
+ * init.c (build_vec_delete): Add type conversion for argument
+ 0 of POINTER_PLUS_EXPR.
+
+ 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)
+
+ 2008-04-10 Diego Novillo <dnovillo@google.com>
+
+ http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00913.html
+
+ * optimize.c (maybe_clone_body): Re-enable call to
+ clone_body.
+ * cp-gimplify.c (cp_gimplify_omp_for): Mark disabled
+ code with call to gimple_unreachable.
+ (cp_genericize): Fix handling of clone bodies.
+
+ 2008-04-04 Diego Novillo <dnovillo@google.com>
+
+ http://gcc.gnu.org/ml/gcc-patches/2008-04/msg00413.html
+
+ * optimize.c (maybe_clone_body): Re-enable.
+
+ 2008-02-19 Diego Novillo <dnovillo@google.com>
+ Oleg Ryjkov <olegr@google.com>
+
+ http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00804.html
+
+ * cp-gimplify.c (gimplify_for_stmt): Change gimple_seq
+ argument to gimple_seq *. Update all users.
+ (gimplify_must_not_throw_expr): Likewise.
+
+ 2008-02-04 Oleg Ryjkov <olegr@google.com>
+
+ * except.c: Include gimple.h
+ (cp_protect_cleanup_actions): Convert to tuples.
+ * Make-lang.in (cp/except.o): Add dependency on gimple.h
+
+ 2007-11-10 Aldy Hernandez <aldyh@redhat.com>
+
+ * cp-gimplify.c (gimplify_cp_loop): Call tree_annotate_all_with_locus
+ instead of annotating each block manually.
+
+ 2007-10-30 Aldy Hernandez <aldyh@redhat.com>
+
+ * cp-gimplify.c (gimplify_cp_loop): Tuplify.
+ (gimplify_for_stmt): Same.
+ (gimplify_switch_stmt): Same.
+ (cp_gimplify_expr): [FOR_STMT]: Do not call gimplify_for_stmt. Return
+ GS_OK.
+ [WHILE_STMT]: Return GS_OK.
+ [SWITCH_STMT]: Same.
+ [CONTINUE_STMT]: Same.
+ [BREAK_STMT]: Same.
+ (cp_genericize): Set gimple_body() of cloned functions when needed.
+
+ 2007-10-29 Aldy Hernandez <aldy@quesejoda.com>
+
+ * cp-gimplify.c: Move build_gimple_eh_filter_tree here.
+ (cp_gimplify_init_expr): Convert to tuples.
+ (gimplify_must_not_throw_expr): Make function return a
+ gimplify_status and convert to tuples.
+
+ 2007-10-18 Aldy Hernandez <aldy@quesejoda.com>
+
+ * cp-gimplify.c (genericize_try_block): Enable and do not call
+ gimplify_stmt.
+ (genericize_catch_block): Same.
+ (genericize_eh_spec_block): Same.
+ Rename gimple_build_eh_filter_tree to build_gimple_eh_filter_tree.
+ (cp_gimplify_expr): Enable TRY_BLOCK, HANDLER, and EH_SPEC_BLOCK.
+
+ 2007-10-16 Aldy Hernandez <aldy@quesejoda.com>
+
+ * optimize.c (maybe_clone_body): Comment out call to clone_body.
+ * decl.c (finish_function): Use gimple_body instead of
+ DECL_SAVED_TREE.
+ * cp-tree.h (cp_gimplify_expr): Last 2 arguments are sequences.
+ * cp-gimplify.c (genericize_try_block): Comment out.
+ (genericize_catch_block): Same.
+ (genericize_eh_spec_block): Same.
+ (gimplify_cp_loop): Comment out calls to gimplify_stmt.
+ (gimplify_for_stmt): Comment out.
+ (gimplify_switch_stmt): Comment out call to gimplify_stmt.
+ (cp_gimplify_omp_for): Same.
+ (gimplify_must_not_throw_expr): Argument pre_p is a sequence.
+ Comment out call to gimplify_stmt and append_to_statement_list.
+ Rename gimple_build_eh_filter_tree to build_gimple_eh_filter_tree.
+ (cp_gimplify_init_expr): Arguments pre_p and post_p are sequences.
+ (cp_gimplify_expr): Same.
+ Comment out calls to genericize_*_block. Comment out call to
+ gimplify_for_stmt.
+
+2008-07-27 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR c++/36944
+ * class.c (type_has_user_provided_default_constructor): Handle
+ default parameters.
+
+2008-07-27 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * decl.c (push_library_fn): Add a parameter for the exceptions that
+ the function may throw.
+ (push_void_library_fn, push_throw_library_fn, expand_static_init):
+ Adjust.
+ (build_library_fn): Change to static.
+ * cp-tree.h: Adjust declarations.
+ * except.c (declare_nothrow_library_fn): New.
+ (do_get_exception_ptr, do_begin_catch, do_free_exception,
+ do_allocate_exception): Use the latter, adjust the declarations
+ (ie, add empty exception-specification), consistently with the
+ actual implementation in libsupc++.
+
+2008-07-25 Jan Hubicka <jh@suse.cz>
+
+ * typeck.c (inline_conversion): Remove.
+ (cp_build_function_call): Do not use inline_conversion.
+ * decl.c (duplicate_decls): Do not insist on inline being declared
+ early.
+ (start_cleanup_fn): Do not assume that INLINE flags prevent function
+ from being output. We now remove static functions always.
+ (finish_function): Do return warning on all static functions.
+ * call.c (build_over_call): Do not use inline_conversion.
+ * cp-tree.h (possibly_inlined_p): Declare.
+ (inline_conversion): Remove.
+ * pt.c (instantiate_decl): Use possibly_inlined_p predicate.
+ * decl2.c (cp_write_global_declarations): Likewise.
+ (mark_used): Likewise.
+ (possibly_inlined_p): New functions.
+
+2008-07-25 Jason Merrill <jason@redhat.com>
+
+ * class.c (type_has_user_provided_default_constructor): Handle
+ templates.
+
+2008-07-23 Jan Hubicka <jh@suse.cz>
+
+ * decl.c (duplicate_decls): Update comment and unit-at-a-time.
+ (grogfndecl): Drop flag_inline_trees code.
+ * pt.c (instantiate_decl): Drop flag_iline_trees code.
+ * lex.c (cxx_init): Do not set unit-at-a-time.
+
+2008-07-23 Jason Merrill <jason@redhat.com>
+
+ * mangle.c (write_unqualified_name): Avoid infinite recursion when
+ trying to mangle a decl with no name.
+
+ Implement defaulted/deleted functions as per N2346
+ * cp-tree.h (struct lang_decl_flags): Add defaulted_p bitfield.
+ (DECL_DELETED_FN): New macro.
+ (DECL_DEFAULTED_FN): New macro.
+ * class.c (user_provided_p): New fn.
+ (defaultable_fn_p): New fn.
+ (type_has_user_provided_constructor): New fn.
+ (type_has_user_provided_default_constructor): New fn.
+ (check_methods): A defaulted fn is still trivial.
+ (check_bases_and_members): Likewise.
+ * decl.c (grok_special_member_properties): Likewise.
+ (duplicate_decls): Complain about redeclaring a function as deleted.
+ (start_decl): initialized==2 means deleted.
+ (cp_finish_decl): Handle deleted/defaulted semantics.
+ * decl2.c (grokfield): Likewise.
+ (mark_used): Check DECL_DEFAULTED_FN instead of DECL_ARTIFICIAL.
+ Complain about using a deleted fn.
+ * init.c (build_value_init_1): Use type_has_user_provided_constructor.
+ (perform_member_init): Check for a user-provided default constructor
+ even if TYPE_NEEDS_CONSTRUCTING.
+ (build_new_1): Likewise.
+ * call.c (build_over_call): Don't call mark_used twice.
+ * method.c (implicitly_declare_fn): Set DECL_DEFAULTED_FN.
+ * search.c (check_final_overrider): Check for deleted mismatch.
+ * parser.c (cp_parser_init_declarator): Tell start_decl about =delete.
+ (cp_parser_pure_specifier): Handle =default and =delete.
+
+ * error.c (maybe_warn_cpp0x): Suggest -std=gnu++0x as well.
+
+2008-07-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 35058
+ * typeck.c: All calls to pedwarn changed.
+ * decl.c: All calls to pedwarn changed.
+ * call.c: All calls to pedwarn changed.
+ * error.c: All calls to pedwarn changed.
+ * typeck2.c: All calls to pedwarn changed.
+ * pt.c: All calls to pedwarn changed.
+ * name-lookup.c: All calls to pedwarn changed.
+ * parser.c: All calls to pedwarn changed.
+
2008-07-21 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* call.c: Fix comment typos.
@@ -204,7 +803,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 { }.
@@ -224,7 +823,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.
@@ -242,7 +841,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.
@@ -255,7 +854,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.
@@ -375,16 +974,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>
@@ -456,22 +1055,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>
@@ -527,16 +1126,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>
@@ -643,7 +1242,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>
@@ -661,14 +1260,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.
@@ -680,14 +1279,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>
@@ -804,7 +1403,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>
@@ -832,14 +1431,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>
@@ -893,17 +1492,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>
@@ -915,208 +1514,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>
@@ -1179,8 +1778,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
@@ -1193,17 +1792,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>
@@ -1259,7 +1858,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
@@ -1332,7 +1931,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
@@ -1340,25 +1939,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>
@@ -1367,7 +1966,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>
@@ -1379,7 +1978,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
@@ -1403,8 +2002,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>
@@ -1471,8 +2070,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>
@@ -1485,7 +2084,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
@@ -1519,12 +2118,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
@@ -1533,7 +2132,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>
@@ -1586,7 +2185,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
@@ -1602,7 +2201,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.
@@ -1619,15 +2218,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>
@@ -1660,7 +2259,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
@@ -1728,7 +2327,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
@@ -1737,14 +2336,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>
@@ -1760,13 +2359,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.
@@ -1808,14 +2407,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.
@@ -1895,42 +2494,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
@@ -1954,9 +2553,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>
@@ -1974,13 +2573,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
@@ -1989,9 +2588,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>
@@ -2061,38 +2660,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>
@@ -2132,7 +2731,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.
@@ -2161,11 +2760,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
@@ -2336,7 +2935,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
@@ -2374,7 +2973,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>
@@ -2448,12 +3047,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
@@ -2520,7 +3119,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>
@@ -2564,8 +3163,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.
@@ -2670,7 +3269,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.
@@ -2690,7 +3289,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>
@@ -2773,14 +3372,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>
@@ -2791,22 +3390,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
@@ -2852,7 +3451,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
@@ -3089,7 +3688,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>
@@ -3147,7 +3746,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.
@@ -3160,7 +3759,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.
@@ -3508,9 +4107,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
@@ -3661,7 +4260,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
@@ -3728,7 +4327,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.
@@ -3948,9 +4547,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
@@ -3991,7 +4590,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
@@ -4020,7 +4619,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>
@@ -4117,14 +4716,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
@@ -4150,7 +4749,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>
@@ -4166,8 +4765,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
@@ -4274,7 +4873,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>
@@ -4311,11 +4910,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
@@ -4453,13 +5052,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
@@ -4483,7 +5082,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
@@ -4506,13 +5105,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.
@@ -4541,7 +5140,7 @@
PR c++/30328
* semantics.c (finish_typeof): Use unlowered_expr_type.
-
+
2007-03-10 Mark Mitchell <mark@codesourcery.com>
PR c++/30274
@@ -4585,7 +5184,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
@@ -4612,17 +5211,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.
@@ -4664,7 +5263,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.
@@ -4676,10 +5275,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.
@@ -4765,13 +5364,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.
@@ -4785,7 +5384,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.
@@ -4809,7 +5408,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
@@ -4825,7 +5424,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.
@@ -4922,7 +5521,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>
@@ -4932,15 +5531,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
@@ -4952,7 +5551,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.
@@ -4981,7 +5580,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.
@@ -4989,23 +5588,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.
@@ -5016,7 +5615,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
@@ -5093,9 +5692,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.
@@ -5120,7 +5719,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
@@ -5208,13 +5807,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
@@ -5245,7 +5844,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/Make-lang.in b/gcc/cp/Make-lang.in
index c7877205f25..03963446251 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -239,7 +239,7 @@ cp/decl.o: cp/decl.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) cp/decl.h \
debug.h gt-cp-decl.h $(TIMEVAR_H) $(TREE_FLOW_H) $(TARGET_H)
cp/decl2.o: cp/decl2.c $(CXX_TREE_H) $(TM_H) $(FLAGS_H) cp/decl.h $(EXPR_H) \
output.h except.h toplev.h $(RTL_H) $(C_COMMON_H) gt-cp-decl2.h $(CGRAPH_H) \
- $(C_PRAGMA_H) $(TREE_DUMP_H) intl.h $(TARGET_H)
+ $(C_PRAGMA_H) $(TREE_DUMP_H) intl.h $(TARGET_H) $(GIMPLE_H)
cp/cp-objcp-common.o : cp/cp-objcp-common.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TREE_H) $(CXX_TREE_H) $(C_COMMON_H) toplev.h \
langhooks.h $(LANGHOOKS_DEF_H) $(DIAGNOSTIC_H) debug.h \
@@ -280,17 +280,17 @@ cp/repo.o: cp/repo.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_H) \
gt-cp-repo.h
cp/semantics.o: cp/semantics.c $(CXX_TREE_H) $(TM_H) except.h toplev.h \
$(FLAGS_H) debug.h output.h $(RTL_H) $(TIMEVAR_H) $(EXPR_H) \
- $(TREE_INLINE_H) $(CGRAPH_H) $(TARGET_H) $(C_COMMON_H)
+ $(TREE_INLINE_H) $(CGRAPH_H) $(TARGET_H) $(C_COMMON_H) $(GIMPLE_H)
cp/dump.o: cp/dump.c $(CXX_TREE_H) $(TM_H) $(TREE_DUMP_H)
cp/optimize.o: cp/optimize.c $(CXX_TREE_H) $(TM_H) rtl.h $(INTEGRATE_H) \
- insn-config.h input.h $(PARAMS_H) debug.h $(TREE_INLINE_H) $(TREE_GIMPLE_H) \
+ insn-config.h input.h $(PARAMS_H) debug.h $(TREE_INLINE_H) $(GIMPLE_H) \
$(TARGET_H)
cp/mangle.o: cp/mangle.c $(CXX_TREE_H) $(TM_H) toplev.h $(REAL_H) \
gt-cp-mangle.h $(TARGET_H) $(TM_P_H)
cp/parser.o: cp/parser.c $(CXX_TREE_H) $(TM_H) $(DIAGNOSTIC_H) gt-cp-parser.h \
output.h $(TARGET_H)
cp/cp-gimplify.o: cp/cp-gimplify.c $(CXX_TREE_H) toplev.h $(C_COMMON_H) \
- $(TM_H) coretypes.h pointer-set.h
+ $(TM_H) coretypes.h pointer-set.h tree-iterator.h
cp/name-lookup.o: cp/name-lookup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(CXX_TREE_H) $(TIMEVAR_H) gt-cp-name-lookup.h toplev.h \
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 93ce4d8366d..6a6c2c25c18 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... */
@@ -772,7 +771,7 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
conv = build_conv (ck_std, to, conv);
conv->bad_p = true;
}
- else if (tcode == ENUMERAL_TYPE && fcode == INTEGER_TYPE)
+ else if (UNSCOPED_ENUM_P (to) && fcode == INTEGER_TYPE)
{
/* For backwards brain damage compatibility, allow interconversion of
enums and integers with a pedwarn. */
@@ -897,10 +896,11 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
{
/* [conv.bool]
- An rvalue of arithmetic, enumeration, pointer, or pointer to
- member type can be converted to an rvalue of type bool. */
+ An rvalue of arithmetic, unscoped enumeration, pointer, or
+ pointer to member type can be converted to an rvalue of type
+ bool. */
if (ARITHMETIC_TYPE_P (from)
- || fcode == ENUMERAL_TYPE
+ || UNSCOPED_ENUM_P (from)
|| fcode == POINTER_TYPE
|| TYPE_PTR_TO_MEMBER_P (from))
{
@@ -920,7 +920,8 @@ standard_conversion (tree to, tree from, tree expr, bool c_cast_p,
/* As an extension, allow conversion to complex type. */
else if (ARITHMETIC_TYPE_P (to))
{
- if (! (INTEGRAL_CODE_P (fcode) || fcode == REAL_TYPE))
+ if (! (INTEGRAL_CODE_P (fcode) || fcode == REAL_TYPE)
+ || SCOPED_ENUM_P (from))
return NULL;
conv = build_conv (ck_std, to, conv);
@@ -2546,24 +2547,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
@@ -3404,8 +3405,9 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3,
calculated only once. */
if (!arg2)
{
- if (pedantic && (complain & tf_error))
- pedwarn ("ISO C++ forbids omitting the middle term of a ?: expression");
+ if (complain & tf_error)
+ 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. */
if (real_lvalue_p (arg1))
@@ -3702,9 +3704,9 @@ build_conditional_expr (tree arg1, tree arg2, tree arg3,
type; the usual arithmetic conversions are performed to bring
them to a common type, and the result is of that type. */
else if ((ARITHMETIC_TYPE_P (arg2_type)
- || TREE_CODE (arg2_type) == ENUMERAL_TYPE)
+ || UNSCOPED_ENUM_P (arg2_type))
&& (ARITHMETIC_TYPE_P (arg3_type)
- || TREE_CODE (arg3_type) == ENUMERAL_TYPE))
+ || UNSCOPED_ENUM_P (arg3_type)))
{
/* In this case, there is always a common type. */
result_type = type_after_usual_arithmetic_conversions (arg2_type,
@@ -4038,7 +4040,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);
@@ -4444,7 +4446,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;
@@ -4454,11 +4456,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;
}
@@ -4504,7 +4506,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
@@ -4535,9 +4537,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;
@@ -4681,12 +4683,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);
@@ -4790,7 +4793,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
if (convs->check_narrowing)
check_narrowing (totype, expr);
- if (issue_conversion_warnings)
+ if (issue_conversion_warnings && (complain & tf_warning))
expr = convert_and_check (totype, expr);
else
expr = convert (totype, expr);
@@ -5089,6 +5092,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
int is_method = 0;
int nargs;
tree *argarray;
+ bool already_used = false;
/* In a template, there is no need to perform all of the work that
is normally done. We are only interested in the type of the call
@@ -5189,7 +5193,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;
@@ -5309,7 +5313,10 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
/* [class.copy]: the copy constructor is implicitly defined even if
the implementation elided its use. */
if (TYPE_HAS_COMPLEX_INIT_REF (DECL_CONTEXT (fn)))
- mark_used (fn);
+ {
+ mark_used (fn);
+ already_used = true;
+ }
/* If we're creating a temp and we already have one, don't create a
new one. If we're not creating a temp but we get one, use
@@ -5369,7 +5376,8 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
return val;
}
- mark_used (fn);
+ if (!already_used)
+ mark_used (fn);
if (DECL_VINDEX (fn) && (flags & LOOKUP_NONVIRTUAL) == 0)
{
@@ -5394,8 +5402,6 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
fn = build_vfn_ref (argarray[0], DECL_VINDEX (fn));
TREE_TYPE (fn) = t;
}
- else if (DECL_INLINE (fn))
- fn = inline_conversion (fn);
else
fn = build_addr_func (fn);
@@ -6643,10 +6649,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);
@@ -6760,7 +6768,7 @@ tweak:
{
if (warn)
{
- warning (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 0c7a76c697a..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);
@@ -3045,10 +3045,10 @@ check_field_decls (tree t, tree *access_decls,
/* Core issue 80: A nonstatic data member is required to have a
different name from the class iff the class has a
- user-defined constructor. */
+ 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. */
@@ -3767,8 +3767,8 @@ check_methods (tree t)
if (DECL_PURE_VIRTUAL_P (x))
VEC_safe_push (tree, gc, CLASSTYPE_PURE_VIRTUALS (t), x);
}
- /* All user-declared destructors are non-trivial. */
- if (DECL_DESTRUCTOR_P (x))
+ /* All user-provided destructors are non-trivial. */
+ if (DECL_DESTRUCTOR_P (x) && !DECL_DEFAULTED_FN (x))
TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) = 1;
}
}
@@ -4067,6 +4067,91 @@ type_has_user_nondefault_constructor (tree t)
return false;
}
+/* Returns true iff FN is a user-provided function, i.e. user-declared
+ and not defaulted at its first declaration. */
+
+static bool
+user_provided_p (tree fn)
+{
+ if (TREE_CODE (fn) == TEMPLATE_DECL)
+ return true;
+ else
+ return (!DECL_ARTIFICIAL (fn)
+ && !(DECL_DEFAULTED_FN (fn)
+ && DECL_INITIALIZED_IN_CLASS_P (fn)));
+}
+
+/* Returns true iff class T has a user-provided constructor. */
+
+bool
+type_has_user_provided_constructor (tree t)
+{
+ tree fns;
+
+ if (!TYPE_HAS_USER_CONSTRUCTOR (t))
+ return false;
+
+ /* This can happen in error cases; avoid crashing. */
+ if (!CLASSTYPE_METHOD_VEC (t))
+ return false;
+
+ for (fns = CLASSTYPE_CONSTRUCTORS (t); fns; fns = OVL_NEXT (fns))
+ if (user_provided_p (OVL_CURRENT (fns)))
+ return true;
+
+ return false;
+}
+
+/* Returns true iff class T has a user-provided default constructor. */
+
+bool
+type_has_user_provided_default_constructor (tree t)
+{
+ tree fns, args;
+
+ if (!TYPE_HAS_USER_CONSTRUCTOR (t))
+ return false;
+
+ for (fns = CLASSTYPE_CONSTRUCTORS (t); fns; fns = OVL_NEXT (fns))
+ {
+ tree fn = OVL_CURRENT (fns);
+ if (TREE_CODE (fn) == FUNCTION_DECL
+ && user_provided_p (fn))
+ {
+ args = FUNCTION_FIRST_USER_PARMTYPE (fn);
+ while (args && TREE_PURPOSE (args))
+ args = TREE_CHAIN (args);
+ if (!args || args == void_list_node)
+ return true;
+ }
+ }
+
+ return false;
+}
+
+/* Returns true if FN can be explicitly defaulted. */
+
+bool
+defaultable_fn_p (tree fn)
+{
+ if (DECL_CONSTRUCTOR_P (fn))
+ {
+ if (skip_artificial_parms_for (fn, DECL_ARGUMENTS (fn))
+ == NULL_TREE)
+ return true;
+ else if (copy_fn_p (fn) > 0)
+ return true;
+ else
+ return false;
+ }
+ else if (DECL_DESTRUCTOR_P (fn))
+ return true;
+ else if (DECL_ASSIGNMENT_OPERATOR_P (fn))
+ return copy_fn_p (fn);
+ else
+ return false;
+}
+
/* Remove all zero-width bit-fields from T. */
static void
@@ -4158,6 +4243,8 @@ check_bases_and_members (tree t)
should take a non-const reference argument. */
int no_const_asn_ref;
tree access_decls;
+ bool saved_complex_asn_ref;
+ bool saved_nontrivial_dtor;
/* By default, we use const reference arguments and generate default
constructors. */
@@ -4171,6 +4258,12 @@ check_bases_and_members (tree t)
/* Check all the method declarations. */
check_methods (t);
+ /* Save the initial values of these flags which only indicate whether
+ or not the class has user-provided functions. As we analyze the
+ bases and members we can set these flags for other reasons. */
+ saved_complex_asn_ref = TYPE_HAS_COMPLEX_ASSIGN_REF (t);
+ saved_nontrivial_dtor = TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t);
+
/* Check all the data member declarations. We cannot call
check_field_decls until we have called check_bases check_methods,
as check_field_decls depends on TYPE_HAS_NONTRIVIAL_DESTRUCTOR
@@ -4186,37 +4279,34 @@ check_bases_and_members (tree t)
/* Do some bookkeeping that will guide the generation of implicitly
declared member functions. */
- TYPE_HAS_COMPLEX_INIT_REF (t)
- |= (TYPE_HAS_INIT_REF (t) || TYPE_CONTAINS_VPTR_P (t));
+ TYPE_HAS_COMPLEX_INIT_REF (t) |= TYPE_CONTAINS_VPTR_P (t);
/* We need to call a constructor for this class if it has a
- user-declared constructor, or if the default constructor is going
+ user-provided constructor, or if the default constructor is going
to initialize the vptr. (This is not an if-and-only-if;
TYPE_NEEDS_CONSTRUCTING is set elsewhere if bases or members
themselves need constructing.) */
TYPE_NEEDS_CONSTRUCTING (t)
- |= (TYPE_HAS_USER_CONSTRUCTOR (t) || TYPE_CONTAINS_VPTR_P (t));
+ |= (type_has_user_provided_constructor (t) || TYPE_CONTAINS_VPTR_P (t));
/* [dcl.init.aggr]
- An aggregate is an array or a class with no user-declared
+ An aggregate is an array or a class with no user-provided
constructors ... and no virtual functions.
Again, other conditions for being an aggregate are checked
elsewhere. */
CLASSTYPE_NON_AGGREGATE (t)
- |= (TYPE_HAS_USER_CONSTRUCTOR (t) || TYPE_POLYMORPHIC_P (t));
+ |= (type_has_user_provided_constructor (t) || TYPE_POLYMORPHIC_P (t));
CLASSTYPE_NON_POD_P (t)
|= (CLASSTYPE_NON_AGGREGATE (t)
- || TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)
- || TYPE_HAS_ASSIGN_REF (t));
- TYPE_HAS_COMPLEX_ASSIGN_REF (t)
- |= TYPE_HAS_ASSIGN_REF (t) || TYPE_CONTAINS_VPTR_P (t);
+ || saved_nontrivial_dtor || saved_complex_asn_ref);
+ TYPE_HAS_COMPLEX_ASSIGN_REF (t) |= TYPE_CONTAINS_VPTR_P (t);
TYPE_HAS_COMPLEX_DFLT (t)
|= (TYPE_HAS_DEFAULT_CONSTRUCTOR (t) || TYPE_CONTAINS_VPTR_P (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)
@@ -4235,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);
}
}
@@ -6081,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;
}
}
@@ -6444,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-gimplify.c b/gcc/cp/cp-gimplify.c
index c6d64dfbb75..243b1c61bfb 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -28,7 +28,8 @@ along with GCC; see the file COPYING3. If not see
#include "cp-tree.h"
#include "c-common.h"
#include "toplev.h"
-#include "tree-gimple.h"
+#include "tree-iterator.h"
+#include "gimple.h"
#include "hashtab.h"
#include "pointer-set.h"
#include "flags.h"
@@ -62,20 +63,14 @@ begin_bc_block (enum bc_t bc)
If we saw a break (or continue) in the scope, append a LABEL_EXPR to
body. Otherwise, just forget the label. */
-static tree
-finish_bc_block (enum bc_t bc, tree label, tree body)
+static gimple_seq
+finish_bc_block (enum bc_t bc, tree label, gimple_seq body)
{
gcc_assert (label == bc_label[bc]);
if (TREE_USED (label))
{
- tree t, sl = NULL;
-
- t = build1 (LABEL_EXPR, void_type_node, label);
-
- append_to_statement_list (body, &sl);
- append_to_statement_list (t, &sl);
- body = sl;
+ gimple_seq_add_stmt (&body, gimple_build_label (label));
}
bc_label[bc] = TREE_CHAIN (label);
@@ -83,11 +78,11 @@ finish_bc_block (enum bc_t bc, tree label, tree body)
return body;
}
-/* Build a GOTO_EXPR to represent a break or continue statement. BC
- indicates which. */
+/* Get the LABEL_EXPR to represent a break or continue statement
+ in the current block scope. BC indicates which. */
static tree
-build_bc_goto (enum bc_t bc)
+get_bc_label (enum bc_t bc)
{
tree label = bc_label[bc];
@@ -103,7 +98,7 @@ build_bc_goto (enum bc_t bc)
/* Mark the label used for finish_bc_block. */
TREE_USED (label) = 1;
- return build1 (GOTO_EXPR, void_type_node, label);
+ return label;
}
/* Genericize a TRY_BLOCK. */
@@ -114,13 +109,6 @@ genericize_try_block (tree *stmt_p)
tree body = TRY_STMTS (*stmt_p);
tree cleanup = TRY_HANDLERS (*stmt_p);
- gimplify_stmt (&body);
-
- if (CLEANUP_P (*stmt_p))
- /* A cleanup is an expression, so it doesn't need to be genericized. */;
- else
- gimplify_stmt (&cleanup);
-
*stmt_p = build2 (TRY_CATCH_EXPR, void_type_node, body, cleanup);
}
@@ -132,12 +120,28 @@ genericize_catch_block (tree *stmt_p)
tree type = HANDLER_TYPE (*stmt_p);
tree body = HANDLER_BODY (*stmt_p);
- gimplify_stmt (&body);
-
/* FIXME should the caught type go in TREE_TYPE? */
*stmt_p = build2 (CATCH_EXPR, void_type_node, type, body);
}
+/* A terser interface for building a representation of an exception
+ specification. */
+
+static tree
+build_gimple_eh_filter_tree (tree body, tree allowed, tree failure)
+{
+ tree t;
+
+ /* FIXME should the allowed types go in TREE_TYPE? */
+ t = build2 (EH_FILTER_EXPR, void_type_node, allowed, NULL_TREE);
+ append_to_statement_list (failure, &EH_FILTER_FAILURE (t));
+
+ t = build2 (TRY_CATCH_EXPR, void_type_node, NULL_TREE, t);
+ append_to_statement_list (body, &TREE_OPERAND (t, 0));
+
+ return t;
+}
+
/* Genericize an EH_SPEC_BLOCK by converting it to a
TRY_CATCH_EXPR/EH_FILTER_EXPR pair. */
@@ -147,9 +151,8 @@ genericize_eh_spec_block (tree *stmt_p)
tree body = EH_SPEC_STMTS (*stmt_p);
tree allowed = EH_SPEC_RAISES (*stmt_p);
tree failure = build_call_n (call_unexpected_node, 1, build_exc_ptr ());
- gimplify_stmt (&body);
- *stmt_p = gimple_build_eh_filter (body, allowed, failure);
+ *stmt_p = build_gimple_eh_filter_tree (body, allowed, failure);
}
/* Genericize an IF_STMT by turning it into a COND_EXPR. */
@@ -158,6 +161,7 @@ static void
gimplify_if_stmt (tree *stmt_p)
{
tree stmt, cond, then_, else_;
+ location_t locus = EXPR_LOCATION (*stmt_p);
stmt = *stmt_p;
cond = IF_COND (stmt);
@@ -175,6 +179,8 @@ gimplify_if_stmt (tree *stmt_p)
stmt = else_;
else
stmt = build3 (COND_EXPR, void_type_node, cond, then_, else_);
+ if (CAN_HAVE_LOCATION_P (stmt) && !EXPR_HAS_LOCATION (stmt))
+ SET_EXPR_LOCATION (stmt, locus);
*stmt_p = stmt;
}
@@ -185,15 +191,20 @@ gimplify_if_stmt (tree *stmt_p)
evaluated before the loop body as in while and for loops, or after the
loop body as in do-while loops. */
-static tree
+static gimple_seq
gimplify_cp_loop (tree cond, tree body, tree incr, bool cond_is_first)
{
- tree top, entry, exit, cont_block, break_block, stmt_list, t;
+ gimple top, entry, stmt;
+ gimple_seq stmt_list, body_seq, incr_seq, exit_seq;
+ tree cont_block, break_block;
location_t stmt_locus;
stmt_locus = input_location;
- stmt_list = NULL_TREE;
- entry = NULL_TREE;
+ stmt_list = NULL;
+ body_seq = NULL;
+ incr_seq = NULL;
+ exit_seq = NULL;
+ entry = NULL;
break_block = begin_bc_block (bc_break);
cont_block = begin_bc_block (bc_continue);
@@ -201,12 +212,12 @@ gimplify_cp_loop (tree cond, tree body, tree incr, bool cond_is_first)
/* If condition is zero don't generate a loop construct. */
if (cond && integer_zerop (cond))
{
- top = NULL_TREE;
- exit = NULL_TREE;
+ top = NULL;
if (cond_is_first)
{
- t = build_bc_goto (bc_break);
- append_to_statement_list (t, &stmt_list);
+ stmt = gimple_build_goto (get_bc_label (bc_break));
+ gimple_set_location (stmt, stmt_locus);
+ gimple_seq_add_stmt (&stmt_list, stmt);
}
}
else
@@ -215,44 +226,55 @@ gimplify_cp_loop (tree cond, tree body, tree incr, bool cond_is_first)
back through the main gimplifier to lower it. Given that we
have to gimplify the loop body NOW so that we can resolve
break/continue stmts, seems easier to just expand to gotos. */
- top = build1 (LABEL_EXPR, void_type_node, NULL_TREE);
+ top = gimple_build_label (create_artificial_label ());
/* If we have an exit condition, then we build an IF with gotos either
out of the loop, or to the top of it. If there's no exit condition,
then we just build a jump back to the top. */
- exit = build_and_jump (&LABEL_EXPR_LABEL (top));
if (cond && !integer_nonzerop (cond))
{
- t = build_bc_goto (bc_break);
- exit = fold_build3 (COND_EXPR, void_type_node, cond, exit, t);
- gimplify_stmt (&exit);
+ if (cond != error_mark_node)
+ {
+ gimplify_expr (&cond, &exit_seq, NULL, is_gimple_val, fb_rvalue);
+ stmt = gimple_build_cond (NE_EXPR, cond,
+ build_int_cst (TREE_TYPE (cond), 0),
+ gimple_label_label (top),
+ get_bc_label (bc_break));
+ gimple_seq_add_stmt (&exit_seq, stmt);
+ }
if (cond_is_first)
{
if (incr)
{
- entry = build1 (LABEL_EXPR, void_type_node, NULL_TREE);
- t = build_and_jump (&LABEL_EXPR_LABEL (entry));
+ entry = gimple_build_label (create_artificial_label ());
+ stmt = gimple_build_goto (gimple_label_label (entry));
}
else
- t = build_bc_goto (bc_continue);
- append_to_statement_list (t, &stmt_list);
+ stmt = gimple_build_goto (get_bc_label (bc_continue));
+ gimple_set_location (stmt, stmt_locus);
+ gimple_seq_add_stmt (&stmt_list, stmt);
}
}
+ else
+ {
+ stmt = gimple_build_goto (gimple_label_label (top));
+ gimple_seq_add_stmt (&exit_seq, stmt);
+ }
}
- gimplify_stmt (&body);
- gimplify_stmt (&incr);
+ gimplify_stmt (&body, &body_seq);
+ gimplify_stmt (&incr, &incr_seq);
- body = finish_bc_block (bc_continue, cont_block, body);
+ body_seq = finish_bc_block (bc_continue, cont_block, body_seq);
- append_to_statement_list (top, &stmt_list);
- append_to_statement_list (body, &stmt_list);
- append_to_statement_list (incr, &stmt_list);
- append_to_statement_list (entry, &stmt_list);
- append_to_statement_list (exit, &stmt_list);
+ gimple_seq_add_stmt (&stmt_list, top);
+ gimple_seq_add_seq (&stmt_list, body_seq);
+ gimple_seq_add_seq (&stmt_list, incr_seq);
+ gimple_seq_add_stmt (&stmt_list, entry);
+ gimple_seq_add_seq (&stmt_list, exit_seq);
- annotate_all_with_locus (&stmt_list, stmt_locus);
+ annotate_all_with_location (stmt_list, stmt_locus);
return finish_bc_block (bc_break, break_block, stmt_list);
}
@@ -261,45 +283,52 @@ gimplify_cp_loop (tree cond, tree body, tree incr, bool cond_is_first)
prequeue and hand off to gimplify_cp_loop. */
static void
-gimplify_for_stmt (tree *stmt_p, tree *pre_p)
+gimplify_for_stmt (tree *stmt_p, gimple_seq *pre_p)
{
tree stmt = *stmt_p;
if (FOR_INIT_STMT (stmt))
gimplify_and_add (FOR_INIT_STMT (stmt), pre_p);
- *stmt_p = gimplify_cp_loop (FOR_COND (stmt), FOR_BODY (stmt),
- FOR_EXPR (stmt), 1);
+ gimple_seq_add_seq (pre_p,
+ gimplify_cp_loop (FOR_COND (stmt), FOR_BODY (stmt),
+ FOR_EXPR (stmt), 1));
+ *stmt_p = NULL_TREE;
}
/* Gimplify a WHILE_STMT node. */
static void
-gimplify_while_stmt (tree *stmt_p)
+gimplify_while_stmt (tree *stmt_p, gimple_seq *pre_p)
{
tree stmt = *stmt_p;
- *stmt_p = gimplify_cp_loop (WHILE_COND (stmt), WHILE_BODY (stmt),
- NULL_TREE, 1);
+ gimple_seq_add_seq (pre_p,
+ gimplify_cp_loop (WHILE_COND (stmt), WHILE_BODY (stmt),
+ NULL_TREE, 1));
+ *stmt_p = NULL_TREE;
}
/* Gimplify a DO_STMT node. */
static void
-gimplify_do_stmt (tree *stmt_p)
+gimplify_do_stmt (tree *stmt_p, gimple_seq *pre_p)
{
tree stmt = *stmt_p;
- *stmt_p = gimplify_cp_loop (DO_COND (stmt), DO_BODY (stmt),
- NULL_TREE, 0);
+ gimple_seq_add_seq (pre_p,
+ gimplify_cp_loop (DO_COND (stmt), DO_BODY (stmt),
+ NULL_TREE, 0));
+ *stmt_p = NULL_TREE;
}
/* Genericize a SWITCH_STMT by turning it into a SWITCH_EXPR. */
static void
-gimplify_switch_stmt (tree *stmt_p)
+gimplify_switch_stmt (tree *stmt_p, gimple_seq *pre_p)
{
tree stmt = *stmt_p;
- tree break_block, body;
+ tree break_block, body, t;
location_t stmt_locus = input_location;
+ gimple_seq seq = NULL;
break_block = begin_bc_block (bc_break);
@@ -307,12 +336,14 @@ gimplify_switch_stmt (tree *stmt_p)
if (!body)
body = build_empty_stmt ();
- *stmt_p = build3 (SWITCH_EXPR, SWITCH_STMT_TYPE (stmt),
- SWITCH_STMT_COND (stmt), body, NULL_TREE);
- SET_EXPR_LOCATION (*stmt_p, stmt_locus);
- gimplify_stmt (stmt_p);
+ t = build3 (SWITCH_EXPR, SWITCH_STMT_TYPE (stmt),
+ SWITCH_STMT_COND (stmt), body, NULL_TREE);
+ SET_EXPR_LOCATION (t, stmt_locus);
+ gimplify_and_add (t, &seq);
- *stmt_p = finish_bc_block (bc_break, break_block, *stmt_p);
+ seq = finish_bc_block (bc_break, break_block, seq);
+ gimple_seq_add_seq (pre_p, seq);
+ *stmt_p = NULL_TREE;
}
/* Hook into the middle of gimplifying an OMP_FOR node. This is required
@@ -321,10 +352,12 @@ gimplify_switch_stmt (tree *stmt_p)
regular gimplifier. */
static enum gimplify_status
-cp_gimplify_omp_for (tree *expr_p)
+cp_gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
{
tree for_stmt = *expr_p;
tree cont_block;
+ gimple stmt;
+ gimple_seq seq = NULL;
/* Protect ourselves from recursion. */
if (OMP_FOR_GIMPLIFYING_P (for_stmt))
@@ -336,10 +369,15 @@ cp_gimplify_omp_for (tree *expr_p)
statement expressions within the INIT, COND, or INCR expressions. */
cont_block = begin_bc_block (bc_continue);
- gimplify_stmt (expr_p);
+ gimplify_and_add (for_stmt, &seq);
+ stmt = gimple_seq_last_stmt (seq);
+ if (gimple_code (stmt) == GIMPLE_OMP_FOR)
+ gimple_omp_set_body (stmt, finish_bc_block (bc_continue, cont_block,
+ gimple_omp_body (stmt)));
+ else
+ seq = finish_bc_block (bc_continue, cont_block, seq);
+ gimple_seq_add_seq (pre_p, seq);
- OMP_FOR_BODY (for_stmt)
- = finish_bc_block (bc_continue, cont_block, OMP_FOR_BODY (for_stmt));
OMP_FOR_GIMPLIFYING_P (for_stmt) = 0;
return GS_ALL_DONE;
@@ -383,7 +421,7 @@ gimplify_expr_stmt (tree *stmt_p)
/* Gimplify initialization from an AGGR_INIT_EXPR. */
static void
-cp_gimplify_init_expr (tree *expr_p, tree *pre_p, tree *post_p)
+cp_gimplify_init_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
{
tree from = TREE_OPERAND (*expr_p, 1);
tree to = TREE_OPERAND (*expr_p, 0);
@@ -441,31 +479,31 @@ cp_gimplify_init_expr (tree *expr_p, tree *pre_p, tree *post_p)
/* Gimplify a MUST_NOT_THROW_EXPR. */
-static void
-gimplify_must_not_throw_expr (tree *expr_p, tree *pre_p)
+static enum gimplify_status
+gimplify_must_not_throw_expr (tree *expr_p, gimple_seq *pre_p)
{
tree stmt = *expr_p;
tree temp = voidify_wrapper_expr (stmt, NULL);
tree body = TREE_OPERAND (stmt, 0);
- gimplify_stmt (&body);
-
- stmt = gimple_build_eh_filter (body, NULL_TREE,
- build_call_n (terminate_node, 0));
+ stmt = build_gimple_eh_filter_tree (body, NULL_TREE,
+ build_call_n (terminate_node, 0));
+ gimplify_and_add (stmt, pre_p);
if (temp)
{
- append_to_statement_list (stmt, pre_p);
*expr_p = temp;
+ return GS_OK;
}
- else
- *expr_p = stmt;
+
+ *expr_p = NULL;
+ return GS_ALL_DONE;
}
/* Do C++-specific gimplification. Args are as for gimplify_expr. */
int
-cp_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p)
+cp_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
{
int saved_stmts_are_full_exprs_p = 0;
enum tree_code code = TREE_CODE (*expr_p);
@@ -498,11 +536,10 @@ cp_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p)
break;
case MUST_NOT_THROW_EXPR:
- gimplify_must_not_throw_expr (expr_p, pre_p);
- ret = GS_OK;
+ ret = gimplify_must_not_throw_expr (expr_p, pre_p);
break;
- /* We used to do this for GIMPLE_MODIFY_STMT as well, but that's unsafe; the
+ /* We used to do this for MODIFY_EXPR as well, but that's unsafe; the
LHS of an assignment might also be involved in the RHS, as in bug
25979. */
case INIT_EXPR:
@@ -539,7 +576,7 @@ cp_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p)
case USING_STMT:
/* Just ignore for now. Eventually we will want to pass this on to
the debugger. */
- *expr_p = build_empty_stmt ();
+ *expr_p = NULL;
ret = GS_ALL_DONE;
break;
@@ -550,35 +587,38 @@ cp_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p)
case FOR_STMT:
gimplify_for_stmt (expr_p, pre_p);
- ret = GS_ALL_DONE;
+ ret = GS_OK;
break;
case WHILE_STMT:
- gimplify_while_stmt (expr_p);
- ret = GS_ALL_DONE;
+ gimplify_while_stmt (expr_p, pre_p);
+ ret = GS_OK;
break;
case DO_STMT:
- gimplify_do_stmt (expr_p);
- ret = GS_ALL_DONE;
+ gimplify_do_stmt (expr_p, pre_p);
+ ret = GS_OK;
break;
case SWITCH_STMT:
- gimplify_switch_stmt (expr_p);
- ret = GS_ALL_DONE;
+ gimplify_switch_stmt (expr_p, pre_p);
+ ret = GS_OK;
break;
case OMP_FOR:
- ret = cp_gimplify_omp_for (expr_p);
+ ret = cp_gimplify_omp_for (expr_p, pre_p);
break;
case CONTINUE_STMT:
- *expr_p = build_bc_goto (bc_continue);
+ gimple_seq_add_stmt (pre_p, gimple_build_predict (PRED_CONTINUE, NOT_TAKEN));
+ gimple_seq_add_stmt (pre_p, gimple_build_goto (get_bc_label (bc_continue)));
+ *expr_p = NULL_TREE;
ret = GS_ALL_DONE;
break;
case BREAK_STMT:
- *expr_p = build_bc_goto (bc_break);
+ gimple_seq_add_stmt (pre_p, gimple_build_goto (get_bc_label (bc_break)));
+ *expr_p = NULL_TREE;
ret = GS_ALL_DONE;
break;
@@ -835,13 +875,13 @@ cxx_omp_clause_apply_fn (tree fn, tree arg1, tree arg2)
end1 = build2 (POINTER_PLUS_EXPR, TREE_TYPE (start1), start1, end1);
p1 = create_tmp_var (TREE_TYPE (start1), NULL);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, p1, start1);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (p1), p1, start1);
append_to_statement_list (t, &ret);
if (arg2)
{
p2 = create_tmp_var (TREE_TYPE (start2), NULL);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, p2, start2);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (p2), p2, start2);
append_to_statement_list (t, &ret);
}
@@ -864,14 +904,14 @@ cxx_omp_clause_apply_fn (tree fn, tree arg1, tree arg2)
t = TYPE_SIZE_UNIT (inner_type);
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (p1), p1, t);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, p1, t);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (p1), p1, t);
append_to_statement_list (t, &ret);
if (arg2)
{
t = TYPE_SIZE_UNIT (inner_type);
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (p2), p2, t);
- t = build2 (GIMPLE_MODIFY_STMT, void_type_node, p2, t);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (p2), p2, t);
append_to_statement_list (t, &ret);
}
@@ -925,7 +965,7 @@ cxx_omp_clause_copy_ctor (tree clause, tree dst, tree src)
if (info)
ret = cxx_omp_clause_apply_fn (TREE_VEC_ELT (info, 0), dst, src);
if (ret == NULL)
- ret = build2 (GIMPLE_MODIFY_STMT, void_type_node, dst, src);
+ ret = build2 (MODIFY_EXPR, TREE_TYPE (dst), dst, src);
return ret;
}
@@ -941,7 +981,7 @@ cxx_omp_clause_assign_op (tree clause, tree dst, tree src)
if (info)
ret = cxx_omp_clause_apply_fn (TREE_VEC_ELT (info, 2), dst, src);
if (ret == NULL)
- ret = build2 (GIMPLE_MODIFY_STMT, void_type_node, dst, src);
+ ret = build2 (MODIFY_EXPR, TREE_TYPE (dst), dst, src);
return ret;
}
diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h
index 1121eb08479..a7d4f89e8c9 100644
--- a/gcc/cp/cp-objcp-common.h
+++ b/gcc/cp/cp-objcp-common.h
@@ -86,6 +86,8 @@ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t,
#define LANG_HOOKS_COMDAT_GROUP cxx_comdat_group
#undef LANG_HOOKS_BUILTIN_FUNCTION
#define LANG_HOOKS_BUILTIN_FUNCTION cxx_builtin_function
+#undef LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE
+#define LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE cxx_builtin_function_ext_scope
#undef LANG_HOOKS_TYPE_HASH_EQ
#define LANG_HOOKS_TYPE_HASH_EQ cxx_type_hash_eq
#undef LANG_HOOKS_MISSING_NORETURN_OK_P
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 6bc5d2d2782..37bed91a19c 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 \
+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)
@@ -96,7 +116,8 @@ struct diagnostic_info;
2: Unused
3: TYPE_FOR_JAVA.
4: TYPE_HAS_NONTRIVIAL_DESTRUCTOR
- 5: CLASS_TYPE_P.
+ 5: CLASS_TYPE_P (in RECORD_TYPE and UNION_TYPE)
+ SCOPED_ENUM_P (in ENUMERAL_TYPE)
6: TYPE_DEPENDENT_P_VALID
Usage of DECL_LANG_FLAG_?:
@@ -534,7 +555,7 @@ enum cp_tree_node_structure_enum {
/* The resulting tree type. */
union lang_tree_node GTY((desc ("cp_tree_node_structure (&%h)"),
- chain_next ("(union lang_tree_node *)GENERIC_NEXT (&%h.generic)")))
+ chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
{
union tree_node GTY ((tag ("TS_CP_GENERIC"),
desc ("tree_node_structure (&%h)"))) generic;
@@ -960,7 +981,7 @@ enum languages { lang_c, lang_cplusplus, lang_java };
|| TREE_CODE (T) == TYPEOF_TYPE \
|| TREE_CODE (T) == BOUND_TEMPLATE_TEMPLATE_PARM \
|| TREE_CODE (T) == DECLTYPE_TYPE \
- || TYPE_LANG_FLAG_5 (T))
+ || CLASS_TYPE_P (T))
/* Set CLASS_TYPE_P for T to VAL. T must be a class, struct, or
union type. */
@@ -1609,7 +1630,7 @@ struct lang_decl_flags GTY(())
unsigned repo_available_p : 1;
unsigned hidden_friend_p : 1;
unsigned threadprivate_p : 1;
- /* One unused bit. */
+ unsigned defaulted_p : 1;
union lang_decl_u {
/* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is
@@ -2626,6 +2647,14 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
#define CP_DECL_THREADPRIVATE_P(DECL) \
(DECL_LANG_SPECIFIC (VAR_DECL_CHECK (DECL))->decl_flags.threadprivate_p)
+/* Nonzero if DECL was declared with '= delete'. */
+#define DECL_DELETED_FN(DECL) \
+ (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (DECL))->decl_flags.threadprivate_p)
+
+/* Nonzero if DECL was declared with '= default'. */
+#define DECL_DEFAULTED_FN(DECL) \
+ (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (DECL))->decl_flags.defaulted_p)
+
/* Record whether a typedef for type `int' was actually `signed int'. */
#define C_TYPEDEF_EXPLICITLY_SIGNED(EXP) DECL_LANG_FLAG_1 (EXP)
@@ -2660,6 +2689,10 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
#define INTEGRAL_OR_ENUMERATION_TYPE_P(TYPE) \
(TREE_CODE (TYPE) == ENUMERAL_TYPE || CP_INTEGRAL_TYPE_P (TYPE))
+/* Returns true if TYPE is an integral or unscoped enumeration type. */
+#define INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P(TYPE) \
+ (UNSCOPED_ENUM_P (TYPE) || CP_INTEGRAL_TYPE_P (TYPE))
+
/* [basic.fundamental]
Integral and floating types are collectively called arithmetic
@@ -2686,6 +2719,59 @@ more_aggr_init_expr_args_p (const aggr_init_expr_arg_iterator *iter)
|| TYPE_PTR_P (TYPE) \
|| TYPE_PTRMEMFUNC_P (TYPE))
+/* Determines whether this type is a C++0x scoped enumeration
+ type. Scoped enumerations types are introduced via "enum class" or
+ "enum struct", e.g.,
+
+ enum class Color {
+ Red, Green, Blue
+ };
+
+ Scoped enumeration types are different from normal (unscoped)
+ enumeration types in several ways:
+
+ - The enumerators of a scoped enumeration type are only available
+ within the scope of the enumeration type and not in the
+ enclosing scope. For example, the Red color can be referred to
+ with "Color::Red" but not "Red".
+
+ - Scoped enumerators and enumerations do not implicitly convert
+ to integers or 'bool'.
+
+ - The underlying type of the enum is well-defined. */
+#define SCOPED_ENUM_P(TYPE) \
+ (TREE_CODE (TYPE) == ENUMERAL_TYPE && TYPE_LANG_FLAG_5 (TYPE))
+
+/* Determine whether this is an unscoped enumeration type. */
+#define UNSCOPED_ENUM_P(TYPE) \
+ (TREE_CODE (TYPE) == ENUMERAL_TYPE && !TYPE_LANG_FLAG_5 (TYPE))
+
+/* Set the flag indicating whether an ENUMERAL_TYPE is a C++0x scoped
+ enumeration type (1) or a normal (unscoped) enumeration type
+ (0). */
+#define SET_SCOPED_ENUM_P(TYPE, VAL) \
+ (TYPE_LANG_FLAG_5 (ENUMERAL_TYPE_CHECK (TYPE)) = (VAL))
+
+/* Returns the underlying type of the given enumeration type. The
+ underlying type is determined in different ways, depending on the
+ properties of the enum:
+
+ - In C++0x, the underlying type can be explicitly specified, e.g.,
+
+ enum E1 : char { ... } // underlying type is char
+
+ - In a C++0x scoped enumeration, the underlying type is int
+ unless otherwises specified:
+
+ enum class E2 { ... } // underlying type is int
+
+ - Otherwise, the underlying type is determined based on the
+ values of the enumerators. In this case, the
+ ENUM_UNDERLYING_TYPE will not be set until after the definition
+ of the enumeration is completed by finish_enum. */
+#define ENUM_UNDERLYING_TYPE(TYPE) \
+ TREE_TYPE (ENUMERAL_TYPE_CHECK (TYPE))
+
/* [dcl.init.aggr]
An aggregate is an array or a class with no user-declared
@@ -4171,6 +4257,9 @@ extern void check_for_override (tree, tree);
extern void push_class_stack (void);
extern void pop_class_stack (void);
extern bool type_has_user_nondefault_constructor (tree);
+extern bool type_has_user_provided_constructor (tree);
+extern bool type_has_user_provided_default_constructor (tree);
+extern bool defaultable_fn_p (tree);
/* in cvt.c */
extern tree convert_to_reference (tree, tree, int, int, tree);
@@ -4214,10 +4303,9 @@ extern bool check_omp_return (void);
extern tree make_typename_type (tree, tree, enum tag_types, tsubst_flags_t);
extern tree make_unbound_class_template (tree, tree, tree, tsubst_flags_t);
extern tree check_for_out_of_scope_variable (tree);
-extern tree build_library_fn (tree, tree);
extern tree build_library_fn_ptr (const char *, tree);
extern tree build_cp_library_fn_ptr (const char *, tree);
-extern tree push_library_fn (tree, tree);
+extern tree push_library_fn (tree, tree, tree);
extern tree push_void_library_fn (tree, tree);
extern tree push_throw_library_fn (tree, tree);
extern tree check_tag_decl (cp_decl_specifier_seq *);
@@ -4242,9 +4330,10 @@ extern bool grok_op_properties (tree, bool);
extern tree xref_tag (enum tag_types, tree, tag_scope, bool);
extern tree xref_tag_from_type (tree, tree, tag_scope);
extern bool xref_basetypes (tree, tree);
-extern tree start_enum (tree);
+extern tree start_enum (tree, tree, bool);
extern void finish_enum (tree);
extern void build_enumerator (tree, tree, tree);
+extern tree lookup_enumerator (tree, tree);
extern void start_preparsed_function (tree, tree, int);
extern int start_function (cp_decl_specifier_seq *, const cp_declarator *, tree);
extern tree begin_function_body (void);
@@ -4275,6 +4364,7 @@ extern tree register_dtor_fn (tree);
extern tmpl_spec_kind current_tmpl_spec_kind (int);
extern tree cp_fname_init (const char *, tree *);
extern tree cxx_builtin_function (tree decl);
+extern tree cxx_builtin_function_ext_scope (tree decl);
extern tree check_elaborated_type_specifier (enum tag_types, tree, bool);
extern void warn_extern_redeclared_static (tree, tree);
extern const char *cxx_comdat_group (tree);
@@ -4323,6 +4413,7 @@ extern void mark_needed (tree);
extern bool decl_needed_p (tree);
extern void note_vague_linkage_fn (tree);
extern tree build_artificial_parm (tree, tree);
+extern bool possibly_inlined_p (tree);
/* in error.c */
extern void init_error (void);
@@ -4419,7 +4510,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);
@@ -4431,6 +4522,10 @@ extern void end_specialization (void);
extern void begin_explicit_instantiation (void);
extern void end_explicit_instantiation (void);
extern tree check_explicit_specialization (tree, tree, int, int);
+extern tree make_auto (void);
+extern tree do_auto_deduction (tree, tree, tree);
+extern tree type_uses_auto (tree);
+extern bool is_auto (const_tree);
extern tree process_template_parm (tree, tree, bool, bool);
extern tree end_template_parm_list (tree);
extern void end_template_decl (void);
@@ -4731,6 +4826,7 @@ extern tree build_min_nt (enum tree_code, ...);
extern tree build_min_non_dep (enum tree_code, tree, ...);
extern tree build_min_non_dep_call_list (tree, tree, tree);
extern tree build_cplus_new (tree, tree);
+extern tree build_aggr_init_expr (tree, tree);
extern tree get_target_expr (tree);
extern tree build_cplus_array_type (tree, tree);
extern tree build_array_of_n_type (tree, int);
@@ -4801,7 +4897,6 @@ extern int comp_cv_qual_signature (tree, tree);
extern tree cxx_sizeof_or_alignof_expr (tree, enum tree_code, bool);
extern tree cxx_sizeof_or_alignof_type (tree, enum tree_code, bool);
extern tree cxx_sizeof_nowarn (tree);
-extern tree inline_conversion (tree);
extern tree is_bitfield_expr_with_lowered_type (const_tree);
extern tree unlowered_expr_type (const_tree);
extern tree decay_conversion (tree);
@@ -4876,11 +4971,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 *);
@@ -4928,24 +5023,10 @@ extern void init_shadowed_var_for_decl (void);
extern tree cxx_staticp (tree);
/* in cp-gimplify.c */
-extern int cp_gimplify_expr (tree *, tree *, tree *);
+extern int cp_gimplify_expr (tree *, gimple_seq *,
+ gimple_seq *);
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 e3043455257..5a5a41fd30a 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -66,7 +66,7 @@ static tree grok_reference_init (tree, tree, tree, tree *);
static tree grokvardecl (tree, tree, const cp_decl_specifier_seq *,
int, int, tree);
static void record_unknown_type (tree, const char *);
-static tree builtin_function_1 (tree, tree);
+static tree builtin_function_1 (tree, tree, bool);
static tree build_library_fn_1 (tree, enum tree_code, tree);
static int member_function_or_else (tree, tree, enum overload_flags);
static void bad_specifiers (tree, const char *, int, int, int, int,
@@ -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
{
@@ -1551,14 +1551,6 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
olddecl);
}
}
-
- if (DECL_DECLARED_INLINE_P (newdecl)
- && ! DECL_DECLARED_INLINE_P (olddecl)
- && TREE_ADDRESSABLE (olddecl) && warn_inline)
- {
- warning (0, "%q#D was used before it was declared inline", newdecl);
- warning (0, "%Jprevious non-inline declaration here", olddecl);
- }
}
}
@@ -1613,6 +1605,12 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
warning (OPT_Wredundant_decls, "redundant redeclaration of %qD in same scope", newdecl);
warning (OPT_Wredundant_decls, "previous declaration of %q+D", olddecl);
}
+
+ if (DECL_DELETED_FN (newdecl))
+ {
+ error ("deleted definition of %qD", newdecl);
+ error ("after previous declaration %q+D", olddecl);
+ }
}
/* Deal with C++: must preserve virtual function table size. */
@@ -1654,15 +1652,9 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
&& DECL_INITIAL (new_result))
{
if (DECL_INITIAL (old_result))
- {
- DECL_INLINE (old_result) = 0;
- DECL_UNINLINABLE (old_result) = 1;
- }
+ DECL_UNINLINABLE (old_result) = 1;
else
- {
- DECL_INLINE (old_result) = DECL_INLINE (new_result);
- DECL_UNINLINABLE (old_result) = DECL_UNINLINABLE (new_result);
- }
+ DECL_UNINLINABLE (old_result) = DECL_UNINLINABLE (new_result);
DECL_EXTERNAL (old_result) = DECL_EXTERNAL (new_result);
DECL_NOT_REALLY_EXTERN (old_result)
= DECL_NOT_REALLY_EXTERN (new_result);
@@ -1676,8 +1668,6 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
}
else
{
- DECL_INLINE (old_result)
- |= DECL_INLINE (new_result);
DECL_DECLARED_INLINE_P (old_result)
|= DECL_DECLARED_INLINE_P (new_result);
DECL_DISREGARD_INLINE_LIMITS (old_result)
@@ -1774,6 +1764,20 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
if (TREE_DEPRECATED (newdecl))
TREE_DEPRECATED (olddecl) = 1;
+ /* Preserve function specific target and optimization options */
+ if (TREE_CODE (newdecl) == FUNCTION_DECL)
+ {
+ if (DECL_FUNCTION_SPECIFIC_TARGET (olddecl)
+ && !DECL_FUNCTION_SPECIFIC_TARGET (newdecl))
+ DECL_FUNCTION_SPECIFIC_TARGET (newdecl)
+ = DECL_FUNCTION_SPECIFIC_TARGET (olddecl);
+
+ if (DECL_FUNCTION_SPECIFIC_OPTIMIZATION (olddecl)
+ && !DECL_FUNCTION_SPECIFIC_OPTIMIZATION (newdecl))
+ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (newdecl)
+ = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (olddecl);
+ }
+
/* Merge the initialization information. */
if (DECL_INITIAL (newdecl) == NULL_TREE
&& DECL_INITIAL (olddecl) != NULL_TREE)
@@ -1948,9 +1952,9 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
}
else if (new_defines_function && DECL_INITIAL (olddecl))
{
- /* C++ is always in in unit-at-a-time mode, so we never
- inline re-defined extern inline functions. */
- DECL_INLINE (newdecl) = 0;
+ /* Never inline re-defined extern inline functions.
+ FIXME: this could be better handled by keeping both
+ function as separate declarations. */
DECL_UNINLINABLE (newdecl) = 1;
}
else
@@ -1960,12 +1964,6 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
DECL_DECLARED_INLINE_P (newdecl) |= DECL_DECLARED_INLINE_P (olddecl);
- /* If either decl says `inline', this fn is inline, unless
- its definition was passed already. */
- if (DECL_INLINE (newdecl) && DECL_INITIAL (olddecl) == NULL_TREE)
- DECL_INLINE (olddecl) = 1;
- DECL_INLINE (newdecl) = DECL_INLINE (olddecl);
-
DECL_UNINLINABLE (newdecl) = DECL_UNINLINABLE (olddecl)
= (DECL_UNINLINABLE (newdecl) || DECL_UNINLINABLE (olddecl));
@@ -2057,6 +2055,12 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
ggc_free (DECL_LANG_SPECIFIC (olddecl));
}
+ /* Merge the USED information. */
+ if (TREE_USED (olddecl))
+ TREE_USED (newdecl) = 1;
+ else if (TREE_USED (newdecl))
+ TREE_USED (olddecl) = 1;
+
if (TREE_CODE (newdecl) == FUNCTION_DECL)
{
int function_size;
@@ -2458,11 +2462,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
@@ -2504,7 +2508,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)
@@ -2600,8 +2604,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;
}
@@ -2619,7 +2623,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)
@@ -2640,8 +2644,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");
@@ -2693,7 +2697,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)
{
@@ -3507,7 +3511,7 @@ cp_make_fname_decl (tree id, int type_dep)
}
static tree
-builtin_function_1 (tree decl, tree context)
+builtin_function_1 (tree decl, tree context, bool is_global)
{
tree id = DECL_NAME (decl);
const char *name = IDENTIFIER_POINTER (id);
@@ -3528,7 +3532,10 @@ builtin_function_1 (tree decl, tree context)
DECL_CONTEXT (decl) = context;
- pushdecl (decl);
+ if (is_global)
+ pushdecl_top_level (decl);
+ else
+ pushdecl (decl);
/* A function in the user's namespace should have an explicit
declaration before it is used. Mark the built-in function as
@@ -3561,11 +3568,36 @@ cxx_builtin_function (tree decl)
{
tree decl2 = copy_node(decl);
push_namespace (std_identifier);
- builtin_function_1 (decl2, std_node);
+ builtin_function_1 (decl2, std_node, false);
+ pop_namespace ();
+ }
+
+ return builtin_function_1 (decl, NULL_TREE, false);
+}
+
+/* Like cxx_builtin_function, but guarantee the function is added to the global
+ scope. This is to allow function specific options to add new machine
+ dependent builtins when the target ISA changes via attribute((target(...)))
+ which saves space on program startup if the program does not use non-generic
+ ISAs. */
+
+tree
+cxx_builtin_function_ext_scope (tree decl)
+{
+
+ tree id = DECL_NAME (decl);
+ const char *name = IDENTIFIER_POINTER (id);
+ /* All builtins that don't begin with an '_' should additionally
+ go in the 'std' namespace. */
+ if (name[0] != '_')
+ {
+ tree decl2 = copy_node(decl);
+ push_namespace (std_identifier);
+ builtin_function_1 (decl2, std_node, true);
pop_namespace ();
}
- return builtin_function_1 (decl, NULL_TREE);
+ return builtin_function_1 (decl, NULL_TREE, true);
}
/* Generate a FUNCTION_DECL with the typical flags for a runtime library
@@ -3591,7 +3623,7 @@ build_library_fn_1 (tree name, enum tree_code operator_code, tree type)
We assume that such functions never throw; if this is incorrect,
callers should unset TREE_NOTHROW. */
-tree
+static tree
build_library_fn (tree name, tree type)
{
tree fn = build_library_fn_1 (name, ERROR_MARK, type);
@@ -3630,12 +3662,18 @@ build_cp_library_fn_ptr (const char* name, tree type)
}
/* Like build_library_fn, but also pushes the function so that we will
- be able to find it via IDENTIFIER_GLOBAL_VALUE. */
+ be able to find it via IDENTIFIER_GLOBAL_VALUE. Also, the function
+ may throw exceptions listed in RAISES. */
tree
-push_library_fn (tree name, tree type)
+push_library_fn (tree name, tree type, tree raises)
{
- tree fn = build_library_fn (name, type);
+ tree fn;
+
+ if (raises)
+ type = build_exception_variant (type, raises);
+
+ fn = build_library_fn (name, type);
pushdecl_top_level (fn);
return fn;
}
@@ -3660,7 +3698,7 @@ tree
push_void_library_fn (tree name, tree parmtypes)
{
tree type = build_function_type (void_type_node, parmtypes);
- return push_library_fn (name, type);
+ return push_library_fn (name, type, NULL_TREE);
}
/* Like push_library_fn, but also note that this function throws
@@ -3669,7 +3707,7 @@ push_void_library_fn (tree name, tree parmtypes)
tree
push_throw_library_fn (tree name, tree type)
{
- tree fn = push_library_fn (name, type);
+ tree fn = push_library_fn (name, type, NULL_TREE);
TREE_THIS_VOLATILE (fn) = 1;
TREE_NOTHROW (fn) = 0;
return fn;
@@ -3770,7 +3808,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;
}
@@ -3784,7 +3822,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))
@@ -3813,9 +3851,8 @@ check_tag_decl (cp_decl_specifier_seq *declspecs)
/* Anonymous unions are objects, so they can have specifiers. */;
SET_ANON_AGGR_TYPE_P (declared_type);
- if (TREE_CODE (declared_type) != UNION_TYPE && pedantic
- && !in_system_header)
- pedwarn ("ISO C++ prohibits anonymous structs");
+ if (TREE_CODE (declared_type) != UNION_TYPE && !in_system_header)
+ pedwarn (input_location, OPT_pedantic, "ISO C++ prohibits anonymous structs");
}
else
@@ -3932,13 +3969,14 @@ groktypename (cp_decl_specifier_seq *type_specifiers,
grokfield.) The DECL corresponding to the DECLARATOR is returned.
If an error occurs, the error_mark_node is returned instead.
- DECLSPECS are the decl-specifiers for the declaration. INITIALIZED
- is true if an explicit initializer is present, but false if this is
- a variable implicitly initialized via a default constructor.
- ATTRIBUTES and PREFIX_ATTRIBUTES are GNU attributes associated with
- this declaration. *PUSHED_SCOPE_P is set to the scope entered in
- this function, if any; if set, the caller is responsible for
- calling pop_scope. */
+ DECLSPECS are the decl-specifiers for the declaration. INITIALIZED is 1
+ if an explicit initializer is present, or 2 for an explicitly defaulted
+ function, or 3 for an explicitly deleted function, but 0 if this is a
+ variable implicitly initialized via a default constructor. ATTRIBUTES
+ and PREFIX_ATTRIBUTES are GNU attributes associated with this
+ declaration. *PUSHED_SCOPE_P is set to the scope entered in this
+ function, if any; if set, the caller is responsible for calling
+ pop_scope. */
tree
start_decl (const cp_declarator *declarator,
@@ -3992,12 +4030,15 @@ start_decl (const cp_declarator *declarator,
switch (TREE_CODE (decl))
{
case TYPE_DECL:
- error ("typedef %qD is initialized (use __typeof__ instead)", decl);
+ error ("typedef %qD is initialized (use decltype instead)", decl);
return error_mark_node;
case FUNCTION_DECL:
- error ("function %q#D is initialized like a variable", decl);
- return error_mark_node;
+ if (initialized == 3)
+ /* We'll handle the rest of the semantics later, but we need to
+ set this now so it's visible to duplicate_decls. */
+ DECL_DELETED_FN (decl) = 1;
+ break;
default:
break;
@@ -4057,7 +4098,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));
@@ -4113,7 +4154,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);
}
@@ -4204,6 +4245,8 @@ start_decl_1 (tree decl, bool initialized)
arrays which might be completed by the initialization. */
if (complete_p)
; /* A complete type is ok. */
+ else if (type_uses_auto (type))
+ ; /* An auto type is ok. */
else if (TREE_CODE (type) != ARRAY_TYPE)
{
error ("variable %q#D has initializer but incomplete type", decl);
@@ -4218,8 +4261,11 @@ start_decl_1 (tree decl, bool initialized)
}
else if (aggregate_definition_p && !complete_p)
{
- error ("aggregate %q#D has incomplete type and cannot be defined",
- decl);
+ if (type_uses_auto (type))
+ error ("declaration of %q#D has no initializer", decl);
+ else
+ error ("aggregate %q#D has incomplete type and cannot be defined",
+ decl);
/* Change the type so that assemble_variable will give
DECL an rtl we can live with: (mem (const_int 0)). */
type = TREE_TYPE (decl) = error_mark_node;
@@ -4773,20 +4819,28 @@ reshape_init_r (tree type, reshape_iter *d, bool first_initializer_p)
{
tree init = d->cur->value;
+ if (error_operand_p (init))
+ return error_mark_node;
+
/* A non-aggregate type is always initialized with a single
initializer. */
if (!CP_AGGREGATE_TYPE_P (type))
{
/* It is invalid to initialize a non-aggregate type with a
- brace-enclosed initializer.
+ brace-enclosed initializer before C++0x.
We need to check for BRACE_ENCLOSED_INITIALIZER_P here because
of g++.old-deja/g++.mike/p7626.C: a pointer-to-member constant is
a CONSTRUCTOR (with a record type). */
if (TREE_CODE (init) == CONSTRUCTOR
&& BRACE_ENCLOSED_INITIALIZER_P (init)) /* p7626.C */
{
- error ("braces around scalar initializer for type %qT", type);
- init = error_mark_node;
+ if (SCALAR_TYPE_P (type))
+ {
+ error ("braces around scalar initializer for type %qT", type);
+ init = error_mark_node;
+ }
+ else
+ maybe_warn_cpp0x ("extended initializer lists");
}
d->cur++;
@@ -5399,6 +5453,7 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
int was_readonly = 0;
bool var_definition_p = false;
int saved_processing_template_decl;
+ tree auto_node;
if (decl == error_mark_node)
return;
@@ -5433,6 +5488,14 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
&& (DECL_INITIAL (decl) || init))
DECL_INITIALIZED_IN_CLASS_P (decl) = 1;
+ auto_node = type_uses_auto (type);
+ if (auto_node && !type_dependent_expression_p (init))
+ {
+ type = TREE_TYPE (decl) = do_auto_deduction (type, init, auto_node);
+ if (type == error_mark_node)
+ return;
+ }
+
if (processing_template_decl)
{
bool type_dependent_p;
@@ -5687,10 +5750,38 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
else
abstract_virtuals_error (decl, type);
- if (TREE_CODE (decl) == FUNCTION_DECL
- || TREE_TYPE (decl) == error_mark_node)
+ if (TREE_TYPE (decl) == error_mark_node)
/* No initialization required. */
;
+ else if (TREE_CODE (decl) == FUNCTION_DECL)
+ {
+ if (init)
+ {
+ if (init == ridpointers[(int)RID_DELETE])
+ {
+ /* fixme check this is 1st decl */
+ DECL_DELETED_FN (decl) = 1;
+ DECL_DECLARED_INLINE_P (decl) = 1;
+ DECL_INITIAL (decl) = error_mark_node;
+ }
+ else if (init == ridpointers[(int)RID_DEFAULT])
+ {
+ if (!defaultable_fn_p (decl))
+ error ("%qD cannot be defaulted", decl);
+ else
+ {
+ /* An out-of-class default definition is defined at
+ the point where it is explicitly defaulted. */
+ DECL_DEFAULTED_FN (decl) = 1;
+ if (DECL_INITIAL (decl) == error_mark_node)
+ synthesize_method (decl);
+ }
+ }
+ else
+ error ("function %q#D is initialized like a variable", decl);
+ }
+ /* else no initialization required. */
+ }
else if (DECL_EXTERNAL (decl)
&& ! (DECL_LANG_SPECIFIC (decl)
&& DECL_NOT_REALLY_EXTERN (decl)))
@@ -5916,8 +6007,6 @@ start_cleanup_fn (void)
actually needed. It is unlikely that it will be inlined, since
it is only called via a function pointer, but we avoid unnecessary
emissions this way. */
- DECL_INLINE (fndecl) = 1;
- DECL_DECLARED_INLINE_P (fndecl) = 1;
DECL_INTERFACE_KNOWN (fndecl) = 1;
/* Build the parameter. */
if (use_cxa_atexit)
@@ -6141,9 +6230,10 @@ expand_static_init (tree decl, tree init)
void_list_node);
tree vfntype = build_function_type (void_type_node, argtypes);
acquire_fn = push_library_fn
- (acquire_fn, build_function_type (integer_type_node, argtypes));
- release_fn = push_library_fn (release_fn, vfntype);
- abort_fn = push_library_fn (abort_fn, vfntype);
+ (acquire_fn, build_function_type (integer_type_node, argtypes),
+ NULL_TREE);
+ release_fn = push_library_fn (release_fn, vfntype, NULL_TREE);
+ abort_fn = push_library_fn (abort_fn, vfntype, NULL_TREE);
}
else
{
@@ -6346,7 +6436,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));
}
@@ -6580,16 +6670,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);
}
}
@@ -6603,11 +6693,6 @@ grokfndecl (tree ctype,
/* If the declaration was declared inline, mark it as such. */
if (inlinep)
DECL_DECLARED_INLINE_P (decl) = 1;
- /* We inline functions that are explicitly declared inline, or, when
- the user explicitly asks us to, all functions. */
- if (DECL_DECLARED_INLINE_P (decl)
- || (flag_inline_trees == 2 && !DECL_INLINE (decl) && funcdef_flag))
- DECL_INLINE (decl) = 1;
DECL_EXTERNAL (decl) = 1;
if (quals && TREE_CODE (type) == FUNCTION_TYPE)
@@ -6666,7 +6751,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
@@ -6935,16 +7021,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;
}
@@ -7004,8 +7091,8 @@ check_static_variable_definition (tree decl, tree type)
error ("ISO C++ forbids in-class initialization of non-const "
"static member %qD",
decl);
- else if (pedantic && !INTEGRAL_TYPE_P (type))
- pedwarn ("ISO C++ forbids initialization of member constant "
+ else if (!INTEGRAL_TYPE_P (type))
+ pedwarn (input_location, OPT_pedantic, "ISO C++ forbids initialization of member constant "
"%qD of non-integral type %qT", decl, type);
return 0;
@@ -7082,12 +7169,12 @@ compute_array_index_type (tree name, tree size)
}
/* As an extension we allow zero-sized arrays. We always allow
them in system headers because glibc uses them. */
- else if (integer_zerop (size) && pedantic && !in_system_header)
+ else if (integer_zerop (size) && !in_system_header)
{
if (name)
- pedwarn ("ISO C++ forbids zero-size array %qD", name);
+ pedwarn (input_location, OPT_pedantic, "ISO C++ forbids zero-size array %qD", name);
else
- pedwarn ("ISO C++ forbids zero-size array");
+ pedwarn (input_location, OPT_pedantic, "ISO C++ forbids zero-size array");
}
}
else if (TREE_CONSTANT (size))
@@ -7103,9 +7190,9 @@ compute_array_index_type (tree name, tree size)
else if (pedantic && warn_vla != 0)
{
if (name)
- pedwarn ("ISO C++ forbids variable length array %qD", name);
+ pedwarn (input_location, OPT_Wvla, "ISO C++ forbids variable length array %qD", name);
else
- pedwarn ("ISO C++ forbids variable length array");
+ pedwarn (input_location, OPT_Wvla, "ISO C++ forbids variable length array");
}
else if (warn_vla > 0)
{
@@ -7362,7 +7449,7 @@ check_var_type (tree identifier, tree type)
Don't make a DECL node; just return the ..._TYPE node.
FIELD for a struct or union field; make a FIELD_DECL.
BITFIELD for a field with specified width.
- INITIALIZED is 1 if the decl has an initializer.
+ INITIALIZED is as for start_decl.
ATTRLIST is a pointer to the list of attributes, which may be NULL
if there are none; *ATTRLIST may be modified if attributes from inside
@@ -7460,6 +7547,9 @@ grokdeclarator (const cp_declarator *declarator,
else if (decl_context == BITFIELD)
bitfield = 1, decl_context = FIELD;
+ if (initialized > 1)
+ funcdef_flag = true;
+
/* Look inside a declarator for the name being declared
and get it as a string, for an error message. */
for (id_declarator = declarator;
@@ -7734,9 +7824,10 @@ 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 ("ISO C++ forbids declaration of %qs with no type", name);
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C++ forbids declaration of %qs with no type", name);
else
warning (OPT_Wreturn_type,
"ISO C++ forbids declaration of %qs with no type", name);
@@ -7791,7 +7882,8 @@ grokdeclarator (const cp_declarator *declarator,
ok = 1;
if (!explicit_int && !defaulted_int && !explicit_char && pedantic)
{
- pedwarn ("long, short, signed or unsigned used invalidly for %qs",
+ pedwarn (input_location, OPT_pedantic,
+ "long, short, signed or unsigned used invalidly for %qs",
name);
if (flag_pedantic_errors)
ok = 0;
@@ -7896,7 +7988,8 @@ grokdeclarator (const cp_declarator *declarator,
if (pedantic)
{
tree bad_type = build_qualified_type (type, type_quals);
- pedwarn ("ignoring %qV qualifiers added to function type %qT",
+ pedwarn (input_location, OPT_pedantic,
+ "ignoring %qV qualifiers added to function type %qT",
bad_type, type);
}
type_quals = TYPE_UNQUALIFIED;
@@ -8177,7 +8270,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
@@ -8400,12 +8493,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. */
@@ -8589,7 +8683,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);
@@ -8714,13 +8808,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);
}
@@ -9042,9 +9136,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;
}
@@ -9124,10 +9218,12 @@ grokdeclarator (const cp_declarator *declarator,
&& pedantic)
{
if (storage_class == sc_static)
- pedwarn ("%<static%> specified invalid for function %qs "
+ pedwarn (input_location, OPT_pedantic,
+ "%<static%> specified invalid for function %qs "
"declared out of global scope", name);
else
- pedwarn ("%<inline%> specifier invalid for function %qs "
+ pedwarn (input_location, OPT_pedantic,
+ "%<inline%> specifier invalid for function %qs "
"declared out of global scope", name);
}
@@ -9166,7 +9262,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;
}
@@ -9203,7 +9299,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;
@@ -9215,9 +9311,9 @@ grokdeclarator (const cp_declarator *declarator,
}
if (storage_class == sc_extern && pedantic)
{
- pedwarn ("cannot explicitly declare member %q#D to have "
- "extern linkage",
- decl);
+ pedwarn (input_location, OPT_pedantic,
+ "cannot explicitly declare member %q#D to have "
+ "extern linkage", decl);
storage_class = sc_none;
}
}
@@ -9233,7 +9329,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 &
@@ -9666,6 +9765,8 @@ grok_special_member_properties (tree decl)
are no other parameters or else all other parameters have
default arguments. */
TYPE_HAS_INIT_REF (class_type) = 1;
+ if (!DECL_DEFAULTED_FN (decl))
+ TYPE_HAS_COMPLEX_INIT_REF (class_type) = 1;
if (ctor > 1)
TYPE_HAS_CONST_INIT_REF (class_type) = 1;
}
@@ -9687,6 +9788,8 @@ grok_special_member_properties (tree decl)
if (assop)
{
TYPE_HAS_ASSIGN_REF (class_type) = 1;
+ if (!DECL_DEFAULTED_FN (decl))
+ TYPE_HAS_COMPLEX_ASSIGN_REF (class_type) = 1;
if (assop != 1)
TYPE_HAS_CONST_ASSIGN_REF (class_type) = 1;
}
@@ -10104,8 +10207,8 @@ grok_op_properties (tree decl, bool complain)
if (operator_code == POSTINCREMENT_EXPR
|| operator_code == POSTDECREMENT_EXPR)
{
- if (pedantic)
- pedwarn ("%qD cannot have default arguments", decl);
+ pedwarn (input_location, OPT_pedantic, "%qD cannot have default arguments",
+ decl);
}
else
{
@@ -10576,10 +10679,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);
@@ -10671,13 +10771,20 @@ xref_basetypes (tree ref, tree base_list)
/* Begin compiling the definition of an enumeration type.
- NAME is its name.
+ NAME is its name,
+
+ UNDERLYING_TYPE is the type that will be used as the storage for
+ the enumeration type. This should be NULL_TREE if no storage type
+ was specified.
+
+ SCOPED_ENUM_P is true if this is a scoped enumeration type.
+
Returns the type object, as yet incomplete.
Also records info about it so that build_enumerator
may be used to declare the individual values as they are read. */
tree
-start_enum (tree name)
+start_enum (tree name, tree underlying_type, bool scoped_enum_p)
{
tree enumtype;
@@ -10709,6 +10816,39 @@ start_enum (tree name)
enumtype = pushtag (name, enumtype, /*tag_scope=*/ts_current);
}
+ if (scoped_enum_p)
+ {
+ SET_SCOPED_ENUM_P (enumtype, 1);
+ begin_scope (sk_scoped_enum, enumtype);
+
+ /* [C++0x dcl.enum]p5:
+
+ If not explicitly specified, the underlying type of a scoped
+ enumeration type is int. */
+ if (!underlying_type)
+ underlying_type = integer_type_node;
+ }
+
+ if (underlying_type)
+ {
+ if (CP_INTEGRAL_TYPE_P (underlying_type))
+ {
+ TYPE_MIN_VALUE (enumtype) = TYPE_MIN_VALUE (underlying_type);
+ TYPE_MAX_VALUE (enumtype) = TYPE_MAX_VALUE (underlying_type);
+ TYPE_SIZE (enumtype) = TYPE_SIZE (underlying_type);
+ TYPE_SIZE_UNIT (enumtype) = TYPE_SIZE_UNIT (underlying_type);
+ TYPE_MODE (enumtype) = TYPE_MODE (underlying_type);
+ TYPE_PRECISION (enumtype) = TYPE_PRECISION (underlying_type);
+ TYPE_ALIGN (enumtype) = TYPE_ALIGN (underlying_type);
+ TYPE_USER_ALIGN (enumtype) = TYPE_USER_ALIGN (underlying_type);
+ TYPE_UNSIGNED (enumtype) = TYPE_UNSIGNED (underlying_type);
+ ENUM_UNDERLYING_TYPE (enumtype) = underlying_type;
+ }
+ else
+ error ("underlying type %<%T%> of %<%T%> must be an integral type",
+ underlying_type, enumtype);
+ }
+
return enumtype;
}
@@ -10721,9 +10861,9 @@ finish_enum (tree enumtype)
{
tree values;
tree decl;
- tree value;
tree minnode;
tree maxnode;
+ tree value;
tree t;
bool unsignedp;
bool use_short_enum;
@@ -10732,6 +10872,8 @@ finish_enum (tree enumtype)
int precision;
integer_type_kind itk;
tree underlying_type = NULL_TREE;
+ bool fixed_underlying_type_p
+ = ENUM_UNDERLYING_TYPE (enumtype) != NULL_TREE;
/* We built up the VALUES in reverse order. */
TYPE_VALUES (enumtype) = nreverse (TYPE_VALUES (enumtype));
@@ -10757,34 +10899,34 @@ finish_enum (tree enumtype)
minnode = maxnode = NULL_TREE;
for (values = TYPE_VALUES (enumtype);
- values;
- values = TREE_CHAIN (values))
- {
- decl = TREE_VALUE (values);
-
- /* [dcl.enum]: Following the closing brace of an enum-specifier,
- each enumerator has the type of its enumeration. Prior to the
- closing brace, the type of each enumerator is the type of its
- initializing value. */
- TREE_TYPE (decl) = enumtype;
-
- /* Update the minimum and maximum values, if appropriate. */
- value = DECL_INITIAL (decl);
- if (value == error_mark_node)
- value = integer_zero_node;
- /* Figure out what the minimum and maximum values of the
- enumerators are. */
- if (!minnode)
- minnode = maxnode = value;
- else if (tree_int_cst_lt (maxnode, value))
- maxnode = value;
- else if (tree_int_cst_lt (value, minnode))
- minnode = value;
- }
+ values;
+ values = TREE_CHAIN (values))
+ {
+ decl = TREE_VALUE (values);
+
+ /* [dcl.enum]: Following the closing brace of an enum-specifier,
+ each enumerator has the type of its enumeration. Prior to the
+ closing brace, the type of each enumerator is the type of its
+ initializing value. */
+ TREE_TYPE (decl) = enumtype;
+
+ /* Update the minimum and maximum values, if appropriate. */
+ value = DECL_INITIAL (decl);
+ if (value == error_mark_node)
+ value = integer_zero_node;
+ /* Figure out what the minimum and maximum values of the
+ enumerators are. */
+ if (!minnode)
+ minnode = maxnode = value;
+ else if (tree_int_cst_lt (maxnode, value))
+ maxnode = value;
+ else if (tree_int_cst_lt (value, minnode))
+ minnode = value;
+ }
}
else
/* [dcl.enum]
-
+
If the enumerator-list is empty, the underlying type is as if
the enumeration had a single enumerator with value 0. */
minnode = maxnode = integer_zero_node;
@@ -10798,46 +10940,70 @@ finish_enum (tree enumtype)
highprec = min_precision (maxnode, unsignedp);
precision = MAX (lowprec, highprec);
- /* Determine the underlying type of the enumeration.
+ if (!fixed_underlying_type_p)
+ {
+ /* Determine the underlying type of the enumeration.
- [dcl.enum]
+ [dcl.enum]
- The underlying type of an enumeration is an integral type that
- can represent all the enumerator values defined in the
- enumeration. It is implementation-defined which integral type is
- used as the underlying type for an enumeration except that the
- underlying type shall not be larger than int unless the value of
- an enumerator cannot fit in an int or unsigned int.
+ The underlying type of an enumeration is an integral type that
+ can represent all the enumerator values defined in the
+ enumeration. It is implementation-defined which integral type is
+ used as the underlying type for an enumeration except that the
+ underlying type shall not be larger than int unless the value of
+ an enumerator cannot fit in an int or unsigned int.
- We use "int" or an "unsigned int" as the underlying type, even if
- a smaller integral type would work, unless the user has
- explicitly requested that we use the smallest possible type. The
- user can request that for all enumerations with a command line
- flag, or for just one enumeration with an attribute. */
+ We use "int" or an "unsigned int" as the underlying type, even if
+ a smaller integral type would work, unless the user has
+ explicitly requested that we use the smallest possible type. The
+ user can request that for all enumerations with a command line
+ flag, or for just one enumeration with an attribute. */
- use_short_enum = flag_short_enums
- || lookup_attribute ("packed", TYPE_ATTRIBUTES (enumtype));
+ use_short_enum = flag_short_enums
+ || lookup_attribute ("packed", TYPE_ATTRIBUTES (enumtype));
- for (itk = (use_short_enum ? itk_char : itk_int);
- itk != itk_none;
- itk++)
- {
- underlying_type = integer_types[itk];
- if (TYPE_PRECISION (underlying_type) >= precision
- && TYPE_UNSIGNED (underlying_type) == unsignedp)
- break;
- }
- if (itk == itk_none)
- {
- /* DR 377
+ for (itk = (use_short_enum ? itk_char : itk_int);
+ itk != itk_none;
+ itk++)
+ {
+ underlying_type = integer_types[itk];
+ if (TYPE_PRECISION (underlying_type) >= precision
+ && TYPE_UNSIGNED (underlying_type) == unsignedp)
+ break;
+ }
+ if (itk == itk_none)
+ {
+ /* DR 377
+
+ IF no integral type can represent all the enumerator values, the
+ enumeration is ill-formed. */
+ error ("no integral type can represent all of the enumerator values "
+ "for %qT", enumtype);
+ precision = TYPE_PRECISION (long_long_integer_type_node);
+ underlying_type = integer_types[itk_unsigned_long_long];
+ }
- IF no integral type can represent all the enumerator values, the
- enumeration is ill-formed. */
- error ("no integral type can represent all of the enumerator values "
- "for %qT", enumtype);
- precision = TYPE_PRECISION (long_long_integer_type_node);
- underlying_type = integer_types[itk_unsigned_long_long];
+ /* [dcl.enum]
+
+ The value of sizeof() applied to an enumeration type, an object
+ of an enumeration type, or an enumerator, is the value of sizeof()
+ applied to the underlying type. */
+ TYPE_SIZE (enumtype) = TYPE_SIZE (underlying_type);
+ TYPE_SIZE_UNIT (enumtype) = TYPE_SIZE_UNIT (underlying_type);
+ TYPE_MODE (enumtype) = TYPE_MODE (underlying_type);
+ TYPE_ALIGN (enumtype) = TYPE_ALIGN (underlying_type);
+ TYPE_USER_ALIGN (enumtype) = TYPE_USER_ALIGN (underlying_type);
+ TYPE_UNSIGNED (enumtype) = TYPE_UNSIGNED (underlying_type);
+
+ /* Set the underlying type of the enumeration type to the
+ computed enumeration type, restricted to the enumerator
+ values. */
+ ENUM_UNDERLYING_TYPE (enumtype) = copy_node (underlying_type);
+ set_min_and_max_values_for_integral_type
+ (ENUM_UNDERLYING_TYPE (enumtype), precision, unsignedp);
}
+ else
+ underlying_type = ENUM_UNDERLYING_TYPE (enumtype);
/* Compute the minimum and maximum values for the type.
@@ -10848,28 +11014,16 @@ finish_enum (tree enumtype)
underlying type in the range bmin to bmax, where bmin and bmax are,
respectively, the smallest and largest values of the smallest bit-
field that can store emin and emax. */
-
+
/* The middle-end currently assumes that types with TYPE_PRECISION
narrower than their underlying type are suitably zero or sign
extended to fill their mode. g++ doesn't make these guarantees.
Until the middle-end can represent such paradoxical types, we
set the TYPE_PRECISION to the width of the underlying type. */
TYPE_PRECISION (enumtype) = TYPE_PRECISION (underlying_type);
-
+
set_min_and_max_values_for_integral_type (enumtype, precision, unsignedp);
-
- /* [dcl.enum]
-
- The value of sizeof() applied to an enumeration type, an object
- of an enumeration type, or an enumerator, is the value of sizeof()
- applied to the underlying type. */
- TYPE_SIZE (enumtype) = TYPE_SIZE (underlying_type);
- TYPE_SIZE_UNIT (enumtype) = TYPE_SIZE_UNIT (underlying_type);
- TYPE_MODE (enumtype) = TYPE_MODE (underlying_type);
- TYPE_ALIGN (enumtype) = TYPE_ALIGN (underlying_type);
- TYPE_USER_ALIGN (enumtype) = TYPE_USER_ALIGN (underlying_type);
- TYPE_UNSIGNED (enumtype) = TYPE_UNSIGNED (underlying_type);
-
+
/* Convert each of the enumerators to the type of the underlying
type of the enumeration. */
for (values = TYPE_VALUES (enumtype); values; values = TREE_CHAIN (values))
@@ -10879,9 +11033,14 @@ finish_enum (tree enumtype)
decl = TREE_VALUE (values);
saved_location = input_location;
input_location = DECL_SOURCE_LOCATION (decl);
- value = perform_implicit_conversion (underlying_type,
- DECL_INITIAL (decl),
- tf_warning_or_error);
+ if (fixed_underlying_type_p)
+ /* If the enumeration type has a fixed underlying type, we
+ already checked all of the enumerator values. */
+ value = DECL_INITIAL (decl);
+ else
+ value = perform_implicit_conversion (underlying_type,
+ DECL_INITIAL (decl),
+ tf_warning_or_error);
input_location = saved_location;
/* Do not clobber shared ints. */
@@ -10889,7 +11048,6 @@ finish_enum (tree enumtype)
TREE_TYPE (value) = enumtype;
DECL_INITIAL (decl) = value;
- TREE_VALUE (values) = value;
}
/* Fix up all variant types of this enum type. */
@@ -10905,8 +11063,13 @@ finish_enum (tree enumtype)
TYPE_ALIGN (t) = TYPE_ALIGN (enumtype);
TYPE_USER_ALIGN (t) = TYPE_USER_ALIGN (enumtype);
TYPE_UNSIGNED (t) = TYPE_UNSIGNED (enumtype);
+ ENUM_UNDERLYING_TYPE (t) = ENUM_UNDERLYING_TYPE (enumtype);
}
+ /* Finish up the scope of a scoped enumeration. */
+ if (SCOPED_ENUM_P (enumtype))
+ finish_scope ();
+
/* Finish debugging output for this type. */
rest_of_type_compilation (enumtype, namespace_bindings_p ());
}
@@ -10983,24 +11146,46 @@ build_enumerator (tree name, tree value, tree enumtype)
/* Remove no-op casts from the value. */
STRIP_TYPE_NOPS (value);
+
+ /* If the underlying type of the enum is fixed, check whether
+ the enumerator values fits in the underlying type. If it
+ does not fit, the program is ill-formed [C++0x dcl.enum]. */
+ if (ENUM_UNDERLYING_TYPE (enumtype)
+ && value
+ && TREE_CODE (value) == INTEGER_CST
+ && !int_fits_type_p (value, ENUM_UNDERLYING_TYPE (enumtype)))
+ {
+ error ("enumerator value %E is too large for underlying type %<%T%>",
+ value, ENUM_UNDERLYING_TYPE (enumtype));
+
+ /* Silently convert the value so that we can continue. */
+ value = perform_implicit_conversion (ENUM_UNDERLYING_TYPE (enumtype),
+ value, tf_none);
+ if (value == error_mark_node)
+ value = NULL_TREE;
+ }
}
/* C++ associates enums with global, function, or class declarations. */
context = current_scope ();
/* Build the actual enumeration constant. Note that the enumeration
- constants have the type of their initializers until the
- enumeration is complete:
-
- [ dcl.enum ]
-
- Following the closing brace of an enum-specifier, each enumer-
- ator has the type of its enumeration. Prior to the closing
- brace, the type of each enumerator is the type of its
- initializing value.
-
- In finish_enum we will reset the type. Of course, if we're
- processing a template, there may be no value. */
+ constants have the underlying type of the enum (if it is fixed)
+ or the type of their initializer (if the underlying type of the
+ enum is not fixed):
+
+ [ C++0x dcl.enum ]
+
+ If the underlying type is fixed, the type of each enumerator
+ prior to the closing brace is the underlying type; if the
+ initializing value of an enumerator cannot be represented by
+ the underlying type, the program is ill-formed. If the
+ underlying type is not fixed, the type of each enumerator is
+ the type of its initializing value.
+
+ If the underlying type is not fixed, it will be computed by
+ finish_enum and we will reset the type of this enumerator. Of
+ course, if we're processing a template, there may be no value. */
type = value ? TREE_TYPE (value) : NULL_TREE;
if (context && context == current_class_type)
@@ -11029,6 +11214,26 @@ build_enumerator (tree name, tree value, tree enumtype)
TYPE_VALUES (enumtype) = tree_cons (name, decl, TYPE_VALUES (enumtype));
}
+/* Look for an enumerator with the given NAME within the enumeration
+ type ENUMTYPE. This routine is used primarily for qualified name
+ lookup into an enumerator in C++0x, e.g.,
+
+ enum class Color { Red, Green, Blue };
+
+ Color color = Color::Red;
+
+ Returns the value corresponding to the enumerator, or
+ NULL_TREE if no such enumerator was found. */
+tree
+lookup_enumerator (tree enumtype, tree name)
+{
+ tree e;
+ gcc_assert (enumtype && TREE_CODE (enumtype) == ENUMERAL_TYPE);
+
+ e = purpose_member (name, TYPE_VALUES (enumtype));
+ return e? TREE_VALUE (e) : NULL_TREE;
+}
+
/* We're defining DECL. Make sure that it's type is OK. */
@@ -11961,13 +12166,15 @@ finish_function (int flags)
/* Don't complain if we abort or throw. */
&& !current_function_returns_abnormally
&& !DECL_NAME (DECL_RESULT (fndecl))
- /* Normally, with -Wreturn-type, flow will complain. Unless we're an
- inline function, as we might never be compiled separately. */
- && (DECL_INLINE (fndecl) || processing_template_decl)
+ && !TREE_NO_WARNING (fndecl)
/* Structor return values (if any) are set by the compiler. */
&& !DECL_CONSTRUCTOR_P (fndecl)
&& !DECL_DESTRUCTOR_P (fndecl))
- warning (OPT_Wreturn_type, "no return statement in function returning non-void");
+ {
+ warning (OPT_Wreturn_type,
+ "no return statement in function returning non-void");
+ TREE_NO_WARNING (fndecl) = 1;
+ }
/* Store the end of the function, so that we get good line number
info for the epilogue. */
@@ -11989,7 +12196,7 @@ finish_function (int flags)
f->extern_decl_map = NULL;
/* Handle attribute((warn_unused_result)). Relies on gimple input. */
- c_warn_unused_result (&DECL_SAVED_TREE (fndecl));
+ c_warn_unused_result (gimple_body (fndecl));
}
/* Clear out the bits we don't need. */
local_names = NULL;
@@ -12078,8 +12285,6 @@ start_method (cp_decl_specifier_seq *declspecs,
check_template_shadow (fndecl);
DECL_DECLARED_INLINE_P (fndecl) = 1;
- if (flag_default_inline)
- DECL_INLINE (fndecl) = 1;
/* We process method specializations in finish_struct_1. */
if (processing_template_decl && !DECL_TEMPLATE_SPECIALIZATION (fndecl))
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index f14f94d16b5..677597ec422 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -51,6 +51,7 @@ along with GCC; see the file COPYING3. If not see
#include "c-pragma.h"
#include "tree-dump.h"
#include "intl.h"
+#include "gimple.h"
extern cpp_reader *parse_in;
@@ -717,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. */
@@ -821,7 +822,24 @@ grokfield (const cp_declarator *declarator,
{
/* Initializers for functions are rejected early in the parser.
If we get here, it must be a pure specifier for a method. */
- if (TREE_CODE (TREE_TYPE (value)) == METHOD_TYPE)
+ if (init == ridpointers[(int)RID_DELETE])
+ {
+ DECL_DELETED_FN (value) = 1;
+ DECL_DECLARED_INLINE_P (value) = 1;
+ DECL_INITIAL (value) = error_mark_node;
+ }
+ else if (init == ridpointers[(int)RID_DEFAULT])
+ {
+ if (!defaultable_fn_p (value))
+ error ("%qD cannot be defaulted", value);
+ else
+ {
+ DECL_DEFAULTED_FN (value) = 1;
+ DECL_INITIALIZED_IN_CLASS_P (value) = 1;
+ DECL_DECLARED_INLINE_P (value) = 1;
+ }
+ }
+ else if (TREE_CODE (TREE_TYPE (value)) == METHOD_TYPE)
{
gcc_assert (error_operand_p (init) || integer_zerop (init));
DECL_PURE_VIRTUAL_P (value) = 1;
@@ -1242,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,
@@ -1385,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)
@@ -2683,7 +2701,6 @@ start_static_storage_duration_function (unsigned count)
type);
TREE_PUBLIC (ssdf_decl) = 0;
DECL_ARTIFICIAL (ssdf_decl) = 1;
- DECL_INLINE (ssdf_decl) = 1;
/* Put this function in the list of functions to be called from the
static constructors and destructors. */
@@ -2794,6 +2811,38 @@ get_priority_info (int priority)
|| DECL_ONE_ONLY (decl) \
|| DECL_WEAK (decl)))
+/* Called from one_static_initialization_or_destruction(),
+ via walk_tree.
+ Walks the initializer list of a global variable and looks for
+ temporary variables (DECL_NAME() == NULL and DECL_ARTIFICIAL != 0)
+ and that have their DECL_CONTEXT() == NULL.
+ For each such temporary variable, set their DECL_CONTEXT() to
+ the current function. This is necessary because otherwise
+ some optimizers (enabled by -O2 -fprofile-arcs) might crash
+ when trying to refer to a temporary variable that does not have
+ it's DECL_CONTECT() properly set. */
+static tree
+fix_temporary_vars_context_r (tree *node,
+ int *unused ATTRIBUTE_UNUSED,
+ void *unused1 ATTRIBUTE_UNUSED)
+{
+ gcc_assert (current_function_decl);
+
+ if (TREE_CODE (*node) == BIND_EXPR)
+ {
+ tree var;
+
+ for (var = BIND_EXPR_VARS (*node); var; var = TREE_CHAIN (var))
+ if (TREE_CODE (var) == VAR_DECL
+ && !DECL_NAME (var)
+ && DECL_ARTIFICIAL (var)
+ && !DECL_CONTEXT (var))
+ DECL_CONTEXT (var) = current_function_decl;
+ }
+
+ return NULL_TREE;
+}
+
/* Set up to handle the initialization or destruction of DECL. If
INITP is nonzero, we are initializing the variable. Otherwise, we
are destroying it. */
@@ -2816,6 +2865,19 @@ one_static_initialization_or_destruction (tree decl, tree init, bool initp)
information. */
input_location = DECL_SOURCE_LOCATION (decl);
+ /* Make sure temporary variables in the initialiser all have
+ their DECL_CONTEXT() set to a value different from NULL_TREE.
+ This can happen when global variables initialisers are built.
+ In that case, the DECL_CONTEXT() of the global variables _AND_ of all
+ the temporary variables that might have been generated in the
+ accompagning initialisers is NULL_TREE, meaning the variables have been
+ declared in the global namespace.
+ What we want to do here is to fix that and make sure the DECL_CONTEXT()
+ of the temporaries are set to the current function decl. */
+ cp_walk_tree_without_duplicates (&init,
+ fix_temporary_vars_context_r,
+ NULL);
+
/* Because of:
[class.access.spec]
@@ -3404,7 +3466,7 @@ cp_write_global_declarations (void)
{
/* Does it need synthesizing? */
if (DECL_ARTIFICIAL (decl) && ! DECL_INITIAL (decl)
- && (! DECL_REALLY_EXTERN (decl) || DECL_INLINE (decl)))
+ && (! DECL_REALLY_EXTERN (decl) || possibly_inlined_p (decl)))
{
/* Even though we're already at the top-level, we push
there again. That way, when we pop back a few lines
@@ -3421,7 +3483,7 @@ cp_write_global_declarations (void)
reconsider = true;
}
- if (!DECL_SAVED_TREE (decl))
+ if (!gimple_body (decl))
continue;
/* We lie to the back end, pretending that some functions
@@ -3665,6 +3727,22 @@ check_default_args (tree x)
}
}
+/* Return true if function DECL can be inlined. This is used to force
+ instantiation of methods that might be interesting for inlining. */
+bool
+possibly_inlined_p (tree decl)
+{
+ gcc_assert (TREE_CODE (decl) == FUNCTION_DECL);
+ if (DECL_UNINLINABLE (decl))
+ return false;
+ if (!optimize)
+ return DECL_DECLARED_INLINE_P (decl);
+ /* When optimizing, we might inline everything when flatten
+ attribute or heuristics inlining for size or autoinlining
+ is used. */
+ return true;
+}
+
/* Mark DECL (either a _DECL or a BASELINK) as "used" in the program.
If DECL is a specialization or implicitly declared class member,
generate the actual definition. */
@@ -3739,7 +3817,7 @@ mark_used (tree decl)
/* Is it a synthesized method that needs to be synthesized? */
if (TREE_CODE (decl) == FUNCTION_DECL
&& DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
- && DECL_ARTIFICIAL (decl)
+ && DECL_DEFAULTED_FN (decl)
&& !DECL_THUNK_P (decl)
&& ! DECL_INITIAL (decl)
/* Kludge: don't synthesize for default args. Unfortunately this
@@ -3752,12 +3830,19 @@ mark_used (tree decl)
/* If we've already synthesized the method we don't need to
do the instantiation test below. */
}
+ else if (TREE_CODE (decl) == FUNCTION_DECL
+ && DECL_DELETED_FN (decl))
+ {
+ error ("deleted function %q+D", decl);
+ error ("used here");
+ }
else if ((DECL_NON_THUNK_FUNCTION_P (decl) || TREE_CODE (decl) == VAR_DECL)
&& DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl)
&& (!DECL_EXPLICIT_INSTANTIATION (decl)
|| (TREE_CODE (decl) == FUNCTION_DECL
- && DECL_INLINE (DECL_TEMPLATE_RESULT
- (template_for_substitution (decl))))
+ && possibly_inlined_p
+ (DECL_TEMPLATE_RESULT (
+ template_for_substitution (decl))))
/* We need to instantiate static data members so that there
initializers are available in integral constant
expressions. */
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 80aa6e962d2..b8330c3d0fc 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -447,8 +447,13 @@ dump_typename (tree t, int flags)
const char *
class_key_or_enum_as_string (tree t)
{
- if (TREE_CODE (t) == ENUMERAL_TYPE)
- return "enum";
+ if (TREE_CODE (t) == ENUMERAL_TYPE)
+ {
+ if (SCOPED_ENUM_P (t))
+ return "enum class";
+ else
+ return "enum";
+ }
else if (TREE_CODE (t) == UNION_TYPE)
return "union";
else if (TYPE_LANG_SPECIFIC (t) && CLASSTYPE_DECLARED_CLASS (t))
@@ -2388,7 +2393,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 +2668,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 +2692,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 ("%s only available with -std=c++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 3070cda4d54..7813d087405 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -1,6 +1,7 @@
/* Handle exceptional things in C++.
Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
- 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+ 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
+ Free Software Foundation, Inc.
Contributed by Michael Tiemann <tiemann@cygnus.com>
Rewritten by Mike Stump <mrs@cygnus.com>, based upon an
initial re-implementation courtesy Tad Hunt.
@@ -38,6 +39,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-inline.h"
#include "tree-iterator.h"
#include "target.h"
+#include "gimple.h"
static void push_eh_cleanup (tree);
static tree prepare_eh_type (tree);
@@ -52,7 +54,7 @@ static tree wrap_cleanups_r (tree *, int *, void *);
static int complete_ptr_ref_or_void_ptr_p (tree, tree);
static bool is_admissible_throw_operand (tree);
static int can_convert_eh (tree, tree);
-static tree cp_protect_cleanup_actions (void);
+static gimple cp_protect_cleanup_actions (void);
/* Sets up all the global eh stuff that needs to be initialized at the
start of compilation. */
@@ -91,14 +93,14 @@ init_exception_processing (void)
/* Returns an expression to be executed if an unhandled exception is
propagated out of a cleanup region. */
-static tree
+static gimple
cp_protect_cleanup_actions (void)
{
/* [except.terminate]
When the destruction of an object during stack unwinding exits
using an exception ... void terminate(); is called. */
- return build_call_n (terminate_node, 0);
+ return gimple_build_call (terminate_node, 0);
}
static tree
@@ -160,6 +162,21 @@ build_exc_ptr (void)
return build0 (EXC_PTR_EXPR, ptr_type_node);
}
+/* Declare a function NAME, returning RETURN_TYPE, taking a single
+ parameter PARM_TYPE, with an empty exception specification.
+
+ Note that the C++ ABI document does not have a throw-specifier on
+ the routines declared below via this function. The declarations
+ are consistent with the actual implementations in libsupc++. */
+
+static tree
+declare_nothrow_library_fn (tree name, tree return_type, tree parm_type)
+{
+ tree tmp = tree_cons (NULL_TREE, parm_type, void_list_node);
+ return push_library_fn (name, build_function_type (return_type, tmp),
+ empty_except_spec);
+}
+
/* Build up a call to __cxa_get_exception_ptr so that we can build a
copy constructor for the thrown object. */
@@ -171,9 +188,8 @@ do_get_exception_ptr (void)
fn = get_identifier ("__cxa_get_exception_ptr");
if (!get_global_value_if_present (fn, &fn))
{
- /* Declare void* __cxa_get_exception_ptr (void *). */
- tree tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
- fn = push_library_fn (fn, build_function_type (ptr_type_node, tmp));
+ /* Declare void* __cxa_get_exception_ptr (void *) throw(). */
+ fn = declare_nothrow_library_fn (fn, ptr_type_node, ptr_type_node);
}
return cp_build_function_call (fn, tree_cons (NULL_TREE, build_exc_ptr (),
@@ -192,9 +208,8 @@ do_begin_catch (void)
fn = get_identifier ("__cxa_begin_catch");
if (!get_global_value_if_present (fn, &fn))
{
- /* Declare void* __cxa_begin_catch (void *). */
- tree tmp = tree_cons (NULL_TREE, ptr_type_node, void_list_node);
- fn = push_library_fn (fn, build_function_type (ptr_type_node, tmp));
+ /* Declare void* __cxa_begin_catch (void *) throw(). */
+ fn = declare_nothrow_library_fn (fn, ptr_type_node, ptr_type_node);
}
return cp_build_function_call (fn, tree_cons (NULL_TREE, build_exc_ptr (),
@@ -543,9 +558,8 @@ do_allocate_exception (tree type)
fn = get_identifier ("__cxa_allocate_exception");
if (!get_global_value_if_present (fn, &fn))
{
- /* Declare void *__cxa_allocate_exception(size_t). */
- tree tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
- fn = push_library_fn (fn, build_function_type (ptr_type_node, tmp));
+ /* Declare void *__cxa_allocate_exception(size_t) throw(). */
+ fn = declare_nothrow_library_fn (fn, ptr_type_node, size_type_node);
}
return cp_build_function_call (fn,
@@ -565,9 +579,8 @@ do_free_exception (tree ptr)
fn = get_identifier ("__cxa_free_exception");
if (!get_global_value_if_present (fn, &fn))
{
- /* Declare void __cxa_free_exception (void *). */
- fn = push_void_library_fn (fn, tree_cons (NULL_TREE, ptr_type_node,
- void_list_node));
+ /* Declare void __cxa_free_exception (void *) throw(). */
+ fn = declare_nothrow_library_fn (fn, void_type_node, ptr_type_node);
}
return cp_build_function_call (fn, tree_cons (NULL_TREE, ptr, NULL_TREE),
@@ -1015,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 7319568b4b4..1c722f52322 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -346,8 +346,8 @@ build_value_init_1 (tree type, bool have_ctor)
if (CLASS_TYPE_P (type))
{
- if (TYPE_HAS_USER_CONSTRUCTOR (type) && !have_ctor)
- return build_cplus_new
+ if (type_has_user_provided_constructor (type) && !have_ctor)
+ return build_aggr_init_expr
(type,
build_special_member_call (NULL_TREE, complete_ctor_identifier,
NULL_TREE, type, LOOKUP_NORMAL,
@@ -511,13 +511,22 @@ perform_member_init (tree member, tree init)
{
/* Initialization of one array from another. */
finish_expr_stmt (build_vec_init (decl, NULL_TREE, TREE_VALUE (init),
- /*explicit_default_init_p=*/false,
+ /*explicit_value_init_p=*/false,
/* from_array=*/1,
tf_warning_or_error));
}
else
- finish_expr_stmt (build_aggr_init (decl, init, 0,
- tf_warning_or_error));
+ {
+ if (CP_TYPE_CONST_P (type)
+ && init == NULL_TREE
+ && !type_has_user_provided_default_constructor (type))
+ /* TYPE_NEEDS_CONSTRUCTING can be set just because we have a
+ vtable; still give this diagnostic. */
+ 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));
+ }
}
else
{
@@ -533,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)
@@ -1277,7 +1286,7 @@ build_aggr_init (tree exp, tree init, int flags, tsubst_flags_t complain)
if (itype && cp_type_quals (itype) != TYPE_UNQUALIFIED)
itype = TREE_TYPE (init) = TYPE_MAIN_VARIANT (itype);
stmt_expr = build_vec_init (exp, NULL_TREE, init,
- /*explicit_default_init_p=*/false,
+ /*explicit_value_init_p=*/false,
itype && same_type_p (itype,
TREE_TYPE (exp)),
complain);
@@ -1883,7 +1892,9 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
return error_mark_node;
is_initialized = (TYPE_NEEDS_CONSTRUCTING (elt_type) || init);
- if (CP_TYPE_CONST_P (elt_type) && !is_initialized)
+
+ if (CP_TYPE_CONST_P (elt_type) && !init
+ && !type_has_user_provided_default_constructor (elt_type))
{
if (complain & tf_error)
error ("uninitialized const in %<new%> of %q#T", elt_type);
@@ -2044,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. */
@@ -2100,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);
@@ -2123,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
{
@@ -2135,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
@@ -2143,22 +2156,22 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
if (is_initialized)
{
bool stable;
+ bool explicit_value_init_p = false;
init_expr = cp_build_indirect_ref (data_addr, NULL, complain);
- if (array_p)
+ if (init == void_zero_node)
{
- bool explicit_default_init_p = false;
+ init = NULL_TREE;
+ explicit_value_init_p = true;
+ }
- if (init == void_zero_node)
- {
- init = NULL_TREE;
- explicit_default_init_p = true;
- }
- else if (init)
+ if (array_p)
+ {
+ 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;
}
@@ -2168,7 +2181,7 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
integer_one_node,
complain),
init,
- explicit_default_init_p,
+ explicit_value_init_p,
/*from_array=*/0,
complain);
@@ -2179,17 +2192,19 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
}
else
{
- if (init == void_zero_node)
- init = build_default_init (full_type, nelts);
-
- if (TYPE_NEEDS_CONSTRUCTING (type))
+ if (TYPE_NEEDS_CONSTRUCTING (type) && !explicit_value_init_p)
{
init_expr = build_special_member_call (init_expr,
complete_ctor_identifier,
init, elt_type,
LOOKUP_NORMAL,
complain);
- stable = stabilize_init (init_expr, &init_preeval_expr);
+ }
+ else if (explicit_value_init_p)
+ {
+ /* Something like `new int()'. */
+ init_expr = build2 (INIT_EXPR, full_type,
+ init_expr, build_value_init (full_type));
}
else
{
@@ -2205,8 +2220,8 @@ build_new_1 (tree placement, tree type, tree nelts, tree init,
init_expr = cp_build_modify_expr (init_expr, INIT_EXPR, init,
complain);
- stable = stabilize_init (init_expr, &init_preeval_expr);
}
+ stable = stabilize_init (init_expr, &init_preeval_expr);
}
if (init_expr == error_mark_node)
@@ -2228,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. */;
@@ -2287,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);
@@ -2349,6 +2366,14 @@ build_new (tree placement, tree type, tree nelts, tree init,
orig_nelts = nelts;
orig_init = init;
+ if (nelts == NULL_TREE && init != void_zero_node && list_length (init) == 1
+ && !any_type_dependent_arguments_p (init))
+ {
+ tree auto_node = type_uses_auto (type);
+ if (auto_node)
+ type = do_auto_deduction (type, TREE_VALUE (init), auto_node);
+ }
+
if (processing_template_decl)
{
if (dependent_type_p (type)
@@ -2370,7 +2395,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;
}
@@ -2651,8 +2676,8 @@ get_temp_regvar (tree type, tree init)
INIT is the (possibly NULL) initializer.
- If EXPLICIT_DEFAULT_INIT_P is true, then INIT must be NULL. All
- elements in the array are default-initialized.
+ If EXPLICIT_VALUE_INIT_P is true, then INIT must be NULL. All
+ elements in the array are value-initialized.
FROM_ARRAY is 0 if we should init everything with INIT
(i.e., every element initialized from INIT).
@@ -2663,7 +2688,7 @@ get_temp_regvar (tree type, tree init)
tree
build_vec_init (tree base, tree maxindex, tree init,
- bool explicit_default_init_p,
+ bool explicit_value_init_p,
int from_array, tsubst_flags_t complain)
{
tree rval;
@@ -2693,7 +2718,7 @@ build_vec_init (tree base, tree maxindex, tree init,
if (maxindex == NULL_TREE || maxindex == error_mark_node)
return error_mark_node;
- if (explicit_default_init_p)
+ if (explicit_value_init_p)
gcc_assert (!init);
inner_elt_type = strip_array_types (atype);
@@ -2829,7 +2854,7 @@ build_vec_init (tree base, tree maxindex, tree init,
We do need to keep going if we're copying an array. */
if (from_array
- || ((TYPE_NEEDS_CONSTRUCTING (type) || explicit_default_init_p)
+ || ((TYPE_NEEDS_CONSTRUCTING (type) || explicit_value_init_p)
&& ! (host_integerp (maxindex, 0)
&& (num_initialized_elts
== tree_low_cst (maxindex, 0) + 1))))
@@ -2878,17 +2903,17 @@ build_vec_init (tree base, tree maxindex, tree init,
("cannot initialize multi-dimensional array with initializer");
elt_init = build_vec_init (build1 (INDIRECT_REF, type, base),
0, 0,
- /*explicit_default_init_p=*/false,
+ explicit_value_init_p,
0, complain);
}
- else if (!TYPE_NEEDS_CONSTRUCTING (type))
- elt_init = (cp_build_modify_expr
- (to, INIT_EXPR,
- build_zero_init (type, size_one_node,
- /*static_storage_p=*/false),
- complain));
+ else if (explicit_value_init_p)
+ elt_init = build2 (INIT_EXPR, type, to,
+ build_value_init (type));
else
- elt_init = build_aggr_init (to, init, 0, complain);
+ {
+ gcc_assert (TYPE_NEEDS_CONSTRUCTING (type));
+ elt_init = build_aggr_init (to, init, 0, complain);
+ }
current_stmt_tree ()->stmts_are_full_exprs_p = 1;
finish_expr_stmt (elt_init);
@@ -3018,12 +3043,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;
}
}
@@ -3264,6 +3291,7 @@ build_vec_delete (tree base, tree maxindex,
{
/* Step back one from start of vector, and read dimension. */
tree cookie_addr;
+ tree size_ptr_type = build_pointer_type (sizetype);
if (TREE_SIDE_EFFECTS (base))
{
@@ -3273,8 +3301,8 @@ build_vec_delete (tree base, tree maxindex,
type = strip_array_types (TREE_TYPE (type));
cookie_addr = fold_build1 (NEGATE_EXPR, sizetype, TYPE_SIZE_UNIT (sizetype));
cookie_addr = build2 (POINTER_PLUS_EXPR,
- build_pointer_type (sizetype),
- base,
+ size_ptr_type,
+ fold_convert (size_ptr_type, base),
cookie_addr);
maxindex = cp_build_indirect_ref (cookie_addr, NULL, tf_warning_or_error);
}
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index ee2f2a80706..d5ddce88aef 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -247,17 +247,6 @@ cxx_init (void)
cxx_init_decl_processing ();
- /* The fact that G++ uses COMDAT for many entities (inline
- functions, template instantiations, virtual tables, etc.) mean
- that it is fundamentally unreliable to try to make decisions
- about whether or not to output a particular entity until the end
- of the compilation. However, the inliner requires that functions
- be provided to the back end if they are to be inlined.
- Therefore, we always use unit-at-a-time mode; in that mode, we
- can provide entities to the back end and it will decide what to
- emit based on what is actually needed. */
- flag_unit_at_a_time = 1;
-
if (c_common_init () == false)
{
input_location = saved_loc;
@@ -492,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);
@@ -501,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/mangle.c b/gcc/cp/mangle.c
index 1bc72b86a2d..dea92b9c9ea 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -1056,7 +1056,10 @@ write_unqualified_name (const tree decl)
else if (DECL_LANG_SPECIFIC (decl) != NULL && DECL_DESTRUCTOR_P (decl))
write_special_name_destructor (decl);
else if (DECL_NAME (decl) == NULL_TREE)
- write_source_name (DECL_ASSEMBLER_NAME (decl));
+ {
+ gcc_assert (DECL_ASSEMBLER_NAME_SET_P (decl));
+ write_source_name (DECL_ASSEMBLER_NAME (decl));
+ }
else if (DECL_CONV_FN_P (decl))
{
/* Conversion operator. Handle it right here.
@@ -1546,6 +1549,13 @@ write_type (tree type)
if (target_mangling)
{
write_string (target_mangling);
+ /* Add substitutions for types other than fundamental
+ types. */
+ if (TREE_CODE (type) != VOID_TYPE
+ && TREE_CODE (type) != INTEGER_TYPE
+ && TREE_CODE (type) != REAL_TYPE
+ && TREE_CODE (type) != BOOLEAN_TYPE)
+ add_substitution (type);
return;
}
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index bd63d0cba52..5b4c273dda9 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -155,7 +155,6 @@ make_thunk (tree function, bool this_adjusting,
DECL_NO_STATIC_CHAIN (thunk) = 1;
/* The THUNK is not a pending inline, even if the FUNCTION is. */
DECL_PENDING_INLINE_P (thunk) = 0;
- DECL_INLINE (thunk) = 0;
DECL_DECLARED_INLINE_P (thunk) = 0;
/* Nor has it been deferred. */
DECL_DEFERRED_FN (thunk) = 0;
@@ -281,7 +280,6 @@ make_alias_for (tree function, tree newid)
DECL_ARTIFICIAL (alias) = 1;
DECL_NO_STATIC_CHAIN (alias) = 1;
DECL_PENDING_INLINE_P (alias) = 0;
- DECL_INLINE (alias) = 0;
DECL_DECLARED_INLINE_P (alias) = 0;
DECL_DEFERRED_FN (alias) = 0;
DECL_USE_TEMPLATE (alias) = 0;
@@ -815,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 &
@@ -1108,9 +1106,9 @@ implicitly_declare_fn (special_function_kind kind, tree type, bool const_p)
rest_of_decl_compilation (fn, toplevel_bindings_p (), at_eof);
DECL_IN_AGGR_P (fn) = 1;
DECL_ARTIFICIAL (fn) = 1;
+ DECL_DEFAULTED_FN (fn) = 1;
DECL_NOT_REALLY_EXTERN (fn) = 1;
DECL_DECLARED_INLINE_P (fn) = 1;
- DECL_INLINE (fn) = 1;
gcc_assert (!TREE_USED (fn));
/* Restore PROCESSING_TEMPLATE_DECL. */
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 477cfb367e8..7fc6a9341ae 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -724,10 +724,10 @@ pushdecl_maybe_friend (tree x, bool is_friend)
/* Don't do anything just yet. */;
else if (t == wchar_decl_node)
{
- if (pedantic && ! DECL_IN_SYSTEM_HEADER (x))
- pedwarn ("redeclaration of %<wchar_t%> as %qT",
+ if (! DECL_IN_SYSTEM_HEADER (x))
+ pedwarn (input_location, OPT_pedantic, "redeclaration of %<wchar_t%> as %qT",
TREE_TYPE (x));
-
+
/* Throw away the redeclaration. */
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t);
}
@@ -796,10 +796,11 @@ pushdecl_maybe_friend (tree x, bool is_friend)
x_exception_spec,
true))
{
- pedwarn ("declaration of %q#D with C language linkage", x);
- pedwarn ("conflicts with previous declaration %q+#D",
- previous);
- pedwarn ("due to different exception specifications");
+ pedwarn (input_location, 0, "declaration of %q#D with C language linkage",
+ x);
+ pedwarn (input_location, 0, "conflicts with previous declaration %q+#D",
+ previous);
+ pedwarn (input_location, 0, "due to different exception specifications");
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
}
}
@@ -889,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);
}
}
@@ -1216,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;
}
}
@@ -1328,7 +1329,7 @@ push_binding_level (struct cp_binding_level *scope)
/* Create a new KIND scope and make it the top of the active scopes stack.
ENTITY is the scope of the associated C++ entity (namespace, class,
- function); it is NULL otherwise. */
+ function, C++0x enumeration); it is NULL otherwise. */
cxx_scope *
begin_scope (scope_kind kind, tree entity)
@@ -1363,6 +1364,7 @@ begin_scope (scope_kind kind, tree entity)
case sk_catch:
case sk_for:
case sk_class:
+ case sk_scoped_enum:
case sk_function_parms:
case sk_omp:
scope->keep = keep_next_level_flag;
@@ -2752,7 +2754,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]
@@ -3487,7 +3490,8 @@ do_using_directive (tree name_space)
/* Emit debugging info. */
if (!processing_template_decl)
- (*debug_hooks->imported_module_or_decl) (name_space, context);
+ (*debug_hooks->imported_module_or_decl) (name_space, NULL_TREE,
+ context, false);
}
/* Deal with a using-directive seen by the parser. Currently we only
@@ -3851,6 +3855,8 @@ lookup_qualified_name (tree scope, tree name, bool is_type_p, bool complain)
if (qualified_lookup_using_namespace (name, scope, &binding, flags))
t = binding.value;
}
+ else if (cxx_dialect != cxx98 && TREE_CODE (scope) == ENUMERAL_TYPE)
+ t = lookup_enumerator (scope, name);
else if (is_class_type (scope, complain))
t = lookup_member (scope, name, 2, is_type_p);
@@ -5322,7 +5328,7 @@ cp_emit_debug_info_for_using (tree t, tree context)
/* FIXME: Handle TEMPLATE_DECLs. */
for (t = OVL_CURRENT (t); t; t = OVL_NEXT (t))
if (TREE_CODE (t) != TEMPLATE_DECL)
- (*debug_hooks->imported_module_or_decl) (t, context);
+ (*debug_hooks->imported_module_or_decl) (t, NULL_TREE, context, false);
}
#include "gt-cp-name-lookup.h"
diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h
index a4c057e0be5..ac92cc89bc9 100644
--- a/gcc/cp/name-lookup.h
+++ b/gcc/cp/name-lookup.h
@@ -113,6 +113,8 @@ typedef enum scope_kind {
for-init-statement. */
sk_function_parms, /* The scope containing function parameters. */
sk_class, /* The scope containing the members of a class. */
+ sk_scoped_enum, /* The scope containing the enumertors of a C++0x
+ scoped enumeration. */
sk_namespace, /* The scope containing the members of a
namespace, including the global scope. */
sk_template_parms, /* A scope for template parameters. */
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index a91f8d5f564..8c7b9e82ccb 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -1,5 +1,5 @@
/* Perform optimizations on tree structure.
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2007
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2007, 2008
Free Software Foundation, Inc.
Written by Mark Michell (mark@codesourcery.com).
@@ -40,7 +40,7 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "diagnostic.h"
#include "tree-dump.h"
-#include "tree-gimple.h"
+#include "gimple.h"
/* Prototypes. */
@@ -72,35 +72,40 @@ update_cloned_parm (tree parm, tree cloned_parm, bool first)
DECL_GIMPLE_REG_P (cloned_parm) = DECL_GIMPLE_REG_P (parm);
}
-/* FN is a function that has a complete body, and CLONE is a function whose
- body is to be set to a copy of FN, mapping argument declarations according
- to the ARG_MAP splay_tree. */
+
+/* FN is a function in High GIMPLE form that has a complete body and no
+ CFG. CLONE is a function whose body is to be set to a copy of FN,
+ mapping argument declarations according to the ARG_MAP splay_tree. */
static void
clone_body (tree clone, tree fn, void *arg_map)
{
copy_body_data id;
+ gimple_seq new_body;
+
+ /* FN must already be in GIMPLE form. */
+ gcc_assert (gimple_body (fn));
- /* Clone the body, as if we were making an inline call. But, remap the
- parameters in the callee to the parameters of caller. */
+ /* Clone the body, as if we were making an inline call. But, remap
+ the parameters in the callee to the parameters of caller. */
memset (&id, 0, sizeof (id));
id.src_fn = fn;
id.dst_fn = clone;
id.src_cfun = DECL_STRUCT_FUNCTION (fn);
- id.decl_map = (struct pointer_map_t *)arg_map;
+ id.decl_map = (struct pointer_map_t *) arg_map;
id.copy_decl = copy_decl_no_change;
id.transform_call_graph_edges = CB_CGE_DUPLICATE;
id.transform_new_cfg = true;
id.transform_return_to_modify = false;
- id.transform_lang_insert_block = insert_block;
+ id.transform_lang_insert_block = NULL;
/* We're not inside any EH region. */
id.eh_region = -1;
/* Actually copy the body. */
- append_to_statement_list_force (copy_generic_body (&id),
- &DECL_SAVED_TREE (clone));
+ new_body = remap_gimple_seq (gimple_body (fn), &id);
+ gimple_set_body (clone, new_body);
}
/* FN is a function that has a complete body. Clone the body as
@@ -133,7 +138,6 @@ maybe_clone_body (tree fn)
/* Update CLONE's source position information to match FN's. */
DECL_SOURCE_LOCATION (clone) = DECL_SOURCE_LOCATION (fn);
- DECL_INLINE (clone) = DECL_INLINE (fn);
DECL_DECLARED_INLINE_P (clone) = DECL_DECLARED_INLINE_P (fn);
DECL_COMDAT (clone) = DECL_COMDAT (fn);
DECL_WEAK (clone) = DECL_WEAK (fn);
@@ -228,6 +232,7 @@ maybe_clone_body (tree fn)
/* Now, expand this function into RTL, if appropriate. */
finish_function (0);
BLOCK_ABSTRACT_ORIGIN (DECL_INITIAL (clone)) = DECL_INITIAL (fn);
+ DECL_SAVED_TREE (clone) = NULL;
expand_or_defer_fn (clone);
first = false;
}
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 03606084258..08ec96711c1 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -1581,7 +1581,7 @@ static tree cp_parser_nested_name_specifier_opt
(cp_parser *, bool, bool, bool, bool);
static tree cp_parser_nested_name_specifier
(cp_parser *, bool, bool, bool, bool);
-static tree cp_parser_class_or_namespace_name
+static tree cp_parser_qualifying_entity
(cp_parser *, bool, bool, bool, bool, bool);
static tree cp_parser_postfix_expression
(cp_parser *, bool, bool, bool);
@@ -2162,8 +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 ("%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)
{
@@ -2228,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);
}
}
@@ -2357,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)
@@ -3214,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. */
- if (pedantic)
- pedwarn ("%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:
@@ -3931,10 +3932,16 @@ cp_parser_unqualified_id (cp_parser* parser,
/* Parse an (optional) nested-name-specifier.
- nested-name-specifier:
+ nested-name-specifier: [C++98]
class-or-namespace-name :: nested-name-specifier [opt]
class-or-namespace-name :: template nested-name-specifier [opt]
+ nested-name-specifier: [C++0x]
+ type-name ::
+ namespace-name ::
+ nested-name-specifier identifier ::
+ nested-name-specifier template [opt] simple-template-id ::
+
PARSER->SCOPE should be set appropriately before this function is
called. TYPENAME_KEYWORD_P is TRUE if the `typename' keyword is in
effect. TYPE_P is TRUE if we non-type bindings should be ignored
@@ -4009,7 +4016,7 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser,
else
{
/* If the next token is not an identifier, then it is
- definitely not a class-or-namespace-name. */
+ definitely not a type-name or namespace-name. */
if (token->type != CPP_NAME)
break;
/* If the following token is neither a `<' (to begin a
@@ -4049,12 +4056,12 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser,
/*only_current_p=*/false);
/* Parse the qualifying entity. */
new_scope
- = cp_parser_class_or_namespace_name (parser,
- typename_keyword_p,
- template_keyword_p,
- check_dependency_p,
- type_p,
- is_declaration);
+ = cp_parser_qualifying_entity (parser,
+ typename_keyword_p,
+ template_keyword_p,
+ check_dependency_p,
+ type_p,
+ is_declaration);
/* Look for the `::' token. */
cp_parser_require (parser, CPP_SCOPE, "%<::%>");
@@ -4106,10 +4113,14 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser,
decl = error_mark_node;
}
else
- cp_parser_name_lookup_error
- (parser, token->u.value, decl,
- "is not a class or namespace",
- token->location);
+ {
+ const char* msg = "is not a class or namespace";
+ if (cxx_dialect != cxx98)
+ msg = "is not a class, namespace, or enumeration";
+ cp_parser_name_lookup_error
+ (parser, token->u.value, decl, msg,
+ token->location);
+ }
}
parser->scope = error_mark_node;
error_p = true;
@@ -4141,7 +4152,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);
@@ -4228,11 +4239,11 @@ cp_parser_nested_name_specifier (cp_parser *parser,
return scope;
}
-/* Parse a class-or-namespace-name.
-
- class-or-namespace-name:
- class-name
- namespace-name
+/* Parse the qualifying entity in a nested-name-specifier. For C++98,
+ this is either a class-name or a namespace-name (which corresponds
+ to the class-or-namespace-name production in the grammar). For
+ C++0x, it can also be a type-name that refers to an enumeration
+ type.
TYPENAME_KEYWORD_P is TRUE iff the `typename' keyword is in effect.
TEMPLATE_KEYWORD_P is TRUE iff the `template' keyword is in effect.
@@ -4246,18 +4257,19 @@ cp_parser_nested_name_specifier (cp_parser *parser,
ERROR_MARK_NODE is returned. */
static tree
-cp_parser_class_or_namespace_name (cp_parser *parser,
- bool typename_keyword_p,
- bool template_keyword_p,
- bool check_dependency_p,
- bool type_p,
- bool is_declaration)
+cp_parser_qualifying_entity (cp_parser *parser,
+ bool typename_keyword_p,
+ bool template_keyword_p,
+ bool check_dependency_p,
+ bool type_p,
+ bool is_declaration)
{
tree saved_scope;
tree saved_qualifying_scope;
tree saved_object_scope;
tree scope;
bool only_class_p;
+ bool successful_parse_p;
/* Before we try to parse the class-name, we must save away the
current PARSER->SCOPE since cp_parser_class_name will destroy
@@ -4267,7 +4279,8 @@ cp_parser_class_or_namespace_name (cp_parser *parser,
saved_object_scope = parser->object_scope;
/* Try for a class-name first. If the SAVED_SCOPE is a type, then
there is no need to look for a namespace-name. */
- only_class_p = template_keyword_p || (saved_scope && TYPE_P (saved_scope));
+ only_class_p = template_keyword_p
+ || (saved_scope && TYPE_P (saved_scope) && cxx_dialect == cxx98);
if (!only_class_p)
cp_parser_parse_tentatively (parser);
scope = cp_parser_class_name (parser,
@@ -4277,8 +4290,26 @@ cp_parser_class_or_namespace_name (cp_parser *parser,
check_dependency_p,
/*class_head_p=*/false,
is_declaration);
+ successful_parse_p = only_class_p || cp_parser_parse_definitely (parser);
+ /* If that didn't work and we're in C++0x mode, try for a type-name. */
+ if (!only_class_p
+ && cxx_dialect != cxx98
+ && !successful_parse_p)
+ {
+ /* Restore the saved scope. */
+ parser->scope = saved_scope;
+ parser->qualifying_scope = saved_qualifying_scope;
+ parser->object_scope = saved_object_scope;
+
+ /* Parse tentatively. */
+ cp_parser_parse_tentatively (parser);
+
+ /* Parse a typedef-name or enum-name. */
+ scope = cp_parser_nonclass_name (parser);
+ successful_parse_p = cp_parser_parse_definitely (parser);
+ }
/* If that didn't work, try for a namespace-name. */
- if (!only_class_p && !cp_parser_parse_definitely (parser))
+ if (!only_class_p && !successful_parse_p)
{
/* Restore the saved scope. */
parser->scope = saved_scope;
@@ -4545,8 +4576,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++. */
- if (pedantic)
- pedwarn ("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 +5606,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,8 +7640,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. */
- if (pedantic)
- pedwarn ("%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,8 +7779,8 @@ cp_parser_declaration_seq_opt (cp_parser* parser)
/* A declaration consisting of a single semicolon is
invalid. Allow it unless we're being pedantic. */
cp_lexer_consume_token (parser->lexer);
- if (pedantic && !in_system_header)
- pedwarn ("extra %<;%>");
+ if (!in_system_header)
+ pedwarn (input_location, OPT_pedantic, "extra %<;%>");
continue;
}
@@ -8295,11 +8324,11 @@ cp_parser_decl_specifier_seq (cp_parser* parser,
GNU Extension:
thread */
case RID_AUTO:
- /* Consume the token. */
- cp_lexer_consume_token (parser->lexer);
-
if (cxx_dialect == cxx98)
{
+ /* Consume the token. */
+ cp_lexer_consume_token (parser->lexer);
+
/* Complain about `auto' as a storage specifier, if
we're complaining about C++0x compatibility. */
warning
@@ -8311,10 +8340,9 @@ cp_parser_decl_specifier_seq (cp_parser* parser,
cp_parser_set_storage_class (parser, decl_specs, RID_AUTO,
token->location);
}
- else
- /* We do not yet support the use of `auto' as a
- type-specifier. */
- error ("%HC++0x %<auto%> specifier not supported", &token->location);
+ else
+ /* C++0x auto type-specifier. */
+ found_decl_spec = false;
break;
case RID_REGISTER:
@@ -9047,8 +9075,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
@@ -9981,18 +10009,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;
}
}
@@ -10182,7 +10209,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))
@@ -10387,9 +10414,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 {};
@@ -10398,8 +10426,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;
@@ -11036,14 +11068,8 @@ cp_parser_simple_type_specifier (cp_parser* parser,
break;
case RID_AUTO:
- if (cxx_dialect != cxx98)
- {
- /* Consume the token. */
- cp_lexer_consume_token (parser->lexer);
- /* We do not yet support the use of `auto' as a
- type-specifier. */
- error ("%HC++0x %<auto%> specifier not supported", &token->location);
- }
+ maybe_warn_cpp0x ("C++0x auto");
+ type = make_auto ();
break;
case RID_DECLTYPE:
@@ -11304,7 +11330,7 @@ cp_parser_nonclass_name (cp_parser* parser)
elaborated-type-specifier:
class-key :: [opt] nested-name-specifier [opt] identifier
class-key :: [opt] nested-name-specifier [opt] template [opt] template-id
- enum :: [opt] nested-name-specifier [opt] identifier
+ enum-key :: [opt] nested-name-specifier [opt] identifier
typename :: [opt] nested-name-specifier identifier
typename :: [opt] nested-name-specifier template [opt]
template-id
@@ -11342,6 +11368,17 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
cp_lexer_consume_token (parser->lexer);
/* Remember that it's an enumeration type. */
tag_type = enum_type;
+ /* Parse the optional `struct' or `class' key (for C++0x scoped
+ enums). */
+ if (cp_lexer_next_token_is_keyword (parser->lexer, RID_CLASS)
+ || cp_lexer_next_token_is_keyword (parser->lexer, RID_STRUCT))
+ {
+ if (cxx_dialect == cxx98)
+ maybe_warn_cpp0x ("scoped enums");
+
+ /* Consume the `struct' or `class'. */
+ cp_lexer_consume_token (parser->lexer);
+ }
/* Parse the attributes. */
attributes = cp_parser_attributes_opt (parser);
}
@@ -11355,7 +11392,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
@@ -11517,7 +11554,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);
@@ -11629,11 +11666,19 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
/* Parse an enum-specifier.
enum-specifier:
- enum identifier [opt] { enumerator-list [opt] }
+ enum-key identifier [opt] enum-base [opt] { enumerator-list [opt] }
+
+ enum-key:
+ enum
+ enum class [C++0x]
+ enum struct [C++0x]
+
+ enum-base: [C++0x]
+ : type-specifier-seq
GNU Extensions:
- enum attributes[opt] identifier [opt] { enumerator-list [opt] }
- attributes[opt]
+ enum-key attributes[opt] identifier [opt] enum-base [opt]
+ { enumerator-list [opt] }attributes[opt]
Returns an ENUM_TYPE representing the enumeration, or NULL_TREE
if the token stream isn't an enum-specifier after all. */
@@ -11644,6 +11689,8 @@ cp_parser_enum_specifier (cp_parser* parser)
tree identifier;
tree type;
tree attributes;
+ bool scoped_enum_p = false;
+ tree underlying_type = NULL_TREE;
/* Parse tentatively so that we can back up if we don't find a
enum-specifier. */
@@ -11655,6 +11702,20 @@ cp_parser_enum_specifier (cp_parser* parser)
the enumeration being defined. */
cp_lexer_consume_token (parser->lexer);
+ /* Parse the "class" or "struct", which indicates a scoped
+ enumeration type in C++0x. */
+ if (cp_lexer_next_token_is_keyword (parser->lexer, RID_CLASS)
+ || cp_lexer_next_token_is_keyword (parser->lexer, RID_STRUCT))
+ {
+ if (cxx_dialect == cxx98)
+ maybe_warn_cpp0x ("scoped enums");
+
+ /* Consume the `struct' or `class' token. */
+ cp_lexer_consume_token (parser->lexer);
+
+ scoped_enum_p = true;
+ }
+
attributes = cp_parser_attributes_opt (parser);
if (cp_lexer_next_token_is (parser->lexer, CPP_NAME))
@@ -11662,6 +11723,35 @@ cp_parser_enum_specifier (cp_parser* parser)
else
identifier = make_anon_name ();
+ /* Check for the `:' that denotes a specified underlying type in C++0x. */
+ if (cp_lexer_next_token_is (parser->lexer, CPP_COLON))
+ {
+ cp_decl_specifier_seq type_specifiers;
+
+ if (cxx_dialect == cxx98)
+ maybe_warn_cpp0x ("scoped enums");
+
+ /* Consume the `:'. */
+ cp_lexer_consume_token (parser->lexer);
+
+ /* Parse the type-specifier-seq. */
+ cp_parser_type_specifier_seq (parser, /*is_condition=*/false,
+ &type_specifiers);
+ if (type_specifiers.type == error_mark_node)
+ return error_mark_node;
+
+ /* If that didn't work, stop. */
+ if (type_specifiers.type != error_mark_node)
+ {
+ underlying_type = grokdeclarator (NULL, &type_specifiers, TYPENAME,
+ /*initialized=*/0, NULL);
+ if (underlying_type == error_mark_node)
+ underlying_type = NULL_TREE;
+ }
+ else
+ cp_parser_error (parser, "expected underlying type of enumeration");
+ }
+
/* Look for the `{' but don't consume it yet. */
if (!cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
cp_parser_simulate_error (parser);
@@ -11676,7 +11766,7 @@ cp_parser_enum_specifier (cp_parser* parser)
/* Create the new type. We do this before consuming the opening
brace so the enum will be recorded as being on the line of its
tag (or the 'enum' keyword, if there is no tag). */
- type = start_enum (identifier);
+ type = start_enum (identifier, underlying_type, scoped_enum_p);
/* Consume the opening brace. */
cp_lexer_consume_token (parser->lexer);
@@ -11734,8 +11824,8 @@ cp_parser_enumerator_list (cp_parser* parser, tree type)
/* If the next token is a `}', there is a trailing comma. */
if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_BRACE))
{
- if (pedantic && !in_system_header)
- pedwarn ("comma at end of enumerator list");
+ if (!in_system_header)
+ pedwarn (input_location, OPT_pedantic, "comma at end of enumerator list");
break;
}
}
@@ -11815,7 +11905,7 @@ cp_parser_namespace_name (cp_parser* parser)
During the lookup of a name preceding the :: scope resolution
operator, object, function, and enumerator names are ignored.
- (Note that cp_parser_class_or_namespace_name only calls this
+ (Note that cp_parser_qualifying_entity only calls this
function if the token after the name is the scope resolution
operator.) */
namespace_decl = cp_parser_lookup_name (parser, identifier,
@@ -12379,7 +12469,7 @@ cp_parser_init_declarator (cp_parser* parser,
tree initializer;
tree decl = NULL_TREE;
tree scope;
- bool is_initialized;
+ int is_initialized;
/* Only valid if IS_INITIALIZED is true. In that case, CPP_EQ if
initialized with "= ..", CPP_OPEN_PAREN if initialized with
"(...)". */
@@ -12515,8 +12605,18 @@ cp_parser_init_declarator (cp_parser* parser,
|| token->type == CPP_OPEN_PAREN
|| token->type == CPP_OPEN_BRACE)
{
- is_initialized = true;
+ is_initialized = 1;
initialization_kind = token->type;
+
+ if (token->type == CPP_EQ
+ && function_declarator_p (declarator))
+ {
+ cp_token *t2 = cp_lexer_peek_nth_token (parser->lexer, 2);
+ if (t2->keyword == RID_DEFAULT)
+ is_initialized = 2;
+ else if (t2->keyword == RID_DELETE)
+ is_initialized = 3;
+ }
}
else
{
@@ -12528,7 +12628,7 @@ cp_parser_init_declarator (cp_parser* parser,
cp_parser_error (parser, "expected initializer");
return error_mark_node;
}
- is_initialized = false;
+ is_initialized = 0;
initialization_kind = CPP_EOF;
}
@@ -13155,7 +13255,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)),
@@ -14369,8 +14469,8 @@ 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. */
- if (pedantic)
- pedwarn ("ISO C++ does not allow designated initializers");
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C++ does not allow designated initializers");
/* Consume the identifier. */
identifier = cp_lexer_consume_token (parser->lexer)->u.value;
/* Consume the `:'. */
@@ -14968,11 +15068,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;
@@ -15012,7 +15118,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;
@@ -15386,8 +15492,8 @@ cp_parser_member_declaration (cp_parser* parser)
if (!decl_specifiers.any_specifiers_p)
{
cp_token *token = cp_lexer_peek_token (parser->lexer);
- if (pedantic && !in_system_header_at (token->location))
- pedwarn ("%Hextra %<;%>", &token->location);
+ if (!in_system_header_at (token->location))
+ pedwarn (token->location, OPT_pedantic, "extra %<;%>");
}
else
{
@@ -15682,6 +15788,15 @@ cp_parser_pure_specifier (cp_parser* parser)
return error_mark_node;
/* Look for the `0' token. */
token = cp_lexer_consume_token (parser->lexer);
+
+ /* Accept = default or = delete in c++0x mode. */
+ if (token->keyword == RID_DEFAULT
+ || token->keyword == RID_DELETE)
+ {
+ maybe_warn_cpp0x ("defaulted and deleted functions");
+ return token->u.value;
+ }
+
/* c_lex_with_flags marks a single digit '0' with PURE_ZERO. */
if (token->type != CPP_NUMBER || !(token->flags & PURE_ZERO))
{
@@ -18441,7 +18556,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);
@@ -20829,6 +20944,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
@@ -20837,8 +20960,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;
@@ -20850,9 +20975,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;
@@ -20861,8 +20987,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;
@@ -20885,7 +21024,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)
@@ -20901,14 +21041,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 c609bd0cc3a..5bb18d99e88 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));
}
@@ -1289,12 +1289,8 @@ register_specialization (tree spec, tree tmpl, tree args, bool is_friend)
to the primary function; now copy the inline bits to
the various clones. */
FOR_EACH_CLONE (clone, fn)
- {
- DECL_DECLARED_INLINE_P (clone)
- = DECL_DECLARED_INLINE_P (fn);
- DECL_INLINE (clone)
- = DECL_INLINE (fn);
- }
+ DECL_DECLARED_INLINE_P (clone)
+ = DECL_DECLARED_INLINE_P (fn);
check_specialization_namespace (fn);
return fn;
@@ -2006,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;
}
}
@@ -2745,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);
}
@@ -2813,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;
@@ -2826,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)
@@ -2836,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,
@@ -4020,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;
@@ -4141,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;
}
@@ -4187,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;
}
@@ -4570,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;
}
@@ -4608,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;
}
}
@@ -4942,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),
@@ -5836,14 +5836,20 @@ lookup_template_class (tree d1,
if (!is_partial_instantiation)
{
set_current_access_from_decl (TYPE_NAME (template_type));
- t = start_enum (TYPE_IDENTIFIER (template_type));
+ t = start_enum (TYPE_IDENTIFIER (template_type),
+ tsubst (ENUM_UNDERLYING_TYPE (template_type),
+ arglist, complain, in_decl),
+ SCOPED_ENUM_P (template_type));
}
else
- /* We don't want to call start_enum for this type, since
- the values for the enumeration constants may involve
- template parameters. And, no one should be interested
- in the enumeration constants for such a type. */
- t = make_node (ENUMERAL_TYPE);
+ {
+ /* We don't want to call start_enum for this type, since
+ the values for the enumeration constants may involve
+ template parameters. And, no one should be interested
+ in the enumeration constants for such a type. */
+ t = make_node (ENUMERAL_TYPE);
+ SET_SCOPED_ENUM_P (t, SCOPED_ENUM_P (template_type));
+ }
}
else
{
@@ -8147,7 +8153,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))
@@ -9720,7 +9728,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;
}
@@ -14589,7 +14597,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)
@@ -14602,7 +14610,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;
}
@@ -14610,8 +14618,9 @@ do_decl_instantiation (tree decl, tree storage)
;
else if (storage == ridpointers[(int) RID_EXTERN])
{
- if (pedantic && !in_system_header && (cxx_dialect == cxx98))
- pedwarn ("ISO C++ 1998 forbids the use of %<extern%> on explicit "
+ if (!in_system_header && (cxx_dialect == cxx98))
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C++ 1998 forbids the use of %<extern%> on explicit "
"instantiations");
extern_p = 1;
}
@@ -14697,17 +14706,19 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain)
if (storage != NULL_TREE)
{
- if (pedantic && !in_system_header)
+ if (!in_system_header)
{
if (storage == ridpointers[(int) RID_EXTERN])
{
if (cxx_dialect == cxx98)
- pedwarn("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("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])
@@ -14752,7 +14763,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))
@@ -14919,8 +14930,6 @@ regenerate_decl_from_template (tree decl, tree tmpl)
if (DECL_DECLARED_INLINE_P (code_pattern)
&& !DECL_DECLARED_INLINE_P (decl))
DECL_DECLARED_INLINE_P (decl) = 1;
- if (DECL_INLINE (code_pattern) && !DECL_INLINE (decl))
- DECL_INLINE (decl) = 1;
}
else if (TREE_CODE (decl) == VAR_DECL)
DECL_INITIAL (decl) =
@@ -15142,7 +15151,8 @@ instantiate_decl (tree d, int defer_ok,
if (external_p
/* ... but we instantiate inline functions so that we can inline
them and ... */
- && ! (TREE_CODE (d) == FUNCTION_DECL && DECL_INLINE (d))
+ && ! (TREE_CODE (d) == FUNCTION_DECL
+ && possibly_inlined_p (d))
/* ... we instantiate static data members whose values are
needed in integral constant expressions. */
&& ! (TREE_CODE (d) == VAR_DECL
@@ -15197,8 +15207,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". */
@@ -15219,9 +15229,7 @@ instantiate_decl (tree d, int defer_ok,
/* Instantiate inline functions so that the inliner can do its
job, even though we'll not be emitting a copy of this
function. */
- if (!(TREE_CODE (d) == FUNCTION_DECL
- && flag_inline_trees
- && DECL_DECLARED_INLINE_P (d)))
+ if (!(TREE_CODE (d) == FUNCTION_DECL && possibly_inlined_p (d)))
goto out;
}
@@ -15884,7 +15892,7 @@ dependent_type_p (tree type)
/* If we are not processing a template, then nobody should be
providing us with a dependent type. */
gcc_assert (type);
- gcc_assert (TREE_CODE (type) != TEMPLATE_TYPE_PARM);
+ gcc_assert (TREE_CODE (type) != TEMPLATE_TYPE_PARM || is_auto (type));
return false;
}
@@ -16179,6 +16187,19 @@ type_dependent_expression_p (tree expression)
if (TREE_CODE (expression) == STMT_EXPR)
expression = stmt_expr_value_expr (expression);
+ if (BRACE_ENCLOSED_INITIALIZER_P (expression))
+ {
+ tree elt;
+ unsigned i;
+
+ FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (expression), i, elt)
+ {
+ if (type_dependent_expression_p (elt))
+ return true;
+ }
+ return false;
+ }
+
if (TREE_TYPE (expression) == unknown_type_node)
{
if (TREE_CODE (expression) == ADDR_EXPR)
@@ -16665,4 +16686,124 @@ build_non_dependent_args (tree args)
return nreverse (new_args);
}
+/* Returns a type which represents 'auto'. We use a TEMPLATE_TYPE_PARM
+ with a level one deeper than the actual template parms. */
+
+tree
+make_auto (void)
+{
+ tree au;
+
+ /* ??? Is it worth caching this for multiple autos at the same level? */
+ au = cxx_make_type (TEMPLATE_TYPE_PARM);
+ TYPE_NAME (au) = build_decl (TYPE_DECL, get_identifier ("auto"), au);
+ TYPE_STUB_DECL (au) = TYPE_NAME (au);
+ TEMPLATE_TYPE_PARM_INDEX (au) = build_template_parm_index
+ (0, processing_template_decl + 1, processing_template_decl + 1,
+ TYPE_NAME (au), NULL_TREE);
+ TYPE_CANONICAL (au) = canonical_type_parameter (au);
+ DECL_ARTIFICIAL (TYPE_NAME (au)) = 1;
+ SET_DECL_TEMPLATE_PARM_P (TYPE_NAME (au));
+
+ return au;
+}
+
+/* Replace auto in TYPE with std::initializer_list<auto>. */
+
+static tree
+listify_autos (tree type, tree auto_node)
+{
+ tree std_init_list = namespace_binding
+ (get_identifier ("initializer_list"), std_node);
+ tree argvec;
+ tree init_auto;
+ if (!std_init_list || !DECL_CLASS_TEMPLATE_P (std_init_list))
+ {
+ error ("deducing auto from brace-enclosed initializer list requires "
+ "#include <initializer_list>");
+ return error_mark_node;
+ }
+ argvec = make_tree_vec (1);
+ TREE_VEC_ELT (argvec, 0) = auto_node;
+ init_auto = lookup_template_class (std_init_list, argvec, NULL_TREE,
+ NULL_TREE, 0, tf_warning_or_error);
+
+ TREE_VEC_ELT (argvec, 0) = init_auto;
+ if (processing_template_decl)
+ argvec = add_to_template_args (current_template_args (), argvec);
+ return tsubst (type, argvec, tf_warning_or_error, NULL_TREE);
+}
+
+/* Replace occurrences of 'auto' in TYPE with the appropriate type deduced
+ from INIT. AUTO_NODE is the TEMPLATE_TYPE_PARM used for 'auto' in TYPE. */
+
+tree
+do_auto_deduction (tree type, tree init, tree auto_node)
+{
+ tree parms, args, tparms, targs;
+ int val;
+
+ /* [dcl.spec.auto]: Obtain P from T by replacing the occurrences of auto
+ with either a new invented type template parameter U or, if the
+ initializer is a braced-init-list (8.5.4), with
+ std::initializer_list<U>. */
+ if (BRACE_ENCLOSED_INITIALIZER_P (init))
+ type = listify_autos (type, auto_node);
+
+ parms = build_tree_list (NULL_TREE, type);
+ args = build_tree_list (NULL_TREE, init);
+ tparms = make_tree_vec (1);
+ targs = make_tree_vec (1);
+ TREE_VEC_ELT (tparms, 0)
+ = build_tree_list (NULL_TREE, TYPE_NAME (auto_node));
+ val = type_unification_real (tparms, targs, parms, args, 0,
+ DEDUCE_CALL, LOOKUP_NORMAL);
+ if (val > 0)
+ {
+ error ("unable to deduce %qT from %qE", type, init);
+ return error_mark_node;
+ }
+
+ if (processing_template_decl)
+ targs = add_to_template_args (current_template_args (), targs);
+ return tsubst (type, targs, tf_warning_or_error, NULL_TREE);
+}
+
+/* Returns true iff TYPE is a TEMPLATE_TYPE_PARM representing 'auto'. */
+
+bool
+is_auto (const_tree type)
+{
+ if (TREE_CODE (type) == TEMPLATE_TYPE_PARM
+ && TYPE_IDENTIFIER (type) == get_identifier ("auto"))
+ return true;
+ else
+ return false;
+}
+
+/* Returns true iff TYPE contains a use of 'auto'. Since auto can only
+ appear as a type-specifier for the declaration in question, we don't
+ have to look through the whole type. */
+
+tree
+type_uses_auto (tree type)
+{
+ enum tree_code code;
+ if (is_auto (type))
+ return type;
+
+ code = TREE_CODE (type);
+
+ if (code == POINTER_TYPE || code == REFERENCE_TYPE
+ || code == OFFSET_TYPE || code == FUNCTION_TYPE
+ || code == METHOD_TYPE || code == ARRAY_TYPE)
+ return type_uses_auto (TREE_TYPE (type));
+
+ if (TYPE_PTRMEMFUNC_P (type))
+ return type_uses_auto (TREE_TYPE (TREE_TYPE
+ (TYPE_PTRMEMFUNC_FN_TYPE (type))));
+
+ return NULL_TREE;
+}
+
#include "gt-cp-pt.h"
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/search.c b/gcc/cp/search.c
index cee29240e9e..7fc040bc8c4 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -1912,6 +1912,20 @@ check_final_overrider (tree overrider, tree basefn)
return 0;
}
+ if (DECL_DELETED_FN (basefn) != DECL_DELETED_FN (overrider))
+ {
+ if (DECL_DELETED_FN (overrider))
+ {
+ error ("deleted function %q+D", overrider);
+ error ("overriding non-deleted function %q+D", basefn);
+ }
+ else
+ {
+ error ("non-deleted function %q+D", overrider);
+ error ("overriding deleted function %q+D", basefn);
+ }
+ return 0;
+ }
return 1;
}
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index ffa6493ced4..e044a4392c3 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -46,6 +46,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-iterator.h"
#include "vec.h"
#include "target.h"
+#include "gimple.h"
/* There routines provide a modular interface to perform many parsing
operations. They may therefore be used during actual parsing, or
@@ -571,7 +572,8 @@ finish_goto_stmt (tree destination)
}
/* COND is the condition-expression for an if, while, etc.,
- statement. Convert it to a boolean value, if appropriate. */
+ statement. Convert it to a boolean value, if appropriate.
+ In addition, verify sequence points if -Wsequence-point is enabled. */
static tree
maybe_convert_cond (tree cond)
@@ -584,6 +586,9 @@ maybe_convert_cond (tree cond)
if (processing_template_decl)
return cond;
+ if (warn_sequence_point)
+ verify_sequence_points (cond);
+
/* Do the conversion. */
cond = convert_from_reference (cond);
@@ -789,6 +794,9 @@ finish_return_stmt (tree expr)
return error_mark_node;
if (!processing_template_decl)
{
+ if (warn_sequence_point)
+ verify_sequence_points (expr);
+
if (DECL_DESTRUCTOR_P (current_function_decl)
|| (DECL_CONSTRUCTOR_P (current_function_decl)
&& targetm.cxx.cdtor_returns_this ()))
@@ -977,6 +985,9 @@ finish_switch_cond (tree cond, tree switch_stmt)
}
if (check_for_bare_parameter_packs (cond))
cond = error_mark_node;
+ else if (!processing_template_decl && warn_sequence_point)
+ verify_sequence_points (cond);
+
finish_cond (&SWITCH_STMT_COND (switch_stmt), cond);
SWITCH_STMT_TYPE (switch_stmt) = orig_type;
add_stmt (switch_stmt);
@@ -2190,7 +2201,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;
}
@@ -3201,6 +3212,8 @@ expand_or_defer_fn (tree fn)
return;
}
+ gcc_assert (gimple_body (fn));
+
/* Replace AGGR_INIT_EXPRs with appropriate CALL_EXPRs. */
cp_walk_tree_without_duplicates (&DECL_SAVED_TREE (fn),
simplify_aggr_init_exprs_r,
@@ -4472,7 +4485,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;
@@ -4583,8 +4596,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
@@ -4594,14 +4605,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 0522ae2786f..f9df932221f 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -339,15 +339,17 @@ build_aggr_init_array (tree return_type, tree fn, tree slot, int nargs,
}
/* INIT is a CALL_EXPR or AGGR_INIT_EXPR which needs info about its
- target. TYPE is the type that this initialization should appear to
- have.
+ target. TYPE is the type to be initialized.
- Build an encapsulation of the initialization to perform
- and return it so that it can be processed by language-independent
- and language-specific expression expanders. */
+ Build an AGGR_INIT_EXPR to represent the initialization. This function
+ differs from build_cplus_new in that an AGGR_INIT_EXPR can only be used
+ to initialize another object, whereas a TARGET_EXPR can either
+ initialize another object or create its own temporary object, and as a
+ result building up a TARGET_EXPR requires that the type's destructor be
+ callable. */
tree
-build_cplus_new (tree type, tree init)
+build_aggr_init_expr (tree type, tree init)
{
tree fn;
tree slot;
@@ -369,8 +371,6 @@ build_cplus_new (tree type, tree init)
&& TREE_CODE (TREE_OPERAND (fn, 0)) == FUNCTION_DECL
&& DECL_CONSTRUCTOR_P (TREE_OPERAND (fn, 0)));
- slot = build_local_temp (type);
-
/* We split the CALL_EXPR into its function and its arguments here.
Then, in expand_expr, we put them back together. The reason for
this is that this expression might be a default argument
@@ -384,6 +384,8 @@ build_cplus_new (tree type, tree init)
type, don't mess with AGGR_INIT_EXPR. */
if (is_ctor || TREE_ADDRESSABLE (type))
{
+ slot = build_local_temp (type);
+
if (TREE_CODE(init) == CALL_EXPR)
rval = build_aggr_init_array (void_type_node, fn, slot,
call_expr_nargs (init),
@@ -398,6 +400,30 @@ build_cplus_new (tree type, tree init)
else
rval = init;
+ return rval;
+}
+
+/* INIT is a CALL_EXPR or AGGR_INIT_EXPR which needs info about its
+ target. TYPE is the type that this initialization should appear to
+ have.
+
+ Build an encapsulation of the initialization to perform
+ and return it so that it can be processed by language-independent
+ and language-specific expression expanders. */
+
+tree
+build_cplus_new (tree type, tree init)
+{
+ tree rval = build_aggr_init_expr (type, init);
+ tree slot;
+
+ if (TREE_CODE (rval) == AGGR_INIT_EXPR)
+ slot = AGGR_INIT_EXPR_SLOT (rval);
+ else if (TREE_CODE (rval) == CALL_EXPR)
+ slot = build_local_temp (type);
+ else
+ return rval;
+
rval = build_target_expr (slot, rval);
TARGET_EXPR_IMPLICIT_P (rval) = 1;
@@ -504,9 +530,9 @@ cplus_array_hash (const void* k)
hashval_t hash;
const_tree const t = (const_tree) k;
- hash = (htab_hash_pointer (TREE_TYPE (t))
- ^ htab_hash_pointer (TYPE_DOMAIN (t)));
-
+ hash = TYPE_UID (TREE_TYPE (t));
+ if (TYPE_DOMAIN (t))
+ hash ^= TYPE_UID (TYPE_DOMAIN (t));
return hash;
}
@@ -553,8 +579,9 @@ build_cplus_array_type_1 (tree elt_type, tree index_type)
cplus_array_htab = htab_create_ggc (61, &cplus_array_hash,
&cplus_array_compare, NULL);
- hash = (htab_hash_pointer (elt_type)
- ^ htab_hash_pointer (index_type));
+ hash = TYPE_UID (elt_type);
+ if (index_type)
+ hash ^= TYPE_UID (index_type);
cai.type = elt_type;
cai.domain = index_type;
@@ -846,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;
@@ -1711,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);
@@ -2060,7 +2088,7 @@ is_dummy_object (const_tree ob)
int
pod_type_p (const_tree t)
{
- /* This CONST_CAST is okay because strip_array_types returns it's
+ /* This CONST_CAST is okay because strip_array_types returns its
argument unmodified and we assign it to a const_tree. */
t = strip_array_types (CONST_CAST_TREE(t));
@@ -2099,7 +2127,7 @@ class_tmpl_impl_spec_p (const_tree t)
int
zero_init_p (const_tree t)
{
- /* This CONST_CAST is okay because strip_array_types returns it's
+ /* This CONST_CAST is okay because strip_array_types returns its
argument unmodified and we assign it to a const_tree. */
t = strip_array_types (CONST_CAST_TREE(t));
@@ -2686,7 +2714,8 @@ stabilize_init (tree init, tree *initp)
return true;
if (TREE_CODE (t) == INIT_EXPR
- && TREE_CODE (TREE_OPERAND (t, 1)) != TARGET_EXPR)
+ && TREE_CODE (TREE_OPERAND (t, 1)) != TARGET_EXPR
+ && TREE_CODE (TREE_OPERAND (t, 1)) != AGGR_INIT_EXPR)
{
TREE_OPERAND (t, 1) = stabilize_expr (TREE_OPERAND (t, 1), initp);
return true;
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 3468bd41a12..336ddccc654 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
@@ -262,10 +262,10 @@ type_after_usual_arithmetic_conversions (tree t1, tree t2)
/* FIXME: Attributes. */
gcc_assert (ARITHMETIC_TYPE_P (t1)
|| TREE_CODE (t1) == VECTOR_TYPE
- || TREE_CODE (t1) == ENUMERAL_TYPE);
+ || UNSCOPED_ENUM_P (t1));
gcc_assert (ARITHMETIC_TYPE_P (t2)
|| TREE_CODE (t2) == VECTOR_TYPE
- || TREE_CODE (t2) == ENUMERAL_TYPE);
+ || UNSCOPED_ENUM_P (t2));
/* In what follows, we slightly generalize the rules given in [expr] so
as to deal with `long long' and `complex'. First, merge the
@@ -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),
@@ -511,9 +511,10 @@ composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2,
tree attributes;
tree result_type;
- if (pedantic && TYPE_PTRFN_P (t2) && (complain & tf_error))
- pedwarn ("ISO C++ forbids %s between pointer of type %<void *%> "
- "and pointer-to-function", location);
+ if (TYPE_PTRFN_P (t2) && (complain & tf_error))
+ pedwarn (input_location, OPT_pedantic, "ISO C++ forbids %s "
+ "between pointer of type %<void *%> and pointer-to-function",
+ location);
result_type
= cp_build_qualified_type (void_type_node,
(cp_type_quals (TREE_TYPE (t1))
@@ -763,9 +764,9 @@ common_type (tree t1, tree t2)
code1 = TREE_CODE (t1);
code2 = TREE_CODE (t2);
- if ((ARITHMETIC_TYPE_P (t1) || code1 == ENUMERAL_TYPE
+ if ((ARITHMETIC_TYPE_P (t1) || UNSCOPED_ENUM_P (t1)
|| code1 == VECTOR_TYPE)
- && (ARITHMETIC_TYPE_P (t2) || code2 == ENUMERAL_TYPE
+ && (ARITHMETIC_TYPE_P (t2) || UNSCOPED_ENUM_P (t2)
|| code2 == VECTOR_TYPE))
return type_after_usual_arithmetic_conversions (t1, t2);
@@ -1278,8 +1279,9 @@ cxx_sizeof_or_alignof_type (tree type, enum tree_code op, bool complain)
type = non_reference (type);
if (TREE_CODE (type) == METHOD_TYPE)
{
- if (complain && (pedantic || warn_pointer_arith))
- pedwarn ("invalid application of %qs to a member function",
+ if (complain)
+ 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;
}
@@ -1355,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;
@@ -1415,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;
@@ -1664,7 +1666,7 @@ default_conversion (tree exp)
/* Perform the integral promotions first so that bitfield
expressions (which may promote to "int", even if the bitfield is
declared "unsigned") are promoted correctly. */
- if (INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (exp)))
+ if (INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (exp)))
exp = perform_integral_promotions (exp);
/* Perform the other conversions. */
exp = decay_conversion (exp);
@@ -1696,18 +1698,6 @@ perform_integral_promotions (tree expr)
return expr;
}
-/* Take the address of an inline function without setting TREE_ADDRESSABLE
- or TREE_USED. */
-
-tree
-inline_conversion (tree exp)
-{
- if (TREE_CODE (exp) == FUNCTION_DECL)
- exp = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (exp)), exp);
-
- return exp;
-}
-
/* Returns nonzero iff exp is a STRING_CST or the result of applying
decay_conversion to one. */
@@ -2146,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;
@@ -2166,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);
}
}
}
@@ -2558,7 +2548,7 @@ build_array_ref (tree array, tree idx)
warn_array_subscript_with_type_char (idx);
- if (!INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (idx)))
+ if (!INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (idx)))
{
error ("array subscript is not an integer");
return error_mark_node;
@@ -2596,8 +2586,8 @@ build_array_ref (tree array, tree idx)
return error_mark_node;
}
- if (pedantic && !lvalue_p (array))
- pedwarn ("ISO C++ forbids subscripting non-lvalue array");
+ if (!lvalue_p (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
@@ -2822,17 +2812,11 @@ cp_build_function_call (tree function, tree params, tsubst_flags_t complain)
fndecl = function;
/* Convert anything with function type to a pointer-to-function. */
- if (pedantic && DECL_MAIN_P (function) && (complain & tf_error))
- pedwarn ("ISO C++ forbids calling %<::main%> from within program");
+ if (DECL_MAIN_P (function) && (complain & tf_error))
+ pedwarn (input_location, OPT_pedantic,
+ "ISO C++ forbids calling %<::main%> from within program");
- /* Differs from default_conversion by not setting TREE_ADDRESSABLE
- (because calling an inline function does not mean the function
- needs to be separately compiled). */
-
- if (DECL_INLINE (function))
- function = inline_conversion (function);
- else
- function = build_addr_func (function);
+ function = build_addr_func (function);
}
else
{
@@ -3251,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;
}
@@ -3262,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;
}
@@ -3537,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;
}
@@ -3545,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;
}
@@ -3725,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;
}
@@ -3733,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;
}
@@ -3826,61 +3810,9 @@ cp_build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
if (shorten && none_complex)
{
- int unsigned0, unsigned1;
- tree arg0 = get_narrower (op0, &unsigned0);
- tree arg1 = get_narrower (op1, &unsigned1);
- /* UNS is 1 if the operation to be done is an unsigned one. */
- int uns = TYPE_UNSIGNED (result_type);
- tree type;
-
final_type = result_type;
-
- /* Handle the case that OP0 does not *contain* a conversion
- but it *requires* conversion to FINAL_TYPE. */
-
- if (op0 == arg0 && TREE_TYPE (op0) != final_type)
- unsigned0 = TYPE_UNSIGNED (TREE_TYPE (op0));
- if (op1 == arg1 && TREE_TYPE (op1) != final_type)
- unsigned1 = TYPE_UNSIGNED (TREE_TYPE (op1));
-
- /* Now UNSIGNED0 is 1 if ARG0 zero-extends to FINAL_TYPE. */
-
- /* For bitwise operations, signedness of nominal type
- does not matter. Consider only how operands were extended. */
- if (shorten == -1)
- uns = unsigned0;
-
- /* Note that in all three cases below we refrain from optimizing
- an unsigned operation on sign-extended args.
- That would not be valid. */
-
- /* Both args variable: if both extended in same way
- from same width, do it in that width.
- Do it unsigned if args were zero-extended. */
- if ((TYPE_PRECISION (TREE_TYPE (arg0))
- < TYPE_PRECISION (result_type))
- && (TYPE_PRECISION (TREE_TYPE (arg1))
- == TYPE_PRECISION (TREE_TYPE (arg0)))
- && unsigned0 == unsigned1
- && (unsigned0 || !uns))
- result_type = c_common_signed_or_unsigned_type
- (unsigned0, common_type (TREE_TYPE (arg0), TREE_TYPE (arg1)));
- else if (TREE_CODE (arg0) == INTEGER_CST
- && (unsigned1 || !uns)
- && (TYPE_PRECISION (TREE_TYPE (arg1))
- < TYPE_PRECISION (result_type))
- && (type = c_common_signed_or_unsigned_type
- (unsigned1, TREE_TYPE (arg1)),
- int_fits_type_p (arg0, type)))
- result_type = type;
- else if (TREE_CODE (arg1) == INTEGER_CST
- && (unsigned0 || !uns)
- && (TYPE_PRECISION (TREE_TYPE (arg0))
- < TYPE_PRECISION (result_type))
- && (type = c_common_signed_or_unsigned_type
- (unsigned0, TREE_TYPE (arg0)),
- int_fits_type_p (arg1, type)))
- result_type = type;
+ result_type = shorten_binary_op (result_type, op0, op1,
+ shorten == -1);
}
/* Comparison operations are shortened too but differently.
@@ -3907,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);
}
}
@@ -4101,15 +3929,12 @@ pointer_diff (tree op0, tree op1, tree ptrtype)
if (!complete_type_or_else (target_type, NULL_TREE))
return error_mark_node;
- if (pedantic || warn_pointer_arith)
- {
- if (TREE_CODE (target_type) == VOID_TYPE)
- permerror ("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");
- if (TREE_CODE (target_type) == METHOD_TYPE)
- permerror ("ISO C++ forbids using pointer to a method in subtraction");
- }
+ if (TREE_CODE (target_type) == VOID_TYPE)
+ permerror (input_location, "ISO C++ forbids using pointer of type %<void *%> in subtraction");
+ if (TREE_CODE (target_type) == FUNCTION_TYPE)
+ permerror (input_location, "ISO C++ forbids using pointer to a function in subtraction");
+ if (TREE_CODE (target_type) == METHOD_TYPE)
+ 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. */
@@ -4184,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
@@ -4474,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
@@ -4502,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"),
@@ -4559,11 +4384,11 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
arg = build1 (CONVERT_EXPR, type, arg);
return arg;
}
- else if (pedantic && DECL_MAIN_P (arg))
+ else if (DECL_MAIN_P (arg))
{
/* 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;
}
@@ -4624,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);
@@ -4655,10 +4480,10 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert,
/* Even if we're not being pedantic, we cannot allow this
extension when we're instantiating in a SFINAE
context. */
- if (! lvalue_p (arg) && (pedantic || complain == tf_none))
+ 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;
}
@@ -4713,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)
@@ -5003,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),
@@ -5443,7 +5260,8 @@ convert_member_func_to_ptr (tree type, tree expr)
|| TREE_CODE (intype) == METHOD_TYPE);
if (pedantic || warn_pmf2ptr)
- pedwarn ("converting from %qT to %qT", intype, type);
+ pedwarn (input_location, pedantic ? OPT_pedantic : OPT_Wpmf_conversions,
+ "converting from %qT to %qT", intype, type);
if (TREE_CODE (intype) == METHOD_TYPE)
expr = build_addr_func (expr);
@@ -5554,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;
@@ -5831,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));
@@ -6184,7 +6002,7 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs,
from_array = TREE_CODE (TREE_TYPE (newrhs)) == ARRAY_TYPE
? 1 + (modifycode != INIT_EXPR): 0;
return build_vec_init (lhs, NULL_TREE, newrhs,
- /*explicit_default_init_p=*/false,
+ /*explicit_value_init_p=*/false,
from_array, complain);
}
@@ -6957,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
@@ -6978,9 +6796,8 @@ 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;
/* There's really no value to return, after all. */
@@ -7286,7 +7103,7 @@ comp_ptr_ttypes_const (tree to, tree from)
int
cp_type_quals (const_tree type)
{
- /* This CONST_CAST is okay because strip_array_types returns it's
+ /* This CONST_CAST is okay because strip_array_types returns its
argument unmodified and we assign it to a const_tree. */
type = strip_array_types (CONST_CAST_TREE(type));
if (type == error_mark_node)
@@ -7300,7 +7117,7 @@ cp_type_quals (const_tree type)
bool
cp_type_readonly (const_tree type)
{
- /* This CONST_CAST is okay because strip_array_types returns it's
+ /* This CONST_CAST is okay because strip_array_types returns its
argument unmodified and we assign it to a const_tree. */
type = strip_array_types (CONST_CAST_TREE(type));
return TYPE_READONLY (type);
@@ -7311,7 +7128,7 @@ cp_type_readonly (const_tree type)
bool
cp_has_mutable_p (const_tree type)
{
- /* This CONST_CAST is okay because strip_array_types returns it's
+ /* This CONST_CAST is okay because strip_array_types returns its
argument unmodified and we assign it to a const_tree. */
type = strip_array_types (CONST_CAST_TREE(type));
@@ -7347,7 +7164,8 @@ cp_apply_type_quals_to_decl (int type_quals, tree decl)
if (pedantic)
{
tree bad_type = build_qualified_type (type, type_quals);
- pedwarn ("ignoring %qV qualifiers added to function type %qT",
+ 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 a30ff547f18..24d003f9afa 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 = pedwarn;
- 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,49 @@ 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);
+ if (is_auto (type))
+ emit_diagnostic (diag_kind, input_location, 0,
+ "invalid use of %<auto%>");
+ else
+ 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 +443,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 +653,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 +681,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 +781,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 +1496,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 +1525,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 +1539,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/dbxout.c b/gcc/dbxout.c
index 95058753075..68cf28e4eca 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -369,7 +369,7 @@ const struct gcc_debug_hooks dbx_debug_hooks =
dbxout_function_decl,
dbxout_global_decl, /* global_decl */
dbxout_type_decl, /* type_decl */
- debug_nothing_tree_tree, /* imported_module_or_decl */
+ debug_nothing_tree_tree_tree_bool, /* imported_module_or_decl */
debug_nothing_tree, /* deferred_inline_function */
debug_nothing_tree, /* outlining_inline_function */
debug_nothing_rtx, /* label */
@@ -401,7 +401,7 @@ const struct gcc_debug_hooks xcoff_debug_hooks =
debug_nothing_tree, /* function_decl */
dbxout_global_decl, /* global_decl */
dbxout_type_decl, /* type_decl */
- debug_nothing_tree_tree, /* imported_module_or_decl */
+ debug_nothing_tree_tree_tree_bool, /* imported_module_or_decl */
debug_nothing_tree, /* deferred_inline_function */
debug_nothing_tree, /* outlining_inline_function */
debug_nothing_rtx, /* label */
@@ -2174,16 +2174,21 @@ dbxout_type (tree type, int full)
stabstr_C ('e');
for (tem = TYPE_VALUES (type); tem; tem = TREE_CHAIN (tem))
{
+ tree value = TREE_VALUE (tem);
+
stabstr_I (TREE_PURPOSE (tem));
stabstr_C (':');
- if (TREE_INT_CST_HIGH (TREE_VALUE (tem)) == 0)
- stabstr_D (TREE_INT_CST_LOW (TREE_VALUE (tem)));
- else if (TREE_INT_CST_HIGH (TREE_VALUE (tem)) == -1
- && (HOST_WIDE_INT) TREE_INT_CST_LOW (TREE_VALUE (tem)) < 0)
- stabstr_D (TREE_INT_CST_LOW (TREE_VALUE (tem)));
+ if (TREE_CODE (value) == CONST_DECL)
+ value = DECL_INITIAL (value);
+
+ if (TREE_INT_CST_HIGH (value) == 0)
+ stabstr_D (TREE_INT_CST_LOW (value));
+ else if (TREE_INT_CST_HIGH (value) == -1
+ && (HOST_WIDE_INT) TREE_INT_CST_LOW (value) < 0)
+ stabstr_D (TREE_INT_CST_LOW (value));
else
- stabstr_O (TREE_VALUE (tem));
+ stabstr_O (value);
stabstr_C (',');
if (TREE_CHAIN (tem) != 0)
diff --git a/gcc/debug.c b/gcc/debug.c
index 12a726f9509..84fc2df9566 100644
--- a/gcc/debug.c
+++ b/gcc/debug.c
@@ -42,7 +42,7 @@ const struct gcc_debug_hooks do_nothing_debug_hooks =
debug_nothing_tree, /* function_decl */
debug_nothing_tree, /* global_decl */
debug_nothing_tree_int, /* type_decl */
- debug_nothing_tree_tree, /* imported_module_or_decl */
+ debug_nothing_tree_tree_tree_bool, /* imported_module_or_decl */
debug_nothing_tree, /* deferred_inline_function */
debug_nothing_tree, /* outlining_inline_function */
debug_nothing_rtx, /* label */
@@ -66,8 +66,10 @@ debug_nothing_tree (tree decl ATTRIBUTE_UNUSED)
}
void
-debug_nothing_tree_tree (tree t1 ATTRIBUTE_UNUSED,
- tree t2 ATTRIBUTE_UNUSED)
+debug_nothing_tree_tree_tree_bool (tree t1 ATTRIBUTE_UNUSED,
+ tree t2 ATTRIBUTE_UNUSED,
+ tree t3 ATTRIBUTE_UNUSED,
+ bool b1 ATTRIBUTE_UNUSED)
{
}
diff --git a/gcc/debug.h b/gcc/debug.h
index cab1e2603e2..956ad0c3fab 100644
--- a/gcc/debug.h
+++ b/gcc/debug.h
@@ -98,7 +98,8 @@ struct gcc_debug_hooks
void (* type_decl) (tree decl, int local);
/* Debug information for imported modules and declarations. */
- void (* imported_module_or_decl) (tree decl, tree context);
+ void (* imported_module_or_decl) (tree decl, tree name,
+ tree context, bool child);
/* DECL is an inline function, whose body is present, but which is
not being output at this point. */
@@ -139,7 +140,7 @@ extern void debug_nothing_int (unsigned int);
extern void debug_nothing_int_int (unsigned int, unsigned int);
extern void debug_nothing_tree (tree);
extern void debug_nothing_tree_int (tree, int);
-extern void debug_nothing_tree_tree (tree, tree);
+extern void debug_nothing_tree_tree_tree_bool (tree, tree, tree, bool);
extern bool debug_true_const_tree (const_tree);
extern void debug_nothing_rtx (rtx);
@@ -160,6 +161,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 80294305850..282a14ac00a 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -563,6 +563,12 @@ along with GCC; see the file COPYING3. If not see
#define PREFERRED_STACK_BOUNDARY STACK_BOUNDARY
#endif
+/* Set INCOMING_STACK_BOUNDARY to PREFERRED_STACK_BOUNDARY if it is not
+ defined. */
+#ifndef INCOMING_STACK_BOUNDARY
+#define INCOMING_STACK_BOUNDARY PREFERRED_STACK_BOUNDARY
+#endif
+
#ifndef TARGET_DEFAULT_PACK_STRUCT
#define TARGET_DEFAULT_PACK_STRUCT 0
#endif
@@ -657,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
@@ -675,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
@@ -950,6 +920,21 @@ along with GCC; see the file COPYING3. If not see
#define OUTGOING_REG_PARM_STACK_SPACE(FNTYPE) 0
#endif
+/* MAX_STACK_ALIGNMENT is the maximum stack alignment guaranteed by
+ the backend. MAX_SUPPORTED_STACK_ALIGNMENT is the maximum best
+ effort stack alignment supported by the backend. If the backend
+ supports stack alignment, MAX_SUPPORTED_STACK_ALIGNMENT and
+ MAX_STACK_ALIGNMENT are the same. Otherwise, the incoming stack
+ boundary will limit the maximum guaranteed stack alignment. */
+#ifdef MAX_STACK_ALIGNMENT
+#define MAX_SUPPORTED_STACK_ALIGNMENT MAX_STACK_ALIGNMENT
+#else
+#define MAX_STACK_ALIGNMENT STACK_BOUNDARY
+#define MAX_SUPPORTED_STACK_ALIGNMENT PREFERRED_STACK_BOUNDARY
+#endif
+
+#define SUPPORTS_STACK_ALIGNMENT (MAX_STACK_ALIGNMENT > STACK_BOUNDARY)
+
#ifndef LOCAL_ALIGNMENT
#define LOCAL_ALIGNMENT(TYPE, ALIGNMENT) ALIGNMENT
#endif
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index c6500d81d26..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,52 +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, write "if (pedantic) pedwarn (...);" */
-void
-pedwarn (const char *gmsgid, ...)
+ 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,...)".
+
+ 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 ());
- report_diagnostic (&diagnostic);
+ diagnostic_set_info (&diagnostic, gmsgid, &ap, location, DK_PEDWARN);
+ diagnostic.option_index = opt;
va_end (ap);
+ return report_diagnostic (&diagnostic);
}
-/* 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. */
+/* 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.
-void
-permerror (const char *gmsgid, ...)
+ Returns true if the warning was printed, false if it was inhibited. */
+
+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 1d13eeeae42..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 *);
@@ -215,14 +213,24 @@ extern char *diagnostic_build_prefix (diagnostic_info *);
extern char *file_name_as_prefix (const char *);
/* In tree-pretty-print.c */
+extern void print_declaration (pretty_printer *, tree, int, int);
extern int dump_generic_node (pretty_printer *, tree, int, int, bool);
extern void print_generic_stmt (FILE *, tree, int);
extern void print_generic_stmt_indented (FILE *, tree, int, int);
extern void print_generic_expr (FILE *, tree, int);
extern void print_generic_decl (FILE *, tree, int);
+extern void debug_c_tree (tree);
+extern void dump_omp_clauses (pretty_printer *, tree, int, int);
+/* In gimple-pretty-print.c */
extern void debug_generic_expr (tree);
extern void debug_generic_stmt (tree);
extern void debug_tree_chain (tree);
-extern void debug_c_tree (tree);
+extern void debug_gimple_stmt (gimple);
+extern void debug_gimple_seq (gimple_seq);
+extern void print_gimple_seq (FILE *, gimple_seq, int, int);
+extern void print_gimple_stmt (FILE *, gimple, int, int);
+extern void print_gimple_expr (FILE *, gimple, int, int);
+extern void dump_gimple_stmt (pretty_printer *, gimple, int, int);
+
#endif /* ! GCC_DIAGNOSTIC_H */
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index 7b5eb7f2835..0eaece14d45 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -15,7 +15,7 @@ Copyright @copyright{} 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation. A copy of
the license is included in the
@c man end
@@ -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 a8040920d65..05203ddfbb4 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -2665,19 +2665,19 @@ take function pointer arguments. The @code{nothrow} attribute is not
implemented in GCC versions earlier than 3.3.
@item option
-@cindex @code{option} function attribute
-The @code{option} attribute is used to specify that a function is to
+@cindex @code{target} function attribute
+The @code{target} attribute is used to specify that a function is to
be compiled with different target options than specified on the
command line. This can be used for instance to have functions
compiled with a different ISA (instruction set architecture) than the
-default. You can also use the @samp{#pragma GCC option} pragma to set
+default. You can also use the @samp{#pragma GCC target} pragma to set
more than one function to be compiled with specific target options.
@xref{Function Specific Option Pragmas}, for details about the
-@samp{#pragma GCC option} pragma.
+@samp{#pragma GCC target} pragma.
For instance on a 386, you could compile one function with
-@code{option("sse4.1,arch=core2")} and another with
-@code{option("sse4a,arch=amdfam10")} that would be equivalent to
+@code{target("sse4.1,arch=core2")} and another with
+@code{target("sse4a,arch=amdfam10")} that would be equivalent to
compiling the first function with @option{-msse4.1} and
@option{-march=core2} options, and the second function with
@option{-msse4a} and @option{-march=amdfam10} options. It is up to the
@@ -2687,8 +2687,8 @@ supports the particular ISA it was compiled for (for example by using
family are used).
@smallexample
-int core2_func (void) __attribute__ ((__option__ ("arch=core2")));
-int sse3_func (void) __attribute__ ((__option__ ("sse3")));
+int core2_func (void) __attribute__ ((__target__ ("arch=core2")));
+int sse3_func (void) __attribute__ ((__target__ ("sse3")));
@end smallexample
On the 386, the following options are allowed:
@@ -2696,132 +2696,132 @@ On the 386, the following options are allowed:
@table @samp
@item abm
@itemx no-abm
-@cindex option("abm")
+@cindex @code{target("abm")} attribute
Enable/disable the generation of the advanced bit instructions.
@item aes
@itemx no-aes
-@cindex @code{option("aes")} attribute
+@cindex @code{target("aes")} attribute
Enable/disable the generation of the AES instructions.
@item mmx
@itemx no-mmx
-@cindex @code{option("mmx")} attribute
+@cindex @code{target("mmx")} attribute
Enable/disable the generation of the MMX instructions.
@item pclmul
@itemx no-pclmul
-@cindex @code{option("pclmul")} attribute
+@cindex @code{target("pclmul")} attribute
Enable/disable the generation of the PCLMUL instructions.
@item popcnt
@itemx no-popcnt
-@cindex @code{option("popcnt")} attribute
+@cindex @code{target("popcnt")} attribute
Enable/disable the generation of the POPCNT instruction.
@item sse
@itemx no-sse
-@cindex @code{option("sse")} attribute
+@cindex @code{target("sse")} attribute
Enable/disable the generation of the SSE instructions.
@item sse2
@itemx no-sse2
-@cindex @code{option("sse2")} attribute
+@cindex @code{target("sse2")} attribute
Enable/disable the generation of the SSE2 instructions.
@item sse3
@itemx no-sse3
-@cindex @code{option("sse3")} attribute
+@cindex @code{target("sse3")} attribute
Enable/disable the generation of the SSE3 instructions.
@item sse4
@itemx no-sse4
-@cindex @code{option("sse4")} attribute
+@cindex @code{target("sse4")} attribute
Enable/disable the generation of the SSE4 instructions (both SSE4.1
and SSE4.2).
@item sse4.1
@itemx no-sse4.1
-@cindex @code{option("sse4.1")} attribute
+@cindex @code{target("sse4.1")} attribute
Enable/disable the generation of the sse4.1 instructions.
@item sse4.2
@itemx no-sse4.2
-@cindex @code{option("sse4.2")} attribute
+@cindex @code{target("sse4.2")} attribute
Enable/disable the generation of the sse4.2 instructions.
@item sse4a
@itemx no-sse4a
-@cindex @code{option("sse4a")} attribute
+@cindex @code{target("sse4a")} attribute
Enable/disable the generation of the SSE4A instructions.
@item sse5
@itemx no-sse5
-@cindex @code{option("sse5")} attribute
+@cindex @code{target("sse5")} attribute
Enable/disable the generation of the SSE5 instructions.
@item ssse3
@itemx no-ssse3
-@cindex @code{option("ssse3")} attribute
+@cindex @code{target("ssse3")} attribute
Enable/disable the generation of the SSSE3 instructions.
@item cld
@itemx no-cld
-@cindex @code{option("cld")} attribute
+@cindex @code{target("cld")} attribute
Enable/disable the generation of the CLD before string moves.
@item fancy-math-387
@itemx no-fancy-math-387
-@cindex @code{option("fancy-math-387")} attribute
+@cindex @code{target("fancy-math-387")} attribute
Enable/disable the generation of the @code{sin}, @code{cos}, and
@code{sqrt} instructions on the 387 floating point unit.
@item fused-madd
@itemx no-fused-madd
-@cindex @code{option("fused-madd")} attribute
+@cindex @code{target("fused-madd")} attribute
Enable/disable the generation of the fused multiply/add instructions.
@item ieee-fp
@itemx no-ieee-fp
-@cindex @code{option("ieee-fp")} attribute
+@cindex @code{target("ieee-fp")} attribute
Enable/disable the generation of floating point that depends on IEEE arithmetic.
@item inline-all-stringops
@itemx no-inline-all-stringops
-@cindex @code{option("inline-all-stringops")} attribute
+@cindex @code{target("inline-all-stringops")} attribute
Enable/disable inlining of string operations.
@item inline-stringops-dynamically
@itemx no-inline-stringops-dynamically
-@cindex @code{option("inline-stringops-dynamically")} attribute
+@cindex @code{target("inline-stringops-dynamically")} attribute
Enable/disable the generation of the inline code to do small string
operations and calling the library routines for large operations.
@item align-stringops
@itemx no-align-stringops
-@cindex @code{option("align-stringops")} attribute
+@cindex @code{target("align-stringops")} attribute
Do/do not align destination of inlined string operations.
@item recip
@itemx no-recip
-@cindex @code{option("recip")} attribute
+@cindex @code{target("recip")} attribute
Enable/disable the generation of RCPSS, RCPPS, RSQRTSS and RSQRTPS
instructions followed an additional Newton-Rhapson step instead of
doing a floating point division.
@item arch=@var{ARCH}
-@cindex @code{option("arch=@var{ARCH}")} attribute
+@cindex @code{target("arch=@var{ARCH}")} attribute
Specify the architecture to generate code for in compiling the function.
@item tune=@var{TUNE}
-@cindex @code{option("tune=@var{TUNE}")} attribute
+@cindex @code{target("tune=@var{TUNE}")} attribute
Specify the architecture to tune for in compiling the function.
@item fpmath=@var{FPMATH}
-@cindex @code{option("fpmath=@var{FPMATH}")} attribute
+@cindex @code{target("fpmath=@var{FPMATH}")} attribute
Specify which floating point unit to use. The
-@code{option("fpmath=sse,387")} option must be specified as
-@code{option("fpmath=sse+387")} because the comma would separate
+@code{target("fpmath=sse,387")} option must be specified as
+@code{target("fpmath=sse+387")} because the comma would separate
different options.
@end table
@@ -2831,10 +2831,10 @@ options, or you can separate the option with a comma (@code{,}).
On the 386, the inliner will not inline a function that has different
target options than the caller, unless the callee has a subset of the
target options of the caller. For example a function declared with
-@code{option("sse5")} can inline a function with
-@code{option("sse2")}, since @code{-msse5} implies @code{-msse2}.
+@code{target("sse5")} can inline a function with
+@code{target("sse2")}, since @code{-msse5} implies @code{-msse2}.
-The @code{option} attribute is not implemented in GCC versions earlier
+The @code{target} attribute is not implemented in GCC versions earlier
than 4.4, and at present only the 386 uses it.
@item optimize
@@ -2853,17 +2853,7 @@ that affect more than one function.
This can be used for instance to have frequently executed functions
compiled with more aggressive optimization options that produce faster
and larger code, while other functions can be called with less
-aggressive options. The @code{hot} attribute implies
-@code{optimize("O3")}, and @code{cold} attribute implies
-@code{optimize("Os")}.
-
-@smallexample
-int fast_func (void) __attribute__ ((__optimize__ ("O3,unroll-loops")));
-int slow_func (void) __attribute__ ((__optimize__ ("Os")));
-@end smallexample
-
-The inliner will not inline functions with a higher optimization level
-than the caller or different space/time trade offs.
+aggressive options.
@item pure
@cindex @code{pure} function attribute
@@ -2903,9 +2893,6 @@ 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{hot} attribute sets
-@code{optimize("O3")} to turn on more aggressive optimization.
-
@item cold
@cindex @code{cold} function attribute
The @code{cold} attribute is used to inform the compiler that a function is
@@ -2923,9 +2910,6 @@ are automatically detected and this attribute is ignored.
The @code{cold} attribute is not implemented in GCC versions earlier than 4.3.
-Starting with GCC 4.4, the @code{cold} attribute sets
-@code{optimize("Os")} to save space.
-
@item regparm (@var{number})
@cindex @code{regparm} attribute
@cindex functions that are passed arguments in registers on the 386
@@ -2957,15 +2941,9 @@ floating point arguments on the stack.
@cindex @code{force_align_arg_pointer} attribute
On the Intel x86, the @code{force_align_arg_pointer} attribute may be
applied to individual function definitions, generating an alternate
-prologue and epilogue that realigns the runtime stack. This supports
-mixing legacy codes that run with a 4-byte aligned stack with modern
-codes that keep a 16-byte stack for SSE compatibility. The alternate
-prologue and epilogue are slower and bigger than the regular ones, and
-the alternate prologue requires a scratch register; this lowers the
-number of registers available if used in conjunction with the
-@code{regparm} attribute. The @code{force_align_arg_pointer}
-attribute is incompatible with nested functions; this is considered a
-hard error.
+prologue and epilogue that realigns the runtime stack if necessary.
+This supports mixing legacy codes that run with a 4-byte aligned stack
+with modern codes that keep a 16-byte stack for SSE compatibility.
@item resbank
@cindex @code{resbank} attribute
@@ -8075,6 +8053,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.
@@ -8274,6 +8253,141 @@ depending on the size of @code{unsigned long}.
Generates the @code{popcntq} machine instruction.
@end table
+The following built-in functions are available when @option{-mavx} is
+used. All of them generate the machine instruction that is part of the
+name.
+
+@smallexample
+v4df __builtin_ia32_addpd256 (v4df,v4df)
+v8sf __builtin_ia32_addps256 (v8sf,v8sf)
+v4df __builtin_ia32_addsubpd256 (v4df,v4df)
+v8sf __builtin_ia32_addsubps256 (v8sf,v8sf)
+v4df __builtin_ia32_andnpd256 (v4df,v4df)
+v8sf __builtin_ia32_andnps256 (v8sf,v8sf)
+v4df __builtin_ia32_andpd256 (v4df,v4df)
+v8sf __builtin_ia32_andps256 (v8sf,v8sf)
+v4df __builtin_ia32_blendpd256 (v4df,v4df,int)
+v8sf __builtin_ia32_blendps256 (v8sf,v8sf,int)
+v4df __builtin_ia32_blendvpd256 (v4df,v4df,v4df)
+v8sf __builtin_ia32_blendvps256 (v8sf,v8sf,v8sf)
+v2df __builtin_ia32_cmppd (v2df,v2df,int)
+v4df __builtin_ia32_cmppd256 (v4df,v4df,int)
+v4sf __builtin_ia32_cmpps (v4sf,v4sf,int)
+v8sf __builtin_ia32_cmpps256 (v8sf,v8sf,int)
+v2df __builtin_ia32_cmpsd (v2df,v2df,int)
+v4sf __builtin_ia32_cmpss (v4sf,v4sf,int)
+v4df __builtin_ia32_cvtdq2pd256 (v4si)
+v8sf __builtin_ia32_cvtdq2ps256 (v8si)
+v4si __builtin_ia32_cvtpd2dq256 (v4df)
+v4sf __builtin_ia32_cvtpd2ps256 (v4df)
+v8si __builtin_ia32_cvtps2dq256 (v8sf)
+v4df __builtin_ia32_cvtps2pd256 (v4sf)
+v4si __builtin_ia32_cvttpd2dq256 (v4df)
+v8si __builtin_ia32_cvttps2dq256 (v8sf)
+v4df __builtin_ia32_divpd256 (v4df,v4df)
+v8sf __builtin_ia32_divps256 (v8sf,v8sf)
+v8sf __builtin_ia32_dpps256 (v8sf,v8sf,int)
+v4df __builtin_ia32_haddpd256 (v4df,v4df)
+v8sf __builtin_ia32_haddps256 (v8sf,v8sf)
+v4df __builtin_ia32_hsubpd256 (v4df,v4df)
+v8sf __builtin_ia32_hsubps256 (v8sf,v8sf)
+v32qi __builtin_ia32_lddqu256 (pcchar)
+v32qi __builtin_ia32_loaddqu256 (pcchar)
+v4df __builtin_ia32_loadupd256 (pcdouble)
+v8sf __builtin_ia32_loadups256 (pcfloat)
+v2df __builtin_ia32_maskloadpd (pcv2df,v2df)
+v4df __builtin_ia32_maskloadpd256 (pcv4df,v4df)
+v4sf __builtin_ia32_maskloadps (pcv4sf,v4sf)
+v8sf __builtin_ia32_maskloadps256 (pcv8sf,v8sf)
+void __builtin_ia32_maskstorepd (pv2df,v2df,v2df)
+void __builtin_ia32_maskstorepd256 (pv4df,v4df,v4df)
+void __builtin_ia32_maskstoreps (pv4sf,v4sf,v4sf)
+void __builtin_ia32_maskstoreps256 (pv8sf,v8sf,v8sf)
+v4df __builtin_ia32_maxpd256 (v4df,v4df)
+v8sf __builtin_ia32_maxps256 (v8sf,v8sf)
+v4df __builtin_ia32_minpd256 (v4df,v4df)
+v8sf __builtin_ia32_minps256 (v8sf,v8sf)
+v4df __builtin_ia32_movddup256 (v4df)
+int __builtin_ia32_movmskpd256 (v4df)
+int __builtin_ia32_movmskps256 (v8sf)
+v8sf __builtin_ia32_movshdup256 (v8sf)
+v8sf __builtin_ia32_movsldup256 (v8sf)
+v4df __builtin_ia32_mulpd256 (v4df,v4df)
+v8sf __builtin_ia32_mulps256 (v8sf,v8sf)
+v4df __builtin_ia32_orpd256 (v4df,v4df)
+v8sf __builtin_ia32_orps256 (v8sf,v8sf)
+v2df __builtin_ia32_pd_pd256 (v4df)
+v4df __builtin_ia32_pd256_pd (v2df)
+v4sf __builtin_ia32_ps_ps256 (v8sf)
+v8sf __builtin_ia32_ps256_ps (v4sf)
+int __builtin_ia32_ptestc256 (v4di,v4di,ptest)
+int __builtin_ia32_ptestnzc256 (v4di,v4di,ptest)
+int __builtin_ia32_ptestz256 (v4di,v4di,ptest)
+v8sf __builtin_ia32_rcpps256 (v8sf)
+v4df __builtin_ia32_roundpd256 (v4df,int)
+v8sf __builtin_ia32_roundps256 (v8sf,int)
+v8sf __builtin_ia32_rsqrtps_nr256 (v8sf)
+v8sf __builtin_ia32_rsqrtps256 (v8sf)
+v4df __builtin_ia32_shufpd256 (v4df,v4df,int)
+v8sf __builtin_ia32_shufps256 (v8sf,v8sf,int)
+v4si __builtin_ia32_si_si256 (v8si)
+v8si __builtin_ia32_si256_si (v4si)
+v4df __builtin_ia32_sqrtpd256 (v4df)
+v8sf __builtin_ia32_sqrtps_nr256 (v8sf)
+v8sf __builtin_ia32_sqrtps256 (v8sf)
+void __builtin_ia32_storedqu256 (pchar,v32qi)
+void __builtin_ia32_storeupd256 (pdouble,v4df)
+void __builtin_ia32_storeups256 (pfloat,v8sf)
+v4df __builtin_ia32_subpd256 (v4df,v4df)
+v8sf __builtin_ia32_subps256 (v8sf,v8sf)
+v4df __builtin_ia32_unpckhpd256 (v4df,v4df)
+v8sf __builtin_ia32_unpckhps256 (v8sf,v8sf)
+v4df __builtin_ia32_unpcklpd256 (v4df,v4df)
+v8sf __builtin_ia32_unpcklps256 (v8sf,v8sf)
+v4df __builtin_ia32_vbroadcastf128_pd256 (pcv2df)
+v8sf __builtin_ia32_vbroadcastf128_ps256 (pcv4sf)
+v4df __builtin_ia32_vbroadcastsd256 (pcdouble)
+v4sf __builtin_ia32_vbroadcastss (pcfloat)
+v8sf __builtin_ia32_vbroadcastss256 (pcfloat)
+v2df __builtin_ia32_vextractf128_pd256 (v4df,int)
+v4sf __builtin_ia32_vextractf128_ps256 (v8sf,int)
+v4si __builtin_ia32_vextractf128_si256 (v8si,int)
+v4df __builtin_ia32_vinsertf128_pd256 (v4df,v2df,int)
+v8sf __builtin_ia32_vinsertf128_ps256 (v8sf,v4sf,int)
+v8si __builtin_ia32_vinsertf128_si256 (v8si,v4si,int)
+v4df __builtin_ia32_vperm2f128_pd256 (v4df,v4df,int)
+v8sf __builtin_ia32_vperm2f128_ps256 (v8sf,v8sf,int)
+v8si __builtin_ia32_vperm2f128_si256 (v8si,v8si,int)
+v2df __builtin_ia32_vpermil2pd (v2df,v2df,v2di,int)
+v4df __builtin_ia32_vpermil2pd256 (v4df,v4df,v4di,int)
+v4sf __builtin_ia32_vpermil2ps (v4sf,v4sf,v4si,int)
+v8sf __builtin_ia32_vpermil2ps256 (v8sf,v8sf,v8si,int)
+v2df __builtin_ia32_vpermilpd (v2df,int)
+v4df __builtin_ia32_vpermilpd256 (v4df,int)
+v4sf __builtin_ia32_vpermilps (v4sf,int)
+v8sf __builtin_ia32_vpermilps256 (v8sf,int)
+v2df __builtin_ia32_vpermilvarpd (v2df,v2di)
+v4df __builtin_ia32_vpermilvarpd256 (v4df,v4di)
+v4sf __builtin_ia32_vpermilvarps (v4sf,v4si)
+v8sf __builtin_ia32_vpermilvarps256 (v8sf,v8si)
+int __builtin_ia32_vtestcpd (v2df,v2df,ptest)
+int __builtin_ia32_vtestcpd256 (v4df,v4df,ptest)
+int __builtin_ia32_vtestcps (v4sf,v4sf,ptest)
+int __builtin_ia32_vtestcps256 (v8sf,v8sf,ptest)
+int __builtin_ia32_vtestnzcpd (v2df,v2df,ptest)
+int __builtin_ia32_vtestnzcpd256 (v4df,v4df,ptest)
+int __builtin_ia32_vtestnzcps (v4sf,v4sf,ptest)
+int __builtin_ia32_vtestnzcps256 (v8sf,v8sf,ptest)
+int __builtin_ia32_vtestzpd (v2df,v2df,ptest)
+int __builtin_ia32_vtestzpd256 (v4df,v4df,ptest)
+int __builtin_ia32_vtestzps (v4sf,v4sf,ptest)
+int __builtin_ia32_vtestzps256 (v8sf,v8sf,ptest)
+void __builtin_ia32_vzeroall (void)
+void __builtin_ia32_vzeroupper (void)
+v4df __builtin_ia32_xorpd256 (v4df,v4df)
+v8sf __builtin_ia32_xorps256 (v8sf,v8sf)
+@end smallexample
+
The following built-in functions are available when @option{-maes} is
used. All of them generate the machine instruction that is part of the
name.
@@ -11614,6 +11728,35 @@ strict control over project policies.
@end table
+GCC also offers a simple mechanism for printing messages during
+compilation.
+
+@table @code
+@item #pragma message @var{string}
+@cindex pragma, diagnostic
+
+Prints @var{string} as a compiler message on compilation. The message
+is informational only, and is neither a compilation warning nor an error.
+
+@smallexample
+#pragma message "Compiling " __FILE__ "..."
+@end smallexample
+
+@var{string} may be parenthesized, and is printed with location
+information. For example,
+
+@smallexample
+#define DO_PRAGMA(x) _Pragma (#x)
+#define TODO(x) DO_PRAGMA(message ("TODO - " #x))
+
+TODO(Remember to fix this)
+@end smallexample
+
+prints @samp{/tmp/file.c:4: note: #pragma message:
+TODO - Remember to fix this}.
+
+@end table
+
@node Visibility Pragmas
@subsection Visibility Pragmas
@@ -11673,42 +11816,23 @@ push_macro} and restored by @code{#pragma pop_macro}.
@subsection Function Specific Option Pragmas
@table @code
-@item #pragma GCC option (@var{"string"}...)
-@cindex pragma GCC option
+@item #pragma GCC target (@var{"string"}...)
+@cindex pragma GCC target
This pragma allows you to set target specific options for functions
defined later in the source file. One or more strings can be
specified. Each function that is defined after this point will be as
-if @code{attribute((option("STRING")))} was specified for that
+if @code{attribute((target("STRING")))} was specified for that
function. The parenthesis around the options is optional.
@xref{Function Attributes}, for more information about the
-@code{option} attribute and the attribute syntax.
+@code{target} attribute and the attribute syntax.
-The @samp{#pragma GCC option} pragma is not implemented in GCC
+The @samp{#pragma GCC target} pragma is not implemented in GCC
versions earlier than 4.4, and is currently only implemented for the
-386 and x86_64 backend.
+386 and x86_64 backends.
@end table
@table @code
-@item #pragma GCC option (push)
-@itemx #pragma GCC option (pop)
-@cindex pragma GCC option
-
-These pragmas maintain a stack of the current options. It is
-intended for include files where you temporarily want to switch to
-using a different @samp{#pragma GCC option} and then to pop back to
-the previous options.
-@end table
-
-@table @code
-@item #pragma GCC option (reset)
-@cindex pragma, target option
-@cindex pragma GCC option
-
-This pragma clears the current @code{#pragma GCC options} to use the
-default switches as specified on the command line.
-@end table
-@table @code
@item #pragma GCC optimize (@var{"string"}...)
@cindex pragma GCC optimize
@@ -11725,22 +11849,31 @@ versions earlier than 4.4.
@end table
@table @code
-@item #pragma GCC optimize (push)
-@itemx #pragma GCC optimize (pop)
-@cindex pragma GCC optimize
-
-These pragmas maintain a stack of the current optimization options.
-It is intended for include files where you temporarily want to switch
-to using a different @code{#pragma GCC optimize} and then to pop back
-to the previous optimizations.
+@item #pragma GCC push_options
+@itemx #pragma GCC pop_options
+@cindex pragma GCC push_options
+@cindex pragma GCC pop_options
+
+These pragmas maintain a stack of the current target and optimization
+options. It is intended for include files where you temporarily want
+to switch to using a different @samp{#pragma GCC target} or
+@samp{#pragma GCC optimize} and then to pop back to the previous
+options.
+
+The @samp{#pragma GCC push_options} and @samp{#pragma GCC pop_options}
+pragmas are not implemented in GCC versions earlier than 4.4.
@end table
@table @code
-@item #pragma GCC optimize reset
-@cindex pragma GCC optimize
+@item #pragma GCC reset_options
+@cindex pragma GCC reset_options
-This pragma clears the current @code{#pragma GCC optimize} to use the
-default switches as specified on the command line.
+This pragma clears the current @code{#pragma GCC target} and
+@code{#pragma GCC optimize} to use the default switches as specified
+on the command line.
+
+The @samp{#pragma GCC reset_options} pragma is not implemented in GCC
+versions earlier than 4.4.
@end table
@node Unnamed Fields
diff --git a/gcc/doc/fragments.texi b/gcc/doc/fragments.texi
index 450fd50f469..dcb64f441a8 100644
--- a/gcc/doc/fragments.texi
+++ b/gcc/doc/fragments.texi
@@ -172,6 +172,11 @@ some other filename (say @file{specs.install}), that will then be
created out of the built-in specs, and introduce a @file{Makefile}
rule to generate the @file{specs} file that's going to be used at
build time out of your @file{specs.install}.
+
+@item T_CFLAGS
+These are extra flags to pass to the C compiler. They are used both
+when building GCC, and when compiling things with the just-built GCC@.
+This variable is deprecated and should not be used.
@end table
@node Host Fragment
@@ -179,36 +184,5 @@ build time out of your @file{specs.install}.
@cindex host makefile fragment
@cindex @file{x-@var{host}}
-The use of @file{x-@var{host}} fragments is discouraged. You should do
-so only if there is no other mechanism to get the behavior desired.
-Host fragments should never forcibly override variables set by the
-configure script, as they may have been adjusted by the user.
-
-Variables provided for host fragments to set include:
-
-@table @code
-
-@item X_CFLAGS
-@itemx X_CPPFLAGS
-These are extra flags to pass to the C compiler and preprocessor,
-respectively. They are used both when building GCC, and when compiling
-things with the just-built GCC@.
-
-@item XCFLAGS
-These are extra flags to use when building the compiler. They are not
-used when compiling @file{libgcc.a}. However, they @emph{are} used when
-recompiling the compiler with itself in later stages of a bootstrap.
-
-@item BOOT_LDFLAGS
-Flags to be passed to the linker when recompiling the compiler with
-itself in later stages of a bootstrap. You might need to use this if,
-for instance, one of the front ends needs more text space than the
-linker provides by default.
-
-@item EXTRA_PROGRAMS
-A list of additional programs required to use the compiler on this host,
-which should be compiled with GCC and installed alongside the front
-ends. If you set this variable, you must also provide rules to build
-the extra programs.
-
-@end table
+The use of @file{x-@var{host}} fragments is discouraged. You should only
+use it for makefile dependencies.
diff --git a/gcc/doc/gcc.texi b/gcc/doc/gcc.texi
index b97943916f1..41031752bf2 100644
--- a/gcc/doc/gcc.texi
+++ b/gcc/doc/gcc.texi
@@ -41,16 +41,16 @@
@copying
Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'' and ``Funding
-Free Software'', the Front-Cover texts being (a) (see below), and with
-the Back-Cover Texts being (b) (see below). A copy of the license is
-included in the section entitled ``GNU Free Documentation License''.
+Invariant Sections being ``Funding Free Software'', the Front-Cover
+Texts being (a) (see below), and with the Back-Cover Texts being (b)
+(see below). A copy of the license is included in the section entitled
+``GNU Free Documentation License''.
(a) The FSF's Front-Cover Text is:
diff --git a/gcc/doc/gccint.texi b/gcc/doc/gccint.texi
index b285ec9b3dd..9fe28c075e0 100644
--- a/gcc/doc/gccint.texi
+++ b/gcc/doc/gccint.texi
@@ -27,16 +27,16 @@
@copying
Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-2007 Free Software Foundation, Inc.
+1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+2008 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'' and ``Funding
-Free Software'', the Front-Cover texts being (a) (see below), and with
-the Back-Cover Texts being (b) (see below). A copy of the license is
-included in the section entitled ``GNU Free Documentation License''.
+Invariant Sections being ``Funding Free Software'', the Front-Cover
+Texts being (a) (see below), and with the Back-Cover Texts being (b)
+(see below). A copy of the license is included in the section entitled
+``GNU Free Documentation License''.
(a) The FSF's Front-Cover Text is:
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 8913ec0c923..e3560c80138 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -70,8 +70,9 @@
@c Part 2 Summary Description and Copyright
@copying
-Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright @copyright{} 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997,
+1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+2008 Free Software Foundation, Inc.
@sp 1
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
@@ -386,7 +387,7 @@ Necessary to build GCC during development because the generated output
files are not included in the SVN repository. They are included in
releases.
-@item Texinfo version 4.4 (or later)
+@item Texinfo version 4.7 (or later)
Necessary for running @command{makeinfo} when modifying @file{*.texi}
files to test your changes.
@@ -1075,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.
@@ -1765,7 +1772,7 @@ build machinery, not of GCC itself) that is used even if you only
build the C front end.
When building from SVN or snapshots, or if you modify Texinfo
-documentation, you need version 4.4 or later of Texinfo installed if you
+documentation, you need version 4.7 or later of Texinfo installed if you
want Info documentation to be regenerated. Releases contain Info
documentation pre-built for the unmodified documentation in the release.
@@ -2362,7 +2369,7 @@ If you find a bug, please report it following the
@uref{../bugs.html,,bug reporting guidelines}.
If you want to print the GCC manuals, do @samp{cd @var{objdir}; make
-dvi}. You will need to have @command{texi2dvi} (version at least 4.4)
+dvi}. You will need to have @command{texi2dvi} (version at least 4.7)
and @TeX{} installed. This creates a number of @file{.dvi} files in
subdirectories of @file{@var{objdir}}; these may be converted for
printing with programs such as @command{dvips}. Alternately, by using
@@ -2415,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}.
@@ -2624,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
@@ -3675,9 +3682,7 @@ or newer for a working GCC@.
<hr />
@end html
@heading @anchor{powerpc-x-netbsd}powerpc-*-netbsd*
-PowerPC system in big endian mode running NetBSD@. To build the
-documentation you will need Texinfo version 4.4 (NetBSD 1.5.1 included
-Texinfo version 3.12).
+PowerPC system in big endian mode running NetBSD@.
@html
<hr />
@@ -4037,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
@@ -4055,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 f493bf710a9..29b67c72b61 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -274,7 +274,8 @@ Objective-C and Objective-C++ Dialects}.
@xref{Debugging Options,,Options for Debugging Your Program or GCC}.
@gccoptlist{-d@var{letters} -dumpspecs -dumpmachine -dumpversion @gol
-fdbg-cnt-list -fdbg-cnt=@var{counter-value-list} @gol
--fdump-noaddr -fdump-unnumbered -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
+-fdump-noaddr -fdump-unnumbered @gol
+-fdump-translation-unit@r{[}-@var{n}@r{]} @gol
-fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
-fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
-fdump-statistics @gol
@@ -328,11 +329,14 @@ Objective-C and Objective-C++ Dialects}.
-fearly-inlining -fexpensive-optimizations -ffast-math @gol
-ffinite-math-only -ffloat-store -fforward-propagate @gol
-ffunction-sections -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm @gol
--fgcse-sm -fif-conversion -fif-conversion2 -finline-functions @gol
--finline-functions-called-once -finline-limit=@var{n} @gol
--finline-small-functions -fipa-cp -fipa-marix-reorg -fipa-pta @gol
+-fgcse-sm -fif-conversion -fif-conversion2 -findirect-inlining @gol
+-finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
+-finline-small-functions -fipa-cp -fipa-cp-clone -fipa-marix-reorg -fipa-pta @gol
-fipa-pure-const -fipa-reference -fipa-struct-reorg @gol
--fipa-type-escape -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
+-fipa-type-escape -fira -fira-algorithm=@var{algorithm} @gol
+-fira-coalesce -fno-ira-share-save-slots @gol
+-fno-ira-share-spill-slots -fira-verbose=@var{n} @gol
+-fivopts -fkeep-inline-functions -fkeep-static-consts @gol
-fmerge-all-constants -fmerge-constants -fmodulo-sched @gol
-fmodulo-sched-allow-regmoves -fmove-loop-invariants -fmudflap @gol
-fmudflapir -fmudflapth -fno-branch-count-reg -fno-default-inline @gol
@@ -342,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
@@ -360,7 +365,7 @@ Objective-C and Objective-C++ Dialects}.
-ftree-loop-distribution @gol
-ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
-ftree-parallelize-loops=@var{n} -ftree-pre -ftree-reassoc @gol
--ftree-sink -ftree-sra -ftree-store-ccp -ftree-switch-conversion @gol
+-ftree-sink -ftree-sra -ftree-switch-conversion @gol
-ftree-ter -ftree-vect-loop-version -ftree-vectorize -ftree-vrp @gol
-funit-at-a-time -funroll-all-loops -funroll-loops @gol
-funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
@@ -555,8 +560,10 @@ Objective-C and Objective-C++ Dialects}.
-masm=@var{dialect} -mno-fancy-math-387 @gol
-mno-fp-ret-in-387 -msoft-float @gol
-mno-wide-multiply -mrtd -malign-double @gol
--mpreferred-stack-boundary=@var{num} -mcld -mcx16 -msahf -mrecip @gol
--mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 @gol
+-mpreferred-stack-boundary=@var{num}
+-mincoming-stack-boundary=@var{num}
+-mcld -mcx16 -msahf -mrecip @gol
+-mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
-maes -mpclmul @gol
-msse4a -m3dnow -mpopcnt -mabm -msse5 @gol
-mthreads -mno-align-stringops -minline-all-stringops @gol
@@ -627,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
@@ -2694,7 +2702,7 @@ Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
-Wstrict-overflow=1 @gol
-Wswitch @gol
-Wtrigraphs @gol
--Wuninitialized @r{(only with} @option{-O1} @r{and above)} @gol
+-Wuninitialized @gol
-Wunknown-pragmas @gol
-Wunused-function @gol
-Wunused-label @gol
@@ -2728,7 +2736,7 @@ name is still supported, but the newer name is more descriptive.)
-Woverride-init @gol
-Wsign-compare @gol
-Wtype-limits @gol
--Wuninitialized @r{(only with} @option{-O1} @r{and above)} @gol
+-Wuninitialized @gol
-Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
}
@@ -2746,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
@@ -2890,8 +2894,7 @@ can be disabled with the @option{-Wno-nonnull} option.
@opindex Winit-self
@opindex Wno-init-self
Warn about uninitialized variables which are initialized with themselves.
-Note this option can only be used with the @option{-Wuninitialized} option,
-which in turn only works with @option{-O1} and above.
+Note this option can only be used with the @option{-Wuninitialized} option.
For example, GCC will warn about @code{i} being uninitialized in the
following snippet only when @option{-Winit-self} has been specified:
@@ -2942,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
@@ -3171,14 +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.
-
-These warnings are possible only in optimizing compilation,
-because they require data flow information that is computed only
-when optimizing. If you do not specify @option{-O}, you will not get
-these warnings. Instead, GCC will issue a warning about @option{-Wuninitialized}
-requiring @option{-O}.
+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.
@@ -3250,8 +3250,7 @@ Some spurious warnings can be avoided if you declare all the functions
you use that never return as @code{noreturn}. @xref{Function
Attributes}.
-This warning is enabled by @option{-Wall} or @option{-Wextra} in
-optimizing compilations (@option{-O1} and above).
+This warning is enabled by @option{-Wall} or @option{-Wextra}.
@item -Wunknown-pragmas
@opindex Wunknown-pragmas
@@ -3612,16 +3611,17 @@ two- or four-byte boundaries.
@opindex Wwrite-strings
@opindex Wno-write-strings
When compiling C, give string constants the type @code{const
-char[@var{length}]} so that
-copying the address of one into a non-@code{const} @code{char *}
-pointer will get a warning; when compiling C++, warn about the
-deprecated conversion from string literals to @code{char *}. This
-warning, by default, is enabled for C++ programs.
-These warnings will help you find at
-compile time code that can try to write into a string constant, but
-only if you have been very careful about using @code{const} in
-declarations and prototypes. Otherwise, it will just be a nuisance;
-this is why we did not make @option{-Wall} request these warnings.
+char[@var{length}]} so that copying the address of one into a
+non-@code{const} @code{char *} pointer will get a warning. These
+warnings will help you find at compile time code that can try to write
+into a string constant, but only if you have been very careful about
+using @code{const} in declarations and prototypes. Otherwise, it will
+just be a nuisance. This is why we did not make @option{-Wall} request
+these warnings.
+
+When compiling C++, warn about the deprecated conversion from string
+literals to @code{char *}. This warning is enabled by default for C++
+programs.
@item -Wclobbered
@opindex Wclobbered
@@ -5199,6 +5199,7 @@ also turns on the following optimization flags:
-fdelete-null-pointer-checks @gol
-fexpensive-optimizations @gol
-fgcse -fgcse-lm @gol
+-findirect-inlining @gol
-foptimize-sibling-calls @gol
-fpeephole2 @gol
-fregmove @gol
@@ -5216,8 +5217,8 @@ invoking @option{-O2} on programs that use computed gotos.
@item -O3
@opindex O3
-Optimize yet more. @option{-O3} turns on all optimizations specified by
-@option{-O2} and also turns on the @option{-finline-functions},
+Optimize yet more. @option{-O3} turns on all optimizations specified
+by @option{-O2} and also turns on the @option{-finline-functions},
@option{-funswitch-loops}, @option{-fpredictive-commoning},
@option{-fgcse-after-reload} and @option{-ftree-vectorize} options.
@@ -5319,6 +5320,15 @@ in this way.
Enabled at level @option{-O2}.
+@item -findirect-inlining
+@opindex findirect-inlining
+Inline also indirect calls that are discovered to be known at compile
+time thanks to previous inlining. This option has any effect only
+when inlining itself is turned on by the @option{-finline-functions}
+or @option{-finline-small-functions} options.
+
+Enabled at level @option{-O2}.
+
@item -finline-functions
@opindex finline-functions
Integrate all simple functions into their callers. The compiler
@@ -5667,6 +5677,49 @@ optimization.
Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
+@item -fira
+@opindex fira
+Use the integrated register allocator (@acronym{IRA}) for register
+allocation. It is a default if @acronym{IRA} has been ported for the
+target.
+
+@item -fira-algorithm=@var{algorithm}
+Use specified algorithm for the integrated register allocator. The
+@var{algorithm} argument should be one of @code{regional}, @code{CB},
+or @code{mixed}. The second algorithm specifies Chaitin-Briggs
+coloring, the first one specifies regional coloring based on
+Chaitin-Briggs coloring, and the third one which is the default
+specifies a mix of Chaitin-Briggs and regional algorithms where loops
+with small register pressure are ignored. The first algorithm can
+give best result for machines with small size and irregular register
+set, the second one is faster and generates decent code and the
+smallest size code, and the mixed algorithm usually give the best
+results in most cases and for most architectures.
+
+@item -fira-coalesce
+@opindex fira-coalesce
+Do optimistic register coalescing. This option might be profitable for
+architectures with big regular register files.
+
+@item -fno-ira-share-save-slots
+@opindex fno-ira-share-save-slots
+Switch off sharing stack slots used for saving call used hard
+registers living through a call. Each hard register will get a
+separate stack slot and as a result function stack frame will be
+bigger.
+
+@item -fno-ira-share-spill-slots
+@opindex fno-ira-share-spill-slots
+Switch off sharing stack slots allocated for pseudo-registers. Each
+pseudo-register which did not get a hard register will get a separate
+stack slot and as a result function stack frame will be bigger.
+
+@item -fira-verbose=@var{n}
+@opindex fira-verbose
+Set up how verbose dump file for the integrated register allocator
+will be. Default value is 5. If the value is greater or equal to 10,
+the dump file will be stderr as if the value were @var{n} minus 10.
+
@item -fdelayed-branch
@opindex fdelayed-branch
If supported for the target machine, attempt to reorder instructions
@@ -5839,7 +5892,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
@@ -5847,9 +5901,18 @@ Perform interprocedural constant propagation.
This optimization analyzes the program to determine when values passed
to functions are constants and then optimizes accordingly.
This optimization can substantially increase performance
-if the application has constants passed to functions, but
-because this optimization can create multiple copies of functions,
-it may significantly increase code size.
+if the application has constants passed to functions.
+This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
+
+@item -fipa-cp-clone
+@opindex fipa-cp-clone
+Perform function cloning to make interprocedural constant propagation stronger.
+When enabled, interprocedural constant propagation will perform function cloning
+when externally visible function can be called with constant arguments.
+Because this optimization can create multiple copies of functions,
+it may significantly increase code size
+(see @option{--param ipcp-unit-growth=@var{value}}).
+This flag is enabled by default at @option{-O3}.
@item -fipa-matrix-reorg
@opindex fipa-matrix-reorg
@@ -5875,13 +5938,6 @@ Perform sparse conditional constant propagation (CCP) on trees. This
pass only operates on local scalar variables and is enabled by default
at @option{-O} and higher.
-@item -ftree-store-ccp
-@opindex ftree-store-ccp
-Perform sparse conditional constant propagation (CCP) on trees. This
-pass operates on both local scalar variables and memory stores and
-loads (global variables, structures, arrays, etc). This flag is
-enabled by default at @option{-O2} and higher.
-
@item -ftree-switch-conversion
Perform conversion of simple initializations in a switch to
initializations from a scalar array. This flag is enabled by default
@@ -6364,6 +6420,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
@@ -6837,6 +6900,10 @@ to the hottest structure frequency in the program is less than this
parameter, then structure reorganization is not applied to this structure.
The default is 10.
+@item predictable-branch-cost-outcome
+When branch is predicted to be taken with probability lower than this threshold
+(in percent), then it is considered well predictable. The default is 10.
+
@item max-crossjump-edges
The maximum number of incoming edges to consider for crossjumping.
The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
@@ -6939,6 +7006,11 @@ Specifies maximal overall growth of the compilation unit caused by inlining.
The default value is 30 which limits unit growth to 1.3 times the original
size.
+@item ipcp-unit-growth
+Specifies maximal overall growth of the compilation unit caused by
+interprocedural constant propagation. The default value is 10 which limits
+unit growth to 1.1 times the original size.
+
@item large-stack-frame
The limit specifying large stack frames. While inlining the algorithm is trying
to not grow past this limit too much. Default value is 256 bytes.
@@ -7358,6 +7430,13 @@ processing. If this limit is hit, SCCVN processing for the whole
function will not be done and optimizations depending on it will
be disabled. The default maximum SCC size is 10000.
+@item ira-max-loops-num
+IRA uses a regional register allocation by default. If a function
+contains loops more than number given by the parameter, non-regional
+register allocator will be used even when option
+@option{-fira-algorithm} is given. The default value of the parameter
+is 20.
+
@end table
@end table
@@ -8597,7 +8676,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}
@@ -8631,7 +8711,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@.
@@ -10729,17 +10810,11 @@ when this option is used to set the precision to less than extended precision.
@item -mstackrealign
@opindex mstackrealign
-Realign the stack at entry. On the Intel x86, the
-@option{-mstackrealign} option will generate an alternate prologue and
-epilogue that realigns the runtime stack. This supports mixing legacy
-codes that keep a 4-byte aligned stack with modern codes that keep a
-16-byte stack for SSE compatibility. The alternate prologue and
-epilogue are slower and bigger than the regular ones, and the
-alternate prologue requires an extra scratch register; this lowers the
-number of registers available if used in conjunction with the
-@code{regparm} attribute. The @option{-mstackrealign} option is
-incompatible with the nested function prologue; this is considered a
-hard error. See also the attribute @code{force_align_arg_pointer},
+Realign the stack at entry. On the Intel x86, the @option{-mstackrealign}
+option will generate an alternate prologue and epilogue that realigns the
+runtime stack if necessary. This supports mixing legacy codes that keep
+a 4-byte aligned stack with modern codes that keep a 16-byte stack for
+SSE compatibility. See also the attribute @code{force_align_arg_pointer},
applicable to individual functions.
@item -mpreferred-stack-boundary=@var{num}
@@ -10748,6 +10823,12 @@ Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
byte boundary. If @option{-mpreferred-stack-boundary} is not specified,
the default is 4 (16 bytes or 128 bits).
+@item -mincoming-stack-boundary=@var{num}
+@opindex mincoming-stack-boundary
+Assume the incoming stack is aligned to a 2 raised to @var{num} byte
+boundary. If @option{-mincoming-stack-boundary} is not specified,
+the one specified by @option{-mpreferred-stack-boundary} will be used.
+
On Pentium and PentiumPro, @code{double} and @code{long double} values
should be aligned to an 8 byte boundary (see @option{-malign-double}) or
suffer significant run time performance penalties. On Pentium III, the
@@ -10783,6 +10864,8 @@ preferred alignment to @option{-mpreferred-stack-boundary=2}.
@itemx -mno-sse4.2
@itemx -msse4
@itemx -mno-sse4
+@itemx -mavx
+@itemx -mno-avx
@itemx -maes
@itemx -mno-aes
@itemx -mpclmul
@@ -10804,7 +10887,7 @@ preferred alignment to @option{-mpreferred-stack-boundary=2}.
@opindex m3dnow
@opindex mno-3dnow
These switches enable or disable the use of instructions in the MMX,
-SSE, SSE2, SSE3, SSSE3, SSE4.1, AES, PCLMUL, SSE4A, SSE5, ABM or
+SSE, SSE2, SSE3, SSSE3, SSE4.1, AVX, AES, PCLMUL, SSE4A, SSE5, ABM or
3DNow!@: extended instruction sets.
These extensions are also available as built-in functions: see
@ref{X86 Built-in Functions}, for details of the functions enabled and
@@ -10813,6 +10896,10 @@ disabled by these switches.
To have SSE/SSE2 instructions generated automatically from floating-point
code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
+GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
+generates new AVX instructions or AVX equivalence for all SSEx instructions
+when needed.
+
These options will enable GCC to use these extended instructions in
generated code, even without @option{-mfpmath=sse}. Applications which
perform runtime CPU detection must compile separate files for each
@@ -11959,7 +12046,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},
@@ -11971,6 +12058,7 @@ The processor names are:
@samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
@samp{loongson2e}, @samp{loongson2f},
@samp{m4k},
+@samp{octeon},
@samp{orion},
@samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
@samp{r4600}, @samp{r4650}, @samp{r6000}, @samp{r8000},
@@ -12061,6 +12149,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
@@ -12151,6 +12243,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
@@ -13013,7 +13118,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}.
@@ -15196,8 +15301,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 4b0c0b6fb7c..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{}
@@ -275,7 +279,7 @@ located in @file{tree-ssa.c} and is described by @code{pass_build_ssa}.
This pass scans the function for uses of @code{SSA_NAME}s that
are fed by default definition. For non-parameter variables, such
uses are uninitialized. The pass is run twice, before and after
-optimization. In the first pass we only warn for uses that are
+optimization (if turned on). In the first pass we only warn for uses that are
positively uninitialized; in the second pass we warn for uses that
are possibly uninitialized. The pass is located in @file{tree-ssa.c}
and is defined by @code{pass_early_warn_uninitialized} and
@@ -837,6 +841,28 @@ Global register allocation. This pass allocates hard registers for
the remaining pseudo registers (those whose life spans are not
contained in one basic block). The pass is located in @file{global.c}.
+@item
+The optional integrated register allocator (@acronym{IRA}). It can be
+used instead of the local and global allocator. It is called
+integrated because coalescing, register live range splitting, and hard
+register preferencing are done on-the-fly during coloring. It also
+has better integration with the reload pass. Pseudo-registers spilled
+by the allocator or the reload have still a chance to get
+hard-registers if the reload evicts some pseudo-registers from
+hard-registers. The allocator helps to choose better pseudos for
+spilling based on their live ranges and to coalesce stack slots
+allocated for the spilled pseudo-registers. IRA is a regional
+register allocator which is transformed into Chaitin-Briggs allocator
+if there is one region. By default, IRA chooses regions using
+register pressure but the user can force it to use one region or
+regions corresponding to all loops.
+
+Source files of the allocator are @file{ira.c}, @file{ira-build.c},
+@file{ira-costs.c}, @file{ira-conflicts.c}, @file{ira-color.c},
+@file{ira-emit.c}, @file{ira-lives}, plus header files @file{ira.h}
+and @file{ira-int.h} used for the communication between the allocator
+and the rest of the compiler and between the IRA files.
+
@cindex reloading
@item
Reloading. This pass renumbers pseudo registers with the hardware
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 274e69b9802..2cd0877601d 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -833,10 +833,9 @@ specified, 1 if @option{-O} is specified, and 0 if neither is specified.
@var{size} is nonzero if @option{-Os} is specified and zero otherwise.
-You should not use this macro to change options that are not
-machine-specific. These should uniformly selected by the same
-optimization level on all supported machines. Use this macro to enable
-machine-specific optimizations.
+This macro is run once at program startup and when the optimization
+options are changed via @code{#pragma GCC optimize} or by using the
+@code{optimize} attribute.
@strong{Do not examine @code{write_symbols} in
this macro!} The debugging options are not supposed to alter the
@@ -1085,6 +1084,12 @@ macro must evaluate to a value equal to or larger than
@code{STACK_BOUNDARY}.
@end defmac
+@defmac INCOMING_STACK_BOUNDARY
+Define this macro if the incoming stack boundary may be different
+from @code{PREFERRED_STACK_BOUNDARY}. This macro must evaluate
+to a value equal to or larger than @code{STACK_BOUNDARY}.
+@end defmac
+
@defmac FUNCTION_BOUNDARY
Alignment required for a function entry point, in bits.
@end defmac
@@ -1123,6 +1128,18 @@ field alignment has not been set by the
@code{__attribute__ ((aligned (@var{n})))} construct.
@end defmac
+@defmac MAX_STACK_ALIGNMENT
+Biggest stack alignment guaranteed by the backend. Use this macro
+to specify the maximum alignment of a variable on stack.
+
+If not defined, the default value is @code{STACK_BOUNDARY}.
+
+@c FIXME: The default should be @code{PREFERRED_STACK_BOUNDARY}.
+@c But the fix for PR 32893 indicates that we can only guarantee
+@c maximum stack alignment on stack up to @code{STACK_BOUNDARY}, not
+@c @code{PREFERRED_STACK_BOUNDARY}, if stack alignment isn't supported.
+@end defmac
+
@defmac MAX_OFILE_ALIGNMENT
Biggest alignment supported by the object file format of this machine.
Use this macro to limit the alignment which can be specified using the
@@ -1368,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
@@ -1471,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.
@@ -2099,6 +2026,18 @@ The macro body should not assume anything about the contents of
On most machines, it is not necessary to define this macro.
@end defmac
+@defmac IRA_HARD_REGNO_ADD_COST_MULTIPLIER (@var{regno})
+In some case register allocation order is not enough for the
+Integrated Register Allocator (@acronym{IRA}) to generate a good code.
+If this macro is defined, it should return a floating point value
+based on @var{regno}. The cost of using @var{regno} for a pseudo will
+be increased by approximately the pseudo's usage frequency times the
+value returned by this macro. Not defining this macro is equivalent
+to having it always return @code{0.0}.
+
+On most machines, it is not necessary to define this macro.
+@end defmac
+
@node Values in Registers
@subsection How Values Fit in Registers
@@ -2887,6 +2826,19 @@ as below:
@end smallexample
@end defmac
+@defmac IRA_COVER_CLASSES
+The macro defines cover classes for the Integrated Register Allocator
+(@acronym{IRA}). Cover classes are a set of non-intersecting register
+classes covering all hard registers used for register allocation
+purposes. Any move between two registers in the same cover class
+should be cheaper than load or store of the registers. The macro
+value should be the initializer for an array of register class values,
+with @code{LIM_REG_CLASSES} used as the end marker.
+
+You must define this macro in order to use the integrated register
+allocator for the target.
+@end defmac
+
@node Old Constraints
@section Obsolete Macros for Defining Constraints
@cindex defining constraints, obsolete method
@@ -3449,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
@@ -3491,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
@@ -3502,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
@@ -5907,9 +5874,14 @@ value to the result of that function. The arguments to that function
are the same as to this macro.
@end defmac
-@defmac BRANCH_COST
-A C expression for the cost of a branch instruction. A value of 1 is
-the default; other values are interpreted relative to that.
+@defmac BRANCH_COST (@var{speed_p}, @var{predictable_p})
+A C expression for the cost of a branch instruction. A value of 1 is the
+default; other values are interpreted relative to that. Parameter @var{speed_p}
+is true when the branch in question should be optimized for speed. When
+it is false, @code{BRANCH_COST} should be returning value optimal for code size
+rather then performance considerations. @var{predictable_p} is true for well
+predictable branches. On many architectures the @code{BRANCH_COST} can be
+reduced then.
@end defmac
Here are additional macros which do not specify precise relative costs,
@@ -10587,6 +10559,17 @@ call stack unwinding. It is used in declarations in @file{unwind-generic.h}
and the associated definitions of those functions.
@end defmac
+@deftypefn {Target Hook} void TARGET_UPDATE_STACK_BOUNDARY (void)
+Define this macro to update the current function stack boundary if
+necessary.
+@end deftypefn
+
+@deftypefn {Target Hook} rtx TARGET_GET_DRAP_RTX (void)
+Define this macro to an rtx for Dynamic Realign Argument Pointer if a
+different argument pointer register is needed to access the function's
+argument list when stack is aligned.
+@end deftypefn
+
@deftypefn {Target Hook} {bool} TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS (void)
When optimization is disabled, this hook indicates whether or not
arguments should be allocated to stack slots. Normally, GCC allocates
diff --git a/gcc/dojump.c b/gcc/dojump.c
index 43373481955..c22402a948d 100644
--- a/gcc/dojump.c
+++ b/gcc/dojump.c
@@ -34,6 +34,7 @@ along with GCC; see the file COPYING3. If not see
#include "optabs.h"
#include "langhooks.h"
#include "ggc.h"
+#include "basic-block.h"
static bool prefer_and_bit_test (enum machine_mode, int);
static void do_jump_by_parts_greater (tree, int, rtx, rtx);
@@ -71,8 +72,7 @@ clear_pending_stack_adjust (void)
{
if (optimize > 0
&& (! flag_omit_frame_pointer || cfun->calls_alloca)
- && EXIT_IGNORE_STACK
- && ! (DECL_INLINE (current_function_decl) && ! flag_no_inline))
+ && EXIT_IGNORE_STACK)
discard_pending_stack_adjust ();
}
@@ -305,8 +305,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 ();
@@ -513,9 +511,12 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label)
/* High branch cost, expand as the bitwise AND of the conditions.
Do the same if the RHS has side effects, because we're effectively
turning a TRUTH_AND_EXPR into a TRUTH_ANDIF_EXPR. */
- if (BRANCH_COST >= 4 || TREE_SIDE_EFFECTS (TREE_OPERAND (exp, 1)))
+ if (BRANCH_COST (optimize_insn_for_speed_p (),
+ false) >= 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 ();
@@ -533,9 +534,11 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label)
/* High branch cost, expand as the bitwise OR of the conditions.
Do the same if the RHS has side effects, because we're effectively
turning a TRUTH_OR_EXPR into a TRUTH_ORIF_EXPR. */
- if (BRANCH_COST >= 4 || TREE_SIDE_EFFECTS (TREE_OPERAND (exp, 1)))
+ if (BRANCH_COST (optimize_insn_for_speed_p (), false)>= 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/domwalk.c b/gcc/domwalk.c
index cec95a5f932..8f779225432 100644
--- a/gcc/domwalk.c
+++ b/gcc/domwalk.c
@@ -144,7 +144,7 @@ walk_dominator_tree (struct dom_walk_data *walk_data, basic_block bb)
{
void *bd = NULL;
basic_block dest;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
bool is_interesting;
basic_block *worklist = XNEWVEC (basic_block, n_basic_blocks * 2);
int sp = 0;
@@ -168,8 +168,8 @@ walk_dominator_tree (struct dom_walk_data *walk_data, basic_block bb)
{
bool recycled;
- /* First get some local data, reusing any local data pointer we may
- have saved. */
+ /* First get some local data, reusing any local data
+ pointer we may have saved. */
if (VEC_length (void_p, walk_data->free_block_data) > 0)
{
bd = VEC_pop (void_p, walk_data->free_block_data);
@@ -199,13 +199,14 @@ walk_dominator_tree (struct dom_walk_data *walk_data, basic_block bb)
if (is_interesting && walk_data->before_dom_children_walk_stmts)
{
if (walk_data->walk_stmts_backward)
- for (bsi = bsi_last (bb); !bsi_end_p (bsi); bsi_prev (&bsi))
+ for (gsi = gsi_last (bb_seq (bb)); !gsi_end_p (gsi);
+ gsi_prev (&gsi))
(*walk_data->before_dom_children_walk_stmts) (walk_data, bb,
- bsi);
+ gsi);
else
- 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))
(*walk_data->before_dom_children_walk_stmts) (walk_data, bb,
- bsi);
+ gsi);
}
/* Callback for operations to execute before we have walked the
@@ -239,13 +240,14 @@ walk_dominator_tree (struct dom_walk_data *walk_data, basic_block bb)
if (is_interesting && walk_data->after_dom_children_walk_stmts)
{
if (walk_data->walk_stmts_backward)
- for (bsi = bsi_last (bb); !bsi_end_p (bsi); bsi_prev (&bsi))
+ for (gsi = gsi_last (bb_seq (bb)); !gsi_end_p (gsi);
+ gsi_prev (&gsi))
(*walk_data->after_dom_children_walk_stmts) (walk_data, bb,
- bsi);
+ gsi);
else
- 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))
(*walk_data->after_dom_children_walk_stmts) (walk_data, bb,
- bsi);
+ gsi);
}
/* Callback for operations to execute after we have walked the
diff --git a/gcc/domwalk.h b/gcc/domwalk.h
index 3fc6810207e..61117ef7d45 100644
--- a/gcc/domwalk.h
+++ b/gcc/domwalk.h
@@ -66,7 +66,7 @@ struct dom_walk_data
/* Function to call to walk statements before the recursive walk
of the dominator children. */
void (*before_dom_children_walk_stmts) (struct dom_walk_data *,
- basic_block, block_stmt_iterator);
+ basic_block, gimple_stmt_iterator);
/* Function to call after the statement walk occurring before the
recursive walk of the dominator children. */
@@ -81,7 +81,7 @@ struct dom_walk_data
/* Function to call to walk statements after the recursive walk
of the dominator children. */
void (*after_dom_children_walk_stmts) (struct dom_walk_data *,
- basic_block, block_stmt_iterator);
+ basic_block, gimple_stmt_iterator);
/* Function to call after the statement walk occurring after the
recursive walk of the dominator children.
diff --git a/gcc/dse.c b/gcc/dse.c
index 4d5120160fa..99233266377 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -783,10 +783,9 @@ replace_inc_dec (rtx *r, void *d)
{
rtx r1 = XEXP (x, 0);
rtx c = gen_int_mode (Pmode, data->size);
- add_insn_before (data->insn,
- gen_rtx_SET (Pmode, r1,
- gen_rtx_PLUS (Pmode, r1, c)),
- NULL);
+ emit_insn_before (gen_rtx_SET (Pmode, r1,
+ gen_rtx_PLUS (Pmode, r1, c)),
+ data->insn);
return -1;
}
@@ -795,10 +794,9 @@ replace_inc_dec (rtx *r, void *d)
{
rtx r1 = XEXP (x, 0);
rtx c = gen_int_mode (Pmode, -data->size);
- add_insn_before (data->insn,
- gen_rtx_SET (Pmode, r1,
- gen_rtx_PLUS (Pmode, r1, c)),
- NULL);
+ emit_insn_before (gen_rtx_SET (Pmode, r1,
+ gen_rtx_PLUS (Pmode, r1, c)),
+ data->insn);
return -1;
}
@@ -809,8 +807,7 @@ replace_inc_dec (rtx *r, void *d)
insn that contained it. */
rtx add = XEXP (x, 0);
rtx r1 = XEXP (add, 0);
- add_insn_before (data->insn,
- gen_rtx_SET (Pmode, r1, add), NULL);
+ emit_insn_before (gen_rtx_SET (Pmode, r1, add), data->insn);
return -1;
}
@@ -827,12 +824,12 @@ static int
replace_inc_dec_mem (rtx *r, void *d)
{
rtx x = *r;
- if (GET_CODE (x) == MEM)
+ if (x != NULL_RTX && MEM_P (x))
{
struct insn_size data;
data.size = GET_MODE_SIZE (GET_MODE (x));
- data.insn = (rtx)d;
+ data.insn = (rtx) d;
for_each_rtx (&XEXP (x, 0), replace_inc_dec, &data);
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 c3cb97383b1..567fc7ad957 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)
@@ -239,9 +265,18 @@ typedef struct dw_fde_struct GTY(())
bool dw_fde_switched_sections;
dw_cfi_ref dw_fde_cfi;
unsigned funcdef_number;
+ HOST_WIDE_INT stack_realignment;
+ /* Dynamic realign argument pointer register. */
+ unsigned int drap_reg;
+ /* Virtual dynamic realign argument pointer register. */
+ unsigned int vdrap_reg;
unsigned all_throwers_are_sibcalls : 1;
unsigned nothrow : 1;
unsigned uses_eh_lsda : 1;
+ /* Whether we did stack realign in this call frame. */
+ unsigned stack_realign : 1;
+ /* Whether dynamic realign argument pointer register has been saved. */
+ unsigned drap_reg_saved: 1;
}
dw_fde_node;
@@ -375,19 +410,24 @@ 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);
+static void dwarf2out_args_size_adjust (HOST_WIDE_INT, const char *);
static void flush_queued_reg_saves (void);
static bool clobbers_queued_reg_save (const_rtx);
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
(dw_cfa_location *, HOST_WIDE_INT);
+static struct dw_loc_descr_struct *build_cfa_aligned_loc
+ (HOST_WIDE_INT, HOST_WIDE_INT);
static void def_cfa_1 (const char *, dw_cfa_location *);
/* How to start an assembler comment. */
@@ -621,6 +661,23 @@ static inline void
add_cfi (dw_cfi_ref *list_head, dw_cfi_ref cfi)
{
dw_cfi_ref *p;
+ dw_fde_ref fde = current_fde ();
+
+ /* When DRAP is used, CFA is defined with an expression. Redefine
+ CFA may lead to a different CFA value. */
+ if (fde && fde->drap_reg != INVALID_REGNUM)
+ switch (cfi->dw_cfi_opc)
+ {
+ case DW_CFA_def_cfa_register:
+ case DW_CFA_def_cfa_offset:
+ case DW_CFA_def_cfa_offset_sf:
+ case DW_CFA_def_cfa:
+ case DW_CFA_def_cfa_sf:
+ gcc_unreachable ();
+
+ default:
+ break;
+ }
/* Find the end of the chain. */
for (p = list_head; (*p) != NULL; p = &(*p)->dw_cfi_next)
@@ -636,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;
}
@@ -647,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 ();
@@ -676,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. */
@@ -691,23 +776,16 @@ lookup_cfa_1 (dw_cfi_ref cfi, dw_cfa_location *loc)
switch (cfi->dw_cfi_opc)
{
case DW_CFA_def_cfa_offset:
- loc->offset = cfi->dw_cfi_oprnd1.dw_cfi_offset;
- break;
case DW_CFA_def_cfa_offset_sf:
- loc->offset
- = cfi->dw_cfi_oprnd1.dw_cfi_offset * DWARF_CIE_DATA_ALIGNMENT;
+ loc->offset = cfi->dw_cfi_oprnd1.dw_cfi_offset;
break;
case DW_CFA_def_cfa_register:
loc->reg = cfi->dw_cfi_oprnd1.dw_cfi_reg_num;
break;
case DW_CFA_def_cfa:
- loc->reg = cfi->dw_cfi_oprnd1.dw_cfi_reg_num;
- loc->offset = cfi->dw_cfi_oprnd2.dw_cfi_offset;
- break;
case DW_CFA_def_cfa_sf:
loc->reg = cfi->dw_cfi_oprnd1.dw_cfi_reg_num;
- loc->offset
- = cfi->dw_cfi_oprnd2.dw_cfi_offset * DWARF_CIE_DATA_ALIGNMENT;
+ loc->offset = cfi->dw_cfi_oprnd2.dw_cfi_offset;
break;
case DW_CFA_def_cfa_expression:
get_cfa_from_loc_descr (loc, cfi->dw_cfi_oprnd1.dw_cfi_loc);
@@ -806,20 +884,14 @@ def_cfa_1 (const char *label, dw_cfa_location *loc_p)
if (loc.reg == old_cfa.reg && !loc.indirect)
{
/* Construct a "DW_CFA_def_cfa_offset <offset>" instruction, indicating
- the CFA register did not change but the offset did. */
+ the CFA register did not change but the offset did. The data
+ factoring for DW_CFA_def_cfa_offset_sf happens in output_cfi, or
+ in the assembler via the .cfi_def_cfa_offset directive. */
if (loc.offset < 0)
- {
- HOST_WIDE_INT f_offset = loc.offset / DWARF_CIE_DATA_ALIGNMENT;
- gcc_assert (f_offset * DWARF_CIE_DATA_ALIGNMENT == loc.offset);
-
- cfi->dw_cfi_opc = DW_CFA_def_cfa_offset_sf;
- cfi->dw_cfi_oprnd1.dw_cfi_offset = f_offset;
- }
+ cfi->dw_cfi_opc = DW_CFA_def_cfa_offset_sf;
else
- {
- cfi->dw_cfi_opc = DW_CFA_def_cfa_offset;
- cfi->dw_cfi_oprnd1.dw_cfi_offset = loc.offset;
- }
+ cfi->dw_cfi_opc = DW_CFA_def_cfa_offset;
+ cfi->dw_cfi_oprnd1.dw_cfi_offset = loc.offset;
}
#ifndef MIPS_DEBUGGING_INFO /* SGI dbx thinks this means no offset. */
@@ -839,22 +911,15 @@ def_cfa_1 (const char *label, dw_cfa_location *loc_p)
{
/* Construct a "DW_CFA_def_cfa <register> <offset>" instruction,
indicating the CFA register has changed to <register> with
- the specified offset. */
+ the specified offset. The data factoring for DW_CFA_def_cfa_sf
+ happens in output_cfi, or in the assembler via the .cfi_def_cfa
+ directive. */
if (loc.offset < 0)
- {
- HOST_WIDE_INT f_offset = loc.offset / DWARF_CIE_DATA_ALIGNMENT;
- gcc_assert (f_offset * DWARF_CIE_DATA_ALIGNMENT == loc.offset);
-
- cfi->dw_cfi_opc = DW_CFA_def_cfa_sf;
- cfi->dw_cfi_oprnd1.dw_cfi_reg_num = loc.reg;
- cfi->dw_cfi_oprnd2.dw_cfi_offset = f_offset;
- }
+ cfi->dw_cfi_opc = DW_CFA_def_cfa_sf;
else
- {
- cfi->dw_cfi_opc = DW_CFA_def_cfa;
- cfi->dw_cfi_oprnd1.dw_cfi_reg_num = loc.reg;
- cfi->dw_cfi_oprnd2.dw_cfi_offset = loc.offset;
- }
+ cfi->dw_cfi_opc = DW_CFA_def_cfa;
+ cfi->dw_cfi_oprnd1.dw_cfi_reg_num = loc.reg;
+ cfi->dw_cfi_oprnd2.dw_cfi_offset = loc.offset;
}
else
{
@@ -880,33 +945,29 @@ static void
reg_save (const char *label, unsigned int reg, unsigned int sreg, HOST_WIDE_INT offset)
{
dw_cfi_ref cfi = new_cfi ();
+ dw_fde_ref fde = current_fde ();
cfi->dw_cfi_oprnd1.dw_cfi_reg_num = reg;
- if (sreg == INVALID_REGNUM)
+ /* When stack is aligned, store REG using DW_CFA_expression with
+ FP. */
+ if (fde
+ && fde->stack_realign
+ && sreg == INVALID_REGNUM)
+ {
+ cfi->dw_cfi_opc = DW_CFA_expression;
+ cfi->dw_cfi_oprnd2.dw_cfi_reg_num = reg;
+ cfi->dw_cfi_oprnd1.dw_cfi_loc
+ = build_cfa_aligned_loc (offset, fde->stack_realignment);
+ }
+ else if (sreg == INVALID_REGNUM)
{
- if (reg & ~0x3f)
- /* The register number won't fit in 6 bits, so we have to use
- the long form. */
+ if (offset < 0)
+ cfi->dw_cfi_opc = DW_CFA_offset_extended_sf;
+ else if (reg & ~0x3f)
cfi->dw_cfi_opc = DW_CFA_offset_extended;
else
cfi->dw_cfi_opc = DW_CFA_offset;
-
-#ifdef ENABLE_CHECKING
- {
- /* If we get an offset that is not a multiple of
- DWARF_CIE_DATA_ALIGNMENT, there is either a bug in the
- definition of DWARF_CIE_DATA_ALIGNMENT, or a bug in the machine
- description. */
- HOST_WIDE_INT check_offset = offset / DWARF_CIE_DATA_ALIGNMENT;
-
- gcc_assert (check_offset * DWARF_CIE_DATA_ALIGNMENT == offset);
- }
-#endif
- offset /= DWARF_CIE_DATA_ALIGNMENT;
- if (offset < 0)
- cfi->dw_cfi_opc = DW_CFA_offset_extended_sf;
-
cfi->dw_cfi_oprnd2.dw_cfi_offset = offset;
}
else if (sreg == reg)
@@ -1115,6 +1176,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. */
@@ -1159,13 +1382,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)
@@ -1185,9 +1417,21 @@ dwarf2out_stack_adjust (rtx insn, bool after_p)
if (offset == 0)
return;
+ label = dwarf2out_cfi_label ();
+ dwarf2out_args_size_adjust (offset, label);
+}
+
+/* Adjust args_size based on stack adjustment OFFSET. */
+
+static void
+dwarf2out_args_size_adjust (HOST_WIDE_INT offset, const char *label)
+{
if (cfa.reg == STACK_POINTER_REGNUM)
cfa.offset += offset;
+ if (cfa_store.reg == STACK_POINTER_REGNUM)
+ cfa_store.offset += offset;
+
#ifndef STACK_GROWS_DOWNWARD
offset = -offset;
#endif
@@ -1196,7 +1440,6 @@ dwarf2out_stack_adjust (rtx insn, bool after_p)
if (args_size < 0)
args_size = 0;
- label = dwarf2out_cfi_label ();
def_cfa_1 (label, &cfa);
if (flag_asynchronous_unwind_tables)
dwarf2out_args_size (label, args_size);
@@ -1445,6 +1688,11 @@ static dw_cfa_location cfa_temp;
difference of the original location and cfa_store's
location (or cfa_temp's location if cfa_temp is used).
+ Rules 16-20: If AND operation happens on sp in prologue, we assume
+ stack is realigned. We will use a group of DW_OP_XXX
+ expressions to represent the location of the stored
+ register instead of CFA+offset.
+
The Rules
"{a,b}" indicates a choice of a xor b.
@@ -1538,13 +1786,48 @@ static dw_cfa_location cfa_temp;
Rule 15:
(set <reg> {unspec, unspec_volatile})
- effects: target-dependent */
+ effects: target-dependent
+
+ Rule 16:
+ (set sp (and: sp <const_int>))
+ constraints: cfa_store.reg == sp
+ effects: current_fde.stack_realign = 1
+ cfa_store.offset = 0
+ fde->drap_reg = cfa.reg if cfa.reg != sp and cfa.reg != fp
+
+ Rule 17:
+ (set (mem ({pre_inc, pre_dec} sp)) (mem (plus (cfa.reg) (const_int))))
+ effects: cfa_store.offset += -/+ mode_size(mem)
+
+ Rule 18:
+ (set (mem ({pre_inc, pre_dec} sp)) fp)
+ constraints: fde->stack_realign == 1
+ effects: cfa_store.offset = 0
+ cfa.reg != HARD_FRAME_POINTER_REGNUM
+
+ Rule 19:
+ (set (mem ({pre_inc, pre_dec} sp)) cfa.reg)
+ constraints: fde->stack_realign == 1
+ && cfa.offset == 0
+ && cfa.indirect == 0
+ && cfa.reg != HARD_FRAME_POINTER_REGNUM
+ effects: Use DW_CFA_def_cfa_expression to define cfa
+ cfa.reg == fde->drap_reg
+
+ Rule 20:
+ (set reg fde->drap_reg)
+ constraints: fde->vdrap_reg == INVALID_REGNUM
+ effects: fde->vdrap_reg = reg.
+ (set mem fde->drap_reg)
+ constraints: fde->drap_reg_saved == 1
+ effects: none. */
static void
dwarf2out_frame_debug_expr (rtx expr, const char *label)
{
rtx src, dest, span;
HOST_WIDE_INT offset;
+ dw_fde_ref fde;
/* If RTX_FRAME_RELATED_P is set on a PARALLEL, process each member of
the PARALLEL independently. The first element is always processed if
@@ -1588,22 +1871,7 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label)
HOST_WIDE_INT offset = stack_adjust_offset (elem);
if (offset != 0)
- {
- if (cfa.reg == STACK_POINTER_REGNUM)
- cfa.offset += offset;
-
-#ifndef STACK_GROWS_DOWNWARD
- offset = -offset;
-#endif
-
- args_size += offset;
- if (args_size < 0)
- args_size = 0;
-
- def_cfa_1 (label, &cfa);
- if (flag_asynchronous_unwind_tables)
- dwarf2out_args_size (label, args_size);
- }
+ dwarf2out_args_size_adjust (offset, label);
}
}
return;
@@ -1621,6 +1889,26 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label)
src = rsi;
}
+ fde = current_fde ();
+
+ if (GET_CODE (src) == REG
+ && fde
+ && fde->drap_reg == REGNO (src)
+ && (fde->drap_reg_saved
+ || GET_CODE (dest) == REG))
+ {
+ /* Rule 20 */
+ /* If we are saving dynamic realign argument pointer to a
+ register, the destination is virtual dynamic realign
+ argument pointer. It may be used to access argument. */
+ if (GET_CODE (dest) == REG)
+ {
+ gcc_assert (fde->vdrap_reg == INVALID_REGNUM);
+ fde->vdrap_reg = REGNO (dest);
+ }
+ return;
+ }
+
switch (GET_CODE (dest))
{
case REG:
@@ -1649,7 +1937,19 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label)
/* For the SPARC and its register window. */
|| (DWARF_FRAME_REGNUM (REGNO (src))
== DWARF_FRAME_RETURN_COLUMN));
- queue_reg_save (label, src, dest, 0);
+
+ /* After stack is aligned, we can only save SP in FP
+ if drap register is used. In this case, we have
+ to restore stack pointer with the CFA value and we
+ don't generate this DWARF information. */
+ if (fde
+ && fde->stack_realign
+ && REGNO (src) == STACK_POINTER_REGNUM)
+ gcc_assert (REGNO (dest) == HARD_FRAME_POINTER_REGNUM
+ && fde->drap_reg != INVALID_REGNUM
+ && cfa.reg != REGNO (src));
+ else
+ queue_reg_save (label, src, dest, 0);
}
break;
@@ -1782,6 +2082,24 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label)
targetm.dwarf_handle_frame_unspec (label, expr, XINT (src, 1));
return;
+ /* Rule 16 */
+ case AND:
+ /* If this AND operation happens on stack pointer in prologue,
+ we assume the stack is realigned and we extract the
+ alignment. */
+ if (fde && XEXP (src, 0) == stack_pointer_rtx)
+ {
+ gcc_assert (cfa_store.reg == REGNO (XEXP (src, 0)));
+ fde->stack_realign = 1;
+ fde->stack_realignment = INTVAL (XEXP (src, 1));
+ cfa_store.offset = 0;
+
+ if (cfa.reg != STACK_POINTER_REGNUM
+ && cfa.reg != HARD_FRAME_POINTER_REGNUM)
+ fde->drap_reg = cfa.reg;
+ }
+ return;
+
default:
gcc_unreachable ();
}
@@ -1790,7 +2108,6 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label)
break;
case MEM:
- gcc_assert (REG_P (src));
/* Saving a register to the stack. Make sure dest is relative to the
CFA register. */
@@ -1821,10 +2138,23 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label)
if (GET_CODE (XEXP (dest, 0)) == PRE_INC)
offset = -offset;
- gcc_assert (REGNO (XEXP (XEXP (dest, 0), 0)) == STACK_POINTER_REGNUM
+ gcc_assert ((REGNO (XEXP (XEXP (dest, 0), 0))
+ == STACK_POINTER_REGNUM)
&& cfa_store.reg == STACK_POINTER_REGNUM);
cfa_store.offset += offset;
+
+ /* Rule 18: If stack is aligned, we will use FP as a
+ reference to represent the address of the stored
+ regiser. */
+ if (fde
+ && fde->stack_realign
+ && src == hard_frame_pointer_rtx)
+ {
+ gcc_assert (cfa.reg != HARD_FRAME_POINTER_REGNUM);
+ cfa_store.offset = 0;
+ }
+
if (cfa.reg == STACK_POINTER_REGNUM)
cfa.offset = cfa_store.offset;
@@ -1885,6 +2215,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)
@@ -1893,6 +2230,32 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label)
if (cfa.offset == 0)
{
+ /* Rule 19 */
+ /* If stack is aligned, putting CFA reg into stack means
+ we can no longer use reg + offset to represent CFA.
+ Here we use DW_CFA_def_cfa_expression instead. The
+ result of this expression equals to the original CFA
+ value. */
+ if (fde
+ && fde->stack_realign
+ && cfa.indirect == 0
+ && cfa.reg != HARD_FRAME_POINTER_REGNUM)
+ {
+ dw_cfa_location cfa_exp;
+
+ gcc_assert (fde->drap_reg == cfa.reg);
+
+ cfa_exp.indirect = 1;
+ cfa_exp.reg = HARD_FRAME_POINTER_REGNUM;
+ cfa_exp.base_offset = offset;
+ cfa_exp.offset = 0;
+
+ fde->drap_reg_saved = 1;
+
+ def_cfa_1 (label, &cfa_exp);
+ break;
+ }
+
/* If the source register is exactly the CFA, assume
we're saving SP like any other register; this happens
on the ARM. */
@@ -1988,6 +2351,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;
}
@@ -2141,12 +2510,24 @@ switch_to_eh_frame_section (void)
}
}
+/* Divide OFF by DWARF_CIE_DATA_ALIGNMENT, asserting no remainder. */
+
+static HOST_WIDE_INT
+div_data_align (HOST_WIDE_INT off)
+{
+ HOST_WIDE_INT r = off / DWARF_CIE_DATA_ALIGNMENT;
+ gcc_assert (r * DWARF_CIE_DATA_ALIGNMENT == off);
+ return r;
+}
+
/* Output a Call Frame Information opcode and its operand(s). */
static void
output_cfi (dw_cfi_ref cfi, dw_fde_ref fde, int for_eh)
{
unsigned long r;
+ HOST_WIDE_INT off;
+
if (cfi->dw_cfi_opc == DW_CFA_advance_loc)
dw2_asm_output_data (1, (cfi->dw_cfi_opc
| (cfi->dw_cfi_oprnd1.dw_cfi_offset & 0x3f)),
@@ -2158,7 +2539,8 @@ output_cfi (dw_cfi_ref cfi, dw_fde_ref fde, int for_eh)
r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, for_eh);
dw2_asm_output_data (1, (cfi->dw_cfi_opc | (r & 0x3f)),
"DW_CFA_offset, column 0x%lx", r);
- dw2_asm_output_data_uleb128 (cfi->dw_cfi_oprnd2.dw_cfi_offset, NULL);
+ off = div_data_align (cfi->dw_cfi_oprnd2.dw_cfi_offset);
+ dw2_asm_output_data_uleb128 (off, NULL);
}
else if (cfi->dw_cfi_opc == DW_CFA_restore)
{
@@ -2210,6 +2592,12 @@ output_cfi (dw_cfi_ref cfi, dw_fde_ref fde, int for_eh)
break;
case DW_CFA_offset_extended:
+ r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, for_eh);
+ dw2_asm_output_data_uleb128 (r, NULL);
+ off = div_data_align (cfi->dw_cfi_oprnd2.dw_cfi_offset);
+ dw2_asm_output_data_uleb128 (off, NULL);
+ break;
+
case DW_CFA_def_cfa:
r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, for_eh);
dw2_asm_output_data_uleb128 (r, NULL);
@@ -2217,10 +2605,17 @@ output_cfi (dw_cfi_ref cfi, dw_fde_ref fde, int for_eh)
break;
case DW_CFA_offset_extended_sf:
+ r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, for_eh);
+ dw2_asm_output_data_uleb128 (r, NULL);
+ off = div_data_align (cfi->dw_cfi_oprnd2.dw_cfi_offset);
+ dw2_asm_output_data_sleb128 (off, NULL);
+ break;
+
case DW_CFA_def_cfa_sf:
r = DWARF2_FRAME_REG_OUT (cfi->dw_cfi_oprnd1.dw_cfi_reg_num, for_eh);
dw2_asm_output_data_uleb128 (r, NULL);
- dw2_asm_output_data_sleb128 (cfi->dw_cfi_oprnd2.dw_cfi_offset, NULL);
+ off = div_data_align (cfi->dw_cfi_oprnd2.dw_cfi_offset);
+ dw2_asm_output_data_sleb128 (off, NULL);
break;
case DW_CFA_restore_extended:
@@ -2244,7 +2639,8 @@ output_cfi (dw_cfi_ref cfi, dw_fde_ref fde, int for_eh)
break;
case DW_CFA_def_cfa_offset_sf:
- dw2_asm_output_data_sleb128 (cfi->dw_cfi_oprnd1.dw_cfi_offset, NULL);
+ off = div_data_align (cfi->dw_cfi_oprnd1.dw_cfi_offset);
+ dw2_asm_output_data_sleb128 (off, NULL);
break;
case DW_CFA_GNU_window_save:
@@ -2265,6 +2661,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);
+ 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. */
@@ -2288,6 +2778,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
@@ -2693,6 +3187,8 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED,
fde->nothrow = TREE_NOTHROW (current_function_decl);
fde->uses_eh_lsda = crtl->uses_eh_lsda;
fde->all_throwers_are_sibcalls = crtl->all_throwers_are_sibcalls;
+ fde->drap_reg = INVALID_REGNUM;
+ fde->vdrap_reg = INVALID_REGNUM;
args_size = old_args_size = 0;
@@ -2702,6 +3198,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
@@ -2715,6 +3254,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,
@@ -2921,14 +3463,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 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);
+static dw_loc_descr_ref int_loc_descriptor (HOST_WIDE_INT);
/* Convert a DWARF stack opcode into its string name. */
@@ -3264,6 +3799,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
@@ -3574,6 +4128,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. */
@@ -3583,6 +4272,9 @@ output_cfa_loc (dw_cfi_ref cfi)
dw_loc_descr_ref loc;
unsigned long size;
+ if (cfi->dw_cfi_opc == DW_CFA_expression)
+ dw2_asm_output_data (1, cfi->dw_cfi_oprnd2.dw_cfi_reg_num, NULL);
+
/* Output the size of the block. */
loc = cfi->dw_cfi_oprnd1.dw_cfi_loc;
size = size_of_locs (loc);
@@ -3592,6 +4284,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. */
@@ -3605,18 +4318,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);
@@ -3627,18 +4329,34 @@ build_cfa_loc (dw_cfa_location *cfa, HOST_WIDE_INT offset)
}
}
else
+ head = new_reg_loc_descr (cfa->reg, offset);
+
+ return head;
+}
+
+/* This function builds a dwarf location descriptor sequence for
+ the address at OFFSET from the CFA when stack is aligned to
+ ALIGNMENT byte. */
+
+static struct dw_loc_descr_struct *
+build_cfa_aligned_loc (HOST_WIDE_INT offset, HOST_WIDE_INT alignment)
+{
+ struct dw_loc_descr_struct *head;
+ unsigned int dwarf_fp
+ = DWARF_FRAME_REGNUM (HARD_FRAME_POINTER_REGNUM);
+
+ /* When CFA is defined as FP+OFFSET, emulate stack alignment. */
+ if (cfa.reg == HARD_FRAME_POINTER_REGNUM && cfa.indirect == 0)
{
- 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 (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
+ head = new_reg_loc_descr (dwarf_fp, offset);
return head;
}
@@ -3767,7 +4485,7 @@ static void dwarf2out_end_block (unsigned, unsigned);
static bool dwarf2out_ignore_block (const_tree);
static void dwarf2out_global_decl (tree);
static void dwarf2out_type_decl (tree, int);
-static void dwarf2out_imported_module_or_decl (tree, tree);
+static void dwarf2out_imported_module_or_decl (tree, tree, tree, bool);
static void dwarf2out_abstract_function (tree);
static void dwarf2out_var_location (rtx);
static void dwarf2out_begin_function (tree);
@@ -4310,7 +5028,6 @@ static dw_loc_descr_ref one_reg_loc_descriptor (unsigned int,
enum var_init_status);
static dw_loc_descr_ref multiple_reg_loc_descriptor (rtx, rtx,
enum var_init_status);
-static dw_loc_descr_ref int_loc_descriptor (HOST_WIDE_INT);
static dw_loc_descr_ref based_loc_descr (rtx, HOST_WIDE_INT,
enum var_init_status);
static int is_based_loc (const_rtx);
@@ -4376,6 +5093,7 @@ static void gen_unspecified_parameters_die (tree, dw_die_ref);
static void gen_formal_types_die (tree, dw_die_ref);
static void gen_subprogram_die (tree, dw_die_ref);
static void gen_variable_die (tree, dw_die_ref);
+static void gen_const_die (tree, dw_die_ref);
static void gen_label_die (tree, dw_die_ref);
static void gen_lexical_block_die (tree, dw_die_ref, int);
static void gen_inlined_subroutine_die (tree, dw_die_ref, int);
@@ -4398,7 +5116,7 @@ static void gen_decl_die (tree, dw_die_ref);
static dw_die_ref force_decl_die (tree);
static dw_die_ref force_type_die (tree);
static dw_die_ref setup_namespace_context (tree, dw_die_ref);
-static void declare_in_namespace (tree, dw_die_ref);
+static dw_die_ref declare_in_namespace (tree, dw_die_ref);
static struct dwarf_file_data * lookup_filename (const char *);
static void retry_incomplete_types (void);
static void gen_type_die_for_member (tree, tree, dw_die_ref);
@@ -6479,7 +7197,8 @@ is_symbol_die (dw_die_ref c)
return (is_type_die (c)
|| (get_AT (c, DW_AT_declaration)
&& !get_AT (c, DW_AT_specification))
- || c->die_tag == DW_TAG_namespace);
+ || c->die_tag == DW_TAG_namespace
+ || c->die_tag == DW_TAG_module);
}
static char *
@@ -6846,8 +7565,10 @@ size_of_die (dw_die_ref die)
size += 1 + 2*HOST_BITS_PER_LONG/HOST_BITS_PER_CHAR; /* block */
break;
case dw_val_class_vec:
- size += 1 + (a->dw_attr_val.v.val_vec.length
- * a->dw_attr_val.v.val_vec.elt_size); /* block */
+ size += constant_size (a->dw_attr_val.v.val_vec.length
+ * a->dw_attr_val.v.val_vec.elt_size)
+ + a->dw_attr_val.v.val_vec.length
+ * a->dw_attr_val.v.val_vec.elt_size; /* block */
break;
case dw_val_class_flag:
size += 1;
@@ -7046,7 +7767,18 @@ value_format (dw_attr_ref a)
case dw_val_class_long_long:
return DW_FORM_block1;
case dw_val_class_vec:
- return DW_FORM_block1;
+ switch (constant_size (a->dw_attr_val.v.val_vec.length
+ * a->dw_attr_val.v.val_vec.elt_size))
+ {
+ case 1:
+ return DW_FORM_block1;
+ case 2:
+ return DW_FORM_block2;
+ case 4:
+ return DW_FORM_block4;
+ default:
+ gcc_unreachable ();
+ }
case dw_val_class_flag:
return DW_FORM_flag;
case dw_val_class_die_ref:
@@ -7338,7 +8070,8 @@ output_die (dw_die_ref die)
unsigned int i;
unsigned char *p;
- dw2_asm_output_data (1, len * elt_size, "%s", name);
+ dw2_asm_output_data (constant_size (len * elt_size),
+ len * elt_size, "%s", name);
if (elt_size > sizeof (HOST_WIDE_INT))
{
elt_size /= 2;
@@ -8635,7 +9368,8 @@ is_subrange_type (const_tree type)
return false;
if (TREE_CODE (subtype) != INTEGER_TYPE
- && TREE_CODE (subtype) != ENUMERAL_TYPE)
+ && TREE_CODE (subtype) != ENUMERAL_TYPE
+ && TREE_CODE (subtype) != BOOLEAN_TYPE)
return false;
if (TREE_CODE (type) == TREE_CODE (subtype)
@@ -8920,11 +9654,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));
@@ -8997,6 +9727,10 @@ multiple_reg_loc_descriptor (rtx rtl, rtx regs,
return loc_result;
}
+#endif /* DWARF2_DEBUGGING_INFO */
+
+#if defined (DWARF2_DEBUGGING_INFO) || defined (DWARF2_UNWIND_INFO)
+
/* Return a location descriptor that designates a constant. */
static dw_loc_descr_ref
@@ -9035,6 +9769,9 @@ int_loc_descriptor (HOST_WIDE_INT i)
return new_loc_descr (op, i, 0);
}
+#endif
+
+#ifdef DWARF2_DEBUGGING_INFO
/* Return a location descriptor that designates a base+offset location. */
@@ -9044,6 +9781,7 @@ based_loc_descr (rtx reg, HOST_WIDE_INT offset,
{
unsigned int regno;
dw_loc_descr_ref result;
+ dw_fde_ref fde = current_fde ();
/* We only use "frame base" when we're sure we're talking about the
post-prologue local stack frame. We do this by *not* running
@@ -9060,13 +9798,41 @@ based_loc_descr (rtx reg, HOST_WIDE_INT offset,
offset += INTVAL (XEXP (elim, 1));
elim = XEXP (elim, 0);
}
- gcc_assert (elim == (frame_pointer_needed ? hard_frame_pointer_rtx
- : stack_pointer_rtx));
- offset += frame_pointer_fb_offset;
+ gcc_assert ((SUPPORTS_STACK_ALIGNMENT
+ && (elim == hard_frame_pointer_rtx
+ || elim == stack_pointer_rtx))
+ || elim == (frame_pointer_needed
+ ? hard_frame_pointer_rtx
+ : stack_pointer_rtx));
+
+ /* If drap register is used to align stack, use frame
+ pointer + offset to access stack variables. If stack
+ is aligned without drap, use stack pointer + offset to
+ access stack variables. */
+ if (crtl->stack_realign_tried
+ && cfa.reg == HARD_FRAME_POINTER_REGNUM
+ && reg == frame_pointer_rtx)
+ {
+ int base_reg
+ = DWARF_FRAME_REGNUM (cfa.indirect
+ ? HARD_FRAME_POINTER_REGNUM
+ : STACK_POINTER_REGNUM);
+ return new_reg_loc_descr (base_reg, offset);
+ }
+ offset += frame_pointer_fb_offset;
return new_loc_descr (DW_OP_fbreg, offset, 0);
}
}
+ else if (fde
+ && fde->drap_reg != INVALID_REGNUM
+ && (fde->drap_reg == REGNO (reg)
+ || fde->vdrap_reg == REGNO (reg)))
+ {
+ /* Use cfa+offset to represent the location of arguments passed
+ on stack when drap is used to align stack. */
+ return new_loc_descr (DW_OP_fbreg, offset, 0);
+ }
regno = dbx_reg_number (reg);
if (regno <= 31)
@@ -9636,9 +10402,8 @@ loc_descriptor_from_tree_1 (tree loc, int want_address)
CASE_CONVERT:
case VIEW_CONVERT_EXPR:
case SAVE_EXPR:
- case GIMPLE_MODIFY_STMT:
- return loc_descriptor_from_tree_1 (GENERIC_TREE_OPERAND (loc, 0),
- want_address);
+ case MODIFY_EXPR:
+ return loc_descriptor_from_tree_1 (TREE_OPERAND (loc, 0), want_address);
case COMPONENT_REF:
case BIT_FIELD_REF:
@@ -10442,14 +11207,12 @@ static tree
reference_to_unused (tree * tp, int * walk_subtrees,
void * data ATTRIBUTE_UNUSED)
{
- if (! EXPR_P (*tp) && ! GIMPLE_STMT_P (*tp) && ! CONSTANT_CLASS_P (*tp))
+ if (! EXPR_P (*tp) && ! CONSTANT_CLASS_P (*tp))
*walk_subtrees = 0;
if (DECL_P (*tp) && ! TREE_PUBLIC (*tp) && ! TREE_USED (*tp)
&& ! TREE_ASM_WRITTEN (*tp))
return *tp;
- else if (!flag_unit_at_a_time)
- return NULL_TREE;
/* ??? The C++ FE emits debug information for using decls, so
putting gcc_unreachable here falls over. See PR31899. For now
be conservative. */
@@ -10793,8 +11556,8 @@ secname_for_decl (const_tree decl)
return secname;
}
-/* Check whether decl is a Fortran COMMON symbol. If not, NULL_RTX is returned.
- If so, the rtx for the SYMBOL_REF for the COMMON block is returned, and the
+/* Check whether decl is a Fortran COMMON symbol. If not, NULL_TREE is
+ returned. If so, the decl for the COMMON block is returned, and the
value is the offset into the common block for the symbol. */
static tree
@@ -10843,6 +11606,32 @@ fortran_common (tree decl, HOST_WIDE_INT *value)
return cvar;
}
+/* Dereference a location expression LOC if DECL is passed by invisible
+ reference. */
+
+static dw_loc_descr_ref
+loc_by_reference (dw_loc_descr_ref loc, tree decl)
+{
+ HOST_WIDE_INT size;
+ enum dwarf_location_atom op;
+
+ if (loc == NULL)
+ return NULL;
+
+ if ((TREE_CODE (decl) != PARM_DECL && TREE_CODE (decl) != RESULT_DECL)
+ || !DECL_BY_REFERENCE (decl))
+ return loc;
+
+ size = int_size_in_bytes (TREE_TYPE (decl));
+ if (size > DWARF2_ADDR_SIZE || size == -1)
+ return 0;
+ else if (size == DWARF2_ADDR_SIZE)
+ op = DW_OP_deref;
+ else
+ op = DW_OP_deref_size;
+ add_loc_descr (&loc, new_loc_descr (op, size, 0));
+ return loc;
+}
/* Generate *either* a DW_AT_location attribute or else a DW_AT_const_value
data attribute for a variable or a parameter. We generate the
@@ -10901,8 +11690,8 @@ add_location_or_const_value_attribute (dw_die_ref die, tree decl,
else
initialized = VAR_INIT_STATUS_INITIALIZED;
- list = new_loc_list (loc_descriptor (varloc, initialized),
- node->label, node->next->label, secname, 1);
+ descr = loc_by_reference (loc_descriptor (varloc, initialized), decl);
+ list = new_loc_list (descr, node->label, node->next->label, secname, 1);
node = node->next;
for (; node->next; node = node->next)
@@ -10913,8 +11702,9 @@ add_location_or_const_value_attribute (dw_die_ref die, tree decl,
enum var_init_status initialized =
NOTE_VAR_LOCATION_STATUS (node->var_loc_note);
varloc = NOTE_VAR_LOCATION (node->var_loc_note);
- add_loc_descr_to_loc_list (&list,
- loc_descriptor (varloc, initialized),
+ descr = loc_by_reference (loc_descriptor (varloc, initialized),
+ decl);
+ add_loc_descr_to_loc_list (&list, descr,
node->label, node->next->label, secname);
}
@@ -10935,8 +11725,9 @@ add_location_or_const_value_attribute (dw_die_ref die, tree decl,
current_function_funcdef_no);
endname = ggc_strdup (label_id);
}
- add_loc_descr_to_loc_list (&list,
- loc_descriptor (varloc, initialized),
+ descr = loc_by_reference (loc_descriptor (varloc, initialized),
+ decl);
+ add_loc_descr_to_loc_list (&list, descr,
node->label, endname, secname);
}
@@ -10966,6 +11757,7 @@ add_location_or_const_value_attribute (dw_die_ref die, tree decl,
descr = loc_descriptor (NOTE_VAR_LOCATION (node->var_loc_note), status);
if (descr)
{
+ descr = loc_by_reference (descr, decl);
add_AT_location_description (die, attr, descr);
return;
}
@@ -10976,6 +11768,7 @@ add_location_or_const_value_attribute (dw_die_ref die, tree decl,
descr = loc_descriptor_from_tree (decl);
if (descr)
{
+ descr = loc_by_reference (descr, decl);
add_AT_location_description (die, attr, descr);
return;
}
@@ -10984,6 +11777,150 @@ add_location_or_const_value_attribute (dw_die_ref die, tree decl,
tree_add_const_value_attribute (die, decl);
}
+/* Helper function for tree_add_const_value_attribute. Natively encode
+ initializer INIT into an array. Return true if successful. */
+
+static bool
+native_encode_initializer (tree init, unsigned char *array, int size)
+{
+ tree type;
+
+ if (init == NULL_TREE)
+ return false;
+
+ STRIP_NOPS (init);
+ switch (TREE_CODE (init))
+ {
+ case STRING_CST:
+ type = TREE_TYPE (init);
+ if (TREE_CODE (type) == ARRAY_TYPE)
+ {
+ tree enttype = TREE_TYPE (type);
+ enum machine_mode mode = TYPE_MODE (enttype);
+
+ if (GET_MODE_CLASS (mode) != MODE_INT || GET_MODE_SIZE (mode) != 1)
+ return false;
+ if (int_size_in_bytes (type) != size)
+ return false;
+ if (size > TREE_STRING_LENGTH (init))
+ {
+ memcpy (array, TREE_STRING_POINTER (init),
+ TREE_STRING_LENGTH (init));
+ memset (array + TREE_STRING_LENGTH (init),
+ '\0', size - TREE_STRING_LENGTH (init));
+ }
+ else
+ memcpy (array, TREE_STRING_POINTER (init), size);
+ return true;
+ }
+ return false;
+ case CONSTRUCTOR:
+ type = TREE_TYPE (init);
+ if (int_size_in_bytes (type) != size)
+ return false;
+ if (TREE_CODE (type) == ARRAY_TYPE)
+ {
+ HOST_WIDE_INT min_index;
+ unsigned HOST_WIDE_INT cnt;
+ int curpos = 0, fieldsize;
+ constructor_elt *ce;
+
+ if (TYPE_DOMAIN (type) == NULL_TREE
+ || !host_integerp (TYPE_MIN_VALUE (TYPE_DOMAIN (type)), 0))
+ return false;
+
+ fieldsize = int_size_in_bytes (TREE_TYPE (type));
+ if (fieldsize <= 0)
+ return false;
+
+ min_index = tree_low_cst (TYPE_MIN_VALUE (TYPE_DOMAIN (type)), 0);
+ memset (array, '\0', size);
+ for (cnt = 0;
+ VEC_iterate (constructor_elt, CONSTRUCTOR_ELTS (init), cnt, ce);
+ cnt++)
+ {
+ tree val = ce->value;
+ tree index = ce->index;
+ int pos = curpos;
+ if (index && TREE_CODE (index) == RANGE_EXPR)
+ pos = (tree_low_cst (TREE_OPERAND (index, 0), 0) - min_index)
+ * fieldsize;
+ else if (index)
+ pos = tree_low_cst (index, 0) * fieldsize;
+
+ if (val)
+ {
+ STRIP_NOPS (val);
+ if (!native_encode_initializer (val, array + pos, fieldsize))
+ return false;
+ }
+ curpos = pos + fieldsize;
+ if (index && TREE_CODE (index) == RANGE_EXPR)
+ {
+ int count = tree_low_cst (TREE_OPERAND (index, 1), 0)
+ - tree_low_cst (TREE_OPERAND (index, 0), 0);
+ while (count > 0)
+ {
+ if (val)
+ memcpy (array + curpos, array + pos, fieldsize);
+ curpos += fieldsize;
+ }
+ }
+ gcc_assert (curpos <= size);
+ }
+ return true;
+ }
+ else if (TREE_CODE (type) == RECORD_TYPE
+ || TREE_CODE (type) == UNION_TYPE)
+ {
+ tree field = NULL_TREE;
+ unsigned HOST_WIDE_INT cnt;
+ constructor_elt *ce;
+
+ if (int_size_in_bytes (type) != size)
+ return false;
+
+ if (TREE_CODE (type) == RECORD_TYPE)
+ field = TYPE_FIELDS (type);
+
+ for (cnt = 0;
+ VEC_iterate (constructor_elt, CONSTRUCTOR_ELTS (init), cnt, ce);
+ cnt++, field = field ? TREE_CHAIN (field) : 0)
+ {
+ tree val = ce->value;
+ int pos, fieldsize;
+
+ if (ce->index != 0)
+ field = ce->index;
+
+ if (val)
+ STRIP_NOPS (val);
+
+ if (field == NULL_TREE || DECL_BIT_FIELD (field))
+ return false;
+
+ if (TREE_CODE (TREE_TYPE (field)) == ARRAY_TYPE
+ && TYPE_DOMAIN (TREE_TYPE (field))
+ && ! TYPE_MAX_VALUE (TYPE_DOMAIN (TREE_TYPE (field))))
+ return false;
+ else if (DECL_SIZE_UNIT (field) == NULL_TREE
+ || !host_integerp (DECL_SIZE_UNIT (field), 0))
+ return false;
+ fieldsize = tree_low_cst (DECL_SIZE_UNIT (field), 0);
+ pos = int_byte_position (field);
+ gcc_assert (pos + fieldsize <= size);
+ if (val
+ && !native_encode_initializer (val, array + pos, fieldsize))
+ return false;
+ }
+ return true;
+ }
+ return false;
+ default:
+ return native_encode_expr (init, array, size) == size;
+ }
+}
+
/* If we don't have a copy of this variable in memory for some reason (such
as a C++ member constant that doesn't have an out-of-line definition),
we should tell the debugger about the constant value. */
@@ -11003,6 +11940,19 @@ tree_add_const_value_attribute (dw_die_ref var_die, tree decl)
rtl = rtl_for_decl_init (init, type);
if (rtl)
add_const_value_attribute (var_die, rtl);
+ /* If the host and target are sane, try harder. */
+ else if (CHAR_BIT == 8 && BITS_PER_UNIT == 8
+ && initializer_constant_valid_p (init, type))
+ {
+ HOST_WIDE_INT size = int_size_in_bytes (TREE_TYPE (init));
+ if (size > 0 && (int) size == size)
+ {
+ unsigned char *array = GGC_CNEWVEC (unsigned char, size);
+
+ if (native_encode_initializer (init, array, size))
+ add_AT_vec (var_die, DW_AT_const_value, size, 1, array);
+ }
+ }
}
/* Convert the CFI instructions for the current function into a
@@ -11114,8 +12064,13 @@ compute_frame_pointer_to_fb_displacement (HOST_WIDE_INT offset)
offset += INTVAL (XEXP (elim, 1));
elim = XEXP (elim, 0);
}
- gcc_assert (elim == (frame_pointer_needed ? hard_frame_pointer_rtx
- : stack_pointer_rtx));
+
+ gcc_assert ((SUPPORTS_STACK_ALIGNMENT
+ && (elim == hard_frame_pointer_rtx
+ || elim == stack_pointer_rtx))
+ || elim == (frame_pointer_needed
+ ? hard_frame_pointer_rtx
+ : stack_pointer_rtx));
frame_pointer_fb_offset = -offset;
}
@@ -11181,6 +12136,7 @@ add_bound_info (dw_die_ref subrange_die, enum dwarf_attribute bound_attr, tree b
case RESULT_DECL:
{
dw_die_ref decl_die = lookup_decl_die (bound);
+ dw_loc_descr_ref loc;
/* ??? Can this happen, or should the variable have been bound
first? Probably it can, since I imagine that we try to create
@@ -11189,6 +12145,11 @@ add_bound_info (dw_die_ref subrange_die, enum dwarf_attribute bound_attr, tree b
later parameter. */
if (decl_die != NULL)
add_AT_die_ref (subrange_die, bound_attr, decl_die);
+ else
+ {
+ loc = loc_descriptor_from_tree_1 (bound, 0);
+ add_AT_location_description (subrange_die, bound_attr, loc);
+ }
break;
}
@@ -11238,6 +12199,9 @@ add_subscript_info (dw_die_ref type_die, tree type, bool collapse_p)
{
tree domain = TYPE_DOMAIN (type);
+ if (TYPE_STRING_FLAG (type) && is_fortran () && dimension_number > 0)
+ break;
+
/* Arrays come in three flavors: Unspecified bounds, fixed bounds,
and (in GNU C only) variable bounds. Handle all three forms
here. */
@@ -11771,7 +12735,40 @@ gen_array_type_die (tree type, dw_die_ref context_die)
bool collapse_nested_arrays = !is_ada ();
tree element_type;
-
+
+ /* Emit DW_TAG_string_type for Fortran character types (with kind 1 only, as
+ DW_TAG_string_type doesn't have DW_AT_type attribute). */
+ if (TYPE_STRING_FLAG (type)
+ && TREE_CODE (type) == ARRAY_TYPE
+ && is_fortran ()
+ && TYPE_MODE (TREE_TYPE (type)) == TYPE_MODE (char_type_node))
+ {
+ HOST_WIDE_INT size;
+
+ array_die = new_die (DW_TAG_string_type, scope_die, type);
+ add_name_attribute (array_die, type_tag (type));
+ equate_type_number_to_die (type, array_die);
+ size = int_size_in_bytes (type);
+ if (size >= 0)
+ add_AT_unsigned (array_die, DW_AT_byte_size, size);
+ else if (TYPE_DOMAIN (type) != NULL_TREE
+ && TYPE_MAX_VALUE (TYPE_DOMAIN (type)) != NULL_TREE
+ && DECL_P (TYPE_MAX_VALUE (TYPE_DOMAIN (type))))
+ {
+ tree szdecl = TYPE_MAX_VALUE (TYPE_DOMAIN (type));
+ dw_loc_descr_ref loc = loc_descriptor_from_tree (szdecl);
+
+ size = int_size_in_bytes (TREE_TYPE (szdecl));
+ if (loc && size > 0)
+ {
+ add_AT_loc (array_die, DW_AT_string_length, loc);
+ if (size != DWARF2_ADDR_SIZE)
+ add_AT_unsigned (array_die, DW_AT_byte_size, size);
+ }
+ }
+ return;
+ }
+
/* ??? The SGI dwarf reader fails for array of array of enum types
(e.g. const enum machine_mode insn_operand_mode[2][10]) unless the inner
array type comes before the outer array type. We thus call gen_type_die
@@ -11798,7 +12795,8 @@ gen_array_type_die (tree type, dw_die_ref context_die)
/* For Fortran multidimensional arrays use DW_ORD_col_major ordering. */
if (is_fortran ()
&& TREE_CODE (type) == ARRAY_TYPE
- && TREE_CODE (TREE_TYPE (type)) == ARRAY_TYPE)
+ && TREE_CODE (TREE_TYPE (type)) == ARRAY_TYPE
+ && !TYPE_STRING_FLAG (TREE_TYPE (type)))
add_AT_unsigned (array_die, DW_AT_ordering, DW_ORD_col_major);
#if 0
@@ -11826,8 +12824,12 @@ gen_array_type_die (tree type, dw_die_ref context_die)
element_type = TREE_TYPE (type);
if (collapse_nested_arrays)
while (TREE_CODE (element_type) == ARRAY_TYPE)
- element_type = TREE_TYPE (element_type);
-
+ {
+ if (TYPE_STRING_FLAG (element_type) && is_fortran ())
+ break;
+ element_type = TREE_TYPE (element_type);
+ }
+
#ifndef MIPS_DEBUGGING_INFO
gen_type_die (element_type, context_die);
#endif
@@ -11852,6 +12854,8 @@ descr_info_loc (tree val, tree base_decl)
{
CASE_CONVERT:
return descr_info_loc (TREE_OPERAND (val, 0), base_decl);
+ case VAR_DECL:
+ return loc_descriptor_from_tree_1 (val, 0);
case INTEGER_CST:
if (host_integerp (val, 0))
return int_loc_descriptor (tree_low_cst (val, 0));
@@ -12193,11 +13197,13 @@ gen_formal_parameter_die (tree node, dw_die_ref context_die)
tree type = TREE_TYPE (node);
add_name_and_src_coords_attributes (parm_die, node);
if (DECL_BY_REFERENCE (node))
- type = TREE_TYPE (type);
- add_type_attribute (parm_die, type,
- TREE_READONLY (node),
- TREE_THIS_VOLATILE (node),
- context_die);
+ add_type_attribute (parm_die, TREE_TYPE (type), 0, 0,
+ context_die);
+ else
+ add_type_attribute (parm_die, type,
+ TREE_READONLY (node),
+ TREE_THIS_VOLATILE (node),
+ context_die);
if (DECL_ARTIFICIAL (node))
add_AT_flag (parm_die, DW_AT_artificial, 1);
}
@@ -12767,29 +13773,72 @@ gen_variable_die (tree decl, dw_die_ref context_die)
com_decl = fortran_common (decl, &off);
/* Symbol in common gets emitted as a child of the common block, in the form
- of a data member.
-
- ??? This creates a new common block die for every common block symbol.
- Better to share same common block die for all symbols in that block. */
+ of a data member. */
if (com_decl)
{
tree field;
dw_die_ref com_die;
- const char *cnam = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (com_decl));
- dw_loc_descr_ref loc = loc_descriptor_from_tree (com_decl);
+ dw_loc_descr_ref loc;
+ var_die = lookup_decl_die (decl);
+ if (var_die)
+ {
+ if (get_AT (var_die, DW_AT_location) == NULL)
+ {
+ loc = loc_descriptor_from_tree (com_decl);
+ if (loc)
+ {
+ if (off)
+ add_loc_descr (&loc, new_loc_descr (DW_OP_plus_uconst,
+ off, 0));
+ add_AT_loc (var_die, DW_AT_location, loc);
+ remove_AT (var_die, DW_AT_declaration);
+ }
+ }
+ return;
+ }
field = TREE_OPERAND (DECL_VALUE_EXPR (decl), 0);
- var_die = new_die (DW_TAG_common_block, context_die, decl);
- add_name_and_src_coords_attributes (var_die, field);
- add_AT_flag (var_die, DW_AT_external, 1);
- add_AT_loc (var_die, DW_AT_location, loc);
- com_die = new_die (DW_TAG_member, var_die, decl);
- add_name_and_src_coords_attributes (com_die, decl);
- add_type_attribute (com_die, TREE_TYPE (decl), TREE_READONLY (decl),
+ com_die = lookup_decl_die (com_decl);
+ loc = loc_descriptor_from_tree (com_decl);
+ if (com_die == NULL)
+ {
+ const char *cnam
+ = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (com_decl));
+
+ com_die = new_die (DW_TAG_common_block, context_die, decl);
+ add_name_and_src_coords_attributes (com_die, com_decl);
+ if (loc)
+ {
+ add_AT_loc (com_die, DW_AT_location, loc);
+ /* Avoid sharing the same loc descriptor between
+ DW_TAG_common_block and DW_TAG_variable. */
+ loc = loc_descriptor_from_tree (com_decl);
+ }
+ else if (DECL_EXTERNAL (decl))
+ add_AT_flag (com_die, DW_AT_declaration, 1);
+ add_pubname_string (cnam, com_die); /* ??? needed? */
+ equate_decl_number_to_die (com_decl, com_die);
+ }
+ else if (get_AT (com_die, DW_AT_location) == NULL && loc)
+ {
+ add_AT_loc (com_die, DW_AT_location, loc);
+ loc = loc_descriptor_from_tree (com_decl);
+ remove_AT (com_die, DW_AT_declaration);
+ }
+ var_die = new_die (DW_TAG_variable, com_die, decl);
+ add_name_and_src_coords_attributes (var_die, decl);
+ add_type_attribute (var_die, TREE_TYPE (decl), TREE_READONLY (decl),
TREE_THIS_VOLATILE (decl), context_die);
- add_AT_loc (com_die, DW_AT_data_member_location,
- int_loc_descriptor (off));
- add_pubname_string (cnam, var_die); /* ??? needed? */
+ add_AT_flag (var_die, DW_AT_external, 1);
+ if (loc)
+ {
+ if (off)
+ add_loc_descr (&loc, new_loc_descr (DW_OP_plus_uconst, off, 0));
+ add_AT_loc (var_die, DW_AT_location, loc);
+ }
+ else if (DECL_EXTERNAL (decl))
+ add_AT_flag (var_die, DW_AT_declaration, 1);
+ equate_decl_number_to_die (decl, var_die);
return;
}
@@ -12831,14 +13880,15 @@ gen_variable_die (tree decl, dw_die_ref context_die)
else
{
tree type = TREE_TYPE (decl);
+
+ add_name_and_src_coords_attributes (var_die, decl);
if ((TREE_CODE (decl) == PARM_DECL
|| TREE_CODE (decl) == RESULT_DECL)
&& DECL_BY_REFERENCE (decl))
- type = TREE_TYPE (type);
-
- add_name_and_src_coords_attributes (var_die, decl);
- add_type_attribute (var_die, type, TREE_READONLY (decl),
- TREE_THIS_VOLATILE (decl), context_die);
+ add_type_attribute (var_die, TREE_TYPE (type), 0, 0, context_die);
+ else
+ add_type_attribute (var_die, type, TREE_READONLY (decl),
+ TREE_THIS_VOLATILE (decl), context_die);
if (TREE_PUBLIC (decl))
add_AT_flag (var_die, DW_AT_external, 1);
@@ -12867,6 +13917,24 @@ gen_variable_die (tree decl, dw_die_ref context_die)
tree_add_const_value_attribute (var_die, decl);
}
+/* Generate a DIE to represent a named constant. */
+
+static void
+gen_const_die (tree decl, dw_die_ref context_die)
+{
+ dw_die_ref const_die;
+ tree type = TREE_TYPE (decl);
+
+ const_die = new_die (DW_TAG_constant, context_die, decl);
+ add_name_and_src_coords_attributes (const_die, decl);
+ add_type_attribute (const_die, type, 1, 0, context_die);
+ if (TREE_PUBLIC (decl))
+ add_AT_flag (const_die, DW_AT_external, 1);
+ if (DECL_ARTIFICIAL (decl))
+ add_AT_flag (const_die, DW_AT_artificial, 1);
+ tree_add_const_value_attribute (const_die, decl);
+}
+
/* Generate a DIE to represent a label identifier. */
static void
@@ -13554,7 +14622,7 @@ gen_type_die_with_usage (tree type, dw_die_ref context_die,
}
else
{
- declare_in_namespace (type, context_die);
+ context_die = declare_in_namespace (type, context_die);
need_pop = 0;
}
@@ -13814,6 +14882,22 @@ is_redundant_typedef (const_tree decl)
return 0;
}
+/* Returns the DIE for a context. */
+
+static inline dw_die_ref
+get_context_die (tree context)
+{
+ if (context)
+ {
+ /* Find die that represents this context. */
+ if (TYPE_P (context))
+ return force_type_die (context);
+ else
+ return force_decl_die (context);
+ }
+ return comp_unit_die;
+}
+
/* Returns the DIE for decl. A DIE will always be returned. */
static dw_die_ref
@@ -13825,18 +14909,7 @@ force_decl_die (tree decl)
decl_die = lookup_decl_die (decl);
if (!decl_die)
{
- dw_die_ref context_die;
- tree decl_context = DECL_CONTEXT (decl);
- if (decl_context)
- {
- /* Find die that represents this context. */
- if (TYPE_P (decl_context))
- context_die = force_type_die (decl_context);
- else
- context_die = force_decl_die (decl_context);
- }
- else
- context_die = comp_unit_die;
+ dw_die_ref context_die = get_context_die (DECL_CONTEXT (decl));
decl_die = lookup_decl_die (decl);
if (decl_die)
@@ -13891,16 +14964,7 @@ force_type_die (tree type)
type_die = lookup_type_die (type);
if (!type_die)
{
- dw_die_ref context_die;
- if (TYPE_CONTEXT (type))
- {
- if (TYPE_P (TYPE_CONTEXT (type)))
- context_die = force_type_die (TYPE_CONTEXT (type));
- else
- context_die = force_decl_die (TYPE_CONTEXT (type));
- }
- else
- context_die = comp_unit_die;
+ dw_die_ref context_die = get_context_die (TYPE_CONTEXT (type));
type_die = modified_type_die (type, TYPE_READONLY (type),
TYPE_VOLATILE (type), context_die);
@@ -13930,29 +14994,32 @@ setup_namespace_context (tree thing, dw_die_ref context_die)
For compatibility with older debuggers, namespace DIEs only contain
declarations; all definitions are emitted at CU scope. */
-static void
+static dw_die_ref
declare_in_namespace (tree thing, dw_die_ref context_die)
{
dw_die_ref ns_context;
if (debug_info_level <= DINFO_LEVEL_TERSE)
- return;
+ return context_die;
/* If this decl is from an inlined function, then don't try to emit it in its
namespace, as we will get confused. It would have already been emitted
when the abstract instance of the inline function was emitted anyways. */
if (DECL_P (thing) && DECL_ABSTRACT_ORIGIN (thing))
- return;
+ return context_die;
ns_context = setup_namespace_context (thing, context_die);
if (ns_context != context_die)
{
+ if (is_fortran ())
+ return ns_context;
if (DECL_P (thing))
gen_decl_die (thing, ns_context);
else
gen_type_die (thing, ns_context);
}
+ return context_die;
}
/* Generate a DIE for a namespace or namespace alias. */
@@ -13968,8 +15035,11 @@ gen_namespace_die (tree decl)
{
/* Output a real namespace. */
dw_die_ref namespace_die
- = new_die (DW_TAG_namespace, context_die, decl);
+ = new_die (is_fortran () ? DW_TAG_module : DW_TAG_namespace,
+ context_die, decl);
add_name_and_src_coords_attributes (namespace_die, decl);
+ if (DECL_EXTERNAL (decl))
+ add_AT_flag (namespace_die, DW_AT_declaration, 1);
equate_decl_number_to_die (decl, namespace_die);
}
else
@@ -14005,8 +15075,20 @@ gen_decl_die (tree decl, dw_die_ref context_die)
break;
case CONST_DECL:
- /* The individual enumerators of an enum type get output when we output
- the Dwarf representation of the relevant enum type itself. */
+ if (!is_fortran ())
+ {
+ /* The individual enumerators of an enum type get output when we output
+ the Dwarf representation of the relevant enum type itself. */
+ break;
+ }
+
+ /* Emit its type. */
+ gen_type_die (TREE_TYPE (decl), context_die);
+
+ /* And its containing namespace. */
+ context_die = declare_in_namespace (decl, context_die);
+
+ gen_const_die (decl, context_die);
break;
case FUNCTION_DECL:
@@ -14059,7 +15141,7 @@ gen_decl_die (tree decl, dw_die_ref context_die)
gen_type_die_for_member (origin, decl, context_die);
/* And its containing namespace. */
- declare_in_namespace (decl, context_die);
+ context_die = declare_in_namespace (decl, context_die);
}
/* Now output a DIE to represent the function itself. */
@@ -14104,16 +15186,6 @@ gen_decl_die (tree decl, dw_die_ref context_die)
if (debug_info_level <= DINFO_LEVEL_TERSE)
break;
- /* If this is the global definition of the Fortran COMMON block, we don't
- need to do anything. Syntactically, the block itself has no identity,
- just its constituent identifiers. */
- if (TREE_CODE (decl) == VAR_DECL
- && TREE_PUBLIC (decl)
- && TREE_STATIC (decl)
- && is_fortran ()
- && !DECL_HAS_VALUE_EXPR_P (decl))
- break;
-
/* Output any DIEs that are needed to specify the type of this data
object. */
if (TREE_CODE (decl) == RESULT_DECL && DECL_BY_REFERENCE (decl))
@@ -14127,7 +15199,7 @@ gen_decl_die (tree decl, dw_die_ref context_die)
gen_type_die_for_member (origin, decl, context_die);
/* And its containing namespace. */
- declare_in_namespace (decl, context_die);
+ context_die = declare_in_namespace (decl, context_die);
/* Now output the DIE to represent the data object itself. This gets
complicated because of the possibility that the VAR_DECL really
@@ -14180,15 +15252,7 @@ dwarf2out_global_decl (tree decl)
/* Output DWARF2 information for file-scope tentative data object
declarations, file-scope (extern) function declarations (which
had no corresponding body) and file-scope tagged type declarations
- and definitions which have not yet been forced out.
-
- Ignore the global decl of any Fortran COMMON blocks which also
- wind up here though they have already been described in the local
- scope for the procedures using them. */
- if (TREE_CODE (decl) == VAR_DECL
- && TREE_PUBLIC (decl) && TREE_STATIC (decl) && is_fortran ())
- return;
-
+ and definitions which have not yet been forced out. */
if (TREE_CODE (decl) != FUNCTION_DECL || !DECL_INITIAL (decl))
dwarf2out_decl (decl);
}
@@ -14202,10 +15266,14 @@ dwarf2out_type_decl (tree decl, int local)
dwarf2out_decl (decl);
}
-/* Output debug information for imported module or decl. */
+/* Output debug information for imported module or decl DECL.
+ NAME is non-NULL name in context if the decl has been renamed.
+ CHILD is true if decl is one of the renamed decls as part of
+ importing whole module. */
static void
-dwarf2out_imported_module_or_decl (tree decl, tree context)
+dwarf2out_imported_module_or_decl (tree decl, tree name, tree context,
+ bool child)
{
dw_die_ref imported_die, at_import_die;
dw_die_ref scope_die;
@@ -14222,16 +15290,19 @@ dwarf2out_imported_module_or_decl (tree decl, tree context)
/* Get the scope die for decl context. Use comp_unit_die for global module
or decl. If die is not found for non globals, force new die. */
- if (!context)
- scope_die = comp_unit_die;
- else if (TYPE_P (context))
+ if (context
+ && TYPE_P (context)
+ && !should_emit_struct_debug (context, DINFO_USAGE_DIR_USE))
+ return;
+ scope_die = get_context_die (context);
+
+ if (child)
{
- if (!should_emit_struct_debug (context, DINFO_USAGE_DIR_USE))
- return;
- scope_die = force_type_die (context);
+ gcc_assert (scope_die->die_child);
+ gcc_assert (scope_die->die_child->die_tag == DW_TAG_imported_module);
+ gcc_assert (TREE_CODE (decl) != NAMESPACE_DECL);
+ scope_die = scope_die->die_child;
}
- else
- scope_die = force_decl_die (context);
/* For TYPE_DECL or CONST_DECL, lookup TREE_TYPE. */
if (TREE_CODE (decl) == TYPE_DECL || TREE_CODE (decl) == CONST_DECL)
@@ -14240,6 +15311,16 @@ dwarf2out_imported_module_or_decl (tree decl, tree context)
at_import_die = base_type_die (TREE_TYPE (decl));
else
at_import_die = force_type_die (TREE_TYPE (decl));
+ /* For namespace N { typedef void T; } using N::T; base_type_die
+ returns NULL, but DW_TAG_imported_declaration requires
+ the DW_AT_import tag. Force creation of DW_TAG_typedef. */
+ if (!at_import_die)
+ {
+ gcc_assert (TREE_CODE (decl) == TYPE_DECL);
+ gen_typedef_die (decl, get_context_die (DECL_CONTEXT (decl)));
+ at_import_die = lookup_type_die (TREE_TYPE (decl));
+ gcc_assert (at_import_die);
+ }
}
else
{
@@ -14251,21 +15332,14 @@ dwarf2out_imported_module_or_decl (tree decl, tree context)
if (TREE_CODE (decl) == FIELD_DECL)
{
tree type = DECL_CONTEXT (decl);
- dw_die_ref type_context_die;
- if (TYPE_CONTEXT (type))
- if (TYPE_P (TYPE_CONTEXT (type)))
- {
- if (!should_emit_struct_debug (TYPE_CONTEXT (type),
- DINFO_USAGE_DIR_USE))
- return;
- type_context_die = force_type_die (TYPE_CONTEXT (type));
- }
- else
- type_context_die = force_decl_die (TYPE_CONTEXT (type));
- else
- type_context_die = comp_unit_die;
- gen_type_die_for_member (type, decl, type_context_die);
+ if (TYPE_CONTEXT (type)
+ && TYPE_P (TYPE_CONTEXT (type))
+ && !should_emit_struct_debug (TYPE_CONTEXT (type),
+ DINFO_USAGE_DIR_USE))
+ return;
+ gen_type_die_for_member (type, decl,
+ get_context_die (TYPE_CONTEXT (type)));
}
at_import_die = force_decl_die (decl);
}
@@ -14280,6 +15354,8 @@ dwarf2out_imported_module_or_decl (tree decl, tree context)
xloc = expand_location (input_location);
add_AT_file (imported_die, DW_AT_decl_file, lookup_filename (xloc.file));
add_AT_unsigned (imported_die, DW_AT_decl_line, xloc.line);
+ if (name)
+ add_AT_string (imported_die, DW_AT_name, IDENTIFIER_POINTER (name));
add_AT_die_ref (imported_die, DW_AT_import, at_import_die);
}
@@ -14357,6 +15433,15 @@ dwarf2out_decl (tree decl)
return;
break;
+ case CONST_DECL:
+ if (debug_info_level <= DINFO_LEVEL_TERSE)
+ return;
+ if (!is_fortran ())
+ return;
+ if (TREE_STATIC (decl) && decl_function_context (decl))
+ context_die = lookup_decl_die (DECL_CONTEXT (decl));
+ break;
+
case NAMESPACE_DECL:
if (debug_info_level <= DINFO_LEVEL_TERSE)
return;
diff --git a/gcc/ebitmap.h b/gcc/ebitmap.h
index 8efb4375ecc..2916e44b223 100644
--- a/gcc/ebitmap.h
+++ b/gcc/ebitmap.h
@@ -121,7 +121,7 @@ ebitmap_iter_init (ebitmap_iterator *i, ebitmap bmp, unsigned int min)
static inline bool
ebitmap_iter_cond (ebitmap_iterator *i, unsigned int *n)
{
- unsigned int ourn;
+ unsigned int ourn = 0;
if (i->size == 0)
return false;
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 65fa8e457ec..a0af7b39436 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -864,9 +864,18 @@ rtx
gen_reg_rtx (enum machine_mode mode)
{
rtx val;
+ unsigned int align = GET_MODE_ALIGNMENT (mode);
gcc_assert (can_create_pseudo_p ());
+ /* If a virtual register with bigger mode alignment is generated,
+ increase stack alignment estimation because it might be spilled
+ to stack later. */
+ if (SUPPORTS_STACK_ALIGNMENT
+ && crtl->stack_alignment_estimated < align
+ && !crtl->stack_realign_processed)
+ crtl->stack_alignment_estimated = align;
+
if (generating_concat_p
&& (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
|| GET_MODE_CLASS (mode) == MODE_COMPLEX_INT))
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 5118a53cfa3..77a3049ba5e 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -86,7 +86,7 @@ along with GCC; see the file COPYING3. If not see
/* Protect cleanup actions with must-not-throw regions, with a call
to the given failure handler. */
-tree (*lang_protect_cleanup_actions) (void);
+gimple (*lang_protect_cleanup_actions) (void);
/* Return true if type A catches type B. */
int (*lang_eh_type_covers) (tree a, tree b);
@@ -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/except.h b/gcc/except.h
index ae3264e6f3e..8f9efb26382 100644
--- a/gcc/except.h
+++ b/gcc/except.h
@@ -108,20 +108,13 @@ extern void dump_eh_tree (FILE *, struct function *);
extern bool eh_region_outer_p (struct function *, int, int);
extern int eh_region_outermost (struct function *, int, int);
-/* tree-eh.c */
-extern void add_stmt_to_eh_region_fn (struct function *, tree, int);
-extern bool remove_stmt_from_eh_region_fn (struct function *, tree);
-extern int lookup_stmt_eh_region_fn (struct function *, const_tree);
-extern int lookup_stmt_eh_region (const_tree);
-extern bool verify_eh_edges (tree);
-
/* If non-NULL, this is a function that returns an expression to be
executed if an unhandled exception is propagated out of a cleanup
region. For example, in C++, an exception thrown by a destructor
during stack unwinding is required to result in a call to
`std::terminate', so the C++ version of this function returns a
CALL_EXPR for `std::terminate'. */
-extern tree (*lang_protect_cleanup_actions) (void);
+extern gimple (*lang_protect_cleanup_actions) (void);
/* Return true if type A catches type B. */
extern int (*lang_eh_type_covers) (tree a, tree b);
@@ -175,7 +168,7 @@ extern tree (*lang_eh_runtime_type) (tree);
struct throw_stmt_node GTY(())
{
- tree stmt;
+ gimple stmt;
int region_nr;
};
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..399139b97b5 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -521,6 +521,8 @@ store_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
!= CODE_FOR_nothing))
{
int icode = optab_handler (movstrict_optab, fieldmode)->insn_code;
+ rtx insn;
+ rtx start = get_last_insn ();
/* Get appropriate low part of the value being stored. */
if (GET_CODE (value) == CONST_INT || REG_P (value))
@@ -544,13 +546,17 @@ store_bit_field_1 (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
op0 = SUBREG_REG (op0);
}
- emit_insn (GEN_FCN (icode)
+ insn = (GEN_FCN (icode)
(gen_rtx_SUBREG (fieldmode, op0,
(bitnum % BITS_PER_WORD) / BITS_PER_UNIT
+ (offset * UNITS_PER_WORD)),
value));
-
- return true;
+ if (insn)
+ {
+ emit_insn (insn);
+ return true;
+ }
+ delete_insns_since (start);
}
/* Handle fields bigger than a word. */
@@ -3486,8 +3492,8 @@ expand_smod_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d)
result = gen_reg_rtx (mode);
/* Avoid conditional branches when they're expensive. */
- if (BRANCH_COST >= 2
- && !optimize_size)
+ if (BRANCH_COST (optimize_insn_for_speed_p (), false) >= 2
+ && optimize_insn_for_speed_p ())
{
rtx signmask = emit_store_flag (result, LT, op0, const0_rtx,
mode, 0, -1);
@@ -3586,7 +3592,9 @@ expand_sdiv_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d)
logd = floor_log2 (d);
shift = build_int_cst (NULL_TREE, logd);
- if (d == 2 && BRANCH_COST >= 1)
+ if (d == 2
+ && BRANCH_COST (optimize_insn_for_speed_p (),
+ false) >= 1)
{
temp = gen_reg_rtx (mode);
temp = emit_store_flag (temp, LT, op0, const0_rtx, mode, 0, 1);
@@ -3596,7 +3604,8 @@ expand_sdiv_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d)
}
#ifdef HAVE_conditional_move
- if (BRANCH_COST >= 2)
+ if (BRANCH_COST (optimize_insn_for_speed_p (), false)
+ >= 2)
{
rtx temp2;
@@ -3625,7 +3634,8 @@ expand_sdiv_pow2 (enum machine_mode mode, rtx op0, HOST_WIDE_INT d)
}
#endif
- if (BRANCH_COST >= 2)
+ if (BRANCH_COST (optimize_insn_for_speed_p (),
+ false) >= 2)
{
int ushift = GET_MODE_BITSIZE (mode) - logd;
@@ -5339,7 +5349,8 @@ emit_store_flag (rtx target, enum rtx_code code, rtx op0, rtx op1,
comparison with zero. Don't do any of these cases if branches are
very cheap. */
- if (BRANCH_COST > 0
+ if (BRANCH_COST (optimize_insn_for_speed_p (),
+ false) > 0
&& GET_MODE_CLASS (mode) == MODE_INT && (code == EQ || code == NE)
&& op1 != const0_rtx)
{
@@ -5362,10 +5373,12 @@ emit_store_flag (rtx target, enum rtx_code code, rtx op0, rtx op1,
do LE and GT if branches are expensive since they are expensive on
2-operand machines. */
- if (BRANCH_COST == 0
+ if (BRANCH_COST (optimize_insn_for_speed_p (),
+ false) == 0
|| GET_MODE_CLASS (mode) != MODE_INT || op1 != const0_rtx
|| (code != EQ && code != NE
- && (BRANCH_COST <= 1 || (code != LE && code != GT))))
+ && (BRANCH_COST (optimize_insn_for_speed_p (),
+ false) <= 1 || (code != LE && code != GT))))
return 0;
/* See what we need to return. We can only return a 1, -1, or the
@@ -5461,7 +5474,10 @@ emit_store_flag (rtx target, enum rtx_code code, rtx op0, rtx op1,
that "or", which is an extra insn, so we only handle EQ if branches
are expensive. */
- if (tem == 0 && (code == NE || BRANCH_COST > 1))
+ if (tem == 0
+ && (code == NE
+ || BRANCH_COST (optimize_insn_for_speed_p (),
+ false) > 1))
{
if (rtx_equal_p (subtarget, op0))
subtarget = 0;
diff --git a/gcc/expr.c b/gcc/expr.c
index e7c24e2b838..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))))
@@ -6539,9 +6559,6 @@ safe_from_p (const_rtx x, tree exp, int top_p)
case tcc_type:
/* Should never get a type here. */
gcc_unreachable ();
-
- case tcc_gimple_stmt:
- gcc_unreachable ();
}
/* If we have an rtl, find any enclosed object. Then see if we conflict
@@ -7048,8 +7065,7 @@ expand_expr_real (tree exp, rtx target, enum machine_mode tmode,
/* Handle ERROR_MARK before anybody tries to access its type. */
if (TREE_CODE (exp) == ERROR_MARK
- || TREE_CODE (exp) == PREDICT_EXPR
- || (!GIMPLE_TUPLE_P (exp) && TREE_CODE (TREE_TYPE (exp)) == ERROR_MARK))
+ || (TREE_CODE (TREE_TYPE (exp)) == ERROR_MARK))
{
ret = CONST0_RTX (tmode);
return ret ? ret : const0_rtx;
@@ -7057,7 +7073,8 @@ expand_expr_real (tree exp, rtx target, enum machine_mode tmode,
if (flag_non_call_exceptions)
{
- rn = lookup_stmt_eh_region (exp);
+ rn = lookup_expr_eh_region (exp);
+
/* If rn < 0, then either (1) tree-ssa not used or (2) doesn't throw. */
if (rn >= 0)
last = get_last_insn ();
@@ -7131,21 +7148,12 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
type) \
: (expr))
- if (GIMPLE_STMT_P (exp))
- {
- type = void_type_node;
- mode = VOIDmode;
- unsignedp = 0;
- }
- else
- {
- type = TREE_TYPE (exp);
- mode = TYPE_MODE (type);
- unsignedp = TYPE_UNSIGNED (type);
- }
+ type = TREE_TYPE (exp);
+ mode = TYPE_MODE (type);
+ 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));
@@ -7955,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);
}
@@ -8149,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. */
@@ -8192,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))
@@ -8202,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;
@@ -8981,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
@@ -9090,16 +9166,6 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
tree lhs = TREE_OPERAND (exp, 0);
tree rhs = TREE_OPERAND (exp, 1);
gcc_assert (ignore);
- expand_assignment (lhs, rhs, false);
- return const0_rtx;
- }
-
- case GIMPLE_MODIFY_STMT:
- {
- tree lhs = GIMPLE_STMT_OPERAND (exp, 0);
- tree rhs = GIMPLE_STMT_OPERAND (exp, 1);
-
- gcc_assert (ignore);
/* Check for |= or &= of a bitfield of size one into another bitfield
of size 1. In this case, (unless we need the result of the
@@ -9191,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 ();
@@ -9358,17 +9422,8 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case VEC_PACK_TRUNC_EXPR:
case VEC_PACK_SAT_EXPR:
case VEC_PACK_FIX_TRUNC_EXPR:
- {
- mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
- goto binop;
- }
-
- case OMP_ATOMIC_LOAD:
- case OMP_ATOMIC_STORE:
- /* OMP expansion is not run when there were errors, so these codes
- can get here. */
- gcc_assert (errorcount != 0);
- return NULL_RTX;
+ mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
+ goto binop;
default:
return lang_hooks.expand_expr (exp, original_target, tmode,
@@ -10027,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..30dbaef1037 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -36,7 +36,7 @@ along with GCC; see the file COPYING3. If not see
/* The default branch cost is 1. */
#ifndef BRANCH_COST
-#define BRANCH_COST 1
+#define BRANCH_COST(speed_p, predictable_p) 1
#endif
/* This is the 4th arg to `expand_expr'.
@@ -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 787c43abad5..c1359e8410a 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -683,7 +683,7 @@ compute_alignments (void)
label_align = XCNEWVEC (struct label_alignment, max_labelno - min_labelno + 1);
/* If not optimizing or optimizing for size, don't assign any alignments. */
- if (! optimize || optimize_size)
+ if (! optimize || optimize_function_for_size_p (cfun))
return 0;
if (dump_file)
@@ -707,7 +707,7 @@ compute_alignments (void)
edge_iterator ei;
if (!LABEL_P (label)
- || probably_never_executed_bb_p (bb))
+ || optimize_bb_for_size_p (bb))
{
if (dump_file)
fprintf(dump_file, "BB %4i freq %4i loop %2i loop_depth %2i skipped.\n",
@@ -765,7 +765,7 @@ compute_alignments (void)
/* In case block is frequent and reached mostly by non-fallthru edge,
align it. It is most likely a first block of loop. */
if (has_fallthru
- && maybe_hot_bb_p (bb)
+ && optimize_bb_for_speed_p (bb)
&& branch_frequency + fallthru_frequency > freq_threshold
&& (branch_frequency
> fallthru_frequency * PARAM_VALUE (PARAM_ALIGN_LOOP_ITERATIONS)))
@@ -1744,6 +1744,34 @@ output_alternate_entry_point (FILE *file, rtx insn)
}
}
+/* Given a CALL_INSN, find and return the nested CALL. */
+static rtx
+call_from_call_insn (rtx insn)
+{
+ rtx x;
+ gcc_assert (CALL_P (insn));
+ x = PATTERN (insn);
+
+ while (GET_CODE (x) != CALL)
+ {
+ switch (GET_CODE (x))
+ {
+ default:
+ gcc_unreachable ();
+ case COND_EXEC:
+ x = COND_EXEC_CODE (x);
+ break;
+ case PARALLEL:
+ x = XVECEXP (x, 0, 0);
+ break;
+ case SET:
+ x = XEXP (x, 1);
+ break;
+ }
+ }
+ return x;
+}
+
/* The final scan for one insn, INSN.
Args are same as in `final', except that INSN
is the insn being scanned.
@@ -1979,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))
@@ -2083,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)
@@ -2161,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",
@@ -2205,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);
@@ -2224,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)
{
@@ -2609,6 +2617,20 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
targetm.asm_out.unwind_emit (asm_out_file, insn);
#endif
+ if (CALL_P (insn))
+ {
+ rtx x = call_from_call_insn (insn);
+ x = XEXP (x, 0);
+ if (x && MEM_P (x) && GET_CODE (XEXP (x, 0)) == SYMBOL_REF)
+ {
+ tree t;
+ x = XEXP (x, 0);
+ t = SYMBOL_REF_DECL (x);
+ if (t)
+ assemble_external (t);
+ }
+ }
+
/* Output assembler code from the template. */
output_asm_insn (templ, recog_data.operand);
diff --git a/gcc/fix-header.c b/gcc/fix-header.c
index f691e4eae70..5402e949db4 100644
--- a/gcc/fix-header.c
+++ b/gcc/fix-header.c
@@ -562,7 +562,10 @@ recognized_function (const cpp_token *fname, unsigned int line, int kind,
/* We only have a partial function declaration,
so remember that we have to add a complete prototype. */
partial_count++;
- partial = obstack_alloc (&scan_file_obstack, sizeof (struct partial_proto));
+ partial
+ = (struct partial_proto *)
+ obstack_alloc (&scan_file_obstack,
+ sizeof (struct partial_proto));
partial->line_seen = line;
partial->fn = fn;
fn->partial = partial;
diff --git a/gcc/flags.h b/gcc/flags.h
index f4cc3aca69d..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.
@@ -169,11 +164,6 @@ extern int flag_pcc_struct_return;
extern int flag_complex_method;
-/* Nonzero means that we don't want inlining by virtue of -fno-inline,
- not just because the tree inliner turned us off. */
-
-extern int flag_really_no_inline;
-
/* Nonzero if we are only using compiler to check syntax errors. */
extern int rtl_dump_and_exit;
@@ -215,6 +205,19 @@ extern int flag_debug_asm;
extern int flag_next_runtime;
extern int flag_dump_rtl_in_asm;
+
+/* The algorithm used for the integrated register allocator (IRA). */
+enum ira_algorithm
+{
+ IRA_ALGORITHM_REGIONAL,
+ IRA_ALGORITHM_CB,
+ IRA_ALGORITHM_MIXED
+};
+
+extern enum ira_algorithm flag_ira_algorithm;
+
+extern unsigned int flag_ira_verbose;
+
/* Other basic status info about current function. */
@@ -264,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 e1e04bb625d..ae66ad4ee2d 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -65,6 +65,7 @@ along with GCC; see the file COPYING3. If not see
#include "hashtab.h"
#include "langhooks.h"
#include "md5.h"
+#include "gimple.h"
/* Nonzero if we are folding constants inside an initializer; zero
otherwise. */
@@ -949,7 +950,7 @@ fold_defer_overflow_warnings (void)
deferred code. */
void
-fold_undefer_overflow_warnings (bool issue, const_tree stmt, int code)
+fold_undefer_overflow_warnings (bool issue, const_gimple stmt, int code)
{
const char *warnmsg;
location_t locus;
@@ -971,7 +972,7 @@ fold_undefer_overflow_warnings (bool issue, const_tree stmt, int code)
if (!issue || warnmsg == NULL)
return;
- if (stmt != NULL_TREE && TREE_NO_WARNING (stmt))
+ if (gimple_no_warning_p (stmt))
return;
/* Use the smallest code level when deciding to issue the
@@ -982,10 +983,10 @@ fold_undefer_overflow_warnings (bool issue, const_tree stmt, int code)
if (!issue_strict_overflow_warning (code))
return;
- if (stmt == NULL_TREE || !expr_has_location (stmt))
+ if (stmt == NULL)
locus = input_location;
else
- locus = expr_location (stmt);
+ locus = gimple_location (stmt);
warning (OPT_Wstrict_overflow, "%H%s", &locus, warnmsg);
}
@@ -995,7 +996,7 @@ fold_undefer_overflow_warnings (bool issue, const_tree stmt, int code)
void
fold_undefer_and_ignore_overflow_warnings (void)
{
- fold_undefer_overflow_warnings (false, NULL_TREE, 0);
+ fold_undefer_overflow_warnings (false, NULL, 0);
}
/* Whether we are deferring overflow warnings. */
@@ -1884,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;
@@ -2639,7 +2639,7 @@ fold_convert (tree type, tree arg)
case VOID_TYPE:
tem = fold_ignored_result (arg);
- if (TREE_CODE (tem) == GIMPLE_MODIFY_STMT)
+ if (TREE_CODE (tem) == MODIFY_EXPR)
return tem;
return fold_build1 (NOP_EXPR, type, tem);
@@ -2682,7 +2682,6 @@ maybe_lvalue_p (const_tree x)
case WITH_CLEANUP_EXPR:
case COMPOUND_EXPR:
case MODIFY_EXPR:
- case GIMPLE_MODIFY_STMT:
case TARGET_EXPR:
case COND_EXPR:
case BIND_EXPR:
@@ -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,
@@ -5110,7 +5109,9 @@ fold_cond_expr_with_comparison (tree type, tree arg0, tree arg1, tree arg2)
#ifndef LOGICAL_OP_NON_SHORT_CIRCUIT
-#define LOGICAL_OP_NON_SHORT_CIRCUIT (BRANCH_COST >= 2)
+#define LOGICAL_OP_NON_SHORT_CIRCUIT \
+ (BRANCH_COST (!cfun || optimize_function_for_speed_p (cfun), \
+ false) >= 2)
#endif
/* EXP is some logical combination of boolean tests. See if we can
@@ -5358,7 +5359,8 @@ fold_truthop (enum tree_code code, tree truth_type, tree lhs, tree rhs)
that can be merged. Avoid doing this if the RHS is a floating-point
comparison since those can trap. */
- if (BRANCH_COST >= 2
+ if (BRANCH_COST (!cfun || optimize_function_for_speed_p (cfun),
+ false) >= 2
&& ! FLOAT_TYPE_P (TREE_TYPE (rl_arg))
&& simple_operand_p (rl_arg)
&& simple_operand_p (rr_arg))
@@ -5931,9 +5933,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 ... */
@@ -6669,7 +6682,7 @@ tree_swap_operands_p (const_tree arg0, const_tree arg1, bool reorder)
if (TREE_CONSTANT (arg0))
return 1;
- if (optimize_size)
+ if (cfun && optimize_function_for_size_p (cfun))
return 0;
if (reorder && flag_evaluation_order
@@ -6734,10 +6747,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 +7639,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 +7688,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
@@ -7847,17 +7858,16 @@ fold_unary (enum tree_code code, tree type, tree op0)
return fold_convert (type, fold_addr_expr (base));
}
- if ((TREE_CODE (op0) == MODIFY_EXPR
- || TREE_CODE (op0) == GIMPLE_MODIFY_STMT)
- && TREE_CONSTANT (GENERIC_TREE_OPERAND (op0, 1))
+ if (TREE_CODE (op0) == MODIFY_EXPR
+ && TREE_CONSTANT (TREE_OPERAND (op0, 1))
/* Detect assigning a bitfield. */
- && !(TREE_CODE (GENERIC_TREE_OPERAND (op0, 0)) == COMPONENT_REF
+ && !(TREE_CODE (TREE_OPERAND (op0, 0)) == COMPONENT_REF
&& DECL_BIT_FIELD
- (TREE_OPERAND (GENERIC_TREE_OPERAND (op0, 0), 1))))
+ (TREE_OPERAND (TREE_OPERAND (op0, 0), 1))))
{
/* Don't leave an assignment inside a conversion
unless assigning a bitfield. */
- tem = fold_build1 (code, type, GENERIC_TREE_OPERAND (op0, 1));
+ tem = fold_build1 (code, type, TREE_OPERAND (op0, 1));
/* First do the assignment, then return converted constant. */
tem = build2 (COMPOUND_EXPR, TREE_TYPE (tem), op0, tem);
TREE_NO_WARNING (tem) = 1;
@@ -8282,9 +8292,14 @@ maybe_canonicalize_comparison_1 (enum tree_code code, tree type,
int sgn0;
bool swap = false;
- /* Match A +- CST code arg1 and CST code arg1. */
- if (!(((code0 == MINUS_EXPR
- || code0 == PLUS_EXPR)
+ /* Match A +- CST code arg1 and CST code arg1. We can change the
+ first form only if overflow is undefined. */
+ if (!((TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (arg0))
+ /* In principle pointers also have undefined overflow behavior,
+ but that causes problems elsewhere. */
+ && !POINTER_TYPE_P (TREE_TYPE (arg0))
+ && (code0 == MINUS_EXPR
+ || code0 == PLUS_EXPR)
&& TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST)
|| code0 == INTEGER_CST))
return NULL_TREE;
@@ -8345,9 +8360,21 @@ maybe_canonicalize_comparison_1 (enum tree_code code, tree type,
*strict_overflow_p = true;
}
- /* Now build the constant reduced in magnitude. */
+ /* Now build the constant reduced in magnitude. But not if that
+ would produce one outside of its types range. */
+ if (INTEGRAL_TYPE_P (TREE_TYPE (cst0))
+ && ((sgn0 == 1
+ && TYPE_MIN_VALUE (TREE_TYPE (cst0))
+ && tree_int_cst_equal (cst0, TYPE_MIN_VALUE (TREE_TYPE (cst0))))
+ || (sgn0 == -1
+ && TYPE_MAX_VALUE (TREE_TYPE (cst0))
+ && tree_int_cst_equal (cst0, TYPE_MAX_VALUE (TREE_TYPE (cst0))))))
+ /* We cannot swap the comparison here as that would cause us to
+ endlessly recurse. */
+ return NULL_TREE;
+
t = int_const_binop (sgn0 == -1 ? PLUS_EXPR : MINUS_EXPR,
- cst0, build_int_cst (TREE_TYPE (cst0), 1), 0);
+ cst0, build_int_cst (TREE_TYPE (cst0), 1), 0);
if (code0 != INTEGER_CST)
t = fold_build2 (code0, TREE_TYPE (arg0), TREE_OPERAND (arg0, 0), t);
@@ -8373,12 +8400,6 @@ maybe_canonicalize_comparison (enum tree_code code, tree type,
const char * const warnmsg = G_("assuming signed overflow does not occur "
"when reducing constant in comparison");
- /* In principle pointers also have undefined overflow behavior,
- but that causes problems elsewhere. */
- if (!TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (arg0))
- || POINTER_TYPE_P (TREE_TYPE (arg0)))
- return NULL_TREE;
-
/* Try canonicalization by simplifying arg0. */
strict_overflow_p = false;
t = maybe_canonicalize_comparison_1 (code, type, arg0, arg1,
@@ -9249,8 +9270,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
tree t1 = NULL_TREE;
bool strict_overflow_p;
- gcc_assert ((IS_EXPR_CODE_CLASS (kind)
- || IS_GIMPLE_STMT_CODE_CLASS (kind))
+ gcc_assert (IS_EXPR_CODE_CLASS (kind)
&& TREE_CODE_LENGTH (code) == 2
&& op0 != NULL_TREE
&& op1 != NULL_TREE);
@@ -10390,7 +10410,7 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
}
/* Optimize x*x as pow(x,2.0), which is expanded as x*x. */
- if (! optimize_size
+ if (optimize_function_for_speed_p (cfun)
&& operand_equal_p (arg0, arg1, 0))
{
tree powfn = mathfn_built_in (type, BUILT_IN_POW);
@@ -10720,14 +10740,13 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
&& TREE_CODE (arg1) == INTEGER_CST
&& TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST)
{
- tree tmp1 = fold_convert (TREE_TYPE (arg0), arg1);
- tree tmp2 = fold_build2 (BIT_AND_EXPR, TREE_TYPE (arg0),
- TREE_OPERAND (arg0, 0), tmp1);
- tree tmp3 = fold_build2 (BIT_AND_EXPR, TREE_TYPE (arg0),
- TREE_OPERAND (arg0, 1), tmp1);
+ tree tmp1 = fold_convert (type, arg1);
+ tree tmp2 = fold_convert (type, TREE_OPERAND (arg0, 0));
+ tree tmp3 = fold_convert (type, TREE_OPERAND (arg0, 1));
+ tmp2 = fold_build2 (BIT_AND_EXPR, type, tmp2, tmp1);
+ tmp3 = fold_build2 (BIT_AND_EXPR, type, tmp3, tmp1);
return fold_convert (type,
- fold_build2 (BIT_IOR_EXPR, TREE_TYPE (arg0),
- tmp2, tmp3));
+ fold_build2 (BIT_IOR_EXPR, type, tmp2, tmp3));
}
/* (X | Y) & Y is (X, Y). */
@@ -12418,29 +12437,6 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
}
}
- /* Change X >= C to X > (C - 1) and X < C to X <= (C - 1) if C > 0.
- This transformation affects the cases which are handled in later
- optimizations involving comparisons with non-negative constants. */
- if (TREE_CODE (arg1) == INTEGER_CST
- && TREE_CODE (arg0) != INTEGER_CST
- && tree_int_cst_sgn (arg1) > 0)
- {
- if (code == GE_EXPR)
- {
- arg1 = const_binop (MINUS_EXPR, arg1,
- build_int_cst (TREE_TYPE (arg1), 1), 0);
- return fold_build2 (GT_EXPR, type, arg0,
- fold_convert (TREE_TYPE (arg0), arg1));
- }
- if (code == LT_EXPR)
- {
- arg1 = const_binop (MINUS_EXPR, arg1,
- build_int_cst (TREE_TYPE (arg1), 1), 0);
- return fold_build2 (LE_EXPR, type, arg0,
- fold_convert (TREE_TYPE (arg0), arg1));
- }
- }
-
/* Comparisons with the highest or lowest possible integer of
the specified precision will have known values. */
{
@@ -13169,8 +13165,7 @@ fold (tree expr)
return expr;
}
- if (IS_EXPR_CODE_CLASS (kind)
- || IS_GIMPLE_STMT_CODE_CLASS (kind))
+ if (IS_EXPR_CODE_CLASS (kind))
{
tree type = TREE_TYPE (t);
tree op0, op1, op2;
@@ -14110,7 +14105,7 @@ tree_single_nonnegative_warnv_p (tree t, bool *strict_overflow_p)
*STRICT_OVERFLOW_P. */
bool
-tree_call_nonnegative_warnv_p (enum tree_code code, tree type, tree fndecl,
+tree_call_nonnegative_warnv_p (tree type, tree fndecl,
tree arg0, tree arg1, bool *strict_overflow_p)
{
if (fndecl && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
@@ -14231,7 +14226,7 @@ tree_call_nonnegative_warnv_p (enum tree_code code, tree type, tree fndecl,
default:
break;
}
- return tree_simple_nonnegative_warnv_p (code,
+ return tree_simple_nonnegative_warnv_p (CALL_EXPR,
type);
}
@@ -14273,10 +14268,9 @@ tree_invalid_nonnegative_warnv_p (tree t, bool *strict_overflow_p)
else
break;
}
- if ((TREE_CODE (t) == MODIFY_EXPR
- || TREE_CODE (t) == GIMPLE_MODIFY_STMT)
- && GENERIC_TREE_OPERAND (t, 0) == temp)
- return tree_expr_nonnegative_warnv_p (GENERIC_TREE_OPERAND (t, 1),
+ if (TREE_CODE (t) == MODIFY_EXPR
+ && TREE_OPERAND (t, 0) == temp)
+ return tree_expr_nonnegative_warnv_p (TREE_OPERAND (t, 1),
strict_overflow_p);
return false;
@@ -14287,8 +14281,7 @@ tree_invalid_nonnegative_warnv_p (tree t, bool *strict_overflow_p)
tree arg0 = call_expr_nargs (t) > 0 ? CALL_EXPR_ARG (t, 0) : NULL_TREE;
tree arg1 = call_expr_nargs (t) > 1 ? CALL_EXPR_ARG (t, 1) : NULL_TREE;
- return tree_call_nonnegative_warnv_p (TREE_CODE (t),
- TREE_TYPE (t),
+ return tree_call_nonnegative_warnv_p (TREE_TYPE (t),
get_callee_fndecl (t),
arg0,
arg1,
@@ -14296,8 +14289,7 @@ tree_invalid_nonnegative_warnv_p (tree t, bool *strict_overflow_p)
}
case COMPOUND_EXPR:
case MODIFY_EXPR:
- case GIMPLE_MODIFY_STMT:
- return tree_expr_nonnegative_warnv_p (GENERIC_TREE_OPERAND (t, 1),
+ return tree_expr_nonnegative_warnv_p (TREE_OPERAND (t, 1),
strict_overflow_p);
case BIND_EXPR:
return tree_expr_nonnegative_warnv_p (expr_last (TREE_OPERAND (t, 1)),
@@ -14672,9 +14664,8 @@ tree_expr_nonzero_warnv_p (tree t, bool *strict_overflow_p)
case COMPOUND_EXPR:
case MODIFY_EXPR:
- case GIMPLE_MODIFY_STMT:
case BIND_EXPR:
- return tree_expr_nonzero_warnv_p (GENERIC_TREE_OPERAND (t, 1),
+ return tree_expr_nonzero_warnv_p (TREE_OPERAND (t, 1),
strict_overflow_p);
case SAVE_EXPR:
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 3e50db4dcc8..6a88c38e724 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,660 @@
+2008-08-29 Jan Hubicka <jh@suse.cz>
+
+ * parse.c (parse_interface): Silence uninitialized var warning.
+
+2008-08-29 Jakub Jelinek <jakub@redhat.com>
+
+ * trans.h (struct lang_type): Add span.
+ (GFC_TYPE_ARRAY_SPAN): Define.
+ * trans-decl.c (gfc_get_symbol_decl): For subref array pointers,
+ copy TREE_STATIC from decl to span instead of setting it
+ unconditionally, set DECL_ARTIFICIAL, fix type of initializer
+ and set GFC_TYPE_ARRAY_SPAN on decl's type.
+ * trans-types.c (gfc_get_array_descr_info): If
+ GFC_TYPE_ARRAY_SPAN is non-NULL, use it as element size.
+
+ * trans-decl.c (check_constant_initializer,
+ gfc_emit_parameter_debug_info): New functions.
+ (gfc_generate_module_vars, gfc_generate_function_code): Emit
+ PARAMETERs and unreferenced variables with initializers into
+ debug info.
+
+ * gfortran.h (gfc_use_list): Add where field.
+ * module.c (use_locus): New static variable.
+ (gfc_match_use): Set it.
+ (gfc_use_module): Copy it to gfc_use_list's where field.
+ * trans-decl.c (gfc_generate_module_vars): Call gfc_trans_use_stmts.
+ (gfc_trans_use_stmts): Set backend locus before calling the debug
+ hook. Allow non-VAR_DECLs to be created even for non-external
+ module. Don't emit anything so far for renames from different
+ modules.
+
+ PR fortran/24790
+ * trans-decl.c (create_function_arglist): Set DECL_BY_REFERENCE on
+ PARM_DECLs with pointer or reference type.
+
+ * trans-decl.c (gfc_build_qualified_array): Build non-flat
+ array type for debug info purposes.
+
+ PR fortran/29635
+ PR fortran/23057
+ * f95-lang.c (gfc_init_ts): New function.
+ (LANG_HOOKS_INIT_TS): Define.
+ * gfortran.h (gfc_use_rename): New type, moved from module.c.
+ (gfc_get_use_rename): New macro, moved from module.c.
+ (gfc_use_list): New type.
+ (gfc_get_use_list): New macro.
+ (gfc_namespace): Add use_stmts field.
+ (gfc_free_use_stmts): New prototype.
+ * Make-lang.in (fortran/trans-decl.o): Depend on debug.h.
+ * module.c (gfc_use_rename, gfc_get_use_rename): Moved to
+ gfortran.h.
+ (gfc_use_module): Chain the USE statement info to
+ ns->use_stmts.
+ (gfc_free_use_stmts): New function.
+ * symbol.c (gfc_free_namespace): Call gfc_free_use_stmts.
+ * trans.h (struct module_htab_entry): New type.
+ (gfc_find_module, gfc_module_add_decl): New functions.
+ * trans.c (gfc_generate_module_code): Create NAMESPACE_DECL for
+ the module, adjust DECL_CONTEXTs of module procedures and
+ call gfc_module_add_decl for them.
+ * trans-common.c (build_common_decl): Set DECL_IGNORED_P
+ on the common variable.
+ (create_common): Set DECL_IGNORED_P for use associated vars.
+ * trans-decl.c: Include debug.h.
+ (gfc_get_symbol_decl): Set DECL_IGNORED_P on use_assoc vars from
+ modules.
+ (build_function_decl): Allow current_function_decl's context
+ to be a NAMESPACE_DECL.
+ (module_htab, cur_module): New variables.
+ (module_htab_do_hash, module_htab_eq, module_htab_decls_hash,
+ module_htab_decls_eq, gfc_find_module, gfc_module_add_decl): New
+ functions.
+ (gfc_create_module_variable): Adjust DECL_CONTEXTs of module
+ variables and types and call gfc_module_add_decl for them.
+ (gfc_generate_module_vars): Temporarily set cur_module.
+ (gfc_trans_use_stmts): New function.
+ (gfc_generate_function_code): Call it.
+ (gfc_generate_block_data): Set DECL_IGNORED_P on decl.
+ * trans-types.c (gfc_get_derived_type): Adjust DECL_CONTEXT
+ and TYPE_CONTEXT of module derived types.
+
+2008-08-28 Daniel Kraft <d@domob.eu>
+
+ * gfortran.h (enum expr_t): New value `EXPR_COMPCALL'.
+ (gfc_get_typebound_proc): New macro.
+ (struct gfc_expr): New union-member `compcall' for EXPR_COMPCALL.
+ (enum gfc_exec_op): New value `EXEC_COMPCALL'.
+ (gfc_find_typebound_proc): New argument.
+ (gfc_copy_ref), (gfc_match_varspec): Made public.
+ * decl.c (match_procedure_in_type): Use gfc_get_typebound_proc.
+ * expr.c (free_expr0), (gfc_copy_expr): Handle EXPR_COMPCALL.
+ (gfc_copy_ref): Made public and use new name.
+ (simplify_const_ref): Use new name of gfc_copy_ref.
+ (simplify_parameter_variable): Ditto.
+ (gfc_simplify_expr): gcc_unreachable for EXPR_COMPCALL.
+ * match.c (match_typebound_call): New method.
+ (gfc_match_call): Allow for CALL's to typebound procedures.
+ * module.c (binding_passing), (binding_overriding): New variables.
+ (expr_types): Add EXPR_COMPCALL.
+ (mio_expr): gcc_unreachable for EXPR_COMPCALL.
+ (mio_typebound_proc), (mio_typebound_symtree): New methods.
+ (mio_f2k_derived): Handle type-bound procedures.
+ * primary.c (gfc_match_varspec): Made public and parse trailing
+ references to type-bound procedures; new argument `sub_flag'.
+ (gfc_match_rvalue): New name and argument of gfc_match_varspec.
+ (match_variable): Ditto.
+ * resolve.c (update_arglist_pass): New method.
+ (update_compcall_arglist), (resolve_typebound_static): New methods.
+ (resolve_typebound_call), (resolve_compcall): New methods.
+ (gfc_resolve_expr): Handle EXPR_COMPCALL.
+ (resolve_code): Handle EXEC_COMPCALL.
+ (resolve_fl_derived): New argument to gfc_find_typebound_proc.
+ (resolve_typebound_procedure): Ditto and removed not-implemented error.
+ * st.c (gfc_free_statement): Handle EXEC_COMPCALL.
+ * symbol.c (gfc_find_typebound_proc): New argument `noaccess' and
+ implement access-checking.
+ * trans-expr.c (gfc_apply_interface_mapping_to_expr): gcc_unreachable
+ on EXPR_COMPCALL.
+ * trans-intrinsic.c (gfc_conv_intrinsic_bound): Add missing break.
+ * trans-openmp.c (gfc_trans_omp_array_reduction): Add missing
+ intialization of ref->type.
+
+2008-08-28 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/37253
+ * module.c (ab_attribute,attr_bits,mio_symbol_attribute): Take care of
+ saving attr.procedure and attr.proc_ptr to the module file.
+
+2008-08-25 Daniel Kraft <d@domob.eu>
+
+ * gfortran.h (gfc_find_component): Add new arguments.
+ * parse.c (parse_derived_contains): Check if the derived-type containing
+ the CONTAINS section is SEQUENCE/BIND(C).
+ * resolve.c (resolve_typebound_procedure): Check for name collision with
+ components.
+ (resolve_fl_derived): Check for name collision with inherited
+ type-bound procedures.
+ * symbol.c (gfc_find_component): New arguments `noaccess' and `silent'.
+ (gfc_add_component): Adapt for new arguments.
+ * primary.c (match_varspec), (gfc_match_structure_constructor): Ditto.
+
+2008-08-24 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/37201
+ * decl.c (verify_bind_c_sym): Reject array/string returning
+ functions.
+
+2008-08-24 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/37201
+ * trans-expr.c (gfc_conv_function_call): Add string_length
+ for character-returning bind(C) functions.
+
+2008-08-24 Daniel Kraft <d@domob.eu>
+
+ * gfortran.h (gfc_typebound_proc): New struct.
+ (gfc_symtree): New member typebound.
+ (gfc_find_typebound_proc): Prototype for new method.
+ (gfc_get_derived_super_type): Prototype for new method.
+ * parse.h (gfc_compile_state): New state COMP_DERIVED_CONTAINS.
+ * decl.c (gfc_match_procedure): Handle PROCEDURE inside derived-type
+ CONTAINS section.
+ (gfc_match_end): Handle new context COMP_DERIVED_CONTAINS.
+ (gfc_match_private): Ditto.
+ (match_binding_attributes), (match_procedure_in_type): New methods.
+ (gfc_match_final_decl): Rewrote to make use of new
+ COMP_DERIVED_CONTAINS parser state.
+ * parse.c (typebound_default_access): New global helper variable.
+ (set_typebound_default_access): New callback method.
+ (parse_derived_contains): New method.
+ (parse_derived): Extracted handling of CONTAINS to new parser state
+ and parse_derived_contains.
+ * resolve.c (resolve_bindings_derived), (resolve_bindings_result): New.
+ (check_typebound_override), (resolve_typebound_procedure): New methods.
+ (resolve_typebound_procedures): New method.
+ (resolve_fl_derived): Call new resolving method for typebound procs.
+ * symbol.c (gfc_new_symtree): Initialize new member typebound to NULL.
+ (gfc_find_typebound_proc): New method.
+ (gfc_get_derived_super_type): New method.
+
+2008-08-23 Janus Weil <janus@gcc.gnu.org>
+
+ * gfortran.h (gfc_component): Add field "symbol_attribute attr", remove
+ fields "pointer", "allocatable", "dimension", "access".
+ Remove functions "gfc_set_component_attr" and "gfc_get_component_attr".
+ * interface.c (gfc_compare_derived_types): Ditto.
+ * trans-array.c (gfc_array_allocate,structure_alloc_comps): Ditto.
+ * trans-expr.c (gfc_conv_component_ref,gfc_trans_subcomponent_assign,
+ gfc_conv_structure): Ditto.
+ * symbol.c (gfc_find_component,free_components,gfc_set_component_attr,
+ gfc_get_component_attr,verify_bind_c_derived_type,
+ generate_isocbinding_symbol): Ditto.
+ * decl.c (build_struct): Ditto.
+ * dump-parse-tree.c (show_components): Ditto.
+ * trans-stmt.c (gfc_trans_deallocate): Ditto.
+ * expr.c (gfc_check_assign,gfc_check_pointer_assign,
+ gfc_default_initializer): Ditto.
+ * module.c (mio_component): Ditto.
+ * trans-types.c (copy_dt_decls_ifequal,gfc_get_derived_type): Ditto.
+ * resolve.c (has_default_initializer,resolve_structure_cons,
+ gfc_iso_c_func_interface,find_array_spec,resolve_ref,
+ resolve_deallocate_expr,resolve_allocate_expr,resolve_fl_derived,
+ resolve_equivalence_derived): Ditto.
+ * trans-io.c (transfer_expr): Ditto.
+ * parse.c (parse_derived): Ditto.
+ * dependency.c (gfc_check_dependency): Ditto.
+ * primary.c (gfc_variable_attr): Ditto.
+
+2008-08-23 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/37076
+ * arith.c (gfc_arith_concat): Fix concat of kind=4 strings.
+
+2008-08-23 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/37025
+ * target-memory.c (gfc_interpret_character): Support
+ kind=4 characters.
+
+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
+ Invariant Section.
+ * gfortran.texi: Likewise.
+ * intrinsic.texi: Do not list GPL as Invariant Section.
+ * invoke.texi: Likewise. Update copyright years.
+
+2008-07-29 Paul Thomas <pault@gcc.gnu.org>
+
+ * trans-expr.c (conv_parent_component_references): New function
+ to build missing parent references.
+ (gfc_conv_variable): Call it
+ * symbol.c (gfc_add_component): Check that component name in a
+ derived type extension does not appear in parent.
+ (gfc_find_component): For a derived type extension, check if
+ the component appears in the parent derived type by calling
+ self. Separate errors for private components and private types.
+ * decl.c (match_data_constant): Add extra arg to call to
+ gfc_match_structure_constructor.
+ (check_extended_derived_type): New function to check that a
+ parent derived type exists and that it is OK for exension.
+ (gfc_get_type_attr_spec): Add extra argument 'name' and return
+ it if extends is specified.
+ (gfc_match_derived_decl): Match derived type extension and
+ build a first component of the parent derived type if OK. Add
+ the f2k namespace if not present.
+ * gfortran.h : Add the extension attribute.
+ * module.c : Handle attribute 'extension'.
+ * match.h : Modify prototypes for gfc_get_type_attr_spec and
+ gfc_match_structure_constructor.
+ * primary.c (build_actual_constructor): New function extracted
+ from gfc_match_structure_constructor and modified to call self
+ iteratively to build derived type extensions, when f2k named
+ components are used.
+ (gfc_match_structure_constructor): Do not throw error for too
+ many components if a parent type is being handled. Use
+ gfc_find_component to generate errors for non-existent or
+ private components. Iteratively call self for derived type
+ extensions so that parent constructor is built. If extension
+ and components left over, throw error.
+ (gfc_match_rvalue): Add extra arg to call to
+ gfc_match_structure_constructor.
+
+ * trans-array.c (gfc_conv_resolve_dependencies): If lhs and rhs
+ are the same symbol, aliassing does not matter.
+
+2008-07-29 Jan Hubicka <jh@suse.cz>
+
+ * options.c (gfc_post_options): Do not set flag_no_inline.
+
+2008-07-29 Daniel Kraft <d@domob.eu>
+
+ PR fortran/36403
+ * trans-intrinsic.c (conv_generic_with_optional_char_arg): New method
+ to append a string-length even if the string argument is missing, e.g.
+ for EOSHIFT.
+ (gfc_conv_intrinsic_function): Call the new method for EOSHIFT, PACK
+ and RESHAPE.
+
+2008-07-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gfortran.h (try): Remove macro. Replace try with gfc_try
+ throughout.
+ * array.c: Likewise.
+ * check.c: Likewise.
+ * cpp.c: Likewise.
+ * cpp.h: Likewise.
+ * data.c: Likewise.
+ * data.h: Likewise.
+ * decl.c: Likewise.
+ * error.c: Likewise.
+ * expr.c: Likewise.
+ * interface.c: Likewise.
+ * intrinsic.c: Likewise.
+ * intrinsic.h: Likewise.
+ * io.c: Likewise.
+ * match.h: Likewise.
+ * parse.c: Likewise.
+ * parse.h: Likewise.
+ * resolve.c: Likewise.
+ * scanner.c: Likewise.
+ * simplify.c: Likewise.
+ * symbol.c: Likewise.
+ * trans-openmp.c: Likewise.
+ * trans-types.c: Likewise.
+
+2008-07-28 Tobias Burnus <burnus@net-b.de>
+
+ * Make-lang.in: Remove -Wno-* from fortran-warn.
+
+2008-07-28 Richard Guenther <rguenther@suse.de>
+
+ Merge from gimple-tuples-branch.
+
+ 2008-07-18 Aldy Hernandez <aldyh@redhat.com>
+
+ * trans-expr.c: Include gimple.h instead of tree-gimple.h.
+ * trans-array.c: Same.
+ * trans-openmp.c: Same.
+ * trans-stmt.c: Same.
+ * f95-lang.c: Same.
+ * trans-io.c: Same.
+ * trans-decl.c: Same.
+ * trans-intrinsic.c: Same.
+ * trans.c: Same. Include tree-iterator.h.
+ * Make-lang.in (trans.o): Depend on tree-iterator.h
+
+ 2008-07-14 Aldy Hernandez <aldyh@redhat.com>
+
+ * trans-array.h (gfc_conv_descriptor_data_set_internal):
+ Rename to gfc_conv_descriptor_data_set.
+ (gfc_conv_descriptor_data_set_tuples): Remove.
+ * trans-array.c (gfc_conv_descriptor_data_get): Rename
+ from gfc_conv_descriptor_data_set_internal.
+ Remove last argument to gfc_add_modify.
+ (gfc_trans_allocate_array_storage): Rename gfc_add_modify_expr to
+ gfc_add_modify.
+ (gfc_trans_create_temp_array): Same.
+ (gfc_conv_array_transpose): Same.
+ (gfc_grow_array): Same.
+ (gfc_put_offset_into_var): Same.
+ (gfc_trans_array_ctor_element): Same.
+ (gfc_trans_array_constructor_subarray): Same.
+ (gfc_trans_array_constructor_value): Same.
+ (gfc_trans_scalarized_loop_end): Same.
+ (gfc_array_init_size): Same.
+ (gfc_array_allocate): Same.
+ (gfc_trans_array_bounds): Same.
+ (gfc_trans_auto_array_allocation): Same.
+ (gfc_trans_g77_array): Same.
+ (gfc_trans_dummy_array_bias): Same.
+ (gfc_conv_expr_descriptor): Same.
+ (structure_alloc_comps): Same.
+ * trans-expr.c: Same.
+ * trans-openmp.c (gfc_omp_clause_default_ctor): Same.
+ Rename gfc_conv_descriptor_data_set_tuples to
+ gfc_conv_descriptor_data_set.
+ (gfc_omp_clause_copy_ctor): Change build_gimple_modify_stmt to
+ build2_v.
+ (gfc_omp_clause_assign_op): Same.
+ (gfc_trans_omp_array_reduction): Rename gfc_add_modify_expr to
+ gfc_add_modify.
+ (gfc_trans_omp_atomic): Same.
+ (gfc_trans_omp_do): Same. Change GIMPLE_MODIFY_STMT to MODIFY_EXPR.
+ Rename gfc_add_modify_stmt to gfc_add_modify.
+ * trans-stmt.c: Rename gfc_add_modify_expr to
+ gfc_add_modify.
+ * trans.c: Rename gfc_add_modify_expr to
+ gfc_add_modify.
+ (gfc_add_modify): Remove last argument.
+ Rename GIMPLE_MODIFY_STMT to MODIFY_EXPR.
+ * trans.h: Remove gfc_add_modify_expr, gfc_add_modify_stmt.
+ Add prototype for gfc_add_modify.
+ * f95-lang.c (union lang_tree_node): Rename GENERIC_NEXT to TREE_CHAIN.
+ * trans-decl.c: Rename gfc_add_modify_stmt to gfc_add_modify.
+ * trans-io.c: Same.
+ * trans-intrinsic.c: Same.
+
+ 2008-02-25 Aldy Hernandez <aldyh@redhat.com>
+
+ * Make-lang.in (fortran-warn): Add -Wno-format.
+
+ 2008-02-19 Diego Novillo <dnovillo@google.com>
+
+ http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00804.html
+
+ * fortran/Make-lang.in (fortran-warn): Remove.
+
+ 2007-11-22 Aldy Hernandez <aldyh@redhat.com>
+
+ * trans-expr.c (gfc_trans_string_copy): Use "void *" when building a
+ memset.
+
+ 2007-11-10 Aldy Hernandez <aldyh@redhat.com>
+
+ * Make-lang.in (fortran-warn): Set to -Wno-format.
+ * trans.c (gfc_trans_code): Update comment to say GENERIC.
+ Call tree_annotate_all_with_locus instead of annotate_all_with_locus.
+
+2008-07-27 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/36132
+ PR fortran/29952
+ PR fortran/36909
+ * trans.c (gfc_trans_runtime_check): Allow run-time warning besides
+ run-time error.
+ * trans.h (gfc_trans_runtime_check): Update declaration.
+ * trans-array.c (gfc_trans_array_ctor_element,gfc_trans_array_bound_check,
+ gfc_conv_array_ref,gfc_conv_ss_startstride,gfc_trans_dummy_array_bias):
+ Updated gfc_trans_runtime_check calls.
+ (gfc_conv_array_parameter): Implement flag_check_array_temporaries,
+ fix packing/unpacking for nonpresent optional actuals to optional
+ formals.
+ * trans-array.h (gfc_conv_array_parameter): Update declaration.
+ * trans-expr.c (gfc_conv_substring,gfc_trans_arrayfunc_assign,
+ gfc_conv_function_call): Updated gfc_trans_runtime_check calls.
+ (gfc_conv_function_call): Update gfc_conv_array_parameter calls.
+ * trans-expr.c (gfc_trans_goto): Updated gfc_trans_runtime_check
+ calls.
+ * trans-io.c (set_string,gfc_conv_intrinsic_repeat): Ditto.
+ (gfc_conv_intrinsic_transfer,gfc_conv_intrinsic_loc): Same for
+ gfc_conv_array_parameter.
+ * trans-intrinsics.c (gfc_conv_intrinsic_bound): Ditto.
+ * trans-decl.c (gfc_build_builtin_function_decls): Add
+ gfor_fndecl_runtime_warning_at.
+ * lang.opt: New option fcheck-array-temporaries.
+ * gfortran.h (gfc_options): New flag_check_array_temporaries.
+ * options.c (gfc_init_options, gfc_handle_option): Handle flag.
+ * invoke.texi: New option fcheck-array-temporaries.
+
+2008-07-24 Jan Hubicka <jh@suse.cz>
+
+ * fortran/options.c (gfc_post_options): Remove flag_unline_trees code.
+
+2008-07-24 Daniel Kraft <d@domob.eu>
+
+ PR fortran/33141
+ * lang.opt (Wnonstd-intrinsics): Removed option.
+ (Wintrinsics-std), (Wintrinsic-shadow): New options.
+ * invoke.texi (Option Summary): Removed -Wnonstd-intrinsics
+ from the list and added -Wintrinsics-std and -Wintrinsic-shadow.
+ (Error and Warning Options): Documented the new options and removed
+ the documentation for -Wnonstd-intrinsics.
+ * gfortran.h (gfc_option_t): New members warn_intrinsic_shadow and
+ warn_intrinsics_std, removed warn_nonstd_intrinsics.
+ (gfc_is_intrinsic): Renamed from gfc_intrinsic_name.
+ (gfc_warn_intrinsic_shadow), (gfc_check_intrinsic_standard): New.
+ * decl.c (match_procedure_decl): Replaced gfc_intrinsic_name by
+ the new name gfc_is_intrinsic.
+ (warn_intrinsic_shadow): New helper method.
+ (gfc_match_function_decl), (gfc_match_subroutine): Call the new method
+ warn_intrinsic_shadow to check the just-parsed procedure.
+ * expr.c (check_init_expr): Call new gfc_is_intrinsic to check whether
+ the function called is really an intrinsic in the selected standard.
+ * intrinsic.c (gfc_is_intrinsic): Renamed from gfc_intrinsic_name and
+ extended to take into account the selected standard settings when trying
+ to find out whether a symbol is an intrinsic or not.
+ (gfc_check_intrinsic_standard): Made public and extended.
+ (gfc_intrinsic_func_interface), (gfc_intrinsic_sub_interface): Removed
+ the calls to check_intrinsic_standard, this check now happens inside
+ gfc_is_intrinsic.
+ (gfc_warn_intrinsic_shadow): New method defined.
+ * options.c (gfc_init_options): Initialize new warning flags to false
+ and removed intialization of Wnonstd-intrinsics flag.
+ (gfc_post_options): Removed logic for Wnonstd-intrinsics flag.
+ (set_Wall): Set new warning flags and removed Wnonstd-intrinsics flag.
+ (gfc_handle_option): Handle the new flags and removed handling of the
+ old Wnonstd-intrinsics flag.
+ * primary.c (gfc_match_rvalue): Replaced call to gfc_intrinsic_name by
+ the new name gfc_is_intrinsic.
+ * resolve.c (resolve_actual_arglist): Ditto.
+ (resolve_generic_f), (resolve_unknown_f): Ditto.
+ (is_external_proc): Ditto.
+ (resolve_generic_s), (resolve_unknown_s): Ditto.
+ (resolve_symbol): Ditto and ensure for symbols declared INTRINSIC that
+ they are really available in the selected standard setting.
+
+2008-07-24 Daniel Kraft <d@domob.eu>
+
+ * match.c (gfc_match): Add assertion to catch wrong calls trying to
+ match upper-case characters.
+
+2008-07-24 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/29952
+ * gfortran.h: Add "warn_array_temp" to gfc_option_t.
+ * lang.opt: Add -Warray-temporaries.
+ * invoke.texi: Document -Warray-temporaries
+ * trans-array.h (gfc_trans_create_temp_array): Add argument of
+ type *locus.
+ (gfc_conv_loop_setup): Likewise.
+ * trans-array.c (gfc_trans_create_temp_array): If
+ -Warray-temporaries is given and locus is present, warn about
+ creation of array temporaries.
+ (gfc_trans_array_constructor_subarray): Add locus to call
+ of gfc_conv_loop_setup.
+ (gfc_trans_array_constructor): Add where argument. Pass where
+ argument to call of gfc_trans_create_temp_array.
+ (gfc_add_loop_ss_code): Add where argument. Pass where argument
+ to recursive call of gfc_add_loop_ss_code and to call of
+ gfc_trans_array_constructor.
+ (gfc_conv_loop_setup): Add where argument. Pass where argument
+ to calls to gfc_add_loop_ss_code and to gfc_trans_create_temp_array.
+ (gfc_conv_expr_descriptor): Pass location to call of
+ gfc_conv_loop_setup.
+ (gfc_conv_array_parameter): If -Warray-temporaries is given,
+ warn about creation of temporary arrays.
+ * trans-expr.c (gfc_conv_subref_array_arg): Add where argument
+ to call to gfc_conv_loop_setup.
+ (gfc_conv_function_call): Add where argument to call to
+ gfc_trans_creat_temp_array.
+ (gfc_trans_subarray_assign): Likewise.
+ (gfc_trans_assignment_1): Add where argument to call to
+ gfc_conv_loop_setup.
+ * trans-stmt.c (gfc_conv_elemental_dependencies): Add where
+ argument to call to gfc_trans_create_temp_array.
+ (gfc_trans_call): Add where argument to call to gfc_conv_loop_setup.
+ (generate_loop_for_temp_to_lhs): Likewise.
+ (generate_loop_for_rhs_to_temp): Likewise.
+ (compute_inner_temp_size): Likewise.
+ (gfc_trans-pointer_assign_need_temp): Likewise.
+ (gfc_evaluate_where_mask): Likewise.
+ (gfc_trans_where_assign): Likewise.
+ (gfc_trans_where_3): Likewise.
+ * trans-io.c (transfer_srray_component): Add where argument
+ to function. Add where argument to call to gfc_conv_loop_setup.
+ (transfer_expr): Add where argument to call to
+ transfer_array_component.
+ (gfc_trans_transfer): Add where expression to call to
+ gfc_conv_loop_setup.
+ * trans-intrinsic.c (gfc_conv_intrinsic_anyall): Add
+ where argument to call to gfc_conv_loop_setup.
+ (gfc_conv_intrinsic_count): Likewise.
+ (gfc_conv_intrinsic_arith): Likewise.
+ (gfc_conv_intrinsic_dot_product): Likewise.
+ (gfc_conv_intrinsic_minmaxloc): Likewise.
+ (gfc_conv_intrinsic_minmaxval): Likewise.
+ (gfc_conv_intrinsic_array_transfer): Warn about
+ creation of temporary array.
+ Add where argument to call to gfc_trans_create_temp_array.
+ * options.c (gfc_init_options): Initialize gfc_option.warn_array_temp.
+ (gfc_handle_option): Set gfc_option.warn_array_temp.
+
+2008-07-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 35058
+ * f95-lang.c (gfc_mark_addressable): All calls to pedwarn changed.
+
2008-07-22 Daniel Kraft <d@domob.eu>
PR fortran/29835
diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in
index b0944c94308..255f07e4f52 100644
--- a/gcc/fortran/Make-lang.in
+++ b/gcc/fortran/Make-lang.in
@@ -311,10 +311,10 @@ fortran/f95-lang.o: $(GFORTRAN_TRANS_DEPS) fortran/mathbuiltins.def \
$(BUILTINS_DEF) fortran/types.def
fortran/scanner.o: toplev.h fortran/cpp.h
fortran/convert.o: $(GFORTRAN_TRANS_DEPS)
-fortran/trans.o: $(GFORTRAN_TRANS_DEPS)
+fortran/trans.o: $(GFORTRAN_TRANS_DEPS) tree-iterator.h
fortran/trans-decl.o: $(GFORTRAN_TRANS_DEPS) gt-fortran-trans-decl.h \
- $(CGRAPH_H) $(TARGET_H) $(FUNCTION_H) $(FLAGS_H) $(RTL_H) $(TREE_GIMPLE_H) \
- $(TREE_DUMP_H)
+ $(CGRAPH_H) $(TARGET_H) $(FUNCTION_H) $(FLAGS_H) $(RTL_H) $(GIMPLE_H) \
+ $(TREE_DUMP_H) debug.h
fortran/trans-types.o: $(GFORTRAN_TRANS_DEPS) gt-fortran-trans-types.h \
$(REAL_H) toplev.h $(TARGET_H) $(FLAGS_H) dwarf2out.h
fortran/trans-const.o: $(GFORTRAN_TRANS_DEPS)
diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c
index 2e21b840e2a..34780b6fe03 100644
--- a/gcc/fortran/arith.c
+++ b/gcc/fortran/arith.c
@@ -1069,7 +1069,8 @@ gfc_arith_concat (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
gfc_expr *result;
int len;
- result = gfc_constant_result (BT_CHARACTER, gfc_default_character_kind,
+ gcc_assert (op1->ts.kind == op2->ts.kind);
+ result = gfc_constant_result (BT_CHARACTER, op1->ts.kind,
&op1->where);
len = op1->value.character.length + op2->value.character.length;
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c
index 7216d1f472e..d99ed9e30a0 100644
--- a/gcc/fortran/array.c
+++ b/gcc/fortran/array.c
@@ -208,7 +208,7 @@ gfc_free_array_spec (gfc_array_spec *as)
/* Take an array bound, resolves the expression, that make up the
shape and check associated constraints. */
-static try
+static gfc_try
resolve_array_bound (gfc_expr *e, int check_constant)
{
if (e == NULL)
@@ -232,7 +232,7 @@ resolve_array_bound (gfc_expr *e, int check_constant)
/* Takes an array specification, resolves the expressions that make up
the shape and make sure everything is integral. */
-try
+gfc_try
gfc_resolve_array_spec (gfc_array_spec *as, int check_constant)
{
gfc_expr *e;
@@ -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;
}
@@ -469,7 +473,7 @@ cleanup:
have that array specification. The error locus is needed in case
something goes wrong. On failure, the caller must free the spec. */
-try
+gfc_try
gfc_set_array_spec (gfc_symbol *sym, gfc_array_spec *as, locus *error_loc)
{
if (as == NULL)
@@ -1038,7 +1042,7 @@ check_element_type (gfc_expr *expr, bool convert)
/* Recursive work function for gfc_check_constructor_type(). */
-static try
+static gfc_try
check_constructor_type (gfc_constructor *c, bool convert)
{
gfc_expr *e;
@@ -1066,10 +1070,10 @@ check_constructor_type (gfc_constructor *c, bool convert)
/* Check that all elements of an array constructor are the same type.
On FAILURE, an error has been generated. */
-try
+gfc_try
gfc_check_constructor_type (gfc_expr *e)
{
- try t;
+ gfc_try t;
if (e->ts.type != BT_UNKNOWN)
{
@@ -1102,12 +1106,12 @@ cons_stack;
static cons_stack *base;
-static try check_constructor (gfc_constructor *, try (*) (gfc_expr *));
+static gfc_try check_constructor (gfc_constructor *, gfc_try (*) (gfc_expr *));
/* Check an EXPR_VARIABLE expression in a constructor to make sure
that that variable is an iteration variables. */
-try
+gfc_try
gfc_check_iter_variable (gfc_expr *expr)
{
gfc_symbol *sym;
@@ -1127,12 +1131,12 @@ gfc_check_iter_variable (gfc_expr *expr)
to calling the check function for each expression in the
constructor, giving variables with the names of iterators a pass. */
-static try
-check_constructor (gfc_constructor *c, try (*check_function) (gfc_expr *))
+static gfc_try
+check_constructor (gfc_constructor *c, gfc_try (*check_function) (gfc_expr *))
{
cons_stack element;
gfc_expr *e;
- try t;
+ gfc_try t;
for (; c; c = c->next)
{
@@ -1165,11 +1169,11 @@ check_constructor (gfc_constructor *c, try (*check_function) (gfc_expr *))
expression -- specification, restricted, or initialization as
determined by the check_function. */
-try
-gfc_check_constructor (gfc_expr *expr, try (*check_function) (gfc_expr *))
+gfc_try
+gfc_check_constructor (gfc_expr *expr, gfc_try (*check_function) (gfc_expr *))
{
cons_stack *base_save;
- try t;
+ gfc_try t;
base_save = base;
base = NULL;
@@ -1197,19 +1201,19 @@ typedef struct
gfc_component *component;
mpz_t *repeat;
- try (*expand_work_function) (gfc_expr *);
+ gfc_try (*expand_work_function) (gfc_expr *);
}
expand_info;
static expand_info current_expand;
-static try expand_constructor (gfc_constructor *);
+static gfc_try expand_constructor (gfc_constructor *);
/* Work function that counts the number of elements present in a
constructor. */
-static try
+static gfc_try
count_elements (gfc_expr *e)
{
mpz_t result;
@@ -1236,7 +1240,7 @@ count_elements (gfc_expr *e)
/* Work function that extracts a particular element from an array
constructor, freeing the rest. */
-static try
+static gfc_try
extract_element (gfc_expr *e)
{
@@ -1259,7 +1263,7 @@ extract_element (gfc_expr *e)
/* Work function that constructs a new constructor out of the old one,
stringing new elements together. */
-static try
+static gfc_try
expand (gfc_expr *e)
{
if (current_expand.new_head == NULL)
@@ -1307,7 +1311,7 @@ gfc_simplify_iterator_var (gfc_expr *e)
/* Expand an expression with that is inside of a constructor,
recursing into other constructors if present. */
-static try
+static gfc_try
expand_expr (gfc_expr *e)
{
if (e->expr_type == EXPR_ARRAY)
@@ -1325,13 +1329,13 @@ expand_expr (gfc_expr *e)
}
-static try
+static gfc_try
expand_iterator (gfc_constructor *c)
{
gfc_expr *start, *end, *step;
iterator_stack frame;
mpz_t trip;
- try t;
+ gfc_try t;
end = step = NULL;
@@ -1409,7 +1413,7 @@ cleanup:
expressions. The work function needs to either save or free the
passed expression. */
-static try
+static gfc_try
expand_constructor (gfc_constructor *c)
{
gfc_expr *e;
@@ -1452,12 +1456,12 @@ expand_constructor (gfc_constructor *c)
/* Top level subroutine for expanding constructors. We only expand
constructor if they are small enough. */
-try
+gfc_try
gfc_expand_constructor (gfc_expr *e)
{
expand_info expand_save;
gfc_expr *f;
- try rc;
+ gfc_try rc;
f = gfc_get_array_element (e, GFC_MAX_AC_EXPAND);
if (f != NULL)
@@ -1496,7 +1500,7 @@ done:
constant, after removal of any iteration variables. We return
FAILURE if not so. */
-static try
+static gfc_try
constant_element (gfc_expr *e)
{
int rv;
@@ -1518,7 +1522,7 @@ int
gfc_constant_ac (gfc_expr *e)
{
expand_info expand_save;
- try rc;
+ gfc_try rc;
iter_stack = NULL;
expand_save = current_expand;
@@ -1556,10 +1560,10 @@ gfc_expanded_ac (gfc_expr *e)
/* Recursive array list resolution function. All of the elements must
be of the same type. */
-static try
+static gfc_try
resolve_array_list (gfc_constructor *p)
{
- try t;
+ gfc_try t;
t = SUCCESS;
@@ -1581,7 +1585,7 @@ resolve_array_list (gfc_constructor *p)
all elements are of compile-time known length, emit an error as this is
invalid. */
-try
+gfc_try
gfc_resolve_character_array_constructor (gfc_expr *expr)
{
gfc_constructor *p;
@@ -1711,10 +1715,10 @@ got_charlen:
/* Resolve all of the expressions in an array list. */
-try
+gfc_try
gfc_resolve_array_constructor (gfc_expr *expr)
{
- try t;
+ gfc_try t;
t = resolve_array_list (expr->value.constructor);
if (t == SUCCESS)
@@ -1795,7 +1799,7 @@ gfc_get_array_element (gfc_expr *array, int element)
{
expand_info expand_save;
gfc_expr *e;
- try rc;
+ gfc_try rc;
expand_save = current_expand;
current_expand.extract_n = element;
@@ -1826,7 +1830,7 @@ gfc_get_array_element (gfc_expr *array, int element)
/* Get the size of single dimension of an array specification. The
array is guaranteed to be one dimensional. */
-try
+gfc_try
spec_dimen_size (gfc_array_spec *as, int dimen, mpz_t *result)
{
if (as == NULL)
@@ -1853,7 +1857,7 @@ spec_dimen_size (gfc_array_spec *as, int dimen, mpz_t *result)
}
-try
+gfc_try
spec_size (gfc_array_spec *as, mpz_t *result)
{
mpz_t size;
@@ -1879,11 +1883,11 @@ spec_size (gfc_array_spec *as, mpz_t *result)
/* Get the number of elements in an array section. */
-static try
+static gfc_try
ref_dimen_size (gfc_array_ref *ar, int dimen, mpz_t *result)
{
mpz_t upper, lower, stride;
- try t;
+ gfc_try t;
if (dimen < 0 || ar == NULL || dimen > ar->dimen - 1)
gfc_internal_error ("ref_dimen_size(): Bad dimension");
@@ -1967,7 +1971,7 @@ ref_dimen_size (gfc_array_ref *ar, int dimen, mpz_t *result)
}
-static try
+static gfc_try
ref_size (gfc_array_ref *ar, mpz_t *result)
{
mpz_t size;
@@ -1996,7 +2000,7 @@ ref_size (gfc_array_ref *ar, mpz_t *result)
able to return a result in the 'result' variable, FAILURE
otherwise. */
-try
+gfc_try
gfc_array_dimen_size (gfc_expr *array, int dimen, mpz_t *result)
{
gfc_ref *ref;
@@ -2064,13 +2068,13 @@ gfc_array_dimen_size (gfc_expr *array, int dimen, mpz_t *result)
array. Returns SUCCESS if this is possible, and sets the 'result'
variable. Otherwise returns FAILURE. */
-try
+gfc_try
gfc_array_size (gfc_expr *array, mpz_t *result)
{
expand_info expand_save;
gfc_ref *ref;
int i, flag;
- try t;
+ gfc_try t;
switch (array->expr_type)
{
@@ -2129,7 +2133,7 @@ gfc_array_size (gfc_expr *array, mpz_t *result)
/* Given an array reference, return the shape of the reference in an
array of mpz_t integers. */
-try
+gfc_try
gfc_array_ref_shape (gfc_array_ref *ar, mpz_t *shape)
{
int d;
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c
index 4132d83a785..1f9ce2fff6a 100644
--- a/gcc/fortran/check.c
+++ b/gcc/fortran/check.c
@@ -35,7 +35,7 @@ along with GCC; see the file COPYING3. If not see
/* Make sure an expression is a scalar. */
-static try
+static gfc_try
scalar_check (gfc_expr *e, int n)
{
if (e->rank == 0)
@@ -50,7 +50,7 @@ scalar_check (gfc_expr *e, int n)
/* Check the type of an expression. */
-static try
+static gfc_try
type_check (gfc_expr *e, int n, bt type)
{
if (e->ts.type == type)
@@ -66,7 +66,7 @@ type_check (gfc_expr *e, int n, bt type)
/* Check that the expression is a numeric type. */
-static try
+static gfc_try
numeric_check (gfc_expr *e, int n)
{
if (gfc_numeric_ts (&e->ts))
@@ -93,7 +93,7 @@ numeric_check (gfc_expr *e, int n)
/* Check that an expression is integer or real. */
-static try
+static gfc_try
int_or_real_check (gfc_expr *e, int n)
{
if (e->ts.type != BT_INTEGER && e->ts.type != BT_REAL)
@@ -110,7 +110,7 @@ int_or_real_check (gfc_expr *e, int n)
/* Check that an expression is real or complex. */
-static try
+static gfc_try
real_or_complex_check (gfc_expr *e, int n)
{
if (e->ts.type != BT_REAL && e->ts.type != BT_COMPLEX)
@@ -128,7 +128,7 @@ real_or_complex_check (gfc_expr *e, int n)
/* Check that the expression is an optional constant integer
and that it specifies a valid kind for that type. */
-static try
+static gfc_try
kind_check (gfc_expr *k, int n, bt type)
{
int kind;
@@ -164,7 +164,7 @@ kind_check (gfc_expr *k, int n, bt type)
/* Make sure the expression is a double precision real. */
-static try
+static gfc_try
double_check (gfc_expr *d, int n)
{
if (type_check (d, n, BT_REAL) == FAILURE)
@@ -184,7 +184,7 @@ double_check (gfc_expr *d, int n)
/* Make sure the expression is a logical array. */
-static try
+static gfc_try
logical_array_check (gfc_expr *array, int n)
{
if (array->ts.type != BT_LOGICAL || array->rank == 0)
@@ -201,7 +201,7 @@ logical_array_check (gfc_expr *array, int n)
/* Make sure an expression is an array. */
-static try
+static gfc_try
array_check (gfc_expr *e, int n)
{
if (e->rank != 0)
@@ -216,7 +216,7 @@ array_check (gfc_expr *e, int n)
/* Make sure two expressions have the same type. */
-static try
+static gfc_try
same_type_check (gfc_expr *e, int n, gfc_expr *f, int m)
{
if (gfc_compare_types (&e->ts, &f->ts))
@@ -232,7 +232,7 @@ same_type_check (gfc_expr *e, int n, gfc_expr *f, int m)
/* Make sure that an expression has a certain (nonzero) rank. */
-static try
+static gfc_try
rank_check (gfc_expr *e, int n, int rank)
{
if (e->rank == rank)
@@ -248,7 +248,7 @@ rank_check (gfc_expr *e, int n, int rank)
/* Make sure a variable expression is not an optional dummy argument. */
-static try
+static gfc_try
nonoptional_check (gfc_expr *e, int n)
{
if (e->expr_type == EXPR_VARIABLE && e->symtree->n.sym->attr.optional)
@@ -266,7 +266,7 @@ nonoptional_check (gfc_expr *e, int n)
/* Check that an expression has a particular kind. */
-static try
+static gfc_try
kind_value_check (gfc_expr *e, int n, int k)
{
if (e->ts.kind == k)
@@ -282,7 +282,7 @@ kind_value_check (gfc_expr *e, int n, int k)
/* Make sure an expression is a variable. */
-static try
+static gfc_try
variable_check (gfc_expr *e, int n)
{
if ((e->expr_type == EXPR_VARIABLE
@@ -309,7 +309,7 @@ variable_check (gfc_expr *e, int n)
/* Check the common DIM parameter for correctness. */
-static try
+static gfc_try
dim_check (gfc_expr *dim, int n, bool optional)
{
if (dim == NULL)
@@ -333,7 +333,7 @@ dim_check (gfc_expr *dim, int n, bool optional)
allow_assumed is zero then dim must be less than the rank of the array
for assumed size arrays. */
-static try
+static gfc_try
dim_rank_check (gfc_expr *dim, gfc_expr *array, int allow_assumed)
{
gfc_array_ref *ar;
@@ -396,7 +396,7 @@ identical_dimen_shape (gfc_expr *a, int ai, gfc_expr *b, int bi)
/* Check whether two character expressions have the same length;
returns SUCCESS if they have or if the length cannot be determined. */
-static try
+static gfc_try
check_same_strlen (const gfc_expr *a, const gfc_expr *b, const char *name)
{
long len_a, len_b;
@@ -434,7 +434,7 @@ check_same_strlen (const gfc_expr *a, const gfc_expr *b, const char *name)
/* Check subroutine suitable for intrinsics taking a real argument and
a kind argument for the result. */
-static try
+static gfc_try
check_a_kind (gfc_expr *a, gfc_expr *kind, bt type)
{
if (type_check (a, 0, BT_REAL) == FAILURE)
@@ -448,7 +448,7 @@ check_a_kind (gfc_expr *a, gfc_expr *kind, bt type)
/* Check subroutine suitable for ceiling, floor and nint. */
-try
+gfc_try
gfc_check_a_ikind (gfc_expr *a, gfc_expr *kind)
{
return check_a_kind (a, kind, BT_INTEGER);
@@ -457,14 +457,14 @@ gfc_check_a_ikind (gfc_expr *a, gfc_expr *kind)
/* Check subroutine suitable for aint, anint. */
-try
+gfc_try
gfc_check_a_xkind (gfc_expr *a, gfc_expr *kind)
{
return check_a_kind (a, kind, BT_REAL);
}
-try
+gfc_try
gfc_check_abs (gfc_expr *a)
{
if (numeric_check (a, 0) == FAILURE)
@@ -474,7 +474,7 @@ gfc_check_abs (gfc_expr *a)
}
-try
+gfc_try
gfc_check_achar (gfc_expr *a, gfc_expr *kind)
{
if (type_check (a, 0, BT_INTEGER) == FAILURE)
@@ -486,7 +486,7 @@ gfc_check_achar (gfc_expr *a, gfc_expr *kind)
}
-try
+gfc_try
gfc_check_access_func (gfc_expr *name, gfc_expr *mode)
{
if (type_check (name, 0, BT_CHARACTER) == FAILURE
@@ -505,7 +505,7 @@ gfc_check_access_func (gfc_expr *name, gfc_expr *mode)
}
-try
+gfc_try
gfc_check_all_any (gfc_expr *mask, gfc_expr *dim)
{
if (logical_array_check (mask, 0) == FAILURE)
@@ -518,7 +518,7 @@ gfc_check_all_any (gfc_expr *mask, gfc_expr *dim)
}
-try
+gfc_try
gfc_check_allocated (gfc_expr *array)
{
symbol_attribute attr;
@@ -545,7 +545,7 @@ gfc_check_allocated (gfc_expr *array)
/* Common check function where the first argument must be real or
integer and the second argument must be the same as the first. */
-try
+gfc_try
gfc_check_a_p (gfc_expr *a, gfc_expr *p)
{
if (int_or_real_check (a, 0) == FAILURE)
@@ -571,7 +571,7 @@ gfc_check_a_p (gfc_expr *a, gfc_expr *p)
}
-try
+gfc_try
gfc_check_x_yd (gfc_expr *x, gfc_expr *y)
{
if (double_check (x, 0) == FAILURE || double_check (y, 1) == FAILURE)
@@ -581,12 +581,12 @@ gfc_check_x_yd (gfc_expr *x, gfc_expr *y)
}
-try
+gfc_try
gfc_check_associated (gfc_expr *pointer, gfc_expr *target)
{
symbol_attribute attr1, attr2;
int i;
- try t;
+ gfc_try t;
locus *where;
where = &pointer->where;
@@ -664,7 +664,7 @@ null_arg:
}
-try
+gfc_try
gfc_check_atan2 (gfc_expr *y, gfc_expr *x)
{
if (type_check (y, 0, BT_REAL) == FAILURE)
@@ -678,7 +678,7 @@ gfc_check_atan2 (gfc_expr *y, gfc_expr *x)
/* BESJN and BESYN functions. */
-try
+gfc_try
gfc_check_besn (gfc_expr *n, gfc_expr *x)
{
if (type_check (n, 0, BT_INTEGER) == FAILURE)
@@ -691,7 +691,7 @@ gfc_check_besn (gfc_expr *n, gfc_expr *x)
}
-try
+gfc_try
gfc_check_btest (gfc_expr *i, gfc_expr *pos)
{
if (type_check (i, 0, BT_INTEGER) == FAILURE)
@@ -703,7 +703,7 @@ gfc_check_btest (gfc_expr *i, gfc_expr *pos)
}
-try
+gfc_try
gfc_check_char (gfc_expr *i, gfc_expr *kind)
{
if (type_check (i, 0, BT_INTEGER) == FAILURE)
@@ -715,7 +715,7 @@ gfc_check_char (gfc_expr *i, gfc_expr *kind)
}
-try
+gfc_try
gfc_check_chdir (gfc_expr *dir)
{
if (type_check (dir, 0, BT_CHARACTER) == FAILURE)
@@ -727,7 +727,7 @@ gfc_check_chdir (gfc_expr *dir)
}
-try
+gfc_try
gfc_check_chdir_sub (gfc_expr *dir, gfc_expr *status)
{
if (type_check (dir, 0, BT_CHARACTER) == FAILURE)
@@ -747,7 +747,7 @@ gfc_check_chdir_sub (gfc_expr *dir, gfc_expr *status)
}
-try
+gfc_try
gfc_check_chmod (gfc_expr *name, gfc_expr *mode)
{
if (type_check (name, 0, BT_CHARACTER) == FAILURE)
@@ -764,7 +764,7 @@ gfc_check_chmod (gfc_expr *name, gfc_expr *mode)
}
-try
+gfc_try
gfc_check_chmod_sub (gfc_expr *name, gfc_expr *mode, gfc_expr *status)
{
if (type_check (name, 0, BT_CHARACTER) == FAILURE)
@@ -790,7 +790,7 @@ gfc_check_chmod_sub (gfc_expr *name, gfc_expr *mode, gfc_expr *status)
}
-try
+gfc_try
gfc_check_cmplx (gfc_expr *x, gfc_expr *y, gfc_expr *kind)
{
if (numeric_check (x, 0) == FAILURE)
@@ -817,7 +817,7 @@ gfc_check_cmplx (gfc_expr *x, gfc_expr *y, gfc_expr *kind)
}
-try
+gfc_try
gfc_check_complex (gfc_expr *x, gfc_expr *y)
{
if (x->ts.type != BT_INTEGER && x->ts.type != BT_REAL)
@@ -844,7 +844,7 @@ gfc_check_complex (gfc_expr *x, gfc_expr *y)
}
-try
+gfc_try
gfc_check_count (gfc_expr *mask, gfc_expr *dim, gfc_expr *kind)
{
if (logical_array_check (mask, 0) == FAILURE)
@@ -862,7 +862,7 @@ gfc_check_count (gfc_expr *mask, gfc_expr *dim, gfc_expr *kind)
}
-try
+gfc_try
gfc_check_cshift (gfc_expr *array, gfc_expr *shift, gfc_expr *dim)
{
if (array_check (array, 0) == FAILURE)
@@ -893,7 +893,7 @@ gfc_check_cshift (gfc_expr *array, gfc_expr *shift, gfc_expr *dim)
}
-try
+gfc_try
gfc_check_ctime (gfc_expr *time)
{
if (scalar_check (time, 0) == FAILURE)
@@ -906,7 +906,7 @@ gfc_check_ctime (gfc_expr *time)
}
-try gfc_check_datan2 (gfc_expr *y, gfc_expr *x)
+gfc_try gfc_check_datan2 (gfc_expr *y, gfc_expr *x)
{
if (double_check (y, 0) == FAILURE || double_check (x, 1) == FAILURE)
return FAILURE;
@@ -914,7 +914,7 @@ try gfc_check_datan2 (gfc_expr *y, gfc_expr *x)
return SUCCESS;
}
-try
+gfc_try
gfc_check_dcmplx (gfc_expr *x, gfc_expr *y)
{
if (numeric_check (x, 0) == FAILURE)
@@ -938,7 +938,7 @@ gfc_check_dcmplx (gfc_expr *x, gfc_expr *y)
}
-try
+gfc_try
gfc_check_dble (gfc_expr *x)
{
if (numeric_check (x, 0) == FAILURE)
@@ -948,7 +948,7 @@ gfc_check_dble (gfc_expr *x)
}
-try
+gfc_try
gfc_check_digits (gfc_expr *x)
{
if (int_or_real_check (x, 0) == FAILURE)
@@ -958,7 +958,7 @@ gfc_check_digits (gfc_expr *x)
}
-try
+gfc_try
gfc_check_dot_product (gfc_expr *vector_a, gfc_expr *vector_b)
{
switch (vector_a->ts.type)
@@ -1000,7 +1000,7 @@ gfc_check_dot_product (gfc_expr *vector_a, gfc_expr *vector_b)
}
-try
+gfc_try
gfc_check_dprod (gfc_expr *x, gfc_expr *y)
{
if (type_check (x, 0, BT_REAL) == FAILURE
@@ -1027,7 +1027,7 @@ gfc_check_dprod (gfc_expr *x, gfc_expr *y)
}
-try
+gfc_try
gfc_check_eoshift (gfc_expr *array, gfc_expr *shift, gfc_expr *boundary,
gfc_expr *dim)
{
@@ -1092,7 +1092,7 @@ gfc_check_eoshift (gfc_expr *array, gfc_expr *shift, gfc_expr *boundary,
/* A single complex argument. */
-try
+gfc_try
gfc_check_fn_c (gfc_expr *a)
{
if (type_check (a, 0, BT_COMPLEX) == FAILURE)
@@ -1104,7 +1104,7 @@ gfc_check_fn_c (gfc_expr *a)
/* A single real argument. */
-try
+gfc_try
gfc_check_fn_r (gfc_expr *a)
{
if (type_check (a, 0, BT_REAL) == FAILURE)
@@ -1115,7 +1115,7 @@ gfc_check_fn_r (gfc_expr *a)
/* A single double argument. */
-try
+gfc_try
gfc_check_fn_d (gfc_expr *a)
{
if (double_check (a, 0) == FAILURE)
@@ -1126,7 +1126,7 @@ gfc_check_fn_d (gfc_expr *a)
/* A single real or complex argument. */
-try
+gfc_try
gfc_check_fn_rc (gfc_expr *a)
{
if (real_or_complex_check (a, 0) == FAILURE)
@@ -1136,7 +1136,7 @@ gfc_check_fn_rc (gfc_expr *a)
}
-try
+gfc_try
gfc_check_fnum (gfc_expr *unit)
{
if (type_check (unit, 0, BT_INTEGER) == FAILURE)
@@ -1149,7 +1149,7 @@ gfc_check_fnum (gfc_expr *unit)
}
-try
+gfc_try
gfc_check_huge (gfc_expr *x)
{
if (int_or_real_check (x, 0) == FAILURE)
@@ -1159,7 +1159,7 @@ gfc_check_huge (gfc_expr *x)
}
-try
+gfc_try
gfc_check_hypot (gfc_expr *x, gfc_expr *y)
{
if (type_check (x, 0, BT_REAL) == FAILURE)
@@ -1173,7 +1173,7 @@ gfc_check_hypot (gfc_expr *x, gfc_expr *y)
/* Check that the single argument is an integer. */
-try
+gfc_try
gfc_check_i (gfc_expr *i)
{
if (type_check (i, 0, BT_INTEGER) == FAILURE)
@@ -1183,7 +1183,7 @@ gfc_check_i (gfc_expr *i)
}
-try
+gfc_try
gfc_check_iand (gfc_expr *i, gfc_expr *j)
{
if (type_check (i, 0, BT_INTEGER) == FAILURE)
@@ -1203,7 +1203,7 @@ gfc_check_iand (gfc_expr *i, gfc_expr *j)
}
-try
+gfc_try
gfc_check_ibclr (gfc_expr *i, gfc_expr *pos)
{
if (type_check (i, 0, BT_INTEGER) == FAILURE)
@@ -1216,7 +1216,7 @@ gfc_check_ibclr (gfc_expr *i, gfc_expr *pos)
}
-try
+gfc_try
gfc_check_ibits (gfc_expr *i, gfc_expr *pos, gfc_expr *len)
{
if (type_check (i, 0, BT_INTEGER) == FAILURE)
@@ -1232,7 +1232,7 @@ gfc_check_ibits (gfc_expr *i, gfc_expr *pos, gfc_expr *len)
}
-try
+gfc_try
gfc_check_ibset (gfc_expr *i, gfc_expr *pos)
{
if (type_check (i, 0, BT_INTEGER) == FAILURE)
@@ -1245,7 +1245,7 @@ gfc_check_ibset (gfc_expr *i, gfc_expr *pos)
}
-try
+gfc_try
gfc_check_ichar_iachar (gfc_expr *c, gfc_expr *kind)
{
int i;
@@ -1316,7 +1316,7 @@ gfc_check_ichar_iachar (gfc_expr *c, gfc_expr *kind)
}
-try
+gfc_try
gfc_check_idnint (gfc_expr *a)
{
if (double_check (a, 0) == FAILURE)
@@ -1326,7 +1326,7 @@ gfc_check_idnint (gfc_expr *a)
}
-try
+gfc_try
gfc_check_ieor (gfc_expr *i, gfc_expr *j)
{
if (type_check (i, 0, BT_INTEGER) == FAILURE)
@@ -1346,7 +1346,7 @@ gfc_check_ieor (gfc_expr *i, gfc_expr *j)
}
-try
+gfc_try
gfc_check_index (gfc_expr *string, gfc_expr *substring, gfc_expr *back,
gfc_expr *kind)
{
@@ -1377,7 +1377,7 @@ gfc_check_index (gfc_expr *string, gfc_expr *substring, gfc_expr *back,
}
-try
+gfc_try
gfc_check_int (gfc_expr *x, gfc_expr *kind)
{
if (numeric_check (x, 0) == FAILURE)
@@ -1390,7 +1390,7 @@ gfc_check_int (gfc_expr *x, gfc_expr *kind)
}
-try
+gfc_try
gfc_check_intconv (gfc_expr *x)
{
if (numeric_check (x, 0) == FAILURE)
@@ -1400,7 +1400,7 @@ gfc_check_intconv (gfc_expr *x)
}
-try
+gfc_try
gfc_check_ior (gfc_expr *i, gfc_expr *j)
{
if (type_check (i, 0, BT_INTEGER) == FAILURE)
@@ -1420,7 +1420,7 @@ gfc_check_ior (gfc_expr *i, gfc_expr *j)
}
-try
+gfc_try
gfc_check_ishft (gfc_expr *i, gfc_expr *shift)
{
if (type_check (i, 0, BT_INTEGER) == FAILURE
@@ -1431,7 +1431,7 @@ gfc_check_ishft (gfc_expr *i, gfc_expr *shift)
}
-try
+gfc_try
gfc_check_ishftc (gfc_expr *i, gfc_expr *shift, gfc_expr *size)
{
if (type_check (i, 0, BT_INTEGER) == FAILURE
@@ -1445,7 +1445,7 @@ gfc_check_ishftc (gfc_expr *i, gfc_expr *shift, gfc_expr *size)
}
-try
+gfc_try
gfc_check_kill (gfc_expr *pid, gfc_expr *sig)
{
if (type_check (pid, 0, BT_INTEGER) == FAILURE)
@@ -1458,7 +1458,7 @@ gfc_check_kill (gfc_expr *pid, gfc_expr *sig)
}
-try
+gfc_try
gfc_check_kill_sub (gfc_expr *pid, gfc_expr *sig, gfc_expr *status)
{
if (type_check (pid, 0, BT_INTEGER) == FAILURE)
@@ -1486,7 +1486,7 @@ gfc_check_kill_sub (gfc_expr *pid, gfc_expr *sig, gfc_expr *status)
}
-try
+gfc_try
gfc_check_kind (gfc_expr *x)
{
if (x->ts.type == BT_DERIVED)
@@ -1501,7 +1501,7 @@ gfc_check_kind (gfc_expr *x)
}
-try
+gfc_try
gfc_check_lbound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind)
{
if (array_check (array, 0) == FAILURE)
@@ -1527,7 +1527,7 @@ gfc_check_lbound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind)
}
-try
+gfc_try
gfc_check_len_lentrim (gfc_expr *s, gfc_expr *kind)
{
if (type_check (s, 0, BT_CHARACTER) == FAILURE)
@@ -1544,7 +1544,7 @@ gfc_check_len_lentrim (gfc_expr *s, gfc_expr *kind)
}
-try
+gfc_try
gfc_check_lge_lgt_lle_llt (gfc_expr *a, gfc_expr *b)
{
if (type_check (a, 0, BT_CHARACTER) == FAILURE)
@@ -1561,7 +1561,7 @@ gfc_check_lge_lgt_lle_llt (gfc_expr *a, gfc_expr *b)
}
-try
+gfc_try
gfc_check_link (gfc_expr *path1, gfc_expr *path2)
{
if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
@@ -1578,7 +1578,7 @@ gfc_check_link (gfc_expr *path1, gfc_expr *path2)
}
-try
+gfc_try
gfc_check_link_sub (gfc_expr *path1, gfc_expr *path2, gfc_expr *status)
{
if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
@@ -1604,14 +1604,14 @@ gfc_check_link_sub (gfc_expr *path1, gfc_expr *path2, gfc_expr *status)
}
-try
+gfc_try
gfc_check_loc (gfc_expr *expr)
{
return variable_check (expr, 0);
}
-try
+gfc_try
gfc_check_symlnk (gfc_expr *path1, gfc_expr *path2)
{
if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
@@ -1628,7 +1628,7 @@ gfc_check_symlnk (gfc_expr *path1, gfc_expr *path2)
}
-try
+gfc_try
gfc_check_symlnk_sub (gfc_expr *path1, gfc_expr *path2, gfc_expr *status)
{
if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
@@ -1654,7 +1654,7 @@ gfc_check_symlnk_sub (gfc_expr *path1, gfc_expr *path2, gfc_expr *status)
}
-try
+gfc_try
gfc_check_logical (gfc_expr *a, gfc_expr *kind)
{
if (type_check (a, 0, BT_LOGICAL) == FAILURE)
@@ -1668,7 +1668,7 @@ gfc_check_logical (gfc_expr *a, gfc_expr *kind)
/* Min/max family. */
-static try
+static gfc_try
min_max_args (gfc_actual_arglist *arg)
{
if (arg == NULL || arg->next == NULL)
@@ -1682,7 +1682,7 @@ min_max_args (gfc_actual_arglist *arg)
}
-static try
+static gfc_try
check_rest (bt type, int kind, gfc_actual_arglist *arglist)
{
gfc_actual_arglist *arg, *tmp;
@@ -1727,7 +1727,7 @@ check_rest (bt type, int kind, gfc_actual_arglist *arglist)
}
-try
+gfc_try
gfc_check_min_max (gfc_actual_arglist *arg)
{
gfc_expr *x;
@@ -1755,21 +1755,21 @@ gfc_check_min_max (gfc_actual_arglist *arg)
}
-try
+gfc_try
gfc_check_min_max_integer (gfc_actual_arglist *arg)
{
return check_rest (BT_INTEGER, gfc_default_integer_kind, arg);
}
-try
+gfc_try
gfc_check_min_max_real (gfc_actual_arglist *arg)
{
return check_rest (BT_REAL, gfc_default_real_kind, arg);
}
-try
+gfc_try
gfc_check_min_max_double (gfc_actual_arglist *arg)
{
return check_rest (BT_REAL, gfc_default_double_kind, arg);
@@ -1778,7 +1778,7 @@ gfc_check_min_max_double (gfc_actual_arglist *arg)
/* End of min/max family. */
-try
+gfc_try
gfc_check_malloc (gfc_expr *size)
{
if (type_check (size, 0, BT_INTEGER) == FAILURE)
@@ -1791,7 +1791,7 @@ gfc_check_malloc (gfc_expr *size)
}
-try
+gfc_try
gfc_check_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b)
{
if ((matrix_a->ts.type != BT_LOGICAL) && !gfc_numeric_ts (&matrix_b->ts))
@@ -1870,7 +1870,7 @@ gfc_check_matmul (gfc_expr *matrix_a, gfc_expr *matrix_b)
I.e. in the case of minloc(array,mask), mask will be in the second
position of the argument list and we'll have to fix that up. */
-try
+gfc_try
gfc_check_minloc_maxloc (gfc_actual_arglist *ap)
{
gfc_expr *a, *m, *d;
@@ -1929,7 +1929,7 @@ gfc_check_minloc_maxloc (gfc_actual_arglist *ap)
I.e. in the case of minval(array,mask), mask will be in the second
position of the argument list and we'll have to fix that up. */
-static try
+static gfc_try
check_reduction (gfc_actual_arglist *ap)
{
gfc_expr *a, *m, *d;
@@ -1970,7 +1970,7 @@ check_reduction (gfc_actual_arglist *ap)
}
-try
+gfc_try
gfc_check_minval_maxval (gfc_actual_arglist *ap)
{
if (int_or_real_check (ap->expr, 0) == FAILURE
@@ -1981,7 +1981,7 @@ gfc_check_minval_maxval (gfc_actual_arglist *ap)
}
-try
+gfc_try
gfc_check_product_sum (gfc_actual_arglist *ap)
{
if (numeric_check (ap->expr, 0) == FAILURE
@@ -1992,7 +1992,7 @@ gfc_check_product_sum (gfc_actual_arglist *ap)
}
-try
+gfc_try
gfc_check_merge (gfc_expr *tsource, gfc_expr *fsource, gfc_expr *mask)
{
if (same_type_check (tsource, 0, fsource, 1) == FAILURE)
@@ -2008,7 +2008,7 @@ gfc_check_merge (gfc_expr *tsource, gfc_expr *fsource, gfc_expr *mask)
}
-try
+gfc_try
gfc_check_move_alloc (gfc_expr *from, gfc_expr *to)
{
symbol_attribute attr;
@@ -2068,7 +2068,7 @@ gfc_check_move_alloc (gfc_expr *from, gfc_expr *to)
}
-try
+gfc_try
gfc_check_nearest (gfc_expr *x, gfc_expr *s)
{
if (type_check (x, 0, BT_REAL) == FAILURE)
@@ -2081,7 +2081,7 @@ gfc_check_nearest (gfc_expr *x, gfc_expr *s)
}
-try
+gfc_try
gfc_check_new_line (gfc_expr *a)
{
if (type_check (a, 0, BT_CHARACTER) == FAILURE)
@@ -2091,7 +2091,7 @@ gfc_check_new_line (gfc_expr *a)
}
-try
+gfc_try
gfc_check_null (gfc_expr *mold)
{
symbol_attribute attr;
@@ -2116,7 +2116,7 @@ gfc_check_null (gfc_expr *mold)
}
-try
+gfc_try
gfc_check_pack (gfc_expr *array, gfc_expr *mask, gfc_expr *vector)
{
char buffer[80];
@@ -2148,7 +2148,7 @@ gfc_check_pack (gfc_expr *array, gfc_expr *mask, gfc_expr *vector)
}
-try
+gfc_try
gfc_check_precision (gfc_expr *x)
{
if (x->ts.type != BT_REAL && x->ts.type != BT_COMPLEX)
@@ -2163,7 +2163,7 @@ gfc_check_precision (gfc_expr *x)
}
-try
+gfc_try
gfc_check_present (gfc_expr *a)
{
gfc_symbol *sym;
@@ -2208,7 +2208,7 @@ gfc_check_present (gfc_expr *a)
}
-try
+gfc_try
gfc_check_radix (gfc_expr *x)
{
if (int_or_real_check (x, 0) == FAILURE)
@@ -2218,7 +2218,7 @@ gfc_check_radix (gfc_expr *x)
}
-try
+gfc_try
gfc_check_range (gfc_expr *x)
{
if (numeric_check (x, 0) == FAILURE)
@@ -2229,7 +2229,7 @@ gfc_check_range (gfc_expr *x)
/* real, float, sngl. */
-try
+gfc_try
gfc_check_real (gfc_expr *a, gfc_expr *kind)
{
if (numeric_check (a, 0) == FAILURE)
@@ -2242,7 +2242,7 @@ gfc_check_real (gfc_expr *a, gfc_expr *kind)
}
-try
+gfc_try
gfc_check_rename (gfc_expr *path1, gfc_expr *path2)
{
if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
@@ -2259,7 +2259,7 @@ gfc_check_rename (gfc_expr *path1, gfc_expr *path2)
}
-try
+gfc_try
gfc_check_rename_sub (gfc_expr *path1, gfc_expr *path2, gfc_expr *status)
{
if (type_check (path1, 0, BT_CHARACTER) == FAILURE)
@@ -2285,7 +2285,7 @@ gfc_check_rename_sub (gfc_expr *path1, gfc_expr *path2, gfc_expr *status)
}
-try
+gfc_try
gfc_check_repeat (gfc_expr *x, gfc_expr *y)
{
if (type_check (x, 0, BT_CHARACTER) == FAILURE)
@@ -2304,7 +2304,7 @@ gfc_check_repeat (gfc_expr *x, gfc_expr *y)
}
-try
+gfc_try
gfc_check_reshape (gfc_expr *source, gfc_expr *shape,
gfc_expr *pad, gfc_expr *order)
{
@@ -2383,7 +2383,7 @@ gfc_check_reshape (gfc_expr *source, gfc_expr *shape,
}
-try
+gfc_try
gfc_check_scale (gfc_expr *x, gfc_expr *i)
{
if (type_check (x, 0, BT_REAL) == FAILURE)
@@ -2396,7 +2396,7 @@ gfc_check_scale (gfc_expr *x, gfc_expr *i)
}
-try
+gfc_try
gfc_check_scan (gfc_expr *x, gfc_expr *y, gfc_expr *z, gfc_expr *kind)
{
if (type_check (x, 0, BT_CHARACTER) == FAILURE)
@@ -2422,7 +2422,7 @@ gfc_check_scan (gfc_expr *x, gfc_expr *y, gfc_expr *z, gfc_expr *kind)
}
-try
+gfc_try
gfc_check_secnds (gfc_expr *r)
{
if (type_check (r, 0, BT_REAL) == FAILURE)
@@ -2438,7 +2438,7 @@ gfc_check_secnds (gfc_expr *r)
}
-try
+gfc_try
gfc_check_selected_char_kind (gfc_expr *name)
{
if (type_check (name, 0, BT_CHARACTER) == FAILURE)
@@ -2454,7 +2454,7 @@ gfc_check_selected_char_kind (gfc_expr *name)
}
-try
+gfc_try
gfc_check_selected_int_kind (gfc_expr *r)
{
if (type_check (r, 0, BT_INTEGER) == FAILURE)
@@ -2467,7 +2467,7 @@ gfc_check_selected_int_kind (gfc_expr *r)
}
-try
+gfc_try
gfc_check_selected_real_kind (gfc_expr *p, gfc_expr *r)
{
if (p == NULL && r == NULL)
@@ -2488,7 +2488,7 @@ gfc_check_selected_real_kind (gfc_expr *p, gfc_expr *r)
}
-try
+gfc_try
gfc_check_set_exponent (gfc_expr *x, gfc_expr *i)
{
if (type_check (x, 0, BT_REAL) == FAILURE)
@@ -2501,7 +2501,7 @@ gfc_check_set_exponent (gfc_expr *x, gfc_expr *i)
}
-try
+gfc_try
gfc_check_shape (gfc_expr *source)
{
gfc_array_ref *ar;
@@ -2522,7 +2522,7 @@ gfc_check_shape (gfc_expr *source)
}
-try
+gfc_try
gfc_check_sign (gfc_expr *a, gfc_expr *b)
{
if (int_or_real_check (a, 0) == FAILURE)
@@ -2535,7 +2535,7 @@ gfc_check_sign (gfc_expr *a, gfc_expr *b)
}
-try
+gfc_try
gfc_check_size (gfc_expr *array, gfc_expr *dim, gfc_expr *kind)
{
if (array_check (array, 0) == FAILURE)
@@ -2562,14 +2562,14 @@ gfc_check_size (gfc_expr *array, gfc_expr *dim, gfc_expr *kind)
}
-try
+gfc_try
gfc_check_sizeof (gfc_expr *arg ATTRIBUTE_UNUSED)
{
return SUCCESS;
}
-try
+gfc_try
gfc_check_sleep_sub (gfc_expr *seconds)
{
if (type_check (seconds, 0, BT_INTEGER) == FAILURE)
@@ -2582,7 +2582,7 @@ gfc_check_sleep_sub (gfc_expr *seconds)
}
-try
+gfc_try
gfc_check_spread (gfc_expr *source, gfc_expr *dim, gfc_expr *ncopies)
{
if (source->rank >= GFC_MAX_DIMENSIONS)
@@ -2613,7 +2613,7 @@ gfc_check_spread (gfc_expr *source, gfc_expr *dim, gfc_expr *ncopies)
/* Functions for checking FGETC, FPUTC, FGET and FPUT (subroutines and
functions). */
-try
+gfc_try
gfc_check_fgetputc_sub (gfc_expr *unit, gfc_expr *c, gfc_expr *status)
{
if (type_check (unit, 0, BT_INTEGER) == FAILURE)
@@ -2639,14 +2639,14 @@ gfc_check_fgetputc_sub (gfc_expr *unit, gfc_expr *c, gfc_expr *status)
}
-try
+gfc_try
gfc_check_fgetputc (gfc_expr *unit, gfc_expr *c)
{
return gfc_check_fgetputc_sub (unit, c, NULL);
}
-try
+gfc_try
gfc_check_fgetput_sub (gfc_expr *c, gfc_expr *status)
{
if (type_check (c, 0, BT_CHARACTER) == FAILURE)
@@ -2666,14 +2666,14 @@ gfc_check_fgetput_sub (gfc_expr *c, gfc_expr *status)
}
-try
+gfc_try
gfc_check_fgetput (gfc_expr *c)
{
return gfc_check_fgetput_sub (c, NULL);
}
-try
+gfc_try
gfc_check_fseek_sub (gfc_expr *unit, gfc_expr *offset, gfc_expr *whence, gfc_expr *status)
{
if (type_check (unit, 0, BT_INTEGER) == FAILURE)
@@ -2711,7 +2711,7 @@ gfc_check_fseek_sub (gfc_expr *unit, gfc_expr *offset, gfc_expr *whence, gfc_exp
-try
+gfc_try
gfc_check_fstat (gfc_expr *unit, gfc_expr *array)
{
if (type_check (unit, 0, BT_INTEGER) == FAILURE)
@@ -2731,7 +2731,7 @@ gfc_check_fstat (gfc_expr *unit, gfc_expr *array)
}
-try
+gfc_try
gfc_check_fstat_sub (gfc_expr *unit, gfc_expr *array, gfc_expr *status)
{
if (type_check (unit, 0, BT_INTEGER) == FAILURE)
@@ -2761,7 +2761,7 @@ gfc_check_fstat_sub (gfc_expr *unit, gfc_expr *array, gfc_expr *status)
}
-try
+gfc_try
gfc_check_ftell (gfc_expr *unit)
{
if (type_check (unit, 0, BT_INTEGER) == FAILURE)
@@ -2774,7 +2774,7 @@ gfc_check_ftell (gfc_expr *unit)
}
-try
+gfc_try
gfc_check_ftell_sub (gfc_expr *unit, gfc_expr *offset)
{
if (type_check (unit, 0, BT_INTEGER) == FAILURE)
@@ -2793,7 +2793,7 @@ gfc_check_ftell_sub (gfc_expr *unit, gfc_expr *offset)
}
-try
+gfc_try
gfc_check_stat (gfc_expr *name, gfc_expr *array)
{
if (type_check (name, 0, BT_CHARACTER) == FAILURE)
@@ -2812,7 +2812,7 @@ gfc_check_stat (gfc_expr *name, gfc_expr *array)
}
-try
+gfc_try
gfc_check_stat_sub (gfc_expr *name, gfc_expr *array, gfc_expr *status)
{
if (type_check (name, 0, BT_CHARACTER) == FAILURE)
@@ -2841,7 +2841,7 @@ gfc_check_stat_sub (gfc_expr *name, gfc_expr *array, gfc_expr *status)
}
-try
+gfc_try
gfc_check_transfer (gfc_expr *source ATTRIBUTE_UNUSED,
gfc_expr *mold ATTRIBUTE_UNUSED, gfc_expr *size)
{
@@ -2868,7 +2868,7 @@ gfc_check_transfer (gfc_expr *source ATTRIBUTE_UNUSED,
}
-try
+gfc_try
gfc_check_transpose (gfc_expr *matrix)
{
if (rank_check (matrix, 0, 2) == FAILURE)
@@ -2878,7 +2878,7 @@ gfc_check_transpose (gfc_expr *matrix)
}
-try
+gfc_try
gfc_check_ubound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind)
{
if (array_check (array, 0) == FAILURE)
@@ -2904,7 +2904,7 @@ gfc_check_ubound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind)
}
-try
+gfc_try
gfc_check_unpack (gfc_expr *vector, gfc_expr *mask, gfc_expr *field)
{
if (rank_check (vector, 0, 1) == FAILURE)
@@ -2942,7 +2942,7 @@ gfc_check_unpack (gfc_expr *vector, gfc_expr *mask, gfc_expr *field)
}
-try
+gfc_try
gfc_check_verify (gfc_expr *x, gfc_expr *y, gfc_expr *z, gfc_expr *kind)
{
if (type_check (x, 0, BT_CHARACTER) == FAILURE)
@@ -2965,7 +2965,7 @@ gfc_check_verify (gfc_expr *x, gfc_expr *y, gfc_expr *z, gfc_expr *kind)
}
-try
+gfc_try
gfc_check_trim (gfc_expr *x)
{
if (type_check (x, 0, BT_CHARACTER) == FAILURE)
@@ -2978,7 +2978,7 @@ gfc_check_trim (gfc_expr *x)
}
-try
+gfc_try
gfc_check_ttynam (gfc_expr *unit)
{
if (scalar_check (unit, 0) == FAILURE)
@@ -2994,7 +2994,7 @@ gfc_check_ttynam (gfc_expr *unit)
/* Common check function for the half a dozen intrinsics that have a
single real argument. */
-try
+gfc_try
gfc_check_x (gfc_expr *x)
{
if (type_check (x, 0, BT_REAL) == FAILURE)
@@ -3006,7 +3006,7 @@ gfc_check_x (gfc_expr *x)
/************* Check functions for intrinsic subroutines *************/
-try
+gfc_try
gfc_check_cpu_time (gfc_expr *time)
{
if (scalar_check (time, 0) == FAILURE)
@@ -3022,7 +3022,7 @@ gfc_check_cpu_time (gfc_expr *time)
}
-try
+gfc_try
gfc_check_date_and_time (gfc_expr *date, gfc_expr *time,
gfc_expr *zone, gfc_expr *values)
{
@@ -3078,7 +3078,7 @@ gfc_check_date_and_time (gfc_expr *date, gfc_expr *time,
}
-try
+gfc_try
gfc_check_mvbits (gfc_expr *from, gfc_expr *frompos, gfc_expr *len,
gfc_expr *to, gfc_expr *topos)
{
@@ -3104,7 +3104,7 @@ gfc_check_mvbits (gfc_expr *from, gfc_expr *frompos, gfc_expr *len,
}
-try
+gfc_try
gfc_check_random_number (gfc_expr *harvest)
{
if (type_check (harvest, 0, BT_REAL) == FAILURE)
@@ -3117,7 +3117,7 @@ gfc_check_random_number (gfc_expr *harvest)
}
-try
+gfc_try
gfc_check_random_seed (gfc_expr *size, gfc_expr *put, gfc_expr *get)
{
unsigned int nargs = 0;
@@ -3197,7 +3197,7 @@ gfc_check_random_seed (gfc_expr *size, gfc_expr *put, gfc_expr *get)
}
-try
+gfc_try
gfc_check_second_sub (gfc_expr *time)
{
if (scalar_check (time, 0) == FAILURE)
@@ -3216,7 +3216,7 @@ gfc_check_second_sub (gfc_expr *time)
/* The arguments of SYSTEM_CLOCK are scalar, integer variables. Note,
count, count_rate, and count_max are all optional arguments */
-try
+gfc_try
gfc_check_system_clock (gfc_expr *count, gfc_expr *count_rate,
gfc_expr *count_max)
{
@@ -3273,7 +3273,7 @@ gfc_check_system_clock (gfc_expr *count, gfc_expr *count_rate,
}
-try
+gfc_try
gfc_check_irand (gfc_expr *x)
{
if (x == NULL)
@@ -3292,7 +3292,7 @@ gfc_check_irand (gfc_expr *x)
}
-try
+gfc_try
gfc_check_alarm_sub (gfc_expr *seconds, gfc_expr *handler, gfc_expr *status)
{
if (scalar_check (seconds, 0) == FAILURE)
@@ -3328,7 +3328,7 @@ gfc_check_alarm_sub (gfc_expr *seconds, gfc_expr *handler, gfc_expr *status)
}
-try
+gfc_try
gfc_check_rand (gfc_expr *x)
{
if (x == NULL)
@@ -3347,7 +3347,7 @@ gfc_check_rand (gfc_expr *x)
}
-try
+gfc_try
gfc_check_srand (gfc_expr *x)
{
if (scalar_check (x, 0) == FAILURE)
@@ -3363,7 +3363,7 @@ gfc_check_srand (gfc_expr *x)
}
-try
+gfc_try
gfc_check_ctime_sub (gfc_expr *time, gfc_expr *result)
{
if (scalar_check (time, 0) == FAILURE)
@@ -3380,7 +3380,7 @@ gfc_check_ctime_sub (gfc_expr *time, gfc_expr *result)
}
-try
+gfc_try
gfc_check_dtime_etime (gfc_expr *x)
{
if (array_check (x, 0) == FAILURE)
@@ -3402,7 +3402,7 @@ gfc_check_dtime_etime (gfc_expr *x)
}
-try
+gfc_try
gfc_check_dtime_etime_sub (gfc_expr *values, gfc_expr *time)
{
if (array_check (values, 0) == FAILURE)
@@ -3433,7 +3433,7 @@ gfc_check_dtime_etime_sub (gfc_expr *values, gfc_expr *time)
}
-try
+gfc_try
gfc_check_fdate_sub (gfc_expr *date)
{
if (type_check (date, 0, BT_CHARACTER) == FAILURE)
@@ -3445,7 +3445,7 @@ gfc_check_fdate_sub (gfc_expr *date)
}
-try
+gfc_try
gfc_check_gerror (gfc_expr *msg)
{
if (type_check (msg, 0, BT_CHARACTER) == FAILURE)
@@ -3457,7 +3457,7 @@ gfc_check_gerror (gfc_expr *msg)
}
-try
+gfc_try
gfc_check_getcwd_sub (gfc_expr *cwd, gfc_expr *status)
{
if (type_check (cwd, 0, BT_CHARACTER) == FAILURE)
@@ -3478,7 +3478,7 @@ gfc_check_getcwd_sub (gfc_expr *cwd, gfc_expr *status)
}
-try
+gfc_try
gfc_check_getarg (gfc_expr *pos, gfc_expr *value)
{
if (type_check (pos, 0, BT_INTEGER) == FAILURE)
@@ -3502,7 +3502,7 @@ gfc_check_getarg (gfc_expr *pos, gfc_expr *value)
}
-try
+gfc_try
gfc_check_getlog (gfc_expr *msg)
{
if (type_check (msg, 0, BT_CHARACTER) == FAILURE)
@@ -3514,7 +3514,7 @@ gfc_check_getlog (gfc_expr *msg)
}
-try
+gfc_try
gfc_check_exit (gfc_expr *status)
{
if (status == NULL)
@@ -3530,7 +3530,7 @@ gfc_check_exit (gfc_expr *status)
}
-try
+gfc_try
gfc_check_flush (gfc_expr *unit)
{
if (unit == NULL)
@@ -3546,7 +3546,7 @@ gfc_check_flush (gfc_expr *unit)
}
-try
+gfc_try
gfc_check_free (gfc_expr *i)
{
if (type_check (i, 0, BT_INTEGER) == FAILURE)
@@ -3559,7 +3559,7 @@ gfc_check_free (gfc_expr *i)
}
-try
+gfc_try
gfc_check_hostnm (gfc_expr *name)
{
if (type_check (name, 0, BT_CHARACTER) == FAILURE)
@@ -3571,7 +3571,7 @@ gfc_check_hostnm (gfc_expr *name)
}
-try
+gfc_try
gfc_check_hostnm_sub (gfc_expr *name, gfc_expr *status)
{
if (type_check (name, 0, BT_CHARACTER) == FAILURE)
@@ -3592,7 +3592,7 @@ gfc_check_hostnm_sub (gfc_expr *name, gfc_expr *status)
}
-try
+gfc_try
gfc_check_itime_idate (gfc_expr *values)
{
if (array_check (values, 0) == FAILURE)
@@ -3614,7 +3614,7 @@ gfc_check_itime_idate (gfc_expr *values)
}
-try
+gfc_try
gfc_check_ltime_gmtime (gfc_expr *time, gfc_expr *values)
{
if (type_check (time, 0, BT_INTEGER) == FAILURE)
@@ -3645,7 +3645,7 @@ gfc_check_ltime_gmtime (gfc_expr *time, gfc_expr *values)
}
-try
+gfc_try
gfc_check_ttynam_sub (gfc_expr *unit, gfc_expr *name)
{
if (scalar_check (unit, 0) == FAILURE)
@@ -3663,7 +3663,7 @@ gfc_check_ttynam_sub (gfc_expr *unit, gfc_expr *name)
}
-try
+gfc_try
gfc_check_isatty (gfc_expr *unit)
{
if (unit == NULL)
@@ -3679,7 +3679,7 @@ gfc_check_isatty (gfc_expr *unit)
}
-try
+gfc_try
gfc_check_isnan (gfc_expr *x)
{
if (type_check (x, 0, BT_REAL) == FAILURE)
@@ -3689,7 +3689,7 @@ gfc_check_isnan (gfc_expr *x)
}
-try
+gfc_try
gfc_check_perror (gfc_expr *string)
{
if (type_check (string, 0, BT_CHARACTER) == FAILURE)
@@ -3701,7 +3701,7 @@ gfc_check_perror (gfc_expr *string)
}
-try
+gfc_try
gfc_check_umask (gfc_expr *mask)
{
if (type_check (mask, 0, BT_INTEGER) == FAILURE)
@@ -3714,7 +3714,7 @@ gfc_check_umask (gfc_expr *mask)
}
-try
+gfc_try
gfc_check_umask_sub (gfc_expr *mask, gfc_expr *old)
{
if (type_check (mask, 0, BT_INTEGER) == FAILURE)
@@ -3736,7 +3736,7 @@ gfc_check_umask_sub (gfc_expr *mask, gfc_expr *old)
}
-try
+gfc_try
gfc_check_unlink (gfc_expr *name)
{
if (type_check (name, 0, BT_CHARACTER) == FAILURE)
@@ -3748,7 +3748,7 @@ gfc_check_unlink (gfc_expr *name)
}
-try
+gfc_try
gfc_check_unlink_sub (gfc_expr *name, gfc_expr *status)
{
if (type_check (name, 0, BT_CHARACTER) == FAILURE)
@@ -3769,7 +3769,7 @@ gfc_check_unlink_sub (gfc_expr *name, gfc_expr *status)
}
-try
+gfc_try
gfc_check_signal (gfc_expr *number, gfc_expr *handler)
{
if (scalar_check (number, 0) == FAILURE)
@@ -3793,7 +3793,7 @@ gfc_check_signal (gfc_expr *number, gfc_expr *handler)
}
-try
+gfc_try
gfc_check_signal_sub (gfc_expr *number, gfc_expr *handler, gfc_expr *status)
{
if (scalar_check (number, 0) == FAILURE)
@@ -3826,7 +3826,7 @@ gfc_check_signal_sub (gfc_expr *number, gfc_expr *handler, gfc_expr *status)
}
-try
+gfc_try
gfc_check_system_sub (gfc_expr *cmd, gfc_expr *status)
{
if (type_check (cmd, 0, BT_CHARACTER) == FAILURE)
@@ -3848,7 +3848,7 @@ gfc_check_system_sub (gfc_expr *cmd, gfc_expr *status)
/* This is used for the GNU intrinsics AND, OR and XOR. */
-try
+gfc_try
gfc_check_and (gfc_expr *i, gfc_expr *j)
{
if (i->ts.type != BT_INTEGER && i->ts.type != BT_LOGICAL)
diff --git a/gcc/fortran/cpp.c b/gcc/fortran/cpp.c
index 0498130396e..86e0335dc9f 100644
--- a/gcc/fortran/cpp.c
+++ b/gcc/fortran/cpp.c
@@ -574,7 +574,7 @@ gfc_cpp_init (void)
pp_dir_change (cpp_in, get_src_pwd ());
}
-try
+gfc_try
gfc_cpp_preprocess (const char *source_file)
{
if (!gfc_cpp_enabled ())
diff --git a/gcc/fortran/cpp.h b/gcc/fortran/cpp.h
index 6f409cc45ee..db245021110 100644
--- a/gcc/fortran/cpp.h
+++ b/gcc/fortran/cpp.h
@@ -36,7 +36,7 @@ int gfc_cpp_handle_option(size_t scode, const char *arg, int value);
void gfc_cpp_post_options (void);
-try gfc_cpp_preprocess (const char *source_file);
+gfc_try gfc_cpp_preprocess (const char *source_file);
void gfc_cpp_done (void);
diff --git a/gcc/fortran/data.c b/gcc/fortran/data.c
index bda448a8f56..09dde150b22 100644
--- a/gcc/fortran/data.c
+++ b/gcc/fortran/data.c
@@ -46,7 +46,7 @@ get_array_index (gfc_array_ref *ar, mpz_t *offset)
{
gfc_expr *e;
int i;
- try re;
+ gfc_try re;
mpz_t delta;
mpz_t tmp;
@@ -247,7 +247,7 @@ create_character_intializer (gfc_expr *init, gfc_typespec *ts,
LVALUE already has an initialization, we extend this, otherwise we
create a new one. */
-try
+gfc_try
gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index)
{
gfc_ref *ref;
diff --git a/gcc/fortran/data.h b/gcc/fortran/data.h
index a677a86e0e3..0d31a920e6d 100644
--- a/gcc/fortran/data.h
+++ b/gcc/fortran/data.h
@@ -19,6 +19,6 @@ along with GCC; see the file COPYING3. If not see
void gfc_formalize_init_value (gfc_symbol *);
void gfc_get_section_index (gfc_array_ref *, mpz_t *, mpz_t *);
-try gfc_assign_data_value (gfc_expr *, gfc_expr *, mpz_t);
+gfc_try gfc_assign_data_value (gfc_expr *, gfc_expr *, mpz_t);
void gfc_assign_data_value_range (gfc_expr *, gfc_expr *, mpz_t, mpz_t);
void gfc_advance_section (mpz_t *, gfc_array_ref *, mpz_t *);
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index aff1ebbaeb5..2b50ea33be8 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)
{
@@ -367,7 +372,7 @@ match_data_constant (gfc_expr **result)
return MATCH_ERROR;
}
else if (sym->attr.flavor == FL_DERIVED)
- return gfc_match_structure_constructor (sym, result);
+ return gfc_match_structure_constructor (sym, result, false);
/* Check to see if the value is an initialization array expression. */
if (sym->value->expr_type == EXPR_ARRAY)
@@ -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
@@ -867,11 +877,11 @@ get_proc_name (const char *name, gfc_symbol **result, bool module_fcn_entry)
the compiler could have automatically handled the varying sizes
across platforms. */
-try
+gfc_try
verify_c_interop_param (gfc_symbol *sym)
{
int is_c_interop = 0;
- try retval = SUCCESS;
+ gfc_try retval = SUCCESS;
/* We check implicitly typed variables in symbol.c:gfc_set_default_type().
Don't repeat the checks here. */
@@ -1009,7 +1019,7 @@ verify_c_interop_param (gfc_symbol *sym)
/* Function called by variable_decl() that adds a name to the symbol table. */
-static try
+static gfc_try
build_sym (const char *name, gfc_charlen *cl,
gfc_array_spec **as, locus *var_locus)
{
@@ -1185,7 +1195,7 @@ gfc_free_enum_history (void)
/* Function called by variable_decl() that adds an initialization
expression to a symbol. */
-static try
+static gfc_try
add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus)
{
symbol_attribute attr;
@@ -1362,7 +1372,7 @@ add_init_expr_to_sym (const char *name, gfc_expr **initp, locus *var_locus)
/* Function called by variable_decl() that adds a name to a structure
being built. */
-static try
+static gfc_try
build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
gfc_array_spec **as)
{
@@ -1393,19 +1403,19 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
c->ts = current_ts;
c->ts.cl = cl;
- gfc_set_component_attr (c, &current_attr);
+ c->attr = current_attr;
c->initializer = *init;
*init = NULL;
c->as = *as;
if (c->as != NULL)
- c->dimension = 1;
+ c->attr.dimension = 1;
*as = NULL;
/* Should this ever get more complicated, combine with similar section
in add_init_expr_to_sym into a separate function. */
- if (c->ts.type == BT_CHARACTER && !c->pointer && c->initializer && c->ts.cl
+ if (c->ts.type == BT_CHARACTER && !c->attr.pointer && c->initializer && c->ts.cl
&& c->ts.cl->length && c->ts.cl->length->expr_type == EXPR_CONSTANT)
{
int len;
@@ -1451,9 +1461,9 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
}
/* Check array components. */
- if (!c->dimension)
+ if (!c->attr.dimension)
{
- if (c->allocatable)
+ if (c->attr.allocatable)
{
gfc_error ("Allocatable component at %C must be an array");
return FAILURE;
@@ -1462,7 +1472,7 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
return SUCCESS;
}
- if (c->pointer)
+ if (c->attr.pointer)
{
if (c->as->type != AS_DEFERRED)
{
@@ -1471,7 +1481,7 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
return FAILURE;
}
}
- else if (c->allocatable)
+ else if (c->attr.allocatable)
{
if (c->as->type != AS_DEFERRED)
{
@@ -1548,7 +1558,7 @@ variable_decl (int elem)
gfc_charlen *cl;
locus var_locus;
match m;
- try t;
+ gfc_try t;
gfc_symbol *sym;
locus old_locus;
@@ -2786,7 +2796,7 @@ match_attr_spec (void)
decl_types d;
const char *attr;
match m;
- try t;
+ gfc_try t;
gfc_clear_attr (&current_attr);
start = gfc_current_locus;
@@ -3248,7 +3258,7 @@ cleanup:
(J3/04-007, section 15.4.1). If a binding label was given and
there is more than one argument (num_idents), it is an error. */
-try
+gfc_try
set_binding_label (char *dest_label, const char *sym_name, int num_idents)
{
if (num_idents > 1 && has_name_equals)
@@ -3288,10 +3298,10 @@ set_com_block_bind_c (gfc_common_head *com_block, int is_bind_c)
/* Verify that the given gfc_typespec is for a C interoperable type. */
-try
+gfc_try
verify_c_interop (gfc_typespec *ts, const char *name, locus *where)
{
- try t;
+ gfc_try t;
/* Make sure the kind used is appropriate for the type.
The f90_type is unknown if an integer constant was
@@ -3326,11 +3336,11 @@ verify_c_interop (gfc_typespec *ts, const char *name, locus *where)
interoperable type. Errors will be reported here, if
encountered. */
-try
+gfc_try
verify_com_block_vars_c_interop (gfc_common_head *com_block)
{
gfc_symbol *curr_sym = NULL;
- try retval = SUCCESS;
+ gfc_try retval = SUCCESS;
curr_sym = com_block->head;
@@ -3354,11 +3364,15 @@ verify_com_block_vars_c_interop (gfc_common_head *com_block)
/* Verify that a given BIND(C) symbol is C interoperable. If it is not,
an appropriate error message is reported. */
-try
+gfc_try
verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
int is_in_common, gfc_common_head *com_block)
{
- try retval = SUCCESS;
+ bool bind_c_function = false;
+ gfc_try retval = SUCCESS;
+
+ if (tmp_sym->attr.function && tmp_sym->attr.is_bind_c)
+ bind_c_function = true;
if (tmp_sym->attr.function && tmp_sym->result != NULL)
{
@@ -3375,7 +3389,7 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
tmp_sym->attr.is_c_interop = 1;
}
}
-
+
/* Here, we know we have the bind(c) attribute, so if we have
enough type info, then verify that it's a C interop kind.
The info could be in the symbol already, or possibly still in
@@ -3441,22 +3455,23 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
retval = FAILURE;
}
- /* If it is a BIND(C) function, make sure the return value is a
- scalar value. The previous tests in this function made sure
- the type is interoperable. */
- if (tmp_sym->attr.function == 1 && tmp_sym->as != NULL)
- gfc_error ("Return type of BIND(C) function '%s' at %L cannot "
- "be an array", tmp_sym->name, &(tmp_sym->declared_at));
-
- /* BIND(C) functions can not return a character string. */
- if (tmp_sym->attr.function == 1 && tmp_sym->ts.type == BT_CHARACTER)
- if (tmp_sym->ts.cl == NULL || tmp_sym->ts.cl->length == NULL
- || tmp_sym->ts.cl->length->expr_type != EXPR_CONSTANT
- || mpz_cmp_si (tmp_sym->ts.cl->length->value.integer, 1) != 0)
- gfc_error ("Return type of BIND(C) function '%s' at %L cannot "
+ }
+
+ /* If it is a BIND(C) function, make sure the return value is a
+ scalar value. The previous tests in this function made sure
+ the type is interoperable. */
+ if (bind_c_function && tmp_sym->as != NULL)
+ gfc_error ("Return type of BIND(C) function '%s' at %L cannot "
+ "be an array", tmp_sym->name, &(tmp_sym->declared_at));
+
+ /* BIND(C) functions can not return a character string. */
+ if (bind_c_function && tmp_sym->ts.type == BT_CHARACTER)
+ if (tmp_sym->ts.cl == NULL || tmp_sym->ts.cl->length == NULL
+ || tmp_sym->ts.cl->length->expr_type != EXPR_CONSTANT
+ || mpz_cmp_si (tmp_sym->ts.cl->length->value.integer, 1) != 0)
+ gfc_error ("Return type of BIND(C) function '%s' at %L cannot "
"be a character string", tmp_sym->name,
&(tmp_sym->declared_at));
- }
}
/* See if the symbol has been marked as private. If it has, make sure
@@ -3478,10 +3493,10 @@ verify_bind_c_sym (gfc_symbol *tmp_sym, gfc_typespec *ts,
the type is C interoperable. Errors are reported by the functions
used to set/test these fields. */
-try
+gfc_try
set_verify_bind_c_sym (gfc_symbol *tmp_sym, int num_idents)
{
- try retval = SUCCESS;
+ gfc_try retval = SUCCESS;
/* TODO: Do we need to make sure the vars aren't marked private? */
@@ -3499,10 +3514,10 @@ set_verify_bind_c_sym (gfc_symbol *tmp_sym, int num_idents)
/* Set the fields marking the given common block as BIND(C), including
a binding label, and report any errors encountered. */
-try
+gfc_try
set_verify_bind_c_com_block (gfc_common_head *com_block, int num_idents)
{
- try retval = SUCCESS;
+ gfc_try retval = SUCCESS;
/* destLabel, common name, typespec (which may have binding label). */
if (set_binding_label (com_block->binding_label, com_block->name, num_idents)
@@ -3519,7 +3534,7 @@ set_verify_bind_c_com_block (gfc_common_head *com_block, int num_idents)
/* Retrieve the list of one or more identifiers that the given bind(c)
attribute applies to. */
-try
+gfc_try
get_bind_c_idents (void)
{
char name[GFC_MAX_SYMBOL_LEN + 1];
@@ -3751,6 +3766,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 +3782,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 +3790,7 @@ loop:
if (gfc_match ("pure% ") == MATCH_YES)
{
if (gfc_add_pure (&current_attr, NULL) == FAILURE)
- return MATCH_ERROR;
+ goto error;
goto loop;
}
@@ -3780,19 +3798,26 @@ 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;
}
/* Copy attributes matched by gfc_match_prefix() to attributes on a symbol. */
-static try
+static gfc_try
copy_prefix (symbol_attribute *dest, locus *where)
{
if (current_attr.pure && gfc_add_pure (dest, where) == FAILURE)
@@ -4120,8 +4145,8 @@ match_procedure_decl (void)
/* Handle intrinsic procedures. */
if (!(proc_if->attr.external || proc_if->attr.use_assoc
|| proc_if->attr.if_source == IFSRC_IFBODY)
- && (gfc_intrinsic_name (proc_if->name, 0)
- || gfc_intrinsic_name (proc_if->name, 1)))
+ && (gfc_is_intrinsic (proc_if, 0, gfc_current_locus)
+ || gfc_is_intrinsic (proc_if, 1, gfc_current_locus)))
proc_if->attr.intrinsic = 1;
if (proc_if->attr.intrinsic
&& !gfc_intrinsic_actual_ok (proc_if->name, 0))
@@ -4300,6 +4325,8 @@ syntax:
/* General matcher for PROCEDURE declarations. */
+static match match_procedure_in_type (void);
+
match
gfc_match_procedure (void)
{
@@ -4318,9 +4345,12 @@ gfc_match_procedure (void)
m = match_procedure_in_interface ();
break;
case COMP_DERIVED:
- gfc_error ("Fortran 2003: Procedure components at %C are "
- "not yet implemented in gfortran");
+ gfc_error ("Fortran 2003: Procedure components at %C are not yet"
+ " implemented in gfortran");
return MATCH_ERROR;
+ case COMP_DERIVED_CONTAINS:
+ m = match_procedure_in_type ();
+ break;
default:
return MATCH_NO;
}
@@ -4336,6 +4366,22 @@ gfc_match_procedure (void)
}
+/* Warn if a matched procedure has the same name as an intrinsic; this is
+ simply a wrapper around gfc_warn_intrinsic_shadow that interprets the current
+ parser-state-stack to find out whether we're in a module. */
+
+static void
+warn_intrinsic_shadow (const gfc_symbol* sym, bool func)
+{
+ bool in_module;
+
+ in_module = (gfc_state_stack->previous
+ && gfc_state_stack->previous->state == COMP_MODULE);
+
+ gfc_warn_intrinsic_shadow (sym, in_module, func);
+}
+
+
/* Match a function declaration. */
match
@@ -4460,6 +4506,9 @@ gfc_match_function_decl (void)
sym->result = result;
}
+ /* Warn if this procedure has the same name as an intrinsic. */
+ warn_intrinsic_shadow (sym, true);
+
return MATCH_YES;
}
@@ -4842,6 +4891,9 @@ gfc_match_subroutine (void)
if (copy_prefix (&sym->attr, &sym->declared_at) == FAILURE)
return MATCH_ERROR;
+ /* Warn if it has the same name as an intrinsic. */
+ warn_intrinsic_shadow (sym, false);
+
return MATCH_YES;
}
@@ -5057,7 +5109,7 @@ gfc_match_end (gfc_statement *st)
block_name = gfc_current_block () == NULL
? NULL : gfc_current_block ()->name;
- if (state == COMP_CONTAINS)
+ if (state == COMP_CONTAINS || state == COMP_DERIVED_CONTAINS)
{
state = gfc_state_stack->previous->state;
block_name = gfc_state_stack->previous->sym == NULL
@@ -5104,6 +5156,7 @@ gfc_match_end (gfc_statement *st)
break;
case COMP_DERIVED:
+ case COMP_DERIVED_CONTAINS:
*st = ST_END_TYPE;
target = " type";
eos_ok = 0;
@@ -5781,9 +5834,12 @@ gfc_match_private (gfc_statement *st)
return MATCH_NO;
if (gfc_current_state () != COMP_MODULE
- && (gfc_current_state () != COMP_DERIVED
- || !gfc_state_stack->previous
- || gfc_state_stack->previous->state != COMP_MODULE))
+ && !(gfc_current_state () == COMP_DERIVED
+ && gfc_state_stack->previous
+ && gfc_state_stack->previous->state == COMP_MODULE)
+ && !(gfc_current_state () == COMP_DERIVED_CONTAINS
+ && gfc_state_stack->previous && gfc_state_stack->previous->previous
+ && gfc_state_stack->previous->previous->state == COMP_MODULE))
{
gfc_error ("PRIVATE statement at %C is only allowed in the "
"specification part of a module");
@@ -6228,6 +6284,49 @@ syntax:
}
+/* Check a derived type that is being extended. */
+static gfc_symbol*
+check_extended_derived_type (char *name)
+{
+ gfc_symbol *extended;
+
+ if (gfc_find_symbol (name, gfc_current_ns, 1, &extended))
+ {
+ gfc_error ("Ambiguous symbol in TYPE definition at %C");
+ return NULL;
+ }
+
+ if (!extended)
+ {
+ gfc_error ("No such symbol in TYPE definition at %C");
+ return NULL;
+ }
+
+ if (extended->attr.flavor != FL_DERIVED)
+ {
+ gfc_error ("'%s' in EXTENDS expression at %C is not a "
+ "derived type", name);
+ return NULL;
+ }
+
+ if (extended->attr.is_bind_c)
+ {
+ gfc_error ("'%s' cannot be extended at %C because it "
+ "is BIND(C)", extended->name);
+ return NULL;
+ }
+
+ if (extended->attr.sequence)
+ {
+ gfc_error ("'%s' cannot be extended at %C because it "
+ "is a SEQUENCE type", extended->name);
+ return NULL;
+ }
+
+ return extended;
+}
+
+
/* Match the optional attribute specifiers for a type declaration.
Return MATCH_ERROR if an error is encountered in one of the handled
attributes (public, private, bind(c)), MATCH_NO if what's found is
@@ -6235,7 +6334,7 @@ syntax:
checking on attribute conflicts needs to be done. */
match
-gfc_get_type_attr_spec (symbol_attribute *attr)
+gfc_get_type_attr_spec (symbol_attribute *attr, char *name)
{
/* See if the derived type is marked as private. */
if (gfc_match (" , private") == MATCH_YES)
@@ -6273,6 +6372,11 @@ gfc_get_type_attr_spec (symbol_attribute *attr)
/* TODO: attr conflicts need to be checked, probably in symbol.c. */
}
+ else if (name && gfc_match(" , extends ( %n )", name) == MATCH_YES)
+ {
+ if (gfc_add_extension (attr, &gfc_current_locus) == FAILURE)
+ return MATCH_ERROR;
+ }
else
return MATCH_NO;
@@ -6289,8 +6393,10 @@ match
gfc_match_derived_decl (void)
{
char name[GFC_MAX_SYMBOL_LEN + 1];
+ char parent[GFC_MAX_SYMBOL_LEN + 1];
symbol_attribute attr;
gfc_symbol *sym;
+ gfc_symbol *extended;
match m;
match is_type_attr_spec = MATCH_NO;
bool seen_attr = false;
@@ -6298,17 +6404,29 @@ gfc_match_derived_decl (void)
if (gfc_current_state () == COMP_DERIVED)
return MATCH_NO;
+ name[0] = '\0';
+ parent[0] = '\0';
gfc_clear_attr (&attr);
+ extended = NULL;
do
{
- is_type_attr_spec = gfc_get_type_attr_spec (&attr);
+ is_type_attr_spec = gfc_get_type_attr_spec (&attr, parent);
if (is_type_attr_spec == MATCH_ERROR)
return MATCH_ERROR;
if (is_type_attr_spec == MATCH_YES)
seen_attr = true;
} while (is_type_attr_spec == MATCH_YES);
+ /* 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);
+
+ if (parent[0] && !extended)
+ return MATCH_ERROR;
+
if (gfc_match (" ::") != MATCH_YES && seen_attr)
{
gfc_error ("Expected :: in TYPE definition at %C");
@@ -6361,10 +6479,34 @@ gfc_match_derived_decl (void)
if (attr.is_bind_c != 0)
sym->attr.is_bind_c = attr.is_bind_c;
+
/* Construct the f2k_derived namespace if it is not yet there. */
if (!sym->f2k_derived)
sym->f2k_derived = gfc_get_namespace (NULL, 0);
+
+ if (extended && !sym->components)
+ {
+ gfc_component *p;
+ gfc_symtree *st;
+
+ /* Add the extended derived type as the first component. */
+ gfc_add_component (sym, parent, &p);
+ sym->attr.extension = attr.extension;
+ extended->refs++;
+ gfc_set_sym_referenced (extended);
+
+ p->ts.type = BT_DERIVED;
+ p->ts.derived = extended;
+ p->initializer = gfc_default_initializer (&p->ts);
+
+ /* Provide the links between the extended type and its extension. */
+ if (!extended->f2k_derived)
+ extended->f2k_derived = gfc_get_namespace (NULL, 0);
+ st = gfc_new_symtree (&extended->f2k_derived->sym_root, sym->name);
+ st->n.sym = sym;
+ }
+
gfc_new_block = sym;
return MATCH_YES;
@@ -6378,7 +6520,7 @@ gfc_match_derived_decl (void)
is the case. Since there is no bounds-checking for Cray Pointees,
this will be okay. */
-try
+gfc_try
gfc_mod_pointee_as (gfc_array_spec *as)
{
as->cray_pointee = true; /* This will be useful to know later. */
@@ -6432,7 +6574,7 @@ enumerator_decl (void)
gfc_symbol *sym;
locus var_locus;
match m;
- try t;
+ gfc_try t;
locus old_locus;
initializer = NULL;
@@ -6515,7 +6657,7 @@ match
gfc_match_enumerator_def (void)
{
match m;
- try t;
+ gfc_try t;
gfc_clear_ts (&current_ts);
@@ -6575,6 +6717,271 @@ cleanup:
}
+
+/* Match binding attributes. */
+
+static match
+match_binding_attributes (gfc_typebound_proc* ba)
+{
+ bool found_passing = false;
+ match m;
+
+ /* Intialize to defaults. Do so even before the MATCH_NO check so that in
+ this case the defaults are in there. */
+ ba->access = ACCESS_UNKNOWN;
+ ba->pass_arg = NULL;
+ ba->pass_arg_num = 0;
+ ba->nopass = 0;
+ ba->non_overridable = 0;
+
+ /* If we find a comma, we believe there are binding attributes. */
+ if (gfc_match_char (',') == MATCH_NO)
+ return MATCH_NO;
+
+ do
+ {
+ /* NOPASS flag. */
+ m = gfc_match (" nopass");
+ if (m == MATCH_ERROR)
+ goto error;
+ if (m == MATCH_YES)
+ {
+ if (found_passing)
+ {
+ gfc_error ("Binding attributes already specify passing, illegal"
+ " NOPASS at %C");
+ goto error;
+ }
+
+ found_passing = true;
+ ba->nopass = 1;
+ continue;
+ }
+
+ /* NON_OVERRIDABLE flag. */
+ m = gfc_match (" non_overridable");
+ if (m == MATCH_ERROR)
+ goto error;
+ if (m == MATCH_YES)
+ {
+ if (ba->non_overridable)
+ {
+ gfc_error ("Duplicate NON_OVERRIDABLE at %C");
+ goto error;
+ }
+
+ ba->non_overridable = 1;
+ continue;
+ }
+
+ /* DEFERRED flag. */
+ /* TODO: Handle really once implemented. */
+ m = gfc_match (" deferred");
+ if (m == MATCH_ERROR)
+ goto error;
+ if (m == MATCH_YES)
+ {
+ gfc_error ("DEFERRED not yet implemented at %C");
+ goto error;
+ }
+
+ /* PASS possibly including argument. */
+ m = gfc_match (" pass");
+ if (m == MATCH_ERROR)
+ goto error;
+ if (m == MATCH_YES)
+ {
+ char arg[GFC_MAX_SYMBOL_LEN + 1];
+
+ if (found_passing)
+ {
+ gfc_error ("Binding attributes already specify passing, illegal"
+ " PASS at %C");
+ goto error;
+ }
+
+ m = gfc_match (" ( %n )", arg);
+ if (m == MATCH_ERROR)
+ goto error;
+ if (m == MATCH_YES)
+ ba->pass_arg = xstrdup (arg);
+ gcc_assert ((m == MATCH_YES) == (ba->pass_arg != NULL));
+
+ found_passing = true;
+ ba->nopass = 0;
+ continue;
+ }
+
+ /* Access specifier. */
+
+ m = gfc_match (" public");
+ if (m == MATCH_ERROR)
+ goto error;
+ if (m == MATCH_YES)
+ {
+ if (ba->access != ACCESS_UNKNOWN)
+ {
+ gfc_error ("Duplicate access-specifier at %C");
+ goto error;
+ }
+
+ ba->access = ACCESS_PUBLIC;
+ continue;
+ }
+
+ m = gfc_match (" private");
+ if (m == MATCH_ERROR)
+ goto error;
+ if (m == MATCH_YES)
+ {
+ if (ba->access != ACCESS_UNKNOWN)
+ {
+ gfc_error ("Duplicate access-specifier at %C");
+ goto error;
+ }
+
+ ba->access = ACCESS_PRIVATE;
+ continue;
+ }
+
+ /* Nothing matching found. */
+ gfc_error ("Expected binding attribute at %C");
+ goto error;
+ }
+ while (gfc_match_char (',') == MATCH_YES);
+
+ return MATCH_YES;
+
+error:
+ gfc_free (ba->pass_arg);
+ return MATCH_ERROR;
+}
+
+
+/* Match a PROCEDURE specific binding inside a derived type. */
+
+static match
+match_procedure_in_type (void)
+{
+ char name[GFC_MAX_SYMBOL_LEN + 1];
+ char target_buf[GFC_MAX_SYMBOL_LEN + 1];
+ char* target;
+ gfc_typebound_proc* tb;
+ bool seen_colons;
+ bool seen_attrs;
+ match m;
+ gfc_symtree* stree;
+ gfc_namespace* ns;
+ gfc_symbol* block;
+
+ /* Check current state. */
+ gcc_assert (gfc_state_stack->state == COMP_DERIVED_CONTAINS);
+ block = gfc_state_stack->previous->sym;
+ gcc_assert (block);
+
+ /* TODO: Really implement PROCEDURE(interface). */
+ if (gfc_match (" (") == MATCH_YES)
+ {
+ gfc_error ("Procedure with interface only allowed in abstract types at"
+ " %C");
+ return MATCH_ERROR;
+ }
+
+ /* Construct the data structure. */
+ tb = gfc_get_typebound_proc ();
+ tb->where = gfc_current_locus;
+
+ /* Match binding attributes. */
+ m = match_binding_attributes (tb);
+ if (m == MATCH_ERROR)
+ return m;
+ seen_attrs = (m == MATCH_YES);
+
+ /* Match the colons. */
+ m = gfc_match (" ::");
+ if (m == MATCH_ERROR)
+ return m;
+ seen_colons = (m == MATCH_YES);
+ if (seen_attrs && !seen_colons)
+ {
+ gfc_error ("Expected '::' after binding-attributes at %C");
+ return MATCH_ERROR;
+ }
+
+ /* Match the binding name. */
+ m = gfc_match_name (name);
+ if (m == MATCH_ERROR)
+ return m;
+ if (m == MATCH_NO)
+ {
+ gfc_error ("Expected binding name at %C");
+ return MATCH_ERROR;
+ }
+
+ /* Try to match the '=> target', if it's there. */
+ target = NULL;
+ m = gfc_match (" =>");
+ if (m == MATCH_ERROR)
+ return m;
+ if (m == MATCH_YES)
+ {
+ if (!seen_colons)
+ {
+ gfc_error ("'::' needed in PROCEDURE binding with explicit target"
+ " at %C");
+ return MATCH_ERROR;
+ }
+
+ m = gfc_match_name (target_buf);
+ if (m == MATCH_ERROR)
+ return m;
+ if (m == MATCH_NO)
+ {
+ gfc_error ("Expected binding target after '=>' at %C");
+ return MATCH_ERROR;
+ }
+ target = target_buf;
+ }
+
+ /* Now we should have the end. */
+ m = gfc_match_eos ();
+ if (m == MATCH_ERROR)
+ return m;
+ if (m == MATCH_NO)
+ {
+ gfc_error ("Junk after PROCEDURE declaration at %C");
+ return MATCH_ERROR;
+ }
+
+ /* If no target was found, it has the same name as the binding. */
+ if (!target)
+ target = name;
+
+ /* Get the namespace to insert the symbols into. */
+ ns = block->f2k_derived;
+ gcc_assert (ns);
+
+ /* See if we already have a binding with this name in the symtree which would
+ be an error. */
+ stree = gfc_find_symtree (ns->sym_root, name);
+ if (stree)
+ {
+ gfc_error ("There's already a procedure with binding name '%s' for the"
+ " derived type '%s' at %C", name, block->name);
+ return MATCH_ERROR;
+ }
+
+ /* Insert it and set attributes. */
+ if (gfc_get_sym_tree (name, ns, &stree))
+ return MATCH_ERROR;
+ if (gfc_get_sym_tree (target, gfc_current_ns, &tb->target))
+ return MATCH_ERROR;
+ stree->typebound = tb;
+
+ return MATCH_YES;
+}
+
+
/* Match a FINAL declaration inside a derived type. */
match
@@ -6585,18 +6992,20 @@ gfc_match_final_decl (void)
match m;
gfc_namespace* module_ns;
bool first, last;
+ gfc_symbol* block;
- if (gfc_state_stack->state != COMP_DERIVED)
+ if (gfc_state_stack->state != COMP_DERIVED_CONTAINS)
{
gfc_error ("FINAL declaration at %C must be inside a derived type "
- "definition!");
+ "CONTAINS section");
return MATCH_ERROR;
}
- gcc_assert (gfc_current_block ());
+ block = gfc_state_stack->previous->sym;
+ gcc_assert (block);
- if (!gfc_state_stack->previous
- || gfc_state_stack->previous->state != COMP_MODULE)
+ if (!gfc_state_stack->previous || !gfc_state_stack->previous->previous
+ || gfc_state_stack->previous->previous->state != COMP_MODULE)
{
gfc_error ("Derived type declaration with FINAL at %C must be in the"
" specification part of a MODULE");
@@ -6654,8 +7063,8 @@ gfc_match_final_decl (void)
return MATCH_ERROR;
/* 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)
+ for (f = block->f2k_derived->finalizers; f; f = f->next)
+ if (f->proc_sym == sym)
{
gfc_error ("'%s' at %C is already defined as FINAL procedure!",
name);
@@ -6663,13 +7072,14 @@ gfc_match_final_decl (void)
}
/* Add this symbol to the list of finalizers. */
- gcc_assert (gfc_current_block ()->f2k_derived);
+ gcc_assert (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;
+ f->next = block->f2k_derived->finalizers;
+ block->f2k_derived->finalizers = f;
first = false;
}
diff --git a/gcc/fortran/dependency.c b/gcc/fortran/dependency.c
index 558b7675873..e58c9aaa0e9 100644
--- a/gcc/fortran/dependency.c
+++ b/gcc/fortran/dependency.c
@@ -639,13 +639,13 @@ gfc_check_dependency (gfc_expr *expr1, gfc_expr *expr2, bool identical)
if (expr1->symtree->n.sym->attr.pointer)
return 1;
for (ref = expr1->ref; ref; ref = ref->next)
- if (ref->type == REF_COMPONENT && ref->u.c.component->pointer)
+ if (ref->type == REF_COMPONENT && ref->u.c.component->attr.pointer)
return 1;
if (expr2->symtree->n.sym->attr.pointer)
return 1;
for (ref = expr2->ref; ref; ref = ref->next)
- if (ref->type == REF_COMPONENT && ref->u.c.component->pointer)
+ if (ref->type == REF_COMPONENT && ref->u.c.component->attr.pointer)
return 1;
/* Otherwise distinct symbols have no dependencies. */
diff --git a/gcc/fortran/dump-parse-tree.c b/gcc/fortran/dump-parse-tree.c
index 80ddda20c54..c829ebddc3c 100644
--- a/gcc/fortran/dump-parse-tree.c
+++ b/gcc/fortran/dump-parse-tree.c
@@ -631,14 +631,14 @@ show_components (gfc_symbol *sym)
{
fprintf (dumpfile, "(%s ", c->name);
show_typespec (&c->ts);
- if (c->pointer)
+ if (c->attr.pointer)
fputs (" POINTER", dumpfile);
- if (c->dimension)
+ if (c->attr.dimension)
fputs (" DIMENSION", dumpfile);
fputc (' ', dumpfile);
show_array_spec (c->as);
- if (c->access)
- fprintf (dumpfile, " %s", gfc_code2string (access_types, c->access));
+ if (c->attr.access)
+ fprintf (dumpfile, " %s", gfc_code2string (access_types, c->attr.access));
fputc (')', dumpfile);
if (c->next != NULL)
fputc (' ', dumpfile);
diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c
index 4ef22d0cbc2..7a5fbd34711 100644
--- a/gcc/fortran/error.c
+++ b/gcc/fortran/error.c
@@ -754,7 +754,7 @@ gfc_notification_std (int std)
standard does not contain the requested bits. Return FAILURE if
an error is generated. */
-try
+gfc_try
gfc_notify_std (int std, const char *nocmsgid, ...)
{
va_list argp;
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 3dfd31b4183..b5a17c0d5d8 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -181,6 +181,10 @@ free_expr0 (gfc_expr *e)
gfc_free_actual_arglist (e->value.function.actual);
break;
+ case EXPR_COMPCALL:
+ gfc_free_actual_arglist (e->value.compcall.actual);
+ break;
+
case EXPR_VARIABLE:
break;
@@ -268,8 +272,8 @@ gfc_extract_int (gfc_expr *expr, int *result)
/* Recursively copy a list of reference structures. */
-static gfc_ref *
-copy_ref (gfc_ref *src)
+gfc_ref *
+gfc_copy_ref (gfc_ref *src)
{
gfc_array_ref *ar;
gfc_ref *dest;
@@ -299,7 +303,7 @@ copy_ref (gfc_ref *src)
break;
}
- dest->next = copy_ref (src->next);
+ dest->next = gfc_copy_ref (src->next);
return dest;
}
@@ -502,6 +506,12 @@ gfc_copy_expr (gfc_expr *p)
gfc_copy_actual_arglist (p->value.function.actual);
break;
+ case EXPR_COMPCALL:
+ q->value.compcall.actual =
+ gfc_copy_actual_arglist (p->value.compcall.actual);
+ q->value.compcall.tbp = p->value.compcall.tbp;
+ break;
+
case EXPR_STRUCTURE:
case EXPR_ARRAY:
q->value.constructor = gfc_copy_constructor (p->value.constructor);
@@ -514,7 +524,7 @@ gfc_copy_expr (gfc_expr *p)
q->shape = gfc_copy_shape (p->shape, p->rank);
- q->ref = copy_ref (p->ref);
+ q->ref = gfc_copy_ref (p->ref);
return q;
}
@@ -824,7 +834,7 @@ is_subref_array (gfc_expr * e)
/* Try to collapse intrinsic expressions. */
-static try
+static gfc_try
simplify_intrinsic_op (gfc_expr *p, int type)
{
gfc_intrinsic_op op;
@@ -960,7 +970,7 @@ simplify_intrinsic_op (gfc_expr *p, int type)
/* Subroutine to simplify constructor expressions. Mutually recursive
with gfc_simplify_expr(). */
-static try
+static gfc_try
simplify_constructor (gfc_constructor *c, int type)
{
gfc_expr *p;
@@ -996,7 +1006,7 @@ simplify_constructor (gfc_constructor *c, int type)
/* Pull a single array element out of an array constructor. */
-static try
+static gfc_try
find_array_element (gfc_constructor *cons, gfc_array_ref *ar,
gfc_constructor **rval)
{
@@ -1007,7 +1017,7 @@ find_array_element (gfc_constructor *cons, gfc_array_ref *ar,
mpz_t span;
mpz_t tmp;
gfc_expr *e;
- try t;
+ gfc_try t;
t = SUCCESS;
e = NULL;
@@ -1115,7 +1125,7 @@ remove_subobject_ref (gfc_expr *p, gfc_constructor *cons)
/* Pull an array section out of an array constructor. */
-static try
+static gfc_try
find_array_section (gfc_expr *expr, gfc_ref *ref)
{
int idx;
@@ -1142,7 +1152,7 @@ find_array_section (gfc_expr *expr, gfc_ref *ref)
gfc_expr *upper;
gfc_expr *lower;
gfc_constructor *vecsub[GFC_MAX_DIMENSIONS], *c;
- try t;
+ gfc_try t;
t = SUCCESS;
@@ -1373,7 +1383,7 @@ cleanup:
/* Pull a substring out of an expression. */
-static try
+static gfc_try
find_substring_ref (gfc_expr *p, gfc_expr **newp)
{
int end;
@@ -1405,7 +1415,7 @@ find_substring_ref (gfc_expr *p, gfc_expr **newp)
/* Simplify a subobject reference of a constructor. This occurs when
parameter variable values are substituted. */
-static try
+static gfc_try
simplify_const_ref (gfc_expr *p)
{
gfc_constructor *cons;
@@ -1443,7 +1453,7 @@ simplify_const_ref (gfc_expr *p)
cons = p->value.constructor;
for (; cons; cons = cons->next)
{
- cons->expr->ref = copy_ref (p->ref->next);
+ cons->expr->ref = gfc_copy_ref (p->ref->next);
simplify_const_ref (cons->expr);
}
}
@@ -1479,7 +1489,7 @@ simplify_const_ref (gfc_expr *p)
/* Simplify a chain of references. */
-static try
+static gfc_try
simplify_ref_chain (gfc_ref *ref, int type)
{
int n;
@@ -1517,11 +1527,11 @@ simplify_ref_chain (gfc_ref *ref, int type)
/* Try to substitute the value of a parameter variable. */
-static try
+static gfc_try
simplify_parameter_variable (gfc_expr *p, int type)
{
gfc_expr *e;
- try t;
+ gfc_try t;
e = gfc_copy_expr (p->symtree->n.sym->value);
if (e == NULL)
@@ -1531,7 +1541,7 @@ simplify_parameter_variable (gfc_expr *p, int type)
/* Do not copy subobject refs for constant. */
if (e->expr_type != EXPR_CONSTANT && p->ref != NULL)
- e->ref = copy_ref (p->ref);
+ e->ref = gfc_copy_ref (p->ref);
t = gfc_simplify_expr (e, type);
/* Only use the simplification if it eliminated all subobject references. */
@@ -1562,7 +1572,7 @@ simplify_parameter_variable (gfc_expr *p, int type)
Returns FAILURE on error, SUCCESS otherwise.
NOTE: Will return SUCCESS even if the expression can not be simplified. */
-try
+gfc_try
gfc_simplify_expr (gfc_expr *p, int type)
{
gfc_actual_arglist *ap;
@@ -1670,6 +1680,10 @@ gfc_simplify_expr (gfc_expr *p, int type)
return FAILURE;
break;
+
+ case EXPR_COMPCALL:
+ gcc_unreachable ();
+ break;
}
return SUCCESS;
@@ -1693,12 +1707,12 @@ et0 (gfc_expr *e)
/* Check an intrinsic arithmetic operation to see if it is consistent
with some type of expression. */
-static try check_init_expr (gfc_expr *);
+static gfc_try check_init_expr (gfc_expr *);
/* Scalarize an expression for an elemental intrinsic call. */
-static try
+static gfc_try
scalarize_intrinsic_call (gfc_expr *e)
{
gfc_actual_arglist *a, *b;
@@ -1831,8 +1845,8 @@ cleanup:
}
-static try
-check_intrinsic_op (gfc_expr *e, try (*check_function) (gfc_expr *))
+static gfc_try
+check_intrinsic_op (gfc_expr *e, gfc_try (*check_function) (gfc_expr *))
{
gfc_expr *op1 = e->value.op.op1;
gfc_expr *op2 = e->value.op.op2;
@@ -2155,12 +2169,11 @@ check_conversion (gfc_expr *e)
intrinsics in the context of initialization expressions. If
FAILURE is returned an error message has been generated. */
-static try
+static gfc_try
check_init_expr (gfc_expr *e)
{
match m;
- try t;
- gfc_intrinsic_sym *isym;
+ gfc_try t;
if (e == NULL)
return SUCCESS;
@@ -2179,7 +2192,12 @@ check_init_expr (gfc_expr *e)
if ((m = check_specification_function (e)) != MATCH_YES)
{
- if ((m = gfc_intrinsic_func_interface (e, 0)) != MATCH_YES)
+ gfc_intrinsic_sym* isym;
+ gfc_symbol* sym;
+
+ sym = e->symtree->n.sym;
+ if (!gfc_is_intrinsic (sym, 0, e->where)
+ || (m = gfc_intrinsic_func_interface (e, 0)) != MATCH_YES)
{
gfc_error ("Function '%s' in initialization expression at %L "
"must be an intrinsic or a specification function",
@@ -2201,7 +2219,7 @@ check_init_expr (gfc_expr *e)
/* Try to scalarize an elemental intrinsic function that has an
array argument. */
- isym = gfc_find_function (e->symtree->n.sym->name);
+ isym = gfc_find_function (e->symtree->n.sym->name);
if (isym && isym->elemental
&& (t = scalarize_intrinsic_call (e)) == SUCCESS)
break;
@@ -2330,7 +2348,7 @@ gfc_match_init_expr (gfc_expr **result)
{
gfc_expr *expr;
match m;
- try t;
+ gfc_try t;
m = gfc_match_expr (&expr);
if (m != MATCH_YES)
@@ -2371,13 +2389,13 @@ gfc_match_init_expr (gfc_expr **result)
}
-static try check_restricted (gfc_expr *);
+static gfc_try check_restricted (gfc_expr *);
/* Given an actual argument list, test to see that each argument is a
restricted expression and optionally if the expression type is
integer or character. */
-static try
+static gfc_try
restricted_args (gfc_actual_arglist *a)
{
for (; a; a = a->next)
@@ -2395,7 +2413,7 @@ restricted_args (gfc_actual_arglist *a)
/* Make sure a non-intrinsic function is a specification function. */
-static try
+static gfc_try
external_spec_function (gfc_expr *e)
{
gfc_symbol *f;
@@ -2437,7 +2455,7 @@ external_spec_function (gfc_expr *e)
/* Check to see that a function reference to an intrinsic is a
restricted expression. */
-static try
+static gfc_try
restricted_intrinsic (gfc_expr *e)
{
/* TODO: Check constraints on inquiry functions. 7.1.6.2 (7). */
@@ -2452,11 +2470,11 @@ restricted_intrinsic (gfc_expr *e)
cousin check_init_expr(), an error message is generated if we
return FAILURE. */
-static try
+static gfc_try
check_restricted (gfc_expr *e)
{
gfc_symbol *sym;
- try t;
+ gfc_try t;
if (e == NULL)
return SUCCESS;
@@ -2564,7 +2582,7 @@ check_restricted (gfc_expr *e)
/* Check to see that an expression is a specification expression. If
we return FAILURE, an error has been generated. */
-try
+gfc_try
gfc_specification_expr (gfc_expr *e)
{
@@ -2607,12 +2625,12 @@ gfc_specification_expr (gfc_expr *e)
/* Given two expressions, make sure that the arrays are conformable. */
-try
+gfc_try
gfc_check_conformance (const char *optype_msgid, gfc_expr *op1, gfc_expr *op2)
{
int op1_flag, op2_flag, d;
mpz_t op1_size, op2_size;
- try t;
+ gfc_try t;
if (op1->rank == 0 || op2->rank == 0)
return SUCCESS;
@@ -2657,7 +2675,7 @@ gfc_check_conformance (const char *optype_msgid, gfc_expr *op1, gfc_expr *op2)
/* Given an assignable expression and an arbitrary expression, make
sure that the assignment can take place. */
-try
+gfc_try
gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform)
{
gfc_symbol *sym;
@@ -2671,7 +2689,7 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform)
has_pointer = sym->attr.pointer;
for (ref = lvalue->ref; ref; ref = ref->next)
- if (ref->type == REF_COMPONENT && ref->u.c.component->pointer)
+ if (ref->type == REF_COMPONENT && ref->u.c.component->attr.pointer)
{
has_pointer = 1;
break;
@@ -2866,7 +2884,7 @@ gfc_check_assign (gfc_expr *lvalue, gfc_expr *rvalue, int conform)
we only check rvalue if it's not an assignment to NULL() or a
NULLIFY statement. */
-try
+gfc_try
gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
{
symbol_attribute attr;
@@ -2903,7 +2921,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
if (pointer)
check_intent_in = 0;
- if (ref->type == REF_COMPONENT && ref->u.c.component->pointer)
+ if (ref->type == REF_COMPONENT && ref->u.c.component->attr.pointer)
pointer = 1;
}
@@ -3014,11 +3032,11 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
/* Relative of gfc_check_assign() except that the lvalue is a single
symbol. Used for initialization assignments. */
-try
+gfc_try
gfc_check_assign_symbol (gfc_symbol *sym, gfc_expr *rvalue)
{
gfc_expr lvalue;
- try r;
+ gfc_try r;
memset (&lvalue, '\0', sizeof (gfc_expr));
@@ -3052,7 +3070,7 @@ gfc_default_initializer (gfc_typespec *ts)
/* See if we have a default initializer. */
for (c = ts->derived->components; c; c = c->next)
- if (c->initializer || c->allocatable)
+ if (c->initializer || c->attr.allocatable)
break;
if (!c)
@@ -3078,7 +3096,7 @@ gfc_default_initializer (gfc_typespec *ts)
if (c->initializer)
tail->expr = gfc_copy_expr (c->initializer);
- if (c->allocatable)
+ if (c->attr.allocatable)
{
tail->expr = gfc_get_expr ();
tail->expr->expr_type = EXPR_NULL;
@@ -3262,3 +3280,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 8e052aaf0d1..30cc98e86d7 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "flags.h"
#include "langhooks.h"
#include "langhooks-def.h"
@@ -62,7 +62,7 @@ GTY(())
union lang_tree_node
GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"),
- chain_next ("(union lang_tree_node *)GENERIC_NEXT (&%h.generic)")))
+ chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
{
union tree_node GTY((tag ("0"),
@@ -99,6 +99,7 @@ int global_bindings_p (void);
static void clear_binding_stack (void);
static void gfc_be_parse_file (int);
static alias_set_type gfc_get_alias_set (tree);
+static void gfc_init_ts (void);
#undef LANG_HOOKS_NAME
#undef LANG_HOOKS_INIT
@@ -112,6 +113,7 @@ static alias_set_type gfc_get_alias_set (tree);
#undef LANG_HOOKS_TYPE_FOR_MODE
#undef LANG_HOOKS_TYPE_FOR_SIZE
#undef LANG_HOOKS_GET_ALIAS_SET
+#undef LANG_HOOKS_INIT_TS
#undef LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE
#undef LANG_HOOKS_OMP_PREDETERMINED_SHARING
#undef LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR
@@ -134,10 +136,11 @@ static alias_set_type gfc_get_alias_set (tree);
#define LANG_HOOKS_POST_OPTIONS gfc_post_options
#define LANG_HOOKS_PRINT_IDENTIFIER gfc_print_identifier
#define LANG_HOOKS_PARSE_FILE gfc_be_parse_file
-#define LANG_HOOKS_MARK_ADDRESSABLE gfc_mark_addressable
-#define LANG_HOOKS_TYPE_FOR_MODE gfc_type_for_mode
-#define LANG_HOOKS_TYPE_FOR_SIZE gfc_type_for_size
-#define LANG_HOOKS_GET_ALIAS_SET gfc_get_alias_set
+#define LANG_HOOKS_MARK_ADDRESSABLE gfc_mark_addressable
+#define LANG_HOOKS_TYPE_FOR_MODE gfc_type_for_mode
+#define LANG_HOOKS_TYPE_FOR_SIZE gfc_type_for_size
+#define LANG_HOOKS_GET_ALIAS_SET gfc_get_alias_set
+#define LANG_HOOKS_INIT_TS gfc_init_ts
#define LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE gfc_omp_privatize_by_reference
#define LANG_HOOKS_OMP_PREDETERMINED_SHARING gfc_omp_predetermined_sharing
#define LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR gfc_omp_clause_default_ctor
@@ -604,7 +607,7 @@ gfc_mark_addressable (tree exp)
IDENTIFIER_POINTER (DECL_NAME (x)));
return false;
}
- pedwarn ("register variable %qs used in nested function",
+ 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 +632,7 @@ gfc_mark_addressable (tree exp)
}
#endif
- pedwarn ("address of register variable %qs requested",
+ pedwarn (input_location, 0, "address of register variable %qs requested",
IDENTIFIER_POINTER (DECL_NAME (x)));
}
@@ -1189,5 +1192,15 @@ gfc_init_builtin_functions (void)
#undef DEFINE_MATH_BUILTIN_C
#undef DEFINE_MATH_BUILTIN
+static void
+gfc_init_ts (void)
+{
+ tree_contains_struct[NAMESPACE_DECL][TS_DECL_NON_COMMON] = 1;
+ tree_contains_struct[NAMESPACE_DECL][TS_DECL_WITH_VIS] = 1;
+ tree_contains_struct[NAMESPACE_DECL][TS_DECL_WRTL] = 1;
+ tree_contains_struct[NAMESPACE_DECL][TS_DECL_COMMON] = 1;
+ tree_contains_struct[NAMESPACE_DECL][TS_DECL_MINIMAL] = 1;
+}
+
#include "gt-fortran-f95-lang.h"
#include "gtype-fortran.h"
diff --git a/gcc/fortran/gfc-internals.texi b/gcc/fortran/gfc-internals.texi
index 330db81c59c..e73d3b59f9a 100644
--- a/gcc/fortran/gfc-internals.texi
+++ b/gcc/fortran/gfc-internals.texi
@@ -34,11 +34,10 @@
Copyright @copyright{} @value{copyrights-gfortran} Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'' and ``Funding
-Free Software'', the Front-Cover
-texts being (a) (see below), and with the Back-Cover Texts being (b)
+Invariant Sections being ``Funding Free Software'', the Front-Cover
+Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
``GNU Free Documentation License''.
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 2c284657a09..d6443515567 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -114,8 +114,6 @@ io_kind;
following enum makes things much more readable. We also start
values off at one instead of zero. */
-/* FIXME: This macro is temporary until we convert everything. */
-#define try gfc_try
typedef enum
{ SUCCESS = 1, FAILURE }
gfc_try;
@@ -153,7 +151,7 @@ bt;
/* Expression node types. */
typedef enum
{ EXPR_OP = 1, EXPR_FUNCTION, EXPR_CONSTANT, EXPR_VARIABLE,
- EXPR_SUBSTRING, EXPR_STRUCTURE, EXPR_ARRAY, EXPR_NULL
+ EXPR_SUBSTRING, EXPR_STRUCTURE, EXPR_ARRAY, EXPR_NULL, EXPR_COMPCALL
}
expr_t;
@@ -640,6 +638,7 @@ typedef struct
unsigned untyped:1; /* No implicit type could be found. */
unsigned is_bind_c:1; /* say if is bound to C */
+ unsigned extension:1; /* extends a derived type */
/* These flags are both in the typespec and attribute. The attribute
list is what gets read from/written to a module file. The typespec
@@ -835,8 +834,7 @@ typedef struct gfc_component
const char *name;
gfc_typespec ts;
- int pointer, allocatable, dimension;
- gfc_access access;
+ symbol_attribute attr;
gfc_array_spec *as;
tree backend_decl;
@@ -993,6 +991,29 @@ typedef struct
}
gfc_user_op;
+
+/* Data needed for type-bound procedures. */
+typedef struct
+{
+ struct gfc_symtree* target;
+ locus where; /* Where the PROCEDURE definition was. */
+
+ gfc_access access;
+ char* pass_arg; /* Argument-name for PASS. NULL if not specified. */
+
+ /* Once resolved, we use the position of pass_arg in the formal arglist of
+ the binding-target procedure to identify it. The first argument has
+ number 1 here, the second 2, and so on. */
+ unsigned pass_arg_num;
+
+ unsigned nopass:1; /* Whether we have NOPASS (PASS otherwise). */
+ unsigned non_overridable:1;
+}
+gfc_typebound_proc;
+
+#define gfc_get_typebound_proc() XCNEW (gfc_typebound_proc)
+
+
/* Symbol nodes. These are important things. They are what the
standard refers to as "entities". The possibly multiple names that
refer to the same entity are accomplished by a binary tree of
@@ -1018,9 +1039,6 @@ typedef struct gfc_symbol
gfc_formal_arglist *formal;
struct gfc_namespace *formal_ns;
-
- /* The namespace containing type-associated procedure symbols. */
- /* TODO: Make this union with formal? */
struct gfc_namespace *f2k_derived;
struct gfc_expr *value; /* Parameter/Initializer value */
@@ -1114,6 +1132,36 @@ gfc_entry_list;
#define gfc_get_entry_list() \
(gfc_entry_list *) gfc_getmem(sizeof(gfc_entry_list))
+/* Lists of rename info for the USE statement. */
+
+typedef struct gfc_use_rename
+{
+ char local_name[GFC_MAX_SYMBOL_LEN + 1], use_name[GFC_MAX_SYMBOL_LEN + 1];
+ struct gfc_use_rename *next;
+ int found;
+ gfc_intrinsic_op op;
+ locus where;
+}
+gfc_use_rename;
+
+#define gfc_get_use_rename() XCNEW (gfc_use_rename);
+
+/* A list of all USE statements in a namespace. */
+
+typedef struct gfc_use_list
+{
+ const char *module_name;
+ int only_flag;
+ struct gfc_use_rename *rename;
+ locus where;
+ /* Next USE statement. */
+ struct gfc_use_list *next;
+}
+gfc_use_list;
+
+#define gfc_get_use_list() \
+ (gfc_use_list *) gfc_getmem(sizeof(gfc_use_list))
+
/* Within a namespace, symbols are pointed to by symtree nodes that
are linked together in a balanced binary tree. There can be
several symtrees pointing to the same symbol node via USE
@@ -1132,6 +1180,8 @@ typedef struct gfc_symtree
}
n;
+ /* Data for type-bound procedures; NULL if no type-bound procedure. */
+ gfc_typebound_proc* typebound;
}
gfc_symtree;
@@ -1212,6 +1262,9 @@ typedef struct gfc_namespace
/* A list of all alternate entry points to this procedure (or NULL). */
gfc_entry_list *entries;
+ /* A list of USE statements in this namespace. */
+ gfc_use_list *use_stmts;
+
/* Set to 1 if namespace is a BLOCK DATA program unit. */
int is_block_data;
@@ -1347,16 +1400,16 @@ gfc_intrinsic_arg;
typedef union
{
- try (*f0)(void);
- try (*f1)(struct gfc_expr *);
- try (*f1m)(gfc_actual_arglist *);
- try (*f2)(struct gfc_expr *, struct gfc_expr *);
- try (*f3)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *);
- try (*f3ml)(gfc_actual_arglist *);
- try (*f3red)(gfc_actual_arglist *);
- try (*f4)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *,
+ gfc_try (*f0)(void);
+ gfc_try (*f1)(struct gfc_expr *);
+ gfc_try (*f1m)(gfc_actual_arglist *);
+ gfc_try (*f2)(struct gfc_expr *, struct gfc_expr *);
+ gfc_try (*f3)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *);
+ gfc_try (*f3ml)(gfc_actual_arglist *);
+ gfc_try (*f3red)(gfc_actual_arglist *);
+ gfc_try (*f4)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *,
struct gfc_expr *);
- try (*f5)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *,
+ gfc_try (*f5)(struct gfc_expr *, struct gfc_expr *, struct gfc_expr *,
struct gfc_expr *, struct gfc_expr *);
}
gfc_check_f;
@@ -1429,11 +1482,13 @@ gfc_intrinsic_sym;
EXPR_FUNCTION Function call, symbol points to function's name
EXPR_CONSTANT A scalar constant: Logical, String, Real, Int or Complex
EXPR_VARIABLE An Lvalue with a root symbol and possible reference list
- which expresses structure, array and substring refs.
+ which expresses structure, array and substring refs.
EXPR_NULL The NULL pointer value (which also has a basic type).
EXPR_SUBSTRING A substring of a constant string
EXPR_STRUCTURE A structure constructor
- EXPR_ARRAY An array constructor. */
+ EXPR_ARRAY An array constructor.
+ EXPR_COMPCALL Function (or subroutine) call of a procedure pointer
+ component or type-bound procedure. */
#include <gmp.h>
#include <mpfr.h>
@@ -1448,7 +1503,8 @@ typedef struct gfc_expr
int rank;
mpz_t *shape; /* Can be NULL if shape is unknown at compile time */
- /* Nonnull for functions and structure constructors */
+ /* Nonnull for functions and structure constructors, the base object for
+ component-calls. */
gfc_symtree *symtree;
gfc_ref *ref;
@@ -1508,6 +1564,13 @@ typedef struct gfc_expr
struct
{
+ gfc_actual_arglist* actual;
+ gfc_symtree* tbp;
+ }
+ compcall;
+
+ struct
+ {
int length;
gfc_char_t *string;
}
@@ -1752,8 +1815,8 @@ gfc_forall_iterator;
typedef enum
{
EXEC_NOP = 1, EXEC_ASSIGN, EXEC_LABEL_ASSIGN, EXEC_POINTER_ASSIGN,
- EXEC_GOTO, EXEC_CALL, EXEC_ASSIGN_CALL, EXEC_RETURN, EXEC_ENTRY,
- EXEC_PAUSE, EXEC_STOP, EXEC_CONTINUE, EXEC_INIT_ASSIGN,
+ EXEC_GOTO, EXEC_CALL, EXEC_COMPCALL, EXEC_ASSIGN_CALL, EXEC_RETURN,
+ EXEC_ENTRY, EXEC_PAUSE, EXEC_STOP, EXEC_CONTINUE, EXEC_INIT_ASSIGN,
EXEC_IF, EXEC_ARITHMETIC_IF, EXEC_DO, EXEC_DO_WHILE, EXEC_SELECT,
EXEC_FORALL, EXEC_WHERE, EXEC_CYCLE, EXEC_EXIT,
EXEC_ALLOCATE, EXEC_DEALLOCATE,
@@ -1872,7 +1935,10 @@ typedef struct
int warn_surprising;
int warn_tabs;
int warn_underflow;
+ int warn_intrinsic_shadow;
+ int warn_intrinsics_std;
int warn_character_truncation;
+ int warn_array_temp;
int max_errors;
int flag_all_intrinsics;
@@ -1892,6 +1958,7 @@ typedef struct
int flag_automatic;
int flag_backslash;
int flag_backtrace;
+ int flag_check_array_temporaries;
int flag_allow_leading_underscore;
int flag_dump_core;
int flag_external_blas;
@@ -1914,7 +1981,6 @@ typedef struct
int warn_std;
int allow_std;
- int warn_nonstd_intrinsics;
int fshort_enums;
int convert;
int record_marker;
@@ -1959,10 +2025,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 *************************/
@@ -2008,7 +2084,7 @@ gfc_char_t gfc_peek_char (void);
char gfc_peek_ascii_char (void);
void gfc_error_recovery (void);
void gfc_gobble_whitespace (void);
-try gfc_new_file (void);
+gfc_try gfc_new_file (void);
const char * gfc_read_orig_filename (const char *, const char **);
extern gfc_source_form gfc_current_form;
@@ -2075,7 +2151,7 @@ int gfc_error_check (void);
int gfc_error_flag_test (void);
notification gfc_notification_std (int);
-try gfc_notify_std (int, const char *, ...) ATTRIBUTE_GCC_GFC(2,3);
+gfc_try gfc_notify_std (int, const char *, ...) ATTRIBUTE_GCC_GFC(2,3);
/* A general purpose syntax error. */
#define gfc_syntax_error(ST) \
@@ -2095,8 +2171,8 @@ arith gfc_check_integer_range (mpz_t p, int kind);
bool gfc_check_character_range (gfc_char_t, int);
/* trans-types.c */
-try gfc_validate_c_kind (gfc_typespec *);
-try gfc_check_any_c_kind (gfc_typespec *);
+gfc_try gfc_validate_c_kind (gfc_typespec *);
+gfc_try gfc_check_any_c_kind (gfc_typespec *);
int gfc_validate_kind (bt, int, bool);
extern int gfc_index_integer_kind;
extern int gfc_default_integer_kind;
@@ -2114,77 +2190,75 @@ extern int gfc_character_storage_size;
/* symbol.c */
void gfc_clear_new_implicit (void);
-try gfc_add_new_implicit_range (int, int);
-try gfc_merge_new_implicit (gfc_typespec *);
+gfc_try gfc_add_new_implicit_range (int, int);
+gfc_try gfc_merge_new_implicit (gfc_typespec *);
void gfc_set_implicit_none (void);
void gfc_check_function_type (gfc_namespace *);
bool gfc_is_intrinsic_typename (const char *);
gfc_typespec *gfc_get_default_type (gfc_symbol *, gfc_namespace *);
-try gfc_set_default_type (gfc_symbol *, int, gfc_namespace *);
-
-void gfc_set_component_attr (gfc_component *, symbol_attribute *);
-void gfc_get_component_attr (symbol_attribute *, gfc_component *);
+gfc_try gfc_set_default_type (gfc_symbol *, int, gfc_namespace *);
void gfc_set_sym_referenced (gfc_symbol *);
-try gfc_add_attribute (symbol_attribute *, locus *);
-try gfc_add_allocatable (symbol_attribute *, locus *);
-try gfc_add_dimension (symbol_attribute *, const char *, locus *);
-try gfc_add_external (symbol_attribute *, locus *);
-try gfc_add_intrinsic (symbol_attribute *, locus *);
-try gfc_add_optional (symbol_attribute *, locus *);
-try gfc_add_pointer (symbol_attribute *, locus *);
-try gfc_add_cray_pointer (symbol_attribute *, locus *);
-try gfc_add_cray_pointee (symbol_attribute *, locus *);
-try gfc_mod_pointee_as (gfc_array_spec *);
-try gfc_add_protected (symbol_attribute *, const char *, locus *);
-try gfc_add_result (symbol_attribute *, const char *, locus *);
-try gfc_add_save (symbol_attribute *, const char *, locus *);
-try gfc_add_threadprivate (symbol_attribute *, const char *, locus *);
-try gfc_add_saved_common (symbol_attribute *, locus *);
-try gfc_add_target (symbol_attribute *, locus *);
-try gfc_add_dummy (symbol_attribute *, const char *, locus *);
-try gfc_add_generic (symbol_attribute *, const char *, locus *);
-try gfc_add_common (symbol_attribute *, locus *);
-try gfc_add_in_common (symbol_attribute *, const char *, locus *);
-try gfc_add_in_equivalence (symbol_attribute *, const char *, locus *);
-try gfc_add_data (symbol_attribute *, const char *, locus *);
-try gfc_add_in_namelist (symbol_attribute *, const char *, locus *);
-try gfc_add_sequence (symbol_attribute *, const char *, locus *);
-try gfc_add_elemental (symbol_attribute *, locus *);
-try gfc_add_pure (symbol_attribute *, locus *);
-try gfc_add_recursive (symbol_attribute *, locus *);
-try gfc_add_function (symbol_attribute *, const char *, locus *);
-try gfc_add_subroutine (symbol_attribute *, const char *, locus *);
-try gfc_add_volatile (symbol_attribute *, const char *, locus *);
-try gfc_add_proc (symbol_attribute *attr, const char *name, locus *where);
-
-try gfc_add_access (symbol_attribute *, gfc_access, const char *, locus *);
-try gfc_add_is_bind_c(symbol_attribute *, const char *, locus *, int);
-try gfc_add_value (symbol_attribute *, const char *, locus *);
-try gfc_add_flavor (symbol_attribute *, sym_flavor, const char *, locus *);
-try gfc_add_entry (symbol_attribute *, const char *, locus *);
-try gfc_add_procedure (symbol_attribute *, procedure_type,
+gfc_try gfc_add_attribute (symbol_attribute *, locus *);
+gfc_try gfc_add_allocatable (symbol_attribute *, locus *);
+gfc_try gfc_add_dimension (symbol_attribute *, const char *, locus *);
+gfc_try gfc_add_external (symbol_attribute *, locus *);
+gfc_try gfc_add_intrinsic (symbol_attribute *, locus *);
+gfc_try gfc_add_optional (symbol_attribute *, locus *);
+gfc_try gfc_add_pointer (symbol_attribute *, locus *);
+gfc_try gfc_add_cray_pointer (symbol_attribute *, locus *);
+gfc_try gfc_add_cray_pointee (symbol_attribute *, locus *);
+gfc_try gfc_mod_pointee_as (gfc_array_spec *);
+gfc_try gfc_add_protected (symbol_attribute *, const char *, locus *);
+gfc_try gfc_add_result (symbol_attribute *, const char *, locus *);
+gfc_try gfc_add_save (symbol_attribute *, const char *, locus *);
+gfc_try gfc_add_threadprivate (symbol_attribute *, const char *, locus *);
+gfc_try gfc_add_saved_common (symbol_attribute *, locus *);
+gfc_try gfc_add_target (symbol_attribute *, locus *);
+gfc_try gfc_add_dummy (symbol_attribute *, const char *, locus *);
+gfc_try gfc_add_generic (symbol_attribute *, const char *, locus *);
+gfc_try gfc_add_common (symbol_attribute *, locus *);
+gfc_try gfc_add_in_common (symbol_attribute *, const char *, locus *);
+gfc_try gfc_add_in_equivalence (symbol_attribute *, const char *, locus *);
+gfc_try gfc_add_data (symbol_attribute *, const char *, locus *);
+gfc_try gfc_add_in_namelist (symbol_attribute *, const char *, locus *);
+gfc_try gfc_add_sequence (symbol_attribute *, const char *, locus *);
+gfc_try gfc_add_elemental (symbol_attribute *, locus *);
+gfc_try gfc_add_pure (symbol_attribute *, locus *);
+gfc_try gfc_add_recursive (symbol_attribute *, locus *);
+gfc_try gfc_add_function (symbol_attribute *, const char *, locus *);
+gfc_try gfc_add_subroutine (symbol_attribute *, const char *, locus *);
+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_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 *);
+gfc_try gfc_add_procedure (symbol_attribute *, procedure_type,
const char *, locus *);
-try gfc_add_intent (symbol_attribute *, sym_intent, locus *);
-try gfc_add_explicit_interface (gfc_symbol *, ifsrc,
+gfc_try gfc_add_intent (symbol_attribute *, sym_intent, locus *);
+gfc_try gfc_add_explicit_interface (gfc_symbol *, ifsrc,
gfc_formal_arglist *, locus *);
-try gfc_add_type (gfc_symbol *, gfc_typespec *, locus *);
+gfc_try gfc_add_type (gfc_symbol *, gfc_typespec *, locus *);
void gfc_clear_attr (symbol_attribute *);
-try gfc_missing_attr (symbol_attribute *, locus *);
-try gfc_copy_attr (symbol_attribute *, symbol_attribute *, locus *);
+gfc_try gfc_missing_attr (symbol_attribute *, locus *);
+gfc_try gfc_copy_attr (symbol_attribute *, symbol_attribute *, locus *);
-try gfc_add_component (gfc_symbol *, const char *, gfc_component **);
+gfc_try gfc_add_component (gfc_symbol *, const char *, gfc_component **);
gfc_symbol *gfc_use_derived (gfc_symbol *);
gfc_symtree *gfc_use_derived_tree (gfc_symtree *);
-gfc_component *gfc_find_component (gfc_symbol *, const char *);
+gfc_component *gfc_find_component (gfc_symbol *, const char *, bool, bool);
gfc_st_label *gfc_get_st_label (int);
void gfc_free_st_label (gfc_st_label *);
void gfc_define_st_label (gfc_st_label *, gfc_sl_type, locus *);
-try gfc_reference_st_label (gfc_st_label *, gfc_sl_type);
+gfc_try gfc_reference_st_label (gfc_st_label *, gfc_sl_type);
gfc_expr * gfc_lval_expr_from_sym (gfc_symbol *);
@@ -2200,11 +2274,11 @@ gfc_symbol *gfc_new_symbol (const char *, gfc_namespace *);
int gfc_find_symbol (const char *, gfc_namespace *, int, gfc_symbol **);
int gfc_find_sym_tree (const char *, gfc_namespace *, int, gfc_symtree **);
int gfc_get_symbol (const char *, gfc_namespace *, gfc_symbol **);
-try verify_c_interop (gfc_typespec *, const char *name, locus *where);
-try verify_c_interop_param (gfc_symbol *);
-try verify_bind_c_sym (gfc_symbol *, gfc_typespec *, int, gfc_common_head *);
-try verify_bind_c_derived_type (gfc_symbol *);
-try verify_com_block_vars_c_interop (gfc_common_head *);
+gfc_try verify_c_interop (gfc_typespec *, const char *name, locus *where);
+gfc_try verify_c_interop_param (gfc_symbol *);
+gfc_try verify_bind_c_sym (gfc_symbol *, gfc_typespec *, int, gfc_common_head *);
+gfc_try verify_bind_c_derived_type (gfc_symbol *);
+gfc_try verify_com_block_vars_c_interop (gfc_common_head *);
void generate_isocbinding_symbol (const char *, iso_c_binding_symbol, const char *);
gfc_symbol *get_iso_c_sym (gfc_symbol *, char *, char *, int);
int gfc_get_sym_tree (const char *, gfc_namespace *, gfc_symtree **);
@@ -2231,10 +2305,15 @@ void gfc_symbol_state (void);
gfc_gsymbol *gfc_get_gsymbol (const char *);
gfc_gsymbol *gfc_find_gsymbol (gfc_gsymbol *, const char *);
+gfc_symbol* gfc_get_derived_super_type (gfc_symbol*);
+gfc_symtree* gfc_find_typebound_proc (gfc_symbol*, gfc_try*, const char*, bool);
+
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;
@@ -2249,12 +2328,12 @@ void gfc_intrinsic_done_1 (void);
char gfc_type_letter (bt);
gfc_symbol * gfc_get_intrinsic_sub_symbol (const char *);
-try gfc_convert_type (gfc_expr *, gfc_typespec *, int);
-try gfc_convert_type_warn (gfc_expr *, gfc_typespec *, int, int);
-try gfc_convert_chartype (gfc_expr *, gfc_typespec *);
+gfc_try gfc_convert_type (gfc_expr *, gfc_typespec *, int);
+gfc_try gfc_convert_type_warn (gfc_expr *, gfc_typespec *, int, int);
+gfc_try gfc_convert_chartype (gfc_expr *, gfc_typespec *);
int gfc_generic_intrinsic (const char *);
int gfc_specific_intrinsic (const char *);
-int gfc_intrinsic_name (const char *, int);
+bool gfc_is_intrinsic (gfc_symbol*, int, locus);
int gfc_intrinsic_actual_ok (const char *, const bool);
gfc_intrinsic_sym *gfc_find_function (const char *);
gfc_intrinsic_sym *gfc_find_subroutine (const char *);
@@ -2262,6 +2341,10 @@ gfc_intrinsic_sym *gfc_find_subroutine (const char *);
match gfc_intrinsic_func_interface (gfc_expr *, int);
match gfc_intrinsic_sub_interface (gfc_code *, int);
+void gfc_warn_intrinsic_shadow (const gfc_symbol*, bool, bool);
+gfc_try gfc_check_intrinsic_standard (const gfc_intrinsic_sym*, const char**,
+ bool, locus);
+
/* match.c -- FIXME */
void gfc_free_iterator (gfc_iterator *, int);
void gfc_free_forall_iterator (gfc_forall_iterator *);
@@ -2292,7 +2375,7 @@ gfc_expr *gfc_build_conversion (gfc_expr *);
void gfc_free_ref_list (gfc_ref *);
void gfc_type_convert_binary (gfc_expr *);
int gfc_is_constant_expr (gfc_expr *);
-try gfc_simplify_expr (gfc_expr *, int);
+gfc_try gfc_simplify_expr (gfc_expr *, int);
int gfc_has_vector_index (gfc_expr *);
gfc_expr *gfc_get_expr (void);
@@ -2303,16 +2386,17 @@ gfc_expr *gfc_logical_expr (int, locus *);
mpz_t *gfc_copy_shape (mpz_t *, int);
mpz_t *gfc_copy_shape_excluding (mpz_t *, int, gfc_expr *);
gfc_expr *gfc_copy_expr (gfc_expr *);
+gfc_ref* gfc_copy_ref (gfc_ref*);
-try gfc_specification_expr (gfc_expr *);
+gfc_try gfc_specification_expr (gfc_expr *);
int gfc_numeric_ts (gfc_typespec *);
int gfc_kind_max (gfc_expr *, gfc_expr *);
-try gfc_check_conformance (const char *, gfc_expr *, gfc_expr *);
-try gfc_check_assign (gfc_expr *, gfc_expr *, int);
-try gfc_check_pointer_assign (gfc_expr *, gfc_expr *);
-try gfc_check_assign_symbol (gfc_symbol *, gfc_expr *);
+gfc_try gfc_check_conformance (const char *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_assign (gfc_expr *, gfc_expr *, int);
+gfc_try gfc_check_pointer_assign (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_assign_symbol (gfc_symbol *, gfc_expr *);
gfc_expr *gfc_default_initializer (gfc_typespec *);
gfc_expr *gfc_get_variable_expr (gfc_symtree *);
@@ -2322,6 +2406,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;
@@ -2332,16 +2418,16 @@ void gfc_free_statement (gfc_code *);
void gfc_free_statements (gfc_code *);
/* resolve.c */
-try gfc_resolve_expr (gfc_expr *);
+gfc_try gfc_resolve_expr (gfc_expr *);
void gfc_resolve (gfc_namespace *);
void gfc_resolve_blocks (gfc_code *, gfc_namespace *);
int gfc_impure_variable (gfc_symbol *);
int gfc_pure (gfc_symbol *);
int gfc_elemental (gfc_symbol *);
-try gfc_resolve_iterator (gfc_iterator *, bool);
-try find_forall_index (gfc_expr *, gfc_symbol *, int);
-try gfc_resolve_index (gfc_expr *, int);
-try gfc_resolve_dim_arg (gfc_expr *);
+gfc_try gfc_resolve_iterator (gfc_iterator *, bool);
+gfc_try find_forall_index (gfc_expr *, gfc_symbol *, int);
+gfc_try gfc_resolve_index (gfc_expr *, int);
+gfc_try gfc_resolve_dim_arg (gfc_expr *);
int gfc_is_formal_arg (void);
void gfc_resolve_substring_charlen (gfc_expr *);
match gfc_iso_c_sub_interface(gfc_code *, gfc_symbol *);
@@ -2351,9 +2437,9 @@ match gfc_iso_c_sub_interface(gfc_code *, gfc_symbol *);
void gfc_free_array_spec (gfc_array_spec *);
gfc_array_ref *gfc_copy_array_ref (gfc_array_ref *);
-try gfc_set_array_spec (gfc_symbol *, gfc_array_spec *, locus *);
+gfc_try gfc_set_array_spec (gfc_symbol *, gfc_array_spec *, locus *);
gfc_array_spec *gfc_copy_array_spec (gfc_array_spec *);
-try gfc_resolve_array_spec (gfc_array_spec *, int);
+gfc_try gfc_resolve_array_spec (gfc_array_spec *, int);
int gfc_compare_array_spec (gfc_array_spec *, gfc_array_spec *);
@@ -2361,25 +2447,25 @@ gfc_expr *gfc_start_constructor (bt, int, locus *);
void gfc_append_constructor (gfc_expr *, gfc_expr *);
void gfc_free_constructor (gfc_constructor *);
void gfc_simplify_iterator_var (gfc_expr *);
-try gfc_expand_constructor (gfc_expr *);
+gfc_try gfc_expand_constructor (gfc_expr *);
int gfc_constant_ac (gfc_expr *);
int gfc_expanded_ac (gfc_expr *);
-try gfc_resolve_character_array_constructor (gfc_expr *);
-try gfc_resolve_array_constructor (gfc_expr *);
-try gfc_check_constructor_type (gfc_expr *);
-try gfc_check_iter_variable (gfc_expr *);
-try gfc_check_constructor (gfc_expr *, try (*)(gfc_expr *));
+gfc_try gfc_resolve_character_array_constructor (gfc_expr *);
+gfc_try gfc_resolve_array_constructor (gfc_expr *);
+gfc_try gfc_check_constructor_type (gfc_expr *);
+gfc_try gfc_check_iter_variable (gfc_expr *);
+gfc_try gfc_check_constructor (gfc_expr *, gfc_try (*)(gfc_expr *));
gfc_constructor *gfc_copy_constructor (gfc_constructor *);
gfc_expr *gfc_get_array_element (gfc_expr *, int);
-try gfc_array_size (gfc_expr *, mpz_t *);
-try gfc_array_dimen_size (gfc_expr *, int, mpz_t *);
-try gfc_array_ref_shape (gfc_array_ref *, mpz_t *);
+gfc_try gfc_array_size (gfc_expr *, mpz_t *);
+gfc_try gfc_array_dimen_size (gfc_expr *, int, mpz_t *);
+gfc_try gfc_array_ref_shape (gfc_array_ref *, mpz_t *);
gfc_array_ref *gfc_find_array_ref (gfc_expr *);
void gfc_insert_constructor (gfc_expr *, gfc_constructor *);
gfc_constructor *gfc_get_constructor (void);
tree gfc_conv_array_initializer (tree type, gfc_expr *);
-try spec_size (gfc_array_spec *, mpz_t *);
-try spec_dimen_size (gfc_array_spec *, int, mpz_t *);
+gfc_try spec_size (gfc_array_spec *, mpz_t *);
+gfc_try spec_dimen_size (gfc_array_spec *, int, mpz_t *);
int gfc_is_compile_time_shape (gfc_array_spec *);
/* interface.c -- FIXME: some of these should be in symbol.c */
@@ -2390,39 +2476,42 @@ void gfc_check_interfaces (gfc_namespace *);
void gfc_procedure_use (gfc_symbol *, gfc_actual_arglist **, locus *);
gfc_symbol *gfc_search_interface (gfc_interface *, int,
gfc_actual_arglist **);
-try gfc_extend_expr (gfc_expr *);
+gfc_try gfc_extend_expr (gfc_expr *);
void gfc_free_formal_arglist (gfc_formal_arglist *);
-try gfc_extend_assign (gfc_code *, gfc_namespace *);
-try gfc_add_interface (gfc_symbol *);
+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;
void gfc_free_open (gfc_open *);
-try gfc_resolve_open (gfc_open *);
+gfc_try gfc_resolve_open (gfc_open *);
void gfc_free_close (gfc_close *);
-try gfc_resolve_close (gfc_close *);
+gfc_try gfc_resolve_close (gfc_close *);
void gfc_free_filepos (gfc_filepos *);
-try gfc_resolve_filepos (gfc_filepos *);
+gfc_try gfc_resolve_filepos (gfc_filepos *);
void gfc_free_inquire (gfc_inquire *);
-try gfc_resolve_inquire (gfc_inquire *);
+gfc_try gfc_resolve_inquire (gfc_inquire *);
void gfc_free_dt (gfc_dt *);
-try gfc_resolve_dt (gfc_dt *);
+gfc_try gfc_resolve_dt (gfc_dt *);
void gfc_free_wait (gfc_wait *);
-try gfc_resolve_wait (gfc_wait *);
+gfc_try gfc_resolve_wait (gfc_wait *);
/* module.c */
void gfc_module_init_2 (void);
void gfc_module_done_2 (void);
void gfc_dump_module (const char *, int);
bool gfc_check_access (gfc_access, gfc_access);
+void gfc_free_use_stmts (gfc_use_list *);
/* primary.c */
symbol_attribute gfc_variable_attr (gfc_expr *, gfc_typespec *);
symbol_attribute gfc_expr_attr (gfc_expr *);
match gfc_match_rvalue (gfc_expr **);
+match gfc_match_varspec (gfc_expr*, int, bool);
int gfc_check_digit (char, int);
/* trans.c */
@@ -2438,7 +2527,7 @@ void gfc_delete_bbt (void *, void *, compare_fn);
void gfc_dump_parse_tree (gfc_namespace *, FILE *);
/* parse.c */
-try gfc_parse_file (void);
+gfc_try gfc_parse_file (void);
void gfc_global_used (gfc_gsymbol *, locus *);
/* dependency.c */
diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index cf90ceda833..933ed45b5cd 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -80,11 +80,10 @@
Copyright @copyright{} @value{copyrights-gfortran} Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'' and ``Funding
-Free Software'', the Front-Cover
-texts being (a) (see below), and with the Back-Cover Texts being (b)
+Invariant Sections being ``Funding Free Software'', the Front-Cover
+Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
``GNU Free Documentation License''.
@@ -402,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,
@@ -414,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 d4809f0d5fb..b03be73accc 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -392,19 +392,19 @@ gfc_compare_derived_types (gfc_symbol *derived1, gfc_symbol *derived2)
if (strcmp (dt1->name, dt2->name) != 0)
return 0;
- if (dt1->access != dt2->access)
+ if (dt1->attr.access != dt2->attr.access)
return 0;
- if (dt1->pointer != dt2->pointer)
+ if (dt1->attr.pointer != dt2->attr.pointer)
return 0;
- if (dt1->dimension != dt2->dimension)
+ if (dt1->attr.dimension != dt2->attr.dimension)
return 0;
- if (dt1->allocatable != dt2->allocatable)
+ if (dt1->attr.allocatable != dt2->attr.allocatable)
return 0;
- if (dt1->dimension && gfc_compare_array_spec (dt1->as, dt2->as) == 0)
+ if (dt1->attr.dimension && gfc_compare_array_spec (dt1->as, dt2->as) == 0)
return 0;
/* Make sure that link lists do not put this function into an
@@ -2218,7 +2218,7 @@ pair_cmp (const void *p1, const void *p2)
refer to the same expression. The analysis is conservative.
Returning FAILURE will produce no warning. */
-static try
+static gfc_try
compare_actual_expr (gfc_expr *e1, gfc_expr *e2)
{
const gfc_ref *r1, *r2;
@@ -2267,7 +2267,7 @@ compare_actual_expr (gfc_expr *e1, gfc_expr *e2)
another, check that identical actual arguments aren't not
associated with some incompatible INTENTs. */
-static try
+static gfc_try
check_some_aliasing (gfc_formal_arglist *f, gfc_actual_arglist *a)
{
sym_intent f1_intent, f2_intent;
@@ -2275,7 +2275,7 @@ check_some_aliasing (gfc_formal_arglist *f, gfc_actual_arglist *a)
gfc_actual_arglist *a1;
size_t n, i, j;
argpair *p;
- try t = SUCCESS;
+ gfc_try t = SUCCESS;
n = 0;
for (f1 = f, a1 = a;; f1 = f1->next, a1 = a1->next)
@@ -2355,7 +2355,7 @@ compare_parameter_intent (gfc_symbol *formal, gfc_expr *actual)
another, check that they are compatible in the sense that intents
are not mismatched. */
-static try
+static gfc_try
check_intents (gfc_formal_arglist *f, gfc_actual_arglist *a)
{
sym_intent f_intent;
@@ -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;
@@ -2546,7 +2546,7 @@ find_sym_in_symtree (gfc_symbol *sym)
interface. If one is found, the expression node is replaced with
the appropriate function call. */
-try
+gfc_try
gfc_extend_expr (gfc_expr *e)
{
gfc_actual_arglist *actual;
@@ -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;
@@ -2677,7 +2677,7 @@ gfc_extend_expr (gfc_expr *e)
SUCCESS if the node was replaced. On FAILURE, no error is
generated. */
-try
+gfc_try
gfc_extend_assign (gfc_code *c, gfc_namespace *ns)
{
gfc_actual_arglist *actual;
@@ -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;
@@ -2731,7 +2731,7 @@ gfc_extend_assign (gfc_code *c, gfc_namespace *ns)
the given interface list. Ambiguity isn't checked yet since module
procedures can be present without interfaces. */
-static try
+static gfc_try
check_new_interface (gfc_interface *base, gfc_symbol *new_sym)
{
gfc_interface *ip;
@@ -2752,7 +2752,7 @@ check_new_interface (gfc_interface *base, gfc_symbol *new_sym)
/* Add a symbol to the current interface. */
-try
+gfc_try
gfc_add_interface (gfc_symbol *new_sym)
{
gfc_interface **head, *intr;
diff --git a/gcc/fortran/intrinsic.c b/gcc/fortran/intrinsic.c
index 4c55a2c99ba..9b11db4bb64 100644
--- a/gcc/fortran/intrinsic.c
+++ b/gcc/fortran/intrinsic.c
@@ -175,7 +175,7 @@ find_char_conv (gfc_typespec *from, gfc_typespec *to)
and call the proper check function rather than forcing each
function to manipulate the argument list. */
-static try
+static gfc_try
do_check (gfc_intrinsic_sym *specific, gfc_actual_arglist *arg)
{
gfc_expr *a1, *a2, *a3, *a4, *a5;
@@ -334,7 +334,7 @@ add_sym (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type
static void
add_sym_0 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type,
int kind, int standard,
- try (*check) (void),
+ gfc_try (*check) (void),
gfc_expr *(*simplify) (void),
void (*resolve) (gfc_expr *))
{
@@ -376,7 +376,7 @@ add_sym_0s (const char *name, gfc_isym_id id, int standard, void (*resolve) (gfc
static void
add_sym_1 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type,
int kind, int standard,
- try (*check) (gfc_expr *),
+ gfc_try (*check) (gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *),
void (*resolve) (gfc_expr *, gfc_expr *),
const char *a1, bt type1, int kind1, int optional1)
@@ -400,7 +400,7 @@ add_sym_1 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt ty
static void
add_sym_1s (const char *name, gfc_isym_id id, enum klass cl, bt type, int kind, int standard,
- try (*check) (gfc_expr *),
+ gfc_try (*check) (gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *),
void (*resolve) (gfc_code *),
const char *a1, bt type1, int kind1, int optional1)
@@ -425,7 +425,7 @@ add_sym_1s (const char *name, gfc_isym_id id, enum klass cl, bt type, int kind,
static void
add_sym_1m (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type,
int kind, int standard,
- try (*check) (gfc_actual_arglist *),
+ gfc_try (*check) (gfc_actual_arglist *),
gfc_expr *(*simplify) (gfc_expr *),
void (*resolve) (gfc_expr *, gfc_actual_arglist *),
const char *a1, bt type1, int kind1, int optional1,
@@ -452,7 +452,7 @@ add_sym_1m (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt t
static void
add_sym_2 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type,
int kind, int standard,
- try (*check) (gfc_expr *, gfc_expr *),
+ gfc_try (*check) (gfc_expr *, gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *, gfc_expr *),
void (*resolve) (gfc_expr *, gfc_expr *, gfc_expr *),
const char *a1, bt type1, int kind1, int optional1,
@@ -478,7 +478,7 @@ add_sym_2 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt ty
static void
add_sym_2s (const char *name, gfc_isym_id id, enum klass cl, bt type, int kind, int standard,
- try (*check) (gfc_expr *, gfc_expr *),
+ gfc_try (*check) (gfc_expr *, gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *, gfc_expr *),
void (*resolve) (gfc_code *),
const char *a1, bt type1, int kind1, int optional1,
@@ -505,7 +505,7 @@ add_sym_2s (const char *name, gfc_isym_id id, enum klass cl, bt type, int kind,
static void
add_sym_3 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type,
int kind, int standard,
- try (*check) (gfc_expr *, gfc_expr *, gfc_expr *),
+ gfc_try (*check) (gfc_expr *, gfc_expr *, gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *),
void (*resolve) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *),
const char *a1, bt type1, int kind1, int optional1,
@@ -534,7 +534,7 @@ add_sym_3 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt ty
static void
add_sym_3ml (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type,
int kind, int standard,
- try (*check) (gfc_actual_arglist *),
+ gfc_try (*check) (gfc_actual_arglist *),
gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *),
void (*resolve) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *),
const char *a1, bt type1, int kind1, int optional1,
@@ -563,7 +563,7 @@ add_sym_3ml (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt
static void
add_sym_3red (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type,
int kind, int standard,
- try (*check) (gfc_actual_arglist *),
+ gfc_try (*check) (gfc_actual_arglist *),
gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *),
void (*resolve) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *),
const char *a1, bt type1, int kind1, int optional1,
@@ -591,7 +591,7 @@ add_sym_3red (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt
static void
add_sym_3s (const char *name, gfc_isym_id id, enum klass cl, bt type, int kind, int standard,
- try (*check) (gfc_expr *, gfc_expr *, gfc_expr *),
+ gfc_try (*check) (gfc_expr *, gfc_expr *, gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *),
void (*resolve) (gfc_code *),
const char *a1, bt type1, int kind1, int optional1,
@@ -620,7 +620,7 @@ add_sym_3s (const char *name, gfc_isym_id id, enum klass cl, bt type, int kind,
static void
add_sym_4 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt type,
int kind, int standard,
- try (*check) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *),
+ gfc_try (*check) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *,
gfc_expr *),
void (*resolve) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *,
@@ -652,7 +652,7 @@ add_sym_4 (const char *name, gfc_isym_id id, enum klass cl, int actual_ok, bt ty
static void
add_sym_4s (const char *name, gfc_isym_id id, enum klass cl, bt type, int kind, int standard,
- try (*check) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *),
+ gfc_try (*check) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *,
gfc_expr *),
void (*resolve) (gfc_code *),
@@ -683,7 +683,7 @@ add_sym_4s (const char *name, gfc_isym_id id, enum klass cl, bt type, int kind,
static void
add_sym_5s (const char *name, gfc_isym_id id, enum klass cl, bt type, int kind, int standard,
- try (*check) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *,
+ gfc_try (*check) (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *,
gfc_expr *),
gfc_expr *(*simplify) (gfc_expr *, gfc_expr *, gfc_expr *,
gfc_expr *, gfc_expr *),
@@ -807,15 +807,47 @@ gfc_intrinsic_actual_ok (const char *name, const bool subroutine_flag)
}
-/* Given a string, figure out if it is the name of an intrinsic
- subroutine or function. There are no generic intrinsic
- subroutines, they are all specific. */
+/* Given a symbol, find out if it is (and is to be treated) an intrinsic. If
+ it's name refers to an intrinsic but this intrinsic is not included in the
+ selected standard, this returns FALSE and sets the symbol's external
+ attribute. */
-int
-gfc_intrinsic_name (const char *name, int subroutine_flag)
+bool
+gfc_is_intrinsic (gfc_symbol* sym, int subroutine_flag, locus loc)
{
- return subroutine_flag ? gfc_find_subroutine (name) != NULL
- : gfc_find_function (name) != NULL;
+ gfc_intrinsic_sym* isym;
+ const char* symstd;
+
+ /* If INTRINSIC/EXTERNAL state is already known, return. */
+ if (sym->attr.intrinsic)
+ return true;
+ if (sym->attr.external)
+ return false;
+
+ if (subroutine_flag)
+ isym = gfc_find_subroutine (sym->name);
+ else
+ isym = gfc_find_function (sym->name);
+
+ /* No such intrinsic available at all? */
+ if (!isym)
+ return false;
+
+ /* See if this intrinsic is allowed in the current standard. */
+ if (gfc_check_intrinsic_standard (isym, &symstd, false, loc) == FAILURE)
+ {
+ if (gfc_option.warn_intrinsics_std)
+ gfc_warning_now ("The intrinsic '%s' at %L is not included in the"
+ " selected standard but %s and '%s' will be treated as"
+ " if declared EXTERNAL. Use an appropriate -std=*"
+ " option or define -fall-intrinsics to allow this"
+ " intrinsic.", sym->name, &loc, symstd, sym->name);
+ sym->attr.external = 1;
+
+ return false;
+ }
+
+ return true;
}
@@ -2992,7 +3024,7 @@ remove_nullargs (gfc_actual_arglist **ap)
wrong (say, a missing required argument) we abort sorting and
return FAILURE. */
-static try
+static gfc_try
sort_actual (const char *name, gfc_actual_arglist **ap,
gfc_intrinsic_arg *formal, locus *where)
{
@@ -3113,7 +3145,7 @@ do_sort:
list. The lists are checked for agreement of type. We don't check
for arrayness here. */
-static try
+static gfc_try
check_arglist (gfc_actual_arglist **ap, gfc_intrinsic_sym *sym,
int error_flag)
{
@@ -3245,7 +3277,7 @@ resolve_intrinsic (gfc_intrinsic_sym *specific, gfc_expr *e)
of the simplification, SUCCESS if the simplification worked, even
if nothing has changed in the expression itself. */
-static try
+static gfc_try
do_simplify (gfc_intrinsic_sym *specific, gfc_expr *e)
{
gfc_expr *result, *a1, *a2, *a3, *a4, *a5;
@@ -3374,11 +3406,11 @@ init_arglist (gfc_intrinsic_sym *isym)
intrinsic's formal argument list. Return SUCCESS if the expression
and intrinsic match, FAILURE otherwise. */
-static try
+static gfc_try
check_specific (gfc_intrinsic_sym *specific, gfc_expr *expr, int error_flag)
{
gfc_actual_arglist *arg, **ap;
- try t;
+ gfc_try t;
ap = &expr->value.function.actual;
@@ -3448,21 +3480,82 @@ check_specific (gfc_intrinsic_sym *specific, gfc_expr *expr, int error_flag)
/* Check whether an intrinsic belongs to whatever standard the user
- has chosen. */
-
-static try
-check_intrinsic_standard (const char *name, int standard, locus *where)
+ has chosen, taking also into account -fall-intrinsics. Here, no
+ warning/error is emitted; but if symstd is not NULL, it is pointed to a
+ textual representation of the symbols standard status (like
+ "new in Fortran 2008", "a GNU extension" or "obsolescent in Fortran 95") that
+ can be used to construct a detailed warning/error message in case of
+ a FAILURE. */
+
+gfc_try
+gfc_check_intrinsic_standard (const gfc_intrinsic_sym* isym,
+ const char** symstd, bool silent, locus where)
{
- /* Do not warn about GNU-extensions if -std=gnu. */
- if (!gfc_option.warn_nonstd_intrinsics
- || (standard == GFC_STD_GNU && gfc_option.warn_std & GFC_STD_GNU))
+ const char* symstd_msg;
+
+ /* For -fall-intrinsics, just succeed. */
+ if (gfc_option.flag_all_intrinsics)
return SUCCESS;
- if (gfc_notify_std (standard, "Intrinsic '%s' at %L is not included "
- "in the selected standard", name, where) == FAILURE)
- return FAILURE;
+ /* Find the symbol's standard message for later usage. */
+ switch (isym->standard)
+ {
+ case GFC_STD_F77:
+ symstd_msg = "available since Fortran 77";
+ break;
- return SUCCESS;
+ case GFC_STD_F95_OBS:
+ symstd_msg = "obsolescent in Fortran 95";
+ break;
+
+ case GFC_STD_F95_DEL:
+ symstd_msg = "deleted in Fortran 95";
+ break;
+
+ case GFC_STD_F95:
+ symstd_msg = "new in Fortran 95";
+ break;
+
+ case GFC_STD_F2003:
+ symstd_msg = "new in Fortran 2003";
+ break;
+
+ case GFC_STD_F2008:
+ symstd_msg = "new in Fortran 2008";
+ break;
+
+ case GFC_STD_GNU:
+ symstd_msg = "a GNU Fortran extension";
+ break;
+
+ case GFC_STD_LEGACY:
+ symstd_msg = "for backward compatibility";
+ break;
+
+ default:
+ gfc_internal_error ("Invalid standard code on intrinsic '%s' (%d)",
+ isym->name, isym->standard);
+ }
+
+ /* If warning about the standard, warn and succeed. */
+ if (gfc_option.warn_std & isym->standard)
+ {
+ /* Do only print a warning if not a GNU extension. */
+ if (!silent && isym->standard != GFC_STD_GNU)
+ gfc_warning ("Intrinsic '%s' (is %s) is used at %L",
+ isym->name, _(symstd_msg), &where);
+
+ return SUCCESS;
+ }
+
+ /* If allowing the symbol's standard, succeed, too. */
+ if (gfc_option.allow_std & isym->standard)
+ return SUCCESS;
+
+ /* Otherwise, fail. */
+ if (symstd)
+ *symstd = _(symstd_msg);
+ return FAILURE;
}
@@ -3508,9 +3601,6 @@ gfc_intrinsic_func_interface (gfc_expr *expr, int error_flag)
return MATCH_NO;
}
- if (check_intrinsic_standard (name, isym->standard, &expr->where) == FAILURE)
- return MATCH_ERROR;
-
if ((isym->id == GFC_ISYM_REAL || isym->id == GFC_ISYM_DBLE
|| isym->id == GFC_ISYM_CMPLX)
&& gfc_init_expr
@@ -3605,9 +3695,6 @@ gfc_intrinsic_sub_interface (gfc_code *c, int error_flag)
if (isym == NULL)
return MATCH_NO;
- if (check_intrinsic_standard (name, isym->standard, &c->loc) == FAILURE)
- return MATCH_ERROR;
-
gfc_suppress_error = !error_flag;
init_arglist (isym);
@@ -3657,7 +3744,7 @@ fail:
/* Call gfc_convert_type() with warning enabled. */
-try
+gfc_try
gfc_convert_type (gfc_expr *expr, gfc_typespec *ts, int eflag)
{
return gfc_convert_type_warn (expr, ts, eflag, 1);
@@ -3674,7 +3761,7 @@ gfc_convert_type (gfc_expr *expr, gfc_typespec *ts, int eflag)
'wflag' controls the warning related to conversion. */
-try
+gfc_try
gfc_convert_type_warn (gfc_expr *expr, gfc_typespec *ts, int eflag, int wflag)
{
gfc_intrinsic_sym *sym;
@@ -3773,7 +3860,7 @@ bad:
}
-try
+gfc_try
gfc_convert_chartype (gfc_expr *expr, gfc_typespec *ts)
{
gfc_intrinsic_sym *sym;
@@ -3827,3 +3914,42 @@ gfc_convert_chartype (gfc_expr *expr, gfc_typespec *ts)
return SUCCESS;
}
+
+
+/* Check if the passed name is name of an intrinsic (taking into account the
+ current -std=* and -fall-intrinsic settings). If it is, see if we should
+ warn about this as a user-procedure having the same name as an intrinsic
+ (-Wintrinsic-shadow enabled) and do so if we should. */
+
+void
+gfc_warn_intrinsic_shadow (const gfc_symbol* sym, bool in_module, bool func)
+{
+ gfc_intrinsic_sym* isym;
+
+ /* If the warning is disabled, do nothing at all. */
+ if (!gfc_option.warn_intrinsic_shadow)
+ return;
+
+ /* Try to find an intrinsic of the same name. */
+ if (func)
+ isym = gfc_find_function (sym->name);
+ else
+ isym = gfc_find_subroutine (sym->name);
+
+ /* If no intrinsic was found with this name or it's not included in the
+ selected standard, everything's fine. */
+ if (!isym || gfc_check_intrinsic_standard (isym, NULL, true,
+ sym->declared_at) == FAILURE)
+ return;
+
+ /* Emit the warning. */
+ if (in_module)
+ gfc_warning ("'%s' declared at %L may shadow the intrinsic of the same"
+ " name. In order to call the intrinsic, explicit INTRINSIC"
+ " declarations may be required.",
+ sym->name, &sym->declared_at);
+ else
+ gfc_warning ("'%s' declared at %L is also the name of an intrinsic. It can"
+ " only be called via an explicit interface or if declared"
+ " EXTERNAL.", sym->name, &sym->declared_at);
+}
diff --git a/gcc/fortran/intrinsic.h b/gcc/fortran/intrinsic.h
index e280c50d78f..5994cf66a79 100644
--- a/gcc/fortran/intrinsic.h
+++ b/gcc/fortran/intrinsic.h
@@ -26,169 +26,169 @@ extern gfc_expr gfc_bad_expr;
/* Check functions. */
-try gfc_check_a_ikind (gfc_expr *, gfc_expr *);
-try gfc_check_a_xkind (gfc_expr *, gfc_expr *);
-try gfc_check_a_p (gfc_expr *, gfc_expr *);
-try gfc_check_x_yd (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_a_ikind (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_a_xkind (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_a_p (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_x_yd (gfc_expr *, gfc_expr *);
-try gfc_check_abs (gfc_expr *);
-try gfc_check_access_func (gfc_expr *, gfc_expr *);
-try gfc_check_achar (gfc_expr *, gfc_expr *);
-try gfc_check_all_any (gfc_expr *, gfc_expr *);
-try gfc_check_allocated (gfc_expr *);
-try gfc_check_associated (gfc_expr *, gfc_expr *);
-try gfc_check_atan2 (gfc_expr *, gfc_expr *);
-try gfc_check_besn (gfc_expr *, gfc_expr *);
-try gfc_check_btest (gfc_expr *, gfc_expr *);
-try gfc_check_char (gfc_expr *, gfc_expr *);
-try gfc_check_chdir (gfc_expr *);
-try gfc_check_chmod (gfc_expr *, gfc_expr *);
-try gfc_check_cmplx (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_complex (gfc_expr *, gfc_expr *);
-try gfc_check_count (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_cshift (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_ctime (gfc_expr *);
-try gfc_check_datan2 (gfc_expr *, gfc_expr *);
-try gfc_check_dcmplx (gfc_expr *, gfc_expr *);
-try gfc_check_dble (gfc_expr *);
-try gfc_check_digits (gfc_expr *);
-try gfc_check_dot_product (gfc_expr *, gfc_expr *);
-try gfc_check_dprod (gfc_expr *, gfc_expr *);
-try gfc_check_eoshift (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_dtime_etime (gfc_expr *);
-try gfc_check_fgetputc (gfc_expr *, gfc_expr *);
-try gfc_check_fgetput (gfc_expr *);
-try gfc_check_fstat (gfc_expr *, gfc_expr *);
-try gfc_check_ftell (gfc_expr *);
-try gfc_check_fn_c (gfc_expr *);
-try gfc_check_fn_d (gfc_expr *);
-try gfc_check_fn_r (gfc_expr *);
-try gfc_check_fn_rc (gfc_expr *);
-try gfc_check_fnum (gfc_expr *);
-try gfc_check_hostnm (gfc_expr *);
-try gfc_check_huge (gfc_expr *);
-try gfc_check_hypot (gfc_expr *, gfc_expr *);
-try gfc_check_i (gfc_expr *);
-try gfc_check_iand (gfc_expr *, gfc_expr *);
-try gfc_check_and (gfc_expr *, gfc_expr *);
-try gfc_check_ibclr (gfc_expr *, gfc_expr *);
-try gfc_check_ibits (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_ibset (gfc_expr *, gfc_expr *);
-try gfc_check_ichar_iachar (gfc_expr *, gfc_expr *);
-try gfc_check_idnint (gfc_expr *);
-try gfc_check_ieor (gfc_expr *, gfc_expr *);
-try gfc_check_index (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_int (gfc_expr *, gfc_expr *);
-try gfc_check_intconv (gfc_expr *);
-try gfc_check_ior (gfc_expr *, gfc_expr *);
-try gfc_check_irand (gfc_expr *);
-try gfc_check_isatty (gfc_expr *);
-try gfc_check_isnan (gfc_expr *);
-try gfc_check_ishft (gfc_expr *, gfc_expr *);
-try gfc_check_ishftc (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_kill (gfc_expr *, gfc_expr *);
-try gfc_check_kind (gfc_expr *);
-try gfc_check_lbound (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_len_lentrim (gfc_expr *, gfc_expr *);
-try gfc_check_link (gfc_expr *, gfc_expr *);
-try gfc_check_lge_lgt_lle_llt (gfc_expr *, gfc_expr *);
-try gfc_check_loc (gfc_expr *);
-try gfc_check_logical (gfc_expr *, gfc_expr *);
-try gfc_check_min_max (gfc_actual_arglist *);
-try gfc_check_min_max_integer (gfc_actual_arglist *);
-try gfc_check_min_max_real (gfc_actual_arglist *);
-try gfc_check_min_max_double (gfc_actual_arglist *);
-try gfc_check_malloc (gfc_expr *);
-try gfc_check_matmul (gfc_expr *, gfc_expr *);
-try gfc_check_merge (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_minloc_maxloc (gfc_actual_arglist *);
-try gfc_check_minval_maxval (gfc_actual_arglist *);
-try gfc_check_nearest (gfc_expr *, gfc_expr *);
-try gfc_check_new_line (gfc_expr *);
-try gfc_check_null (gfc_expr *);
-try gfc_check_pack (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_precision (gfc_expr *);
-try gfc_check_present (gfc_expr *);
-try gfc_check_product_sum (gfc_actual_arglist *);
-try gfc_check_radix (gfc_expr *);
-try gfc_check_rand (gfc_expr *);
-try gfc_check_range (gfc_expr *);
-try gfc_check_real (gfc_expr *, gfc_expr *);
-try gfc_check_rename (gfc_expr *, gfc_expr *);
-try gfc_check_repeat (gfc_expr *, gfc_expr *);
-try gfc_check_reshape (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_scale (gfc_expr *, gfc_expr *);
-try gfc_check_scan (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_second_sub (gfc_expr *);
-try gfc_check_secnds (gfc_expr *);
-try gfc_check_selected_char_kind (gfc_expr *);
-try gfc_check_selected_int_kind (gfc_expr *);
-try gfc_check_selected_real_kind (gfc_expr *, gfc_expr *);
-try gfc_check_set_exponent (gfc_expr *, gfc_expr *);
-try gfc_check_shape (gfc_expr *);
-try gfc_check_size (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_sign (gfc_expr *, gfc_expr *);
-try gfc_check_signal (gfc_expr *, gfc_expr *);
-try gfc_check_sizeof (gfc_expr *);
-try gfc_check_spread (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_srand (gfc_expr *);
-try gfc_check_stat (gfc_expr *, gfc_expr *);
-try gfc_check_sum (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_symlnk (gfc_expr *, gfc_expr *);
-try gfc_check_transfer (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_transpose (gfc_expr *);
-try gfc_check_trim (gfc_expr *);
-try gfc_check_ttynam (gfc_expr *);
-try gfc_check_ubound (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_umask (gfc_expr *);
-try gfc_check_unlink (gfc_expr *);
-try gfc_check_unpack (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_verify (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_x (gfc_expr *);
+gfc_try gfc_check_abs (gfc_expr *);
+gfc_try gfc_check_access_func (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_achar (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_all_any (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_allocated (gfc_expr *);
+gfc_try gfc_check_associated (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_atan2 (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_besn (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_btest (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_char (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_chdir (gfc_expr *);
+gfc_try gfc_check_chmod (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_cmplx (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_complex (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_count (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_cshift (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_ctime (gfc_expr *);
+gfc_try gfc_check_datan2 (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_dcmplx (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_dble (gfc_expr *);
+gfc_try gfc_check_digits (gfc_expr *);
+gfc_try gfc_check_dot_product (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_dprod (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_eoshift (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_dtime_etime (gfc_expr *);
+gfc_try gfc_check_fgetputc (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_fgetput (gfc_expr *);
+gfc_try gfc_check_fstat (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_ftell (gfc_expr *);
+gfc_try gfc_check_fn_c (gfc_expr *);
+gfc_try gfc_check_fn_d (gfc_expr *);
+gfc_try gfc_check_fn_r (gfc_expr *);
+gfc_try gfc_check_fn_rc (gfc_expr *);
+gfc_try gfc_check_fnum (gfc_expr *);
+gfc_try gfc_check_hostnm (gfc_expr *);
+gfc_try gfc_check_huge (gfc_expr *);
+gfc_try gfc_check_hypot (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_i (gfc_expr *);
+gfc_try gfc_check_iand (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_and (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_ibclr (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_ibits (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_ibset (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_ichar_iachar (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_idnint (gfc_expr *);
+gfc_try gfc_check_ieor (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_index (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_int (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_intconv (gfc_expr *);
+gfc_try gfc_check_ior (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_irand (gfc_expr *);
+gfc_try gfc_check_isatty (gfc_expr *);
+gfc_try gfc_check_isnan (gfc_expr *);
+gfc_try gfc_check_ishft (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_ishftc (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_kill (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_kind (gfc_expr *);
+gfc_try gfc_check_lbound (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_len_lentrim (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_link (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_lge_lgt_lle_llt (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_loc (gfc_expr *);
+gfc_try gfc_check_logical (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_min_max (gfc_actual_arglist *);
+gfc_try gfc_check_min_max_integer (gfc_actual_arglist *);
+gfc_try gfc_check_min_max_real (gfc_actual_arglist *);
+gfc_try gfc_check_min_max_double (gfc_actual_arglist *);
+gfc_try gfc_check_malloc (gfc_expr *);
+gfc_try gfc_check_matmul (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_merge (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_minloc_maxloc (gfc_actual_arglist *);
+gfc_try gfc_check_minval_maxval (gfc_actual_arglist *);
+gfc_try gfc_check_nearest (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_new_line (gfc_expr *);
+gfc_try gfc_check_null (gfc_expr *);
+gfc_try gfc_check_pack (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_precision (gfc_expr *);
+gfc_try gfc_check_present (gfc_expr *);
+gfc_try gfc_check_product_sum (gfc_actual_arglist *);
+gfc_try gfc_check_radix (gfc_expr *);
+gfc_try gfc_check_rand (gfc_expr *);
+gfc_try gfc_check_range (gfc_expr *);
+gfc_try gfc_check_real (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_rename (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_repeat (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_reshape (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_scale (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_scan (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_second_sub (gfc_expr *);
+gfc_try gfc_check_secnds (gfc_expr *);
+gfc_try gfc_check_selected_char_kind (gfc_expr *);
+gfc_try gfc_check_selected_int_kind (gfc_expr *);
+gfc_try gfc_check_selected_real_kind (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_set_exponent (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_shape (gfc_expr *);
+gfc_try gfc_check_size (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_sign (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_signal (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_sizeof (gfc_expr *);
+gfc_try gfc_check_spread (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_srand (gfc_expr *);
+gfc_try gfc_check_stat (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_sum (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_symlnk (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_transfer (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_transpose (gfc_expr *);
+gfc_try gfc_check_trim (gfc_expr *);
+gfc_try gfc_check_ttynam (gfc_expr *);
+gfc_try gfc_check_ubound (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_umask (gfc_expr *);
+gfc_try gfc_check_unlink (gfc_expr *);
+gfc_try gfc_check_unpack (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_verify (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_x (gfc_expr *);
/* Intrinsic subroutines. */
-try gfc_check_alarm_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_chdir_sub (gfc_expr *, gfc_expr *);
-try gfc_check_chmod_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_cpu_time (gfc_expr *);
-try gfc_check_ctime_sub (gfc_expr *, gfc_expr *);
-try gfc_check_system_clock (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_date_and_time (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_exit (gfc_expr *);
-try gfc_check_fdate_sub (gfc_expr *);
-try gfc_check_flush (gfc_expr *);
-try gfc_check_free (gfc_expr *);
-try gfc_check_fstat_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_gerror (gfc_expr *);
-try gfc_check_getarg (gfc_expr *, gfc_expr *);
-try gfc_check_getlog (gfc_expr *);
-try gfc_check_move_alloc (gfc_expr *, gfc_expr *);
-try gfc_check_mvbits (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *,
+gfc_try gfc_check_alarm_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_chdir_sub (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_chmod_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_cpu_time (gfc_expr *);
+gfc_try gfc_check_ctime_sub (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_system_clock (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_date_and_time (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_exit (gfc_expr *);
+gfc_try gfc_check_fdate_sub (gfc_expr *);
+gfc_try gfc_check_flush (gfc_expr *);
+gfc_try gfc_check_free (gfc_expr *);
+gfc_try gfc_check_fstat_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_gerror (gfc_expr *);
+gfc_try gfc_check_getarg (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_getlog (gfc_expr *);
+gfc_try gfc_check_move_alloc (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_mvbits (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *,
gfc_expr *);
-try gfc_check_random_number (gfc_expr *);
-try gfc_check_random_seed (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_dtime_etime_sub (gfc_expr *, gfc_expr *);
-try gfc_check_fgetputc_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_fgetput_sub (gfc_expr *, gfc_expr *);
-try gfc_check_fseek_sub (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_ftell_sub (gfc_expr *, gfc_expr *);
-try gfc_check_getcwd_sub (gfc_expr *, gfc_expr *);
-try gfc_check_hostnm_sub (gfc_expr *, gfc_expr *);
-try gfc_check_itime_idate (gfc_expr *);
-try gfc_check_kill_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_ltime_gmtime (gfc_expr *, gfc_expr *);
-try gfc_check_perror (gfc_expr *);
-try gfc_check_rename_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_link_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_symlnk_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_signal_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_sleep_sub (gfc_expr *);
-try gfc_check_stat_sub (gfc_expr *, gfc_expr *, gfc_expr *);
-try gfc_check_system_sub (gfc_expr *, gfc_expr *);
-try gfc_check_ttynam_sub (gfc_expr *, gfc_expr *);
-try gfc_check_umask_sub (gfc_expr *, gfc_expr *);
-try gfc_check_unlink_sub (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_random_number (gfc_expr *);
+gfc_try gfc_check_random_seed (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_dtime_etime_sub (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_fgetputc_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_fgetput_sub (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_fseek_sub (gfc_expr *, gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_ftell_sub (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_getcwd_sub (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_hostnm_sub (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_itime_idate (gfc_expr *);
+gfc_try gfc_check_kill_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_ltime_gmtime (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_perror (gfc_expr *);
+gfc_try gfc_check_rename_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_link_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_symlnk_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_signal_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_sleep_sub (gfc_expr *);
+gfc_try gfc_check_stat_sub (gfc_expr *, gfc_expr *, gfc_expr *);
+gfc_try gfc_check_system_sub (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_ttynam_sub (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_umask_sub (gfc_expr *, gfc_expr *);
+gfc_try gfc_check_unlink_sub (gfc_expr *, gfc_expr *);
/* Simplification functions. */
diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index db336bfcd92..8337f74c522 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -7,10 +7,9 @@ For copying conditions, see the file gfortran.texi.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'' and ``Funding
-Free Software'', the Front-Cover texts being (a) (see below), and with
-the Back-Cover Texts being (b) (see below). A copy of the license is
-included in the gfdl(7) man page.
+Invariant Sections being ``Funding Free Software'', the Front-Cover
+Texts being (a) (see below), and with the Back-Cover Texts being (b)
+(see below). A copy of the license is included in the gfdl(7) man page.
Some basic guidelines for editing this document:
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 445b4a7d1a9..b854ce4b3b8 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -5,16 +5,15 @@
@ignore
@c man begin COPYRIGHT
-Copyright @copyright{} 2004, 2005, 2006, 2007
+Copyright @copyright{} 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'' and ``Funding
-Free Software'', the Front-Cover texts being (a) (see below), and with
-the Back-Cover Texts being (b) (see below). A copy of the license is
-included in the gfdl(7) man page.
+Invariant Sections being ``Funding Free Software'', the Front-Cover
+Texts being (a) (see below), and with the Back-Cover Texts being (b)
+(see below). A copy of the license is included in the gfdl(7) man page.
(a) The FSF's Front-Cover Text is:
@@ -137,9 +136,9 @@ by type. Explanations are in the following sections.
and warnings}.
@gccoptlist{-fmax-errors=@var{n} @gol
-fsyntax-only -pedantic -pedantic-errors @gol
--Wall -Waliasing -Wampersand -Wcharacter-truncation -Wconversion @gol
--Wimplicit-interface -Wline-truncation -Wnonstd-intrinsics -Wsurprising @gol
--Wno-tabs -Wunderflow -Wunused-parameter}
+-Wall -Waliasing -Wampersand -Warray-bounds -Wcharacter-truncation @gol
+-Wconversion -Wimplicit-interface -Wline-truncation -Wintrinsics-std @gol
+-Wsurprising -Wno-tabs -Wunderflow -Wunused-parameter -Wintrinsics-shadow}
@item Debugging Options
@xref{Debugging Options,,Options for debugging your program or GNU Fortran}.
@@ -164,7 +163,7 @@ and warnings}.
@xref{Code Gen Options,,Options for code generation conventions}.
@gccoptlist{-fno-automatic -ff2c -fno-underscoring
-fsecond-underscore @gol
--fbounds-check -fmax-stack-var-size=@var{n} @gol
+-fbounds-check -fcheck-array-temporaries -fmax-stack-var-size=@var{n} @gol
-fpack-derived -frepack-arrays -fshort-enums -fexternal-blas @gol
-fblas-matmul-limit=@var{n} -frecursive -finit-local-zero @gol
-finit-integer=@var{n} -finit-real=@var{<zero|inf|-inf|nan>} @gol
@@ -211,7 +210,9 @@ form is determined by the file extension.
Accept all of the intrinsic procedures provided in libgfortran
without regard to the setting of @option{-std}. In particular,
this option can be quite useful with @option{-std=f95}. Additionally,
-@command{gfortran} will ignore @option{-Wnonstd-intrinsics}.
+@command{gfortran} will ignore @option{-Wintrinsics-std} and will never try
+to link to an @code{EXTERNAL} version if the intrinsic is not included in the
+selected standard.
@item -fd-lines-as-code
@item -fd-lines-as-comments
@@ -662,8 +663,8 @@ warnings.
Enables commonly used warning options pertaining to usage that
we recommend avoiding and that we believe are easy to avoid.
This currently includes @option{-Waliasing},
-@option{-Wampersand}, @option{-Wsurprising}, @option{-Wnonstd-intrinsics},
-@option{-Wno-tabs}, and @option{-Wline-truncation}.
+@option{-Wampersand}, @option{-Wsurprising}, @option{-Wintrinsics-std},
+@option{-Wno-tabs}, @option{-Wintrinsic-shadow} and @option{-Wline-truncation}.
@item -Waliasing
@opindex @code{Waliasing}
@@ -698,6 +699,13 @@ given in a continued character constant, GNU Fortran assumes continuation
at the first non-comment, non-whitespace character after the ampersand
that initiated the continuation.
+@item -Warray-temporaries
+@opindex @code{Warray-temporaries}
+@cindex warnings, array temporaries
+Warn about array temporaries generated by the compiler. The information
+generated by this warning is sometimes useful in optimization, in order to
+avoid such temporaries.
+
@item -Wcharacter-truncation
@opindex @code{Wcharacter-truncation}
@cindex warnings, character truncation
@@ -721,11 +729,15 @@ Warn if a procedure is called without an explicit interface.
Note this only checks that an explicit interface is present. It does not
check that the declared interfaces are consistent across program units.
-@item -Wnonstd-intrinsics
-@opindex @code{Wnonstd-intrinsics}
+@item -Wintrinsics-std
+@opindex @code{Wintrinsics-std}
@cindex warnings, non-standard intrinsics
-Warn if the user tries to use an intrinsic that does not belong to the
-standard the user has chosen via the @option{-std} option.
+@cindex warnings, intrinsics of other standards
+Warn if @command{gfortran} finds a procedure named like an intrinsic not
+available in the currently selected standard (with @option{-std}) and treats
+it as @code{EXTERNAL} procedure because of this. @option{-fall-intrinsics} can
+be used to never trigger this behaviour and always link to the intrinsic
+regardless of the selected standard.
@item -Wsurprising
@opindex @code{Wsurprising}
@@ -745,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
@@ -765,6 +781,15 @@ is active for @option{-pedantic}, @option{-std=f95}, @option{-std=f2003},
Produce a warning when numerical constant expressions are
encountered, which yield an UNDERFLOW during compilation.
+@item -Wintrinsic-shadow
+@opindex @code{Wintrinsic-shadow}
+@cindex warnings, intrinsic
+@cindex intrinsic
+Warn if a user-defined procedure or module procedure has the same name as an
+intrinsic; in this case, an explicit interface or @code{EXTERNAL} or
+@code{INTRINSIC} declaration might be needed to get calls later resolved to
+the desired intrinsic/procedure.
+
@item -Wunused-parameter
@opindex @code{Wunused-parameter}
@cindex warnings, unused parameter
@@ -1146,6 +1171,17 @@ the compilation of the main program.
In the future this may also include other forms of checking, e.g., checking
substring references.
+
+@item fcheck-array-temporaries
+@opindex @code{fcheck-array-temporaries}
+@cindex checking array temporaries
+Warns at run time when for passing an actual argument a temporary array
+had to be generated. The information generated by this warning is
+sometimes useful in optimization, in order to avoid such temporaries.
+
+Note: The warning is only printed once per location.
+
+
@item -fmax-stack-var-size=@var{n}
@opindex @code{fmax-stack-var-size}
This option specifies the size in bytes of the largest array that will be put
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index 188cf95ad06..979dfc20aa3 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -474,7 +474,7 @@ format_lex (void)
by itself, and we are checking it for validity. The dual origin
means that the warning message is a little less than great. */
-static try
+static gfc_try
check_format (bool is_input)
{
const char *posint_required = _("Positive width required");
@@ -489,7 +489,7 @@ check_format (bool is_input)
format_token t, u;
int level;
int repeat;
- try rv;
+ gfc_try rv;
use_last_char = 0;
saved_token = FMT_NONE;
@@ -981,7 +981,7 @@ finished:
/* Given an expression node that is a constant string, see if it looks
like a format string. */
-static try
+static gfc_try
check_format_string (gfc_expr *e, bool is_input)
{
if (!e || e->ts.type != BT_CHARACTER || e->expr_type != EXPR_CONSTANT)
@@ -1191,7 +1191,7 @@ match_ltag (const io_tag *tag, gfc_st_label ** label)
/* Resolution of the FORMAT tag, to be called from resolve_tag. */
-static try
+static gfc_try
resolve_tag_format (const gfc_expr *e)
{
if (e->expr_type == EXPR_CONSTANT
@@ -1260,7 +1260,7 @@ resolve_tag_format (const gfc_expr *e)
/* Do expression resolution and type-checking on an expression tag. */
-static try
+static gfc_try
resolve_tag (const io_tag *tag, gfc_expr *e)
{
if (e == NULL)
@@ -1417,7 +1417,7 @@ gfc_free_open (gfc_open *open)
/* Resolve everything in a gfc_open structure. */
-try
+gfc_try
gfc_resolve_open (gfc_open *open)
{
@@ -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,
@@ -2017,7 +2016,7 @@ cleanup:
/* Resolve everything in a gfc_close structure. */
-try
+gfc_try
gfc_resolve_close (gfc_close *close)
{
RESOLVE_TAG (&tag_unit, close->unit);
@@ -2141,7 +2140,7 @@ cleanup:
}
-try
+gfc_try
gfc_resolve_filepos (gfc_filepos *fp)
{
RESOLVE_TAG (&tag_unit, fp->unit);
@@ -2467,7 +2466,7 @@ gfc_free_dt (gfc_dt *dt)
/* Resolve everything in a gfc_dt structure. */
-try
+gfc_try
gfc_resolve_dt (gfc_dt *dt)
{
gfc_expr *e;
@@ -3705,7 +3704,7 @@ cleanup:
/* Resolve everything in a gfc_inquire structure. */
-try
+gfc_try
gfc_resolve_inquire (gfc_inquire *inquire)
{
RESOLVE_TAG (&tag_unit, inquire->unit);
@@ -3764,7 +3763,7 @@ gfc_free_wait (gfc_wait *wait)
}
-try
+gfc_try
gfc_resolve_wait (gfc_wait *wait)
{
RESOLVE_TAG (&tag_unit, wait->unit);
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index f0f6c6a756d..93211952c12 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -76,6 +76,10 @@ Wampersand
Fortran Warning
Warn about missing ampersand in continued character constants
+Warray-temporaries
+Fortran Warning
+Warn about creation of array temporaries
+
Wcharacter-truncation
Fortran Warning
Warn about truncated character expressions
@@ -92,9 +96,9 @@ Wline-truncation
Fortran Warning
Warn about truncated source lines
-Wnonstd-intrinsics
+Wintrinsics-std
Fortran Warning
-Warn about usage of non-standard intrinsics
+Warn on intrinsics not part of the selected standard
Wreturn-type
Fortran Warning
@@ -112,6 +116,10 @@ Wunderflow
Fortran Warning
Warn about underflow of numerical constant expressions
+Wintrinsic-shadow
+Fortran Warning
+Warn if a user-procedure has the same name as an intrinsic
+
cpp
Fortran Joined Separate Negative(nocpp)
Enable preprocessing
@@ -148,6 +156,10 @@ fblas-matmul-limit=
Fortran RejectNegative Joined UInteger
-fblas-matmul-limit=<n> Size of the smallest matrix for which matmul will use BLAS
+fcheck-array-temporaries
+Fortran
+Produce a warning at runtime if a array temporary has been created for a procedure argument
+
fconvert=big-endian
Fortran RejectNegative
Use big-endian format for unformatted files
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 19a97e930e9..0da70689443 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. */
@@ -1187,6 +1188,11 @@ loop:
}
default:
+
+ /* gfc_next_ascii_char converts characters to lower-case, so we shouldn't
+ expect an upper case character here! */
+ gcc_assert (TOLOWER (c) == c);
+
if (c == gfc_next_ascii_char ())
goto loop;
break;
@@ -2503,6 +2509,48 @@ done:
}
+/* Match the call of a type-bound procedure, if CALL%var has already been
+ matched and var found to be a derived-type variable. */
+
+static match
+match_typebound_call (gfc_symtree* varst)
+{
+ gfc_symbol* var;
+ gfc_expr* base;
+ match m;
+
+ var = varst->n.sym;
+
+ base = gfc_get_expr ();
+ base->expr_type = EXPR_VARIABLE;
+ base->symtree = varst;
+ base->where = gfc_current_locus;
+
+ m = gfc_match_varspec (base, 0, true);
+ if (m == MATCH_NO)
+ gfc_error ("Expected component reference at %C");
+ if (m != MATCH_YES)
+ return MATCH_ERROR;
+
+ if (gfc_match_eos () != MATCH_YES)
+ {
+ gfc_error ("Junk after CALL at %C");
+ return MATCH_ERROR;
+ }
+
+ if (base->expr_type != EXPR_COMPCALL)
+ {
+ gfc_error ("Expected type-bound procedure reference at %C");
+ return MATCH_ERROR;
+ }
+
+ new_st.op = EXEC_COMPCALL;
+ new_st.expr = base;
+
+ return MATCH_YES;
+}
+
+
/* Match a CALL statement. The tricky part here are possible
alternate return specifiers. We handle these by having all
"subroutines" actually return an integer via a register that gives
@@ -2535,6 +2583,11 @@ gfc_match_call (void)
sym = st->n.sym;
+ /* If this is a variable of derived-type, it probably starts a type-bound
+ procedure call. */
+ if (sym->attr.flavor != FL_PROCEDURE && sym->ts.type == BT_DERIVED)
+ return match_typebound_call (st);
+
/* If it does not seem to be callable... */
if (!sym->attr.generic
&& !sym->attr.subroutine)
diff --git a/gcc/fortran/match.h b/gcc/fortran/match.h
index 21a24795664..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 *****************/
@@ -175,17 +176,17 @@ match gfc_match_volatile (void);
/* Fortran 2003 c interop.
TODO: some of these should be moved to another file rather than decl.c */
void set_com_block_bind_c (gfc_common_head *, int);
-try set_binding_label (char *, const char *, int);
-try set_verify_bind_c_sym (gfc_symbol *, int);
-try set_verify_bind_c_com_block (gfc_common_head *, int);
-try get_bind_c_idents (void);
+gfc_try set_binding_label (char *, const char *, int);
+gfc_try set_verify_bind_c_sym (gfc_symbol *, int);
+gfc_try set_verify_bind_c_com_block (gfc_common_head *, int);
+gfc_try get_bind_c_idents (void);
match gfc_match_bind_c_stmt (void);
match gfc_match_suffix (gfc_symbol *, gfc_symbol **);
match gfc_match_bind_c (gfc_symbol *, bool);
-match gfc_get_type_attr_spec (symbol_attribute *);
+match gfc_get_type_attr_spec (symbol_attribute *, char*);
/* primary.c. */
-match gfc_match_structure_constructor (gfc_symbol *, gfc_expr **);
+match gfc_match_structure_constructor (gfc_symbol *, gfc_expr **, bool);
match gfc_match_variable (gfc_expr **, int);
match gfc_match_equiv_variable (gfc_expr **);
match gfc_match_actual_arglist (int, gfc_actual_arglist **);
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c
index a418bb9d9a4..0f504efeded 100644
--- a/gcc/fortran/module.c
+++ b/gcc/fortran/module.c
@@ -162,20 +162,6 @@ pointer_info;
#define gfc_get_pointer_info() XCNEW (pointer_info)
-/* Lists of rename info for the USE statement. */
-
-typedef struct gfc_use_rename
-{
- char local_name[GFC_MAX_SYMBOL_LEN + 1], use_name[GFC_MAX_SYMBOL_LEN + 1];
- struct gfc_use_rename *next;
- int found;
- gfc_intrinsic_op op;
- locus where;
-}
-gfc_use_rename;
-
-#define gfc_get_use_rename() XCNEW (gfc_use_rename);
-
/* Local variables */
/* The FILE for the module we're reading or writing. */
@@ -202,6 +188,8 @@ static int symbol_number; /* Counter for assigning symbol numbers */
/* Tells mio_expr_ref to make symbols for unused equivalence members. */
static bool in_load_equiv;
+static locus use_locus;
+
/*****************************************************************/
@@ -560,6 +548,8 @@ gfc_match_use (void)
}
}
+ use_locus = gfc_current_locus;
+
m = gfc_match_name (module_name);
if (m != MATCH_YES)
return m;
@@ -1648,7 +1638,8 @@ typedef enum
AB_ELEMENTAL, AB_PURE, AB_RECURSIVE, AB_GENERIC, AB_ALWAYS_EXPLICIT,
AB_CRAY_POINTER, AB_CRAY_POINTEE, AB_THREADPRIVATE, AB_ALLOC_COMP,
AB_POINTER_COMP, AB_PRIVATE_COMP, AB_VALUE, AB_VOLATILE, AB_PROTECTED,
- AB_IS_BIND_C, AB_IS_C_INTEROP, AB_IS_ISO_C, AB_ABSTRACT, AB_ZERO_COMP
+ AB_IS_BIND_C, AB_IS_C_INTEROP, AB_IS_ISO_C, AB_ABSTRACT, AB_ZERO_COMP,
+ AB_EXTENSION, AB_PROCEDURE, AB_PROC_POINTER
}
ab_attribute;
@@ -1688,6 +1679,23 @@ static const mstring attr_bits[] =
minit ("ZERO_COMP", AB_ZERO_COMP),
minit ("PROTECTED", AB_PROTECTED),
minit ("ABSTRACT", AB_ABSTRACT),
+ minit ("EXTENSION", AB_EXTENSION),
+ minit ("PROCEDURE", AB_PROCEDURE),
+ minit ("PROC_POINTER", AB_PROC_POINTER),
+ minit (NULL, -1)
+};
+
+/* For binding attributes. */
+static const mstring binding_passing[] =
+{
+ minit ("PASS", 0),
+ minit ("NOPASS", 1),
+ minit (NULL, -1)
+};
+static const mstring binding_overriding[] =
+{
+ minit ("OVERRIDABLE", 0),
+ minit ("NON_OVERRIDABLE", 1),
minit (NULL, -1)
};
@@ -1801,6 +1809,12 @@ mio_symbol_attribute (symbol_attribute *attr)
MIO_NAME (ab_attribute) (AB_PRIVATE_COMP, attr_bits);
if (attr->zero_comp)
MIO_NAME (ab_attribute) (AB_ZERO_COMP, attr_bits);
+ if (attr->extension)
+ MIO_NAME (ab_attribute) (AB_EXTENSION, attr_bits);
+ if (attr->procedure)
+ MIO_NAME (ab_attribute) (AB_PROCEDURE, attr_bits);
+ if (attr->proc_pointer)
+ MIO_NAME (ab_attribute) (AB_PROC_POINTER, attr_bits);
mio_rparen ();
@@ -1919,6 +1933,15 @@ mio_symbol_attribute (symbol_attribute *attr)
case AB_ZERO_COMP:
attr->zero_comp = 1;
break;
+ case AB_EXTENSION:
+ attr->extension = 1;
+ break;
+ case AB_PROCEDURE:
+ attr->procedure = 1;
+ break;
+ case AB_PROC_POINTER:
+ attr->proc_pointer = 1;
+ break;
}
}
}
@@ -2245,10 +2268,8 @@ mio_component (gfc_component *c)
mio_typespec (&c->ts);
mio_array_spec (&c->as);
- mio_integer (&c->dimension);
- mio_integer (&c->pointer);
- mio_integer (&c->allocatable);
- c->access = MIO_NAME (gfc_access) (c->access, access_types);
+ mio_symbol_attribute (&c->attr);
+ c->attr.access = MIO_NAME (gfc_access) (c->attr.access, access_types);
mio_expr (&c->initializer);
mio_rparen ();
@@ -2745,6 +2766,7 @@ static const mstring expr_types[] = {
minit ("STRUCTURE", EXPR_STRUCTURE),
minit ("ARRAY", EXPR_ARRAY),
minit ("NULL", EXPR_NULL),
+ minit ("COMPCALL", EXPR_COMPCALL),
minit (NULL, -1)
};
@@ -3008,6 +3030,10 @@ mio_expr (gfc_expr **ep)
case EXPR_NULL:
break;
+
+ case EXPR_COMPCALL:
+ gcc_unreachable ();
+ break;
}
mio_rparen ();
@@ -3161,6 +3187,147 @@ mio_namespace_ref (gfc_namespace **nsp)
}
+/* Save/restore the f2k_derived namespace of a derived-type symbol. */
+
+static void
+mio_typebound_proc (gfc_typebound_proc** proc)
+{
+ int flag;
+
+ if (iomode == IO_INPUT)
+ {
+ *proc = gfc_get_typebound_proc ();
+ (*proc)->where = gfc_current_locus;
+ }
+ gcc_assert (*proc);
+
+ mio_lparen ();
+ mio_symtree_ref (&(*proc)->target);
+
+ (*proc)->access = MIO_NAME (gfc_access) ((*proc)->access, access_types);
+
+ (*proc)->nopass = mio_name ((*proc)->nopass, binding_passing);
+ (*proc)->non_overridable = mio_name ((*proc)->non_overridable,
+ binding_overriding);
+
+ if (iomode == IO_INPUT)
+ (*proc)->pass_arg = NULL;
+
+ flag = (int) (*proc)->pass_arg_num;
+ mio_integer (&flag);
+ (*proc)->pass_arg_num = (unsigned) flag;
+
+ mio_rparen ();
+}
+
+static void
+mio_typebound_symtree (gfc_symtree* st)
+{
+ if (iomode == IO_OUTPUT && !st->typebound)
+ return;
+
+ if (iomode == IO_OUTPUT)
+ {
+ mio_lparen ();
+ mio_allocated_string (st->name);
+ }
+ /* For IO_INPUT, the above is done in mio_f2k_derived. */
+
+ mio_typebound_proc (&st->typebound);
+ mio_rparen ();
+}
+
+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 ();
+
+ /* Handle type-bound procedures. */
+ mio_lparen ();
+ if (iomode == IO_OUTPUT)
+ gfc_traverse_symtree (f2k->sym_root, &mio_typebound_symtree);
+ else
+ {
+ while (peek_atom () == ATOM_LPAREN)
+ {
+ gfc_symtree* st;
+
+ mio_lparen ();
+
+ require_atom (ATOM_STRING);
+ gfc_get_sym_tree (atom_string, f2k, &st);
+ gfc_free (atom_string);
+
+ mio_typebound_symtree (st);
+ }
+ }
+ 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. */
@@ -3223,6 +3390,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,
@@ -4878,6 +5048,7 @@ gfc_use_module (void)
gfc_state_data *p;
int c, line, start;
gfc_symtree *mod_symtree;
+ gfc_use_list *use_stmt;
filename = (char *) alloca (strlen (module_name) + strlen (MODULE_EXTENSION)
+ 1);
@@ -4970,6 +5141,34 @@ gfc_use_module (void)
pi_root = NULL;
fclose (module_fp);
+
+ use_stmt = gfc_get_use_list ();
+ use_stmt->module_name = gfc_get_string (module_name);
+ use_stmt->only_flag = only_flag;
+ use_stmt->rename = gfc_rename_list;
+ use_stmt->where = use_locus;
+ gfc_rename_list = NULL;
+ use_stmt->next = gfc_current_ns->use_stmts;
+ gfc_current_ns->use_stmts = use_stmt;
+}
+
+
+void
+gfc_free_use_stmts (gfc_use_list *use_stmts)
+{
+ gfc_use_list *next;
+ for (; use_stmts; use_stmts = next)
+ {
+ gfc_use_rename *next_rename;
+
+ for (; use_stmts->rename; use_stmts->rename = next_rename)
+ {
+ next_rename = use_stmts->rename->next;
+ gfc_free (use_stmts->rename);
+ }
+ next = use_stmts->next;
+ gfc_free (use_stmts);
+ }
}
diff --git a/gcc/fortran/options.c b/gcc/fortran/options.c
index 8480364bc52..4ecb8f998e3 100644
--- a/gcc/fortran/options.c
+++ b/gcc/fortran/options.c
@@ -69,12 +69,15 @@ gfc_init_options (unsigned int argc, const char **argv)
gfc_option.warn_aliasing = 0;
gfc_option.warn_ampersand = 0;
gfc_option.warn_character_truncation = 0;
+ gfc_option.warn_array_temp = 0;
gfc_option.warn_conversion = 0;
gfc_option.warn_implicit_interface = 0;
gfc_option.warn_line_truncation = 0;
gfc_option.warn_surprising = 0;
gfc_option.warn_tabs = 1;
gfc_option.warn_underflow = 1;
+ gfc_option.warn_intrinsic_shadow = 0;
+ gfc_option.warn_intrinsics_std = 0;
gfc_option.max_errors = 25;
gfc_option.flag_all_intrinsics = 0;
@@ -98,6 +101,7 @@ gfc_init_options (unsigned int argc, const char **argv)
gfc_option.flag_backslash = 0;
gfc_option.flag_module_private = 0;
gfc_option.flag_backtrace = 0;
+ gfc_option.flag_check_array_temporaries = 0;
gfc_option.flag_allow_leading_underscore = 0;
gfc_option.flag_dump_core = 0;
gfc_option.flag_external_blas = 0;
@@ -123,8 +127,6 @@ gfc_init_options (unsigned int argc, const char **argv)
set_default_std_flags ();
- gfc_option.warn_nonstd_intrinsics = 0;
-
/* -fshort-enums can be default on some targets. */
gfc_option.fshort_enums = targetm.default_short_enums ();
@@ -292,14 +294,6 @@ gfc_post_options (const char **pfilename)
gfc_warning_now ("'-fd-lines-as-code' has no effect in free form");
}
- flag_inline_trees = 1;
-
- /* Use tree inlining. */
- if (!flag_no_inline)
- flag_no_inline = 1;
- if (flag_inline_functions)
- flag_inline_trees = 2;
-
/* If -pedantic, warn about the use of GNU extensions. */
if (pedantic && (gfc_option.allow_std & GFC_STD_GNU) != 0)
gfc_option.warn_std |= GFC_STD_GNU;
@@ -354,9 +348,6 @@ gfc_post_options (const char **pfilename)
gfc_option.warn_tabs = 0;
}
- if (gfc_option.flag_all_intrinsics)
- gfc_option.warn_nonstd_intrinsics = 0;
-
gfc_cpp_post_options ();
/* FIXME: return gfc_cpp_preprocess_only ();
@@ -378,13 +369,14 @@ set_Wall (int setting)
gfc_option.warn_aliasing = setting;
gfc_option.warn_ampersand = setting;
gfc_option.warn_line_truncation = setting;
- gfc_option.warn_nonstd_intrinsics = setting;
gfc_option.warn_surprising = setting;
gfc_option.warn_tabs = !setting;
gfc_option.warn_underflow = setting;
+ gfc_option.warn_intrinsic_shadow = 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;
@@ -485,6 +477,10 @@ gfc_handle_option (size_t scode, const char *arg, int value)
gfc_option.warn_ampersand = value;
break;
+ case OPT_Warray_temporaries:
+ gfc_option.warn_array_temp = value;
+ break;
+
case OPT_Wcharacter_truncation:
gfc_option.warn_character_truncation = value;
break;
@@ -517,6 +513,10 @@ gfc_handle_option (size_t scode, const char *arg, int value)
gfc_option.warn_underflow = value;
break;
+ case OPT_Wintrinsic_shadow:
+ gfc_option.warn_intrinsic_shadow = value;
+ break;
+
case OPT_fall_intrinsics:
gfc_option.flag_all_intrinsics = 1;
break;
@@ -537,6 +537,10 @@ gfc_handle_option (size_t scode, const char *arg, int value)
gfc_option.flag_backtrace = value;
break;
+ case OPT_fcheck_array_temporaries:
+ gfc_option.flag_check_array_temporaries = value;
+ break;
+
case OPT_fdump_core:
gfc_option.flag_dump_core = value;
break;
@@ -778,8 +782,8 @@ gfc_handle_option (size_t scode, const char *arg, int value)
gfc_option.warn_std = 0;
break;
- case OPT_Wnonstd_intrinsics:
- gfc_option.warn_nonstd_intrinsics = value;
+ case OPT_Wintrinsics_std:
+ gfc_option.warn_intrinsics_std = value;
break;
case OPT_fshort_enums:
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 1a479627668..9ec376ad066 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -923,7 +923,7 @@ pop_state (void)
/* Try to find the given state in the state stack. */
-try
+gfc_try
gfc_find_state (gfc_compile_state state)
{
gfc_state_data *p;
@@ -1575,8 +1575,8 @@ typedef struct
}
st_state;
-static try
-verify_st_order (st_state *p, gfc_statement st)
+static gfc_try
+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;
}
@@ -1690,13 +1691,154 @@ unexpected_eof (void)
}
+/* Set the default access attribute for a typebound procedure; this is used
+ as callback for gfc_traverse_symtree. */
+
+static gfc_access typebound_default_access;
+
+static void
+set_typebound_default_access (gfc_symtree* stree)
+{
+ if (stree->typebound && stree->typebound->access == ACCESS_UNKNOWN)
+ stree->typebound->access = typebound_default_access;
+}
+
+
+/* Parse the CONTAINS section of a derived type definition. */
+
+static bool
+parse_derived_contains (void)
+{
+ gfc_state_data s;
+ bool seen_private = false;
+ bool seen_comps = false;
+ bool error_flag = false;
+ bool to_finish;
+
+ gcc_assert (gfc_current_state () == COMP_DERIVED);
+ gcc_assert (gfc_current_block ());
+
+ /* Derived-types with SEQUENCE and/or BIND(C) must not have a CONTAINS
+ section. */
+ if (gfc_current_block ()->attr.sequence)
+ gfc_error ("Derived-type '%s' with SEQUENCE must not have a CONTAINS"
+ " section at %C", gfc_current_block ()->name);
+ if (gfc_current_block ()->attr.is_bind_c)
+ gfc_error ("Derived-type '%s' with BIND(C) must not have a CONTAINS"
+ " section at %C", gfc_current_block ()->name);
+
+ accept_statement (ST_CONTAINS);
+ push_state (&s, COMP_DERIVED_CONTAINS, NULL);
+
+ to_finish = false;
+ while (!to_finish)
+ {
+ gfc_statement st;
+ st = next_statement ();
+ switch (st)
+ {
+ case ST_NONE:
+ unexpected_eof ();
+ break;
+
+ case ST_DATA_DECL:
+ gfc_error ("Components in TYPE at %C must precede CONTAINS");
+ error_flag = true;
+ break;
+
+ case ST_PROCEDURE:
+ if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Type-bound"
+ " procedure at %C") == FAILURE)
+ error_flag = true;
+
+ accept_statement (ST_PROCEDURE);
+ seen_comps = true;
+ break;
+
+ case ST_FINAL:
+ if (gfc_notify_std (GFC_STD_F2003,
+ "Fortran 2003: FINAL procedure declaration"
+ " at %C") == FAILURE)
+ error_flag = true;
+
+ accept_statement (ST_FINAL);
+ seen_comps = true;
+ break;
+
+ case ST_END_TYPE:
+ to_finish = true;
+
+ if (!seen_comps
+ && (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: Derived type "
+ "definition at %C with empty CONTAINS "
+ "section") == FAILURE))
+ error_flag = true;
+
+ /* ST_END_TYPE is accepted by parse_derived after return. */
+ break;
+
+ case ST_PRIVATE:
+ if (gfc_find_state (COMP_MODULE) == FAILURE)
+ {
+ gfc_error ("PRIVATE statement in TYPE at %C must be inside "
+ "a MODULE");
+ error_flag = true;
+ break;
+ }
+
+ if (seen_comps)
+ {
+ gfc_error ("PRIVATE statement at %C must precede procedure"
+ " bindings");
+ error_flag = true;
+ break;
+ }
+
+ if (seen_private)
+ {
+ gfc_error ("Duplicate PRIVATE statement at %C");
+ error_flag = true;
+ }
+
+ accept_statement (ST_PRIVATE);
+ seen_private = true;
+ break;
+
+ case ST_SEQUENCE:
+ gfc_error ("SEQUENCE statement at %C must precede CONTAINS");
+ error_flag = true;
+ break;
+
+ case ST_CONTAINS:
+ gfc_error ("Already inside a CONTAINS block at %C");
+ error_flag = true;
+ break;
+
+ default:
+ unexpected_statement (st);
+ break;
+ }
+ }
+
+ pop_state ();
+ gcc_assert (gfc_current_state () == COMP_DERIVED);
+
+ /* Walk the parsed type-bound procedures and set ACCESS_UNKNOWN attributes
+ to PUBLIC or PRIVATE depending on seen_private. */
+ typebound_default_access = (seen_private ? ACCESS_PRIVATE : ACCESS_PUBLIC);
+ gfc_traverse_symtree (gfc_current_block ()->f2k_derived->sym_root,
+ &set_typebound_default_access);
+
+ return error_flag;
+}
+
+
/* Parse a derived type. */
static void
parse_derived (void)
{
int compiling_type, seen_private, seen_sequence, seen_component, error_flag;
- int seen_contains, seen_contains_comp;
gfc_statement st;
gfc_state_data s;
gfc_symbol *derived_sym = NULL;
@@ -1712,8 +1854,6 @@ parse_derived (void)
seen_private = 0;
seen_sequence = 0;
seen_component = 0;
- seen_contains = 0;
- seen_contains_comp = 0;
compiling_type = 1;
@@ -1726,34 +1866,22 @@ parse_derived (void)
unexpected_eof ();
case ST_DATA_DECL:
- case ST_PROCEDURE:
- if (seen_contains)
- {
- gfc_error ("Components in TYPE at %C must precede CONTAINS");
- error_flag = 1;
- }
-
accept_statement (st);
seen_component = 1;
break;
- case ST_FINAL:
- if (!seen_contains)
- {
- gfc_error ("FINAL declaration at %C must be inside CONTAINS");
- error_flag = 1;
- }
-
- if (gfc_notify_std (GFC_STD_F2003,
- "Fortran 2003: FINAL procedure declaration"
- " at %C") == FAILURE)
- error_flag = 1;
+ case ST_PROCEDURE:
+ gfc_error ("PROCEDURE binding at %C must be inside CONTAINS");
+ error_flag = 1;
+ break;
- accept_statement (ST_FINAL);
- seen_contains_comp = 1;
+ case ST_FINAL:
+ gfc_error ("FINAL declaration at %C must be inside CONTAINS");
+ error_flag = 1;
break;
case ST_END_TYPE:
+endType:
compiling_type = 0;
if (!seen_component
@@ -1762,22 +1890,10 @@ parse_derived (void)
== FAILURE))
error_flag = 1;
- if (seen_contains && !seen_contains_comp
- && (gfc_notify_std (GFC_STD_F2008, "Fortran 2008: Derived type "
- "definition at %C with empty CONTAINS "
- "section") == FAILURE))
- error_flag = 1;
-
accept_statement (ST_END_TYPE);
break;
case ST_PRIVATE:
- if (seen_contains)
- {
- gfc_error ("PRIVATE statement at %C must precede CONTAINS");
- error_flag = 1;
- }
-
if (gfc_find_state (COMP_MODULE) == FAILURE)
{
gfc_error ("PRIVATE statement in TYPE at %C must be inside "
@@ -1801,17 +1917,12 @@ parse_derived (void)
}
s.sym->component_access = ACCESS_PRIVATE;
+
accept_statement (ST_PRIVATE);
seen_private = 1;
break;
case ST_SEQUENCE:
- if (seen_contains)
- {
- gfc_error ("SEQUENCE statement at %C must precede CONTAINS");
- error_flag = 1;
- }
-
if (seen_component)
{
gfc_error ("SEQUENCE statement at %C must precede "
@@ -1841,15 +1952,10 @@ parse_derived (void)
" definition at %C") == FAILURE)
error_flag = 1;
- if (seen_contains)
- {
- gfc_error ("Already inside a CONTAINS block at %C");
- error_flag = 1;
- }
-
- seen_contains = 1;
accept_statement (ST_CONTAINS);
- break;
+ if (parse_derived_contains ())
+ error_flag = 1;
+ goto endType;
default:
unexpected_statement (st);
@@ -1866,7 +1972,7 @@ parse_derived (void)
for (c = sym->components; c; c = c->next)
{
/* Look for allocatable components. */
- if (c->allocatable
+ if (c->attr.allocatable
|| (c->ts.type == BT_DERIVED && c->ts.derived->attr.alloc_comp))
{
sym->attr.alloc_comp = 1;
@@ -1874,7 +1980,7 @@ parse_derived (void)
}
/* Look for pointer components. */
- if (c->pointer
+ if (c->attr.pointer
|| (c->ts.type == BT_DERIVED && c->ts.derived->attr.pointer_comp))
{
sym->attr.pointer_comp = 1;
@@ -1883,7 +1989,7 @@ parse_derived (void)
/* Look for private components. */
if (sym->component_access == ACCESS_PRIVATE
- || c->access == ACCESS_PRIVATE
+ || c->attr.access == ACCESS_PRIVATE
|| (c->ts.type == BT_DERIVED && c->ts.derived->attr.private_comp))
{
sym->attr.private_comp = 1;
@@ -1958,7 +2064,7 @@ static gfc_statement parse_spec (gfc_statement);
static void
parse_interface (void)
{
- gfc_compile_state new_state, current_state;
+ gfc_compile_state new_state = COMP_NONE, current_state;
gfc_symbol *prog_unit, *sym;
gfc_interface_info save;
gfc_state_data s1, s2;
@@ -2169,6 +2275,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 +2302,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 +2376,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 +2471,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;
@@ -3563,7 +3739,7 @@ add_global_program (void)
/* Top level parser. */
-try
+gfc_try
gfc_parse_file (void)
{
int seen_program, errors_before, errors;
diff --git a/gcc/fortran/parse.h b/gcc/fortran/parse.h
index 196b9f736a5..7fe2330dbec 100644
--- a/gcc/fortran/parse.h
+++ b/gcc/fortran/parse.h
@@ -29,8 +29,8 @@ along with GCC; see the file COPYING3. If not see
typedef enum
{
COMP_NONE, COMP_PROGRAM, COMP_MODULE, COMP_SUBROUTINE, COMP_FUNCTION,
- COMP_BLOCK_DATA, COMP_INTERFACE, COMP_DERIVED, COMP_IF, COMP_DO,
- COMP_SELECT, COMP_FORALL, COMP_WHERE, COMP_CONTAINS, COMP_ENUM,
+ COMP_BLOCK_DATA, COMP_INTERFACE, COMP_DERIVED, COMP_DERIVED_CONTAINS, COMP_IF,
+ COMP_DO, COMP_SELECT, COMP_FORALL, COMP_WHERE, COMP_CONTAINS, COMP_ENUM,
COMP_OMP_STRUCTURED_BLOCK
}
gfc_compile_state;
@@ -61,7 +61,7 @@ extern gfc_state_data *gfc_state_stack;
#define gfc_current_state() (gfc_state_stack->state)
int gfc_check_do_variable (gfc_symtree *);
-try gfc_find_state (gfc_compile_state);
+gfc_try gfc_find_state (gfc_compile_state);
gfc_state_data *gfc_enclosing_unit (gfc_compile_state *);
const char *gfc_ascii_statement (gfc_statement);
match gfc_match_enum (void);
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c
index ba8416376ec..c72f430c860 100644
--- a/gcc/fortran/primary.c
+++ b/gcc/fortran/primary.c
@@ -1676,7 +1676,7 @@ cleanup:
}
-/* Used by match_varspec() to extend the reference list by one
+/* Used by gfc_match_varspec() to extend the reference list by one
element. */
static gfc_ref *
@@ -1699,15 +1699,17 @@ extend_ref (gfc_expr *primary, gfc_ref *tail)
/* Match any additional specifications associated with the current
variable like member references or substrings. If equiv_flag is
set we only match stuff that is allowed inside an EQUIVALENCE
- statement. */
+ statement. sub_flag tells whether we expect a type-bound procedure found
+ to be a subroutine as part of CALL or a FUNCTION. */
-static match
-match_varspec (gfc_expr *primary, int equiv_flag)
+match
+gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag)
{
char name[GFC_MAX_SYMBOL_LEN + 1];
gfc_ref *substring, *tail;
gfc_component *component;
gfc_symbol *sym = primary->symtree->n.sym;
+ gfc_symtree *tbp;
match m;
bool unknown;
@@ -1751,13 +1753,61 @@ match_varspec (gfc_expr *primary, int equiv_flag)
for (;;)
{
+ gfc_try t;
+
m = gfc_match_name (name);
if (m == MATCH_NO)
gfc_error ("Expected structure component name at %C");
if (m != MATCH_YES)
return MATCH_ERROR;
- component = gfc_find_component (sym, name);
+ tbp = gfc_find_typebound_proc (sym, &t, name, false);
+ if (tbp)
+ {
+ gfc_symbol* tbp_sym;
+
+ if (t == FAILURE)
+ return MATCH_ERROR;
+
+ gcc_assert (!tail || !tail->next);
+ gcc_assert (primary->expr_type == EXPR_VARIABLE);
+
+ tbp_sym = tbp->typebound->target->n.sym;
+
+ primary->expr_type = EXPR_COMPCALL;
+ primary->value.compcall.tbp = tbp;
+ primary->ts = tbp_sym->ts;
+
+ m = gfc_match_actual_arglist (tbp_sym->attr.subroutine,
+ &primary->value.compcall.actual);
+ if (m == MATCH_ERROR)
+ return MATCH_ERROR;
+ if (m == MATCH_NO)
+ {
+ if (sub_flag)
+ primary->value.compcall.actual = NULL;
+ else
+ {
+ gfc_error ("Expected argument list at %C");
+ return MATCH_ERROR;
+ }
+ }
+
+ if (sub_flag && !tbp_sym->attr.subroutine)
+ {
+ gfc_error ("'%s' at %C should be a SUBROUTINE", name);
+ return MATCH_ERROR;
+ }
+ if (!sub_flag && !tbp_sym->attr.function)
+ {
+ gfc_error ("'%s' at %C should be a FUNCTION", name);
+ return MATCH_ERROR;
+ }
+
+ break;
+ }
+
+ component = gfc_find_component (sym, name, false, false);
if (component == NULL)
return MATCH_ERROR;
@@ -1898,7 +1948,7 @@ gfc_variable_attr (gfc_expr *expr, gfc_typespec *ts)
break;
case REF_COMPONENT:
- gfc_get_component_attr (&attr, ref->u.c.component);
+ attr = ref->u.c.component->attr;
if (ts != NULL)
{
*ts = ref->u.c.component->ts;
@@ -1909,8 +1959,8 @@ gfc_variable_attr (gfc_expr *expr, gfc_typespec *ts)
ts->cl = NULL;
}
- pointer = ref->u.c.component->pointer;
- allocatable = ref->u.c.component->allocatable;
+ pointer = ref->u.c.component->attr.pointer;
+ allocatable = ref->u.c.component->attr.allocatable;
if (pointer)
target = 1;
@@ -1984,11 +2034,103 @@ gfc_free_structure_ctor_component (gfc_structure_ctor_component *comp)
gfc_free_expr (comp->val);
}
-match
-gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result)
+
+/* Translate the component list into the actual constructor by sorting it in
+ the order required; this also checks along the way that each and every
+ component actually has an initializer and handles default initializers
+ for components without explicit value given. */
+static gfc_try
+build_actual_constructor (gfc_structure_ctor_component **comp_head,
+ gfc_constructor **ctor_head, gfc_symbol *sym)
{
- gfc_structure_ctor_component *comp_head, *comp_tail;
gfc_structure_ctor_component *comp_iter;
+ gfc_constructor *ctor_tail = NULL;
+ gfc_component *comp;
+
+ for (comp = sym->components; comp; comp = comp->next)
+ {
+ gfc_structure_ctor_component **next_ptr;
+ gfc_expr *value = NULL;
+
+ /* Try to find the initializer for the current component by name. */
+ next_ptr = comp_head;
+ for (comp_iter = *comp_head; comp_iter; comp_iter = comp_iter->next)
+ {
+ if (!strcmp (comp_iter->name, comp->name))
+ break;
+ next_ptr = &comp_iter->next;
+ }
+
+ /* If an extension, try building the parent derived type by building
+ a value expression for the parent derived type and calling self. */
+ if (!comp_iter && comp == sym->components && sym->attr.extension)
+ {
+ value = gfc_get_expr ();
+ value->expr_type = EXPR_STRUCTURE;
+ value->value.constructor = NULL;
+ value->ts = comp->ts;
+ value->where = gfc_current_locus;
+
+ if (build_actual_constructor (comp_head, &value->value.constructor,
+ comp->ts.derived) == FAILURE)
+ {
+ gfc_free_expr (value);
+ return FAILURE;
+ }
+ *ctor_head = ctor_tail = gfc_get_constructor ();
+ ctor_tail->expr = value;
+ continue;
+ }
+
+ /* If it was not found, try the default initializer if there's any;
+ otherwise, it's an error. */
+ if (!comp_iter)
+ {
+ if (comp->initializer)
+ {
+ if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Structure"
+ " constructor with missing optional arguments"
+ " at %C") == FAILURE)
+ return FAILURE;
+ value = gfc_copy_expr (comp->initializer);
+ }
+ else
+ {
+ gfc_error ("No initializer for component '%s' given in the"
+ " structure constructor at %C!", comp->name);
+ return FAILURE;
+ }
+ }
+ else
+ value = comp_iter->val;
+
+ /* Add the value to the constructor chain built. */
+ if (ctor_tail)
+ {
+ ctor_tail->next = gfc_get_constructor ();
+ ctor_tail = ctor_tail->next;
+ }
+ else
+ *ctor_head = ctor_tail = gfc_get_constructor ();
+ gcc_assert (value);
+ ctor_tail->expr = value;
+
+ /* Remove the entry from the component list. We don't want the expression
+ value to be free'd, so set it to NULL. */
+ if (comp_iter)
+ {
+ *next_ptr = comp_iter->next;
+ comp_iter->val = NULL;
+ gfc_free_structure_ctor_component (comp_iter);
+ }
+ }
+ return SUCCESS;
+}
+
+match
+gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result, bool parent)
+{
+ gfc_structure_ctor_component *comp_tail, *comp_head, *comp_iter;
gfc_constructor *ctor_head, *ctor_tail;
gfc_component *comp; /* Is set NULL when named component is first seen */
gfc_expr *e;
@@ -1996,15 +2138,15 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result)
match m;
const char* last_name = NULL;
- comp_head = comp_tail = NULL;
+ comp_tail = comp_head = NULL;
ctor_head = ctor_tail = NULL;
- if (gfc_match_char ('(') != MATCH_YES)
+ if (!parent && gfc_match_char ('(') != MATCH_YES)
goto syntax;
where = gfc_current_locus;
- gfc_find_component (sym, NULL);
+ gfc_find_component (sym, NULL, false, true);
/* Match the component list and store it in a list together with the
corresponding component names. Check for empty argument list first. */
@@ -2047,7 +2189,7 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result)
if (last_name)
gfc_error ("Component initializer without name after"
" component named %s at %C!", last_name);
- else
+ else if (!parent)
gfc_error ("Too many components in structure constructor at"
" %C!");
goto cleanup;
@@ -2057,39 +2199,22 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result)
strncpy (comp_tail->name, comp->name, GFC_MAX_SYMBOL_LEN + 1);
}
- /* Find the current component in the structure definition; this is
- needed to get its access attribute in the private check below. */
+ /* Find the current component in the structure definition and check
+ its access is not private. */
if (comp)
- this_comp = comp;
+ this_comp = gfc_find_component (sym, comp->name, false, false);
else
{
- for (comp = sym->components; comp; comp = comp->next)
- if (!strcmp (comp->name, comp_tail->name))
- {
- this_comp = comp;
- break;
- }
+ this_comp = gfc_find_component (sym,
+ (const char *)comp_tail->name,
+ false, false);
comp = NULL; /* Reset needed! */
-
- /* Here we can check if a component name is given which does not
- correspond to any component of the defined structure. */
- if (!this_comp)
- {
- gfc_error ("Component '%s' in structure constructor at %C"
- " does not correspond to any component in the"
- " constructed structure!", comp_tail->name);
- goto cleanup;
- }
}
- gcc_assert (this_comp);
- /* Check the current component's access status. */
- if (sym->attr.use_assoc && this_comp->access == ACCESS_PRIVATE)
- {
- gfc_error ("Component '%s' is PRIVATE in structure constructor"
- " at %C!", comp_tail->name);
- goto cleanup;
- }
+ /* Here we can check if a component name is given which does not
+ correspond to any component of the defined structure. */
+ if (!this_comp)
+ goto cleanup;
/* Check if this component is already given a value. */
for (comp_iter = comp_head; comp_iter != comp_tail;
@@ -2111,89 +2236,56 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result)
if (m == MATCH_ERROR)
goto cleanup;
- if (comp)
- comp = comp->next;
- }
- while (gfc_match_char (',') == MATCH_YES);
+ /* If not explicitly a parent constructor, gather up the components
+ and build one. */
+ if (comp && comp == sym->components
+ && sym->attr.extension
+ && (comp_tail->val->ts.type != BT_DERIVED
+ ||
+ comp_tail->val->ts.derived != this_comp->ts.derived))
+ {
+ gfc_current_locus = where;
+ gfc_free_expr (comp_tail->val);
- if (gfc_match_char (')') != MATCH_YES)
- goto syntax;
-
- /* If there were components given and all components are private, error
- out at this place. */
- if (sym->attr.use_assoc && sym->component_access == ACCESS_PRIVATE)
- {
- gfc_error ("All components of '%s' are PRIVATE in structure"
- " constructor at %C", sym->name);
- goto cleanup;
- }
- }
+ m = gfc_match_structure_constructor (comp->ts.derived,
+ &comp_tail->val, true);
+ if (m == MATCH_NO)
+ goto syntax;
+ if (m == MATCH_ERROR)
+ goto cleanup;
+ }
- /* Translate the component list into the actual constructor by sorting it in
- the order required; this also checks along the way that each and every
- component actually has an initializer and handles default initializers
- for components without explicit value given. */
- for (comp = sym->components; comp; comp = comp->next)
- {
- gfc_structure_ctor_component **next_ptr;
- gfc_expr *value = NULL;
+ if (comp)
+ comp = comp->next;
- /* Try to find the initializer for the current component by name. */
- next_ptr = &comp_head;
- for (comp_iter = comp_head; comp_iter; comp_iter = comp_iter->next)
- {
- if (!strcmp (comp_iter->name, comp->name))
+ if (parent && !comp)
break;
- next_ptr = &comp_iter->next;
}
- /* If it was not found, try the default initializer if there's any;
- otherwise, it's an error. */
- if (!comp_iter)
- {
- if (comp->initializer)
- {
- if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: Structure"
- " constructor with missing optional arguments"
- " at %C") == FAILURE)
- goto cleanup;
- value = gfc_copy_expr (comp->initializer);
- }
- else
- {
- gfc_error ("No initializer for component '%s' given in the"
- " structure constructor at %C!", comp->name);
- goto cleanup;
- }
- }
- else
- value = comp_iter->val;
-
- /* Add the value to the constructor chain built. */
- if (ctor_tail)
- {
- ctor_tail->next = gfc_get_constructor ();
- ctor_tail = ctor_tail->next;
- }
- else
- ctor_head = ctor_tail = gfc_get_constructor ();
- gcc_assert (value);
- ctor_tail->expr = value;
+ while (gfc_match_char (',') == MATCH_YES);
- /* Remove the entry from the component list. We don't want the expression
- value to be free'd, so set it to NULL. */
- if (comp_iter)
- {
- *next_ptr = comp_iter->next;
- comp_iter->val = NULL;
- gfc_free_structure_ctor_component (comp_iter);
- }
+ if (!parent && gfc_match_char (')') != MATCH_YES)
+ goto syntax;
}
+ if (build_actual_constructor (&comp_head, &ctor_head, sym) == FAILURE)
+ goto cleanup;
+
/* No component should be left, as this should have caused an error in the
loop constructing the component-list (name that does not correspond to any
component in the structure definition). */
- gcc_assert (!comp_head);
+ if (comp_head && sym->attr.extension)
+ {
+ for (comp_iter = comp_head; comp_iter; comp_iter = comp_iter->next)
+ {
+ gfc_error ("component '%s' at %L has already been set by a "
+ "parent derived type constructor", comp_iter->name,
+ &comp_iter->where);
+ }
+ goto cleanup;
+ }
+ else
+ gcc_assert (!comp_head);
e = gfc_get_expr ();
@@ -2345,7 +2437,7 @@ gfc_match_rvalue (gfc_expr **result)
e->expr_type = EXPR_VARIABLE;
e->symtree = symtree;
- m = match_varspec (e, 0);
+ m = gfc_match_varspec (e, 0, false);
break;
case FL_PARAMETER:
@@ -2362,7 +2454,7 @@ gfc_match_rvalue (gfc_expr **result)
}
e->symtree = symtree;
- m = match_varspec (e, 0);
+ m = gfc_match_varspec (e, 0, false);
if (sym->ts.is_c_interop || sym->ts.is_iso_c)
break;
@@ -2396,7 +2488,7 @@ gfc_match_rvalue (gfc_expr **result)
if (sym == NULL)
m = MATCH_ERROR;
else
- m = gfc_match_structure_constructor (sym, &e);
+ m = gfc_match_structure_constructor (sym, &e, false);
break;
/* If we're here, then the name is known to be the name of a
@@ -2413,13 +2505,13 @@ gfc_match_rvalue (gfc_expr **result)
goto function0;
if (sym->attr.flavor == FL_UNKNOWN) sym->attr.flavor = FL_PROCEDURE;
- if (gfc_intrinsic_name (sym->name, 0)
- || gfc_intrinsic_name (sym->name, 1))
+ if (gfc_is_intrinsic (sym, 0, gfc_current_locus)
+ || gfc_is_intrinsic (sym, 1, gfc_current_locus))
sym->attr.intrinsic = 1;
e = gfc_get_expr ();
e->expr_type = EXPR_VARIABLE;
e->symtree = symtree;
- m = match_varspec (e, 0);
+ m = gfc_match_varspec (e, 0, false);
break;
}
@@ -2446,7 +2538,7 @@ gfc_match_rvalue (gfc_expr **result)
e->symtree = symtree;
e->expr_type = EXPR_VARIABLE;
- m = match_varspec (e, 0);
+ m = gfc_match_varspec (e, 0, false);
break;
}
@@ -2542,7 +2634,7 @@ gfc_match_rvalue (gfc_expr **result)
e = gfc_get_expr ();
e->symtree = symtree;
e->expr_type = EXPR_VARIABLE;
- m = match_varspec (e, 0);
+ m = gfc_match_varspec (e, 0, false);
break;
}
@@ -2565,9 +2657,9 @@ gfc_match_rvalue (gfc_expr **result)
break;
}
- /*FIXME:??? match_varspec does set this for us: */
+ /*FIXME:??? gfc_match_varspec does set this for us: */
e->ts = sym->ts;
- m = match_varspec (e, 0);
+ m = gfc_match_varspec (e, 0, false);
break;
}
@@ -2656,7 +2748,7 @@ gfc_match_rvalue (gfc_expr **result)
/* If our new function returns a character, array or structure
type, it might have subsequent references. */
- m = match_varspec (e, 0);
+ m = gfc_match_varspec (e, 0, false);
if (m == MATCH_NO)
m = MATCH_YES;
@@ -2840,7 +2932,7 @@ match_variable (gfc_expr **result, int equiv_flag, int host_flag)
expr->where = where;
/* Now see if we have to do more. */
- m = match_varspec (expr, equiv_flag);
+ m = gfc_match_varspec (expr, equiv_flag, false);
if (m != MATCH_YES)
{
gfc_free_expr (expr);
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 056ff0ee3e2..c6f59ad6329 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -298,7 +298,7 @@ resolve_formal_arglists (gfc_namespace *ns)
static void
resolve_contained_fntype (gfc_symbol *sym, gfc_namespace *ns)
{
- try t;
+ gfc_try t;
/* If this namespace is not a function or an entry master function,
ignore it. */
@@ -648,7 +648,7 @@ has_default_initializer (gfc_symbol *der)
for (c = der->components; c; c = c->next)
if ((c->ts.type != BT_DERIVED && c->initializer)
|| (c->ts.type == BT_DERIVED
- && (!c->pointer && has_default_initializer (c->ts.derived))))
+ && (!c->attr.pointer && has_default_initializer (c->ts.derived))))
break;
return c != NULL;
@@ -767,12 +767,12 @@ resolve_contained_functions (gfc_namespace *ns)
/* Resolve all of the elements of a structure constructor and make sure that
the types are correct. */
-static try
+static gfc_try
resolve_structure_cons (gfc_expr *expr)
{
gfc_constructor *cons;
gfc_component *comp;
- try t;
+ gfc_try t;
symbol_attribute a;
t = SUCCESS;
@@ -810,7 +810,7 @@ resolve_structure_cons (gfc_expr *expr)
rank = comp->as ? comp->as->rank : 0;
if (cons->expr->expr_type != EXPR_NULL && rank != cons->expr->rank
- && (comp->allocatable || cons->expr->rank))
+ && (comp->attr.allocatable || cons->expr->rank))
{
gfc_error ("The rank of the element in the derived type "
"constructor at %L does not match that of the "
@@ -824,7 +824,7 @@ resolve_structure_cons (gfc_expr *expr)
if (!gfc_compare_types (&cons->expr->ts, &comp->ts))
{
t = FAILURE;
- if (comp->pointer && cons->expr->ts.type != BT_UNKNOWN)
+ if (comp->attr.pointer && cons->expr->ts.type != BT_UNKNOWN)
gfc_error ("The element in the derived type constructor at %L, "
"for pointer component '%s', is %s but should be %s",
&cons->expr->where, comp->name,
@@ -835,7 +835,7 @@ resolve_structure_cons (gfc_expr *expr)
}
if (cons->expr->expr_type == EXPR_NULL
- && !(comp->pointer || comp->allocatable))
+ && !(comp->attr.pointer || comp->attr.allocatable))
{
t = FAILURE;
gfc_error ("The NULL in the derived type constructor at %L is "
@@ -844,7 +844,7 @@ resolve_structure_cons (gfc_expr *expr)
comp->name);
}
- if (!comp->pointer || cons->expr->expr_type == EXPR_NULL)
+ if (!comp->attr.pointer || cons->expr->expr_type == EXPR_NULL)
continue;
a = gfc_expr_attr (cons->expr);
@@ -1017,7 +1017,7 @@ resolve_assumed_size_actual (gfc_expr *e)
that look like procedure arguments are really simple variable
references. */
-static try
+static gfc_try
resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype)
{
gfc_symbol *sym;
@@ -1076,7 +1076,7 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype)
if (!sym->attr.intrinsic
&& !(sym->attr.external || sym->attr.use_assoc
|| sym->attr.if_source == IFSRC_IFBODY)
- && gfc_intrinsic_name (sym->name, sym->attr.subroutine))
+ && gfc_is_intrinsic (sym, sym->attr.subroutine, e->where))
sym->attr.intrinsic = 1;
if (sym->attr.proc == PROC_ST_FUNCTION)
@@ -1261,7 +1261,7 @@ resolve_actual_arglist (gfc_actual_arglist *arg, procedure_type ptype)
procedures. If called with c == NULL, we have a function, otherwise if
expr == NULL, we have a subroutine. */
-static try
+static gfc_try
resolve_elemental_actual (gfc_expr *expr, gfc_code *c)
{
gfc_actual_arglist *arg0;
@@ -1506,7 +1506,7 @@ resolve_generic_f0 (gfc_expr *expr, gfc_symbol *sym)
}
-static try
+static gfc_try
resolve_generic_f (gfc_expr *expr)
{
gfc_symbol *sym;
@@ -1535,7 +1535,7 @@ generic:
/* Last ditch attempt. See if the reference is to an intrinsic
that possesses a matching interface. 14.1.2.4 */
- if (sym && !gfc_intrinsic_name (sym->name, 0))
+ if (sym && !gfc_is_intrinsic (sym, 0, expr->where))
{
gfc_error ("There is no specific function for the generic '%s' at %L",
expr->symtree->n.sym->name, &expr->where);
@@ -1622,7 +1622,7 @@ found:
}
-static try
+static gfc_try
resolve_specific_f (gfc_expr *expr)
{
gfc_symbol *sym;
@@ -1656,7 +1656,7 @@ resolve_specific_f (gfc_expr *expr)
/* Resolve a procedure call not known to be generic nor specific. */
-static try
+static gfc_try
resolve_unknown_f (gfc_expr *expr)
{
gfc_symbol *sym;
@@ -1673,7 +1673,7 @@ resolve_unknown_f (gfc_expr *expr)
/* See if we have an intrinsic function reference. */
- if (gfc_intrinsic_name (sym->name, 0))
+ if (gfc_is_intrinsic (sym, 0, expr->where))
{
if (gfc_intrinsic_func_interface (expr, 1) == MATCH_YES)
return SUCCESS;
@@ -1721,13 +1721,13 @@ is_external_proc (gfc_symbol *sym)
{
if (!sym->attr.dummy && !sym->attr.contained
&& !(sym->attr.intrinsic
- || gfc_intrinsic_name (sym->name, sym->attr.subroutine))
+ || gfc_is_intrinsic (sym, sym->attr.subroutine, sym->declared_at))
&& sym->attr.proc != PROC_ST_FUNCTION
&& !sym->attr.use_assoc
&& sym->name)
return true;
- else
- return false;
+
+ return false;
}
@@ -1796,10 +1796,10 @@ pure_stmt_function (gfc_expr *e, gfc_symbol *sym)
}
-static try
+static gfc_try
is_scalar_expr_ptr (gfc_expr *expr)
{
- try retval = SUCCESS;
+ gfc_try retval = SUCCESS;
gfc_ref *ref;
int start;
int end;
@@ -1897,14 +1897,14 @@ is_scalar_expr_ptr (gfc_expr *expr)
and, in the case of c_associated, set the binding label based on
the arguments. */
-static try
+static gfc_try
gfc_iso_c_func_interface (gfc_symbol *sym, gfc_actual_arglist *args,
gfc_symbol **new_sym)
{
char name[GFC_MAX_SYMBOL_LEN + 1];
char binding_label[GFC_MAX_BINDING_LABEL_LEN + 1];
int optional_arg = 0;
- try retval = SUCCESS;
+ gfc_try retval = SUCCESS;
gfc_symbol *args_sym;
gfc_typespec *arg_ts;
gfc_ref *parent_ref;
@@ -1996,7 +1996,7 @@ gfc_iso_c_func_interface (gfc_symbol *sym, gfc_actual_arglist *args,
if (!(args_sym->attr.target)
&& !(args_sym->attr.pointer)
&& (parent_ref == NULL ||
- !parent_ref->u.c.component->pointer))
+ !parent_ref->u.c.component->attr.pointer))
{
gfc_error_now ("Parameter '%s' to '%s' at %L must be either "
"a TARGET or an associated pointer",
@@ -2084,7 +2084,7 @@ gfc_iso_c_func_interface (gfc_symbol *sym, gfc_actual_arglist *args,
}
else if ((args_sym->attr.pointer == 1 ||
(parent_ref != NULL
- && parent_ref->u.c.component->pointer))
+ && parent_ref->u.c.component->attr.pointer))
&& is_scalar_expr_ptr (args->expr) != SUCCESS)
{
/* Case 1c, section 15.1.2.5, J3/04-007: an associated
@@ -2161,13 +2161,13 @@ gfc_iso_c_func_interface (gfc_symbol *sym, gfc_actual_arglist *args,
/* TODO: Check procedure arguments so that an INTENT(IN) isn't passed
to INTENT(OUT) or INTENT(INOUT). */
-static try
+static gfc_try
resolve_function (gfc_expr *expr)
{
gfc_actual_arglist *arg;
gfc_symbol *sym;
const char *name;
- try t;
+ gfc_try t;
int temp;
procedure_type p = PROC_INTRINSIC;
@@ -2438,7 +2438,7 @@ resolve_generic_s0 (gfc_code *c, gfc_symbol *sym)
}
-static try
+static gfc_try
resolve_generic_s (gfc_code *c)
{
gfc_symbol *sym;
@@ -2469,7 +2469,7 @@ generic:
that possesses a matching interface. 14.1.2.4 */
sym = c->symtree->n.sym;
- if (!gfc_intrinsic_name (sym->name, 1))
+ if (!gfc_is_intrinsic (sym, 1, c->loc))
{
gfc_error ("There is no specific subroutine for the generic '%s' at %L",
sym->name, &c->loc);
@@ -2698,7 +2698,7 @@ found:
}
-static try
+static gfc_try
resolve_specific_s (gfc_code *c)
{
gfc_symbol *sym;
@@ -2733,7 +2733,7 @@ resolve_specific_s (gfc_code *c)
/* Resolve a subroutine call not known to be generic nor specific. */
-static try
+static gfc_try
resolve_unknown_s (gfc_code *c)
{
gfc_symbol *sym;
@@ -2748,7 +2748,7 @@ resolve_unknown_s (gfc_code *c)
/* See if we have an intrinsic function reference. */
- if (gfc_intrinsic_name (sym->name, 1))
+ if (gfc_is_intrinsic (sym, 1, c->loc))
{
if (gfc_intrinsic_sub_interface (c, 1) == MATCH_YES)
return SUCCESS;
@@ -2772,10 +2772,10 @@ found:
for functions, subroutines and functions are stored differently and this
makes things awkward. */
-static try
+static gfc_try
resolve_call (gfc_code *c)
{
- try t;
+ gfc_try t;
procedure_type ptype = PROC_INTRINSIC;
if (c->symtree && c->symtree->n.sym
@@ -2864,10 +2864,10 @@ resolve_call (gfc_code *c)
if their shapes do not match. If either op1->shape or op2->shape is
NULL, return SUCCESS. */
-static try
+static gfc_try
compare_shapes (gfc_expr *op1, gfc_expr *op2)
{
- try t;
+ gfc_try t;
int i;
t = SUCCESS;
@@ -2893,13 +2893,13 @@ compare_shapes (gfc_expr *op1, gfc_expr *op2)
/* Resolve an operator expression node. This can involve replacing the
operation with a user defined function call. */
-static try
+static gfc_try
resolve_operator (gfc_expr *e)
{
gfc_expr *op1, *op2;
char msg[200];
bool dual_locus_error;
- try t;
+ gfc_try t;
/* Resolve all subnodes-- give them types. */
@@ -3338,7 +3338,7 @@ compute_last_value_for_triplet (gfc_expr *start, gfc_expr *end,
/* Compare a single dimension of an array reference to the array
specification. */
-static try
+static gfc_try
check_dimension (int i, gfc_array_ref *ar, gfc_array_spec *as)
{
mpz_t last_value;
@@ -3456,7 +3456,7 @@ check_dimension (int i, gfc_array_ref *ar, gfc_array_spec *as)
/* Compare an array reference with an array specification. */
-static try
+static gfc_try
compare_spec_to_ref (gfc_array_ref *ar)
{
gfc_array_spec *as;
@@ -3495,7 +3495,7 @@ compare_spec_to_ref (gfc_array_ref *ar)
/* Resolve one part of an array index. */
-try
+gfc_try
gfc_resolve_index (gfc_expr *index, int check_scalar)
{
gfc_typespec ts;
@@ -3539,7 +3539,7 @@ gfc_resolve_index (gfc_expr *index, int check_scalar)
/* Resolve a dim argument to an intrinsic function. */
-try
+gfc_try
gfc_resolve_dim_arg (gfc_expr *dim)
{
if (dim == NULL)
@@ -3624,7 +3624,7 @@ find_array_spec (gfc_expr *e)
if (c == NULL)
gfc_internal_error ("find_array_spec(): Component not found");
- if (c->dimension)
+ if (c->attr.dimension)
{
if (as != NULL)
gfc_internal_error ("find_array_spec(): unused as(1)");
@@ -3644,7 +3644,7 @@ find_array_spec (gfc_expr *e)
/* Resolve an array reference. */
-static try
+static gfc_try
resolve_array_ref (gfc_array_ref *ar)
{
int i, check_scalar;
@@ -3705,7 +3705,7 @@ resolve_array_ref (gfc_array_ref *ar)
}
-static try
+static gfc_try
resolve_substring (gfc_ref *ref)
{
if (ref->u.ss.start != NULL)
@@ -3837,7 +3837,7 @@ gfc_resolve_substring_charlen (gfc_expr *e)
/* Resolve subtype references. */
-static try
+static gfc_try
resolve_ref (gfc_expr *expr)
{
int current_part_dimension, n_components, seen_part_dimension;
@@ -3897,14 +3897,14 @@ resolve_ref (gfc_expr *expr)
case REF_COMPONENT:
if (current_part_dimension || seen_part_dimension)
{
- if (ref->u.c.component->pointer)
+ if (ref->u.c.component->attr.pointer)
{
gfc_error ("Component to the right of a part reference "
"with nonzero rank must not have the POINTER "
"attribute at %L", &expr->where);
return FAILURE;
}
- else if (ref->u.c.component->allocatable)
+ else if (ref->u.c.component->attr.allocatable)
{
gfc_error ("Component to the right of a part reference "
"with nonzero rank must not have the ALLOCATABLE "
@@ -4035,11 +4035,11 @@ done:
/* Resolve a variable expression. */
-static try
+static gfc_try
resolve_variable (gfc_expr *e)
{
gfc_symbol *sym;
- try t;
+ gfc_try t;
t = SUCCESS;
@@ -4281,14 +4281,149 @@ fixup_charlen (gfc_expr *e)
}
+/* Update an actual argument to include the passed-object for type-bound
+ procedures at the right position. */
+
+static gfc_actual_arglist*
+update_arglist_pass (gfc_actual_arglist* lst, gfc_expr* po, unsigned argpos)
+{
+ if (argpos == 1)
+ {
+ gfc_actual_arglist* result;
+
+ result = gfc_get_actual_arglist ();
+ result->expr = po;
+ result->next = lst;
+
+ return result;
+ }
+
+ gcc_assert (lst);
+ gcc_assert (argpos > 1);
+
+ lst->next = update_arglist_pass (lst->next, po, argpos - 1);
+ return lst;
+}
+
+
+/* Update the arglist of an EXPR_COMPCALL expression to include the
+ passed-object. */
+
+static gfc_try
+update_compcall_arglist (gfc_expr* e)
+{
+ gfc_expr* po;
+ gfc_typebound_proc* tbp;
+
+ tbp = e->value.compcall.tbp->typebound;
+
+ po = gfc_get_expr ();
+ po->expr_type = EXPR_VARIABLE;
+ po->symtree = e->symtree;
+ po->ref = gfc_copy_ref (e->ref);
+
+ if (gfc_resolve_expr (po) == FAILURE)
+ return FAILURE;
+ if (po->rank > 0)
+ {
+ gfc_error ("Passed-object at %L must be scalar", &e->where);
+ return FAILURE;
+ }
+
+ if (tbp->nopass)
+ {
+ gfc_free_expr (po);
+ return SUCCESS;
+ }
+
+ gcc_assert (tbp->pass_arg_num > 0);
+ e->value.compcall.actual = update_arglist_pass (e->value.compcall.actual, po,
+ tbp->pass_arg_num);
+
+ return SUCCESS;
+}
+
+
+/* Resolve a call to a type-bound procedure, either function or subroutine,
+ statically from the data in an EXPR_COMPCALL expression. The adapted
+ arglist and the target-procedure symtree are returned. */
+
+static gfc_try
+resolve_typebound_static (gfc_expr* e, gfc_symtree** target,
+ gfc_actual_arglist** actual)
+{
+ gcc_assert (e->expr_type == EXPR_COMPCALL);
+
+ /* Update the actual arglist for PASS. */
+ if (update_compcall_arglist (e) == FAILURE)
+ return FAILURE;
+
+ *actual = e->value.compcall.actual;
+ *target = e->value.compcall.tbp->typebound->target;
+
+ gfc_free_ref_list (e->ref);
+ e->ref = NULL;
+ e->value.compcall.actual = NULL;
+
+ return SUCCESS;
+}
+
+
+/* Resolve a call to a type-bound subroutine. */
+
+static gfc_try
+resolve_typebound_call (gfc_code* c)
+{
+ gfc_actual_arglist* newactual;
+ gfc_symtree* target;
+
+ /* Transform into an ordinary EXEC_CALL for now. */
+
+ if (resolve_typebound_static (c->expr, &target, &newactual) == FAILURE)
+ return FAILURE;
+
+ c->ext.actual = newactual;
+ c->symtree = target;
+ c->op = EXEC_CALL;
+
+ gcc_assert (!c->expr->ref && !c->expr->value.compcall.actual);
+ gfc_free_expr (c->expr);
+ c->expr = NULL;
+
+ return resolve_call (c);
+}
+
+
+/* Resolve a component-call expression. */
+
+static gfc_try
+resolve_compcall (gfc_expr* e)
+{
+ gfc_actual_arglist* newactual;
+ gfc_symtree* target;
+
+ /* For now, we simply transform it into a EXPR_FUNCTION call with the same
+ arglist to the TBP's binding target. */
+
+ if (resolve_typebound_static (e, &target, &newactual) == FAILURE)
+ return FAILURE;
+
+ e->value.function.actual = newactual;
+ e->symtree = target;
+ e->expr_type = EXPR_FUNCTION;
+
+ return gfc_resolve_expr (e);
+}
+
+
/* Resolve an expression. That is, make sure that types of operands agree
with their operators, intrinsic operators are converted to function calls
for overloaded types and unresolved function references are resolved. */
-try
+gfc_try
gfc_resolve_expr (gfc_expr *e)
{
- try t;
+ gfc_try t;
if (e == NULL)
return SUCCESS;
@@ -4317,6 +4452,10 @@ gfc_resolve_expr (gfc_expr *e)
break;
+ case EXPR_COMPCALL:
+ t = resolve_compcall (e);
+ break;
+
case EXPR_SUBSTRING:
t = resolve_ref (e);
break;
@@ -4373,7 +4512,7 @@ gfc_resolve_expr (gfc_expr *e)
/* Resolve an expression from an iterator. They must be scalar and have
INTEGER or (optionally) REAL type. */
-static try
+static gfc_try
gfc_resolve_iterator_expr (gfc_expr *expr, bool real_ok,
const char *name_msgid)
{
@@ -4414,7 +4553,7 @@ gfc_resolve_iterator_expr (gfc_expr *expr, bool real_ok,
/* Resolve the expressions in an iterator structure. If REAL_OK is
false allow only INTEGER type iterators, otherwise allow REAL types. */
-try
+gfc_try
gfc_resolve_iterator (gfc_iterator *iter, bool real_ok)
{
if (gfc_resolve_iterator_expr (iter->var, real_ok, "Loop variable")
@@ -4497,7 +4636,7 @@ forall_index (gfc_expr *expr, gfc_symbol *sym, int *f)
/* Check whether the FORALL index appears in the expression or not.
Returns SUCCESS if SYM is found in EXPR. */
-try
+gfc_try
find_forall_index (gfc_expr *expr, gfc_symbol *sym, int f)
{
if (gfc_traverse_expr (expr, sym, forall_index, f))
@@ -4597,7 +4736,7 @@ derived_inaccessible (gfc_symbol *sym)
/* Resolve the argument of a deallocate expression. The expression must be
a pointer or a full array. */
-static try
+static gfc_try
resolve_deallocate_expr (gfc_expr *e)
{
symbol_attribute attr;
@@ -4630,7 +4769,7 @@ resolve_deallocate_expr (gfc_expr *e)
case REF_COMPONENT:
allocatable = (ref->u.c.component->as != NULL
&& ref->u.c.component->as->type == AS_DEFERRED);
- pointer = ref->u.c.component->pointer;
+ pointer = ref->u.c.component->attr.pointer;
break;
case REF_SUBSTRING:
@@ -4712,7 +4851,7 @@ expr_to_initialize (gfc_expr *e)
checks to see whether the expression is OK or not. The expression must
have a trailing array reference that gives the size of the array. */
-static try
+static gfc_try
resolve_allocate_expr (gfc_expr *e, gfc_code *code)
{
int i, pointer, allocatable, dimension, check_intent_in;
@@ -4777,8 +4916,8 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code)
allocatable = (ref->u.c.component->as != NULL
&& ref->u.c.component->as->type == AS_DEFERRED);
- pointer = ref->u.c.component->pointer;
- dimension = ref->u.c.component->dimension;
+ pointer = ref->u.c.component->attr.pointer;
+ dimension = ref->u.c.component->attr.dimension;
break;
case REF_SUBSTRING:
@@ -4786,7 +4925,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code)
pointer = 0;
break;
}
- }
+ }
}
if (allocatable == 0 && pointer == 0)
@@ -5112,7 +5251,7 @@ check_case_overlap (gfc_case *list)
Makes sure that all case expressions are scalar constants of the same
type. Return FAILURE if anything is wrong. */
-static try
+static gfc_try
validate_case_label_expr (gfc_expr *e, gfc_expr *case_expr)
{
if (e == NULL) return SUCCESS;
@@ -5181,7 +5320,7 @@ resolve_select (gfc_code *code)
int seen_logical;
int ncases;
bt type;
- try t;
+ gfc_try t;
if (code->expr == NULL)
{
@@ -5622,12 +5761,12 @@ resolve_branch (gfc_st_label *label, gfc_code *code)
/* Check whether EXPR1 has the same shape as EXPR2. */
-static try
+static gfc_try
resolve_where_shape (gfc_expr *expr1, gfc_expr *expr2)
{
mpz_t shape[GFC_MAX_DIMENSIONS];
mpz_t shape2[GFC_MAX_DIMENSIONS];
- try result = FAILURE;
+ gfc_try result = FAILURE;
int i;
/* Compare the rank. */
@@ -5934,7 +6073,7 @@ static void resolve_code (gfc_code *, gfc_namespace *);
void
gfc_resolve_blocks (gfc_code *b, gfc_namespace *ns)
{
- try t;
+ gfc_try t;
for (; b; b = b->block)
{
@@ -6148,7 +6287,7 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
int omp_workshare_save;
int forall_save;
code_stack frame;
- try t;
+ gfc_try t;
frame.prev = cs_base;
frame.head = code;
@@ -6201,7 +6340,9 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
omp_workshare_flag = omp_workshare_save;
}
- t = gfc_resolve_expr (code->expr);
+ t = SUCCESS;
+ if (code->op != EXEC_COMPCALL)
+ t = gfc_resolve_expr (code->expr);
forall_flag = forall_save;
if (gfc_resolve_expr (code->expr2) == FAILURE)
@@ -6307,6 +6448,10 @@ resolve_code (gfc_code *code, gfc_namespace *ns)
resolve_call (code);
break;
+ case EXEC_COMPCALL:
+ resolve_typebound_call (code);
+ break;
+
case EXEC_SELECT:
/* Select is complicated. Also, a SELECT construct could be
a transformed computed GOTO. */
@@ -6666,7 +6811,7 @@ gfc_verify_binding_labels (gfc_symbol *sym)
/* Resolve an index expression. */
-static try
+static gfc_try
resolve_index_expr (gfc_expr *e)
{
if (gfc_resolve_expr (e) == FAILURE)
@@ -6683,7 +6828,7 @@ resolve_index_expr (gfc_expr *e)
/* Resolve a charlen structure. */
-static try
+static gfc_try
resolve_charlen (gfc_charlen *cl)
{
int i;
@@ -6983,7 +7128,7 @@ apply_default_init_local (gfc_symbol *sym)
/* Resolution of common features of flavors variable and procedure. */
-static try
+static gfc_try
resolve_fl_var_and_proc (gfc_symbol *sym, int mp_flag)
{
/* Constraints on deferred shape variable. */
@@ -7025,7 +7170,7 @@ resolve_fl_var_and_proc (gfc_symbol *sym, int mp_flag)
/* Additional checks for symbols with flavor variable and derived
type. To be called from resolve_fl_variable. */
-static try
+static gfc_try
resolve_fl_variable_derived (gfc_symbol *sym, int no_init_flag)
{
gcc_assert (sym->ts.type == BT_DERIVED);
@@ -7084,7 +7229,7 @@ resolve_fl_variable_derived (gfc_symbol *sym, int no_init_flag)
/* Resolve symbols with flavor variable. */
-static try
+static gfc_try
resolve_fl_variable (gfc_symbol *sym, int mp_flag)
{
int no_init_flag, automatic_flag;
@@ -7209,7 +7354,7 @@ no_init_error:
/* Resolve a procedure. */
-static try
+static gfc_try
resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
{
gfc_formal_arglist *arg;
@@ -7443,6 +7588,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;
}
@@ -7451,12 +7610,12 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
been defined and we now know their defined arguments, check that they fulfill
the requirements of the standard for procedures used as finalizers. */
-static try
+static gfc_try
gfc_resolve_finalizers (gfc_symbol* derived)
{
gfc_finalizer* list;
gfc_finalizer** prev_link; /* For removing wrong entries from the list. */
- try result = SUCCESS;
+ gfc_try result = SUCCESS;
bool seen_scalar = false;
if (!derived->f2k_derived || !derived->f2k_derived->finalizers)
@@ -7472,22 +7631,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 +7707,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 +7726,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,12 +7751,344 @@ 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;
}
+/* Check that it is ok for the typebound procedure proc to override the
+ procedure old. */
+
+static gfc_try
+check_typebound_override (gfc_symtree* proc, gfc_symtree* old)
+{
+ locus where;
+ const gfc_symbol* proc_target;
+ const gfc_symbol* old_target;
+ unsigned proc_pass_arg, old_pass_arg, argpos;
+ gfc_formal_arglist* proc_formal;
+ gfc_formal_arglist* old_formal;
+
+ where = proc->typebound->where;
+ proc_target = proc->typebound->target->n.sym;
+ old_target = old->typebound->target->n.sym;
+
+ /* Check that overridden binding is not NON_OVERRIDABLE. */
+ if (old->typebound->non_overridable)
+ {
+ gfc_error ("'%s' at %L overrides a procedure binding declared"
+ " NON_OVERRIDABLE", proc->name, &where);
+ return FAILURE;
+ }
+
+ /* If the overridden binding is PURE, the overriding must be, too. */
+ if (old_target->attr.pure && !proc_target->attr.pure)
+ {
+ gfc_error ("'%s' at %L overrides a PURE procedure and must also be PURE",
+ proc->name, &where);
+ return FAILURE;
+ }
+
+ /* If the overridden binding is ELEMENTAL, the overriding must be, too. If it
+ is not, the overriding must not be either. */
+ if (old_target->attr.elemental && !proc_target->attr.elemental)
+ {
+ gfc_error ("'%s' at %L overrides an ELEMENTAL procedure and must also be"
+ " ELEMENTAL", proc->name, &where);
+ return FAILURE;
+ }
+ if (!old_target->attr.elemental && proc_target->attr.elemental)
+ {
+ gfc_error ("'%s' at %L overrides a non-ELEMENTAL procedure and must not"
+ " be ELEMENTAL, either", proc->name, &where);
+ return FAILURE;
+ }
+
+ /* If the overridden binding is a SUBROUTINE, the overriding must also be a
+ SUBROUTINE. */
+ if (old_target->attr.subroutine && !proc_target->attr.subroutine)
+ {
+ gfc_error ("'%s' at %L overrides a SUBROUTINE and must also be a"
+ " SUBROUTINE", proc->name, &where);
+ return FAILURE;
+ }
+
+ /* If the overridden binding is a FUNCTION, the overriding must also be a
+ FUNCTION and have the same characteristics. */
+ if (old_target->attr.function)
+ {
+ if (!proc_target->attr.function)
+ {
+ gfc_error ("'%s' at %L overrides a FUNCTION and must also be a"
+ " FUNCTION", proc->name, &where);
+ return FAILURE;
+ }
+
+ /* FIXME: Do more comprehensive checking (including, for instance, the
+ rank and array-shape). */
+ gcc_assert (proc_target->result && old_target->result);
+ if (!gfc_compare_types (&proc_target->result->ts,
+ &old_target->result->ts))
+ {
+ gfc_error ("'%s' at %L and the overridden FUNCTION should have"
+ " matching result types", proc->name, &where);
+ return FAILURE;
+ }
+ }
+
+ /* If the overridden binding is PUBLIC, the overriding one must not be
+ PRIVATE. */
+ if (old->typebound->access == ACCESS_PUBLIC
+ && proc->typebound->access == ACCESS_PRIVATE)
+ {
+ gfc_error ("'%s' at %L overrides a PUBLIC procedure and must not be"
+ " PRIVATE", proc->name, &where);
+ return FAILURE;
+ }
+
+ /* Compare the formal argument lists of both procedures. This is also abused
+ to find the position of the passed-object dummy arguments of both
+ bindings as at least the overridden one might not yet be resolved and we
+ need those positions in the check below. */
+ proc_pass_arg = old_pass_arg = 0;
+ if (!proc->typebound->nopass && !proc->typebound->pass_arg)
+ proc_pass_arg = 1;
+ if (!old->typebound->nopass && !old->typebound->pass_arg)
+ old_pass_arg = 1;
+ argpos = 1;
+ for (proc_formal = proc_target->formal, old_formal = old_target->formal;
+ proc_formal && old_formal;
+ proc_formal = proc_formal->next, old_formal = old_formal->next)
+ {
+ if (proc->typebound->pass_arg
+ && !strcmp (proc->typebound->pass_arg, proc_formal->sym->name))
+ proc_pass_arg = argpos;
+ if (old->typebound->pass_arg
+ && !strcmp (old->typebound->pass_arg, old_formal->sym->name))
+ old_pass_arg = argpos;
+
+ /* Check that the names correspond. */
+ if (strcmp (proc_formal->sym->name, old_formal->sym->name))
+ {
+ gfc_error ("Dummy argument '%s' of '%s' at %L should be named '%s' as"
+ " to match the corresponding argument of the overridden"
+ " procedure", proc_formal->sym->name, proc->name, &where,
+ old_formal->sym->name);
+ return FAILURE;
+ }
+
+ /* Check that the types correspond if neither is the passed-object
+ argument. */
+ /* FIXME: Do more comprehensive testing here. */
+ if (proc_pass_arg != argpos && old_pass_arg != argpos
+ && !gfc_compare_types (&proc_formal->sym->ts, &old_formal->sym->ts))
+ {
+ gfc_error ("Types mismatch for dummy argument '%s' of '%s' %L in"
+ " in respect to the overridden procedure",
+ proc_formal->sym->name, proc->name, &where);
+ return FAILURE;
+ }
+
+ ++argpos;
+ }
+ if (proc_formal || old_formal)
+ {
+ gfc_error ("'%s' at %L must have the same number of formal arguments as"
+ " the overridden procedure", proc->name, &where);
+ return FAILURE;
+ }
+
+ /* If the overridden binding is NOPASS, the overriding one must also be
+ NOPASS. */
+ if (old->typebound->nopass && !proc->typebound->nopass)
+ {
+ gfc_error ("'%s' at %L overrides a NOPASS binding and must also be"
+ " NOPASS", proc->name, &where);
+ return FAILURE;
+ }
+
+ /* If the overridden binding is PASS(x), the overriding one must also be
+ PASS and the passed-object dummy arguments must correspond. */
+ if (!old->typebound->nopass)
+ {
+ if (proc->typebound->nopass)
+ {
+ gfc_error ("'%s' at %L overrides a binding with PASS and must also be"
+ " PASS", proc->name, &where);
+ return FAILURE;
+ }
+
+ if (proc_pass_arg != old_pass_arg)
+ {
+ gfc_error ("Passed-object dummy argument of '%s' at %L must be at"
+ " the same position as the passed-object dummy argument of"
+ " the overridden procedure", proc->name, &where);
+ return FAILURE;
+ }
+ }
+
+ return SUCCESS;
+}
+
+
+/* Resolve the type-bound procedures for a derived type. */
+
+static gfc_symbol* resolve_bindings_derived;
+static gfc_try resolve_bindings_result;
+
+static void
+resolve_typebound_procedure (gfc_symtree* stree)
+{
+ gfc_symbol* proc;
+ locus where;
+ gfc_symbol* me_arg;
+ gfc_symbol* super_type;
+ gfc_component* comp;
+
+ /* If this is no type-bound procedure, just return. */
+ if (!stree->typebound)
+ return;
+
+ /* Get the target-procedure to check it. */
+ gcc_assert (stree->typebound->target);
+ proc = stree->typebound->target->n.sym;
+ where = stree->typebound->where;
+
+ /* Default access should already be resolved from the parser. */
+ gcc_assert (stree->typebound->access != ACCESS_UNKNOWN);
+
+ /* It should be a module procedure or an external procedure with explicit
+ interface. */
+ if ((!proc->attr.subroutine && !proc->attr.function)
+ || (proc->attr.proc != PROC_MODULE
+ && proc->attr.if_source != IFSRC_IFBODY)
+ || proc->attr.abstract)
+ {
+ gfc_error ("'%s' must be a module procedure or an external procedure with"
+ " an explicit interface at %L", proc->name, &where);
+ goto error;
+ }
+
+ /* Find the super-type of the current derived type. We could do this once and
+ store in a global if speed is needed, but as long as not I believe this is
+ more readable and clearer. */
+ super_type = gfc_get_derived_super_type (resolve_bindings_derived);
+
+ /* If PASS, resolve and check arguments. */
+ if (!stree->typebound->nopass)
+ {
+ if (stree->typebound->pass_arg)
+ {
+ gfc_formal_arglist* i;
+
+ /* If an explicit passing argument name is given, walk the arg-list
+ and look for it. */
+
+ me_arg = NULL;
+ stree->typebound->pass_arg_num = 1;
+ for (i = proc->formal; i; i = i->next)
+ {
+ if (!strcmp (i->sym->name, stree->typebound->pass_arg))
+ {
+ me_arg = i->sym;
+ break;
+ }
+ ++stree->typebound->pass_arg_num;
+ }
+
+ if (!me_arg)
+ {
+ gfc_error ("Procedure '%s' with PASS(%s) at %L has no"
+ " argument '%s'",
+ proc->name, stree->typebound->pass_arg, &where,
+ stree->typebound->pass_arg);
+ goto error;
+ }
+ }
+ else
+ {
+ /* Otherwise, take the first one; there should in fact be at least
+ one. */
+ stree->typebound->pass_arg_num = 1;
+ if (!proc->formal)
+ {
+ gfc_error ("Procedure '%s' with PASS at %L must have at"
+ " least one argument", proc->name, &where);
+ goto error;
+ }
+ me_arg = proc->formal->sym;
+ }
+
+ /* Now check that the argument-type matches. */
+ gcc_assert (me_arg);
+ if (me_arg->ts.type != BT_DERIVED
+ || me_arg->ts.derived != resolve_bindings_derived)
+ {
+ gfc_error ("Argument '%s' of '%s' with PASS(%s) at %L must be of"
+ " the derived-type '%s'", me_arg->name, proc->name,
+ me_arg->name, &where, resolve_bindings_derived->name);
+ goto error;
+ }
+
+ gfc_warning ("Polymorphic entities are not yet implemented,"
+ " non-polymorphic passed-object dummy argument of '%s'"
+ " at %L accepted", proc->name, &where);
+ }
+
+ /* If we are extending some type, check that we don't override a procedure
+ flagged NON_OVERRIDABLE. */
+ if (super_type)
+ {
+ gfc_symtree* overridden;
+ overridden = gfc_find_typebound_proc (super_type, NULL,
+ stree->name, true);
+
+ if (overridden && check_typebound_override (stree, overridden) == FAILURE)
+ goto error;
+ }
+
+ /* See if there's a name collision with a component directly in this type. */
+ for (comp = resolve_bindings_derived->components; comp; comp = comp->next)
+ if (!strcmp (comp->name, stree->name))
+ {
+ gfc_error ("Procedure '%s' at %L has the same name as a component of"
+ " '%s'",
+ stree->name, &where, resolve_bindings_derived->name);
+ goto error;
+ }
+
+ /* Try to find a name collision with an inherited component. */
+ if (super_type && gfc_find_component (super_type, stree->name, true, true))
+ {
+ gfc_error ("Procedure '%s' at %L has the same name as an inherited"
+ " component of '%s'",
+ stree->name, &where, resolve_bindings_derived->name);
+ goto error;
+ }
+
+ return;
+
+error:
+ resolve_bindings_result = FAILURE;
+}
+
+static gfc_try
+resolve_typebound_procedures (gfc_symbol* derived)
+{
+ if (!derived->f2k_derived || !derived->f2k_derived->sym_root)
+ return SUCCESS;
+
+ resolve_bindings_derived = derived;
+ resolve_bindings_result = SUCCESS;
+ gfc_traverse_symtree (derived->f2k_derived->sym_root,
+ &resolve_typebound_procedure);
+
+ return resolve_bindings_result;
+}
+
+
/* Add a derived type to the dt_list. The dt_list is used in trans-types.c
to give all identical derived types the same backend_decl. */
static void
@@ -7610,14 +8112,28 @@ add_dt_to_dt_list (gfc_symbol *derived)
/* Resolve the components of a derived type. */
-static try
+static gfc_try
resolve_fl_derived (gfc_symbol *sym)
{
+ gfc_symbol* super_type;
gfc_component *c;
int i;
+ super_type = gfc_get_derived_super_type (sym);
+
for (c = sym->components; c != NULL; c = c->next)
{
+ /* If this type is an extension, see if this component has the same name
+ as an inherited type-bound procedure. */
+ if (super_type
+ && gfc_find_typebound_proc (super_type, NULL, c->name, true))
+ {
+ gfc_error ("Component '%s' of '%s' at %L has the same name as an"
+ " inherited type-bound procedure",
+ c->name, sym->name, &c->loc);
+ return FAILURE;
+ }
+
if (c->ts.type == BT_CHARACTER)
{
if (c->ts.cl->length == NULL
@@ -7656,7 +8172,7 @@ resolve_fl_derived (gfc_symbol *sym)
}
}
- if (c->ts.type == BT_DERIVED && c->pointer
+ if (c->ts.type == BT_DERIVED && c->attr.pointer
&& c->ts.derived->components == NULL
&& !c->ts.derived->attr.zero_comp)
{
@@ -7672,11 +8188,11 @@ resolve_fl_derived (gfc_symbol *sym)
if (c->ts.type == BT_DERIVED
&& c->ts.derived
&& c->ts.derived->components
- && c->pointer
+ && c->attr.pointer
&& sym != c->ts.derived)
add_dt_to_dt_list (c->ts.derived);
- if (c->pointer || c->allocatable || c->as == NULL)
+ if (c->attr.pointer || c->attr.allocatable || c->as == NULL)
continue;
for (i = 0; i < c->as->rank; i++)
@@ -7696,6 +8212,10 @@ resolve_fl_derived (gfc_symbol *sym)
}
}
+ /* Resolve the type-bound procedures. */
+ if (resolve_typebound_procedures (sym) == FAILURE)
+ return FAILURE;
+
/* Resolve the finalizer procedures. */
if (gfc_resolve_finalizers (sym) == FAILURE)
return FAILURE;
@@ -7707,7 +8227,7 @@ resolve_fl_derived (gfc_symbol *sym)
}
-static try
+static gfc_try
resolve_fl_namelist (gfc_symbol *sym)
{
gfc_namelist *nl;
@@ -7826,7 +8346,7 @@ resolve_fl_namelist (gfc_symbol *sym)
}
-static try
+static gfc_try
resolve_fl_parameter (gfc_symbol *sym)
{
/* A parameter array's shape needs to be constant. */
@@ -7961,24 +8481,45 @@ resolve_symbol (gfc_symbol *sym)
type to avoid spurious warnings. */
if (sym->attr.flavor != FL_MODULE && sym->attr.intrinsic)
{
- if (gfc_intrinsic_name (sym->name, 0))
+ gfc_intrinsic_sym* isym;
+ const char* symstd;
+
+ /* We already know this one is an intrinsic, so we don't call
+ gfc_is_intrinsic for full checking but rather use gfc_find_function and
+ gfc_find_subroutine directly to check whether it is a function or
+ subroutine. */
+
+ if ((isym = gfc_find_function (sym->name)))
{
if (sym->ts.type != BT_UNKNOWN && gfc_option.warn_surprising)
- gfc_warning ("Type specified for intrinsic function '%s' at %L is ignored",
- sym->name, &sym->declared_at);
+ gfc_warning ("Type specified for intrinsic function '%s' at %L is"
+ " ignored", sym->name, &sym->declared_at);
}
- else if (gfc_intrinsic_name (sym->name, 1))
+ else if ((isym = gfc_find_subroutine (sym->name)))
{
if (sym->ts.type != BT_UNKNOWN)
{
- gfc_error ("Intrinsic subroutine '%s' at %L shall not have a type specifier",
- sym->name, &sym->declared_at);
+ gfc_error ("Intrinsic subroutine '%s' at %L shall not have a type"
+ " specifier", sym->name, &sym->declared_at);
return;
}
}
else
{
- gfc_error ("Intrinsic '%s' at %L does not exist", sym->name, &sym->declared_at);
+ gfc_error ("'%s' declared INTRINSIC at %L does not exist",
+ sym->name, &sym->declared_at);
+ return;
+ }
+
+ /* Check it is actually available in the standard settings. */
+ if (gfc_check_intrinsic_standard (isym, &symstd, false, sym->declared_at)
+ == FAILURE)
+ {
+ gfc_error ("The intrinsic '%s' declared INTRINSIC at %L is not"
+ " available in the current standard settings but %s. Use"
+ " an appropriate -std=* option or enable -fall-intrinsics"
+ " in order to use it.",
+ sym->name, &sym->declared_at, symstd);
return;
}
}
@@ -8077,7 +8618,7 @@ resolve_symbol (gfc_symbol *sym)
sym->attr.use_assoc == 0 && sym->attr.dummy == 0 &&
sym->attr.flavor != FL_PROCEDURE && sym->attr.flavor != FL_DERIVED)
{
- try t = SUCCESS;
+ gfc_try t = SUCCESS;
/* First, make sure the variable is declared at the
module-level scope (J3/04-007, Section 15.3). */
@@ -8290,7 +8831,7 @@ values;
/* Advance the values structure to point to the next value in the data list. */
-static try
+static gfc_try
next_data_value (void)
{
@@ -8307,13 +8848,13 @@ next_data_value (void)
}
-static try
+static gfc_try
check_data_variable (gfc_data_variable *var, locus *where)
{
gfc_expr *e;
mpz_t size;
mpz_t offset;
- try t;
+ gfc_try t;
ar_type mark = AR_UNKNOWN;
int i;
mpz_t section_index[GFC_MAX_DIMENSIONS];
@@ -8470,17 +9011,17 @@ check_data_variable (gfc_data_variable *var, locus *where)
}
-static try traverse_data_var (gfc_data_variable *, locus *);
+static gfc_try traverse_data_var (gfc_data_variable *, locus *);
/* Iterate over a list of elements in a DATA statement. */
-static try
+static gfc_try
traverse_data_list (gfc_data_variable *var, locus *where)
{
mpz_t trip;
iterator_stack frame;
gfc_expr *e, *start, *end, *step;
- try retval = SUCCESS;
+ gfc_try retval = SUCCESS;
mpz_init (frame.value);
@@ -8560,10 +9101,10 @@ cleanup:
/* Type resolve variables in the variable list of a DATA statement. */
-static try
+static gfc_try
traverse_data_var (gfc_data_variable *var, locus *where)
{
- try t;
+ gfc_try t;
for (; var; var = var->next)
{
@@ -8584,7 +9125,7 @@ traverse_data_var (gfc_data_variable *var, locus *where)
This is separate from the assignment checking because data lists should
only be resolved once. */
-static try
+static gfc_try
resolve_data_variables (gfc_data_variable *d)
{
for (; d; d = d->next)
@@ -8800,7 +9341,7 @@ sequence_type (gfc_typespec ts)
/* Resolve derived type EQUIVALENCE object. */
-static try
+static gfc_try
resolve_equivalence_derived (gfc_symbol *derived, gfc_symbol *sym, gfc_expr *e)
{
gfc_symbol *d;
@@ -8844,7 +9385,7 @@ resolve_equivalence_derived (gfc_symbol *derived, gfc_symbol *sym, gfc_expr *e)
/* Shall not be an object of sequence derived type containing a pointer
in the structure. */
- if (c->pointer)
+ if (c->attr.pointer)
{
gfc_error ("Derived type variable '%s' at %L with pointer "
"component(s) cannot be an EQUIVALENCE object",
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index c0becf05e2c..8c702ca3f33 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -1672,7 +1672,7 @@ preprocessor_line (gfc_char_t *c)
}
-static try load_file (const char *, const char *, bool);
+static gfc_try load_file (const char *, const char *, bool);
/* include_line()-- Checks a line buffer to see if it is an include
line. If so, we call load_file() recursively to load the included
@@ -1751,7 +1751,7 @@ include_line (gfc_char_t *line)
/* Load a file into memory by calling load_line until the file ends. */
-static try
+static gfc_try
load_file (const char *realfilename, const char *displayedname, bool initial)
{
gfc_char_t *line;
@@ -1921,10 +1921,10 @@ load_file (const char *realfilename, const char *displayedname, bool initial)
it tries to determine the source form from the filename, defaulting
to free form. */
-try
+gfc_try
gfc_new_file (void)
{
- try result;
+ gfc_try result;
if (gfc_cpp_enabled ())
{
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c
index c889dae14fa..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;
@@ -3942,7 +3944,7 @@ gfc_simplify_shape (gfc_expr *source)
gfc_expr *result, *e, *f;
gfc_array_ref *ar;
int n;
- try t;
+ gfc_try t;
if (source->rank == 0)
return gfc_start_constructor (BT_INTEGER, gfc_default_integer_kind,
diff --git a/gcc/fortran/st.c b/gcc/fortran/st.c
index 790dec6cf58..81d861aee96 100644
--- a/gcc/fortran/st.c
+++ b/gcc/fortran/st.c
@@ -108,6 +108,8 @@ gfc_free_statement (gfc_code *p)
case EXEC_ARITHMETIC_IF:
break;
+ case EXEC_COMPCALL:
+ gfc_free_expr (p->expr);
case EXEC_CALL:
case EXEC_ASSIGN_CALL:
gfc_free_actual_arglist (p->ext.actual);
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 121f62ea2cb..41e8006809e 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
@@ -145,7 +146,7 @@ gfc_clear_new_implicit (void)
/* Prepare for a new implicit range. Sets flags in new_flag[]. */
-try
+gfc_try
gfc_add_new_implicit_range (int c1, int c2)
{
int i;
@@ -172,7 +173,7 @@ gfc_add_new_implicit_range (int c1, int c2)
/* Add a matched implicit range for gfc_set_implicit(). Check if merging
the new implicit types back into the existing types will work. */
-try
+gfc_try
gfc_merge_new_implicit (gfc_typespec *ts)
{
int i;
@@ -230,7 +231,7 @@ gfc_get_default_type (gfc_symbol *sym, gfc_namespace *ns)
letter of its name. Fails if the letter in question has no default
type. */
-try
+gfc_try
gfc_set_default_type (gfc_symbol *sym, int error_flag, gfc_namespace *ns)
{
gfc_typespec *ts;
@@ -336,7 +337,7 @@ gfc_check_function_type (gfc_namespace *ns)
goto conflict_std;\
}
-static try
+static gfc_try
check_conflict (symbol_attribute *attr, const char *name, locus *where)
{
static const char *dummy = "DUMMY", *save = "SAVE", *pointer = "POINTER",
@@ -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)
{
@@ -790,7 +787,7 @@ duplicate_attr (const char *attr, locus *where)
/* Called from decl.c (attr_decl1) to check attributes, when declared
separately. */
-try
+gfc_try
gfc_add_attribute (symbol_attribute *attr, locus *where)
{
@@ -800,7 +797,7 @@ gfc_add_attribute (symbol_attribute *attr, locus *where)
return check_conflict (attr, NULL, where);
}
-try
+gfc_try
gfc_add_allocatable (symbol_attribute *attr, locus *where)
{
@@ -826,7 +823,7 @@ gfc_add_allocatable (symbol_attribute *attr, locus *where)
}
-try
+gfc_try
gfc_add_dimension (symbol_attribute *attr, const char *name, locus *where)
{
@@ -852,7 +849,7 @@ gfc_add_dimension (symbol_attribute *attr, const char *name, locus *where)
}
-try
+gfc_try
gfc_add_external (symbol_attribute *attr, locus *where)
{
@@ -877,7 +874,7 @@ gfc_add_external (symbol_attribute *attr, locus *where)
}
-try
+gfc_try
gfc_add_intrinsic (symbol_attribute *attr, locus *where)
{
@@ -896,7 +893,7 @@ gfc_add_intrinsic (symbol_attribute *attr, locus *where)
}
-try
+gfc_try
gfc_add_optional (symbol_attribute *attr, locus *where)
{
@@ -914,7 +911,7 @@ gfc_add_optional (symbol_attribute *attr, locus *where)
}
-try
+gfc_try
gfc_add_pointer (symbol_attribute *attr, locus *where)
{
@@ -939,7 +936,7 @@ gfc_add_pointer (symbol_attribute *attr, locus *where)
}
-try
+gfc_try
gfc_add_cray_pointer (symbol_attribute *attr, locus *where)
{
@@ -951,7 +948,7 @@ gfc_add_cray_pointer (symbol_attribute *attr, locus *where)
}
-try
+gfc_try
gfc_add_cray_pointee (symbol_attribute *attr, locus *where)
{
@@ -970,7 +967,7 @@ gfc_add_cray_pointee (symbol_attribute *attr, locus *where)
}
-try
+gfc_try
gfc_add_protected (symbol_attribute *attr, const char *name, locus *where)
{
if (check_used (attr, name, where))
@@ -990,7 +987,7 @@ gfc_add_protected (symbol_attribute *attr, const char *name, locus *where)
}
-try
+gfc_try
gfc_add_result (symbol_attribute *attr, const char *name, locus *where)
{
@@ -1002,7 +999,7 @@ gfc_add_result (symbol_attribute *attr, const char *name, locus *where)
}
-try
+gfc_try
gfc_add_save (symbol_attribute *attr, const char *name, locus *where)
{
@@ -1031,7 +1028,7 @@ gfc_add_save (symbol_attribute *attr, const char *name, locus *where)
}
-try
+gfc_try
gfc_add_value (symbol_attribute *attr, const char *name, locus *where)
{
@@ -1052,7 +1049,7 @@ gfc_add_value (symbol_attribute *attr, const char *name, locus *where)
}
-try
+gfc_try
gfc_add_volatile (symbol_attribute *attr, const char *name, locus *where)
{
/* No check_used needed as 11.2.1 of the F2003 standard allows
@@ -1071,7 +1068,7 @@ gfc_add_volatile (symbol_attribute *attr, const char *name, locus *where)
}
-try
+gfc_try
gfc_add_threadprivate (symbol_attribute *attr, const char *name, locus *where)
{
@@ -1089,7 +1086,7 @@ gfc_add_threadprivate (symbol_attribute *attr, const char *name, locus *where)
}
-try
+gfc_try
gfc_add_target (symbol_attribute *attr, locus *where)
{
@@ -1107,7 +1104,7 @@ gfc_add_target (symbol_attribute *attr, locus *where)
}
-try
+gfc_try
gfc_add_dummy (symbol_attribute *attr, const char *name, locus *where)
{
@@ -1120,7 +1117,7 @@ gfc_add_dummy (symbol_attribute *attr, const char *name, locus *where)
}
-try
+gfc_try
gfc_add_in_common (symbol_attribute *attr, const char *name, locus *where)
{
@@ -1139,7 +1136,7 @@ gfc_add_in_common (symbol_attribute *attr, const char *name, locus *where)
}
-try
+gfc_try
gfc_add_in_equivalence (symbol_attribute *attr, const char *name, locus *where)
{
@@ -1155,7 +1152,7 @@ gfc_add_in_equivalence (symbol_attribute *attr, const char *name, locus *where)
}
-try
+gfc_try
gfc_add_data (symbol_attribute *attr, const char *name, locus *where)
{
@@ -1167,7 +1164,7 @@ gfc_add_data (symbol_attribute *attr, const char *name, locus *where)
}
-try
+gfc_try
gfc_add_in_namelist (symbol_attribute *attr, const char *name, locus *where)
{
@@ -1176,7 +1173,7 @@ gfc_add_in_namelist (symbol_attribute *attr, const char *name, locus *where)
}
-try
+gfc_try
gfc_add_sequence (symbol_attribute *attr, const char *name, locus *where)
{
@@ -1188,7 +1185,7 @@ gfc_add_sequence (symbol_attribute *attr, const char *name, locus *where)
}
-try
+gfc_try
gfc_add_elemental (symbol_attribute *attr, locus *where)
{
@@ -1206,7 +1203,7 @@ gfc_add_elemental (symbol_attribute *attr, locus *where)
}
-try
+gfc_try
gfc_add_pure (symbol_attribute *attr, locus *where)
{
@@ -1224,7 +1221,7 @@ gfc_add_pure (symbol_attribute *attr, locus *where)
}
-try
+gfc_try
gfc_add_recursive (symbol_attribute *attr, locus *where)
{
@@ -1242,7 +1239,7 @@ gfc_add_recursive (symbol_attribute *attr, locus *where)
}
-try
+gfc_try
gfc_add_entry (symbol_attribute *attr, const char *name, locus *where)
{
@@ -1260,7 +1257,7 @@ gfc_add_entry (symbol_attribute *attr, const char *name, locus *where)
}
-try
+gfc_try
gfc_add_function (symbol_attribute *attr, const char *name, locus *where)
{
@@ -1273,7 +1270,7 @@ gfc_add_function (symbol_attribute *attr, const char *name, locus *where)
}
-try
+gfc_try
gfc_add_subroutine (symbol_attribute *attr, const char *name, locus *where)
{
@@ -1286,7 +1283,7 @@ gfc_add_subroutine (symbol_attribute *attr, const char *name, locus *where)
}
-try
+gfc_try
gfc_add_generic (symbol_attribute *attr, const char *name, locus *where)
{
@@ -1299,7 +1296,7 @@ gfc_add_generic (symbol_attribute *attr, const char *name, locus *where)
}
-try
+gfc_try
gfc_add_proc (symbol_attribute *attr, const char *name, locus *where)
{
@@ -1325,7 +1322,7 @@ gfc_add_proc (symbol_attribute *attr, const char *name, locus *where)
/* Flavors are special because some flavors are not what Fortran
considers attributes and can be reaffirmed multiple times. */
-try
+gfc_try
gfc_add_flavor (symbol_attribute *attr, sym_flavor f, const char *name,
locus *where)
{
@@ -1361,7 +1358,7 @@ gfc_add_flavor (symbol_attribute *attr, sym_flavor f, const char *name,
}
-try
+gfc_try
gfc_add_procedure (symbol_attribute *attr, procedure_type t,
const char *name, locus *where)
{
@@ -1397,7 +1394,7 @@ gfc_add_procedure (symbol_attribute *attr, procedure_type t,
}
-try
+gfc_try
gfc_add_intent (symbol_attribute *attr, sym_intent intent, locus *where)
{
@@ -1423,7 +1420,7 @@ gfc_add_intent (symbol_attribute *attr, sym_intent intent, locus *where)
/* No checks for use-association in public and private statements. */
-try
+gfc_try
gfc_add_access (symbol_attribute *attr, gfc_access access,
const char *name, locus *where)
{
@@ -1444,7 +1441,7 @@ gfc_add_access (symbol_attribute *attr, gfc_access access,
/* Set the is_bind_c field for the given symbol_attribute. */
-try
+gfc_try
gfc_add_is_bind_c (symbol_attribute *attr, const char *name, locus *where,
int is_proc_lang_bind_spec)
{
@@ -1468,7 +1465,28 @@ gfc_add_is_bind_c (symbol_attribute *attr, const char *name, locus *where,
}
-try
+/* 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)
{
@@ -1503,7 +1521,7 @@ gfc_add_explicit_interface (gfc_symbol *sym, ifsrc source,
/* Add a type to a symbol. */
-try
+gfc_try
gfc_add_type (gfc_symbol *sym, gfc_typespec *ts, locus *where)
{
sym_flavor flavor;
@@ -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;
@@ -1555,7 +1575,7 @@ gfc_clear_attr (symbol_attribute *attr)
/* Check for missing attributes in the new symbol. Currently does
nothing, but it's not clear that it is unnecessary yet. */
-try
+gfc_try
gfc_missing_attr (symbol_attribute *attr ATTRIBUTE_UNUSED,
locus *where ATTRIBUTE_UNUSED)
{
@@ -1568,7 +1588,7 @@ gfc_missing_attr (symbol_attribute *attr ATTRIBUTE_UNUSED,
attributes have a lot of side-effects but cannot be present given
where we are called from, so we ignore some bits. */
-try
+gfc_try
gfc_copy_attr (symbol_attribute *dest, symbol_attribute *src, locus *where)
{
int is_proc_lang_bind_spec;
@@ -1681,7 +1701,7 @@ fail:
already present. On success, the component pointer is modified to
point to the additional component structure. */
-try
+gfc_try
gfc_add_component (gfc_symbol *sym, const char *name,
gfc_component **component)
{
@@ -1701,6 +1721,14 @@ gfc_add_component (gfc_symbol *sym, const char *name,
tail = p;
}
+ if (sym->attr.extension
+ && gfc_find_component (sym->components->ts.derived, name, true, true))
+ {
+ gfc_error ("Component '%s' at %C already in the parent type "
+ "at %L", name, &sym->components->ts.derived->declared_at);
+ return FAILURE;
+ }
+
/* Allocate a new component. */
p = gfc_get_component ();
@@ -1811,10 +1839,12 @@ bad:
/* Given a derived type node and a component name, try to locate the
component structure. Returns the NULL pointer if the component is
- not found or the components are private. */
+ not found or the components are private. If noaccess is set, no access
+ checks are done. */
gfc_component *
-gfc_find_component (gfc_symbol *sym, const char *name)
+gfc_find_component (gfc_symbol *sym, const char *name,
+ bool noaccess, bool silent)
{
gfc_component *p;
@@ -1830,17 +1860,39 @@ gfc_find_component (gfc_symbol *sym, const char *name)
if (strcmp (p->name, name) == 0)
break;
- if (p == NULL)
+ if (p == NULL
+ && sym->attr.extension
+ && sym->components->ts.type == BT_DERIVED)
+ {
+ p = gfc_find_component (sym->components->ts.derived, name,
+ noaccess, silent);
+ /* Do not overwrite the error. */
+ if (p == NULL)
+ return p;
+ }
+
+ if (p == NULL && !silent)
gfc_error ("'%s' at %C is not a member of the '%s' structure",
name, sym->name);
- else
+
+ else if (sym->attr.use_assoc && !noaccess)
{
- if (sym->attr.use_assoc && (sym->component_access == ACCESS_PRIVATE
- || p->access == ACCESS_PRIVATE))
+ if (p->attr.access == ACCESS_PRIVATE)
+ {
+ if (!silent)
+ gfc_error ("Component '%s' at %C is a PRIVATE component of '%s'",
+ name, sym->name);
+ return NULL;
+ }
+
+ /* If there were components given and all components are private, error
+ out at this place. */
+ if (p->attr.access != ACCESS_PUBLIC && sym->component_access == ACCESS_PRIVATE)
{
- gfc_error ("Component '%s' at %C is a PRIVATE component of '%s'",
- name, sym->name);
- p = NULL;
+ if (!silent)
+ gfc_error ("All components of '%s' are PRIVATE in structure"
+ " constructor at %C", sym->name);
+ return NULL;
}
}
@@ -1868,34 +1920,6 @@ free_components (gfc_component *p)
}
-/* Set component attributes from a standard symbol attribute structure. */
-
-void
-gfc_set_component_attr (gfc_component *c, symbol_attribute *attr)
-{
-
- c->dimension = attr->dimension;
- c->pointer = attr->pointer;
- c->allocatable = attr->allocatable;
- c->access = attr->access;
-}
-
-
-/* Get a standard symbol attribute structure given the component
- structure. */
-
-void
-gfc_get_component_attr (symbol_attribute *attr, gfc_component *c)
-{
-
- gfc_clear_attr (attr);
- attr->dimension = c->dimension;
- attr->pointer = c->pointer;
- attr->allocatable = c->allocatable;
- attr->access = c->access;
-}
-
-
/******************** Statement label management ********************/
/* Comparison function for statement labels, used for managing the
@@ -2034,12 +2058,12 @@ gfc_define_st_label (gfc_st_label *lp, gfc_sl_type type, locus *label_locus)
updating the unknown state. Returns FAILURE if something goes
wrong. */
-try
+gfc_try
gfc_reference_st_label (gfc_st_label *lp, gfc_sl_type type)
{
gfc_sl_type label_type;
int labelno;
- try rc;
+ gfc_try rc;
if (lp == NULL)
return SUCCESS;
@@ -2206,6 +2230,7 @@ gfc_new_symtree (gfc_symtree **root, const char *name)
st = XCNEW (gfc_symtree);
st->name = gfc_get_string (name);
+ st->typebound = NULL;
gfc_insert_bbt (root, st, compare_symtree);
return st;
@@ -2938,9 +2963,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);
}
@@ -2995,6 +3023,7 @@ gfc_free_namespace (gfc_namespace *ns)
gfc_free_equiv (ns->equiv);
gfc_free_equiv_lists (ns->equiv_lists);
+ gfc_free_use_stmts (ns->use_stmts);
for (i = GFC_INTRINSIC_BEGIN; i != GFC_INTRINSIC_END; i++)
gfc_free_interface (ns->op[i]);
@@ -3257,12 +3286,12 @@ get_iso_c_binding_dt (int sym_id)
for such. If an error occurs, the errors are reported here, allowing for
multiple errors to be handled for a single derived type. */
-try
+gfc_try
verify_bind_c_derived_type (gfc_symbol *derived_sym)
{
gfc_component *curr_comp = NULL;
- try is_c_interop = FAILURE;
- try retval = SUCCESS;
+ gfc_try is_c_interop = FAILURE;
+ gfc_try retval = SUCCESS;
if (derived_sym == NULL)
gfc_internal_error ("verify_bind_c_derived_type(): Given symbol is "
@@ -3304,7 +3333,7 @@ verify_bind_c_derived_type (gfc_symbol *derived_sym)
{
/* The components cannot be pointers (fortran sense).
J3/04-007, Section 15.2.3, C1505. */
- if (curr_comp->pointer != 0)
+ if (curr_comp->attr.pointer != 0)
{
gfc_error ("Component '%s' at %L cannot have the "
"POINTER attribute because it is a member "
@@ -3316,7 +3345,7 @@ verify_bind_c_derived_type (gfc_symbol *derived_sym)
/* The components cannot be allocatable.
J3/04-007, Section 15.2.3, C1505. */
- if (curr_comp->allocatable != 0)
+ if (curr_comp->attr.allocatable != 0)
{
gfc_error ("Component '%s' at %L cannot have the "
"ALLOCATABLE attribute because it is a member "
@@ -3406,7 +3435,7 @@ verify_bind_c_derived_type (gfc_symbol *derived_sym)
/* Generate symbols for the named constants c_null_ptr and c_null_funptr. */
-static try
+static gfc_try
gen_special_c_interop_ptr (int ptr_id, const char *ptr_name,
const char *module_name)
{
@@ -4031,8 +4060,8 @@ generate_isocbinding_symbol (const char *mod_name, iso_c_binding_symbol s,
index = get_c_kind ("c_ptr", c_interop_kinds_table);
tmp_comp->ts.kind = c_interop_kinds_table[index].value;
- tmp_comp->pointer = 0;
- tmp_comp->dimension = 0;
+ tmp_comp->attr.pointer = 0;
+ tmp_comp->attr.dimension = 0;
/* Mark the component as C interoperable. */
tmp_comp->ts.is_c_interop = 1;
@@ -4183,3 +4212,102 @@ 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;
+}
+
+
+/* Get the super-type of a given derived type. */
+
+gfc_symbol*
+gfc_get_derived_super_type (gfc_symbol* derived)
+{
+ if (!derived->attr.extension)
+ return NULL;
+
+ gcc_assert (derived->components);
+ gcc_assert (derived->components->ts.type == BT_DERIVED);
+ gcc_assert (derived->components->ts.derived);
+
+ return derived->components->ts.derived;
+}
+
+
+/* Find a type-bound procedure by name for a derived-type (looking recursively
+ through the super-types). */
+
+gfc_symtree*
+gfc_find_typebound_proc (gfc_symbol* derived, gfc_try* t,
+ const char* name, bool noaccess)
+{
+ gfc_symtree* res;
+
+ /* Set default to failure. */
+ if (t)
+ *t = FAILURE;
+
+ /* Try to find it in the current type's namespace. */
+ gcc_assert (derived->f2k_derived);
+ res = gfc_find_symtree (derived->f2k_derived->sym_root, name);
+ if (res)
+ {
+ if (!res->typebound)
+ return NULL;
+
+ /* We found one. */
+ if (t)
+ *t = SUCCESS;
+
+ if (!noaccess && derived->attr.use_assoc
+ && res->typebound->access == ACCESS_PRIVATE)
+ {
+ gfc_error ("'%s' of '%s' is PRIVATE at %C", name, derived->name);
+ if (t)
+ *t = FAILURE;
+ }
+
+ return res;
+ }
+
+ /* Otherwise, recurse on parent type if derived is an extension. */
+ if (derived->attr.extension)
+ {
+ gfc_symbol* super_type;
+ super_type = gfc_get_derived_super_type (derived);
+ gcc_assert (super_type);
+ return gfc_find_typebound_proc (super_type, t, name, noaccess);
+ }
+
+ /* Nothing found. */
+ return NULL;
+}
diff --git a/gcc/fortran/target-memory.c b/gcc/fortran/target-memory.c
index 40e595ba404..b1029dfa5dc 100644
--- a/gcc/fortran/target-memory.c
+++ b/gcc/fortran/target-memory.c
@@ -399,9 +399,28 @@ gfc_interpret_character (unsigned char *buffer, size_t buffer_size,
result->value.character.string =
gfc_get_wide_string (result->value.character.length + 1);
- gcc_assert (result->ts.kind == gfc_default_character_kind);
- for (i = 0; i < result->value.character.length; i++)
- result->value.character.string[i] = (gfc_char_t) buffer[i];
+ if (result->ts.kind == gfc_default_character_kind)
+ for (i = 0; i < result->value.character.length; i++)
+ result->value.character.string[i] = (gfc_char_t) buffer[i];
+ else
+ {
+ mpz_t integer;
+ unsigned bytes = size_character (1, result->ts.kind);
+ mpz_init (integer);
+ gcc_assert (bytes <= sizeof (unsigned long));
+
+ for (i = 0; i < result->value.character.length; i++)
+ {
+ gfc_conv_tree_to_mpz (integer,
+ native_interpret_expr (gfc_get_char_type (result->ts.kind),
+ &buffer[bytes*i], buffer_size-bytes*i));
+ result->value.character.string[i]
+ = (gfc_char_t) mpz_get_ui (integer);
+ }
+
+ mpz_clear (integer);
+ }
+
result->value.character.string[result->value.character.length] = '\0';
return result->value.character.length;
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c
index 6402887cec8..2d574a3bc77 100644
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -80,7 +80,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "ggc.h"
#include "toplev.h"
#include "real.h"
@@ -161,12 +161,10 @@ gfc_conv_descriptor_data_get (tree desc)
This function gets called through the following macros:
gfc_conv_descriptor_data_set
- gfc_conv_descriptor_data_set_tuples. */
+ gfc_conv_descriptor_data_set. */
void
-gfc_conv_descriptor_data_set_internal (stmtblock_t *block,
- tree desc, tree value,
- bool tuples_p)
+gfc_conv_descriptor_data_set (stmtblock_t *block, tree desc, tree value)
{
tree field, type, t;
@@ -177,7 +175,7 @@ gfc_conv_descriptor_data_set_internal (stmtblock_t *block,
gcc_assert (DATA_FIELD == 0);
t = fold_build3 (COMPONENT_REF, TREE_TYPE (field), desc, field, NULL_TREE);
- gfc_add_modify (block, t, fold_convert (TREE_TYPE (field), value), tuples_p);
+ gfc_add_modify (block, t, fold_convert (TREE_TYPE (field), value));
}
@@ -547,7 +545,7 @@ gfc_trans_allocate_array_storage (stmtblock_t * pre, stmtblock_t * post,
/* The offset is zero because we create temporaries with a zero
lower bound. */
tmp = gfc_conv_descriptor_offset (desc);
- gfc_add_modify_expr (pre, tmp, gfc_index_zero_node);
+ gfc_add_modify (pre, tmp, gfc_index_zero_node);
if (dealloc && !onstack)
{
@@ -576,7 +574,7 @@ tree
gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post,
gfc_loopinfo * loop, gfc_ss_info * info,
tree eltype, bool dynamic, bool dealloc,
- bool callee_alloc)
+ bool callee_alloc, locus * where)
{
tree type;
tree desc;
@@ -589,6 +587,10 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post,
int dim;
gcc_assert (info->dimen > 0);
+
+ if (gfc_option.warn_array_temp && where)
+ gfc_warning ("Creating array temporary at %L", where);
+
/* Set the lower bound to zero. */
for (dim = 0; dim < info->dimen; dim++)
{
@@ -623,7 +625,7 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post,
/* Fill in the array dtype. */
tmp = gfc_conv_descriptor_dtype (desc);
- gfc_add_modify_expr (pre, tmp, gfc_get_dtype (TREE_TYPE (desc)));
+ gfc_add_modify (pre, tmp, gfc_get_dtype (TREE_TYPE (desc)));
/*
Fill in the bounds and stride. This is a packed array, so:
@@ -657,13 +659,13 @@ gfc_trans_create_temp_array (stmtblock_t * pre, stmtblock_t * post,
/* Store the stride and bound components in the descriptor. */
tmp = gfc_conv_descriptor_stride (desc, gfc_rank_cst[n]);
- gfc_add_modify_expr (pre, tmp, size);
+ gfc_add_modify (pre, tmp, size);
tmp = gfc_conv_descriptor_lbound (desc, gfc_rank_cst[n]);
- gfc_add_modify_expr (pre, tmp, gfc_index_zero_node);
+ gfc_add_modify (pre, tmp, gfc_index_zero_node);
tmp = gfc_conv_descriptor_ubound (desc, gfc_rank_cst[n]);
- gfc_add_modify_expr (pre, tmp, loop->to[n]);
+ gfc_add_modify (pre, tmp, loop->to[n]);
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
loop->to[n], gfc_index_one_node);
@@ -748,7 +750,7 @@ gfc_conv_array_transpose (gfc_se * se, gfc_expr * expr)
se->expr = dest;
/* Copy across the dtype field. */
- gfc_add_modify_expr (&se->pre,
+ gfc_add_modify (&se->pre,
gfc_conv_descriptor_dtype (dest),
gfc_conv_descriptor_dtype (src));
@@ -765,15 +767,15 @@ gfc_conv_array_transpose (gfc_se * se, gfc_expr * expr)
dest_index = gfc_rank_cst[n];
src_index = gfc_rank_cst[1 - n];
- gfc_add_modify_expr (&se->pre,
+ gfc_add_modify (&se->pre,
gfc_conv_descriptor_stride (dest, dest_index),
gfc_conv_descriptor_stride (src, src_index));
- gfc_add_modify_expr (&se->pre,
+ gfc_add_modify (&se->pre,
gfc_conv_descriptor_lbound (dest, dest_index),
gfc_conv_descriptor_lbound (src, src_index));
- gfc_add_modify_expr (&se->pre,
+ gfc_add_modify (&se->pre,
gfc_conv_descriptor_ubound (dest, dest_index),
gfc_conv_descriptor_ubound (src, src_index));
@@ -799,7 +801,7 @@ gfc_conv_array_transpose (gfc_se * se, gfc_expr * expr)
else
dest_info->offset = gfc_index_zero_node;
- gfc_add_modify_expr (&se->pre,
+ gfc_add_modify (&se->pre,
gfc_conv_descriptor_offset (dest),
dest_info->offset);
@@ -843,7 +845,7 @@ gfc_grow_array (stmtblock_t * pblock, tree desc, tree extra)
/* Add EXTRA to the upper bound. */
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, ubound, extra);
- gfc_add_modify_expr (pblock, ubound, tmp);
+ gfc_add_modify (pblock, ubound, tmp);
/* Get the value of the current data pointer. */
arg0 = gfc_conv_descriptor_data_get (desc);
@@ -953,7 +955,7 @@ gfc_put_offset_into_var (stmtblock_t * pblock, tree * poffset,
/* We should have already created the offset variable. We cannot
create it here because we may be in an inner scope. */
gcc_assert (*offsetvar != NULL_TREE);
- gfc_add_modify_expr (pblock, *offsetvar, *poffset);
+ gfc_add_modify (pblock, *offsetvar, *poffset);
*poffset = *offsetvar;
TREE_USED (*offsetvar) = 1;
}
@@ -992,7 +994,7 @@ gfc_trans_array_ctor_element (stmtblock_t * pblock, tree desc,
{
/* The temporary is an array of pointers. */
se->expr = fold_convert (TREE_TYPE (tmp), se->expr);
- gfc_add_modify_expr (&se->pre, tmp, se->expr);
+ gfc_add_modify (&se->pre, tmp, se->expr);
}
else
{
@@ -1007,7 +1009,7 @@ gfc_trans_array_ctor_element (stmtblock_t * pblock, tree desc,
{
if (first_len)
{
- gfc_add_modify_expr (&se->pre, first_len_val,
+ gfc_add_modify (&se->pre, first_len_val,
se->string_length);
first_len = false;
}
@@ -1018,7 +1020,7 @@ gfc_trans_array_ctor_element (stmtblock_t * pblock, tree desc,
tree cond = fold_build2 (NE_EXPR, boolean_type_node,
first_len_val, se->string_length);
gfc_trans_runtime_check
- (cond, &se->pre, &expr->where,
+ (true, false, cond, &se->pre, &expr->where,
"Different CHARACTER lengths (%ld/%ld) in array constructor",
fold_convert (long_integer_type_node, first_len_val),
fold_convert (long_integer_type_node, se->string_length));
@@ -1029,7 +1031,7 @@ gfc_trans_array_ctor_element (stmtblock_t * pblock, tree desc,
{
/* TODO: Should the frontend already have done this conversion? */
se->expr = fold_convert (TREE_TYPE (tmp), se->expr);
- gfc_add_modify_expr (&se->pre, tmp, se->expr);
+ gfc_add_modify (&se->pre, tmp, se->expr);
}
gfc_add_block_to_block (pblock, &se->pre);
@@ -1070,7 +1072,7 @@ gfc_trans_array_constructor_subarray (stmtblock_t * pblock,
/* Initialize the loop. */
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr->where);
/* Make sure the constructed array has room for the new data. */
if (dynamic)
@@ -1100,7 +1102,7 @@ gfc_trans_array_constructor_subarray (stmtblock_t * pblock,
/* Increment the offset. */
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
*poffset, gfc_index_one_node);
- gfc_add_modify_expr (&body, *poffset, tmp);
+ gfc_add_modify (&body, *poffset, tmp);
/* Finish the loop. */
gfc_trans_scalarizing_loops (&loop, &body);
@@ -1239,7 +1241,7 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type,
}
if (!INTEGER_CST_P (*poffset))
{
- gfc_add_modify_expr (&body, *offsetvar, *poffset);
+ gfc_add_modify (&body, *offsetvar, *poffset);
*poffset = *offsetvar;
}
}
@@ -1285,13 +1287,13 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type,
/* Make a temporary, store the current value in that
and return it, once the loop is done. */
tmp_loopvar = gfc_create_var (TREE_TYPE (loopvar), "loopvar");
- gfc_add_modify_expr (pblock, tmp_loopvar, loopvar);
+ gfc_add_modify (pblock, tmp_loopvar, loopvar);
/* Initialize the loop. */
gfc_init_se (&se, NULL);
gfc_conv_expr_val (&se, c->iterator->start);
gfc_add_block_to_block (pblock, &se.pre);
- gfc_add_modify_expr (pblock, loopvar, se.expr);
+ gfc_add_modify (pblock, loopvar, se.expr);
gfc_init_se (&se, NULL);
gfc_conv_expr_val (&se, c->iterator->end);
@@ -1344,7 +1346,7 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type,
/* Increase loop variable by step. */
tmp = fold_build2 (PLUS_EXPR, TREE_TYPE (loopvar), loopvar, step);
- gfc_add_modify_expr (&body, loopvar, tmp);
+ gfc_add_modify (&body, loopvar, tmp);
/* Finish the loop. */
tmp = gfc_finish_block (&body);
@@ -1356,7 +1358,7 @@ gfc_trans_array_constructor_value (stmtblock_t * pblock, tree type,
gfc_add_expr_to_block (pblock, tmp);
/* Restore the original value of the loop counter. */
- gfc_add_modify_expr (pblock, loopvar, tmp_loopvar);
+ gfc_add_modify (pblock, loopvar, tmp_loopvar);
}
}
mpz_clear (size);
@@ -1683,7 +1685,7 @@ constant_array_constructor_loop_size (gfc_loopinfo * loop)
simplest method. */
static void
-gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss)
+gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss, locus * where)
{
gfc_constructor *c;
tree offset;
@@ -1809,7 +1811,7 @@ gfc_trans_array_constructor (gfc_loopinfo * loop, gfc_ss * ss)
loopfrom = NULL_TREE;
gfc_trans_create_temp_array (&loop->pre, &loop->post, loop, &ss->data.info,
- type, dynamic, true, false);
+ type, dynamic, true, false, where);
if (loopfrom != NULL_TREE)
{
@@ -1896,7 +1898,8 @@ gfc_set_vector_loop_bounds (gfc_loopinfo * loop, gfc_ss_info * info)
but before the actual scalarizing loops. */
static void
-gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript)
+gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript,
+ locus * where)
{
gfc_se se;
int n;
@@ -1950,7 +1953,8 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript)
/* Add the expressions for scalar and vector subscripts. */
for (n = 0; n < GFC_MAX_DIMENSIONS; n++)
if (ss->data.info.subscript[n])
- gfc_add_loop_ss_code (loop, ss->data.info.subscript[n], true);
+ gfc_add_loop_ss_code (loop, ss->data.info.subscript[n], true,
+ where);
gfc_set_vector_loop_bounds (loop, &ss->data.info);
break;
@@ -1993,7 +1997,7 @@ gfc_add_loop_ss_code (gfc_loopinfo * loop, gfc_ss * ss, bool subscript)
gfc_add_block_to_block (&loop->pre, &se.pre);
gfc_add_block_to_block (&loop->post, &se.post);
}
- gfc_trans_array_constructor (loop, ss);
+ gfc_trans_array_constructor (loop, ss, where);
break;
case GFC_SS_TEMP:
@@ -2229,7 +2233,7 @@ gfc_trans_array_bound_check (gfc_se * se, tree descriptor, tree index, int n,
else
asprintf (&msg, "%s, lower bound of dimension %d exceeded (%%ld < %%ld)",
gfc_msg_fault, n+1);
- gfc_trans_runtime_check (fault, &se->pre, where, msg,
+ gfc_trans_runtime_check (true, false, fault, &se->pre, where, msg,
fold_convert (long_integer_type_node, index),
fold_convert (long_integer_type_node, tmp));
gfc_free (msg);
@@ -2245,7 +2249,7 @@ gfc_trans_array_bound_check (gfc_se * se, tree descriptor, tree index, int n,
else
asprintf (&msg, "%s, upper bound of dimension %d exceeded (%%ld > %%ld)",
gfc_msg_fault, n+1);
- gfc_trans_runtime_check (fault, &se->pre, where, msg,
+ gfc_trans_runtime_check (true, false, fault, &se->pre, where, msg,
fold_convert (long_integer_type_node, index),
fold_convert (long_integer_type_node, tmp));
gfc_free (msg);
@@ -2439,7 +2443,7 @@ gfc_conv_array_ref (gfc_se * se, gfc_array_ref * ar, gfc_symbol * sym,
asprintf (&msg, "%s for array '%s', "
"lower bound of dimension %d exceeded (%%ld < %%ld)",
gfc_msg_fault, sym->name, n+1);
- gfc_trans_runtime_check (cond, &se->pre, where, msg,
+ gfc_trans_runtime_check (true, false, cond, &se->pre, where, msg,
fold_convert (long_integer_type_node,
indexse.expr),
fold_convert (long_integer_type_node, tmp));
@@ -2456,7 +2460,7 @@ gfc_conv_array_ref (gfc_se * se, gfc_array_ref * ar, gfc_symbol * sym,
asprintf (&msg, "%s for array '%s', "
"upper bound of dimension %d exceeded (%%ld > %%ld)",
gfc_msg_fault, sym->name, n+1);
- gfc_trans_runtime_check (cond, &se->pre, where, msg,
+ gfc_trans_runtime_check (true, false, cond, &se->pre, where, msg,
fold_convert (long_integer_type_node,
indexse.expr),
fold_convert (long_integer_type_node, tmp));
@@ -2634,7 +2638,7 @@ gfc_trans_scalarized_loop_end (gfc_loopinfo * loop, int n,
loopbody = gfc_finish_block (pbody);
/* Initialize the loopvar. */
- gfc_add_modify_expr (&loop->code[n], loop->loopvar[n], loop->from[n]);
+ gfc_add_modify (&loop->code[n], loop->loopvar[n], loop->from[n]);
exit_label = gfc_build_label_decl (NULL_TREE);
@@ -2655,7 +2659,7 @@ gfc_trans_scalarized_loop_end (gfc_loopinfo * loop, int n,
/* Increment the loopvar. */
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
loop->loopvar[n], gfc_index_one_node);
- gfc_add_modify_expr (&block, loop->loopvar[n], tmp);
+ gfc_add_modify (&block, loop->loopvar[n], tmp);
/* Build the loop. */
tmp = gfc_finish_block (&block);
@@ -3020,7 +3024,8 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
asprintf (&msg, "Zero stride is not allowed, for dimension %d "
"of array '%s'", info->dim[n]+1,
ss->expr->symtree->name);
- gfc_trans_runtime_check (tmp, &inner, &ss->expr->where, msg);
+ gfc_trans_runtime_check (true, false, tmp, &inner,
+ &ss->expr->where, msg);
gfc_free (msg);
desc = ss->data.info.descriptor;
@@ -3062,7 +3067,8 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
asprintf (&msg, "%s, lower bound of dimension %d of array '%s'"
" exceeded (%%ld < %%ld)", gfc_msg_fault,
info->dim[n]+1, ss->expr->symtree->name);
- gfc_trans_runtime_check (tmp, &inner, &ss->expr->where, msg,
+ gfc_trans_runtime_check (true, false, tmp, &inner,
+ &ss->expr->where, msg,
fold_convert (long_integer_type_node,
info->start[n]),
fold_convert (long_integer_type_node,
@@ -3078,7 +3084,8 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
asprintf (&msg, "%s, upper bound of dimension %d of array "
"'%s' exceeded (%%ld > %%ld)", gfc_msg_fault,
info->dim[n]+1, ss->expr->symtree->name);
- gfc_trans_runtime_check (tmp, &inner, &ss->expr->where, msg,
+ gfc_trans_runtime_check (true, false, tmp, &inner,
+ &ss->expr->where, msg,
fold_convert (long_integer_type_node, info->start[n]),
fold_convert (long_integer_type_node, ubound));
gfc_free (msg);
@@ -3100,7 +3107,8 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
asprintf (&msg, "%s, lower bound of dimension %d of array '%s'"
" exceeded (%%ld < %%ld)", gfc_msg_fault,
info->dim[n]+1, ss->expr->symtree->name);
- gfc_trans_runtime_check (tmp, &inner, &ss->expr->where, msg,
+ gfc_trans_runtime_check (true, false, tmp, &inner,
+ &ss->expr->where, msg,
fold_convert (long_integer_type_node,
tmp2),
fold_convert (long_integer_type_node,
@@ -3115,7 +3123,8 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
asprintf (&msg, "%s, upper bound of dimension %d of array "
"'%s' exceeded (%%ld > %%ld)", gfc_msg_fault,
info->dim[n]+1, ss->expr->symtree->name);
- gfc_trans_runtime_check (tmp, &inner, &ss->expr->where, msg,
+ gfc_trans_runtime_check (true, false, tmp, &inner,
+ &ss->expr->where, msg,
fold_convert (long_integer_type_node, tmp2),
fold_convert (long_integer_type_node, ubound));
gfc_free (msg);
@@ -3138,7 +3147,8 @@ gfc_conv_ss_startstride (gfc_loopinfo * loop)
asprintf (&msg, "%s, size mismatch for dimension %d "
"of array '%s' (%%ld/%%ld)", gfc_msg_bounds,
info->dim[n]+1, ss->expr->symtree->name);
- gfc_trans_runtime_check (tmp3, &inner, &ss->expr->where, msg,
+ gfc_trans_runtime_check (true, false, tmp3, &inner,
+ &ss->expr->where, msg,
fold_convert (long_integer_type_node, tmp),
fold_convert (long_integer_type_node, size[n]));
gfc_free (msg);
@@ -3247,14 +3257,16 @@ gfc_conv_resolve_dependencies (gfc_loopinfo * loop, gfc_ss * dest,
if (ss->type != GFC_SS_SECTION)
continue;
- if (gfc_could_be_alias (dest, ss)
- || gfc_are_equivalenced_arrays (dest->expr, ss->expr))
+ if (dest->expr->symtree->n.sym != ss->expr->symtree->n.sym)
{
- nDepend = 1;
- break;
+ if (gfc_could_be_alias (dest, ss)
+ || gfc_are_equivalenced_arrays (dest->expr, ss->expr))
+ {
+ nDepend = 1;
+ break;
+ }
}
-
- if (dest->expr->symtree->n.sym == ss->expr->symtree->n.sym)
+ else
{
lref = dest->expr->ref;
rref = ss->expr->ref;
@@ -3327,7 +3339,7 @@ gfc_conv_resolve_dependencies (gfc_loopinfo * loop, gfc_ss * dest,
moved outside the loop. */
void
-gfc_conv_loop_setup (gfc_loopinfo * loop)
+gfc_conv_loop_setup (gfc_loopinfo * loop, locus * where)
{
int n;
int dim;
@@ -3493,7 +3505,7 @@ gfc_conv_loop_setup (gfc_loopinfo * loop)
/* Add all the scalar code that can be taken out of the loops.
This may include calculating the loop bounds, so do it before
allocating the temporary. */
- gfc_add_loop_ss_code (loop, loop->ss, false);
+ gfc_add_loop_ss_code (loop, loop->ss, false, where);
/* If we want a temporary then create it. */
if (loop->temp_ss != NULL)
@@ -3515,7 +3527,7 @@ gfc_conv_loop_setup (gfc_loopinfo * loop)
loop->temp_ss->data.info.dimen = n;
gfc_trans_create_temp_array (&loop->pre, &loop->post, loop,
&loop->temp_ss->data.info, tmp, false, true,
- false);
+ false, where);
}
for (n = 0; n < loop->temp_dim; n++)
@@ -3609,7 +3621,7 @@ gfc_array_init_size (tree descriptor, int rank, tree * poffset,
/* Set the dtype. */
tmp = gfc_conv_descriptor_dtype (descriptor);
- gfc_add_modify_expr (pblock, tmp, gfc_get_dtype (TREE_TYPE (descriptor)));
+ gfc_add_modify (pblock, tmp, gfc_get_dtype (TREE_TYPE (descriptor)));
or_expr = NULL_TREE;
@@ -3640,7 +3652,7 @@ gfc_array_init_size (tree descriptor, int rank, tree * poffset,
}
}
tmp = gfc_conv_descriptor_lbound (descriptor, gfc_rank_cst[n]);
- gfc_add_modify_expr (pblock, tmp, se.expr);
+ gfc_add_modify (pblock, tmp, se.expr);
/* Work out the offset for this component. */
tmp = fold_build2 (MULT_EXPR, gfc_array_index_type, se.expr, stride);
@@ -3657,11 +3669,11 @@ gfc_array_init_size (tree descriptor, int rank, tree * poffset,
gfc_add_block_to_block (pblock, &se.pre);
tmp = gfc_conv_descriptor_ubound (descriptor, gfc_rank_cst[n]);
- gfc_add_modify_expr (pblock, tmp, se.expr);
+ gfc_add_modify (pblock, tmp, se.expr);
/* Store the stride. */
tmp = gfc_conv_descriptor_stride (descriptor, gfc_rank_cst[n]);
- gfc_add_modify_expr (pblock, tmp, stride);
+ gfc_add_modify (pblock, tmp, stride);
/* Calculate the size of this dimension. */
size = fold_build2 (PLUS_EXPR, gfc_array_index_type, se.expr, size);
@@ -3701,11 +3713,11 @@ gfc_array_init_size (tree descriptor, int rank, tree * poffset,
var = gfc_create_var (TREE_TYPE (size), "size");
gfc_start_block (&thenblock);
- gfc_add_modify_expr (&thenblock, var, gfc_index_zero_node);
+ gfc_add_modify (&thenblock, var, gfc_index_zero_node);
thencase = gfc_finish_block (&thenblock);
gfc_start_block (&elseblock);
- gfc_add_modify_expr (&elseblock, var, size);
+ gfc_add_modify (&elseblock, var, size);
elsecase = gfc_finish_block (&elseblock);
tmp = gfc_evaluate_now (or_expr, pblock);
@@ -3748,7 +3760,7 @@ gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree pstat)
if (!prev_ref)
allocatable_array = expr->symtree->n.sym->attr.allocatable;
else
- allocatable_array = prev_ref->u.c.component->allocatable;
+ allocatable_array = prev_ref->u.c.component->attr.allocatable;
/* Figure out the size of the array. */
switch (ref->u.ar.type)
@@ -3791,7 +3803,7 @@ gfc_array_allocate (gfc_se * se, gfc_expr * expr, tree pstat)
gfc_add_expr_to_block (&se->pre, tmp);
tmp = gfc_conv_descriptor_offset (se->expr);
- gfc_add_modify_expr (&se->pre, tmp, offset);
+ gfc_add_modify (&se->pre, tmp, offset);
if (expr->ts.type == BT_DERIVED
&& expr->ts.derived->attr.alloc_comp)
@@ -3989,7 +4001,7 @@ gfc_trans_array_bounds (tree type, gfc_symbol * sym, tree * poffset,
gfc_init_se (&se, NULL);
gfc_conv_expr_type (&se, as->lower[dim], gfc_array_index_type);
gfc_add_block_to_block (pblock, &se.pre);
- gfc_add_modify_expr (pblock, lbound, se.expr);
+ gfc_add_modify (pblock, lbound, se.expr);
}
ubound = GFC_TYPE_ARRAY_UBOUND (type, dim);
if (as->upper[dim] && !INTEGER_CST_P (ubound))
@@ -3997,7 +4009,7 @@ gfc_trans_array_bounds (tree type, gfc_symbol * sym, tree * poffset,
gfc_init_se (&se, NULL);
gfc_conv_expr_type (&se, as->upper[dim], gfc_array_index_type);
gfc_add_block_to_block (pblock, &se.pre);
- gfc_add_modify_expr (pblock, ubound, se.expr);
+ gfc_add_modify (pblock, ubound, se.expr);
}
/* The offset of this dimension. offset = offset - lbound * stride. */
tmp = fold_build2 (MULT_EXPR, gfc_array_index_type, lbound, size);
@@ -4017,7 +4029,7 @@ gfc_trans_array_bounds (tree type, gfc_symbol * sym, tree * poffset,
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, ubound, tmp);
tmp = fold_build2 (MULT_EXPR, gfc_array_index_type, size, tmp);
if (stride)
- gfc_add_modify_expr (pblock, stride, tmp);
+ gfc_add_modify (pblock, stride, tmp);
else
stride = gfc_evaluate_now (tmp, pblock);
@@ -4027,7 +4039,7 @@ gfc_trans_array_bounds (tree type, gfc_symbol * sym, tree * poffset,
stride, gfc_index_zero_node);
tmp = fold_build3 (COND_EXPR, gfc_array_index_type, tmp,
stride, gfc_index_zero_node);
- gfc_add_modify_expr (pblock, stride, tmp);
+ gfc_add_modify (pblock, stride, tmp);
}
size = stride;
@@ -4100,7 +4112,7 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody)
if (sym->attr.cray_pointee)
{
if (TREE_CODE (GFC_TYPE_ARRAY_OFFSET (type)) == VAR_DECL)
- gfc_add_modify_expr (&block, GFC_TYPE_ARRAY_OFFSET (type), offset);
+ gfc_add_modify (&block, GFC_TYPE_ARRAY_OFFSET (type), offset);
gfc_add_expr_to_block (&block, fnbody);
return gfc_finish_block (&block);
}
@@ -4113,11 +4125,11 @@ gfc_trans_auto_array_allocation (tree decl, gfc_symbol * sym, tree fnbody)
/* Allocate memory to hold the data. */
tmp = gfc_call_malloc (&block, TREE_TYPE (decl), size);
- gfc_add_modify_expr (&block, decl, tmp);
+ gfc_add_modify (&block, decl, tmp);
/* Set offset of the array. */
if (TREE_CODE (GFC_TYPE_ARRAY_OFFSET (type)) == VAR_DECL)
- gfc_add_modify_expr (&block, GFC_TYPE_ARRAY_OFFSET (type), offset);
+ gfc_add_modify (&block, GFC_TYPE_ARRAY_OFFSET (type), offset);
/* Automatic arrays should not have initializers. */
@@ -4165,13 +4177,13 @@ gfc_trans_g77_array (gfc_symbol * sym, tree body)
/* Set the offset. */
if (TREE_CODE (GFC_TYPE_ARRAY_OFFSET (type)) == VAR_DECL)
- gfc_add_modify_expr (&block, GFC_TYPE_ARRAY_OFFSET (type), offset);
+ gfc_add_modify (&block, GFC_TYPE_ARRAY_OFFSET (type), offset);
/* Set the pointer itself if we aren't using the parameter directly. */
if (TREE_CODE (parm) != PARM_DECL)
{
tmp = convert (TREE_TYPE (parm), GFC_DECL_SAVED_DESCRIPTOR (parm));
- gfc_add_modify_expr (&block, parm, tmp);
+ gfc_add_modify (&block, parm, tmp);
}
stmt = gfc_finish_block (&block);
@@ -4266,7 +4278,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
TREE_USED (partial) = 1;
tmp = gfc_conv_descriptor_stride (dumdesc, gfc_rank_cst[0]);
tmp = fold_build2 (EQ_EXPR, boolean_type_node, tmp, gfc_index_one_node);
- gfc_add_modify_expr (&block, partial, tmp);
+ gfc_add_modify (&block, partial, tmp);
}
else
{
@@ -4286,7 +4298,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
tmp = fold_build3 (COND_EXPR, gfc_array_index_type, tmp,
gfc_index_one_node, stride);
stride = GFC_TYPE_ARRAY_STRIDE (type, 0);
- gfc_add_modify_expr (&block, stride, tmp);
+ gfc_add_modify (&block, stride, tmp);
/* Allow the user to disable array repacking. */
stmt_unpacked = NULL_TREE;
@@ -4299,6 +4311,9 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
stmt_unpacked = build_call_expr (gfor_fndecl_in_pack, 1, tmp);
stride = gfc_index_one_node;
+
+ if (gfc_option.warn_array_temp)
+ gfc_warning ("Creating array temporary at %L", &loc);
}
/* This is for the case where the array data is used directly without
@@ -4317,7 +4332,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
}
else
tmp = stmt_packed != NULL_TREE ? stmt_packed : stmt_unpacked;
- gfc_add_modify_expr (&block, tmpdesc, fold_convert (type, tmp));
+ gfc_add_modify (&block, tmpdesc, fold_convert (type, tmp));
offset = gfc_index_zero_node;
size = gfc_index_one_node;
@@ -4344,7 +4359,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
gfc_conv_expr_type (&se, sym->as->lower[n],
gfc_array_index_type);
gfc_add_block_to_block (&block, &se.pre);
- gfc_add_modify_expr (&block, lbound, se.expr);
+ gfc_add_modify (&block, lbound, se.expr);
}
ubound = GFC_TYPE_ARRAY_UBOUND (type, n);
@@ -4358,7 +4373,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
gfc_conv_expr_type (&se, sym->as->upper[n],
gfc_array_index_type);
gfc_add_block_to_block (&block, &se.pre);
- gfc_add_modify_expr (&block, ubound, se.expr);
+ gfc_add_modify (&block, ubound, se.expr);
}
/* Check the sizes match. */
@@ -4374,7 +4389,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
tmp = fold_build2 (NE_EXPR, gfc_array_index_type, tmp, stride2);
asprintf (&msg, "%s for dimension %d of array '%s'",
gfc_msg_bounds, n+1, sym->name);
- gfc_trans_runtime_check (tmp, &block, &loc, msg);
+ gfc_trans_runtime_check (true, false, tmp, &block, &loc, msg);
gfc_free (msg);
}
}
@@ -4385,7 +4400,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type,
dubound, dlbound);
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type, tmp, lbound);
- gfc_add_modify_expr (&block, ubound, tmp);
+ gfc_add_modify (&block, ubound, tmp);
}
/* The offset of this dimension. offset = offset - lbound * stride. */
tmp = fold_build2 (MULT_EXPR, gfc_array_index_type, lbound, stride);
@@ -4425,7 +4440,7 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
stmt_unpacked, stmt_packed);
else
tmp = (stmt_packed != NULL_TREE) ? stmt_packed : stmt_unpacked;
- gfc_add_modify_expr (&block, stride, tmp);
+ gfc_add_modify (&block, stride, tmp);
}
}
else
@@ -4441,14 +4456,14 @@ gfc_trans_dummy_array_bias (gfc_symbol * sym, tree tmpdesc, tree body)
ubound, tmp);
tmp = fold_build2 (MULT_EXPR, gfc_array_index_type,
GFC_TYPE_ARRAY_STRIDE (type, n), tmp);
- gfc_add_modify_expr (&block, stride, tmp);
+ gfc_add_modify (&block, stride, tmp);
}
}
}
/* Set the offset. */
if (TREE_CODE (GFC_TYPE_ARRAY_OFFSET (type)) == VAR_DECL)
- gfc_add_modify_expr (&block, GFC_TYPE_ARRAY_OFFSET (type), offset);
+ gfc_add_modify (&block, GFC_TYPE_ARRAY_OFFSET (type), offset);
gfc_trans_vla_type_sizes (sym, &block);
@@ -4743,7 +4758,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
if (se->direct_byref)
{
/* Copy the descriptor for pointer assignments. */
- gfc_add_modify_expr (&se->pre, se->expr, desc);
+ gfc_add_modify (&se->pre, se->expr, desc);
/* Add any offsets from subreferences. */
gfc_get_dataptr_offset (&se->pre, se->expr, desc, NULL_TREE,
@@ -4871,7 +4886,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
gfc_add_ss_to_loop (&loop, loop.temp_ss);
}
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, & expr->where);
if (need_tmp)
{
@@ -4976,7 +4991,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
/* Set the dtype. */
tmp = gfc_conv_descriptor_dtype (parm);
- gfc_add_modify_expr (&loop.pre, tmp, gfc_get_dtype (parmtype));
+ gfc_add_modify (&loop.pre, tmp, gfc_get_dtype (parmtype));
/* Set offset for assignments to pointer only to zero if it is not
the full array. */
@@ -5045,11 +5060,11 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
from = gfc_index_one_node;
}
tmp = gfc_conv_descriptor_lbound (parm, gfc_rank_cst[dim]);
- gfc_add_modify_expr (&loop.pre, tmp, from);
+ gfc_add_modify (&loop.pre, tmp, from);
/* Set the new upper bound. */
tmp = gfc_conv_descriptor_ubound (parm, gfc_rank_cst[dim]);
- gfc_add_modify_expr (&loop.pre, tmp, to);
+ gfc_add_modify (&loop.pre, tmp, to);
/* Multiply the stride by the section stride to get the
total stride. */
@@ -5074,7 +5089,7 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
/* Store the new stride. */
tmp = gfc_conv_descriptor_stride (parm, gfc_rank_cst[dim]);
- gfc_add_modify_expr (&loop.pre, tmp, stride);
+ gfc_add_modify (&loop.pre, tmp, stride);
dim++;
}
@@ -5091,14 +5106,14 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
{
/* Set the offset. */
tmp = gfc_conv_descriptor_offset (parm);
- gfc_add_modify_expr (&loop.pre, tmp, base);
+ gfc_add_modify (&loop.pre, tmp, base);
}
else
{
/* Only the callee knows what the correct offset it, so just set
it to zero here. */
tmp = gfc_conv_descriptor_offset (parm);
- gfc_add_modify_expr (&loop.pre, tmp, gfc_index_zero_node);
+ gfc_add_modify (&loop.pre, tmp, gfc_index_zero_node);
}
desc = parm;
}
@@ -5124,7 +5139,8 @@ gfc_conv_expr_descriptor (gfc_se * se, gfc_expr * expr, gfc_ss * ss)
/* TODO: Optimize passing g77 arrays. */
void
-gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77)
+gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77,
+ const gfc_symbol *fsym, const char *proc_name)
{
tree ptr;
tree desc;
@@ -5219,15 +5235,61 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77)
{
desc = se->expr;
/* Repack the array. */
+
+ if (gfc_option.warn_array_temp)
+ {
+ if (fsym)
+ gfc_warning ("Creating array temporary at %L for argument '%s'",
+ &expr->where, fsym->name);
+ else
+ gfc_warning ("Creating array temporary at %L", &expr->where);
+ }
+
ptr = build_call_expr (gfor_fndecl_in_pack, 1, desc);
+
+ if (fsym && fsym->attr.optional && sym && sym->attr.optional)
+ {
+ tmp = gfc_conv_expr_present (sym);
+ ptr = build3 (COND_EXPR, TREE_TYPE (se->expr), tmp, ptr,
+ null_pointer_node);
+ }
+
ptr = gfc_evaluate_now (ptr, &se->pre);
+
se->expr = ptr;
+ if (gfc_option.flag_check_array_temporaries)
+ {
+ char * msg;
+
+ if (fsym && proc_name)
+ asprintf (&msg, "An array temporary was created for argument "
+ "'%s' of procedure '%s'", fsym->name, proc_name);
+ else
+ asprintf (&msg, "An array temporary was created");
+
+ tmp = build_fold_indirect_ref (desc);
+ tmp = gfc_conv_array_data (tmp);
+ tmp = fold_build2 (NE_EXPR, boolean_type_node,
+ fold_convert (TREE_TYPE (tmp), ptr), tmp);
+
+ if (fsym && fsym->attr.optional && sym && sym->attr.optional)
+ tmp = fold_build2 (TRUTH_AND_EXPR, boolean_type_node,
+ gfc_conv_expr_present (sym), tmp);
+
+ gfc_trans_runtime_check (false, true, tmp, &se->pre,
+ &expr->where, msg);
+ gfc_free (msg);
+ }
+
gfc_start_block (&block);
/* Copy the data back. */
- tmp = build_call_expr (gfor_fndecl_in_unpack, 2, desc, ptr);
- gfc_add_expr_to_block (&block, tmp);
+ if (fsym == NULL || fsym->attr.intent != INTENT_IN)
+ {
+ tmp = build_call_expr (gfor_fndecl_in_unpack, 2, desc, ptr);
+ gfc_add_expr_to_block (&block, tmp);
+ }
/* Free the temporary. */
tmp = gfc_call_free (convert (pvoid_type_node, ptr));
@@ -5242,6 +5304,11 @@ gfc_conv_array_parameter (gfc_se * se, gfc_expr * expr, gfc_ss * ss, int g77)
tmp = gfc_conv_array_data (tmp);
tmp = fold_build2 (NE_EXPR, boolean_type_node,
fold_convert (TREE_TYPE (tmp), ptr), tmp);
+
+ if (fsym && fsym->attr.optional && sym && sym->attr.optional)
+ tmp = fold_build2 (TRUTH_AND_EXPR, boolean_type_node,
+ gfc_conv_expr_present (sym), tmp);
+
tmp = build3_v (COND_EXPR, tmp, stmt, build_empty_stmt ());
gfc_add_expr_to_block (&block, tmp);
@@ -5463,7 +5530,7 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
case DEALLOCATE_ALLOC_COMP:
/* Do not deallocate the components of ultimate pointer
components. */
- if (cmp_has_alloc_comps && !c->pointer)
+ if (cmp_has_alloc_comps && !c->attr.pointer)
{
comp = fold_build3 (COMPONENT_REF, ctype,
decl, cdecl, NULL_TREE);
@@ -5473,7 +5540,7 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
gfc_add_expr_to_block (&fnblock, tmp);
}
- if (c->allocatable)
+ if (c->attr.allocatable)
{
comp = fold_build3 (COMPONENT_REF, ctype,
decl, cdecl, NULL_TREE);
@@ -5483,9 +5550,9 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
break;
case NULLIFY_ALLOC_COMP:
- if (c->pointer)
+ if (c->attr.pointer)
continue;
- else if (c->allocatable)
+ else if (c->attr.allocatable)
{
comp = fold_build3 (COMPONENT_REF, ctype,
decl, cdecl, NULL_TREE);
@@ -5503,7 +5570,7 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
break;
case COPY_ALLOC_COMP:
- if (c->pointer)
+ if (c->attr.pointer)
continue;
/* We need source and destination components. */
@@ -5511,7 +5578,7 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
dcmp = fold_build3 (COMPONENT_REF, ctype, dest, cdecl, NULL_TREE);
dcmp = fold_convert (TREE_TYPE (comp), dcmp);
- if (c->allocatable && !cmp_has_alloc_comps)
+ if (c->attr.allocatable && !cmp_has_alloc_comps)
{
tmp = gfc_duplicate_allocatable(dcmp, comp, ctype, c->as->rank);
gfc_add_expr_to_block (&fnblock, tmp);
@@ -5521,7 +5588,7 @@ structure_alloc_comps (gfc_symbol * der_type, tree decl,
{
rank = c->as ? c->as->rank : 0;
tmp = fold_convert (TREE_TYPE (dcmp), comp);
- gfc_add_modify_expr (&fnblock, dcmp, tmp);
+ gfc_add_modify (&fnblock, dcmp, tmp);
tmp = structure_alloc_comps (c->ts.derived, comp, dcmp,
rank, purpose);
gfc_add_expr_to_block (&fnblock, tmp);
diff --git a/gcc/fortran/trans-array.h b/gcc/fortran/trans-array.h
index 2b644c7880b..18de51c8437 100644
--- a/gcc/fortran/trans-array.h
+++ b/gcc/fortran/trans-array.h
@@ -32,7 +32,8 @@ void gfc_set_loop_bounds_from_array_spec (gfc_interface_mapping *,
/* Generate code to create a temporary array. */
tree gfc_trans_create_temp_array (stmtblock_t *, stmtblock_t *, gfc_loopinfo *,
- gfc_ss_info *, tree, bool, bool, bool);
+ gfc_ss_info *, tree, bool, bool, bool,
+ locus *);
/* Generate function entry code for allocation of compiler allocated array
variables. */
@@ -88,7 +89,7 @@ void gfc_trans_scalarizing_loops (gfc_loopinfo *, stmtblock_t *);
/* Mark the end of the main loop body and the start of the copying loop. */
void gfc_trans_scalarized_loop_boundary (gfc_loopinfo *, stmtblock_t *);
/* Initialize the scalarization loop parameters. */
-void gfc_conv_loop_setup (gfc_loopinfo *);
+void gfc_conv_loop_setup (gfc_loopinfo *, locus *);
/* Resolve array assignment dependencies. */
void gfc_conv_resolve_dependencies (gfc_loopinfo *, gfc_ss *, gfc_ss *);
/* Build a null array descriptor constructor. */
@@ -104,7 +105,8 @@ void gfc_conv_tmp_ref (gfc_se *);
/* Evaluate an array expression. */
void gfc_conv_expr_descriptor (gfc_se *, gfc_expr *, gfc_ss *);
/* Convert an array for passing as an actual function parameter. */
-void gfc_conv_array_parameter (gfc_se *, gfc_expr *, gfc_ss *, int);
+void gfc_conv_array_parameter (gfc_se *, gfc_expr *, gfc_ss *, int,
+ const gfc_symbol *, const char *);
/* Evaluate and transpose a matrix expression. */
void gfc_conv_array_transpose (gfc_se *, gfc_expr *);
@@ -118,11 +120,7 @@ tree gfc_conv_array_ubound (tree, int);
/* Build expressions for accessing components of an array descriptor. */
tree gfc_conv_descriptor_data_get (tree);
-void gfc_conv_descriptor_data_set_internal (stmtblock_t *, tree, tree, bool);
-#define gfc_conv_descriptor_data_set(BLOCK, T1, T2) \
- gfc_conv_descriptor_data_set_internal ((BLOCK), (T1), (T2), false)
-#define gfc_conv_descriptor_data_set_tuples(BLOCK, T1, T2) \
- gfc_conv_descriptor_data_set_internal ((BLOCK), (T1), (T2), true)
+void gfc_conv_descriptor_data_set (stmtblock_t *, tree, tree);
tree gfc_conv_descriptor_data_addr (tree);
tree gfc_conv_descriptor_offset (tree);
tree gfc_conv_descriptor_dtype (tree);
diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c
index 8c30309b81f..9e55792f20b 100644
--- a/gcc/fortran/trans-common.c
+++ b/gcc/fortran/trans-common.c
@@ -416,6 +416,7 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init)
SET_DECL_ASSEMBLER_NAME (decl, gfc_sym_mangled_common_id (com));
TREE_PUBLIC (decl) = 1;
TREE_STATIC (decl) = 1;
+ DECL_IGNORED_P (decl) = 1;
if (!com->is_bind_c)
DECL_ALIGN (decl) = BIGGEST_ALIGNMENT;
else
@@ -680,6 +681,8 @@ create_common (gfc_common_head *com, segment_info *head, bool saw_equiv)
TREE_PUBLIC (var_decl) = TREE_PUBLIC (decl);
TREE_STATIC (var_decl) = TREE_STATIC (decl);
TREE_USED (var_decl) = TREE_USED (decl);
+ if (s->sym->attr.use_assoc)
+ DECL_IGNORED_P (var_decl) = 1;
if (s->sym->attr.target)
TREE_ADDRESSABLE (var_decl) = 1;
/* This is a fake variable just for debugging purposes. */
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index d2161f5c5c7..72f59737ae6 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "tree.h"
#include "tree-dump.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "ggc.h"
#include "toplev.h"
#include "tm.h"
@@ -35,6 +35,7 @@ along with GCC; see the file COPYING3. If not see
#include "function.h"
#include "flags.h"
#include "cgraph.h"
+#include "debug.h"
#include "gfortran.h"
#include "trans.h"
#include "trans-types.h"
@@ -79,6 +80,7 @@ tree gfor_fndecl_stop_numeric;
tree gfor_fndecl_stop_string;
tree gfor_fndecl_runtime_error;
tree gfor_fndecl_runtime_error_at;
+tree gfor_fndecl_runtime_warning_at;
tree gfor_fndecl_os_error;
tree gfor_fndecl_generate_error;
tree gfor_fndecl_set_fpe;
@@ -701,6 +703,50 @@ gfc_build_qualified_array (tree decl, gfc_symbol * sym)
TYPE_DOMAIN (type) = range;
layout_type (type);
}
+
+ if (nest || write_symbols == NO_DEBUG)
+ return;
+
+ if (TYPE_NAME (type) != NULL_TREE
+ && GFC_TYPE_ARRAY_UBOUND (type, sym->as->rank - 1) != NULL_TREE
+ && TREE_CODE (GFC_TYPE_ARRAY_UBOUND (type, sym->as->rank - 1)) == VAR_DECL)
+ {
+ tree gtype = DECL_ORIGINAL_TYPE (TYPE_NAME (type));
+
+ for (dim = 0; dim < sym->as->rank - 1; dim++)
+ {
+ gcc_assert (TREE_CODE (gtype) == ARRAY_TYPE);
+ gtype = TREE_TYPE (gtype);
+ }
+ gcc_assert (TREE_CODE (gtype) == ARRAY_TYPE);
+ if (TYPE_MAX_VALUE (TYPE_DOMAIN (gtype)) == NULL)
+ TYPE_NAME (type) = NULL_TREE;
+ }
+
+ if (TYPE_NAME (type) == NULL_TREE)
+ {
+ tree gtype = TREE_TYPE (type), rtype, type_decl;
+
+ for (dim = sym->as->rank - 1; dim >= 0; dim--)
+ {
+ rtype = build_range_type (gfc_array_index_type,
+ GFC_TYPE_ARRAY_LBOUND (type, dim),
+ GFC_TYPE_ARRAY_UBOUND (type, dim));
+ gtype = build_array_type (gtype, rtype);
+ /* Ensure the bound variables aren't optimized out at -O0. */
+ if (!optimize)
+ {
+ if (GFC_TYPE_ARRAY_LBOUND (type, dim)
+ && TREE_CODE (GFC_TYPE_ARRAY_LBOUND (type, dim)) == VAR_DECL)
+ DECL_IGNORED_P (GFC_TYPE_ARRAY_LBOUND (type, dim)) = 0;
+ if (GFC_TYPE_ARRAY_UBOUND (type, dim)
+ && TREE_CODE (GFC_TYPE_ARRAY_UBOUND (type, dim)) == VAR_DECL)
+ DECL_IGNORED_P (GFC_TYPE_ARRAY_UBOUND (type, dim)) = 0;
+ }
+ }
+ TYPE_NAME (type) = type_decl = build_decl (TYPE_DECL, NULL, gtype);
+ DECL_ORIGINAL_TYPE (type_decl) = gtype;
+ }
}
@@ -993,7 +1039,11 @@ gfc_get_symbol_decl (gfc_symbol * sym)
This is done here rather than in gfc_finish_var_decl because it
is different for string length variables. */
if (sym->module)
- SET_DECL_ASSEMBLER_NAME (decl, gfc_sym_mangled_identifier (sym));
+ {
+ SET_DECL_ASSEMBLER_NAME (decl, gfc_sym_mangled_identifier (sym));
+ if (sym->attr.use_assoc)
+ DECL_IGNORED_P (decl) = 1;
+ }
if (sym->attr.dimension)
{
@@ -1055,10 +1105,12 @@ gfc_get_symbol_decl (gfc_symbol * sym)
span = build_decl (VAR_DECL, create_tmp_var_name ("span"),
gfc_array_index_type);
gfc_finish_var_decl (span, sym);
- TREE_STATIC (span) = 1;
- DECL_INITIAL (span) = build_int_cst (NULL_TREE, 0);
+ TREE_STATIC (span) = TREE_STATIC (decl);
+ DECL_ARTIFICIAL (span) = 1;
+ DECL_INITIAL (span) = build_int_cst (gfc_array_index_type, 0);
GFC_DECL_SPAN (decl) = span;
+ GFC_TYPE_ARRAY_SPAN (TREE_TYPE (decl)) = span;
}
sym->backend_decl = decl;
@@ -1299,7 +1351,9 @@ build_function_decl (gfc_symbol * sym)
/* Allow only one nesting level. Allow public declarations. */
gcc_assert (current_function_decl == NULL_TREE
- || DECL_CONTEXT (current_function_decl) == NULL_TREE);
+ || DECL_CONTEXT (current_function_decl) == NULL_TREE
+ || TREE_CODE (DECL_CONTEXT (current_function_decl))
+ == NAMESPACE_DECL);
type = gfc_get_function_type (sym);
fndecl = build_decl (FUNCTION_DECL, gfc_sym_identifier (sym), type);
@@ -1592,6 +1646,10 @@ create_function_arglist (gfc_symbol * sym)
DECL_ARG_TYPE (parm) = TREE_VALUE (typelist);
/* All implementation args are read-only. */
TREE_READONLY (parm) = 1;
+ if (POINTER_TYPE_P (type)
+ && (!f->sym->attr.proc_pointer
+ && f->sym->attr.flavor != FL_PROCEDURE))
+ DECL_BY_REFERENCE (parm) = 1;
gfc_finish_decl (parm);
@@ -2455,6 +2513,10 @@ gfc_build_builtin_function_decls (void)
/* The runtime_error_at function does not return. */
TREE_THIS_VOLATILE (gfor_fndecl_runtime_error_at) = 1;
+ gfor_fndecl_runtime_warning_at =
+ gfc_build_library_function_decl (get_identifier (PREFIX("runtime_warning_at")),
+ void_type_node, -2, pchar_type_node,
+ pchar_type_node);
gfor_fndecl_generate_error =
gfc_build_library_function_decl (get_identifier (PREFIX("generate_error")),
void_type_node, 3, pvoid_type_node,
@@ -2571,7 +2633,7 @@ gfc_trans_assign_aux_var (gfc_symbol * sym, tree fnbody)
/* Set the initial value to length. See the comments in
function gfc_add_assign_aux_vars in this file. */
- gfc_add_modify_expr (&body, GFC_DECL_STRING_LEN (sym->backend_decl),
+ gfc_add_modify (&body, GFC_DECL_STRING_LEN (sym->backend_decl),
build_int_cst (NULL_TREE, -2));
gfc_add_expr_to_block (&body, fnbody);
@@ -2602,7 +2664,7 @@ gfc_trans_vla_one_sizepos (tree *tp, stmtblock_t *body)
var = gfc_create_var_np (TREE_TYPE (t), NULL);
gfc_add_decl_to_function (var);
- gfc_add_modify_expr (body, var, val);
+ gfc_add_modify (body, var, val);
if (TREE_CODE (t) == SAVE_EXPR)
TREE_OPERAND (t, 0) = var;
*tp = var;
@@ -2917,6 +2979,88 @@ gfc_trans_deferred_vars (gfc_symbol * proc_sym, tree fnbody)
return gfc_finish_block (&body);
}
+static GTY ((param_is (struct module_htab_entry))) htab_t module_htab;
+
+/* Hash and equality functions for module_htab. */
+
+static hashval_t
+module_htab_do_hash (const void *x)
+{
+ return htab_hash_string (((const struct module_htab_entry *)x)->name);
+}
+
+static int
+module_htab_eq (const void *x1, const void *x2)
+{
+ return strcmp ((((const struct module_htab_entry *)x1)->name),
+ (const char *)x2) == 0;
+}
+
+/* Hash and equality functions for module_htab's decls. */
+
+static hashval_t
+module_htab_decls_hash (const void *x)
+{
+ const_tree t = (const_tree) x;
+ const_tree n = DECL_NAME (t);
+ if (n == NULL_TREE)
+ n = TYPE_NAME (TREE_TYPE (t));
+ return htab_hash_string (IDENTIFIER_POINTER (n));
+}
+
+static int
+module_htab_decls_eq (const void *x1, const void *x2)
+{
+ const_tree t1 = (const_tree) x1;
+ const_tree n1 = DECL_NAME (t1);
+ if (n1 == NULL_TREE)
+ n1 = TYPE_NAME (TREE_TYPE (t1));
+ return strcmp (IDENTIFIER_POINTER (n1), (const char *) x2) == 0;
+}
+
+struct module_htab_entry *
+gfc_find_module (const char *name)
+{
+ void **slot;
+
+ if (! module_htab)
+ module_htab = htab_create_ggc (10, module_htab_do_hash,
+ module_htab_eq, NULL);
+
+ slot = htab_find_slot_with_hash (module_htab, name,
+ htab_hash_string (name), INSERT);
+ if (*slot == NULL)
+ {
+ struct module_htab_entry *entry = GGC_CNEW (struct module_htab_entry);
+
+ entry->name = gfc_get_string (name);
+ entry->decls = htab_create_ggc (10, module_htab_decls_hash,
+ module_htab_decls_eq, NULL);
+ *slot = (void *) entry;
+ }
+ return (struct module_htab_entry *) *slot;
+}
+
+void
+gfc_module_add_decl (struct module_htab_entry *entry, tree decl)
+{
+ void **slot;
+ const char *name;
+
+ if (DECL_NAME (decl))
+ name = IDENTIFIER_POINTER (DECL_NAME (decl));
+ else
+ {
+ gcc_assert (TREE_CODE (decl) == TYPE_DECL);
+ name = IDENTIFIER_POINTER (TYPE_NAME (TREE_TYPE (decl)));
+ }
+ slot = htab_find_slot_with_hash (entry->decls, name,
+ htab_hash_string (name), INSERT);
+ if (*slot == NULL)
+ *slot = (void *) decl;
+}
+
+static struct module_htab_entry *cur_module;
/* Output an initialized decl for a module variable. */
@@ -2936,6 +3080,22 @@ gfc_create_module_variable (gfc_symbol * sym)
&& sym->ts.type == BT_DERIVED)
sym->backend_decl = gfc_typenode_for_spec (&(sym->ts));
+ if (sym->attr.flavor == FL_DERIVED
+ && sym->backend_decl
+ && TREE_CODE (sym->backend_decl) == RECORD_TYPE)
+ {
+ decl = sym->backend_decl;
+ gcc_assert (sym->ns->proc_name->attr.flavor == FL_MODULE);
+ gcc_assert (TYPE_CONTEXT (decl) == NULL_TREE
+ || TYPE_CONTEXT (decl) == sym->ns->proc_name->backend_decl);
+ gcc_assert (DECL_CONTEXT (TYPE_STUB_DECL (decl)) == NULL_TREE
+ || DECL_CONTEXT (TYPE_STUB_DECL (decl))
+ == sym->ns->proc_name->backend_decl);
+ TYPE_CONTEXT (decl) = sym->ns->proc_name->backend_decl;
+ DECL_CONTEXT (TYPE_STUB_DECL (decl)) = sym->ns->proc_name->backend_decl;
+ gfc_module_add_decl (cur_module, TYPE_STUB_DECL (decl));
+ }
+
/* Only output variables and array valued, or derived type,
parameters. */
if (sym->attr.flavor != FL_VARIABLE
@@ -2943,6 +3103,15 @@ gfc_create_module_variable (gfc_symbol * sym)
&& (sym->attr.dimension || sym->ts.type == BT_DERIVED)))
return;
+ if ((sym->attr.in_common || sym->attr.in_equivalence) && sym->backend_decl)
+ {
+ decl = sym->backend_decl;
+ gcc_assert (DECL_CONTEXT (decl) == NULL_TREE);
+ gcc_assert (sym->ns->proc_name->attr.flavor == FL_MODULE);
+ DECL_CONTEXT (decl) = sym->ns->proc_name->backend_decl;
+ gfc_module_add_decl (cur_module, decl);
+ }
+
/* Don't generate variables from other modules. Variables from
COMMONs will already have been generated. */
if (sym->attr.use_assoc || sym->attr.in_common)
@@ -2950,8 +3119,8 @@ gfc_create_module_variable (gfc_symbol * sym)
/* Equivalenced variables arrive here after creation. */
if (sym->backend_decl
- && (sym->equiv_built || sym->attr.in_equivalence))
- return;
+ && (sym->equiv_built || sym->attr.in_equivalence))
+ return;
if (sym->backend_decl)
internal_error ("backend decl for module variable %s already exists",
@@ -2964,7 +3133,11 @@ gfc_create_module_variable (gfc_symbol * sym)
/* Create the variable. */
pushdecl (decl);
+ gcc_assert (DECL_CONTEXT (decl) == NULL_TREE);
+ gcc_assert (sym->ns->proc_name->attr.flavor == FL_MODULE);
+ DECL_CONTEXT (decl) = sym->ns->proc_name->backend_decl;
rest_of_decl_compilation (decl, 1, 0);
+ gfc_module_add_decl (cur_module, decl);
/* Also add length of strings. */
if (sym->ts.type == BT_CHARACTER)
@@ -2980,6 +3153,215 @@ gfc_create_module_variable (gfc_symbol * sym)
}
}
+/* Emit debug information for USE statements. */
+
+static void
+gfc_trans_use_stmts (gfc_namespace * ns)
+{
+ gfc_use_list *use_stmt;
+ for (use_stmt = ns->use_stmts; use_stmt; use_stmt = use_stmt->next)
+ {
+ struct module_htab_entry *entry
+ = gfc_find_module (use_stmt->module_name);
+ gfc_use_rename *rent;
+
+ if (entry->namespace_decl == NULL)
+ {
+ entry->namespace_decl
+ = build_decl (NAMESPACE_DECL,
+ get_identifier (use_stmt->module_name),
+ void_type_node);
+ DECL_EXTERNAL (entry->namespace_decl) = 1;
+ }
+ gfc_set_backend_locus (&use_stmt->where);
+ if (!use_stmt->only_flag)
+ (*debug_hooks->imported_module_or_decl) (entry->namespace_decl,
+ NULL_TREE,
+ ns->proc_name->backend_decl,
+ false);
+ for (rent = use_stmt->rename; rent; rent = rent->next)
+ {
+ tree decl, local_name;
+ void **slot;
+
+ if (rent->op != INTRINSIC_NONE)
+ continue;
+
+ slot = htab_find_slot_with_hash (entry->decls, rent->use_name,
+ htab_hash_string (rent->use_name),
+ INSERT);
+ if (*slot == NULL)
+ {
+ gfc_symtree *st;
+
+ st = gfc_find_symtree (ns->sym_root,
+ rent->local_name[0]
+ ? rent->local_name : rent->use_name);
+ gcc_assert (st && st->n.sym->attr.use_assoc);
+ if (st->n.sym->backend_decl
+ && DECL_P (st->n.sym->backend_decl)
+ && st->n.sym->module
+ && strcmp (st->n.sym->module, use_stmt->module_name) == 0)
+ {
+ gcc_assert (DECL_EXTERNAL (entry->namespace_decl)
+ || (TREE_CODE (st->n.sym->backend_decl)
+ != VAR_DECL));
+ decl = copy_node (st->n.sym->backend_decl);
+ DECL_CONTEXT (decl) = entry->namespace_decl;
+ DECL_EXTERNAL (decl) = 1;
+ DECL_IGNORED_P (decl) = 0;
+ DECL_INITIAL (decl) = NULL_TREE;
+ }
+ else
+ {
+ *slot = error_mark_node;
+ htab_clear_slot (entry->decls, slot);
+ continue;
+ }
+ *slot = decl;
+ }
+ decl = (tree) *slot;
+ if (rent->local_name[0])
+ local_name = get_identifier (rent->local_name);
+ else
+ local_name = NULL_TREE;
+ gfc_set_backend_locus (&rent->where);
+ (*debug_hooks->imported_module_or_decl) (decl, local_name,
+ ns->proc_name->backend_decl,
+ !use_stmt->only_flag);
+ }
+ }
+}
+
+
+/* Return true if expr is a constant initializer that gfc_conv_initializer
+ will handle. */
+
+static bool
+check_constant_initializer (gfc_expr *expr, gfc_typespec *ts, bool array,
+ bool pointer)
+{
+ gfc_constructor *c;
+ gfc_component *cm;
+
+ if (pointer)
+ return true;
+ else if (array)
+ {
+ if (expr->expr_type == EXPR_CONSTANT || expr->expr_type == EXPR_NULL)
+ return true;
+ else if (expr->expr_type == EXPR_STRUCTURE)
+ return check_constant_initializer (expr, ts, false, false);
+ else if (expr->expr_type != EXPR_ARRAY)
+ return false;
+ for (c = expr->value.constructor; c; c = c->next)
+ {
+ if (c->iterator)
+ return false;
+ if (c->expr->expr_type == EXPR_STRUCTURE)
+ {
+ if (!check_constant_initializer (c->expr, ts, false, false))
+ return false;
+ }
+ else if (c->expr->expr_type != EXPR_CONSTANT)
+ return false;
+ }
+ return true;
+ }
+ else switch (ts->type)
+ {
+ case BT_DERIVED:
+ if (expr->expr_type != EXPR_STRUCTURE)
+ return false;
+ cm = expr->ts.derived->components;
+ for (c = expr->value.constructor; c; c = c->next, cm = cm->next)
+ {
+ if (!c->expr || cm->attr.allocatable)
+ continue;
+ if (!check_constant_initializer (c->expr, &cm->ts,
+ cm->attr.dimension,
+ cm->attr.pointer))
+ return false;
+ }
+ return true;
+ default:
+ return expr->expr_type == EXPR_CONSTANT;
+ }
+}
+
+/* Emit debug info for parameters and unreferenced variables with
+ initializers. */
+
+static void
+gfc_emit_parameter_debug_info (gfc_symbol *sym)
+{
+ tree decl;
+
+ if (sym->attr.flavor != FL_PARAMETER
+ && (sym->attr.flavor != FL_VARIABLE || sym->attr.referenced))
+ return;
+
+ if (sym->backend_decl != NULL
+ || sym->value == NULL
+ || sym->attr.use_assoc
+ || sym->attr.dummy
+ || sym->attr.result
+ || sym->attr.function
+ || sym->attr.intrinsic
+ || sym->attr.pointer
+ || sym->attr.allocatable
+ || sym->attr.cray_pointee
+ || sym->attr.threadprivate
+ || sym->attr.is_bind_c
+ || sym->attr.subref_array_pointer
+ || sym->attr.assign)
+ return;
+
+ if (sym->ts.type == BT_CHARACTER)
+ {
+ gfc_conv_const_charlen (sym->ts.cl);
+ if (sym->ts.cl->backend_decl == NULL
+ || TREE_CODE (sym->ts.cl->backend_decl) != INTEGER_CST)
+ return;
+ }
+ else if (sym->ts.type == BT_DERIVED && sym->ts.derived->attr.alloc_comp)
+ return;
+
+ if (sym->as)
+ {
+ int n;
+
+ if (sym->as->type != AS_EXPLICIT)
+ return;
+ for (n = 0; n < sym->as->rank; n++)
+ if (sym->as->lower[n]->expr_type != EXPR_CONSTANT
+ || sym->as->upper[n] == NULL
+ || sym->as->upper[n]->expr_type != EXPR_CONSTANT)
+ return;
+ }
+
+ if (!check_constant_initializer (sym->value, &sym->ts,
+ sym->attr.dimension, false))
+ return;
+
+ /* Create the decl for the variable or constant. */
+ decl = build_decl (sym->attr.flavor == FL_PARAMETER ? CONST_DECL : VAR_DECL,
+ gfc_sym_identifier (sym), gfc_sym_type (sym));
+ if (sym->attr.flavor == FL_PARAMETER)
+ TREE_READONLY (decl) = 1;
+ gfc_set_decl_location (decl, &sym->declared_at);
+ if (sym->attr.dimension)
+ GFC_DECL_PACKED_ARRAY (decl) = 1;
+ DECL_CONTEXT (decl) = sym->ns->proc_name->backend_decl;
+ TREE_STATIC (decl) = 1;
+ TREE_USED (decl) = 1;
+ if (DECL_CONTEXT (decl) && TREE_CODE (DECL_CONTEXT (decl)) == NAMESPACE_DECL)
+ TREE_PUBLIC (decl) = 1;
+ DECL_INITIAL (decl)
+ = gfc_conv_initializer (sym->value, &sym->ts, TREE_TYPE (decl),
+ sym->attr.dimension, 0);
+ debug_hooks->global_decl (decl);
+}
/* Generate all the required code for module variables. */
@@ -2987,6 +3369,7 @@ void
gfc_generate_module_vars (gfc_namespace * ns)
{
module_namespace = ns;
+ cur_module = gfc_find_module (ns->proc_name->name);
/* Check if the frontend left the namespace in a reasonable state. */
gcc_assert (ns->proc_name && !ns->proc_name->tlink);
@@ -2996,8 +3379,14 @@ gfc_generate_module_vars (gfc_namespace * ns)
/* Create decls for all the module variables. */
gfc_traverse_ns (ns, gfc_create_module_variable);
+
+ cur_module = NULL;
+
+ gfc_trans_use_stmts (ns);
+ gfc_traverse_ns (ns, gfc_emit_parameter_debug_info);
}
+
static void
gfc_generate_contained_functions (gfc_namespace * parent)
{
@@ -3407,7 +3796,7 @@ gfc_generate_function_code (gfc_namespace * ns)
{
tree alternate_return;
alternate_return = gfc_get_fake_result_decl (sym, 0);
- gfc_add_modify_expr (&body, alternate_return, integer_zero_node);
+ gfc_add_modify (&body, alternate_return, integer_zero_node);
}
if (ns->entries)
@@ -3528,6 +3917,9 @@ gfc_generate_function_code (gfc_namespace * ns)
gfc_gimplify_function (fndecl);
cgraph_finalize_function (fndecl, false);
}
+
+ gfc_trans_use_stmts (ns);
+ gfc_traverse_ns (ns, gfc_emit_parameter_debug_info);
}
void
@@ -3619,6 +4011,7 @@ gfc_generate_block_data (gfc_namespace * ns)
decl = build_decl (VAR_DECL, id, gfc_array_index_type);
TREE_PUBLIC (decl) = 1;
TREE_STATIC (decl) = 1;
+ DECL_IGNORED_P (decl) = 1;
pushdecl (decl);
rest_of_decl_compilation (decl, 1, 0);
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index b5c9cdda0c6..6c0897897aa 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -1,6 +1,6 @@
/* Expression translation
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
- Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ Free Software Foundation, Inc.
Contributed by Paul Brook <paul@nowt.org>
and Steven Bosscher <s.bosscher@student.tudelft.nl>
@@ -30,7 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "ggc.h"
#include "toplev.h"
#include "real.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "langhooks.h"
#include "flags.h"
#include "gfortran.h"
@@ -115,7 +115,7 @@ gfc_make_safe_expr (gfc_se * se)
/* We need a temporary for this result. */
var = gfc_create_var (TREE_TYPE (se->expr), NULL);
- gfc_add_modify_expr (&se->pre, var, se->expr);
+ gfc_add_modify (&se->pre, var, se->expr);
se->expr = var;
}
@@ -257,7 +257,7 @@ gfc_conv_string_length (gfc_charlen * cl, stmtblock_t * pblock)
gfc_add_block_to_block (pblock, &se.pre);
if (cl->backend_decl)
- gfc_add_modify_expr (pblock, cl->backend_decl, se.expr);
+ gfc_add_modify (pblock, cl->backend_decl, se.expr);
else
cl->backend_decl = gfc_evaluate_now (se.expr, pblock);
}
@@ -328,7 +328,7 @@ gfc_conv_substring (gfc_se * se, gfc_ref * ref, int kind,
else
asprintf (&msg, "Substring out of bounds: lower bound (%%ld)"
"is less than one");
- gfc_trans_runtime_check (fault, &se->pre, where, msg,
+ gfc_trans_runtime_check (true, false, fault, &se->pre, where, msg,
fold_convert (long_integer_type_node,
start.expr));
gfc_free (msg);
@@ -344,7 +344,7 @@ gfc_conv_substring (gfc_se * se, gfc_ref * ref, int kind,
else
asprintf (&msg, "Substring out of bounds: upper bound (%%ld) "
"exceeds string length (%%ld)");
- gfc_trans_runtime_check (fault, &se->pre, where, msg,
+ gfc_trans_runtime_check (true, false, fault, &se->pre, where, msg,
fold_convert (long_integer_type_node, end.expr),
fold_convert (long_integer_type_node,
se->string_length));
@@ -390,11 +390,45 @@ gfc_conv_component_ref (gfc_se * se, gfc_ref * ref)
se->string_length = tmp;
}
- if (c->pointer && c->dimension == 0 && c->ts.type != BT_CHARACTER)
+ if (c->attr.pointer && c->attr.dimension == 0 && c->ts.type != BT_CHARACTER)
se->expr = build_fold_indirect_ref (se->expr);
}
+/* This function deals with component references to components of the
+ parent type for derived type extensons. */
+static void
+conv_parent_component_references (gfc_se * se, gfc_ref * ref)
+{
+ gfc_component *c;
+ gfc_component *cmp;
+ gfc_symbol *dt;
+ gfc_ref parent;
+
+ dt = ref->u.c.sym;
+ c = ref->u.c.component;
+
+ /* Build a gfc_ref to recursively call gfc_conv_component_ref. */
+ parent.type = REF_COMPONENT;
+ parent.next = NULL;
+ parent.u.c.sym = dt;
+ parent.u.c.component = dt->components;
+
+ if (dt->attr.extension && dt->components)
+ {
+ /* Return if the component is not in the parent type. */
+ for (cmp = dt->components->next; cmp; cmp = cmp->next)
+ if (strcmp (c->name, cmp->name) == 0)
+ return;
+
+ /* Otherwise build the reference and call self. */
+ gfc_conv_component_ref (se, &parent);
+ parent.u.c.sym = dt->components->ts.derived;
+ parent.u.c.component = c;
+ conv_parent_component_references (se, &parent);
+ }
+}
+
/* Return the contents of a variable. Also handles reference/pointer
variables (all Fortran pointer references are implicit). */
@@ -561,6 +595,9 @@ gfc_conv_variable (gfc_se * se, gfc_expr * expr)
break;
case REF_COMPONENT:
+ if (ref->u.c.sym->attr.extension)
+ conv_parent_component_references (se, ref);
+
gfc_conv_component_ref (se, ref);
break;
@@ -993,7 +1030,7 @@ gfc_conv_string_tmp (gfc_se * se, tree type, tree len)
fold_build2 (MULT_EXPR, TREE_TYPE (len), len,
fold_convert (TREE_TYPE (len),
TYPE_SIZE (type))));
- gfc_add_modify_expr (&se->pre, var, tmp);
+ gfc_add_modify (&se->pre, var, tmp);
/* Free the temporary afterwards. */
tmp = gfc_call_free (convert (pvoid_type_node, var));
@@ -1509,7 +1546,7 @@ gfc_get_interface_mapping_array (stmtblock_t * block, gfc_symbol * sym,
type = gfc_get_nodesc_array_type (type, sym->as, packed);
var = gfc_create_var (type, "ifm");
- gfc_add_modify_expr (block, var, fold_convert (type, data));
+ gfc_add_modify (block, var, fold_convert (type, data));
return var;
}
@@ -1974,6 +2011,10 @@ gfc_apply_interface_mapping_to_expr (gfc_interface_mapping * mapping,
case EXPR_STRUCTURE:
gfc_apply_interface_mapping_to_cons (mapping, expr->value.constructor);
break;
+
+ case EXPR_COMPCALL:
+ gcc_unreachable ();
+ break;
}
return;
@@ -2059,7 +2100,7 @@ gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr,
gfc_add_ss_to_loop (&loop, loop.temp_ss);
/* Setup the scalarizing loops. */
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr->where);
/* Pass the temporary descriptor back to the caller. */
info = &loop.temp_ss->data.info;
@@ -2124,7 +2165,7 @@ gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr,
gfc_conv_ss_startstride (&loop2);
/* Setup the scalarizing loops. */
- gfc_conv_loop_setup (&loop2);
+ gfc_conv_loop_setup (&loop2, &expr->where);
gfc_copy_loopinfo_to_se (&lse, &loop2);
gfc_copy_loopinfo_to_se (&rse, &loop2);
@@ -2165,7 +2206,7 @@ gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr,
tmp_index = fold_build2 (MINUS_EXPR, gfc_array_index_type,
tmp_index, rse.loop->from[0]);
- gfc_add_modify_expr (&rse.loop->code[0], offset, tmp_index);
+ gfc_add_modify (&rse.loop->code[0], offset, tmp_index);
tmp_index = fold_build2 (PLUS_EXPR, gfc_array_index_type,
rse.loop->loopvar[0], offset);
@@ -2299,7 +2340,7 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
f = f || !sym->attr.always_explicit;
argss = gfc_walk_expr (arg->expr);
- gfc_conv_array_parameter (se, arg->expr, argss, f);
+ gfc_conv_array_parameter (se, arg->expr, argss, f, NULL, NULL);
}
/* TODO -- the following two lines shouldn't be necessary, but
@@ -2535,7 +2576,8 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
gfc_conv_subref_array_arg (&parmse, e, f,
fsym ? fsym->attr.intent : INTENT_INOUT);
else
- gfc_conv_array_parameter (&parmse, e, argss, f);
+ gfc_conv_array_parameter (&parmse, e, argss, f, fsym,
+ sym->name);
/* If an ALLOCATABLE dummy argument has INTENT(OUT) and is
allocated on entry, it must be deallocated. */
@@ -2639,7 +2681,9 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
gfc_finish_interface_mapping (&mapping, &se->pre, &se->post);
ts = sym->ts;
- if (ts.type == BT_CHARACTER && !sym->attr.is_bind_c)
+ if (ts.type == BT_CHARACTER && sym->attr.is_bind_c)
+ se->string_length = build_int_cst (gfc_charlen_type_node, 1);
+ else if (ts.type == BT_CHARACTER)
{
if (sym->ts.cl->length == NULL)
{
@@ -2717,7 +2761,8 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
mustn't be deallocated. */
callee_alloc = sym->attr.allocatable || sym->attr.pointer;
gfc_trans_create_temp_array (&se->pre, &se->post, se->loop, info, tmp,
- false, !sym->attr.pointer, callee_alloc);
+ false, !sym->attr.pointer, callee_alloc,
+ &se->ss->expr->where);
/* Pass the temporary as the first argument. */
tmp = info->descriptor;
@@ -2835,7 +2880,8 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
tmp = gfc_conv_descriptor_data_get (info->descriptor);
tmp = fold_build2 (NE_EXPR, boolean_type_node,
tmp, info->data);
- gfc_trans_runtime_check (tmp, &se->pre, NULL, gfc_msg_fault);
+ gfc_trans_runtime_check (true, false, tmp, &se->pre, NULL,
+ gfc_msg_fault);
}
se->expr = info->descriptor;
/* Bundle in the string length. */
@@ -2892,9 +2938,9 @@ fill_with_spaces (tree start, tree type, tree size)
/* Initialize variables. */
gfc_init_block (&block);
i = gfc_create_var (sizetype, "i");
- gfc_add_modify_expr (&block, i, fold_convert (sizetype, size));
+ gfc_add_modify (&block, i, fold_convert (sizetype, size));
el = gfc_create_var (build_pointer_type (type), "el");
- gfc_add_modify_expr (&block, el, fold_convert (TREE_TYPE (el), start));
+ gfc_add_modify (&block, el, fold_convert (TREE_TYPE (el), start));
exit_label = gfc_build_label_decl (NULL_TREE);
TREE_USED (exit_label) = 1;
@@ -2910,14 +2956,14 @@ fill_with_spaces (tree start, tree type, tree size)
gfc_add_expr_to_block (&loop, tmp);
/* Assignment. */
- gfc_add_modify_expr (&loop, fold_build1 (INDIRECT_REF, type, el),
+ gfc_add_modify (&loop, fold_build1 (INDIRECT_REF, type, el),
build_int_cst (type,
lang_hooks.to_target_charset (' ')));
/* Increment loop variables. */
- gfc_add_modify_expr (&loop, i, fold_build2 (MINUS_EXPR, sizetype, i,
+ gfc_add_modify (&loop, i, fold_build2 (MINUS_EXPR, sizetype, i,
TYPE_SIZE_UNIT (type)));
- gfc_add_modify_expr (&loop, el, fold_build2 (POINTER_PLUS_EXPR,
+ gfc_add_modify (&loop, el, fold_build2 (POINTER_PLUS_EXPR,
TREE_TYPE (el), el,
TYPE_SIZE_UNIT (type)));
@@ -2986,7 +3032,7 @@ gfc_trans_string_copy (stmtblock_t * block, tree dlength, tree dest,
if (dsc != NULL_TREE && ssc != NULL_TREE
&& TREE_TYPE (dsc) == TREE_TYPE (ssc))
{
- gfc_add_modify_expr (block, dsc, ssc);
+ gfc_add_modify (block, dsc, ssc);
return;
}
@@ -3132,7 +3178,7 @@ gfc_conv_statement_function (gfc_se * se, gfc_expr * expr)
gfc_conv_expr (&lse, args->expr);
gfc_add_block_to_block (&se->pre, &lse.pre);
- gfc_add_modify_expr (&se->pre, temp_vars[n], lse.expr);
+ gfc_add_modify (&se->pre, temp_vars[n], lse.expr);
gfc_add_block_to_block (&se->pre, &lse.post);
}
@@ -3335,7 +3381,7 @@ gfc_trans_subarray_assign (tree dest, gfc_component * cm, gfc_expr * expr)
gfc_conv_ss_startstride (&loop);
/* Setup the scalarizing loops. */
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr->where);
/* Setup the gfc_se structures. */
gfc_copy_loopinfo_to_se (&lse, &loop);
@@ -3392,11 +3438,11 @@ gfc_trans_subcomponent_assign (tree dest, gfc_component * cm, gfc_expr * expr)
gfc_start_block (&block);
- if (cm->pointer)
+ if (cm->attr.pointer)
{
gfc_init_se (&se, NULL);
/* Pointer component. */
- if (cm->dimension)
+ if (cm->attr.dimension)
{
/* Array pointer. */
if (expr->expr_type == EXPR_NULL)
@@ -3417,16 +3463,16 @@ gfc_trans_subcomponent_assign (tree dest, gfc_component * cm, gfc_expr * expr)
se.want_pointer = 1;
gfc_conv_expr (&se, expr);
gfc_add_block_to_block (&block, &se.pre);
- gfc_add_modify_expr (&block, dest,
+ gfc_add_modify (&block, dest,
fold_convert (TREE_TYPE (dest), se.expr));
gfc_add_block_to_block (&block, &se.post);
}
}
- else if (cm->dimension)
+ else if (cm->attr.dimension)
{
- if (cm->allocatable && expr->expr_type == EXPR_NULL)
+ if (cm->attr.allocatable && expr->expr_type == EXPR_NULL)
gfc_conv_descriptor_data_set (&block, dest, null_pointer_node);
- else if (cm->allocatable)
+ else if (cm->attr.allocatable)
{
tree tmp2;
@@ -3438,7 +3484,7 @@ gfc_trans_subcomponent_assign (tree dest, gfc_component * cm, gfc_expr * expr)
gfc_add_block_to_block (&block, &se.pre);
tmp = fold_convert (TREE_TYPE (dest), se.expr);
- gfc_add_modify_expr (&block, dest, tmp);
+ gfc_add_modify (&block, dest, tmp);
if (cm->ts.type == BT_DERIVED && cm->ts.derived->attr.alloc_comp)
tmp = gfc_copy_alloc_comp (cm->ts.derived, se.expr, dest,
@@ -3456,7 +3502,7 @@ gfc_trans_subcomponent_assign (tree dest, gfc_component * cm, gfc_expr * expr)
/* Shift the lbound and ubound of temporaries to being unity, rather
than zero, based. Calculate the offset for all cases. */
offset = gfc_conv_descriptor_offset (dest);
- gfc_add_modify_expr (&block, offset, gfc_index_zero_node);
+ gfc_add_modify (&block, offset, gfc_index_zero_node);
tmp2 =gfc_create_var (gfc_array_index_type, NULL);
for (n = 0; n < expr->rank; n++)
{
@@ -3467,21 +3513,21 @@ gfc_trans_subcomponent_assign (tree dest, gfc_component * cm, gfc_expr * expr)
tmp = gfc_conv_descriptor_ubound (dest, gfc_rank_cst[n]);
span = fold_build2 (MINUS_EXPR, gfc_array_index_type, tmp,
gfc_conv_descriptor_lbound (dest, gfc_rank_cst[n]));
- gfc_add_modify_expr (&block, tmp,
+ gfc_add_modify (&block, tmp,
fold_build2 (PLUS_EXPR,
gfc_array_index_type,
span, gfc_index_one_node));
tmp = gfc_conv_descriptor_lbound (dest, gfc_rank_cst[n]);
- gfc_add_modify_expr (&block, tmp, gfc_index_one_node);
+ gfc_add_modify (&block, tmp, gfc_index_one_node);
}
tmp = fold_build2 (MULT_EXPR, gfc_array_index_type,
gfc_conv_descriptor_lbound (dest,
gfc_rank_cst[n]),
gfc_conv_descriptor_stride (dest,
gfc_rank_cst[n]));
- gfc_add_modify_expr (&block, tmp2, tmp);
+ gfc_add_modify (&block, tmp2, tmp);
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type, offset, tmp2);
- gfc_add_modify_expr (&block, offset, tmp);
+ gfc_add_modify (&block, offset, tmp);
}
}
else
@@ -3496,7 +3542,7 @@ gfc_trans_subcomponent_assign (tree dest, gfc_component * cm, gfc_expr * expr)
{
gfc_init_se (&se, NULL);
gfc_conv_expr (&se, expr);
- gfc_add_modify_expr (&block, dest,
+ gfc_add_modify (&block, dest,
fold_convert (TREE_TYPE (dest), se.expr));
}
else
@@ -3597,11 +3643,11 @@ gfc_conv_structure (gfc_se * se, gfc_expr * expr, int init)
components. Although the latter have a default initializer
of EXPR_NULL,... by default, the static nullify is not needed
since this is done every time we come into scope. */
- if (!c->expr || cm->allocatable)
+ if (!c->expr || cm->attr.allocatable)
continue;
val = gfc_conv_initializer (c->expr, &cm->ts,
- TREE_TYPE (cm->backend_decl), cm->dimension, cm->pointer);
+ TREE_TYPE (cm->backend_decl), cm->attr.dimension, cm->attr.pointer);
/* Append it to the constructor list. */
CONSTRUCTOR_APPEND_ELT (v, cm->backend_decl, val);
@@ -3742,7 +3788,7 @@ gfc_conv_expr_val (gfc_se * se, gfc_expr * expr)
if (se->post.head)
{
val = gfc_create_var (TREE_TYPE (se->expr), NULL);
- gfc_add_modify_expr (&se->pre, val, se->expr);
+ gfc_add_modify (&se->pre, val, se->expr);
se->expr = val;
gfc_add_block_to_block (&se->pre, &se->post);
}
@@ -3788,7 +3834,7 @@ gfc_conv_expr_reference (gfc_se * se, gfc_expr * expr)
if (se->post.head)
{
var = gfc_create_var (TREE_TYPE (se->expr), NULL);
- gfc_add_modify_expr (&se->pre, var, se->expr);
+ gfc_add_modify (&se->pre, var, se->expr);
gfc_add_block_to_block (&se->pre, &se->post);
se->expr = var;
}
@@ -3802,7 +3848,7 @@ gfc_conv_expr_reference (gfc_se * se, gfc_expr * expr)
se->want_pointer = 1;
gfc_conv_expr (se, expr);
var = gfc_create_var (TREE_TYPE (se->expr), NULL);
- gfc_add_modify_expr (&se->pre, var, se->expr);
+ gfc_add_modify (&se->pre, var, se->expr);
se->expr = var;
return;
}
@@ -3823,7 +3869,7 @@ gfc_conv_expr_reference (gfc_se * se, gfc_expr * expr)
else
{
var = gfc_create_var (TREE_TYPE (se->expr), NULL);
- gfc_add_modify_expr (&se->pre, var, se->expr);
+ gfc_add_modify (&se->pre, var, se->expr);
}
gfc_add_block_to_block (&se->pre, &se->post);
@@ -3876,7 +3922,7 @@ gfc_trans_pointer_assignment (gfc_expr * expr1, gfc_expr * expr2)
gfc_add_block_to_block (&block, &lse.pre);
gfc_add_block_to_block (&block, &rse.pre);
- gfc_add_modify_expr (&block, lse.expr,
+ gfc_add_modify (&block, lse.expr,
fold_convert (TREE_TYPE (lse.expr), rse.expr));
gfc_add_block_to_block (&block, &rse.post);
gfc_add_block_to_block (&block, &lse.post);
@@ -3909,7 +3955,7 @@ gfc_trans_pointer_assignment (gfc_expr * expr1, gfc_expr * expr2)
tmp = fold_convert (gfc_array_index_type, size_in_bytes (tmp));
if (!INTEGER_CST_P (tmp))
gfc_add_block_to_block (&lse.post, &rse.pre);
- gfc_add_modify_expr (&lse.post, GFC_DECL_SPAN(decl), tmp);
+ gfc_add_modify (&lse.post, GFC_DECL_SPAN(decl), tmp);
}
break;
@@ -3923,7 +3969,7 @@ gfc_trans_pointer_assignment (gfc_expr * expr1, gfc_expr * expr2)
lse.expr = tmp;
lse.direct_byref = 1;
gfc_conv_expr_descriptor (&lse, expr2, rss);
- gfc_add_modify_expr (&lse.pre, desc, tmp);
+ gfc_add_modify (&lse.pre, desc, tmp);
break;
}
gfc_add_block_to_block (&block, &lse.pre);
@@ -4035,7 +4081,7 @@ gfc_trans_scalar_assign (gfc_se * lse, gfc_se * rse, gfc_typespec ts,
gfc_add_block_to_block (&block, &rse->pre);
gfc_add_block_to_block (&block, &lse->pre);
- gfc_add_modify_expr (&block, lse->expr,
+ gfc_add_modify (&block, lse->expr,
fold_convert (TREE_TYPE (lse->expr), rse->expr));
/* Do a deep copy if the rhs is a variable, if it is not the
@@ -4052,7 +4098,7 @@ gfc_trans_scalar_assign (gfc_se * lse, gfc_se * rse, gfc_typespec ts,
gfc_add_block_to_block (&block, &lse->pre);
gfc_add_block_to_block (&block, &rse->pre);
- gfc_add_modify_expr (&block, lse->expr,
+ gfc_add_modify (&block, lse->expr,
fold_convert (TREE_TYPE (lse->expr), rse->expr));
}
@@ -4142,7 +4188,7 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_expr * expr2)
gfc_start_block (&se.pre);
se.want_pointer = 1;
- gfc_conv_array_parameter (&se, expr1, ss, 0);
+ gfc_conv_array_parameter (&se, expr1, ss, 0, NULL, NULL);
se.direct_byref = 1;
se.ss = gfc_walk_expr (expr2);
@@ -4415,7 +4461,7 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag)
/* Resolve any data dependencies in the statement. */
gfc_conv_resolve_dependencies (&loop, lss, rss);
/* Setup the scalarizing loops. */
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr2->where);
/* Setup the gfc_se structures. */
gfc_copy_loopinfo_to_se (&lse, &loop);
diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c
index 92bc0bb6d51..ecb568767ff 100644
--- a/gcc/fortran/trans-intrinsic.c
+++ b/gcc/fortran/trans-intrinsic.c
@@ -30,7 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "ggc.h"
#include "toplev.h"
#include "real.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "flags.h"
#include "gfortran.h"
#include "arith.h"
@@ -864,7 +864,8 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper)
tmp = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (TREE_TYPE (desc))];
tmp = fold_build2 (GE_EXPR, boolean_type_node, bound, tmp);
cond = fold_build2 (TRUTH_ORIF_EXPR, boolean_type_node, cond, tmp);
- gfc_trans_runtime_check (cond, &se->pre, &expr->where, gfc_msg_fault);
+ gfc_trans_runtime_check (true, false, cond, &se->pre, &expr->where,
+ gfc_msg_fault);
}
}
@@ -900,6 +901,7 @@ gfc_conv_intrinsic_bound (gfc_se * se, gfc_expr * expr, int upper)
case AR_FULL:
break;
}
+ break;
}
}
}
@@ -1315,7 +1317,7 @@ gfc_conv_intrinsic_char (gfc_se * se, gfc_expr * expr)
var = gfc_create_var (type, "char");
arg[0] = fold_build1 (NOP_EXPR, type, arg[0]);
- gfc_add_modify_expr (&se->pre, var, arg[0]);
+ gfc_add_modify (&se->pre, var, arg[0]);
se->expr = gfc_build_addr_expr (build_pointer_type (type), var);
se->string_length = integer_one_node;
}
@@ -1478,7 +1480,7 @@ gfc_conv_intrinsic_minmax (gfc_se * se, gfc_expr * expr, int op)
args[0] = gfc_evaluate_now (args[0], &se->pre);
mvar = gfc_create_var (type, "M");
- gfc_add_modify_expr (&se->pre, mvar, args[0]);
+ gfc_add_modify (&se->pre, mvar, args[0]);
for (i = 1, argexpr = argexpr->next; i < nargs; i++)
{
tree cond, isnan;
@@ -1717,7 +1719,7 @@ gfc_conv_intrinsic_anyall (gfc_se * se, gfc_expr * expr, int op)
tmp = convert (type, boolean_true_node);
else
tmp = convert (type, boolean_false_node);
- gfc_add_modify_expr (&se->pre, resvar, tmp);
+ gfc_add_modify (&se->pre, resvar, tmp);
/* Walk the arguments. */
arrayss = gfc_walk_expr (actual->expr);
@@ -1731,7 +1733,7 @@ gfc_conv_intrinsic_anyall (gfc_se * se, gfc_expr * expr, int op)
/* Initialize the loop. */
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr->where);
gfc_mark_ss_chain_used (arrayss, 1);
/* Generate the loop body. */
@@ -1743,7 +1745,7 @@ gfc_conv_intrinsic_anyall (gfc_se * se, gfc_expr * expr, int op)
tmp = convert (type, boolean_false_node);
else
tmp = convert (type, boolean_true_node);
- gfc_add_modify_expr (&block, resvar, tmp);
+ gfc_add_modify (&block, resvar, tmp);
/* And break out of the loop. */
tmp = build1_v (GOTO_EXPR, exit_label);
@@ -1801,7 +1803,7 @@ gfc_conv_intrinsic_count (gfc_se * se, gfc_expr * expr)
type = gfc_typenode_for_spec (&expr->ts);
/* Initialize the result. */
resvar = gfc_create_var (type, "count");
- gfc_add_modify_expr (&se->pre, resvar, build_int_cst (type, 0));
+ gfc_add_modify (&se->pre, resvar, build_int_cst (type, 0));
/* Walk the arguments. */
arrayss = gfc_walk_expr (actual->expr);
@@ -1813,7 +1815,7 @@ gfc_conv_intrinsic_count (gfc_se * se, gfc_expr * expr)
/* Initialize the loop. */
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr->where);
gfc_mark_ss_chain_used (arrayss, 1);
/* Generate the loop body. */
@@ -1874,7 +1876,7 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, int op)
else
tmp = gfc_build_const (type, integer_one_node);
- gfc_add_modify_expr (&se->pre, resvar, tmp);
+ gfc_add_modify (&se->pre, resvar, tmp);
/* Walk the arguments. */
actual = expr->value.function.actual;
@@ -1901,7 +1903,7 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, int op)
/* Initialize the loop. */
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr->where);
gfc_mark_ss_chain_used (arrayss, 1);
if (maskss)
@@ -1931,7 +1933,7 @@ gfc_conv_intrinsic_arith (gfc_se * se, gfc_expr * expr, int op)
gfc_add_block_to_block (&block, &arrayse.pre);
tmp = fold_build2 (op, type, resvar, arrayse.expr);
- gfc_add_modify_expr (&block, resvar, tmp);
+ gfc_add_modify (&block, resvar, tmp);
gfc_add_block_to_block (&block, &arrayse.post);
if (maskss)
@@ -1998,7 +2000,7 @@ gfc_conv_intrinsic_dot_product (gfc_se * se, gfc_expr * expr)
else
tmp = gfc_build_const (type, integer_zero_node);
- gfc_add_modify_expr (&se->pre, resvar, tmp);
+ gfc_add_modify (&se->pre, resvar, tmp);
/* Walk argument #1. */
actual = expr->value.function.actual;
@@ -2019,7 +2021,7 @@ gfc_conv_intrinsic_dot_product (gfc_se * se, gfc_expr * expr)
/* Initialize the loop. */
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr->where);
gfc_mark_ss_chain_used (arrayss1, 1);
gfc_mark_ss_chain_used (arrayss2, 1);
@@ -2055,7 +2057,7 @@ gfc_conv_intrinsic_dot_product (gfc_se * se, gfc_expr * expr)
tmp = fold_build2 (MULT_EXPR, type, arrayse1.expr, arrayse2.expr);
tmp = fold_build2 (PLUS_EXPR, type, resvar, tmp);
}
- gfc_add_modify_expr (&block, resvar, tmp);
+ gfc_add_modify (&block, resvar, tmp);
/* Finish up the loop block and the loop. */
tmp = gfc_finish_block (&block);
@@ -2145,7 +2147,7 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, int op)
possible value is HUGE in both cases. */
if (op == GT_EXPR)
tmp = fold_build1 (NEGATE_EXPR, TREE_TYPE (tmp), tmp);
- gfc_add_modify_expr (&se->pre, limit, tmp);
+ gfc_add_modify (&se->pre, limit, tmp);
if (op == GT_EXPR && expr->ts.type == BT_INTEGER)
tmp = fold_build2 (MINUS_EXPR, TREE_TYPE (tmp), tmp,
@@ -2159,14 +2161,14 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, int op)
/* Initialize the loop. */
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr->where);
gcc_assert (loop.dimen == 1);
/* Initialize the position to zero, following Fortran 2003. We are free
to do this because Fortran 95 allows the result of an entirely false
mask to be processor dependent. */
- gfc_add_modify_expr (&loop.pre, pos, gfc_index_zero_node);
+ gfc_add_modify (&loop.pre, pos, gfc_index_zero_node);
gfc_mark_ss_chain_used (arrayss, 1);
if (maskss)
@@ -2199,7 +2201,7 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, int op)
gfc_start_block (&ifblock);
/* Assign the value to the limit... */
- gfc_add_modify_expr (&ifblock, limit, arrayse.expr);
+ gfc_add_modify (&ifblock, limit, arrayse.expr);
/* Remember where we are. An offset must be added to the loop
counter to obtain the required position. */
@@ -2209,11 +2211,11 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, int op)
else
tmp = build_int_cst (gfc_array_index_type, 1);
- gfc_add_modify_expr (&block, offset, tmp);
+ gfc_add_modify (&block, offset, tmp);
tmp = fold_build2 (PLUS_EXPR, TREE_TYPE (pos),
loop.loopvar[0], offset);
- gfc_add_modify_expr (&ifblock, pos, tmp);
+ gfc_add_modify (&ifblock, pos, tmp);
ifbody = gfc_finish_block (&ifblock);
@@ -2257,7 +2259,7 @@ gfc_conv_intrinsic_minmaxloc (gfc_se * se, gfc_expr * expr, int op)
the pos variable the same way as above. */
gfc_init_block (&elseblock);
- gfc_add_modify_expr (&elseblock, pos, gfc_index_zero_node);
+ gfc_add_modify (&elseblock, pos, gfc_index_zero_node);
elsetmp = gfc_finish_block (&elseblock);
tmp = build3_v (COND_EXPR, maskse.expr, tmp, elsetmp);
@@ -2328,7 +2330,7 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, int op)
tmp = fold_build2 (MINUS_EXPR, TREE_TYPE (tmp),
tmp, build_int_cst (type, 1));
- gfc_add_modify_expr (&se->pre, limit, tmp);
+ gfc_add_modify (&se->pre, limit, tmp);
/* Walk the arguments. */
actual = expr->value.function.actual;
@@ -2355,7 +2357,7 @@ gfc_conv_intrinsic_minmaxval (gfc_se * se, gfc_expr * expr, int op)
/* Initialize the loop. */
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr->where);
gfc_mark_ss_chain_used (arrayss, 1);
if (maskss)
@@ -2651,6 +2653,64 @@ gfc_conv_intrinsic_ishftc (gfc_se * se, gfc_expr * expr)
se->expr = fold_build3 (COND_EXPR, type, tmp, args[0], rrot);
}
+
+/* Process an intrinsic with unspecified argument-types that has an optional
+ argument (which could be of type character), e.g. EOSHIFT. For those, we
+ need to append the string length of the optional argument if it is not
+ present and the type is really character.
+ primary specifies the position (starting at 1) of the non-optional argument
+ specifying the type and optional gives the position of the optional
+ argument in the arglist. */
+
+static void
+conv_generic_with_optional_char_arg (gfc_se* se, gfc_expr* expr,
+ unsigned primary, unsigned optional)
+{
+ gfc_actual_arglist* prim_arg;
+ gfc_actual_arglist* opt_arg;
+ unsigned cur_pos;
+ gfc_actual_arglist* arg;
+ gfc_symbol* sym;
+ tree append_args;
+
+ /* Find the two arguments given as position. */
+ cur_pos = 0;
+ prim_arg = NULL;
+ opt_arg = NULL;
+ for (arg = expr->value.function.actual; arg; arg = arg->next)
+ {
+ ++cur_pos;
+
+ if (cur_pos == primary)
+ prim_arg = arg;
+ if (cur_pos == optional)
+ opt_arg = arg;
+
+ if (cur_pos >= primary && cur_pos >= optional)
+ break;
+ }
+ gcc_assert (prim_arg);
+ gcc_assert (prim_arg->expr);
+ gcc_assert (opt_arg);
+
+ /* If we do have type CHARACTER and the optional argument is really absent,
+ append a dummy 0 as string length. */
+ append_args = NULL_TREE;
+ if (prim_arg->expr->ts.type == BT_CHARACTER && !opt_arg->expr)
+ {
+ tree dummy;
+
+ dummy = build_int_cst (gfc_charlen_type_node, 0);
+ append_args = gfc_chainon_list (append_args, dummy);
+ }
+
+ /* Build the call itself. */
+ sym = gfc_get_symbol_for_expr (expr);
+ gfc_conv_function_call (se, sym, expr->value.function.actual, append_args);
+ gfc_free (sym);
+}
+
+
/* The length of a character string. */
static void
gfc_conv_intrinsic_len (gfc_se * se, gfc_expr * expr)
@@ -3002,12 +3062,12 @@ gfc_conv_intrinsic_spacing (gfc_se * se, gfc_expr * expr)
gfc_add_expr_to_block (&block, tmp);
tmp = fold_build2 (MINUS_EXPR, integer_type_node, e, prec);
- gfc_add_modify_expr (&block, e, fold_build2 (MAX_EXPR, integer_type_node,
+ gfc_add_modify (&block, e, fold_build2 (MAX_EXPR, integer_type_node,
tmp, emin));
tmp = build_call_expr (built_in_decls[scalbn], 2,
build_real_from_int_cst (type, integer_one_node), e);
- gfc_add_modify_expr (&block, res, tmp);
+ gfc_add_modify (&block, res, tmp);
/* Finish by building the IF statement. */
cond = fold_build2 (EQ_EXPR, boolean_type_node, arg,
@@ -3070,7 +3130,7 @@ gfc_conv_intrinsic_rrspacing (gfc_se * se, gfc_expr * expr)
e = gfc_create_var (integer_type_node, NULL);
x = gfc_create_var (type, NULL);
- gfc_add_modify_expr (&se->pre, x,
+ gfc_add_modify (&se->pre, x,
build_call_expr (built_in_decls[fabs], 1, arg));
@@ -3082,7 +3142,7 @@ gfc_conv_intrinsic_rrspacing (gfc_se * se, gfc_expr * expr)
tmp = fold_build2 (MINUS_EXPR, integer_type_node,
build_int_cst (NULL_TREE, prec), e);
tmp = build_call_expr (built_in_decls[scalbn], 2, x, tmp);
- gfc_add_modify_expr (&block, x, tmp);
+ gfc_add_modify (&block, x, tmp);
stmt = gfc_finish_block (&block);
cond = fold_build2 (NE_EXPR, boolean_type_node, x,
@@ -3299,7 +3359,7 @@ gfc_conv_intrinsic_sizeof (gfc_se *se, gfc_expr *expr)
else
tmp = fold_convert (gfc_array_index_type,
size_in_bytes (type));
- gfc_add_modify_expr (&argse.pre, source_bytes, tmp);
+ gfc_add_modify (&argse.pre, source_bytes, tmp);
/* Obtain the size of the array in bytes. */
for (n = 0; n < arg->rank; n++)
@@ -3314,7 +3374,7 @@ gfc_conv_intrinsic_sizeof (gfc_se *se, gfc_expr *expr)
tmp, gfc_index_one_node);
tmp = fold_build2 (MULT_EXPR, gfc_array_index_type,
tmp, source_bytes);
- gfc_add_modify_expr (&argse.pre, source_bytes, tmp);
+ gfc_add_modify (&argse.pre, source_bytes, tmp);
}
se->expr = source_bytes;
}
@@ -3434,6 +3494,10 @@ gfc_conv_intrinsic_array_transfer (gfc_se * se, gfc_expr * expr)
&& arg->expr->ref->u.ar.type == AR_FULL))
{
tmp = build_fold_addr_expr (argse.expr);
+
+ if (gfc_option.warn_array_temp)
+ gfc_warning ("Creating array temporary at %L", &expr->where);
+
source = build_call_expr (gfor_fndecl_in_pack, 1, tmp);
source = gfc_evaluate_now (source, &argse.pre);
@@ -3468,13 +3532,13 @@ gfc_conv_intrinsic_array_transfer (gfc_se * se, gfc_expr * expr)
{
tree idx;
idx = gfc_rank_cst[n];
- gfc_add_modify_expr (&argse.pre, source_bytes, tmp);
+ gfc_add_modify (&argse.pre, source_bytes, tmp);
stride = gfc_conv_descriptor_stride (argse.expr, idx);
lower = gfc_conv_descriptor_lbound (argse.expr, idx);
upper = gfc_conv_descriptor_ubound (argse.expr, idx);
tmp = fold_build2 (MINUS_EXPR, gfc_array_index_type,
upper, lower);
- gfc_add_modify_expr (&argse.pre, extent, tmp);
+ gfc_add_modify (&argse.pre, extent, tmp);
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
extent, gfc_index_one_node);
tmp = fold_build2 (MULT_EXPR, gfc_array_index_type,
@@ -3482,7 +3546,7 @@ gfc_conv_intrinsic_array_transfer (gfc_se * se, gfc_expr * expr)
}
}
- gfc_add_modify_expr (&argse.pre, source_bytes, tmp);
+ gfc_add_modify (&argse.pre, source_bytes, tmp);
gfc_add_block_to_block (&se->pre, &argse.pre);
gfc_add_block_to_block (&se->post, &argse.post);
@@ -3517,7 +3581,7 @@ gfc_conv_intrinsic_array_transfer (gfc_se * se, gfc_expr * expr)
size_in_bytes (mold_type));
dest_word_len = gfc_create_var (gfc_array_index_type, NULL);
- gfc_add_modify_expr (&se->pre, dest_word_len, tmp);
+ gfc_add_modify (&se->pre, dest_word_len, tmp);
/* Finally convert SIZE, if it is present. */
arg = arg->next;
@@ -3546,8 +3610,8 @@ gfc_conv_intrinsic_array_transfer (gfc_se * se, gfc_expr * expr)
else
tmp = source_bytes;
- gfc_add_modify_expr (&se->pre, size_bytes, tmp);
- gfc_add_modify_expr (&se->pre, size_words,
+ gfc_add_modify (&se->pre, size_bytes, tmp);
+ gfc_add_modify (&se->pre, size_words,
fold_build2 (CEIL_DIV_EXPR, gfc_array_index_type,
size_bytes, dest_word_len));
@@ -3564,8 +3628,8 @@ gfc_conv_intrinsic_array_transfer (gfc_se * se, gfc_expr * expr)
tmp, gfc_index_one_node);
tmp = fold_build2 (MIN_EXPR, gfc_array_index_type,
tmp, size_words);
- gfc_add_modify_expr (&se->pre, size_words, tmp);
- gfc_add_modify_expr (&se->pre, size_bytes,
+ gfc_add_modify (&se->pre, size_words, tmp);
+ gfc_add_modify (&se->pre, size_bytes,
fold_build2 (MULT_EXPR, gfc_array_index_type,
size_words, dest_word_len));
upper = fold_build2 (PLUS_EXPR, gfc_array_index_type,
@@ -3587,7 +3651,8 @@ gfc_conv_intrinsic_array_transfer (gfc_se * se, gfc_expr * expr)
FIXME callee_alloc is not set! */
gfc_trans_create_temp_array (&se->pre, &se->post, se->loop,
- info, mold_type, false, true, false);
+ info, mold_type, false, true, false,
+ &expr->where);
/* Cast the pointer to the result. */
tmp = gfc_conv_descriptor_data_get (info->descriptor);
@@ -3627,7 +3692,7 @@ gfc_conv_intrinsic_transfer (gfc_se * se, gfc_expr * expr)
if (ss == gfc_ss_terminator)
gfc_conv_expr_reference (&argse, arg->expr);
else
- gfc_conv_array_parameter (&argse, arg->expr, ss, 1);
+ gfc_conv_array_parameter (&argse, arg->expr, ss, 1, NULL, NULL);
gfc_add_block_to_block (&se->pre, &argse.pre);
gfc_add_block_to_block (&se->post, &argse.post);
ptr = argse.expr;
@@ -3953,7 +4018,7 @@ gfc_conv_intrinsic_repeat (gfc_se * se, gfc_expr * expr)
/* Check that NCOPIES is not negative. */
cond = fold_build2 (LT_EXPR, boolean_type_node, ncopies,
build_int_cst (ncopies_type, 0));
- gfc_trans_runtime_check (cond, &se->pre, &expr->where,
+ gfc_trans_runtime_check (true, false, cond, &se->pre, &expr->where,
"Argument NCOPIES of REPEAT intrinsic is negative "
"(its value is %lld)",
fold_convert (long_integer_type_node, ncopies));
@@ -3965,7 +4030,7 @@ gfc_conv_intrinsic_repeat (gfc_se * se, gfc_expr * expr)
build_int_cst (size_type_node, 0));
tmp = fold_build3 (COND_EXPR, ncopies_type, cond,
build_int_cst (ncopies_type, 0), ncopies);
- gfc_add_modify_expr (&se->pre, n, tmp);
+ gfc_add_modify (&se->pre, n, tmp);
ncopies = n;
/* Check that ncopies is not too large: ncopies should be less than
@@ -3985,7 +4050,7 @@ gfc_conv_intrinsic_repeat (gfc_se * se, gfc_expr * expr)
build_int_cst (size_type_node, 0));
cond = fold_build3 (COND_EXPR, boolean_type_node, tmp, boolean_false_node,
cond);
- gfc_trans_runtime_check (cond, &se->pre, &expr->where,
+ gfc_trans_runtime_check (true, false, cond, &se->pre, &expr->where,
"Argument NCOPIES of REPEAT intrinsic is too large");
/* Compute the destination length. */
@@ -4000,7 +4065,7 @@ gfc_conv_intrinsic_repeat (gfc_se * se, gfc_expr * expr)
memmove (dest + (i * slen * size), src, slen*size); */
gfc_start_block (&block);
count = gfc_create_var (ncopies_type, "count");
- gfc_add_modify_expr (&block, count, build_int_cst (ncopies_type, 0));
+ gfc_add_modify (&block, count, build_int_cst (ncopies_type, 0));
exit_label = gfc_build_label_decl (NULL_TREE);
/* Start the loop body. */
@@ -4031,7 +4096,7 @@ gfc_conv_intrinsic_repeat (gfc_se * se, gfc_expr * expr)
/* Increment count. */
tmp = fold_build2 (PLUS_EXPR, ncopies_type,
count, build_int_cst (TREE_TYPE (count), 1));
- gfc_add_modify_expr (&body, count, tmp);
+ gfc_add_modify (&body, count, tmp);
/* Build the loop. */
tmp = build1_v (LOOP_EXPR, gfc_finish_block (&body));
@@ -4089,13 +4154,13 @@ gfc_conv_intrinsic_loc (gfc_se * se, gfc_expr * expr)
if (ss == gfc_ss_terminator)
gfc_conv_expr_reference (se, arg_expr);
else
- gfc_conv_array_parameter (se, arg_expr, ss, 1);
+ gfc_conv_array_parameter (se, arg_expr, ss, 1, NULL, NULL);
se->expr= convert (gfc_get_int_type (gfc_index_integer_kind), se->expr);
/* Create a temporary variable for loc return value. Without this,
we get an error an ICE in gcc/expr.c(expand_expr_addr_expr_1). */
temp_var = gfc_create_var (gfc_get_int_type (gfc_index_integer_kind), NULL);
- gfc_add_modify_expr (&se->pre, temp_var, se->expr);
+ gfc_add_modify (&se->pre, temp_var, se->expr);
se->expr = temp_var;
}
@@ -4122,7 +4187,22 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
{
if (lib == 1)
se->ignore_optional = 1;
- gfc_conv_intrinsic_funcall (se, expr);
+
+ switch (expr->value.function.isym->id)
+ {
+ case GFC_ISYM_EOSHIFT:
+ case GFC_ISYM_PACK:
+ case GFC_ISYM_RESHAPE:
+ /* For all of those the first argument specifies the type and the
+ third is optional. */
+ conv_generic_with_optional_char_arg (se, expr, 1, 3);
+ break;
+
+ default:
+ gfc_conv_intrinsic_funcall (se, expr);
+ break;
+ }
+
return;
}
}
@@ -4600,6 +4680,14 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr * expr)
gfc_conv_intrinsic_funcall (se, expr);
break;
+ case GFC_ISYM_EOSHIFT:
+ case GFC_ISYM_PACK:
+ case GFC_ISYM_RESHAPE:
+ /* For those, expr->rank should always be >0 and thus the if above the
+ switch should have matched. */
+ gcc_unreachable ();
+ break;
+
default:
gfc_conv_intrinsic_lib_function (se, expr);
break;
diff --git a/gcc/fortran/trans-io.c b/gcc/fortran/trans-io.c
index f210169abe0..2452939be7b 100644
--- a/gcc/fortran/trans-io.c
+++ b/gcc/fortran/trans-io.c
@@ -1,6 +1,6 @@
/* IO Code translation/library interface
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software
- Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ Free Software Foundation, Inc.
Contributed by Paul Brook
This file is part of GCC.
@@ -24,7 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "ggc.h"
#include "toplev.h"
#include "real.h"
@@ -450,7 +450,7 @@ set_parameter_const (stmtblock_t *block, tree var, enum iofield type,
var, TYPE_FIELDS (TREE_TYPE (var)), NULL_TREE);
tmp = fold_build3 (COMPONENT_REF, TREE_TYPE (p->field), var, p->field,
NULL_TREE);
- gfc_add_modify_expr (block, tmp, build_int_cst (TREE_TYPE (p->field), val));
+ gfc_add_modify (block, tmp, build_int_cst (TREE_TYPE (p->field), val));
return p->mask;
}
@@ -505,7 +505,7 @@ set_parameter_value (stmtblock_t *block, tree var, enum iofield type,
var, TYPE_FIELDS (TREE_TYPE (var)), NULL_TREE);
tmp = fold_build3 (COMPONENT_REF, dest_type, var, p->field, NULL_TREE);
- gfc_add_modify_expr (block, tmp, se.expr);
+ gfc_add_modify (block, tmp, se.expr);
return p->mask;
}
@@ -535,7 +535,7 @@ set_parameter_ref (stmtblock_t *block, stmtblock_t *postblock,
/* If this is for the iostat variable initialize the
user variable to LIBERROR_OK which is zero. */
if (type == IOPARM_common_iostat)
- gfc_add_modify_expr (block, se.expr,
+ gfc_add_modify (block, se.expr,
build_int_cst (TREE_TYPE (se.expr), LIBERROR_OK));
}
else
@@ -549,13 +549,13 @@ set_parameter_ref (stmtblock_t *block, stmtblock_t *postblock,
/* If this is for the iostat variable, initialize the
user variable to LIBERROR_OK which is zero. */
if (type == IOPARM_common_iostat)
- gfc_add_modify_expr (block, tmpvar,
+ gfc_add_modify (block, tmpvar,
build_int_cst (TREE_TYPE (tmpvar), LIBERROR_OK));
addr = build_fold_addr_expr (tmpvar);
/* After the I/O operation, we set the variable from the temporary. */
tmp = convert (TREE_TYPE (se.expr), tmpvar);
- gfc_add_modify_expr (postblock, se.expr, tmp);
+ gfc_add_modify (postblock, se.expr, tmp);
}
if (p->param_type == IOPARM_ptype_common)
@@ -563,7 +563,7 @@ set_parameter_ref (stmtblock_t *block, stmtblock_t *postblock,
var, TYPE_FIELDS (TREE_TYPE (var)), NULL_TREE);
tmp = fold_build3 (COMPONENT_REF, TREE_TYPE (p->field),
var, p->field, NULL_TREE);
- gfc_add_modify_expr (block, tmp, addr);
+ gfc_add_modify (block, tmp, addr);
return p->mask;
}
@@ -668,13 +668,13 @@ set_string (stmtblock_t * block, stmtblock_t * postblock, tree var,
asprintf(&msg, "Label assigned to variable '%s' (%%ld) is not a format "
"label", e->symtree->name);
- gfc_trans_runtime_check (cond, &se.pre, &e->where, msg,
+ gfc_trans_runtime_check (true, false, cond, &se.pre, &e->where, msg,
fold_convert (long_integer_type_node, tmp));
gfc_free (msg);
- gfc_add_modify_expr (&se.pre, io,
+ gfc_add_modify (&se.pre, io,
fold_convert (TREE_TYPE (io), GFC_DECL_ASSIGN_ADDR (se.expr)));
- gfc_add_modify_expr (&se.pre, len, GFC_DECL_STRING_LEN (se.expr));
+ gfc_add_modify (&se.pre, len, GFC_DECL_STRING_LEN (se.expr));
}
else
{
@@ -688,8 +688,8 @@ set_string (stmtblock_t * block, stmtblock_t * postblock, tree var,
gcc_unreachable ();
gfc_conv_string_parameter (&se);
- gfc_add_modify_expr (&se.pre, io, fold_convert (TREE_TYPE (io), se.expr));
- gfc_add_modify_expr (&se.pre, len, se.string_length);
+ gfc_add_modify (&se.pre, io, fold_convert (TREE_TYPE (io), se.expr));
+ gfc_add_modify (&se.pre, len, se.string_length);
}
gfc_add_block_to_block (block, &se.pre);
@@ -764,10 +764,10 @@ set_internal_unit (stmtblock_t * block, stmtblock_t * post_block,
/* The cast is needed for character substrings and the descriptor
data. */
- gfc_add_modify_expr (&se.pre, io, fold_convert (TREE_TYPE (io), tmp));
- gfc_add_modify_expr (&se.pre, len,
+ gfc_add_modify (&se.pre, io, fold_convert (TREE_TYPE (io), tmp));
+ gfc_add_modify (&se.pre, len,
fold_convert (TREE_TYPE (len), se.string_length));
- gfc_add_modify_expr (&se.pre, desc, se.expr);
+ gfc_add_modify (&se.pre, desc, se.expr);
gfc_add_block_to_block (block, &se.pre);
gfc_add_block_to_block (post_block, &se.post);
@@ -865,7 +865,7 @@ set_error_locus (stmtblock_t * block, tree var, locus * where)
str = gfc_build_cstring_const (f->filename);
str = gfc_build_addr_expr (pchar_type_node, str);
- gfc_add_modify_expr (block, locus_file, str);
+ gfc_add_modify (block, locus_file, str);
line = LOCATION_LINE (where->lb->location);
set_parameter_const (block, var, IOPARM_common_line, line);
@@ -1900,7 +1900,7 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr, gfc_code * code);
recursive. */
static tree
-transfer_array_component (tree expr, gfc_component * cm)
+transfer_array_component (tree expr, gfc_component * cm, locus * where)
{
tree tmp;
stmtblock_t body;
@@ -1944,7 +1944,7 @@ transfer_array_component (tree expr, gfc_component * cm)
gfc_init_loopinfo (&loop);
gfc_add_ss_to_loop (&loop, ss);
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, where);
gfc_mark_ss_chain_used (ss, 1);
gfc_start_scalarized_body (&loop, &body);
@@ -2087,14 +2087,14 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr, gfc_code * code)
tmp = fold_build3 (COMPONENT_REF, TREE_TYPE (field),
expr, field, NULL_TREE);
- if (c->dimension)
+ if (c->attr.dimension)
{
- tmp = transfer_array_component (tmp, c);
+ tmp = transfer_array_component (tmp, c, & code->loc);
gfc_add_expr_to_block (&se->pre, tmp);
}
else
{
- if (!c->pointer)
+ if (!c->attr.pointer)
tmp = build_fold_addr_expr (tmp);
transfer_expr (se, &c->ts, tmp, code);
}
@@ -2213,7 +2213,7 @@ gfc_trans_transfer (gfc_code * code)
/* Initialize the loop. */
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &code->expr->where);
/* The main loop body. */
gfc_mark_ss_chain_used (ss, 1);
diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c
index 06329a98554..11a1f40dfac 100644
--- a/gcc/fortran/trans-openmp.c
+++ b/gcc/fortran/trans-openmp.c
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "ggc.h"
#include "toplev.h"
#include "real.h"
@@ -147,7 +147,7 @@ gfc_omp_clause_default_ctor (tree clause, tree decl, tree outer)
gfc_init_block (&cond_block);
- gfc_add_modify_expr (&cond_block, decl, outer);
+ gfc_add_modify (&cond_block, decl, outer);
rank = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (type) - 1];
size = gfc_conv_descriptor_ubound (decl, rank);
size = fold_build2 (MINUS_EXPR, gfc_array_index_type, size,
@@ -164,11 +164,11 @@ gfc_omp_clause_default_ctor (tree clause, tree decl, tree outer)
ptr = gfc_allocate_array_with_status (&cond_block,
build_int_cst (pvoid_type_node, 0),
size, NULL);
- gfc_conv_descriptor_data_set_tuples (&cond_block, decl, ptr);
+ gfc_conv_descriptor_data_set (&cond_block, decl, ptr);
then_b = gfc_finish_block (&cond_block);
gfc_init_block (&cond_block);
- gfc_conv_descriptor_data_set_tuples (&cond_block, decl, null_pointer_node);
+ gfc_conv_descriptor_data_set (&cond_block, decl, null_pointer_node);
else_b = gfc_finish_block (&cond_block);
cond = fold_build2 (NE_EXPR, boolean_type_node,
@@ -191,7 +191,7 @@ gfc_omp_clause_copy_ctor (tree clause, tree dest, tree src)
if (! GFC_DESCRIPTOR_TYPE_P (type)
|| GFC_TYPE_ARRAY_AKIND (type) != GFC_ARRAY_ALLOCATABLE)
- return build_gimple_modify_stmt (dest, src);
+ return build2_v (MODIFY_EXPR, dest, src);
gcc_assert (OMP_CLAUSE_CODE (clause) == OMP_CLAUSE_FIRSTPRIVATE);
@@ -199,7 +199,7 @@ gfc_omp_clause_copy_ctor (tree clause, tree dest, tree src)
and copied from SRC. */
gfc_start_block (&block);
- gfc_add_modify_expr (&block, dest, src);
+ gfc_add_modify (&block, dest, src);
rank = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (type) - 1];
size = gfc_conv_descriptor_ubound (dest, rank);
size = fold_build2 (MINUS_EXPR, gfc_array_index_type, size,
@@ -216,7 +216,7 @@ gfc_omp_clause_copy_ctor (tree clause, tree dest, tree src)
ptr = gfc_allocate_array_with_status (&block,
build_int_cst (pvoid_type_node, 0),
size, NULL);
- gfc_conv_descriptor_data_set_tuples (&block, dest, ptr);
+ gfc_conv_descriptor_data_set (&block, dest, ptr);
call = build_call_expr (built_in_decls[BUILT_IN_MEMCPY], 3, ptr,
fold_convert (pvoid_type_node,
gfc_conv_descriptor_data_get (src)),
@@ -236,7 +236,7 @@ gfc_omp_clause_assign_op (tree clause ATTRIBUTE_UNUSED, tree dest, tree src)
if (! GFC_DESCRIPTOR_TYPE_P (type)
|| GFC_TYPE_ARRAY_AKIND (type) != GFC_ARRAY_ALLOCATABLE)
- return build_gimple_modify_stmt (dest, src);
+ return build2_v (MODIFY_EXPR, dest, src);
/* Handle copying allocatable arrays. */
gfc_start_block (&block);
@@ -454,7 +454,7 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where)
tree decl, backend_decl, stmt;
locus old_loc = gfc_current_locus;
const char *iname;
- try t;
+ gfc_try t;
decl = OMP_CLAUSE_DECL (c);
gfc_current_locus = where;
@@ -498,6 +498,7 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where)
e1->symtree = symtree1;
e1->ts = sym->ts;
e1->ref = ref = gfc_get_ref ();
+ ref->type = REF_ARRAY;
ref->u.ar.where = where;
ref->u.ar.as = sym->as;
ref->u.ar.type = AR_FULL;
@@ -602,7 +603,7 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where)
gfc_start_block (&block);
- gfc_add_modify_expr (&block, decl, outer_sym.backend_decl);
+ gfc_add_modify (&block, decl, outer_sym.backend_decl);
rank = gfc_rank_cst[GFC_TYPE_ARRAY_RANK (type) - 1];
size = gfc_conv_descriptor_ubound (decl, rank);
size = fold_build2 (MINUS_EXPR, gfc_array_index_type, size,
@@ -619,7 +620,7 @@ gfc_trans_omp_array_reduction (tree c, gfc_symbol *sym, locus where)
ptr = gfc_allocate_array_with_status (&block,
build_int_cst (pvoid_type_node, 0),
size, NULL);
- gfc_conv_descriptor_data_set_tuples (&block, decl, ptr);
+ gfc_conv_descriptor_data_set (&block, decl, ptr);
gfc_add_expr_to_block (&block, gfc_trans_assignment (e1, e2, false));
stmt = gfc_finish_block (&block);
}
@@ -1062,7 +1063,7 @@ gfc_trans_omp_atomic (gfc_code *code)
tree accum = gfc_create_var (TREE_TYPE (rse.expr), NULL);
gfc_actual_arglist *arg;
- gfc_add_modify_stmt (&block, accum, rse.expr);
+ gfc_add_modify (&block, accum, rse.expr);
for (arg = expr2->value.function.actual->next->next; arg;
arg = arg->next)
{
@@ -1070,7 +1071,7 @@ gfc_trans_omp_atomic (gfc_code *code)
gfc_conv_expr (&rse, arg->expr);
gfc_add_block_to_block (&block, &rse.pre);
x = fold_build2 (op, TREE_TYPE (accum), accum, rse.expr);
- gfc_add_modify_stmt (&block, accum, x);
+ gfc_add_modify (&block, accum, x);
}
rse.expr = accum;
@@ -1204,11 +1205,11 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock,
/* Loop body. */
if (simple)
{
- TREE_VEC_ELT (init, i) = build2_v (GIMPLE_MODIFY_STMT, dovar, from);
+ TREE_VEC_ELT (init, i) = build2_v (MODIFY_EXPR, dovar, from);
TREE_VEC_ELT (cond, i) = fold_build2 (simple > 0 ? LE_EXPR : GE_EXPR,
boolean_type_node, dovar, to);
TREE_VEC_ELT (incr, i) = fold_build2 (PLUS_EXPR, type, dovar, step);
- TREE_VEC_ELT (incr, i) = fold_build2 (GIMPLE_MODIFY_STMT, type, dovar,
+ TREE_VEC_ELT (incr, i) = fold_build2 (MODIFY_EXPR, type, dovar,
TREE_VEC_ELT (incr, i));
}
else
@@ -1225,13 +1226,13 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock,
tmp = fold_build2 (TRUNC_DIV_EXPR, type, tmp, step);
tmp = gfc_evaluate_now (tmp, pblock);
count = gfc_create_var (type, "count");
- TREE_VEC_ELT (init, i) = build2_v (GIMPLE_MODIFY_STMT, count,
+ TREE_VEC_ELT (init, i) = build2_v (MODIFY_EXPR, count,
build_int_cst (type, 0));
TREE_VEC_ELT (cond, i) = fold_build2 (LT_EXPR, boolean_type_node,
count, tmp);
TREE_VEC_ELT (incr, i) = fold_build2 (PLUS_EXPR, type, count,
build_int_cst (type, 1));
- TREE_VEC_ELT (incr, i) = fold_build2 (GIMPLE_MODIFY_STMT, type,
+ TREE_VEC_ELT (incr, i) = fold_build2 (MODIFY_EXPR, type,
count, TREE_VEC_ELT (incr, i));
/* Initialize DOVAR. */
@@ -1260,7 +1261,7 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock,
than value after iterator increment. */
tmp = gfc_evaluate_now (step, pblock);
tmp = fold_build2 (PLUS_EXPR, type, dovar, tmp);
- tmp = fold_build2 (GIMPLE_MODIFY_STMT, type, dovar, tmp);
+ tmp = fold_build2 (MODIFY_EXPR, type, dovar, tmp);
for (c = omp_clauses; c ; c = OMP_CLAUSE_CHAIN (c))
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE
&& OMP_CLAUSE_DECL (c) == dovar)
@@ -1308,7 +1309,7 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock,
dovar_init = nreverse (dovar_init);
while (dovar_init)
{
- gfc_add_modify_stmt (&body, TREE_PURPOSE (dovar_init),
+ gfc_add_modify (&body, TREE_PURPOSE (dovar_init),
TREE_VALUE (dovar_init));
dovar_init = TREE_CHAIN (dovar_init);
}
@@ -1381,7 +1382,7 @@ gfc_trans_omp_parallel (gfc_code *code)
omp_clauses = gfc_trans_omp_clauses (&block, code->ext.omp_clauses,
code->loc);
stmt = gfc_trans_omp_code (code->block->next, true);
- stmt = build4_v (OMP_PARALLEL, stmt, omp_clauses, NULL, NULL);
+ stmt = build2 (OMP_PARALLEL, void_type_node, stmt, omp_clauses);
gfc_add_expr_to_block (&block, stmt);
return gfc_finish_block (&block);
}
@@ -1421,7 +1422,7 @@ gfc_trans_omp_parallel_do (gfc_code *code)
stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0, 0));
else
poplevel (0, 0, 0);
- stmt = build4_v (OMP_PARALLEL, stmt, omp_clauses, NULL, NULL);
+ stmt = build2 (OMP_PARALLEL, void_type_node, stmt, omp_clauses);
OMP_PARALLEL_COMBINED (stmt) = 1;
gfc_add_expr_to_block (&block, stmt);
return gfc_finish_block (&block);
@@ -1446,7 +1447,7 @@ gfc_trans_omp_parallel_sections (gfc_code *code)
stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0, 0));
else
poplevel (0, 0, 0);
- stmt = build4_v (OMP_PARALLEL, stmt, omp_clauses, NULL, NULL);
+ stmt = build2 (OMP_PARALLEL, void_type_node, stmt, omp_clauses);
OMP_PARALLEL_COMBINED (stmt) = 1;
gfc_add_expr_to_block (&block, stmt);
return gfc_finish_block (&block);
@@ -1471,7 +1472,7 @@ gfc_trans_omp_parallel_workshare (gfc_code *code)
stmt = build3_v (BIND_EXPR, NULL, stmt, poplevel (1, 0, 0));
else
poplevel (0, 0, 0);
- stmt = build4_v (OMP_PARALLEL, stmt, omp_clauses, NULL, NULL);
+ stmt = build2 (OMP_PARALLEL, void_type_node, stmt, omp_clauses);
OMP_PARALLEL_COMBINED (stmt) = 1;
gfc_add_expr_to_block (&block, stmt);
return gfc_finish_block (&block);
@@ -1503,7 +1504,7 @@ gfc_trans_omp_sections (gfc_code *code, gfc_omp_clauses *clauses)
}
stmt = gfc_finish_block (&body);
- stmt = build3_v (OMP_SECTIONS, stmt, omp_clauses, NULL_TREE);
+ stmt = build2 (OMP_SECTIONS, void_type_node, stmt, omp_clauses);
gfc_add_expr_to_block (&block, stmt);
return gfc_finish_block (&block);
@@ -1522,16 +1523,13 @@ static tree
gfc_trans_omp_task (gfc_code *code)
{
stmtblock_t block;
- tree stmt, body_stmt, omp_clauses;
+ tree stmt, omp_clauses;
gfc_start_block (&block);
omp_clauses = gfc_trans_omp_clauses (&block, code->ext.omp_clauses,
code->loc);
- body_stmt = gfc_trans_omp_code (code->block->next, true);
- stmt = make_node (OMP_TASK);
- TREE_TYPE (stmt) = void_type_node;
- OMP_TASK_CLAUSES (stmt) = omp_clauses;
- OMP_TASK_BODY (stmt) = body_stmt;
+ stmt = gfc_trans_omp_code (code->block->next, true);
+ stmt = build2 (OMP_TASK, void_type_node, stmt, omp_clauses);
gfc_add_expr_to_block (&block, stmt);
return gfc_finish_block (&block);
}
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c
index 6afac5d3734..11882d793d9 100644
--- a/gcc/fortran/trans-stmt.c
+++ b/gcc/fortran/trans-stmt.c
@@ -25,7 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "ggc.h"
#include "toplev.h"
#include "real.h"
@@ -127,8 +127,8 @@ gfc_trans_label_assign (gfc_code * code)
label_tree = gfc_build_addr_expr (pvoid_type_node, label_tree);
}
- gfc_add_modify_expr (&se.pre, len, len_tree);
- gfc_add_modify_expr (&se.pre, addr, label_tree);
+ gfc_add_modify (&se.pre, len, len_tree);
+ gfc_add_modify (&se.pre, addr, label_tree);
return gfc_finish_block (&se.pre);
}
@@ -154,7 +154,7 @@ gfc_trans_goto (gfc_code * code)
tmp = GFC_DECL_STRING_LEN (se.expr);
tmp = fold_build2 (NE_EXPR, boolean_type_node, tmp,
build_int_cst (TREE_TYPE (tmp), -1));
- gfc_trans_runtime_check (tmp, &se.pre, &loc,
+ gfc_trans_runtime_check (true, false, tmp, &se.pre, &loc,
"Assigned label is not a target label");
assigned_goto = GFC_DECL_ASSIGN_ADDR (se.expr);
@@ -180,7 +180,7 @@ gfc_trans_goto (gfc_code * code)
code = code->block;
}
while (code != NULL);
- gfc_trans_runtime_check (boolean_true_node, &se.pre, &loc,
+ gfc_trans_runtime_check (true, false, boolean_true_node, &se.pre, &loc,
"Assigned label is not in the list");
return gfc_finish_block (&se.pre);
@@ -269,10 +269,11 @@ gfc_conv_elemental_dependencies (gfc_se * se, gfc_se * loopse,
tmp = gfc_typenode_for_spec (&e->ts);
tmp = gfc_trans_create_temp_array (&se->pre, &se->post,
&tmp_loop, info, tmp,
- false, true, false);
- gfc_add_modify_expr (&se->pre, size, tmp);
+ false, true, false,
+ & arg->expr->where);
+ gfc_add_modify (&se->pre, size, tmp);
tmp = fold_convert (pvoid_type_node, info->data);
- gfc_add_modify_expr (&se->pre, data, tmp);
+ gfc_add_modify (&se->pre, data, tmp);
gfc_merge_block_scope (&block);
/* Obtain the argument descriptor for unpacking. */
@@ -293,7 +294,7 @@ gfc_conv_elemental_dependencies (gfc_se * se, gfc_se * loopse,
offset, tmp);
}
info->offset = gfc_create_var (gfc_array_index_type, NULL);
- gfc_add_modify_expr (&se->pre, info->offset, offset);
+ gfc_add_modify (&se->pre, info->offset, offset);
/* Copy the result back using unpack. */
tmp = build_call_expr (gfor_fndecl_in_unpack, 2, parmse.expr, data);
@@ -348,7 +349,7 @@ gfc_trans_call (gfc_code * code, bool dependency_check)
se.expr = convert (gfc_typenode_for_spec (&sym->ts), se.expr);
if (sym->backend_decl == NULL)
sym->backend_decl = gfc_get_symbol_decl (sym);
- gfc_add_modify_expr (&se.pre, sym->backend_decl, se.expr);
+ gfc_add_modify (&se.pre, sym->backend_decl, se.expr);
}
else
gfc_add_expr_to_block (&se.pre, se.expr);
@@ -375,7 +376,7 @@ gfc_trans_call (gfc_code * code, bool dependency_check)
gfc_add_ss_to_loop (&loop, ss);
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &code->expr->where);
gfc_mark_ss_chain_used (ss, 1);
/* Convert the arguments, checking for dependencies. */
@@ -733,7 +734,7 @@ gfc_trans_simple_do (gfc_code * code, stmtblock_t *pblock, tree dovar,
type = TREE_TYPE (dovar);
/* Initialize the DO variable: dovar = from. */
- gfc_add_modify_expr (pblock, dovar, from);
+ gfc_add_modify (pblock, dovar, from);
/* Cycle and exit statements are implemented with gotos. */
cycle_label = gfc_build_label_decl (NULL_TREE);
@@ -762,7 +763,7 @@ gfc_trans_simple_do (gfc_code * code, stmtblock_t *pblock, tree dovar,
/* Increment the loop variable. */
tmp = fold_build2 (PLUS_EXPR, type, dovar, step);
- gfc_add_modify_expr (&body, dovar, tmp);
+ gfc_add_modify (&body, dovar, tmp);
/* The loop exit. */
tmp = build1_v (GOTO_EXPR, exit_label);
@@ -910,7 +911,7 @@ gfc_trans_do (gfc_code * code)
tmp = fold_build1 (FIX_TRUNC_EXPR, utype, tmp);
}
countm1 = gfc_create_var (utype, "countm1");
- gfc_add_modify_expr (&block, countm1, tmp);
+ gfc_add_modify (&block, countm1, tmp);
/* Cycle and exit statements are implemented with gotos. */
cycle_label = gfc_build_label_decl (NULL_TREE);
@@ -918,7 +919,7 @@ gfc_trans_do (gfc_code * code)
TREE_USED (exit_label) = 1;
/* Initialize the DO variable: dovar = from. */
- gfc_add_modify_expr (&block, dovar, from);
+ gfc_add_modify (&block, dovar, from);
/* If the loop is empty, go directly to the exit label. */
tmp = fold_build3 (COND_EXPR, void_type_node, empty,
@@ -948,7 +949,7 @@ gfc_trans_do (gfc_code * code)
/* Increment the loop variable. */
tmp = fold_build2 (PLUS_EXPR, type, dovar, step);
- gfc_add_modify_expr (&body, dovar, tmp);
+ gfc_add_modify (&body, dovar, tmp);
/* End with the loop condition. Loop until countm1 == 0. */
cond = fold_build2 (EQ_EXPR, boolean_type_node, countm1,
@@ -960,7 +961,7 @@ gfc_trans_do (gfc_code * code)
/* Decrement the loop count. */
tmp = fold_build2 (MINUS_EXPR, utype, countm1, build_int_cst (utype, 1));
- gfc_add_modify_expr (&body, countm1, tmp);
+ gfc_add_modify (&body, countm1, tmp);
/* End of loop body. */
tmp = gfc_finish_block (&body);
@@ -1478,7 +1479,7 @@ gfc_trans_character_select (gfc_code *code)
tmp = build_call_expr (fndecl, 4, init, build_int_cst (NULL_TREE, n),
se.expr, se.string_length);
case_num = gfc_create_var (integer_type_node, "case_num");
- gfc_add_modify_expr (&block, case_num, tmp);
+ gfc_add_modify (&block, case_num, tmp);
gfc_add_block_to_block (&block, &se.post);
@@ -1608,7 +1609,7 @@ forall_make_variable_temp (gfc_code *c, stmtblock_t *pre, stmtblock_t *post)
{
/* Use the variable offset for the temporary. */
tmp = gfc_conv_descriptor_offset (tse.expr);
- gfc_add_modify_expr (pre, tmp,
+ gfc_add_modify (pre, tmp,
gfc_conv_array_offset (old_sym->backend_decl));
}
}
@@ -1764,7 +1765,7 @@ gfc_trans_forall_loop (forall_info *forall_tmp, tree body,
/* Initialize the mask index outside the FORALL nest. */
if (mask_flag && forall_tmp->mask)
- gfc_add_modify_expr (outer, forall_tmp->maskindex, gfc_index_zero_node);
+ gfc_add_modify (outer, forall_tmp->maskindex, gfc_index_zero_node);
iter = forall_tmp->this_loop;
nvar = forall_tmp->nvar;
@@ -1797,7 +1798,7 @@ gfc_trans_forall_loop (forall_info *forall_tmp, tree body,
/* Increment the loop variable. */
tmp = fold_build2 (PLUS_EXPR, TREE_TYPE (var), var, step);
- gfc_add_modify_expr (&block, var, tmp);
+ gfc_add_modify (&block, var, tmp);
/* Advance to the next mask element. Only do this for the
innermost loop. */
@@ -1806,26 +1807,26 @@ gfc_trans_forall_loop (forall_info *forall_tmp, tree body,
tree maskindex = forall_tmp->maskindex;
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
maskindex, gfc_index_one_node);
- gfc_add_modify_expr (&block, maskindex, tmp);
+ gfc_add_modify (&block, maskindex, tmp);
}
/* Decrement the loop counter. */
tmp = fold_build2 (MINUS_EXPR, TREE_TYPE (var), count,
build_int_cst (TREE_TYPE (var), 1));
- gfc_add_modify_expr (&block, count, tmp);
+ gfc_add_modify (&block, count, tmp);
body = gfc_finish_block (&block);
/* Loop var initialization. */
gfc_init_block (&block);
- gfc_add_modify_expr (&block, var, start);
+ gfc_add_modify (&block, var, start);
/* Initialize the loop counter. */
tmp = fold_build2 (MINUS_EXPR, TREE_TYPE (var), step, start);
tmp = fold_build2 (PLUS_EXPR, TREE_TYPE (var), end, tmp);
tmp = fold_build2 (TRUNC_DIV_EXPR, TREE_TYPE (var), tmp, step);
- gfc_add_modify_expr (&block, count, tmp);
+ gfc_add_modify (&block, count, tmp);
/* The loop expression. */
tmp = build1_v (LOOP_EXPR, body);
@@ -1917,7 +1918,7 @@ gfc_do_allocate (tree bytesize, tree size, tree * pdata, stmtblock_t * pblock,
*pdata = convert (pvoid_type_node, tmpvar);
tmp = gfc_call_malloc (pblock, TREE_TYPE (tmpvar), bytesize);
- gfc_add_modify_expr (pblock, tmpvar, tmp);
+ gfc_add_modify (pblock, tmpvar, tmp);
}
return tmpvar;
}
@@ -1953,13 +1954,13 @@ generate_loop_for_temp_to_lhs (gfc_expr *expr, tree tmp1, tree count3,
/* Use the scalar assignment as is. */
gfc_add_block_to_block (&block, &lse.pre);
- gfc_add_modify_expr (&block, lse.expr, tmp);
+ gfc_add_modify (&block, lse.expr, tmp);
gfc_add_block_to_block (&block, &lse.post);
/* Increment the count1. */
tmp = fold_build2 (PLUS_EXPR, TREE_TYPE (count1), count1,
gfc_index_one_node);
- gfc_add_modify_expr (&block, count1, tmp);
+ gfc_add_modify (&block, count1, tmp);
tmp = gfc_finish_block (&block);
}
@@ -1977,7 +1978,7 @@ generate_loop_for_temp_to_lhs (gfc_expr *expr, tree tmp1, tree count3,
/* Calculate the bounds of the scalarization. */
gfc_conv_ss_startstride (&loop1);
/* Setup the scalarizing loops. */
- gfc_conv_loop_setup (&loop1);
+ gfc_conv_loop_setup (&loop1, &expr->where);
gfc_mark_ss_chain_used (lss, 1);
@@ -2015,14 +2016,14 @@ generate_loop_for_temp_to_lhs (gfc_expr *expr, tree tmp1, tree count3,
/* Increment count1. */
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
count1, gfc_index_one_node);
- gfc_add_modify_expr (&body, count1, tmp);
+ gfc_add_modify (&body, count1, tmp);
/* Increment count3. */
if (count3)
{
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
count3, gfc_index_one_node);
- gfc_add_modify_expr (&body, count3, tmp);
+ gfc_add_modify (&body, count3, tmp);
}
/* Generate the copying loops. */
@@ -2075,7 +2076,7 @@ generate_loop_for_rhs_to_temp (gfc_expr *expr2, tree tmp1, tree count3,
gfc_add_ss_to_loop (&loop, rss);
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr2->where);
gfc_mark_ss_chain_used (rss, 1);
/* Start the loop body. */
@@ -2116,21 +2117,21 @@ generate_loop_for_rhs_to_temp (gfc_expr *expr2, tree tmp1, tree count3,
/* Increment count1. */
tmp = fold_build2 (PLUS_EXPR, TREE_TYPE (count1), count1,
gfc_index_one_node);
- gfc_add_modify_expr (&block, count1, tmp);
+ gfc_add_modify (&block, count1, tmp);
}
else
{
/* Increment count1. */
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
count1, gfc_index_one_node);
- gfc_add_modify_expr (&body1, count1, tmp);
+ gfc_add_modify (&body1, count1, tmp);
/* Increment count3. */
if (count3)
{
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
count3, gfc_index_one_node);
- gfc_add_modify_expr (&body1, count3, tmp);
+ gfc_add_modify (&body1, count3, tmp);
}
/* Generate the copying loops. */
@@ -2197,7 +2198,7 @@ compute_inner_temp_size (gfc_expr *expr1, gfc_expr *expr2,
flag_bounds_check = 0;
gfc_conv_ss_startstride (&loop);
flag_bounds_check = save_flag;
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr2->where);
/* Figure out how many elements we need. */
for (i = 0; i < loop.dimen; i++)
@@ -2256,7 +2257,7 @@ compute_overall_iter_number (forall_info *nested_forall_info, tree inner_size,
/* Otherwise, create a temporary variable to compute the result. */
number = gfc_create_var (gfc_array_index_type, "num");
- gfc_add_modify_expr (block, number, gfc_index_zero_node);
+ gfc_add_modify (block, number, gfc_index_zero_node);
gfc_start_block (&body);
if (inner_size_body)
@@ -2266,7 +2267,7 @@ compute_overall_iter_number (forall_info *nested_forall_info, tree inner_size,
number, inner_size);
else
tmp = inner_size;
- gfc_add_modify_expr (&body, number, tmp);
+ gfc_add_modify (&body, number, tmp);
tmp = gfc_finish_block (&body);
/* Generate loops. */
@@ -2377,13 +2378,13 @@ gfc_trans_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2,
if (wheremask)
{
count = gfc_create_var (gfc_array_index_type, "count");
- gfc_add_modify_expr (block, count, gfc_index_zero_node);
+ gfc_add_modify (block, count, gfc_index_zero_node);
}
else
count = NULL;
/* Initialize count1. */
- gfc_add_modify_expr (block, count1, gfc_index_zero_node);
+ gfc_add_modify (block, count1, gfc_index_zero_node);
/* Calculate the size of temporary needed in the assignment. Return loop, lss
and rss which are used in function generate_loop_for_rhs_to_temp(). */
@@ -2422,11 +2423,11 @@ gfc_trans_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2,
gfc_add_expr_to_block (block, tmp);
/* Reset count1. */
- gfc_add_modify_expr (block, count1, gfc_index_zero_node);
+ gfc_add_modify (block, count1, gfc_index_zero_node);
/* Reset count. */
if (wheremask)
- gfc_add_modify_expr (block, count, gfc_index_zero_node);
+ gfc_add_modify (block, count, gfc_index_zero_node);
/* Generate codes to copy the temporary to lhs. */
tmp = generate_loop_for_temp_to_lhs (expr1, tmp1, count, count1,
@@ -2468,7 +2469,7 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2,
tree tmp, tmp1, ptemp1;
count = gfc_create_var (gfc_array_index_type, "count");
- gfc_add_modify_expr (block, count, gfc_index_zero_node);
+ gfc_add_modify (block, count, gfc_index_zero_node);
inner_size = integer_one_node;
lss = gfc_walk_expr (expr1);
@@ -2489,14 +2490,14 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2,
rse.want_pointer = 1;
gfc_conv_expr (&rse, expr2);
gfc_add_block_to_block (&body, &rse.pre);
- gfc_add_modify_expr (&body, lse.expr,
+ gfc_add_modify (&body, lse.expr,
fold_convert (TREE_TYPE (lse.expr), rse.expr));
gfc_add_block_to_block (&body, &rse.post);
/* Increment count. */
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
count, gfc_index_one_node);
- gfc_add_modify_expr (&body, count, tmp);
+ gfc_add_modify (&body, count, tmp);
tmp = gfc_finish_block (&body);
@@ -2506,7 +2507,7 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2,
gfc_add_expr_to_block (block, tmp);
/* Reset count. */
- gfc_add_modify_expr (block, count, gfc_index_zero_node);
+ gfc_add_modify (block, count, gfc_index_zero_node);
gfc_start_block (&body);
gfc_init_se (&lse, NULL);
@@ -2515,12 +2516,12 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2,
lse.want_pointer = 1;
gfc_conv_expr (&lse, expr1);
gfc_add_block_to_block (&body, &lse.pre);
- gfc_add_modify_expr (&body, lse.expr, rse.expr);
+ gfc_add_modify (&body, lse.expr, rse.expr);
gfc_add_block_to_block (&body, &lse.post);
/* Increment count. */
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
count, gfc_index_one_node);
- gfc_add_modify_expr (&body, count, tmp);
+ gfc_add_modify (&body, count, tmp);
tmp = gfc_finish_block (&body);
/* Generate body and loops according to the information in
@@ -2538,7 +2539,7 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2,
/* Setup the scalarizing loops and bounds. */
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr2->where);
info = &rss->data.info;
desc = info->descriptor;
@@ -2565,7 +2566,7 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2,
/* Increment count. */
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
count, gfc_index_one_node);
- gfc_add_modify_expr (&body, count, tmp);
+ gfc_add_modify (&body, count, tmp);
tmp = gfc_finish_block (&body);
@@ -2575,13 +2576,13 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2,
gfc_add_expr_to_block (block, tmp);
/* Reset count. */
- gfc_add_modify_expr (block, count, gfc_index_zero_node);
+ gfc_add_modify (block, count, gfc_index_zero_node);
parm = gfc_build_array_ref (tmp1, count, NULL);
lss = gfc_walk_expr (expr1);
gfc_init_se (&lse, NULL);
gfc_conv_expr_descriptor (&lse, expr1, lss);
- gfc_add_modify_expr (&lse.pre, lse.expr, parm);
+ gfc_add_modify (&lse.pre, lse.expr, parm);
gfc_start_block (&body);
gfc_add_block_to_block (&body, &lse.pre);
gfc_add_block_to_block (&body, &lse.post);
@@ -2589,7 +2590,7 @@ gfc_trans_pointer_assign_need_temp (gfc_expr * expr1, gfc_expr * expr2,
/* Increment count. */
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
count, gfc_index_one_node);
- gfc_add_modify_expr (&body, count, tmp);
+ gfc_add_modify (&body, count, tmp);
tmp = gfc_finish_block (&body);
@@ -2821,7 +2822,7 @@ gfc_trans_forall_1 (gfc_code * code, forall_info * nested_forall_info)
/* As the mask array can be very big, prefer compact boolean types. */
tree mask_type = gfc_get_logical_type (gfc_logical_kinds[0].kind);
- gfc_add_modify_expr (&block, maskindex, gfc_index_zero_node);
+ gfc_add_modify (&block, maskindex, gfc_index_zero_node);
/* Start of mask assignment loop body. */
gfc_start_block (&body);
@@ -2835,12 +2836,12 @@ gfc_trans_forall_1 (gfc_code * code, forall_info * nested_forall_info)
se.expr = convert (mask_type, se.expr);
tmp = gfc_build_array_ref (mask, maskindex, NULL);
- gfc_add_modify_expr (&body, tmp, se.expr);
+ gfc_add_modify (&body, tmp, se.expr);
/* Advance to the next mask element. */
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
maskindex, gfc_index_one_node);
- gfc_add_modify_expr (&body, maskindex, tmp);
+ gfc_add_modify (&body, maskindex, tmp);
/* Generate the loops. */
tmp = gfc_finish_block (&body);
@@ -2998,7 +2999,7 @@ gfc_evaluate_where_mask (gfc_expr * me, forall_info * nested_forall_info,
/* Variable to index the temporary. */
count = gfc_create_var (gfc_array_index_type, "count");
/* Initialize count. */
- gfc_add_modify_expr (block, count, gfc_index_zero_node);
+ gfc_add_modify (block, count, gfc_index_zero_node);
gfc_start_block (&body);
@@ -3019,7 +3020,7 @@ gfc_evaluate_where_mask (gfc_expr * me, forall_info * nested_forall_info,
gfc_add_ss_to_loop (&loop, rss);
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &me->where);
gfc_mark_ss_chain_used (rss, 1);
/* Start the loop body. */
@@ -3040,14 +3041,14 @@ gfc_evaluate_where_mask (gfc_expr * me, forall_info * nested_forall_info,
gfc_add_block_to_block (&body1, &lse.pre);
gfc_add_block_to_block (&body1, &rse.pre);
- gfc_add_modify_expr (&body1, cond, fold_convert (mask_type, rse.expr));
+ gfc_add_modify (&body1, cond, fold_convert (mask_type, rse.expr));
if (mask && (cmask || pmask))
{
tmp = gfc_build_array_ref (mask, count, NULL);
if (invert)
tmp = fold_build1 (TRUTH_NOT_EXPR, mask_type, tmp);
- gfc_add_modify_expr (&body1, mtmp, tmp);
+ gfc_add_modify (&body1, mtmp, tmp);
}
if (cmask)
@@ -3056,7 +3057,7 @@ gfc_evaluate_where_mask (gfc_expr * me, forall_info * nested_forall_info,
tmp = cond;
if (mask)
tmp = fold_build2 (TRUTH_AND_EXPR, mask_type, mtmp, tmp);
- gfc_add_modify_expr (&body1, tmp1, tmp);
+ gfc_add_modify (&body1, tmp1, tmp);
}
if (pmask)
@@ -3065,7 +3066,7 @@ gfc_evaluate_where_mask (gfc_expr * me, forall_info * nested_forall_info,
tmp = fold_build1 (TRUTH_NOT_EXPR, mask_type, cond);
if (mask)
tmp = fold_build2 (TRUTH_AND_EXPR, mask_type, mtmp, tmp);
- gfc_add_modify_expr (&body1, tmp1, tmp);
+ gfc_add_modify (&body1, tmp1, tmp);
}
gfc_add_block_to_block (&body1, &lse.post);
@@ -3080,7 +3081,7 @@ gfc_evaluate_where_mask (gfc_expr * me, forall_info * nested_forall_info,
/* Increment count. */
tmp1 = fold_build2 (PLUS_EXPR, gfc_array_index_type, count,
gfc_index_one_node);
- gfc_add_modify_expr (&body1, count, tmp1);
+ gfc_add_modify (&body1, count, tmp1);
/* Generate the copying loops. */
gfc_trans_scalarizing_loops (&loop, &body1);
@@ -3186,7 +3187,7 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2,
gfc_conv_resolve_dependencies (&loop, lss_section, rss);
/* Setup the scalarizing loops. */
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &expr2->where);
/* Setup the gfc_se structures. */
gfc_copy_loopinfo_to_se (&lse, &loop);
@@ -3241,7 +3242,7 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2,
/* Increment count1. */
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
count1, gfc_index_one_node);
- gfc_add_modify_expr (&body, count1, tmp);
+ gfc_add_modify (&body, count1, tmp);
/* Use the scalar assignment as is. */
gfc_add_block_to_block (&block, &body);
@@ -3257,7 +3258,7 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2,
expression. */
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
count1, gfc_index_one_node);
- gfc_add_modify_expr (&body, count1, tmp);
+ gfc_add_modify (&body, count1, tmp);
gfc_trans_scalarized_loop_boundary (&loop, &body);
/* We need to copy the temporary to the actual lhs. */
@@ -3291,14 +3292,14 @@ gfc_trans_where_assign (gfc_expr *expr1, gfc_expr *expr2,
/* Increment count2. */
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
count2, gfc_index_one_node);
- gfc_add_modify_expr (&body, count2, tmp);
+ gfc_add_modify (&body, count2, tmp);
}
else
{
/* Increment count1. */
tmp = fold_build2 (PLUS_EXPR, gfc_array_index_type,
count1, gfc_index_one_node);
- gfc_add_modify_expr (&body, count1, tmp);
+ gfc_add_modify (&body, count1, tmp);
}
/* Generate the copying loops. */
@@ -3491,8 +3492,8 @@ gfc_trans_where_2 (gfc_code * code, tree mask, bool invert,
/* Variables to control maskexpr. */
count1 = gfc_create_var (gfc_array_index_type, "count1");
count2 = gfc_create_var (gfc_array_index_type, "count2");
- gfc_add_modify_expr (block, count1, gfc_index_zero_node);
- gfc_add_modify_expr (block, count2, gfc_index_zero_node);
+ gfc_add_modify (block, count1, gfc_index_zero_node);
+ gfc_add_modify (block, count2, gfc_index_zero_node);
tmp = gfc_trans_where_assign (expr1, expr2,
cmask, invert,
@@ -3509,8 +3510,8 @@ gfc_trans_where_2 (gfc_code * code, tree mask, bool invert,
/* Variables to control maskexpr. */
count1 = gfc_create_var (gfc_array_index_type, "count1");
count2 = gfc_create_var (gfc_array_index_type, "count2");
- gfc_add_modify_expr (block, count1, gfc_index_zero_node);
- gfc_add_modify_expr (block, count2, gfc_index_zero_node);
+ gfc_add_modify (block, count1, gfc_index_zero_node);
+ gfc_add_modify (block, count2, gfc_index_zero_node);
tmp = gfc_trans_where_assign (expr1, expr2,
cmask, invert,
@@ -3634,7 +3635,7 @@ gfc_trans_where_3 (gfc_code * cblock, gfc_code * eblock)
}
gfc_conv_ss_startstride (&loop);
- gfc_conv_loop_setup (&loop);
+ gfc_conv_loop_setup (&loop, &tdst->where);
gfc_mark_ss_chain_used (css, 1);
gfc_mark_ss_chain_used (tdss, 1);
@@ -3892,7 +3893,7 @@ gfc_trans_allocate (gfc_code * code)
gfc_init_se (&se, NULL);
gfc_conv_expr_lhs (&se, code->expr);
tmp = convert (TREE_TYPE (se.expr), stat);
- gfc_add_modify_expr (&block, se.expr, tmp);
+ gfc_add_modify (&block, se.expr, tmp);
}
return gfc_finish_block (&block);
@@ -3941,7 +3942,7 @@ gfc_trans_deallocate (gfc_code * code)
apstat = build_fold_addr_expr (astat);
/* Initialize astat to 0. */
- gfc_add_modify_expr (&block, astat, build_int_cst (TREE_TYPE (astat), 0));
+ gfc_add_modify (&block, astat, build_int_cst (TREE_TYPE (astat), 0));
}
else
pstat = apstat = stat = astat = NULL_TREE;
@@ -3969,7 +3970,7 @@ gfc_trans_deallocate (gfc_code * code)
/* Do not deallocate the components of a derived type
ultimate pointer component. */
- if (!(last && last->u.c.component->pointer)
+ if (!(last && last->u.c.component->attr.pointer)
&& !(!last && expr->symtree->n.sym->attr.pointer))
{
tmp = gfc_deallocate_alloc_comp (expr->ts.derived, se.expr,
@@ -3996,7 +3997,7 @@ gfc_trans_deallocate (gfc_code * code)
if (code->expr)
{
apstat = fold_build2 (PLUS_EXPR, TREE_TYPE (stat), astat, stat);
- gfc_add_modify_expr (&se.pre, astat, apstat);
+ gfc_add_modify (&se.pre, astat, apstat);
}
tmp = gfc_finish_block (&se.pre);
@@ -4010,7 +4011,7 @@ gfc_trans_deallocate (gfc_code * code)
gfc_init_se (&se, NULL);
gfc_conv_expr_lhs (&se, code->expr);
tmp = convert (TREE_TYPE (se.expr), astat);
- gfc_add_modify_expr (&block, se.expr, tmp);
+ gfc_add_modify (&block, se.expr, tmp);
}
return gfc_finish_block (&block);
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 2928cc68bf2..8178ae39f05 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -124,14 +124,14 @@ int gfc_character_storage_size;
if a mismatch occurs between ts->f90_type and ts->type; SUCCESS if
they match. */
-try
+gfc_try
gfc_validate_c_kind (gfc_typespec *ts)
{
return ((ts->type == ts->f90_type) ? SUCCESS : FAILURE);
}
-try
+gfc_try
gfc_check_any_c_kind (gfc_typespec *ts)
{
int i;
@@ -1764,7 +1764,7 @@ copy_dt_decls_ifequal (gfc_symbol *from, gfc_symbol *to)
for (; to_cm; to_cm = to_cm->next, from_cm = from_cm->next)
{
to_cm->backend_decl = from_cm->backend_decl;
- if (!from_cm->pointer && from_cm->ts.type == BT_DERIVED)
+ if (!from_cm->attr.pointer && from_cm->ts.type == BT_DERIVED)
gfc_get_derived_type (to_cm->ts.derived);
else if (from_cm->ts.type == BT_CHARACTER)
@@ -1848,7 +1848,7 @@ gfc_get_derived_type (gfc_symbol * derived)
if (c->ts.type != BT_DERIVED)
continue;
- if (!c->pointer || c->ts.derived->backend_decl == NULL)
+ if (!c->attr.pointer || c->ts.derived->backend_decl == NULL)
c->ts.derived->backend_decl = gfc_get_derived_type (c->ts.derived);
if (c->ts.derived && c->ts.derived->attr.is_iso_c)
@@ -1893,12 +1893,12 @@ gfc_get_derived_type (gfc_symbol * derived)
/* This returns an array descriptor type. Initialization may be
required. */
- if (c->dimension)
+ if (c->attr.dimension)
{
- if (c->pointer || c->allocatable)
+ if (c->attr.pointer || c->attr.allocatable)
{
enum gfc_array_kind akind;
- if (c->pointer)
+ if (c->attr.pointer)
akind = GFC_ARRAY_POINTER;
else
akind = GFC_ARRAY_ALLOCATABLE;
@@ -1910,7 +1910,7 @@ gfc_get_derived_type (gfc_symbol * derived)
field_type = gfc_get_nodesc_array_type (field_type, c->as,
PACKED_STATIC);
}
- else if (c->pointer)
+ else if (c->attr.pointer)
field_type = build_pointer_type (field_type);
field = gfc_add_field_to_struct (&fieldlist, typenode,
@@ -1934,12 +1934,23 @@ gfc_get_derived_type (gfc_symbol * derived)
gfc_finish_type (typenode);
gfc_set_decl_location (TYPE_STUB_DECL (typenode), &derived->declared_at);
+ if (derived->module && derived->ns->proc_name->attr.flavor == FL_MODULE)
+ {
+ if (derived->ns->proc_name->backend_decl
+ && TREE_CODE (derived->ns->proc_name->backend_decl)
+ == NAMESPACE_DECL)
+ {
+ TYPE_CONTEXT (typenode) = derived->ns->proc_name->backend_decl;
+ DECL_CONTEXT (TYPE_STUB_DECL (typenode))
+ = derived->ns->proc_name->backend_decl;
+ }
+ }
derived->backend_decl = typenode;
- /* Add this backend_decl to all the other, equal derived types. */
- for (dt = gfc_derived_types; dt; dt = dt->next)
- copy_dt_decls_ifequal (derived, dt->derived);
+ /* Add this backend_decl to all the other, equal derived types. */
+ for (dt = gfc_derived_types; dt; dt = dt->next)
+ copy_dt_decls_ifequal (derived, dt->derived);
return derived->backend_decl;
}
@@ -2278,7 +2289,10 @@ gfc_get_array_descr_info (const_tree type, struct array_descr_info *info)
else
info->base_decl = base_decl = build_decl (VAR_DECL, NULL_TREE, ptype);
- elem_size = fold_convert (gfc_array_index_type, TYPE_SIZE_UNIT (etype));
+ if (GFC_TYPE_ARRAY_SPAN (type))
+ elem_size = GFC_TYPE_ARRAY_SPAN (type);
+ else
+ elem_size = fold_convert (gfc_array_index_type, TYPE_SIZE_UNIT (etype));
field = TYPE_FIELDS (TYPE_MAIN_VARIANT (type));
data_off = byte_position (field);
field = TREE_CHAIN (field);
diff --git a/gcc/fortran/trans.c b/gcc/fortran/trans.c
index 1db628eff42..1b115f435fc 100644
--- a/gcc/fortran/trans.c
+++ b/gcc/fortran/trans.c
@@ -23,7 +23,8 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "tree-gimple.h"
+#include "gimple.h"
+#include "tree-iterator.h"
#include "ggc.h"
#include "toplev.h"
#include "defaults.h"
@@ -142,19 +143,18 @@ gfc_evaluate_now (tree expr, stmtblock_t * pblock)
return expr;
var = gfc_create_var (TREE_TYPE (expr), NULL);
- gfc_add_modify_expr (pblock, var, expr);
+ gfc_add_modify (pblock, var, expr);
return var;
}
-/* Build a MODIFY_EXPR (or GIMPLE_MODIFY_STMT) node and add it to a
- given statement block PBLOCK. A MODIFY_EXPR is an assignment:
+/* Build a MODIFY_EXPR node and add it to a given statement block PBLOCK.
+ A MODIFY_EXPR is an assignment:
LHS <- RHS. */
void
-gfc_add_modify (stmtblock_t * pblock, tree lhs, tree rhs,
- bool tuples_p)
+gfc_add_modify (stmtblock_t * pblock, tree lhs, tree rhs)
{
tree tmp;
@@ -167,8 +167,7 @@ gfc_add_modify (stmtblock_t * pblock, tree lhs, tree rhs,
|| AGGREGATE_TYPE_P (TREE_TYPE (lhs)));
#endif
- tmp = fold_build2 (tuples_p ? GIMPLE_MODIFY_STMT : MODIFY_EXPR,
- void_type_node, lhs, rhs);
+ tmp = fold_build2 (MODIFY_EXPR, void_type_node, lhs, rhs);
gfc_add_expr_to_block (pblock, tmp);
}
@@ -351,13 +350,14 @@ gfc_build_array_ref (tree base, tree offset, tree decl)
/* Generate a runtime error if COND is true. */
void
-gfc_trans_runtime_check (tree cond, stmtblock_t * pblock, locus * where,
- const char * msgid, ...)
+gfc_trans_runtime_check (bool error, bool once, tree cond, stmtblock_t * pblock,
+ locus * where, const char * msgid, ...)
{
va_list ap;
stmtblock_t block;
tree body;
tree tmp;
+ tree tmpvar = NULL;
tree arg, arg2;
tree *argarray;
tree fntype;
@@ -377,6 +377,14 @@ gfc_trans_runtime_check (tree cond, stmtblock_t * pblock, locus * where,
nargs++;
}
+ if (once)
+ {
+ tmpvar = gfc_create_var (boolean_type_node, "print_warning");
+ TREE_STATIC (tmpvar) = 1;
+ DECL_INITIAL (tmpvar) = boolean_true_node;
+ gfc_add_expr_to_block (pblock, tmpvar);
+ }
+
/* The code to generate the error. */
gfc_start_block (&block);
@@ -408,16 +416,25 @@ gfc_trans_runtime_check (tree cond, stmtblock_t * pblock, locus * where,
argarray[2+i] = va_arg (ap, tree);
va_end (ap);
- /* Build the function call to runtime_error_at; because of the variable
- number of arguments, we can't use build_call_expr directly. */
- fntype = TREE_TYPE (gfor_fndecl_runtime_error_at);
+ /* Build the function call to runtime_(warning,error)_at; because of the
+ variable number of arguments, we can't use build_call_expr directly. */
+ if (error)
+ fntype = TREE_TYPE (gfor_fndecl_runtime_error_at);
+ else
+ fntype = TREE_TYPE (gfor_fndecl_runtime_warning_at);
+
tmp = fold_builtin_call_array (TREE_TYPE (fntype),
fold_build1 (ADDR_EXPR,
build_pointer_type (fntype),
- gfor_fndecl_runtime_error_at),
+ error
+ ? gfor_fndecl_runtime_error_at
+ : gfor_fndecl_runtime_warning_at),
nargs + 2, argarray);
gfc_add_expr_to_block (&block, tmp);
+ if (once)
+ gfc_add_modify (&block, tmpvar, boolean_false_node);
+
body = gfc_finish_block (&block);
if (integer_onep (cond))
@@ -427,7 +444,12 @@ gfc_trans_runtime_check (tree cond, stmtblock_t * pblock, locus * where,
else
{
/* Tell the compiler that this isn't likely. */
- cond = fold_convert (long_integer_type_node, cond);
+ if (once)
+ cond = fold_build2 (TRUTH_AND_EXPR, long_integer_type_node, tmpvar,
+ cond);
+ else
+ cond = fold_convert (long_integer_type_node, cond);
+
tmp = build_int_cst (long_integer_type_node, 0);
cond = build_call_expr (built_in_decls[BUILT_IN_EXPECT], 2, cond, tmp);
cond = fold_convert (boolean_type_node, cond);
@@ -472,7 +494,7 @@ gfc_call_malloc (stmtblock_t * block, tree type, tree size)
size = fold_build2 (MAX_EXPR, size_type_node, size,
build_int_cst (size_type_node, 1));
- gfc_add_modify_expr (&block2, res,
+ gfc_add_modify (&block2, res,
build_call_expr (built_in_decls[BUILT_IN_MALLOC], 1,
size));
null_result = fold_build2 (EQ_EXPR, boolean_type_node, res,
@@ -570,10 +592,10 @@ gfc_allocate_with_status (stmtblock_t * block, tree size, tree status)
stmtblock_t set_status_block;
gfc_start_block (&set_status_block);
- gfc_add_modify_expr (&set_status_block,
+ gfc_add_modify (&set_status_block,
fold_build1 (INDIRECT_REF, status_type, status),
build_int_cst (status_type, LIBERROR_ALLOCATION));
- gfc_add_modify_expr (&set_status_block, res,
+ gfc_add_modify (&set_status_block, res,
build_int_cst (pvoid_type_node, 0));
tmp = fold_build2 (EQ_EXPR, boolean_type_node, status,
@@ -584,7 +606,7 @@ gfc_allocate_with_status (stmtblock_t * block, tree size, tree status)
/* The allocation itself. */
gfc_start_block (&alloc_block);
- gfc_add_modify_expr (&alloc_block, res,
+ gfc_add_modify (&alloc_block, res,
build_call_expr (built_in_decls[BUILT_IN_MALLOC], 1,
fold_build2 (MAX_EXPR, size_type_node,
size,
@@ -666,7 +688,7 @@ gfc_allocate_array_with_status (stmtblock_t * block, tree mem, tree size,
/* If mem is NULL, we call gfc_allocate_with_status. */
gfc_start_block (&alloc_block);
tmp = gfc_allocate_with_status (&alloc_block, size, status);
- gfc_add_modify_expr (&alloc_block, res, fold_convert (type, tmp));
+ gfc_add_modify (&alloc_block, res, fold_convert (type, tmp));
alloc = gfc_finish_block (&alloc_block);
/* Otherwise, we issue a runtime error or set the status variable. */
@@ -685,9 +707,9 @@ gfc_allocate_array_with_status (stmtblock_t * block, tree mem, tree size,
gfc_add_expr_to_block (&set_status_block, tmp);
tmp = gfc_allocate_with_status (&set_status_block, size, status);
- gfc_add_modify_expr (&set_status_block, res, fold_convert (type, tmp));
+ gfc_add_modify (&set_status_block, res, fold_convert (type, tmp));
- gfc_add_modify_expr (&set_status_block,
+ gfc_add_modify (&set_status_block,
fold_build1 (INDIRECT_REF, status_type, status),
build_int_cst (status_type, LIBERROR_ALLOCATION));
@@ -862,7 +884,7 @@ gfc_call_realloc (stmtblock_t * block, tree mem, tree size)
/* Call realloc and check the result. */
tmp = build_call_expr (built_in_decls[BUILT_IN_REALLOC], 2,
fold_convert (pvoid_type_node, mem), size);
- gfc_add_modify_expr (block, res, fold_convert (type, tmp));
+ gfc_add_modify (block, res, fold_convert (type, tmp));
null_result = fold_build2 (EQ_EXPR, boolean_type_node, res,
build_int_cst (pvoid_type_node, 0));
nonzero = fold_build2 (NE_EXPR, boolean_type_node, size,
@@ -962,7 +984,7 @@ gfc_trans_code (gfc_code * code)
gfc_start_block (&block);
- /* Translate statements one by one to GIMPLE trees until we reach
+ /* Translate statements one by one into GENERIC trees until we reach
the end of this gfc_code branch. */
for (; code; code = code->next)
{
@@ -1150,7 +1172,7 @@ gfc_trans_code (gfc_code * code)
if (res != NULL_TREE && ! IS_EMPTY_STMT (res))
{
if (TREE_CODE (res) == STATEMENT_LIST)
- annotate_all_with_locus (&res, input_location);
+ tree_annotate_all_with_location (&res, input_location);
else
SET_EXPR_LOCATION (res, input_location);
@@ -1187,6 +1209,19 @@ void
gfc_generate_module_code (gfc_namespace * ns)
{
gfc_namespace *n;
+ struct module_htab_entry *entry;
+
+ gcc_assert (ns->proc_name->backend_decl == NULL);
+ ns->proc_name->backend_decl
+ = build_decl (NAMESPACE_DECL, get_identifier (ns->proc_name->name),
+ void_type_node);
+ gfc_set_decl_location (ns->proc_name->backend_decl,
+ &ns->proc_name->declared_at);
+ entry = gfc_find_module (ns->proc_name->name);
+ if (entry->namespace_decl)
+ /* Buggy sourcecode, using a module before defining it? */
+ htab_empty (entry->decls);
+ entry->namespace_decl = ns->proc_name->backend_decl;
gfc_generate_module_vars (ns);
@@ -1194,10 +1229,21 @@ gfc_generate_module_code (gfc_namespace * ns)
sibling calls. */
for (n = ns->contained; n; n = n->sibling)
{
+ gfc_entry_list *el;
+
if (!n->proc_name)
continue;
gfc_create_function_decl (n);
+ gcc_assert (DECL_CONTEXT (n->proc_name->backend_decl) == NULL_TREE);
+ DECL_CONTEXT (n->proc_name->backend_decl) = ns->proc_name->backend_decl;
+ gfc_module_add_decl (entry, n->proc_name->backend_decl);
+ for (el = ns->entries; el; el = el->next)
+ {
+ gcc_assert (DECL_CONTEXT (el->sym->backend_decl) == NULL_TREE);
+ DECL_CONTEXT (el->sym->backend_decl) = ns->proc_name->backend_decl;
+ gfc_module_add_decl (entry, el->sym->backend_decl);
+ }
}
for (n = ns->contained; n; n = n->sibling)
diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h
index 98002a9f2f7..5d729eaab83 100644
--- a/gcc/fortran/trans.h
+++ b/gcc/fortran/trans.h
@@ -348,12 +348,8 @@ void gfc_trans_vla_type_sizes (gfc_symbol *, stmtblock_t *);
void gfc_add_expr_to_block (stmtblock_t *, tree);
/* Add a block to the end of a block. */
void gfc_add_block_to_block (stmtblock_t *, stmtblock_t *);
-/* Add a MODIFY_EXPR or a GIMPLE_MODIFY_STMT to a block. */
-void gfc_add_modify (stmtblock_t *, tree, tree, bool);
-#define gfc_add_modify_expr(BLOCK, LHS, RHS) \
- gfc_add_modify ((BLOCK), (LHS), (RHS), false)
-#define gfc_add_modify_stmt(BLOCK, LHS, RHS) \
- gfc_add_modify ((BLOCK), (LHS), (RHS), true)
+/* Add a MODIFY_EXPR to a block. */
+void gfc_add_modify (stmtblock_t *, tree, tree);
/* Initialize a statement block. */
void gfc_init_block (stmtblock_t *);
@@ -433,6 +429,16 @@ void gfc_generate_block_data (gfc_namespace *);
/* Output a decl for a module variable. */
void gfc_generate_module_vars (gfc_namespace *);
+struct module_htab_entry GTY(())
+{
+ const char *name;
+ tree namespace_decl;
+ htab_t GTY ((param_is (union tree_node))) decls;
+};
+
+struct module_htab_entry *gfc_find_module (const char *);
+void gfc_module_add_decl (struct module_htab_entry *, tree);
+
/* Get and set the current location. */
void gfc_set_backend_locus (locus *);
void gfc_get_backend_locus (locus *);
@@ -444,8 +450,9 @@ void gfc_generate_constructors (void);
/* Get the string length of an array constructor. */
bool get_array_ctor_strlen (stmtblock_t *, gfc_constructor *, tree *);
-/* Generate a runtime error check. */
-void gfc_trans_runtime_check (tree, stmtblock_t *, locus *, const char *, ...);
+/* Generate a runtime warning/error check. */
+void gfc_trans_runtime_check (bool, bool, tree, stmtblock_t *, locus *,
+ const char *, ...);
/* Generate a call to free() after checking that its arg is non-NULL. */
tree gfc_call_free (tree);
@@ -510,6 +517,7 @@ extern GTY(()) tree gfor_fndecl_stop_numeric;
extern GTY(()) tree gfor_fndecl_stop_string;
extern GTY(()) tree gfor_fndecl_runtime_error;
extern GTY(()) tree gfor_fndecl_runtime_error_at;
+extern GTY(()) tree gfor_fndecl_runtime_warning_at;
extern GTY(()) tree gfor_fndecl_os_error;
extern GTY(()) tree gfor_fndecl_generate_error;
extern GTY(()) tree gfor_fndecl_set_fpe;
@@ -607,6 +615,7 @@ struct lang_type GTY(())
tree offset;
tree dtype;
tree dataptr_type;
+ tree span;
};
struct lang_decl GTY(())
@@ -659,6 +668,7 @@ struct lang_decl GTY(())
#define GFC_TYPE_ARRAY_DTYPE(node) (TYPE_LANG_SPECIFIC(node)->dtype)
#define GFC_TYPE_ARRAY_DATAPTR_TYPE(node) \
(TYPE_LANG_SPECIFIC(node)->dataptr_type)
+#define GFC_TYPE_ARRAY_SPAN(node) (TYPE_LANG_SPECIFIC(node)->span)
/* Build an expression with void type. */
#define build1_v(code, arg) fold_build1(code, void_type_node, arg)
diff --git a/gcc/function.c b/gcc/function.c
index fa2a84d804f..da26dc7d114 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -59,7 +59,7 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "target.h"
#include "cfglayout.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-pass.h"
#include "predict.h"
#include "df.h"
@@ -350,10 +350,14 @@ get_stack_local_alignment (tree type, enum machine_mode mode)
-2 means use BITS_PER_UNIT,
positive specifies alignment boundary in bits.
+ If REDUCE_ALIGNMENT_OK is true, it is OK to reduce alignment.
+
We do not round to stack_boundary here. */
rtx
-assign_stack_local (enum machine_mode mode, HOST_WIDE_INT size, int align)
+assign_stack_local_1 (enum machine_mode mode, HOST_WIDE_INT size,
+ int align,
+ bool reduce_alignment_ok ATTRIBUTE_UNUSED)
{
rtx x, addr;
int bigend_correction = 0;
@@ -375,17 +379,52 @@ assign_stack_local (enum machine_mode mode, HOST_WIDE_INT size, int align)
else
alignment = align / BITS_PER_UNIT;
+ alignment_in_bits = alignment * BITS_PER_UNIT;
+
if (FRAME_GROWS_DOWNWARD)
frame_offset -= size;
- /* Ignore alignment we can't do with expected alignment of the boundary. */
- if (alignment * BITS_PER_UNIT > PREFERRED_STACK_BOUNDARY)
- alignment = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT;
+ /* Ignore alignment if it exceeds MAX_SUPPORTED_STACK_ALIGNMENT. */
+ if (alignment_in_bits > MAX_SUPPORTED_STACK_ALIGNMENT)
+ {
+ alignment_in_bits = MAX_SUPPORTED_STACK_ALIGNMENT;
+ alignment = alignment_in_bits / BITS_PER_UNIT;
+ }
- alignment_in_bits = alignment * BITS_PER_UNIT;
+ if (SUPPORTS_STACK_ALIGNMENT)
+ {
+ if (crtl->stack_alignment_estimated < alignment_in_bits)
+ {
+ if (!crtl->stack_realign_processed)
+ crtl->stack_alignment_estimated = alignment_in_bits;
+ else
+ {
+ /* If stack is realigned and stack alignment value
+ hasn't been finalized, it is OK not to increase
+ stack_alignment_estimated. The bigger alignment
+ requirement is recorded in stack_alignment_needed
+ below. */
+ gcc_assert (!crtl->stack_realign_finalized);
+ if (!crtl->stack_realign_needed)
+ {
+ /* It is OK to reduce the alignment as long as the
+ requested size is 0 or the estimated stack
+ alignment >= mode alignment. */
+ gcc_assert (reduce_alignment_ok
+ || size == 0
+ || (crtl->stack_alignment_estimated
+ >= GET_MODE_ALIGNMENT (mode)));
+ alignment_in_bits = crtl->stack_alignment_estimated;
+ alignment = alignment_in_bits / BITS_PER_UNIT;
+ }
+ }
+ }
+ }
if (crtl->stack_alignment_needed < alignment_in_bits)
crtl->stack_alignment_needed = alignment_in_bits;
+ if (crtl->max_used_stack_slot_alignment < crtl->stack_alignment_needed)
+ crtl->max_used_stack_slot_alignment = crtl->stack_alignment_needed;
/* Calculate how many bytes the start of local variables is off from
stack alignment. */
@@ -449,6 +488,14 @@ assign_stack_local (enum machine_mode mode, HOST_WIDE_INT size, int align)
return x;
}
+
+/* Wrap up assign_stack_local_1 with last parameter as false. */
+
+rtx
+assign_stack_local (enum machine_mode mode, HOST_WIDE_INT size, int align)
+{
+ return assign_stack_local_1 (mode, size, align, false);
+}
/* Removes temporary slot TEMP from LIST. */
@@ -885,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);
}
}
@@ -1163,23 +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)
- new = arg_pointer_rtx, offset = in_arg_offset;
+ {
+ if (stack_realign_drap)
+ {
+ /* 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_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;
}
@@ -1187,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.
@@ -1201,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)
@@ -1210,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;
@@ -1270,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);
@@ -1280,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 ();
@@ -1304,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);
@@ -1335,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]);
@@ -1345,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 ();
@@ -1359,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;
@@ -1417,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 ();
@@ -1432,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 ();
@@ -1442,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:
@@ -1547,7 +1605,7 @@ static tree
instantiate_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
{
tree t = *tp;
- if (! EXPR_P (t) && ! GIMPLE_STMT_P (t))
+ if (! EXPR_P (t))
{
*walk_subtrees = 0;
if (DECL_P (t) && DECL_RTL_SET_P (t))
@@ -2204,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;
@@ -2947,6 +3010,20 @@ assign_parms (tree fndecl)
continue;
}
+ /* Estimate stack alignment from parameter alignment. */
+ if (SUPPORTS_STACK_ALIGNMENT)
+ {
+ unsigned int align = FUNCTION_ARG_BOUNDARY (data.promoted_mode,
+ data.passed_type);
+ if (TYPE_ALIGN (data.nominal_type) > align)
+ align = TYPE_ALIGN (data.passed_type);
+ if (crtl->stack_alignment_estimated < align)
+ {
+ gcc_assert (!crtl->stack_realign_processed);
+ crtl->stack_alignment_estimated = align;
+ }
+ }
+
if (cfun->stdarg && !TREE_CHAIN (parm))
assign_parms_setup_varargs (&all, &data, false);
@@ -2984,6 +3061,28 @@ assign_parms (tree fndecl)
now that all parameters have been copied out of hard registers. */
emit_insn (all.first_conversion_insn);
+ /* Estimate reload stack alignment from scalar return mode. */
+ if (SUPPORTS_STACK_ALIGNMENT)
+ {
+ if (DECL_RESULT (fndecl))
+ {
+ tree type = TREE_TYPE (DECL_RESULT (fndecl));
+ enum machine_mode mode = TYPE_MODE (type);
+
+ if (mode != BLKmode
+ && mode != VOIDmode
+ && !AGGREGATE_TYPE_P (type))
+ {
+ unsigned int align = GET_MODE_ALIGNMENT (mode);
+ if (crtl->stack_alignment_estimated < align)
+ {
+ gcc_assert (!crtl->stack_realign_processed);
+ crtl->stack_alignment_estimated = align;
+ }
+ }
+ }
+ }
+
/* If we are receiving a struct value address as the first argument, set up
the RTL for the function result. As this might require code to convert
the transmitted address to Pmode, we do this here to ensure that possible
@@ -3092,7 +3191,7 @@ gimplify_parm_type (tree *tp, int *walk_subtrees, void *data)
else if (TYPE_SIZE (t) && !TREE_CONSTANT (TYPE_SIZE (t))
&& !TYPE_SIZES_GIMPLIFIED (t))
{
- gimplify_type_sizes (t, (tree *) data);
+ gimplify_type_sizes (t, (gimple_seq *) data);
*walk_subtrees = 1;
}
}
@@ -3102,15 +3201,15 @@ gimplify_parm_type (tree *tp, int *walk_subtrees, void *data)
/* Gimplify the parameter list for current_function_decl. This involves
evaluating SAVE_EXPRs of variable sized parameters and generating code
- to implement callee-copies reference parameters. Returns a list of
- statements to add to the beginning of the function, or NULL if nothing
- to do. */
+ to implement callee-copies reference parameters. Returns a sequence of
+ statements to add to the beginning of the function. */
-tree
+gimple_seq
gimplify_parameters (void)
{
struct assign_parm_data_all all;
- tree fnargs, parm, stmts = NULL;
+ tree fnargs, parm;
+ gimple_seq stmts = NULL;
assign_parms_initialize_all (&all);
fnargs = assign_parms_augmented_arg_list (&all);
@@ -3137,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);
@@ -3151,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;
@@ -3170,12 +3272,11 @@ gimplify_parameters (void)
t = built_in_decls[BUILT_IN_ALLOCA];
t = build_call_expr (t, 1, DECL_SIZE_UNIT (parm));
t = fold_convert (ptr_type, t);
- t = build_gimple_modify_stmt (addr, t);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (addr), addr, t);
gimplify_and_add (t, &stmts);
}
- t = build_gimple_modify_stmt (local, parm);
- gimplify_and_add (t, &stmts);
+ gimplify_assign (local, parm, &stmts);
SET_DECL_VALUE_EXPR (parm, local);
DECL_HAS_VALUE_EXPR_P (parm) = 1;
@@ -3258,15 +3359,43 @@ locate_and_pad_parm (enum machine_mode passed_mode, tree type, int in_regs,
= type ? size_in_bytes (type) : size_int (GET_MODE_SIZE (passed_mode));
where_pad = FUNCTION_ARG_PADDING (passed_mode, type);
boundary = FUNCTION_ARG_BOUNDARY (passed_mode, type);
- if (boundary > PREFERRED_STACK_BOUNDARY)
- boundary = PREFERRED_STACK_BOUNDARY;
locate->where_pad = where_pad;
+
+ /* Alignment can't exceed MAX_SUPPORTED_STACK_ALIGNMENT. */
+ if (boundary > MAX_SUPPORTED_STACK_ALIGNMENT)
+ boundary = MAX_SUPPORTED_STACK_ALIGNMENT;
+
locate->boundary = boundary;
+ if (SUPPORTS_STACK_ALIGNMENT)
+ {
+ /* stack_alignment_estimated can't change after stack has been
+ realigned. */
+ if (crtl->stack_alignment_estimated < boundary)
+ {
+ if (!crtl->stack_realign_processed)
+ crtl->stack_alignment_estimated = boundary;
+ else
+ {
+ /* If stack is realigned and stack alignment value
+ hasn't been finalized, it is OK not to increase
+ stack_alignment_estimated. The bigger alignment
+ requirement is recorded in stack_alignment_needed
+ below. */
+ gcc_assert (!crtl->stack_realign_finalized
+ && crtl->stack_realign_needed);
+ }
+ }
+ }
+
/* Remember if the outgoing parameter requires extra alignment on the
calling function side. */
if (crtl->stack_alignment_needed < boundary)
crtl->stack_alignment_needed = boundary;
+ if (crtl->max_used_stack_slot_alignment < crtl->stack_alignment_needed)
+ crtl->max_used_stack_slot_alignment = crtl->stack_alignment_needed;
+ if (crtl->preferred_stack_boundary < boundary)
+ crtl->preferred_stack_boundary = boundary;
#ifdef ARGS_GROW_DOWNWARD
locate->slot_offset.constant = -initial_offset_ptr->constant;
@@ -3886,6 +4015,7 @@ prepare_function_start (void)
init_emit ();
init_varasm_status ();
init_expr ();
+ default_rtl_profile ();
cse_not_expected = ! optimize;
@@ -4353,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;
@@ -4364,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 ();
@@ -4602,7 +4732,8 @@ get_arg_pointer_save_area (void)
generated stack slot may not be a valid memory address, so we
have to check it and fix it if necessary. */
start_sequence ();
- emit_move_insn (validize_mem (ret), virtual_incoming_args_rtx);
+ emit_move_insn (validize_mem (ret),
+ crtl->args.internal_arg_pointer);
seq = get_insns ();
end_sequence ();
@@ -4712,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)
{
@@ -4758,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)
{
@@ -4907,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 ece44fdc7ac..eb85e3c37af 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -311,6 +311,9 @@ struct rtl_data GTY(())
needed by inner routines. */
rtx x_arg_pointer_save_area;
+ /* Dynamic Realign Argument Pointer used for realigning stack. */
+ rtx drap_reg;
+
/* Offset to end of allocated area of stack frame.
If stack grows down, this is the address of the last stack slot allocated.
If stack grows up, this is the address for the next slot. */
@@ -328,12 +331,29 @@ struct rtl_data GTY(())
/* Current nesting level for temporaries. */
int x_temp_slot_level;
- /* The largest alignment of slot allocated on the stack. */
+ /* The largest alignment needed on the stack, including requirement
+ for outgoing stack alignment. */
unsigned int stack_alignment_needed;
- /* Preferred alignment of the end of stack frame. */
+ /* Preferred alignment of the end of stack frame, which is preferred
+ 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;
+
+ /* The stack alignment estimated before reload, with consideration of
+ following factors:
+ 1. Alignment of local stack variables (max_used_stack_slot_alignment)
+ 2. Alignment requirement to call other functions
+ (preferred_stack_boundary)
+ 3. Alignment of non-local stack variables but might be spilled in
+ local stack. */
+ unsigned int stack_alignment_estimated;
+
/* For reorg. */
/* If some insns can be deferred to the delay slots of the epilogue, the
@@ -393,10 +413,37 @@ struct rtl_data GTY(())
/* Nonzero if code to initialize arg_pointer_save_area has been emitted. */
bool arg_pointer_save_area_init;
- /* Nonzero means current function must be given a frame pointer.
- Set in stmt.c if anything is allocated on the stack there.
- Set in reload1.c if anything is allocated on the stack there. */
+ /* Nonzero if current function must be given a frame pointer.
+ Set in global.c if anything is allocated on the stack there. */
bool frame_pointer_needed;
+
+ /* 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.
+ 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. */
+ bool stack_realign_processed;
+
+ /* Nonzero if function stack realignment has been finalized, namely
+ stack_realign_needed flag has been set and finalized after reload. */
+ bool stack_realign_finalized;
};
#define return_label (crtl->x_return_label)
@@ -411,6 +458,8 @@ struct rtl_data GTY(())
#define temp_slot_level (crtl->x_temp_slot_level)
#define nonlocal_goto_handler_labels (crtl->x_nonlocal_goto_handler_labels)
#define frame_pointer_needed (crtl->frame_pointer_needed)
+#define stack_realign_fp (crtl->stack_realign_needed && !crtl->need_drap)
+#define stack_realign_drap (crtl->stack_realign_needed && crtl->need_drap)
extern GTY(()) struct rtl_data x_rtl;
@@ -428,6 +477,10 @@ struct function GTY(())
/* The control flow graph for this function. */
struct control_flow_graph *cfg;
+
+ /* GIMPLE body for this function. */
+ struct gimple_seq_d *gimple_body;
+
/* SSA and dataflow information. */
struct gimple_df *gimple_df;
diff --git a/gcc/fwprop.c b/gcc/fwprop.c
index fbe432974f4..7c61ca008e5 100644
--- a/gcc/fwprop.c
+++ b/gcc/fwprop.c
@@ -1056,7 +1056,9 @@ fwprop (void)
struct df_ref *use = DF_USES_GET (i);
if (use)
if (DF_REF_TYPE (use) == DF_REF_REG_USE
- || DF_REF_BB (use)->loop_father == NULL)
+ || DF_REF_BB (use)->loop_father == NULL
+ /* The outer most loop is not really a loop. */
+ || loop_outer (DF_REF_BB (use)->loop_father) == NULL)
forward_propagate_into (use);
}
@@ -1099,7 +1101,9 @@ fwprop_addr (void)
struct df_ref *use = DF_USES_GET (i);
if (use)
if (DF_REF_TYPE (use) != DF_REF_REG_USE
- && DF_REF_BB (use)->loop_father != NULL)
+ && DF_REF_BB (use)->loop_father != NULL
+ /* The outer most loop is not really a loop. */
+ && loop_outer (DF_REF_BB (use)->loop_father) != NULL)
forward_propagate_into (use);
}
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/gcov.c b/gcc/gcov.c
index a6cabe84d03..1c4b97db1fd 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -361,6 +361,9 @@ main (int argc, char **argv)
gcc_init_libintl ();
+ /* Handle response files. */
+ expandargv (&argc, &argv);
+
argno = process_args (argc, argv);
if (optind == argc)
print_usage (true);
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 008544f0f64..ee2d31e0a42 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -738,9 +738,7 @@ gcse_main (rtx f ATTRIBUTE_UNUSED)
timevar_pop (TV_CPROP1);
}
- if (optimize_size)
- /* Do nothing. */ ;
- else
+ if (optimize_function_for_speed_p (cfun))
{
timevar_push (TV_PRE);
changed |= one_pre_gcse_pass (pass + 1);
@@ -773,7 +771,7 @@ gcse_main (rtx f ATTRIBUTE_UNUSED)
for code size -- it rarely makes programs faster, and can make
them bigger if we did partial redundancy elimination (when optimizing
for space, we don't run the partial redundancy algorithms). */
- if (optimize_size)
+ if (optimize_function_for_size_p (cfun))
{
timevar_push (TV_HOIST);
max_gcse_regno = max_reg_num ();
@@ -825,7 +823,7 @@ gcse_main (rtx f ATTRIBUTE_UNUSED)
/* We are finished with alias. */
end_alias_analysis ();
- if (!optimize_size && flag_gcse_sm)
+ if (optimize_function_for_speed_p (cfun) && flag_gcse_sm)
{
timevar_push (TV_LSM);
store_motion ();
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index f7309b16c88..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;
@@ -1537,7 +1541,7 @@ open_base_files (void)
"hard-reg-set.h", "basic-block.h", "cselib.h", "insn-addr.h",
"optabs.h", "libfuncs.h", "debug.h", "ggc.h", "cgraph.h",
"tree-flow.h", "reload.h", "cpp-id-data.h", "tree-chrec.h",
- "cfglayout.h", "except.h", "output.h", "cfgloop.h", NULL
+ "cfglayout.h", "except.h", "output.h", "gimple.h", "cfgloop.h", NULL
};
const char *const *ifp;
outf_p gtype_desc_c;
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index 98a6c280ef3..0afe0d815dd 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -172,7 +172,6 @@ along with GCC; see the file COPYING3. If not see
thing you need to do to add a new special allocation size. */
static const size_t extra_order_size_table[] = {
- sizeof (struct stmt_ann_d),
sizeof (struct var_ann_d),
sizeof (struct tree_decl_non_common),
sizeof (struct tree_field_decl),
@@ -184,9 +183,6 @@ static const size_t extra_order_size_table[] = {
sizeof (struct basic_block_def),
sizeof (bitmap_element),
sizeof (bitmap_head),
- /* PHI nodes with one to three arguments are already covered by the
- above sizes. */
- sizeof (struct tree_phi_node) + sizeof (struct phi_arg_d) * 3,
TREE_EXP_SIZE (2),
RTL_SIZE (2), /* MEM, PLUS, etc. */
RTL_SIZE (9), /* INSN */
diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c
index 99175d5b2f1..99f8754473b 100644
--- a/gcc/gimple-low.c
+++ b/gcc/gimple-low.c
@@ -1,4 +1,4 @@
-/* Tree lowering pass. Lowers GIMPLE into unstructured form.
+/* GIMPLE lowering pass. Converts High GIMPLE into Low GIMPLE.
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
@@ -25,7 +25,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "rtl.h"
#include "varray.h"
-#include "tree-gimple.h"
+#include "gimple.h"
+#include "tree-iterator.h"
#include "tree-inline.h"
#include "diagnostic.h"
#include "langhooks.h"
@@ -40,76 +41,123 @@ along with GCC; see the file COPYING3. If not see
#include "toplev.h"
#include "tree-pass.h"
+/* The differences between High GIMPLE and Low GIMPLE are the
+ following:
+
+ 1- Lexical scopes are removed (i.e., GIMPLE_BIND disappears).
+
+ 2- GIMPLE_TRY and GIMPLE_CATCH are converted to abnormal control
+ flow and exception regions are built as an on-the-side region
+ hierarchy (See tree-eh.c:lower_eh_constructs).
+
+ 3- Multiple identical return statements are grouped into a single
+ return and gotos to the unique return site. */
+
+/* Match a return statement with a label. During lowering, we identify
+ identical return statements and replace duplicates with a jump to
+ the corresponding label. */
+struct return_statements_t
+{
+ tree label;
+ gimple stmt;
+};
+typedef struct return_statements_t return_statements_t;
+
+DEF_VEC_O(return_statements_t);
+DEF_VEC_ALLOC_O(return_statements_t,heap);
+
struct lower_data
{
/* Block the current statement belongs to. */
tree block;
- /* A TREE_LIST of label and return statements to be moved to the end
+ /* A vector of label and return statements to be moved to the end
of the function. */
- tree return_statements;
+ VEC(return_statements_t,heap) *return_statements;
/* True if the function calls __builtin_setjmp. */
bool calls_builtin_setjmp;
};
-static void lower_stmt (tree_stmt_iterator *, struct lower_data *);
-static void lower_bind_expr (tree_stmt_iterator *, struct lower_data *);
-static void lower_cond_expr (tree_stmt_iterator *, struct lower_data *);
-static void lower_return_expr (tree_stmt_iterator *, struct lower_data *);
-static void lower_builtin_setjmp (tree_stmt_iterator *);
+static void lower_stmt (gimple_stmt_iterator *, struct lower_data *);
+static void lower_gimple_bind (gimple_stmt_iterator *, struct lower_data *);
+static void lower_gimple_return (gimple_stmt_iterator *, struct lower_data *);
+static void lower_builtin_setjmp (gimple_stmt_iterator *);
-/* Lower the body of current_function_decl. */
+
+/* Lower the body of current_function_decl from High GIMPLE into Low
+ GIMPLE. */
static unsigned int
lower_function_body (void)
{
struct lower_data data;
- tree *body_p = &DECL_SAVED_TREE (current_function_decl);
- tree bind = *body_p;
- tree_stmt_iterator i;
- tree t, x;
-
- gcc_assert (TREE_CODE (bind) == BIND_EXPR);
+ gimple_seq body = gimple_body (current_function_decl);
+ gimple_seq lowered_body;
+ gimple_stmt_iterator i;
+ gimple bind;
+ tree t;
+ gimple x;
+
+ /* The gimplifier should've left a body of exactly one statement,
+ namely a GIMPLE_BIND. */
+ gcc_assert (gimple_seq_first (body) == gimple_seq_last (body)
+ && gimple_code (gimple_seq_first_stmt (body)) == GIMPLE_BIND);
memset (&data, 0, sizeof (data));
data.block = DECL_INITIAL (current_function_decl);
BLOCK_SUBBLOCKS (data.block) = NULL_TREE;
BLOCK_CHAIN (data.block) = NULL_TREE;
TREE_ASM_WRITTEN (data.block) = 1;
+ data.return_statements = VEC_alloc (return_statements_t, heap, 8);
+
+ bind = gimple_seq_first_stmt (body);
+ lowered_body = NULL;
+ gimple_seq_add_stmt (&lowered_body, bind);
+ i = gsi_start (lowered_body);
+ lower_gimple_bind (&i, &data);
- *body_p = alloc_stmt_list ();
- i = tsi_start (*body_p);
- tsi_link_after (&i, bind, TSI_NEW_STMT);
- lower_bind_expr (&i, &data);
+ /* Once the old body has been lowered, replace it with the new
+ lowered sequence. */
+ gimple_set_body (current_function_decl, lowered_body);
- i = tsi_last (*body_p);
+ i = gsi_last (lowered_body);
/* If the function falls off the end, we need a null return statement.
- If we've already got one in the return_statements list, we don't
+ If we've already got one in the return_statements vector, we don't
need to do anything special. Otherwise build one by hand. */
- if (block_may_fallthru (*body_p)
- && (data.return_statements == NULL
- || TREE_OPERAND (TREE_VALUE (data.return_statements), 0) != NULL))
+ if (gimple_seq_may_fallthru (lowered_body)
+ && (VEC_empty (return_statements_t, data.return_statements)
+ || gimple_return_retval (VEC_last (return_statements_t,
+ data.return_statements)->stmt) != NULL))
{
- x = build1 (RETURN_EXPR, void_type_node, NULL);
- SET_EXPR_LOCATION (x, cfun->function_end_locus);
- tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
+ x = gimple_build_return (NULL);
+ gimple_set_location (x, cfun->function_end_locus);
+ gsi_insert_after (&i, x, GSI_CONTINUE_LINKING);
}
/* If we lowered any return statements, emit the representative
at the end of the function. */
- for (t = data.return_statements ; t ; t = TREE_CHAIN (t))
+ while (!VEC_empty (return_statements_t, data.return_statements))
{
- x = build1 (LABEL_EXPR, void_type_node, TREE_PURPOSE (t));
- tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
+ return_statements_t t;
+
+ /* Unfortunately, we can't use VEC_pop because it returns void for
+ objects. */
+ t = *VEC_last (return_statements_t, data.return_statements);
+ VEC_truncate (return_statements_t,
+ data.return_statements,
+ VEC_length (return_statements_t,
+ data.return_statements) - 1);
+
+ x = gimple_build_label (t.label);
+ gsi_insert_after (&i, x, GSI_CONTINUE_LINKING);
/* Remove the line number from the representative return statement.
It now fills in for many such returns. Failure to remove this
will result in incorrect results for coverage analysis. */
- x = TREE_VALUE (t);
- SET_EXPR_LOCATION (x, UNKNOWN_LOCATION);
- tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
+ gimple_set_location (t.stmt, UNKNOWN_LOCATION);
+ gsi_insert_after (&i, t.stmt, GSI_CONTINUE_LINKING);
}
/* If the function calls __builtin_setjmp, we need to emit the computed
@@ -123,21 +171,21 @@ lower_function_body (void)
/* This mark will create forward edges from every call site. */
DECL_NONLOCAL (disp_label) = 1;
cfun->has_nonlocal_label = 1;
- x = build1 (LABEL_EXPR, void_type_node, disp_label);
- tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
+ x = gimple_build_label (disp_label);
+ gsi_insert_after (&i, x, GSI_CONTINUE_LINKING);
/* Build 'DISP_VAR = __builtin_setjmp_dispatcher (DISP_LABEL);'
and insert. */
disp_var = create_tmp_var (ptr_type_node, "setjmpvar");
arg = build_addr (disp_label, current_function_decl);
t = implicit_built_in_decls[BUILT_IN_SETJMP_DISPATCHER];
- t = build_call_expr (t, 1, arg);
- x = build_gimple_modify_stmt (disp_var, t);
+ x = gimple_build_call (t, 1, arg);
+ gimple_call_set_lhs (x, disp_var);
/* Build 'goto DISP_VAR;' and insert. */
- tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
- x = build1 (GOTO_EXPR, void_type_node, disp_var);
- tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
+ gsi_insert_after (&i, x, GSI_CONTINUE_LINKING);
+ x = gimple_build_goto (disp_var);
+ gsi_insert_after (&i, x, GSI_CONTINUE_LINKING);
}
gcc_assert (data.block == DECL_INITIAL (current_function_decl));
@@ -145,6 +193,7 @@ lower_function_body (void)
= blocks_nreverse (BLOCK_SUBBLOCKS (data.block));
clear_block_marks (data.block);
+ VEC_free(return_statements_t, heap, data.return_statements);
return 0;
}
@@ -168,134 +217,131 @@ struct gimple_opt_pass pass_lower_cf =
};
-/* Lower the EXPR. Unlike gimplification the statements are not relowered
+/* Lower sequence SEQ. Unlike gimplification the statements are not relowered
when they are changed -- if this has to be done, the lowering routine must
do it explicitly. DATA is passed through the recursion. */
static void
-lower_stmt_body (tree expr, struct lower_data *data)
+lower_sequence (gimple_seq seq, struct lower_data *data)
{
- tree_stmt_iterator tsi;
+ gimple_stmt_iterator gsi;
- for (tsi = tsi_start (expr); !tsi_end_p (tsi); )
- lower_stmt (&tsi, data);
+ for (gsi = gsi_start (seq); !gsi_end_p (gsi); )
+ lower_stmt (&gsi, data);
}
-/* Lower the OpenMP directive statement pointed by TSI. DATA is
+/* Lower the OpenMP directive statement pointed by GSI. DATA is
passed through the recursion. */
static void
-lower_omp_directive (tree_stmt_iterator *tsi, struct lower_data *data)
+lower_omp_directive (gimple_stmt_iterator *gsi, struct lower_data *data)
{
- tree stmt;
+ gimple stmt;
- stmt = tsi_stmt (*tsi);
+ stmt = gsi_stmt (*gsi);
- lower_stmt_body (OMP_BODY (stmt), data);
- tsi_link_before (tsi, stmt, TSI_SAME_STMT);
- tsi_link_before (tsi, OMP_BODY (stmt), TSI_SAME_STMT);
- OMP_BODY (stmt) = NULL_TREE;
- tsi_delink (tsi);
+ lower_sequence (gimple_omp_body (stmt), data);
+ gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
+ gsi_insert_seq_before (gsi, gimple_omp_body (stmt), GSI_SAME_STMT);
+ gimple_omp_set_body (stmt, NULL);
+ gsi_remove (gsi, false);
}
-/* Lower statement TSI. DATA is passed through the recursion. */
+/* Lower statement GSI. DATA is passed through the recursion. */
static void
-lower_stmt (tree_stmt_iterator *tsi, struct lower_data *data)
+lower_stmt (gimple_stmt_iterator *gsi, struct lower_data *data)
{
- tree stmt = tsi_stmt (*tsi);
+ gimple stmt = gsi_stmt (*gsi);
- if (EXPR_HAS_LOCATION (stmt) && data)
- TREE_BLOCK (stmt) = data->block;
+ gimple_set_block (stmt, data->block);
- switch (TREE_CODE (stmt))
+ switch (gimple_code (stmt))
{
- case BIND_EXPR:
- lower_bind_expr (tsi, data);
- return;
- case COND_EXPR:
- lower_cond_expr (tsi, data);
- return;
- case RETURN_EXPR:
- lower_return_expr (tsi, data);
+ case GIMPLE_BIND:
+ lower_gimple_bind (gsi, data);
return;
- case TRY_FINALLY_EXPR:
- case TRY_CATCH_EXPR:
- lower_stmt_body (TREE_OPERAND (stmt, 0), data);
- lower_stmt_body (TREE_OPERAND (stmt, 1), data);
+ case GIMPLE_COND:
+ /* The gimplifier has already lowered this into gotos. */
break;
- case CATCH_EXPR:
- lower_stmt_body (CATCH_BODY (stmt), data);
+
+ case GIMPLE_RETURN:
+ lower_gimple_return (gsi, data);
+ return;
+
+ case GIMPLE_TRY:
+ lower_sequence (gimple_try_eval (stmt), data);
+ lower_sequence (gimple_try_cleanup (stmt), data);
break;
- case EH_FILTER_EXPR:
- lower_stmt_body (EH_FILTER_FAILURE (stmt), data);
+
+ case GIMPLE_CATCH:
+ lower_sequence (gimple_catch_handler (stmt), data);
break;
-
- case NOP_EXPR:
- case ASM_EXPR:
- case GOTO_EXPR:
- case PREDICT_EXPR:
- case LABEL_EXPR:
- case SWITCH_EXPR:
- case CHANGE_DYNAMIC_TYPE_EXPR:
- case OMP_FOR:
- case OMP_SECTIONS:
- case OMP_SECTIONS_SWITCH:
- case OMP_SECTION:
- case OMP_SINGLE:
- case OMP_MASTER:
- case OMP_ORDERED:
- case OMP_CRITICAL:
- case OMP_RETURN:
- case OMP_ATOMIC_LOAD:
- case OMP_ATOMIC_STORE:
- case OMP_CONTINUE:
+
+ case GIMPLE_EH_FILTER:
+ lower_sequence (gimple_eh_filter_failure (stmt), data);
break;
- case GIMPLE_MODIFY_STMT:
- if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == CALL_EXPR)
- stmt = GIMPLE_STMT_OPERAND (stmt, 1);
- else
- break;
- /* FALLTHRU */
+ case GIMPLE_NOP:
+ case GIMPLE_ASM:
+ case GIMPLE_ASSIGN:
+ case GIMPLE_GOTO:
+ case GIMPLE_PREDICT:
+ case GIMPLE_LABEL:
+ case GIMPLE_SWITCH:
+ case GIMPLE_CHANGE_DYNAMIC_TYPE:
+ case GIMPLE_OMP_FOR:
+ case GIMPLE_OMP_SECTIONS:
+ case GIMPLE_OMP_SECTIONS_SWITCH:
+ case GIMPLE_OMP_SECTION:
+ case GIMPLE_OMP_SINGLE:
+ case GIMPLE_OMP_MASTER:
+ case GIMPLE_OMP_ORDERED:
+ case GIMPLE_OMP_CRITICAL:
+ case GIMPLE_OMP_RETURN:
+ case GIMPLE_OMP_ATOMIC_LOAD:
+ case GIMPLE_OMP_ATOMIC_STORE:
+ case GIMPLE_OMP_CONTINUE:
+ break;
- case CALL_EXPR:
+ case GIMPLE_CALL:
{
- tree decl = get_callee_fndecl (stmt);
+ tree decl = gimple_call_fndecl (stmt);
+
if (decl
&& DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
&& DECL_FUNCTION_CODE (decl) == BUILT_IN_SETJMP)
{
data->calls_builtin_setjmp = true;
- lower_builtin_setjmp (tsi);
+ lower_builtin_setjmp (gsi);
return;
}
}
break;
- case OMP_PARALLEL:
- case OMP_TASK:
- lower_omp_directive (tsi, data);
+ case GIMPLE_OMP_PARALLEL:
+ case GIMPLE_OMP_TASK:
+ lower_omp_directive (gsi, data);
return;
default:
gcc_unreachable ();
}
- tsi_next (tsi);
+ gsi_next (gsi);
}
/* Lower a bind_expr TSI. DATA is passed through the recursion. */
static void
-lower_bind_expr (tree_stmt_iterator *tsi, struct lower_data *data)
+lower_gimple_bind (gimple_stmt_iterator *gsi, struct lower_data *data)
{
tree old_block = data->block;
- tree stmt = tsi_stmt (*tsi);
- tree new_block = BIND_EXPR_BLOCK (stmt);
+ gimple stmt = gsi_stmt (*gsi);
+ tree new_block = gimple_bind_block (stmt);
if (new_block)
{
@@ -325,8 +371,8 @@ lower_bind_expr (tree_stmt_iterator *tsi, struct lower_data *data)
}
}
- record_vars (BIND_EXPR_VARS (stmt));
- lower_stmt_body (BIND_EXPR_BODY (stmt), data);
+ record_vars (gimple_bind_vars (stmt));
+ lower_sequence (gimple_bind_body (stmt), data);
if (new_block)
{
@@ -337,9 +383,9 @@ lower_bind_expr (tree_stmt_iterator *tsi, struct lower_data *data)
data->block = old_block;
}
- /* The BIND_EXPR no longer carries any useful information -- kill it. */
- tsi_link_before (tsi, BIND_EXPR_BODY (stmt), TSI_SAME_STMT);
- tsi_delink (tsi);
+ /* The GIMPLE_BIND no longer carries any useful information -- kill it. */
+ gsi_insert_seq_before (gsi, gimple_bind_body (stmt), GSI_SAME_STMT);
+ gsi_remove (gsi, false);
}
/* Try to determine whether a TRY_CATCH expression can fall through.
@@ -390,6 +436,58 @@ try_catch_may_fallthru (const_tree stmt)
}
}
+
+/* Same as above, but for a GIMPLE_TRY_CATCH. */
+
+static bool
+gimple_try_catch_may_fallthru (gimple stmt)
+{
+ gimple_stmt_iterator i;
+
+ /* We don't handle GIMPLE_TRY_FINALLY. */
+ gcc_assert (gimple_try_kind (stmt) == GIMPLE_TRY_CATCH);
+
+ /* If the TRY block can fall through, the whole TRY_CATCH can
+ fall through. */
+ if (gimple_seq_may_fallthru (gimple_try_eval (stmt)))
+ return true;
+
+ i = gsi_start (gimple_try_cleanup (stmt));
+ switch (gimple_code (gsi_stmt (i)))
+ {
+ case GIMPLE_CATCH:
+ /* We expect to see a sequence of GIMPLE_CATCH stmts, each with a
+ catch expression and a body. The whole try/catch may fall
+ through iff any of the catch bodies falls through. */
+ for (; !gsi_end_p (i); gsi_next (&i))
+ {
+ if (gimple_seq_may_fallthru (gimple_catch_handler (gsi_stmt (i))))
+ return true;
+ }
+ return false;
+
+ case GIMPLE_EH_FILTER:
+ /* The exception filter expression only matters if there is an
+ exception. If the exception does not match EH_FILTER_TYPES,
+ we will execute EH_FILTER_FAILURE, and we will fall through
+ if that falls through. If the exception does match
+ EH_FILTER_TYPES, the stack unwinder will continue up the
+ stack, so we will not fall through. We don't know whether we
+ will throw an exception which matches EH_FILTER_TYPES or not,
+ so we just ignore EH_FILTER_TYPES and assume that we might
+ throw an exception which doesn't match. */
+ return gimple_seq_may_fallthru (gimple_eh_filter_failure (gsi_stmt (i)));
+
+ default:
+ /* This case represents statements to be executed when an
+ exception occurs. Those statements are implicitly followed
+ by a GIMPLE_RESX to resume execution after the exception. So
+ in this case the try/catch never falls through. */
+ return false;
+ }
+}
+
+
/* Try to determine if we can fall out of the bottom of BLOCK. This guess
need not be 100% accurate; simply be conservative and return true if we
don't know. This is used only to avoid stupidly generating extra code.
@@ -398,7 +496,7 @@ try_catch_may_fallthru (const_tree stmt)
bool
block_may_fallthru (const_tree block)
{
- /* This CONST_CAST is okay because expr_last returns it's argument
+ /* This CONST_CAST is okay because expr_last returns its argument
unmodified and we assign it to a const_tree. */
const_tree stmt = expr_last (CONST_CAST_TREE(block));
@@ -440,9 +538,9 @@ block_may_fallthru (const_tree block)
return (block_may_fallthru (TREE_OPERAND (stmt, 0))
&& block_may_fallthru (TREE_OPERAND (stmt, 1)));
- case GIMPLE_MODIFY_STMT:
- if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == CALL_EXPR)
- stmt = GIMPLE_STMT_OPERAND (stmt, 1);
+ case MODIFY_EXPR:
+ if (TREE_CODE (TREE_OPERAND (stmt, 1)) == CALL_EXPR)
+ stmt = TREE_OPERAND (stmt, 1);
else
return true;
/* FALLTHRU */
@@ -459,138 +557,110 @@ block_may_fallthru (const_tree block)
}
}
-/* Lower a cond_expr TSI. DATA is passed through the recursion. */
-static void
-lower_cond_expr (tree_stmt_iterator *tsi, struct lower_data *data)
+/* Try to determine if we can continue executing the statement
+ immediately following STMT. This guess need not be 100% accurate;
+ simply be conservative and return true if we don't know. This is
+ used only to avoid stupidly generating extra code. If we're wrong,
+ we'll just delete the extra code later. */
+
+bool
+gimple_stmt_may_fallthru (gimple stmt)
{
- tree stmt = tsi_stmt (*tsi);
- bool then_is_goto, else_is_goto;
- tree then_branch, else_branch;
- tree then_goto, else_goto;
-
- then_branch = COND_EXPR_THEN (stmt);
- else_branch = COND_EXPR_ELSE (stmt);
+ if (!stmt)
+ return true;
- lower_stmt_body (then_branch, data);
- lower_stmt_body (else_branch, data);
+ switch (gimple_code (stmt))
+ {
+ case GIMPLE_GOTO:
+ case GIMPLE_RETURN:
+ case GIMPLE_RESX:
+ /* Easy cases. If the last statement of the seq implies
+ control transfer, then we can't fall through. */
+ return false;
- then_goto = expr_only (then_branch);
- then_is_goto = then_goto && simple_goto_p (then_goto);
+ case GIMPLE_SWITCH:
+ /* Switch has already been lowered and represents a
+ branch to a selected label and hence can not fall through. */
+ return true;
- else_goto = expr_only (else_branch);
- else_is_goto = else_goto && simple_goto_p (else_goto);
+ case GIMPLE_COND:
+ /* GIMPLE_COND's are already lowered into a two-way branch. They
+ can't fall through. */
+ return false;
- if (!then_is_goto || !else_is_goto)
- {
- tree then_label, else_label, end_label, t;
-
- then_label = NULL_TREE;
- else_label = NULL_TREE;
- end_label = NULL_TREE;
-
- /* Replace the cond_expr with explicit gotos. */
- if (!then_is_goto)
- {
- t = build1 (LABEL_EXPR, void_type_node, NULL_TREE);
- if (TREE_SIDE_EFFECTS (then_branch))
- then_label = t;
- else
- end_label = t;
- then_goto = build_and_jump (&LABEL_EXPR_LABEL (t));
- }
+ case GIMPLE_BIND:
+ return gimple_seq_may_fallthru (gimple_bind_body (stmt));
- if (!else_is_goto)
- {
- t = build1 (LABEL_EXPR, void_type_node, NULL_TREE);
- if (TREE_SIDE_EFFECTS (else_branch))
- else_label = t;
- else
- {
- /* Both THEN and ELSE can be no-ops if one or both contained an
- empty BIND_EXPR that was associated with the toplevel block
- of an inlined function. In that case remove_useless_stmts
- can't have cleaned things up for us; kill the whole
- conditional now. */
- if (end_label)
- {
- tsi_delink (tsi);
- return;
- }
- else
- end_label = t;
- }
- else_goto = build_and_jump (&LABEL_EXPR_LABEL (t));
- }
+ case GIMPLE_TRY:
+ if (gimple_try_kind (stmt) == GIMPLE_TRY_CATCH)
+ return gimple_try_catch_may_fallthru (stmt);
- if (then_label)
- {
- bool may_fallthru = block_may_fallthru (then_branch);
+ /* It must be a GIMPLE_TRY_FINALLY. */
- tsi_link_after (tsi, then_label, TSI_CONTINUE_LINKING);
- tsi_link_after (tsi, then_branch, TSI_CONTINUE_LINKING);
-
- if (else_label && may_fallthru)
- {
- end_label = build1 (LABEL_EXPR, void_type_node, NULL_TREE);
- t = build_and_jump (&LABEL_EXPR_LABEL (end_label));
- tsi_link_after (tsi, t, TSI_CONTINUE_LINKING);
- }
- }
-
- if (else_label)
- {
- tsi_link_after (tsi, else_label, TSI_CONTINUE_LINKING);
- tsi_link_after (tsi, else_branch, TSI_CONTINUE_LINKING);
- }
+ /* The finally clause is always executed after the try clause,
+ so if it does not fall through, then the try-finally will not
+ fall through. Otherwise, if the try clause does not fall
+ through, then when the finally clause falls through it will
+ resume execution wherever the try clause was going. So the
+ whole try-finally will only fall through if both the try
+ clause and the finally clause fall through. */
+ return (gimple_seq_may_fallthru (gimple_try_eval (stmt))
+ && gimple_seq_may_fallthru (gimple_try_cleanup (stmt)));
+
+ case GIMPLE_ASSIGN:
+ return true;
- if (end_label)
- tsi_link_after (tsi, end_label, TSI_CONTINUE_LINKING);
+ case GIMPLE_CALL:
+ /* Functions that do not return do not fall through. */
+ return (gimple_call_flags (stmt) & ECF_NORETURN) == 0;
+
+ default:
+ return true;
}
+}
+
- COND_EXPR_THEN (stmt) = then_goto;
- COND_EXPR_ELSE (stmt) = else_goto;
+/* Same as gimple_stmt_may_fallthru, but for the gimple sequence SEQ. */
- tsi_next (tsi);
+bool
+gimple_seq_may_fallthru (gimple_seq seq)
+{
+ return gimple_stmt_may_fallthru (gimple_seq_last_stmt (seq));
}
-/* Lower a return_expr TSI. DATA is passed through the recursion. */
+
+/* Lower a GIMPLE_RETURN GSI. DATA is passed through the recursion. */
static void
-lower_return_expr (tree_stmt_iterator *tsi, struct lower_data *data)
+lower_gimple_return (gimple_stmt_iterator *gsi, struct lower_data *data)
{
- tree stmt = tsi_stmt (*tsi);
- tree value, t, label;
-
- /* Extract the value being returned. */
- value = TREE_OPERAND (stmt, 0);
- if (value && TREE_CODE (value) == GIMPLE_MODIFY_STMT)
- value = GIMPLE_STMT_OPERAND (value, 1);
+ gimple stmt = gsi_stmt (*gsi);
+ gimple t;
+ int i;
+ return_statements_t tmp_rs;
/* Match this up with an existing return statement that's been created. */
- for (t = data->return_statements; t ; t = TREE_CHAIN (t))
+ for (i = VEC_length (return_statements_t, data->return_statements) - 1;
+ i >= 0; i--)
{
- tree tvalue = TREE_OPERAND (TREE_VALUE (t), 0);
- if (tvalue && TREE_CODE (tvalue) == GIMPLE_MODIFY_STMT)
- tvalue = GIMPLE_STMT_OPERAND (tvalue, 1);
+ tmp_rs = *VEC_index (return_statements_t, data->return_statements, i);
- if (value == tvalue)
- {
- label = TREE_PURPOSE (t);
- goto found;
- }
+ if (gimple_return_retval (stmt) == gimple_return_retval (tmp_rs.stmt))
+ goto found;
}
/* Not found. Create a new label and record the return statement. */
- label = create_artificial_label ();
- data->return_statements = tree_cons (label, stmt, data->return_statements);
+ tmp_rs.label = create_artificial_label ();
+ tmp_rs.stmt = stmt;
+ VEC_safe_push (return_statements_t, heap, data->return_statements, &tmp_rs);
/* Generate a goto statement and remove the return statement. */
found:
- t = build1 (GOTO_EXPR, void_type_node, label);
- SET_EXPR_LOCUS (t, EXPR_LOCUS (stmt));
- tsi_link_before (tsi, t, TSI_SAME_STMT);
- tsi_delink (tsi);
+ t = gimple_build_goto (tmp_rs.label);
+ gimple_set_location (t, gimple_location (stmt));
+ gsi_insert_before (gsi, t, GSI_SAME_STMT);
+ gsi_remove (gsi, false);
}
/* Lower a __builtin_setjmp TSI.
@@ -647,71 +717,66 @@ lower_return_expr (tree_stmt_iterator *tsi, struct lower_data *data)
to the receivers, thus keeping the complexity explosion localized. */
static void
-lower_builtin_setjmp (tree_stmt_iterator *tsi)
+lower_builtin_setjmp (gimple_stmt_iterator *gsi)
{
- tree stmt = tsi_stmt (*tsi);
+ gimple stmt = gsi_stmt (*gsi);
tree cont_label = create_artificial_label ();
tree next_label = create_artificial_label ();
tree dest, t, arg;
+ gimple g;
/* NEXT_LABEL is the label __builtin_longjmp will jump to. Its address is
passed to both __builtin_setjmp_setup and __builtin_setjmp_receiver. */
FORCED_LABEL (next_label) = 1;
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
- {
- dest = GIMPLE_STMT_OPERAND (stmt, 0);
- stmt = GIMPLE_STMT_OPERAND (stmt, 1);
- }
- else
- dest = NULL_TREE;
+ dest = gimple_call_lhs (stmt);
/* Build '__builtin_setjmp_setup (BUF, NEXT_LABEL)' and insert. */
arg = build_addr (next_label, current_function_decl);
t = implicit_built_in_decls[BUILT_IN_SETJMP_SETUP];
- t = build_call_expr (t, 2, CALL_EXPR_ARG (stmt, 0), arg);
- SET_EXPR_LOCUS (t, EXPR_LOCUS (stmt));
- tsi_link_before (tsi, t, TSI_SAME_STMT);
+ g = gimple_build_call (t, 2, gimple_call_arg (stmt, 0), arg);
+ gimple_set_location (g, gimple_location (stmt));
+ gsi_insert_before (gsi, g, GSI_SAME_STMT);
/* Build 'DEST = 0' and insert. */
if (dest)
{
- t = build_gimple_modify_stmt (dest, fold_convert (TREE_TYPE (dest),
- integer_zero_node));
- SET_EXPR_LOCUS (t, EXPR_LOCUS (stmt));
- tsi_link_before (tsi, t, TSI_SAME_STMT);
+ g = gimple_build_assign (dest, fold_convert (TREE_TYPE (dest),
+ integer_zero_node));
+ gimple_set_location (g, gimple_location (stmt));
+ gsi_insert_before (gsi, g, GSI_SAME_STMT);
}
/* Build 'goto CONT_LABEL' and insert. */
- t = build1 (GOTO_EXPR, void_type_node, cont_label);
- tsi_link_before (tsi, t, TSI_SAME_STMT);
+ g = gimple_build_goto (cont_label);
+ gsi_insert_before (gsi, g, TSI_SAME_STMT);
/* Build 'NEXT_LABEL:' and insert. */
- t = build1 (LABEL_EXPR, void_type_node, next_label);
- tsi_link_before (tsi, t, TSI_SAME_STMT);
+ g = gimple_build_label (next_label);
+ gsi_insert_before (gsi, g, GSI_SAME_STMT);
/* Build '__builtin_setjmp_receiver (NEXT_LABEL)' and insert. */
arg = build_addr (next_label, current_function_decl);
t = implicit_built_in_decls[BUILT_IN_SETJMP_RECEIVER];
- t = build_call_expr (t, 1, arg);
- SET_EXPR_LOCUS (t, EXPR_LOCUS (stmt));
- tsi_link_before (tsi, t, TSI_SAME_STMT);
+ g = gimple_build_call (t, 1, arg);
+ gimple_set_location (g, gimple_location (stmt));
+ gsi_insert_before (gsi, g, GSI_SAME_STMT);
/* Build 'DEST = 1' and insert. */
if (dest)
{
- t = build_gimple_modify_stmt (dest, fold_convert (TREE_TYPE (dest),
- integer_one_node));
- SET_EXPR_LOCUS (t, EXPR_LOCUS (stmt));
- tsi_link_before (tsi, t, TSI_SAME_STMT);
+ g = gimple_build_assign (dest, fold_convert (TREE_TYPE (dest),
+ integer_one_node));
+ gimple_set_location (g, gimple_location (stmt));
+ gsi_insert_before (gsi, g, GSI_SAME_STMT);
}
/* Build 'CONT_LABEL:' and insert. */
- t = build1 (LABEL_EXPR, void_type_node, cont_label);
- tsi_link_before (tsi, t, TSI_SAME_STMT);
+ g = gimple_build_label (cont_label);
+ gsi_insert_before (gsi, g, GSI_SAME_STMT);
/* Remove the call to __builtin_setjmp. */
- tsi_delink (tsi);
+ gsi_remove (gsi, false);
}
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index b6bc9ca79a5..b0b5e78968d 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -28,7 +28,8 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "rtl.h"
#include "varray.h"
-#include "tree-gimple.h"
+#include "gimple.h"
+#include "tree-iterator.h"
#include "tree-inline.h"
#include "diagnostic.h"
#include "langhooks.h"
@@ -49,6 +50,8 @@ along with GCC; see the file COPYING3. If not see
#include "optabs.h"
#include "pointer-set.h"
#include "splay-tree.h"
+#include "vec.h"
+#include "gimple.h"
enum gimplify_omp_var_data
@@ -67,6 +70,7 @@ enum gimplify_omp_var_data
| GOVD_LASTPRIVATE | GOVD_REDUCTION | GOVD_LOCAL)
};
+
enum omp_region_type
{
ORT_WORKSHARE = 0,
@@ -89,7 +93,6 @@ static struct gimplify_ctx *gimplify_ctxp;
static struct gimplify_omp_ctx *gimplify_omp_ctxp;
-
/* Formal (expression) temporary table handling: Multiple occurrences of
the same scalar expression are evaluated into the same temporary. */
@@ -100,7 +103,7 @@ typedef struct gimple_temp_hash_elt
} elt_t;
/* Forward declarations. */
-static enum gimplify_status gimplify_compound_expr (tree *, tree *, bool);
+static enum gimplify_status gimplify_compound_expr (tree *, gimple_seq *, bool);
/* Mark X addressable. Unlike the langhook we expect X to be in gimple
form and we don't do any syntax checking. */
@@ -146,6 +149,49 @@ gimple_tree_eq (const void *p1, const void *p2)
return 1;
}
+/* Link gimple statement GS to the end of the sequence *SEQ_P. If
+ *SEQ_P is NULL, a new sequence is allocated. This function is
+ similar to gimple_seq_add_stmt, but does not scan the operands.
+ During gimplification, we need to manipulate statement sequences
+ before the def/use vectors have been constructed. */
+
+static void
+gimplify_seq_add_stmt (gimple_seq *seq_p, gimple gs)
+{
+ gimple_stmt_iterator si;
+
+ if (gs == NULL)
+ return;
+
+ if (*seq_p == NULL)
+ *seq_p = gimple_seq_alloc ();
+
+ si = gsi_last (*seq_p);
+
+ gsi_insert_after_without_update (&si, gs, GSI_NEW_STMT);
+}
+
+/* Append sequence SRC to the end of sequence *DST_P. If *DST_P is
+ NULL, a new sequence is allocated. This function is
+ similar to gimple_seq_add_seq, but does not scan the operands.
+ During gimplification, we need to manipulate statement sequences
+ before the def/use vectors have been constructed. */
+
+static void
+gimplify_seq_add_seq (gimple_seq *dst_p, gimple_seq src)
+{
+ gimple_stmt_iterator si;
+
+ if (src == NULL)
+ return;
+
+ if (*dst_p == NULL)
+ *dst_p = gimple_seq_alloc ();
+
+ si = gsi_last (*dst_p);
+ gsi_insert_seq_after_without_update (&si, src, GSI_NEW_STMT);
+}
+
/* Set up a context for the gimplifier. */
void
@@ -158,15 +204,18 @@ push_gimplify_context (struct gimplify_ctx *c)
/* Tear down a context for the gimplifier. If BODY is non-null, then
put the temporaries into the outer BIND_EXPR. Otherwise, put them
- in the local_decls. */
+ in the local_decls.
+
+ BODY is not a sequence, but the first tuple in a sequence. */
void
-pop_gimplify_context (tree body)
+pop_gimplify_context (gimple body)
{
struct gimplify_ctx *c = gimplify_ctxp;
tree t;
- gcc_assert (c && !c->current_bind_expr);
+ gcc_assert (c && (c->bind_expr_stack == NULL
+ || VEC_empty (gimple, c->bind_expr_stack)));
gimplify_ctxp = c->prev_context;
for (t = c->temps; t ; t = TREE_CHAIN (t))
@@ -182,23 +231,31 @@ pop_gimplify_context (tree body)
}
static void
-gimple_push_bind_expr (tree bind)
+gimple_push_bind_expr (gimple gimple_bind)
{
- TREE_CHAIN (bind) = gimplify_ctxp->current_bind_expr;
- gimplify_ctxp->current_bind_expr = bind;
+ if (gimplify_ctxp->bind_expr_stack == NULL)
+ gimplify_ctxp->bind_expr_stack = VEC_alloc (gimple, heap, 8);
+ VEC_safe_push (gimple, heap, gimplify_ctxp->bind_expr_stack, gimple_bind);
}
static void
gimple_pop_bind_expr (void)
{
- gimplify_ctxp->current_bind_expr
- = TREE_CHAIN (gimplify_ctxp->current_bind_expr);
+ VEC_pop (gimple, gimplify_ctxp->bind_expr_stack);
}
-tree
+gimple
gimple_current_bind_expr (void)
{
- return gimplify_ctxp->current_bind_expr;
+ return VEC_last (gimple, gimplify_ctxp->bind_expr_stack);
+}
+
+/* Return the stack GIMPLE_BINDs created during gimplification. */
+
+VEC(gimple, heap) *
+gimple_bind_expr_stack (void)
+{
+ return gimplify_ctxp->bind_expr_stack;
}
/* Returns true iff there is a COND_EXPR between us and the innermost
@@ -215,9 +272,9 @@ gimple_conditional_context (void)
static void
gimple_push_condition (void)
{
-#ifdef ENABLE_CHECKING
+#ifdef ENABLE_GIMPLE_CHECKING
if (gimplify_ctxp->conditions == 0)
- gcc_assert (!gimplify_ctxp->conditional_cleanups);
+ gcc_assert (gimple_seq_empty_p (gimplify_ctxp->conditional_cleanups));
#endif
++(gimplify_ctxp->conditions);
}
@@ -226,15 +283,15 @@ gimple_push_condition (void)
now, add any conditional cleanups we've seen to the prequeue. */
static void
-gimple_pop_condition (tree *pre_p)
+gimple_pop_condition (gimple_seq *pre_p)
{
int conds = --(gimplify_ctxp->conditions);
gcc_assert (conds >= 0);
if (conds == 0)
{
- append_to_statement_list (gimplify_ctxp->conditional_cleanups, pre_p);
- gimplify_ctxp->conditional_cleanups = NULL_TREE;
+ gimplify_seq_add_seq (pre_p, gimplify_ctxp->conditional_cleanups);
+ gimplify_ctxp->conditional_cleanups = NULL;
}
}
@@ -324,13 +381,34 @@ append_to_statement_list_force (tree t, tree *list_p)
append_to_statement_list_1 (t, list_p);
}
-/* Both gimplify the statement T and append it to LIST_P. */
+/* Both gimplify the statement T and append it to *SEQ_P. This function
+ behaves exactly as gimplify_stmt, but you don't have to pass T as a
+ reference. */
void
-gimplify_and_add (tree t, tree *list_p)
+gimplify_and_add (tree t, gimple_seq *seq_p)
+{
+ gimplify_stmt (&t, seq_p);
+}
+
+/* Gimplify statement T into sequence *SEQ_P, and return the first
+ tuple in the sequence of generated tuples for this statement.
+ Return NULL if gimplifying T produced no tuples. */
+
+static gimple
+gimplify_and_return_first (tree t, gimple_seq *seq_p)
{
- gimplify_stmt (&t);
- append_to_statement_list (t, list_p);
+ gimple_stmt_iterator last = gsi_last (*seq_p);
+
+ gimplify_and_add (t, seq_p);
+
+ if (!gsi_end_p (last))
+ {
+ gsi_next (&last);
+ return gsi_stmt (last);
+ }
+ else
+ return gimple_seq_first_stmt (*seq_p);
}
/* Strip off a legitimate source ending from the input string NAME of
@@ -353,20 +431,6 @@ remove_suffix (char *name, int len)
}
}
-/* Create a nameless artificial label and put it in the current function
- context. Returns the newly created label. */
-
-tree
-create_artificial_label (void)
-{
- tree lab = build_decl (LABEL_DECL, NULL_TREE, void_type_node);
-
- DECL_ARTIFICIAL (lab) = 1;
- DECL_IGNORED_P (lab) = 1;
- DECL_CONTEXT (lab) = current_function_decl;
- return lab;
-}
-
/* Subroutine for find_single_pointer_decl. */
static tree
@@ -494,31 +558,6 @@ create_tmp_var (tree type, const char *prefix)
return tmp_var;
}
-/* Given a tree, try to return a useful variable name that we can use
- to prefix a temporary that is being assigned the value of the tree.
- I.E. given <temp> = &A, return A. */
-
-const char *
-get_name (const_tree t)
-{
- const_tree stripped_decl;
-
- stripped_decl = t;
- STRIP_NOPS (stripped_decl);
- if (DECL_P (stripped_decl) && DECL_NAME (stripped_decl))
- return IDENTIFIER_POINTER (DECL_NAME (stripped_decl));
- else
- {
- switch (TREE_CODE (stripped_decl))
- {
- case ADDR_EXPR:
- return get_name (TREE_OPERAND (stripped_decl, 0));
- default:
- return NULL;
- }
- }
-}
-
/* Create a temporary with a name derived from VAL. Subroutine of
lookup_tmp_var; nobody else should call this function. */
@@ -573,6 +612,62 @@ lookup_tmp_var (tree val, bool is_formal)
return ret;
}
+
+/* Return true if T is a CALL_EXPR or an expression that can be
+ assignmed to a temporary. Note that this predicate should only be
+ used during gimplification. See the rationale for this in
+ gimplify_modify_expr. */
+
+static bool
+is_gimple_formal_tmp_or_call_rhs (tree t)
+{
+ return TREE_CODE (t) == CALL_EXPR || is_gimple_formal_tmp_rhs (t);
+}
+
+/* Returns true iff T is a valid RHS for an assignment to a renamed
+ user -- or front-end generated artificial -- variable. */
+
+static bool
+is_gimple_reg_or_call_rhs (tree t)
+{
+ /* If the RHS of the MODIFY_EXPR may throw or make a nonlocal goto
+ and the LHS is a user variable, then we need to introduce a formal
+ temporary. This way the optimizers can determine that the user
+ variable is only modified if evaluation of the RHS does not throw.
+
+ Don't force a temp of a non-renamable type; the copy could be
+ arbitrarily expensive. Instead we will generate a VDEF for
+ the assignment. */
+
+ if (is_gimple_reg_type (TREE_TYPE (t))
+ && ((TREE_CODE (t) == CALL_EXPR && TREE_SIDE_EFFECTS (t))
+ || tree_could_throw_p (t)))
+ return false;
+
+ return is_gimple_formal_tmp_or_call_rhs (t);
+}
+
+/* Return true if T is a valid memory RHS or a CALL_EXPR. Note that
+ this predicate should only be used during gimplification. See the
+ rationale for this in gimplify_modify_expr. */
+
+static bool
+is_gimple_mem_or_call_rhs (tree t)
+{
+ /* If we're dealing with a renamable type, either source or dest must be
+ a renamed variable. Also force a temporary if the type doesn't need
+ to be stored in memory, since it's cheap and prevents erroneous
+ tailcalls (PR 17526). */
+ if (is_gimple_reg_type (TREE_TYPE (t))
+ || (TYPE_MODE (TREE_TYPE (t)) != BLKmode
+ && (TREE_CODE (t) != CALL_EXPR
+ || ! aggregate_value_p (t, t))))
+ return is_gimple_val (t);
+ else
+ return is_gimple_formal_tmp_or_call_rhs (t);
+}
+
+
/* Returns a formal temporary variable initialized with VAL. PRE_P is as
in gimplify_expr. Only use this function if:
@@ -586,11 +681,15 @@ lookup_tmp_var (tree val, bool is_formal)
For other cases, use get_initialized_tmp_var instead. */
static tree
-internal_get_tmp_var (tree val, tree *pre_p, tree *post_p, bool is_formal)
+internal_get_tmp_var (tree val, gimple_seq *pre_p, gimple_seq *post_p,
+ bool is_formal)
{
tree t, mod;
- gimplify_expr (&val, pre_p, post_p, is_gimple_formal_tmp_rhs, fb_rvalue);
+ /* Notice that we explicitly allow VAL to be a CALL_EXPR so that we
+ can create an INIT_EXPR and convert it into a GIMPLE_CALL below. */
+ gimplify_expr (&val, pre_p, post_p, is_gimple_formal_tmp_or_call_rhs,
+ fb_rvalue);
t = lookup_tmp_var (val, is_formal);
@@ -625,21 +724,25 @@ internal_get_tmp_var (tree val, tree *pre_p, tree *post_p, bool is_formal)
/* gimplify_modify_expr might want to reduce this further. */
gimplify_and_add (mod, pre_p);
+ ggc_free (mod);
/* If we're gimplifying into ssa, gimplify_modify_expr will have
- given our temporary an ssa name. Find and return it. */
+ given our temporary an SSA name. Find and return it. */
if (gimplify_ctxp->into_ssa)
- t = TREE_OPERAND (mod, 0);
+ {
+ gimple last = gimple_seq_last_stmt (*pre_p);
+ t = gimple_get_lhs (last);
+ }
return t;
}
/* Returns a formal temporary variable initialized with VAL. PRE_P
- points to a statement list where side-effects needed to compute VAL
- should be stored. */
+ points to a sequence where side-effects needed to compute VAL should be
+ stored. */
tree
-get_formal_tmp_var (tree val, tree *pre_p)
+get_formal_tmp_var (tree val, gimple_seq *pre_p)
{
return internal_get_tmp_var (val, pre_p, NULL, true);
}
@@ -648,7 +751,7 @@ get_formal_tmp_var (tree val, tree *pre_p)
are as in gimplify_expr. */
tree
-get_initialized_tmp_var (tree val, tree *pre_p, tree *post_p)
+get_initialized_tmp_var (tree val, gimple_seq *pre_p, gimple_seq *post_p)
{
return internal_get_tmp_var (val, pre_p, post_p, false);
}
@@ -657,27 +760,23 @@ get_initialized_tmp_var (tree val, tree *pre_p, tree *post_p)
true, generate debug info for them; otherwise don't. */
void
-declare_vars (tree vars, tree scope, bool debug_info)
+declare_vars (tree vars, gimple scope, bool debug_info)
{
tree last = vars;
if (last)
{
tree temps, block;
- /* C99 mode puts the default 'return 0;' for main outside the outer
- braces. So drill down until we find an actual scope. */
- while (TREE_CODE (scope) == COMPOUND_EXPR)
- scope = TREE_OPERAND (scope, 0);
-
- gcc_assert (TREE_CODE (scope) == BIND_EXPR);
+ gcc_assert (gimple_code (scope) == GIMPLE_BIND);
temps = nreverse (last);
- block = BIND_EXPR_BLOCK (scope);
+ block = gimple_block (scope);
+ gcc_assert (!block || TREE_CODE (block) == BLOCK);
if (!block || !debug_info)
{
- TREE_CHAIN (last) = BIND_EXPR_VARS (scope);
- BIND_EXPR_VARS (scope) = temps;
+ TREE_CHAIN (last) = gimple_bind_vars (scope);
+ gimple_bind_set_vars (scope, temps);
}
else
{
@@ -689,7 +788,8 @@ declare_vars (tree vars, tree scope, bool debug_info)
BLOCK_VARS (block) = chainon (BLOCK_VARS (block), temps);
else
{
- BIND_EXPR_VARS (scope) = chainon (BIND_EXPR_VARS (scope), temps);
+ gimple_bind_set_vars (scope,
+ chainon (gimple_bind_vars (scope), temps));
BLOCK_VARS (block) = temps;
}
}
@@ -752,13 +852,34 @@ gimple_add_tmp_var (tree tmp)
else if (cfun)
record_vars (tmp);
else
- declare_vars (tmp, DECL_SAVED_TREE (current_function_decl), false);
+ {
+ gimple_seq body_seq;
+
+ /* This case is for nested functions. We need to expose the locals
+ they create. */
+ body_seq = gimple_body (current_function_decl);
+ declare_vars (tmp, gimple_seq_first_stmt (body_seq), false);
+ }
+}
+
+/* Determines whether to assign a location to the statement GS. */
+
+static bool
+should_carry_location_p (gimple gs)
+{
+ /* Don't emit a line note for a label. We particularly don't want to
+ emit one for the break label, since it doesn't actually correspond
+ to the beginning of the loop/switch. */
+ if (gimple_code (gs) == GIMPLE_LABEL)
+ return false;
+
+ return true;
}
-/* Determines whether to assign a locus to the statement STMT. */
+/* Same, but for a tree. */
static bool
-should_carry_locus_p (const_tree stmt)
+tree_should_carry_location_p (const_tree stmt)
{
/* Don't emit a line note for a label. We particularly don't want to
emit one for the break label, since it doesn't actually correspond
@@ -773,16 +894,87 @@ should_carry_locus_p (const_tree stmt)
return true;
}
+/* Return true if a location should not be emitted for this statement
+ by annotate_one_with_location. */
+
+static inline bool
+gimple_do_not_emit_location_p (gimple g)
+{
+ return gimple_plf (g, GF_PLF_1);
+}
+
+/* Mark statement G so a location will not be emitted by
+ annotate_one_with_location. */
+
+static inline void
+gimple_set_do_not_emit_location (gimple g)
+{
+ /* The PLF flags are initialized to 0 when a new tuple is created,
+ so no need to initialize it anywhere. */
+ gimple_set_plf (g, GF_PLF_1, true);
+}
+
+/* Set the location for gimple statement GS to LOCUS. */
+
+static void
+annotate_one_with_location (gimple gs, location_t location)
+{
+ if (!gimple_has_location (gs)
+ && !gimple_do_not_emit_location_p (gs)
+ && should_carry_location_p (gs))
+ gimple_set_location (gs, location);
+}
+
+/* Same, but for tree T. */
+
static void
-annotate_one_with_locus (tree t, location_t locus)
+tree_annotate_one_with_location (tree t, location_t location)
{
if (CAN_HAVE_LOCATION_P (t)
- && ! EXPR_HAS_LOCATION (t) && should_carry_locus_p (t))
- SET_EXPR_LOCATION (t, locus);
+ && ! EXPR_HAS_LOCATION (t) && tree_should_carry_location_p (t))
+ SET_EXPR_LOCATION (t, location);
+}
+
+
+/* Set LOCATION for all the statements after iterator GSI in sequence
+ SEQ. If GSI is pointing to the end of the sequence, start with the
+ first statement in SEQ. */
+
+static void
+annotate_all_with_location_after (gimple_seq seq, gimple_stmt_iterator gsi,
+ location_t location)
+{
+ if (gsi_end_p (gsi))
+ gsi = gsi_start (seq);
+ else
+ gsi_next (&gsi);
+
+ for (; !gsi_end_p (gsi); gsi_next (&gsi))
+ annotate_one_with_location (gsi_stmt (gsi), location);
+}
+
+
+/* Set the location for all the statements in a sequence STMT_P to LOCUS. */
+
+void
+annotate_all_with_location (gimple_seq stmt_p, location_t location)
+{
+ gimple_stmt_iterator i;
+
+ if (gimple_seq_empty_p (stmt_p))
+ return;
+
+ for (i = gsi_start (stmt_p); !gsi_end_p (i); gsi_next (&i))
+ {
+ gimple gs = gsi_stmt (i);
+ annotate_one_with_location (gs, location);
+ }
}
+/* Same, but for statement or statement list in *STMT_P. */
+
void
-annotate_all_with_locus (tree *stmt_p, location_t locus)
+tree_annotate_all_with_location (tree *stmt_p, location_t location)
{
tree_stmt_iterator i;
@@ -798,10 +990,11 @@ annotate_all_with_locus (tree *stmt_p, location_t locus)
gcc_assert (TREE_CODE (t) != STATEMENT_LIST
&& TREE_CODE (t) != COMPOUND_EXPR);
- annotate_one_with_locus (t, locus);
+ tree_annotate_one_with_location (t, location);
}
}
+
/* Similar to copy_tree_r() but do not copy SAVE_EXPR or TARGET_EXPR nodes.
These nodes model computations that should only be done once. If we
were to unshare something like SAVE_EXPR(i++), the gimplification
@@ -915,15 +1108,6 @@ unvisit_body (tree *body_p, tree fndecl)
unvisit_body (&DECL_SAVED_TREE (cgn->decl), cgn->decl);
}
-/* Unshare T and all the trees reached from T via TREE_CHAIN. */
-
-static void
-unshare_all_trees (tree t)
-{
- walk_tree (&t, copy_if_shared_r, NULL, NULL);
- walk_tree (&t, unmark_visited_r, NULL, NULL);
-}
-
/* Unconditionally make an unshared copy of EXPR. This is used when using
stored expressions which span multiple functions, such as BINFO_VTABLE,
as the normal unsharing process can't tell that they're shared. */
@@ -934,25 +1118,6 @@ unshare_expr (tree expr)
walk_tree (&expr, mostly_copy_tree_r, NULL, NULL);
return expr;
}
-
-/* A terser interface for building a representation of an exception
- specification. */
-
-tree
-gimple_build_eh_filter (tree body, tree allowed, tree failure)
-{
- tree t;
-
- /* FIXME should the allowed types go in TREE_TYPE? */
- t = build2 (EH_FILTER_EXPR, void_type_node, allowed, NULL_TREE);
- append_to_statement_list (failure, &EH_FILTER_FAILURE (t));
-
- t = build2 (TRY_CATCH_EXPR, void_type_node, NULL_TREE, t);
- append_to_statement_list (body, &TREE_OPERAND (t, 0));
-
- return t;
-}
-
/* WRAPPER is a code such as BIND_EXPR or CLEANUP_POINT_EXPR which can both
contain statements and have a value. Assign its value to a temporary
@@ -1019,9 +1184,8 @@ voidify_wrapper_expr (tree wrapper, tree temp)
/* The wrapper is on the RHS of an assignment that we're pushing
down. */
gcc_assert (TREE_CODE (temp) == INIT_EXPR
- || TREE_CODE (temp) == GIMPLE_MODIFY_STMT
|| TREE_CODE (temp) == MODIFY_EXPR);
- GENERIC_TREE_OPERAND (temp, 1) = *p;
+ TREE_OPERAND (temp, 1) = *p;
*p = temp;
}
else
@@ -1040,28 +1204,28 @@ voidify_wrapper_expr (tree wrapper, tree temp)
a temporary through which they communicate. */
static void
-build_stack_save_restore (tree *save, tree *restore)
+build_stack_save_restore (gimple *save, gimple *restore)
{
- tree save_call, tmp_var;
+ tree tmp_var;
- save_call =
- build_call_expr (implicit_built_in_decls[BUILT_IN_STACK_SAVE], 0);
+ *save = gimple_build_call (implicit_built_in_decls[BUILT_IN_STACK_SAVE], 0);
tmp_var = create_tmp_var (ptr_type_node, "saved_stack");
+ gimple_call_set_lhs (*save, tmp_var);
- *save = build_gimple_modify_stmt (tmp_var, save_call);
- *restore =
- build_call_expr (implicit_built_in_decls[BUILT_IN_STACK_RESTORE],
- 1, tmp_var);
+ *restore = gimple_build_call (implicit_built_in_decls[BUILT_IN_STACK_RESTORE],
+ 1, tmp_var);
}
/* Gimplify a BIND_EXPR. Just voidify and recurse. */
static enum gimplify_status
-gimplify_bind_expr (tree *expr_p, tree *pre_p)
+gimplify_bind_expr (tree *expr_p, gimple_seq *pre_p)
{
tree bind_expr = *expr_p;
bool old_save_stack = gimplify_ctxp->save_stack;
tree t;
+ gimple gimple_bind;
+ gimple_seq body;
tree temp = voidify_wrapper_expr (bind_expr, NULL);
@@ -1093,70 +1257,90 @@ gimplify_bind_expr (tree *expr_p, tree *pre_p)
DECL_GIMPLE_REG_P (t) = 1;
}
- gimple_push_bind_expr (bind_expr);
+ gimple_bind = gimple_build_bind (BIND_EXPR_VARS (bind_expr), NULL,
+ BIND_EXPR_BLOCK (bind_expr));
+ gimple_push_bind_expr (gimple_bind);
+
gimplify_ctxp->save_stack = false;
- gimplify_to_stmt_list (&BIND_EXPR_BODY (bind_expr));
+ /* Gimplify the body into the GIMPLE_BIND tuple's body. */
+ body = NULL;
+ gimplify_stmt (&BIND_EXPR_BODY (bind_expr), &body);
+ gimple_bind_set_body (gimple_bind, body);
if (gimplify_ctxp->save_stack)
{
- tree stack_save, stack_restore;
+ gimple stack_save, stack_restore, gs;
+ gimple_seq cleanup, new_body;
/* Save stack on entry and restore it on exit. Add a try_finally
block to achieve this. Note that mudflap depends on the
format of the emitted code: see mx_register_decls(). */
build_stack_save_restore (&stack_save, &stack_restore);
- t = build2 (TRY_FINALLY_EXPR, void_type_node,
- BIND_EXPR_BODY (bind_expr), NULL_TREE);
- append_to_statement_list (stack_restore, &TREE_OPERAND (t, 1));
+ cleanup = new_body = NULL;
+ gimplify_seq_add_stmt (&cleanup, stack_restore);
+ gs = gimple_build_try (gimple_bind_body (gimple_bind), cleanup,
+ GIMPLE_TRY_FINALLY);
- BIND_EXPR_BODY (bind_expr) = NULL_TREE;
- append_to_statement_list (stack_save, &BIND_EXPR_BODY (bind_expr));
- append_to_statement_list (t, &BIND_EXPR_BODY (bind_expr));
+ gimplify_seq_add_stmt (&new_body, stack_save);
+ gimplify_seq_add_stmt (&new_body, gs);
+ gimple_bind_set_body (gimple_bind, new_body);
}
gimplify_ctxp->save_stack = old_save_stack;
gimple_pop_bind_expr ();
+ gimplify_seq_add_stmt (pre_p, gimple_bind);
+
if (temp)
{
*expr_p = temp;
- append_to_statement_list (bind_expr, pre_p);
return GS_OK;
}
- else
- return GS_ALL_DONE;
+
+ *expr_p = NULL_TREE;
+ return GS_ALL_DONE;
}
/* Gimplify a RETURN_EXPR. If the expression to be returned is not a
GIMPLE value, it is assigned to a new temporary and the statement is
re-written to return the temporary.
- PRE_P points to the list where side effects that must happen before
+ PRE_P points to the sequence where side effects that must happen before
STMT should be stored. */
static enum gimplify_status
-gimplify_return_expr (tree stmt, tree *pre_p)
+gimplify_return_expr (tree stmt, gimple_seq *pre_p)
{
+ gimple ret;
tree ret_expr = TREE_OPERAND (stmt, 0);
tree result_decl, result;
- if (!ret_expr || TREE_CODE (ret_expr) == RESULT_DECL
+ if (ret_expr == error_mark_node)
+ return GS_ERROR;
+
+ if (!ret_expr
+ || TREE_CODE (ret_expr) == RESULT_DECL
|| ret_expr == error_mark_node)
- return GS_ALL_DONE;
+ {
+ gimple ret = gimple_build_return (ret_expr);
+ gimple_set_no_warning (ret, TREE_NO_WARNING (stmt));
+ gimplify_seq_add_stmt (pre_p, ret);
+ return GS_ALL_DONE;
+ }
if (VOID_TYPE_P (TREE_TYPE (TREE_TYPE (current_function_decl))))
result_decl = NULL_TREE;
else
{
- result_decl = GENERIC_TREE_OPERAND (ret_expr, 0);
+ result_decl = TREE_OPERAND (ret_expr, 0);
+
+ /* See through a return by reference. */
if (TREE_CODE (result_decl) == INDIRECT_REF)
- /* See through a return by reference. */
result_decl = TREE_OPERAND (result_decl, 0);
gcc_assert ((TREE_CODE (ret_expr) == MODIFY_EXPR
- || TREE_CODE (ret_expr) == GIMPLE_MODIFY_STMT
|| TREE_CODE (ret_expr) == INIT_EXPR)
&& TREE_CODE (result_decl) == RESULT_DECL);
}
@@ -1190,34 +1374,30 @@ gimplify_return_expr (tree stmt, tree *pre_p)
gimplify_ctxp->return_temp = result;
}
- /* Smash the lhs of the GIMPLE_MODIFY_STMT to the temporary we plan to use.
+ /* Smash the lhs of the MODIFY_EXPR to the temporary we plan to use.
Then gimplify the whole thing. */
if (result != result_decl)
- GENERIC_TREE_OPERAND (ret_expr, 0) = result;
+ TREE_OPERAND (ret_expr, 0) = result;
gimplify_and_add (TREE_OPERAND (stmt, 0), pre_p);
- /* If we didn't use a temporary, then the result is just the result_decl.
- Otherwise we need a simple copy. This should already be gimple. */
- if (result == result_decl)
- ret_expr = result;
- else
- ret_expr = build_gimple_modify_stmt (result_decl, result);
- TREE_OPERAND (stmt, 0) = ret_expr;
+ ret = gimple_build_return (result);
+ gimple_set_no_warning (ret, TREE_NO_WARNING (stmt));
+ gimplify_seq_add_stmt (pre_p, ret);
return GS_ALL_DONE;
}
static void
-gimplify_vla_decl (tree decl, tree *stmt_p)
+gimplify_vla_decl (tree decl, gimple_seq *seq_p)
{
/* This is a variable-sized decl. Simplify its size and mark it
for deferred expansion. Note that mudflap depends on the format
of the emitted code: see mx_register_decls(). */
tree t, addr, ptr_type;
- gimplify_one_sizepos (&DECL_SIZE (decl), stmt_p);
- gimplify_one_sizepos (&DECL_SIZE_UNIT (decl), stmt_p);
+ gimplify_one_sizepos (&DECL_SIZE (decl), seq_p);
+ gimplify_one_sizepos (&DECL_SIZE_UNIT (decl), seq_p);
/* All occurrences of this decl in final gimplified code will be
replaced by indirection. Setting DECL_VALUE_EXPR does two
@@ -1234,20 +1414,21 @@ gimplify_vla_decl (tree decl, tree *stmt_p)
t = built_in_decls[BUILT_IN_ALLOCA];
t = build_call_expr (t, 1, DECL_SIZE_UNIT (decl));
t = fold_convert (ptr_type, t);
- t = build_gimple_modify_stmt (addr, t);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (addr), addr, t);
- gimplify_and_add (t, stmt_p);
+ gimplify_and_add (t, seq_p);
/* Indicate that we need to restore the stack level when the
enclosing BIND_EXPR is exited. */
gimplify_ctxp->save_stack = true;
}
+
/* Gimplifies a DECL_EXPR node *STMT_P by making any necessary allocation
and initialization explicit. */
static enum gimplify_status
-gimplify_decl_expr (tree *stmt_p)
+gimplify_decl_expr (tree *stmt_p, gimple_seq *seq_p)
{
tree stmt = *stmt_p;
tree decl = DECL_EXPR_DECL (stmt);
@@ -1260,14 +1441,18 @@ gimplify_decl_expr (tree *stmt_p)
if ((TREE_CODE (decl) == TYPE_DECL
|| TREE_CODE (decl) == VAR_DECL)
&& !TYPE_SIZES_GIMPLIFIED (TREE_TYPE (decl)))
- gimplify_type_sizes (TREE_TYPE (decl), stmt_p);
+ gimplify_type_sizes (TREE_TYPE (decl), seq_p);
if (TREE_CODE (decl) == VAR_DECL && !DECL_EXTERNAL (decl))
{
tree init = DECL_INITIAL (decl);
- if (TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST)
- gimplify_vla_decl (decl, stmt_p);
+ 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)
{
@@ -1275,7 +1460,8 @@ gimplify_decl_expr (tree *stmt_p)
{
DECL_INITIAL (decl) = NULL_TREE;
init = build2 (INIT_EXPR, void_type_node, decl, init);
- gimplify_and_add (init, stmt_p);
+ gimplify_and_add (init, seq_p);
+ ggc_free (init);
}
else
/* We must still examine initializers for static variables
@@ -1300,27 +1486,49 @@ gimplify_decl_expr (tree *stmt_p)
EXIT_EXPR, we need to append a label for it to jump to. */
static enum gimplify_status
-gimplify_loop_expr (tree *expr_p, tree *pre_p)
+gimplify_loop_expr (tree *expr_p, gimple_seq *pre_p)
{
tree saved_label = gimplify_ctxp->exit_label;
- tree start_label = build1 (LABEL_EXPR, void_type_node, NULL_TREE);
- tree jump_stmt = build_and_jump (&LABEL_EXPR_LABEL (start_label));
+ tree start_label = create_artificial_label ();
- append_to_statement_list (start_label, pre_p);
+ gimplify_seq_add_stmt (pre_p, gimple_build_label (start_label));
gimplify_ctxp->exit_label = NULL_TREE;
gimplify_and_add (LOOP_EXPR_BODY (*expr_p), pre_p);
+ gimplify_seq_add_stmt (pre_p, gimple_build_goto (start_label));
+
if (gimplify_ctxp->exit_label)
+ gimplify_seq_add_stmt (pre_p, gimple_build_label (gimplify_ctxp->exit_label));
+
+ gimplify_ctxp->exit_label = saved_label;
+
+ *expr_p = NULL;
+ return GS_ALL_DONE;
+}
+
+/* Gimplifies a statement list onto a sequence. These may be created either
+ by an enlightened front-end, or by shortcut_cond_expr. */
+
+static enum gimplify_status
+gimplify_statement_list (tree *expr_p, gimple_seq *pre_p)
+{
+ tree temp = voidify_wrapper_expr (*expr_p, NULL);
+
+ tree_stmt_iterator i = tsi_start (*expr_p);
+
+ while (!tsi_end_p (i))
{
- append_to_statement_list (jump_stmt, pre_p);
- *expr_p = build1 (LABEL_EXPR, void_type_node, gimplify_ctxp->exit_label);
+ gimplify_stmt (tsi_stmt_ptr (i), pre_p);
+ tsi_delink (&i);
}
- else
- *expr_p = jump_stmt;
- gimplify_ctxp->exit_label = saved_label;
+ if (temp)
+ {
+ *expr_p = temp;
+ return GS_OK;
+ }
return GS_ALL_DONE;
}
@@ -1335,70 +1543,63 @@ compare_case_labels (const void *p1, const void *p2)
const_tree const case1 = *(const_tree const*)p1;
const_tree const case2 = *(const_tree const*)p2;
- return tree_int_cst_compare (CASE_LOW (case1), CASE_LOW (case2));
+ /* The 'default' case label always goes first. */
+ if (!CASE_LOW (case1))
+ return -1;
+ else if (!CASE_LOW (case2))
+ return 1;
+ else
+ return tree_int_cst_compare (CASE_LOW (case1), CASE_LOW (case2));
}
+
/* Sort the case labels in LABEL_VEC in place in ascending order. */
void
-sort_case_labels (tree label_vec)
+sort_case_labels (VEC(tree,heap)* label_vec)
{
- size_t len = TREE_VEC_LENGTH (label_vec);
- tree default_case = TREE_VEC_ELT (label_vec, len - 1);
-
- if (CASE_LOW (default_case))
- {
- size_t i;
-
- /* The last label in the vector should be the default case
- but it is not. */
- for (i = 0; i < len; ++i)
- {
- tree t = TREE_VEC_ELT (label_vec, i);
- if (!CASE_LOW (t))
- {
- default_case = t;
- TREE_VEC_ELT (label_vec, i) = TREE_VEC_ELT (label_vec, len - 1);
- TREE_VEC_ELT (label_vec, len - 1) = default_case;
- break;
- }
- }
- }
-
- qsort (&TREE_VEC_ELT (label_vec, 0), len - 1, sizeof (tree),
- compare_case_labels);
+ size_t len = VEC_length (tree, label_vec);
+ qsort (VEC_address (tree, label_vec), len, sizeof (tree),
+ compare_case_labels);
}
+
/* Gimplify a SWITCH_EXPR, and collect a TREE_VEC of the labels it can
branch to. */
static enum gimplify_status
-gimplify_switch_expr (tree *expr_p, tree *pre_p)
+gimplify_switch_expr (tree *expr_p, gimple_seq *pre_p)
{
tree switch_expr = *expr_p;
+ gimple_seq switch_body_seq = NULL;
enum gimplify_status ret;
- ret = gimplify_expr (&SWITCH_COND (switch_expr), pre_p, NULL,
- is_gimple_val, fb_rvalue);
+ ret = gimplify_expr (&SWITCH_COND (switch_expr), pre_p, NULL, is_gimple_val,
+ fb_rvalue);
+ if (ret == GS_ERROR || ret == GS_UNHANDLED)
+ return ret;
if (SWITCH_BODY (switch_expr))
{
- VEC(tree,heap) *labels, *saved_labels;
- tree label_vec, default_case = NULL_TREE;
+ VEC (tree,heap) *labels;
+ VEC (tree,heap) *saved_labels;
+ tree default_case = NULL_TREE;
size_t i, len;
-
+ gimple gimple_switch;
+
/* If someone can be bothered to fill in the labels, they can
be bothered to null out the body too. */
gcc_assert (!SWITCH_LABELS (switch_expr));
+ /* save old labels, get new ones from body, then restore the old
+ labels. Save all the things from the switch body to append after. */
saved_labels = gimplify_ctxp->case_labels;
gimplify_ctxp->case_labels = VEC_alloc (tree, heap, 8);
- gimplify_to_stmt_list (&SWITCH_BODY (switch_expr));
-
+ gimplify_stmt (&SWITCH_BODY (switch_expr), &switch_body_seq);
labels = gimplify_ctxp->case_labels;
gimplify_ctxp->case_labels = saved_labels;
-
+
i = 0;
while (i < VEC_length (tree, labels))
{
@@ -1428,44 +1629,39 @@ gimplify_switch_expr (tree *expr_p, tree *pre_p)
}
len = i;
- label_vec = make_tree_vec (len + 1);
- SWITCH_LABELS (*expr_p) = label_vec;
- append_to_statement_list (switch_expr, pre_p);
-
- if (! default_case)
+ if (!default_case)
{
+ gimple new_default;
+
/* If the switch has no default label, add one, so that we jump
around the switch body. */
default_case = build3 (CASE_LABEL_EXPR, void_type_node, NULL_TREE,
- NULL_TREE, create_artificial_label ());
- append_to_statement_list (SWITCH_BODY (switch_expr), pre_p);
- *expr_p = build1 (LABEL_EXPR, void_type_node,
- CASE_LABEL (default_case));
+ NULL_TREE, create_artificial_label ());
+ new_default = gimple_build_label (CASE_LABEL (default_case));
+ gimplify_seq_add_stmt (&switch_body_seq, new_default);
}
- else
- *expr_p = SWITCH_BODY (switch_expr);
-
- for (i = 0; i < len; ++i)
- TREE_VEC_ELT (label_vec, i) = VEC_index (tree, labels, i);
- TREE_VEC_ELT (label_vec, len) = default_case;
-
- VEC_free (tree, heap, labels);
- sort_case_labels (label_vec);
+ if (!VEC_empty (tree, labels))
+ sort_case_labels (labels);
- SWITCH_BODY (switch_expr) = NULL;
+ gimple_switch = gimple_build_switch_vec (SWITCH_COND (switch_expr),
+ default_case, labels);
+ gimplify_seq_add_stmt (pre_p, gimple_switch);
+ gimplify_seq_add_seq (pre_p, switch_body_seq);
+ VEC_free(tree, heap, labels);
}
else
gcc_assert (SWITCH_LABELS (switch_expr));
- return ret;
+ return GS_ALL_DONE;
}
+
static enum gimplify_status
-gimplify_case_label_expr (tree *expr_p)
+gimplify_case_label_expr (tree *expr_p, gimple_seq *pre_p)
{
- tree expr = *expr_p;
struct gimplify_ctx *ctxp;
+ gimple gimple_label;
/* Invalid OpenMP programs can play Duff's Device type games with
#pragma omp parallel. At least in the C front end, we don't
@@ -1474,8 +1670,10 @@ gimplify_case_label_expr (tree *expr_p)
if (ctxp->case_labels)
break;
- VEC_safe_push (tree, heap, ctxp->case_labels, expr);
- *expr_p = build1 (LABEL_EXPR, void_type_node, CASE_LABEL (expr));
+ gimple_label = gimple_build_label (CASE_LABEL (*expr_p));
+ VEC_safe_push (tree, heap, ctxp->case_labels, *expr_p);
+ gimplify_seq_add_stmt (pre_p, gimple_label);
+
return GS_ALL_DONE;
}
@@ -1648,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. */
@@ -1720,7 +1914,7 @@ gimplify_var_or_parm_decl (tree *expr_p)
/* Gimplify the COMPONENT_REF, ARRAY_REF, REALPART_EXPR or IMAGPART_EXPR
- node pointed to by EXPR_P.
+ node *EXPR_P.
compound_lval
: min_lval '[' val ']'
@@ -1735,15 +1929,15 @@ gimplify_var_or_parm_decl (tree *expr_p)
union reference must be explicit, which was not always the case when we
were splitting up array and member refs.
- PRE_P points to the list where side effects that must happen before
+ PRE_P points to the sequence where side effects that must happen before
*EXPR_P should be stored.
- POST_P points to the list where side effects that must happen after
+ POST_P points to the sequence where side effects that must happen after
*EXPR_P should be stored. */
static enum gimplify_status
-gimplify_compound_lval (tree *expr_p, tree *pre_p,
- tree *post_p, fallback_t fallback)
+gimplify_compound_lval (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
+ fallback_t fallback)
{
tree *p;
VEC(tree,heap) *stack;
@@ -1798,14 +1992,15 @@ gimplify_compound_lval (tree *expr_p, tree *pre_p,
/* Gimplify the low bound and element type size and put them into
the ARRAY_REF. If these values are set, they have already been
gimplified. */
- if (!TREE_OPERAND (t, 2))
+ if (TREE_OPERAND (t, 2) == NULL_TREE)
{
tree low = unshare_expr (array_ref_low_bound (t));
if (!is_gimple_min_invariant (low))
{
- TREE_OPERAND (t, 2) = low;
- tret = gimplify_expr (&TREE_OPERAND (t, 2), pre_p, post_p,
- is_gimple_formal_tmp_reg, fb_rvalue);
+ TREE_OPERAND (t, 2) = low;
+ tret = gimplify_expr (&TREE_OPERAND (t, 2), pre_p,
+ post_p, is_gimple_formal_tmp_reg,
+ fb_rvalue);
ret = MIN (ret, tret);
}
}
@@ -1822,9 +2017,10 @@ gimplify_compound_lval (tree *expr_p, tree *pre_p,
if (!is_gimple_min_invariant (elmt_size))
{
- TREE_OPERAND (t, 3) = elmt_size;
- tret = gimplify_expr (&TREE_OPERAND (t, 3), pre_p, post_p,
- is_gimple_formal_tmp_reg, fb_rvalue);
+ TREE_OPERAND (t, 3) = elmt_size;
+ tret = gimplify_expr (&TREE_OPERAND (t, 3), pre_p,
+ post_p, is_gimple_formal_tmp_reg,
+ fb_rvalue);
ret = MIN (ret, tret);
}
}
@@ -1844,9 +2040,10 @@ gimplify_compound_lval (tree *expr_p, tree *pre_p,
if (!is_gimple_min_invariant (offset))
{
- TREE_OPERAND (t, 2) = offset;
- tret = gimplify_expr (&TREE_OPERAND (t, 2), pre_p, post_p,
- is_gimple_formal_tmp_reg, fb_rvalue);
+ TREE_OPERAND (t, 2) = offset;
+ tret = gimplify_expr (&TREE_OPERAND (t, 2), pre_p,
+ post_p, is_gimple_formal_tmp_reg,
+ fb_rvalue);
ret = MIN (ret, tret);
}
}
@@ -1896,15 +2093,13 @@ gimplify_compound_lval (tree *expr_p, tree *pre_p,
STRIP_USELESS_TYPE_CONVERSION (TREE_OPERAND (t, 0));
- /* The innermost expression P may have originally had TREE_SIDE_EFFECTS
- set which would have caused all the outer expressions in EXPR_P
- leading to P to also have had TREE_SIDE_EFFECTS set. */
+ /* The innermost expression P may have originally had
+ TREE_SIDE_EFFECTS set which would have caused all the outer
+ expressions in *EXPR_P leading to P to also have had
+ TREE_SIDE_EFFECTS set. */
recalculate_side_effects (t);
}
- tret = gimplify_expr (p, pre_p, post_p, is_gimple_min_lval, fallback);
- ret = MIN (ret, tret);
-
/* If the outermost expression is a COMPONENT_REF, canonicalize its type. */
if ((fallback & fb_rvalue) && TREE_CODE (*expr_p) == COMPONENT_REF)
{
@@ -1930,11 +2125,12 @@ gimplify_compound_lval (tree *expr_p, tree *pre_p,
in another expression. */
static enum gimplify_status
-gimplify_self_mod_expr (tree *expr_p, tree *pre_p, tree *post_p,
+gimplify_self_mod_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
bool want_value)
{
enum tree_code code;
- tree lhs, lvalue, rhs, t1, post = NULL, *orig_post_p = post_p;
+ tree lhs, lvalue, rhs, t1;
+ gimple_seq post = NULL, *orig_post_p = post_p;
bool postfix;
enum tree_code arith_code;
enum gimplify_status ret;
@@ -1991,22 +2187,22 @@ gimplify_self_mod_expr (tree *expr_p, tree *pre_p, tree *post_p,
}
t1 = build2 (arith_code, TREE_TYPE (*expr_p), lhs, rhs);
- t1 = build_gimple_modify_stmt (lvalue, t1);
if (postfix)
{
- gimplify_and_add (t1, orig_post_p);
- append_to_statement_list (post, orig_post_p);
+ gimplify_assign (lvalue, t1, orig_post_p);
+ gimplify_seq_add_seq (orig_post_p, post);
*expr_p = lhs;
return GS_ALL_DONE;
}
else
{
- *expr_p = t1;
+ *expr_p = build2 (MODIFY_EXPR, TREE_TYPE (lvalue), lvalue, t1);
return GS_OK;
}
}
+
/* If *EXPR_P has a variable sized type, wrap it in a WITH_SIZE_EXPR. */
static void
@@ -2033,10 +2229,12 @@ maybe_with_size_expr (tree *expr_p)
*expr_p = build2 (WITH_SIZE_EXPR, type, expr, size);
}
-/* Subroutine of gimplify_call_expr: Gimplify a single argument. */
+
+/* Helper for gimplify_call_expr. Gimplify a single argument *ARG_P
+ Store any side-effects in PRE_P. */
static enum gimplify_status
-gimplify_arg (tree *expr_p, tree *pre_p)
+gimplify_arg (tree *arg_p, gimple_seq *pre_p)
{
bool (*test) (tree);
fallback_t fb;
@@ -2046,31 +2244,33 @@ gimplify_arg (tree *expr_p, tree *pre_p)
aggregates into temporaries only to copy the temporaries to
the argument list. Make optimizers happy by pulling out to
temporaries those types that fit in registers. */
- if (is_gimple_reg_type (TREE_TYPE (*expr_p)))
+ if (is_gimple_reg_type (TREE_TYPE (*arg_p)))
test = is_gimple_val, fb = fb_rvalue;
else
test = is_gimple_lvalue, fb = fb_either;
/* If this is a variable sized type, we must remember the size. */
- maybe_with_size_expr (expr_p);
+ maybe_with_size_expr (arg_p);
/* There is a sequence point before a function call. Side effects in
the argument list must occur before the actual call. So, when
gimplifying arguments, force gimplify_expr to use an internal
post queue which is then appended to the end of PRE_P. */
- return gimplify_expr (expr_p, pre_p, NULL, test, fb);
+ return gimplify_expr (arg_p, pre_p, NULL, test, fb);
}
-/* Gimplify the CALL_EXPR node pointed to by EXPR_P. PRE_P points to the
- list where side effects that must happen before *EXPR_P should be stored.
+
+/* Gimplify the CALL_EXPR node *EXPR_P into the GIMPLE sequence PRE_P.
WANT_VALUE is true if the result of the call is desired. */
static enum gimplify_status
-gimplify_call_expr (tree *expr_p, tree *pre_p, bool want_value)
+gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value)
{
- tree decl, parms, p;
+ tree fndecl, parms, p;
enum gimplify_status ret;
int i, nargs;
+ gimple call;
+ bool builtin_va_start_p = FALSE;
gcc_assert (TREE_CODE (*expr_p) == CALL_EXPR);
@@ -2091,23 +2291,24 @@ gimplify_call_expr (tree *expr_p, tree *pre_p, bool want_value)
we gimplify the CALL_EXPR. At this time we do not manage to
transform all calls in the same manner as the expanders do, but
we do transform most of them. */
- decl = get_callee_fndecl (*expr_p);
- if (decl && DECL_BUILT_IN (decl))
+ 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;
}
- if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
- && DECL_FUNCTION_CODE (decl) == BUILT_IN_VA_START)
+ if (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
+ && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_VA_START)
{
+ builtin_va_start_p = TRUE;
if (call_expr_nargs (*expr_p) < 2)
{
error ("too few arguments to function %<va_start%>");
@@ -2120,9 +2321,6 @@ gimplify_call_expr (tree *expr_p, tree *pre_p, bool want_value)
*expr_p = build_empty_stmt ();
return GS_OK;
}
- /* Avoid gimplifying the second argument to va_start, which needs
- to be the plain PARM_DECL. */
- return gimplify_arg (&CALL_EXPR_ARG (*expr_p, 0), pre_p);
}
}
@@ -2135,19 +2333,20 @@ gimplify_call_expr (tree *expr_p, tree *pre_p, bool want_value)
nargs = call_expr_nargs (*expr_p);
/* Get argument types for verification. */
- decl = get_callee_fndecl (*expr_p);
+ fndecl = get_callee_fndecl (*expr_p);
parms = NULL_TREE;
- if (decl)
- parms = TYPE_ARG_TYPES (TREE_TYPE (decl));
+ if (fndecl)
+ parms = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
else if (POINTER_TYPE_P (TREE_TYPE (CALL_EXPR_FN (*expr_p))))
parms = TYPE_ARG_TYPES (TREE_TYPE (TREE_TYPE (CALL_EXPR_FN (*expr_p))));
/* Verify if the type of the argument matches that of the function
declaration. If we cannot verify this or there is a mismatch,
mark the call expression so it doesn't get inlined later. */
- if (decl && DECL_ARGUMENTS (decl))
+ if (fndecl && DECL_ARGUMENTS (fndecl))
{
- for (i = 0, p = DECL_ARGUMENTS (decl); i < nargs;
+ for (i = 0, p = DECL_ARGUMENTS (fndecl);
+ i < nargs;
i++, p = TREE_CHAIN (p))
{
/* We cannot distinguish a varargs function from the case
@@ -2212,50 +2411,63 @@ gimplify_call_expr (tree *expr_p, tree *pre_p, bool want_value)
--nargs;
*expr_p = build_call_array (TREE_TYPE (call), CALL_EXPR_FN (call),
nargs, CALL_EXPR_ARGP (call));
- /* Copy all CALL_EXPR flags, locus and block, except
+
+ /* Copy all CALL_EXPR flags, location and block, except
CALL_EXPR_VA_ARG_PACK flag. */
CALL_EXPR_STATIC_CHAIN (*expr_p) = CALL_EXPR_STATIC_CHAIN (call);
CALL_EXPR_TAILCALL (*expr_p) = CALL_EXPR_TAILCALL (call);
CALL_EXPR_RETURN_SLOT_OPT (*expr_p)
= CALL_EXPR_RETURN_SLOT_OPT (call);
CALL_FROM_THUNK_P (*expr_p) = CALL_FROM_THUNK_P (call);
- CALL_CANNOT_INLINE_P (*expr_p)
- = CALL_CANNOT_INLINE_P (call);
- TREE_NOTHROW (*expr_p) = TREE_NOTHROW (call);
+ CALL_CANNOT_INLINE_P (*expr_p) = CALL_CANNOT_INLINE_P (call);
SET_EXPR_LOCUS (*expr_p, EXPR_LOCUS (call));
TREE_BLOCK (*expr_p) = TREE_BLOCK (call);
+
/* Set CALL_EXPR_VA_ARG_PACK. */
CALL_EXPR_VA_ARG_PACK (*expr_p) = 1;
}
}
/* Finally, gimplify the function arguments. */
- for (i = (PUSH_ARGS_REVERSED ? nargs - 1 : 0);
- PUSH_ARGS_REVERSED ? i >= 0 : i < nargs;
- PUSH_ARGS_REVERSED ? i-- : i++)
+ if (nargs > 0)
{
- enum gimplify_status t;
+ for (i = (PUSH_ARGS_REVERSED ? nargs - 1 : 0);
+ PUSH_ARGS_REVERSED ? i >= 0 : i < nargs;
+ PUSH_ARGS_REVERSED ? i-- : i++)
+ {
+ enum gimplify_status t;
- t = gimplify_arg (&CALL_EXPR_ARG (*expr_p, i), pre_p);
+ /* Avoid gimplifying the second argument to va_start, which needs to
+ be the plain PARM_DECL. */
+ if ((i != 1) || !builtin_va_start_p)
+ {
+ t = gimplify_arg (&CALL_EXPR_ARG (*expr_p, i), pre_p);
- if (t == GS_ERROR)
- ret = GS_ERROR;
+ if (t == GS_ERROR)
+ ret = GS_ERROR;
+ }
+ }
}
/* 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 = error_mark_node;
+ return GS_ERROR;
+ }
/* If the function is "const" or "pure", then clear TREE_SIDE_EFFECTS on its
decl. This allows us to eliminate redundant or useless
@@ -2268,6 +2480,24 @@ gimplify_call_expr (tree *expr_p, tree *pre_p, bool want_value)
&& !(flags & (ECF_LOOPING_CONST_OR_PURE)))
TREE_SIDE_EFFECTS (*expr_p) = 0;
}
+
+ /* If the value is not needed by the caller, emit a new GIMPLE_CALL
+ and clear *EXPR_P. Otherwise, leave *EXPR_P in its gimplified
+ form and delegate the creation of a GIMPLE_CALL to
+ gimplify_modify_expr. This is always possible because when
+ WANT_VALUE is true, the caller wants the result of this call into
+ a temporary, which means that we will emit an INIT_EXPR in
+ internal_get_tmp_var which will then be handled by
+ gimplify_modify_expr. */
+ if (!want_value)
+ {
+ /* The CALL_EXPR in *EXPR_P is already in GIMPLE form, so all we
+ have to do is replicate it as a GIMPLE_CALL tuple. */
+ call = gimple_build_call_from_tree (*expr_p);
+ gimplify_seq_add_stmt (pre_p, call);
+ *expr_p = NULL_TREE;
+ }
+
return ret;
}
@@ -2356,6 +2586,10 @@ shortcut_cond_r (tree pred, tree *true_label_p, tree *false_label_p)
return expr;
}
+/* Given a conditional expression EXPR with short-circuit boolean
+ predicates using TRUTH_ANDIF_EXPR or TRUTH_ORIF_EXPR, break the
+ predicate appart into the equivalent sequence of conditionals. */
+
static tree
shortcut_cond_expr (tree expr)
{
@@ -2382,6 +2616,7 @@ shortcut_cond_expr (tree expr)
expr = build3 (COND_EXPR, void_type_node, pred, then_, NULL_TREE);
}
}
+
if (!then_se)
{
/* If there is no 'then', turn
@@ -2550,7 +2785,7 @@ gimple_boolify (tree expr)
its operands. New statements are inserted to PRE_P. */
static enum gimplify_status
-gimplify_pure_cond_expr (tree *expr_p, tree *pre_p)
+gimplify_pure_cond_expr (tree *expr_p, gimple_seq *pre_p)
{
tree expr = *expr_p, cond;
enum gimplify_status ret, tret;
@@ -2565,8 +2800,7 @@ gimplify_pure_cond_expr (tree *expr_p, tree *pre_p)
TREE_SET_CODE (cond, TRUTH_AND_EXPR);
else if (code == TRUTH_ORIF_EXPR)
TREE_SET_CODE (cond, TRUTH_OR_EXPR);
- ret = gimplify_expr (&cond, pre_p, NULL,
- is_gimple_condexpr, fb_rvalue);
+ ret = gimplify_expr (&cond, pre_p, NULL, is_gimple_condexpr, fb_rvalue);
COND_EXPR_COND (*expr_p) = cond;
tret = gimplify_expr (&COND_EXPR_THEN (expr), pre_p, NULL,
@@ -2612,17 +2846,20 @@ generic_expr_could_trap_p (tree expr)
The second form is used when *EXPR_P is of type void.
- TARGET is the tree for T1 above.
-
PRE_P points to the list where side effects that must happen before
*EXPR_P should be stored. */
static enum gimplify_status
-gimplify_cond_expr (tree *expr_p, tree *pre_p, fallback_t fallback)
+gimplify_cond_expr (tree *expr_p, gimple_seq *pre_p, fallback_t fallback)
{
tree expr = *expr_p;
- tree tmp, tmp2, type;
+ tree tmp, type, arm1, arm2;
enum gimplify_status ret;
+ tree label_true, label_false, label_cont;
+ bool have_then_clause_p, have_else_clause_p;
+ gimple gimple_cond;
+ enum tree_code pred_code;
+ gimple_seq seq = NULL;
type = TREE_TYPE (expr);
@@ -2647,7 +2884,7 @@ gimplify_cond_expr (tree *expr_p, tree *pre_p, fallback_t fallback)
&& !generic_expr_could_trap_p (TREE_OPERAND (*expr_p, 2)))
return gimplify_pure_cond_expr (expr_p, pre_p);
- result = tmp2 = tmp = create_tmp_var (TREE_TYPE (expr), "iftmp");
+ result = tmp = create_tmp_var (TREE_TYPE (expr), "iftmp");
ret = GS_ALL_DONE;
}
else
@@ -2662,34 +2899,33 @@ gimplify_cond_expr (tree *expr_p, tree *pre_p, fallback_t fallback)
TREE_OPERAND (expr, 2) =
build_fold_addr_expr (TREE_OPERAND (expr, 2));
- tmp2 = tmp = create_tmp_var (type, "iftmp");
+ tmp = create_tmp_var (type, "iftmp");
expr = build3 (COND_EXPR, void_type_node, TREE_OPERAND (expr, 0),
TREE_OPERAND (expr, 1), TREE_OPERAND (expr, 2));
result = build_fold_indirect_ref (tmp);
- ret = GS_ALL_DONE;
}
/* Build the then clause, 't1 = a;'. But don't build an assignment
if this branch is void; in C++ it can be, if it's a throw. */
if (TREE_TYPE (TREE_OPERAND (expr, 1)) != void_type_node)
TREE_OPERAND (expr, 1)
- = build_gimple_modify_stmt (tmp, TREE_OPERAND (expr, 1));
+ = build2 (MODIFY_EXPR, TREE_TYPE (tmp), tmp, TREE_OPERAND (expr, 1));
/* Build the else clause, 't1 = b;'. */
if (TREE_TYPE (TREE_OPERAND (expr, 2)) != void_type_node)
TREE_OPERAND (expr, 2)
- = build_gimple_modify_stmt (tmp2, TREE_OPERAND (expr, 2));
+ = build2 (MODIFY_EXPR, TREE_TYPE (tmp), tmp, TREE_OPERAND (expr, 2));
TREE_TYPE (expr) = void_type_node;
recalculate_side_effects (expr);
/* Move the COND_EXPR to the prequeue. */
- gimplify_and_add (expr, pre_p);
+ gimplify_stmt (&expr, pre_p);
*expr_p = result;
- return ret;
+ return GS_ALL_DONE;
}
/* Make sure the condition has BOOLEAN_TYPE. */
@@ -2710,45 +2946,131 @@ gimplify_cond_expr (tree *expr_p, tree *pre_p, fallback_t fallback)
wrapped in a TRY_FINALLY_EXPR. To prevent that, we need to
set up a conditional context. */
gimple_push_condition ();
- gimplify_stmt (expr_p);
+ gimplify_stmt (expr_p, &seq);
gimple_pop_condition (pre_p);
+ gimple_seq_add_seq (pre_p, seq);
return GS_ALL_DONE;
}
}
/* Now do the normal gimplification. */
- ret = gimplify_expr (&TREE_OPERAND (expr, 0), pre_p, NULL,
- is_gimple_condexpr, fb_rvalue);
+
+ /* Gimplify condition. */
+ ret = gimplify_expr (&TREE_OPERAND (expr, 0), pre_p, NULL, is_gimple_condexpr,
+ fb_rvalue);
+ if (ret == GS_ERROR)
+ return GS_ERROR;
+ gcc_assert (TREE_OPERAND (expr, 0) != NULL_TREE);
gimple_push_condition ();
- gimplify_to_stmt_list (&TREE_OPERAND (expr, 1));
- gimplify_to_stmt_list (&TREE_OPERAND (expr, 2));
- recalculate_side_effects (expr);
+ have_then_clause_p = have_else_clause_p = false;
+ if (TREE_OPERAND (expr, 1) != NULL
+ && TREE_CODE (TREE_OPERAND (expr, 1)) == GOTO_EXPR
+ && TREE_CODE (GOTO_DESTINATION (TREE_OPERAND (expr, 1))) == LABEL_DECL
+ && (DECL_CONTEXT (GOTO_DESTINATION (TREE_OPERAND (expr, 1)))
+ == current_function_decl)
+ /* For -O0 avoid this optimization if the COND_EXPR and GOTO_EXPR
+ have different locations, otherwise we end up with incorrect
+ location information on the branches. */
+ && (optimize
+ || !EXPR_HAS_LOCATION (expr)
+ || !EXPR_HAS_LOCATION (TREE_OPERAND (expr, 1))
+ || EXPR_LOCATION (expr) == EXPR_LOCATION (TREE_OPERAND (expr, 1))))
+ {
+ label_true = GOTO_DESTINATION (TREE_OPERAND (expr, 1));
+ have_then_clause_p = true;
+ }
+ else
+ label_true = create_artificial_label ();
+ if (TREE_OPERAND (expr, 2) != NULL
+ && TREE_CODE (TREE_OPERAND (expr, 2)) == GOTO_EXPR
+ && TREE_CODE (GOTO_DESTINATION (TREE_OPERAND (expr, 2))) == LABEL_DECL
+ && (DECL_CONTEXT (GOTO_DESTINATION (TREE_OPERAND (expr, 2)))
+ == current_function_decl)
+ /* For -O0 avoid this optimization if the COND_EXPR and GOTO_EXPR
+ have different locations, otherwise we end up with incorrect
+ location information on the branches. */
+ && (optimize
+ || !EXPR_HAS_LOCATION (expr)
+ || !EXPR_HAS_LOCATION (TREE_OPERAND (expr, 2))
+ || EXPR_LOCATION (expr) == EXPR_LOCATION (TREE_OPERAND (expr, 2))))
+ {
+ label_false = GOTO_DESTINATION (TREE_OPERAND (expr, 2));
+ have_else_clause_p = true;
+ }
+ else
+ label_false = create_artificial_label ();
+
+ gimple_cond_get_ops_from_tree (COND_EXPR_COND (expr), &pred_code, &arm1,
+ &arm2);
+
+ gimple_cond = gimple_build_cond (pred_code, arm1, arm2, label_true,
+ label_false);
+
+ gimplify_seq_add_stmt (&seq, gimple_cond);
+ label_cont = NULL_TREE;
+ if (!have_then_clause_p)
+ {
+ /* For if (...) {} else { code; } put label_true after
+ the else block. */
+ if (TREE_OPERAND (expr, 1) == NULL_TREE
+ && !have_else_clause_p
+ && TREE_OPERAND (expr, 2) != NULL_TREE)
+ label_cont = label_true;
+ else
+ {
+ gimplify_seq_add_stmt (&seq, gimple_build_label (label_true));
+ have_then_clause_p = gimplify_stmt (&TREE_OPERAND (expr, 1), &seq);
+ /* For if (...) { code; } else {} or
+ if (...) { code; } else goto label; or
+ if (...) { code; return; } else { ... }
+ label_cont isn't needed. */
+ if (!have_else_clause_p
+ && TREE_OPERAND (expr, 2) != NULL_TREE
+ && gimple_seq_may_fallthru (seq))
+ {
+ gimple g;
+ label_cont = create_artificial_label ();
+
+ g = gimple_build_goto (label_cont);
+
+ /* GIMPLE_COND's are very low level; they have embedded
+ gotos. This particular embedded goto should not be marked
+ with the location of the original COND_EXPR, as it would
+ correspond to the COND_EXPR's condition, not the ELSE or the
+ THEN arms. To avoid marking it with the wrong location, flag
+ it as "no location". */
+ gimple_set_do_not_emit_location (g);
+
+ gimplify_seq_add_stmt (&seq, g);
+ }
+ }
+ }
+ if (!have_else_clause_p)
+ {
+ gimplify_seq_add_stmt (&seq, gimple_build_label (label_false));
+ have_else_clause_p = gimplify_stmt (&TREE_OPERAND (expr, 2), &seq);
+ }
+ if (label_cont)
+ gimplify_seq_add_stmt (&seq, gimple_build_label (label_cont));
gimple_pop_condition (pre_p);
+ gimple_seq_add_seq (pre_p, seq);
if (ret == GS_ERROR)
- ;
- else if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 1)))
+ ; /* Do nothing. */
+ else if (have_then_clause_p || have_else_clause_p)
ret = GS_ALL_DONE;
- else if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 2)))
- /* Rewrite "if (a); else b" to "if (!a) b" */
+ else
{
- TREE_OPERAND (expr, 0) = invert_truthvalue (TREE_OPERAND (expr, 0));
- ret = gimplify_expr (&TREE_OPERAND (expr, 0), pre_p, NULL,
- is_gimple_condexpr, fb_rvalue);
-
- tmp = TREE_OPERAND (expr, 1);
- TREE_OPERAND (expr, 1) = TREE_OPERAND (expr, 2);
- TREE_OPERAND (expr, 2) = tmp;
+ /* Both arms are empty; replace the COND_EXPR with its predicate. */
+ expr = TREE_OPERAND (expr, 0);
+ gimplify_stmt (&expr, pre_p);
}
- else
- /* Both arms are empty; replace the COND_EXPR with its predicate. */
- expr = TREE_OPERAND (expr, 0);
- *expr_p = expr;
+ *expr_p = NULL;
return ret;
}
@@ -2756,27 +3078,39 @@ gimplify_cond_expr (tree *expr_p, tree *pre_p, fallback_t fallback)
a call to __builtin_memcpy. */
static enum gimplify_status
-gimplify_modify_expr_to_memcpy (tree *expr_p, tree size, bool want_value)
+gimplify_modify_expr_to_memcpy (tree *expr_p, tree size, bool want_value,
+ gimple_seq *seq_p)
{
tree t, to, to_ptr, from, from_ptr;
+ gimple gs;
- to = GENERIC_TREE_OPERAND (*expr_p, 0);
- from = GENERIC_TREE_OPERAND (*expr_p, 1);
+ to = TREE_OPERAND (*expr_p, 0);
+ from = TREE_OPERAND (*expr_p, 1);
from_ptr = build_fold_addr_expr (from);
+ gimplify_arg (&from_ptr, seq_p);
to_ptr = build_fold_addr_expr (to);
+ gimplify_arg (&to_ptr, seq_p);
+
t = implicit_built_in_decls[BUILT_IN_MEMCPY];
- t = build_call_expr (t, 3, to_ptr, from_ptr, size);
+
+ gs = gimple_build_call (t, 3, to_ptr, from_ptr, size);
if (want_value)
{
- t = build1 (NOP_EXPR, TREE_TYPE (to_ptr), t);
- t = build1 (INDIRECT_REF, TREE_TYPE (to), t);
+ /* tmp = memcpy() */
+ t = create_tmp_var (TREE_TYPE (to_ptr), NULL);
+ gimple_call_set_lhs (gs, t);
+ gimplify_seq_add_stmt (seq_p, gs);
+
+ *expr_p = build1 (INDIRECT_REF, TREE_TYPE (to), t);
+ return GS_ALL_DONE;
}
- *expr_p = t;
- return GS_OK;
+ gimplify_seq_add_stmt (seq_p, gs);
+ *expr_p = NULL;
+ return GS_ALL_DONE;
}
/* A subroutine of gimplify_modify_expr. Replace a MODIFY_EXPR with
@@ -2784,14 +3118,16 @@ gimplify_modify_expr_to_memcpy (tree *expr_p, tree size, bool want_value)
a CONSTRUCTOR with an empty element list. */
static enum gimplify_status
-gimplify_modify_expr_to_memset (tree *expr_p, tree size, bool want_value)
+gimplify_modify_expr_to_memset (tree *expr_p, tree size, bool want_value,
+ gimple_seq *seq_p)
{
tree t, from, to, to_ptr;
+ gimple gs;
/* Assert our assumptions, to abort instead of producing wrong code
silently if they are not met. Beware that the RHS CONSTRUCTOR might
not be immediately exposed. */
- from = GENERIC_TREE_OPERAND (*expr_p, 1);
+ from = TREE_OPERAND (*expr_p, 1);
if (TREE_CODE (from) == WITH_SIZE_EXPR)
from = TREE_OPERAND (from, 0);
@@ -2799,20 +3135,28 @@ gimplify_modify_expr_to_memset (tree *expr_p, tree size, bool want_value)
&& VEC_empty (constructor_elt, CONSTRUCTOR_ELTS (from)));
/* Now proceed. */
- to = GENERIC_TREE_OPERAND (*expr_p, 0);
+ to = TREE_OPERAND (*expr_p, 0);
to_ptr = build_fold_addr_expr (to);
+ gimplify_arg (&to_ptr, seq_p);
t = implicit_built_in_decls[BUILT_IN_MEMSET];
- t = build_call_expr (t, 3, to_ptr, integer_zero_node, size);
+
+ gs = gimple_build_call (t, 3, to_ptr, integer_zero_node, size);
if (want_value)
{
- t = build1 (NOP_EXPR, TREE_TYPE (to_ptr), t);
- t = build1 (INDIRECT_REF, TREE_TYPE (to), t);
+ /* tmp = memset() */
+ t = create_tmp_var (TREE_TYPE (to_ptr), NULL);
+ gimple_call_set_lhs (gs, t);
+ gimplify_seq_add_stmt (seq_p, gs);
+
+ *expr_p = build1 (INDIRECT_REF, TREE_TYPE (to), t);
+ return GS_ALL_DONE;
}
- *expr_p = t;
- return GS_OK;
+ gimplify_seq_add_stmt (seq_p, gs);
+ *expr_p = NULL;
+ return GS_ALL_DONE;
}
/* A subroutine of gimplify_init_ctor_preeval. Called via walk_tree,
@@ -2868,12 +3212,12 @@ gimplify_init_ctor_preeval_1 (tree *tp, int *walk_subtrees, void *xdata)
return NULL;
}
-/* A subroutine of gimplify_init_constructor. Pre-evaluate *EXPR_P,
+/* A subroutine of gimplify_init_constructor. Pre-evaluate EXPR,
force values that overlap with the lhs (as described by *DATA)
into temporaries. */
static void
-gimplify_init_ctor_preeval (tree *expr_p, tree *pre_p, tree *post_p,
+gimplify_init_ctor_preeval (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
struct gimplify_init_ctor_preeval_data *data)
{
enum gimplify_status one;
@@ -2900,6 +3244,7 @@ gimplify_init_ctor_preeval (tree *expr_p, tree *pre_p, tree *post_p,
for (ix = 0; VEC_iterate (constructor_elt, v, ix, ce); ix++)
gimplify_init_ctor_preeval (&ce->value, pre_p, post_p, data);
+
return;
}
@@ -2907,7 +3252,7 @@ gimplify_init_ctor_preeval (tree *expr_p, tree *pre_p, tree *post_p,
maybe_with_size_expr (expr_p);
/* Gimplify the constructor element to something appropriate for the rhs
- of a MODIFY_EXPR. Given that we know the lhs is an aggregate, we know
+ of a MODIFY_EXPR. Given that we know the LHS is an aggregate, we know
the gimplifier will consider this a store to memory. Doing this
gimplification now means that we won't have to deal with complicated
language-specific trees, nor trees like SAVE_EXPR that can induce
@@ -2958,29 +3303,27 @@ gimplify_init_ctor_preeval (tree *expr_p, tree *pre_p, tree *post_p,
already been taken care of for us, in gimplify_init_ctor_preeval(). */
static void gimplify_init_ctor_eval (tree, VEC(constructor_elt,gc) *,
- tree *, bool);
+ gimple_seq *, bool);
static void
gimplify_init_ctor_eval_range (tree object, tree lower, tree upper,
tree value, tree array_elt_type,
- tree *pre_p, bool cleared)
+ gimple_seq *pre_p, bool cleared)
{
- tree loop_entry_label, loop_exit_label;
+ tree loop_entry_label, loop_exit_label, fall_thru_label;
tree var, var_type, cref, tmp;
loop_entry_label = create_artificial_label ();
loop_exit_label = create_artificial_label ();
+ fall_thru_label = create_artificial_label ();
/* Create and initialize the index variable. */
var_type = TREE_TYPE (upper);
var = create_tmp_var (var_type, NULL);
- append_to_statement_list (build_gimple_modify_stmt (var, lower), pre_p);
+ gimplify_seq_add_stmt (pre_p, gimple_build_assign (var, lower));
/* Add the loop entry label. */
- append_to_statement_list (build1 (LABEL_EXPR,
- void_type_node,
- loop_entry_label),
- pre_p);
+ gimplify_seq_add_stmt (pre_p, gimple_build_label (loop_entry_label));
/* Build the reference. */
cref = build4 (ARRAY_REF, array_elt_type, unshare_expr (object),
@@ -2995,34 +3338,25 @@ gimplify_init_ctor_eval_range (tree object, tree lower, tree upper,
gimplify_init_ctor_eval (cref, CONSTRUCTOR_ELTS (value),
pre_p, cleared);
else
- append_to_statement_list (build_gimple_modify_stmt (cref, value), pre_p);
+ gimplify_seq_add_stmt (pre_p, gimple_build_assign (cref, value));
/* We exit the loop when the index var is equal to the upper bound. */
- gimplify_and_add (build3 (COND_EXPR, void_type_node,
- build2 (EQ_EXPR, boolean_type_node,
- var, upper),
- build1 (GOTO_EXPR,
- void_type_node,
- loop_exit_label),
- NULL_TREE),
- pre_p);
+ gimplify_seq_add_stmt (pre_p,
+ gimple_build_cond (EQ_EXPR, var, upper,
+ loop_exit_label, fall_thru_label));
+
+ gimplify_seq_add_stmt (pre_p, gimple_build_label (fall_thru_label));
/* Otherwise, increment the index var... */
tmp = build2 (PLUS_EXPR, var_type, var,
fold_convert (var_type, integer_one_node));
- append_to_statement_list (build_gimple_modify_stmt (var, tmp), pre_p);
+ gimplify_seq_add_stmt (pre_p, gimple_build_assign (var, tmp));
/* ...and jump back to the loop entry. */
- append_to_statement_list (build1 (GOTO_EXPR,
- void_type_node,
- loop_entry_label),
- pre_p);
+ gimplify_seq_add_stmt (pre_p, gimple_build_goto (loop_entry_label));
/* Add the loop exit label. */
- append_to_statement_list (build1 (LABEL_EXPR,
- void_type_node,
- loop_exit_label),
- pre_p);
+ gimplify_seq_add_stmt (pre_p, gimple_build_label (loop_exit_label));
}
/* Return true if FDECL is accessing a field that is zero sized. */
@@ -3055,7 +3389,7 @@ zero_sized_type (const_tree type)
static void
gimplify_init_ctor_eval (tree object, VEC(constructor_elt,gc) *elts,
- tree *pre_p, bool cleared)
+ gimple_seq *pre_p, bool cleared)
{
tree array_elt_type = NULL;
unsigned HOST_WIDE_INT ix;
@@ -3066,7 +3400,7 @@ gimplify_init_ctor_eval (tree object, VEC(constructor_elt,gc) *elts,
FOR_EACH_CONSTRUCTOR_ELT (elts, ix, purpose, value)
{
- tree cref, init;
+ tree cref;
/* NULL values are created above for gimplification errors. */
if (value == NULL)
@@ -3128,12 +3462,28 @@ gimplify_init_ctor_eval (tree object, VEC(constructor_elt,gc) *elts,
pre_p, cleared);
else
{
- init = build2 (INIT_EXPR, TREE_TYPE (cref), cref, value);
+ tree init = build2 (INIT_EXPR, TREE_TYPE (cref), cref, value);
gimplify_and_add (init, pre_p);
+ ggc_free (init);
}
}
}
+
+/* Returns the appropriate RHS predicate for this LHS. */
+
+gimple_predicate
+rhs_predicate_for (tree lhs)
+{
+ if (is_gimple_formal_tmp_var (lhs))
+ return is_gimple_formal_tmp_or_call_rhs;
+ else if (is_gimple_reg (lhs))
+ return is_gimple_reg_or_call_rhs;
+ else
+ return is_gimple_mem_or_call_rhs;
+}
+
+
/* A subroutine of gimplify_modify_expr. Break out elements of a
CONSTRUCTOR used as an initializer into separate MODIFY_EXPRs.
@@ -3148,12 +3498,11 @@ gimplify_init_ctor_eval (tree object, VEC(constructor_elt,gc) *elts,
If NOTIFY_TEMP_CREATION is false, just do the gimplification. */
static enum gimplify_status
-gimplify_init_constructor (tree *expr_p, tree *pre_p,
- tree *post_p, bool want_value,
- bool notify_temp_creation)
+gimplify_init_constructor (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
+ bool want_value, bool notify_temp_creation)
{
tree object;
- tree ctor = GENERIC_TREE_OPERAND (*expr_p, 1);
+ tree ctor = TREE_OPERAND (*expr_p, 1);
tree type = TREE_TYPE (ctor);
enum gimplify_status ret;
VEC(constructor_elt,gc) *elts;
@@ -3163,16 +3512,16 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p,
if (!notify_temp_creation)
{
- ret = gimplify_expr (&GENERIC_TREE_OPERAND (*expr_p, 0), pre_p, post_p,
+ ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
is_gimple_lvalue, fb_lvalue);
if (ret == GS_ERROR)
return ret;
}
- object = GENERIC_TREE_OPERAND (*expr_p, 0);
+ object = TREE_OPERAND (*expr_p, 0);
elts = CONSTRUCTOR_ELTS (ctor);
-
ret = GS_ALL_DONE;
+
switch (TREE_CODE (type))
{
case RECORD_TYPE:
@@ -3194,7 +3543,7 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p,
return GS_OK;
break;
}
-
+
/* Fetch information about the constructor to direct later processing.
We might want to make static versions of it in various cases, and
can only do so if it known to be a valid constant initializer. */
@@ -3287,25 +3636,25 @@ gimplify_init_constructor (tree *expr_p, tree *pre_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);
- GENERIC_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
@@ -3327,7 +3676,7 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p,
preeval_data.lhs_base_decl = NULL;
preeval_data.lhs_alias_set = get_alias_set (object);
- gimplify_init_ctor_preeval (&GENERIC_TREE_OPERAND (*expr_p, 1),
+ gimplify_init_ctor_preeval (&TREE_OPERAND (*expr_p, 1),
pre_p, post_p, &preeval_data);
}
@@ -3337,9 +3686,9 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p,
Note that we still have to gimplify, in order to handle the
case of variable sized types. Avoid shared tree structures. */
CONSTRUCTOR_ELTS (ctor) = NULL;
+ TREE_SIDE_EFFECTS (ctor) = 0;
object = unshare_expr (object);
- gimplify_stmt (expr_p);
- append_to_statement_list (*expr_p, pre_p);
+ gimplify_stmt (expr_p, pre_p);
}
/* If we have not block cleared the object, or if there are nonzero
@@ -3383,7 +3732,9 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p,
{
ctor = build2 (COMPLEX_EXPR, type, r, i);
TREE_OPERAND (*expr_p, 1) = ctor;
- ret = gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, post_p,
+ ret = gimplify_expr (&TREE_OPERAND (*expr_p, 1),
+ pre_p,
+ post_p,
rhs_predicate_for (TREE_OPERAND (*expr_p, 0)),
fb_rvalue);
}
@@ -3435,13 +3786,13 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p,
for (ix = 0; VEC_iterate (constructor_elt, elts, ix, ce); ix++)
{
enum gimplify_status tret;
- tret = gimplify_expr (&ce->value, pre_p, post_p,
- is_gimple_val, fb_rvalue);
+ tret = gimplify_expr (&ce->value, pre_p, post_p, is_gimple_val,
+ fb_rvalue);
if (tret == GS_ERROR)
ret = GS_ERROR;
}
- if (!is_gimple_reg (GENERIC_TREE_OPERAND (*expr_p, 0)))
- GENERIC_TREE_OPERAND (*expr_p, 1) = get_formal_tmp_var (ctor, pre_p);
+ if (!is_gimple_reg (TREE_OPERAND (*expr_p, 0)))
+ TREE_OPERAND (*expr_p, 1) = get_formal_tmp_var (ctor, pre_p);
}
break;
@@ -3454,12 +3805,24 @@ gimplify_init_constructor (tree *expr_p, tree *pre_p,
return GS_ERROR;
else if (want_value)
{
- append_to_statement_list (*expr_p, pre_p);
*expr_p = object;
return GS_OK;
}
else
- return GS_ALL_DONE;
+ {
+ /* If we have gimplified both sides of the initializer but have
+ not emitted an assignment, do so now. */
+ if (*expr_p)
+ {
+ tree lhs = TREE_OPERAND (*expr_p, 0);
+ tree rhs = TREE_OPERAND (*expr_p, 1);
+ gimple init = gimple_build_assign (lhs, rhs);
+ gimplify_seq_add_stmt (pre_p, init);
+ *expr_p = NULL;
+ }
+
+ return GS_ALL_DONE;
+ }
}
/* Given a pointer value OP0, return a simplified version of an
@@ -3537,8 +3900,9 @@ gimple_fold_indirect_ref_rhs (tree t)
something changes. */
static enum gimplify_status
-gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p, tree *pre_p,
- tree *post_p, bool want_value)
+gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p,
+ gimple_seq *pre_p, gimple_seq *post_p,
+ bool want_value)
{
enum gimplify_status ret = GS_OK;
@@ -3549,7 +3913,7 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p, tree *pre_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)
{
@@ -3735,8 +4099,8 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p, tree *pre_p,
tree wrap = *from_p;
tree t;
- ret = gimplify_expr (to_p, pre_p, post_p,
- is_gimple_min_lval, fb_lvalue);
+ ret = gimplify_expr (to_p, pre_p, post_p, is_gimple_min_lval,
+ fb_lvalue);
if (ret != GS_ERROR)
ret = GS_OK;
@@ -3761,51 +4125,6 @@ gimplify_modify_expr_rhs (tree *expr_p, tree *from_p, tree *to_p, tree *pre_p,
return ret;
}
-/* Destructively convert the TREE pointer in TP into a gimple tuple if
- appropriate. */
-
-static void
-tree_to_gimple_tuple (tree *tp)
-{
-
- switch (TREE_CODE (*tp))
- {
- case GIMPLE_MODIFY_STMT:
- return;
- case MODIFY_EXPR:
- {
- struct gimple_stmt *gs;
- tree lhs = TREE_OPERAND (*tp, 0);
- bool def_stmt_self_p = false;
-
- if (TREE_CODE (lhs) == SSA_NAME)
- {
- if (SSA_NAME_DEF_STMT (lhs) == *tp)
- def_stmt_self_p = true;
- }
-
- gs = &make_node (GIMPLE_MODIFY_STMT)->gstmt;
- gs->base = (*tp)->base;
- /* The set to base above overwrites the CODE. */
- TREE_SET_CODE ((tree) gs, GIMPLE_MODIFY_STMT);
-
- SET_EXPR_LOCUS ((tree) gs, EXPR_LOCUS (*tp));
- gs->operands[0] = TREE_OPERAND (*tp, 0);
- gs->operands[1] = TREE_OPERAND (*tp, 1);
- gs->block = TREE_BLOCK (*tp);
- *tp = (tree)gs;
-
- /* If we re-gimplify a set to an SSA_NAME, we must change the
- SSA name's DEF_STMT link. */
- if (def_stmt_self_p)
- SSA_NAME_DEF_STMT (GIMPLE_STMT_OPERAND (*tp, 0)) = *tp;
-
- return;
- }
- default:
- break;
- }
-}
/* Promote partial stores to COMPLEX variables to total stores. *EXPR_P is
a MODIFY_EXPR with a lhs of a REAL/IMAGPART_EXPR of a variable with
@@ -3820,13 +4139,14 @@ tree_to_gimple_tuple (tree *tp)
followed by a DCE pass are necessary in order to fix things up. */
static enum gimplify_status
-gimplify_modify_expr_complex_part (tree *expr_p, tree *pre_p, bool want_value)
+gimplify_modify_expr_complex_part (tree *expr_p, gimple_seq *pre_p,
+ bool want_value)
{
enum tree_code code, ocode;
tree lhs, rhs, new_rhs, other, realpart, imagpart;
- lhs = GENERIC_TREE_OPERAND (*expr_p, 0);
- rhs = GENERIC_TREE_OPERAND (*expr_p, 1);
+ lhs = TREE_OPERAND (*expr_p, 0);
+ rhs = TREE_OPERAND (*expr_p, 1);
code = TREE_CODE (lhs);
lhs = TREE_OPERAND (lhs, 0);
@@ -3842,20 +4162,13 @@ gimplify_modify_expr_complex_part (tree *expr_p, tree *pre_p, bool want_value)
else
new_rhs = build2 (COMPLEX_EXPR, TREE_TYPE (lhs), realpart, imagpart);
- GENERIC_TREE_OPERAND (*expr_p, 0) = lhs;
- GENERIC_TREE_OPERAND (*expr_p, 1) = new_rhs;
-
- if (want_value)
- {
- tree_to_gimple_tuple (expr_p);
-
- append_to_statement_list (*expr_p, pre_p);
- *expr_p = rhs;
- }
+ gimplify_seq_add_stmt (pre_p, gimple_build_assign (lhs, new_rhs));
+ *expr_p = (want_value) ? rhs : NULL_TREE;
return GS_ALL_DONE;
}
+
/* Gimplify the MODIFY_EXPR node pointed to by EXPR_P.
modify_expr
@@ -3872,14 +4185,15 @@ gimplify_modify_expr_complex_part (tree *expr_p, tree *pre_p, bool want_value)
in another expression. */
static enum gimplify_status
-gimplify_modify_expr (tree *expr_p, tree *pre_p, tree *post_p, bool want_value)
+gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
+ bool want_value)
{
- tree *from_p = &GENERIC_TREE_OPERAND (*expr_p, 1);
- tree *to_p = &GENERIC_TREE_OPERAND (*expr_p, 0);
+ tree *from_p = &TREE_OPERAND (*expr_p, 1);
+ tree *to_p = &TREE_OPERAND (*expr_p, 0);
enum gimplify_status ret = GS_UNHANDLED;
+ gimple assign;
gcc_assert (TREE_CODE (*expr_p) == MODIFY_EXPR
- || TREE_CODE (*expr_p) == GIMPLE_MODIFY_STMT
|| TREE_CODE (*expr_p) == INIT_EXPR);
/* Insert pointer conversions required by the middle-end that are not
@@ -3903,12 +4217,10 @@ gimplify_modify_expr (tree *expr_p, tree *pre_p, tree *post_p, bool want_value)
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);
- gimplify_stmt (to_p);
- append_to_statement_list (*from_p, pre_p);
- append_to_statement_list (*to_p, pre_p);
+ gimplify_stmt (from_p, pre_p);
+ gimplify_stmt (to_p, pre_p);
*expr_p = NULL_TREE;
return GS_ALL_DONE;
}
@@ -3918,15 +4230,27 @@ gimplify_modify_expr (tree *expr_p, tree *pre_p, tree *post_p, bool want_value)
before gimplifying any of the operands so that we can resolve any
PLACEHOLDER_EXPRs in the size. Also note that the RTL expander uses
the size of the expression to be copied, not of the destination, so
- that is what we must here. */
+ that is what we must do here. */
maybe_with_size_expr (from_p);
ret = gimplify_expr (to_p, pre_p, post_p, is_gimple_lvalue, fb_lvalue);
if (ret == GS_ERROR)
return ret;
- ret = gimplify_expr (from_p, pre_p, post_p,
- rhs_predicate_for (*to_p), fb_rvalue);
+ /* As a special case, we have to temporarily allow for assignments
+ with a CALL_EXPR on the RHS. Since in GIMPLE a function call is
+ a toplevel statement, when gimplifying the GENERIC expression
+ MODIFY_EXPR <a, CALL_EXPR <foo>>, we cannot create the tuple
+ GIMPLE_ASSIGN <a, GIMPLE_CALL <foo>>.
+
+ Instead, we need to create the tuple GIMPLE_CALL <a, foo>. To
+ prevent gimplify_expr from trying to create a new temporary for
+ foo's LHS, we tell it that it should only gimplify until it
+ reaches the CALL_EXPR. On return from gimplify_expr, the newly
+ created GIMPLE_CALL <foo> will be the last statement in *PRE_P
+ and all we need to do here is set 'a' to be its LHS. */
+ ret = gimplify_expr (from_p, pre_p, post_p, rhs_predicate_for (*to_p),
+ fb_rvalue);
if (ret == GS_ERROR)
return ret;
@@ -3945,11 +4269,13 @@ gimplify_modify_expr (tree *expr_p, tree *pre_p, tree *post_p, bool want_value)
tree size = TREE_OPERAND (*from_p, 1);
if (TREE_CODE (from) == CONSTRUCTOR)
- return gimplify_modify_expr_to_memset (expr_p, size, want_value);
+ return gimplify_modify_expr_to_memset (expr_p, size, want_value, pre_p);
+
if (is_gimple_addressable (from))
{
*from_p = from;
- return gimplify_modify_expr_to_memcpy (expr_p, size, want_value);
+ return gimplify_modify_expr_to_memcpy (expr_p, size, want_value,
+ pre_p);
}
}
@@ -3961,35 +4287,49 @@ gimplify_modify_expr (tree *expr_p, tree *pre_p, tree *post_p, bool want_value)
&& is_gimple_reg (TREE_OPERAND (*to_p, 0)))
return gimplify_modify_expr_complex_part (expr_p, pre_p, want_value);
- if (gimplify_ctxp->into_ssa && is_gimple_reg (*to_p))
- {
- /* If we've somehow already got an SSA_NAME on the LHS, then
- we're probably modified it twice. Not good. */
- gcc_assert (TREE_CODE (*to_p) != SSA_NAME);
- *to_p = make_ssa_name (*to_p, *expr_p);
- }
-
/* Try to alleviate the effects of the gimplification creating artificial
temporaries (see for example is_gimple_reg_rhs) on the debug info. */
if (!gimplify_ctxp->into_ssa
- && DECL_P (*from_p) && DECL_IGNORED_P (*from_p)
- && DECL_P (*to_p) && !DECL_IGNORED_P (*to_p))
+ && DECL_P (*from_p)
+ && DECL_IGNORED_P (*from_p)
+ && DECL_P (*to_p)
+ && !DECL_IGNORED_P (*to_p))
{
if (!DECL_NAME (*from_p) && DECL_NAME (*to_p))
DECL_NAME (*from_p)
= create_tmp_var_name (IDENTIFIER_POINTER (DECL_NAME (*to_p)));
DECL_DEBUG_EXPR_IS_FROM (*from_p) = 1;
SET_DECL_DEBUG_EXPR (*from_p, *to_p);
+ }
+
+ if (TREE_CODE (*from_p) == CALL_EXPR)
+ {
+ /* Since the RHS is a CALL_EXPR, we need to create a GIMPLE_CALL
+ instead of a GIMPLE_ASSIGN. */
+ assign = gimple_build_call_from_tree (*from_p);
+ gimple_call_set_lhs (assign, *to_p);
}
+ else
+ assign = gimple_build_assign (*to_p, *from_p);
- if (want_value)
+ gimplify_seq_add_stmt (pre_p, assign);
+
+ if (gimplify_ctxp->into_ssa && is_gimple_reg (*to_p))
{
- tree_to_gimple_tuple (expr_p);
+ /* If we've somehow already got an SSA_NAME on the LHS, then
+ we've probably modified it twice. Not good. */
+ gcc_assert (TREE_CODE (*to_p) != SSA_NAME);
+ *to_p = make_ssa_name (*to_p, assign);
+ gimple_set_lhs (assign, *to_p);
+ }
- append_to_statement_list (*expr_p, pre_p);
- *expr_p = *to_p;
+ if (want_value)
+ {
+ *expr_p = unshare_expr (*to_p);
return GS_OK;
}
+ else
+ *expr_p = NULL;
return GS_ALL_DONE;
}
@@ -4071,12 +4411,9 @@ gimplify_boolean_expr (tree *expr_p)
expressions in the sequence will be emitted.
WANT_VALUE is true when the result of the last COMPOUND_EXPR is used. */
-/* ??? Should rearrange to share the pre-queue with all the indirect
- invocations of gimplify_expr. Would probably save on creations
- of statement_list nodes. */
static enum gimplify_status
-gimplify_compound_expr (tree *expr_p, tree *pre_p, bool want_value)
+gimplify_compound_expr (tree *expr_p, gimple_seq *pre_p, bool want_value)
{
tree t = *expr_p;
@@ -4087,8 +4424,7 @@ gimplify_compound_expr (tree *expr_p, tree *pre_p, bool want_value)
if (TREE_CODE (*sub_p) == COMPOUND_EXPR)
gimplify_compound_expr (sub_p, pre_p, false);
else
- gimplify_stmt (sub_p);
- append_to_statement_list (*sub_p, pre_p);
+ gimplify_stmt (sub_p, pre_p);
t = TREE_OPERAND (t, 1);
}
@@ -4099,58 +4435,21 @@ gimplify_compound_expr (tree *expr_p, tree *pre_p, bool want_value)
return GS_OK;
else
{
- gimplify_stmt (expr_p);
+ gimplify_stmt (expr_p, pre_p);
return GS_ALL_DONE;
}
}
-/* Gimplifies a statement list. These may be created either by an
- enlightened front-end, or by shortcut_cond_expr. */
-
-static enum gimplify_status
-gimplify_statement_list (tree *expr_p, tree *pre_p)
-{
- tree temp = voidify_wrapper_expr (*expr_p, NULL);
-
- tree_stmt_iterator i = tsi_start (*expr_p);
-
- while (!tsi_end_p (i))
- {
- tree t;
-
- gimplify_stmt (tsi_stmt_ptr (i));
-
- t = tsi_stmt (i);
- if (t == NULL)
- tsi_delink (&i);
- else if (TREE_CODE (t) == STATEMENT_LIST)
- {
- tsi_link_before (&i, t, TSI_SAME_STMT);
- tsi_delink (&i);
- }
- else
- tsi_next (&i);
- }
-
- if (temp)
- {
- append_to_statement_list (*expr_p, pre_p);
- *expr_p = temp;
- return GS_OK;
- }
-
- return GS_ALL_DONE;
-}
-/* Gimplify a SAVE_EXPR node. EXPR_P points to the expression to
- gimplify. After gimplification, EXPR_P will point to a new temporary
- that holds the original value of the SAVE_EXPR node.
+/* Gimplify a SAVE_EXPR node. EXPR_P points to the expression to
+ gimplify. After gimplification, EXPR_P will point to a new temporary
+ that holds the original value of the SAVE_EXPR node.
- PRE_P points to the list where side effects that must happen before
- *EXPR_P should be stored. */
+ PRE_P points to the list where side effects that must happen before
+ *EXPR_P should be stored. */
static enum gimplify_status
-gimplify_save_expr (tree *expr_p, tree *pre_p, tree *post_p)
+gimplify_save_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
{
enum gimplify_status ret = GS_ALL_DONE;
tree val;
@@ -4168,7 +4467,6 @@ gimplify_save_expr (tree *expr_p, tree *pre_p, tree *post_p)
{
ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
is_gimple_stmt, fb_none);
- append_to_statement_list (TREE_OPERAND (*expr_p, 0), pre_p);
val = NULL;
}
else
@@ -4197,7 +4495,7 @@ gimplify_save_expr (tree *expr_p, tree *pre_p, tree *post_p)
*EXPR_P should be stored. */
static enum gimplify_status
-gimplify_addr_expr (tree *expr_p, tree *pre_p, tree *post_p)
+gimplify_addr_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
{
tree expr = *expr_p;
tree op0 = TREE_OPERAND (expr, 0);
@@ -4280,24 +4578,39 @@ gimplify_addr_expr (tree *expr_p, tree *pre_p, tree *post_p)
value; output operands should be a gimple lvalue. */
static enum gimplify_status
-gimplify_asm_expr (tree *expr_p, tree *pre_p, tree *post_p)
+gimplify_asm_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
{
- tree expr = *expr_p;
- int noutputs = list_length (ASM_OUTPUTS (expr));
- const char **oconstraints
- = (const char **) alloca ((noutputs) * sizeof (const char *));
+ tree expr;
+ int noutputs;
+ const char **oconstraints;
int i;
tree link;
const char *constraint;
bool allows_mem, allows_reg, is_inout;
enum gimplify_status ret, tret;
+ gimple stmt;
+ VEC(tree, gc) *inputs;
+ VEC(tree, gc) *outputs;
+ VEC(tree, gc) *clobbers;
+ tree link_next;
+
+ expr = *expr_p;
+ noutputs = list_length (ASM_OUTPUTS (expr));
+ oconstraints = (const char **) alloca ((noutputs) * sizeof (const char *));
+
+ inputs = outputs = clobbers = NULL;
ret = GS_ALL_DONE;
- for (i = 0, link = ASM_OUTPUTS (expr); link; ++i, link = TREE_CHAIN (link))
+ link_next = NULL_TREE;
+ for (i = 0, link = ASM_OUTPUTS (expr); link; ++i, link = link_next)
{
- size_t constraint_len;
bool ok;
- oconstraints[i] = constraint
+ size_t constraint_len;
+
+ link_next = TREE_CHAIN (link);
+
+ oconstraints[i]
+ = constraint
= TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
constraint_len = strlen (constraint);
if (constraint_len == 0)
@@ -4323,6 +4636,9 @@ gimplify_asm_expr (tree *expr_p, tree *pre_p, tree *post_p)
ret = tret;
}
+ VEC_safe_push (tree, gc, outputs, link);
+ TREE_CHAIN (link) = NULL_TREE;
+
if (is_inout)
{
/* An input/output operand. To give the optimizers more
@@ -4416,10 +4732,11 @@ gimplify_asm_expr (tree *expr_p, tree *pre_p, tree *post_p)
}
}
- for (link = ASM_INPUTS (expr); link; ++i, link = TREE_CHAIN (link))
+ link_next = NULL_TREE;
+ for (link = ASM_INPUTS (expr); link; ++i, link = link_next)
{
- constraint
- = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
+ link_next = TREE_CHAIN (link);
+ constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
parse_input_constraint (&constraint, 0, 0, noutputs, 0,
oconstraints, &allows_mem, &allows_reg);
@@ -4455,13 +4772,27 @@ gimplify_asm_expr (tree *expr_p, tree *pre_p, tree *post_p)
if (tret == GS_ERROR)
ret = tret;
}
+
+ TREE_CHAIN (link) = NULL_TREE;
+ VEC_safe_push (tree, gc, inputs, link);
}
+
+ for (link = ASM_CLOBBERS (expr); link; ++i, link = TREE_CHAIN (link))
+ VEC_safe_push (tree, gc, clobbers, link);
+
+ stmt = gimple_build_asm_vec (TREE_STRING_POINTER (ASM_STRING (expr)),
+ inputs, outputs, clobbers);
+
+ gimple_asm_set_volatile (stmt, ASM_VOLATILE_P (expr));
+ gimple_asm_set_input (stmt, ASM_INPUT_P (expr));
+
+ gimplify_seq_add_stmt (pre_p, stmt);
return ret;
}
/* Gimplify a CLEANUP_POINT_EXPR. Currently this works by adding
- WITH_CLEANUP_EXPRs to the prequeue as we encounter cleanups while
+ GIMPLE_WITH_CLEANUP_EXPRs to the prequeue as we encounter cleanups while
gimplifying the body, and converting them to TRY_FINALLY_EXPRs when we
return to this function.
@@ -4475,10 +4806,10 @@ gimplify_asm_expr (tree *expr_p, tree *pre_p, tree *post_p)
Thing. */
static enum gimplify_status
-gimplify_cleanup_point_expr (tree *expr_p, tree *pre_p)
+gimplify_cleanup_point_expr (tree *expr_p, gimple_seq *pre_p)
{
- tree_stmt_iterator iter;
- tree body;
+ gimple_stmt_iterator iter;
+ gimple_seq body_sequence = NULL;
tree temp = voidify_wrapper_expr (*expr_p, NULL);
@@ -4486,74 +4817,79 @@ gimplify_cleanup_point_expr (tree *expr_p, tree *pre_p)
CLEANUP_POINT_EXPR and the cleanup. So save and reset the count and
any cleanups collected outside the CLEANUP_POINT_EXPR. */
int old_conds = gimplify_ctxp->conditions;
- tree old_cleanups = gimplify_ctxp->conditional_cleanups;
+ gimple_seq old_cleanups = gimplify_ctxp->conditional_cleanups;
gimplify_ctxp->conditions = 0;
- gimplify_ctxp->conditional_cleanups = NULL_TREE;
+ gimplify_ctxp->conditional_cleanups = NULL;
- body = TREE_OPERAND (*expr_p, 0);
- gimplify_to_stmt_list (&body);
+ gimplify_stmt (&TREE_OPERAND (*expr_p, 0), &body_sequence);
gimplify_ctxp->conditions = old_conds;
gimplify_ctxp->conditional_cleanups = old_cleanups;
- for (iter = tsi_start (body); !tsi_end_p (iter); )
+ for (iter = gsi_start (body_sequence); !gsi_end_p (iter); )
{
- tree *wce_p = tsi_stmt_ptr (iter);
- tree wce = *wce_p;
+ gimple wce = gsi_stmt (iter);
- if (TREE_CODE (wce) == WITH_CLEANUP_EXPR)
+ if (gimple_code (wce) == GIMPLE_WITH_CLEANUP_EXPR)
{
- if (tsi_one_before_end_p (iter))
+ if (gsi_one_before_end_p (iter))
{
- tsi_link_before (&iter, TREE_OPERAND (wce, 0), TSI_SAME_STMT);
- tsi_delink (&iter);
+ /* Note that gsi_insert_seq_before and gsi_remove do not
+ scan operands, unlike some other sequence mutators. */
+ gsi_insert_seq_before_without_update (&iter,
+ gimple_wce_cleanup (wce),
+ GSI_SAME_STMT);
+ gsi_remove (&iter, true);
break;
}
else
{
- tree sl, tfe;
- enum tree_code code;
+ gimple gtry;
+ gimple_seq seq;
+ enum gimple_try_flags kind;
- if (CLEANUP_EH_ONLY (wce))
- code = TRY_CATCH_EXPR;
+ if (gimple_wce_cleanup_eh_only (wce))
+ kind = GIMPLE_TRY_CATCH;
else
- code = TRY_FINALLY_EXPR;
-
- sl = tsi_split_statement_list_after (&iter);
- tfe = build2 (code, void_type_node, sl, NULL_TREE);
- append_to_statement_list (TREE_OPERAND (wce, 0),
- &TREE_OPERAND (tfe, 1));
- *wce_p = tfe;
- iter = tsi_start (sl);
+ kind = GIMPLE_TRY_FINALLY;
+ seq = gsi_split_seq_after (iter);
+
+ 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) = gtry;
+ iter = gsi_start (seq);
}
}
else
- tsi_next (&iter);
+ gsi_next (&iter);
}
+ gimplify_seq_add_seq (pre_p, body_sequence);
if (temp)
{
*expr_p = temp;
- append_to_statement_list (body, pre_p);
return GS_OK;
}
else
{
- *expr_p = body;
+ *expr_p = NULL;
return GS_ALL_DONE;
}
}
/* Insert a cleanup marker for gimplify_cleanup_point_expr. CLEANUP
- is the cleanup action required. */
+ is the cleanup action required. EH_ONLY is true if the cleanup should
+ only be executed if an exception is thrown, not on normal exit. */
static void
-gimple_push_cleanup (tree var, tree cleanup, bool eh_only, tree *pre_p)
+gimple_push_cleanup (tree var, tree cleanup, bool eh_only, gimple_seq *pre_p)
{
- tree wce;
+ gimple wce;
+ gimple_seq cleanup_stmts = NULL;
/* Errors can result in improperly nested cleanups. Which results in
- confusion when trying to resolve the WITH_CLEANUP_EXPR. */
+ confusion when trying to resolve the GIMPLE_WITH_CLEANUP_EXPR. */
if (errorcount || sorrycount)
return;
@@ -4579,15 +4915,17 @@ gimple_push_cleanup (tree var, tree cleanup, bool eh_only, tree *pre_p)
}
val
*/
-
tree flag = create_tmp_var (boolean_type_node, "cleanup");
- tree ffalse = build_gimple_modify_stmt (flag, boolean_false_node);
- tree ftrue = build_gimple_modify_stmt (flag, boolean_true_node);
+ gimple ffalse = gimple_build_assign (flag, boolean_false_node);
+ gimple ftrue = gimple_build_assign (flag, boolean_true_node);
+
cleanup = build3 (COND_EXPR, void_type_node, flag, cleanup, NULL);
- wce = build1 (WITH_CLEANUP_EXPR, void_type_node, cleanup);
- append_to_statement_list (ffalse, &gimplify_ctxp->conditional_cleanups);
- append_to_statement_list (wce, &gimplify_ctxp->conditional_cleanups);
- append_to_statement_list (ftrue, pre_p);
+ gimplify_stmt (&cleanup, &cleanup_stmts);
+ wce = gimple_build_wce (cleanup_stmts);
+
+ gimplify_seq_add_stmt (&gimplify_ctxp->conditional_cleanups, ffalse);
+ gimplify_seq_add_stmt (&gimplify_ctxp->conditional_cleanups, wce);
+ gimplify_seq_add_stmt (pre_p, ftrue);
/* Because of this manipulation, and the EH edges that jump
threading cannot redirect, the temporary (VAR) will appear
@@ -4596,18 +4934,17 @@ gimple_push_cleanup (tree var, tree cleanup, bool eh_only, tree *pre_p)
}
else
{
- wce = build1 (WITH_CLEANUP_EXPR, void_type_node, cleanup);
- CLEANUP_EH_ONLY (wce) = eh_only;
- append_to_statement_list (wce, pre_p);
+ gimplify_stmt (&cleanup, &cleanup_stmts);
+ wce = gimple_build_wce (cleanup_stmts);
+ gimple_wce_set_cleanup_eh_only (wce, eh_only);
+ gimplify_seq_add_stmt (pre_p, wce);
}
-
- gimplify_stmt (&TREE_OPERAND (wce, 0));
}
/* Gimplify a TARGET_EXPR which doesn't appear on the rhs of an INIT_EXPR. */
static enum gimplify_status
-gimplify_target_expr (tree *expr_p, tree *pre_p, tree *post_p)
+gimplify_target_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
{
tree targ = *expr_p;
tree temp = TARGET_EXPR_SLOT (targ);
@@ -4633,9 +4970,11 @@ gimplify_target_expr (tree *expr_p, tree *pre_p, tree *post_p)
ret = gimplify_expr (&init, pre_p, post_p, is_gimple_stmt, fb_none);
else
{
- init = build2 (INIT_EXPR, void_type_node, temp, init);
- ret = gimplify_expr (&init, pre_p, post_p, is_gimple_stmt,
- fb_none);
+ tree init_expr = build2 (INIT_EXPR, void_type_node, temp, init);
+ init = init_expr;
+ ret = gimplify_expr (&init, pre_p, post_p, is_gimple_stmt, fb_none);
+ init = NULL;
+ ggc_free (init_expr);
}
if (ret == GS_ERROR)
{
@@ -4643,15 +4982,13 @@ gimplify_target_expr (tree *expr_p, tree *pre_p, tree *post_p)
TARGET_EXPR_INITIAL (targ) = NULL_TREE;
return GS_ERROR;
}
- append_to_statement_list (init, pre_p);
+ if (init)
+ gimplify_and_add (init, pre_p);
/* If needed, push the cleanup for the temp. */
if (TARGET_EXPR_CLEANUP (targ))
- {
- gimplify_stmt (&TARGET_EXPR_CLEANUP (targ));
- gimple_push_cleanup (temp, TARGET_EXPR_CLEANUP (targ),
- CLEANUP_EH_ONLY (targ), pre_p);
- }
+ gimple_push_cleanup (temp, TARGET_EXPR_CLEANUP (targ),
+ CLEANUP_EH_ONLY (targ), pre_p);
/* Only expand this once. */
TREE_OPERAND (targ, 3) = init;
@@ -4667,29 +5004,23 @@ gimplify_target_expr (tree *expr_p, tree *pre_p, tree *post_p)
/* Gimplification of expression trees. */
-/* Gimplify an expression which appears at statement context; usually, this
- means replacing it with a suitably gimple STATEMENT_LIST. */
+/* Gimplify an expression which appears at statement context. The
+ corresponding GIMPLE statements are added to *SEQ_P. If *SEQ_P is
+ NULL, a new sequence is allocated.
-void
-gimplify_stmt (tree *stmt_p)
+ Return true if we actually added a statement to the queue. */
+
+bool
+gimplify_stmt (tree *stmt_p, gimple_seq *seq_p)
{
- gimplify_expr (stmt_p, NULL, NULL, is_gimple_stmt, fb_none);
-}
+ gimple_seq_node last;
-/* Similarly, but force the result to be a STATEMENT_LIST. */
+ if (!*seq_p)
+ *seq_p = gimple_seq_alloc ();
-void
-gimplify_to_stmt_list (tree *stmt_p)
-{
- gimplify_stmt (stmt_p);
- if (!*stmt_p)
- *stmt_p = alloc_stmt_list ();
- else if (TREE_CODE (*stmt_p) != STATEMENT_LIST)
- {
- tree t = *stmt_p;
- *stmt_p = alloc_stmt_list ();
- append_to_statement_list (t, stmt_p);
- }
+ last = gimple_seq_last (*seq_p);
+ gimplify_expr (stmt_p, seq_p, NULL, is_gimple_stmt, fb_none);
+ return last != gimple_seq_last (*seq_p);
}
@@ -5078,7 +5409,7 @@ omp_check_private (struct gimplify_omp_ctx *ctx, tree decl)
and previous omp contexts. */
static void
-gimplify_scan_omp_clauses (tree *list_p, tree *pre_p,
+gimplify_scan_omp_clauses (tree *list_p, gimple_seq *pre_p,
enum omp_region_type region_type)
{
struct gimplify_omp_ctx *ctx, *outer_ctx;
@@ -5090,7 +5421,6 @@ gimplify_scan_omp_clauses (tree *list_p, tree *pre_p,
while ((c = *list_p) != NULL)
{
- enum gimplify_status gs;
bool remove = false;
bool notice_outer = true;
const char *check_non_private = NULL;
@@ -5140,11 +5470,22 @@ gimplify_scan_omp_clauses (tree *list_p, tree *pre_p,
GOVD_LOCAL | GOVD_SEEN);
gimplify_omp_ctxp = ctx;
push_gimplify_context (&gctx);
- gimplify_stmt (&OMP_CLAUSE_REDUCTION_INIT (c));
- pop_gimplify_context (OMP_CLAUSE_REDUCTION_INIT (c));
+
+ OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c) = gimple_seq_alloc ();
+ OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c) = gimple_seq_alloc ();
+
+ gimplify_and_add (OMP_CLAUSE_REDUCTION_INIT (c),
+ &OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c));
+ pop_gimplify_context
+ (gimple_seq_first_stmt (OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c)));
push_gimplify_context (&gctx);
- gimplify_stmt (&OMP_CLAUSE_REDUCTION_MERGE (c));
- pop_gimplify_context (OMP_CLAUSE_REDUCTION_MERGE (c));
+ gimplify_and_add (OMP_CLAUSE_REDUCTION_MERGE (c),
+ &OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c));
+ pop_gimplify_context
+ (gimple_seq_first_stmt (OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c)));
+ OMP_CLAUSE_REDUCTION_INIT (c) = NULL_TREE;
+ OMP_CLAUSE_REDUCTION_MERGE (c) = NULL_TREE;
+
gimplify_omp_ctxp = outer_ctx;
}
else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE
@@ -5160,8 +5501,12 @@ gimplify_scan_omp_clauses (tree *list_p, tree *pre_p,
BIND_EXPR_BODY (bind) = OMP_CLAUSE_LASTPRIVATE_STMT (c);
OMP_CLAUSE_LASTPRIVATE_STMT (c) = bind;
}
- gimplify_stmt (&OMP_CLAUSE_LASTPRIVATE_STMT (c));
- pop_gimplify_context (OMP_CLAUSE_LASTPRIVATE_STMT (c));
+ gimplify_and_add (OMP_CLAUSE_LASTPRIVATE_STMT (c),
+ &OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c));
+ pop_gimplify_context
+ (gimple_seq_first_stmt (OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c)));
+ OMP_CLAUSE_LASTPRIVATE_STMT (c) = NULL_TREE;
+
gimplify_omp_ctxp = outer_ctx;
}
if (notice_outer)
@@ -5196,10 +5541,9 @@ gimplify_scan_omp_clauses (tree *list_p, tree *pre_p,
case OMP_CLAUSE_SCHEDULE:
case OMP_CLAUSE_NUM_THREADS:
- gs = gimplify_expr (&OMP_CLAUSE_OPERAND (c, 0), pre_p, NULL,
- is_gimple_val, fb_rvalue);
- if (gs == GS_ERROR)
- remove = true;
+ if (gimplify_expr (&OMP_CLAUSE_OPERAND (c, 0), pre_p, NULL,
+ is_gimple_val, fb_rvalue) == GS_ERROR)
+ remove = true;
break;
case OMP_CLAUSE_NOWAIT:
@@ -5370,10 +5714,12 @@ gimplify_adjust_omp_clauses (tree *list_p)
variables. We need to do this scan now, because variable-sized
decls will be decomposed during gimplification. */
-static enum gimplify_status
-gimplify_omp_parallel (tree *expr_p, tree *pre_p)
+static void
+gimplify_omp_parallel (tree *expr_p, gimple_seq *pre_p)
{
tree expr = *expr_p;
+ gimple g;
+ gimple_seq body = NULL;
struct gimplify_ctx gctx;
gimplify_scan_omp_clauses (&OMP_PARALLEL_CLAUSES (expr), pre_p,
@@ -5383,16 +5729,21 @@ gimplify_omp_parallel (tree *expr_p, tree *pre_p)
push_gimplify_context (&gctx);
- gimplify_stmt (&OMP_PARALLEL_BODY (expr));
-
- if (TREE_CODE (OMP_PARALLEL_BODY (expr)) == BIND_EXPR)
- pop_gimplify_context (OMP_PARALLEL_BODY (expr));
+ g = gimplify_and_return_first (OMP_PARALLEL_BODY (expr), &body);
+ if (gimple_code (g) == GIMPLE_BIND)
+ pop_gimplify_context (g);
else
- pop_gimplify_context (NULL_TREE);
+ pop_gimplify_context (NULL);
gimplify_adjust_omp_clauses (&OMP_PARALLEL_CLAUSES (expr));
- return GS_ALL_DONE;
+ g = gimple_build_omp_parallel (body,
+ OMP_PARALLEL_CLAUSES (expr),
+ NULL_TREE, NULL_TREE);
+ if (OMP_PARALLEL_COMBINED (expr))
+ gimple_omp_set_subcode (g, GF_OMP_PARALLEL_COMBINED);
+ gimplify_seq_add_stmt (pre_p, g);
+ *expr_p = NULL_TREE;
}
/* Gimplify the contents of an OMP_TASK statement. This involves
@@ -5400,36 +5751,43 @@ gimplify_omp_parallel (tree *expr_p, tree *pre_p)
variables. We need to do this scan now, because variable-sized
decls will be decomposed during gimplification. */
-static enum gimplify_status
-gimplify_omp_task (tree *expr_p, tree *pre_p)
+static void
+gimplify_omp_task (tree *expr_p, gimple_seq *pre_p)
{
tree expr = *expr_p;
+ gimple g;
+ gimple_seq body = NULL;
struct gimplify_ctx gctx;
gimplify_scan_omp_clauses (&OMP_TASK_CLAUSES (expr), pre_p, ORT_TASK);
push_gimplify_context (&gctx);
- gimplify_stmt (&OMP_TASK_BODY (expr));
-
- if (TREE_CODE (OMP_TASK_BODY (expr)) == BIND_EXPR)
- pop_gimplify_context (OMP_TASK_BODY (expr));
+ g = gimplify_and_return_first (OMP_TASK_BODY (expr), &body);
+ if (gimple_code (g) == GIMPLE_BIND)
+ pop_gimplify_context (g);
else
- pop_gimplify_context (NULL_TREE);
+ pop_gimplify_context (NULL);
gimplify_adjust_omp_clauses (&OMP_TASK_CLAUSES (expr));
- return GS_ALL_DONE;
+ g = gimple_build_omp_task (body,
+ OMP_TASK_CLAUSES (expr),
+ NULL_TREE, NULL_TREE,
+ NULL_TREE, NULL_TREE, NULL_TREE);
+ gimplify_seq_add_stmt (pre_p, g);
+ *expr_p = NULL_TREE;
}
/* Gimplify the gross structure of an OMP_FOR statement. */
static enum gimplify_status
-gimplify_omp_for (tree *expr_p, tree *pre_p)
+gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
{
- tree for_stmt, decl, var, t, bodylist;
+ tree for_stmt, decl, var, t;
enum gimplify_status ret = GS_OK;
- tree body, init_decl = NULL_TREE;
+ gimple gfor;
+ gimple_seq for_body, for_pre_body;
int i;
for_stmt = *expr_p;
@@ -5437,12 +5795,12 @@ gimplify_omp_for (tree *expr_p, tree *pre_p)
gimplify_scan_omp_clauses (&OMP_FOR_CLAUSES (for_stmt), pre_p,
ORT_WORKSHARE);
- /* If OMP_FOR is re-gimplified, ensure all variables in pre-body
- are noticed. */
- gimplify_stmt (&OMP_FOR_PRE_BODY (for_stmt));
-
- bodylist = alloc_stmt_list ();
+ /* Handle OMP_FOR_INIT. */
+ for_pre_body = NULL;
+ gimplify_and_add (OMP_FOR_PRE_BODY (for_stmt), &for_pre_body);
+ OMP_FOR_PRE_BODY (for_stmt) = NULL_TREE;
+ for_body = gimple_seq_alloc ();
gcc_assert (TREE_VEC_LENGTH (OMP_FOR_INIT (for_stmt))
== TREE_VEC_LENGTH (OMP_FOR_COND (for_stmt)));
gcc_assert (TREE_VEC_LENGTH (OMP_FOR_INIT (for_stmt))
@@ -5450,9 +5808,8 @@ gimplify_omp_for (tree *expr_p, tree *pre_p)
for (i = 0; i < TREE_VEC_LENGTH (OMP_FOR_INIT (for_stmt)); i++)
{
t = TREE_VEC_ELT (OMP_FOR_INIT (for_stmt), i);
- gcc_assert (TREE_CODE (t) == MODIFY_EXPR
- || TREE_CODE (t) == GIMPLE_MODIFY_STMT);
- decl = GENERIC_TREE_OPERAND (t, 0);
+ gcc_assert (TREE_CODE (t) == MODIFY_EXPR);
+ decl = TREE_OPERAND (t, 0);
gcc_assert (DECL_P (decl));
gcc_assert (INTEGRAL_TYPE_P (TREE_TYPE (decl))
|| POINTER_TYPE_P (TREE_TYPE (decl)));
@@ -5469,30 +5826,29 @@ gimplify_omp_for (tree *expr_p, tree *pre_p)
if (!is_gimple_reg (decl))
{
var = create_tmp_var (TREE_TYPE (decl), get_name (decl));
- GENERIC_TREE_OPERAND (t, 0) = var;
+ TREE_OPERAND (t, 0) = var;
+
+ gimplify_seq_add_stmt (&for_body, gimple_build_assign (decl, var));
- init_decl = build_gimple_modify_stmt (decl, var);
omp_add_variable (gimplify_omp_ctxp, var, GOVD_PRIVATE | GOVD_SEEN);
}
else
var = decl;
- ret |= gimplify_expr (&GENERIC_TREE_OPERAND (t, 1),
- &OMP_FOR_PRE_BODY (for_stmt),
- NULL, is_gimple_val, fb_rvalue);
-
- tree_to_gimple_tuple (&TREE_VEC_ELT (OMP_FOR_INIT (for_stmt), i));
+ ret |= gimplify_expr (&TREE_OPERAND (t, 1), &for_pre_body, NULL,
+ is_gimple_val, fb_rvalue);
+ if (ret == GS_ERROR)
+ return ret;
+ /* Handle OMP_FOR_COND. */
t = TREE_VEC_ELT (OMP_FOR_COND (for_stmt), i);
gcc_assert (COMPARISON_CLASS_P (t));
- gcc_assert (GENERIC_TREE_OPERAND (t, 0) == decl);
- TREE_OPERAND (t, 0) = var;
+ gcc_assert (TREE_OPERAND (t, 0) == decl);
- ret |= gimplify_expr (&GENERIC_TREE_OPERAND (t, 1),
- &OMP_FOR_PRE_BODY (for_stmt),
- NULL, is_gimple_val, fb_rvalue);
+ ret |= gimplify_expr (&TREE_OPERAND (t, 1), &for_pre_body, NULL,
+ is_gimple_val, fb_rvalue);
- tree_to_gimple_tuple (&TREE_VEC_ELT (OMP_FOR_INCR (for_stmt), i));
+ /* Handle OMP_FOR_INCR. */
t = TREE_VEC_ELT (OMP_FOR_INCR (for_stmt), i);
switch (TREE_CODE (t))
{
@@ -5500,7 +5856,7 @@ gimplify_omp_for (tree *expr_p, tree *pre_p)
case POSTINCREMENT_EXPR:
t = build_int_cst (TREE_TYPE (decl), 1);
t = build2 (PLUS_EXPR, TREE_TYPE (decl), var, t);
- t = build_gimple_modify_stmt (var, t);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (var), var, t);
TREE_VEC_ELT (OMP_FOR_INCR (for_stmt), i) = t;
break;
@@ -5508,15 +5864,15 @@ gimplify_omp_for (tree *expr_p, tree *pre_p)
case POSTDECREMENT_EXPR:
t = build_int_cst (TREE_TYPE (decl), -1);
t = build2 (PLUS_EXPR, TREE_TYPE (decl), var, t);
- t = build_gimple_modify_stmt (var, t);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (var), var, t);
TREE_VEC_ELT (OMP_FOR_INCR (for_stmt), i) = t;
break;
- case GIMPLE_MODIFY_STMT:
- gcc_assert (GIMPLE_STMT_OPERAND (t, 0) == decl);
- GIMPLE_STMT_OPERAND (t, 0) = var;
+ case MODIFY_EXPR:
+ gcc_assert (TREE_OPERAND (t, 0) == decl);
+ TREE_OPERAND (t, 0) = var;
- t = GIMPLE_STMT_OPERAND (t, 1);
+ t = TREE_OPERAND (t, 1);
switch (TREE_CODE (t))
{
case PLUS_EXPR:
@@ -5537,64 +5893,84 @@ gimplify_omp_for (tree *expr_p, tree *pre_p)
gcc_unreachable ();
}
- ret |= gimplify_expr (&TREE_OPERAND (t, 1),
- &OMP_FOR_PRE_BODY (for_stmt),
- NULL, is_gimple_val, fb_rvalue);
+ ret |= gimplify_expr (&TREE_OPERAND (t, 1), &for_pre_body, NULL,
+ is_gimple_val, fb_rvalue);
break;
default:
gcc_unreachable ();
}
- if (init_decl)
- append_to_statement_list (init_decl, &bodylist);
-
if (var != decl || TREE_VEC_LENGTH (OMP_FOR_INIT (for_stmt)) > 1)
{
tree c;
for (c = OMP_FOR_CLAUSES (for_stmt); c ; c = OMP_CLAUSE_CHAIN (c))
- if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE
- && OMP_CLAUSE_DECL (c) == decl
- && OMP_CLAUSE_LASTPRIVATE_STMT (c) == NULL)
- {
- t = TREE_VEC_ELT (OMP_FOR_INCR (for_stmt), i);
- gcc_assert (TREE_CODE (t) == GIMPLE_MODIFY_STMT);
- gcc_assert (GIMPLE_STMT_OPERAND (t, 0) == var);
- t = GIMPLE_STMT_OPERAND (t, 1);
- gcc_assert (TREE_CODE (t) == PLUS_EXPR
- || TREE_CODE (t) == MINUS_EXPR
- || TREE_CODE (t) == POINTER_PLUS_EXPR);
- gcc_assert (TREE_OPERAND (t, 0) == var);
- t = build2 (TREE_CODE (t), TREE_TYPE (decl), decl,
- TREE_OPERAND (t, 1));
- OMP_CLAUSE_LASTPRIVATE_STMT (c)
- = build_gimple_modify_stmt (decl, t);
+ if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE
+ && OMP_CLAUSE_DECL (c) == decl
+ && OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c) == NULL)
+ {
+ t = TREE_VEC_ELT (OMP_FOR_INCR (for_stmt), i);
+ gcc_assert (TREE_CODE (t) == MODIFY_EXPR);
+ gcc_assert (TREE_OPERAND (t, 0) == var);
+ t = TREE_OPERAND (t, 1);
+ gcc_assert (TREE_CODE (t) == PLUS_EXPR
+ || TREE_CODE (t) == MINUS_EXPR
+ || TREE_CODE (t) == POINTER_PLUS_EXPR);
+ gcc_assert (TREE_OPERAND (t, 0) == var);
+ t = build2 (TREE_CODE (t), TREE_TYPE (decl), decl,
+ TREE_OPERAND (t, 1));
+ gimplify_assign (decl, t,
+ &OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c));
}
}
}
- body = OMP_FOR_BODY (for_stmt);
- gimplify_to_stmt_list (&body);
- append_to_statement_list (body, &bodylist);
- OMP_FOR_BODY (for_stmt) = bodylist;
+ gimplify_and_add (OMP_FOR_BODY (for_stmt), &for_body);
+
gimplify_adjust_omp_clauses (&OMP_FOR_CLAUSES (for_stmt));
+ gfor = gimple_build_omp_for (for_body, OMP_FOR_CLAUSES (for_stmt),
+ TREE_VEC_LENGTH (OMP_FOR_INIT (for_stmt)),
+ for_pre_body);
+
+ for (i = 0; i < TREE_VEC_LENGTH (OMP_FOR_INIT (for_stmt)); i++)
+ {
+ t = TREE_VEC_ELT (OMP_FOR_INIT (for_stmt), i);
+ gimple_omp_for_set_index (gfor, i, TREE_OPERAND (t, 0));
+ gimple_omp_for_set_initial (gfor, i, TREE_OPERAND (t, 1));
+ t = TREE_VEC_ELT (OMP_FOR_COND (for_stmt), i);
+ gimple_omp_for_set_cond (gfor, i, TREE_CODE (t));
+ gimple_omp_for_set_final (gfor, i, TREE_OPERAND (t, 1));
+ t = TREE_VEC_ELT (OMP_FOR_INCR (for_stmt), i);
+ gimple_omp_for_set_incr (gfor, i, TREE_OPERAND (t, 1));
+ }
+
+ gimplify_seq_add_stmt (pre_p, gfor);
return ret == GS_ALL_DONE ? GS_ALL_DONE : GS_ERROR;
}
/* Gimplify the gross structure of other OpenMP worksharing constructs.
In particular, OMP_SECTIONS and OMP_SINGLE. */
-static enum gimplify_status
-gimplify_omp_workshare (tree *expr_p, tree *pre_p)
+static void
+gimplify_omp_workshare (tree *expr_p, gimple_seq *pre_p)
{
- tree stmt = *expr_p;
+ tree expr = *expr_p;
+ gimple stmt;
+ gimple_seq body = NULL;
- gimplify_scan_omp_clauses (&OMP_CLAUSES (stmt), pre_p, ORT_WORKSHARE);
- gimplify_to_stmt_list (&OMP_BODY (stmt));
- gimplify_adjust_omp_clauses (&OMP_CLAUSES (stmt));
+ gimplify_scan_omp_clauses (&OMP_CLAUSES (expr), pre_p, ORT_WORKSHARE);
+ gimplify_and_add (OMP_BODY (expr), &body);
+ gimplify_adjust_omp_clauses (&OMP_CLAUSES (expr));
- return GS_ALL_DONE;
+ if (TREE_CODE (expr) == OMP_SECTIONS)
+ stmt = gimple_build_omp_sections (body, OMP_CLAUSES (expr));
+ else if (TREE_CODE (expr) == OMP_SINGLE)
+ stmt = gimple_build_omp_single (body, OMP_CLAUSES (expr));
+ else
+ gcc_unreachable ();
+
+ gimplify_seq_add_stmt (pre_p, stmt);
}
/* A subroutine of gimplify_omp_atomic. The front end is supposed to have
@@ -5644,7 +6020,8 @@ goa_lhs_expr_p (tree expr, tree addr)
a subexpression, 0 if it did not, or -1 if an error was encountered. */
static int
-goa_stabilize_expr (tree *expr_p, tree *pre_p, tree lhs_addr, tree lhs_var)
+goa_stabilize_expr (tree *expr_p, gimple_seq *pre_p, tree lhs_addr,
+ tree lhs_var)
{
tree expr = *expr_p;
int saw_lhs;
@@ -5661,11 +6038,11 @@ goa_stabilize_expr (tree *expr_p, tree *pre_p, tree lhs_addr, tree lhs_var)
switch (TREE_CODE_CLASS (TREE_CODE (expr)))
{
case tcc_binary:
- saw_lhs |= goa_stabilize_expr (&TREE_OPERAND (expr, 1), pre_p,
- lhs_addr, lhs_var);
+ saw_lhs |= goa_stabilize_expr (&TREE_OPERAND (expr, 1), pre_p, lhs_addr,
+ lhs_var);
case tcc_unary:
- saw_lhs |= goa_stabilize_expr (&TREE_OPERAND (expr, 0), pre_p,
- lhs_addr, lhs_var);
+ saw_lhs |= goa_stabilize_expr (&TREE_OPERAND (expr, 0), pre_p, lhs_addr,
+ lhs_var);
break;
default:
break;
@@ -5682,15 +6059,16 @@ goa_stabilize_expr (tree *expr_p, tree *pre_p, tree lhs_addr, tree lhs_var)
return saw_lhs;
}
+
/* Gimplify an OMP_ATOMIC statement. */
static enum gimplify_status
-gimplify_omp_atomic (tree *expr_p, tree *pre_p)
+gimplify_omp_atomic (tree *expr_p, gimple_seq *pre_p)
{
tree addr = TREE_OPERAND (*expr_p, 0);
tree rhs = TREE_OPERAND (*expr_p, 1);
tree type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (addr)));
- tree tmp_load, load, store;
+ tree tmp_load;
tmp_load = create_tmp_var (type, NULL);
if (goa_stabilize_expr (&rhs, pre_p, addr, tmp_load) < 0)
@@ -5700,74 +6078,170 @@ gimplify_omp_atomic (tree *expr_p, tree *pre_p)
!= GS_ALL_DONE)
return GS_ERROR;
- load = build2 (OMP_ATOMIC_LOAD, void_type_node, tmp_load, addr);
- append_to_statement_list (load, pre_p);
+ gimplify_seq_add_stmt (pre_p, gimple_build_omp_atomic_load (tmp_load, addr));
if (gimplify_expr (&rhs, pre_p, NULL, is_gimple_val, fb_rvalue)
!= GS_ALL_DONE)
return GS_ERROR;
- store = build1 (OMP_ATOMIC_STORE, void_type_node, rhs);
- *expr_p = store;
+ gimplify_seq_add_stmt (pre_p, gimple_build_omp_atomic_store (rhs));
+ *expr_p = NULL;
return GS_ALL_DONE;
-
}
-/* Gimplifies the expression tree pointed to by EXPR_P. Return 0 if
- gimplification failed.
-
- PRE_P points to the list where side effects that must happen before
- EXPR should be stored.
-
- POST_P points to the list where side effects that must happen after
- EXPR should be stored, or NULL if there is no suitable list. In
- that case, we copy the result to a temporary, emit the
- post-effects, and then return the temporary.
-
- GIMPLE_TEST_F points to a function that takes a tree T and
- returns nonzero if T is in the GIMPLE form requested by the
- caller. The GIMPLE predicates are in tree-gimple.c.
-
- This test is used twice. Before gimplification, the test is
- invoked to determine whether *EXPR_P is already gimple enough. If
- that fails, *EXPR_P is gimplified according to its code and
- GIMPLE_TEST_F is called again. If the test still fails, then a new
- temporary variable is created and assigned the value of the
- gimplified expression.
- FALLBACK tells the function what sort of a temporary we want. If the 1
- bit is set, an rvalue is OK. If the 2 bit is set, an lvalue is OK.
- If both are set, either is OK, but an lvalue is preferable.
-
- The return value is either GS_ERROR or GS_ALL_DONE, since this function
- iterates until solution. */
+/* Converts the GENERIC expression tree *EXPR_P to GIMPLE. If the
+ expression produces a value to be used as an operand inside a GIMPLE
+ statement, the value will be stored back in *EXPR_P. This value will
+ be a tree of class tcc_declaration, tcc_constant, tcc_reference or
+ an SSA_NAME. The corresponding sequence of GIMPLE statements is
+ emitted in PRE_P and POST_P.
+
+ Additionally, this process may overwrite parts of the input
+ expression during gimplification. Ideally, it should be
+ possible to do non-destructive gimplification.
+
+ EXPR_P points to the GENERIC expression to convert to GIMPLE. If
+ the expression needs to evaluate to a value to be used as
+ an operand in a GIMPLE statement, this value will be stored in
+ *EXPR_P on exit. This happens when the caller specifies one
+ of fb_lvalue or fb_rvalue fallback flags.
+
+ PRE_P will contain the sequence of GIMPLE statements corresponding
+ to the evaluation of EXPR and all the side-effects that must
+ be executed before the main expression. On exit, the last
+ statement of PRE_P is the core statement being gimplified. For
+ instance, when gimplifying 'if (++a)' the last statement in
+ PRE_P will be 'if (t.1)' where t.1 is the result of
+ pre-incrementing 'a'.
+
+ POST_P will contain the sequence of GIMPLE statements corresponding
+ to the evaluation of all the side-effects that must be executed
+ after the main expression. If this is NULL, the post
+ side-effects are stored at the end of PRE_P.
+
+ The reason why the output is split in two is to handle post
+ side-effects explicitly. In some cases, an expression may have
+ inner and outer post side-effects which need to be emitted in
+ an order different from the one given by the recursive
+ traversal. For instance, for the expression (*p--)++ the post
+ side-effects of '--' must actually occur *after* the post
+ side-effects of '++'. However, gimplification will first visit
+ the inner expression, so if a separate POST sequence was not
+ used, the resulting sequence would be:
+
+ 1 t.1 = *p
+ 2 p = p - 1
+ 3 t.2 = t.1 + 1
+ 4 *p = t.2
+
+ However, the post-decrement operation in line #2 must not be
+ evaluated until after the store to *p at line #4, so the
+ correct sequence should be:
+
+ 1 t.1 = *p
+ 2 t.2 = t.1 + 1
+ 3 *p = t.2
+ 4 p = p - 1
+
+ So, by specifying a separate post queue, it is possible
+ to emit the post side-effects in the correct order.
+ If POST_P is NULL, an internal queue will be used. Before
+ returning to the caller, the sequence POST_P is appended to
+ the main output sequence PRE_P.
+
+ GIMPLE_TEST_F points to a function that takes a tree T and
+ returns nonzero if T is in the GIMPLE form requested by the
+ caller. The GIMPLE predicates are in tree-gimple.c.
+
+ FALLBACK tells the function what sort of a temporary we want if
+ gimplification cannot produce an expression that complies with
+ GIMPLE_TEST_F.
+
+ fb_none means that no temporary should be generated
+ fb_rvalue means that an rvalue is OK to generate
+ fb_lvalue means that an lvalue is OK to generate
+ fb_either means that either is OK, but an lvalue is preferable.
+ fb_mayfail means that gimplification may fail (in which case
+ GS_ERROR will be returned)
+
+ The return value is either GS_ERROR or GS_ALL_DONE, since this
+ function iterates until EXPR is completely gimplified or an error
+ occurs. */
enum gimplify_status
-gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
- bool (* gimple_test_f) (tree), fallback_t fallback)
+gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
+ bool (*gimple_test_f) (tree), fallback_t fallback)
{
tree tmp;
- tree internal_pre = NULL_TREE;
- tree internal_post = NULL_TREE;
+ gimple_seq internal_pre = NULL;
+ gimple_seq internal_post = NULL;
tree save_expr;
- int is_statement = (pre_p == NULL);
+ bool is_statement;
location_t saved_location;
enum gimplify_status ret;
+ gimple_stmt_iterator pre_last_gsi, post_last_gsi;
save_expr = *expr_p;
if (save_expr == NULL_TREE)
return GS_ALL_DONE;
+ /* If we are gimplifying a top-level statement, PRE_P must be valid. */
+ is_statement = gimple_test_f == is_gimple_stmt;
+ if (is_statement)
+ gcc_assert (pre_p);
+
+ /* Consistency checks. */
+ if (gimple_test_f == is_gimple_reg)
+ gcc_assert (fallback & (fb_rvalue | fb_lvalue));
+ else if (gimple_test_f == is_gimple_val
+ || gimple_test_f == is_gimple_formal_tmp_rhs
+ || gimple_test_f == is_gimple_formal_tmp_or_call_rhs
+ || gimple_test_f == is_gimple_formal_tmp_reg
+ || gimple_test_f == is_gimple_formal_tmp_var
+ || gimple_test_f == is_gimple_call_addr
+ || gimple_test_f == is_gimple_condexpr
+ || gimple_test_f == is_gimple_mem_rhs
+ || gimple_test_f == is_gimple_mem_or_call_rhs
+ || gimple_test_f == is_gimple_reg_rhs
+ || gimple_test_f == is_gimple_reg_or_call_rhs
+ || gimple_test_f == is_gimple_asm_val)
+ gcc_assert (fallback & fb_rvalue);
+ else if (gimple_test_f == is_gimple_min_lval
+ || gimple_test_f == is_gimple_lvalue)
+ gcc_assert (fallback & fb_lvalue);
+ else if (gimple_test_f == is_gimple_addressable)
+ gcc_assert (fallback & fb_either);
+ else if (gimple_test_f == is_gimple_stmt)
+ gcc_assert (fallback == fb_none);
+ else
+ {
+ /* We should have recognized the GIMPLE_TEST_F predicate to
+ know what kind of fallback to use in case a temporary is
+ needed to hold the value or address of *EXPR_P. */
+ gcc_unreachable ();
+ }
+
/* We used to check the predicate here and return immediately if it
succeeds. This is wrong; the design is for gimplification to be
idempotent, and for the predicates to only test for valid forms, not
whether they are fully simplified. */
-
- /* Set up our internal queues if needed. */
if (pre_p == NULL)
pre_p = &internal_pre;
+
if (post_p == NULL)
post_p = &internal_post;
+ /* Remember the last statements added to PRE_P and POST_P. Every
+ new statement added by the gimplification helpers needs to be
+ annotated with location information. To centralize the
+ responsibility, we remember the last statement that had been
+ added to both queues before gimplifying *EXPR_P. If
+ gimplification produces new statements in PRE_P and POST_P, those
+ statements will be annotated with the same location information
+ as *EXPR_P. */
+ pre_last_gsi = gsi_last (*pre_p);
+ post_last_gsi = gsi_last (*post_p);
+
saved_location = input_location;
if (save_expr != error_mark_node
&& EXPR_HAS_LOCATION (*expr_p))
@@ -5786,8 +6260,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
/* Die, die, die, my darling. */
if (save_expr == error_mark_node
- || (!GIMPLE_STMT_P (save_expr)
- && TREE_TYPE (save_expr)
+ || (TREE_TYPE (save_expr)
&& TREE_TYPE (save_expr) == error_mark_node))
{
ret = GS_ERROR;
@@ -5831,6 +6304,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
case COND_EXPR:
ret = gimplify_cond_expr (expr_p, pre_p, fallback);
+
/* C99 code may assign to an array in a structure value of a
conditional expression, and this has undefined behavior
only on execution, so create a temporary if an lvalue is
@@ -5844,6 +6318,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
case CALL_EXPR:
ret = gimplify_call_expr (expr_p, pre_p, fallback != fb_none);
+
/* C99 code may assign to an array in a structure returned
from a function, and this has undefined behavior only on
execution, so create a temporary if an lvalue is
@@ -5863,23 +6338,9 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
break;
case MODIFY_EXPR:
- case GIMPLE_MODIFY_STMT:
case INIT_EXPR:
ret = gimplify_modify_expr (expr_p, pre_p, post_p,
fallback != fb_none);
-
- if (*expr_p)
- {
- /* The distinction between MODIFY_EXPR and INIT_EXPR is no longer
- useful. */
- if (TREE_CODE (*expr_p) == INIT_EXPR)
- TREE_SET_CODE (*expr_p, MODIFY_EXPR);
-
- /* Convert MODIFY_EXPR to GIMPLE_MODIFY_STMT. */
- if (TREE_CODE (*expr_p) == MODIFY_EXPR)
- tree_to_gimple_tuple (expr_p);
- }
-
break;
case TRUTH_ANDIF_EXPR:
@@ -5973,7 +6434,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
break;
case DECL_EXPR:
- ret = gimplify_decl_expr (expr_p);
+ ret = gimplify_decl_expr (expr_p, pre_p);
break;
case EXC_PTR_EXPR:
@@ -6003,20 +6464,27 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
if (TREE_CODE (GOTO_DESTINATION (*expr_p)) != LABEL_DECL)
ret = gimplify_expr (&GOTO_DESTINATION (*expr_p), pre_p,
NULL, is_gimple_val, fb_rvalue);
+ gimplify_seq_add_stmt (pre_p,
+ gimple_build_goto (GOTO_DESTINATION (*expr_p)));
break;
- /* Predictions are always gimplified. */
case PREDICT_EXPR:
- goto out;
+ gimplify_seq_add_stmt (pre_p,
+ gimple_build_predict (PREDICT_EXPR_PREDICTOR (*expr_p),
+ PREDICT_EXPR_OUTCOME (*expr_p)));
+ ret = GS_ALL_DONE;
+ break;
case LABEL_EXPR:
ret = GS_ALL_DONE;
gcc_assert (decl_function_context (LABEL_EXPR_LABEL (*expr_p))
== current_function_decl);
+ gimplify_seq_add_stmt (pre_p,
+ gimple_build_label (LABEL_EXPR_LABEL (*expr_p)));
break;
case CASE_LABEL_EXPR:
- ret = gimplify_case_label_expr (expr_p);
+ ret = gimplify_case_label_expr (expr_p, pre_p);
break;
case RETURN_EXPR:
@@ -6068,12 +6536,12 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
{
enum gimplify_status r0, r1, r2;
- r0 = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
- is_gimple_lvalue, fb_either);
- r1 = gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, post_p,
- is_gimple_val, fb_rvalue);
- r2 = gimplify_expr (&TREE_OPERAND (*expr_p, 2), pre_p, post_p,
- is_gimple_val, fb_rvalue);
+ r0 = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,
+ post_p, is_gimple_lvalue, fb_either);
+ r1 = gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p,
+ post_p, is_gimple_val, fb_rvalue);
+ r2 = gimplify_expr (&TREE_OPERAND (*expr_p, 2), pre_p,
+ post_p, is_gimple_val, fb_rvalue);
recalculate_side_effects (*expr_p);
ret = MIN (r0, MIN (r1, r2));
@@ -6090,10 +6558,24 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
case TRY_FINALLY_EXPR:
case TRY_CATCH_EXPR:
- gimplify_to_stmt_list (&TREE_OPERAND (*expr_p, 0));
- gimplify_to_stmt_list (&TREE_OPERAND (*expr_p, 1));
- ret = GS_ALL_DONE;
- break;
+ {
+ gimple_seq eval, cleanup;
+ gimple try_;
+
+ eval = cleanup = NULL;
+ gimplify_and_add (TREE_OPERAND (*expr_p, 0), &eval);
+ gimplify_and_add (TREE_OPERAND (*expr_p, 1), &cleanup);
+ try_ = gimple_build_try (eval, cleanup,
+ TREE_CODE (*expr_p) == TRY_FINALLY_EXPR
+ ? GIMPLE_TRY_FINALLY
+ : GIMPLE_TRY_CATCH);
+ if (TREE_CODE (*expr_p) == TRY_CATCH_EXPR)
+ gimple_try_set_catch_is_cleanup (try_,
+ TRY_CATCH_IS_CLEANUP (*expr_p));
+ gimplify_seq_add_stmt (pre_p, try_);
+ ret = GS_ALL_DONE;
+ break;
+ }
case CLEANUP_POINT_EXPR:
ret = gimplify_cleanup_point_expr (expr_p, pre_p);
@@ -6104,27 +6586,51 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
break;
case CATCH_EXPR:
- gimplify_to_stmt_list (&CATCH_BODY (*expr_p));
- ret = GS_ALL_DONE;
- break;
+ {
+ gimple c;
+ gimple_seq handler = NULL;
+ gimplify_and_add (CATCH_BODY (*expr_p), &handler);
+ c = gimple_build_catch (CATCH_TYPES (*expr_p), handler);
+ gimplify_seq_add_stmt (pre_p, c);
+ ret = GS_ALL_DONE;
+ break;
+ }
case EH_FILTER_EXPR:
- gimplify_to_stmt_list (&EH_FILTER_FAILURE (*expr_p));
- ret = GS_ALL_DONE;
- break;
+ {
+ gimple ehf;
+ gimple_seq failure = NULL;
+
+ gimplify_and_add (EH_FILTER_FAILURE (*expr_p), &failure);
+ ehf = gimple_build_eh_filter (EH_FILTER_TYPES (*expr_p), failure);
+ gimple_eh_filter_set_must_not_throw
+ (ehf, EH_FILTER_MUST_NOT_THROW (*expr_p));
+ gimplify_seq_add_stmt (pre_p, ehf);
+ ret = GS_ALL_DONE;
+ break;
+ }
case CHANGE_DYNAMIC_TYPE_EXPR:
- ret = gimplify_expr (&CHANGE_DYNAMIC_TYPE_LOCATION (*expr_p),
- pre_p, post_p, is_gimple_reg, fb_lvalue);
+ {
+ gimple cdt;
+
+ ret = gimplify_expr (&CHANGE_DYNAMIC_TYPE_LOCATION (*expr_p),
+ pre_p, post_p, is_gimple_reg, fb_lvalue);
+ cdt = gimple_build_cdt (CHANGE_DYNAMIC_TYPE_NEW_TYPE (*expr_p),
+ CHANGE_DYNAMIC_TYPE_LOCATION (*expr_p));
+ gimplify_seq_add_stmt (pre_p, cdt);
+ ret = GS_ALL_DONE;
+ }
break;
case OBJ_TYPE_REF:
{
enum gimplify_status r0, r1;
- r0 = gimplify_expr (&OBJ_TYPE_REF_OBJECT (*expr_p), pre_p, post_p,
- is_gimple_val, fb_rvalue);
- r1 = gimplify_expr (&OBJ_TYPE_REF_EXPR (*expr_p), pre_p, post_p,
- is_gimple_val, fb_rvalue);
+ r0 = gimplify_expr (&OBJ_TYPE_REF_OBJECT (*expr_p), pre_p,
+ post_p, is_gimple_val, fb_rvalue);
+ r1 = gimplify_expr (&OBJ_TYPE_REF_EXPR (*expr_p), pre_p,
+ post_p, is_gimple_val, fb_rvalue);
+ TREE_SIDE_EFFECTS (*expr_p) = 0;
ret = MIN (r0, r1);
}
break;
@@ -6169,11 +6675,13 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
break;
case OMP_PARALLEL:
- ret = gimplify_omp_parallel (expr_p, pre_p);
+ gimplify_omp_parallel (expr_p, pre_p);
+ ret = GS_ALL_DONE;
break;
case OMP_TASK:
- ret = gimplify_omp_task (expr_p, pre_p);
+ gimplify_omp_task (expr_p, pre_p);
+ ret = GS_ALL_DONE;
break;
case OMP_FOR:
@@ -6182,68 +6690,74 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
case OMP_SECTIONS:
case OMP_SINGLE:
- ret = gimplify_omp_workshare (expr_p, pre_p);
+ gimplify_omp_workshare (expr_p, pre_p);
+ ret = GS_ALL_DONE;
break;
case OMP_SECTION:
case OMP_MASTER:
case OMP_ORDERED:
case OMP_CRITICAL:
- gimplify_to_stmt_list (&OMP_BODY (*expr_p));
- break;
+ {
+ gimple_seq body = NULL;
+ gimple g;
+
+ gimplify_and_add (OMP_BODY (*expr_p), &body);
+ switch (TREE_CODE (*expr_p))
+ {
+ case OMP_SECTION:
+ g = gimple_build_omp_section (body);
+ break;
+ case OMP_MASTER:
+ g = gimple_build_omp_master (body);
+ break;
+ case OMP_ORDERED:
+ g = gimple_build_omp_ordered (body);
+ break;
+ case OMP_CRITICAL:
+ g = gimple_build_omp_critical (body,
+ OMP_CRITICAL_NAME (*expr_p));
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ gimplify_seq_add_stmt (pre_p, g);
+ ret = GS_ALL_DONE;
+ break;
+ }
case OMP_ATOMIC:
ret = gimplify_omp_atomic (expr_p, pre_p);
break;
- case OMP_RETURN:
- case OMP_CONTINUE:
- case OMP_ATOMIC_STORE:
- case OMP_SECTIONS_SWITCH:
- ret = GS_ALL_DONE;
- break;
-
- case OMP_ATOMIC_LOAD:
- if (gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p, NULL,
- is_gimple_val, fb_rvalue) != GS_ALL_DONE)
- ret = GS_ERROR;
- else
- ret = GS_ALL_DONE;
- break;
-
case POINTER_PLUS_EXPR:
/* Convert ((type *)A)+offset into &A->field_of_type_and_offset.
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;
}
/* FALLTHRU */
+
default:
switch (TREE_CODE_CLASS (TREE_CODE (*expr_p)))
{
@@ -6257,18 +6771,17 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
Compare scalar mode aggregates as scalar mode values. Using
memcmp for them would be very inefficient at best, and is
plain wrong if bitfields are involved. */
+ {
+ tree type = TREE_TYPE (TREE_OPERAND (*expr_p, 1));
- {
- tree type = TREE_TYPE (TREE_OPERAND (*expr_p, 1));
-
- if (!AGGREGATE_TYPE_P (type))
- goto expr_2;
- else if (TYPE_MODE (type) != BLKmode)
- ret = gimplify_scalar_mode_aggregate_compare (expr_p);
- else
- ret = gimplify_variable_sized_compare (expr_p);
+ if (!AGGREGATE_TYPE_P (type))
+ goto expr_2;
+ else if (TYPE_MODE (type) != BLKmode)
+ ret = gimplify_scalar_mode_aggregate_compare (expr_p);
+ else
+ ret = gimplify_variable_sized_compare (expr_p);
- break;
+ break;
}
/* If *EXPR_P does not need to be special-cased, handle it
@@ -6284,7 +6797,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
enum gimplify_status r0, r1;
r0 = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p,
- post_p, is_gimple_val, fb_rvalue);
+ post_p, is_gimple_val, fb_rvalue);
r1 = gimplify_expr (&TREE_OPERAND (*expr_p, 1), pre_p,
post_p, is_gimple_val, fb_rvalue);
@@ -6305,6 +6818,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
}
recalculate_side_effects (*expr_p);
+
dont_recalculate:
break;
}
@@ -6372,6 +6886,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
/* Historically, the compiler has treated a bare reference
to a non-BLKmode volatile lvalue as forcing a load. */
tree type = TYPE_MAIN_VARIANT (TREE_TYPE (*expr_p));
+
/* Normally, we do not want to create a temporary for a
TREE_ADDRESSABLE type because such a type should not be
copied by bitwise-assignment. However, we make an
@@ -6381,7 +6896,8 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
given a TREE_ADDRESSABLE type. */
tree tmp = create_tmp_var_raw (type, "vol");
gimple_add_tmp_var (tmp);
- *expr_p = build_gimple_modify_stmt (tmp, *expr_p);
+ gimplify_assign (tmp, *expr_p, pre_p);
+ *expr_p = NULL;
}
else
/* We can't do anything useful with a volatile reference to
@@ -6393,33 +6909,68 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
}
/* If we are gimplifying at the statement level, we're done. Tack
- everything together and replace the original statement with the
- gimplified form. */
+ everything together and return. */
if (fallback == fb_none || is_statement)
{
- if (internal_pre || internal_post)
+ /* Since *EXPR_P has been converted into a GIMPLE tuple, clear
+ it out for GC to reclaim it. */
+ *expr_p = NULL_TREE;
+
+ if (!gimple_seq_empty_p (internal_pre)
+ || !gimple_seq_empty_p (internal_post))
{
- append_to_statement_list (*expr_p, &internal_pre);
- append_to_statement_list (internal_post, &internal_pre);
- annotate_all_with_locus (&internal_pre, input_location);
- *expr_p = internal_pre;
+ gimplify_seq_add_seq (&internal_pre, internal_post);
+ gimplify_seq_add_seq (pre_p, internal_pre);
}
- else if (!*expr_p)
- ;
- else if (TREE_CODE (*expr_p) == STATEMENT_LIST)
- annotate_all_with_locus (expr_p, input_location);
- else
- annotate_one_with_locus (*expr_p, input_location);
+
+ /* The result of gimplifying *EXPR_P is going to be the last few
+ statements in *PRE_P and *POST_P. Add location information
+ to all the statements that were added by the gimplification
+ helpers. */
+ if (!gimple_seq_empty_p (*pre_p))
+ annotate_all_with_location_after (*pre_p, pre_last_gsi, input_location);
+
+ if (!gimple_seq_empty_p (*post_p))
+ annotate_all_with_location_after (*post_p, post_last_gsi,
+ input_location);
+
goto out;
}
- /* Otherwise we're gimplifying a subexpression, so the resulting value is
- interesting. */
+#ifdef ENABLE_GIMPLE_CHECKING
+ if (*expr_p)
+ {
+ enum tree_code code = TREE_CODE (*expr_p);
+ /* These expressions should already be in gimple IR form. */
+ gcc_assert (code != MODIFY_EXPR
+ && code != ASM_EXPR
+ && code != BIND_EXPR
+ && code != CATCH_EXPR
+ && code != COND_EXPR
+ && code != EH_FILTER_EXPR
+ && code != GOTO_EXPR
+ && code != LABEL_EXPR
+ && code != LOOP_EXPR
+ && code != RESX_EXPR
+ && code != SWITCH_EXPR
+ && code != TRY_FINALLY_EXPR
+ && code != OMP_CRITICAL
+ && code != OMP_FOR
+ && code != OMP_MASTER
+ && code != OMP_ORDERED
+ && code != OMP_PARALLEL
+ && code != OMP_SECTIONS
+ && code != OMP_SECTION
+ && code != OMP_SINGLE);
+ }
+#endif
- /* If it's sufficiently simple already, we're done. Unless we are
- handling some post-effects internally; if that's the case, we need to
- copy into a temp before adding the post-effects to the tree. */
- if (!internal_post && (*gimple_test_f) (*expr_p))
+ /* Otherwise we're gimplifying a subexpression, so the resulting
+ value is interesting. If it's a valid operand that matches
+ GIMPLE_TEST_F, we're done. Unless we are handling some
+ post-effects internally; if that's the case, we need to copy into
+ a temporary before adding the post-effects to POST_P. */
+ if (gimple_seq_empty_p (internal_post) && (*gimple_test_f) (*expr_p))
goto out;
/* Otherwise, we need to create a new temporary for the gimplified
@@ -6429,7 +6980,8 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
object the lvalue refers to would (probably) be modified by the
postqueue; we need to copy the value out first, which means an
rvalue. */
- if ((fallback & fb_lvalue) && !internal_post
+ if ((fallback & fb_lvalue)
+ && gimple_seq_empty_p (internal_post)
&& is_gimple_addressable (*expr_p))
{
/* An lvalue will do. Take the address of the expression, store it
@@ -6439,14 +6991,15 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
gimplify_expr (&tmp, pre_p, post_p, is_gimple_reg, fb_rvalue);
*expr_p = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (tmp)), tmp);
}
- else if ((fallback & fb_rvalue) && is_gimple_formal_tmp_rhs (*expr_p))
+ else if ((fallback & fb_rvalue) && is_gimple_formal_tmp_or_call_rhs (*expr_p))
{
+ /* An rvalue will do. Assign the gimplified expression into a
+ new temporary TMP and replace the original expression with
+ TMP. First, make sure that the expression has a type so that
+ it can be assigned into a temporary. */
gcc_assert (!VOID_TYPE_P (TREE_TYPE (*expr_p)));
- /* An rvalue will do. Assign the gimplified expression into a new
- temporary TMP and replace the original expression with TMP. */
-
- if (internal_post || (fallback & fb_lvalue))
+ if (!gimple_seq_empty_p (internal_post) || (fallback & fb_lvalue))
/* The postqueue might change the value of the expression between
the initialization and use of the temporary, so we can't use a
formal temp. FIXME do we care? */
@@ -6459,7 +7012,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
}
else
{
-#ifdef ENABLE_CHECKING
+#ifdef ENABLE_GIMPLE_CHECKING
if (!(fallback & fb_mayfail))
{
fprintf (stderr, "gimplification failed:\n");
@@ -6469,6 +7022,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
}
#endif
gcc_assert (fallback & fb_mayfail);
+
/* If this is an asm statement, and the user asked for the
impossible, don't die. Fail and let gimplify_asm_expr
issue an error. */
@@ -6479,10 +7033,10 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
/* Make sure the temporary matches our predicate. */
gcc_assert ((*gimple_test_f) (*expr_p));
- if (internal_post)
+ if (!gimple_seq_empty_p (internal_post))
{
- annotate_all_with_locus (&internal_post, input_location);
- append_to_statement_list (internal_post, pre_p);
+ annotate_all_with_location (internal_post, input_location);
+ gimplify_seq_add_seq (pre_p, internal_post);
}
out:
@@ -6494,7 +7048,7 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
size that we find. Add to LIST_P any statements generated. */
void
-gimplify_type_sizes (tree type, tree *list_p)
+gimplify_type_sizes (tree type, gimple_seq *list_p)
{
tree field, t;
@@ -6577,10 +7131,10 @@ gimplify_type_sizes (tree type, tree *list_p)
/* A subroutine of gimplify_type_sizes to make sure that *EXPR_P,
a size or position, has had all of its SAVE_EXPRs evaluated.
- We add any required statements to STMT_P. */
+ We add any required statements to *STMT_P. */
void
-gimplify_one_sizepos (tree *expr_p, tree *stmt_p)
+gimplify_one_sizepos (tree *expr_p, gimple_seq *stmt_p)
{
tree type, expr = *expr_p;
@@ -6611,28 +7165,30 @@ gimplify_one_sizepos (tree *expr_p, tree *stmt_p)
&& TYPE_IS_SIZETYPE (type))
{
tree tmp;
+ gimple stmt;
*expr_p = create_tmp_var (type, NULL);
tmp = build1 (NOP_EXPR, type, expr);
- tmp = build_gimple_modify_stmt (*expr_p, tmp);
+ stmt = gimplify_assign (*expr_p, tmp, stmt_p);
if (EXPR_HAS_LOCATION (expr))
- SET_EXPR_LOCUS (tmp, EXPR_LOCUS (expr));
+ gimple_set_location (stmt, *EXPR_LOCUS (expr));
else
- SET_EXPR_LOCATION (tmp, input_location);
-
- gimplify_and_add (tmp, stmt_p);
+ gimple_set_location (stmt, input_location);
}
}
-
-/* Gimplify the body of statements pointed to by BODY_P. FNDECL is the
- function decl containing BODY. */
-void
+/* Gimplify the body of statements pointed to by BODY_P and return a
+ GIMPLE_BIND containing the sequence of GIMPLE statements
+ corresponding to BODY_P. FNDECL is the function decl containing
+ *BODY_P. */
+
+gimple
gimplify_body (tree *body_p, tree fndecl, bool do_parms)
{
location_t saved_location = input_location;
- tree body, parm_stmts;
+ gimple_seq parm_stmts, seq;
+ gimple outer_bind;
struct gimplify_ctx gctx;
timevar_push (TV_TREE_GIMPLIFY);
@@ -6652,63 +7208,62 @@ gimplify_body (tree *body_p, tree fndecl, bool do_parms)
/* Resolve callee-copies. This has to be done before processing
the body so that DECL_VALUE_EXPR gets processed correctly. */
- parm_stmts = do_parms ? gimplify_parameters () : NULL;
+ parm_stmts = (do_parms) ? gimplify_parameters () : NULL;
/* Gimplify the function's body. */
- gimplify_stmt (body_p);
- body = *body_p;
-
- if (!body)
- body = alloc_stmt_list ();
- else if (TREE_CODE (body) == STATEMENT_LIST)
+ seq = NULL;
+ gimplify_stmt (body_p, &seq);
+ outer_bind = gimple_seq_first_stmt (seq);
+ if (!outer_bind)
{
- tree t = expr_only (*body_p);
- if (t)
- body = t;
+ outer_bind = gimple_build_nop ();
+ gimplify_seq_add_stmt (&seq, outer_bind);
}
- /* If there isn't an outer BIND_EXPR, add one. */
- if (TREE_CODE (body) != BIND_EXPR)
- {
- tree b = build3 (BIND_EXPR, void_type_node, NULL_TREE,
- NULL_TREE, NULL_TREE);
- TREE_SIDE_EFFECTS (b) = 1;
- append_to_statement_list_force (body, &BIND_EXPR_BODY (b));
- body = b;
- }
+ /* The body must contain exactly one statement, a GIMPLE_BIND. If this is
+ not the case, wrap everything in a GIMPLE_BIND to make it so. */
+ if (gimple_code (outer_bind) == GIMPLE_BIND
+ && gimple_seq_first (seq) == gimple_seq_last (seq))
+ ;
+ else
+ outer_bind = gimple_build_bind (NULL_TREE, seq, NULL);
+
+ *body_p = NULL_TREE;
/* If we had callee-copies statements, insert them at the beginning
of the function. */
- if (parm_stmts)
+ if (!gimple_seq_empty_p (parm_stmts))
{
- append_to_statement_list_force (BIND_EXPR_BODY (body), &parm_stmts);
- BIND_EXPR_BODY (body) = parm_stmts;
+ gimplify_seq_add_seq (&parm_stmts, gimple_bind_body (outer_bind));
+ gimple_bind_set_body (outer_bind, parm_stmts);
}
- /* Unshare again, in case gimplification was sloppy. */
- unshare_all_trees (body);
-
- *body_p = body;
-
- pop_gimplify_context (body);
+ pop_gimplify_context (outer_bind);
gcc_assert (gimplify_ctxp == NULL);
#ifdef ENABLE_TYPES_CHECKING
if (!errorcount && !sorrycount)
- verify_gimple_1 (BIND_EXPR_BODY (*body_p));
+ verify_types_in_gimple_seq (gimple_bind_body (outer_bind));
#endif
timevar_pop (TV_TREE_GIMPLIFY);
input_location = saved_location;
+
+ return outer_bind;
}
/* Entry point to the gimplification pass. FNDECL is the FUNCTION_DECL
- node for the function we want to gimplify. */
+ node for the function we want to gimplify.
+
+ Returns the sequence of GIMPLE statements corresponding to the body
+ of FNDECL. */
void
gimplify_function_tree (tree fndecl)
{
tree oldfn, parm, ret;
+ gimple_seq seq;
+ gimple bind;
oldfn = current_function_decl;
current_function_decl = fndecl;
@@ -6735,7 +7290,13 @@ gimplify_function_tree (tree fndecl)
&& !needs_to_live_in_memory (ret))
DECL_GIMPLE_REG_P (ret) = 1;
- gimplify_body (&DECL_SAVED_TREE (fndecl), fndecl, true);
+ bind = gimplify_body (&DECL_SAVED_TREE (fndecl), fndecl, true);
+
+ /* The tree body of the function is no longer needed, replace it
+ with the new GIMPLE body. */
+ seq = gimple_seq_alloc ();
+ gimple_seq_add_stmt (&seq, bind);
+ gimple_set_body (fndecl, seq);
/* If we're instrumenting function entry/exit, then prepend the call to
the entry hook and wrap the whole function in a TRY_FINALLY_EXPR to
@@ -6745,44 +7306,248 @@ gimplify_function_tree (tree fndecl)
&& !DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (fndecl)
&& !flag_instrument_functions_exclude_p (fndecl))
{
- tree tf, x, bind;
+ tree x;
+ gimple new_bind;
+ gimple tf;
+ gimple_seq cleanup = NULL, body = NULL;
- tf = build2 (TRY_FINALLY_EXPR, void_type_node, NULL, NULL);
- TREE_SIDE_EFFECTS (tf) = 1;
- x = DECL_SAVED_TREE (fndecl);
- append_to_statement_list (x, &TREE_OPERAND (tf, 0));
x = implicit_built_in_decls[BUILT_IN_PROFILE_FUNC_EXIT];
- x = build_call_expr (x, 0);
- append_to_statement_list (x, &TREE_OPERAND (tf, 1));
+ gimplify_seq_add_stmt (&cleanup, gimple_build_call (x, 0));
+ tf = gimple_build_try (seq, cleanup, GIMPLE_TRY_FINALLY);
- bind = build3 (BIND_EXPR, void_type_node, NULL, NULL, NULL);
- TREE_SIDE_EFFECTS (bind) = 1;
x = implicit_built_in_decls[BUILT_IN_PROFILE_FUNC_ENTER];
- x = build_call_expr (x, 0);
- append_to_statement_list (x, &BIND_EXPR_BODY (bind));
- append_to_statement_list (tf, &BIND_EXPR_BODY (bind));
+ gimplify_seq_add_stmt (&body, gimple_build_call (x, 0));
+ gimplify_seq_add_stmt (&body, tf);
+ new_bind = gimple_build_bind (NULL, body, gimple_block (bind));
+ /* Clear the block for BIND, since it is no longer directly inside
+ the function, but within a try block. */
+ gimple_set_block (bind, NULL);
- DECL_SAVED_TREE (fndecl) = bind;
+ /* Replace the current function body with the body
+ wrapped in the try/finally TF. */
+ seq = gimple_seq_alloc ();
+ gimple_seq_add_stmt (&seq, new_bind);
+ gimple_set_body (fndecl, seq);
}
+ DECL_SAVED_TREE (fndecl) = NULL_TREE;
+
current_function_decl = oldfn;
pop_cfun ();
}
-
+
+
+/* Some transformations like inlining may invalidate the GIMPLE form
+ for operands. This function traverses all the operands in STMT and
+ gimplifies anything that is not a valid gimple operand. Any new
+ GIMPLE statements are inserted before *GSI_P. */
+
+void
+gimple_regimplify_operands (gimple stmt, gimple_stmt_iterator *gsi_p)
+{
+ size_t i, num_ops;
+ tree orig_lhs = NULL_TREE, lhs, t;
+ gimple_seq pre = NULL;
+ gimple post_stmt = NULL;
+ struct gimplify_ctx gctx;
+
+ push_gimplify_context (&gctx);
+ gimplify_ctxp->into_ssa = gimple_in_ssa_p (cfun);
+
+ switch (gimple_code (stmt))
+ {
+ case GIMPLE_COND:
+ gimplify_expr (gimple_cond_lhs_ptr (stmt), &pre, NULL,
+ is_gimple_val, fb_rvalue);
+ gimplify_expr (gimple_cond_rhs_ptr (stmt), &pre, NULL,
+ is_gimple_val, fb_rvalue);
+ break;
+ case GIMPLE_OMP_ATOMIC_LOAD:
+ gimplify_expr (gimple_omp_atomic_load_rhs_ptr (stmt), &pre, NULL,
+ is_gimple_val, fb_rvalue);
+ break;
+ case GIMPLE_ASM:
+ {
+ size_t i, noutputs = gimple_asm_noutputs (stmt);
+ const char *constraint, **oconstraints;
+ bool allows_mem, allows_reg, is_inout;
+
+ oconstraints
+ = (const char **) alloca ((noutputs) * sizeof (const char *));
+ for (i = 0; i < noutputs; i++)
+ {
+ tree op = gimple_asm_output_op (stmt, i);
+ constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (op)));
+ oconstraints[i] = constraint;
+ parse_output_constraint (&constraint, i, 0, 0, &allows_mem,
+ &allows_reg, &is_inout);
+ gimplify_expr (&TREE_VALUE (op), &pre, NULL,
+ is_inout ? is_gimple_min_lval : is_gimple_lvalue,
+ fb_lvalue | fb_mayfail);
+ }
+ for (i = 0; i < gimple_asm_ninputs (stmt); i++)
+ {
+ tree op = gimple_asm_input_op (stmt, i);
+ constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (op)));
+ parse_input_constraint (&constraint, 0, 0, noutputs, 0,
+ oconstraints, &allows_mem, &allows_reg);
+ if (TREE_ADDRESSABLE (TREE_TYPE (TREE_VALUE (op))) && allows_mem)
+ allows_reg = 0;
+ if (!allows_reg && allows_mem)
+ gimplify_expr (&TREE_VALUE (op), &pre, NULL,
+ is_gimple_lvalue, fb_lvalue | fb_mayfail);
+ else
+ gimplify_expr (&TREE_VALUE (op), &pre, NULL,
+ is_gimple_asm_val, fb_rvalue);
+ }
+ }
+ break;
+ default:
+ /* NOTE: We start gimplifying operands from last to first to
+ make sure that side-effects on the RHS of calls, assignments
+ and ASMs are executed before the LHS. The ordering is not
+ important for other statements. */
+ num_ops = gimple_num_ops (stmt);
+ orig_lhs = gimple_get_lhs (stmt);
+ for (i = num_ops; i > 0; i--)
+ {
+ tree op = gimple_op (stmt, i - 1);
+ if (op == NULL_TREE)
+ continue;
+ if (i == 1 && (is_gimple_call (stmt) || is_gimple_assign (stmt)))
+ gimplify_expr (&op, &pre, NULL, is_gimple_lvalue, fb_lvalue);
+ else if (i == 2
+ && is_gimple_assign (stmt)
+ && num_ops == 2
+ && get_gimple_rhs_class (gimple_expr_code (stmt))
+ == GIMPLE_SINGLE_RHS)
+ gimplify_expr (&op, &pre, NULL,
+ rhs_predicate_for (gimple_assign_lhs (stmt)),
+ fb_rvalue);
+ else if (i == 2 && is_gimple_call (stmt))
+ {
+ if (TREE_CODE (op) == FUNCTION_DECL)
+ continue;
+ gimplify_expr (&op, &pre, NULL, is_gimple_call_addr, fb_rvalue);
+ }
+ else
+ gimplify_expr (&op, &pre, NULL, is_gimple_val, fb_rvalue);
+ gimple_set_op (stmt, i - 1, op);
+ }
+
+ lhs = gimple_get_lhs (stmt);
+ /* If regimplification of the LHS changed it in a way that requires
+ a simple RHS, create temporary. */
+ if (orig_lhs != lhs && !is_gimple_formal_tmp_var (lhs))
+ {
+ bool need_temp = false;
+
+ if (is_gimple_assign (stmt)
+ && num_ops == 2
+ && get_gimple_rhs_class (gimple_expr_code (stmt))
+ == GIMPLE_SINGLE_RHS)
+ gimplify_expr (gimple_assign_rhs1_ptr (stmt), &pre, NULL,
+ rhs_predicate_for (gimple_assign_lhs (stmt)),
+ fb_rvalue);
+ else if (is_gimple_reg (lhs))
+ {
+ if (is_gimple_reg_type (TREE_TYPE (lhs)))
+ {
+ if (is_gimple_call (stmt))
+ {
+ i = gimple_call_flags (stmt);
+ if ((i & ECF_LOOPING_CONST_OR_PURE)
+ || !(i & (ECF_CONST | ECF_PURE)))
+ need_temp = true;
+ }
+ if (stmt_can_throw_internal (stmt))
+ need_temp = true;
+ }
+ }
+ else
+ {
+ if (is_gimple_reg_type (TREE_TYPE (lhs)))
+ need_temp = true;
+ else if (TYPE_MODE (TREE_TYPE (lhs)) != BLKmode)
+ {
+ if (is_gimple_call (stmt))
+ {
+ tree fndecl = gimple_call_fndecl (stmt);
+
+ if (!aggregate_value_p (TREE_TYPE (lhs), fndecl)
+ && !(fndecl && DECL_RESULT (fndecl)
+ && DECL_BY_REFERENCE (DECL_RESULT (fndecl))))
+ need_temp = true;
+ }
+ else
+ need_temp = true;
+ }
+ }
+ if (need_temp)
+ {
+ tree temp = create_tmp_var (TREE_TYPE (lhs), NULL);
+
+ DECL_GIMPLE_FORMAL_TEMP_P (temp) = 1;
+ if (TREE_CODE (TREE_TYPE (lhs)) == COMPLEX_TYPE
+ || TREE_CODE (TREE_TYPE (lhs)) == VECTOR_TYPE)
+ DECL_GIMPLE_REG_P (temp) = 1;
+ if (TREE_CODE (orig_lhs) == SSA_NAME)
+ orig_lhs = SSA_NAME_VAR (orig_lhs);
+ if (TREE_CODE (orig_lhs) == VAR_DECL
+ && DECL_BASED_ON_RESTRICT_P (orig_lhs))
+ {
+ DECL_BASED_ON_RESTRICT_P (temp) = 1;
+ SET_DECL_RESTRICT_BASE (temp,
+ DECL_GET_RESTRICT_BASE (orig_lhs));
+ }
+
+ if (gimple_in_ssa_p (cfun))
+ temp = make_ssa_name (temp, NULL);
+ gimple_set_lhs (stmt, temp);
+ post_stmt = gimple_build_assign (lhs, temp);
+ if (TREE_CODE (lhs) == SSA_NAME)
+ SSA_NAME_DEF_STMT (lhs) = post_stmt;
+ }
+ }
+ break;
+ }
+
+ if (!gimple_seq_empty_p (pre))
+ {
+ if (gimple_in_ssa_p (cfun))
+ {
+ gimple_stmt_iterator i;
+
+ for (i = gsi_start (pre); !gsi_end_p (i); gsi_next (&i))
+ mark_symbols_for_renaming (gsi_stmt (i));
+ }
+ gsi_insert_seq_before (gsi_p, pre, GSI_SAME_STMT);
+ }
+ if (post_stmt)
+ gsi_insert_after (gsi_p, post_stmt, GSI_NEW_STMT);
+
+ if (gimple_referenced_vars (cfun))
+ for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t))
+ add_referenced_var (t);
+
+ pop_gimplify_context (NULL);
+}
+
+
/* Expands EXPR to list of gimple statements STMTS. If SIMPLE is true,
force the result to be either ssa_name or an invariant, otherwise
just force it to be a rhs expression. If VAR is not NULL, make the
base variable of the final destination be VAR if suitable. */
tree
-force_gimple_operand (tree expr, tree *stmts, bool simple, tree var)
+force_gimple_operand (tree expr, gimple_seq *stmts, bool simple, tree var)
{
tree t;
enum gimplify_status ret;
gimple_predicate gimple_test_f;
struct gimplify_ctx gctx;
- *stmts = NULL_TREE;
+ *stmts = NULL;
if (is_gimple_val (expr))
return expr;
@@ -6794,9 +7559,9 @@ force_gimple_operand (tree expr, tree *stmts, bool simple, tree var)
gimplify_ctxp->allow_rhs_cond_expr = true;
if (var)
- expr = build_gimple_modify_stmt (var, expr);
+ expr = build2 (MODIFY_EXPR, TREE_TYPE (var), var, expr);
- if (TREE_CODE (expr) != GIMPLE_MODIFY_STMT
+ if (TREE_CODE (expr) != MODIFY_EXPR
&& TREE_TYPE (expr) == void_type_node)
{
gimplify_and_add (expr, stmts);
@@ -6804,16 +7569,13 @@ force_gimple_operand (tree expr, tree *stmts, bool simple, tree var)
}
else
{
- ret = gimplify_expr (&expr, stmts, NULL,
- gimple_test_f, fb_rvalue);
+ ret = gimplify_expr (&expr, stmts, NULL, gimple_test_f, fb_rvalue);
gcc_assert (ret != GS_ERROR);
}
if (gimple_referenced_vars (cfun))
- {
- for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t))
- add_referenced_var (t);
- }
+ for (t = gimplify_ctxp->temps; t ; t = TREE_CHAIN (t))
+ add_referenced_var (t);
pop_gimplify_context (NULL);
@@ -6821,33 +7583,34 @@ force_gimple_operand (tree expr, tree *stmts, bool simple, tree var)
}
/* Invokes force_gimple_operand for EXPR with parameters SIMPLE_P and VAR. If
- some statements are produced, emits them at BSI. If BEFORE is true.
- the statements are appended before BSI, otherwise they are appended after
- it. M specifies the way BSI moves after insertion (BSI_SAME_STMT or
- BSI_CONTINUE_LINKING are the usual values). */
+ some statements are produced, emits them at GSI. If BEFORE is true.
+ the statements are appended before GSI, otherwise they are appended after
+ it. M specifies the way GSI moves after insertion (GSI_SAME_STMT or
+ GSI_CONTINUE_LINKING are the usual values). */
tree
-force_gimple_operand_bsi (block_stmt_iterator *bsi, tree expr,
+force_gimple_operand_gsi (gimple_stmt_iterator *gsi, tree expr,
bool simple_p, tree var, bool before,
- enum bsi_iterator_update m)
+ enum gsi_iterator_update m)
{
- tree stmts;
+ gimple_seq stmts;
expr = force_gimple_operand (expr, &stmts, simple_p, var);
- if (stmts)
+
+ if (!gimple_seq_empty_p (stmts))
{
if (gimple_in_ssa_p (cfun))
{
- tree_stmt_iterator tsi;
+ gimple_stmt_iterator i;
- for (tsi = tsi_start (stmts); !tsi_end_p (tsi); tsi_next (&tsi))
- mark_symbols_for_renaming (tsi_stmt (tsi));
+ for (i = gsi_start (stmts); !gsi_end_p (i); gsi_next (&i))
+ mark_symbols_for_renaming (gsi_stmt (i));
}
if (before)
- bsi_insert_before (bsi, stmts, m);
+ gsi_insert_seq_before (gsi, stmts, m);
else
- bsi_insert_after (bsi, stmts, m);
+ gsi_insert_seq_after (gsi, stmts, m);
}
return expr;
diff --git a/gcc/global.c b/gcc/global.c
index c47033e5754..88fe38352f7 100644
--- a/gcc/global.c
+++ b/gcc/global.c
@@ -188,7 +188,7 @@ compute_regs_asm_clobbered (char *regs_asm_clobbered)
/* All registers that can be eliminated. */
-static HARD_REG_SET eliminable_regset;
+HARD_REG_SET eliminable_regset;
static int regno_compare (const void *, const void *);
static int allocno_compare (const void *, const void *);
@@ -197,7 +197,6 @@ static void prune_preferences (void);
static void set_preferences (void);
static void find_reg (int, HARD_REG_SET, int, int, int);
static void dump_conflicts (FILE *);
-static void build_insn_chain (void);
/* Look through the list of eliminable registers. Set ELIM_SET to the
@@ -233,6 +232,7 @@ compute_regsets (HARD_REG_SET *elim_set,
= (! flag_omit_frame_pointer
|| (cfun->calls_alloca && EXIT_IGNORE_STACK)
|| crtl->accesses_prior_frames
+ || crtl->stack_realign_needed
|| FRAME_POINTER_REQUIRED);
frame_pointer_needed = need_fp;
@@ -256,7 +256,10 @@ compute_regsets (HARD_REG_SET *elim_set,
{
bool cannot_elim
= (! CAN_ELIMINATE (eliminables[i].from, eliminables[i].to)
- || (eliminables[i].to == STACK_POINTER_REGNUM && need_fp));
+ || (eliminables[i].to == STACK_POINTER_REGNUM
+ && need_fp
+ && (! SUPPORTS_STACK_ALIGNMENT
+ || ! stack_realign_fp)));
if (!regs_asm_clobbered[eliminables[i].from])
{
@@ -1165,8 +1168,8 @@ find_reg (int num, HARD_REG_SET losers, int alt_regs_p, int accept_call_clobbere
if (! accept_call_clobbered
&& allocno[num].calls_crossed != 0
&& allocno[num].throwing_calls_crossed == 0
- && CALLER_SAVE_PROFITABLE (optimize_size ? allocno[num].n_refs : allocno[num].freq,
- optimize_size ? allocno[num].calls_crossed
+ && CALLER_SAVE_PROFITABLE (optimize_function_for_size_p (cfun) ? allocno[num].n_refs : allocno[num].freq,
+ optimize_function_for_size_p (cfun) ? allocno[num].calls_crossed
: allocno[num].freq_calls_crossed))
{
HARD_REG_SET new_losers;
@@ -1351,7 +1354,8 @@ mark_elimination (int from, int to)
FOR_EACH_BB (bb)
{
- regset r = DF_LIVE_IN (bb);
+ /* We don't use LIVE info in IRA. */
+ regset r = (flag_ira ? DF_LR_IN (bb) : DF_LIVE_IN (bb));
if (REGNO_REG_SET_P (r, from))
{
CLEAR_REGNO_REG_SET (r, from);
@@ -1381,11 +1385,21 @@ print_insn_chains (FILE *file)
print_insn_chain (file, c);
}
+/* Return true if pseudo REGNO should be added to set live_throughout
+ or dead_or_set of the insn chains for reload consideration. */
+
+static bool
+pseudo_for_reload_consideration_p (int regno)
+{
+ /* Consider spilled pseudos too for IRA because they still have a
+ chance to get hard-registers in the reload when IRA is used. */
+ return reg_renumber[regno] >= 0 || (flag_ira && optimize);
+}
/* Walk the insns of the current function and build reload_insn_chain,
and record register life information. */
-static void
+void
build_insn_chain (void)
{
unsigned int i;
@@ -1408,7 +1422,6 @@ build_insn_chain (void)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (TEST_HARD_REG_BIT (eliminable_regset, i))
bitmap_set_bit (elim_regset, i);
-
FOR_EACH_BB_REVERSE (bb)
{
bitmap_iterator bi;
@@ -1426,7 +1439,7 @@ build_insn_chain (void)
EXECUTE_IF_SET_IN_BITMAP (df_get_live_out (bb), FIRST_PSEUDO_REGISTER, i, bi)
{
- if (reg_renumber[i] >= 0)
+ if (pseudo_for_reload_consideration_p (i))
bitmap_set_bit (live_relevant_regs, i);
}
@@ -1463,11 +1476,13 @@ build_insn_chain (void)
if (!fixed_regs[regno])
bitmap_set_bit (&c->dead_or_set, regno);
}
- else if (reg_renumber[regno] >= 0)
+ else if (pseudo_for_reload_consideration_p (regno))
bitmap_set_bit (&c->dead_or_set, regno);
}
- if ((regno < FIRST_PSEUDO_REGISTER || reg_renumber[regno] >= 0)
+ if ((regno < FIRST_PSEUDO_REGISTER
+ || reg_renumber[regno] >= 0
+ || (flag_ira && optimize))
&& (!DF_REF_FLAGS_IS_SET (def, DF_REF_CONDITIONAL)))
{
rtx reg = DF_REF_REG (def);
@@ -1563,11 +1578,12 @@ build_insn_chain (void)
if (!fixed_regs[regno])
bitmap_set_bit (&c->dead_or_set, regno);
}
- else if (reg_renumber[regno] >= 0)
+ else if (pseudo_for_reload_consideration_p (regno))
bitmap_set_bit (&c->dead_or_set, regno);
}
- if (regno < FIRST_PSEUDO_REGISTER || reg_renumber[regno] >= 0)
+ if (regno < FIRST_PSEUDO_REGISTER
+ || pseudo_for_reload_consideration_p (regno))
{
if (GET_CODE (reg) == SUBREG
&& !DF_REF_FLAGS_IS_SET (use,
@@ -1744,6 +1760,13 @@ dump_global_regs (FILE *file)
fprintf (file, "\n\n");
}
+
+static bool
+gate_handle_global_alloc (void)
+{
+ return ! flag_ira;
+}
+
/* Run old register allocator. Return TRUE if we must exit
rest_of_compilation upon return. */
static unsigned int
@@ -1807,7 +1830,7 @@ struct rtl_opt_pass pass_global_alloc =
{
RTL_PASS,
"greg", /* name */
- NULL, /* gate */
+ gate_handle_global_alloc, /* gate */
rest_of_handle_global_alloc, /* execute */
NULL, /* sub */
NULL, /* next */
diff --git a/gcc/gthr-posix.c b/gcc/gthr-posix.c
index e2d731ae407..154fc339416 100644
--- a/gcc/gthr-posix.c
+++ b/gcc/gthr-posix.c
@@ -75,6 +75,24 @@ pthread_create (pthread_t *thread ATTRIBUTE_UNUSED,
return 0;
}
+int
+pthread_join (pthread_t thread ATTRIBUTE_UNUSED,
+ void **value_ptr ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
+void
+pthread_exit (void *value_ptr ATTRIBUTE_UNUSED)
+{
+}
+
+int
+pthread_detach (pthread_t thread ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+
int
pthread_cancel (pthread_t thread ATTRIBUTE_UNUSED)
{
@@ -93,6 +111,17 @@ pthread_mutex_trylock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
return 0;
}
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+int
+pthread_mutex_timedlock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
+ const struct timespec *abs_timeout ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+#endif
+#endif /* _POSIX_TIMEOUTS */
+
int
pthread_mutex_unlock (pthread_mutex_t *mutex ATTRIBUTE_UNUSED)
{
@@ -150,9 +179,12 @@ pthread_cond_wait (pthread_cond_t *cond ATTRIBUTE_UNUSED,
return 0;
}
-void
-pthread_exit (void *value_ptr ATTRIBUTE_UNUSED)
+int
+pthread_cond_timedwait (pthread_cond_t *cond ATTRIBUTE_UNUSED,
+ pthread_mutex_t *mutex ATTRIBUTE_UNUSED,
+ const struct timespec *abstime ATTRIBUTE_UNUSED)
{
+ return 0;
}
int
@@ -173,6 +205,7 @@ pthread_self (void)
{
return (pthread_t) 0;
}
+
#ifdef _POSIX_PRIORITY_SCHEDULING
#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
int
diff --git a/gcc/gthr-posix.h b/gcc/gthr-posix.h
index b16f9b31fe8..221833e0089 100644
--- a/gcc/gthr-posix.h
+++ b/gcc/gthr-posix.h
@@ -34,6 +34,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
Easy, since the interface is just one-to-one mapping. */
#define __GTHREADS 1
+#define __GTHREADS_CXX0X 1
/* Some implementations of <pthread.h> require this to be defined. */
#if !defined(_REENTRANT) && defined(__osf__)
@@ -43,11 +44,13 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
#include <pthread.h>
#include <unistd.h>
+typedef pthread_t __gthread_t;
typedef pthread_key_t __gthread_key_t;
typedef pthread_once_t __gthread_once_t;
typedef pthread_mutex_t __gthread_mutex_t;
typedef pthread_mutex_t __gthread_recursive_mutex_t;
typedef pthread_cond_t __gthread_cond_t;
+typedef struct timespec __gthread_time_t;
/* POSIX like conditional variables are supported. Please look at comments
in gthr.h for details. */
@@ -63,6 +66,7 @@ typedef pthread_cond_t __gthread_cond_t;
#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function
#endif
#define __GTHREAD_COND_INIT PTHREAD_COND_INITIALIZER
+#define __GTHREAD_TIME_INIT {0,0}
#if SUPPORTS_WEAK && GTHREAD_USE_WEAK
# ifndef __gthrw_pragma
@@ -88,28 +92,60 @@ typedef pthread_cond_t __gthread_cond_t;
__gthrw3(pthread_once)
__gthrw3(pthread_getspecific)
__gthrw3(pthread_setspecific)
+
__gthrw3(pthread_create)
+__gthrw3(pthread_join)
+__gthrw3(pthread_detach)
+__gthrw3(pthread_equal)
+__gthrw3(pthread_self)
__gthrw3(pthread_cancel)
+__gthrw3(sched_yield)
+
__gthrw3(pthread_mutex_lock)
__gthrw3(pthread_mutex_trylock)
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+__gthrw3(pthread_mutex_timedlock)
+#endif
+#endif /* _POSIX_TIMEOUTS */
__gthrw3(pthread_mutex_unlock)
__gthrw3(pthread_mutex_init)
__gthrw3(pthread_mutex_destroy)
+
__gthrw3(pthread_cond_broadcast)
+__gthrw3(pthread_cond_signal)
__gthrw3(pthread_cond_wait)
+__gthrw3(pthread_cond_timedwait)
+__gthrw3(pthread_cond_destroy)
#else
__gthrw(pthread_once)
__gthrw(pthread_getspecific)
__gthrw(pthread_setspecific)
+
__gthrw(pthread_create)
+__gthrw(pthread_join)
+__gthrw(pthread_equal)
+__gthrw(pthread_self)
+__gthrw(pthread_detach)
__gthrw(pthread_cancel)
+__gthrw(sched_yield)
+
__gthrw(pthread_mutex_lock)
__gthrw(pthread_mutex_trylock)
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+__gthrw(pthread_mutex_timedlock)
+#endif
+#endif /* _POSIX_TIMEOUTS */
__gthrw(pthread_mutex_unlock)
__gthrw(pthread_mutex_init)
__gthrw(pthread_mutex_destroy)
+
__gthrw(pthread_cond_broadcast)
+__gthrw(pthread_cond_signal)
__gthrw(pthread_cond_wait)
+__gthrw(pthread_cond_timedwait)
+__gthrw(pthread_cond_destroy)
#endif
__gthrw(pthread_key_create)
@@ -122,17 +158,11 @@ __gthrw(pthread_mutexattr_destroy)
#if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK)
/* Objective-C. */
#if defined(__osf__) && defined(_PTHREAD_USE_MANGLED_NAMES_)
-__gthrw3(pthread_cond_destroy)
__gthrw3(pthread_cond_init)
-__gthrw3(pthread_cond_signal)
__gthrw3(pthread_exit)
-__gthrw3(pthread_self)
#else
-__gthrw(pthread_cond_destroy)
__gthrw(pthread_cond_init)
-__gthrw(pthread_cond_signal)
__gthrw(pthread_exit)
-__gthrw(pthread_self)
#endif /* __osf__ && _PTHREAD_USE_MANGLED_NAMES_ */
#ifdef _POSIX_PRIORITY_SCHEDULING
#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
@@ -140,7 +170,6 @@ __gthrw(sched_get_priority_max)
__gthrw(sched_get_priority_min)
#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */
#endif /* _POSIX_PRIORITY_SCHEDULING */
-__gthrw(sched_yield)
__gthrw(pthread_attr_destroy)
__gthrw(pthread_attr_init)
__gthrw(pthread_attr_setdetachstate)
@@ -647,6 +676,42 @@ __gthread_objc_condition_signal (objc_condition_t condition)
#else /* _LIBOBJC */
static inline int
+__gthread_create (__gthread_t *thread, void *(*func) (void*), void *args)
+{
+ return __gthrw_(pthread_create) (thread, NULL, func, args);
+}
+
+static inline int
+__gthread_join (__gthread_t thread, void **value_ptr)
+{
+ return __gthrw_(pthread_join) (thread, value_ptr);
+}
+
+static inline int
+__gthread_detach (__gthread_t thread)
+{
+ return __gthrw_(pthread_detach) (thread);
+}
+
+static inline int
+__gthread_equal (__gthread_t t1, __gthread_t t2)
+{
+ return __gthrw_(pthread_equal) (t1, t2);
+}
+
+static inline __gthread_t
+__gthread_self (void)
+{
+ return __gthrw_(pthread_self) ();
+}
+
+static inline int
+__gthread_yield (void)
+{
+ return __gthrw_(sched_yield) ();
+}
+
+static inline int
__gthread_once (__gthread_once_t *once, void (*func) (void))
{
if (__gthread_active_p ())
@@ -706,6 +771,20 @@ __gthread_mutex_trylock (__gthread_mutex_t *mutex)
return 0;
}
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+static inline int
+__gthread_mutex_timedlock (__gthread_mutex_t *mutex,
+ const __gthread_time_t *abs_timeout)
+{
+ if (__gthread_active_p ())
+ return __gthrw_(pthread_mutex_timedlock) (mutex, abs_timeout);
+ else
+ return 0;
+}
+#endif
+#endif
+
static inline int
__gthread_mutex_unlock (__gthread_mutex_t *mutex)
{
@@ -749,6 +828,17 @@ __gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex)
return __gthread_mutex_trylock (mutex);
}
+#ifdef _POSIX_TIMEOUTS
+#if _POSIX_TIMEOUTS >= 0
+static inline int
+__gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *mutex,
+ const __gthread_time_t *abs_timeout)
+{
+ return __gthread_mutex_timedlock (mutex, abs_timeout);
+}
+#endif
+#endif
+
static inline int
__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex)
{
@@ -762,18 +852,45 @@ __gthread_cond_broadcast (__gthread_cond_t *cond)
}
static inline int
+__gthread_cond_signal (__gthread_cond_t *cond)
+{
+ return __gthrw_(pthread_cond_signal) (cond);
+}
+
+static inline int
__gthread_cond_wait (__gthread_cond_t *cond, __gthread_mutex_t *mutex)
{
return __gthrw_(pthread_cond_wait) (cond, mutex);
}
static inline int
+__gthread_cond_timedwait (__gthread_cond_t *cond, __gthread_mutex_t *mutex,
+ const __gthread_time_t *abs_timeout)
+{
+ return __gthrw_(pthread_cond_timedwait) (cond, mutex, abs_timeout);
+}
+
+static inline int
__gthread_cond_wait_recursive (__gthread_cond_t *cond,
__gthread_recursive_mutex_t *mutex)
{
return __gthread_cond_wait (cond, mutex);
}
+static inline int
+__gthread_cond_timedwait_recursive (__gthread_cond_t *cond,
+ __gthread_recursive_mutex_t *mutex,
+ const __gthread_time_t *abs_timeout)
+{
+ return __gthread_cond_timedwait (cond, mutex, abs_timeout);
+}
+
+static inline int
+__gthread_cond_destroy (__gthread_cond_t* cond)
+{
+ return __gthrw_(pthread_cond_destroy) (cond);
+}
+
#endif /* _LIBOBJC */
#endif /* ! GCC_GTHR_POSIX_H */
diff --git a/gcc/gthr.h b/gcc/gthr.h
index a145ef1a9de..d318256429a 100644
--- a/gcc/gthr.h
+++ b/gcc/gthr.h
@@ -104,12 +104,43 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
All functions returning int should return zero on success or the error
number. If the operation is not supported, -1 is returned.
+ If the following are also defined, you should
+ #define __GTHREADS_CXX0X 1
+ to enable the c++0x thread library.
+
+ Types:
+ __gthread_t
+ __gthread_time_t
+
+ Interface:
+ int __gthread_create (__gthread_t *thread, void *(*func) (void*),
+ void *args);
+ int __gthread_join (__gthread_t thread, void **value_ptr);
+ int __gthread_detach (__gthread_t thread);
+ int __gthread_equal (__gthread_t t1, __gthread_t t2);
+ __gthread_t __gthread_self (void);
+ int __gthread_yield (void);
+
+ int __gthread_mutex_timedlock (__gthread_mutex_t *m,
+ const __gthread_time_t *abs_timeout);
+ int __gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *m,
+ const __gthread_time_t *abs_time);
+
+ int __gthread_cond_signal (__gthread_cond_t *cond);
+ int __gthread_cond_timedwait (__gthread_cond_t *cond,
+ __gthread_mutex_t *mutex,
+ const __gthread_time_t *abs_timeout);
+ int __gthread_cond_timedwait_recursive (__gthread_cond_t *cond,
+ __gthread_recursive_mutex_t *mutex,
+ const __gthread_time_t *abs_time)
+
Currently supported threads packages are
TPF threads with -D__tpf__
POSIX/Unix98 threads with -D_PTHREADS
POSIX/Unix95 threads with -D_PTHREADS95
DCE threads with -D_DCE_THREADS
Solaris/UI threads with -D_SOLARIS_THREADS
+
*/
/* Check first for thread specific defines. */
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/hard-reg-set.h b/gcc/hard-reg-set.h
index 21030fdd2df..c4f74a267c0 100644
--- a/gcc/hard-reg-set.h
+++ b/gcc/hard-reg-set.h
@@ -538,6 +538,11 @@ extern char global_regs[FIRST_PSEUDO_REGISTER];
extern HARD_REG_SET regs_invalidated_by_call;
+/* Call used hard registers which can not be saved because there is no
+ insn for this. */
+
+extern HARD_REG_SET no_caller_save_reg_set;
+
#ifdef REG_ALLOC_ORDER
/* Table of register numbers in the order in which to try to use them. */
@@ -556,6 +561,10 @@ extern HARD_REG_SET reg_class_contents[N_REG_CLASSES];
extern unsigned int reg_class_size[N_REG_CLASSES];
+/* For each reg class, table listing all the classes contained in it. */
+
+extern enum reg_class reg_class_subclasses[N_REG_CLASSES][N_REG_CLASSES];
+
/* For each pair of reg classes,
a largest reg class contained in their union. */
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index da8afde3106..51fc48c6043 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -67,7 +67,9 @@
#endif
#ifndef MAX_CONDITIONAL_EXECUTE
-#define MAX_CONDITIONAL_EXECUTE (BRANCH_COST + 1)
+#define MAX_CONDITIONAL_EXECUTE \
+ (BRANCH_COST (optimize_function_for_speed_p (cfun), false) \
+ + 1)
#endif
#define IFCVT_MULTIPLE_DUMPS 1
@@ -626,6 +628,9 @@ struct noce_if_info
from TEST_BB. For the noce transformations, we allow the symmetric
form as well. */
bool then_else_reversed;
+
+ /* Estimated cost of the particular branch instruction. */
+ int branch_cost;
};
static rtx noce_emit_store_flag (struct noce_if_info *, rtx, int, int);
@@ -963,20 +968,20 @@ noce_try_store_flag_constants (struct noce_if_info *if_info)
normalize = 0;
else if (ifalse == 0 && exact_log2 (itrue) >= 0
&& (STORE_FLAG_VALUE == 1
- || BRANCH_COST >= 2))
+ || if_info->branch_cost >= 2))
normalize = 1;
else if (itrue == 0 && exact_log2 (ifalse) >= 0 && can_reverse
- && (STORE_FLAG_VALUE == 1 || BRANCH_COST >= 2))
+ && (STORE_FLAG_VALUE == 1 || if_info->branch_cost >= 2))
normalize = 1, reversep = 1;
else if (itrue == -1
&& (STORE_FLAG_VALUE == -1
- || BRANCH_COST >= 2))
+ || if_info->branch_cost >= 2))
normalize = -1;
else if (ifalse == -1 && can_reverse
- && (STORE_FLAG_VALUE == -1 || BRANCH_COST >= 2))
+ && (STORE_FLAG_VALUE == -1 || if_info->branch_cost >= 2))
normalize = -1, reversep = 1;
- else if ((BRANCH_COST >= 2 && STORE_FLAG_VALUE == -1)
- || BRANCH_COST >= 3)
+ else if ((if_info->branch_cost >= 2 && STORE_FLAG_VALUE == -1)
+ || if_info->branch_cost >= 3)
normalize = -1;
else
return FALSE;
@@ -1107,7 +1112,7 @@ noce_try_addcc (struct noce_if_info *if_info)
/* If that fails, construct conditional increment or decrement using
setcc. */
- if (BRANCH_COST >= 2
+ if (if_info->branch_cost >= 2
&& (XEXP (if_info->a, 1) == const1_rtx
|| XEXP (if_info->a, 1) == constm1_rtx))
{
@@ -1158,7 +1163,7 @@ noce_try_store_flag_mask (struct noce_if_info *if_info)
int reversep;
reversep = 0;
- if ((BRANCH_COST >= 2
+ if ((if_info->branch_cost >= 2
|| STORE_FLAG_VALUE == -1)
&& ((if_info->a == const0_rtx
&& rtx_equal_p (if_info->b, if_info->x))
@@ -1317,7 +1322,7 @@ noce_try_cmove_arith (struct noce_if_info *if_info)
/* ??? FIXME: Magic number 5. */
if (cse_not_expected
&& MEM_P (a) && MEM_P (b)
- && BRANCH_COST >= 5)
+ && if_info->branch_cost >= 5)
{
a = XEXP (a, 0);
b = XEXP (b, 0);
@@ -1347,7 +1352,7 @@ noce_try_cmove_arith (struct noce_if_info *if_info)
if (insn_a)
{
insn_cost = insn_rtx_cost (PATTERN (insn_a));
- if (insn_cost == 0 || insn_cost > COSTS_N_INSNS (BRANCH_COST))
+ if (insn_cost == 0 || insn_cost > COSTS_N_INSNS (if_info->branch_cost))
return FALSE;
}
else
@@ -1356,7 +1361,7 @@ noce_try_cmove_arith (struct noce_if_info *if_info)
if (insn_b)
{
insn_cost += insn_rtx_cost (PATTERN (insn_b));
- if (insn_cost == 0 || insn_cost > COSTS_N_INSNS (BRANCH_COST))
+ if (insn_cost == 0 || insn_cost > COSTS_N_INSNS (if_info->branch_cost))
return FALSE;
}
@@ -2831,6 +2836,8 @@ noce_find_if_block (basic_block test_bb,
if_info.cond_earliest = cond_earliest;
if_info.jump = jump;
if_info.then_else_reversed = then_else_reversed;
+ if_info.branch_cost = BRANCH_COST (optimize_bb_for_speed_p (test_bb),
+ predictable_edge_p (then_edge));
/* Do the real work. */
@@ -3597,7 +3604,9 @@ find_if_case_1 (basic_block test_bb, edge then_edge, edge else_edge)
test_bb->index, then_bb->index);
/* THEN is small. */
- if (! cheap_bb_rtx_cost_p (then_bb, COSTS_N_INSNS (BRANCH_COST)))
+ if (! cheap_bb_rtx_cost_p (then_bb,
+ COSTS_N_INSNS (BRANCH_COST (optimize_bb_for_speed_p (then_edge->src),
+ predictable_edge_p (then_edge)))))
return FALSE;
/* Registers set are dead, or are predicable. */
@@ -3711,7 +3720,9 @@ find_if_case_2 (basic_block test_bb, edge then_edge, edge else_edge)
test_bb->index, else_bb->index);
/* ELSE is small. */
- if (! cheap_bb_rtx_cost_p (else_bb, COSTS_N_INSNS (BRANCH_COST)))
+ if (! cheap_bb_rtx_cost_p (else_bb,
+ COSTS_N_INSNS (BRANCH_COST (optimize_bb_for_speed_p (else_edge->src),
+ predictable_edge_p (else_edge)))))
return FALSE;
/* Registers set are dead, or are predicable. */
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 505f17d101c..6c3572dd51e 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -132,6 +132,23 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic.h"
#include "tree-dump.h"
#include "tree-inline.h"
+#include "fibheap.h"
+#include "params.h"
+
+/* Number of functions identified as candidates for cloning. When not cloning
+ we can simplify iterate stage not forcing it to go through the decision
+ on what is profitable and what not. */
+static int n_cloning_candidates;
+
+/* Maximal count found in program. */
+static gcov_type max_count;
+
+/* Cgraph nodes that has been completely replaced by cloning during iterate
+ * stage and will be removed after ipcp is finished. */
+static bitmap dead_nodes;
+
+static void ipcp_print_profile_data (FILE *);
+static void ipcp_function_scale_print (FILE *);
/* Get the original node field of ipa_node_params associated with node NODE. */
static inline struct cgraph_node *
@@ -159,6 +176,46 @@ ipcp_init_cloned_node (struct cgraph_node *orig_node,
ipa_create_param_decls_array (new_node);
}
+/* Perform intraprocedrual analysis needed for ipcp. */
+static void
+ipcp_analyze_node (struct cgraph_node *node)
+{
+ /* Unreachable nodes should have been eliminated before ipcp. */
+ gcc_assert (node->needed || node->reachable);
+
+ ipa_count_formal_params (node);
+ ipa_create_param_decls_array (node);
+ ipa_detect_param_modifications (node);
+}
+
+/* Recompute all local information since node might've got new
+ direct calls after cloning. */
+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 ();
+
+ /* Indirect inlinng rely on fact that we've already analyzed
+ the body.. */
+ if (flag_indirect_inlining)
+ {
+ struct cgraph_edge *cs;
+
+ ipcp_analyze_node (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)
@@ -177,12 +234,20 @@ ipcp_set_node_scale (struct cgraph_node *node, gcov_type count)
static inline bool
ipcp_lat_is_const (struct ipcp_lattice *lat)
{
- if (lat->type == IPA_CONST_VALUE || lat->type == IPA_CONST_VALUE_REF)
+ if (lat->type == IPA_CONST_VALUE)
return true;
else
return false;
}
+/* Return whether LAT is a constant lattice that ipa-cp can actually insert
+ into the code (i.e. constants excluding member pointers and pointers). */
+static inline bool
+ipcp_lat_is_insertable (struct ipcp_lattice *lat)
+{
+ return lat->type == IPA_CONST_VALUE;
+}
+
/* Return true if LAT1 and LAT2 are equal. */
static inline bool
ipcp_lats_are_equal (struct ipcp_lattice *lat1, struct ipcp_lattice *lat2)
@@ -247,18 +312,11 @@ static void
ipcp_lattice_from_jfunc (struct ipa_node_params *info, struct ipcp_lattice *lat,
struct ipa_jump_func *jfunc)
{
- if (jfunc->type == IPA_UNKNOWN)
- lat->type = IPA_BOTTOM;
- else if (jfunc->type == IPA_CONST)
+ if (jfunc->type == IPA_CONST)
{
lat->type = IPA_CONST_VALUE;
lat->constant = jfunc->value.constant;
}
- else if (jfunc->type == IPA_CONST_REF)
- {
- lat->type = IPA_CONST_VALUE_REF;
- lat->constant = jfunc->value.constant;
- }
else if (jfunc->type == IPA_PASS_THROUGH)
{
struct ipcp_lattice *caller_lat;
@@ -267,17 +325,21 @@ ipcp_lattice_from_jfunc (struct ipa_node_params *info, struct ipcp_lattice *lat,
lat->type = caller_lat->type;
lat->constant = caller_lat->constant;
}
+ else
+ 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;
@@ -290,7 +352,7 @@ ipcp_print_all_lattices (FILE * f)
struct cgraph_node *node;
int i, count;
- fprintf (f, "\nLATTICE PRINT\n");
+ fprintf (f, "\nLattice:\n");
for (node = cgraph_nodes; node; node = node->next)
{
struct ipa_node_params *info;
@@ -298,26 +360,121 @@ ipcp_print_all_lattices (FILE * f)
if (!node->analyzed)
continue;
info = IPA_NODE_REF (node);
- fprintf (f, "Printing lattices %s:\n", cgraph_node_name (node));
+ fprintf (f, " Node: %s:\n", cgraph_node_name (node));
count = ipa_get_param_count (info);
for (i = 0; i < count; i++)
{
struct ipcp_lattice *lat = ipcp_get_ith_lattice (info, i);
- if (lat->type == IPA_CONST_VALUE || lat->type == IPA_CONST_VALUE_REF)
+
+ fprintf (f, " param [%d]: ", i);
+ if (lat->type == IPA_CONST_VALUE)
{
- fprintf (f, " param [%d]: ", i);
fprintf (f, "type is CONST ");
print_generic_expr (f, lat->constant, 0);
fprintf (f, "\n");
}
else if (lat->type == IPA_TOP)
- fprintf (f, "param [%d]: type is TOP \n", i);
+ fprintf (f, "type is TOP\n");
else
- fprintf (f, "param [%d]: type is BOTTOM \n", i);
+ fprintf (f, "type is BOTTOM\n");
}
}
}
+/* Return true if this NODE is viable candidate for cloning. */
+static bool
+ipcp_cloning_candidate_p (struct cgraph_node *node)
+{
+ int n_calls = 0;
+ int n_hot_calls = 0;
+ gcov_type direct_call_sum = 0;
+ struct cgraph_edge *e;
+
+ /* We never clone functions that are not visible from outside.
+ FIXME: in future we should clone such functions when they are called with
+ different constants, but current ipcp implementation is not good on this.
+ */
+ if (!node->needed || !node->analyzed)
+ return false;
+
+ if (cgraph_function_body_availability (node) <= AVAIL_OVERWRITABLE)
+ {
+ if (dump_file)
+ fprintf (dump_file, "Not considering %s for cloning; body is overwrittable.\n",
+ cgraph_node_name (node));
+ return false;
+ }
+ if (!tree_versionable_function_p (node->decl))
+ {
+ if (dump_file)
+ fprintf (dump_file, "Not considering %s for cloning; body is not versionable.\n",
+ cgraph_node_name (node));
+ return false;
+ }
+ for (e = node->callers; e; e = e->next_caller)
+ {
+ direct_call_sum += e->count;
+ n_calls ++;
+ if (cgraph_maybe_hot_edge_p (e))
+ n_hot_calls ++;
+ }
+
+ if (!n_calls)
+ {
+ if (dump_file)
+ fprintf (dump_file, "Not considering %s for cloning; no direct calls.\n",
+ cgraph_node_name (node));
+ return false;
+ }
+ if (node->local.inline_summary.self_insns < n_calls)
+ {
+ if (dump_file)
+ fprintf (dump_file, "Considering %s for cloning; code would shrink.\n",
+ cgraph_node_name (node));
+ return true;
+ }
+
+ if (!flag_ipa_cp_clone)
+ {
+ if (dump_file)
+ fprintf (dump_file, "Not considering %s for cloning; -fipa-cp-clone disabled.\n",
+ cgraph_node_name (node));
+ return false;
+ }
+
+ if (!optimize_function_for_speed_p (DECL_STRUCT_FUNCTION (node->decl)))
+ {
+ if (dump_file)
+ fprintf (dump_file, "Not considering %s for cloning; optimizing it for size.\n",
+ cgraph_node_name (node));
+ return false;
+ }
+
+ /* When profile is available and function is hot, propagate into it even if
+ calls seems cold; constant propagation can improve function's speed
+ significandly. */
+ if (max_count)
+ {
+ if (direct_call_sum > node->count * 90 / 100)
+ {
+ if (dump_file)
+ fprintf (dump_file, "Considering %s for cloning; usually called directly.\n",
+ cgraph_node_name (node));
+ return true;
+ }
+ }
+ if (!n_hot_calls)
+ {
+ if (dump_file)
+ fprintf (dump_file, "Not considering %s for cloning; no hot calls.\n",
+ cgraph_node_name (node));
+ }
+ if (dump_file)
+ fprintf (dump_file, "Considering %s for cloning.\n",
+ cgraph_node_name (node));
+ return true;
+}
+
/* Initialize ipcp_lattices array. The lattices corresponding to supported
types (integers, real types and Fortran constants defined as const_decls)
are initialized to IPA_TOP, the rest of them to IPA_BOTTOM. */
@@ -326,38 +483,24 @@ ipcp_initialize_node_lattices (struct cgraph_node *node)
{
int i;
struct ipa_node_params *info = IPA_NODE_REF (node);
+ enum ipa_lattice_type type;
info->ipcp_lattices = XCNEWVEC (struct ipcp_lattice,
ipa_get_param_count (info));
- for (i = 0; i < ipa_get_param_count (info) ; i++)
- {
- tree parm_tree = ipa_get_ith_param (info, i);
- struct ipcp_lattice *lat = ipcp_get_ith_lattice (info, i);
-
- if (INTEGRAL_TYPE_P (TREE_TYPE (parm_tree))
- || SCALAR_FLOAT_TYPE_P (TREE_TYPE (parm_tree))
- || POINTER_TYPE_P (TREE_TYPE (parm_tree)))
- lat->type = IPA_TOP;
- else
- lat->type = IPA_BOTTOM;
- }
-}
-
-/* Create a new assignment statement and make it the first statement in the
- function. PARM1 is the lhs of the assignment and VAL is the rhs. */
-static void
-constant_val_insert (tree parm1, tree val)
-{
- tree init_stmt = NULL;
- edge e_step;
-
- init_stmt = build_gimple_modify_stmt (parm1, val);
+
+ if (ipa_is_called_with_var_arguments (info))
+ type = IPA_BOTTOM;
+ else if (!node->needed)
+ type = IPA_TOP;
+ /* When cloning is allowed, we can assume that externally visible functions
+ are not called. We will compensate this by cloning later. */
+ else if (ipcp_cloning_candidate_p (node))
+ type = IPA_TOP, n_cloning_candidates ++;
+ else
+ type = IPA_BOTTOM;
- if (init_stmt)
- {
- e_step = single_succ_edge (ENTRY_BLOCK_PTR_FOR_FUNCTION (cfun));
- bsi_insert_on_edge_immediate (e_step, init_stmt);
- }
+ for (i = 0; i < ipa_get_param_count (info) ; i++)
+ ipcp_get_ith_lattice (info, i)->type = type;
}
/* build INTEGER_CST tree with type TREE_TYPE and value according to LAT.
@@ -365,26 +508,19 @@ constant_val_insert (tree parm1, tree val)
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;
-}
-
-/* Build the tree representing the constant and call constant_val_insert(). */
-static void
-ipcp_propagate_one_const (struct cgraph_node *node, int param,
- struct ipcp_lattice *lat)
-{
- tree const_val;
- tree parm_tree;
+ val = lat->constant;
- if (dump_file)
- fprintf (dump_file, "propagating const to %s\n", cgraph_node_name (node));
- parm_tree = ipa_get_ith_param (IPA_NODE_REF (node), param);
- const_val = build_const_val (lat, TREE_TYPE (parm_tree));
- constant_val_insert (parm_tree, const_val);
+ 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;
}
/* Compute the proper scale for NODE. It is the ratio between the number of
@@ -416,18 +552,8 @@ ipcp_init_stage (void)
struct cgraph_edge *cs;
for (node = cgraph_nodes; node; node = node->next)
- {
- if (!node->analyzed)
- continue;
- /* Unreachable nodes should have been eliminated before ipcp. */
- gcc_assert (node->needed || node->reachable);
-
- ipa_count_formal_params (node);
- ipa_create_param_decls_array (node);
- ipcp_initialize_node_lattices (node);
- ipa_detect_param_modifications (node);
- ipcp_compute_node_scale (node);
- }
+ if (node->analyzed)
+ ipcp_analyze_node (node);
for (node = cgraph_nodes; node; node = node->next)
{
if (!node->analyzed)
@@ -444,6 +570,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);
@@ -472,6 +600,13 @@ ipcp_change_tops_to_bottom (void)
if (lat->type == IPA_TOP)
{
prop_again = true;
+ if (dump_file)
+ {
+ fprintf (dump_file, "Forcing param ");
+ print_generic_expr (dump_file, ipa_get_ith_param (info, i), 0);
+ fprintf (dump_file, " of node %s to bottom.\n",
+ cgraph_node_name (node));
+ }
lat->type = IPA_BOTTOM;
}
}
@@ -495,6 +630,7 @@ ipcp_propagate_stage (void)
ipa_check_create_node_params ();
ipa_check_create_edge_args ();
+
/* Initialize worklist to contain all functions. */
wl = ipa_init_func_list ();
while (wl)
@@ -533,74 +669,47 @@ ipcp_propagate_stage (void)
static void
ipcp_iterate_stage (void)
{
+ struct cgraph_node *node;
+ n_cloning_candidates = 0;
+
+ if (dump_file)
+ fprintf (dump_file, "\nIPA iterate stage:\n\n");
+ for (node = cgraph_nodes; node; node = node->next)
+ {
+ ipcp_initialize_node_lattices (node);
+ ipcp_compute_node_scale (node);
+ }
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ ipcp_print_all_lattices (dump_file);
+ ipcp_function_scale_print (dump_file);
+ }
+
ipcp_propagate_stage ();
if (ipcp_change_tops_to_bottom ())
/* Some lattices have changed from IPA_TOP to IPA_BOTTOM.
This change should be propagated. */
- ipcp_propagate_stage ();
+ {
+ gcc_assert (n_cloning_candidates);
+ ipcp_propagate_stage ();
+ }
+ if (dump_file)
+ {
+ fprintf (dump_file, "\nIPA lattices after propagation:\n");
+ ipcp_print_all_lattices (dump_file);
+ if (dump_flags & TDF_DETAILS)
+ ipcp_print_profile_data (dump_file);
+ }
}
/* Check conditions to forbid constant insertion to function described by
NODE. */
static inline bool
-ipcp_node_not_modifiable_p (struct cgraph_node *node)
+ipcp_node_modifiable_p (struct cgraph_node *node)
{
- /* ??? Handle pending sizes case. */
- if (DECL_UNINLINABLE (node->decl))
- return true;
- return false;
-}
-
-/* Print ipa_jump_func data structures to F. */
-static void
-ipcp_print_all_jump_functions (FILE * f)
-{
- struct cgraph_node *node;
- int i, count;
- struct cgraph_edge *cs;
- struct ipa_jump_func *jump_func;
- enum jump_func_type type;
- tree info_type;
-
- fprintf (f, "\nCALLSITE PARAM PRINT\n");
- for (node = cgraph_nodes; node; node = node->next)
- {
- if (!node->analyzed)
- continue;
-
- for (cs = node->callees; cs; cs = cs->next_callee)
- {
- fprintf (f, "callsite %s ", cgraph_node_name (node));
- fprintf (f, "-> %s :: \n", cgraph_node_name (cs->callee));
-
- if (!ipa_edge_args_info_available_for_edge_p (cs)
- || ipa_is_called_with_var_arguments (IPA_NODE_REF (cs->callee)))
- continue;
-
- count = ipa_get_cs_argument_count (IPA_EDGE_REF (cs));
- for (i = 0; i < count; i++)
- {
- jump_func = ipa_get_ith_jump_func (IPA_EDGE_REF (cs), i);
- type = jump_func->type;
-
- fprintf (f, " param %d: ", i);
- if (type == IPA_UNKNOWN)
- fprintf (f, "UNKNOWN\n");
- else if (type == IPA_CONST || type == IPA_CONST_REF)
- {
- info_type = jump_func->value.constant;
- fprintf (f, "CONST : ");
- print_generic_expr (f, info_type, 0);
- fprintf (f, "\n");
- }
- else if (type == IPA_PASS_THROUGH)
- {
- fprintf (f, "PASS THROUGH : ");
- fprintf (f, "%d\n", jump_func->value.formal_id);
- }
- }
- }
- }
+ /* Once we will be able to do in-place replacement, we can be more
+ lax here. */
+ return tree_versionable_function_p (node->decl);
}
/* Print count scale data structures. */
@@ -664,7 +773,7 @@ ipcp_print_edge_profiles (FILE * f)
for (node = cgraph_nodes; node; node = node->next)
{
fprintf (f, "function %s: \n", cgraph_node_name (node));
- if (DECL_SAVED_TREE (node->decl))
+ if (node->analyzed)
{
bb =
ENTRY_BLOCK_PTR_FOR_FUNCTION (DECL_STRUCT_FUNCTION (node->decl));
@@ -744,17 +853,6 @@ ipcp_print_bb_profiles (FILE * f)
}
}
-/* Print all IPCP data structures to F. */
-static void
-ipcp_print_all_structures (FILE * f)
-{
- ipcp_print_all_lattices (f);
- ipcp_function_scale_print (f);
- ipa_print_all_tree_maps (f);
- ipa_print_all_params_modified (f);
- ipcp_print_all_jump_functions (f);
-}
-
/* Print profile info for all functions. */
static void
ipcp_print_profile_data (FILE * f)
@@ -774,34 +872,25 @@ ipcp_print_profile_data (FILE * f)
PARM_TREE is the formal parameter found to be constant. LAT represents the
constant. */
static struct ipa_replace_map *
-ipcp_create_replace_map (struct function *func, tree parm_tree,
- struct ipcp_lattice *lat)
+ipcp_create_replace_map (tree parm_tree, struct ipcp_lattice *lat)
{
struct ipa_replace_map *replace_map;
tree const_val;
replace_map = XCNEW (struct ipa_replace_map);
- gcc_assert (ipcp_lat_is_const (lat));
- if (lat->type != IPA_CONST_VALUE_REF
- && is_gimple_reg (parm_tree) && gimple_default_def (func, parm_tree)
- && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (gimple_default_def (func,
- parm_tree)))
- {
- if (dump_file)
- fprintf (dump_file, "replacing param with const\n");
- const_val = build_const_val (lat, TREE_TYPE (parm_tree));
- replace_map->old_tree =gimple_default_def (func, parm_tree);
- replace_map->new_tree = const_val;
- replace_map->replace_p = true;
- replace_map->ref_p = false;
- }
- else
+ const_val = build_const_val (lat, TREE_TYPE (parm_tree));
+ if (dump_file)
{
- replace_map->old_tree = NULL;
- replace_map->new_tree = NULL;
- replace_map->replace_p = false;
- replace_map->ref_p = false;
+ fprintf (dump_file, " replacing param ");
+ print_generic_expr (dump_file, parm_tree, 0);
+ fprintf (dump_file, " with const ");
+ print_generic_expr (dump_file, const_val, 0);
+ fprintf (dump_file, "\n");
}
+ replace_map->old_tree = parm_tree;
+ replace_map->new_tree = const_val;
+ replace_map->replace_p = true;
+ replace_map->ref_p = false;
return replace_map;
}
@@ -814,8 +903,17 @@ ipcp_need_redirect_p (struct cgraph_edge *cs)
struct ipa_node_params *orig_callee_info;
int i, count;
struct ipa_jump_func *jump_func;
+ struct cgraph_node *node = cs->callee, *orig;
+
+ if (!n_cloning_candidates)
+ return false;
- orig_callee_info = IPA_NODE_REF (ipcp_get_orig_node (cs->callee));
+ if ((orig = ipcp_get_orig_node (node)) != NULL)
+ node = orig;
+ if (ipcp_get_orig_node (cs->caller))
+ return false;
+
+ orig_callee_info = IPA_NODE_REF (node);
count = ipa_get_param_count (orig_callee_info);
for (i = 0; i < count; i++)
{
@@ -823,7 +921,7 @@ 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)
return true;
}
}
@@ -835,28 +933,59 @@ ipcp_need_redirect_p (struct cgraph_edge *cs)
static void
ipcp_update_callgraph (void)
{
- struct cgraph_node *node, *orig_callee;
- struct cgraph_edge *cs;
+ struct cgraph_node *node;
for (node = cgraph_nodes; node; node = node->next)
- {
- /* want to fix only original nodes */
- if (!node->analyzed || ipcp_node_is_clone (node))
- continue;
- for (cs = node->callees; cs; cs = cs->next_callee)
- if (ipcp_node_is_clone (cs->callee))
+ if (node->analyzed && ipcp_node_is_clone (node))
+ {
+ bitmap args_to_skip = BITMAP_ALLOC (NULL);
+ struct cgraph_node *orig_node = ipcp_get_orig_node (node);
+ struct ipa_node_params *info = IPA_NODE_REF (orig_node);
+ int i, count = ipa_get_param_count (info);
+ struct cgraph_edge *cs, *next;
+
+ for (i = 0; i < count; i++)
{
- /* Callee is a cloned node */
- orig_callee = ipcp_get_orig_node (cs->callee);
- if (ipcp_need_redirect_p (cs))
+ struct ipcp_lattice *lat = ipcp_get_ith_lattice (info, i);
+ tree parm_tree = ipa_get_ith_param (info, i);
+
+ /* We can proactively remove obviously unused arguments. */
+ if (is_gimple_reg (parm_tree)
+ && !gimple_default_def (DECL_STRUCT_FUNCTION (orig_node->decl),
+ parm_tree))
{
- cgraph_redirect_edge_callee (cs, orig_callee);
- TREE_OPERAND (CALL_EXPR_FN (get_call_expr_in (cs->call_stmt)),
- 0) =
- orig_callee->decl;
+ bitmap_set_bit (args_to_skip, i);
+ continue;
}
+
+ if (lat->type == IPA_CONST_VALUE)
+ bitmap_set_bit (args_to_skip, i);
}
- }
+ for (cs = node->callers; cs; cs = next)
+ {
+ next = cs->next_caller;
+ if (ipcp_node_is_clone (cs->caller) || !ipcp_need_redirect_p (cs))
+ {
+ gimple new_stmt;
+ gimple_stmt_iterator gsi;
+
+ current_function_decl = cs->caller->decl;
+ push_cfun (DECL_STRUCT_FUNCTION (cs->caller->decl));
+
+ new_stmt = giple_copy_call_skip_args (cs->call_stmt, args_to_skip);
+ gsi = gsi_for_stmt (cs->call_stmt);
+ gsi_replace (&gsi, new_stmt, true);
+ cgraph_set_call_stmt (cs, new_stmt);
+ pop_cfun ();
+ current_function_decl = NULL;
+ }
+ else
+ {
+ cgraph_redirect_edge_callee (cs, orig_node);
+ gimple_call_set_fndecl (cs->call_stmt, orig_node->decl);
+ }
+ }
+ }
}
/* Update all cfg basic blocks in NODE according to SCALE. */
@@ -913,55 +1042,195 @@ ipcp_update_profiling (void)
}
}
+/* Return true if original clone needs to be preserved. */
+static bool
+ipcp_need_original_clone_p (struct cgraph_node *node)
+{
+ struct cgraph_edge *e;
+
+ if (node->needed)
+ return true;
+ for (e = node->callers; e; e = e->next_caller)
+ if (!bitmap_bit_p (dead_nodes, e->caller->uid)
+ && ipcp_need_redirect_p (e))
+ return true;
+
+ return false;
+}
+
+/* Estimate cost of cloning NODE. */
+static long
+ipcp_estimate_cloning_cost (struct cgraph_node *node)
+{
+ int freq_sum = 1;
+ gcov_type count_sum = 1;
+ struct cgraph_edge *e;
+ int cost;
+
+ /* When we don't need original clone; we should always propagate. */
+ if (!ipcp_need_original_clone_p (node))
+ {
+ if (dump_file)
+ fprintf (dump_file, "Function %s can be fully propagated\n",
+ cgraph_node_name (node));
+ return 0;
+ }
+
+ for (e = node->callers; e; e = e->next_caller)
+ if (!bitmap_bit_p (dead_nodes, e->caller->uid)
+ && !ipcp_need_redirect_p (e))
+ {
+ count_sum += e->count;
+ freq_sum += e->frequency + 1;
+ }
+
+ cost = node->local.inline_summary.self_insns * 1000;
+ if (max_count)
+ cost /= count_sum * 1000 / max_count + 1;
+ else
+ cost /= freq_sum * 1000 / REG_BR_PROB_BASE + 1;
+ if (dump_file)
+ fprintf (dump_file, "Cost of versioning %s is %i, (size: %i, freq: %i)\n",
+ cgraph_node_name (node), cost, node->local.inline_summary.self_insns,
+ freq_sum);
+ return cost + 1;
+}
+
+/* Return number of live constant parameters. */
+static int
+ipcp_const_param_count (struct cgraph_node *node)
+{
+ int const_param = 0;
+ struct ipa_node_params *info = IPA_NODE_REF (node);
+ int count = ipa_get_param_count (info);
+ int i;
+
+ for (i = 0; i < count; i++)
+ {
+ struct ipcp_lattice *lat = ipcp_get_ith_lattice (info, i);
+ tree parm_tree = ipa_get_ith_param (info, i);
+ if (ipcp_lat_is_insertable (lat)
+ /* Do not count obviously unused arguments. */
+ && (!is_gimple_reg (parm_tree)
+ || gimple_default_def (DECL_STRUCT_FUNCTION (node->decl),
+ parm_tree)))
+ const_param++;
+ }
+ return const_param;
+}
+
/* Propagate the constant parameters found by ipcp_iterate_stage()
to the function's code. */
static void
ipcp_insert_stage (void)
{
struct cgraph_node *node, *node1 = NULL;
- int i, const_param;
+ int i;
VEC (cgraph_edge_p, heap) * redirect_callers;
varray_type replace_trees;
struct cgraph_edge *cs;
int node_callers, count;
tree parm_tree;
struct ipa_replace_map *replace_param;
+ fibheap_t heap;
+ long overall_insns = 0, new_insns = 0;
+ long max_new_insns;
ipa_check_create_node_params ();
ipa_check_create_edge_args ();
+ if (dump_file)
+ fprintf (dump_file, "\nIPA insert stage:\n\n");
+
+ dead_nodes = BITMAP_ALLOC (NULL);
for (node = cgraph_nodes; node; node = node->next)
+ if (node->analyzed)
+ {
+ if (node->count > max_count)
+ max_count = node->count;
+ overall_insns += node->local.inline_summary.self_insns;
+ }
+
+ max_new_insns = overall_insns;
+ if (max_new_insns < PARAM_VALUE (PARAM_LARGE_UNIT_INSNS))
+ max_new_insns = PARAM_VALUE (PARAM_LARGE_UNIT_INSNS);
+ max_new_insns = max_new_insns * PARAM_VALUE (PARAM_IPCP_UNIT_GROWTH) / 100 + 1;
+
+ /* First collect all functions we proved to have constant arguments to heap. */
+ heap = fibheap_new ();
+ for (node = cgraph_nodes; node; node = node->next)
{
struct ipa_node_params *info;
/* Propagation of the constant is forbidden in certain conditions. */
- if (!node->analyzed || ipcp_node_not_modifiable_p (node))
+ if (!node->analyzed || !ipcp_node_modifiable_p (node))
continue;
info = IPA_NODE_REF (node);
if (ipa_is_called_with_var_arguments (info))
continue;
- const_param = 0;
- count = ipa_get_param_count (info);
- for (i = 0; i < count; i++)
+ if (ipcp_const_param_count (node))
+ node->aux = fibheap_insert (heap, ipcp_estimate_cloning_cost (node), node);
+ }
+
+ /* Now clone in priority order until code size growth limits are met or
+ heap is emptied. */
+ while (!fibheap_empty (heap))
+ {
+ struct ipa_node_params *info;
+ int growth = 0;
+ bitmap args_to_skip;
+
+ node = (struct cgraph_node *)fibheap_extract_min (heap);
+ node->aux = NULL;
+ if (dump_file)
+ fprintf (dump_file, "considering function %s\n",
+ cgraph_node_name (node));
+
+ if (ipcp_need_original_clone_p (node))
+ growth = node->local.inline_summary.self_insns;
+ else
+ bitmap_set_bit (dead_nodes, node->uid);
+
+ if (new_insns + growth > max_new_insns)
+ break;
+ if (growth
+ && optimize_function_for_size_p (DECL_STRUCT_FUNCTION (node->decl)))
{
- struct ipcp_lattice *lat = ipcp_get_ith_lattice (info, i);
- if (ipcp_lat_is_const (lat))
- const_param++;
+ if (dump_file)
+ fprintf (dump_file, "Not versioning, cold code would grow");
+ continue;
}
- if (const_param == 0)
- continue;
- VARRAY_GENERIC_PTR_INIT (replace_trees, const_param, "replace_trees");
+
+ new_insns += growth;
+
+ info = IPA_NODE_REF (node);
+ count = ipa_get_param_count (info);
+
+ VARRAY_GENERIC_PTR_INIT (replace_trees, ipcp_const_param_count (node),
+ "replace_trees");
+ args_to_skip = BITMAP_ALLOC (NULL);
for (i = 0; i < count; i++)
{
struct ipcp_lattice *lat = ipcp_get_ith_lattice (info, i);
- if (ipcp_lat_is_const (lat))
+ parm_tree = ipa_get_ith_param (info, i);
+
+ /* We can proactively remove obviously unused arguments. */
+ if (is_gimple_reg (parm_tree)
+ && !gimple_default_def (DECL_STRUCT_FUNCTION (node->decl),
+ parm_tree))
+ {
+ bitmap_set_bit (args_to_skip, i);
+ continue;
+ }
+
+ if (lat->type == IPA_CONST_VALUE)
{
- parm_tree = ipa_get_ith_param (info, i);
replace_param =
- ipcp_create_replace_map (DECL_STRUCT_FUNCTION (node->decl),
- parm_tree, lat);
+ ipcp_create_replace_map (parm_tree, lat);
VARRAY_PUSH_GENERIC_PTR (replace_trees, replace_param);
+ bitmap_set_bit (args_to_skip, i);
}
}
+
/* Compute how many callers node has. */
node_callers = 0;
for (cs = node->callers; cs != NULL; cs = cs->next_caller)
@@ -969,50 +1238,48 @@ ipcp_insert_stage (void)
redirect_callers = VEC_alloc (cgraph_edge_p, heap, node_callers);
for (cs = node->callers; cs != NULL; cs = cs->next_caller)
VEC_quick_push (cgraph_edge_p, redirect_callers, cs);
+
/* Redirecting all the callers of the node to the
new versioned node. */
node1 =
- cgraph_function_versioning (node, redirect_callers, replace_trees);
+ cgraph_function_versioning (node, redirect_callers, replace_trees,
+ args_to_skip);
+ BITMAP_FREE (args_to_skip);
VEC_free (cgraph_edge_p, heap, redirect_callers);
VARRAY_CLEAR (replace_trees);
if (node1 == NULL)
continue;
if (dump_file)
- fprintf (dump_file, "versioned function %s\n",
- cgraph_node_name (node));
+ fprintf (dump_file, "versioned function %s with growth %i, overall %i\n",
+ cgraph_node_name (node), (int)growth, (int)new_insns);
ipcp_init_cloned_node (node, node1);
- if (const_param > 0)
- {
- push_cfun (DECL_STRUCT_FUNCTION (node1->decl));
- tree_register_cfg_hooks ();
- current_function_decl = node1->decl;
- for (i = 0; i < count; i++)
- {
- struct ipcp_lattice *lat = ipcp_get_ith_lattice (info, i);
- if (ipcp_lat_is_const (lat))
- {
- parm_tree = ipa_get_ith_param (info, i);
- if (lat->type != IPA_CONST_VALUE_REF
- && !is_gimple_reg (parm_tree))
- ipcp_propagate_one_const (node1, i, lat);
- }
- }
- if (gimple_in_ssa_p (cfun))
- {
- update_ssa (TODO_update_ssa);
-#ifdef ENABLE_CHECKING
- verify_ssa (true);
-#endif
- }
- free_dominance_info (CDI_DOMINATORS);
- 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);
+
+ for (cs = node->callees; cs; cs = cs->next_callee)
+ if (cs->callee->aux)
+ {
+ fibheap_delete_node (heap, (fibnode_t) cs->callee->aux);
+ cs->callee->aux = fibheap_insert (heap,
+ ipcp_estimate_cloning_cost (cs->callee),
+ cs->callee);
+ }
+ }
+
+ while (!fibheap_empty (heap))
+ {
+ if (dump_file)
+ fprintf (dump_file, "skipping function %s\n",
+ cgraph_node_name (node));
+ node = (struct cgraph_node *) fibheap_extract_min (heap);
+ node->aux = NULL;
}
+ fibheap_delete (heap);
+ BITMAP_FREE (dead_nodes);
ipcp_update_callgraph ();
ipcp_update_profiling ();
}
@@ -1021,31 +1288,19 @@ 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 ();
+ cgraph_remove_unreachable_nodes (true,dump_file);
if (dump_file)
{
fprintf (dump_file, "\nIPA structures before propagation:\n");
- ipcp_print_all_structures (dump_file);
+ if (dump_flags & TDF_DETAILS)
+ ipa_print_all_params (dump_file);
+ ipa_print_all_jump_functions (dump_file);
}
/* 2. Do the interprocedural propagation. */
ipcp_iterate_stage ();
- if (dump_file)
- {
- fprintf (dump_file, "\nIPA structures after propagation:\n");
- ipcp_print_all_structures (dump_file);
- fprintf (dump_file, "\nProfiling info before insert stage:\n");
- ipcp_print_profile_data (dump_file);
- }
/* 3. Insert the constants found to the functions. */
ipcp_insert_stage ();
- if (dump_file)
+ if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "\nProfiling info after insert stage:\n");
ipcp_print_profile_data (dump_file);
@@ -1054,10 +1309,23 @@ ipcp_driver (void)
free_all_ipa_structures_after_ipa_cp ();
if (dump_file)
fprintf (dump_file, "\nIPA constant propagation end\n");
- cgraph_remove_unreachable_nodes (true, NULL);
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 ();
+}
+
/* Gate for IPCP optimization. */
static bool
cgraph_gate_cp (void)
@@ -1065,10 +1333,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 */
@@ -1080,6 +1348,14 @@ struct simple_ipa_opt_pass pass_ipa_cp =
PROP_trees, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- TODO_dump_cgraph | TODO_dump_func /* todo_flags_finish */
- }
+ TODO_dump_cgraph | TODO_dump_func |
+ TODO_remove_functions /* 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 b7f1597691a..4c8096ae9b6 100644
--- a/gcc/ipa-inline.c
+++ b/gcc/ipa-inline.c
@@ -60,7 +60,7 @@ along with GCC; see the file COPYING3. If not see
cgraph_decide_inlining implements heuristics taking whole callgraph
into account, while cgraph_decide_inlining_incrementally considers
- only one function at a time and is used in non-unit-at-a-time mode.
+ only one function at a time and is used by early inliner.
The inliner itself is split into several passes:
@@ -82,15 +82,13 @@ along with GCC; see the file COPYING3. If not see
to do inlining expanding code size it might result in unbounded growth of
whole unit.
- This is the main inlining pass in non-unit-at-a-time.
-
- With unit-at-a-time the pass is run during conversion into SSA form.
- Only functions already converted into SSA form are inlined, so the
- conversion must happen in topological order on the callgraph (that is
- maintained by pass manager). The functions after inlining are early
- optimized so the early inliner sees unoptimized function itself, but
- all considered callees are already optimized allowing it to unfold
- abstraction penalty on C++ effectively and cheaply.
+ The pass is run during conversion into SSA form. Only functions already
+ converted into SSA form are inlined, so the conversion must happen in
+ topological order on the callgraph (that is maintained by pass manager).
+ The functions after inlining are early optimized so the early inliner sees
+ unoptimized function itself, but all considered callees are already
+ optimized allowing it to unfold abstraction penalty on C++ effectively and
+ cheaply.
pass_ipa_early_inlining
@@ -139,6 +137,7 @@ along with GCC; see the file COPYING3. If not see
#include "ggc.h"
#include "tree-flow.h"
#include "rtl.h"
+#include "ipa-prop.h"
/* Mode incremental inliner operate on:
@@ -149,16 +148,11 @@ along with GCC; see the file COPYING3. If not see
In SIZE mode, only functions that reduce function body size after inlining
are inlined, this is used during early inlining.
- In SPEED mode, all small functions are inlined. This might result in
- unbounded growth of compilation unit and is used only in non-unit-at-a-time
- mode.
-
in ALL mode, everything is inlined. This is used during flattening. */
enum inlining_mode {
INLINE_NONE = 0,
INLINE_ALWAYS_INLINE,
INLINE_SIZE,
- INLINE_SPEED,
INLINE_ALL
};
static bool
@@ -172,6 +166,9 @@ static int nfunctions_inlined;
static int overall_insns;
static gcov_type max_count;
+/* Holders of ipa cgraph hooks: */
+static struct cgraph_node_hook_list *function_insertion_hook_holder;
+
static inline struct inline_summary *
inline_summary (struct cgraph_node *node)
{
@@ -201,20 +198,21 @@ cgraph_estimate_size_after_inlining (int times, struct cgraph_node *to,
clones or re-using node originally representing out-of-line function call.
*/
void
-cgraph_clone_inlined_nodes (struct cgraph_edge *e, bool duplicate, bool update_original)
+cgraph_clone_inlined_nodes (struct cgraph_edge *e, bool duplicate,
+ bool update_original)
{
HOST_WIDE_INT peak;
+
if (duplicate)
{
/* We may eliminate the need for out-of-line copy to be output.
In that case just go ahead and re-use it. */
if (!e->callee->callers->next_caller
&& !e->callee->needed
- && !cgraph_new_nodes
- && flag_unit_at_a_time)
+ && !cgraph_new_nodes)
{
gcc_assert (!e->callee->global.inlined_to);
- if (DECL_SAVED_TREE (e->callee->decl))
+ if (gimple_body (e->callee->decl))
overall_insns -= e->callee->global.insns, nfunctions_inlined++;
duplicate = false;
}
@@ -261,7 +259,7 @@ cgraph_mark_inline_edge (struct cgraph_edge *e, bool update_original)
gcc_assert (e->inline_failed);
e->inline_failed = NULL;
- if (!e->callee->global.inlined && flag_unit_at_a_time)
+ if (!e->callee->global.inlined)
DECL_POSSIBLY_INLINED (e->callee->decl) = true;
e->callee->global.inlined = true;
@@ -296,7 +294,7 @@ cgraph_mark_inline (struct cgraph_edge *edge)
struct cgraph_node *what = edge->callee;
struct cgraph_edge *e, *next;
- gcc_assert (!CALL_STMT_CANNOT_INLINE_P (edge->call_stmt));
+ gcc_assert (!gimple_call_cannot_inline_p (edge->call_stmt));
/* Look for all calls, mark them inline and clone recursively
all inlined functions. */
for (e = what->callers; e; e = next)
@@ -320,18 +318,25 @@ cgraph_estimate_growth (struct cgraph_node *node)
{
int growth = 0;
struct cgraph_edge *e;
+ bool self_recursive = false;
+
if (node->global.estimated_growth != INT_MIN)
return node->global.estimated_growth;
for (e = node->callers; e; e = e->next_caller)
- if (e->inline_failed)
- growth += (cgraph_estimate_size_after_inlining (1, e->caller, node)
- - e->caller->global.insns);
+ {
+ if (e->caller == node)
+ self_recursive = true;
+ if (e->inline_failed)
+ growth += (cgraph_estimate_size_after_inlining (1, e->caller, node)
+ - e->caller->global.insns);
+ }
- /* ??? Wrong for self recursive functions or cases where we decide to not
- inline for different reasons, but it is not big deal as in that case
- we will keep the body around, but we will also avoid some inlining. */
- if (!node->needed && !DECL_EXTERNAL (node->decl))
+ /* ??? Wrong for non-trivially self recursive functions or cases where
+ we decide to not inline for different reasons, but it is not big deal
+ as in that case we will keep the body around, but we will also avoid
+ some inlining. */
+ if (!node->needed && !DECL_EXTERNAL (node->decl) && !self_recursive)
growth -= node->global.insns;
node->global.estimated_growth = growth;
@@ -470,26 +475,6 @@ cgraph_recursive_inlining_p (struct cgraph_node *to,
return recursive;
}
-/* Return true if the call can be hot. */
-static bool
-cgraph_maybe_hot_edge_p (struct cgraph_edge *edge)
-{
- if (profile_info && flag_branch_probabilities
- && (edge->count
- <= profile_info->sum_max / PARAM_VALUE (HOT_BB_COUNT_FRACTION)))
- return false;
- if (lookup_attribute ("cold", DECL_ATTRIBUTES (edge->callee->decl))
- || lookup_attribute ("cold", DECL_ATTRIBUTES (edge->caller->decl)))
- return false;
- if (lookup_attribute ("hot", DECL_ATTRIBUTES (edge->caller->decl)))
- return true;
- if (flag_guess_branch_prob
- && edge->frequency < (CGRAPH_FREQ_MAX
- / PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION)))
- return false;
- return true;
-}
-
/* A cost model driving the inlining heuristics in a way so the edges with
smallest badness are inlined first. After each inlining is performed
the costs of all caller edges of nodes affected are recomputed so the
@@ -660,10 +645,12 @@ lookup_recursive_calls (struct cgraph_node *node, struct cgraph_node *where,
}
/* Decide on recursive inlining: in the case function has recursive calls,
- inline until body size reaches given argument. */
+ inline until body size reaches given argument. If any new indirect edges
+ are discovered in the process, add them to NEW_EDGES, unless it is NULL. */
static bool
-cgraph_decide_recursive_inlining (struct cgraph_node *node)
+cgraph_decide_recursive_inlining (struct cgraph_node *node,
+ VEC (cgraph_edge_p, heap) *new_edges)
{
int limit = PARAM_VALUE (PARAM_MAX_INLINE_INSNS_RECURSIVE_AUTO);
int max_depth = PARAM_VALUE (PARAM_MAX_INLINE_RECURSIVE_DEPTH_AUTO);
@@ -674,7 +661,7 @@ cgraph_decide_recursive_inlining (struct cgraph_node *node)
int depth = 0;
int n = 0;
- if (optimize_size
+ if (optimize_function_for_size_p (DECL_STRUCT_FUNCTION (node->decl))
|| (!flag_inline_functions && !DECL_DECLARED_INLINE_P (node->decl)))
return false;
@@ -760,6 +747,8 @@ cgraph_decide_recursive_inlining (struct cgraph_node *node)
}
cgraph_redirect_edge_callee (curr, master_clone);
cgraph_mark_inline_edge (curr, false);
+ if (flag_indirect_inlining)
+ ipa_propagate_indirect_call_infos (curr, new_edges);
lookup_recursive_calls (node, curr->callee, heap);
n++;
}
@@ -817,6 +806,20 @@ compute_max_insns (int insns)
* (100 + PARAM_VALUE (PARAM_INLINE_UNIT_GROWTH)) / 100);
}
+/* Compute badness of all edges in NEW_EDGES and add them to the HEAP. */
+static void
+add_new_edges_to_heap (fibheap_t heap, VEC (cgraph_edge_p, heap) *new_edges)
+{
+ while (VEC_length (cgraph_edge_p, new_edges) > 0)
+ {
+ struct cgraph_edge *edge = VEC_pop (cgraph_edge_p, new_edges);
+
+ gcc_assert (!edge->aux);
+ edge->aux = fibheap_insert (heap, cgraph_edge_badness (edge), edge);
+ }
+}
+
+
/* We use greedy algorithm for inlining of small functions:
All inline candidates are put into prioritized heap based on estimated
growth of the overall number of instructions and then update the estimates.
@@ -833,6 +836,10 @@ cgraph_decide_inlining_of_small_functions (void)
fibheap_t heap = fibheap_new ();
bitmap updated_nodes = BITMAP_ALLOC (NULL);
int min_insns, max_insns;
+ VEC (cgraph_edge_p, heap) *new_indirect_edges = NULL;
+
+ if (flag_indirect_inlining)
+ new_indirect_edges = VEC_alloc (cgraph_edge_p, heap, 8);
if (dump_file)
fprintf (dump_file, "\nDeciding on smaller functions:\n");
@@ -906,8 +913,13 @@ cgraph_decide_inlining_of_small_functions (void)
is not good idea so prohibit the recursive inlining.
??? When the frequencies are taken into account we might not need this
- restriction. */
- if (!max_count)
+ restriction.
+
+ We need to be cureful here, in some testcases, e.g. directivec.c in
+ libcpp, we can estimate self recursive function to have negative growth
+ for inlining completely.
+ */
+ if (!edge->count)
{
where = edge->caller;
while (where->global.inlined_to)
@@ -931,7 +943,7 @@ cgraph_decide_inlining_of_small_functions (void)
if (!flag_inline_functions
&& !DECL_DECLARED_INLINE_P (edge->callee->decl))
not_good = N_("function not declared inline and code size would grow");
- if (optimize_size)
+ if (optimize_function_for_size_p (DECL_STRUCT_FUNCTION(edge->caller->decl)))
not_good = N_("optimizing for size and code size would grow");
if (not_good && growth > 0 && cgraph_estimate_growth (edge->callee) > 0)
{
@@ -956,7 +968,7 @@ cgraph_decide_inlining_of_small_functions (void)
}
if (!tree_can_inline_p (edge->caller->decl, edge->callee->decl))
{
- CALL_STMT_CANNOT_INLINE_P (edge->call_stmt) = true;
+ gimple_call_set_cannot_inline (edge->call_stmt, true);
edge->inline_failed = N_("target specific option mismatch");
if (dump_file)
fprintf (dump_file, " inline_failed:%s.\n", edge->inline_failed);
@@ -968,14 +980,16 @@ cgraph_decide_inlining_of_small_functions (void)
where = edge->caller;
if (where->global.inlined_to)
where = where->global.inlined_to;
- if (!cgraph_decide_recursive_inlining (where))
+ if (!cgraph_decide_recursive_inlining (where, new_indirect_edges))
continue;
+ if (flag_indirect_inlining)
+ add_new_edges_to_heap (heap, new_indirect_edges);
update_callee_keys (heap, where, updated_nodes);
}
else
{
struct cgraph_node *callee;
- if (CALL_STMT_CANNOT_INLINE_P (edge->call_stmt)
+ if (gimple_call_cannot_inline_p (edge->call_stmt)
|| !cgraph_check_inline_limits (edge->caller, edge->callee,
&edge->inline_failed, true))
{
@@ -986,6 +1000,11 @@ cgraph_decide_inlining_of_small_functions (void)
}
callee = edge->callee;
cgraph_mark_inline_edge (edge, true);
+ if (flag_indirect_inlining)
+ {
+ ipa_propagate_indirect_call_infos (edge, new_indirect_edges);
+ add_new_edges_to_heap (heap, new_indirect_edges);
+ }
update_callee_keys (heap, callee, updated_nodes);
}
where = edge->caller;
@@ -1028,6 +1047,9 @@ cgraph_decide_inlining_of_small_functions (void)
&edge->inline_failed))
edge->inline_failed = N_("--param inline-unit-growth limit reached");
}
+
+ if (new_indirect_edges)
+ VEC_free (cgraph_edge_p, heap, new_indirect_edges);
fibheap_delete (heap);
BITMAP_FREE (updated_nodes);
}
@@ -1046,6 +1068,8 @@ cgraph_decide_inlining (void)
int i;
int initial_insns = 0;
+ cgraph_remove_function_insertion_hook (function_insertion_hook_holder);
+
max_count = 0;
for (node = cgraph_nodes; node; node = node->next)
if (node->analyzed && (node->needed || node->reachable))
@@ -1101,17 +1125,19 @@ cgraph_decide_inlining (void)
for (e = node->callers; e; e = next)
{
next = e->next_caller;
- if (!e->inline_failed || CALL_STMT_CANNOT_INLINE_P (e->call_stmt))
+ if (!e->inline_failed || gimple_call_cannot_inline_p (e->call_stmt))
continue;
if (cgraph_recursive_inlining_p (e->caller, e->callee,
&e->inline_failed))
continue;
if (!tree_can_inline_p (e->caller->decl, e->callee->decl))
{
- CALL_STMT_CANNOT_INLINE_P (e->call_stmt) = true;
+ gimple_call_set_cannot_inline (e->call_stmt, true);
continue;
}
cgraph_mark_inline_edge (e, true);
+ if (flag_indirect_inlining)
+ ipa_propagate_indirect_call_infos (e, NULL);
if (dump_file)
fprintf (dump_file,
" Inlined into %s which now has %i insns.\n",
@@ -1130,25 +1156,31 @@ cgraph_decide_inlining (void)
overall_insns - old_insns);
}
- if (!flag_really_no_inline)
- cgraph_decide_inlining_of_small_functions ();
+ cgraph_decide_inlining_of_small_functions ();
- if (!flag_really_no_inline
- && flag_inline_functions_called_once)
+ /* After this point, any edge discovery performed by indirect inlining is no
+ good so let's give up. */
+ if (flag_indirect_inlining)
+ free_all_ipa_structures_after_iinln ();
+
+ if (flag_inline_functions_called_once)
{
if (dump_file)
fprintf (dump_file, "\nDeciding on functions called once:\n");
/* And finally decide what functions are called once. */
-
for (i = nnodes - 1; i >= 0; i--)
{
node = order[i];
- if (node->callers && !node->callers->next_caller && !node->needed
- && node->local.inlinable && node->callers->inline_failed
- && !CALL_STMT_CANNOT_INLINE_P (node->callers->call_stmt)
- && !DECL_EXTERNAL (node->decl) && !DECL_COMDAT (node->decl))
+ if (node->callers
+ && !node->callers->next_caller
+ && !node->needed
+ && node->local.inlinable
+ && node->callers->inline_failed
+ && !gimple_call_cannot_inline_p (node->callers->call_stmt)
+ && !DECL_EXTERNAL (node->decl)
+ && !DECL_COMDAT (node->decl))
{
if (dump_file)
{
@@ -1259,13 +1291,13 @@ try_inline (struct cgraph_edge *e, enum inlining_mode mode, int depth)
if (e->inline_failed)
cgraph_mark_inline (e);
- /* In order to fully inline always_inline functions at -O0, we need to
+ /* In order to fully inline always_inline functions, we need to
recurse here, since the inlined functions might not be processed by
incremental inlining at all yet.
Also flattening needs to be done recursively. */
- if (!flag_unit_at_a_time || mode == INLINE_ALL || always_inline)
+ if (mode == INLINE_ALL || always_inline)
cgraph_decide_inlining_incrementally (e->callee, mode, depth + 1);
callee->aux = (void *)(size_t) callee_mode;
return true;
@@ -1310,7 +1342,7 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node,
if (!e->callee->local.disregard_inline_limits
&& (mode != INLINE_ALL || !e->callee->local.inlinable))
continue;
- if (CALL_STMT_CANNOT_INLINE_P (e->call_stmt))
+ if (gimple_call_cannot_inline_p (e->call_stmt))
continue;
/* When the edge is already inlined, we just need to recurse into
it in order to fully flatten the leaves. */
@@ -1337,7 +1369,7 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node,
}
if (!tree_can_inline_p (node->decl, e->callee->decl))
{
- CALL_STMT_CANNOT_INLINE_P (e->call_stmt) = true;
+ gimple_call_set_cannot_inline (e->call_stmt, true);
if (dump_file)
{
indent_to (dump_file, depth);
@@ -1356,7 +1388,7 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node,
}
continue;
}
- if (!DECL_SAVED_TREE (e->callee->decl) && !e->callee->inline_decl)
+ if (!gimple_body (e->callee->decl) && !e->callee->inline_decl)
{
if (dump_file)
{
@@ -1370,8 +1402,7 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node,
}
/* Now do the automatic inlining. */
- if (!flag_really_no_inline && mode != INLINE_ALL
- && mode != INLINE_ALWAYS_INLINE)
+ if (mode != INLINE_ALL && mode != INLINE_ALWAYS_INLINE)
for (e = node->callees; e; e = e->next_callee)
{
if (!e->callee->local.inlinable
@@ -1423,7 +1454,7 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node,
}
if (!cgraph_check_inline_limits (node, e->callee, &e->inline_failed,
false)
- || CALL_STMT_CANNOT_INLINE_P (e->call_stmt))
+ || gimple_call_cannot_inline_p (e->call_stmt))
{
if (dump_file)
{
@@ -1432,7 +1463,7 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node,
}
continue;
}
- if (!DECL_SAVED_TREE (e->callee->decl) && !e->callee->inline_decl)
+ if (!gimple_body (e->callee->decl) && !e->callee->inline_decl)
{
if (dump_file)
{
@@ -1444,7 +1475,7 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node,
}
if (!tree_can_inline_p (node->decl, e->callee->decl))
{
- CALL_STMT_CANNOT_INLINE_P (e->call_stmt) = true;
+ gimple_call_set_cannot_inline (e->call_stmt, true);
if (dump_file)
{
indent_to (dump_file, depth);
@@ -1455,20 +1486,11 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node,
}
if (cgraph_default_inline_p (e->callee, &failed_reason))
inlined |= try_inline (e, mode, depth);
- else if (!flag_unit_at_a_time)
- e->inline_failed = failed_reason;
}
node->aux = (void *)(size_t) old_mode;
return inlined;
}
-/* When inlining shall be performed. */
-static bool
-cgraph_gate_inlining (void)
-{
- return flag_inline_trees;
-}
-
/* Because inlining might remove no-longer reachable nodes, we need to
keep the array visible to garbage collector to avoid reading collected
out nodes. */
@@ -1486,9 +1508,7 @@ cgraph_early_inlining (void)
if (sorrycount || errorcount)
return 0;
- if (cgraph_decide_inlining_incrementally (node,
- flag_unit_at_a_time || optimize_size
- ? INLINE_SIZE : INLINE_SPEED, 0))
+ if (cgraph_decide_inlining_incrementally (node, INLINE_SIZE, 0))
{
timevar_push (TV_INTEGRATION);
todo = optimize_inline_calls (current_function_decl);
@@ -1501,7 +1521,7 @@ cgraph_early_inlining (void)
static bool
cgraph_gate_early_inlining (void)
{
- return flag_inline_trees && flag_early_inlining;
+ return flag_early_inlining;
}
struct gimple_opt_pass pass_early_inline =
@@ -1527,7 +1547,7 @@ struct gimple_opt_pass pass_early_inline =
static bool
cgraph_gate_ipa_early_inlining (void)
{
- return (flag_inline_trees && flag_early_inlining
+ return (flag_early_inlining
&& (flag_branch_probabilities || flag_test_coverage
|| profile_arc_flag));
}
@@ -1564,13 +1584,11 @@ compute_inline_parameters (struct cgraph_node *node)
= inline_summary (node)->estimated_self_stack_size;
node->global.stack_frame_offset = 0;
node->local.inlinable = tree_inlinable_function_p (current_function_decl);
- inline_summary (node)->self_insns = estimate_num_insns (current_function_decl,
- &eni_inlining_weights);
+ inline_summary (node)->self_insns
+ = estimate_num_insns_fn (current_function_decl, &eni_inlining_weights);
if (node->local.inlinable && !node->local.disregard_inline_limits)
node->local.disregard_inline_limits
= DECL_DISREGARD_INLINE_LIMITS (current_function_decl);
- if (flag_really_no_inline && !node->local.disregard_inline_limits)
- node->local.inlinable = 0;
/* Inlining characteristics are maintained by the cgraph_mark_inline. */
node->global.insns = inline_summary (node)->self_insns;
return 0;
@@ -1586,19 +1604,12 @@ compute_inline_parameters_for_current (void)
return 0;
}
-/* When inlining shall be performed. */
-static bool
-gate_inline_passes (void)
-{
- return flag_inline_trees;
-}
-
struct gimple_opt_pass pass_inline_parameters =
{
{
GIMPLE_PASS,
NULL, /* name */
- gate_inline_passes, /* gate */
+ NULL, /* gate */
compute_inline_parameters_for_current,/* execute */
NULL, /* sub */
NULL, /* next */
@@ -1612,32 +1623,77 @@ struct gimple_opt_pass pass_inline_parameters =
}
};
+/* This function performs intraprocedural analyzis in NODE that is required to
+ inline indirect calls. */
+static void
+inline_indirect_intraprocedural_analysis (struct cgraph_node *node)
+{
+ struct cgraph_edge *cs;
+
+ 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 (!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_params (dump_file, node);
+ ipa_print_node_jump_functions (dump_file, node);
+ }
+}
+
+/* Note function body size. */
+static void
+analyze_function (struct cgraph_node *node)
+{
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
+ current_function_decl = node->decl;
+
+ compute_inline_parameters (node);
+ if (flag_indirect_inlining)
+ inline_indirect_intraprocedural_analysis (node);
+
+ current_function_decl = NULL;
+ pop_cfun ();
+}
+
+/* Called when new function is inserted to callgraph late. */
+static void
+add_new_function (struct cgraph_node *node, void *data ATTRIBUTE_UNUSED)
+{
+ analyze_function (node);
+}
+
/* Note function body size. */
static void
inline_generate_summary (void)
{
- struct cgraph_node **order =
- XCNEWVEC (struct cgraph_node *, cgraph_n_nodes);
- int nnodes = cgraph_postorder (order);
- int i;
+ struct cgraph_node *node;
- for (i = nnodes - 1; i >= 0; i--)
+ function_insertion_hook_holder =
+ cgraph_add_function_insertion_hook (&add_new_function, NULL);
+
+ if (flag_indirect_inlining)
{
- struct cgraph_node *node = order[i];
-
- /* Allow possibly removed nodes to be garbage collected. */
- order[i] = NULL;
- if (node->analyzed && (node->needed || node->reachable))
- {
- push_cfun (DECL_STRUCT_FUNCTION (node->decl));
- current_function_decl = node->decl;
- compute_inline_parameters (node);
- pop_cfun ();
- }
+ ipa_register_cgraph_hooks ();
+ ipa_check_create_node_params ();
+ ipa_check_create_edge_args ();
}
+
+ for (node = cgraph_nodes; node; node = node->next)
+ if (node->analyzed)
+ analyze_function (node);
- current_function_decl = NULL;
- free (order);
return;
}
@@ -1656,6 +1712,7 @@ inline_transform (struct cgraph_node *node)
for (e = node->callees; e; e = e->next_callee)
if (!e->inline_failed || warn_inline)
break;
+
if (e)
{
timevar_push (TV_INTEGRATION);
@@ -1670,7 +1727,7 @@ struct ipa_opt_pass pass_ipa_inline =
{
IPA_PASS,
"inline", /* name */
- cgraph_gate_inlining, /* gate */
+ NULL, /* gate */
cgraph_decide_inlining, /* execute */
NULL, /* sub */
NULL, /* next */
@@ -1693,62 +1750,4 @@ struct ipa_opt_pass pass_ipa_inline =
};
-/* When inlining shall be performed. */
-static bool
-cgraph_gate_O0_always_inline (void)
-{
- return !flag_unit_at_a_time || !flag_inline_trees;
-}
-
-static unsigned int
-cgraph_O0_always_inline (void)
-{
- struct cgraph_node *node = cgraph_node (current_function_decl);
- unsigned int todo = 0;
- bool inlined;
-
- if (sorrycount || errorcount)
- return 0;
- inlined = cgraph_decide_inlining_incrementally (node, INLINE_SPEED, 0);
- /* We might need the body of this function so that we can expand
- it inline somewhere else. */
- if (cgraph_preserve_function_body_p (current_function_decl))
- save_inline_function_body (node);
- if (inlined || warn_inline)
- {
- timevar_push (TV_INTEGRATION);
- todo = optimize_inline_calls (current_function_decl);
- timevar_pop (TV_INTEGRATION);
- }
- /* In non-unit-at-a-time we must mark all referenced functions as needed. */
- if (!flag_unit_at_a_time)
- {
- struct cgraph_edge *e;
- for (e = node->callees; e; e = e->next_callee)
- if (e->callee->analyzed)
- cgraph_mark_needed_node (e->callee);
- }
- return todo | execute_fixup_cfg ();
-}
-
-struct gimple_opt_pass pass_O0_always_inline =
-{
- {
- GIMPLE_PASS,
- "always_inline", /* name */
- cgraph_gate_O0_always_inline, /* gate */
- cgraph_O0_always_inline, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_INLINE_HEURISTICS, /* tv_id */
- 0, /* properties_required */
- PROP_cfg, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_dump_func | TODO_verify_flow
- | TODO_verify_stmts /* todo_flags_finish */
- }
-};
-
#include "gt-ipa-inline.h"
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index ff833d77f23..ffbf3adb668 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "timevar.h"
#include "flags.h"
+#include "diagnostic.h"
/* Vector where the parameter infos are actually stored. */
VEC (ipa_node_params_t, heap) *ipa_node_params_vector;
@@ -117,6 +118,9 @@ ipa_create_param_decls_array (struct cgraph_node *mt)
int param_num;
struct ipa_node_params *info = IPA_NODE_REF (mt);
+ if (info->param_decls)
+ return;
+
info->param_decls = XCNEWVEC (tree, ipa_get_param_count (info));
fndecl = mt->decl;
fnargs = DECL_ARGUMENTS (fndecl);
@@ -146,92 +150,81 @@ ipa_count_formal_params (struct cgraph_node *mt)
ipa_set_param_count (IPA_NODE_REF (mt), param_num);
}
-/* Check STMT to detect whether a formal is modified within MT, the appropriate
- entry is updated in the modified_flags array of ipa_node_params (associated
- with MT). */
+/* Check STMT to detect whether a formal parameter is directly modified within
+ STMT, the appropriate entry is updated in the modified flags of INFO.
+ Directly means that this function does not check for modifications through
+ pointers or escaping addresses because all TREE_ADDRESSABLE parameters are
+ considered modified anyway. */
static void
-ipa_check_stmt_modifications (struct cgraph_node *mt, tree stmt)
+ipa_check_stmt_modifications (struct ipa_node_params *info, gimple stmt)
{
- int index, j;
- tree parm_decl;
- struct ipa_node_params *info;
+ int j;
+ int index;
+ tree lhs;
- switch (TREE_CODE (stmt))
+ switch (gimple_code (stmt))
{
- case GIMPLE_MODIFY_STMT:
- if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == PARM_DECL)
- {
- info = IPA_NODE_REF (mt);
- parm_decl = GIMPLE_STMT_OPERAND (stmt, 0);
- index = ipa_get_param_decl_index (info, parm_decl);
- if (index >= 0)
- info->modified_flags[index] = true;
- }
+ case GIMPLE_ASSIGN:
+ lhs = gimple_assign_lhs (stmt);
+
+ while (handled_component_p (lhs))
+ lhs = TREE_OPERAND (lhs, 0);
+ if (TREE_CODE (lhs) == SSA_NAME)
+ lhs = SSA_NAME_VAR (lhs);
+ index = ipa_get_param_decl_index (info, lhs);
+ if (index >= 0)
+ info->param_flags[index].modified = true;
break;
- case ASM_EXPR:
+
+ case GIMPLE_ASM:
/* Asm code could modify any of the parameters. */
- info = IPA_NODE_REF (mt);
- for (j = 0; j < ipa_get_param_count (IPA_NODE_REF (mt)); j++)
- info->modified_flags[j] = true;
+ for (j = 0; j < ipa_get_param_count (info); j++)
+ info->param_flags[j].modified = true;
break;
+
default:
break;
}
}
-/* The modify computation driver for MT. Compute which formal arguments
- of function MT are locally modified. Formals may be modified in MT
- if their address is taken, or if
- they appear on the left hand side of an assignment. */
+/* Compute which formal parameters of function associated with NODE are locally
+ modified. Parameters may be modified in NODE if they are TREE_ADDRESSABLE,
+ if they appear on the left hand side of an assignment or if there is an
+ ASM_EXPR in the function. */
void
-ipa_detect_param_modifications (struct cgraph_node *mt)
+ipa_detect_param_modifications (struct cgraph_node *node)
{
- tree decl;
- tree body;
- int j, count;
+ tree decl = node->decl;
basic_block bb;
struct function *func;
- block_stmt_iterator bsi;
- tree stmt, parm_tree;
- struct ipa_node_params *info = IPA_NODE_REF (mt);
+ gimple_stmt_iterator gsi;
+ gimple stmt;
+ struct ipa_node_params *info = IPA_NODE_REF (node);
+ int i, count;
- if (ipa_get_param_count (info) == 0 || info->modified_flags)
+ if (ipa_get_param_count (info) == 0 || info->modification_analysis_done)
return;
- count = ipa_get_param_count (info);
- info->modified_flags = XCNEWVEC (bool, count);
- decl = mt->decl;
- /* ??? Handle pending sizes case. Set all parameters
- of the function to be modified. */
+ if (!info->param_flags)
+ info->param_flags = XCNEWVEC (struct ipa_param_flags,
+ ipa_get_param_count (info));
- if (DECL_UNINLINABLE (decl))
+ func = DECL_STRUCT_FUNCTION (decl);
+ FOR_EACH_BB_FN (bb, func)
{
- for (j = 0; j < count; j++)
- info->modified_flags[j] = true;
-
- return;
- }
- /* Formals whose address is taken are considered modified. */
- for (j = 0; j < count; j++)
- {
- parm_tree = ipa_get_ith_param (info, j);
- if (!is_gimple_reg (parm_tree)
- && TREE_ADDRESSABLE (parm_tree))
- info->modified_flags[j] = true;
- }
- body = DECL_SAVED_TREE (decl);
- if (body != NULL)
- {
- func = DECL_STRUCT_FUNCTION (decl);
- FOR_EACH_BB_FN (bb, func)
- {
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- {
- stmt = bsi_stmt (bsi);
- ipa_check_stmt_modifications (mt, stmt);
- }
- }
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ stmt = gsi_stmt (gsi);
+ ipa_check_stmt_modifications (info, stmt);
+ }
}
+
+ count = ipa_get_param_count (info);
+ for (i = 0; i < count; i++)
+ if (TREE_ADDRESSABLE (ipa_get_ith_param (info, i)))
+ info->param_flags[i].modified = true;
+
+ info->modification_analysis_done = 1;
}
/* Count number of arguments callsite CS has and store it in
@@ -239,100 +232,759 @@ ipa_detect_param_modifications (struct cgraph_node *mt)
void
ipa_count_arguments (struct cgraph_edge *cs)
{
- tree call_tree;
+ gimple stmt;
int arg_num;
- call_tree = get_call_expr_in (cs->call_stmt);
- gcc_assert (TREE_CODE (call_tree) == CALL_EXPR);
- arg_num = call_expr_nargs (call_tree);
+ 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);
}
-/* Compute jump function for all arguments of callsite CS
- and insert the information in the jump_functions array
- in the ipa_edge_args corresponding to this callsite. */
+/* The following function prints the jump functions of all arguments on all
+ call graph edges going from NODE to file F. */
void
-ipa_compute_jump_functions (struct cgraph_edge *cs)
+ipa_print_node_jump_functions (FILE *f, struct cgraph_node *node)
{
- tree call_tree;
- tree arg, cst_decl;
- int arg_num;
- struct cgraph_node *mt;
- tree parm_decl;
- struct function *curr_cfun;
- call_expr_arg_iterator iter;
- struct ipa_edge_args *args = IPA_EDGE_REF (cs);
+ int i, count;
+ struct cgraph_edge *cs;
+ struct ipa_jump_func *jump_func;
+ enum jump_func_type type;
- if (ipa_get_cs_argument_count (args) == 0 || args->jump_functions)
- return;
- args->jump_functions = XCNEWVEC (struct ipa_jump_func,
- ipa_get_cs_argument_count (args));
- call_tree = get_call_expr_in (cs->call_stmt);
- gcc_assert (TREE_CODE (call_tree) == CALL_EXPR);
- arg_num = 0;
+ fprintf (f, " Jump functions of caller %s:\n", cgraph_node_name (node));
+ for (cs = node->callees; cs; cs = cs->next_callee)
+ {
+ if (!ipa_edge_args_info_available_for_edge_p (cs))
+ continue;
+
+ fprintf (f, " callsite %s ", cgraph_node_name (node));
+ fprintf (f, "-> %s :: \n", cgraph_node_name (cs->callee));
+
+ count = ipa_get_cs_argument_count (IPA_EDGE_REF (cs));
+ for (i = 0; i < count; i++)
+ {
+ jump_func = ipa_get_ith_jump_func (IPA_EDGE_REF (cs), i);
+ type = jump_func->type;
+
+ fprintf (f, " param %d: ", i);
+ if (type == IPA_UNKNOWN)
+ fprintf (f, "UNKNOWN\n");
+ else if (type == IPA_CONST)
+ {
+ tree val = jump_func->value.constant;
+ fprintf (f, "CONST: ");
+ print_generic_expr (f, val, 0);
+ fprintf (f, "\n");
+ }
+ else if (type == IPA_CONST_MEMBER_PTR)
+ {
+ fprintf (f, "CONST MEMBER PTR: ");
+ print_generic_expr (f, jump_func->value.member_cst.pfn, 0);
+ fprintf (f, ", ");
+ print_generic_expr (f, jump_func->value.member_cst.delta, 0);
+ fprintf (f, "\n");
+ }
+ else if (type == IPA_PASS_THROUGH)
+ {
+ fprintf (f, "PASS THROUGH: ");
+ fprintf (f, "%d\n", jump_func->value.formal_id);
+ }
+ }
+ }
+}
- FOR_EACH_CALL_EXPR_ARG (arg, iter, call_tree)
+/* Print ipa_jump_func data structures of all nodes in the call graph to F. */
+void
+ipa_print_all_jump_functions (FILE *f)
+{
+ struct cgraph_node *node;
+
+ fprintf (f, "\nJump functions:\n");
+ for (node = cgraph_nodes; node; node = node->next)
{
- /* If the formal parameter was passed as argument, we store
- IPA_PASS_THROUGH and its index in the caller as the jump function
- of this argument. */
- if ((TREE_CODE (arg) == SSA_NAME
- && TREE_CODE (SSA_NAME_VAR (arg)) == PARM_DECL)
- || TREE_CODE (arg) == PARM_DECL)
+ ipa_print_node_jump_functions (f, node);
+ }
+}
+
+/* The following function determines the jump functions of scalar arguments.
+ Scalar means SSA names and constants of a number of selected types. INFO is
+ the ipa_node_params structure associated with the caller, FUNCTIONS is a
+ pointer to an array of jump function structures associated with CALL which
+ is the call statement being examined.*/
+static void
+compute_scalar_jump_functions (struct ipa_node_params *info,
+ struct ipa_jump_func *functions,
+ gimple call)
+{
+ tree arg;
+ unsigned num = 0;
+
+ for (num = 0; num < gimple_call_num_args (call); num++)
+ {
+ arg = gimple_call_arg (call, num);
+
+ if (is_gimple_ip_invariant (arg))
{
- struct ipa_node_params *info;
- int index;
-
- mt = cs->caller;
- info = IPA_NODE_REF (mt);
- parm_decl = TREE_CODE (arg) == PARM_DECL ? arg : SSA_NAME_VAR (arg);
-
- index = ipa_get_param_decl_index (info, parm_decl);
- if (TREE_CODE (arg) == SSA_NAME && IS_VALID_JUMP_FUNC_INDEX (index))
+ functions[num].type = IPA_CONST;
+ functions[num].value.constant = arg;
+ }
+ else if ((TREE_CODE (arg) == SSA_NAME) && SSA_NAME_IS_DEFAULT_DEF (arg))
+ {
+ int index = ipa_get_param_decl_index (info, SSA_NAME_VAR (arg));
+
+ if (index >= 0)
{
- curr_cfun = DECL_STRUCT_FUNCTION (mt->decl);
- if (!gimple_default_def (curr_cfun, parm_decl)
- || gimple_default_def (curr_cfun, parm_decl) != arg)
- info->modified_flags[index] = true;
+ functions[num].type = IPA_PASS_THROUGH;
+ functions[num].value.formal_id = index;
}
- if (!IS_VALID_JUMP_FUNC_INDEX (index) || info->modified_flags[index])
- args->jump_functions[arg_num].type = IPA_UNKNOWN;
- else
+ }
+ }
+}
+
+/* This function inspects the given TYPE and returns true iff it has the same
+ structure (the same number of fields of the same types) as a C++ member
+ pointer. If METHOD_PTR and DELTA are non-NULL, the trees representing the
+ corresponding fields are stored there. */
+static bool
+type_like_member_ptr_p (tree type, tree *method_ptr, tree *delta)
+{
+ tree fld;
+
+ if (TREE_CODE (type) != RECORD_TYPE)
+ return false;
+
+ fld = TYPE_FIELDS (type);
+ if (!fld || !POINTER_TYPE_P (TREE_TYPE (fld))
+ || TREE_CODE (TREE_TYPE (TREE_TYPE (fld))) != METHOD_TYPE)
+ return false;
+
+ if (method_ptr)
+ *method_ptr = fld;
+
+ fld = TREE_CHAIN (fld);
+ if (!fld || INTEGRAL_TYPE_P (fld))
+ return false;
+ if (delta)
+ *delta = fld;
+
+ if (TREE_CHAIN (fld))
+ return false;
+
+ return true;
+}
+
+/* This function goes through arguments of the CALL and for every one that
+ looks like a member pointer, it checks whether it can be safely declared
+ pass-through and if so, marks that to the corresponding item of jum
+ FUNCTIONS . It returns true iff there were non-pass-through member pointers
+ within the arguments. INFO describes formal parameters of the caller. */
+static bool
+compute_pass_through_member_ptrs (struct ipa_node_params *info,
+ struct ipa_jump_func *functions,
+ gimple call)
+{
+ bool undecided_members = false;
+ unsigned num;
+ tree arg;
+
+ for (num = 0; num < gimple_call_num_args (call); num++)
+ {
+ arg = gimple_call_arg (call, num);
+
+ if (type_like_member_ptr_p (TREE_TYPE (arg), NULL, NULL))
+ {
+ if (TREE_CODE (arg) == PARM_DECL)
{
- args->jump_functions[arg_num].type = IPA_PASS_THROUGH;
- args->jump_functions[arg_num].value.formal_id = index;
+ int index = ipa_get_param_decl_index (info, arg);
+
+ gcc_assert (index >=0);
+ if (!ipa_is_ith_param_modified (info, index))
+ {
+ functions[num].type = IPA_PASS_THROUGH;
+ functions[num].value.formal_id = index;
+ }
+ else
+ undecided_members = true;
}
+ else
+ undecided_members = true;
}
- /* If a constant value was passed as argument,
- we store IPA_CONST and its value as the jump function
- of this argument. */
- else if (TREE_CODE (arg) == INTEGER_CST
- || TREE_CODE (arg) == REAL_CST
- || TREE_CODE (arg) == FIXED_CST)
+ }
+
+ return undecided_members;
+}
+
+/* Simple function filling in a member pointer constant jump function (with PFN
+ and DELTA as the constant value) into JFUNC. */
+static void
+fill_member_ptr_cst_jump_function (struct ipa_jump_func *jfunc,
+ tree pfn, tree delta)
+{
+ jfunc->type = IPA_CONST_MEMBER_PTR;
+ jfunc->value.member_cst.pfn = pfn;
+ jfunc->value.member_cst.delta = delta;
+}
+
+/* Traverse statements from CALL backwards, scanning whether the argument ARG
+ which is a member pointer is filled in with constant values. If it is, fill
+ the jump function JFUNC in appropriately. METHOD_FIELD and DELTA_FIELD are
+ fields of the record type of the member pointer. To give an example, we
+ look for a pattern looking like the following:
+
+ D.2515.__pfn ={v} printStuff;
+ D.2515.__delta ={v} 0;
+ i_1 = doprinting (D.2515); */
+static void
+determine_cst_member_ptr (gimple call, tree arg, tree method_field,
+ tree delta_field, struct ipa_jump_func *jfunc)
+{
+ gimple_stmt_iterator gsi;
+ tree method = NULL_TREE;
+ tree delta = NULL_TREE;
+
+ gsi = gsi_for_stmt (call);
+
+ gsi_prev (&gsi);
+ for (; !gsi_end_p (gsi); gsi_prev (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
+ tree lhs, rhs, fld;
+
+ if (!is_gimple_assign (stmt) || gimple_num_ops (stmt) != 2)
+ return;
+
+ lhs = gimple_assign_lhs (stmt);
+ rhs = gimple_assign_rhs1 (stmt);
+
+ if (TREE_CODE (lhs) != COMPONENT_REF
+ || TREE_OPERAND (lhs, 0) != arg)
+ continue;
+
+ fld = TREE_OPERAND (lhs, 1);
+ if (!method && fld == method_field)
{
- args->jump_functions[arg_num].type = IPA_CONST;
- args->jump_functions[arg_num].value.constant = arg;
+ if (TREE_CODE (rhs) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (rhs, 0)) == FUNCTION_DECL
+ && TREE_CODE (TREE_TYPE (TREE_OPERAND (rhs, 0))) == METHOD_TYPE)
+ {
+ method = TREE_OPERAND (rhs, 0);
+ if (delta)
+ {
+ fill_member_ptr_cst_jump_function (jfunc, rhs, delta);
+ return;
+ }
+ }
+ else
+ return;
}
- /* This is for the case of Fortran. If the address of a const_decl
- was passed as argument then we store
- IPA_CONST_REF/IPA_CONST_REF and the constant
- value as the jump function corresponding to this argument. */
- else if (TREE_CODE (arg) == ADDR_EXPR
- && TREE_CODE (TREE_OPERAND (arg, 0)) == CONST_DECL)
+
+ if (!delta && fld == delta_field)
{
- cst_decl = TREE_OPERAND (arg, 0);
- if (TREE_CODE (DECL_INITIAL (cst_decl)) == INTEGER_CST
- || TREE_CODE (DECL_INITIAL (cst_decl)) == REAL_CST
- || TREE_CODE (DECL_INITIAL (cst_decl)) == FIXED_CST)
+ if (TREE_CODE (rhs) == INTEGER_CST)
{
- args->jump_functions[arg_num].type = IPA_CONST_REF;
- args->jump_functions[arg_num].value.constant = cst_decl;
+ delta = rhs;
+ if (method)
+ {
+ fill_member_ptr_cst_jump_function (jfunc, rhs, delta);
+ return;
+ }
}
+ else
+ return;
+ }
+ }
+
+ return;
+}
+
+/* Go through the arguments of the CALL and for every member pointer within
+ tries determine whether it is a constant. If it is, create a corresponding
+ constant jump function in FUNCTIONS which is an array of jump functions
+ associated with the call. */
+static void
+compute_cst_member_ptr_arguments (struct ipa_jump_func *functions,
+ gimple call)
+{
+ unsigned num;
+ tree arg, method_field, delta_field;
+
+ for (num = 0; num < gimple_call_num_args (call); num++)
+ {
+ arg = gimple_call_arg (call, num);
+
+ if (functions[num].type == IPA_UNKNOWN
+ && type_like_member_ptr_p (TREE_TYPE (arg), &method_field,
+ &delta_field))
+ determine_cst_member_ptr (call, arg, method_field, delta_field,
+ &functions[num]);
+ }
+}
+
+/* Compute jump function for all arguments of callsite CS and insert the
+ information in the jump_functions array in the ipa_edge_args corresponding
+ to this callsite. */
+void
+ipa_compute_jump_functions (struct cgraph_edge *cs)
+{
+ struct ipa_node_params *info = IPA_NODE_REF (cs->caller);
+ struct ipa_edge_args *arguments = IPA_EDGE_REF (cs);
+ gimple call;
+
+ if (ipa_get_cs_argument_count (arguments) == 0 || arguments->jump_functions)
+ return;
+ arguments->jump_functions = XCNEWVEC (struct ipa_jump_func,
+ ipa_get_cs_argument_count (arguments));
+
+ call = cs->call_stmt;
+ gcc_assert (is_gimple_call (call));
+
+ /* We will deal with constants and SSA scalars first: */
+ compute_scalar_jump_functions (info, arguments->jump_functions, call);
+
+ /* Let's check whether there are any potential member pointers and if so,
+ whether we can determine their functions as pass_through. */
+ if (!compute_pass_through_member_ptrs (info, arguments->jump_functions, call))
+ return;
+
+ /* Finally, let's check whether we actually pass a new constant membeer
+ pointer here... */
+ compute_cst_member_ptr_arguments (arguments->jump_functions, call);
+}
+
+/* If RHS looks like a rhs of a statement loading pfn from a member pointer
+ formal parameter, return the parameter, otherwise return NULL. */
+static tree
+ipa_get_member_ptr_load_param (tree rhs)
+{
+ tree rec, fld;
+ tree ptr_field;
+
+ if (TREE_CODE (rhs) != COMPONENT_REF)
+ return NULL_TREE;
+
+ rec = TREE_OPERAND (rhs, 0);
+ if (TREE_CODE (rec) != PARM_DECL
+ || !type_like_member_ptr_p (TREE_TYPE (rec), &ptr_field, NULL))
+ return NULL_TREE;
+
+ fld = TREE_OPERAND (rhs, 1);
+ if (fld == ptr_field)
+ return rec;
+ else
+ return NULL_TREE;
+}
+
+/* If STMT looks like a statement loading a value from a member pointer formal
+ parameter, this function retuns that parameter. */
+static tree
+ipa_get_stmt_member_ptr_load_param (gimple stmt)
+{
+ tree rhs;
+
+ if (!is_gimple_assign (stmt) || gimple_num_ops (stmt) != 2)
+ return NULL_TREE;
+
+ rhs = gimple_assign_rhs1 (stmt);
+ return ipa_get_member_ptr_load_param (rhs);
+}
+
+/* Returns true iff T is an SSA_NAME defined by a statement. */
+static bool
+ipa_is_ssa_with_stmt_def (tree t)
+{
+ if (TREE_CODE (t) == SSA_NAME
+ && !SSA_NAME_IS_DEFAULT_DEF (t))
+ return true;
+ else
+ return false;
+}
+
+/* Creates a new note describing a call to a parameter number FORMAL_ID and
+ attaches it to the linked list of INFO. It also sets the called flag of the
+ parameter. STMT is the corresponding call statement. */
+static void
+ipa_note_param_call (struct ipa_node_params *info, int formal_id,
+ gimple stmt)
+{
+ struct ipa_param_call_note *note;
+ basic_block bb = gimple_bb (stmt);
+
+ info->param_flags[formal_id].called = 1;
+
+ note = XCNEW (struct ipa_param_call_note);
+ note->formal_id = formal_id;
+ note->stmt = stmt;
+ note->count = bb->count;
+ note->frequency = compute_call_stmt_bb_frequency (bb);
+
+ note->next = info->param_calls;
+ info->param_calls = note;
+
+ return;
+}
+
+/* Analyze the CALL and examine uses of formal parameters of the caller
+ (described by INFO). Currently it checks whether the call calls a pointer
+ that is a formal parameter and if so, the parameter is marked with the
+ called flag and a note describing the call is created. This is very simple
+ for ordinary pointers represented in SSA but not-so-nice when it comes to
+ member pointers. The ugly part of this function does nothing more than
+ tries to match the pattern of such a call. An example of such a pattern is
+ the gimple dump below, the call is on the last line:
+
+ <bb 2>:
+ f$__delta_5 = f.__delta;
+ f$__pfn_24 = f.__pfn;
+ D.2496_3 = (int) f$__pfn_24;
+ D.2497_4 = D.2496_3 & 1;
+ if (D.2497_4 != 0)
+ goto <bb 3>;
+ else
+ goto <bb 4>;
+
+ <bb 3>:
+ D.2500_7 = (unsigned int) f$__delta_5;
+ D.2501_8 = &S + D.2500_7;
+ D.2502_9 = (int (*__vtbl_ptr_type) (void) * *) D.2501_8;
+ D.2503_10 = *D.2502_9;
+ D.2504_12 = f$__pfn_24 + -1;
+ D.2505_13 = (unsigned int) D.2504_12;
+ D.2506_14 = D.2503_10 + D.2505_13;
+ D.2507_15 = *D.2506_14;
+ iftmp.11_16 = (String:: *) D.2507_15;
+
+ <bb 4>:
+ # iftmp.11_1 = PHI <iftmp.11_16(3), f$__pfn_24(2)>
+ D.2500_19 = (unsigned int) f$__delta_5;
+ D.2508_20 = &S + D.2500_19;
+ D.2493_21 = iftmp.11_1 (D.2508_20, 4);
+
+ Such patterns are results of simple calls to a member pointer:
+
+ int doprinting (int (MyString::* f)(int) const)
+ {
+ MyString S ("somestring");
+
+ return (S.*f)(4);
+ }
+*/
+
+static void
+ipa_analyze_call_uses (struct ipa_node_params *info, gimple call)
+{
+ tree target = gimple_call_fn (call);
+ gimple def;
+ tree var;
+ tree n1, n2;
+ gimple d1, d2;
+ tree rec, rec2, cond;
+ gimple branch;
+ int index;
+ basic_block bb, virt_bb, join;
+
+ if (TREE_CODE (target) != SSA_NAME)
+ return;
+
+ var = SSA_NAME_VAR (target);
+ if (SSA_NAME_IS_DEFAULT_DEF (target))
+ {
+ /* assuming TREE_CODE (var) == PARM_DECL */
+ index = ipa_get_param_decl_index (info, var);
+ if (index >= 0)
+ ipa_note_param_call (info, index, call);
+ return;
+ }
+
+ /* Now we need to try to match the complex pattern of calling a member
+ pointer. */
+
+ if (!POINTER_TYPE_P (TREE_TYPE (target))
+ || TREE_CODE (TREE_TYPE (TREE_TYPE (target))) != METHOD_TYPE)
+ return;
+
+ def = SSA_NAME_DEF_STMT (target);
+ if (gimple_code (def) != GIMPLE_PHI)
+ return;
+
+ if (gimple_phi_num_args (def) != 2)
+ return;
+
+ /* First, we need to check whether one of these is a load from a member
+ pointer that is a parameter to this function. */
+ n1 = PHI_ARG_DEF (def, 0);
+ n2 = PHI_ARG_DEF (def, 1);
+ if (!ipa_is_ssa_with_stmt_def (n1) || !ipa_is_ssa_with_stmt_def (n2))
+ return;
+ d1 = SSA_NAME_DEF_STMT (n1);
+ d2 = SSA_NAME_DEF_STMT (n2);
+
+ if ((rec = ipa_get_stmt_member_ptr_load_param (d1)))
+ {
+ if (ipa_get_stmt_member_ptr_load_param (d2))
+ return;
+
+ bb = gimple_bb (d1);
+ virt_bb = gimple_bb (d2);
+ }
+ else if ((rec = ipa_get_stmt_member_ptr_load_param (d2)))
+ {
+ bb = gimple_bb (d2);
+ virt_bb = gimple_bb (d1);
+ }
+ else
+ return;
+
+ /* Second, we need to check that the basic blocks are laid out in the way
+ corresponding to the pattern. */
+
+ join = gimple_bb (def);
+ if (!single_pred_p (virt_bb) || !single_succ_p (virt_bb)
+ || single_pred (virt_bb) != bb
+ || single_succ (virt_bb) != join)
+ return;
+
+ /* Third, let's see that the branching is done depending on the least
+ significant bit of the pfn. */
+
+ branch = last_stmt (bb);
+ if (gimple_code (branch) != GIMPLE_COND)
+ return;
+
+ if (gimple_cond_code (branch) != NE_EXPR
+ || !integer_zerop (gimple_cond_rhs (branch)))
+ return;
+
+ cond = gimple_cond_lhs (branch);
+ if (!ipa_is_ssa_with_stmt_def (cond))
+ return;
+
+ def = SSA_NAME_DEF_STMT (cond);
+ if (!is_gimple_assign (def) || gimple_num_ops (def) != 3
+ || gimple_assign_rhs_code (def) != BIT_AND_EXPR
+ || !integer_onep (gimple_assign_rhs2 (def)))
+ return;
+
+ cond = gimple_assign_rhs1 (def);
+ if (!ipa_is_ssa_with_stmt_def (cond))
+ return;
+
+ def = SSA_NAME_DEF_STMT (cond);
+
+ if (is_gimple_assign (def) && gimple_num_ops (def) == 2
+ && gimple_assign_rhs_code (def) == NOP_EXPR)
+ {
+ cond = gimple_assign_rhs1 (def);
+ if (!ipa_is_ssa_with_stmt_def (cond))
+ return;
+ def = SSA_NAME_DEF_STMT (cond);
+ }
+
+ rec2 = ipa_get_stmt_member_ptr_load_param (def);
+ if (rec != rec2)
+ return;
+
+ index = ipa_get_param_decl_index (info, rec);
+ if (index >= 0 && !ipa_is_ith_param_modified (info, index))
+ ipa_note_param_call (info, index, call);
+
+ return;
+}
+
+/* Analyze the statement STMT with respect to formal parameters (described in
+ INFO) and their uses. Currently it only checks whether formal parameters
+ are called. */
+static void
+ipa_analyze_stmt_uses (struct ipa_node_params *info, gimple stmt)
+{
+ if (is_gimple_call (stmt))
+ ipa_analyze_call_uses (info, stmt);
+}
+
+/* Scan the function body of NODE and inspect the uses of formal parameters.
+ Store the findings in various structures of the associated ipa_node_params
+ structure, such as parameter flags, notes etc. */
+void
+ipa_analyze_params_uses (struct cgraph_node *node)
+{
+ tree decl = node->decl;
+ basic_block bb;
+ struct function *func;
+ gimple_stmt_iterator gsi;
+ struct ipa_node_params *info = IPA_NODE_REF (node);
+
+ if (ipa_get_param_count (info) == 0 || info->uses_analysis_done)
+ return;
+ if (!info->param_flags)
+ info->param_flags = XCNEWVEC (struct ipa_param_flags,
+ ipa_get_param_count (info));
+
+ func = DECL_STRUCT_FUNCTION (decl);
+ FOR_EACH_BB_FN (bb, func)
+ {
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
+ ipa_analyze_stmt_uses (info, stmt);
+ }
+ }
+
+ info->uses_analysis_done = 1;
+}
+
+/* Update the jump functions assocated with call graph edge E when the call
+ graph edge CS is being inlined, assuming that E->caller is already (possibly
+ indirectly) inlined into CS->callee and that E has not been inlined. */
+static void
+update_jump_functions_after_inlining (struct cgraph_edge *cs,
+ struct cgraph_edge *e)
+{
+ struct ipa_edge_args *top = IPA_EDGE_REF (cs);
+ struct ipa_edge_args *args = IPA_EDGE_REF (e);
+ int count = ipa_get_cs_argument_count (args);
+ int i;
+
+ for (i = 0; i < count; i++)
+ {
+ struct ipa_jump_func *src, *dst = ipa_get_ith_jump_func (args, i);
+
+ if (dst->type != IPA_PASS_THROUGH)
+ continue;
+
+ /* We must check range due to calls with variable number of arguments: */
+ if (dst->value.formal_id >= (unsigned) ipa_get_cs_argument_count (top))
+ {
+ dst->type = IPA_BOTTOM;
+ continue;
}
- else
- args->jump_functions[arg_num].type = IPA_UNKNOWN;
- arg_num++;
+
+ src = ipa_get_ith_jump_func (top, dst->value.formal_id);
+ *dst = *src;
+ }
+}
+
+/* Print out a debug message to file F that we have discovered that an indirect
+ call descibed by NT is in fact a call of a known constant function descibed
+ by JFUNC. NODE is the node where the call is. */
+static void
+print_edge_addition_message (FILE *f, struct ipa_param_call_note *nt,
+ struct ipa_jump_func *jfunc,
+ struct cgraph_node *node)
+{
+ fprintf (f, "ipa-prop: Discovered an indirect call to a known target (");
+ if (jfunc->type == IPA_CONST_MEMBER_PTR)
+ {
+ print_node_brief (f, "", jfunc->value.member_cst.pfn, 0);
+ print_node_brief (f, ", ", jfunc->value.member_cst.delta, 0);
}
+ else
+ print_node_brief(f, "", jfunc->value.constant, 0);
+
+ fprintf (f, ") in %s: ", cgraph_node_name (node));
+ print_gimple_stmt (f, nt->stmt, 2, TDF_SLIM);
+}
+
+/* Update the param called notes associated with NODE when CS is being inlined,
+ assuming NODE is (potentially indirectly) inlined into CS->callee.
+ Moreover, if the callee is discovered to be constant, create a new cgraph
+ edge for it. Newly discovered indirect edges will be added to NEW_EDGES,
+ unless it is NULL. */
+static void
+update_call_notes_after_inlining (struct cgraph_edge *cs,
+ struct cgraph_node *node,
+ VEC (cgraph_edge_p, heap) *new_edges)
+{
+ struct ipa_node_params *info = IPA_NODE_REF (node);
+ struct ipa_edge_args *top = IPA_EDGE_REF (cs);
+ struct ipa_param_call_note *nt;
+
+ for (nt = info->param_calls; nt; nt = nt->next)
+ {
+ struct ipa_jump_func *jfunc;
+
+ if (nt->processed)
+ continue;
+
+ /* We must check range due to calls with variable number of arguments: */
+ if (nt->formal_id >= (unsigned) ipa_get_cs_argument_count (top))
+ {
+ nt->processed = true;
+ continue;
+ }
+
+ jfunc = ipa_get_ith_jump_func (top, nt->formal_id);
+ if (jfunc->type == IPA_PASS_THROUGH)
+ nt->formal_id = jfunc->value.formal_id;
+ else if (jfunc->type == IPA_CONST || jfunc->type == IPA_CONST_MEMBER_PTR)
+ {
+ struct cgraph_node *callee;
+ struct cgraph_edge *new_indirect_edge;
+ tree decl;
+
+ nt->processed = true;
+ if (jfunc->type == IPA_CONST_MEMBER_PTR)
+ decl = jfunc->value.member_cst.pfn;
+ else
+ decl = jfunc->value.constant;
+
+ if (TREE_CODE (decl) != ADDR_EXPR)
+ continue;
+ decl = TREE_OPERAND (decl, 0);
+
+ if (TREE_CODE (decl) != FUNCTION_DECL)
+ continue;
+ callee = cgraph_node (decl);
+ if (!callee || !callee->local.inlinable)
+ continue;
+
+ if (dump_file)
+ print_edge_addition_message (dump_file, nt, jfunc, node);
+
+ new_indirect_edge = cgraph_create_edge (node, callee, nt->stmt,
+ nt->count, nt->frequency,
+ nt->loop_nest);
+ new_indirect_edge->indirect_call = 1;
+ ipa_check_create_edge_args ();
+ if (new_edges)
+ VEC_safe_push (cgraph_edge_p, heap, new_edges, new_indirect_edge);
+ }
+ }
+}
+
+/* Recursively traverse subtree of NODE (including node) made of inlined
+ cgraph_edges when CS has been inlined and invoke
+ update_call_notes_after_inlining on all nodes and
+ update_jump_functions_after_inlining on all non-inlined edges that lead out
+ of this subtree. Newly discovered indirect edges will be added to
+ NEW_EDGES, unless it is NULL. */
+static void
+propagate_info_to_inlined_callees (struct cgraph_edge *cs,
+ struct cgraph_node *node,
+ VEC (cgraph_edge_p, heap) *new_edges)
+{
+ struct cgraph_edge *e;
+
+ update_call_notes_after_inlining (cs, node, new_edges);
+
+ for (e = node->callees; e; e = e->next_callee)
+ if (!e->inline_failed)
+ propagate_info_to_inlined_callees (cs, e->callee, new_edges);
+ else
+ update_jump_functions_after_inlining (cs, e);
+}
+
+/* Update jump functions and call note functions on inlining the call site CS.
+ CS is expected to lead to a node already cloned by
+ cgraph_clone_inline_nodes. Newly discovered indirect edges will be added to
+ NEW_EDGES, unless it is NULL. */
+void
+ipa_propagate_indirect_call_infos (struct cgraph_edge *cs,
+ VEC (cgraph_edge_p, heap) *new_edges)
+{
+ propagate_info_to_inlined_callees (cs, cs->callee, new_edges);
}
/* Frees all dynamically allocated structures that the argument info points
@@ -371,8 +1023,15 @@ ipa_free_node_params_substructures (struct ipa_node_params *info)
free (info->ipcp_lattices);
if (info->param_decls)
free (info->param_decls);
- if (info->modified_flags)
- free (info->modified_flags);
+ if (info->param_flags)
+ free (info->param_flags);
+
+ while (info->param_calls)
+ {
+ struct ipa_param_call_note *note = info->param_calls;
+ info->param_calls = note->next;
+ free (note);
+ }
memset (info, 0, sizeof (*info));
}
@@ -398,6 +1057,10 @@ static void
ipa_edge_removal_hook (struct cgraph_edge *cs,
void *data __attribute__ ((unused)))
{
+ /* During IPA-CP updating we can be called on not-yet analyze clones. */
+ if (VEC_length (ipa_edge_args_t, ipa_edge_args_vector)
+ <= (unsigned)cs->uid)
+ return;
ipa_free_edge_args_substructures (IPA_EDGE_REF (cs));
}
@@ -451,6 +1114,7 @@ ipa_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
void *data)
{
struct ipa_node_params *old_info, *new_info;
+ struct ipa_param_call_note *note;
int param_count;
ipa_check_create_node_params ();
@@ -464,12 +1128,24 @@ ipa_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst,
sizeof (struct ipcp_lattice) * param_count);
new_info->param_decls = (tree *)
duplicate_array (old_info->param_decls, sizeof (tree) * param_count);
- new_info->modified_flags = (bool *)
- duplicate_array (old_info->modified_flags, sizeof (bool) * param_count);
+ new_info->param_flags = (struct ipa_param_flags *)
+ duplicate_array (old_info->param_flags,
+ sizeof (struct ipa_param_flags) * param_count);
new_info->ipcp_orig_node = old_info->ipcp_orig_node;
new_info->count_scale = old_info->count_scale;
+ for (note = old_info->param_calls; note; note = note->next)
+ {
+ struct ipa_param_call_note *nn;
+
+ nn = (struct ipa_param_call_note *)
+ xcalloc (1, sizeof (struct ipa_param_call_note));
+ memcpy (nn, note, sizeof (struct ipa_param_call_note));
+ nn->next = new_info->param_calls;
+ new_info->param_calls = nn;
+ }
+
data = data; /* Suppressing compiler warning. */
}
@@ -510,6 +1186,19 @@ ipa_unregister_cgraph_hooks (void)
void
free_all_ipa_structures_after_ipa_cp (void)
{
+ if (!flag_indirect_inlining)
+ {
+ ipa_free_all_edge_args ();
+ ipa_free_all_node_params ();
+ ipa_unregister_cgraph_hooks ();
+ }
+}
+
+/* Free all ipa_node_params and all ipa_edge_args structures if they are no
+ longer needed after indirect inlining. */
+void
+free_all_ipa_structures_after_iinln (void)
+{
ipa_free_all_edge_args ();
ipa_free_all_node_params ();
ipa_unregister_cgraph_hooks ();
@@ -518,60 +1207,39 @@ free_all_ipa_structures_after_ipa_cp (void)
/* Print ipa_tree_map data structures of all functions in the
callgraph to F. */
void
-ipa_print_all_tree_maps (FILE * f)
+ipa_print_node_params (FILE * f, struct cgraph_node *node)
{
int i, count;
tree temp;
- struct cgraph_node *node;
+ struct ipa_node_params *info;
- fprintf (f, "\nPARAM TREE MAP PRINT\n");
- for (node = cgraph_nodes; node; node = node->next)
+ if (!node->analyzed)
+ return;
+ info = IPA_NODE_REF (node);
+ fprintf (f, " function %s Trees :: \n", cgraph_node_name (node));
+ count = ipa_get_param_count (info);
+ for (i = 0; i < count; i++)
{
- struct ipa_node_params *info;
-
- if (!node->analyzed)
- continue;
- info = IPA_NODE_REF (node);
- fprintf (f, "function %s Trees :: \n", cgraph_node_name (node));
- count = ipa_get_param_count (info);
- for (i = 0; i < count; i++)
- {
- temp = ipa_get_ith_param (info, i);
- if (TREE_CODE (temp) == PARM_DECL)
- fprintf (f, " param [%d] : %s\n", i,
- (*lang_hooks.decl_printable_name) (temp, 2));
- }
-
+ temp = ipa_get_ith_param (info, i);
+ if (TREE_CODE (temp) == PARM_DECL)
+ fprintf (f, " param %d : %s", i,
+ (*lang_hooks.decl_printable_name) (temp, 2));
+ if (ipa_is_ith_param_modified (info, i))
+ fprintf (f, " modified");
+ if (ipa_is_ith_param_called (info, i))
+ fprintf (f, " called");
+ fprintf (f, "\n");
}
}
-/* Print modified_flags data structures of all functions in the
+/* Print ipa_tree_map data structures of all functions in the
callgraph to F. */
void
-ipa_print_all_params_modified (FILE * f)
+ipa_print_all_params (FILE * f)
{
- int i, count;
- bool temp;
struct cgraph_node *node;
- fprintf (f, "\nMODIFY PRINT\n");
+ fprintf (f, "\nFunction parameters:\n");
for (node = cgraph_nodes; node; node = node->next)
- {
- struct ipa_node_params *info;
-
- if (!node->analyzed)
- continue;
- info = IPA_NODE_REF (node);
- fprintf (f, "function %s :: \n", cgraph_node_name (node));
- count = ipa_get_param_count (info);
- for (i = 0; i < count; i++)
- {
- temp = info->modified_flags[i];
- if (temp)
- fprintf (f, " param [%d] true \n", i);
- else
- fprintf (f, " param [%d] false \n", i);
- }
- }
+ ipa_print_node_params (f, node);
}
-
diff --git a/gcc/ipa-prop.h b/gcc/ipa-prop.h
index 2dd83326018..80b591bc2f8 100644
--- a/gcc/ipa-prop.h
+++ b/gcc/ipa-prop.h
@@ -22,6 +22,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "vec.h"
+#include "cgraph.h"
/* The following definitions and interfaces are used by
interprocedural analyses. */
@@ -31,42 +32,50 @@ along with GCC; see the file COPYING3. If not see
Formal - the caller's formal parameter is passed as an actual argument.
Constant - a constant is passed as an actual argument.
Unknown - neither of the above.
- Integer and real constants are represented as IPA_CONST and Fortran
- constants are represented as IPA_CONST_REF. */
+ Integer and real constants are represented as IPA_CONST.
+ Finally, IPA_CONST_MEMBER_PTR stands for C++ member pointers constants. */
enum jump_func_type
{
- IPA_UNKNOWN,
+ IPA_UNKNOWN = 0, /* newly allocated and zeroed jump functions default */
IPA_CONST,
- IPA_CONST_REF,
+ IPA_CONST_MEMBER_PTR,
IPA_PASS_THROUGH
};
/* All formal parameters in the program have a lattice associated with it
computed by the interprocedural stage of IPCP.
There are three main values of the lattice:
- TOP - unknown.
- BOTTOM - non constant.
- CONSTANT_TYPE - constant value.
+ IPA_TOP - unknown,
+ IPA_BOTTOM - non constant,
+ IPA_CONST_VALUE - simple scalar constant,
Cval of formal f will have a constant value if all callsites to this
function have the same constant value passed to f.
- Integer and real constants are represented as IPA_CONST and Fortran
- constants are represented as IPA_CONST_REF. */
+ Integer and real constants are represented as IPA_CONST. */
enum ipa_lattice_type
{
IPA_BOTTOM,
IPA_CONST_VALUE,
- IPA_CONST_VALUE_REF,
IPA_TOP
};
-/* Represents a value of a jump function.
- value represents a constant.
- formal_id is used only in jump function context and represents
- pass-through parameter (the formal of caller is passed as argument). */
+/* Structure holding a C++ member pointer constant. Holds a pointer to the
+ method and delta offset. */
+struct ipa_member_ptr_cst
+{
+ tree pfn;
+ tree delta;
+};
+
+/* Represents a value of a jump function. formal_id is used only in jump
+ function context and represents pass-through parameter (the formal parameter
+ of the caller is passed as argument). constant represents the actual
+ constant in constant jump functions and member_cst holds constant c++ member
+ functions. */
union jump_func_value
{
unsigned int formal_id;
tree constant;
+ struct ipa_member_ptr_cst member_cst;
};
/* A jump function for a callsite represents the values passed as actual
@@ -101,10 +110,43 @@ struct ipa_replace_map
bool ref_p;
};
+/* ipa_param_flags contains various flags that describe how the associated
+ parameter is treated within a function. */
+struct ipa_param_flags
+{
+ /* Whether the value parameter has been modified within the function. */
+ unsigned modified : 1;
+ /* Whether the parameter has been used as a call destination. */
+ unsigned called : 1;
+};
+
+/* Each instance of the following structure describes a statement that calls a
+ function parameter. Those referring to statements within the same function
+ are linked in a list. */
+struct ipa_param_call_note
+{
+ /* Linked list's next */
+ struct ipa_param_call_note *next;
+ /* Statement that contains the call to the parameter above. */
+ gimple stmt;
+ /* Index of the parameter that is called. */
+ unsigned int formal_id;
+ /* Expected number of executions: calculated in profile.c. */
+ gcov_type count;
+ /* Expected frequency of executions within the function. see cgraph_edge in
+ cgraph.h for more on this. */
+ int frequency;
+ /* Depth of loop nest, 1 means no loop nest. */
+ int loop_nest;
+ /* Set when we have already found the target to be a compile time constant
+ and turned this into an edge or when the note was found unusable for some
+ reason. */
+ bool processed;
+};
+
/* ipa_node_params stores information related to formal parameters of functions
and some other information for interprocedural passes that operate on
parameters (such as ipa-cp). */
-
struct ipa_node_params
{
/* Number of formal parameters of this function. When set to 0,
@@ -115,8 +157,10 @@ struct ipa_node_params
struct ipcp_lattice *ipcp_lattices;
/* Mapping each parameter to its PARM_DECL tree. */
tree *param_decls;
- /* Indicating which parameter is modified in its function. */
- bool *modified_flags;
+ /* Various flags describing individual parameters. */
+ struct ipa_param_flags *param_flags;
+ /* List of structures enumerating calls to a formal parameter. */
+ struct ipa_param_call_note *param_calls;
/* Only for versioned nodes this field would not be NULL,
it points to the node that IPA cp cloned from. */
struct cgraph_node *ipcp_orig_node;
@@ -130,6 +174,10 @@ struct ipa_node_params
/* Whether this function is called with variable number of actual
arguments. */
unsigned called_with_var_arguments : 1;
+ /* Whether the modification analysis has already been performed. */
+ unsigned modification_analysis_done : 1;
+ /* Whether the param uses analysis has already been performed. */
+ unsigned uses_analysis_done : 1;
};
/* ipa_node_params access functions. Please use these to access fields that
@@ -164,7 +212,16 @@ ipa_get_ith_param (struct ipa_node_params *info, int i)
static inline bool
ipa_is_ith_param_modified (struct ipa_node_params *info, int i)
{
- return info->modified_flags[i];
+ return info->param_flags[i].modified;
+}
+
+/* Returns the called flag corresponding o the ith paramterer. Note there is
+ no setter method as the goal is to set all flags when building the array in
+ ipa_detect_called_params. */
+static inline bool
+ipa_is_ith_param_called (struct ipa_node_params *info, int i)
+{
+ return info->param_flags[i].called;
}
/* Flag this node as having callers with variable number of arguments. */
@@ -255,6 +312,7 @@ void ipa_free_node_params_substructures (struct ipa_node_params *);
void ipa_free_all_node_params (void);
void ipa_free_all_edge_args (void);
void free_all_ipa_structures_after_ipa_cp (void);
+void free_all_ipa_structures_after_iinln (void);
void ipa_register_cgraph_hooks (void);
/* This function ensures the array of node param infos is big enough to
@@ -318,9 +376,14 @@ void ipa_count_arguments (struct cgraph_edge *);
void ipa_count_formal_params (struct cgraph_node *);
void ipa_create_param_decls_array (struct cgraph_node *);
void ipa_detect_param_modifications (struct cgraph_node *);
+void ipa_analyze_params_uses (struct cgraph_node *);
+void ipa_propagate_indirect_call_infos (struct cgraph_edge *cs,
+ VEC (cgraph_edge_p, heap) *new_edges);
/* Debugging interface. */
-void ipa_print_all_tree_maps (FILE *);
-void ipa_print_all_params_modified (FILE *);
+void ipa_print_node_params (FILE *, struct cgraph_node *node);
+void ipa_print_all_params (FILE *);
+void ipa_print_node_jump_functions (FILE *f, struct cgraph_node *node);
+void ipa_print_all_jump_functions (FILE * f);
#endif /* IPA_PROP_H */
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index 3b2cdaee2a1..20abdf3f477 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -44,7 +44,7 @@ along with GCC; see the file COPYING3. If not see
#include "ggc.h"
#include "ipa-utils.h"
#include "c-common.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "cgraph.h"
#include "output.h"
#include "flags.h"
@@ -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)
@@ -276,42 +324,47 @@ check_lhs_var (funct_state local, tree t)
actual asm statement. */
static void
-get_asm_expr_operands (funct_state local, tree stmt)
+get_asm_expr_operands (funct_state local, gimple stmt)
{
- int noutputs = list_length (ASM_OUTPUTS (stmt));
+ size_t noutputs = gimple_asm_noutputs (stmt);
const char **oconstraints
= (const char **) alloca ((noutputs) * sizeof (const char *));
- int i;
- tree link;
+ size_t i;
+ tree op;
const char *constraint;
bool allows_mem, allows_reg, is_inout;
- for (i=0, link = ASM_OUTPUTS (stmt); link; ++i, link = TREE_CHAIN (link))
+ for (i = 0; i < noutputs; i++)
{
+ op = gimple_asm_output_op (stmt, i);
oconstraints[i] = constraint
- = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
+ = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (op)));
parse_output_constraint (&constraint, i, 0, 0,
&allows_mem, &allows_reg, &is_inout);
- check_lhs_var (local, TREE_VALUE (link));
+ check_lhs_var (local, TREE_VALUE (op));
}
- for (link = ASM_INPUTS (stmt); link; link = TREE_CHAIN (link))
+ for (i = 0; i < gimple_asm_ninputs (stmt); i++)
{
+ op = gimple_asm_input_op (stmt, i);
constraint
- = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
+ = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (op)));
parse_input_constraint (&constraint, 0, 0, noutputs, 0,
oconstraints, &allows_mem, &allows_reg);
- check_rhs_var (local, TREE_VALUE (link));
+ check_rhs_var (local, TREE_VALUE (op));
}
- for (link = ASM_CLOBBERS (stmt); link; link = TREE_CHAIN (link))
- if (simple_cst_equal(TREE_VALUE (link), memory_identifier_string) == 1)
- /* Abandon all hope, ye who enter here. */
- local->pure_const_state = IPA_NEITHER;
+ for (i = 0; i < gimple_asm_nclobbers (stmt); i++)
+ {
+ op = gimple_asm_clobber_op (stmt, i);
+ if (simple_cst_equal(TREE_VALUE (op), memory_identifier_string) == 1)
+ /* Abandon all hope, ye who enter here. */
+ local->pure_const_state = IPA_NEITHER;
+ }
- if (ASM_VOLATILE_P (stmt))
+ if (gimple_asm_volatile_p (stmt))
local->pure_const_state = IPA_NEITHER;
}
@@ -323,17 +376,20 @@ get_asm_expr_operands (funct_state local, tree stmt)
the entire call expression. */
static void
-check_call (funct_state local, tree call_expr)
+check_call (funct_state local, gimple call)
{
- int flags = call_expr_flags (call_expr);
- tree operand;
- call_expr_arg_iterator iter;
- tree callee_t = get_callee_fndecl (call_expr);
+ int flags = gimple_call_flags (call);
+ tree lhs, callee_t = gimple_call_fndecl (call);
struct cgraph_node* callee;
enum availability avail = AVAIL_NOT_AVAILABLE;
+ size_t i;
+
+ lhs = gimple_call_lhs (call);
+ if (lhs)
+ check_lhs_var (local, lhs);
- FOR_EACH_CALL_EXPR_ARG (operand, iter, call_expr)
- check_rhs_var (local, operand);
+ for (i = 0; i < gimple_call_num_args (call); i++)
+ check_rhs_var (local, gimple_call_arg (call, i));
/* The const and pure flags are set by a variety of places in the
compiler (including here). If someone has already set the flags
@@ -405,11 +461,10 @@ check_call (funct_state local, tree call_expr)
should be converted to use the operand scanner. */
static tree
-scan_function (tree *tp,
- int *walk_subtrees,
- void *data)
+scan_function_op (tree *tp, int *walk_subtrees, void *data)
{
- struct cgraph_node *fn = (struct cgraph_node *) data;
+ struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
+ struct cgraph_node *fn = (struct cgraph_node *) wi->info;
tree t = *tp;
funct_state local = get_function_state (fn);
@@ -417,58 +472,72 @@ scan_function (tree *tp,
{
case VAR_DECL:
if (DECL_INITIAL (t))
- walk_tree (&DECL_INITIAL (t), scan_function, fn, visited_nodes);
+ walk_tree (&DECL_INITIAL (t), scan_function_op, data, visited_nodes);
*walk_subtrees = 0;
break;
- case GIMPLE_MODIFY_STMT:
+ case ADDR_EXPR:
+ /* This case is here to find addresses on rhs of constructors in
+ decl_initial of static variables. */
+ check_rhs_var (local, t);
+ *walk_subtrees = 0;
+ break;
+
+ default:
+ break;
+ }
+ return NULL;
+}
+
+static tree
+scan_function_stmt (gimple_stmt_iterator *gsi_p,
+ bool *handled_ops_p,
+ struct walk_stmt_info *wi)
+{
+ struct cgraph_node *fn = (struct cgraph_node *) wi->info;
+ gimple stmt = gsi_stmt (*gsi_p);
+ funct_state local = get_function_state (fn);
+
+ switch (gimple_code (stmt))
+ {
+ case GIMPLE_ASSIGN:
{
/* First look on the lhs and see what variable is stored to */
- tree lhs = GIMPLE_STMT_OPERAND (t, 0);
- tree rhs = GIMPLE_STMT_OPERAND (t, 1);
+ tree lhs = gimple_assign_lhs (stmt);
+ tree rhs1 = gimple_assign_rhs1 (stmt);
+ tree rhs2 = gimple_assign_rhs2 (stmt);
+ enum tree_code code = gimple_assign_rhs_code (stmt);
+
check_lhs_var (local, lhs);
/* For the purposes of figuring out what the cast affects */
/* Next check the operands on the rhs to see if they are ok. */
- switch (TREE_CODE_CLASS (TREE_CODE (rhs)))
+ switch (TREE_CODE_CLASS (code))
{
case tcc_binary:
{
- tree op0 = TREE_OPERAND (rhs, 0);
- tree op1 = TREE_OPERAND (rhs, 1);
- check_rhs_var (local, op0);
- check_rhs_var (local, op1);
+ check_rhs_var (local, rhs1);
+ check_rhs_var (local, rhs2);
}
break;
case tcc_unary:
{
- tree op0 = TREE_OPERAND (rhs, 0);
- check_rhs_var (local, op0);
+ check_rhs_var (local, rhs1);
}
break;
case tcc_reference:
- check_rhs_var (local, rhs);
+ check_rhs_var (local, rhs1);
break;
case tcc_declaration:
- check_rhs_var (local, rhs);
+ check_rhs_var (local, rhs1);
break;
case tcc_expression:
- switch (TREE_CODE (rhs))
+ switch (code)
{
case ADDR_EXPR:
- check_rhs_var (local, rhs);
- break;
- default:
- break;
- }
- break;
- case tcc_vl_exp:
- switch (TREE_CODE (rhs))
- {
- case CALL_EXPR:
- check_call (local, rhs);
+ check_rhs_var (local, rhs1);
break;
default:
break;
@@ -477,19 +546,12 @@ scan_function (tree *tp,
default:
break;
}
- *walk_subtrees = 0;
+ *handled_ops_p = true;
}
break;
- case ADDR_EXPR:
- /* This case is here to find addresses on rhs of constructors in
- decl_initial of static variables. */
- check_rhs_var (local, t);
- *walk_subtrees = 0;
- break;
-
- case LABEL_EXPR:
- if (DECL_NONLOCAL (TREE_OPERAND (t, 0)))
+ case GIMPLE_LABEL:
+ if (DECL_NONLOCAL (gimple_label_label (stmt)))
/* Target of long jump. */
{
local->pure_const_state = IPA_NEITHER;
@@ -497,14 +559,14 @@ scan_function (tree *tp,
}
break;
- case CALL_EXPR:
- check_call (local, t);
- *walk_subtrees = 0;
+ case GIMPLE_CALL:
+ check_call (local, stmt);
+ *handled_ops_p = true;
break;
- case ASM_EXPR:
- get_asm_expr_operands (local, t);
- *walk_subtrees = 0;
+ case GIMPLE_ASM:
+ get_asm_expr_operands (local, stmt);
+ *handled_ops_p = true;
break;
default:
@@ -513,17 +575,17 @@ scan_function (tree *tp,
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;
@@ -567,11 +629,18 @@ analyze_function (struct cgraph_node *fn)
FOR_EACH_BB_FN (this_block, this_cfun)
{
- block_stmt_iterator bsi;
- for (bsi = bsi_start (this_block); !bsi_end_p (bsi); bsi_next (&bsi))
+ gimple_stmt_iterator gsi;
+ struct walk_stmt_info wi;
+
+ memset (&wi, 0, sizeof(wi));
+ for (gsi = gsi_start_bb (this_block);
+ !gsi_end_p (gsi);
+ gsi_next (&gsi))
{
- walk_tree (bsi_stmt_ptr (bsi), scan_function,
- fn, visited_nodes);
+ wi.info = fn;
+ wi.pset = visited_nodes;
+ walk_gimple_stmt (&gsi, scan_function_stmt, scan_function_op,
+ &wi);
if (l->pure_const_state == IPA_NEITHER)
goto end;
}
@@ -610,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
@@ -649,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);
@@ -723,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:
@@ -754,35 +853,38 @@ 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;
}
static bool
gate_pure_const (void)
{
- return (flag_unit_at_a_time != 0 && flag_ipa_pure_const
+ return (flag_ipa_pure_const
/* Don't bother doing anything if the program has errors. */
&& !(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 */
@@ -792,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 75aed2f52f6..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.
@@ -45,8 +45,7 @@ along with GCC; see the file COPYING3. If not see
Currently must be run after inlining decisions have been made since
otherwise, the local sets will not contain information that is
consistent with post inlined state. The global sets are not prone
- to this problem since they are by definition transitive.
-*/
+ to this problem since they are by definition transitive. */
#include "config.h"
#include "system.h"
@@ -62,7 +61,7 @@ along with GCC; see the file COPYING3. If not see
#include "ipa-utils.h"
#include "ipa-reference.h"
#include "c-common.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "cgraph.h"
#include "output.h"
#include "flags.h"
@@ -96,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,
@@ -297,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));
@@ -346,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));
}
}
@@ -388,43 +391,48 @@ check_lhs_var (ipa_reference_local_vars_info_t local, tree t)
function being analyzed and STMT is the actual asm statement. */
static void
-get_asm_expr_operands (ipa_reference_local_vars_info_t local, tree stmt)
+get_asm_stmt_operands (ipa_reference_local_vars_info_t local, gimple stmt)
{
- int noutputs = list_length (ASM_OUTPUTS (stmt));
+ size_t noutputs = gimple_asm_noutputs (stmt);
const char **oconstraints
= (const char **) alloca ((noutputs) * sizeof (const char *));
- int i;
- tree link;
+ size_t i;
+ tree op;
const char *constraint;
bool allows_mem, allows_reg, is_inout;
- for (i=0, link = ASM_OUTPUTS (stmt); link; ++i, link = TREE_CHAIN (link))
+ for (i = 0; i < noutputs; i++)
{
+ op = gimple_asm_output_op (stmt, i);
oconstraints[i] = constraint
- = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
+ = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (op)));
parse_output_constraint (&constraint, i, 0, 0,
&allows_mem, &allows_reg, &is_inout);
- check_lhs_var (local, TREE_VALUE (link));
+ check_lhs_var (local, TREE_VALUE (op));
}
- for (link = ASM_INPUTS (stmt); link; link = TREE_CHAIN (link))
+ for (i = 0; i < gimple_asm_ninputs (stmt); i++)
{
+ op = gimple_asm_input_op (stmt, i);
constraint
- = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
+ = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (op)));
parse_input_constraint (&constraint, 0, 0, noutputs, 0,
oconstraints, &allows_mem, &allows_reg);
- check_rhs_var (local, TREE_VALUE (link));
+ check_rhs_var (local, TREE_VALUE (op));
}
- for (link = ASM_CLOBBERS (stmt); link; link = TREE_CHAIN (link))
- if (simple_cst_equal(TREE_VALUE (link), memory_identifier_string) == 1)
- {
- /* Abandon all hope, ye who enter here. */
- local->calls_read_all = true;
- local->calls_write_all = true;
- }
+ for (i = 0; i < gimple_asm_nclobbers (stmt); i++)
+ {
+ op = gimple_asm_clobber_op (stmt, i);
+ if (simple_cst_equal(TREE_VALUE (op), memory_identifier_string) == 1)
+ {
+ /* Abandon all hope, ye who enter here. */
+ local->calls_read_all = true;
+ local->calls_write_all = true;
+ }
+ }
}
/* Check the parameters of a function call from CALLER to CALL_EXPR to
@@ -435,16 +443,19 @@ get_asm_expr_operands (ipa_reference_local_vars_info_t local, tree stmt)
the tree node for the entire call expression. */
static void
-check_call (ipa_reference_local_vars_info_t local, tree call_expr)
+check_call (ipa_reference_local_vars_info_t local, gimple stmt)
{
- int flags = call_expr_flags (call_expr);
+ int flags = gimple_call_flags (stmt);
tree operand;
- tree callee_t = get_callee_fndecl (call_expr);
+ tree callee_t = gimple_call_fndecl (stmt);
enum availability avail = AVAIL_NOT_AVAILABLE;
- call_expr_arg_iterator iter;
+ size_t i;
+
+ if ((operand = gimple_call_lhs (stmt)) != NULL)
+ check_lhs_var (local, operand);
- FOR_EACH_CALL_EXPR_ARG (operand, iter, call_expr)
- check_rhs_var (local, operand);
+ for (i = 0; i < gimple_call_num_args (stmt); i++)
+ check_rhs_var (local, gimple_call_arg (stmt, i));
if (callee_t)
{
@@ -473,73 +484,49 @@ check_call (ipa_reference_local_vars_info_t local, tree call_expr)
should be converted to use the operand scanner. */
static tree
-scan_for_static_refs (tree *tp,
- int *walk_subtrees,
- void *data)
+scan_stmt_for_static_refs (gimple_stmt_iterator *gsip, bool *handled_ops_p,
+ struct walk_stmt_info *data)
{
- struct cgraph_node *fn = (struct cgraph_node *) data;
- tree t = *tp;
+ struct cgraph_node *fn = (struct cgraph_node *) data->info;
+ gimple stmt = gsi_stmt (*gsip);
ipa_reference_local_vars_info_t local = NULL;
if (fn)
local = get_reference_vars_info_from_cgraph (fn)->local;
- switch (TREE_CODE (t))
+ switch (gimple_code (stmt))
{
- case VAR_DECL:
- if (DECL_INITIAL (t))
- walk_tree (&DECL_INITIAL (t), scan_for_static_refs, fn, visited_nodes);
- *walk_subtrees = 0;
- break;
-
- case GIMPLE_MODIFY_STMT:
+ case GIMPLE_ASSIGN:
{
/* First look on the lhs and see what variable is stored to */
- tree lhs = GIMPLE_STMT_OPERAND (t, 0);
- tree rhs = GIMPLE_STMT_OPERAND (t, 1);
+ tree lhs = gimple_assign_lhs (stmt);
+ tree rhs1 = gimple_assign_rhs1 (stmt);
+ tree rhs2 = gimple_assign_rhs2 (stmt);
+ enum tree_code code = gimple_assign_rhs_code (stmt);
+
check_lhs_var (local, lhs);
/* For the purposes of figuring out what the cast affects */
/* Next check the operands on the rhs to see if they are ok. */
- switch (TREE_CODE_CLASS (TREE_CODE (rhs)))
+ switch (TREE_CODE_CLASS (code))
{
case tcc_binary:
case tcc_comparison:
- {
- tree op0 = TREE_OPERAND (rhs, 0);
- tree op1 = TREE_OPERAND (rhs, 1);
- check_rhs_var (local, op0);
- check_rhs_var (local, op1);
- }
+ check_rhs_var (local, rhs1);
+ check_rhs_var (local, rhs2);
break;
- case tcc_unary:
- {
- tree op0 = TREE_OPERAND (rhs, 0);
- check_rhs_var (local, op0);
- }
- break;
+ case tcc_unary:
case tcc_reference:
- check_rhs_var (local, rhs);
- break;
case tcc_declaration:
- check_rhs_var (local, rhs);
+ check_rhs_var (local, rhs1);
break;
+
case tcc_expression:
- switch (TREE_CODE (rhs))
+ switch (code)
{
case ADDR_EXPR:
- check_rhs_var (local, rhs);
- break;
- default:
- break;
- }
- break;
- case tcc_vl_exp:
- switch (TREE_CODE (rhs))
- {
- case CALL_EXPR:
- check_call (local, rhs);
+ check_rhs_var (local, rhs1);
break;
default:
break;
@@ -548,19 +535,12 @@ scan_for_static_refs (tree *tp,
default:
break;
}
- *walk_subtrees = 0;
+ *handled_ops_p = true;
}
break;
- case ADDR_EXPR:
- /* This case is here to find addresses on rhs of constructors in
- decl_initial of static variables. */
- check_rhs_var (local, t);
- *walk_subtrees = 0;
- break;
-
- case LABEL_EXPR:
- if (DECL_NONLOCAL (TREE_OPERAND (t, 0)))
+ case GIMPLE_LABEL:
+ if (DECL_NONLOCAL (gimple_label_label (stmt)))
{
/* Target of long jump. */
local->calls_read_all = true;
@@ -568,14 +548,14 @@ scan_for_static_refs (tree *tp,
}
break;
- case CALL_EXPR:
- check_call (local, t);
- *walk_subtrees = 0;
+ case GIMPLE_CALL:
+ check_call (local, stmt);
+ *handled_ops_p = true;
break;
- case ASM_EXPR:
- get_asm_expr_operands (local, t);
- *walk_subtrees = 0;
+ case GIMPLE_ASM:
+ get_asm_stmt_operands (local, stmt);
+ *handled_ops_p = true;
break;
default:
@@ -584,6 +564,42 @@ scan_for_static_refs (tree *tp,
return NULL;
}
+/* Call-back to scan GIMPLE operands for static references. This is supposed
+ to work with scan_stmt_for_static_refs so the real call-back data is stored
+ inside a walk_stmt_info struct. Callers using the walk_tree interface must
+ also wrap the call-back data in a walk_stmt_info struct. */
+
+static tree
+scan_op_for_static_refs (tree *tp, int *walk_subtrees, void *data)
+{
+ struct walk_stmt_info *wi = (struct walk_stmt_info*) data;
+ struct cgraph_node *fn = (struct cgraph_node *) wi->info;
+ tree t = *tp;
+ ipa_reference_local_vars_info_t local = NULL;
+ if (fn)
+ local = get_reference_vars_info_from_cgraph (fn)->local;
+
+ switch (TREE_CODE (t))
+ {
+ case VAR_DECL:
+ if (DECL_INITIAL (t))
+ walk_tree (&DECL_INITIAL (t), scan_op_for_static_refs, data,
+ wi->pset);
+ *walk_subtrees = 0;
+ break;
+
+ case ADDR_EXPR:
+ /* This case is here to find addresses on rhs of constructors in
+ decl_initial of static variables. */
+ check_rhs_var (local, t);
+ *walk_subtrees = 0;
+ break;
+
+ default:
+ break;
+ }
+ return NULL;
+}
/* Lookup the tree node for the static variable that has UID. */
static tree
@@ -630,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
@@ -777,16 +794,19 @@ ipa_init (void)
static void
analyze_variable (struct varpool_node *vnode)
{
+ struct walk_stmt_info wi;
tree global = vnode->decl;
- walk_tree (&DECL_INITIAL (global), scan_for_static_refs,
- NULL, visited_nodes);
+
+ memset (&wi, 0, sizeof (wi));
+ wi.pset = visited_nodes;
+ walk_tree (&DECL_INITIAL (global), scan_op_for_static_refs,
+ &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);
@@ -795,42 +815,59 @@ analyze_function (struct cgraph_node *fn)
tree decl = fn->decl;
/* 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)
- {
- block_stmt_iterator bsi;
- tree phi, op;
- use_operand_p use;
- ssa_op_iter iter;
-
- /* Find the addresses taken in phi node arguments. */
- for (phi = phi_nodes (this_block); phi; phi = PHI_CHAIN (phi))
- {
- 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);
+ }
+ }
- for (bsi = bsi_start (this_block); !bsi_end_p (bsi); bsi_next (&bsi))
- walk_tree (bsi_stmt_ptr (bsi), scan_for_static_refs,
- fn, visited_nodes);
- }
- }
+ 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))
@@ -844,8 +881,13 @@ analyze_function (struct cgraph_node *fn)
if (TREE_CODE (var) == VAR_DECL
&& DECL_INITIAL (var)
&& !TREE_STATIC (var))
- walk_tree (&DECL_INITIAL (var), scan_for_static_refs,
- fn, visited_nodes);
+ {
+ memset (&wi, 0, sizeof (wi));
+ wi.info = fn;
+ wi.pset = visited_nodes;
+ walk_tree (&DECL_INITIAL (var), scan_op_for_static_refs,
+ &wi, wi.pset);
+ }
}
}
}
@@ -892,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)
@@ -940,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));
- }
-
- /* 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));
- }
+ fprintf (dump_file, "\nPromotable global:%s",
+ 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:",
@@ -1058,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
@@ -1314,18 +1386,18 @@ static_execute (void)
static bool
gate_reference (void)
{
- return (flag_unit_at_a_time != 0 && flag_ipa_reference
+ return (flag_ipa_reference
/* Don't bother doing anything if the program has errors. */
&& !(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 */
@@ -1335,8 +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/ipa-struct-reorg.c b/gcc/ipa-struct-reorg.c
index fffb454d831..d6bca8ab722 100644
--- a/gcc/ipa-struct-reorg.c
+++ b/gcc/ipa-struct-reorg.c
@@ -28,7 +28,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ggc.h"
#include "tree.h"
#include "rtl.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-inline.h"
#include "tree-flow.h"
#include "tree-flow-inline.h"
@@ -55,6 +55,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ipa-type-escape.h"
#include "tree-dump.h"
#include "c-common.h"
+#include "gimple.h"
/* This optimization implements structure peeling.
@@ -168,7 +169,7 @@ typedef const struct new_var_data *const_new_var;
/* This structure represents allocation site of the structure. */
typedef struct alloc_site
{
- tree stmt;
+ gimple stmt;
d_str str;
} alloc_site_t;
@@ -235,7 +236,7 @@ get_type_of_var (tree var)
/* Set of actions we do for each newly generated STMT. */
static inline void
-finalize_stmt (tree stmt)
+finalize_stmt (gimple stmt)
{
update_stmt (stmt);
mark_symbols_for_renaming (stmt);
@@ -244,9 +245,9 @@ finalize_stmt (tree stmt)
/* This function finalizes STMT and appends it to the list STMTS. */
static inline void
-finalize_stmt_and_append (tree *stmts, tree stmt)
+finalize_stmt_and_append (gimple_seq *stmts, gimple stmt)
{
- append_to_statement_list (stmt, stmts);
+ gimple_seq_add_stmt (stmts, stmt);
finalize_stmt (stmt);
}
@@ -307,25 +308,24 @@ find_field_in_struct (d_str str, tree field_decl)
static bool
is_result_of_mult (tree arg, tree *num, tree struct_size)
{
- tree size_def_stmt = SSA_NAME_DEF_STMT (arg);
+ gimple size_def_stmt = SSA_NAME_DEF_STMT (arg);
/* If the allocation statement was of the form
D.2229_10 = <alloc_func> (D.2228_9);
then size_def_stmt can be D.2228_9 = num.3_8 * 8; */
- if (size_def_stmt && TREE_CODE (size_def_stmt) == GIMPLE_MODIFY_STMT)
+ if (size_def_stmt && is_gimple_assign (size_def_stmt))
{
- tree lhs = GIMPLE_STMT_OPERAND (size_def_stmt, 0);
- tree rhs = GIMPLE_STMT_OPERAND (size_def_stmt, 1);
+ tree lhs = gimple_assign_lhs (size_def_stmt);
/* We expect temporary here. */
if (!is_gimple_reg (lhs))
return false;
- if (TREE_CODE (rhs) == MULT_EXPR)
+ if (gimple_assign_rhs_code (size_def_stmt) == MULT_EXPR)
{
- tree arg0 = TREE_OPERAND (rhs, 0);
- tree arg1 = TREE_OPERAND (rhs, 1);
+ tree arg0 = gimple_assign_rhs1 (size_def_stmt);
+ tree arg1 = gimple_assign_rhs2 (size_def_stmt);
if (operand_equal_p (arg0, struct_size, OEP_ONLY_CONST))
{
@@ -356,8 +356,9 @@ static bool
decompose_indirect_ref_acc (tree str_decl, struct field_access_site *acc)
{
tree ref_var;
- tree rhs, struct_size, op0, op1;
+ tree struct_size, op0, op1;
tree before_cast;
+ enum tree_code rhs_code;
ref_var = TREE_OPERAND (acc->ref, 0);
@@ -366,20 +367,20 @@ decompose_indirect_ref_acc (tree str_decl, struct field_access_site *acc)
acc->ref_def_stmt = SSA_NAME_DEF_STMT (ref_var);
if (!(acc->ref_def_stmt)
- || (TREE_CODE (acc->ref_def_stmt) != GIMPLE_MODIFY_STMT))
+ || (gimple_code (acc->ref_def_stmt) != GIMPLE_ASSIGN))
return false;
- rhs = GIMPLE_STMT_OPERAND (acc->ref_def_stmt, 1);
+ rhs_code = gimple_assign_rhs_code (acc->ref_def_stmt);
- if (TREE_CODE (rhs) != PLUS_EXPR
- && TREE_CODE (rhs)!= MINUS_EXPR
- && TREE_CODE (rhs) != POINTER_PLUS_EXPR)
+ if (rhs_code != PLUS_EXPR
+ && rhs_code != MINUS_EXPR
+ && rhs_code != POINTER_PLUS_EXPR)
return false;
- op0 = TREE_OPERAND (rhs, 0);
- op1 = TREE_OPERAND (rhs, 1);
+ op0 = gimple_assign_rhs1 (acc->ref_def_stmt);
+ op1 = gimple_assign_rhs2 (acc->ref_def_stmt);
- if (!is_array_access_through_pointer_and_index (TREE_CODE (rhs), op0, op1,
+ if (!is_array_access_through_pointer_and_index (rhs_code, op0, op1,
&acc->base, &acc->offset,
&acc->cast_stmt))
return false;
@@ -438,7 +439,7 @@ make_field_acc_node (void)
if it is already in hashtable of function accesses F_ACCS. */
static struct field_access_site *
-is_in_field_accs (tree stmt, htab_t f_accs)
+is_in_field_accs (gimple stmt, htab_t f_accs)
{
return (struct field_access_site *)
htab_find_with_hash (f_accs, stmt, htab_hash_pointer (stmt));
@@ -466,7 +467,7 @@ add_field_acc_to_acc_sites (struct field_access_site *acc,
accesses ACCS, this function creates it. */
static void
-add_access_to_acc_sites (tree stmt, tree var, htab_t accs)
+add_access_to_acc_sites (gimple stmt, tree var, htab_t accs)
{
struct access_site *acc;
@@ -538,23 +539,6 @@ finalize_new_vars_creation (void **slot, void *data ATTRIBUTE_UNUSED)
return 1;
}
-/* This function updates statements in STMT_LIST with BB info. */
-
-static void
-add_bb_info (basic_block bb, tree stmt_list)
-{
- if (TREE_CODE (stmt_list) == STATEMENT_LIST)
- {
- tree_stmt_iterator tsi;
- for (tsi = tsi_start (stmt_list); !tsi_end_p (tsi); tsi_next (&tsi))
- {
- tree stmt = tsi_stmt (tsi);
-
- set_bb_for_stmt (stmt, bb);
- }
- }
-}
-
/* This function looks for the variable of NEW_TYPE type, stored in VAR.
It returns it, if found, and NULL_TREE otherwise. */
@@ -610,12 +594,12 @@ find_new_var_of_type (tree orig_var, tree new_type)
res = NUM * sizeof(TYPE) and returns it.
res is filled into RES. */
-static tree
+static gimple
gen_size (tree num, tree type, tree *res)
{
tree struct_size = TYPE_SIZE_UNIT (type);
HOST_WIDE_INT struct_size_int = TREE_INT_CST_LOW (struct_size);
- tree new_stmt;
+ gimple new_stmt;
*res = create_tmp_var (TREE_TYPE (num), NULL);
@@ -625,17 +609,13 @@ gen_size (tree num, tree type, tree *res)
if (exact_log2 (struct_size_int) == -1)
{
tree size = build_int_cst (TREE_TYPE (num), struct_size_int);
- new_stmt = build_gimple_modify_stmt (*res, build2 (MULT_EXPR,
- TREE_TYPE (num),
- num, size));
+ new_stmt = gimple_build_assign_with_ops (MULT_EXPR, *res, num, size);
}
else
{
tree C = build_int_cst (TREE_TYPE (num), exact_log2 (struct_size_int));
- new_stmt = build_gimple_modify_stmt (*res, build2 (LSHIFT_EXPR,
- TREE_TYPE (num),
- num, C));
+ new_stmt = gimple_build_assign_with_ops (LSHIFT_EXPR, *res, num, C);
}
finalize_stmt (new_stmt);
@@ -646,21 +626,18 @@ gen_size (tree num, tree type, tree *res)
BEFORE_CAST to NEW_TYPE. The cast result variable is stored
into RES_P. ORIG_CAST_STMT is the original cast statement. */
-static tree
-gen_cast_stmt (tree before_cast, tree new_type, tree orig_cast_stmt,
+static gimple
+gen_cast_stmt (tree before_cast, tree new_type, gimple orig_cast_stmt,
tree *res_p)
{
- tree lhs, new_lhs, new_stmt;
- gcc_assert (TREE_CODE (orig_cast_stmt) == GIMPLE_MODIFY_STMT);
-
- lhs = GIMPLE_STMT_OPERAND (orig_cast_stmt, 0);
+ tree lhs, new_lhs;
+ gimple new_stmt;
+
+ lhs = gimple_assign_lhs (orig_cast_stmt);
new_lhs = find_new_var_of_type (lhs, new_type);
gcc_assert (new_lhs);
- new_stmt = build_gimple_modify_stmt (new_lhs,
- build1 (NOP_EXPR,
- TREE_TYPE (new_lhs),
- before_cast));
+ new_stmt = gimple_build_assign_with_ops (NOP_EXPR, new_lhs, before_cast, 0);
finalize_stmt (new_stmt);
*res_p = new_lhs;
return new_stmt;
@@ -673,12 +650,14 @@ static edge
make_edge_and_fix_phis_of_dest (basic_block bb, edge e)
{
edge new_e;
- tree phi, arg;
+ tree arg;
+ gimple_stmt_iterator si;
new_e = make_edge (bb, e->dest, e->flags);
- for (phi = phi_nodes (new_e->dest); phi; phi = PHI_CHAIN (phi))
+ for (si = gsi_start_phis (new_e->dest); !gsi_end_p (si); gsi_next (&si))
{
+ gimple phi = gsi_stmt (si);
arg = PHI_ARG_DEF_FROM_EDGE (phi, e);
add_phi_arg (phi, arg, new_e);
}
@@ -686,32 +665,46 @@ make_edge_and_fix_phis_of_dest (basic_block bb, edge e)
return new_e;
}
-/* This function inserts NEW_STMTS before STMT. */
+/* This function inserts NEW_STMT before STMT. */
static void
-insert_before_stmt (tree stmt, tree new_stmts)
+insert_before_stmt (gimple stmt, gimple new_stmt)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
- if (!stmt || !new_stmts)
+ if (!stmt || !new_stmt)
return;
- bsi = bsi_for_stmt (stmt);
- bsi_insert_before (&bsi, new_stmts, BSI_SAME_STMT);
+ bsi = gsi_for_stmt (stmt);
+ gsi_insert_before (&bsi, new_stmt, GSI_SAME_STMT);
}
/* Insert NEW_STMTS after STMT. */
static void
-insert_after_stmt (tree stmt, tree new_stmts)
+insert_seq_after_stmt (gimple stmt, gimple_seq new_stmts)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
if (!stmt || !new_stmts)
return;
- bsi = bsi_for_stmt (stmt);
- bsi_insert_after (&bsi, new_stmts, BSI_SAME_STMT);
+ bsi = gsi_for_stmt (stmt);
+ gsi_insert_seq_after (&bsi, new_stmts, GSI_SAME_STMT);
+}
+
+/* Insert NEW_STMT after STMT. */
+
+static void
+insert_after_stmt (gimple stmt, gimple new_stmt)
+{
+ gimple_stmt_iterator bsi;
+
+ if (!stmt || !new_stmt)
+ return;
+
+ bsi = gsi_for_stmt (stmt);
+ gsi_insert_after (&bsi, new_stmt, GSI_SAME_STMT);
}
/* This function returns vector of allocation sites
@@ -730,20 +723,20 @@ get_fallocs (tree fn_decl)
p_8 = (struct str_t *) D.2225_7;
which is returned by this function. */
-static tree
-get_final_alloc_stmt (tree alloc_stmt)
+static gimple
+get_final_alloc_stmt (gimple alloc_stmt)
{
- tree final_stmt;
+ gimple final_stmt;
use_operand_p use_p;
tree alloc_res;
if (!alloc_stmt)
return NULL;
- if (TREE_CODE (alloc_stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_call (alloc_stmt))
return NULL;
- alloc_res = GIMPLE_STMT_OPERAND (alloc_stmt, 0);
+ alloc_res = gimple_get_lhs (alloc_stmt);
if (TREE_CODE (alloc_res) != SSA_NAME)
return NULL;
@@ -758,7 +751,7 @@ get_final_alloc_stmt (tree alloc_stmt)
sites of function FN_DECL. It returns false otherwise. */
static bool
-is_part_of_malloc (tree stmt, tree fn_decl)
+is_part_of_malloc (gimple stmt, tree fn_decl)
{
fallocs_t fallocs = get_fallocs (fn_decl);
@@ -767,8 +760,7 @@ is_part_of_malloc (tree stmt, tree fn_decl)
alloc_site_t *call;
unsigned i;
- for (i = 0;
- VEC_iterate (alloc_site_t, fallocs->allocs, i, call); i++)
+ for (i = 0; VEC_iterate (alloc_site_t, fallocs->allocs, i, call); i++)
if (call->stmt == stmt
|| get_final_alloc_stmt (call->stmt) == stmt)
return true;
@@ -780,7 +772,7 @@ is_part_of_malloc (tree stmt, tree fn_decl)
struct find_stmt_data
{
bool found;
- tree stmt;
+ gimple stmt;
};
/* This function looks for DATA->stmt among
@@ -790,9 +782,8 @@ struct find_stmt_data
static int
find_in_field_accs (void **slot, void *data)
{
- struct field_access_site *f_acc =
- *(struct field_access_site **) slot;
- tree stmt = ((struct find_stmt_data *)data)->stmt;
+ struct field_access_site *f_acc = *(struct field_access_site **) slot;
+ gimple stmt = ((struct find_stmt_data *)data)->stmt;
if (f_acc->stmt == stmt
|| f_acc->ref_def_stmt == stmt
@@ -810,7 +801,7 @@ find_in_field_accs (void **slot, void *data)
and false otherwise. */
static bool
-is_part_of_field_access (tree stmt, d_str str)
+is_part_of_field_access (gimple stmt, d_str str)
{
int i;
@@ -883,7 +874,8 @@ struct ref_pos
static tree
find_pos_in_stmt_1 (tree *tp, int *walk_subtrees, void * data)
{
- struct ref_pos * r_pos = (struct ref_pos *) data;
+ struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
+ struct ref_pos *r_pos = (struct ref_pos *) wi->info;
tree ref = r_pos->ref;
tree t = *tp;
@@ -893,23 +885,8 @@ find_pos_in_stmt_1 (tree *tp, int *walk_subtrees, void * data)
return t;
}
- switch (TREE_CODE (t))
- {
- case GIMPLE_MODIFY_STMT:
- {
- tree lhs = GIMPLE_STMT_OPERAND (t, 0);
- tree rhs = GIMPLE_STMT_OPERAND (t, 1);
- *walk_subtrees = 1;
- walk_tree (&lhs, find_pos_in_stmt_1, data, NULL);
- walk_tree (&rhs, find_pos_in_stmt_1, data, NULL);
- *walk_subtrees = 0;
- }
- break;
-
- default:
- *walk_subtrees = 1;
- }
- return NULL_TREE;
+ *walk_subtrees = 1;
+ return NULL_TREE;
}
@@ -917,13 +894,16 @@ find_pos_in_stmt_1 (tree *tp, int *walk_subtrees, void * data)
It returns it, if found, and NULL otherwise. */
static tree *
-find_pos_in_stmt (tree stmt, tree ref)
+find_pos_in_stmt (gimple stmt, tree ref)
{
struct ref_pos r_pos;
+ struct walk_stmt_info wi;
r_pos.ref = ref;
r_pos.pos = NULL;
- walk_tree (&stmt, find_pos_in_stmt_1, &r_pos, NULL);
+ memset (&wi, 0, sizeof (wi));
+ wi.info = &r_pos;
+ walk_gimple_op (stmt, find_pos_in_stmt_1, &wi);
return r_pos.pos;
}
@@ -1003,16 +983,15 @@ replace_field_acc (struct field_access_site *acc, tree new_type)
new_acc = build_comp_ref (new_ref, field_id, new_type);
VEC_free (type_wrapper_t, heap, wrapper);
- if (TREE_CODE (acc->stmt) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_assign (acc->stmt))
{
- lhs = GIMPLE_STMT_OPERAND (acc->stmt, 0);
- rhs = GIMPLE_STMT_OPERAND (acc->stmt, 1);
-
-
+ lhs = gimple_assign_lhs (acc->stmt);
+ rhs = gimple_assign_rhs1 (acc->stmt);
+
if (lhs == acc->comp_ref)
- GIMPLE_STMT_OPERAND (acc->stmt, 0) = new_acc;
+ gimple_assign_set_lhs (acc->stmt, new_acc);
else if (rhs == acc->comp_ref)
- GIMPLE_STMT_OPERAND (acc->stmt, 1) = new_acc;
+ gimple_assign_set_rhs1 (acc->stmt, new_acc);
else
{
pos = find_pos_in_stmt (acc->stmt, acc->comp_ref);
@@ -1070,18 +1049,15 @@ find_structure (tree type)
like assignments: p.8_7 = p; or statements with rhs of
tree codes PLUS_EXPR and MINUS_EXPR. */
-static tree
-create_base_plus_offset (tree orig_stmt, tree new_type,
- tree offset)
+static gimple
+create_base_plus_offset (gimple orig_stmt, tree new_type, tree offset)
{
- tree lhs, rhs;
- tree new_lhs, new_rhs;
- tree new_stmt;
-
- gcc_assert (TREE_CODE (orig_stmt) == GIMPLE_MODIFY_STMT);
+ tree lhs;
+ tree new_lhs;
+ gimple new_stmt;
+ tree new_op0 = NULL_TREE, new_op1 = NULL_TREE;
- lhs = GIMPLE_STMT_OPERAND (orig_stmt, 0);
- rhs = GIMPLE_STMT_OPERAND (orig_stmt, 1);
+ lhs = gimple_assign_lhs (orig_stmt);
gcc_assert (TREE_CODE (lhs) == VAR_DECL
|| TREE_CODE (lhs) == SSA_NAME);
@@ -1090,15 +1066,14 @@ create_base_plus_offset (tree orig_stmt, tree new_type,
gcc_assert (new_lhs);
finalize_var_creation (new_lhs);
- switch (TREE_CODE (rhs))
+ switch (gimple_assign_rhs_code (orig_stmt))
{
case PLUS_EXPR:
case MINUS_EXPR:
case POINTER_PLUS_EXPR:
{
- tree op0 = TREE_OPERAND (rhs, 0);
- tree op1 = TREE_OPERAND (rhs, 1);
- tree new_op0 = NULL_TREE, new_op1 = NULL_TREE;
+ tree op0 = gimple_assign_rhs1 (orig_stmt);
+ tree op1 = gimple_assign_rhs2 (orig_stmt);
unsigned str0, str1;
unsigned length = VEC_length (structure, structures);
@@ -1116,9 +1091,6 @@ create_base_plus_offset (tree orig_stmt, tree new_type,
new_op0 = offset;
if (!new_op1)
new_op1 = offset;
-
- new_rhs = build2 (TREE_CODE (rhs), TREE_TYPE (new_op0),
- new_op0, new_op1);
}
break;
@@ -1126,8 +1098,9 @@ create_base_plus_offset (tree orig_stmt, tree new_type,
gcc_unreachable();
}
- new_stmt = build_gimple_modify_stmt (new_lhs, new_rhs);
- finalize_stmt (new_stmt);
+ new_stmt = gimple_build_assign_with_ops (gimple_assign_rhs_code (orig_stmt),
+ new_lhs, new_op0, new_op1);
+ finalize_stmt (new_stmt);
return new_stmt;
}
@@ -1140,9 +1113,10 @@ create_new_field_access (struct field_access_site *f_acc,
struct field_entry field)
{
tree new_type = field.field_mapping;
- tree new_stmt;
+ gimple new_stmt;
tree size_res;
- tree mult_stmt, cast_stmt;
+ gimple mult_stmt;
+ gimple cast_stmt;
tree cast_res = NULL;
if (f_acc->num)
@@ -1182,41 +1156,37 @@ create_new_field_access (struct field_access_site *f_acc,
variable located in the condition statement at the position POS. */
static void
-create_new_stmts_for_cond_expr_1 (tree new_var, tree cond_stmt, bool pos)
+create_new_stmts_for_cond_expr_1 (tree new_var, gimple cond_stmt, unsigned pos)
{
- tree new_cond;
- tree new_stmt;
+ gimple new_stmt;
edge true_e = NULL, false_e = NULL;
basic_block new_bb;
- tree stmt_list;
+ gimple_stmt_iterator si;
- extract_true_false_edges_from_block (bb_for_stmt (cond_stmt),
+ extract_true_false_edges_from_block (gimple_bb (cond_stmt),
&true_e, &false_e);
- new_cond = unshare_expr (COND_EXPR_COND (cond_stmt));
-
- TREE_OPERAND (new_cond, pos) = new_var;
-
- new_stmt = build3 (COND_EXPR, TREE_TYPE (cond_stmt),
- new_cond, NULL_TREE, NULL_TREE);
+ new_stmt = gimple_build_cond (gimple_cond_code (cond_stmt),
+ pos == 0 ? new_var : gimple_cond_lhs (cond_stmt),
+ pos == 1 ? new_var : gimple_cond_rhs (cond_stmt),
+ NULL_TREE,
+ NULL_TREE);
finalize_stmt (new_stmt);
/* Create new basic block after bb. */
- new_bb = create_empty_bb (bb_for_stmt (cond_stmt));
+ new_bb = create_empty_bb (gimple_bb (cond_stmt));
/* Add new condition stmt to the new_bb. */
- stmt_list = bb_stmt_list (new_bb);
- append_to_statement_list (new_stmt, &stmt_list);
- add_bb_info (new_bb, stmt_list);
+ si = gsi_start_bb (new_bb);
+ gsi_insert_after (&si, new_stmt, GSI_NEW_STMT);
-
/* Create false and true edges from new_bb. */
make_edge_and_fix_phis_of_dest (new_bb, true_e);
make_edge_and_fix_phis_of_dest (new_bb, false_e);
/* Redirect one of original edges to point to new_bb. */
- if (TREE_CODE (cond_stmt) == NE_EXPR)
+ if (gimple_cond_code (cond_stmt) == NE_EXPR)
redirect_edge_succ (true_e, new_bb);
else
redirect_edge_succ (false_e, new_bb);
@@ -1227,23 +1197,22 @@ create_new_stmts_for_cond_expr_1 (tree new_var, tree cond_stmt, bool pos)
recursively redirect edges to newly generated basic blocks. */
static void
-create_new_stmts_for_cond_expr (tree stmt)
+create_new_stmts_for_cond_expr (gimple stmt)
{
- tree cond = COND_EXPR_COND (stmt);
tree arg0, arg1, arg;
unsigned str0, str1;
bool s0, s1;
d_str str;
tree type;
- bool pos;
+ unsigned pos;
int i;
unsigned length = VEC_length (structure, structures);
- gcc_assert (TREE_CODE (cond) == EQ_EXPR
- || TREE_CODE (cond) == NE_EXPR);
+ gcc_assert (gimple_cond_code (stmt) == EQ_EXPR
+ || gimple_cond_code (stmt) == NE_EXPR);
- arg0 = TREE_OPERAND (cond, 0);
- arg1 = TREE_OPERAND (cond, 1);
+ arg0 = gimple_cond_lhs (stmt);
+ arg1 = gimple_cond_rhs (stmt);
str0 = find_structure (strip_type (get_type_of_var (arg0)));
str1 = find_structure (strip_type (get_type_of_var (arg1)));
@@ -1273,15 +1242,14 @@ create_new_stmts_for_cond_expr (tree stmt)
/* Create a new general access to replace original access ACC
for structure type NEW_TYPE. */
-static tree
+static gimple
create_general_new_stmt (struct access_site *acc, tree new_type)
{
- tree old_stmt = acc->stmt;
+ gimple old_stmt = acc->stmt;
tree var;
- tree new_stmt = unshare_expr (old_stmt);
+ gimple new_stmt = gimple_copy (old_stmt);
unsigned i;
-
for (i = 0; VEC_iterate (tree, acc->vars, i, var); i++)
{
tree *pos;
@@ -1291,32 +1259,30 @@ create_general_new_stmt (struct access_site *acc, tree new_type)
gcc_assert (new_var);
finalize_var_creation (new_var);
- if (TREE_CODE (new_stmt) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_assign (new_stmt))
{
-
- lhs = GIMPLE_STMT_OPERAND (new_stmt, 0);
- rhs = GIMPLE_STMT_OPERAND (new_stmt, 1);
+ lhs = gimple_assign_lhs (new_stmt);
if (TREE_CODE (lhs) == SSA_NAME)
lhs = SSA_NAME_VAR (lhs);
- if (TREE_CODE (rhs) == SSA_NAME)
- rhs = SSA_NAME_VAR (rhs);
+ if (gimple_assign_rhs_code (new_stmt) == SSA_NAME)
+ rhs = SSA_NAME_VAR (gimple_assign_rhs1 (new_stmt));
/* It can happen that rhs is a constructor.
Then we have to replace it to be of new_type. */
- if (TREE_CODE (rhs) == CONSTRUCTOR)
+ if (gimple_assign_rhs_code (new_stmt) == CONSTRUCTOR)
{
/* Dealing only with empty constructors right now. */
gcc_assert (VEC_empty (constructor_elt,
CONSTRUCTOR_ELTS (rhs)));
rhs = build_constructor (new_type, 0);
- GIMPLE_STMT_OPERAND (new_stmt, 1) = rhs;
+ gimple_assign_set_rhs1 (new_stmt, rhs);
}
if (lhs == var)
- GIMPLE_STMT_OPERAND (new_stmt, 0) = new_var;
+ gimple_assign_set_lhs (new_stmt, new_var);
else if (rhs == var)
- GIMPLE_STMT_OPERAND (new_stmt, 1) = new_var;
+ gimple_assign_set_rhs1 (new_stmt, new_var);
else
{
pos = find_pos_in_stmt (new_stmt, var);
@@ -1343,12 +1309,12 @@ static void
create_new_stmts_for_general_acc (struct access_site *acc, d_str str)
{
tree type;
- tree stmt = acc->stmt;
+ gimple stmt = acc->stmt;
unsigned i;
for (i = 0; VEC_iterate (tree, str->new_types, i, type); i++)
{
- tree new_stmt;
+ gimple new_stmt;
new_stmt = create_general_new_stmt (acc, type);
insert_after_stmt (stmt, new_stmt);
@@ -1361,10 +1327,10 @@ create_new_stmts_for_general_acc (struct access_site *acc, d_str str)
static void
create_new_general_access (struct access_site *acc, d_str str)
{
- tree stmt = acc->stmt;
- switch (TREE_CODE (stmt))
+ gimple stmt = acc->stmt;
+ switch (gimple_code (stmt))
{
- case COND_EXPR:
+ case GIMPLE_COND:
create_new_stmts_for_cond_expr (stmt);
break;
@@ -1391,7 +1357,7 @@ create_new_acc (void **slot, void *data)
basic_block bb = ((struct create_acc_data *)data)->bb;
d_str str = ((struct create_acc_data *)data)->str;
- if (bb_for_stmt (acc->stmt) == bb)
+ if (gimple_bb (acc->stmt) == bb)
create_new_general_access (acc, str);
return 1;
}
@@ -1407,7 +1373,7 @@ create_new_field_acc (void **slot, void *data)
d_str str = ((struct create_acc_data *)data)->str;
int i = ((struct create_acc_data *)data)->field_index;
- if (bb_for_stmt (f_acc->stmt) == bb)
+ if (gimple_bb (f_acc->stmt) == bb)
create_new_field_access (f_acc, str->fields[i]);
return 1;
}
@@ -1462,11 +1428,11 @@ dump_field_acc (void **slot, void *data ATTRIBUTE_UNUSED)
fprintf(dump_file, "\n");
if (f_acc->stmt)
- print_generic_stmt (dump_file, f_acc->stmt, 0);
+ print_gimple_stmt (dump_file, f_acc->stmt, 0, 0);
if (f_acc->ref_def_stmt)
- print_generic_stmt (dump_file, f_acc->ref_def_stmt, 0);
+ print_gimple_stmt (dump_file, f_acc->ref_def_stmt, 0, 0);
if (f_acc->cast_stmt)
- print_generic_stmt (dump_file, f_acc->cast_stmt, 0);
+ print_gimple_stmt (dump_file, f_acc->cast_stmt, 0, 0);
return 1;
}
@@ -1697,22 +1663,20 @@ free_field_accesses (htab_t f_accs)
The edge origin is CONTEXT function. */
static void
-update_cgraph_with_malloc_call (tree malloc_stmt, tree context)
+update_cgraph_with_malloc_call (gimple malloc_stmt, tree context)
{
- tree call_expr;
struct cgraph_node *src, *dest;
tree malloc_fn_decl;
if (!malloc_stmt)
return;
- call_expr = get_call_expr_in (malloc_stmt);
- malloc_fn_decl = get_callee_fndecl (call_expr);
+ malloc_fn_decl = gimple_call_fndecl (malloc_stmt);
src = cgraph_node (context);
dest = cgraph_node (malloc_fn_decl);
cgraph_create_edge (src, dest, malloc_stmt,
- 0, 0, bb_for_stmt (malloc_stmt)->loop_depth);
+ 0, 0, gimple_bb (malloc_stmt)->loop_depth);
}
/* This function generates set of statements required
@@ -1720,40 +1684,39 @@ update_cgraph_with_malloc_call (tree malloc_stmt, tree context)
The statements are stored in NEW_STMTS. The statement that contain
call to malloc is returned. MALLOC_STMT is an original call to malloc. */
-static tree
-create_new_malloc (tree malloc_stmt, tree new_type, tree *new_stmts, tree num)
+static gimple
+create_new_malloc (gimple malloc_stmt, tree new_type, gimple_seq *new_stmts,
+ tree num)
{
tree new_malloc_size;
- tree call_expr, malloc_fn_decl;
- tree new_stmt, malloc_res;
- tree call_stmt, final_stmt;
+ tree malloc_fn_decl;
+ gimple new_stmt;
+ tree malloc_res;
+ gimple call_stmt, final_stmt;
tree cast_res;
gcc_assert (num && malloc_stmt && new_type);
- *new_stmts = alloc_stmt_list ();
+ *new_stmts = gimple_seq_alloc ();
/* Generate argument to malloc as multiplication of num
and size of new_type. */
new_stmt = gen_size (num, new_type, &new_malloc_size);
- append_to_statement_list (new_stmt, new_stmts);
+ gimple_seq_add_stmt (new_stmts, new_stmt);
/* Generate new call for malloc. */
malloc_res = create_tmp_var (ptr_type_node, NULL);
+ add_referenced_var (malloc_res);
- if (malloc_res)
- add_referenced_var (malloc_res);
-
- call_expr = get_call_expr_in (malloc_stmt);
- malloc_fn_decl = get_callee_fndecl (call_expr);
- call_expr = build_call_expr (malloc_fn_decl, 1, new_malloc_size);
- call_stmt = build_gimple_modify_stmt (malloc_res, call_expr);
+ malloc_fn_decl = gimple_call_fndecl (malloc_stmt);
+ call_stmt = gimple_build_call (malloc_fn_decl, 1, new_malloc_size);
+ gimple_call_set_lhs (call_stmt, malloc_res);
finalize_stmt_and_append (new_stmts, call_stmt);
/* Create new cast statement. */
final_stmt = get_final_alloc_stmt (malloc_stmt);
gcc_assert (final_stmt);
new_stmt = gen_cast_stmt (malloc_res, new_type, final_stmt, &cast_res);
- append_to_statement_list (new_stmt, new_stmts);
+ gimple_seq_add_stmt (new_stmts, new_stmt);
return call_stmt;
}
@@ -1764,11 +1727,10 @@ create_new_malloc (tree malloc_stmt, tree new_type, tree *new_stmts, tree num)
they are filled into NEW_STMTS_P. */
static tree
-gen_num_of_structs_in_malloc (tree stmt, tree str_decl, tree *new_stmts_p)
+gen_num_of_structs_in_malloc (gimple stmt, tree str_decl,
+ gimple_seq *new_stmts_p)
{
- call_expr_arg_iterator iter;
tree arg;
- tree call_expr;
tree struct_size;
HOST_WIDE_INT struct_size_int;
@@ -1776,11 +1738,10 @@ gen_num_of_structs_in_malloc (tree stmt, tree str_decl, tree *new_stmts_p)
return NULL_TREE;
/* Get malloc argument. */
- call_expr = get_call_expr_in (stmt);
- if (!call_expr)
+ if (!is_gimple_call (stmt))
return NULL_TREE;
- arg = first_call_expr_arg (call_expr, &iter);
+ arg = gimple_call_arg (stmt, 0);
if (TREE_CODE (arg) != SSA_NAME
&& !TREE_CONSTANT (arg))
@@ -1793,7 +1754,8 @@ gen_num_of_structs_in_malloc (tree stmt, tree str_decl, tree *new_stmts_p)
if (TREE_CODE (arg) == SSA_NAME)
{
- tree num, div_stmt;
+ tree num;
+ gimple div_stmt;
if (is_result_of_mult (arg, &num, struct_size))
return num;
@@ -1804,23 +1766,16 @@ gen_num_of_structs_in_malloc (tree stmt, tree str_decl, tree *new_stmts_p)
add_referenced_var (num);
if (exact_log2 (struct_size_int) == -1)
- div_stmt = build_gimple_modify_stmt (num,
- build2 (TRUNC_DIV_EXPR,
- integer_type_node,
- arg, struct_size));
+ div_stmt = gimple_build_assign_with_ops (TRUNC_DIV_EXPR, num, arg,
+ struct_size);
else
{
tree C = build_int_cst (integer_type_node,
exact_log2 (struct_size_int));
- div_stmt =
- build_gimple_modify_stmt (num, build2 (RSHIFT_EXPR,
- integer_type_node,
- arg, C));
+ div_stmt = gimple_build_assign_with_ops (RSHIFT_EXPR, num, arg, C);
}
- *new_stmts_p = alloc_stmt_list ();
- append_to_statement_list (div_stmt,
- new_stmts_p);
+ gimple_seq_add_stmt (new_stmts_p, div_stmt);
finalize_stmt (div_stmt);
return num;
}
@@ -2049,7 +2004,7 @@ field_acc_hash (const void *x)
static int
field_acc_eq (const void *x, const void *y)
{
- return ((const struct field_access_site *)x)->stmt == (const_tree)y;
+ return ((const struct field_access_site *)x)->stmt == (const_gimple)y;
}
/* This function prints an access site, defined by SLOT. */
@@ -2063,7 +2018,7 @@ dump_acc (void **slot, void *data ATTRIBUTE_UNUSED)
fprintf(dump_file, "\n");
if (acc->stmt)
- print_generic_stmt (dump_file, acc->stmt, 0);
+ print_gimple_stmt (dump_file, acc->stmt, 0, 0);
fprintf(dump_file, " : ");
for (i = 0; VEC_iterate (tree, acc->vars, i, var); i++)
@@ -2146,35 +2101,33 @@ create_new_alloc_sites (fallocs_t m_data, tree context)
alloc_site_t *call;
unsigned j;
- for (j = 0;
- VEC_iterate (alloc_site_t, m_data->allocs, j, call); j++)
+ for (j = 0; VEC_iterate (alloc_site_t, m_data->allocs, j, call); j++)
{
- tree stmt = call->stmt;
+ gimple stmt = call->stmt;
d_str str = call->str;
tree num;
- tree new_stmts = NULL_TREE;
- tree last_stmt = get_final_alloc_stmt (stmt);
+ gimple_seq new_stmts = NULL;
+ gimple last_stmt = get_final_alloc_stmt (stmt);
unsigned i;
tree type;
num = gen_num_of_structs_in_malloc (stmt, str->decl, &new_stmts);
if (new_stmts)
{
- last_stmt = tsi_stmt (tsi_last (new_stmts));
- insert_after_stmt (last_stmt, new_stmts);
+ last_stmt = gimple_seq_last_stmt (new_stmts);
+ insert_seq_after_stmt (last_stmt, new_stmts);
}
/* Generate an allocation sites for each new structure type. */
- for (i = 0;
- VEC_iterate (tree, str->new_types, i, type); i++)
+ for (i = 0; VEC_iterate (tree, str->new_types, i, type); i++)
{
- tree new_malloc_stmt = NULL_TREE;
- tree last_stmt_tmp = NULL_TREE;
+ gimple new_malloc_stmt = NULL;
+ gimple last_stmt_tmp = NULL;
- new_stmts = NULL_TREE;
+ new_stmts = NULL;
new_malloc_stmt = create_new_malloc (stmt, type, &new_stmts, num);
- last_stmt_tmp = tsi_stmt (tsi_last (new_stmts));
- insert_after_stmt (last_stmt, new_stmts);
+ last_stmt_tmp = gimple_seq_last_stmt (new_stmts);
+ insert_seq_after_stmt (last_stmt, new_stmts);
update_cgraph_with_malloc_call (new_malloc_stmt, context);
last_stmt = last_stmt_tmp;
}
@@ -2304,7 +2257,7 @@ acc_hash (const void *x)
static int
acc_eq (const void *x, const void *y)
{
- return ((const struct access_site *)x)->stmt == (const_tree)y;
+ return ((const struct access_site *)x)->stmt == (const_gimple)y;
}
/* Given a structure declaration STRUCT_DECL, and number of fields
@@ -2405,25 +2358,19 @@ remove_structure (unsigned i)
COND_STMT is a condition statement to check. */
static bool
-is_safe_cond_expr (tree cond_stmt)
+is_safe_cond_expr (gimple cond_stmt)
{
-
tree arg0, arg1;
unsigned str0, str1;
bool s0, s1;
unsigned length = VEC_length (structure, structures);
- tree cond = COND_EXPR_COND (cond_stmt);
-
- if (TREE_CODE (cond) != EQ_EXPR
- && TREE_CODE (cond) != NE_EXPR)
+ if (gimple_cond_code (cond_stmt) != EQ_EXPR
+ && gimple_cond_code (cond_stmt) != NE_EXPR)
return false;
- if (TREE_CODE_LENGTH (TREE_CODE (cond)) != 2)
- return false;
-
- arg0 = TREE_OPERAND (cond, 0);
- arg1 = TREE_OPERAND (cond, 1);
+ arg0 = gimple_cond_lhs (cond_stmt);
+ arg1 = gimple_cond_rhs (cond_stmt);
str0 = find_structure (strip_type (get_type_of_var (arg0)));
str1 = find_structure (strip_type (get_type_of_var (arg1)));
@@ -2470,7 +2417,8 @@ exclude_from_accs (void **slot, void *data)
static tree
get_stmt_accesses (tree *tp, int *walk_subtrees, void *data)
{
- tree stmt = (tree) data;
+ struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
+ gimple stmt = (gimple) wi->info;
tree t = *tp;
if (!t)
@@ -2478,17 +2426,6 @@ get_stmt_accesses (tree *tp, int *walk_subtrees, void *data)
switch (TREE_CODE (t))
{
- case GIMPLE_MODIFY_STMT:
- {
- tree lhs = GIMPLE_STMT_OPERAND (t, 0);
- tree rhs = GIMPLE_STMT_OPERAND (t, 1);
- *walk_subtrees = 1;
- walk_tree (&lhs, get_stmt_accesses, data, NULL);
- walk_tree (&rhs, get_stmt_accesses, data, NULL);
- *walk_subtrees = 0;
- }
- break;
-
case BIT_FIELD_REF:
{
tree var = TREE_OPERAND(t, 0);
@@ -2549,7 +2486,7 @@ get_stmt_accesses (tree *tp, int *walk_subtrees, void *data)
print_generic_expr (dump_file, type, 0);
fprintf (dump_file,
" has complicate access in statement ");
- print_generic_stmt (dump_file, stmt, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
}
remove_structure (i);
@@ -2558,7 +2495,7 @@ get_stmt_accesses (tree *tp, int *walk_subtrees, void *data)
else
{
/* Increase count of field. */
- basic_block bb = bb_for_stmt (stmt);
+ basic_block bb = gimple_bb (stmt);
field->count += bb->count;
/* Add stmt to the acc_sites of field. */
@@ -2571,18 +2508,6 @@ get_stmt_accesses (tree *tp, int *walk_subtrees, void *data)
}
break;
- case MINUS_EXPR:
- case PLUS_EXPR:
- {
- tree op0 = TREE_OPERAND (t, 0);
- tree op1 = TREE_OPERAND (t, 1);
- *walk_subtrees = 1;
- walk_tree (&op0, get_stmt_accesses, data, NULL);
- walk_tree (&op1, get_stmt_accesses, data, NULL);
- *walk_subtrees = 0;
- }
- break;
-
case COND_EXPR:
{
tree cond = COND_EXPR_COND (t);
@@ -2618,14 +2543,6 @@ get_stmt_accesses (tree *tp, int *walk_subtrees, void *data)
}
break;
- case CALL_EXPR:
- {
- /* It was checked as part of stage1 that structures
- to be transformed cannot be passed as parameters of functions. */
- *walk_subtrees = 0;
- }
- break;
-
default:
return NULL;
}
@@ -3019,7 +2936,7 @@ add_structure (tree type)
allocates the structure represented by STR. */
static void
-add_alloc_site (tree fn_decl, tree stmt, d_str str)
+add_alloc_site (tree fn_decl, gimple stmt, d_str str)
{
fallocs_t fallocs = NULL;
alloc_site_t m_call;
@@ -3049,7 +2966,7 @@ add_alloc_site (tree fn_decl, tree stmt, d_str str)
if (dump_file)
{
fprintf (dump_file, "\nAdding stmt ");
- print_generic_stmt (dump_file, stmt, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
fprintf (dump_file, " to list of mallocs.");
}
}
@@ -3061,11 +2978,11 @@ add_alloc_site (tree fn_decl, tree stmt, d_str str)
Otherwise I_P contains the length of the vector of structures. */
static bool
-is_alloc_of_struct (tree stmt, unsigned *i_p)
+is_alloc_of_struct (gimple stmt, unsigned *i_p)
{
tree lhs;
tree type;
- tree final_stmt;
+ gimple final_stmt;
final_stmt = get_final_alloc_stmt (stmt);
@@ -3075,10 +2992,10 @@ is_alloc_of_struct (tree stmt, unsigned *i_p)
/* final_stmt should be of the form:
T.3 = (struct_type *) T.2; */
- if (TREE_CODE (final_stmt) != GIMPLE_MODIFY_STMT)
+ if (gimple_code (final_stmt) != GIMPLE_ASSIGN)
return false;
- lhs = GIMPLE_STMT_OPERAND (final_stmt, 0);
+ lhs = gimple_assign_lhs (final_stmt);
type = get_type_of_var (lhs);
@@ -3128,13 +3045,13 @@ safe_cond_expr_check (void **slot, void *data)
{
struct access_site *acc = *(struct access_site **) slot;
- if (TREE_CODE (acc->stmt) == COND_EXPR
+ if (gimple_code (acc->stmt) == GIMPLE_COND
&& !is_safe_cond_expr (acc->stmt))
{
if (dump_file)
{
fprintf (dump_file, "\nUnsafe conditional statement ");
- print_generic_stmt (dump_file, acc->stmt, 0);
+ print_gimple_stmt (dump_file, acc->stmt, 0, 0);
}
*(bool *) data = false;
return 0;
@@ -3163,21 +3080,25 @@ exclude_alloc_and_field_accs_1 (d_str str, struct cgraph_node *node)
static void
collect_accesses_in_bb (basic_block bb)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
+ struct walk_stmt_info wi;
+
+ memset (&wi, 0, sizeof (wi));
- for (bsi = bsi_start (bb); ! bsi_end_p (bsi); bsi_next (&bsi))
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (bsi);
/* In asm stmt we cannot always track the arguments,
so we just give up. */
- if (TREE_CODE (stmt) == ASM_EXPR)
+ if (gimple_code (stmt) == GIMPLE_ASM)
{
free_structures ();
break;
}
- walk_tree (&stmt, get_stmt_accesses, stmt, NULL);
+ wi.info = (void *) stmt;
+ walk_gimple_op (stmt, get_stmt_accesses, &wi);
}
}
@@ -3467,7 +3388,6 @@ program_redefines_malloc_p (void)
struct cgraph_edge *c_edge;
tree fndecl;
tree fndecl2;
- tree call_expr;
for (c_node = cgraph_nodes; c_node; c_node = c_node->next)
{
@@ -3475,17 +3395,16 @@ program_redefines_malloc_p (void)
for (c_edge = c_node->callees; c_edge; c_edge = c_edge->next_callee)
{
- call_expr = get_call_expr_in (c_edge->call_stmt);
c_node2 = c_edge->callee;
fndecl2 = c_node2->decl;
- if (call_expr)
+ if (is_gimple_call (c_edge->call_stmt))
{
const char * fname = get_name (fndecl2);
- if ((call_expr_flags (call_expr) & ECF_MALLOC) &&
- (DECL_FUNCTION_CODE (fndecl2) != BUILT_IN_MALLOC) &&
- (DECL_FUNCTION_CODE (fndecl2) != BUILT_IN_CALLOC) &&
- (DECL_FUNCTION_CODE (fndecl2) != BUILT_IN_ALLOCA))
+ if ((gimple_call_flags (c_edge->call_stmt) & ECF_MALLOC)
+ && (DECL_FUNCTION_CODE (fndecl2) != BUILT_IN_MALLOC)
+ && (DECL_FUNCTION_CODE (fndecl2) != BUILT_IN_CALLOC)
+ && (DECL_FUNCTION_CODE (fndecl2) != BUILT_IN_ALLOCA))
return true;
/* Check that there is no __builtin_object_size,
@@ -3527,15 +3446,15 @@ collect_alloc_sites (void)
{
for (cs = node->callees; cs; cs = cs->next_callee)
{
- tree stmt = cs->call_stmt;
+ gimple stmt = cs->call_stmt;
if (stmt)
{
- tree call = get_call_expr_in (stmt);
tree decl;
- if (call && (decl = get_callee_fndecl (call))
- && TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_call (stmt)
+ && (decl = gimple_call_fndecl (stmt))
+ && gimple_call_lhs (stmt))
{
unsigned i;
@@ -3555,7 +3474,7 @@ collect_alloc_sites (void)
{
fprintf (dump_file,
"\nUnsupported allocation function ");
- print_generic_stmt (dump_file, stmt, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
}
remove_structure (i);
}
@@ -4035,8 +3954,9 @@ reorg_structs_drive (void)
static bool
struct_reorg_gate (void)
{
- return flag_ipa_struct_reorg && flag_whole_program
- && (optimize > 0);
+ return flag_ipa_struct_reorg
+ && flag_whole_program
+ && (optimize > 0);
}
struct simple_ipa_opt_pass pass_ipa_struct_reorg =
diff --git a/gcc/ipa-struct-reorg.h b/gcc/ipa-struct-reorg.h
index 54cdbc9982f..a92d345ec92 100644
--- a/gcc/ipa-struct-reorg.h
+++ b/gcc/ipa-struct-reorg.h
@@ -37,15 +37,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
struct field_access_site
{
/* Statement in which the access site occurs. */
- tree stmt; /* D.2169_25 = D.2168_24->b; */
+ gimple stmt; /* D.2169_25 = D.2168_24->b; */
tree comp_ref; /* D.2168_24->b */
tree field_decl; /* b */
tree ref; /* D.2168_24 */
tree num; /* i.6_20 */
tree offset; /* D2167_22 */
tree base; /* p.5_23 */
- tree ref_def_stmt; /* D.2168_24 = D.2167_22 + p.5_23; */
- tree cast_stmt; /* D.2167_22 = (struct str_t *) D.2166_21;
+ gimple ref_def_stmt; /* D.2168_24 = D.2167_22 + p.5_23; */
+ gimple cast_stmt; /* D.2167_22 = (struct str_t *) D.2166_21;
This statement is not always present. */
};
@@ -53,7 +53,7 @@ struct field_access_site
struct access_site
{
/* A statement in which the access site occurs. */
- tree stmt;
+ gimple stmt;
/* A list of structure variables in the access site. */
VEC (tree, heap) *vars;
};
diff --git a/gcc/ipa-type-escape.c b/gcc/ipa-type-escape.c
index 229d8b2e9a5..48d95049b4f 100644
--- a/gcc/ipa-type-escape.c
+++ b/gcc/ipa-type-escape.c
@@ -47,7 +47,7 @@ along with GCC; see the file COPYING3. If not see
#include "ipa-utils.h"
#include "ipa-type-escape.h"
#include "c-common.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "cgraph.h"
#include "output.h"
#include "flags.h"
@@ -136,8 +136,8 @@ static bitmap_obstack ipa_obstack;
/* Static functions from this file that are used
before being defined. */
-static unsigned int look_for_casts (tree lhs ATTRIBUTE_UNUSED, tree);
-static bool is_cast_from_non_pointer (tree, tree, void *);
+static unsigned int look_for_casts (tree);
+static bool is_cast_from_non_pointer (tree, gimple, void *);
/* Get the name of TYPE or return the string "<UNNAMED>". */
static const char*
@@ -308,7 +308,7 @@ get_canon_type (tree type, bool see_thru_ptrs, bool see_thru_arrays)
while (POINTER_TYPE_P (type))
type = TYPE_MAIN_VARIANT (TREE_TYPE (type));
- result = splay_tree_lookup(type_to_canon_type, (splay_tree_key) type);
+ result = splay_tree_lookup (type_to_canon_type, (splay_tree_key) type);
if (result == NULL)
return discover_unique_type (type);
@@ -663,9 +663,7 @@ check_cast_type (tree to_type, tree from_type)
static bool
is_malloc_result (tree var)
{
- tree def_stmt;
- tree rhs;
- int flags;
+ gimple def_stmt;
if (!var)
return false;
@@ -675,20 +673,13 @@ is_malloc_result (tree var)
def_stmt = SSA_NAME_DEF_STMT (var);
- if (TREE_CODE (def_stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_call (def_stmt))
return false;
- if (var != GIMPLE_STMT_OPERAND (def_stmt, 0))
+ if (var != gimple_call_lhs (def_stmt))
return false;
- rhs = get_call_expr_in (def_stmt);
-
- if (!rhs)
- return false;
-
- flags = call_expr_flags (rhs);
-
- return ((flags & ECF_MALLOC) != 0);
+ return ((gimple_call_flags (def_stmt) & ECF_MALLOC) != 0);
}
@@ -769,115 +760,98 @@ check_cast (tree to_type, tree from)
return cast;
}
-typedef struct cast
-{
- int type;
- tree stmt;
-}cast_t;
-
-/* This function is a callback for walk_tree called from
- is_cast_from_non_pointer. The data->type is set to be:
- 0 - if there is no cast
- number - the number of casts from non-pointer type
- -1 - if there is a cast that makes the type to escape
+/* Scan assignment statement S to see if there are any casts within it. */
- If data->type = number, then data->stmt will contain the
- last casting stmt met in traversing. */
-
-static tree
-is_cast_from_non_pointer_1 (tree *tp, int *walk_subtrees, void *data)
+static unsigned int
+look_for_casts_stmt (gimple s)
{
- tree def_stmt = *tp;
+ unsigned int cast = 0;
+ gcc_assert (is_gimple_assign (s));
- if (pointer_set_insert (visited_stmts, def_stmt))
+ if (gimple_assign_cast_p (s))
{
- *walk_subtrees = 0;
- return NULL;
+ tree castfromvar = gimple_assign_rhs1 (s);
+ cast |= check_cast (TREE_TYPE (gimple_assign_lhs (s)), castfromvar);
}
-
- switch (TREE_CODE (def_stmt))
+ else
{
- case GIMPLE_MODIFY_STMT:
- {
- use_operand_p use_p;
- ssa_op_iter iter;
- tree lhs = GIMPLE_STMT_OPERAND (def_stmt, 0);
- tree rhs = GIMPLE_STMT_OPERAND (def_stmt, 1);
-
- unsigned int cast = look_for_casts (lhs, rhs);
- /* Check that only one cast happened, and it's of
- non-pointer type. */
- if ((cast & CT_FROM_NON_P) == (CT_FROM_NON_P)
- && (cast & ~(CT_FROM_NON_P)) == 0)
- {
- ((cast_t *)data)->stmt = def_stmt;
- ((cast_t *)data)->type++;
-
- FOR_EACH_SSA_USE_OPERAND (use_p, def_stmt, iter, SSA_OP_ALL_USES)
- {
- walk_use_def_chains (USE_FROM_PTR (use_p), is_cast_from_non_pointer,
- data, false);
- if (((cast_t*)data)->type == -1)
- return def_stmt;
- }
- }
-
- /* Check that there is no cast, or cast is not harmful. */
- else if ((cast & CT_NO_CAST) == (CT_NO_CAST)
- || (cast & CT_DOWN) == (CT_DOWN)
- || (cast & CT_UP) == (CT_UP)
- || (cast & CT_USELESS) == (CT_USELESS)
- || (cast & CT_FROM_MALLOC) == (CT_FROM_MALLOC))
- {
- FOR_EACH_SSA_USE_OPERAND (use_p, def_stmt, iter, SSA_OP_ALL_USES)
- {
- walk_use_def_chains (USE_FROM_PTR (use_p), is_cast_from_non_pointer,
- data, false);
- if (((cast_t*)data)->type == -1)
- return def_stmt;
- }
- }
+ size_t i;
+ for (i = 0; i < gimple_num_ops (s); i++)
+ cast |= look_for_casts (gimple_op (s, i));
+ }
- /* The cast is harmful. */
- else
- {
- ((cast_t *)data)->type = -1;
- return def_stmt;
- }
+ if (!cast)
+ cast = CT_NO_CAST;
- *walk_subtrees = 0;
- }
- break;
+ return cast;
+}
- default:
- {
- *walk_subtrees = 0;
- break;
- }
- }
- return NULL;
-}
+typedef struct cast
+{
+ int type;
+ gimple stmt;
+} cast_t;
/* This function is a callback for walk_use_def_chains function called
from is_array_access_through_pointer_and_index. */
static bool
-is_cast_from_non_pointer (tree var, tree def_stmt, void *data)
+is_cast_from_non_pointer (tree var, gimple def_stmt, void *data)
{
-
if (!def_stmt || !var)
return false;
- if (TREE_CODE (def_stmt) == PHI_NODE)
+ if (gimple_code (def_stmt) == GIMPLE_PHI)
return false;
if (SSA_NAME_IS_DEFAULT_DEF (var))
return false;
- walk_tree (&def_stmt, is_cast_from_non_pointer_1, data, NULL);
+ if (is_gimple_assign (def_stmt))
+ {
+ use_operand_p use_p;
+ ssa_op_iter iter;
+ unsigned int cast = look_for_casts_stmt (def_stmt);
+
+ /* Check that only one cast happened, and it's of non-pointer
+ type. */
+ if ((cast & CT_FROM_NON_P) == (CT_FROM_NON_P)
+ && (cast & ~(CT_FROM_NON_P)) == 0)
+ {
+ ((cast_t *)data)->stmt = def_stmt;
+ ((cast_t *)data)->type++;
+
+ FOR_EACH_SSA_USE_OPERAND (use_p, def_stmt, iter, SSA_OP_ALL_USES)
+ {
+ walk_use_def_chains (USE_FROM_PTR (use_p),
+ is_cast_from_non_pointer, data, false);
+ if (((cast_t*)data)->type == -1)
+ break;
+ }
+ }
+ /* Check that there is no cast, or cast is not harmful. */
+ else if ((cast & CT_NO_CAST) == (CT_NO_CAST)
+ || (cast & CT_DOWN) == (CT_DOWN)
+ || (cast & CT_UP) == (CT_UP)
+ || (cast & CT_USELESS) == (CT_USELESS)
+ || (cast & CT_FROM_MALLOC) == (CT_FROM_MALLOC))
+ {
+ FOR_EACH_SSA_USE_OPERAND (use_p, def_stmt, iter, SSA_OP_ALL_USES)
+ {
+ walk_use_def_chains (USE_FROM_PTR (use_p),
+ is_cast_from_non_pointer, data, false);
+ if (((cast_t*)data)->type == -1)
+ break;
+ }
+ }
+ /* The cast is harmful. */
+ else
+ ((cast_t *)data)->type = -1;
+ }
+
if (((cast_t*)data)->type == -1)
return true;
@@ -930,9 +904,10 @@ is_cast_from_non_pointer (tree var, tree def_stmt, void *data)
bool
is_array_access_through_pointer_and_index (enum tree_code code, tree op0,
tree op1, tree *base, tree *offset,
- tree *offset_cast_stmt)
+ gimple *offset_cast_stmt)
{
- tree before_cast, before_cast_def_stmt;
+ tree before_cast;
+ gimple before_cast_def_stmt;
cast_t op0_cast, op1_cast;
*base = NULL;
@@ -1014,26 +989,23 @@ is_array_access_through_pointer_and_index (enum tree_code code, tree op0,
/* before_cast_def_stmt should be of the form:
D.1605_6 = i.1_5 * 16; */
- if (TREE_CODE (before_cast_def_stmt) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_assign (before_cast_def_stmt))
{
- tree lhs = GIMPLE_STMT_OPERAND (before_cast_def_stmt,0);
- tree rhs = GIMPLE_STMT_OPERAND (before_cast_def_stmt,1);
-
/* We expect temporary here. */
- if (!is_gimple_reg (lhs))
+ if (!is_gimple_reg (gimple_assign_lhs (before_cast_def_stmt)))
return false;
- if (TREE_CODE (rhs) == MULT_EXPR)
+ if (gimple_assign_rhs_code (before_cast_def_stmt) == MULT_EXPR)
{
- tree arg0 = TREE_OPERAND (rhs, 0);
- tree arg1 = TREE_OPERAND (rhs, 1);
+ tree arg0 = gimple_assign_rhs1 (before_cast_def_stmt);
+ tree arg1 = gimple_assign_rhs2 (before_cast_def_stmt);
tree unit_size =
TYPE_SIZE_UNIT (TREE_TYPE (TYPE_MAIN_VARIANT (TREE_TYPE (op0))));
if (!(CONSTANT_CLASS_P (arg0)
- && simple_cst_equal (arg0,unit_size))
+ && simple_cst_equal (arg0, unit_size))
&& !(CONSTANT_CLASS_P (arg1)
- && simple_cst_equal (arg1,unit_size)))
+ && simple_cst_equal (arg1, unit_size)))
return false;
}
else
@@ -1173,7 +1145,11 @@ check_tree (tree t)
check_tree (TREE_OPERAND (t, 0));
if (SSA_VAR_P (t) || (TREE_CODE (t) == FUNCTION_DECL))
- check_operand (t);
+ {
+ check_operand (t);
+ if (DECL_P (t) && DECL_INITIAL (t))
+ check_tree (DECL_INITIAL (t));
+ }
}
/* Create an address_of edge FROM_TYPE.TO_TYPE. */
@@ -1260,15 +1236,13 @@ look_for_address_of (tree t)
}
-/* Scan tree T to see if there are any casts within it.
- LHS Is the LHS of the expression involving the cast. */
+/* Scan tree T to see if there are any casts within it. */
static unsigned int
-look_for_casts (tree lhs ATTRIBUTE_UNUSED, tree t)
+look_for_casts (tree t)
{
unsigned int cast = 0;
-
if (is_gimple_cast (t) || TREE_CODE (t) == VIEW_CONVERT_EXPR)
{
tree castfromvar = TREE_OPERAND (t, 0);
@@ -1302,7 +1276,7 @@ static void
check_rhs_var (tree t)
{
look_for_address_of (t);
- check_tree(t);
+ check_tree (t);
}
/* Check to see if T is an assignment to a static var we are
@@ -1311,7 +1285,7 @@ check_rhs_var (tree t)
static void
check_lhs_var (tree t)
{
- check_tree(t);
+ check_tree (t);
}
/* This is a scaled down version of get_asm_expr_operands from
@@ -1322,35 +1296,15 @@ check_lhs_var (tree t)
analyzed and STMT is the actual asm statement. */
static void
-get_asm_expr_operands (tree stmt)
+check_asm (gimple stmt)
{
- int noutputs = list_length (ASM_OUTPUTS (stmt));
- const char **oconstraints
- = (const char **) alloca ((noutputs) * sizeof (const char *));
- int i;
- tree link;
- const char *constraint;
- bool allows_mem, allows_reg, is_inout;
-
- for (i=0, link = ASM_OUTPUTS (stmt); link; ++i, link = TREE_CHAIN (link))
- {
- oconstraints[i] = constraint
- = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
- parse_output_constraint (&constraint, i, 0, 0,
- &allows_mem, &allows_reg, &is_inout);
-
- check_lhs_var (TREE_VALUE (link));
- }
+ size_t i;
- for (link = ASM_INPUTS (stmt); link; link = TREE_CHAIN (link))
- {
- constraint
- = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
- parse_input_constraint (&constraint, 0, 0, noutputs, 0,
- oconstraints, &allows_mem, &allows_reg);
-
- check_rhs_var (TREE_VALUE (link));
- }
+ for (i = 0; i < gimple_asm_noutputs (stmt); i++)
+ check_lhs_var (gimple_asm_output_op (stmt, i));
+
+ for (i = 0; i < gimple_asm_ninputs (stmt); i++)
+ check_rhs_var (gimple_asm_input_op (stmt, i));
/* There is no code here to check for asm memory clobbers. The
casual maintainer might think that such code would be necessary,
@@ -1360,22 +1314,22 @@ get_asm_expr_operands (tree stmt)
assumed to already escape. So, we are protected here. */
}
-/* Check the parameters of a function call to CALL_EXPR to mark the
+
+/* Check the parameters of function call to CALL to mark the
types that pass across the function boundary. Also check to see if
this is either an indirect call, a call outside the compilation
unit. */
static void
-check_call (tree call_expr)
+check_call (gimple call)
{
- tree operand;
- tree callee_t = get_callee_fndecl (call_expr);
+ tree callee_t = gimple_call_fndecl (call);
struct cgraph_node* callee;
enum availability avail = AVAIL_NOT_AVAILABLE;
- call_expr_arg_iterator iter;
+ size_t i;
- FOR_EACH_CALL_EXPR_ARG (operand, iter, call_expr)
- check_rhs_var (operand);
+ for (i = 0; i < gimple_call_num_args (call); i++)
+ check_rhs_var (gimple_call_arg (call, i));
if (callee_t)
{
@@ -1388,12 +1342,11 @@ check_call (tree call_expr)
parameters. */
if (TYPE_ARG_TYPES (TREE_TYPE (callee_t)))
{
- for (arg_type = TYPE_ARG_TYPES (TREE_TYPE (callee_t)),
- operand = first_call_expr_arg (call_expr, &iter);
+ for (arg_type = TYPE_ARG_TYPES (TREE_TYPE (callee_t)), i = 0;
arg_type && TREE_VALUE (arg_type) != void_type_node;
- arg_type = TREE_CHAIN (arg_type),
- operand = next_call_expr_arg (&iter))
+ arg_type = TREE_CHAIN (arg_type), i++)
{
+ tree operand = gimple_call_arg (call, i);
if (operand)
{
last_arg_type = TREE_VALUE(arg_type);
@@ -1411,15 +1364,14 @@ check_call (tree call_expr)
/* FIXME - According to Geoff Keating, we should never
have to do this; the front ends should always process
the arg list from the TYPE_ARG_LIST. */
- for (arg_type = DECL_ARGUMENTS (callee_t),
- operand = first_call_expr_arg (call_expr, &iter);
+ for (arg_type = DECL_ARGUMENTS (callee_t), i = 0;
arg_type;
- arg_type = TREE_CHAIN (arg_type),
- operand = next_call_expr_arg (&iter))
+ arg_type = TREE_CHAIN (arg_type), i++)
{
+ tree operand = gimple_call_arg (call, i);
if (operand)
{
- last_arg_type = TREE_TYPE(arg_type);
+ last_arg_type = TREE_TYPE (arg_type);
check_cast (last_arg_type, operand);
}
else
@@ -1433,10 +1385,9 @@ check_call (tree call_expr)
/* In the case where we have a var_args function, we need to
check the remaining parameters against the last argument. */
arg_type = last_arg_type;
- for (;
- operand != NULL_TREE;
- operand = next_call_expr_arg (&iter))
+ for ( ; i < gimple_call_num_args (call); i++)
{
+ tree operand = gimple_call_arg (call, i);
if (arg_type)
check_cast (arg_type, operand);
else
@@ -1457,16 +1408,16 @@ check_call (tree call_expr)
are any bits available for the callee (such as by declaration or
because it is builtin) and process solely on the basis of those
bits. */
-
if (avail == AVAIL_NOT_AVAILABLE || avail == AVAIL_OVERWRITABLE)
{
/* If this is a direct call to an external function, mark all of
the parameter and return types. */
- FOR_EACH_CALL_EXPR_ARG (operand, iter, call_expr)
+ for (i = 0; i < gimple_call_num_args (call); i++)
{
+ tree operand = gimple_call_arg (call, i);
tree type = get_canon_type (TREE_TYPE (operand), false, false);
mark_interesting_type (type, EXPOSED_PARAMETER);
- }
+ }
if (callee_t)
{
@@ -1494,7 +1445,8 @@ okay_pointer_operation (enum tree_code code, tree op0, tree op1)
case PLUS_EXPR:
case POINTER_PLUS_EXPR:
{
- tree base, offset, offset_cast_stmt;
+ tree base, offset;
+ gimple offset_cast_stmt;
if (POINTER_TYPE_P (op0type)
&& TREE_CODE (op0) == SSA_NAME
@@ -1528,150 +1480,124 @@ okay_pointer_operation (enum tree_code code, tree op0, tree op1)
return false;
}
-/* TP is the part of the tree currently under the microscope.
- WALK_SUBTREES is part of the walk_tree api but is unused here.
- DATA is cgraph_node of the function being walked. */
-/* FIXME: When this is converted to run over SSA form, this code
- should be converted to use the operand scanner. */
-static tree
-scan_for_refs (tree *tp, int *walk_subtrees, void *data)
+/* Helper for scan_for_refs. Check the operands of an assignment to
+ mark types that may escape. */
+
+static void
+check_assign (gimple t)
{
- struct cgraph_node *fn = (struct cgraph_node *) data;
- tree t = *tp;
+ /* First look on the lhs and see what variable is stored to */
+ check_lhs_var (gimple_assign_lhs (t));
+
+ /* For the purposes of figuring out what the cast affects */
- switch (TREE_CODE (t))
+ /* Next check the operands on the rhs to see if they are ok. */
+ switch (TREE_CODE_CLASS (gimple_assign_rhs_code (t)))
{
- case VAR_DECL:
- if (DECL_INITIAL (t))
- walk_tree (&DECL_INITIAL (t), scan_for_refs, fn, visited_nodes);
- *walk_subtrees = 0;
+ case tcc_binary:
+ {
+ tree op0 = gimple_assign_rhs1 (t);
+ tree type0 = get_canon_type (TREE_TYPE (op0), false, false);
+ tree op1 = gimple_assign_rhs2 (t);
+ tree type1 = get_canon_type (TREE_TYPE (op1), false, false);
+
+ /* If this is pointer arithmetic of any bad sort, then
+ we need to mark the types as bad. For binary
+ operations, no binary operator we currently support
+ is always "safe" in regard to what it would do to
+ pointers for purposes of determining which types
+ escape, except operations of the size of the type.
+ It is possible that min and max under the right set
+ of circumstances and if the moon is in the correct
+ place could be safe, but it is hard to see how this
+ is worth the effort. */
+ if (type0 && POINTER_TYPE_P (type0)
+ && !okay_pointer_operation (gimple_assign_rhs_code (t), op0, op1))
+ mark_interesting_type (type0, FULL_ESCAPE);
+
+ if (type1 && POINTER_TYPE_P (type1)
+ && !okay_pointer_operation (gimple_assign_rhs_code (t), op1, op0))
+ mark_interesting_type (type1, FULL_ESCAPE);
+
+ look_for_casts (op0);
+ look_for_casts (op1);
+ check_rhs_var (op0);
+ check_rhs_var (op1);
+ }
break;
- case GIMPLE_MODIFY_STMT:
+ case tcc_unary:
{
- /* First look on the lhs and see what variable is stored to */
- tree lhs = GIMPLE_STMT_OPERAND (t, 0);
- tree rhs = GIMPLE_STMT_OPERAND (t, 1);
+ tree op0 = gimple_assign_rhs1 (t);
+ tree type0 = get_canon_type (TREE_TYPE (op0), false, false);
+
+ /* For unary operations, if the operation is NEGATE or ABS on
+ a pointer, this is also considered pointer arithmetic and
+ thus, bad for business. */
+ if (type0
+ && POINTER_TYPE_P (type0)
+ && (TREE_CODE (op0) == NEGATE_EXPR
+ || TREE_CODE (op0) == ABS_EXPR))
+ mark_interesting_type (type0, FULL_ESCAPE);
+
+ check_rhs_var (op0);
+ look_for_casts (op0);
+ }
+ break;
- check_lhs_var (lhs);
- check_cast (TREE_TYPE (lhs), rhs);
+ case tcc_reference:
+ look_for_casts (gimple_assign_rhs1 (t));
+ check_rhs_var (gimple_assign_rhs1 (t));
+ break;
- /* For the purposes of figuring out what the cast affects */
+ case tcc_declaration:
+ check_rhs_var (gimple_assign_rhs1 (t));
+ break;
- /* Next check the operands on the rhs to see if they are ok. */
- switch (TREE_CODE_CLASS (TREE_CODE (rhs)))
- {
- case tcc_binary:
- {
- tree op0 = TREE_OPERAND (rhs, 0);
- tree type0 = get_canon_type (TREE_TYPE (op0), false, false);
- tree op1 = TREE_OPERAND (rhs, 1);
- tree type1 = get_canon_type (TREE_TYPE (op1), false, false);
-
- /* If this is pointer arithmetic of any bad sort, then
- we need to mark the types as bad. For binary
- operations, no binary operator we currently support
- is always "safe" in regard to what it would do to
- pointers for purposes of determining which types
- escape, except operations of the size of the type.
- It is possible that min and max under the right set
- of circumstances and if the moon is in the correct
- place could be safe, but it is hard to see how this
- is worth the effort. */
-
- if (type0 && POINTER_TYPE_P (type0)
- && !okay_pointer_operation (TREE_CODE (rhs), op0, op1))
- mark_interesting_type (type0, FULL_ESCAPE);
- if (type1 && POINTER_TYPE_P (type1)
- && !okay_pointer_operation (TREE_CODE (rhs), op1, op0))
- mark_interesting_type (type1, FULL_ESCAPE);
-
- look_for_casts (lhs, op0);
- look_for_casts (lhs, op1);
- check_rhs_var (op0);
- check_rhs_var (op1);
- }
- break;
- case tcc_unary:
- {
- tree op0 = TREE_OPERAND (rhs, 0);
- tree type0 = get_canon_type (TREE_TYPE (op0), false, false);
- /* For unary operations, if the operation is NEGATE or
- ABS on a pointer, this is also considered pointer
- arithmetic and thus, bad for business. */
- if (type0 && (TREE_CODE (op0) == NEGATE_EXPR
- || TREE_CODE (op0) == ABS_EXPR)
- && POINTER_TYPE_P (type0))
- {
- mark_interesting_type (type0, FULL_ESCAPE);
- }
- check_rhs_var (op0);
- look_for_casts (lhs, op0);
- look_for_casts (lhs, rhs);
- }
+ case tcc_expression:
+ if (gimple_assign_rhs_code (t) == ADDR_EXPR)
+ {
+ tree rhs = gimple_assign_rhs1 (t);
+ look_for_casts (TREE_OPERAND (rhs, 0));
+ check_rhs_var (rhs);
+ }
+ break;
- break;
- case tcc_reference:
- look_for_casts (lhs, rhs);
- check_rhs_var (rhs);
- break;
- case tcc_declaration:
- check_rhs_var (rhs);
- break;
- case tcc_expression:
- switch (TREE_CODE (rhs))
- {
- case ADDR_EXPR:
- look_for_casts (lhs, TREE_OPERAND (rhs, 0));
- check_rhs_var (rhs);
- break;
- default:
- break;
- }
- break;
- case tcc_vl_exp:
- switch (TREE_CODE (rhs))
- {
- case CALL_EXPR:
- /* If this is a call to malloc, squirrel away the
- result so we do mark the resulting cast as being
- bad. */
- check_call (rhs);
- break;
- default:
- break;
- }
- break;
- default:
- break;
- }
- *walk_subtrees = 0;
- }
+ default:
break;
+ }
+}
+
- case ADDR_EXPR:
- /* This case is here to find addresses on rhs of constructors in
- decl_initial of static variables. */
- check_rhs_var (t);
- *walk_subtrees = 0;
+/* Scan statement T for references to types and mark anything
+ interesting. */
+
+static void
+scan_for_refs (gimple t)
+{
+ switch (gimple_code (t))
+ {
+ case GIMPLE_ASSIGN:
+ check_assign (t);
break;
- case CALL_EXPR:
+ case GIMPLE_CALL:
+ /* If this is a call to malloc, squirrel away the result so we
+ do mark the resulting cast as being bad. */
check_call (t);
- *walk_subtrees = 0;
break;
- case ASM_EXPR:
- get_asm_expr_operands (t);
- *walk_subtrees = 0;
+ case GIMPLE_ASM:
+ check_asm (t);
break;
default:
break;
}
- return NULL;
+
+ return;
}
@@ -1721,7 +1647,7 @@ analyze_variable (struct varpool_node *vnode)
gcc_assert (TREE_CODE (global) == VAR_DECL);
if (DECL_INITIAL (global))
- walk_tree (&DECL_INITIAL (global), scan_for_refs, NULL, visited_nodes);
+ check_tree (DECL_INITIAL (global));
}
/* This is the main routine for finding the reference patterns for
@@ -1742,10 +1668,9 @@ analyze_function (struct cgraph_node *fn)
FOR_EACH_BB_FN (this_block, this_cfun)
{
- block_stmt_iterator bsi;
- for (bsi = bsi_start (this_block); !bsi_end_p (bsi); bsi_next (&bsi))
- walk_tree (bsi_stmt_ptr (bsi), scan_for_refs,
- fn, visited_nodes);
+ gimple_stmt_iterator gsi;
+ for (gsi = gsi_start_bb (this_block); !gsi_end_p (gsi); gsi_next (&gsi))
+ scan_for_refs (gsi_stmt (gsi));
}
}
@@ -1761,8 +1686,7 @@ analyze_function (struct cgraph_node *fn)
if (TREE_CODE (var) == VAR_DECL
&& DECL_INITIAL (var)
&& !TREE_STATIC (var))
- walk_tree (&DECL_INITIAL (var), scan_for_refs,
- fn, visited_nodes);
+ check_tree (DECL_INITIAL (var));
get_canon_type (TREE_TYPE (var), false, false);
}
}
@@ -2192,7 +2116,7 @@ type_escape_execute (void)
static bool
gate_type_escape_vars (void)
{
- return (flag_unit_at_a_time != 0 && flag_ipa_type_escape
+ return (flag_ipa_type_escape
/* Don't bother doing anything if the program has errors. */
&& !(errorcount || sorrycount));
}
@@ -2215,4 +2139,3 @@ struct simple_ipa_opt_pass pass_ipa_type_escape =
0 /* todo_flags_finish */
}
};
-
diff --git a/gcc/ipa-type-escape.h b/gcc/ipa-type-escape.h
index c851a2707be..13c3b725c89 100644
--- a/gcc/ipa-type-escape.h
+++ b/gcc/ipa-type-escape.h
@@ -23,11 +23,11 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
bool ipa_type_escape_type_contained_p (tree type);
-bool ipa_type_escape_field_does_not_clobber_p (tree record_type, tree field_type);
+bool ipa_type_escape_field_does_not_clobber_p (tree, tree);
int ipa_type_escape_star_count_of_interesting_type (tree type);
int ipa_type_escape_star_count_of_interesting_or_array_type (tree type);
bool is_array_access_through_pointer_and_index (enum tree_code, tree, tree,
- tree *, tree *, tree *);
+ tree *, tree *, gimple *);
#endif /* GCC_IPA_TYPE_ESCAPE_H */
diff --git a/gcc/ipa-utils.c b/gcc/ipa-utils.c
index 2a9562935c3..729a84d8710 100644
--- a/gcc/ipa-utils.c
+++ b/gcc/ipa-utils.c
@@ -32,7 +32,7 @@ along with GCC; see the file COPYING3. If not see
#include "ipa-utils.h"
#include "ipa-reference.h"
#include "c-common.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "cgraph.h"
#include "output.h"
#include "flags.h"
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index fd98969a355..6178327d369 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,87 @@
+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
+ Invariant Section.
+
+2008-07-29 Jakub Jelinek <jakub@redhat.com>
+
+ * class.c (build_utf8_ref): Set DECL_SIZE and DECL_SIZE_UNIT
+ from ctype's sizes.
+
+ * class.c (build_utf8_ref): Pad initializer string to utf8const_type's
+ alignment.
+
+2008-07-29 Jan Hubicka <jh@suse.cz>
+
+ * lang.c (java_post_options): Remove handling of flag_no_inline.
+
+2008-07-28 Richard Guenther <rguenther@suse.de>
+
+ Merge from gimple-tuples-branch.
+
+ 2008-07-18 Richard Guenther <rguenther@suse.de>
+
+ * expr.c: Include tree-iterator.h.
+ * Make-lang.in (expr.o): Add tree-iterator.h dependency.
+
+ 2008-07-18 Aldy Hernandez <aldyh@redhat.com>
+
+ * java-gimplify.c: Include gimple.h instead of tree-gimple.h.
+ * expr.c: Same.
+
+ 2008-07-14 Aldy Hernandez <aldyh@redhat.com>
+
+ * java-gimplify.c (java_gimplify_expr): Same.
+ (java_gimplify_modify_expr): Same.
+ * java-tree.h: Rename GENERIC_NEXT to TREE_CHAIN.
+
+ 2008-05-02 Diego Novillo <dnovillo@google.com>
+
+ * expr.c (build_java_throw_out_of_bounds_exception): Fix
+ mixed declarations and code.
+
+ 2008-05-02 Doug Kwan <dougkwan@google.com>
+
+ * expr.c (build_java_throw_out_of_bounds_exception ): Wrap call to
+ _Jv_ThrowBadArrayIndex with a COMPOUND_EXPR to return 0.
+
+ 2008-02-19 Diego Novillo <dnovillo@google.com>
+
+ http://gcc.gnu.org/ml/gcc-patches/2008-02/msg00804.html
+
+ * java-gimplify.c (java_gimplify_self_mod_expr): Change
+ gimple_seq arguments to gimple_seq *. Update all users.
+
+ 2007-11-26 Aldy Hernandez <aldyh@redhat.com>
+
+ * java-gimplify.c (java_gimplify_expr): Make pre_p and post_p
+ sequences.
+ (java_gimplify_self_mod_expr): Same.
+ * java-tree.h (java_gimplify_expr): Make pre_p and post_p
+ sequences.
+
+2008-07-24 Jan Hubicka <jh@suse.cz>
+
+ * java/decl.c: Include cgraph.h
+ (end_java_method): Remove non-unit-at-a-time code.
+ (java_mark_decl_local): Likewise; sanity check that we don't touch
+ finalized nodes.
+
2008-07-15 Jan Hubicka <jh@suse.cz>
* lang.c (java_init_options): Enable unit-at-a-time by default.
diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in
index c5446db6569..f188c7d788d 100644
--- a/gcc/java/Make-lang.in
+++ b/gcc/java/Make-lang.in
@@ -269,7 +269,8 @@ java/except.o: java/except.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h $(REAL_H) \
java/expr.o: java/expr.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h $(REAL_H) \
$(RTL_H) $(EXPR_H) java/javaop.h java/java-opcodes.h except.h \
java/java-except.h java/java-except.h java/parse.h toplev.h \
- $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) gt-java-expr.h $(TARGET_H)
+ $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) gt-java-expr.h $(TARGET_H) \
+ tree-iterator.h
java/jcf-depend.o: java/jcf-depend.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) java/jcf.h
java/jcf-parse.o: java/jcf-parse.c $(CONFIG_H) $(JAVA_TREE_H) $(FLAGS_H) \
@@ -298,7 +299,7 @@ java/verify-impl.o: java/verify-impl.c $(CONFIG_H) java/verify.h $(SYSTEM_H) \
java/zextract.o: java/zextract.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
java/zipfile.h
java/java-gimplify.o: java/java-gimplify.c $(CONFIG_H) $(SYSTEM_H) \
- coretypes.h $(TM_H) $(JAVA_TREE_H) $(TREE_GIMPLE_H) toplev.h
+ coretypes.h $(TM_H) $(JAVA_TREE_H) $(GIMPLE_H) toplev.h
# jcf-io.o needs $(ZLIBINC) added to cflags.
java/jcf-io.o: java/jcf-io.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
diff --git a/gcc/java/class.c b/gcc/java/class.c
index ef5cc0f8956..647da9ad23e 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -930,8 +930,8 @@ static GTY(()) tree utf8_decl_list = NULL_TREE;
tree
build_utf8_ref (tree name)
{
- const char * name_ptr = IDENTIFIER_POINTER(name);
- int name_len = IDENTIFIER_LENGTH(name);
+ const char * name_ptr = IDENTIFIER_POINTER (name);
+ int name_len = IDENTIFIER_LENGTH (name), name_pad;
char buf[60];
tree ctype, field = NULL_TREE, str_type, cinit, string;
static int utf8_count = 0;
@@ -942,8 +942,11 @@ build_utf8_ref (tree name)
return ref;
ctype = make_node (RECORD_TYPE);
+ /* '\0' byte plus padding to utf8const_type's alignment. */
+ name_pad = TYPE_ALIGN_UNIT (utf8const_type)
+ - (name_len & (TYPE_ALIGN_UNIT (utf8const_type) - 1));
str_type = build_prim_array_type (unsigned_byte_type_node,
- name_len + 1); /* Allow for final '\0'. */
+ name_len + name_pad);
PUSH_FIELD (ctype, field, "hash", unsigned_short_type_node);
PUSH_FIELD (ctype, field, "length", unsigned_short_type_node);
PUSH_FIELD (ctype, field, "data", str_type);
@@ -973,8 +976,7 @@ build_utf8_ref (tree name)
{
int decl_size;
/* Ensure decl_size is a multiple of utf8const_type's alignment. */
- decl_size = (name_len + 5 + TYPE_ALIGN_UNIT (utf8const_type) - 1)
- & ~(TYPE_ALIGN_UNIT (utf8const_type) - 1);
+ decl_size = name_len + 4 + name_pad;
if (flag_merge_constants && decl_size < 256)
{
char buf[32];
@@ -988,6 +990,8 @@ build_utf8_ref (tree name)
TREE_CHAIN (decl) = utf8_decl_list;
layout_decl (decl, 0);
+ DECL_SIZE (decl) = TYPE_SIZE (ctype);
+ DECL_SIZE_UNIT (decl) = TYPE_SIZE_UNIT (ctype);
pushdecl (decl);
rest_of_decl_compilation (decl, global_bindings_p (), 0);
varpool_mark_needed_node (varpool_node (decl));
@@ -1817,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/decl.c b/gcc/java/decl.c
index d249157371d..1768109414d 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -49,6 +49,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "version.h"
#include "tree-iterator.h"
#include "langhooks.h"
+#include "cgraph.h"
#if defined (DEBUG_JAVA_BINDING_LEVELS)
extern void indent (void);
@@ -1797,14 +1798,6 @@ end_java_method (void)
finish_method (fndecl);
- if (! flag_unit_at_a_time)
- {
- /* Nulling these fields when we no longer need them saves
- memory. */
- DECL_SAVED_TREE (fndecl) = NULL;
- DECL_STRUCT_FUNCTION (fndecl) = NULL;
- DECL_INITIAL (fndecl) = NULL_TREE;
- }
current_function_decl = NULL_TREE;
}
@@ -1854,15 +1847,12 @@ java_mark_decl_local (tree decl)
{
DECL_EXTERNAL (decl) = 0;
- /* If we've already constructed DECL_RTL, give encode_section_info
- a second chance, now that we've changed the flags. */
- /* ??? Ideally, we'd have flag_unit_at_a_time set, and not have done
- anything that would have referenced DECL_RTL so far. But at the
- moment we force flag_unit_at_a_time off due to excessive memory
- consumption when compiling large jar files. Which probably means
- that we need to re-order how we process jar files... */
- if (DECL_RTL_SET_P (decl))
- make_decl_rtl (decl);
+#ifdef ENABLE_CHECKING
+ /* Double check that we didn't pass the function to the callgraph early. */
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ gcc_assert (!cgraph_node (decl)->local.finalized);
+#endif
+ gcc_assert (!DECL_RTL_SET_P (decl));
}
/* Given appropriate target support, G++ will emit hidden aliases for native
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index c64f6d68eba..ff28bbb0b40 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -42,7 +42,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "toplev.h"
#include "except.h"
#include "ggc.h"
-#include "tree-gimple.h"
+#include "tree-iterator.h"
+#include "gimple.h"
#include "target.h"
static void flush_quick_stack (void);
@@ -814,10 +815,20 @@ encode_newarray_type (tree type)
static tree
build_java_throw_out_of_bounds_exception (tree index)
{
- tree node = build_call_nary (int_type_node,
+ tree node;
+
+ /* We need to build a COMPOUND_EXPR because _Jv_ThrowBadArrayIndex()
+ has void return type. We cannot just set the type of the CALL_EXPR below
+ to int_type_node because we would lose it during gimplification. */
+ gcc_assert (VOID_TYPE_P (TREE_TYPE (TREE_TYPE (soft_badarrayindex_node))));
+ node = build_call_nary (void_type_node,
build_address_of (soft_badarrayindex_node),
1, index);
+ TREE_SIDE_EFFECTS (node) = 1;
+
+ node = build2 (COMPOUND_EXPR, int_type_node, node, integer_zero_node);
TREE_SIDE_EFFECTS (node) = 1; /* Allows expansion within ANDIF */
+
return (node);
}
diff --git a/gcc/java/gcj.texi b/gcc/java/gcj.texi
index 179e620f8c9..af5b06615b0 100644
--- a/gcc/java/gcj.texi
+++ b/gcc/java/gcj.texi
@@ -17,7 +17,7 @@
@c the word ``Java'.
@c When this manual is copyrighted.
-@set copyrights-gcj 2001, 2002, 2003, 2004, 2005, 2006, 2007
+@set copyrights-gcj 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
@copying
@c man begin COPYRIGHT
@@ -25,13 +25,12 @@ Copyright @copyright{} @value{copyrights-gcj} Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2 or
-any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'', the Front-Cover
-texts being (a) (see below), and with the Back-Cover Texts being (b)
-(see below). A copy of the license is included in the
+any later version published by the Free Software Foundation; with no
+Invariant Sections, the Front-Cover Texts being (a) (see below), and
+with the Back-Cover Texts being (b) (see below).
+A copy of the license is included in the
@c man end
-section entitled
-``GNU Free Documentation License''.
+section entitled ``GNU Free Documentation License''.
@ignore
@c man begin COPYRIGHT
man page gfdl(7).
diff --git a/gcc/java/java-gimplify.c b/gcc/java/java-gimplify.c
index 53582411353..790cb13c039 100644
--- a/gcc/java/java-gimplify.c
+++ b/gcc/java/java-gimplify.c
@@ -28,12 +28,13 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "tree.h"
#include "java-tree.h"
#include "tree-dump.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "toplev.h"
static tree java_gimplify_block (tree);
static enum gimplify_status java_gimplify_modify_expr (tree *);
-static enum gimplify_status java_gimplify_self_mod_expr (tree*, tree*, tree *);
+static enum gimplify_status java_gimplify_self_mod_expr (tree *, gimple_seq *,
+ gimple_seq *);
static void dump_java_tree (enum tree_dump_index, tree);
@@ -53,8 +54,7 @@ java_genericize (tree fndecl)
/* Gimplify a Java tree. */
int
-java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
- tree *post_p ATTRIBUTE_UNUSED)
+java_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
{
enum tree_code code = TREE_CODE (*expr_p);
@@ -68,9 +68,6 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
*expr_p = java_replace_reference (*expr_p, /* want_lvalue */ false);
return GS_UNHANDLED;
- /* We don't handle GIMPLE_MODIFY_STMT, as MODIFY_EXPRs with java
- semantics should only be generated by the front-end, and never
- by anything after gimplification. */
case MODIFY_EXPR:
return java_gimplify_modify_expr (expr_p);
@@ -142,7 +139,7 @@ java_gimplify_modify_expr (tree *modify_expr_p)
{
tree new_lhs = java_replace_reference (lhs, /* want_lvalue */ true);
tree new_rhs = build1 (NOP_EXPR, TREE_TYPE (new_lhs), rhs);
- modify_expr = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (new_lhs),
+ modify_expr = build2 (MODIFY_EXPR, TREE_TYPE (new_lhs),
new_lhs, new_rhs);
modify_expr = build1 (NOP_EXPR, lhs_type, modify_expr);
}
@@ -160,8 +157,8 @@ java_gimplify_modify_expr (tree *modify_expr_p)
between the reading and the writing. */
static enum gimplify_status
-java_gimplify_self_mod_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED,
- tree *post_p ATTRIBUTE_UNUSED)
+java_gimplify_self_mod_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED,
+ gimple_seq *post_p ATTRIBUTE_UNUSED)
{
tree lhs = TREE_OPERAND (*expr_p, 0);
@@ -180,7 +177,7 @@ java_gimplify_block (tree java_block)
{
tree decls = BLOCK_VARS (java_block);
tree body = BLOCK_EXPR_BODY (java_block);
- tree outer = gimple_current_bind_expr ();
+ gimple outer = gimple_current_bind_expr ();
tree block;
/* Don't bother with empty blocks. */
@@ -199,10 +196,10 @@ java_gimplify_block (tree java_block)
routines generate info for the variables in that block. */
TREE_USED (block) = 1;
- if (outer != NULL_TREE)
+ if (outer != NULL)
{
- outer = BIND_EXPR_BLOCK (outer);
- BLOCK_SUBBLOCKS (outer) = chainon (BLOCK_SUBBLOCKS (outer), block);
+ tree b = gimple_bind_block (outer);
+ BLOCK_SUBBLOCKS (b) = chainon (BLOCK_SUBBLOCKS (b), block);
}
BLOCK_EXPR_BODY (java_block) = NULL_TREE;
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h
index a046a0f450a..7ae71d9e41b 100644
--- a/gcc/java/java-tree.h
+++ b/gcc/java/java-tree.h
@@ -649,7 +649,7 @@ struct lang_identifier GTY(())
/* The resulting tree type. */
union lang_tree_node
GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"),
- chain_next ("(union lang_tree_node *)GENERIC_NEXT (&%h.generic)")))
+ chain_next ("(union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
{
union tree_node GTY ((tag ("0"),
@@ -1555,7 +1555,7 @@ enum
#undef DEBUG_JAVA_BINDING_LEVELS
extern void java_genericize (tree);
-extern int java_gimplify_expr (tree *, tree *, tree *);
+extern int java_gimplify_expr (tree *, gimple_seq *, gimple_seq *);
extern FILE *finput;
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index 1d11b4f2e00..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_:
@@ -532,12 +532,6 @@ java_post_options (const char **pfilename)
{
const char *filename = *pfilename;
- /* Use tree inlining. */
- if (!flag_no_inline)
- flag_no_inline = 1;
- if (flag_inline_functions)
- flag_inline_trees = 2;
-
/* An absolute requirement: if we're not using indirect dispatch, we
must always verify everything. */
if (! flag_indirect_dispatch)
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..bacb7f4e1ba 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -351,7 +351,7 @@ reversed_comparison_code_parts (enum rtx_code code, const_rtx arg0,
return UNKNOWN;
/* These CONST_CAST's are okay because prev_nonnote_insn just
- returns it's argument and we assign it to a const_rtx
+ returns its argument and we assign it to a const_rtx
variable. */
for (prev = prev_nonnote_insn (CONST_CAST_RTX(insn));
prev != 0 && !LABEL_P (prev);
@@ -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/lambda-code.c b/gcc/lambda-code.c
index 5ae74ffa1ce..21bc1846a73 100644
--- a/gcc/lambda-code.c
+++ b/gcc/lambda-code.c
@@ -1231,16 +1231,16 @@ gcc_loop_to_lambda_loop (struct loop *loop, int depth,
VEC(tree,heap) * outerinductionvars,
VEC(tree,heap) ** lboundvars,
VEC(tree,heap) ** uboundvars,
- VEC(int,heap) ** steps,
+ VEC(int,heap) ** steps,
struct obstack * lambda_obstack)
{
- tree phi;
- tree exit_cond;
+ gimple phi;
+ gimple exit_cond;
tree access_fn, inductionvar;
tree step;
lambda_loop lloop = NULL;
lambda_linear_expression lbound, ubound;
- tree test;
+ tree test_lhs, test_rhs;
int stepint;
int extra = 0;
tree lboundvar, uboundvar, uboundresult;
@@ -1257,9 +1257,7 @@ gcc_loop_to_lambda_loop (struct loop *loop, int depth,
return NULL;
}
- test = TREE_OPERAND (exit_cond, 0);
-
- if (SSA_NAME_DEF_STMT (inductionvar) == NULL_TREE)
+ if (SSA_NAME_DEF_STMT (inductionvar) == NULL)
{
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -1270,10 +1268,10 @@ gcc_loop_to_lambda_loop (struct loop *loop, int depth,
}
phi = SSA_NAME_DEF_STMT (inductionvar);
- if (TREE_CODE (phi) != PHI_NODE)
+ if (gimple_code (phi) != GIMPLE_PHI)
{
- phi = SINGLE_SSA_TREE_OPERAND (phi, SSA_OP_USE);
- if (!phi)
+ tree op = SINGLE_SSA_TREE_OPERAND (phi, SSA_OP_USE);
+ if (!op)
{
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -1283,16 +1281,14 @@ gcc_loop_to_lambda_loop (struct loop *loop, int depth,
return NULL;
}
- phi = SSA_NAME_DEF_STMT (phi);
- if (TREE_CODE (phi) != PHI_NODE)
+ phi = SSA_NAME_DEF_STMT (op);
+ if (gimple_code (phi) != GIMPLE_PHI)
{
-
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,
"Unable to convert loop: Cannot find PHI node for induction variable\n");
return NULL;
}
-
}
/* The induction variable name/version we want to put in the array is the
@@ -1331,7 +1327,7 @@ gcc_loop_to_lambda_loop (struct loop *loop, int depth,
/* Only want phis for induction vars, which will have two
arguments. */
- if (PHI_NUM_ARGS (phi) != 2)
+ if (gimple_phi_num_args (phi) != 2)
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,
@@ -1341,8 +1337,8 @@ gcc_loop_to_lambda_loop (struct loop *loop, int depth,
/* Another induction variable check. One argument's source should be
in the loop, one outside the loop. */
- if (flow_bb_inside_loop_p (loop, PHI_ARG_EDGE (phi, 0)->src)
- && flow_bb_inside_loop_p (loop, PHI_ARG_EDGE (phi, 1)->src))
+ if (flow_bb_inside_loop_p (loop, gimple_phi_arg_edge (phi, 0)->src)
+ && flow_bb_inside_loop_p (loop, gimple_phi_arg_edge (phi, 1)->src))
{
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -1352,7 +1348,7 @@ gcc_loop_to_lambda_loop (struct loop *loop, int depth,
return NULL;
}
- if (flow_bb_inside_loop_p (loop, PHI_ARG_EDGE (phi, 0)->src))
+ if (flow_bb_inside_loop_p (loop, gimple_phi_arg_edge (phi, 0)->src))
{
lboundvar = PHI_ARG_DEF (phi, 1);
lbound = gcc_tree_to_linear_expression (depth, lboundvar,
@@ -1378,21 +1374,23 @@ gcc_loop_to_lambda_loop (struct loop *loop, int depth,
}
/* One part of the test may be a loop invariant tree. */
VEC_reserve (tree, heap, *invariants, 1);
- if (TREE_CODE (TREE_OPERAND (test, 1)) == SSA_NAME
- && invariant_in_loop_and_outer_loops (loop, TREE_OPERAND (test, 1)))
- VEC_quick_push (tree, *invariants, TREE_OPERAND (test, 1));
- else if (TREE_CODE (TREE_OPERAND (test, 0)) == SSA_NAME
- && invariant_in_loop_and_outer_loops (loop, TREE_OPERAND (test, 0)))
- VEC_quick_push (tree, *invariants, TREE_OPERAND (test, 0));
+ test_lhs = gimple_cond_lhs (exit_cond);
+ test_rhs = gimple_cond_rhs (exit_cond);
+
+ if (TREE_CODE (test_rhs) == SSA_NAME
+ && invariant_in_loop_and_outer_loops (loop, test_rhs))
+ VEC_quick_push (tree, *invariants, test_rhs);
+ else if (TREE_CODE (test_lhs) == SSA_NAME
+ && invariant_in_loop_and_outer_loops (loop, test_lhs))
+ VEC_quick_push (tree, *invariants, test_lhs);
/* The non-induction variable part of the test is the upper bound variable.
*/
- if (TREE_OPERAND (test, 0) == inductionvar)
- uboundvar = TREE_OPERAND (test, 1);
+ if (test_lhs == inductionvar)
+ uboundvar = test_rhs;
else
- uboundvar = TREE_OPERAND (test, 0);
+ uboundvar = test_lhs;
-
/* We only size the vectors assuming we have, at max, 2 times as many
invariants as we do loops (one for each bound).
This is just an arbitrary number, but it has to be matched against the
@@ -1401,13 +1399,13 @@ gcc_loop_to_lambda_loop (struct loop *loop, int depth,
/* We might have some leftover. */
- if (TREE_CODE (test) == LT_EXPR)
+ if (gimple_cond_code (exit_cond) == LT_EXPR)
extra = -1 * stepint;
- else if (TREE_CODE (test) == NE_EXPR)
+ else if (gimple_cond_code (exit_cond) == NE_EXPR)
extra = -1 * stepint;
- else if (TREE_CODE (test) == GT_EXPR)
+ else if (gimple_cond_code (exit_cond) == GT_EXPR)
extra = -1 * stepint;
- else if (TREE_CODE (test) == EQ_EXPR)
+ else if (gimple_cond_code (exit_cond) == EQ_EXPR)
extra = 1 * stepint;
ubound = gcc_tree_to_linear_expression (depth, uboundvar,
@@ -1439,24 +1437,23 @@ gcc_loop_to_lambda_loop (struct loop *loop, int depth,
static tree
find_induction_var_from_exit_cond (struct loop *loop)
{
- tree expr = get_loop_exit_condition (loop);
+ gimple expr = get_loop_exit_condition (loop);
tree ivarop;
- tree test;
- if (expr == NULL_TREE)
- return NULL_TREE;
- if (TREE_CODE (expr) != COND_EXPR)
+ tree test_lhs, test_rhs;
+ if (expr == NULL)
return NULL_TREE;
- test = TREE_OPERAND (expr, 0);
- if (!COMPARISON_CLASS_P (test))
+ if (gimple_code (expr) != GIMPLE_COND)
return NULL_TREE;
+ test_lhs = gimple_cond_lhs (expr);
+ test_rhs = gimple_cond_rhs (expr);
/* Find the side that is invariant in this loop. The ivar must be the other
side. */
- if (expr_invariant_in_loop_p (loop, TREE_OPERAND (test, 0)))
- ivarop = TREE_OPERAND (test, 1);
- else if (expr_invariant_in_loop_p (loop, TREE_OPERAND (test, 1)))
- ivarop = TREE_OPERAND (test, 0);
+ if (expr_invariant_in_loop_p (loop, test_lhs))
+ ivarop = test_rhs;
+ else if (expr_invariant_in_loop_p (loop, test_rhs))
+ ivarop = test_lhs;
else
return NULL_TREE;
@@ -1548,7 +1545,7 @@ gcc_loopnest_to_lambda_loopnest (struct loop *loop_nest,
static tree
lbv_to_gcc_expression (lambda_body_vector lbv,
tree type, VEC(tree,heap) *induction_vars,
- tree *stmts_to_insert)
+ gimple_seq *stmts_to_insert)
{
int k;
tree resvar;
@@ -1583,7 +1580,7 @@ lle_to_gcc_expression (lambda_linear_expression lle,
tree type,
VEC(tree,heap) *induction_vars,
VEC(tree,heap) *invariants,
- enum tree_code wrap, tree *stmts_to_insert)
+ enum tree_code wrap, gimple_seq *stmts_to_insert)
{
int k;
tree resvar;
@@ -1641,17 +1638,19 @@ lle_to_gcc_expression (lambda_linear_expression lle,
/* Remove the induction variable defined at IV_STMT. */
void
-remove_iv (tree iv_stmt)
+remove_iv (gimple iv_stmt)
{
- if (TREE_CODE (iv_stmt) == PHI_NODE)
+ gimple_stmt_iterator si = gsi_for_stmt (iv_stmt);
+
+ if (gimple_code (iv_stmt) == GIMPLE_PHI)
{
- int i;
+ unsigned i;
- for (i = 0; i < PHI_NUM_ARGS (iv_stmt); i++)
+ for (i = 0; i < gimple_phi_num_args (iv_stmt); i++)
{
- tree stmt;
+ gimple stmt;
imm_use_iterator imm_iter;
- tree arg = PHI_ARG_DEF (iv_stmt, i);
+ tree arg = gimple_phi_arg_def (iv_stmt, i);
bool used = false;
if (TREE_CODE (arg) != SSA_NAME)
@@ -1665,13 +1664,11 @@ remove_iv (tree iv_stmt)
remove_iv (SSA_NAME_DEF_STMT (arg));
}
- remove_phi_node (iv_stmt, NULL_TREE, true);
+ remove_phi_node (&si, true);
}
else
{
- block_stmt_iterator bsi = bsi_for_stmt (iv_stmt);
-
- bsi_remove (&bsi, true);
+ gsi_remove (&si, true);
release_defs (iv_stmt);
}
}
@@ -1692,18 +1689,18 @@ void
lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
VEC(tree,heap) *old_ivs,
VEC(tree,heap) *invariants,
- VEC(tree,heap) **remove_ivs,
+ VEC(gimple,heap) **remove_ivs,
lambda_loopnest new_loopnest,
lambda_trans_matrix transform,
struct obstack * lambda_obstack)
{
struct loop *temp;
size_t i = 0;
- int j;
+ unsigned j;
size_t depth = 0;
VEC(tree,heap) *new_ivs = NULL;
tree oldiv;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
transform = lambda_trans_matrix_inverse (transform);
@@ -1720,13 +1717,15 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
lambda_loop newloop;
basic_block bb;
edge exit;
- tree ivvar, ivvarinced, exitcond, stmts;
+ tree ivvar, ivvarinced;
+ gimple exitcond;
+ gimple_seq stmts;
enum tree_code testtype;
tree newupperbound, newlowerbound;
lambda_linear_expression offset;
tree type;
bool insert_after;
- tree inc_stmt;
+ gimple inc_stmt;
oldiv = VEC_index (tree, old_ivs, i);
type = TREE_TYPE (oldiv);
@@ -1749,6 +1748,7 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
/* Now build the new lower bounds, and insert the statements
necessary to generate it on the loop preheader. */
+ stmts = NULL;
newlowerbound = lle_to_gcc_expression (LL_LOWER_BOUND (newloop),
LL_LINEAR_OFFSET (newloop),
type,
@@ -1757,11 +1757,12 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
if (stmts)
{
- bsi_insert_on_edge (loop_preheader_edge (temp), stmts);
- bsi_commit_edge_inserts ();
+ gsi_insert_seq_on_edge (loop_preheader_edge (temp), stmts);
+ gsi_commit_edge_inserts ();
}
/* Build the new upper bound and insert its statements in the
basic block of the exit condition */
+ stmts = NULL;
newupperbound = lle_to_gcc_expression (LL_UPPER_BOUND (newloop),
LL_LINEAR_OFFSET (newloop),
type,
@@ -1769,10 +1770,10 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
invariants, MIN_EXPR, &stmts);
exit = single_exit (temp);
exitcond = get_loop_exit_condition (temp);
- bb = bb_for_stmt (exitcond);
- bsi = bsi_after_labels (bb);
+ bb = gimple_bb (exitcond);
+ bsi = gsi_after_labels (bb);
if (stmts)
- bsi_insert_before (&bsi, stmts, BSI_NEW_STMT);
+ gsi_insert_seq_before (&bsi, stmts, GSI_NEW_STMT);
/* Create the new iv. */
@@ -1786,13 +1787,14 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
dominate the block containing the exit condition.
So we simply create our own incremented iv to use in the new exit
test, and let redundancy elimination sort it out. */
- inc_stmt = build2 (PLUS_EXPR, type,
- ivvar, build_int_cst (type, LL_STEP (newloop)));
- inc_stmt = build_gimple_modify_stmt (SSA_NAME_VAR (ivvar), inc_stmt);
+ inc_stmt = gimple_build_assign_with_ops (PLUS_EXPR, SSA_NAME_VAR (ivvar),
+ ivvar,
+ build_int_cst (type, LL_STEP (newloop)));
+
ivvarinced = make_ssa_name (SSA_NAME_VAR (ivvar), inc_stmt);
- GIMPLE_STMT_OPERAND (inc_stmt, 0) = ivvarinced;
- bsi = bsi_for_stmt (exitcond);
- bsi_insert_before (&bsi, inc_stmt, BSI_SAME_STMT);
+ gimple_assign_set_lhs (inc_stmt, ivvarinced);
+ bsi = gsi_for_stmt (exitcond);
+ gsi_insert_before (&bsi, inc_stmt, GSI_SAME_STMT);
/* Replace the exit condition with the new upper bound
comparison. */
@@ -1806,9 +1808,7 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
if (exit->flags & EDGE_FALSE_VALUE)
testtype = swap_tree_comparison (testtype);
- COND_EXPR_COND (exitcond) = build2 (testtype,
- boolean_type_node,
- newupperbound, ivvarinced);
+ gimple_cond_set_condition (exitcond, testtype, newupperbound, ivvarinced);
update_stmt (exitcond);
VEC_replace (tree, new_ivs, i, ivvar);
@@ -1824,10 +1824,10 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
imm_use_iterator imm_iter;
use_operand_p use_p;
tree oldiv_def;
- tree oldiv_stmt = SSA_NAME_DEF_STMT (oldiv);
- tree stmt;
+ gimple oldiv_stmt = SSA_NAME_DEF_STMT (oldiv);
+ gimple stmt;
- if (TREE_CODE (oldiv_stmt) == PHI_NODE)
+ if (gimple_code (oldiv_stmt) == GIMPLE_PHI)
oldiv_def = PHI_RESULT (oldiv_stmt);
else
oldiv_def = SINGLE_SSA_TREE_OPERAND (oldiv_stmt, SSA_OP_DEF);
@@ -1835,7 +1835,8 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
FOR_EACH_IMM_USE_STMT (stmt, imm_iter, oldiv_def)
{
- tree newiv, stmts;
+ tree newiv;
+ gimple_seq stmts;
lambda_body_vector lbv, newlbv;
/* Compute the new expression for the induction
@@ -1847,28 +1848,29 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
newlbv = lambda_body_vector_compute_new (transform, lbv,
lambda_obstack);
+ stmts = NULL;
newiv = lbv_to_gcc_expression (newlbv, TREE_TYPE (oldiv),
new_ivs, &stmts);
- if (stmts && TREE_CODE (stmt) != PHI_NODE)
+ if (stmts && gimple_code (stmt) != GIMPLE_PHI)
{
- bsi = bsi_for_stmt (stmt);
- bsi_insert_before (&bsi, stmts, BSI_SAME_STMT);
+ bsi = gsi_for_stmt (stmt);
+ gsi_insert_seq_before (&bsi, stmts, GSI_SAME_STMT);
}
FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter)
propagate_value (use_p, newiv);
- if (stmts && TREE_CODE (stmt) == PHI_NODE)
- for (j = 0; j < PHI_NUM_ARGS (stmt); j++)
- if (PHI_ARG_DEF (stmt, j) == newiv)
- bsi_insert_on_edge (PHI_ARG_EDGE (stmt, j), stmts);
+ if (stmts && gimple_code (stmt) == GIMPLE_PHI)
+ for (j = 0; j < gimple_phi_num_args (stmt); j++)
+ if (gimple_phi_arg_def (stmt, j) == newiv)
+ gsi_insert_seq_on_edge (gimple_phi_arg_edge (stmt, j), stmts);
update_stmt (stmt);
}
/* Remove the now unused induction variable. */
- VEC_safe_push (tree, heap, *remove_ivs, oldiv_stmt);
+ VEC_safe_push (gimple, heap, *remove_ivs, oldiv_stmt);
}
VEC_free (tree, heap, new_ivs);
}
@@ -1877,13 +1879,13 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
determining if we have a perfect loop nest. */
static bool
-not_interesting_stmt (tree stmt)
+not_interesting_stmt (gimple stmt)
{
/* Note that COND_EXPR's aren't interesting because if they were exiting the
loop, we would have already failed the number of exits tests. */
- if (TREE_CODE (stmt) == LABEL_EXPR
- || TREE_CODE (stmt) == GOTO_EXPR
- || TREE_CODE (stmt) == COND_EXPR)
+ if (gimple_code (stmt) == GIMPLE_LABEL
+ || gimple_code (stmt) == GIMPLE_GOTO
+ || gimple_code (stmt) == GIMPLE_COND)
return true;
return false;
}
@@ -1891,11 +1893,11 @@ not_interesting_stmt (tree stmt)
/* Return TRUE if PHI uses DEF for it's in-the-loop edge for LOOP. */
static bool
-phi_loop_edge_uses_def (struct loop *loop, tree phi, tree def)
+phi_loop_edge_uses_def (struct loop *loop, gimple phi, tree def)
{
- int i;
- for (i = 0; i < PHI_NUM_ARGS (phi); i++)
- if (flow_bb_inside_loop_p (loop, PHI_ARG_EDGE (phi, i)->src))
+ unsigned i;
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
+ if (flow_bb_inside_loop_p (loop, gimple_phi_arg_edge (phi, i)->src))
if (PHI_ARG_DEF (phi, i) == def)
return true;
return false;
@@ -1904,7 +1906,7 @@ phi_loop_edge_uses_def (struct loop *loop, tree phi, tree def)
/* Return TRUE if STMT is a use of PHI_RESULT. */
static bool
-stmt_uses_phi_result (tree stmt, tree phi_result)
+stmt_uses_phi_result (gimple stmt, tree phi_result)
{
tree use = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_USE);
@@ -1920,9 +1922,9 @@ stmt_uses_phi_result (tree stmt, tree phi_result)
i_3 = PHI (0, i_29); */
static bool
-stmt_is_bumper_for_loop (struct loop *loop, tree stmt)
+stmt_is_bumper_for_loop (struct loop *loop, gimple stmt)
{
- tree use;
+ gimple use;
tree def;
imm_use_iterator iter;
use_operand_p use_p;
@@ -1934,7 +1936,7 @@ stmt_is_bumper_for_loop (struct loop *loop, tree stmt)
FOR_EACH_IMM_USE_FAST (use_p, iter, def)
{
use = USE_STMT (use_p);
- if (TREE_CODE (use) == PHI_NODE)
+ if (gimple_code (use) == GIMPLE_PHI)
{
if (phi_loop_edge_uses_def (loop, use, def))
if (stmt_uses_phi_result (stmt, PHI_RESULT (use)))
@@ -1976,7 +1978,7 @@ perfect_nest_p (struct loop *loop)
{
basic_block *bbs;
size_t i;
- tree exit_cond;
+ gimple exit_cond;
/* Loops at depth 0 are perfect nests. */
if (!loop->inner)
@@ -1989,13 +1991,13 @@ perfect_nest_p (struct loop *loop)
{
if (bbs[i]->loop_father == loop)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
- for (bsi = bsi_start (bbs[i]); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (bsi = gsi_start_bb (bbs[i]); !gsi_end_p (bsi); gsi_next (&bsi))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (bsi);
- if (TREE_CODE (stmt) == COND_EXPR
+ if (gimple_code (stmt) == GIMPLE_COND
&& exit_cond != stmt)
goto non_perfectly_nested;
@@ -2023,10 +2025,10 @@ perfect_nest_p (struct loop *loop)
of body basic block. */
static void
-replace_uses_equiv_to_x_with_y (struct loop *loop, tree stmt, tree x,
+replace_uses_equiv_to_x_with_y (struct loop *loop, gimple stmt, tree x,
int xstep, tree y, tree yinit,
htab_t replacements,
- block_stmt_iterator *firstbsi)
+ gimple_stmt_iterator *firstbsi)
{
ssa_op_iter iter;
use_operand_p use_p;
@@ -2035,7 +2037,8 @@ replace_uses_equiv_to_x_with_y (struct loop *loop, tree stmt, tree x,
{
tree use = USE_FROM_PTR (use_p);
tree step = NULL_TREE;
- tree scev, init, val, var, setstmt;
+ tree scev, init, val, var;
+ gimple setstmt;
struct tree_map *h, in;
void **loc;
@@ -2098,12 +2101,12 @@ replace_uses_equiv_to_x_with_y (struct loop *loop, tree stmt, tree x,
which sets Y. */
var = create_tmp_var (TREE_TYPE (use), "perfecttmp");
add_referenced_var (var);
- val = force_gimple_operand_bsi (firstbsi, val, false, NULL,
- true, BSI_SAME_STMT);
- setstmt = build_gimple_modify_stmt (var, val);
+ val = force_gimple_operand_gsi (firstbsi, val, false, NULL,
+ true, GSI_SAME_STMT);
+ setstmt = gimple_build_assign (var, val);
var = make_ssa_name (var, setstmt);
- GIMPLE_STMT_OPERAND (setstmt, 0) = var;
- bsi_insert_before (firstbsi, setstmt, BSI_SAME_STMT);
+ gimple_assign_set_lhs (setstmt, var);
+ gsi_insert_before (firstbsi, setstmt, GSI_SAME_STMT);
update_stmt (setstmt);
SET_USE (use_p, var);
h = GGC_NEW (struct tree_map);
@@ -2119,12 +2122,11 @@ replace_uses_equiv_to_x_with_y (struct loop *loop, tree stmt, tree x,
/* Return true if STMT is an exit PHI for LOOP */
static bool
-exit_phi_for_loop_p (struct loop *loop, tree stmt)
+exit_phi_for_loop_p (struct loop *loop, gimple stmt)
{
-
- if (TREE_CODE (stmt) != PHI_NODE
- || PHI_NUM_ARGS (stmt) != 1
- || bb_for_stmt (stmt) != single_exit (loop)->dest)
+ if (gimple_code (stmt) != GIMPLE_PHI
+ || gimple_phi_num_args (stmt) != 1
+ || gimple_bb (stmt) != single_exit (loop)->dest)
return false;
return true;
@@ -2134,21 +2136,21 @@ exit_phi_for_loop_p (struct loop *loop, tree stmt)
copying it to the beginning of that loop and changing the uses. */
static bool
-can_put_in_inner_loop (struct loop *inner, tree stmt)
+can_put_in_inner_loop (struct loop *inner, gimple stmt)
{
imm_use_iterator imm_iter;
use_operand_p use_p;
- gcc_assert (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT);
+ gcc_assert (is_gimple_assign (stmt));
if (!ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS)
- || !expr_invariant_in_loop_p (inner, GIMPLE_STMT_OPERAND (stmt, 1)))
+ || !stmt_invariant_in_loop_p (inner, stmt))
return false;
- FOR_EACH_IMM_USE_FAST (use_p, imm_iter, GIMPLE_STMT_OPERAND (stmt, 0))
+ FOR_EACH_IMM_USE_FAST (use_p, imm_iter, gimple_assign_lhs (stmt))
{
if (!exit_phi_for_loop_p (inner, USE_STMT (use_p)))
{
- basic_block immbb = bb_for_stmt (USE_STMT (use_p));
+ basic_block immbb = gimple_bb (USE_STMT (use_p));
if (!flow_bb_inside_loop_p (inner, immbb))
return false;
@@ -2158,8 +2160,9 @@ can_put_in_inner_loop (struct loop *inner, tree stmt)
}
/* Return true if STMT can be put *after* the inner loop of LOOP. */
+
static bool
-can_put_after_inner_loop (struct loop *loop, tree stmt)
+can_put_after_inner_loop (struct loop *loop, gimple stmt)
{
imm_use_iterator imm_iter;
use_operand_p use_p;
@@ -2167,11 +2170,11 @@ can_put_after_inner_loop (struct loop *loop, tree stmt)
if (!ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS))
return false;
- FOR_EACH_IMM_USE_FAST (use_p, imm_iter, GIMPLE_STMT_OPERAND (stmt, 0))
+ FOR_EACH_IMM_USE_FAST (use_p, imm_iter, gimple_assign_lhs (stmt))
{
if (!exit_phi_for_loop_p (loop, USE_STMT (use_p)))
{
- basic_block immbb = bb_for_stmt (USE_STMT (use_p));
+ basic_block immbb = gimple_bb (USE_STMT (use_p));
if (!dominated_by_p (CDI_DOMINATORS,
immbb,
@@ -2211,81 +2214,77 @@ can_duplicate_iv (tree iv, struct loop *loop)
it has better cache behavior. */
static bool
-cannot_convert_modify_to_perfect_nest (tree stmt, struct loop *loop)
+cannot_convert_modify_to_perfect_nest (gimple stmt, struct loop *loop)
{
-
use_operand_p use_a, use_b;
imm_use_iterator imm_iter;
ssa_op_iter op_iter, op_iter1;
- tree op0 = GIMPLE_STMT_OPERAND (stmt, 0);
+ tree op0 = gimple_assign_lhs (stmt);
/* The statement should not define a variable used in the inner
loop. */
if (TREE_CODE (op0) == SSA_NAME
&& !can_duplicate_iv (op0, loop))
FOR_EACH_IMM_USE_FAST (use_a, imm_iter, op0)
- if (bb_for_stmt (USE_STMT (use_a))->loop_father
- == loop->inner)
+ if (gimple_bb (USE_STMT (use_a))->loop_father == loop->inner)
return true;
FOR_EACH_SSA_USE_OPERAND (use_a, stmt, op_iter, SSA_OP_USE)
{
- tree node, op = USE_FROM_PTR (use_a);
+ gimple node;
+ tree op = USE_FROM_PTR (use_a);
/* The variables should not be used in both loops. */
if (!can_duplicate_iv (op, loop))
FOR_EACH_IMM_USE_FAST (use_b, imm_iter, op)
- if (bb_for_stmt (USE_STMT (use_b))->loop_father
- == loop->inner)
+ if (gimple_bb (USE_STMT (use_b))->loop_father == loop->inner)
return true;
/* The statement should not use the value of a scalar that was
modified in the loop. */
node = SSA_NAME_DEF_STMT (op);
- if (TREE_CODE (node) == PHI_NODE)
+ if (gimple_code (node) == GIMPLE_PHI)
FOR_EACH_PHI_ARG (use_b, node, op_iter1, SSA_OP_USE)
- {
- tree arg = USE_FROM_PTR (use_b);
+ {
+ tree arg = USE_FROM_PTR (use_b);
- if (TREE_CODE (arg) == SSA_NAME)
- {
- tree arg_stmt = SSA_NAME_DEF_STMT (arg);
+ if (TREE_CODE (arg) == SSA_NAME)
+ {
+ gimple arg_stmt = SSA_NAME_DEF_STMT (arg);
- if (bb_for_stmt (arg_stmt)
- && (bb_for_stmt (arg_stmt)->loop_father
- == loop->inner))
- return true;
- }
- }
+ if (gimple_bb (arg_stmt)
+ && (gimple_bb (arg_stmt)->loop_father == loop->inner))
+ return true;
+ }
+ }
}
return false;
}
-
/* Return true when BB contains statements that can harm the transform
to a perfect loop nest. */
static bool
cannot_convert_bb_to_perfect_nest (basic_block bb, struct loop *loop)
{
- block_stmt_iterator bsi;
- tree exit_condition = get_loop_exit_condition (loop);
+ gimple_stmt_iterator bsi;
+ gimple exit_condition = get_loop_exit_condition (loop);
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (bsi);
if (stmt == exit_condition
|| not_interesting_stmt (stmt)
|| stmt_is_bumper_for_loop (loop, stmt))
continue;
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_assign (stmt))
{
if (cannot_convert_modify_to_perfect_nest (stmt, loop))
return true;
- if (can_duplicate_iv (GIMPLE_STMT_OPERAND (stmt, 0), loop))
+ if (can_duplicate_iv (gimple_assign_lhs (stmt), loop))
continue;
if (can_put_in_inner_loop (loop->inner, stmt)
@@ -2298,7 +2297,7 @@ cannot_convert_bb_to_perfect_nest (basic_block bb, struct loop *loop)
right now. This test ensures that the statement comes
completely *after* the inner loop. */
if (!dominated_by_p (CDI_DOMINATORS,
- bb_for_stmt (stmt),
+ gimple_bb (stmt),
loop->inner->header))
return true;
}
@@ -2306,6 +2305,7 @@ cannot_convert_bb_to_perfect_nest (basic_block bb, struct loop *loop)
return false;
}
+
/* Return TRUE if LOOP is an imperfect nest that we can convert to a
perfect one. At the moment, we only handle imperfect nests of
depth 2, where all of the statements occur after the inner loop. */
@@ -2314,8 +2314,8 @@ static bool
can_convert_to_perfect_nest (struct loop *loop)
{
basic_block *bbs;
- tree phi;
size_t i;
+ gimple_stmt_iterator si;
/* Can't handle triply nested+ loops yet. */
if (!loop->inner || loop->inner->inner)
@@ -2329,8 +2329,10 @@ can_convert_to_perfect_nest (struct loop *loop)
/* We also need to make sure the loop exit only has simple copy phis in it,
otherwise we don't know how to transform it into a perfect nest. */
- for (phi = phi_nodes (single_exit (loop)->dest); phi; phi = PHI_CHAIN (phi))
- if (PHI_NUM_ARGS (phi) != 1)
+ for (si = gsi_start_phis (single_exit (loop)->dest);
+ !gsi_end_p (si);
+ gsi_next (&si))
+ if (gimple_phi_num_args (gsi_stmt (si)) != 1)
goto fail;
free (bbs);
@@ -2385,17 +2387,17 @@ perfect_nestify (struct loop *loop,
VEC(tree,heap) *loopivs)
{
basic_block *bbs;
- tree exit_condition;
- tree cond_stmt;
+ gimple exit_condition;
+ gimple cond_stmt;
basic_block preheaderbb, headerbb, bodybb, latchbb, olddest;
int i;
- block_stmt_iterator bsi, firstbsi;
+ gimple_stmt_iterator bsi, firstbsi;
bool insert_after;
edge e;
struct loop *newloop;
- tree phi;
+ gimple phi;
tree uboundvar;
- tree stmt;
+ gimple stmt;
tree oldivvar, ivvar, ivvarinced;
VEC(tree,heap) *phis = NULL;
htab_t replacements = NULL;
@@ -2406,8 +2408,9 @@ perfect_nestify (struct loop *loop,
headerbb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb);
/* Push the exit phi nodes that we are moving. */
- for (phi = phi_nodes (olddest); phi; phi = PHI_CHAIN (phi))
+ for (bsi = gsi_start_phis (olddest); !gsi_end_p (bsi); gsi_next (&bsi))
{
+ phi = gsi_stmt (bsi);
VEC_reserve (tree, heap, phis, 2);
VEC_quick_push (tree, phis, PHI_RESULT (phi));
VEC_quick_push (tree, phis, PHI_ARG_DEF (phi, 0));
@@ -2415,8 +2418,8 @@ perfect_nestify (struct loop *loop,
e = redirect_edge_and_branch (single_succ_edge (preheaderbb), headerbb);
/* Remove the exit phis from the old basic block. */
- while (phi_nodes (olddest) != NULL)
- remove_phi_node (phi_nodes (olddest), NULL, false);
+ for (bsi = gsi_start_phis (olddest); !gsi_end_p (bsi); )
+ remove_phi_node (&bsi, false);
/* and add them back to the new basic block. */
while (VEC_length (tree, phis) != 0)
@@ -2434,13 +2437,10 @@ perfect_nestify (struct loop *loop,
bodybb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb);
latchbb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb);
make_edge (headerbb, bodybb, EDGE_FALLTHRU);
- cond_stmt = build3 (COND_EXPR, void_type_node,
- build2 (NE_EXPR, boolean_type_node,
- integer_one_node,
- integer_zero_node),
- NULL_TREE, NULL_TREE);
- bsi = bsi_start (bodybb);
- bsi_insert_after (&bsi, cond_stmt, BSI_NEW_STMT);
+ cond_stmt = gimple_build_cond (NE_EXPR, integer_one_node, integer_zero_node,
+ NULL_TREE, NULL_TREE);
+ bsi = gsi_start_bb (bodybb);
+ gsi_insert_after (&bsi, cond_stmt, GSI_NEW_STMT);
e = make_edge (bodybb, olddest, EDGE_FALSE_VALUE);
make_edge (bodybb, latchbb, EDGE_TRUE_VALUE);
make_edge (latchbb, headerbb, EDGE_FALLTHRU);
@@ -2474,19 +2474,16 @@ perfect_nestify (struct loop *loop,
exit_condition = get_loop_exit_condition (newloop);
uboundvar = create_tmp_var (integer_type_node, "uboundvar");
add_referenced_var (uboundvar);
- stmt = build_gimple_modify_stmt (uboundvar, VEC_index (tree, ubounds, 0));
+ stmt = gimple_build_assign (uboundvar, VEC_index (tree, ubounds, 0));
uboundvar = make_ssa_name (uboundvar, stmt);
- GIMPLE_STMT_OPERAND (stmt, 0) = uboundvar;
+ gimple_assign_set_lhs (stmt, uboundvar);
if (insert_after)
- bsi_insert_after (&bsi, stmt, BSI_SAME_STMT);
+ gsi_insert_after (&bsi, stmt, GSI_SAME_STMT);
else
- bsi_insert_before (&bsi, stmt, BSI_SAME_STMT);
+ gsi_insert_before (&bsi, stmt, GSI_SAME_STMT);
update_stmt (stmt);
- COND_EXPR_COND (exit_condition) = build2 (GE_EXPR,
- boolean_type_node,
- uboundvar,
- ivvarinced);
+ gimple_cond_set_condition (exit_condition, GE_EXPR, uboundvar, ivvarinced);
update_stmt (exit_condition);
replacements = htab_create_ggc (20, tree_map_hash,
tree_map_eq, NULL);
@@ -2494,10 +2491,10 @@ perfect_nestify (struct loop *loop,
/* Now move the statements, and replace the induction variable in the moved
statements with the correct loop induction variable. */
oldivvar = VEC_index (tree, loopivs, 0);
- firstbsi = bsi_start (bodybb);
+ firstbsi = gsi_start_bb (bodybb);
for (i = loop->num_nodes - 1; i >= 0 ; i--)
{
- block_stmt_iterator tobsi = bsi_last (bodybb);
+ gimple_stmt_iterator tobsi = gsi_last_bb (bodybb);
if (bbs[i]->loop_father == loop)
{
/* If this is true, we are *before* the inner loop.
@@ -2513,22 +2510,22 @@ perfect_nestify (struct loop *loop,
if (dominated_by_p (CDI_DOMINATORS, loop->inner->header, bbs[i]))
{
- block_stmt_iterator header_bsi
- = bsi_after_labels (loop->inner->header);
+ gimple_stmt_iterator header_bsi
+ = gsi_after_labels (loop->inner->header);
- for (bsi = bsi_start (bbs[i]); !bsi_end_p (bsi);)
+ for (bsi = gsi_start_bb (bbs[i]); !gsi_end_p (bsi);)
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (bsi);
if (stmt == exit_condition
|| not_interesting_stmt (stmt)
|| stmt_is_bumper_for_loop (loop, stmt))
{
- bsi_next (&bsi);
+ gsi_next (&bsi);
continue;
}
- bsi_move_before (&bsi, &header_bsi);
+ gsi_move_before (&bsi, &header_bsi);
}
}
else
@@ -2536,16 +2533,17 @@ perfect_nestify (struct loop *loop,
/* Note that the bsi only needs to be explicitly incremented
when we don't move something, since it is automatically
incremented when we do. */
- for (bsi = bsi_start (bbs[i]); !bsi_end_p (bsi);)
+ for (bsi = gsi_start_bb (bbs[i]); !gsi_end_p (bsi);)
{
ssa_op_iter i;
- tree n, stmt = bsi_stmt (bsi);
+ tree n;
+ gimple stmt = gsi_stmt (bsi);
if (stmt == exit_condition
|| not_interesting_stmt (stmt)
|| stmt_is_bumper_for_loop (loop, stmt))
{
- bsi_next (&bsi);
+ gsi_next (&bsi);
continue;
}
@@ -2553,7 +2551,7 @@ perfect_nestify (struct loop *loop,
(loop, stmt, oldivvar, VEC_index (int, steps, 0), ivvar,
VEC_index (tree, lbounds, 0), replacements, &firstbsi);
- bsi_move_before (&bsi, &tobsi);
+ gsi_move_before (&bsi, &tobsi);
/* If the statement has any virtual operands, they may
need to be rewired because the original loop may
@@ -2793,7 +2791,7 @@ build_access_matrix (data_reference_p data_reference,
{
struct access_matrix *am = GGC_NEW (struct access_matrix);
unsigned i, ndim = DR_NUM_DIMENSIONS (data_reference);
- struct loop *loop = bb_for_stmt (DR_STMT (data_reference))->loop_father;
+ struct loop *loop = gimple_bb (DR_STMT (data_reference))->loop_father;
struct loop *loop_nest = get_loop (loop_nest_num);
unsigned nivs = loop_depth (loop) - loop_depth (loop_nest) + 1;
unsigned lambda_nb_columns;
diff --git a/gcc/lambda-mat.c b/gcc/lambda-mat.c
index 852f812f16a..36110a72103 100644
--- a/gcc/lambda-mat.c
+++ b/gcc/lambda-mat.c
@@ -24,6 +24,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h"
#include "ggc.h"
#include "tree.h"
+#include "tree-flow.h"
#include "lambda.h"
static void lambda_matrix_get_column (lambda_matrix, int, int,
diff --git a/gcc/lambda-trans.c b/gcc/lambda-trans.c
index c5872d5cc37..e81a71cd53e 100644
--- a/gcc/lambda-trans.c
+++ b/gcc/lambda-trans.c
@@ -25,6 +25,7 @@ along with GCC; see the file COPYING3. If not see
#include "ggc.h"
#include "tree.h"
#include "target.h"
+#include "tree-flow.h"
#include "lambda.h"
/* Allocate a new transformation matrix. */
diff --git a/gcc/lambda.h b/gcc/lambda.h
index 40e8502973c..66fbac74bd5 100644
--- a/gcc/lambda.h
+++ b/gcc/lambda.h
@@ -209,10 +209,10 @@ lambda_loopnest gcc_loopnest_to_lambda_loopnest (struct loop *,
struct obstack *);
void lambda_loopnest_to_gcc_loopnest (struct loop *,
VEC(tree,heap) *, VEC(tree,heap) *,
- VEC(tree,heap) **,
+ VEC(gimple,heap) **,
lambda_loopnest, lambda_trans_matrix,
struct obstack *);
-void remove_iv (tree);
+void remove_iv (gimple);
static inline void lambda_vector_negate (lambda_vector, lambda_vector, int);
static inline void lambda_vector_mult_const (lambda_vector, lambda_vector, int, int);
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index dd4916caff6..7f8de5b9772 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -73,7 +73,7 @@ extern tree lhd_callgraph_analyze_expr (tree *, int *);
/* Declarations for tree gimplification hooks. */
-extern int lhd_gimplify_expr (tree *, tree *, tree *);
+extern int lhd_gimplify_expr (tree *, gimple_seq *, gimple_seq *);
extern enum omp_clause_default_kind lhd_omp_predetermined_sharing (tree);
extern tree lhd_omp_assignment (tree, tree, tree);
struct gimplify_omp_ctx;
@@ -112,6 +112,7 @@ extern void lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *,
#define LANG_HOOKS_TREE_SIZE lhd_tree_size
#define LANG_HOOKS_TYPES_COMPATIBLE_P lhd_types_compatible_p
#define LANG_HOOKS_BUILTIN_FUNCTION lhd_builtin_function
+#define LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE LANG_HOOKS_BUILTIN_FUNCTION
#define LANG_HOOKS_EXPR_TO_DECL lhd_expr_to_decl
#define LANG_HOOKS_TO_TARGET_CHARSET lhd_to_target_charset
#define LANG_HOOKS_INIT_TS lhd_do_nothing
@@ -272,6 +273,7 @@ extern tree lhd_make_node (enum tree_code);
LANG_HOOKS_GIMPLIFY_EXPR, \
LANG_HOOKS_FOLD_OBJ_TYPE_REF, \
LANG_HOOKS_BUILTIN_FUNCTION, \
+ LANG_HOOKS_BUILTIN_FUNCTION_EXT_SCOPE, \
LANG_HOOKS_INIT_TS, \
LANG_HOOKS_EXPR_TO_DECL, \
}
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index e2460473f54..4d441029802 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -27,7 +27,7 @@ along with GCC; see the file COPYING3. If not see
#include "toplev.h"
#include "tree.h"
#include "tree-inline.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "rtl.h"
#include "insn-config.h"
#include "integrate.h"
@@ -133,7 +133,7 @@ lhd_warn_unused_global_decl (const_tree decl)
/* This is what used to exist in check_global_declarations. Probably
not many of these actually apply to non-C languages. */
- if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl))
+ if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl))
return false;
if (TREE_CODE (decl) == VAR_DECL && TREE_READONLY (decl))
return false;
@@ -303,8 +303,9 @@ lhd_expr_size (const_tree exp)
/* lang_hooks.gimplify_expr re-writes *EXPR_P into GIMPLE form. */
int
-lhd_gimplify_expr (tree *expr_p ATTRIBUTE_UNUSED, tree *pre_p ATTRIBUTE_UNUSED,
- tree *post_p ATTRIBUTE_UNUSED)
+lhd_gimplify_expr (tree *expr_p ATTRIBUTE_UNUSED,
+ gimple_seq *pre_p ATTRIBUTE_UNUSED,
+ gimple_seq *post_p ATTRIBUTE_UNUSED)
{
return GS_UNHANDLED;
}
@@ -527,7 +528,7 @@ lhd_omp_predetermined_sharing (tree decl ATTRIBUTE_UNUSED)
tree
lhd_omp_assignment (tree clause ATTRIBUTE_UNUSED, tree dst, tree src)
{
- return build_gimple_modify_stmt (dst, src);
+ return build2 (MODIFY_EXPR, TREE_TYPE (dst), dst, src);
}
/* Register language specific type size variables as potentially OpenMP
@@ -539,13 +540,16 @@ lhd_omp_firstprivatize_type_sizes (struct gimplify_omp_ctx *c ATTRIBUTE_UNUSED,
{
}
-tree
-add_builtin_function (const char *name,
- tree type,
- int function_code,
- enum built_in_class cl,
- const char *library_name,
- tree attrs)
+/* Common function for add_builtin_function and
+ add_builtin_function_ext_scope. */
+static tree
+add_builtin_function_common (const char *name,
+ tree type,
+ int function_code,
+ enum built_in_class cl,
+ const char *library_name,
+ tree attrs,
+ tree (*hook) (tree))
{
tree id = get_identifier (name);
tree decl = build_decl (FUNCTION_DECL, id, type);
@@ -570,8 +574,43 @@ add_builtin_function (const char *name,
else
decl_attributes (&decl, NULL_TREE, 0);
- return lang_hooks.builtin_function (decl);
+ return hook (decl);
+
+}
+
+/* Create a builtin function. */
+
+tree
+add_builtin_function (const char *name,
+ tree type,
+ int function_code,
+ enum built_in_class cl,
+ const char *library_name,
+ tree attrs)
+{
+ return add_builtin_function_common (name, type, function_code, cl,
+ library_name, attrs,
+ lang_hooks.builtin_function);
+}
+/* Like add_builtin_function, but make sure the scope is the external scope.
+ This is used to delay putting in back end builtin functions until the ISA
+ that defines the builtin is declared via function specific target options,
+ which can save memory for machines like the x86_64 that have multiple ISAs.
+ If this points to the same function as builtin_function, the backend must
+ add all of the builtins at program initialization time. */
+
+tree
+add_builtin_function_ext_scope (const char *name,
+ tree type,
+ int function_code,
+ enum built_in_class cl,
+ const char *library_name,
+ tree attrs)
+{
+ return add_builtin_function_common (name, type, function_code, cl,
+ library_name, attrs,
+ lang_hooks.builtin_function_ext_scope);
}
tree
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index 1f64cf18d52..a10ce482f5c 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -401,7 +401,7 @@ struct lang_hooks
/* Perform language-specific gimplification on the argument. Returns an
enum gimplify_status, though we can't see that type here. */
- int (*gimplify_expr) (tree *, tree *, tree *);
+ int (*gimplify_expr) (tree *, gimple_seq *, gimple_seq *);
/* Fold an OBJ_TYPE_REF expression to the address of a function.
KNOWN_TYPE carries the true type of the OBJ_TYPE_REF_OBJECT. */
@@ -410,6 +410,14 @@ struct lang_hooks
/* Do language specific processing in the builtin function DECL */
tree (*builtin_function) (tree decl);
+ /* Like builtin_function, but make sure the scope is the external scope.
+ This is used to delay putting in back end builtin functions until the ISA
+ that defines the builtin is declared via function specific target options,
+ which can save memory for machines like the x86_64 that have multiple
+ ISAs. If this points to the same function as builtin_function, the
+ backend must add all of the builtins at program initialization time. */
+ tree (*builtin_function_ext_scope) (tree decl);
+
/* Used to set up the tree_contains_structure array for a frontend. */
void (*init_ts) (void);
@@ -429,4 +437,10 @@ extern tree add_builtin_function (const char *name, tree type,
const char *library_name,
tree attrs);
+extern tree add_builtin_function_ext_scope (const char *name, tree type,
+ int function_code,
+ enum built_in_class cl,
+ const char *library_name,
+ tree attrs);
+
#endif /* GCC_LANG_HOOKS_H */
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/local-alloc.c b/gcc/local-alloc.c
index 98b67700808..5926d6af354 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -298,9 +298,8 @@ static int equiv_init_movable_p (rtx, int);
static int contains_replace_regs (rtx);
static int memref_referenced_p (rtx, rtx);
static int memref_used_between_p (rtx, rtx, rtx);
-static void update_equiv_regs (void);
static void no_equiv (rtx, const_rtx, void *);
-static void block_alloc (int);
+static void block_alloc (basic_block);
static int qty_sugg_compare (int, int);
static int qty_sugg_compare_1 (const void *, const void *);
static int qty_compare (int, int);
@@ -312,7 +311,7 @@ static void reg_is_set (rtx, const_rtx, void *);
static void reg_is_born (rtx, int);
static void wipe_dead_reg (rtx, int);
static int find_free_reg (enum reg_class, enum machine_mode, int, int, int,
- int, int);
+ int, int, basic_block);
static void mark_life (int, enum machine_mode, int);
static void post_mark_life (int, enum machine_mode, int, int, int);
static int requires_inout (const char *);
@@ -437,7 +436,7 @@ local_alloc (void)
next_qty = 0;
- block_alloc (b->index);
+ block_alloc (b);
}
free (qty);
@@ -795,9 +794,11 @@ memref_used_between_p (rtx memref, rtx start, rtx end)
into the using insn. If it succeeds, we can eliminate the register
completely.
- Initialize the REG_EQUIV_INIT array of initializing insns. */
+ Initialize the REG_EQUIV_INIT array of initializing insns.
-static void
+ Return non-zero if jump label rebuilding should be done. */
+
+int
update_equiv_regs (void)
{
rtx insn;
@@ -1183,6 +1184,8 @@ update_equiv_regs (void)
new_insn = emit_insn_before (PATTERN (equiv_insn), insn);
REG_NOTES (new_insn) = REG_NOTES (equiv_insn);
REG_NOTES (equiv_insn) = 0;
+ /* Rescan it to process the notes. */
+ df_insn_rescan (new_insn);
/* Make sure this insn is recognized before
reload begins, otherwise
@@ -1227,6 +1230,7 @@ update_equiv_regs (void)
end_alias_analysis ();
free (reg_equiv);
+ return recorded_label_ref;
}
/* Mark REG as having no known equivalence.
@@ -1266,7 +1270,7 @@ no_equiv (rtx reg, const_rtx store ATTRIBUTE_UNUSED, void *data ATTRIBUTE_UNUSED
Only the pseudos that die but once can be handled. */
static void
-block_alloc (int b)
+block_alloc (basic_block b)
{
int i, q;
rtx insn;
@@ -1279,7 +1283,7 @@ block_alloc (int b)
/* Count the instructions in the basic block. */
- insn = BB_END (BASIC_BLOCK (b));
+ insn = BB_END (b);
while (1)
{
if (!NOTE_P (insn))
@@ -1287,7 +1291,7 @@ block_alloc (int b)
++insn_count;
gcc_assert (insn_count <= max_uid);
}
- if (insn == BB_HEAD (BASIC_BLOCK (b)))
+ if (insn == BB_HEAD (b))
break;
insn = PREV_INSN (insn);
}
@@ -1298,14 +1302,14 @@ block_alloc (int b)
/* Initialize table of hardware registers currently live. */
- REG_SET_TO_HARD_REG_SET (regs_live, DF_LR_IN (BASIC_BLOCK (b)));
+ REG_SET_TO_HARD_REG_SET (regs_live, DF_LR_IN (b));
/* This is conservative, as this would include registers that are
artificial-def'ed-but-not-used. However, artificial-defs are
rare, and such uninitialized use is rarer still, and the chance
of this having any performance impact is even less, while the
benefit is not having to compute and keep the TOP set around. */
- for (def_rec = df_get_artificial_defs (b); *def_rec; def_rec++)
+ for (def_rec = df_get_artificial_defs (b->index); *def_rec; def_rec++)
{
int regno = DF_REF_REGNO (*def_rec);
if (regno < FIRST_PSEUDO_REGISTER)
@@ -1316,7 +1320,7 @@ block_alloc (int b)
and assigns quantities to registers.
It computes which registers to tie. */
- insn = BB_HEAD (BASIC_BLOCK (b));
+ insn = BB_HEAD (b);
while (1)
{
if (!NOTE_P (insn))
@@ -1483,7 +1487,7 @@ block_alloc (int b)
IOR_HARD_REG_SET (regs_live_at[2 * insn_number], regs_live);
IOR_HARD_REG_SET (regs_live_at[2 * insn_number + 1], regs_live);
- if (insn == BB_END (BASIC_BLOCK (b)))
+ if (insn == BB_END (b))
break;
insn = NEXT_INSN (insn);
@@ -1538,7 +1542,7 @@ block_alloc (int b)
q = qty_order[i];
if (qty_phys_num_sugg[q] != 0 || qty_phys_num_copy_sugg[q] != 0)
qty[q].phys_reg = find_free_reg (qty[q].min_class, qty[q].mode, q,
- 0, 1, qty[q].birth, qty[q].death);
+ 0, 1, qty[q].birth, qty[q].death, b);
else
qty[q].phys_reg = -1;
}
@@ -1623,19 +1627,19 @@ block_alloc (int b)
a scheduling pass after reload and we are not optimizing
for code size. */
if (flag_schedule_insns_after_reload && dbg_cnt (local_alloc_for_sched)
- && !optimize_size
+ && optimize_bb_for_speed_p (b)
&& !SMALL_REGISTER_CLASSES)
{
qty[q].phys_reg = find_free_reg (qty[q].min_class,
qty[q].mode, q, 0, 0,
- fake_birth, fake_death);
+ fake_birth, fake_death, b);
if (qty[q].phys_reg >= 0)
continue;
}
#endif
qty[q].phys_reg = find_free_reg (qty[q].min_class,
qty[q].mode, q, 0, 0,
- qty[q].birth, qty[q].death);
+ qty[q].birth, qty[q].death, b);
if (qty[q].phys_reg >= 0)
continue;
}
@@ -1643,17 +1647,17 @@ block_alloc (int b)
#ifdef INSN_SCHEDULING
/* Similarly, avoid false dependencies. */
if (flag_schedule_insns_after_reload && dbg_cnt (local_alloc_for_sched)
- && !optimize_size
+ && optimize_bb_for_speed_p (b)
&& !SMALL_REGISTER_CLASSES
&& qty[q].alternate_class != NO_REGS)
qty[q].phys_reg = find_free_reg (qty[q].alternate_class,
qty[q].mode, q, 0, 0,
- fake_birth, fake_death);
+ fake_birth, fake_death, b);
#endif
if (qty[q].alternate_class != NO_REGS)
qty[q].phys_reg = find_free_reg (qty[q].alternate_class,
qty[q].mode, q, 0, 0,
- qty[q].birth, qty[q].death);
+ qty[q].birth, qty[q].death, b);
}
}
@@ -2141,7 +2145,7 @@ wipe_dead_reg (rtx reg, int output_p)
static int
find_free_reg (enum reg_class rclass, enum machine_mode mode, int qtyno,
int accept_call_clobbered, int just_try_suggested,
- int born_index, int dead_index)
+ int born_index, int dead_index, basic_block bb)
{
int i, ins;
HARD_REG_SET first_used, used;
@@ -2257,7 +2261,7 @@ find_free_reg (enum reg_class rclass, enum machine_mode mode, int qtyno,
/* Don't try the copy-suggested regs again. */
qty_phys_num_copy_sugg[qtyno] = 0;
return find_free_reg (rclass, mode, qtyno, accept_call_clobbered, 1,
- born_index, dead_index);
+ born_index, dead_index, bb);
}
/* We need not check to see if the current function has nonlocal
@@ -2270,11 +2274,12 @@ find_free_reg (enum reg_class rclass, enum machine_mode mode, int qtyno,
&& ! just_try_suggested
&& qty[qtyno].n_calls_crossed != 0
&& qty[qtyno].n_throwing_calls_crossed == 0
- && CALLER_SAVE_PROFITABLE (optimize_size ? qty[qtyno].n_refs : qty[qtyno].freq,
- optimize_size ? qty[qtyno].n_calls_crossed
+ && CALLER_SAVE_PROFITABLE (optimize_bb_for_size_p (bb) ? qty[qtyno].n_refs
+ : qty[qtyno].freq,
+ optimize_bb_for_size_p (bb) ? qty[qtyno].n_calls_crossed
: qty[qtyno].freq_calls_crossed))
{
- i = find_free_reg (rclass, mode, qtyno, 1, 0, born_index, dead_index);
+ i = find_free_reg (rclass, mode, qtyno, 1, 0, born_index, dead_index, bb);
if (i >= 0)
caller_save_needed = 1;
return i;
@@ -2442,6 +2447,12 @@ find_stack_regs (void)
}
#endif
+static bool
+gate_handle_local_alloc (void)
+{
+ return ! flag_ira;
+}
+
/* Run old register allocator. Return TRUE if we must exit
rest_of_compilation upon return. */
static unsigned int
@@ -2517,7 +2528,7 @@ struct rtl_opt_pass pass_local_alloc =
{
RTL_PASS,
"lreg", /* name */
- NULL, /* gate */
+ gate_handle_local_alloc, /* gate */
rest_of_handle_local_alloc, /* execute */
NULL, /* sub */
NULL, /* next */
diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c
index b6dc266d7c6..7995786329c 100644
--- a/gcc/loop-unroll.c
+++ b/gcc/loop-unroll.c
@@ -269,7 +269,7 @@ decide_unrolling_and_peeling (int flags)
fprintf (dump_file, "\n;; *** Considering loop %d ***\n", loop->num);
/* Do not peel cold areas. */
- if (!maybe_hot_bb_p (loop->header))
+ if (optimize_loop_for_size_p (loop))
{
if (dump_file)
fprintf (dump_file, ";; Not considering loop, cold area\n");
@@ -368,7 +368,7 @@ decide_peel_completely (struct loop *loop, int flags ATTRIBUTE_UNUSED)
}
/* Do not peel cold areas. */
- if (!maybe_hot_bb_p (loop->header))
+ if (optimize_loop_for_size_p (loop))
{
if (dump_file)
fprintf (dump_file, ";; Not considering loop, cold area\n");
diff --git a/gcc/loop-unswitch.c b/gcc/loop-unswitch.c
index 9d66d41db6e..8770bf6b5a8 100644
--- a/gcc/loop-unswitch.c
+++ b/gcc/loop-unswitch.c
@@ -290,7 +290,7 @@ unswitch_single_loop (struct loop *loop, rtx cond_checked, int num)
}
/* Do not unswitch in cold areas. */
- if (!maybe_hot_bb_p (loop->header))
+ if (optimize_loop_for_size_p (loop))
{
if (dump_file)
fprintf (dump_file, ";; Not unswitching, not hot area\n");
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 33bb0b4e8f4..b00a6b99f5e 100644
--- a/gcc/matrix-reorg.c
+++ b/gcc/matrix-reorg.c
@@ -107,9 +107,7 @@ along with GCC; see the file COPYING3. If not see
Both optimizations are described in the paper "Matrix flattening and
transposing in GCC" which was presented in GCC summit 2006.
- http://www.gccsummit.org/2006/2006-GCC-Summit-Proceedings.pdf
-
- */
+ http://www.gccsummit.org/2006/2006-GCC-Summit-Proceedings.pdf. */
#include "config.h"
#include "system.h"
@@ -145,8 +143,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-chrec.h"
#include "tree-scalar-evolution.h"
-/*
- We need to collect a lot of data from the original malloc,
+/* We need to collect a lot of data from the original malloc,
particularly as the gimplifier has converted:
orig_var = (struct_type *) malloc (x * sizeof (struct_type *));
@@ -164,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));
@@ -188,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;
@@ -224,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;
@@ -263,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;
@@ -272,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;
@@ -283,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;
@@ -323,7 +319,7 @@ struct matrix_info
struct matrix_access_phi_node
{
- tree phi;
+ gimple phi;
int indirection_level;
};
@@ -409,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 = GIMPLE_STMT_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)))
@@ -451,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;
@@ -469,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;
@@ -598,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))
@@ -611,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;
@@ -633,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)
{
@@ -671,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;
@@ -698,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;
@@ -741,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]),
@@ -770,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 = GIMPLE_STMT_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. */
@@ -910,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 (GIMPLE_STMT_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);
@@ -930,7 +941,7 @@ analyze_transpose (void **slot, void *data ATTRIBUTE_UNUSED)
{
acc_info->iterated_by_inner_most_loop_p = 1;
mi->dim_hot_level[acc_info->level] +=
- bb_for_stmt (acc_info->stmt)->count;
+ gimple_bb (acc_info->stmt)->count;
}
}
@@ -946,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 (GIMPLE_STMT_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;
@@ -972,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 (GIMPLE_STMT_OPERAND (stmt, 0)) == INDIRECT_REF)
+ if (is_gimple_assign (stmt)
+ && TREE_CODE (gimple_assign_lhs (stmt)) == INDIRECT_REF)
{
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
+ lhs = gimple_assign_lhs (stmt);
gcc_assert (POINTER_TYPE_P
(TREE_TYPE (SSA_NAME_VAR (TREE_OPERAND (lhs, 0)))));
type_size =
@@ -1027,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);
}
@@ -1061,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
@@ -1074,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)
{
@@ -1091,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;
}
@@ -1127,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 = GIMPLE_STMT_OPERAND (use_stmt, 0);
- tree rhs = GIMPLE_STMT_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));
@@ -1151,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.
@@ -1171,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);
@@ -1193,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)
{
@@ -1236,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)
@@ -1332,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
@@ -1343,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
@@ -1362,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 (GIMPLE_STMT_OPERAND (stmt, 0) == t)
- return stmt;
+ if (gimple_get_lhs (stmt) == t)
+ {
+ callback_data->stmt = stmt;
+ return t;
+ }
}
}
*walk_subtrees = 1;
@@ -1385,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 (GIMPLE_STMT_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)
@@ -1446,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;
}
@@ -1484,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;
@@ -1505,17 +1590,18 @@ 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;
- struct malloc_call_data mcd;
+ gimple call_stmt;
+ tree size;
+ struct malloc_call_data mcd = {NULL, NULL_TREE, NULL_TREE};
call_stmt = mi->malloc_for_level[level];
@@ -1575,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;
@@ -1584,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 (GIMPLE_STMT_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 = GIMPLE_STMT_OPERAND (stmt, 0);
+ tmpmi.decl = lhs;
if ((mi = (struct matrix_info *) htab_find (matrices_to_reorg,
&tmpmi)))
{
@@ -1598,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 (GIMPLE_STMT_OPERAND (stmt, 0)) == SSA_NAME
- && TREE_CODE (GIMPLE_STMT_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 = GIMPLE_STMT_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,
- GIMPLE_STMT_OPERAND (stmt, 0), 0,
+ analyze_matrix_accesses (mi, lhs, 0,
false, visited_stmts_1, record);
}
}
@@ -1640,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 = GIMPLE_STMT_OPERAND (SSA_NAME_DEF_STMT (ssa_var), 1);
- lhs = GIMPLE_STMT_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;
@@ -1664,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)
{
@@ -1692,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);
@@ -1719,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)
@@ -1730,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)
@@ -1741,73 +1834,65 @@ transform_access_sites (void **slot, void *data ATTRIBUTE_UNUSED)
}
if (acc_info->is_alloc)
{
- if (acc_info->level >= 0 && bb_for_stmt (acc_info->stmt))
+ if (acc_info->level >= 0 && gimple_bb (acc_info->stmt))
{
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 (GIMPLE_STMT_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,
- GIMPLE_STMT_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 (GIMPLE_STMT_OPERAND
- (acc_info->stmt, 0)),
- TREE_OPERAND (GIMPLE_STMT_OPERAND
- (acc_info->stmt, 1), 0));
- tmp =
- create_tmp_var (TREE_TYPE
- (GIMPLE_STMT_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 (GIMPLE_STMT_OPERAND
- (acc_info->stmt, 0)), tmp,
- conv);
- tmp = make_ssa_name (tmp, stmts);
- GIMPLE_STMT_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 = GIMPLE_STMT_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),
- GIMPLE_STMT_OPERAND (orig, 0));
- GIMPLE_STMT_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;
@@ -1841,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;
@@ -1857,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)
@@ -1876,7 +1961,8 @@ 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);
+ update_stmt (acc_info->stmt);
}
}
}
@@ -1935,10 +2021,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;
@@ -2021,17 +2108,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;
}
}
@@ -2041,7 +2131,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.
@@ -2060,7 +2150,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
@@ -2091,24 +2182,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);
- GIMPLE_STMT_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 = GIMPLE_STMT_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)
@@ -2123,33 +2212,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 = GIMPLE_STMT_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,
- GIMPLE_STMT_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,
- GIMPLE_STMT_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);
@@ -2159,24 +2246,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;
@@ -2204,7 +2288,6 @@ dump_matrix_reorg_analysis (void **slot, void *data ATTRIBUTE_UNUSED)
return 1;
}
-
/* Perform matrix flattening. */
static unsigned int
@@ -2233,7 +2316,7 @@ matrix_reorg (void)
current_function_decl = node->decl;
push_cfun (DECL_STRUCT_FUNCTION (node->decl));
bitmap_obstack_initialize (NULL);
- tree_register_cfg_hooks ();
+ gimple_register_cfg_hooks ();
if (!gimple_in_ssa_p (cfun))
{
@@ -2301,7 +2384,7 @@ matrix_reorg (void)
current_function_decl = node->decl;
push_cfun (DECL_STRUCT_FUNCTION (node->decl));
bitmap_obstack_initialize (NULL);
- tree_register_cfg_hooks ();
+ gimple_register_cfg_hooks ();
record_all_accesses_in_func ();
htab_traverse (matrices_to_reorg, transform_access_sites, NULL);
free_dominance_info (CDI_DOMINATORS);
@@ -2344,3 +2427,4 @@ struct simple_ipa_opt_pass pass_ipa_matrix_reorg =
TODO_dump_cgraph | TODO_dump_func /* todo_flags_finish */
}
};
+
diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog
index 12291d5604f..8fa3d3d4df1 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,19 @@
+2008-07-28 Richard Guenther <rguenther@suse.de>
+
+ Merge from gimple-tuples-branch.
+
+ 2008-07-18 Aldy Hernandez <aldyh@redhat.com>
+
+ * Make-lang.in (objc-lang.o): Depend on GIMPLE_H.
+ (objc-act.o): Rename TREE_GIMPLE_H to GIMPLE_H.
+ * objc-act.h: Include gimple.h instead of tree-gimple.h.
+ * ipa-reference.c: Same.
+
+ 2007-11-10 Aldy Hernandez <aldyh@redhat.com>
+
+ * objc-act.c (objc_gimplify_expr): Change pre and post to sequences.
+ * objc-act.h (objc_gimplify_expr): Change prototype accordingly.
+
2008-07-21 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* objc-act.c: Fix comment typos.
diff --git a/gcc/objc/Make-lang.in b/gcc/objc/Make-lang.in
index 93a0042a860..c5de9d83c73 100644
--- a/gcc/objc/Make-lang.in
+++ b/gcc/objc/Make-lang.in
@@ -72,14 +72,14 @@ objc/objc-lang.o : objc/objc-lang.c \
$(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(C_TREE_H) $(DIAGNOSTIC_H) \
$(GGC_H) langhooks.h $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-objc.h \
- c-objc-common.h objc/objc-act.h $(TREE_GIMPLE_H)
+ c-objc-common.h objc/objc-act.h $(GIMPLE_H)
objc/objc-act.o : objc/objc-act.c \
$(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) $(TM_P_H) \
$(EXPR_H) $(TARGET_H) $(C_TREE_H) $(DIAGNOSTIC_H) toplev.h $(FLAGS_H) \
objc/objc-act.h input.h $(FUNCTION_H) output.h debug.h langhooks.h \
$(LANGHOOKS_DEF_H) $(HASHTAB_H) $(C_PRAGMA_H) gt-objc-objc-act.h \
- $(TREE_GIMPLE_H)
+ $(GIMPLE_H)
objc.srcextra:
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 44c8648a781..5941fb69389 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -9476,7 +9476,7 @@ objc_rewrite_function_call (tree function, tree params)
of its cousins). */
enum gimplify_status
-objc_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p)
+objc_gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
{
enum gimplify_status r0, r1;
if (TREE_CODE (*expr_p) == OBJ_TYPE_REF
diff --git a/gcc/objc/objc-act.h b/gcc/objc/objc-act.h
index e4b8a93bf39..741401d8356 100644
--- a/gcc/objc/objc-act.h
+++ b/gcc/objc/objc-act.h
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see
#define GCC_OBJC_ACT_H
/* For enum gimplify_status */
-#include "tree-gimple.h"
+#include "gimple.h"
/*** Language hooks ***/
@@ -32,7 +32,7 @@ const char *objc_printable_name (tree, int);
tree objc_get_callee_fndecl (const_tree);
void objc_finish_file (void);
tree objc_fold_obj_type_ref (tree, tree);
-enum gimplify_status objc_gimplify_expr (tree *, tree *, tree *);
+enum gimplify_status objc_gimplify_expr (tree *, gimple_seq *, gimple_seq *);
/* NB: The remaining public functions are prototyped in c-common.h, for the
benefit of stub-objc.c and objc-act.c. */
diff --git a/gcc/objcp/Make-lang.in b/gcc/objcp/Make-lang.in
index 695df4d2f61..fb7cffee234 100644
--- a/gcc/objcp/Make-lang.in
+++ b/gcc/objcp/Make-lang.in
@@ -72,12 +72,12 @@ cc1objplus$(exeext): $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) $(LIBDEPS)
objcp/objcp-lang.o : objcp/objcp-lang.c \
$(CXX_TREE_H) $(TM_H) toplev.h debug.h langhooks.h objc/objc-act.h \
$(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-objcp.h \
- $(DIAGNOSTIC_H) cp/cp-objcp-common.h $(TREE_GIMPLE_H)
+ $(DIAGNOSTIC_H) cp/cp-objcp-common.h $(GIMPLE_H)
objcp/objcp-decl.o : objcp/objcp-decl.c \
$(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \
toplev.h $(GGC_H) $(C_PRAGMA_H) input.h $(FLAGS_H) output.h \
- objc/objc-act.h objcp/objcp-decl.h $(TREE_GIMPLE_H) $(EXPR_H) $(TARGET_H)
+ objc/objc-act.h objcp/objcp-decl.h $(GIMPLE_H) $(EXPR_H) $(TARGET_H)
# The following must be an explicit rule; please keep in sync with the implicit
# one in Makefile.in.
@@ -86,7 +86,7 @@ objcp/objcp-act.o : objc/objc-act.c \
$(EXPR_H) $(TARGET_H) $(CXX_TREE_H) $(DIAGNOSTIC_H) toplev.h $(FLAGS_H) \
objc/objc-act.h input.h $(FUNCTION_H) output.h debug.h langhooks.h \
objcp/objcp-decl.h $(LANGHOOKS_DEF_H) $(HASHTAB_H) gt-objc-objc-act.h \
- $(TREE_GIMPLE_H)
+ $(GIMPLE_H)
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
po-generated:
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 8ee717a36a1..d6c5500319a 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -27,7 +27,8 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h"
#include "tree.h"
#include "rtl.h"
-#include "tree-gimple.h"
+#include "gimple.h"
+#include "tree-iterator.h"
#include "tree-inline.h"
#include "langhooks.h"
#include "diagnostic.h"
@@ -44,6 +45,7 @@ along with GCC; see the file COPYING3. If not see
#include "optabs.h"
#include "cfgloop.h"
+
/* Lowering of OpenMP parallel and workshare constructs proceeds in two
phases. The first phase scans the function looking for OMP statements
and then for variables that must be replaced to satisfy data sharing
@@ -68,7 +70,7 @@ typedef struct omp_context
/* The tree of contexts corresponding to the encountered constructs. */
struct omp_context *outer;
- tree stmt;
+ gimple stmt;
/* Map variables to fields in a structure that allows communication
between sending and receiving threads. */
@@ -114,7 +116,8 @@ struct omp_for_data_loop
struct omp_for_data
{
struct omp_for_data_loop loop;
- tree chunk_size, for_stmt;
+ tree chunk_size;
+ gimple for_stmt;
tree pre, iter_type;
int collapse;
bool have_nowait, have_ordered;
@@ -128,8 +131,33 @@ static int taskreg_nesting_level;
struct omp_region *root_omp_region;
static bitmap task_shared_vars;
-static void scan_omp (tree *, omp_context *);
-static void lower_omp (tree *, omp_context *);
+static void scan_omp (gimple_seq, omp_context *);
+static tree scan_omp_1_op (tree *, int *, void *);
+
+#define WALK_SUBSTMTS \
+ case GIMPLE_BIND: \
+ case GIMPLE_TRY: \
+ case GIMPLE_CATCH: \
+ case GIMPLE_EH_FILTER: \
+ /* The sub-statements for these should be walked. */ \
+ *handled_ops_p = false; \
+ break;
+
+/* Convenience function for calling scan_omp_1_op on tree operands. */
+
+static inline tree
+scan_omp_op (tree *tp, omp_context *ctx)
+{
+ struct walk_stmt_info wi;
+
+ memset (&wi, 0, sizeof (wi));
+ wi.info = ctx;
+ wi.want_locations = true;
+
+ return walk_tree (tp, scan_omp_1_op, &wi, NULL);
+}
+
+static void lower_omp (gimple_seq, omp_context *);
static tree lookup_decl_in_outer_ctx (tree, omp_context *);
static tree maybe_lookup_decl_in_outer_ctx (tree, omp_context *);
@@ -150,7 +178,7 @@ find_omp_clause (tree clauses, enum tree_code kind)
static inline bool
is_parallel_ctx (omp_context *ctx)
{
- return TREE_CODE (ctx->stmt) == OMP_PARALLEL;
+ return gimple_code (ctx->stmt) == GIMPLE_OMP_PARALLEL;
}
@@ -159,7 +187,7 @@ is_parallel_ctx (omp_context *ctx)
static inline bool
is_task_ctx (omp_context *ctx)
{
- return TREE_CODE (ctx->stmt) == OMP_TASK;
+ return gimple_code (ctx->stmt) == GIMPLE_OMP_TASK;
}
@@ -168,8 +196,8 @@ is_task_ctx (omp_context *ctx)
static inline bool
is_taskreg_ctx (omp_context *ctx)
{
- return TREE_CODE (ctx->stmt) == OMP_PARALLEL
- || TREE_CODE (ctx->stmt) == OMP_TASK;
+ return gimple_code (ctx->stmt) == GIMPLE_OMP_PARALLEL
+ || gimple_code (ctx->stmt) == GIMPLE_OMP_TASK;
}
@@ -186,7 +214,7 @@ is_combined_parallel (struct omp_region *region)
them into *FD. */
static void
-extract_omp_for_data (tree for_stmt, struct omp_for_data *fd,
+extract_omp_for_data (gimple for_stmt, struct omp_for_data *fd,
struct omp_for_data_loop *loops)
{
tree t, var, *collapse_iter, *collapse_count;
@@ -197,7 +225,7 @@ extract_omp_for_data (tree for_stmt, struct omp_for_data *fd,
fd->for_stmt = for_stmt;
fd->pre = NULL;
- fd->collapse = TREE_VEC_LENGTH (OMP_FOR_INIT (for_stmt));
+ fd->collapse = gimple_omp_for_collapse (for_stmt);
if (fd->collapse > 1)
fd->loops = loops;
else
@@ -209,7 +237,7 @@ extract_omp_for_data (tree for_stmt, struct omp_for_data *fd,
collapse_iter = NULL;
collapse_count = NULL;
- for (t = OMP_FOR_CLAUSES (for_stmt); t ; t = OMP_CLAUSE_CHAIN (t))
+ for (t = gimple_omp_for_clauses (for_stmt); t ; t = OMP_CLAUSE_CHAIN (t))
switch (OMP_CLAUSE_CODE (t))
{
case OMP_CLAUSE_NOWAIT:
@@ -264,19 +292,16 @@ extract_omp_for_data (tree for_stmt, struct omp_for_data *fd,
else
loop = &dummy_loop;
- t = TREE_VEC_ELT (OMP_FOR_INIT (for_stmt), i);
- gcc_assert (TREE_CODE (t) == GIMPLE_MODIFY_STMT);
- loop->v = GIMPLE_STMT_OPERAND (t, 0);
+
+ loop->v = gimple_omp_for_index (for_stmt, i);
gcc_assert (SSA_VAR_P (loop->v));
gcc_assert (TREE_CODE (TREE_TYPE (loop->v)) == INTEGER_TYPE
|| TREE_CODE (TREE_TYPE (loop->v)) == POINTER_TYPE);
var = TREE_CODE (loop->v) == SSA_NAME ? SSA_NAME_VAR (loop->v) : loop->v;
- loop->n1 = GIMPLE_STMT_OPERAND (t, 1);
+ loop->n1 = gimple_omp_for_initial (for_stmt, i);
- t = TREE_VEC_ELT (OMP_FOR_COND (for_stmt), i);
- loop->cond_code = TREE_CODE (t);
- gcc_assert (TREE_OPERAND (t, 0) == var);
- loop->n2 = TREE_OPERAND (t, 1);
+ loop->cond_code = gimple_omp_for_cond (for_stmt, i);
+ loop->n2 = gimple_omp_for_final (for_stmt, i);
switch (loop->cond_code)
{
case LT_EXPR:
@@ -304,10 +329,7 @@ extract_omp_for_data (tree for_stmt, struct omp_for_data *fd,
gcc_unreachable ();
}
- t = TREE_VEC_ELT (OMP_FOR_INCR (for_stmt), i);
- gcc_assert (TREE_CODE (t) == GIMPLE_MODIFY_STMT);
- gcc_assert (GIMPLE_STMT_OPERAND (t, 0) == var);
- t = GIMPLE_STMT_OPERAND (t, 1);
+ t = gimple_omp_for_incr (for_stmt, i);
gcc_assert (TREE_OPERAND (t, 0) == var);
switch (TREE_CODE (t))
{
@@ -449,9 +471,9 @@ extract_omp_for_data (tree for_stmt, struct omp_for_data *fd,
When expanding a combined parallel+workshare region, the call to
the child function may need additional arguments in the case of
- OMP_FOR regions. In some cases, these arguments are computed out
- of variables passed in from the parent to the child via 'struct
- .omp_data_s'. For instance:
+ GIMPLE_OMP_FOR regions. In some cases, these arguments are
+ computed out of variables passed in from the parent to the child
+ via 'struct .omp_data_s'. For instance:
#pragma omp parallel for schedule (guided, i * 4)
for (j ...)
@@ -475,7 +497,7 @@ extract_omp_for_data (tree for_stmt, struct omp_for_data *fd,
To see whether the code in WS_ENTRY_BB blocks the combined
parallel+workshare call, we collect all the variables used in the
- OMP_FOR header check whether they appear on the LHS of any
+ GIMPLE_OMP_FOR header check whether they appear on the LHS of any
statement in WS_ENTRY_BB. If so, then we cannot emit the combined
call.
@@ -488,15 +510,15 @@ static bool
workshare_safe_to_combine_p (basic_block par_entry_bb, basic_block ws_entry_bb)
{
struct omp_for_data fd;
- tree par_stmt, ws_stmt;
+ gimple par_stmt, ws_stmt;
par_stmt = last_stmt (par_entry_bb);
ws_stmt = last_stmt (ws_entry_bb);
- if (TREE_CODE (ws_stmt) == OMP_SECTIONS)
+ if (gimple_code (ws_stmt) == GIMPLE_OMP_SECTIONS)
return true;
- gcc_assert (TREE_CODE (ws_stmt) == OMP_FOR);
+ gcc_assert (gimple_code (ws_stmt) == GIMPLE_OMP_FOR);
extract_omp_for_data (ws_stmt, &fd, NULL);
@@ -525,11 +547,11 @@ workshare_safe_to_combine_p (basic_block par_entry_bb, basic_block ws_entry_bb)
expanded. */
static tree
-get_ws_args_for (tree ws_stmt)
+get_ws_args_for (gimple ws_stmt)
{
tree t;
- if (TREE_CODE (ws_stmt) == OMP_FOR)
+ if (gimple_code (ws_stmt) == GIMPLE_OMP_FOR)
{
struct omp_for_data fd;
tree ws_args;
@@ -554,12 +576,12 @@ get_ws_args_for (tree ws_stmt)
return ws_args;
}
- else if (TREE_CODE (ws_stmt) == OMP_SECTIONS)
+ else if (gimple_code (ws_stmt) == GIMPLE_OMP_SECTIONS)
{
/* Number of sections is equal to the number of edges from the
- OMP_SECTIONS_SWITCH statement, except for the one to the exit
- of the sections region. */
- basic_block bb = single_succ (bb_for_stmt (ws_stmt));
+ GIMPLE_OMP_SECTIONS_SWITCH statement, except for the one to
+ the exit of the sections region. */
+ basic_block bb = single_succ (gimple_bb (ws_stmt));
t = build_int_cst (unsigned_type_node, EDGE_COUNT (bb->succs) - 1);
t = tree_cons (NULL, t, NULL);
return t;
@@ -583,9 +605,9 @@ determine_parallel_type (struct omp_region *region)
return;
/* We only support parallel+for and parallel+sections. */
- if (region->type != OMP_PARALLEL
- || (region->inner->type != OMP_FOR
- && region->inner->type != OMP_SECTIONS))
+ if (region->type != GIMPLE_OMP_PARALLEL
+ || (region->inner->type != GIMPLE_OMP_FOR
+ && region->inner->type != GIMPLE_OMP_SECTIONS))
return;
/* Check for perfect nesting PAR_ENTRY_BB -> WS_ENTRY_BB and
@@ -598,13 +620,13 @@ determine_parallel_type (struct omp_region *region)
if (single_succ (par_entry_bb) == ws_entry_bb
&& single_succ (ws_exit_bb) == par_exit_bb
&& workshare_safe_to_combine_p (par_entry_bb, ws_entry_bb)
- && (OMP_PARALLEL_COMBINED (last_stmt (par_entry_bb))
+ && (gimple_omp_parallel_combined_p (last_stmt (par_entry_bb))
|| (last_and_only_stmt (ws_entry_bb)
&& last_and_only_stmt (par_exit_bb))))
{
- tree ws_stmt = last_stmt (ws_entry_bb);
+ gimple ws_stmt = last_stmt (ws_entry_bb);
- if (region->inner->type == OMP_FOR)
+ if (region->inner->type == GIMPLE_OMP_FOR)
{
/* If this is a combined parallel loop, we need to determine
whether or not to use the combined library calls. There
@@ -615,7 +637,7 @@ determine_parallel_type (struct omp_region *region)
parallel loop call would still need extra synchronization
to implement ordered semantics, so there would not be any
gain in using the combined call. */
- tree clauses = OMP_FOR_CLAUSES (ws_stmt);
+ tree clauses = gimple_omp_for_clauses (ws_stmt);
tree c = find_omp_clause (clauses, OMP_CLAUSE_SCHEDULE);
if (c == NULL
|| OMP_CLAUSE_SCHEDULE_KIND (c) == OMP_CLAUSE_SCHEDULE_STATIC
@@ -745,7 +767,7 @@ use_pointer_for_field (tree decl, omp_context *shared_ctx)
{
tree c;
- for (c = OMP_TASKREG_CLAUSES (up->stmt);
+ for (c = gimple_omp_taskreg_clauses (up->stmt);
c; c = OMP_CLAUSE_CHAIN (c))
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_SHARED
&& OMP_CLAUSE_DECL (c) == decl)
@@ -990,7 +1012,7 @@ fixup_remapped_decl (tree decl, omp_context *ctx, bool private_debug)
&& DECL_HAS_VALUE_EXPR_P (decl))
{
tree ve = DECL_VALUE_EXPR (decl);
- walk_tree (&ve, copy_body_r, &ctx->cb, NULL);
+ walk_tree (&ve, copy_tree_body_r, &ctx->cb, NULL);
SET_DECL_VALUE_EXPR (new_decl, ve);
DECL_HAS_VALUE_EXPR_P (new_decl) = 1;
}
@@ -1058,19 +1080,19 @@ void
dump_omp_region (FILE *file, struct omp_region *region, int indent)
{
fprintf (file, "%*sbb %d: %s\n", indent, "", region->entry->index,
- tree_code_name[region->type]);
+ gimple_code_name[region->type]);
if (region->inner)
dump_omp_region (file, region->inner, indent + 4);
if (region->cont)
{
- fprintf (file, "%*sbb %d: OMP_CONTINUE\n", indent, "",
+ fprintf (file, "%*sbb %d: GIMPLE_OMP_CONTINUE\n", indent, "",
region->cont->index);
}
if (region->exit)
- fprintf (file, "%*sbb %d: OMP_RETURN\n", indent, "",
+ fprintf (file, "%*sbb %d: GIMPLE_OMP_RETURN\n", indent, "",
region->exit->index);
else
fprintf (file, "%*s[no exit marker]\n", indent, "");
@@ -1095,7 +1117,8 @@ debug_all_omp_regions (void)
/* Create a new parallel region starting at STMT inside region PARENT. */
struct omp_region *
-new_omp_region (basic_block bb, enum tree_code type, struct omp_region *parent)
+new_omp_region (basic_block bb, enum gimple_code type,
+ struct omp_region *parent)
{
struct omp_region *region = XCNEW (struct omp_region);
@@ -1155,7 +1178,7 @@ free_omp_regions (void)
/* Create a new context, with OUTER_CTX being the surrounding context. */
static omp_context *
-new_omp_context (tree stmt, omp_context *outer_ctx)
+new_omp_context (gimple stmt, omp_context *outer_ctx)
{
omp_context *ctx = XCNEW (omp_context);
@@ -1188,17 +1211,19 @@ new_omp_context (tree stmt, omp_context *outer_ctx)
return ctx;
}
-static void maybe_catch_exception (tree *stmt_p);
+static gimple_seq maybe_catch_exception (gimple_seq);
/* Finalize task copyfn. */
static void
-finalize_task_copyfn (tree task_stmt)
+finalize_task_copyfn (gimple task_stmt)
{
struct function *child_cfun;
tree child_fn, old_fn;
+ gimple_seq seq, new_seq;
+ gimple bind;
- child_fn = OMP_TASK_COPYFN (task_stmt);
+ child_fn = gimple_omp_task_copy_fn (task_stmt);
if (child_fn == NULL_TREE)
return;
@@ -1211,8 +1236,17 @@ finalize_task_copyfn (tree task_stmt)
old_fn = current_function_decl;
push_cfun (child_cfun);
current_function_decl = child_fn;
- gimplify_body (&DECL_SAVED_TREE (child_fn), child_fn, false);
- maybe_catch_exception (&BIND_EXPR_BODY (DECL_SAVED_TREE (child_fn)));
+ bind = gimplify_body (&DECL_SAVED_TREE (child_fn), child_fn, false);
+ seq = gimple_seq_alloc ();
+ gimple_seq_add_stmt (&seq, bind);
+ new_seq = maybe_catch_exception (seq);
+ if (new_seq != seq)
+ {
+ bind = gimple_build_bind (NULL, new_seq, NULL);
+ seq = gimple_seq_alloc ();
+ gimple_seq_add_stmt (&seq, bind);
+ }
+ gimple_set_body (child_fn, seq);
pop_cfun ();
current_function_decl = old_fn;
@@ -1285,9 +1319,11 @@ fixup_child_record_type (omp_context *ctx)
DECL_CONTEXT (new_f) = type;
TREE_TYPE (new_f) = remap_type (TREE_TYPE (f), &ctx->cb);
TREE_CHAIN (new_f) = new_fields;
- walk_tree (&DECL_SIZE (new_f), copy_body_r, &ctx->cb, NULL);
- walk_tree (&DECL_SIZE_UNIT (new_f), copy_body_r, &ctx->cb, NULL);
- walk_tree (&DECL_FIELD_OFFSET (new_f), copy_body_r, &ctx->cb, NULL);
+ walk_tree (&DECL_SIZE (new_f), copy_tree_body_r, &ctx->cb, NULL);
+ walk_tree (&DECL_SIZE_UNIT (new_f), copy_tree_body_r,
+ &ctx->cb, NULL);
+ walk_tree (&DECL_FIELD_OFFSET (new_f), copy_tree_body_r,
+ &ctx->cb, NULL);
new_fields = new_f;
/* Arrange to be able to look up the receiver field
@@ -1386,7 +1422,7 @@ scan_sharing_clauses (tree clauses, omp_context *ctx)
case OMP_CLAUSE_COPYPRIVATE:
if (ctx->outer)
- scan_omp (&OMP_CLAUSE_DECL (c), ctx->outer);
+ scan_omp_op (&OMP_CLAUSE_DECL (c), ctx->outer);
/* FALLTHRU */
case OMP_CLAUSE_COPYIN:
@@ -1403,7 +1439,7 @@ scan_sharing_clauses (tree clauses, omp_context *ctx)
case OMP_CLAUSE_NUM_THREADS:
case OMP_CLAUSE_SCHEDULE:
if (ctx->outer)
- scan_omp (&OMP_CLAUSE_OPERAND (c, 0), ctx->outer);
+ scan_omp_op (&OMP_CLAUSE_OPERAND (c, 0), ctx->outer);
break;
case OMP_CLAUSE_NOWAIT:
@@ -1424,7 +1460,7 @@ scan_sharing_clauses (tree clauses, omp_context *ctx)
case OMP_CLAUSE_LASTPRIVATE:
/* Let the corresponding firstprivate clause create
the variable. */
- if (OMP_CLAUSE_LASTPRIVATE_STMT (c))
+ if (OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c))
scan_array_reductions = true;
if (OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE (c))
break;
@@ -1472,12 +1508,12 @@ scan_sharing_clauses (tree clauses, omp_context *ctx)
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION
&& OMP_CLAUSE_REDUCTION_PLACEHOLDER (c))
{
- scan_omp (&OMP_CLAUSE_REDUCTION_INIT (c), ctx);
- scan_omp (&OMP_CLAUSE_REDUCTION_MERGE (c), ctx);
+ scan_omp (OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c), ctx);
+ scan_omp (OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c), ctx);
}
else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LASTPRIVATE
- && OMP_CLAUSE_LASTPRIVATE_STMT (c))
- scan_omp (&OMP_CLAUSE_LASTPRIVATE_STMT (c), ctx);
+ && OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c))
+ scan_omp (OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c), ctx);
}
/* Create a new name for omp child function. Returns an identifier. */
@@ -1526,7 +1562,7 @@ create_omp_child_function (omp_context *ctx, bool task_copy)
if (!task_copy)
ctx->cb.dst_fn = decl;
else
- OMP_TASK_COPYFN (ctx->stmt) = decl;
+ gimple_omp_task_set_copy_fn (ctx->stmt, decl);
TREE_STATIC (decl) = 1;
TREE_USED (decl) = 1;
@@ -1567,8 +1603,8 @@ create_omp_child_function (omp_context *ctx, bool task_copy)
allocate_struct_function clobbers CFUN, so we need to restore
it afterward. */
push_struct_function (decl);
- DECL_SOURCE_LOCATION (decl) = EXPR_LOCATION (ctx->stmt);
- cfun->function_end_locus = EXPR_LOCATION (ctx->stmt);
+ DECL_SOURCE_LOCATION (decl) = gimple_location (ctx->stmt);
+ cfun->function_end_locus = gimple_location (ctx->stmt);
pop_cfun ();
}
@@ -1576,22 +1612,24 @@ create_omp_child_function (omp_context *ctx, bool task_copy)
/* Scan an OpenMP parallel directive. */
static void
-scan_omp_parallel (tree *stmt_p, omp_context *outer_ctx)
+scan_omp_parallel (gimple_stmt_iterator *gsi, omp_context *outer_ctx)
{
omp_context *ctx;
tree name;
+ gimple stmt = gsi_stmt (*gsi);
/* Ignore parallel directives with empty bodies, unless there
are copyin clauses. */
if (optimize > 0
- && empty_body_p (OMP_PARALLEL_BODY (*stmt_p))
- && find_omp_clause (OMP_CLAUSES (*stmt_p), OMP_CLAUSE_COPYIN) == NULL)
+ && empty_body_p (gimple_omp_body (stmt))
+ && find_omp_clause (gimple_omp_parallel_clauses (stmt),
+ OMP_CLAUSE_COPYIN) == NULL)
{
- *stmt_p = build_empty_stmt ();
+ gsi_replace (gsi, gimple_build_nop (), false);
return;
}
- ctx = new_omp_context (*stmt_p, outer_ctx);
+ ctx = new_omp_context (stmt, outer_ctx);
if (taskreg_nesting_level > 1)
ctx->is_nested = true;
ctx->field_map = splay_tree_new (splay_tree_compare_pointers, 0, 0);
@@ -1601,10 +1639,10 @@ scan_omp_parallel (tree *stmt_p, omp_context *outer_ctx)
name = build_decl (TYPE_DECL, name, ctx->record_type);
TYPE_NAME (ctx->record_type) = name;
create_omp_child_function (ctx, false);
- OMP_PARALLEL_FN (*stmt_p) = ctx->cb.dst_fn;
+ gimple_omp_parallel_set_child_fn (stmt, ctx->cb.dst_fn);
- scan_sharing_clauses (OMP_PARALLEL_CLAUSES (*stmt_p), ctx);
- scan_omp (&OMP_PARALLEL_BODY (*stmt_p), ctx);
+ scan_sharing_clauses (gimple_omp_parallel_clauses (stmt), ctx);
+ scan_omp (gimple_omp_body (stmt), ctx);
if (TYPE_FIELDS (ctx->record_type) == NULL)
ctx->record_type = ctx->receiver_decl = NULL;
@@ -1618,20 +1656,21 @@ scan_omp_parallel (tree *stmt_p, omp_context *outer_ctx)
/* Scan an OpenMP task directive. */
static void
-scan_omp_task (tree *stmt_p, omp_context *outer_ctx)
+scan_omp_task (gimple_stmt_iterator *gsi, omp_context *outer_ctx)
{
omp_context *ctx;
- tree name;
+ tree name, t;
+ gimple stmt = gsi_stmt (*gsi);
/* Ignore task directives with empty bodies. */
if (optimize > 0
- && empty_body_p (OMP_TASK_BODY (*stmt_p)))
+ && empty_body_p (gimple_omp_body (stmt)))
{
- *stmt_p = build_empty_stmt ();
+ gsi_replace (gsi, gimple_build_nop (), false);
return;
}
- ctx = new_omp_context (*stmt_p, outer_ctx);
+ ctx = new_omp_context (stmt, outer_ctx);
if (taskreg_nesting_level > 1)
ctx->is_nested = true;
ctx->field_map = splay_tree_new (splay_tree_compare_pointers, 0, 0);
@@ -1641,9 +1680,9 @@ scan_omp_task (tree *stmt_p, omp_context *outer_ctx)
name = build_decl (TYPE_DECL, name, ctx->record_type);
TYPE_NAME (ctx->record_type) = name;
create_omp_child_function (ctx, false);
- OMP_TASK_FN (*stmt_p) = ctx->cb.dst_fn;
+ gimple_omp_task_set_child_fn (stmt, ctx->cb.dst_fn);
- scan_sharing_clauses (OMP_TASK_CLAUSES (*stmt_p), ctx);
+ scan_sharing_clauses (gimple_omp_task_clauses (stmt), ctx);
if (ctx->srecord_type)
{
@@ -1653,15 +1692,15 @@ scan_omp_task (tree *stmt_p, omp_context *outer_ctx)
create_omp_child_function (ctx, true);
}
- scan_omp (&OMP_TASK_BODY (*stmt_p), ctx);
+ scan_omp (gimple_omp_body (stmt), ctx);
if (TYPE_FIELDS (ctx->record_type) == NULL)
{
ctx->record_type = ctx->receiver_decl = NULL;
- OMP_TASK_ARG_SIZE (*stmt_p)
- = build_int_cst (long_integer_type_node, 0);
- OMP_TASK_ARG_ALIGN (*stmt_p)
- = build_int_cst (long_integer_type_node, 1);
+ t = build_int_cst (long_integer_type_node, 0);
+ gimple_omp_task_set_arg_size (stmt, t);
+ t = build_int_cst (long_integer_type_node, 1);
+ gimple_omp_task_set_arg_align (stmt, t);
}
else
{
@@ -1684,12 +1723,12 @@ scan_omp_task (tree *stmt_p, omp_context *outer_ctx)
fixup_child_record_type (ctx);
if (ctx->srecord_type)
layout_type (ctx->srecord_type);
- OMP_TASK_ARG_SIZE (*stmt_p)
- = fold_convert (long_integer_type_node,
+ t = fold_convert (long_integer_type_node,
TYPE_SIZE_UNIT (ctx->record_type));
- OMP_TASK_ARG_ALIGN (*stmt_p)
- = build_int_cst (long_integer_type_node,
+ gimple_omp_task_set_arg_size (stmt, t);
+ t = build_int_cst (long_integer_type_node,
TYPE_ALIGN_UNIT (ctx->record_type));
+ gimple_omp_task_set_arg_align (stmt, t);
}
}
@@ -1697,47 +1736,43 @@ scan_omp_task (tree *stmt_p, omp_context *outer_ctx)
/* Scan an OpenMP loop directive. */
static void
-scan_omp_for (tree *stmt_p, omp_context *outer_ctx)
+scan_omp_for (gimple stmt, omp_context *outer_ctx)
{
omp_context *ctx;
- tree stmt;
- int i;
+ size_t i;
- stmt = *stmt_p;
ctx = new_omp_context (stmt, outer_ctx);
- scan_sharing_clauses (OMP_FOR_CLAUSES (stmt), ctx);
+ scan_sharing_clauses (gimple_omp_for_clauses (stmt), ctx);
- scan_omp (&OMP_FOR_PRE_BODY (stmt), ctx);
- for (i = 0; i < TREE_VEC_LENGTH (OMP_FOR_INIT (stmt)); i++)
+ scan_omp (gimple_omp_for_pre_body (stmt), ctx);
+ for (i = 0; i < gimple_omp_for_collapse (stmt); i++)
{
- scan_omp (&TREE_VEC_ELT (OMP_FOR_INIT (stmt), i), ctx);
- scan_omp (&TREE_VEC_ELT (OMP_FOR_COND (stmt), i), ctx);
- scan_omp (&TREE_VEC_ELT (OMP_FOR_INCR (stmt), i), ctx);
+ scan_omp_op (gimple_omp_for_index_ptr (stmt, i), ctx);
+ scan_omp_op (gimple_omp_for_initial_ptr (stmt, i), ctx);
+ scan_omp_op (gimple_omp_for_final_ptr (stmt, i), ctx);
+ scan_omp_op (gimple_omp_for_incr_ptr (stmt, i), ctx);
}
- scan_omp (&OMP_FOR_BODY (stmt), ctx);
+ scan_omp (gimple_omp_body (stmt), ctx);
}
/* Scan an OpenMP sections directive. */
static void
-scan_omp_sections (tree *stmt_p, omp_context *outer_ctx)
+scan_omp_sections (gimple stmt, omp_context *outer_ctx)
{
- tree stmt;
omp_context *ctx;
- stmt = *stmt_p;
ctx = new_omp_context (stmt, outer_ctx);
- scan_sharing_clauses (OMP_SECTIONS_CLAUSES (stmt), ctx);
- scan_omp (&OMP_SECTIONS_BODY (stmt), ctx);
+ scan_sharing_clauses (gimple_omp_sections_clauses (stmt), ctx);
+ scan_omp (gimple_omp_body (stmt), ctx);
}
/* Scan an OpenMP single directive. */
static void
-scan_omp_single (tree *stmt_p, omp_context *outer_ctx)
+scan_omp_single (gimple stmt, omp_context *outer_ctx)
{
- tree stmt = *stmt_p;
omp_context *ctx;
tree name;
@@ -1748,8 +1783,8 @@ scan_omp_single (tree *stmt_p, omp_context *outer_ctx)
name = build_decl (TYPE_DECL, name, ctx->record_type);
TYPE_NAME (ctx->record_type) = name;
- scan_sharing_clauses (OMP_SINGLE_CLAUSES (stmt), ctx);
- scan_omp (&OMP_SINGLE_BODY (stmt), ctx);
+ scan_sharing_clauses (gimple_omp_single_clauses (stmt), ctx);
+ scan_omp (gimple_omp_body (stmt), ctx);
if (TYPE_FIELDS (ctx->record_type) == NULL)
ctx->record_type = NULL;
@@ -1760,24 +1795,24 @@ scan_omp_single (tree *stmt_p, omp_context *outer_ctx)
/* Check OpenMP nesting restrictions. */
static void
-check_omp_nesting_restrictions (tree t, omp_context *ctx)
+check_omp_nesting_restrictions (gimple stmt, omp_context *ctx)
{
- switch (TREE_CODE (t))
+ switch (gimple_code (stmt))
{
- case OMP_FOR:
- case OMP_SECTIONS:
- case OMP_SINGLE:
- case CALL_EXPR:
+ case GIMPLE_OMP_FOR:
+ case GIMPLE_OMP_SECTIONS:
+ case GIMPLE_OMP_SINGLE:
+ case GIMPLE_CALL:
for (; ctx != NULL; ctx = ctx->outer)
- switch (TREE_CODE (ctx->stmt))
+ switch (gimple_code (ctx->stmt))
{
- case OMP_FOR:
- case OMP_SECTIONS:
- case OMP_SINGLE:
- case OMP_ORDERED:
- case OMP_MASTER:
- case OMP_TASK:
- if (TREE_CODE (t) == CALL_EXPR)
+ case GIMPLE_OMP_FOR:
+ case GIMPLE_OMP_SECTIONS:
+ case GIMPLE_OMP_SINGLE:
+ case GIMPLE_OMP_ORDERED:
+ case GIMPLE_OMP_MASTER:
+ case GIMPLE_OMP_TASK:
+ if (is_gimple_call (stmt))
{
warning (0, "barrier region may not be closely nested inside "
"of work-sharing, critical, ordered, master or "
@@ -1788,54 +1823,55 @@ check_omp_nesting_restrictions (tree t, omp_context *ctx)
"of work-sharing, critical, ordered, master or explicit "
"task region");
return;
- case OMP_PARALLEL:
+ case GIMPLE_OMP_PARALLEL:
return;
default:
break;
}
break;
- case OMP_MASTER:
+ case GIMPLE_OMP_MASTER:
for (; ctx != NULL; ctx = ctx->outer)
- switch (TREE_CODE (ctx->stmt))
+ switch (gimple_code (ctx->stmt))
{
- case OMP_FOR:
- case OMP_SECTIONS:
- case OMP_SINGLE:
- case OMP_TASK:
+ case GIMPLE_OMP_FOR:
+ case GIMPLE_OMP_SECTIONS:
+ case GIMPLE_OMP_SINGLE:
+ case GIMPLE_OMP_TASK:
warning (0, "master region may not be closely nested inside "
"of work-sharing or explicit task region");
return;
- case OMP_PARALLEL:
+ case GIMPLE_OMP_PARALLEL:
return;
default:
break;
}
break;
- case OMP_ORDERED:
+ case GIMPLE_OMP_ORDERED:
for (; ctx != NULL; ctx = ctx->outer)
- switch (TREE_CODE (ctx->stmt))
+ switch (gimple_code (ctx->stmt))
{
- case OMP_CRITICAL:
- case OMP_TASK:
+ case GIMPLE_OMP_CRITICAL:
+ case GIMPLE_OMP_TASK:
warning (0, "ordered region may not be closely nested inside "
"of critical or explicit task region");
return;
- case OMP_FOR:
- if (find_omp_clause (OMP_CLAUSES (ctx->stmt),
+ case GIMPLE_OMP_FOR:
+ if (find_omp_clause (gimple_omp_for_clauses (ctx->stmt),
OMP_CLAUSE_ORDERED) == NULL)
warning (0, "ordered region must be closely nested inside "
"a loop region with an ordered clause");
return;
- case OMP_PARALLEL:
+ case GIMPLE_OMP_PARALLEL:
return;
default:
break;
}
break;
- case OMP_CRITICAL:
+ case GIMPLE_OMP_CRITICAL:
for (; ctx != NULL; ctx = ctx->outer)
- if (TREE_CODE (ctx->stmt) == OMP_CRITICAL
- && OMP_CRITICAL_NAME (t) == OMP_CRITICAL_NAME (ctx->stmt))
+ if (gimple_code (ctx->stmt) == GIMPLE_OMP_CRITICAL
+ && (gimple_omp_critical_name (stmt)
+ == gimple_omp_critical_name (ctx->stmt)))
{
warning (0, "critical region may not be nested inside a critical "
"region with the same name");
@@ -1848,90 +1884,117 @@ check_omp_nesting_restrictions (tree t, omp_context *ctx)
}
-/* Callback for walk_stmts used to scan for OpenMP directives at TP. */
+/* Helper function scan_omp.
+
+ Callback for walk_tree or operators in walk_gimple_stmt used to
+ scan for OpenMP directives in TP. */
static tree
-scan_omp_1 (tree *tp, int *walk_subtrees, void *data)
+scan_omp_1_op (tree *tp, int *walk_subtrees, void *data)
{
struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
omp_context *ctx = (omp_context *) wi->info;
tree t = *tp;
- if (EXPR_HAS_LOCATION (t))
- input_location = EXPR_LOCATION (t);
+ switch (TREE_CODE (t))
+ {
+ case VAR_DECL:
+ case PARM_DECL:
+ case LABEL_DECL:
+ case RESULT_DECL:
+ if (ctx)
+ *tp = remap_decl (t, &ctx->cb);
+ break;
+
+ default:
+ if (ctx && TYPE_P (t))
+ *tp = remap_type (t, &ctx->cb);
+ else if (!DECL_P (t))
+ *walk_subtrees = 1;
+ break;
+ }
+
+ return NULL_TREE;
+}
+
+
+/* Helper function for scan_omp.
+
+ Callback for walk_gimple_stmt used to scan for OpenMP directives in
+ the current statement in GSI. */
+
+static tree
+scan_omp_1_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
+ struct walk_stmt_info *wi)
+{
+ gimple stmt = gsi_stmt (*gsi);
+ omp_context *ctx = (omp_context *) wi->info;
+
+ if (gimple_has_location (stmt))
+ input_location = gimple_location (stmt);
/* Check the OpenMP nesting restrictions. */
if (ctx != NULL)
{
- if (OMP_DIRECTIVE_P (t))
- check_omp_nesting_restrictions (t, ctx);
- else if (TREE_CODE (t) == CALL_EXPR)
+ if (is_gimple_omp (stmt))
+ check_omp_nesting_restrictions (stmt, ctx);
+ else if (is_gimple_call (stmt))
{
- tree fndecl = get_callee_fndecl (t);
+ tree fndecl = gimple_call_fndecl (stmt);
if (fndecl && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
&& DECL_FUNCTION_CODE (fndecl) == BUILT_IN_GOMP_BARRIER)
- check_omp_nesting_restrictions (t, ctx);
+ check_omp_nesting_restrictions (stmt, ctx);
}
}
- *walk_subtrees = 0;
- switch (TREE_CODE (t))
+ *handled_ops_p = true;
+
+ switch (gimple_code (stmt))
{
- case OMP_PARALLEL:
+ case GIMPLE_OMP_PARALLEL:
taskreg_nesting_level++;
- scan_omp_parallel (tp, ctx);
+ scan_omp_parallel (gsi, ctx);
taskreg_nesting_level--;
break;
- case OMP_TASK:
+ case GIMPLE_OMP_TASK:
taskreg_nesting_level++;
- scan_omp_task (tp, ctx);
+ scan_omp_task (gsi, ctx);
taskreg_nesting_level--;
break;
- case OMP_FOR:
- scan_omp_for (tp, ctx);
+ case GIMPLE_OMP_FOR:
+ scan_omp_for (stmt, ctx);
break;
- case OMP_SECTIONS:
- scan_omp_sections (tp, ctx);
+ case GIMPLE_OMP_SECTIONS:
+ scan_omp_sections (stmt, ctx);
break;
- case OMP_SINGLE:
- scan_omp_single (tp, ctx);
+ case GIMPLE_OMP_SINGLE:
+ scan_omp_single (stmt, ctx);
break;
- case OMP_SECTION:
- case OMP_MASTER:
- case OMP_ORDERED:
- case OMP_CRITICAL:
- ctx = new_omp_context (*tp, ctx);
- scan_omp (&OMP_BODY (*tp), ctx);
+ case GIMPLE_OMP_SECTION:
+ case GIMPLE_OMP_MASTER:
+ case GIMPLE_OMP_ORDERED:
+ case GIMPLE_OMP_CRITICAL:
+ ctx = new_omp_context (stmt, ctx);
+ scan_omp (gimple_omp_body (stmt), ctx);
break;
- case BIND_EXPR:
+ case GIMPLE_BIND:
{
tree var;
- *walk_subtrees = 1;
- for (var = BIND_EXPR_VARS (t); var ; var = TREE_CHAIN (var))
- insert_decl_map (&ctx->cb, var, var);
+ *handled_ops_p = false;
+ if (ctx)
+ for (var = gimple_bind_vars (stmt); var ; var = TREE_CHAIN (var))
+ insert_decl_map (&ctx->cb, var, var);
}
break;
-
- case VAR_DECL:
- case PARM_DECL:
- case LABEL_DECL:
- case RESULT_DECL:
- if (ctx)
- *tp = remap_decl (t, &ctx->cb);
- break;
-
default:
- if (ctx && TYPE_P (t))
- *tp = remap_type (t, &ctx->cb);
- else if (!DECL_P (t))
- *walk_subtrees = 1;
+ *handled_ops_p = false;
break;
}
@@ -1939,24 +2002,22 @@ scan_omp_1 (tree *tp, int *walk_subtrees, void *data)
}
-/* Scan all the statements starting at STMT_P. CTX contains context
- information about the OpenMP directives and clauses found during
- the scan. */
+/* Scan all the statements starting at the current statement. CTX
+ contains context information about the OpenMP directives and
+ clauses found during the scan. */
static void
-scan_omp (tree *stmt_p, omp_context *ctx)
+scan_omp (gimple_seq body, omp_context *ctx)
{
location_t saved_location;
struct walk_stmt_info wi;
memset (&wi, 0, sizeof (wi));
- wi.callback = scan_omp_1;
wi.info = ctx;
- wi.want_bind_expr = (ctx != NULL);
wi.want_locations = true;
saved_location = input_location;
- walk_stmts (&wi, stmt_p);
+ walk_gimple_seq (body, scan_omp_1_stmt, scan_omp_1_op, &wi);
input_location = saved_location;
}
@@ -1973,7 +2034,7 @@ build_omp_barrier (void)
/* If a context was created for STMT when it was scanned, return it. */
static omp_context *
-maybe_lookup_ctx (tree stmt)
+maybe_lookup_ctx (gimple stmt)
{
splay_tree_node n;
n = splay_tree_lookup (all_contexts, (splay_tree_key) stmt);
@@ -2133,17 +2194,17 @@ omp_reduction_init (tree clause, tree type)
to destructors go in DLIST. */
static void
-lower_rec_input_clauses (tree clauses, tree *ilist, tree *dlist,
+lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist,
omp_context *ctx)
{
- tree_stmt_iterator diter;
+ gimple_stmt_iterator diter;
tree c, dtor, copyin_seq, x, ptr;
bool copyin_by_ref = false;
bool lastprivate_firstprivate = false;
int pass;
- *dlist = alloc_stmt_list ();
- diter = tsi_start (*dlist);
+ *dlist = gimple_seq_alloc ();
+ diter = gsi_start (*dlist);
copyin_seq = NULL;
/* Do all the fixed sized types in the first pass, and the variable sized
@@ -2205,15 +2266,26 @@ lower_rec_input_clauses (tree clauses, tree *ilist, tree *dlist,
if (c_kind != OMP_CLAUSE_FIRSTPRIVATE || !is_task_ctx (ctx))
{
+ gimple stmt;
+ tree tmp;
+
ptr = DECL_VALUE_EXPR (new_var);
gcc_assert (TREE_CODE (ptr) == INDIRECT_REF);
ptr = TREE_OPERAND (ptr, 0);
gcc_assert (DECL_P (ptr));
x = TYPE_SIZE_UNIT (TREE_TYPE (new_var));
- x = build_call_expr (built_in_decls[BUILT_IN_ALLOCA], 1, x);
- x = fold_convert (TREE_TYPE (ptr), x);
- x = build_gimple_modify_stmt (ptr, x);
- gimplify_and_add (x, ilist);
+
+ /* void *tmp = __builtin_alloca */
+ stmt
+ = gimple_build_call (built_in_decls[BUILT_IN_ALLOCA], 1, x);
+ tmp = create_tmp_var_raw (ptr_type_node, NULL);
+ gimple_add_tmp_var (tmp);
+ gimple_call_set_lhs (stmt, tmp);
+
+ gimple_seq_add_stmt (ilist, stmt);
+
+ x = fold_convert (TREE_TYPE (ptr), tmp);
+ gimplify_assign (ptr, x, ilist);
}
}
else if (is_reference (var))
@@ -2252,8 +2324,7 @@ lower_rec_input_clauses (tree clauses, tree *ilist, tree *dlist,
x = fold_convert (TREE_TYPE (new_var), x);
}
- x = build_gimple_modify_stmt (new_var, x);
- gimplify_and_add (x, ilist);
+ gimplify_assign (new_var, x, ilist);
new_var = build_fold_indirect_ref (new_var);
}
@@ -2315,9 +2386,11 @@ lower_rec_input_clauses (tree clauses, tree *ilist, tree *dlist,
x = lang_hooks.decls.omp_clause_dtor (c, new_var);
if (x)
{
+ gimple_seq tseq = NULL;
+
dtor = x;
- gimplify_stmt (&dtor);
- tsi_link_before (&diter, dtor, TSI_SAME_STMT);
+ gimplify_stmt (&dtor, &tseq);
+ gsi_insert_seq_before (&diter, tseq, GSI_SAME_STMT);
}
break;
@@ -2360,16 +2433,17 @@ lower_rec_input_clauses (tree clauses, tree *ilist, tree *dlist,
x = build_fold_addr_expr (x);
SET_DECL_VALUE_EXPR (placeholder, x);
DECL_HAS_VALUE_EXPR_P (placeholder) = 1;
- gimplify_and_add (OMP_CLAUSE_REDUCTION_INIT (c), ilist);
- OMP_CLAUSE_REDUCTION_INIT (c) = NULL;
+ lower_omp (OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c), ctx);
+ gimple_seq_add_seq (ilist,
+ OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c));
+ OMP_CLAUSE_REDUCTION_GIMPLE_INIT (c) = NULL;
DECL_HAS_VALUE_EXPR_P (placeholder) = 0;
}
else
{
x = omp_reduction_init (c, TREE_TYPE (new_var));
gcc_assert (TREE_CODE (TREE_TYPE (new_var)) != ARRAY_TYPE);
- x = build_gimple_modify_stmt (new_var, x);
- gimplify_and_add (x, ilist);
+ gimplify_assign (new_var, x, ilist);
}
break;
@@ -2406,10 +2480,10 @@ lower_rec_input_clauses (tree clauses, tree *ilist, tree *dlist,
always true. */
static void
-lower_lastprivate_clauses (tree clauses, tree predicate, tree *stmt_list,
- omp_context *ctx)
+lower_lastprivate_clauses (tree clauses, tree predicate, gimple_seq *stmt_list,
+ omp_context *ctx)
{
- tree sub_list, x, c;
+ tree x, c, label = NULL;
bool par_clauses = false;
/* Early exit if there are no lastprivate clauses. */
@@ -2426,14 +2500,29 @@ lower_lastprivate_clauses (tree clauses, tree predicate, tree *stmt_list,
if (ctx == NULL || !is_parallel_ctx (ctx))
return;
- clauses = find_omp_clause (OMP_PARALLEL_CLAUSES (ctx->stmt),
+ clauses = find_omp_clause (gimple_omp_parallel_clauses (ctx->stmt),
OMP_CLAUSE_LASTPRIVATE);
if (clauses == NULL)
return;
par_clauses = true;
}
- sub_list = alloc_stmt_list ();
+ if (predicate)
+ {
+ gimple stmt;
+ tree label_true, arm1, arm2;
+
+ label = create_artificial_label ();
+ label_true = create_artificial_label ();
+ arm1 = TREE_OPERAND (predicate, 0);
+ arm2 = TREE_OPERAND (predicate, 1);
+ gimplify_expr (&arm1, stmt_list, NULL, is_gimple_val, fb_rvalue);
+ gimplify_expr (&arm2, stmt_list, NULL, is_gimple_val, fb_rvalue);
+ stmt = gimple_build_cond (TREE_CODE (predicate), arm1, arm2,
+ label_true, label);
+ gimple_seq_add_stmt (stmt_list, stmt);
+ gimple_seq_add_stmt (stmt_list, gimple_build_label (label_true));
+ }
for (c = clauses; c ;)
{
@@ -2444,15 +2533,19 @@ lower_lastprivate_clauses (tree clauses, tree predicate, tree *stmt_list,
var = OMP_CLAUSE_DECL (c);
new_var = lookup_decl (var, ctx);
- if (OMP_CLAUSE_LASTPRIVATE_STMT (c))
- gimplify_and_add (OMP_CLAUSE_LASTPRIVATE_STMT (c), &sub_list);
- OMP_CLAUSE_LASTPRIVATE_STMT (c) = NULL;
+ if (OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c))
+ {
+ lower_omp (OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c), ctx);
+ gimple_seq_add_seq (stmt_list,
+ OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c));
+ }
+ OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (c) = NULL;
x = build_outer_var_ref (var, ctx);
if (is_reference (var))
new_var = build_fold_indirect_ref (new_var);
x = lang_hooks.decls.omp_clause_assign_op (c, x, new_var);
- append_to_statement_list (x, &sub_list);
+ gimplify_and_add (x, stmt_list);
}
c = OMP_CLAUSE_CHAIN (c);
if (c == NULL && !par_clauses)
@@ -2467,27 +2560,25 @@ lower_lastprivate_clauses (tree clauses, tree predicate, tree *stmt_list,
if (ctx == NULL || !is_parallel_ctx (ctx))
break;
- c = find_omp_clause (OMP_PARALLEL_CLAUSES (ctx->stmt),
+ c = find_omp_clause (gimple_omp_parallel_clauses (ctx->stmt),
OMP_CLAUSE_LASTPRIVATE);
par_clauses = true;
}
}
- if (predicate)
- x = build3 (COND_EXPR, void_type_node, predicate, sub_list, NULL);
- else
- x = sub_list;
-
- gimplify_and_add (x, stmt_list);
+ if (label)
+ gimple_seq_add_stmt (stmt_list, gimple_build_label (label));
}
/* Generate code to implement the REDUCTION clauses. */
static void
-lower_reduction_clauses (tree clauses, tree *stmt_list, omp_context *ctx)
+lower_reduction_clauses (tree clauses, gimple_seq *stmt_seqp, omp_context *ctx)
{
- tree sub_list = NULL, x, c;
+ gimple_seq sub_seq = NULL;
+ gimple stmt;
+ tree x, c;
int count = 0;
/* First see if there is exactly one reduction clause. Use OMP_ATOMIC
@@ -2535,7 +2626,7 @@ lower_reduction_clauses (tree clauses, tree *stmt_list, omp_context *ctx)
ref = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (addr)), addr);
x = fold_build2 (code, TREE_TYPE (ref), ref, new_var);
x = build2 (OMP_ATOMIC, void_type_node, addr, x);
- gimplify_and_add (x, stmt_list);
+ gimplify_and_add (x, stmt_seqp);
return;
}
@@ -2547,33 +2638,33 @@ lower_reduction_clauses (tree clauses, tree *stmt_list, omp_context *ctx)
ref = build_fold_addr_expr (ref);
SET_DECL_VALUE_EXPR (placeholder, ref);
DECL_HAS_VALUE_EXPR_P (placeholder) = 1;
- gimplify_and_add (OMP_CLAUSE_REDUCTION_MERGE (c), &sub_list);
- OMP_CLAUSE_REDUCTION_MERGE (c) = NULL;
+ lower_omp (OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c), ctx);
+ gimple_seq_add_seq (&sub_seq, OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c));
+ OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (c) = NULL;
OMP_CLAUSE_REDUCTION_PLACEHOLDER (c) = NULL;
}
else
{
x = build2 (code, TREE_TYPE (ref), ref, new_var);
ref = build_outer_var_ref (var, ctx);
- x = build_gimple_modify_stmt (ref, x);
- append_to_statement_list (x, &sub_list);
+ gimplify_assign (ref, x, &sub_seq);
}
}
- x = build_call_expr (built_in_decls[BUILT_IN_GOMP_ATOMIC_START], 0);
- gimplify_and_add (x, stmt_list);
+ stmt = gimple_build_call (built_in_decls[BUILT_IN_GOMP_ATOMIC_START], 0);
+ gimple_seq_add_stmt (stmt_seqp, stmt);
- gimplify_and_add (sub_list, stmt_list);
+ gimple_seq_add_seq (stmt_seqp, sub_seq);
- x = build_call_expr (built_in_decls[BUILT_IN_GOMP_ATOMIC_END], 0);
- gimplify_and_add (x, stmt_list);
+ stmt = gimple_build_call (built_in_decls[BUILT_IN_GOMP_ATOMIC_END], 0);
+ gimple_seq_add_stmt (stmt_seqp, stmt);
}
/* Generate code to implement the COPYPRIVATE clauses. */
static void
-lower_copyprivate_clauses (tree clauses, tree *slist, tree *rlist,
+lower_copyprivate_clauses (tree clauses, gimple_seq *slist, gimple_seq *rlist,
omp_context *ctx)
{
tree c;
@@ -2592,8 +2683,7 @@ lower_copyprivate_clauses (tree clauses, tree *slist, tree *rlist,
ref = build_sender_ref (var, ctx);
x = lookup_decl_in_outer_ctx (var, ctx);
x = by_ref ? build_fold_addr_expr (x) : x;
- x = build_gimple_modify_stmt (ref, x);
- gimplify_and_add (x, slist);
+ gimplify_assign (ref, x, slist);
ref = build_receiver_ref (var, by_ref, ctx);
if (is_reference (var))
@@ -2611,7 +2701,8 @@ lower_copyprivate_clauses (tree clauses, tree *slist, tree *rlist,
and REDUCTION from the sender (aka parent) side. */
static void
-lower_send_clauses (tree clauses, tree *ilist, tree *olist, omp_context *ctx)
+lower_send_clauses (tree clauses, gimple_seq *ilist, gimple_seq *olist,
+ omp_context *ctx)
{
tree c;
@@ -2681,8 +2772,7 @@ lower_send_clauses (tree clauses, tree *ilist, tree *olist, omp_context *ctx)
{
ref = build_sender_ref (val, ctx);
x = by_ref ? build_fold_addr_expr (var) : var;
- x = build_gimple_modify_stmt (ref, x);
- gimplify_and_add (x, ilist);
+ gimplify_assign (ref, x, ilist);
if (is_task_ctx (ctx))
DECL_ABSTRACT_ORIGIN (TREE_OPERAND (ref, 1)) = NULL;
}
@@ -2690,18 +2780,17 @@ lower_send_clauses (tree clauses, tree *ilist, tree *olist, omp_context *ctx)
if (do_out)
{
ref = build_sender_ref (val, ctx);
- x = build_gimple_modify_stmt (var, ref);
- gimplify_and_add (x, olist);
+ gimplify_assign (var, ref, olist);
}
}
}
-/* Generate code to implement SHARED from the sender (aka parent) side.
- This is trickier, since OMP_PARALLEL_CLAUSES doesn't list things that
- got automatically shared. */
+/* Generate code to implement SHARED from the sender (aka parent)
+ side. This is trickier, since GIMPLE_OMP_PARALLEL_CLAUSES doesn't
+ list things that got automatically shared. */
static void
-lower_send_shared_vars (tree *ilist, tree *olist, omp_context *ctx)
+lower_send_shared_vars (gimple_seq *ilist, gimple_seq *olist, omp_context *ctx)
{
tree var, ovar, nvar, f, x, record_type;
@@ -2725,25 +2814,37 @@ lower_send_shared_vars (tree *ilist, tree *olist, omp_context *ctx)
{
x = build_sender_ref (ovar, ctx);
var = build_fold_addr_expr (var);
- x = build_gimple_modify_stmt (x, var);
- gimplify_and_add (x, ilist);
+ gimplify_assign (x, var, ilist);
}
else
{
x = build_sender_ref (ovar, ctx);
- x = build_gimple_modify_stmt (x, var);
- gimplify_and_add (x, ilist);
+ gimplify_assign (x, var, ilist);
if (!TREE_READONLY (var))
{
x = build_sender_ref (ovar, ctx);
- x = build_gimple_modify_stmt (var, x);
- gimplify_and_add (x, olist);
+ gimplify_assign (var, x, olist);
}
}
}
}
+
+/* A convenience function to build an empty GIMPLE_COND with just the
+ condition. */
+
+static gimple
+gimple_build_cond_empty (tree cond)
+{
+ enum tree_code pred_code;
+ tree lhs, rhs;
+
+ gimple_cond_get_ops_from_tree (cond, &pred_code, &lhs, &rhs);
+ return gimple_build_cond (pred_code, lhs, rhs, NULL_TREE, NULL_TREE);
+}
+
+
/* Build the function calls to GOMP_parallel_start etc to actually
generate the parallel operation. REGION is the parallel region
being expanded. BB is the block where to insert the code. WS_ARGS
@@ -2753,13 +2854,14 @@ lower_send_shared_vars (tree *ilist, tree *olist, omp_context *ctx)
static void
expand_parallel_call (struct omp_region *region, basic_block bb,
- tree entry_stmt, tree ws_args)
+ gimple entry_stmt, tree ws_args)
{
tree t, t1, t2, val, cond, c, clauses;
- block_stmt_iterator si;
+ gimple_stmt_iterator gsi;
+ gimple stmt;
int start_ix;
- clauses = OMP_PARALLEL_CLAUSES (entry_stmt);
+ clauses = gimple_omp_parallel_clauses (entry_stmt);
/* Determine what flavor of GOMP_parallel_start we will be
emitting. */
@@ -2768,14 +2870,14 @@ expand_parallel_call (struct omp_region *region, basic_block bb,
{
switch (region->inner->type)
{
- case OMP_FOR:
+ case GIMPLE_OMP_FOR:
gcc_assert (region->inner->sched_kind != OMP_CLAUSE_SCHEDULE_AUTO);
start_ix = BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START
+ (region->inner->sched_kind
== OMP_CLAUSE_SCHEDULE_RUNTIME
? 3 : region->inner->sched_kind);
break;
- case OMP_SECTIONS:
+ case GIMPLE_OMP_SECTIONS:
start_ix = BUILT_IN_GOMP_PARALLEL_SECTIONS_START;
break;
default:
@@ -2803,7 +2905,7 @@ expand_parallel_call (struct omp_region *region, basic_block bb,
(cond != 0) or (cond ? val : 1u). */
if (cond)
{
- block_stmt_iterator si;
+ gimple_stmt_iterator gsi;
cond = gimple_boolify (cond);
@@ -2814,14 +2916,14 @@ expand_parallel_call (struct omp_region *region, basic_block bb,
{
basic_block cond_bb, then_bb, else_bb;
edge e, e_then, e_else;
- tree t, tmp_then, tmp_else, tmp_join, tmp_var;
+ tree tmp_then, tmp_else, tmp_join, tmp_var;
tmp_var = create_tmp_var (TREE_TYPE (val), NULL);
if (gimple_in_ssa_p (cfun))
{
- tmp_then = make_ssa_name (tmp_var, NULL_TREE);
- tmp_else = make_ssa_name (tmp_var, NULL_TREE);
- tmp_join = make_ssa_name (tmp_var, NULL_TREE);
+ tmp_then = make_ssa_name (tmp_var, NULL);
+ tmp_else = make_ssa_name (tmp_var, NULL);
+ tmp_join = make_ssa_name (tmp_var, NULL);
}
else
{
@@ -2840,24 +2942,18 @@ expand_parallel_call (struct omp_region *region, basic_block bb,
set_immediate_dominator (CDI_DOMINATORS, then_bb, cond_bb);
set_immediate_dominator (CDI_DOMINATORS, else_bb, cond_bb);
- t = build3 (COND_EXPR, void_type_node,
- cond, NULL_TREE, NULL_TREE);
+ stmt = gimple_build_cond_empty (cond);
+ gsi = gsi_start_bb (cond_bb);
+ gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
- si = bsi_start (cond_bb);
- bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
+ gsi = gsi_start_bb (then_bb);
+ stmt = gimple_build_assign (tmp_then, val);
+ gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
- si = bsi_start (then_bb);
- t = build_gimple_modify_stmt (tmp_then, val);
- if (gimple_in_ssa_p (cfun))
- SSA_NAME_DEF_STMT (tmp_then) = t;
- bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
-
- si = bsi_start (else_bb);
- t = build_gimple_modify_stmt (tmp_else,
- build_int_cst (unsigned_type_node, 1));
- if (gimple_in_ssa_p (cfun))
- SSA_NAME_DEF_STMT (tmp_else) = t;
- bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
+ gsi = gsi_start_bb (else_bb);
+ stmt = gimple_build_assign
+ (tmp_else, build_int_cst (unsigned_type_node, 1));
+ gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
make_edge (cond_bb, then_bb, EDGE_TRUE_VALUE);
make_edge (cond_bb, else_bb, EDGE_FALSE_VALUE);
@@ -2866,7 +2962,7 @@ expand_parallel_call (struct omp_region *region, basic_block bb,
if (gimple_in_ssa_p (cfun))
{
- tree phi = create_phi_node (tmp_join, bb);
+ gimple phi = create_phi_node (tmp_join, bb);
SSA_NAME_DEF_STMT (tmp_join) = phi;
add_phi_arg (phi, tmp_then, e_then);
add_phi_arg (phi, tmp_else, e_else);
@@ -2875,18 +2971,18 @@ expand_parallel_call (struct omp_region *region, basic_block bb,
val = tmp_join;
}
- si = bsi_start (bb);
- val = force_gimple_operand_bsi (&si, val, true, NULL_TREE,
- false, BSI_CONTINUE_LINKING);
+ gsi = gsi_start_bb (bb);
+ val = force_gimple_operand_gsi (&gsi, val, true, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
}
- si = bsi_last (bb);
- t = OMP_PARALLEL_DATA_ARG (entry_stmt);
+ gsi = gsi_last_bb (bb);
+ t = gimple_omp_parallel_data_arg (entry_stmt);
if (t == NULL)
t1 = null_pointer_node;
else
t1 = build_fold_addr_expr (t);
- t2 = build_fold_addr_expr (OMP_PARALLEL_FN (entry_stmt));
+ t2 = build_fold_addr_expr (gimple_omp_parallel_child_fn (entry_stmt));
if (ws_args)
{
@@ -2898,21 +2994,21 @@ expand_parallel_call (struct omp_region *region, basic_block bb,
else
t = build_call_expr (built_in_decls[start_ix], 3, t2, t1, val);
- force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- false, BSI_CONTINUE_LINKING);
+ force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
- t = OMP_PARALLEL_DATA_ARG (entry_stmt);
+ t = gimple_omp_parallel_data_arg (entry_stmt);
if (t == NULL)
t = null_pointer_node;
else
t = build_fold_addr_expr (t);
- t = build_call_expr (OMP_PARALLEL_FN (entry_stmt), 1, t);
- force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- false, BSI_CONTINUE_LINKING);
+ t = build_call_expr (gimple_omp_parallel_child_fn (entry_stmt), 1, t);
+ force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
t = build_call_expr (built_in_decls[BUILT_IN_GOMP_PARALLEL_END], 0);
- force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- false, BSI_CONTINUE_LINKING);
+ force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
}
@@ -2920,12 +3016,12 @@ expand_parallel_call (struct omp_region *region, basic_block bb,
generate the task operation. BB is the block where to insert the code. */
static void
-expand_task_call (basic_block bb, tree entry_stmt)
+expand_task_call (basic_block bb, gimple entry_stmt)
{
tree t, t1, t2, t3, flags, cond, c, clauses;
- block_stmt_iterator si;
+ gimple_stmt_iterator gsi;
- clauses = OMP_TASK_CLAUSES (entry_stmt);
+ clauses = gimple_omp_task_clauses (entry_stmt);
c = find_omp_clause (clauses, OMP_CLAUSE_IF);
if (c)
@@ -2936,53 +3032,52 @@ expand_task_call (basic_block bb, tree entry_stmt)
c = find_omp_clause (clauses, OMP_CLAUSE_UNTIED);
flags = build_int_cst (unsigned_type_node, (c ? 1 : 0));
- si = bsi_last (bb);
- t = OMP_TASK_DATA_ARG (entry_stmt);
+ gsi = gsi_last_bb (bb);
+ t = gimple_omp_task_data_arg (entry_stmt);
if (t == NULL)
t2 = null_pointer_node;
else
t2 = build_fold_addr_expr (t);
- t1 = build_fold_addr_expr (OMP_TASK_FN (entry_stmt));
- t = OMP_TASK_COPYFN (entry_stmt);
+ t1 = build_fold_addr_expr (gimple_omp_task_child_fn (entry_stmt));
+ t = gimple_omp_task_copy_fn (entry_stmt);
if (t == NULL)
t3 = null_pointer_node;
else
t3 = build_fold_addr_expr (t);
t = build_call_expr (built_in_decls[BUILT_IN_GOMP_TASK], 7, t1, t2, t3,
- OMP_TASK_ARG_SIZE (entry_stmt),
- OMP_TASK_ARG_ALIGN (entry_stmt), cond, flags);
+ gimple_omp_task_arg_size (entry_stmt),
+ gimple_omp_task_arg_align (entry_stmt), cond, flags);
- force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- false, BSI_CONTINUE_LINKING);
+ force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
}
-/* If exceptions are enabled, wrap *STMT_P in a MUST_NOT_THROW catch
- handler. This prevents programs from violating the structured
- block semantics with throws. */
+/* If exceptions are enabled, wrap the statements in BODY in a MUST_NOT_THROW
+ catch handler and return it. This prevents programs from violating the
+ structured block semantics with throws. */
-static void
-maybe_catch_exception (tree *stmt_p)
+static gimple_seq
+maybe_catch_exception (gimple_seq body)
{
- tree f, t;
+ gimple f, t;
if (!flag_exceptions)
- return;
+ return body;
if (lang_protect_cleanup_actions)
t = lang_protect_cleanup_actions ();
else
- t = build_call_expr (built_in_decls[BUILT_IN_TRAP], 0);
- f = build2 (EH_FILTER_EXPR, void_type_node, NULL, NULL);
- EH_FILTER_MUST_NOT_THROW (f) = 1;
- gimplify_and_add (t, &EH_FILTER_FAILURE (f));
-
- t = build2 (TRY_CATCH_EXPR, void_type_node, *stmt_p, NULL);
- append_to_statement_list (f, &TREE_OPERAND (t, 1));
+ t = gimple_build_call (built_in_decls[BUILT_IN_TRAP], 0);
+
+ f = gimple_build_eh_filter (NULL, gimple_seq_alloc_with_stmt (t));
+ gimple_eh_filter_set_must_not_throw (f, true);
+
+ t = gimple_build_try (body, gimple_seq_alloc_with_stmt (f),
+ GIMPLE_TRY_CATCH);
- *stmt_p = NULL;
- append_to_statement_list (t, stmt_p);
+ return gimple_seq_alloc_with_stmt (t);
}
/* Chain all the DECLs in LIST by their TREE_CHAIN fields. */
@@ -3006,19 +3101,19 @@ list2chain (tree list)
/* Remove barriers in REGION->EXIT's block. Note that this is only
- valid for OMP_PARALLEL regions. Since the end of a parallel region
- is an implicit barrier, any workshare inside the OMP_PARALLEL that
- left a barrier at the end of the OMP_PARALLEL region can now be
+ valid for GIMPLE_OMP_PARALLEL regions. Since the end of a parallel region
+ is an implicit barrier, any workshare inside the GIMPLE_OMP_PARALLEL that
+ left a barrier at the end of the GIMPLE_OMP_PARALLEL region can now be
removed. */
static void
remove_exit_barrier (struct omp_region *region)
{
- block_stmt_iterator si;
+ gimple_stmt_iterator gsi;
basic_block exit_bb;
edge_iterator ei;
edge e;
- tree t;
+ gimple stmt;
exit_bb = region->exit;
@@ -3027,32 +3122,32 @@ remove_exit_barrier (struct omp_region *region)
if (! exit_bb)
return;
- /* The last insn in the block will be the parallel's OMP_RETURN. The
- workshare's OMP_RETURN will be in a preceding block. The kinds of
+ /* The last insn in the block will be the parallel's GIMPLE_OMP_RETURN. The
+ workshare's GIMPLE_OMP_RETURN will be in a preceding block. The kinds of
statements that can appear in between are extremely limited -- no
memory operations at all. Here, we allow nothing at all, so the
- only thing we allow to precede this OMP_RETURN is a label. */
- si = bsi_last (exit_bb);
- gcc_assert (TREE_CODE (bsi_stmt (si)) == OMP_RETURN);
- bsi_prev (&si);
- if (!bsi_end_p (si) && TREE_CODE (bsi_stmt (si)) != LABEL_EXPR)
+ only thing we allow to precede this GIMPLE_OMP_RETURN is a label. */
+ gsi = gsi_last_bb (exit_bb);
+ gcc_assert (gimple_code (gsi_stmt (gsi)) == GIMPLE_OMP_RETURN);
+ gsi_prev (&gsi);
+ if (!gsi_end_p (gsi) && gimple_code (gsi_stmt (gsi)) != GIMPLE_LABEL)
return;
FOR_EACH_EDGE (e, ei, exit_bb->preds)
{
- si = bsi_last (e->src);
- if (bsi_end_p (si))
+ gsi = gsi_last_bb (e->src);
+ if (gsi_end_p (gsi))
continue;
- t = bsi_stmt (si);
- if (TREE_CODE (t) == OMP_RETURN)
- OMP_RETURN_NOWAIT (t) = 1;
+ stmt = gsi_stmt (gsi);
+ if (gimple_code (stmt) == GIMPLE_OMP_RETURN)
+ gimple_omp_return_set_nowait (stmt);
}
}
static void
remove_exit_barriers (struct omp_region *region)
{
- if (region->type == OMP_PARALLEL)
+ if (region->type == GIMPLE_OMP_PARALLEL)
remove_exit_barrier (region);
if (region->inner)
@@ -3076,27 +3171,26 @@ remove_exit_barriers (struct omp_region *region)
scheduling point. */
static void
-optimize_omp_library_calls (tree entry_stmt)
+optimize_omp_library_calls (gimple entry_stmt)
{
basic_block bb;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
tree thr_num_id
= DECL_ASSEMBLER_NAME (built_in_decls [BUILT_IN_OMP_GET_THREAD_NUM]);
tree num_thr_id
= DECL_ASSEMBLER_NAME (built_in_decls [BUILT_IN_OMP_GET_NUM_THREADS]);
- bool untied_task = (TREE_CODE (entry_stmt) == OMP_TASK
- && find_omp_clause (OMP_TASK_CLAUSES (entry_stmt),
+ bool untied_task = (gimple_code (entry_stmt) == GIMPLE_OMP_TASK
+ && find_omp_clause (gimple_omp_task_clauses (entry_stmt),
OMP_CLAUSE_UNTIED) != NULL);
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))
{
- tree stmt = bsi_stmt (bsi);
- tree call = get_call_expr_in (stmt);
+ gimple call = gsi_stmt (gsi);
tree decl;
- if (call
- && (decl = get_callee_fndecl (call))
+ if (is_gimple_call (call)
+ && (decl = gimple_call_fndecl (call))
&& DECL_EXTERNAL (decl)
&& TREE_PUBLIC (decl)
&& DECL_INITIAL (decl) == NULL)
@@ -3117,7 +3211,7 @@ optimize_omp_library_calls (tree entry_stmt)
continue;
if (DECL_ASSEMBLER_NAME (decl) != DECL_ASSEMBLER_NAME (built_in)
- || call_expr_nargs (call) != 0)
+ || gimple_call_num_args (call) != 0)
continue;
if (flag_exceptions && !TREE_NOTHROW (decl))
@@ -3128,7 +3222,7 @@ optimize_omp_library_calls (tree entry_stmt)
!= TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (built_in))))
continue;
- CALL_EXPR_FN (call) = build_fold_addr_expr (built_in);
+ gimple_call_set_fndecl (call, built_in);
}
}
}
@@ -3141,12 +3235,12 @@ expand_omp_taskreg (struct omp_region *region)
basic_block entry_bb, exit_bb, new_bb;
struct function *child_cfun;
tree child_fn, block, t, ws_args, *tp;
- block_stmt_iterator si;
- tree entry_stmt;
+ gimple_stmt_iterator gsi;
+ gimple entry_stmt, stmt;
edge e;
entry_stmt = last_stmt (region->entry);
- child_fn = OMP_TASKREG_FN (entry_stmt);
+ child_fn = gimple_omp_taskreg_child_fn (entry_stmt);
child_cfun = DECL_STRUCT_FUNCTION (child_fn);
/* If this function has been already instrumented, make sure
the child function isn't instrumented again. */
@@ -3166,14 +3260,14 @@ expand_omp_taskreg (struct omp_region *region)
the region, in which case all we need to do is make the
sub-graph unreachable and emit the parallel call. */
edge entry_succ_e, exit_succ_e;
- block_stmt_iterator si;
+ gimple_stmt_iterator gsi;
entry_succ_e = single_succ_edge (entry_bb);
- si = bsi_last (entry_bb);
- gcc_assert (TREE_CODE (bsi_stmt (si)) == OMP_PARALLEL
- || TREE_CODE (bsi_stmt (si)) == OMP_TASK);
- bsi_remove (&si, true);
+ gsi = gsi_last_bb (entry_bb);
+ gcc_assert (gimple_code (gsi_stmt (gsi)) == GIMPLE_OMP_PARALLEL
+ || gimple_code (gsi_stmt (gsi)) == GIMPLE_OMP_TASK);
+ gsi_remove (&gsi, true);
new_bb = entry_bb;
if (exit_bb)
@@ -3198,41 +3292,52 @@ expand_omp_taskreg (struct omp_region *region)
a function call that has been inlined, the original PARM_DECL
.OMP_DATA_I may have been converted into a different local
variable. In which case, we need to keep the assignment. */
- if (OMP_TASKREG_DATA_ARG (entry_stmt))
+ if (gimple_omp_taskreg_data_arg (entry_stmt))
{
basic_block entry_succ_bb = single_succ (entry_bb);
- block_stmt_iterator si;
- tree parcopy_stmt = NULL_TREE, arg, narg;
+ gimple_stmt_iterator gsi;
+ tree arg, narg;
+ gimple parcopy_stmt = NULL;
- for (si = bsi_start (entry_succ_bb); ; bsi_next (&si))
+ for (gsi = gsi_start_bb (entry_succ_bb); ; gsi_next (&gsi))
{
- tree stmt, arg;
+ gimple stmt;
- gcc_assert (!bsi_end_p (si));
- stmt = bsi_stmt (si);
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ gcc_assert (!gsi_end_p (gsi));
+ stmt = gsi_stmt (gsi);
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
continue;
- arg = GIMPLE_STMT_OPERAND (stmt, 1);
- STRIP_NOPS (arg);
- if (TREE_CODE (arg) == ADDR_EXPR
- && TREE_OPERAND (arg, 0)
- == OMP_TASKREG_DATA_ARG (entry_stmt))
+ if (gimple_num_ops (stmt) == 2)
{
- parcopy_stmt = stmt;
- break;
+ tree arg = gimple_assign_rhs1 (stmt);
+
+ /* We're ignore the subcode because we're
+ effectively doing a STRIP_NOPS. */
+
+ if (TREE_CODE (arg) == ADDR_EXPR
+ && TREE_OPERAND (arg, 0)
+ == gimple_omp_taskreg_data_arg (entry_stmt))
+ {
+ parcopy_stmt = stmt;
+ break;
+ }
}
}
- gcc_assert (parcopy_stmt != NULL_TREE);
+ gcc_assert (parcopy_stmt != NULL);
arg = DECL_ARGUMENTS (child_fn);
if (!gimple_in_ssa_p (cfun))
{
- if (GIMPLE_STMT_OPERAND (parcopy_stmt, 0) == arg)
- bsi_remove (&si, true);
+ if (gimple_assign_lhs (parcopy_stmt) == arg)
+ gsi_remove (&gsi, true);
else
- GIMPLE_STMT_OPERAND (parcopy_stmt, 1) = arg;
+ {
+ /* ?? Is setting the subcode really necessary ?? */
+ gimple_omp_set_subcode (parcopy_stmt, TREE_CODE (arg));
+ gimple_assign_set_rhs1 (parcopy_stmt, arg);
+ }
}
else
{
@@ -3240,9 +3345,11 @@ expand_omp_taskreg (struct omp_region *region)
definition of the argument. That should not be defined now,
since the argument is not used uninitialized. */
gcc_assert (gimple_default_def (cfun, arg) == NULL);
- narg = make_ssa_name (arg, build_empty_stmt ());
+ narg = make_ssa_name (arg, gimple_build_nop ());
set_default_def (arg, narg);
- GIMPLE_STMT_OPERAND (parcopy_stmt, 1) = narg;
+ /* ?? Is setting the subcode really necessary ?? */
+ gimple_omp_set_subcode (parcopy_stmt, TREE_CODE (narg));
+ gimple_assign_set_rhs1 (parcopy_stmt, narg);
update_stmt (parcopy_stmt);
}
}
@@ -3250,33 +3357,34 @@ expand_omp_taskreg (struct omp_region *region)
/* Declare local variables needed in CHILD_CFUN. */
block = DECL_INITIAL (child_fn);
BLOCK_VARS (block) = list2chain (child_cfun->local_decls);
- DECL_SAVED_TREE (child_fn) = bb_stmt_list (single_succ (entry_bb));
+ DECL_SAVED_TREE (child_fn) = NULL;
+ gimple_set_body (child_fn, bb_seq (single_succ (entry_bb)));
TREE_USED (block) = 1;
/* Reset DECL_CONTEXT on function arguments. */
for (t = DECL_ARGUMENTS (child_fn); t; t = TREE_CHAIN (t))
DECL_CONTEXT (t) = child_fn;
- /* Split ENTRY_BB at OMP_PARALLEL or OMP_TASK, so that it can be
- moved to the child function. */
- si = bsi_last (entry_bb);
- t = bsi_stmt (si);
- gcc_assert (t && (TREE_CODE (t) == OMP_PARALLEL
- || TREE_CODE (t) == OMP_TASK));
- bsi_remove (&si, true);
- e = split_block (entry_bb, t);
+ /* Split ENTRY_BB at GIMPLE_OMP_PARALLEL or GIMPLE_OMP_TASK,
+ so that it can be moved to the child function. */
+ gsi = gsi_last_bb (entry_bb);
+ stmt = gsi_stmt (gsi);
+ gcc_assert (stmt && (gimple_code (stmt) == GIMPLE_OMP_PARALLEL
+ || gimple_code (stmt) == GIMPLE_OMP_TASK));
+ gsi_remove (&gsi, true);
+ e = split_block (entry_bb, stmt);
entry_bb = e->dest;
single_succ_edge (entry_bb)->flags = EDGE_FALLTHRU;
- /* Convert OMP_RETURN into a RETURN_EXPR. */
+ /* Convert GIMPLE_OMP_RETURN into a RETURN_EXPR. */
if (exit_bb)
{
- si = bsi_last (exit_bb);
- gcc_assert (!bsi_end_p (si)
- && TREE_CODE (bsi_stmt (si)) == OMP_RETURN);
- t = build1 (RETURN_EXPR, void_type_node, NULL);
- bsi_insert_after (&si, t, BSI_SAME_STMT);
- bsi_remove (&si, true);
+ gsi = gsi_last_bb (exit_bb);
+ gcc_assert (!gsi_end_p (gsi)
+ && gimple_code (gsi_stmt (gsi)) == GIMPLE_OMP_RETURN);
+ stmt = gimple_build_return (NULL);
+ gsi_insert_after (&gsi, stmt, GSI_SAME_STMT);
+ gsi_remove (&gsi, true);
}
/* Move the parallel region into CHILD_CFUN. */
@@ -3291,7 +3399,7 @@ expand_omp_taskreg (struct omp_region *region)
block = NULL_TREE;
}
else
- block = TREE_BLOCK (entry_stmt);
+ block = gimple_block (entry_stmt);
new_bb = move_sese_region_to_fn (child_cfun, entry_bb, exit_bb, block);
if (exit_bb)
@@ -3328,7 +3436,7 @@ expand_omp_taskreg (struct omp_region *region)
current_function_decl = child_fn;
FOR_EACH_BB (bb)
- changed |= tree_purge_dead_eh_edges (bb);
+ changed |= gimple_purge_dead_eh_edges (bb);
if (changed)
cleanup_tree_cfg ();
current_function_decl = save_current;
@@ -3337,7 +3445,7 @@ expand_omp_taskreg (struct omp_region *region)
}
/* Emit a library call to launch the children threads. */
- if (TREE_CODE (entry_stmt) == OMP_PARALLEL)
+ if (gimple_code (entry_stmt) == GIMPLE_OMP_PARALLEL)
expand_parallel_call (region, new_bb, entry_stmt, ws_args);
else
expand_task_call (new_bb, entry_stmt);
@@ -3431,11 +3539,12 @@ expand_omp_for_generic (struct omp_region *region,
enum built_in_function start_fn,
enum built_in_function next_fn)
{
- tree type, istart0, iend0, iend, phi;
+ tree type, istart0, iend0, iend;
tree t, vmain, vback, bias = NULL_TREE;
basic_block entry_bb, cont_bb, exit_bb, l0_bb, l1_bb, collapse_bb;
basic_block l2_bb = NULL, l3_bb = NULL;
- block_stmt_iterator si;
+ gimple_stmt_iterator gsi;
+ gimple stmt;
bool in_combined_parallel = is_combined_parallel (region);
bool broken_loop = region->cont == NULL;
edge e, ne;
@@ -3499,9 +3608,9 @@ expand_omp_for_generic (struct omp_region *region,
l3_bb = BRANCH_EDGE (entry_bb)->dest;
exit_bb = region->exit;
- si = bsi_last (entry_bb);
+ gsi = gsi_last_bb (entry_bb);
- gcc_assert (TREE_CODE (bsi_stmt (si)) == OMP_FOR);
+ gcc_assert (gimple_code (gsi_stmt (gsi)) == GIMPLE_OMP_FOR);
if (fd->collapse > 1)
{
/* collapsed loops need work for expansion in SSA form. */
@@ -3536,21 +3645,23 @@ expand_omp_for_generic (struct omp_region *region,
else
{
counts[i] = create_tmp_var (type, ".count");
- t = build_gimple_modify_stmt (counts[i], t);
- force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- true, BSI_SAME_STMT);
+ t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
+ true, GSI_SAME_STMT);
+ stmt = gimple_build_assign (counts[i], t);
+ gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
}
if (SSA_VAR_P (fd->loop.n2))
{
if (i == 0)
- t = build_gimple_modify_stmt (fd->loop.n2, counts[0]);
+ t = counts[0];
else
{
t = fold_build2 (MULT_EXPR, type, fd->loop.n2, counts[i]);
- t = build_gimple_modify_stmt (fd->loop.n2, t);
+ t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
+ true, GSI_SAME_STMT);
}
- force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- true, BSI_SAME_STMT);
+ stmt = gimple_build_assign (fd->loop.n2, t);
+ gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
}
}
}
@@ -3615,41 +3726,38 @@ expand_omp_for_generic (struct omp_region *region,
if (TREE_TYPE (t) != boolean_type_node)
t = fold_build2 (NE_EXPR, boolean_type_node,
t, build_int_cst (TREE_TYPE (t), 0));
- t = force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- true, BSI_SAME_STMT);
- t = build3 (COND_EXPR, void_type_node, t, NULL_TREE, NULL_TREE);
- bsi_insert_after (&si, t, BSI_SAME_STMT);
+ t = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
+ true, GSI_SAME_STMT);
+ gsi_insert_after (&gsi, gimple_build_cond_empty (t), GSI_SAME_STMT);
- /* Remove the OMP_FOR statement. */
- bsi_remove (&si, true);
+ /* Remove the GIMPLE_OMP_FOR statement. */
+ gsi_remove (&gsi, true);
/* Iteration setup for sequential loop goes in L0_BB. */
- si = bsi_start (l0_bb);
+ gsi = gsi_start_bb (l0_bb);
if (bias)
t = fold_convert (type, fold_build2 (MINUS_EXPR, fd->iter_type,
istart0, bias));
else
t = fold_convert (type, istart0);
- t = force_gimple_operand_bsi (&si, t, false, NULL_TREE,
- false, BSI_CONTINUE_LINKING);
- t = build_gimple_modify_stmt (fd->loop.v, t);
- bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
- if (gimple_in_ssa_p (cfun))
- SSA_NAME_DEF_STMT (fd->loop.v) = t;
+ t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
+ stmt = gimple_build_assign (fd->loop.v, t);
+ gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
if (bias)
t = fold_convert (type, fold_build2 (MINUS_EXPR, fd->iter_type,
iend0, bias));
else
t = fold_convert (type, iend0);
- iend = force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- false, BSI_CONTINUE_LINKING);
+ iend = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
if (fd->collapse > 1)
{
tree tem = create_tmp_var (type, ".tem");
- t = build_gimple_modify_stmt (tem, fd->loop.v);
- bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
+ stmt = gimple_build_assign (tem, fd->loop.v);
+ gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
for (i = fd->collapse - 1; i >= 0; i--)
{
tree vtype = TREE_TYPE (fd->loops[i].v), itype;
@@ -3664,15 +3772,17 @@ expand_omp_for_generic (struct omp_region *region,
fd->loops[i].n1, fold_convert (sizetype, t));
else
t = fold_build2 (PLUS_EXPR, itype, fd->loops[i].n1, t);
- t = build_gimple_modify_stmt (fd->loops[i].v, t);
- force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- false, BSI_CONTINUE_LINKING);
+ t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
+ stmt = gimple_build_assign (fd->loops[i].v, t);
+ gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
if (i != 0)
{
t = fold_build2 (TRUNC_DIV_EXPR, type, tem, counts[i]);
- t = build_gimple_modify_stmt (tem, t);
- force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- false, BSI_CONTINUE_LINKING);
+ t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
+ stmt = gimple_build_assign (tem, t);
+ gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
}
}
}
@@ -3681,30 +3791,28 @@ expand_omp_for_generic (struct omp_region *region,
{
/* Code to control the increment and predicate for the sequential
loop goes in the CONT_BB. */
- si = bsi_last (cont_bb);
- t = bsi_stmt (si);
- gcc_assert (TREE_CODE (t) == OMP_CONTINUE);
- vmain = TREE_OPERAND (t, 1);
- vback = TREE_OPERAND (t, 0);
+ gsi = gsi_last_bb (cont_bb);
+ stmt = gsi_stmt (gsi);
+ gcc_assert (gimple_code (stmt) == GIMPLE_OMP_CONTINUE);
+ vmain = gimple_omp_continue_control_use (stmt);
+ vback = gimple_omp_continue_control_def (stmt);
if (POINTER_TYPE_P (type))
t = fold_build2 (POINTER_PLUS_EXPR, type, vmain,
fold_convert (sizetype, fd->loop.step));
else
t = fold_build2 (PLUS_EXPR, type, vmain, fd->loop.step);
- t = force_gimple_operand_bsi (&si, t, false, NULL_TREE,
- true, BSI_SAME_STMT);
- t = build_gimple_modify_stmt (vback, t);
- bsi_insert_before (&si, t, BSI_SAME_STMT);
- if (gimple_in_ssa_p (cfun))
- SSA_NAME_DEF_STMT (vback) = t;
-
+ t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
+ true, GSI_SAME_STMT);
+ stmt = gimple_build_assign (vback, t);
+ gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
+
t = build2 (fd->loop.cond_code, boolean_type_node, vback, iend);
- t = build3 (COND_EXPR, void_type_node, t, NULL_TREE, NULL_TREE);
- bsi_insert_before (&si, t, BSI_SAME_STMT);
+ stmt = gimple_build_cond_empty (t);
+ gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
- /* Remove OMP_CONTINUE. */
- bsi_remove (&si, true);
+ /* Remove GIMPLE_OMP_CONTINUE. */
+ gsi_remove (&gsi, true);
if (fd->collapse > 1)
{
@@ -3716,17 +3824,18 @@ expand_omp_for_generic (struct omp_region *region,
tree vtype = TREE_TYPE (fd->loops[i].v);
bb = create_empty_bb (last_bb);
- si = bsi_start (bb);
+ gsi = gsi_start_bb (bb);
if (i < fd->collapse - 1)
{
e = make_edge (last_bb, bb, EDGE_FALSE_VALUE);
e->probability = REG_BR_PROB_BASE / 8;
- t = build_gimple_modify_stmt (fd->loops[i + 1].v,
- fd->loops[i + 1].n1);
- force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- false, BSI_CONTINUE_LINKING);
+ t = fd->loops[i + 1].n1;
+ t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
+ stmt = gimple_build_assign (fd->loops[i + 1].v, t);
+ gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
}
else
collapse_bb = bb;
@@ -3740,19 +3849,20 @@ expand_omp_for_generic (struct omp_region *region,
else
t = fold_build2 (PLUS_EXPR, vtype, fd->loops[i].v,
fd->loops[i].step);
- t = build_gimple_modify_stmt (fd->loops[i].v, t);
- force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- false, BSI_CONTINUE_LINKING);
+ t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
+ stmt = gimple_build_assign (fd->loops[i].v, t);
+ gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
if (i > 0)
{
+ t = fd->loops[i].n2;
+ t = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
t = fold_build2 (fd->loops[i].cond_code, boolean_type_node,
- fd->loops[i].v, fd->loops[i].n2);
- t = force_gimple_operand_bsi (&si, t, false, NULL_TREE,
- false, BSI_CONTINUE_LINKING);
- t = build3 (COND_EXPR, void_type_node, t,
- NULL_TREE, NULL_TREE);
- bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
+ fd->loops[i].v, t);
+ stmt = gimple_build_cond_empty (t);
+ gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
e = make_edge (bb, l1_bb, EDGE_TRUE_VALUE);
e->probability = REG_BR_PROB_BASE * 7 / 8;
}
@@ -3763,29 +3873,29 @@ expand_omp_for_generic (struct omp_region *region,
}
/* Emit code to get the next parallel iteration in L2_BB. */
- si = bsi_start (l2_bb);
+ gsi = gsi_start_bb (l2_bb);
t = build_call_expr (built_in_decls[next_fn], 2,
build_fold_addr_expr (istart0),
build_fold_addr_expr (iend0));
+ t = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
if (TREE_TYPE (t) != boolean_type_node)
t = fold_build2 (NE_EXPR, boolean_type_node,
t, build_int_cst (TREE_TYPE (t), 0));
- t = force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- false, BSI_CONTINUE_LINKING);
- t = build3 (COND_EXPR, void_type_node, t, NULL_TREE, NULL_TREE);
- bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
+ stmt = gimple_build_cond_empty (t);
+ gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
}
/* Add the loop cleanup function. */
- si = bsi_last (exit_bb);
- if (OMP_RETURN_NOWAIT (bsi_stmt (si)))
+ gsi = gsi_last_bb (exit_bb);
+ if (gimple_omp_return_nowait_p (gsi_stmt (gsi)))
t = built_in_decls[BUILT_IN_GOMP_LOOP_END_NOWAIT];
else
t = built_in_decls[BUILT_IN_GOMP_LOOP_END];
- t = build_call_expr (t, 0);
- bsi_insert_after (&si, t, BSI_SAME_STMT);
- bsi_remove (&si, true);
+ stmt = gimple_build_call (t, 0);
+ gsi_insert_after (&gsi, stmt, GSI_SAME_STMT);
+ gsi_remove (&gsi, true);
/* Connect the new blocks. */
find_edge (entry_bb, l0_bb)->flags = EDGE_TRUE_VALUE;
@@ -3793,12 +3903,18 @@ expand_omp_for_generic (struct omp_region *region,
if (!broken_loop)
{
+ gimple_seq phis;
+
e = find_edge (cont_bb, l3_bb);
ne = make_edge (l2_bb, l3_bb, EDGE_FALSE_VALUE);
- for (phi = phi_nodes (l3_bb); phi; phi = PHI_CHAIN (phi))
- SET_USE (PHI_ARG_DEF_PTR_FROM_EDGE (phi, ne),
- PHI_ARG_DEF_FROM_EDGE (phi, e));
+ phis = phi_nodes (l3_bb);
+ for (gsi = gsi_start (phis); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple phi = gsi_stmt (gsi);
+ SET_USE (PHI_ARG_DEF_PTR_FROM_EDGE (phi, ne),
+ PHI_ARG_DEF_FROM_EDGE (phi, e));
+ }
remove_edge (e);
make_edge (cont_bb, l2_bb, EDGE_FALSE_VALUE);
@@ -3868,7 +3984,8 @@ expand_omp_for_static_nochunk (struct omp_region *region,
tree type, itype, vmain, vback;
basic_block entry_bb, exit_bb, seq_start_bb, body_bb, cont_bb;
basic_block fin_bb;
- block_stmt_iterator si;
+ gimple_stmt_iterator gsi;
+ gimple stmt;
itype = type = TREE_TYPE (fd->loop.v);
if (POINTER_TYPE_P (type))
@@ -3886,28 +4003,28 @@ expand_omp_for_static_nochunk (struct omp_region *region,
exit_bb = region->exit;
/* Iteration space partitioning goes in ENTRY_BB. */
- si = bsi_last (entry_bb);
- gcc_assert (TREE_CODE (bsi_stmt (si)) == OMP_FOR);
+ gsi = gsi_last_bb (entry_bb);
+ gcc_assert (gimple_code (gsi_stmt (gsi)) == GIMPLE_OMP_FOR);
t = build_call_expr (built_in_decls[BUILT_IN_OMP_GET_NUM_THREADS], 0);
t = fold_convert (itype, t);
- nthreads = force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- true, BSI_SAME_STMT);
+ nthreads = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
+ true, GSI_SAME_STMT);
t = build_call_expr (built_in_decls[BUILT_IN_OMP_GET_THREAD_NUM], 0);
t = fold_convert (itype, t);
- threadid = force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- true, BSI_SAME_STMT);
+ threadid = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
+ true, GSI_SAME_STMT);
fd->loop.n1
- = force_gimple_operand_bsi (&si, fold_convert (type, fd->loop.n1),
- true, NULL_TREE, true, BSI_SAME_STMT);
+ = force_gimple_operand_gsi (&gsi, fold_convert (type, fd->loop.n1),
+ true, NULL_TREE, true, GSI_SAME_STMT);
fd->loop.n2
- = force_gimple_operand_bsi (&si, fold_convert (itype, fd->loop.n2),
- true, NULL_TREE, true, BSI_SAME_STMT);
+ = force_gimple_operand_gsi (&gsi, fold_convert (itype, fd->loop.n2),
+ true, NULL_TREE, true, GSI_SAME_STMT);
fd->loop.step
- = force_gimple_operand_bsi (&si, fold_convert (itype, fd->loop.step),
- true, NULL_TREE, true, BSI_SAME_STMT);
+ = force_gimple_operand_gsi (&gsi, fold_convert (itype, fd->loop.step),
+ true, NULL_TREE, true, GSI_SAME_STMT);
t = build_int_cst (itype, (fd->loop.cond_code == LT_EXPR ? -1 : 1));
t = fold_build2 (PLUS_EXPR, itype, fd->loop.step, t);
@@ -3920,32 +4037,31 @@ expand_omp_for_static_nochunk (struct omp_region *region,
else
t = fold_build2 (TRUNC_DIV_EXPR, itype, t, fd->loop.step);
t = fold_convert (itype, t);
- n = force_gimple_operand_bsi (&si, t, true, NULL_TREE, true, BSI_SAME_STMT);
+ n = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, true, GSI_SAME_STMT);
t = fold_build2 (TRUNC_DIV_EXPR, itype, n, nthreads);
- q = force_gimple_operand_bsi (&si, t, true, NULL_TREE, true, BSI_SAME_STMT);
+ q = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, true, GSI_SAME_STMT);
t = fold_build2 (MULT_EXPR, itype, q, nthreads);
t = fold_build2 (NE_EXPR, itype, t, n);
t = fold_build2 (PLUS_EXPR, itype, q, t);
- q = force_gimple_operand_bsi (&si, t, true, NULL_TREE, true, BSI_SAME_STMT);
+ q = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, true, GSI_SAME_STMT);
t = build2 (MULT_EXPR, itype, q, threadid);
- s0 = force_gimple_operand_bsi (&si, t, true, NULL_TREE, true, BSI_SAME_STMT);
+ s0 = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, true, GSI_SAME_STMT);
t = fold_build2 (PLUS_EXPR, itype, s0, q);
t = fold_build2 (MIN_EXPR, itype, t, n);
- e0 = force_gimple_operand_bsi (&si, t, true, NULL_TREE, true, BSI_SAME_STMT);
+ e0 = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE, true, GSI_SAME_STMT);
t = build2 (GE_EXPR, boolean_type_node, s0, e0);
- t = build3 (COND_EXPR, void_type_node, t, NULL_TREE, NULL_TREE);
- bsi_insert_before (&si, t, BSI_SAME_STMT);
+ gsi_insert_before (&gsi, gimple_build_cond_empty (t), GSI_SAME_STMT);
- /* Remove the OMP_FOR statement. */
- bsi_remove (&si, true);
+ /* Remove the GIMPLE_OMP_FOR statement. */
+ gsi_remove (&gsi, true);
/* Setup code for sequential iteration goes in SEQ_START_BB. */
- si = bsi_start (seq_start_bb);
+ gsi = gsi_start_bb (seq_start_bb);
t = fold_convert (itype, s0);
t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
@@ -3954,13 +4070,11 @@ expand_omp_for_static_nochunk (struct omp_region *region,
fold_convert (sizetype, t));
else
t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
- t = force_gimple_operand_bsi (&si, t, false, NULL_TREE,
- false, BSI_CONTINUE_LINKING);
- t = build_gimple_modify_stmt (fd->loop.v, t);
- bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
- if (gimple_in_ssa_p (cfun))
- SSA_NAME_DEF_STMT (fd->loop.v) = t;
-
+ t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
+ stmt = gimple_build_assign (fd->loop.v, t);
+ gsi_insert_after (&gsi, stmt, GSI_CONTINUE_LINKING);
+
t = fold_convert (itype, e0);
t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
if (POINTER_TYPE_P (type))
@@ -3968,41 +4082,39 @@ expand_omp_for_static_nochunk (struct omp_region *region,
fold_convert (sizetype, t));
else
t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
- e = force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- false, BSI_CONTINUE_LINKING);
+ e = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
- /* The code controlling the sequential loop replaces the OMP_CONTINUE. */
- si = bsi_last (cont_bb);
- t = bsi_stmt (si);
- gcc_assert (TREE_CODE (t) == OMP_CONTINUE);
- vmain = TREE_OPERAND (t, 1);
- vback = TREE_OPERAND (t, 0);
+ /* The code controlling the sequential loop replaces the
+ GIMPLE_OMP_CONTINUE. */
+ gsi = gsi_last_bb (cont_bb);
+ stmt = gsi_stmt (gsi);
+ gcc_assert (gimple_code (stmt) == GIMPLE_OMP_CONTINUE);
+ vmain = gimple_omp_continue_control_use (stmt);
+ vback = gimple_omp_continue_control_def (stmt);
if (POINTER_TYPE_P (type))
t = fold_build2 (POINTER_PLUS_EXPR, type, vmain,
fold_convert (sizetype, fd->loop.step));
else
t = fold_build2 (PLUS_EXPR, type, vmain, fd->loop.step);
- t = force_gimple_operand_bsi (&si, t, false, NULL_TREE,
- true, BSI_SAME_STMT);
- t = build_gimple_modify_stmt (vback, t);
- bsi_insert_before (&si, t, BSI_SAME_STMT);
- if (gimple_in_ssa_p (cfun))
- SSA_NAME_DEF_STMT (vback) = t;
+ t = force_gimple_operand_gsi (&gsi, t, false, NULL_TREE,
+ true, GSI_SAME_STMT);
+ stmt = gimple_build_assign (vback, t);
+ gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
t = build2 (fd->loop.cond_code, boolean_type_node, vback, e);
- t = build3 (COND_EXPR, void_type_node, t, NULL_TREE, NULL_TREE);
- bsi_insert_before (&si, t, BSI_SAME_STMT);
+ gsi_insert_before (&gsi, gimple_build_cond_empty (t), GSI_SAME_STMT);
- /* Remove the OMP_CONTINUE statement. */
- bsi_remove (&si, true);
+ /* Remove the GIMPLE_OMP_CONTINUE statement. */
+ gsi_remove (&gsi, true);
- /* Replace the OMP_RETURN with a barrier, or nothing. */
- si = bsi_last (exit_bb);
- if (!OMP_RETURN_NOWAIT (bsi_stmt (si)))
- force_gimple_operand_bsi (&si, build_omp_barrier (), false, NULL_TREE,
- false, BSI_SAME_STMT);
- bsi_remove (&si, true);
+ /* Replace the GIMPLE_OMP_RETURN with a barrier, or nothing. */
+ gsi = gsi_last_bb (exit_bb);
+ if (!gimple_omp_return_nowait_p (gsi_stmt (gsi)))
+ force_gimple_operand_gsi (&gsi, build_omp_barrier (), false, NULL_TREE,
+ false, GSI_SAME_STMT);
+ gsi_remove (&gsi, true);
/* Connect all the blocks. */
find_edge (entry_bb, seq_start_bb)->flags = EDGE_FALSE_VALUE;
@@ -4057,16 +4169,16 @@ expand_omp_for_static_nochunk (struct omp_region *region,
*/
static void
-expand_omp_for_static_chunk (struct omp_region *region,
- struct omp_for_data *fd)
+expand_omp_for_static_chunk (struct omp_region *region, struct omp_for_data *fd)
{
- tree n, s0, e0, e, t, phi, nphi, args;
+ tree n, s0, e0, e, t;
tree trip_var, trip_init, trip_main, trip_back, nthreads, threadid;
- tree type, itype, cont, v_main, v_back, v_extra;
+ tree type, itype, v_main, v_back, v_extra;
basic_block entry_bb, exit_bb, body_bb, seq_start_bb, iter_part_bb;
basic_block trip_update_bb, cont_bb, fin_bb;
- block_stmt_iterator si;
- edge se, re, ene;
+ gimple_stmt_iterator si;
+ gimple stmt;
+ edge se;
itype = type = TREE_TYPE (fd->loop.v);
if (POINTER_TYPE_P (type))
@@ -4089,31 +4201,31 @@ expand_omp_for_static_chunk (struct omp_region *region,
exit_bb = region->exit;
/* Trip and adjustment setup goes in ENTRY_BB. */
- si = bsi_last (entry_bb);
- gcc_assert (TREE_CODE (bsi_stmt (si)) == OMP_FOR);
+ si = gsi_last_bb (entry_bb);
+ gcc_assert (gimple_code (gsi_stmt (si)) == GIMPLE_OMP_FOR);
t = build_call_expr (built_in_decls[BUILT_IN_OMP_GET_NUM_THREADS], 0);
t = fold_convert (itype, t);
- nthreads = force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- true, BSI_SAME_STMT);
+ nthreads = force_gimple_operand_gsi (&si, t, true, NULL_TREE,
+ true, GSI_SAME_STMT);
t = build_call_expr (built_in_decls[BUILT_IN_OMP_GET_THREAD_NUM], 0);
t = fold_convert (itype, t);
- threadid = force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- true, BSI_SAME_STMT);
+ threadid = force_gimple_operand_gsi (&si, t, true, NULL_TREE,
+ true, GSI_SAME_STMT);
fd->loop.n1
- = force_gimple_operand_bsi (&si, fold_convert (type, fd->loop.n1),
- true, NULL_TREE, true, BSI_SAME_STMT);
+ = force_gimple_operand_gsi (&si, fold_convert (type, fd->loop.n1),
+ true, NULL_TREE, true, GSI_SAME_STMT);
fd->loop.n2
- = force_gimple_operand_bsi (&si, fold_convert (itype, fd->loop.n2),
- true, NULL_TREE, true, BSI_SAME_STMT);
+ = force_gimple_operand_gsi (&si, fold_convert (itype, fd->loop.n2),
+ true, NULL_TREE, true, GSI_SAME_STMT);
fd->loop.step
- = force_gimple_operand_bsi (&si, fold_convert (itype, fd->loop.step),
- true, NULL_TREE, true, BSI_SAME_STMT);
+ = force_gimple_operand_gsi (&si, fold_convert (itype, fd->loop.step),
+ true, NULL_TREE, true, GSI_SAME_STMT);
fd->chunk_size
- = force_gimple_operand_bsi (&si, fold_convert (itype, fd->chunk_size),
- true, NULL_TREE, true, BSI_SAME_STMT);
+ = force_gimple_operand_gsi (&si, fold_convert (itype, fd->chunk_size),
+ true, NULL_TREE, true, GSI_SAME_STMT);
t = build_int_cst (itype, (fd->loop.cond_code == LT_EXPR ? -1 : 1));
t = fold_build2 (PLUS_EXPR, itype, fd->loop.step, t);
@@ -4126,16 +4238,16 @@ expand_omp_for_static_chunk (struct omp_region *region,
else
t = fold_build2 (TRUNC_DIV_EXPR, itype, t, fd->loop.step);
t = fold_convert (itype, t);
- n = force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- true, BSI_SAME_STMT);
+ n = force_gimple_operand_gsi (&si, t, true, NULL_TREE,
+ true, GSI_SAME_STMT);
trip_var = create_tmp_var (itype, ".trip");
if (gimple_in_ssa_p (cfun))
{
add_referenced_var (trip_var);
- trip_init = make_ssa_name (trip_var, NULL_TREE);
- trip_main = make_ssa_name (trip_var, NULL_TREE);
- trip_back = make_ssa_name (trip_var, NULL_TREE);
+ trip_init = make_ssa_name (trip_var, NULL);
+ trip_main = make_ssa_name (trip_var, NULL);
+ trip_back = make_ssa_name (trip_var, NULL);
}
else
{
@@ -4144,10 +4256,8 @@ expand_omp_for_static_chunk (struct omp_region *region,
trip_back = trip_var;
}
- t = build_gimple_modify_stmt (trip_init, build_int_cst (itype, 0));
- bsi_insert_before (&si, t, BSI_SAME_STMT);
- if (gimple_in_ssa_p (cfun))
- SSA_NAME_DEF_STMT (trip_init) = t;
+ stmt = gimple_build_assign (trip_init, build_int_cst (itype, 0));
+ gsi_insert_before (&si, stmt, GSI_SAME_STMT);
t = fold_build2 (MULT_EXPR, itype, threadid, fd->chunk_size);
t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
@@ -4156,32 +4266,31 @@ expand_omp_for_static_chunk (struct omp_region *region,
fold_convert (sizetype, t));
else
t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
- v_extra = force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- true, BSI_SAME_STMT);
+ v_extra = force_gimple_operand_gsi (&si, t, true, NULL_TREE,
+ true, GSI_SAME_STMT);
- /* Remove the OMP_FOR. */
- bsi_remove (&si, true);
+ /* Remove the GIMPLE_OMP_FOR. */
+ gsi_remove (&si, true);
/* Iteration space partitioning goes in ITER_PART_BB. */
- si = bsi_last (iter_part_bb);
+ si = gsi_last_bb (iter_part_bb);
t = fold_build2 (MULT_EXPR, itype, trip_main, nthreads);
t = fold_build2 (PLUS_EXPR, itype, t, threadid);
t = fold_build2 (MULT_EXPR, itype, t, fd->chunk_size);
- s0 = force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- false, BSI_CONTINUE_LINKING);
+ s0 = force_gimple_operand_gsi (&si, t, true, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
t = fold_build2 (PLUS_EXPR, itype, s0, fd->chunk_size);
t = fold_build2 (MIN_EXPR, itype, t, n);
- e0 = force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- false, BSI_CONTINUE_LINKING);
+ e0 = force_gimple_operand_gsi (&si, t, true, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
t = build2 (LT_EXPR, boolean_type_node, s0, n);
- t = build3 (COND_EXPR, void_type_node, t, NULL_TREE, NULL_TREE);
- bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
+ gsi_insert_after (&si, gimple_build_cond_empty (t), GSI_CONTINUE_LINKING);
/* Setup code for sequential iteration goes in SEQ_START_BB. */
- si = bsi_start (seq_start_bb);
+ si = gsi_start_bb (seq_start_bb);
t = fold_convert (itype, s0);
t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
@@ -4190,12 +4299,10 @@ expand_omp_for_static_chunk (struct omp_region *region,
fold_convert (sizetype, t));
else
t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
- t = force_gimple_operand_bsi (&si, t, false, NULL_TREE,
- false, BSI_CONTINUE_LINKING);
- t = build_gimple_modify_stmt (fd->loop.v, t);
- bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
- if (gimple_in_ssa_p (cfun))
- SSA_NAME_DEF_STMT (fd->loop.v) = t;
+ t = force_gimple_operand_gsi (&si, t, false, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
+ stmt = gimple_build_assign (fd->loop.v, t);
+ gsi_insert_after (&si, stmt, GSI_CONTINUE_LINKING);
t = fold_convert (itype, e0);
t = fold_build2 (MULT_EXPR, itype, t, fd->loop.step);
@@ -4204,50 +4311,45 @@ expand_omp_for_static_chunk (struct omp_region *region,
fold_convert (sizetype, t));
else
t = fold_build2 (PLUS_EXPR, type, t, fd->loop.n1);
- e = force_gimple_operand_bsi (&si, t, true, NULL_TREE,
- false, BSI_CONTINUE_LINKING);
+ e = force_gimple_operand_gsi (&si, t, true, NULL_TREE,
+ false, GSI_CONTINUE_LINKING);
/* The code controlling the sequential loop goes in CONT_BB,
- replacing the OMP_CONTINUE. */
- si = bsi_last (cont_bb);
- cont = bsi_stmt (si);
- gcc_assert (TREE_CODE (cont) == OMP_CONTINUE);
- v_main = TREE_OPERAND (cont, 1);
- v_back = TREE_OPERAND (cont, 0);
+ replacing the GIMPLE_OMP_CONTINUE. */
+ si = gsi_last_bb (cont_bb);
+ stmt = gsi_stmt (si);
+ gcc_assert (gimple_code (stmt) == GIMPLE_OMP_CONTINUE);
+ v_main = gimple_omp_continue_control_use (stmt);
+ v_back = gimple_omp_continue_control_def (stmt);
if (POINTER_TYPE_P (type))
t = fold_build2 (POINTER_PLUS_EXPR, type, v_main,
fold_convert (sizetype, fd->loop.step));
else
- t = build2 (PLUS_EXPR, type, v_main, fd->loop.step);
- t = build_gimple_modify_stmt (v_back, t);
- bsi_insert_before (&si, t, BSI_SAME_STMT);
- if (gimple_in_ssa_p (cfun))
- SSA_NAME_DEF_STMT (v_back) = t;
+ t = fold_build2 (PLUS_EXPR, type, v_main, fd->loop.step);
+ stmt = gimple_build_assign (v_back, t);
+ gsi_insert_before (&si, stmt, GSI_SAME_STMT);
t = build2 (fd->loop.cond_code, boolean_type_node, v_back, e);
- t = build3 (COND_EXPR, void_type_node, t, NULL_TREE, NULL_TREE);
- bsi_insert_before (&si, t, BSI_SAME_STMT);
+ gsi_insert_before (&si, gimple_build_cond_empty (t), GSI_SAME_STMT);
- /* Remove OMP_CONTINUE. */
- bsi_remove (&si, true);
+ /* Remove GIMPLE_OMP_CONTINUE. */
+ gsi_remove (&si, true);
/* Trip update code goes into TRIP_UPDATE_BB. */
- si = bsi_start (trip_update_bb);
+ si = gsi_start_bb (trip_update_bb);
t = build_int_cst (itype, 1);
t = build2 (PLUS_EXPR, itype, trip_main, t);
- t = build_gimple_modify_stmt (trip_back, t);
- bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
- if (gimple_in_ssa_p (cfun))
- SSA_NAME_DEF_STMT (trip_back) = t;
+ stmt = gimple_build_assign (trip_back, t);
+ gsi_insert_after (&si, stmt, GSI_CONTINUE_LINKING);
- /* Replace the OMP_RETURN with a barrier, or nothing. */
- si = bsi_last (exit_bb);
- if (!OMP_RETURN_NOWAIT (bsi_stmt (si)))
- force_gimple_operand_bsi (&si, build_omp_barrier (), false, NULL_TREE,
- false, BSI_SAME_STMT);
- bsi_remove (&si, true);
+ /* Replace the GIMPLE_OMP_RETURN with a barrier, or nothing. */
+ si = gsi_last_bb (exit_bb);
+ if (!gimple_omp_return_nowait_p (gsi_stmt (si)))
+ force_gimple_operand_gsi (&si, build_omp_barrier (), false, NULL_TREE,
+ false, GSI_SAME_STMT);
+ gsi_remove (&si, true);
/* Connect the new blocks. */
find_edge (iter_part_bb, seq_start_bb)->flags = EDGE_TRUE_VALUE;
@@ -4260,21 +4362,30 @@ expand_omp_for_static_chunk (struct omp_region *region,
if (gimple_in_ssa_p (cfun))
{
+ gimple_stmt_iterator psi;
+ gimple phi;
+ edge re, ene;
+ edge_var_map_vector head;
+ edge_var_map *vm;
+ size_t i;
+
/* When we redirect the edge from trip_update_bb to iter_part_bb, we
remove arguments of the phi nodes in fin_bb. We need to create
appropriate phi nodes in iter_part_bb instead. */
se = single_pred_edge (fin_bb);
re = single_succ_edge (trip_update_bb);
+ head = redirect_edge_var_map_vector (re);
ene = single_succ_edge (entry_bb);
- args = PENDING_STMT (re);
- PENDING_STMT (re) = NULL_TREE;
- for (phi = phi_nodes (fin_bb);
- phi && args;
- phi = PHI_CHAIN (phi), args = TREE_CHAIN (args))
+ psi = gsi_start_phis (fin_bb);
+ for (i = 0; !gsi_end_p (psi) && VEC_iterate (edge_var_map, head, i, vm);
+ gsi_next (&psi), ++i)
{
- t = PHI_RESULT (phi);
- gcc_assert (t == TREE_PURPOSE (args));
+ gimple nphi;
+
+ phi = gsi_stmt (psi);
+ t = gimple_phi_result (phi);
+ gcc_assert (t == redirect_edge_var_map_result (vm));
nphi = create_phi_node (t, iter_part_bb);
SSA_NAME_DEF_STMT (t) = nphi;
@@ -4284,11 +4395,17 @@ expand_omp_for_static_chunk (struct omp_region *region,
if (t == fd->loop.v)
t = v_extra;
add_phi_arg (nphi, t, ene);
- add_phi_arg (nphi, TREE_VALUE (args), re);
+ add_phi_arg (nphi, redirect_edge_var_map_def (vm), re);
+ }
+ gcc_assert (!gsi_end_p (psi) && i == VEC_length (edge_var_map, head));
+ redirect_edge_var_map_clear (re);
+ while (1)
+ {
+ psi = gsi_start_phis (fin_bb);
+ if (gsi_end_p (psi))
+ break;
+ remove_phi_node (&psi, false);
}
- gcc_assert (!phi && !args);
- while ((phi = phi_nodes (fin_bb)) != NULL_TREE)
- remove_phi_node (phi, NULL_TREE, false);
/* Make phi node for trip. */
phi = create_phi_node (trip_main, iter_part_bb);
@@ -4319,9 +4436,8 @@ expand_omp_for (struct omp_region *region)
loops
= (struct omp_for_data_loop *)
- alloca (TREE_VEC_LENGTH (OMP_FOR_INIT (last_stmt (region->entry)))
+ alloca (gimple_omp_for_collapse (last_stmt (region->entry))
* sizeof (struct omp_for_data_loop));
-
extract_omp_for_data (last_stmt (region->entry), &fd, loops);
region->sched_kind = fd.sched_kind;
@@ -4351,7 +4467,7 @@ expand_omp_for (struct omp_region *region)
gcc_assert (fd.sched_kind != OMP_CLAUSE_SCHEDULE_AUTO);
fn_index = (fd.sched_kind == OMP_CLAUSE_SCHEDULE_RUNTIME)
- ? 3 : fd.sched_kind;
+ ? 3 : fd.sched_kind;
fn_index += fd.have_ordered * 4;
start_ix = BUILT_IN_GOMP_LOOP_STATIC_START + fn_index;
next_ix = BUILT_IN_GOMP_LOOP_STATIC_NEXT + fn_index;
@@ -4399,13 +4515,16 @@ expand_omp_for (struct omp_region *region)
static void
expand_omp_sections (struct omp_region *region)
{
- tree label_vec, l1, l2, t, u, sections_stmt, vin, vmain, vnext, cont;
- unsigned i, casei, len;
+ tree t, u, vin = NULL, vmain, vnext, l1, l2;
+ VEC (tree,heap) *label_vec;
+ unsigned len;
basic_block entry_bb, l0_bb, l1_bb, l2_bb, default_bb;
- block_stmt_iterator si;
+ gimple_stmt_iterator si, switch_si;
+ gimple sections_stmt, stmt, cont;
edge_iterator ei;
edge e;
struct omp_region *inner;
+ unsigned i, casei;
bool exit_reachable = region->cont != NULL;
gcc_assert (exit_reachable == (region->exit != NULL));
@@ -4416,50 +4535,55 @@ expand_omp_sections (struct omp_region *region)
if (exit_reachable)
{
if (single_pred (l2_bb) == l0_bb)
- l2 = tree_block_label (l2_bb);
+ l2 = gimple_block_label (l2_bb);
else
{
/* This can happen if there are reductions. */
len = EDGE_COUNT (l0_bb->succs);
gcc_assert (len > 0);
e = EDGE_SUCC (l0_bb, len - 1);
- si = bsi_last (e->dest);
+ si = gsi_last_bb (e->dest);
l2 = NULL_TREE;
- if (bsi_end_p (si) || TREE_CODE (bsi_stmt (si)) != OMP_SECTION)
- l2 = tree_block_label (e->dest);
+ if (gsi_end_p (si)
+ || gimple_code (gsi_stmt (si)) != GIMPLE_OMP_SECTION)
+ l2 = gimple_block_label (e->dest);
else
FOR_EACH_EDGE (e, ei, l0_bb->succs)
{
- si = bsi_last (e->dest);
- if (bsi_end_p (si) || TREE_CODE (bsi_stmt (si)) != OMP_SECTION)
+ si = gsi_last_bb (e->dest);
+ if (gsi_end_p (si)
+ || gimple_code (gsi_stmt (si)) != GIMPLE_OMP_SECTION)
{
- l2 = tree_block_label (e->dest);
+ l2 = gimple_block_label (e->dest);
break;
}
}
}
default_bb = create_empty_bb (l1_bb->prev_bb);
- l1 = tree_block_label (l1_bb);
+ l1 = gimple_block_label (l1_bb);
}
else
{
default_bb = create_empty_bb (l0_bb);
l1 = NULL_TREE;
- l2 = tree_block_label (default_bb);
+ l2 = gimple_block_label (default_bb);
}
/* We will build a switch() with enough cases for all the
- OMP_SECTION regions, a '0' case to handle the end of more work
+ GIMPLE_OMP_SECTION regions, a '0' case to handle the end of more work
and a default case to abort if something goes wrong. */
len = EDGE_COUNT (l0_bb->succs);
- label_vec = make_tree_vec (len + 1);
+
+ /* Use VEC_quick_push on label_vec throughout, since we know the size
+ in advance. */
+ label_vec = VEC_alloc (tree, heap, len);
/* The call to GOMP_sections_start goes in ENTRY_BB, replacing the
- OMP_SECTIONS statement. */
- si = bsi_last (entry_bb);
- sections_stmt = bsi_stmt (si);
- gcc_assert (TREE_CODE (sections_stmt) == OMP_SECTIONS);
- vin = OMP_SECTIONS_CONTROL (sections_stmt);
+ GIMPLE_OMP_SECTIONS statement. */
+ si = gsi_last_bb (entry_bb);
+ sections_stmt = gsi_stmt (si);
+ gcc_assert (gimple_code (sections_stmt) == GIMPLE_OMP_SECTIONS);
+ vin = gimple_omp_sections_control (sections_stmt);
if (!is_combined_parallel (region))
{
/* If we are not inside a combined parallel+sections region,
@@ -4467,29 +4591,28 @@ expand_omp_sections (struct omp_region *region)
t = build_int_cst (unsigned_type_node,
exit_reachable ? len - 1 : len);
u = built_in_decls[BUILT_IN_GOMP_SECTIONS_START];
- t = build_call_expr (u, 1, t);
+ stmt = gimple_build_call (u, 1, t);
}
else
{
/* Otherwise, call GOMP_sections_next. */
u = built_in_decls[BUILT_IN_GOMP_SECTIONS_NEXT];
- t = build_call_expr (u, 0);
+ stmt = gimple_build_call (u, 0);
}
- t = build_gimple_modify_stmt (vin, t);
- bsi_insert_after (&si, t, BSI_SAME_STMT);
- if (gimple_in_ssa_p (cfun))
- SSA_NAME_DEF_STMT (vin) = t;
- bsi_remove (&si, true);
-
- /* The switch() statement replacing OMP_SECTIONS_SWITCH goes in L0_BB. */
- si = bsi_last (l0_bb);
- gcc_assert (TREE_CODE (bsi_stmt (si)) == OMP_SECTIONS_SWITCH);
+ gimple_call_set_lhs (stmt, vin);
+ gsi_insert_after (&si, stmt, GSI_SAME_STMT);
+ gsi_remove (&si, true);
+
+ /* The switch() statement replacing GIMPLE_OMP_SECTIONS_SWITCH goes in
+ L0_BB. */
+ switch_si = gsi_last_bb (l0_bb);
+ gcc_assert (gimple_code (gsi_stmt (switch_si)) == GIMPLE_OMP_SECTIONS_SWITCH);
if (exit_reachable)
{
cont = last_stmt (l1_bb);
- gcc_assert (TREE_CODE (cont) == OMP_CONTINUE);
- vmain = TREE_OPERAND (cont, 1);
- vnext = TREE_OPERAND (cont, 0);
+ gcc_assert (gimple_code (cont) == GIMPLE_OMP_CONTINUE);
+ vmain = gimple_omp_continue_control_use (cont);
+ vnext = gimple_omp_continue_control_def (cont);
}
else
{
@@ -4497,20 +4620,16 @@ expand_omp_sections (struct omp_region *region)
vnext = NULL_TREE;
}
- t = build3 (SWITCH_EXPR, void_type_node, vmain, NULL, label_vec);
- bsi_insert_after (&si, t, BSI_SAME_STMT);
- bsi_remove (&si, true);
-
i = 0;
if (exit_reachable)
{
t = build3 (CASE_LABEL_EXPR, void_type_node,
build_int_cst (unsigned_type_node, 0), NULL, l2);
- TREE_VEC_ELT (label_vec, 0) = t;
+ VEC_quick_push (tree, label_vec, t);
i++;
}
- /* Convert each OMP_SECTION into a CASE_LABEL_EXPR. */
+ /* Convert each GIMPLE_OMP_SECTION into a CASE_LABEL_EXPR. */
for (inner = region->inner, casei = 1;
inner;
inner = inner->next, i++, casei++)
@@ -4518,7 +4637,7 @@ expand_omp_sections (struct omp_region *region)
basic_block s_entry_bb, s_exit_bb;
/* Skip optional reduction region. */
- if (inner->type == OMP_ATOMIC_LOAD)
+ if (inner->type == GIMPLE_OMP_ATOMIC_LOAD)
{
--i;
--casei;
@@ -4528,61 +4647,63 @@ expand_omp_sections (struct omp_region *region)
s_entry_bb = inner->entry;
s_exit_bb = inner->exit;
- t = tree_block_label (s_entry_bb);
+ t = gimple_block_label (s_entry_bb);
u = build_int_cst (unsigned_type_node, casei);
u = build3 (CASE_LABEL_EXPR, void_type_node, u, NULL, t);
- TREE_VEC_ELT (label_vec, i) = u;
+ VEC_quick_push (tree, label_vec, u);
- si = bsi_last (s_entry_bb);
- gcc_assert (TREE_CODE (bsi_stmt (si)) == OMP_SECTION);
- gcc_assert (i < len || OMP_SECTION_LAST (bsi_stmt (si)));
- bsi_remove (&si, true);
+ si = gsi_last_bb (s_entry_bb);
+ gcc_assert (gimple_code (gsi_stmt (si)) == GIMPLE_OMP_SECTION);
+ gcc_assert (i < len || gimple_omp_section_last_p (gsi_stmt (si)));
+ gsi_remove (&si, true);
single_succ_edge (s_entry_bb)->flags = EDGE_FALLTHRU;
if (s_exit_bb == NULL)
continue;
- si = bsi_last (s_exit_bb);
- gcc_assert (TREE_CODE (bsi_stmt (si)) == OMP_RETURN);
- bsi_remove (&si, true);
+ si = gsi_last_bb (s_exit_bb);
+ gcc_assert (gimple_code (gsi_stmt (si)) == GIMPLE_OMP_RETURN);
+ gsi_remove (&si, true);
single_succ_edge (s_exit_bb)->flags = EDGE_FALLTHRU;
}
/* Error handling code goes in DEFAULT_BB. */
- t = tree_block_label (default_bb);
+ t = gimple_block_label (default_bb);
u = build3 (CASE_LABEL_EXPR, void_type_node, NULL, NULL, t);
- TREE_VEC_ELT (label_vec, len) = u;
make_edge (l0_bb, default_bb, 0);
- si = bsi_start (default_bb);
- t = build_call_expr (built_in_decls[BUILT_IN_TRAP], 0);
- bsi_insert_after (&si, t, BSI_CONTINUE_LINKING);
+ stmt = gimple_build_switch_vec (vmain, u, label_vec);
+ gsi_insert_after (&switch_si, stmt, GSI_SAME_STMT);
+ gsi_remove (&switch_si, true);
+ VEC_free (tree, heap, label_vec);
+
+ si = gsi_start_bb (default_bb);
+ stmt = gimple_build_call (built_in_decls[BUILT_IN_TRAP], 0);
+ gsi_insert_after (&si, stmt, GSI_CONTINUE_LINKING);
if (exit_reachable)
{
/* Code to get the next section goes in L1_BB. */
- si = bsi_last (l1_bb);
- gcc_assert (TREE_CODE (bsi_stmt (si)) == OMP_CONTINUE);
+ si = gsi_last_bb (l1_bb);
+ gcc_assert (gimple_code (gsi_stmt (si)) == GIMPLE_OMP_CONTINUE);
- t = build_call_expr (built_in_decls[BUILT_IN_GOMP_SECTIONS_NEXT], 0);
- t = build_gimple_modify_stmt (vnext, t);
- bsi_insert_after (&si, t, BSI_SAME_STMT);
- if (gimple_in_ssa_p (cfun))
- SSA_NAME_DEF_STMT (vnext) = t;
- bsi_remove (&si, true);
+ stmt = gimple_build_call (built_in_decls[BUILT_IN_GOMP_SECTIONS_NEXT], 0);
+ gimple_call_set_lhs (stmt, vnext);
+ gsi_insert_after (&si, stmt, GSI_SAME_STMT);
+ gsi_remove (&si, true);
single_succ_edge (l1_bb)->flags = EDGE_FALLTHRU;
- /* Cleanup function replaces OMP_RETURN in EXIT_BB. */
- si = bsi_last (l2_bb);
- if (OMP_RETURN_NOWAIT (bsi_stmt (si)))
+ /* Cleanup function replaces GIMPLE_OMP_RETURN in EXIT_BB. */
+ si = gsi_last_bb (l2_bb);
+ if (gimple_omp_return_nowait_p (gsi_stmt (si)))
t = built_in_decls[BUILT_IN_GOMP_SECTIONS_END_NOWAIT];
else
t = built_in_decls[BUILT_IN_GOMP_SECTIONS_END];
- t = build_call_expr (t, 0);
- bsi_insert_after (&si, t, BSI_SAME_STMT);
- bsi_remove (&si, true);
+ stmt = gimple_build_call (t, 0);
+ gsi_insert_after (&si, stmt, GSI_SAME_STMT);
+ gsi_remove (&si, true);
}
set_immediate_dominator (CDI_DOMINATORS, default_bb, l0_bb);
@@ -4596,28 +4717,28 @@ static void
expand_omp_single (struct omp_region *region)
{
basic_block entry_bb, exit_bb;
- block_stmt_iterator si;
+ gimple_stmt_iterator si;
bool need_barrier = false;
entry_bb = region->entry;
exit_bb = region->exit;
- si = bsi_last (entry_bb);
+ si = gsi_last_bb (entry_bb);
/* The terminal barrier at the end of a GOMP_single_copy sequence cannot
be removed. We need to ensure that the thread that entered the single
does not exit before the data is copied out by the other threads. */
- if (find_omp_clause (OMP_SINGLE_CLAUSES (bsi_stmt (si)),
+ if (find_omp_clause (gimple_omp_single_clauses (gsi_stmt (si)),
OMP_CLAUSE_COPYPRIVATE))
need_barrier = true;
- gcc_assert (TREE_CODE (bsi_stmt (si)) == OMP_SINGLE);
- bsi_remove (&si, true);
+ gcc_assert (gimple_code (gsi_stmt (si)) == GIMPLE_OMP_SINGLE);
+ gsi_remove (&si, true);
single_succ_edge (entry_bb)->flags = EDGE_FALLTHRU;
- si = bsi_last (exit_bb);
- if (!OMP_RETURN_NOWAIT (bsi_stmt (si)) || need_barrier)
- force_gimple_operand_bsi (&si, build_omp_barrier (), false, NULL_TREE,
- false, BSI_SAME_STMT);
- bsi_remove (&si, true);
+ si = gsi_last_bb (exit_bb);
+ if (!gimple_omp_return_nowait_p (gsi_stmt (si)) || need_barrier)
+ force_gimple_operand_gsi (&si, build_omp_barrier (), false, NULL_TREE,
+ false, GSI_SAME_STMT);
+ gsi_remove (&si, true);
single_succ_edge (exit_bb)->flags = EDGE_FALLTHRU;
}
@@ -4630,24 +4751,24 @@ static void
expand_omp_synch (struct omp_region *region)
{
basic_block entry_bb, exit_bb;
- block_stmt_iterator si;
+ gimple_stmt_iterator si;
entry_bb = region->entry;
exit_bb = region->exit;
- si = bsi_last (entry_bb);
- gcc_assert (TREE_CODE (bsi_stmt (si)) == OMP_SINGLE
- || TREE_CODE (bsi_stmt (si)) == OMP_MASTER
- || TREE_CODE (bsi_stmt (si)) == OMP_ORDERED
- || TREE_CODE (bsi_stmt (si)) == OMP_CRITICAL);
- bsi_remove (&si, true);
+ si = gsi_last_bb (entry_bb);
+ gcc_assert (gimple_code (gsi_stmt (si)) == GIMPLE_OMP_SINGLE
+ || gimple_code (gsi_stmt (si)) == GIMPLE_OMP_MASTER
+ || gimple_code (gsi_stmt (si)) == GIMPLE_OMP_ORDERED
+ || gimple_code (gsi_stmt (si)) == GIMPLE_OMP_CRITICAL);
+ gsi_remove (&si, true);
single_succ_edge (entry_bb)->flags = EDGE_FALLTHRU;
if (exit_bb)
{
- si = bsi_last (exit_bb);
- gcc_assert (TREE_CODE (bsi_stmt (si)) == OMP_RETURN);
- bsi_remove (&si, true);
+ si = gsi_last_bb (exit_bb);
+ gcc_assert (gimple_code (gsi_stmt (si)) == GIMPLE_OMP_RETURN);
+ gsi_remove (&si, true);
single_succ_edge (exit_bb)->flags = EDGE_FALLTHRU;
}
}
@@ -4667,38 +4788,36 @@ expand_omp_atomic_fetch_op (basic_block load_bb,
enum insn_code *optab;
tree rhs;
basic_block store_bb = single_succ (load_bb);
- block_stmt_iterator bsi;
- tree stmt;
+ gimple_stmt_iterator gsi;
+ gimple stmt;
/* We expect to find the following sequences:
load_bb:
- OMP_ATOMIC_LOAD (tmp, mem)
+ GIMPLE_OMP_ATOMIC_LOAD (tmp, mem)
store_bb:
val = tmp OP something; (or: something OP tmp)
- OMP_STORE (val)
+ GIMPLE_OMP_STORE (val)
???FIXME: Allow a more flexible sequence.
Perhaps use data flow to pick the statements.
*/
- bsi = bsi_after_labels (store_bb);
- stmt = bsi_stmt (bsi);
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ gsi = gsi_after_labels (store_bb);
+ stmt = gsi_stmt (gsi);
+ if (!is_gimple_assign (stmt))
return false;
- bsi_next (&bsi);
- if (TREE_CODE (bsi_stmt (bsi)) != OMP_ATOMIC_STORE)
+ gsi_next (&gsi);
+ if (gimple_code (gsi_stmt (gsi)) != GIMPLE_OMP_ATOMIC_STORE)
return false;
- if (!operand_equal_p (GIMPLE_STMT_OPERAND (stmt, 0), stored_val, 0))
+ if (!operand_equal_p (gimple_assign_lhs (stmt), stored_val, 0))
return false;
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
-
/* Check for one of the supported fetch-op operations. */
- switch (TREE_CODE (rhs))
+ switch (gimple_assign_rhs_code (stmt))
{
case PLUS_EXPR:
case POINTER_PLUS_EXPR:
@@ -4725,11 +4844,11 @@ expand_omp_atomic_fetch_op (basic_block load_bb,
return false;
}
/* Make sure the expression is of the proper form. */
- if (operand_equal_p (TREE_OPERAND (rhs, 0), loaded_val, 0))
- rhs = TREE_OPERAND (rhs, 1);
- else if (commutative_tree_code (TREE_CODE (rhs))
- && operand_equal_p (TREE_OPERAND (rhs, 1), loaded_val, 0))
- rhs = TREE_OPERAND (rhs, 0);
+ if (operand_equal_p (gimple_assign_rhs1 (stmt), loaded_val, 0))
+ rhs = gimple_assign_rhs2 (stmt);
+ else if (commutative_tree_code (gimple_assign_rhs_code (stmt))
+ && operand_equal_p (gimple_assign_rhs2 (stmt), loaded_val, 0))
+ rhs = gimple_assign_rhs1 (stmt);
else
return false;
@@ -4739,18 +4858,18 @@ expand_omp_atomic_fetch_op (basic_block load_bb,
if (optab[TYPE_MODE (itype)] == CODE_FOR_nothing)
return false;
- bsi = bsi_last (load_bb);
- gcc_assert (TREE_CODE (bsi_stmt (bsi)) == OMP_ATOMIC_LOAD);
+ gsi = gsi_last_bb (load_bb);
+ gcc_assert (gimple_code (gsi_stmt (gsi)) == GIMPLE_OMP_ATOMIC_LOAD);
call = build_call_expr (decl, 2, addr, fold_convert (itype, rhs));
call = fold_convert (void_type_node, call);
- force_gimple_operand_bsi (&bsi, call, true, NULL_TREE, true, BSI_SAME_STMT);
- bsi_remove (&bsi, true);
+ force_gimple_operand_gsi (&gsi, call, true, NULL_TREE, true, GSI_SAME_STMT);
+ gsi_remove (&gsi, true);
- bsi = bsi_last (store_bb);
- gcc_assert (TREE_CODE (bsi_stmt (bsi)) == OMP_ATOMIC_STORE);
- bsi_remove (&bsi, true);
- bsi = bsi_last (store_bb);
- bsi_remove (&bsi, true);
+ gsi = gsi_last_bb (store_bb);
+ gcc_assert (gimple_code (gsi_stmt (gsi)) == GIMPLE_OMP_ATOMIC_STORE);
+ gsi_remove (&gsi, true);
+ gsi = gsi_last_bb (store_bb);
+ gsi_remove (&gsi, true);
if (gimple_in_ssa_p (cfun))
update_ssa (TODO_update_ssa_no_phi);
@@ -4777,9 +4896,9 @@ expand_omp_atomic_pipeline (basic_block load_bb, basic_block store_bb,
{
tree loadedi, storedi, initial, new_storedi, old_vali;
tree type, itype, cmpxchg, iaddr;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator si;
basic_block loop_header = single_succ (load_bb);
- tree phi, x;
+ gimple phi, stmt;
edge e;
cmpxchg = built_in_decls[BUILT_IN_VAL_COMPARE_AND_SWAP_N + index + 1];
@@ -4789,19 +4908,24 @@ expand_omp_atomic_pipeline (basic_block load_bb, basic_block store_bb,
if (sync_compare_and_swap[TYPE_MODE (itype)] == CODE_FOR_nothing)
return false;
- /* Load the initial value, replacing the OMP_ATOMIC_LOAD. */
- bsi = bsi_last (load_bb);
- gcc_assert (TREE_CODE (bsi_stmt (bsi)) == OMP_ATOMIC_LOAD);
+ /* Load the initial value, replacing the GIMPLE_OMP_ATOMIC_LOAD. */
+ si = gsi_last_bb (load_bb);
+ gcc_assert (gimple_code (gsi_stmt (si)) == GIMPLE_OMP_ATOMIC_LOAD);
+
/* For floating-point values, we'll need to view-convert them to integers
so that we can perform the atomic compare and swap. Simplify the
following code by always setting up the "i"ntegral variables. */
if (!INTEGRAL_TYPE_P (type) && !POINTER_TYPE_P (type))
{
+ tree iaddr_val;
+
iaddr = create_tmp_var (build_pointer_type (itype), NULL);
- x = build_gimple_modify_stmt (iaddr,
- fold_convert (TREE_TYPE (iaddr), addr));
- force_gimple_operand_bsi (&bsi, x, true, NULL_TREE,
- true, BSI_SAME_STMT);
+ iaddr_val
+ = force_gimple_operand_gsi (&si,
+ fold_convert (TREE_TYPE (iaddr), addr),
+ false, NULL_TREE, true, GSI_SAME_STMT);
+ stmt = gimple_build_assign (iaddr, iaddr_val);
+ gsi_insert_before (&si, stmt, GSI_SAME_STMT);
DECL_NO_TBAA_P (iaddr) = 1;
DECL_POINTER_ALIAS_SET (iaddr) = 0;
loadedi = create_tmp_var (itype, NULL);
@@ -4817,63 +4941,65 @@ expand_omp_atomic_pipeline (basic_block load_bb, basic_block store_bb,
iaddr = addr;
loadedi = loaded_val;
}
- initial = force_gimple_operand_bsi (&bsi, build_fold_indirect_ref (iaddr),
- true, NULL_TREE, true, BSI_SAME_STMT);
+
+ initial = force_gimple_operand_gsi (&si, build_fold_indirect_ref (iaddr),
+ true, NULL_TREE, true, GSI_SAME_STMT);
/* Move the value to the LOADEDI temporary. */
if (gimple_in_ssa_p (cfun))
{
- gcc_assert (phi_nodes (loop_header) == NULL_TREE);
+ gcc_assert (gimple_seq_empty_p (phi_nodes (loop_header)));
phi = create_phi_node (loadedi, loop_header);
SSA_NAME_DEF_STMT (loadedi) = phi;
SET_USE (PHI_ARG_DEF_PTR_FROM_EDGE (phi, single_succ_edge (load_bb)),
initial);
}
else
- bsi_insert_before (&bsi,
- build_gimple_modify_stmt (loadedi, initial),
- BSI_SAME_STMT);
+ gsi_insert_before (&si,
+ gimple_build_assign (loadedi, initial),
+ GSI_SAME_STMT);
if (loadedi != loaded_val)
{
- block_stmt_iterator bsi2;
+ gimple_stmt_iterator gsi2;
+ tree x;
x = build1 (VIEW_CONVERT_EXPR, type, loadedi);
- bsi2 = bsi_start (loop_header);
+ gsi2 = gsi_start_bb (loop_header);
if (gimple_in_ssa_p (cfun))
{
- x = force_gimple_operand_bsi (&bsi2, x, true, NULL_TREE,
- true, BSI_SAME_STMT);
- x = build_gimple_modify_stmt (loaded_val, x);
- bsi_insert_before (&bsi2, x, BSI_SAME_STMT);
- SSA_NAME_DEF_STMT (loaded_val) = x;
+ gimple stmt;
+ x = force_gimple_operand_gsi (&gsi2, x, true, NULL_TREE,
+ true, GSI_SAME_STMT);
+ stmt = gimple_build_assign (loaded_val, x);
+ gsi_insert_before (&gsi2, stmt, GSI_SAME_STMT);
}
else
{
- x = build_gimple_modify_stmt (loaded_val, x);
- force_gimple_operand_bsi (&bsi2, x, true, NULL_TREE,
- true, BSI_SAME_STMT);
+ x = build2 (MODIFY_EXPR, TREE_TYPE (loaded_val), loaded_val, x);
+ force_gimple_operand_gsi (&gsi2, x, true, NULL_TREE,
+ true, GSI_SAME_STMT);
}
}
- bsi_remove (&bsi, true);
+ gsi_remove (&si, true);
- bsi = bsi_last (store_bb);
- gcc_assert (TREE_CODE (bsi_stmt (bsi)) == OMP_ATOMIC_STORE);
+ si = gsi_last_bb (store_bb);
+ gcc_assert (gimple_code (gsi_stmt (si)) == GIMPLE_OMP_ATOMIC_STORE);
if (iaddr == addr)
storedi = stored_val;
else
storedi =
- force_gimple_operand_bsi (&bsi,
+ force_gimple_operand_gsi (&si,
build1 (VIEW_CONVERT_EXPR, itype,
stored_val), true, NULL_TREE, true,
- BSI_SAME_STMT);
+ GSI_SAME_STMT);
/* Build the compare&swap statement. */
new_storedi = build_call_expr (cmpxchg, 3, iaddr, loadedi, storedi);
- new_storedi = force_gimple_operand_bsi (&bsi,
+ new_storedi = force_gimple_operand_gsi (&si,
fold_convert (itype, new_storedi),
true, NULL_TREE,
- true, BSI_SAME_STMT);
+ true, GSI_SAME_STMT);
if (gimple_in_ssa_p (cfun))
old_vali = loadedi;
@@ -4882,21 +5008,20 @@ expand_omp_atomic_pipeline (basic_block load_bb, basic_block store_bb,
old_vali = create_tmp_var (itype, NULL);
if (gimple_in_ssa_p (cfun))
add_referenced_var (old_vali);
- x = build_gimple_modify_stmt (old_vali, loadedi);
- force_gimple_operand_bsi (&bsi, x, true, NULL_TREE,
- true, BSI_SAME_STMT);
+ stmt = gimple_build_assign (old_vali, loadedi);
+ gsi_insert_before (&si, stmt, GSI_SAME_STMT);
- x = build_gimple_modify_stmt (loadedi, new_storedi);
- force_gimple_operand_bsi (&bsi, x, true, NULL_TREE,
- true, BSI_SAME_STMT);
+ stmt = gimple_build_assign (loadedi, new_storedi);
+ gsi_insert_before (&si, stmt, GSI_SAME_STMT);
}
/* Note that we always perform the comparison as an integer, even for
floating point. This allows the atomic operation to properly
succeed even with NaNs and -0.0. */
- x = build2 (NE_EXPR, boolean_type_node, new_storedi, old_vali);
- x = build3 (COND_EXPR, void_type_node, x, NULL_TREE, NULL_TREE);
- bsi_insert_before (&bsi, x, BSI_SAME_STMT);
+ stmt = gimple_build_cond_empty
+ (build2 (NE_EXPR, boolean_type_node,
+ new_storedi, old_vali));
+ gsi_insert_before (&si, stmt, GSI_SAME_STMT);
/* Update cfg. */
e = single_succ_edge (store_bb);
@@ -4909,12 +5034,12 @@ expand_omp_atomic_pipeline (basic_block load_bb, basic_block store_bb,
if we are not in SSA). */
if (gimple_in_ssa_p (cfun))
{
- phi = phi_nodes (loop_header);
+ phi = gimple_seq_first_stmt (phi_nodes (loop_header));
SET_USE (PHI_ARG_DEF_PTR_FROM_EDGE (phi, e), new_storedi);
}
- /* Remove OMP_ATOMIC_STORE. */
- bsi_remove (&bsi, true);
+ /* Remove GIMPLE_OMP_ATOMIC_STORE. */
+ gsi_remove (&si, true);
if (gimple_in_ssa_p (cfun))
update_ssa (TODO_update_ssa_no_phi);
@@ -4933,15 +5058,16 @@ expand_omp_atomic_pipeline (basic_block load_bb, basic_block store_bb,
responses received from omp@openmp.org, appears to be within spec.
Which makes sense, since that's how several other compilers handle
this situation as well.
- LOADED_VAL and ADDR are the operands of OMP_ATOMIC_LOAD we're expanding.
- STORED_VAL is the operand of the matching OMP_ATOMIC_STORE.
+ LOADED_VAL and ADDR are the operands of GIMPLE_OMP_ATOMIC_LOAD we're
+ expanding. STORED_VAL is the operand of the matching
+ GIMPLE_OMP_ATOMIC_STORE.
We replace
- OMP_ATOMIC_LOAD (loaded_val, addr) with
+ GIMPLE_OMP_ATOMIC_LOAD (loaded_val, addr) with
loaded_val = *addr;
and replace
- OMP_ATOMIC_ATORE (stored_val) with
+ GIMPLE_OMP_ATOMIC_ATORE (stored_val) with
*addr = stored_val;
*/
@@ -4949,40 +5075,39 @@ static bool
expand_omp_atomic_mutex (basic_block load_bb, basic_block store_bb,
tree addr, tree loaded_val, tree stored_val)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator si;
+ gimple stmt;
tree t;
- bsi = bsi_last (load_bb);
- gcc_assert (TREE_CODE (bsi_stmt (bsi)) == OMP_ATOMIC_LOAD);
+ si = gsi_last_bb (load_bb);
+ gcc_assert (gimple_code (gsi_stmt (si)) == GIMPLE_OMP_ATOMIC_LOAD);
t = built_in_decls[BUILT_IN_GOMP_ATOMIC_START];
t = build_function_call_expr (t, 0);
- force_gimple_operand_bsi (&bsi, t, true, NULL_TREE, true, BSI_SAME_STMT);
+ force_gimple_operand_gsi (&si, t, true, NULL_TREE, true, GSI_SAME_STMT);
- t = build_gimple_modify_stmt (loaded_val, build_fold_indirect_ref (addr));
- if (gimple_in_ssa_p (cfun))
- SSA_NAME_DEF_STMT (loaded_val) = t;
- bsi_insert_before (&bsi, t, BSI_SAME_STMT);
- bsi_remove (&bsi, true);
+ stmt = gimple_build_assign (loaded_val, build_fold_indirect_ref (addr));
+ gsi_insert_before (&si, stmt, GSI_SAME_STMT);
+ gsi_remove (&si, true);
- bsi = bsi_last (store_bb);
- gcc_assert (TREE_CODE (bsi_stmt (bsi)) == OMP_ATOMIC_STORE);
+ si = gsi_last_bb (store_bb);
+ gcc_assert (gimple_code (gsi_stmt (si)) == GIMPLE_OMP_ATOMIC_STORE);
- t = build_gimple_modify_stmt (build_fold_indirect_ref (unshare_expr (addr)),
+ stmt = gimple_build_assign (build_fold_indirect_ref (unshare_expr (addr)),
stored_val);
- bsi_insert_before (&bsi, t, BSI_SAME_STMT);
+ gsi_insert_before (&si, stmt, GSI_SAME_STMT);
t = built_in_decls[BUILT_IN_GOMP_ATOMIC_END];
t = build_function_call_expr (t, 0);
- force_gimple_operand_bsi (&bsi, t, true, NULL_TREE, true, BSI_SAME_STMT);
- bsi_remove (&bsi, true);
+ force_gimple_operand_gsi (&si, t, true, NULL_TREE, true, GSI_SAME_STMT);
+ gsi_remove (&si, true);
if (gimple_in_ssa_p (cfun))
update_ssa (TODO_update_ssa_no_phi);
return true;
}
-/* Expand an OMP_ATOMIC statement. We try to expand
+/* Expand an GIMPLE_OMP_ATOMIC statement. We try to expand
using expand_omp_atomic_fetch_op. If it failed, we try to
call expand_omp_atomic_pipeline, and if it fails too, the
ultimate fallback is wrapping the operation in a mutex
@@ -4993,10 +5118,10 @@ static void
expand_omp_atomic (struct omp_region *region)
{
basic_block load_bb = region->entry, store_bb = region->exit;
- tree load = last_stmt (load_bb), store = last_stmt (store_bb);
- tree loaded_val = TREE_OPERAND (load, 0);
- tree addr = TREE_OPERAND (load, 1);
- tree stored_val = TREE_OPERAND (store, 0);
+ gimple load = last_stmt (load_bb), store = last_stmt (store_bb);
+ tree loaded_val = gimple_omp_atomic_load_lhs (load);
+ tree addr = gimple_omp_atomic_load_rhs (load);
+ tree stored_val = gimple_omp_atomic_store_val (store);
tree type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (addr)));
HOST_WIDE_INT index;
@@ -5035,7 +5160,7 @@ expand_omp_atomic (struct omp_region *region)
/* Expand the parallel region tree rooted at REGION. Expansion
proceeds in depth-first order. Innermost regions are expanded
first. This way, parallel regions that require a new function to
- be created (e.g., OMP_PARALLEL) can be expanded without having any
+ be created (e.g., GIMPLE_OMP_PARALLEL) can be expanded without having any
internal dependencies in their body. */
static void
@@ -5047,50 +5172,47 @@ expand_omp (struct omp_region *region)
/* First, determine whether this is a combined parallel+workshare
region. */
- if (region->type == OMP_PARALLEL)
+ if (region->type == GIMPLE_OMP_PARALLEL)
determine_parallel_type (region);
if (region->inner)
expand_omp (region->inner);
saved_location = input_location;
- if (EXPR_HAS_LOCATION (last_stmt (region->entry)))
- input_location = EXPR_LOCATION (last_stmt (region->entry));
+ if (gimple_has_location (last_stmt (region->entry)))
+ input_location = gimple_location (last_stmt (region->entry));
switch (region->type)
{
- case OMP_PARALLEL:
+ case GIMPLE_OMP_PARALLEL:
+ case GIMPLE_OMP_TASK:
expand_omp_taskreg (region);
break;
- case OMP_TASK:
- expand_omp_taskreg (region);
- break;
-
- case OMP_FOR:
+ case GIMPLE_OMP_FOR:
expand_omp_for (region);
break;
- case OMP_SECTIONS:
+ case GIMPLE_OMP_SECTIONS:
expand_omp_sections (region);
break;
- case OMP_SECTION:
+ case GIMPLE_OMP_SECTION:
/* Individual omp sections are handled together with their
- parent OMP_SECTIONS region. */
+ parent GIMPLE_OMP_SECTIONS region. */
break;
- case OMP_SINGLE:
+ case GIMPLE_OMP_SINGLE:
expand_omp_single (region);
break;
- case OMP_MASTER:
- case OMP_ORDERED:
- case OMP_CRITICAL:
+ case GIMPLE_OMP_MASTER:
+ case GIMPLE_OMP_ORDERED:
+ case GIMPLE_OMP_CRITICAL:
expand_omp_synch (region);
break;
- case OMP_ATOMIC_LOAD:
+ case GIMPLE_OMP_ATOMIC_LOAD:
expand_omp_atomic (region);
break;
@@ -5113,19 +5235,19 @@ static void
build_omp_regions_1 (basic_block bb, struct omp_region *parent,
bool single_tree)
{
- block_stmt_iterator si;
- tree stmt;
+ gimple_stmt_iterator gsi;
+ gimple stmt;
basic_block son;
- si = bsi_last (bb);
- if (!bsi_end_p (si) && OMP_DIRECTIVE_P (bsi_stmt (si)))
+ gsi = gsi_last_bb (bb);
+ if (!gsi_end_p (gsi) && is_gimple_omp (gsi_stmt (gsi)))
{
struct omp_region *region;
- enum tree_code code;
+ enum gimple_code code;
- stmt = bsi_stmt (si);
- code = TREE_CODE (stmt);
- if (code == OMP_RETURN)
+ stmt = gsi_stmt (gsi);
+ code = gimple_code (stmt);
+ if (code == GIMPLE_OMP_RETURN)
{
/* STMT is the return point out of region PARENT. Mark it
as the exit point and make PARENT the immediately
@@ -5135,26 +5257,28 @@ build_omp_regions_1 (basic_block bb, struct omp_region *parent,
region->exit = bb;
parent = parent->outer;
}
- else if (code == OMP_ATOMIC_STORE)
+ else if (code == GIMPLE_OMP_ATOMIC_STORE)
{
- /* OMP_ATOMIC_STORE is analogous to OMP_RETURN, but matches with
- OMP_ATOMIC_LOAD. */
+ /* GIMPLE_OMP_ATOMIC_STORE is analoguous to
+ GIMPLE_OMP_RETURN, but matches with
+ GIMPLE_OMP_ATOMIC_LOAD. */
gcc_assert (parent);
- gcc_assert (parent->type == OMP_ATOMIC_LOAD);
+ gcc_assert (parent->type == GIMPLE_OMP_ATOMIC_LOAD);
region = parent;
region->exit = bb;
parent = parent->outer;
}
- else if (code == OMP_CONTINUE)
+ else if (code == GIMPLE_OMP_CONTINUE)
{
gcc_assert (parent);
parent->cont = bb;
}
- else if (code == OMP_SECTIONS_SWITCH)
+ else if (code == GIMPLE_OMP_SECTIONS_SWITCH)
{
- /* OMP_SECTIONS_SWITCH is part of OMP_SECTIONS, and we do nothing for
- it. */ ;
+ /* GIMPLE_OMP_SECTIONS_SWITCH is part of
+ GIMPLE_OMP_SECTIONS, and we do nothing for it. */
+ ;
}
else
{
@@ -5215,7 +5339,6 @@ build_omp_regions (void)
build_omp_regions_1 (ENTRY_BLOCK_PTR, NULL, false);
}
-
/* Main entry point for expanding OMP-GIMPLE into runtime calls. */
static unsigned int
@@ -5273,107 +5396,106 @@ struct gimple_opt_pass pass_expand_omp =
/* Routines to lower OpenMP directives into OMP-GIMPLE. */
-/* Lower the OpenMP sections directive in *STMT_P. */
+/* Lower the OpenMP sections directive in the current statement in GSI_P.
+ CTX is the enclosing OMP context for the current statement. */
static void
-lower_omp_sections (tree *stmt_p, omp_context *ctx)
+lower_omp_sections (gimple_stmt_iterator *gsi_p, omp_context *ctx)
{
- tree new_stmt, stmt, body, bind, block, ilist, olist, new_body, control;
- tree t, dlist;
- tree_stmt_iterator tsi;
+ tree block, control;
+ gimple_stmt_iterator tgsi;
unsigned i, len;
+ gimple stmt, new_stmt, bind, t;
+ gimple_seq ilist, dlist, olist, new_body, body;
struct gimplify_ctx gctx;
- stmt = *stmt_p;
+ stmt = gsi_stmt (*gsi_p);
push_gimplify_context (&gctx);
dlist = NULL;
ilist = NULL;
- lower_rec_input_clauses (OMP_SECTIONS_CLAUSES (stmt), &ilist, &dlist, ctx);
+ lower_rec_input_clauses (gimple_omp_sections_clauses (stmt),
+ &ilist, &dlist, ctx);
- tsi = tsi_start (OMP_SECTIONS_BODY (stmt));
- for (len = 0; !tsi_end_p (tsi); len++, tsi_next (&tsi))
+ tgsi = gsi_start (gimple_omp_body (stmt));
+ for (len = 0; !gsi_end_p (tgsi); len++, gsi_next (&tgsi))
continue;
- tsi = tsi_start (OMP_SECTIONS_BODY (stmt));
- body = alloc_stmt_list ();
- for (i = 0; i < len; i++, tsi_next (&tsi))
+ tgsi = gsi_start (gimple_omp_body (stmt));
+ body = NULL;
+ for (i = 0; i < len; i++, gsi_next (&tgsi))
{
omp_context *sctx;
- tree sec_start, sec_end;
+ gimple sec_start;
- sec_start = tsi_stmt (tsi);
+ sec_start = gsi_stmt (tgsi);
sctx = maybe_lookup_ctx (sec_start);
gcc_assert (sctx);
- append_to_statement_list (sec_start, &body);
+ gimple_seq_add_stmt (&body, sec_start);
- lower_omp (&OMP_SECTION_BODY (sec_start), sctx);
- append_to_statement_list (OMP_SECTION_BODY (sec_start), &body);
- OMP_SECTION_BODY (sec_start) = NULL;
+ lower_omp (gimple_omp_body (sec_start), sctx);
+ gimple_seq_add_seq (&body, gimple_omp_body (sec_start));
+ gimple_omp_set_body (sec_start, NULL);
if (i == len - 1)
{
- tree l = alloc_stmt_list ();
- lower_lastprivate_clauses (OMP_SECTIONS_CLAUSES (stmt), NULL,
+ gimple_seq l = NULL;
+ lower_lastprivate_clauses (gimple_omp_sections_clauses (stmt), NULL,
&l, ctx);
- append_to_statement_list (l, &body);
- OMP_SECTION_LAST (sec_start) = 1;
+ gimple_seq_add_seq (&body, l);
+ gimple_omp_section_set_last (sec_start);
}
- sec_end = make_node (OMP_RETURN);
- append_to_statement_list (sec_end, &body);
+ gimple_seq_add_stmt (&body, gimple_build_omp_return (false));
}
block = make_node (BLOCK);
- bind = build3 (BIND_EXPR, void_type_node, NULL, body, block);
+ bind = gimple_build_bind (NULL, body, block);
- olist = NULL_TREE;
- lower_reduction_clauses (OMP_SECTIONS_CLAUSES (stmt), &olist, ctx);
+ olist = NULL;
+ lower_reduction_clauses (gimple_omp_sections_clauses (stmt), &olist, ctx);
block = make_node (BLOCK);
- new_stmt = build3 (BIND_EXPR, void_type_node, NULL, NULL, block);
- TREE_SIDE_EFFECTS (new_stmt) = 1;
+ new_stmt = gimple_build_bind (NULL, NULL, block);
pop_gimplify_context (new_stmt);
-
- BIND_EXPR_VARS (new_stmt)
- = chainon (BIND_EXPR_VARS (new_stmt), ctx->block_vars);
- BLOCK_VARS (block) = BIND_EXPR_VARS (new_stmt);
+ gimple_bind_append_vars (new_stmt, ctx->block_vars);
+ BLOCK_VARS (block) = gimple_bind_vars (bind);
if (BLOCK_VARS (block))
TREE_USED (block) = 1;
- new_body = alloc_stmt_list ();
- append_to_statement_list (ilist, &new_body);
- append_to_statement_list (stmt, &new_body);
- append_to_statement_list (make_node (OMP_SECTIONS_SWITCH), &new_body);
- append_to_statement_list (bind, &new_body);
+ new_body = NULL;
+ gimple_seq_add_seq (&new_body, ilist);
+ gimple_seq_add_stmt (&new_body, stmt);
+ gimple_seq_add_stmt (&new_body, gimple_build_omp_sections_switch ());
+ gimple_seq_add_stmt (&new_body, bind);
control = create_tmp_var (unsigned_type_node, ".section");
- t = build2 (OMP_CONTINUE, void_type_node, control, control);
- OMP_SECTIONS_CONTROL (stmt) = control;
- append_to_statement_list (t, &new_body);
+ t = gimple_build_omp_continue (control, control);
+ gimple_omp_sections_set_control (stmt, control);
+ gimple_seq_add_stmt (&new_body, t);
- append_to_statement_list (olist, &new_body);
- append_to_statement_list (dlist, &new_body);
+ gimple_seq_add_seq (&new_body, olist);
+ gimple_seq_add_seq (&new_body, dlist);
- maybe_catch_exception (&new_body);
+ new_body = maybe_catch_exception (new_body);
- t = make_node (OMP_RETURN);
- OMP_RETURN_NOWAIT (t) = !!find_omp_clause (OMP_SECTIONS_CLAUSES (stmt),
- OMP_CLAUSE_NOWAIT);
- append_to_statement_list (t, &new_body);
+ t = gimple_build_omp_return
+ (!!find_omp_clause (gimple_omp_sections_clauses (stmt),
+ OMP_CLAUSE_NOWAIT));
+ gimple_seq_add_stmt (&new_body, t);
- BIND_EXPR_BODY (new_stmt) = new_body;
- OMP_SECTIONS_BODY (stmt) = NULL;
+ gimple_bind_set_body (new_stmt, new_body);
+ gimple_omp_set_body (stmt, NULL);
- *stmt_p = new_stmt;
+ gsi_replace (gsi_p, new_stmt, true);
}
/* A subroutine of lower_omp_single. Expand the simple form of
- an OMP_SINGLE, without a copyprivate clause:
+ a GIMPLE_OMP_SINGLE, without a copyprivate clause:
if (GOMP_single_start ())
BODY;
@@ -5384,22 +5506,31 @@ lower_omp_sections (tree *stmt_p, omp_context *ctx)
to a synchronization analysis pass. */
static void
-lower_omp_single_simple (tree single_stmt, tree *pre_p)
+lower_omp_single_simple (gimple single_stmt, gimple_seq *pre_p)
{
- tree t;
-
- t = build_call_expr (built_in_decls[BUILT_IN_GOMP_SINGLE_START], 0);
- if (TREE_TYPE (t) != boolean_type_node)
- t = fold_build2 (NE_EXPR, boolean_type_node,
- t, build_int_cst (TREE_TYPE (t), 0));
- t = build3 (COND_EXPR, void_type_node, t,
- OMP_SINGLE_BODY (single_stmt), NULL);
- gimplify_and_add (t, pre_p);
+ tree tlabel = create_artificial_label ();
+ tree flabel = create_artificial_label ();
+ gimple call, cond;
+ tree lhs, decl;
+
+ decl = built_in_decls[BUILT_IN_GOMP_SINGLE_START];
+ lhs = create_tmp_var (TREE_TYPE (TREE_TYPE (decl)), NULL);
+ call = gimple_build_call (decl, 0);
+ gimple_call_set_lhs (call, lhs);
+ gimple_seq_add_stmt (pre_p, call);
+
+ cond = gimple_build_cond (EQ_EXPR, lhs,
+ fold_convert (TREE_TYPE (lhs), boolean_true_node),
+ tlabel, flabel);
+ gimple_seq_add_stmt (pre_p, cond);
+ gimple_seq_add_stmt (pre_p, gimple_build_label (tlabel));
+ gimple_seq_add_seq (pre_p, gimple_omp_body (single_stmt));
+ gimple_seq_add_stmt (pre_p, gimple_build_label (flabel));
}
/* A subroutine of lower_omp_single. Expand the simple form of
- an OMP_SINGLE, with a copyprivate clause:
+ a GIMPLE_OMP_SINGLE, with a copyprivate clause:
#pragma omp single copyprivate (a, b, c)
@@ -5428,9 +5559,10 @@ lower_omp_single_simple (tree single_stmt, tree *pre_p)
to a synchronization analysis pass. */
static void
-lower_omp_single_copy (tree single_stmt, tree *pre_p, omp_context *ctx)
+lower_omp_single_copy (gimple single_stmt, gimple_seq *pre_p, omp_context *ctx)
{
- tree ptr_type, t, l0, l1, l2, copyin_seq;
+ tree ptr_type, t, l0, l1, l2;
+ gimple_seq copyin_seq;
ctx->sender_decl = create_tmp_var (ctx->record_type, ".omp_copy_o");
@@ -5443,8 +5575,7 @@ lower_omp_single_copy (tree single_stmt, tree *pre_p, omp_context *ctx)
t = build_call_expr (built_in_decls[BUILT_IN_GOMP_SINGLE_COPY_START], 0);
t = fold_convert (ptr_type, t);
- t = build_gimple_modify_stmt (ctx->receiver_decl, t);
- gimplify_and_add (t, pre_p);
+ gimplify_assign (ctx->receiver_decl, t, pre_p);
t = build2 (EQ_EXPR, boolean_type_node, ctx->receiver_decl,
build_int_cst (ptr_type, 0));
@@ -5452,13 +5583,12 @@ lower_omp_single_copy (tree single_stmt, tree *pre_p, omp_context *ctx)
build_and_jump (&l0), build_and_jump (&l1));
gimplify_and_add (t, pre_p);
- t = build1 (LABEL_EXPR, void_type_node, l0);
- gimplify_and_add (t, pre_p);
+ gimple_seq_add_stmt (pre_p, gimple_build_label (l0));
- append_to_statement_list (OMP_SINGLE_BODY (single_stmt), pre_p);
+ gimple_seq_add_seq (pre_p, gimple_omp_body (single_stmt));
copyin_seq = NULL;
- lower_copyprivate_clauses (OMP_SINGLE_CLAUSES (single_stmt), pre_p,
+ lower_copyprivate_clauses (gimple_omp_single_clauses (single_stmt), pre_p,
&copyin_seq, ctx);
t = build_fold_addr_expr (ctx->sender_decl);
@@ -5468,56 +5598,57 @@ lower_omp_single_copy (tree single_stmt, tree *pre_p, omp_context *ctx)
t = build_and_jump (&l2);
gimplify_and_add (t, pre_p);
- t = build1 (LABEL_EXPR, void_type_node, l1);
- gimplify_and_add (t, pre_p);
+ gimple_seq_add_stmt (pre_p, gimple_build_label (l1));
- append_to_statement_list (copyin_seq, pre_p);
+ gimple_seq_add_seq (pre_p, copyin_seq);
- t = build1 (LABEL_EXPR, void_type_node, l2);
- gimplify_and_add (t, pre_p);
+ gimple_seq_add_stmt (pre_p, gimple_build_label (l2));
}
/* Expand code for an OpenMP single directive. */
static void
-lower_omp_single (tree *stmt_p, omp_context *ctx)
+lower_omp_single (gimple_stmt_iterator *gsi_p, omp_context *ctx)
{
- tree t, bind, block, single_stmt = *stmt_p, dlist;
+ tree block;
+ gimple t, bind, single_stmt = gsi_stmt (*gsi_p);
+ gimple_seq bind_body, dlist;
struct gimplify_ctx gctx;
push_gimplify_context (&gctx);
- block = make_node (BLOCK);
- *stmt_p = bind = build3 (BIND_EXPR, void_type_node, NULL, NULL, block);
- TREE_SIDE_EFFECTS (bind) = 1;
+ bind_body = NULL;
+ lower_rec_input_clauses (gimple_omp_single_clauses (single_stmt),
+ &bind_body, &dlist, ctx);
+ lower_omp (gimple_omp_body (single_stmt), ctx);
- lower_rec_input_clauses (OMP_SINGLE_CLAUSES (single_stmt),
- &BIND_EXPR_BODY (bind), &dlist, ctx);
- lower_omp (&OMP_SINGLE_BODY (single_stmt), ctx);
-
- append_to_statement_list (single_stmt, &BIND_EXPR_BODY (bind));
+ gimple_seq_add_stmt (&bind_body, single_stmt);
if (ctx->record_type)
- lower_omp_single_copy (single_stmt, &BIND_EXPR_BODY (bind), ctx);
+ lower_omp_single_copy (single_stmt, &bind_body, ctx);
else
- lower_omp_single_simple (single_stmt, &BIND_EXPR_BODY (bind));
+ lower_omp_single_simple (single_stmt, &bind_body);
+
+ gimple_omp_set_body (single_stmt, NULL);
- OMP_SINGLE_BODY (single_stmt) = NULL;
+ gimple_seq_add_seq (&bind_body, dlist);
- append_to_statement_list (dlist, &BIND_EXPR_BODY (bind));
+ bind_body = maybe_catch_exception (bind_body);
- maybe_catch_exception (&BIND_EXPR_BODY (bind));
+ t = gimple_build_omp_return
+ (!!find_omp_clause (gimple_omp_single_clauses (single_stmt),
+ OMP_CLAUSE_NOWAIT));
+ gimple_seq_add_stmt (&bind_body, t);
- t = make_node (OMP_RETURN);
- OMP_RETURN_NOWAIT (t) = !!find_omp_clause (OMP_SINGLE_CLAUSES (single_stmt),
- OMP_CLAUSE_NOWAIT);
- append_to_statement_list (t, &BIND_EXPR_BODY (bind));
+ block = make_node (BLOCK);
+ bind = gimple_build_bind (NULL, bind_body, block);
pop_gimplify_context (bind);
- BIND_EXPR_VARS (bind) = chainon (BIND_EXPR_VARS (bind), ctx->block_vars);
- BLOCK_VARS (block) = BIND_EXPR_VARS (bind);
+ gimple_bind_append_vars (bind, ctx->block_vars);
+ BLOCK_VARS (block) = ctx->block_vars;
+ gsi_replace (gsi_p, bind, true);
if (BLOCK_VARS (block))
TREE_USED (block) = 1;
}
@@ -5526,82 +5657,80 @@ lower_omp_single (tree *stmt_p, omp_context *ctx)
/* Expand code for an OpenMP master directive. */
static void
-lower_omp_master (tree *stmt_p, omp_context *ctx)
+lower_omp_master (gimple_stmt_iterator *gsi_p, omp_context *ctx)
{
- tree bind, block, stmt = *stmt_p, lab = NULL, x;
+ tree block, lab = NULL, x;
+ gimple stmt = gsi_stmt (*gsi_p), bind;
+ gimple_seq tseq;
struct gimplify_ctx gctx;
push_gimplify_context (&gctx);
block = make_node (BLOCK);
- *stmt_p = bind = build3 (BIND_EXPR, void_type_node, NULL, NULL, block);
- TREE_SIDE_EFFECTS (bind) = 1;
-
- append_to_statement_list (stmt, &BIND_EXPR_BODY (bind));
+ bind = gimple_build_bind (NULL, gimple_seq_alloc_with_stmt (stmt),
+ block);
x = build_call_expr (built_in_decls[BUILT_IN_OMP_GET_THREAD_NUM], 0);
x = build2 (EQ_EXPR, boolean_type_node, x, integer_zero_node);
x = build3 (COND_EXPR, void_type_node, x, NULL, build_and_jump (&lab));
- gimplify_and_add (x, &BIND_EXPR_BODY (bind));
+ tseq = NULL;
+ gimplify_and_add (x, &tseq);
+ gimple_bind_add_seq (bind, tseq);
- lower_omp (&OMP_MASTER_BODY (stmt), ctx);
- maybe_catch_exception (&OMP_MASTER_BODY (stmt));
- append_to_statement_list (OMP_MASTER_BODY (stmt), &BIND_EXPR_BODY (bind));
- OMP_MASTER_BODY (stmt) = NULL;
+ lower_omp (gimple_omp_body (stmt), ctx);
+ gimple_omp_set_body (stmt, maybe_catch_exception (gimple_omp_body (stmt)));
+ gimple_bind_add_seq (bind, gimple_omp_body (stmt));
+ gimple_omp_set_body (stmt, NULL);
- x = build1 (LABEL_EXPR, void_type_node, lab);
- gimplify_and_add (x, &BIND_EXPR_BODY (bind));
+ gimple_bind_add_stmt (bind, gimple_build_label (lab));
- x = make_node (OMP_RETURN);
- OMP_RETURN_NOWAIT (x) = 1;
- append_to_statement_list (x, &BIND_EXPR_BODY (bind));
+ gimple_bind_add_stmt (bind, gimple_build_omp_return (true));
pop_gimplify_context (bind);
- BIND_EXPR_VARS (bind) = chainon (BIND_EXPR_VARS (bind), ctx->block_vars);
- BLOCK_VARS (block) = BIND_EXPR_VARS (bind);
+ gimple_bind_append_vars (bind, ctx->block_vars);
+ BLOCK_VARS (block) = ctx->block_vars;
+ gsi_replace (gsi_p, bind, true);
}
/* Expand code for an OpenMP ordered directive. */
static void
-lower_omp_ordered (tree *stmt_p, omp_context *ctx)
+lower_omp_ordered (gimple_stmt_iterator *gsi_p, omp_context *ctx)
{
- tree bind, block, stmt = *stmt_p, x;
+ tree block;
+ gimple stmt = gsi_stmt (*gsi_p), bind, x;
struct gimplify_ctx gctx;
push_gimplify_context (&gctx);
block = make_node (BLOCK);
- *stmt_p = bind = build3 (BIND_EXPR, void_type_node, NULL, NULL, block);
- TREE_SIDE_EFFECTS (bind) = 1;
-
- append_to_statement_list (stmt, &BIND_EXPR_BODY (bind));
+ bind = gimple_build_bind (NULL, gimple_seq_alloc_with_stmt (stmt),
+ block);
- x = build_call_expr (built_in_decls[BUILT_IN_GOMP_ORDERED_START], 0);
- gimplify_and_add (x, &BIND_EXPR_BODY (bind));
+ x = gimple_build_call (built_in_decls[BUILT_IN_GOMP_ORDERED_START], 0);
+ gimple_bind_add_stmt (bind, x);
- lower_omp (&OMP_ORDERED_BODY (stmt), ctx);
- maybe_catch_exception (&OMP_ORDERED_BODY (stmt));
- append_to_statement_list (OMP_ORDERED_BODY (stmt), &BIND_EXPR_BODY (bind));
- OMP_ORDERED_BODY (stmt) = NULL;
+ lower_omp (gimple_omp_body (stmt), ctx);
+ gimple_omp_set_body (stmt, maybe_catch_exception (gimple_omp_body (stmt)));
+ gimple_bind_add_seq (bind, gimple_omp_body (stmt));
+ gimple_omp_set_body (stmt, NULL);
- x = build_call_expr (built_in_decls[BUILT_IN_GOMP_ORDERED_END], 0);
- gimplify_and_add (x, &BIND_EXPR_BODY (bind));
+ x = gimple_build_call (built_in_decls[BUILT_IN_GOMP_ORDERED_END], 0);
+ gimple_bind_add_stmt (bind, x);
- x = make_node (OMP_RETURN);
- OMP_RETURN_NOWAIT (x) = 1;
- append_to_statement_list (x, &BIND_EXPR_BODY (bind));
+ gimple_bind_add_stmt (bind, gimple_build_omp_return (true));
pop_gimplify_context (bind);
- BIND_EXPR_VARS (bind) = chainon (BIND_EXPR_VARS (bind), ctx->block_vars);
- BLOCK_VARS (block) = BIND_EXPR_VARS (bind);
+ gimple_bind_append_vars (bind, ctx->block_vars);
+ BLOCK_VARS (block) = gimple_bind_vars (bind);
+ gsi_replace (gsi_p, bind, true);
}
-/* Gimplify an OMP_CRITICAL statement. This is a relatively simple
+/* Gimplify a GIMPLE_OMP_CRITICAL statement. This is a relatively simple
substitution of a couple of function calls. But in the NAMED case,
requires that languages coordinate a symbol name. It is therefore
best put here in common code. */
@@ -5610,13 +5739,15 @@ static GTY((param1_is (tree), param2_is (tree)))
splay_tree critical_name_mutexes;
static void
-lower_omp_critical (tree *stmt_p, omp_context *ctx)
+lower_omp_critical (gimple_stmt_iterator *gsi_p, omp_context *ctx)
{
- tree bind, block, stmt = *stmt_p;
- tree t, lock, unlock, name;
+ tree block;
+ tree name, lock, unlock;
+ gimple stmt = gsi_stmt (*gsi_p), bind;
+ gimple_seq tbody;
struct gimplify_ctx gctx;
- name = OMP_CRITICAL_NAME (stmt);
+ name = gimple_omp_critical_name (stmt);
if (name)
{
tree decl;
@@ -5667,27 +5798,27 @@ lower_omp_critical (tree *stmt_p, omp_context *ctx)
push_gimplify_context (&gctx);
block = make_node (BLOCK);
- *stmt_p = bind = build3 (BIND_EXPR, void_type_node, NULL, NULL, block);
- TREE_SIDE_EFFECTS (bind) = 1;
-
- append_to_statement_list (stmt, &BIND_EXPR_BODY (bind));
+ bind = gimple_build_bind (NULL, gimple_seq_alloc_with_stmt (stmt), block);
- gimplify_and_add (lock, &BIND_EXPR_BODY (bind));
+ tbody = gimple_bind_body (bind);
+ gimplify_and_add (lock, &tbody);
+ gimple_bind_set_body (bind, tbody);
- lower_omp (&OMP_CRITICAL_BODY (stmt), ctx);
- maybe_catch_exception (&OMP_CRITICAL_BODY (stmt));
- append_to_statement_list (OMP_CRITICAL_BODY (stmt), &BIND_EXPR_BODY (bind));
- OMP_CRITICAL_BODY (stmt) = NULL;
+ lower_omp (gimple_omp_body (stmt), ctx);
+ gimple_omp_set_body (stmt, maybe_catch_exception (gimple_omp_body (stmt)));
+ gimple_bind_add_seq (bind, gimple_omp_body (stmt));
+ gimple_omp_set_body (stmt, NULL);
- gimplify_and_add (unlock, &BIND_EXPR_BODY (bind));
+ tbody = gimple_bind_body (bind);
+ gimplify_and_add (unlock, &tbody);
+ gimple_bind_set_body (bind, tbody);
- t = make_node (OMP_RETURN);
- OMP_RETURN_NOWAIT (t) = 1;
- append_to_statement_list (t, &BIND_EXPR_BODY (bind));
+ gimple_bind_add_stmt (bind, gimple_build_omp_return (true));
pop_gimplify_context (bind);
- BIND_EXPR_VARS (bind) = chainon (BIND_EXPR_VARS (bind), ctx->block_vars);
- BLOCK_VARS (block) = BIND_EXPR_VARS (bind);
+ gimple_bind_append_vars (bind, ctx->block_vars);
+ BLOCK_VARS (block) = gimple_bind_vars (bind);
+ gsi_replace (gsi_p, bind, true);
}
@@ -5698,11 +5829,12 @@ lower_omp_critical (tree *stmt_p, omp_context *ctx)
*BODY_P. */
static void
-lower_omp_for_lastprivate (struct omp_for_data *fd, tree *body_p,
- tree *dlist, struct omp_context *ctx)
+lower_omp_for_lastprivate (struct omp_for_data *fd, gimple_seq *body_p,
+ gimple_seq *dlist, struct omp_context *ctx)
{
- tree clauses, cond, stmts, vinit, t;
+ tree clauses, cond, vinit;
enum tree_code cond_code;
+ gimple_seq stmts;
cond_code = fd->loop.cond_code;
cond_code = cond_code == LT_EXPR ? GE_EXPR : LE_EXPR;
@@ -5718,12 +5850,12 @@ lower_omp_for_lastprivate (struct omp_for_data *fd, tree *body_p,
cond = build2 (cond_code, boolean_type_node, fd->loop.v, fd->loop.n2);
- clauses = OMP_FOR_CLAUSES (fd->for_stmt);
+ clauses = gimple_omp_for_clauses (fd->for_stmt);
stmts = NULL;
lower_lastprivate_clauses (clauses, cond, &stmts, ctx);
- if (stmts != NULL)
+ if (!gimple_seq_empty_p (stmts))
{
- append_to_statement_list (*dlist, &stmts);
+ gimple_seq_add_seq (&stmts, *dlist);
*dlist = stmts;
/* Optimize: v = 0; is usually cheaper than v = some_other_constant. */
@@ -5735,8 +5867,7 @@ lower_omp_for_lastprivate (struct omp_for_data *fd, tree *body_p,
/* Initialize the iterator variable, so that threads that don't execute
any iterations don't execute the lastprivate clauses by accident. */
- t = build_gimple_modify_stmt (fd->loop.v, vinit);
- gimplify_and_add (t, body_p);
+ gimplify_assign (fd->loop.v, vinit, body_p);
}
}
@@ -5744,37 +5875,39 @@ lower_omp_for_lastprivate (struct omp_for_data *fd, tree *body_p,
/* Lower code for an OpenMP loop directive. */
static void
-lower_omp_for (tree *stmt_p, omp_context *ctx)
+lower_omp_for (gimple_stmt_iterator *gsi_p, omp_context *ctx)
{
- tree t, stmt, ilist, dlist, new_stmt, block, *body_p, *rhs_p;
+ tree *rhs_p, block;
struct omp_for_data fd;
- int i;
+ gimple stmt = gsi_stmt (*gsi_p), new_stmt;
+ gimple_seq omp_for_body, body, dlist, ilist;
+ size_t i;
struct gimplify_ctx gctx;
- stmt = *stmt_p;
-
push_gimplify_context (&gctx);
- lower_omp (&OMP_FOR_PRE_BODY (stmt), ctx);
- lower_omp (&OMP_FOR_BODY (stmt), ctx);
+ lower_omp (gimple_omp_for_pre_body (stmt), ctx);
+ lower_omp (gimple_omp_body (stmt), ctx);
block = make_node (BLOCK);
- new_stmt = build3 (BIND_EXPR, void_type_node, NULL, NULL, block);
- TREE_SIDE_EFFECTS (new_stmt) = 1;
- body_p = &BIND_EXPR_BODY (new_stmt);
+ new_stmt = gimple_build_bind (NULL, NULL, block);
/* Move declaration of temporaries in the loop body before we make
it go away. */
- if (TREE_CODE (OMP_FOR_BODY (stmt)) == BIND_EXPR)
- BIND_EXPR_VARS (new_stmt)
- = chainon (BIND_EXPR_VARS (new_stmt),
- BIND_EXPR_VARS (OMP_FOR_BODY (stmt)));
+ omp_for_body = gimple_omp_body (stmt);
+ if (!gimple_seq_empty_p (omp_for_body)
+ && gimple_code (gimple_seq_first_stmt (omp_for_body)) == GIMPLE_BIND)
+ {
+ tree vars = gimple_bind_vars (gimple_seq_first_stmt (omp_for_body));
+ gimple_bind_append_vars (new_stmt, vars);
+ }
- /* The pre-body and input clauses go before the lowered OMP_FOR. */
+ /* The pre-body and input clauses go before the lowered GIMPLE_OMP_FOR. */
ilist = NULL;
dlist = NULL;
- lower_rec_input_clauses (OMP_FOR_CLAUSES (stmt), body_p, &dlist, ctx);
- append_to_statement_list (OMP_FOR_PRE_BODY (stmt), body_p);
+ body = NULL;
+ lower_rec_input_clauses (gimple_omp_for_clauses (stmt), &body, &dlist, ctx);
+ gimple_seq_add_seq (&body, gimple_omp_for_pre_body (stmt));
/* Lower the header expressions. At this point, we can assume that
the header is of the form:
@@ -5783,71 +5916,72 @@ lower_omp_for (tree *stmt_p, omp_context *ctx)
We just need to make sure that VAL1, VAL2 and VAL3 are lowered
using the .omp_data_s mapping, if needed. */
- for (i = 0; i < TREE_VEC_LENGTH (OMP_FOR_INIT (stmt)); i++)
+ for (i = 0; i < gimple_omp_for_collapse (stmt); i++)
{
- rhs_p = &GIMPLE_STMT_OPERAND (TREE_VEC_ELT (OMP_FOR_INIT (stmt), i), 1);
+ rhs_p = gimple_omp_for_initial_ptr (stmt, i);
if (!is_gimple_min_invariant (*rhs_p))
- *rhs_p = get_formal_tmp_var (*rhs_p, body_p);
+ *rhs_p = get_formal_tmp_var (*rhs_p, &body);
- rhs_p = &TREE_OPERAND (TREE_VEC_ELT (OMP_FOR_COND (stmt), i), 1);
+ rhs_p = gimple_omp_for_final_ptr (stmt, i);
if (!is_gimple_min_invariant (*rhs_p))
- *rhs_p = get_formal_tmp_var (*rhs_p, body_p);
+ *rhs_p = get_formal_tmp_var (*rhs_p, &body);
- rhs_p = &TREE_OPERAND (GIMPLE_STMT_OPERAND
- (TREE_VEC_ELT (OMP_FOR_INCR (stmt), i), 1), 1);
+ rhs_p = &TREE_OPERAND (gimple_omp_for_incr (stmt, i), 1);
if (!is_gimple_min_invariant (*rhs_p))
- *rhs_p = get_formal_tmp_var (*rhs_p, body_p);
+ *rhs_p = get_formal_tmp_var (*rhs_p, &body);
}
/* Once lowered, extract the bounds and clauses. */
extract_omp_for_data (stmt, &fd, NULL);
- lower_omp_for_lastprivate (&fd, body_p, &dlist, ctx);
-
- append_to_statement_list (stmt, body_p);
+ lower_omp_for_lastprivate (&fd, &body, &dlist, ctx);
- append_to_statement_list (OMP_FOR_BODY (stmt), body_p);
+ gimple_seq_add_stmt (&body, stmt);
+ gimple_seq_add_seq (&body, gimple_omp_body (stmt));
- t = build2 (OMP_CONTINUE, void_type_node, fd.loop.v, fd.loop.v);
- append_to_statement_list (t, body_p);
+ gimple_seq_add_stmt (&body, gimple_build_omp_continue (fd.loop.v,
+ fd.loop.v));
/* After the loop, add exit clauses. */
- lower_reduction_clauses (OMP_FOR_CLAUSES (stmt), body_p, ctx);
- append_to_statement_list (dlist, body_p);
+ lower_reduction_clauses (gimple_omp_for_clauses (stmt), &body, ctx);
+ gimple_seq_add_seq (&body, dlist);
- maybe_catch_exception (body_p);
+ body = maybe_catch_exception (body);
/* Region exit marker goes at the end of the loop body. */
- t = make_node (OMP_RETURN);
- OMP_RETURN_NOWAIT (t) = fd.have_nowait;
- append_to_statement_list (t, body_p);
+ gimple_seq_add_stmt (&body, gimple_build_omp_return (fd.have_nowait));
pop_gimplify_context (new_stmt);
- BIND_EXPR_VARS (new_stmt)
- = chainon (BIND_EXPR_VARS (new_stmt), ctx->block_vars);
- BLOCK_VARS (block) = BIND_EXPR_VARS (new_stmt);
+
+ gimple_bind_append_vars (new_stmt, ctx->block_vars);
+ BLOCK_VARS (block) = gimple_bind_vars (new_stmt);
if (BLOCK_VARS (block))
TREE_USED (block) = 1;
- OMP_FOR_BODY (stmt) = NULL_TREE;
- OMP_FOR_PRE_BODY (stmt) = NULL_TREE;
- *stmt_p = new_stmt;
+ gimple_bind_set_body (new_stmt, body);
+ gimple_omp_set_body (stmt, NULL);
+ gimple_omp_for_set_pre_body (stmt, NULL);
+ gsi_replace (gsi_p, new_stmt, true);
}
-/* Callback for walk_stmts. Check if *TP only contains OMP_FOR
- or OMP_PARALLEL. */
+/* Callback for walk_stmts. Check if the current statement only contains
+ GIMPLE_OMP_FOR or GIMPLE_OMP_PARALLEL. */
static tree
-check_combined_parallel (tree *tp, int *walk_subtrees, void *data)
+check_combined_parallel (gimple_stmt_iterator *gsi_p,
+ bool *handled_ops_p,
+ struct walk_stmt_info *wi)
{
- struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
int *info = (int *) wi->info;
+ gimple stmt = gsi_stmt (*gsi_p);
- *walk_subtrees = 0;
- switch (TREE_CODE (*tp))
+ *handled_ops_p = true;
+ switch (gimple_code (stmt))
{
- case OMP_FOR:
- case OMP_SECTIONS:
+ WALK_SUBSTMTS;
+
+ case GIMPLE_OMP_FOR:
+ case GIMPLE_OMP_SECTIONS:
*info = *info == 0 ? 1 : -1;
break;
default:
@@ -5894,9 +6028,10 @@ task_copyfn_remap_type (struct omp_taskcopy_context *tcctx, tree orig_type)
DECL_CONTEXT (new_f) = type;
TREE_TYPE (new_f) = remap_type (TREE_TYPE (f), &tcctx->cb);
TREE_CHAIN (new_f) = new_fields;
- walk_tree (&DECL_SIZE (new_f), copy_body_r, &tcctx->cb, NULL);
- walk_tree (&DECL_SIZE_UNIT (new_f), copy_body_r, &tcctx->cb, NULL);
- walk_tree (&DECL_FIELD_OFFSET (new_f), copy_body_r, &tcctx->cb, NULL);
+ walk_tree (&DECL_SIZE (new_f), copy_tree_body_r, &tcctx->cb, NULL);
+ walk_tree (&DECL_SIZE_UNIT (new_f), copy_tree_body_r, &tcctx->cb, NULL);
+ walk_tree (&DECL_FIELD_OFFSET (new_f), copy_tree_body_r,
+ &tcctx->cb, NULL);
new_fields = new_f;
*pointer_map_insert (tcctx->cb.decl_map, f) = new_f;
}
@@ -5908,7 +6043,7 @@ task_copyfn_remap_type (struct omp_taskcopy_context *tcctx, tree orig_type)
/* Create task copyfn. */
static void
-create_task_copyfn (tree task_stmt, omp_context *ctx)
+create_task_copyfn (gimple task_stmt, omp_context *ctx)
{
struct function *child_cfun;
tree child_fn, t, c, src, dst, f, sf, arg, sarg, decl;
@@ -5918,7 +6053,7 @@ create_task_copyfn (tree task_stmt, omp_context *ctx)
struct omp_taskcopy_context tcctx;
struct gimplify_ctx gctx;
- child_fn = OMP_TASK_COPYFN (task_stmt);
+ child_fn = gimple_omp_task_copy_fn (task_stmt);
child_cfun = DECL_STRUCT_FUNCTION (child_fn);
gcc_assert (child_cfun->cfg == NULL);
child_cfun->dont_save_pending_sizes_p = 1;
@@ -5936,7 +6071,7 @@ create_task_copyfn (tree task_stmt, omp_context *ctx)
TREE_SIDE_EFFECTS (bind) = 1;
list = NULL;
DECL_SAVED_TREE (child_fn) = bind;
- DECL_SOURCE_LOCATION (child_fn) = EXPR_LOCATION (task_stmt);
+ DECL_SOURCE_LOCATION (child_fn) = gimple_location (task_stmt);
/* Remap src and dst argument types if needed. */
record_type = ctx->record_type;
@@ -5986,7 +6121,7 @@ create_task_copyfn (tree task_stmt, omp_context *ctx)
/* First pass: initialize temporaries used in record_type and srecord_type
sizes and field offsets. */
if (tcctx.cb.decl_map)
- for (c = OMP_TASK_CLAUSES (task_stmt); c; c = OMP_CLAUSE_CHAIN (c))
+ for (c = gimple_omp_task_clauses (task_stmt); c; c = OMP_CLAUSE_CHAIN (c))
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FIRSTPRIVATE)
{
tree *p;
@@ -6000,13 +6135,13 @@ create_task_copyfn (tree task_stmt, omp_context *ctx)
sf = *(tree *) pointer_map_contains (tcctx.cb.decl_map, sf);
src = build_fold_indirect_ref (sarg);
src = build3 (COMPONENT_REF, TREE_TYPE (sf), src, sf, NULL);
- t = build_gimple_modify_stmt (*p, src);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (*p), *p, src);
append_to_statement_list (t, &list);
}
/* Second pass: copy shared var pointers and copy construct non-VLA
firstprivate vars. */
- for (c = OMP_TASK_CLAUSES (task_stmt); c; c = OMP_CLAUSE_CHAIN (c))
+ for (c = gimple_omp_task_clauses (task_stmt); c; c = OMP_CLAUSE_CHAIN (c))
switch (OMP_CLAUSE_CODE (c))
{
case OMP_CLAUSE_SHARED:
@@ -6025,7 +6160,7 @@ create_task_copyfn (tree task_stmt, omp_context *ctx)
src = build3 (COMPONENT_REF, TREE_TYPE (sf), src, sf, NULL);
dst = build_fold_indirect_ref (arg);
dst = build3 (COMPONENT_REF, TREE_TYPE (f), dst, f, NULL);
- t = build_gimple_modify_stmt (dst, src);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (dst), dst, src);
append_to_statement_list (t, &list);
break;
case OMP_CLAUSE_FIRSTPRIVATE:
@@ -6079,7 +6214,7 @@ create_task_copyfn (tree task_stmt, omp_context *ctx)
src = decl;
dst = build_fold_indirect_ref (arg);
dst = build3 (COMPONENT_REF, TREE_TYPE (f), dst, f, NULL);
- t = build_gimple_modify_stmt (dst, src);
+ t = build2 (MODIFY_EXPR, TREE_TYPE (dst), dst, src);
append_to_statement_list (t, &list);
break;
default:
@@ -6088,7 +6223,7 @@ create_task_copyfn (tree task_stmt, omp_context *ctx)
/* Last pass: handle VLA firstprivates. */
if (tcctx.cb.decl_map)
- for (c = OMP_TASK_CLAUSES (task_stmt); c; c = OMP_CLAUSE_CHAIN (c))
+ for (c = gimple_omp_task_clauses (task_stmt); c; c = OMP_CLAUSE_CHAIN (c))
if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FIRSTPRIVATE)
{
tree ind, ptr, df;
@@ -6122,7 +6257,8 @@ create_task_copyfn (tree task_stmt, omp_context *ctx)
df = *(tree *) pointer_map_contains (tcctx.cb.decl_map, df);
ptr = build_fold_indirect_ref (arg);
ptr = build3 (COMPONENT_REF, TREE_TYPE (df), ptr, df, NULL);
- t = build_gimple_modify_stmt (ptr, build_fold_addr_expr (dst));
+ t = build2 (MODIFY_EXPR, TREE_TYPE (ptr), ptr,
+ build_fold_addr_expr (dst));
append_to_statement_list (t, &list);
}
@@ -6137,117 +6273,113 @@ create_task_copyfn (tree task_stmt, omp_context *ctx)
current_function_decl = ctx->cb.src_fn;
}
-/* Lower the OpenMP parallel or task directive in *STMT_P. CTX holds context
- information for the directive. */
+/* Lower the OpenMP parallel or task directive in the current statement
+ in GSI_P. CTX holds context information for the directive. */
static void
-lower_omp_taskreg (tree *stmt_p, omp_context *ctx)
+lower_omp_taskreg (gimple_stmt_iterator *gsi_p, omp_context *ctx)
{
- tree clauses, par_bind, par_body, new_body, bind;
- tree olist, ilist, par_olist, par_ilist;
- tree stmt, child_fn, t;
+ tree clauses;
+ tree child_fn, t;
+ gimple stmt = gsi_stmt (*gsi_p);
+ gimple par_bind, bind;
+ gimple_seq par_body, olist, ilist, par_olist, par_ilist, new_body;
struct gimplify_ctx gctx;
- stmt = *stmt_p;
-
- clauses = OMP_TASKREG_CLAUSES (stmt);
- par_bind = OMP_TASKREG_BODY (stmt);
- par_body = BIND_EXPR_BODY (par_bind);
+ clauses = gimple_omp_taskreg_clauses (stmt);
+ par_bind = gimple_seq_first_stmt (gimple_omp_body (stmt));
+ par_body = gimple_bind_body (par_bind);
child_fn = ctx->cb.dst_fn;
- if (TREE_CODE (stmt) == OMP_PARALLEL && !OMP_PARALLEL_COMBINED (stmt))
+ if (gimple_code (stmt) == GIMPLE_OMP_PARALLEL
+ && !gimple_omp_parallel_combined_p (stmt))
{
struct walk_stmt_info wi;
int ws_num = 0;
memset (&wi, 0, sizeof (wi));
- wi.callback = check_combined_parallel;
wi.info = &ws_num;
wi.val_only = true;
- walk_stmts (&wi, &par_bind);
+ walk_gimple_seq (par_body, check_combined_parallel, NULL, &wi);
if (ws_num == 1)
- OMP_PARALLEL_COMBINED (stmt) = 1;
+ gimple_omp_parallel_set_combined_p (stmt, true);
}
if (ctx->srecord_type)
create_task_copyfn (stmt, ctx);
push_gimplify_context (&gctx);
- par_olist = NULL_TREE;
- par_ilist = NULL_TREE;
+ par_olist = NULL;
+ par_ilist = NULL;
lower_rec_input_clauses (clauses, &par_ilist, &par_olist, ctx);
- lower_omp (&par_body, ctx);
- if (TREE_CODE (stmt) == OMP_PARALLEL)
+ lower_omp (par_body, ctx);
+ if (gimple_code (stmt) == GIMPLE_OMP_PARALLEL)
lower_reduction_clauses (clauses, &par_olist, ctx);
/* Declare all the variables created by mapping and the variables
declared in the scope of the parallel body. */
record_vars_into (ctx->block_vars, child_fn);
- record_vars_into (BIND_EXPR_VARS (par_bind), child_fn);
+ record_vars_into (gimple_bind_vars (par_bind), child_fn);
if (ctx->record_type)
{
ctx->sender_decl
= create_tmp_var (ctx->srecord_type ? ctx->srecord_type
: ctx->record_type, ".omp_data_o");
- OMP_TASKREG_DATA_ARG (stmt) = ctx->sender_decl;
+ gimple_omp_taskreg_set_data_arg (stmt, ctx->sender_decl);
}
- olist = NULL_TREE;
- ilist = NULL_TREE;
+ olist = NULL;
+ ilist = NULL;
lower_send_clauses (clauses, &ilist, &olist, ctx);
lower_send_shared_vars (&ilist, &olist, ctx);
/* Once all the expansions are done, sequence all the different
- fragments inside OMP_TASKREG_BODY. */
- bind = build3 (BIND_EXPR, void_type_node, NULL, NULL,
- BIND_EXPR_BLOCK (par_bind));
- TREE_SIDE_EFFECTS (bind) = 1;
+ fragments inside gimple_omp_body. */
- new_body = alloc_stmt_list ();
+ new_body = NULL;
if (ctx->record_type)
{
t = build_fold_addr_expr (ctx->sender_decl);
/* fixup_child_record_type might have changed receiver_decl's type. */
t = fold_convert (TREE_TYPE (ctx->receiver_decl), t);
- t = build_gimple_modify_stmt (ctx->receiver_decl, t);
- append_to_statement_list (t, &new_body);
+ gimple_seq_add_stmt (&new_body,
+ gimple_build_assign (ctx->receiver_decl, t));
}
- append_to_statement_list (par_ilist, &new_body);
- append_to_statement_list (par_body, &new_body);
- append_to_statement_list (par_olist, &new_body);
- maybe_catch_exception (&new_body);
- t = make_node (OMP_RETURN);
- append_to_statement_list (t, &new_body);
- OMP_TASKREG_BODY (stmt) = new_body;
+ gimple_seq_add_seq (&new_body, par_ilist);
+ gimple_seq_add_seq (&new_body, par_body);
+ gimple_seq_add_seq (&new_body, par_olist);
+ new_body = maybe_catch_exception (new_body);
+ gimple_seq_add_stmt (&new_body, gimple_build_omp_return (false));
+ gimple_omp_set_body (stmt, new_body);
- append_to_statement_list (stmt, &BIND_EXPR_BODY (bind));
+ bind = gimple_build_bind (NULL, NULL, gimple_bind_block (par_bind));
+ gimple_bind_add_stmt (bind, stmt);
if (ilist || olist)
{
- append_to_statement_list (bind, &ilist);
- append_to_statement_list (olist, &ilist);
- bind = build3 (BIND_EXPR, void_type_node, NULL, NULL, NULL);
- TREE_SIDE_EFFECTS (bind) = 1;
- append_to_statement_list (ilist, &BIND_EXPR_BODY (bind));
+ gimple_seq_add_stmt (&ilist, bind);
+ gimple_seq_add_seq (&ilist, olist);
+ bind = gimple_build_bind (NULL, ilist, NULL);
}
- *stmt_p = bind;
+ gsi_replace (gsi_p, bind, true);
- pop_gimplify_context (NULL_TREE);
+ pop_gimplify_context (NULL);
}
/* Callback for lower_omp_1. Return non-NULL if *tp needs to be
- regimplified. */
+ regimplified. If DATA is non-NULL, lower_omp_1 is outside
+ of OpenMP context, but with task_shared_vars set. */
static tree
-lower_omp_2 (tree *tp, int *walk_subtrees, void *data)
+lower_omp_regimplify_p (tree *tp, int *walk_subtrees,
+ void *data)
{
tree t = *tp;
- omp_context *ctx = (omp_context *) data;
/* Any variable with DECL_VALUE_EXPR needs to be regimplified. */
- if (TREE_CODE (t) == VAR_DECL && ctx && DECL_HAS_VALUE_EXPR_P (t))
+ if (TREE_CODE (t) == VAR_DECL && data == NULL && DECL_HAS_VALUE_EXPR_P (t))
return t;
if (task_shared_vars
@@ -6257,7 +6389,7 @@ lower_omp_2 (tree *tp, int *walk_subtrees, void *data)
/* If a global variable has been privatized, TREE_CONSTANT on
ADDR_EXPR might be wrong. */
- if (ctx && TREE_CODE (t) == ADDR_EXPR)
+ if (data == NULL && TREE_CODE (t) == ADDR_EXPR)
recompute_tree_invariant_for_addr_expr (t);
*walk_subtrees = !TYPE_P (t) && !DECL_P (t);
@@ -6265,158 +6397,106 @@ lower_omp_2 (tree *tp, int *walk_subtrees, void *data)
}
static void
-lower_omp_1 (tree *tp, omp_context *ctx, tree_stmt_iterator *tsi)
+lower_omp_1 (gimple_stmt_iterator *gsi_p, omp_context *ctx)
{
- tree t = *tp;
+ gimple stmt = gsi_stmt (*gsi_p);
+ struct walk_stmt_info wi;
- if (!t)
- return;
+ if (gimple_has_location (stmt))
+ input_location = gimple_location (stmt);
- if (EXPR_HAS_LOCATION (t))
- input_location = EXPR_LOCATION (t);
+ if (task_shared_vars)
+ memset (&wi, '\0', sizeof (wi));
/* If we have issued syntax errors, avoid doing any heavy lifting.
Just replace the OpenMP directives with a NOP to avoid
confusing RTL expansion. */
- if (errorcount && OMP_DIRECTIVE_P (t))
+ if (errorcount && is_gimple_omp (stmt))
{
- *tp = build_empty_stmt ();
+ gsi_replace (gsi_p, gimple_build_nop (), true);
return;
}
- switch (TREE_CODE (t))
+ switch (gimple_code (stmt))
{
- case STATEMENT_LIST:
- {
- tree_stmt_iterator i;
- for (i = tsi_start (t); !tsi_end_p (i); tsi_next (&i))
- lower_omp_1 (tsi_stmt_ptr (i), ctx, &i);
- }
- break;
-
- case COND_EXPR:
- lower_omp_1 (&COND_EXPR_THEN (t), ctx, NULL);
- lower_omp_1 (&COND_EXPR_ELSE (t), ctx, NULL);
+ case GIMPLE_COND:
if ((ctx || task_shared_vars)
- && walk_tree (&COND_EXPR_COND (t), lower_omp_2, ctx, NULL))
- {
- tree pre = NULL;
- gimplify_expr (&COND_EXPR_COND (t), &pre, NULL,
- is_gimple_condexpr, fb_rvalue);
- if (pre)
- {
- if (tsi)
- tsi_link_before (tsi, pre, TSI_SAME_STMT);
- else
- {
- append_to_statement_list (t, &pre);
- *tp = pre;
- }
- }
- }
+ && (walk_tree (gimple_cond_lhs_ptr (stmt), lower_omp_regimplify_p,
+ ctx ? NULL : &wi, NULL)
+ || walk_tree (gimple_cond_rhs_ptr (stmt), lower_omp_regimplify_p,
+ ctx ? NULL : &wi, NULL)))
+ gimple_regimplify_operands (stmt, gsi_p);
break;
- case CATCH_EXPR:
- lower_omp_1 (&CATCH_BODY (t), ctx, NULL);
+ case GIMPLE_CATCH:
+ lower_omp (gimple_catch_handler (stmt), ctx);
break;
- case EH_FILTER_EXPR:
- lower_omp_1 (&EH_FILTER_FAILURE (t), ctx, NULL);
+ case GIMPLE_EH_FILTER:
+ lower_omp (gimple_eh_filter_failure (stmt), ctx);
break;
- case TRY_CATCH_EXPR:
- case TRY_FINALLY_EXPR:
- lower_omp_1 (&TREE_OPERAND (t, 0), ctx, NULL);
- lower_omp_1 (&TREE_OPERAND (t, 1), ctx, NULL);
+ case GIMPLE_TRY:
+ lower_omp (gimple_try_eval (stmt), ctx);
+ lower_omp (gimple_try_cleanup (stmt), ctx);
break;
- case BIND_EXPR:
- lower_omp_1 (&BIND_EXPR_BODY (t), ctx, NULL);
+ case GIMPLE_BIND:
+ lower_omp (gimple_bind_body (stmt), ctx);
break;
- case RETURN_EXPR:
- lower_omp_1 (&TREE_OPERAND (t, 0), ctx, NULL);
+ case GIMPLE_OMP_PARALLEL:
+ case GIMPLE_OMP_TASK:
+ ctx = maybe_lookup_ctx (stmt);
+ lower_omp_taskreg (gsi_p, ctx);
break;
-
- case OMP_PARALLEL:
- case OMP_TASK:
- ctx = maybe_lookup_ctx (t);
- lower_omp_taskreg (tp, ctx);
- break;
- case OMP_FOR:
- ctx = maybe_lookup_ctx (t);
+ case GIMPLE_OMP_FOR:
+ ctx = maybe_lookup_ctx (stmt);
gcc_assert (ctx);
- lower_omp_for (tp, ctx);
+ lower_omp_for (gsi_p, ctx);
break;
- case OMP_SECTIONS:
- ctx = maybe_lookup_ctx (t);
+ case GIMPLE_OMP_SECTIONS:
+ ctx = maybe_lookup_ctx (stmt);
gcc_assert (ctx);
- lower_omp_sections (tp, ctx);
+ lower_omp_sections (gsi_p, ctx);
break;
- case OMP_SINGLE:
- ctx = maybe_lookup_ctx (t);
+ case GIMPLE_OMP_SINGLE:
+ ctx = maybe_lookup_ctx (stmt);
gcc_assert (ctx);
- lower_omp_single (tp, ctx);
+ lower_omp_single (gsi_p, ctx);
break;
- case OMP_MASTER:
- ctx = maybe_lookup_ctx (t);
+ case GIMPLE_OMP_MASTER:
+ ctx = maybe_lookup_ctx (stmt);
gcc_assert (ctx);
- lower_omp_master (tp, ctx);
+ lower_omp_master (gsi_p, ctx);
break;
- case OMP_ORDERED:
- ctx = maybe_lookup_ctx (t);
+ case GIMPLE_OMP_ORDERED:
+ ctx = maybe_lookup_ctx (stmt);
gcc_assert (ctx);
- lower_omp_ordered (tp, ctx);
+ lower_omp_ordered (gsi_p, ctx);
break;
- case OMP_CRITICAL:
- ctx = maybe_lookup_ctx (t);
+ case GIMPLE_OMP_CRITICAL:
+ ctx = maybe_lookup_ctx (stmt);
gcc_assert (ctx);
- lower_omp_critical (tp, ctx);
+ lower_omp_critical (gsi_p, ctx);
+ break;
+ case GIMPLE_OMP_ATOMIC_LOAD:
+ if ((ctx || task_shared_vars)
+ && walk_tree (gimple_omp_atomic_load_rhs_ptr (stmt),
+ lower_omp_regimplify_p, ctx ? NULL : &wi, NULL))
+ gimple_regimplify_operands (stmt, gsi_p);
break;
-
default:
if ((ctx || task_shared_vars)
- && walk_tree (tp, lower_omp_2, ctx, NULL))
- {
- /* The gimplifier doesn't gimplify CALL_EXPR_STATIC_CHAIN.
- Handle that here. */
- tree call = get_call_expr_in (t);
- if (call
- && CALL_EXPR_STATIC_CHAIN (call)
- && walk_tree (&CALL_EXPR_STATIC_CHAIN (call), lower_omp_2,
- ctx, NULL))
- {
- tree pre = NULL;
- gimplify_expr (&CALL_EXPR_STATIC_CHAIN (call), &pre, NULL,
- is_gimple_val, fb_rvalue);
- if (pre)
- {
- if (tsi)
- tsi_link_before (tsi, pre, TSI_SAME_STMT);
- else
- {
- append_to_statement_list (t, &pre);
- lower_omp_1 (&pre, ctx, NULL);
- *tp = pre;
- return;
- }
- }
- }
-
- if (tsi == NULL)
- gimplify_stmt (tp);
- else
- {
- tree pre = NULL;
- gimplify_expr (tp, &pre, NULL, is_gimple_stmt, fb_none);
- if (pre)
- tsi_link_before (tsi, pre, TSI_SAME_STMT);
- }
- }
+ && walk_gimple_op (stmt, lower_omp_regimplify_p,
+ ctx ? NULL : &wi))
+ gimple_regimplify_operands (stmt, gsi_p);
break;
}
}
static void
-lower_omp (tree *stmt_p, omp_context *ctx)
+lower_omp (gimple_seq body, omp_context *ctx)
{
location_t saved_location = input_location;
- lower_omp_1 (stmt_p, ctx, NULL);
+ gimple_stmt_iterator gsi = gsi_start (body);
+ for (gsi = gsi_start (body); !gsi_end_p (gsi); gsi_next (&gsi))
+ lower_omp_1 (&gsi, ctx);
input_location = saved_location;
}
@@ -6425,10 +6505,13 @@ lower_omp (tree *stmt_p, omp_context *ctx)
static unsigned int
execute_lower_omp (void)
{
+ gimple_seq body;
+
all_contexts = splay_tree_new (splay_tree_compare_pointers, 0,
delete_omp_context);
- scan_omp (&DECL_SAVED_TREE (current_function_decl), NULL);
+ body = gimple_body (current_function_decl);
+ scan_omp (body, NULL);
gcc_assert (taskreg_nesting_level == 0);
if (all_contexts->root)
@@ -6437,7 +6520,7 @@ execute_lower_omp (void)
if (task_shared_vars)
push_gimplify_context (&gctx);
- lower_omp (&DECL_SAVED_TREE (current_function_decl), NULL);
+ lower_omp (body, NULL);
if (task_shared_vars)
pop_gimplify_context (NULL);
}
@@ -6486,13 +6569,25 @@ static splay_tree all_labels;
true if an error is detected. */
static bool
-diagnose_sb_0 (tree *stmt_p, tree branch_ctx, tree label_ctx)
+diagnose_sb_0 (gimple_stmt_iterator *gsi_p,
+ gimple branch_ctx, gimple label_ctx)
{
- bool exit_p = true;
-
- if ((label_ctx ? TREE_VALUE (label_ctx) : NULL) == branch_ctx)
+ if (label_ctx == branch_ctx)
return false;
+
+ /*
+ Previously we kept track of the label's entire context in diagnose_sb_[12]
+ so we could traverse it and issue a correct "exit" or "enter" error
+ message upon a structured block violation.
+
+ We built the context by building a list with tree_cons'ing, but there is
+ no easy counterpart in gimple tuples. It seems like far too much work
+ for issuing exit/enter error messages. If someone really misses the
+ distinct error message... patches welcome.
+ */
+
+#if 0
/* Try to avoid confusing the user by producing and error message
with correct "exit" or "enter" verbiage. We prefer "exit"
unless we can show that LABEL_CTX is nested within BRANCH_CTX. */
@@ -6515,63 +6610,64 @@ diagnose_sb_0 (tree *stmt_p, tree branch_ctx, tree label_ctx)
error ("invalid exit from OpenMP structured block");
else
error ("invalid entry to OpenMP structured block");
+#endif
- *stmt_p = build_empty_stmt ();
+ /* If it's obvious we have an invalid entry, be specific about the error. */
+ if (branch_ctx == NULL)
+ error ("invalid entry to OpenMP structured block");
+ else
+ /* Otherwise, be vague and lazy, but efficient. */
+ error ("invalid branch to/from an OpenMP structured block");
+
+ gsi_replace (gsi_p, gimple_build_nop (), false);
return true;
}
/* Pass 1: Create a minimal tree of OpenMP structured blocks, and record
- where in the tree each label is found. */
+ where each label is found. */
static tree
-diagnose_sb_1 (tree *tp, int *walk_subtrees, void *data)
+diagnose_sb_1 (gimple_stmt_iterator *gsi_p, bool *handled_ops_p,
+ struct walk_stmt_info *wi)
{
- struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
- tree context = (tree) wi->info;
- tree inner_context;
- tree t = *tp;
- int i;
+ gimple context = (gimple) wi->info;
+ gimple inner_context;
+ gimple stmt = gsi_stmt (*gsi_p);
- *walk_subtrees = 0;
- switch (TREE_CODE (t))
+ *handled_ops_p = true;
+
+ switch (gimple_code (stmt))
{
- case OMP_PARALLEL:
- case OMP_TASK:
- case OMP_SECTIONS:
- case OMP_SINGLE:
- walk_tree (&OMP_CLAUSES (t), diagnose_sb_1, wi, NULL);
- /* FALLTHRU */
- case OMP_SECTION:
- case OMP_MASTER:
- case OMP_ORDERED:
- case OMP_CRITICAL:
- /* The minimal context here is just a tree of statements. */
- inner_context = tree_cons (NULL, t, context);
+ WALK_SUBSTMTS;
+
+ case GIMPLE_OMP_PARALLEL:
+ case GIMPLE_OMP_TASK:
+ case GIMPLE_OMP_SECTIONS:
+ case GIMPLE_OMP_SINGLE:
+ case GIMPLE_OMP_SECTION:
+ case GIMPLE_OMP_MASTER:
+ case GIMPLE_OMP_ORDERED:
+ case GIMPLE_OMP_CRITICAL:
+ /* The minimal context here is just the current OMP construct. */
+ inner_context = stmt;
wi->info = inner_context;
- walk_stmts (wi, &OMP_BODY (t));
+ walk_gimple_seq (gimple_omp_body (stmt), diagnose_sb_1, NULL, wi);
wi->info = context;
break;
- case OMP_FOR:
- walk_tree (&OMP_FOR_CLAUSES (t), diagnose_sb_1, wi, NULL);
- inner_context = tree_cons (NULL, t, context);
+ case GIMPLE_OMP_FOR:
+ inner_context = stmt;
wi->info = inner_context;
- for (i = 0; i < TREE_VEC_LENGTH (OMP_FOR_INIT (t)); i++)
- {
- walk_tree (&TREE_VEC_ELT (OMP_FOR_INIT (t), i), diagnose_sb_1,
- wi, NULL);
- walk_tree (&TREE_VEC_ELT (OMP_FOR_COND (t), i), diagnose_sb_1,
- wi, NULL);
- walk_tree (&TREE_VEC_ELT (OMP_FOR_INCR (t), i), diagnose_sb_1,
- wi, NULL);
- }
- walk_stmts (wi, &OMP_FOR_PRE_BODY (t));
- walk_stmts (wi, &OMP_FOR_BODY (t));
+ /* gimple_omp_for_{index,initial,final} are all DECLs; no need to
+ walk them. */
+ walk_gimple_seq (gimple_omp_for_pre_body (stmt),
+ diagnose_sb_1, NULL, wi);
+ walk_gimple_seq (gimple_omp_body (stmt), diagnose_sb_1, NULL, wi);
wi->info = context;
break;
- case LABEL_EXPR:
- splay_tree_insert (all_labels, (splay_tree_key) LABEL_EXPR_LABEL (t),
+ case GIMPLE_LABEL:
+ splay_tree_insert (all_labels, (splay_tree_key) gimple_label_label (stmt),
(splay_tree_value) context);
break;
@@ -6586,76 +6682,68 @@ diagnose_sb_1 (tree *tp, int *walk_subtrees, void *data)
the destination label's context. */
static tree
-diagnose_sb_2 (tree *tp, int *walk_subtrees, void *data)
+diagnose_sb_2 (gimple_stmt_iterator *gsi_p, bool *handled_ops_p,
+ struct walk_stmt_info *wi)
{
- struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
- tree context = (tree) wi->info;
+ gimple context = (gimple) wi->info;
splay_tree_node n;
- tree t = *tp;
- int i;
+ gimple stmt = gsi_stmt (*gsi_p);
- *walk_subtrees = 0;
- switch (TREE_CODE (t))
+ *handled_ops_p = true;
+
+ switch (gimple_code (stmt))
{
- case OMP_PARALLEL:
- case OMP_TASK:
- case OMP_SECTIONS:
- case OMP_SINGLE:
- walk_tree (&OMP_CLAUSES (t), diagnose_sb_2, wi, NULL);
- /* FALLTHRU */
- case OMP_SECTION:
- case OMP_MASTER:
- case OMP_ORDERED:
- case OMP_CRITICAL:
- wi->info = t;
- walk_stmts (wi, &OMP_BODY (t));
+ WALK_SUBSTMTS;
+
+ case GIMPLE_OMP_PARALLEL:
+ case GIMPLE_OMP_TASK:
+ case GIMPLE_OMP_SECTIONS:
+ case GIMPLE_OMP_SINGLE:
+ case GIMPLE_OMP_SECTION:
+ case GIMPLE_OMP_MASTER:
+ case GIMPLE_OMP_ORDERED:
+ case GIMPLE_OMP_CRITICAL:
+ wi->info = stmt;
+ walk_gimple_seq (gimple_omp_body (stmt), diagnose_sb_2, NULL, wi);
wi->info = context;
break;
- case OMP_FOR:
- walk_tree (&OMP_FOR_CLAUSES (t), diagnose_sb_2, wi, NULL);
- wi->info = t;
- for (i = 0; i < TREE_VEC_LENGTH (OMP_FOR_INIT (t)); i++)
- {
- walk_tree (&TREE_VEC_ELT (OMP_FOR_INIT (t), i), diagnose_sb_2,
- wi, NULL);
- walk_tree (&TREE_VEC_ELT (OMP_FOR_COND (t), i), diagnose_sb_2,
- wi, NULL);
- walk_tree (&TREE_VEC_ELT (OMP_FOR_INCR (t), i), diagnose_sb_2,
- wi, NULL);
- }
- walk_stmts (wi, &OMP_FOR_PRE_BODY (t));
- walk_stmts (wi, &OMP_FOR_BODY (t));
+ case GIMPLE_OMP_FOR:
+ wi->info = stmt;
+ /* gimple_omp_for_{index,initial,final} are all DECLs; no need to
+ walk them. */
+ walk_gimple_seq (gimple_omp_for_pre_body (stmt),
+ diagnose_sb_2, NULL, wi);
+ walk_gimple_seq (gimple_omp_body (stmt), diagnose_sb_2, NULL, wi);
wi->info = context;
break;
- case GOTO_EXPR:
+ case GIMPLE_GOTO:
{
- tree lab = GOTO_DESTINATION (t);
+ tree lab = gimple_goto_dest (stmt);
if (TREE_CODE (lab) != LABEL_DECL)
break;
n = splay_tree_lookup (all_labels, (splay_tree_key) lab);
- diagnose_sb_0 (tp, context, n ? (tree) n->value : NULL_TREE);
+ diagnose_sb_0 (gsi_p, context, n ? (gimple) n->value : NULL);
}
break;
- case SWITCH_EXPR:
+ case GIMPLE_SWITCH:
{
- tree vec = SWITCH_LABELS (t);
- int i, len = TREE_VEC_LENGTH (vec);
- for (i = 0; i < len; ++i)
+ unsigned int i;
+ for (i = 0; i < gimple_switch_num_labels (stmt); ++i)
{
- tree lab = CASE_LABEL (TREE_VEC_ELT (vec, i));
+ tree lab = CASE_LABEL (gimple_switch_label (stmt, i));
n = splay_tree_lookup (all_labels, (splay_tree_key) lab);
- if (diagnose_sb_0 (tp, context, (tree) n->value))
+ if (n && diagnose_sb_0 (gsi_p, context, (gimple) n->value))
break;
}
}
break;
- case RETURN_EXPR:
- diagnose_sb_0 (tp, context, NULL_TREE);
+ case GIMPLE_RETURN:
+ diagnose_sb_0 (gsi_p, context, NULL);
break;
default:
@@ -6670,24 +6758,25 @@ diagnose_omp_structured_block_errors (tree fndecl)
{
tree save_current = current_function_decl;
struct walk_stmt_info wi;
+ struct function *old_cfun = cfun;
+ gimple_seq body = gimple_body (fndecl);
current_function_decl = fndecl;
+ set_cfun (DECL_STRUCT_FUNCTION (fndecl));
all_labels = splay_tree_new (splay_tree_compare_pointers, 0, 0);
memset (&wi, 0, sizeof (wi));
- wi.callback = diagnose_sb_1;
- walk_stmts (&wi, &DECL_SAVED_TREE (fndecl));
+ walk_gimple_seq (body, diagnose_sb_1, NULL, &wi);
memset (&wi, 0, sizeof (wi));
- wi.callback = diagnose_sb_2;
wi.want_locations = true;
- wi.want_return_expr = true;
- walk_stmts (&wi, &DECL_SAVED_TREE (fndecl));
+ walk_gimple_seq (body, diagnose_sb_2, NULL, &wi);
splay_tree_delete (all_labels);
all_labels = NULL;
+ set_cfun (old_cfun);
current_function_decl = save_current;
}
diff --git a/gcc/opt-functions.awk b/gcc/opt-functions.awk
index a14b8c203d5..574379bddce 100644
--- a/gcc/opt-functions.awk
+++ b/gcc/opt-functions.awk
@@ -71,6 +71,7 @@ function switch_flags (flags)
result = result \
test_flag("Common", flags, " | CL_COMMON") \
test_flag("Target", flags, " | CL_TARGET") \
+ test_flag("Save", flags, " | CL_SAVE") \
test_flag("Joined", flags, " | CL_JOINED") \
test_flag("JoinedOrMissing", flags, " | CL_JOINED | CL_MISSING_OK") \
test_flag("Separate", flags, " | CL_SEPARATE") \
diff --git a/gcc/optabs.c b/gcc/optabs.c
index ee5bec11a41..0c3b9caeed5 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
@@ -3443,7 +3443,9 @@ expand_abs_nojump (enum machine_mode mode, rtx op0, rtx target,
value of X as (((signed) x >> (W-1)) ^ x) - ((signed) x >> (W-1)),
where W is the width of MODE. */
- if (GET_MODE_CLASS (mode) == MODE_INT && BRANCH_COST >= 2)
+ if (GET_MODE_CLASS (mode) == MODE_INT
+ && BRANCH_COST (optimize_insn_for_speed_p (),
+ false) >= 2)
{
rtx extended = expand_shift (RSHIFT_EXPR, mode, op0,
size_int (GET_MODE_BITSIZE (mode) - 1),
@@ -3759,14 +3761,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 +3784,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 +3797,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 +5163,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 +5177,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 +5392,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/optc-gen.awk b/gcc/optc-gen.awk
index 845efb4a515..d53ba69aa76 100644
--- a/gcc/optc-gen.awk
+++ b/gcc/optc-gen.awk
@@ -225,7 +225,7 @@ for (i = 0; i < n_opts; i++) {
print "};"
print "";
-print "#if !defined(GCC_DRIVER) && !defined(IN_LIBGCC2)"
+print "#if !defined(GCC_DRIVER) && !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS)"
print "";
print "/* Save optimization variables into a structure. */"
print "void";
diff --git a/gcc/opth-gen.awk b/gcc/opth-gen.awk
index 7c1d92ac4fa..a67e5b77a8b 100644
--- a/gcc/opth-gen.awk
+++ b/gcc/opth-gen.awk
@@ -95,7 +95,7 @@ print ""
# Also, order the structure so that pointer fields occur first, then int
# fields, and then char fields to provide the best packing.
-print "#if !defined(GCC_DRIVER) && !defined(IN_LIBGCC2)"
+print "#if !defined(GCC_DRIVER) && !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS)"
print ""
print "/* Structure to save/restore optimization and target specific options. */";
print "struct cl_optimization GTY(())";
diff --git a/gcc/opts.c b/gcc/opts.c
index a4572270386..621f6b3fff3 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. */
@@ -333,11 +331,6 @@ bool use_gnu_debug_info_extensions;
/* The default visibility for all symbols (unless overridden) */
enum symbol_visibility default_visibility = VISIBILITY_DEFAULT;
-/* Disable unit-at-a-time for frontends that might be still broken in this
- respect. */
-
-bool no_unit_at_a_time_default;
-
/* Global visibility options. */
struct visibility_flags visibility_options;
@@ -354,7 +347,8 @@ static bool profile_arc_flag_set, flag_profile_values_set;
static bool flag_unroll_loops_set, flag_tracer_set;
static bool flag_value_profile_transformations_set;
static bool flag_peel_loops_set, flag_branch_probabilities_set;
-static bool flag_inline_functions_set;
+static bool flag_inline_functions_set, flag_ipa_cp_set, flag_ipa_cp_clone_set;
+static bool flag_predictive_commoning_set, flag_unswitch_loops_set, flag_gcse_after_reload_set;
/* Functions excluded from profiling. */
@@ -872,13 +866,11 @@ decode_options (unsigned int argc, const char **argv)
}
}
}
-
-
+
if (!flag_unit_at_a_time)
{
flag_section_anchors = 0;
flag_toplevel_reorder = 0;
- flag_unit_at_a_time = 1;
}
if (!flag_toplevel_reorder)
{
@@ -887,6 +879,11 @@ decode_options (unsigned int argc, const char **argv)
flag_section_anchors = 0;
}
+#ifdef IRA_COVER_CLASSES
+ /* Use IRA if it is implemented for the target. */
+ flag_ira = 1;
+#endif
+
/* Originally we just set the variables if a particular optimization level,
but with the advent of being able to change the optimization level for a
function, we need to reset optimizations. */
@@ -934,6 +931,7 @@ decode_options (unsigned int argc, const char **argv)
/* -O2 optimizations. */
opt2 = (optimize >= 2);
flag_inline_small_functions = opt2;
+ flag_indirect_inlining = opt2;
flag_thread_jumps = opt2;
flag_crossjumping = opt2;
flag_optimize_sibling_calls = opt2;
@@ -954,13 +952,13 @@ decode_options (unsigned int argc, const char **argv)
flag_delete_null_pointer_checks = opt2;
flag_reorder_blocks = opt2;
flag_reorder_functions = opt2;
- flag_tree_store_ccp = opt2;
flag_tree_vrp = opt2;
flag_tree_builtin_call_dce = opt2;
flag_tree_pre = opt2;
- flag_tree_switch_conversion = 1;
+ flag_tree_switch_conversion = 1;
+ flag_ipa_cp = opt2;
- /* Allow more virtual operators to increase alias precision. */
+ /* Allow more virtual operators to increase alias precision. */
set_param_value ("max-aliased-vops",
(opt2) ? 500 : initial_max_aliased_vops);
@@ -976,6 +974,9 @@ decode_options (unsigned int argc, const char **argv)
flag_unswitch_loops = opt3;
flag_gcse_after_reload = opt3;
flag_tree_vectorize = opt3;
+ flag_ipa_cp_clone = opt3;
+ if (flag_ipa_cp_clone)
+ flag_ipa_cp = 1;
/* Allow even more virtual operators. Max-aliased-vops was set above for
-O2, so don't reset it unless we are at -O3. */
@@ -993,51 +994,10 @@ decode_options (unsigned int argc, const char **argv)
if (optimize_size)
{
- /* Loop header copying usually increases size of the code. This used not to
- be true, since quite often it is possible to verify that the condition is
- satisfied in the first iteration and therefore to eliminate it. Jump
- threading handles these cases now. */
- flag_tree_ch = 0;
-
- /* Conditional DCE generates bigger code. */
- flag_tree_builtin_call_dce = 0;
-
- /* PRE tends to generate bigger code. */
- flag_tree_pre = 0;
-
- /* These options are set with -O3, so reset for -Os */
- flag_predictive_commoning = 0;
- flag_inline_functions = 0;
- flag_unswitch_loops = 0;
- flag_gcse_after_reload = 0;
- flag_tree_vectorize = 0;
-
- /* Don't reorder blocks when optimizing for size because extra jump insns may
- be created; also barrier may create extra padding.
-
- More correctly we should have a block reordering mode that tried to
- minimize the combined size of all the jumps. This would more or less
- automatically remove extra jumps, but would also try to use more short
- jumps instead of long jumps. */
- flag_reorder_blocks = 0;
- flag_reorder_blocks_and_partition = 0;
-
/* Inlining of functions reducing size is a good idea regardless of them
being declared inline. */
flag_inline_functions = 1;
- /* Don't align code. */
- align_loops = 1;
- align_jumps = 1;
- align_labels = 1;
- align_functions = 1;
-
- /* Unroll/prefetch switches that may be set on the command line, and tend to
- generate bigger code. */
- flag_unroll_loops = 0;
- flag_unroll_all_loops = 0;
- flag_prefetch_loop_arrays = 0;
-
/* Basic optimization options. */
optimize_size = 1;
if (optimize > 2)
@@ -1078,44 +1038,14 @@ decode_options (unsigned int argc, const char **argv)
flag_pic = flag_pie;
if (flag_pic && !flag_pie)
flag_shlib = 1;
-
- if (flag_no_inline == 2)
- flag_no_inline = 0;
- else
- flag_really_no_inline = flag_no_inline;
}
- /* Set flag_no_inline before the post_options () hook. The C front
- ends use it to determine tree inlining defaults. FIXME: such
- code should be lang-independent when all front ends use tree
- inlining, in which case it, and this condition, should be moved
- to the top of process_options() instead. */
if (optimize == 0)
{
/* Inlining does not work if not optimizing,
so force it not to be done. */
- flag_no_inline = 1;
warn_inline = 0;
-
- /* The c_decode_option function and decode_option hook set
- this to `2' if -Wall is used, so we can avoid giving out
- lots of errors for people who don't realize what -Wall does. */
- if (warn_uninitialized == 1)
- warning (OPT_Wuninitialized,
- "-Wuninitialized is not supported without -O");
- }
-
- if (flag_really_no_inline == 2)
- flag_really_no_inline = flag_no_inline;
-
- /* Inlining of functions called just once will only work if we can look
- at the complete translation unit. */
- if (flag_inline_functions_called_once && !flag_unit_at_a_time)
- {
- flag_inline_functions_called_once = 0;
- warning (OPT_Wdisabled_optimization,
- "-funit-at-a-time is required for inlining of functions "
- "that are only called once");
+ flag_no_inline = 1;
}
/* The optimization to partition hot and cold basic blocks into separate
@@ -1126,8 +1056,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;
}
@@ -1138,7 +1068,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;
}
@@ -1151,12 +1081,20 @@ 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;
}
+#ifndef IRA_COVER_CLASSES
+ if (flag_ira)
+ {
+ inform (input_location, "-fira does not work on this architecture");
+ flag_ira = 0;
+ }
+#endif
+
/* Save the current optimization options if this is the first call. */
if (first_time_p)
{
@@ -1703,7 +1641,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:
@@ -1870,6 +1808,17 @@ common_handle_option (size_t scode, const char *arg, int value,
flag_value_profile_transformations = value;
if (!flag_inline_functions_set)
flag_inline_functions = value;
+ if (!flag_ipa_cp_set)
+ flag_ipa_cp = value;
+ if (!flag_ipa_cp_clone_set
+ && value && flag_ipa_cp)
+ flag_ipa_cp_clone = value;
+ if (!flag_predictive_commoning_set)
+ flag_predictive_commoning = value;
+ if (!flag_unswitch_loops_set)
+ flag_unswitch_loops = value;
+ if (!flag_gcse_after_reload_set)
+ flag_gcse_after_reload = value;
break;
case OPT_fprofile_generate_:
@@ -1939,6 +1888,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)
@@ -1977,10 +1957,45 @@ common_handle_option (size_t scode, const char *arg, int value,
warning (0, "unknown tls-model \"%s\"", arg);
break;
+ case OPT_fira_algorithm_:
+ if (!strcmp (arg, "regional"))
+ flag_ira_algorithm = IRA_ALGORITHM_REGIONAL;
+ else if (!strcmp (arg, "CB"))
+ flag_ira_algorithm = IRA_ALGORITHM_CB;
+ else if (!strcmp (arg, "mixed"))
+ flag_ira_algorithm = IRA_ALGORITHM_MIXED;
+ else
+ warning (0, "unknown ira algorithm \"%s\"", arg);
+ break;
+
+ case OPT_fira_verbose_:
+ flag_ira_verbose = value;
+ break;
+
case OPT_ftracer:
flag_tracer_set = true;
break;
+ case OPT_fipa_cp:
+ flag_ipa_cp_set = true;
+ break;
+
+ case OPT_fipa_cp_clone:
+ flag_ipa_cp_clone_set = true;
+ break;
+
+ case OPT_fpredictive_commoning:
+ flag_predictive_commoning_set = true;
+ break;
+
+ case OPT_funswitch_loops:
+ flag_unswitch_loops_set = true;
+ break;
+
+ case OPT_fgcse_after_reload:
+ flag_gcse_after_reload_set = true;
+ break;
+
case OPT_funroll_loops:
flag_unroll_loops_set = true;
break;
@@ -2073,7 +2088,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
@@ -2084,23 +2098,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/opts.h b/gcc/opts.h
index 2f543407de0..7a51a0e3b52 100644
--- a/gcc/opts.h
+++ b/gcc/opts.h
@@ -64,15 +64,15 @@ extern const struct cl_option cl_options[];
extern const unsigned int cl_options_count;
extern const char *const lang_names[];
extern const unsigned int cl_lang_count;
-extern bool no_unit_at_a_time_default;
+#define CL_SAVE (1 << 17) /* Target-specific option for attribute. */
#define CL_PARAMS (1 << 18) /* Fake entry. Used to display --param info with --help. */
#define CL_WARNING (1 << 19) /* Enables an (optional) warning message. */
#define CL_OPTIMIZATION (1 << 20) /* Enables an (optional) optimization. */
#define CL_TARGET (1 << 21) /* Target-specific option. */
#define CL_COMMON (1 << 22) /* Language-independent. */
-#define CL_MIN_OPTION_CLASS CL_PARAMS
+#define CL_MIN_OPTION_CLASS CL_SAVE
#define CL_MAX_OPTION_CLASS CL_COMMON
/* From here on the bits describe attributes of the options.
diff --git a/gcc/params.def b/gcc/params.def
index d1f8fcec0e7..5e9a664208f 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -78,6 +78,13 @@ DEFPARAM (PARAM_STRUCT_REORG_COLD_STRUCT_RATIO,
"The threshold ratio between current and hottest structure counts",
10, 0, 100)
+/* When branch is predicted to be taken with probability lower than this
+ threshold (in percent), then it is considered well predictable. */
+DEFPARAM (PARAM_PREDICTABLE_BRANCH_OUTCOME,
+ "predictable-branch-outcome",
+ "Maximal esitmated outcome of branch considered predictable",
+ 2, 0, 50)
+
/* The single function inlining limit. This is the maximum size
of a function counted in internal gcc instructions (not in
real machine instructions) that is eligible for inlining
@@ -193,6 +200,10 @@ DEFPARAM(PARAM_INLINE_UNIT_GROWTH,
"inline-unit-growth",
"how much can given compilation unit grow because of the inlining (in percent)",
30, 0, 0)
+DEFPARAM(PARAM_IPCP_UNIT_GROWTH,
+ "ipcp-unit-growth",
+ "how much can given compilation unit grow because of the interprocedural constant propagation (in percent)",
+ 10, 0, 0)
DEFPARAM(PARAM_INLINE_CALL_COST,
"inline-call-cost",
"expense of call operation relative to ordinary arithmetic operations",
@@ -710,6 +721,11 @@ DEFPARAM (PARAM_DF_DOUBLE_QUEUE_THRESHOLD_FACTOR,
"Multiplier used for determining the double-queueing threshold",
2, 0, 0)
+DEFPARAM (PARAM_IRA_MAX_LOOPS_NUM,
+ "ira-max-loops-num",
+ "max loops number for regional RA",
+ 50, 0, 0)
+
/* Switch initialization conversion will refuse to create arrays that are
bigger than this parameter times the number of switch branches. */
diff --git a/gcc/params.h b/gcc/params.h
index 7e08ec741e5..8147b609848 100644
--- a/gcc/params.h
+++ b/gcc/params.h
@@ -167,6 +167,8 @@ typedef enum compiler_param
PARAM_VALUE (PARAM_L2_CACHE_SIZE)
#define USE_CANONICAL_TYPES \
PARAM_VALUE (PARAM_USE_CANONICAL_TYPES)
+#define IRA_MAX_LOOPS_NUM \
+ PARAM_VALUE (PARAM_IRA_MAX_LOOPS_NUM)
#define SWITCH_CONVERSION_BRANCH_RATIO \
PARAM_VALUE (PARAM_SWITCH_CONVERSION_BRANCH_RATIO)
#endif /* ! GCC_PARAMS_H */
diff --git a/gcc/passes.c b/gcc/passes.c
index bccbe70db74..7c76747b971 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -180,7 +180,7 @@ rest_of_decl_compilation (tree decl,
/* Don't output anything when a tentative file-scope definition
is seen. But at end of compilation, do output code for them.
- We do output all variables when unit-at-a-time is active and rely on
+ We do output all variables and rely on
callgraph code to defer them except for forward declarations
(see gcc.c-torture/compile/920624-1.c) */
if ((at_end
@@ -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
{
@@ -523,9 +523,7 @@ init_optimization_passes (void)
NEXT_PASS (pass_inline_parameters);
*p = NULL;
- /* Interprocedural optimization passes.
- All these passes are ignored in -fno-unit-at-a-time
- except for subpasses of early_local_passes. */
+ /* Interprocedural optimization passes. */
p = &all_ipa_passes;
NEXT_PASS (pass_ipa_function_and_variable_visibility);
NEXT_PASS (pass_ipa_early_inline);
@@ -546,31 +544,20 @@ init_optimization_passes (void)
NEXT_PASS (pass_referenced_vars);
NEXT_PASS (pass_reset_cc_flags);
NEXT_PASS (pass_build_ssa);
+ NEXT_PASS (pass_early_warn_uninitialized);
NEXT_PASS (pass_all_early_optimizations);
{
struct opt_pass **p = &pass_all_early_optimizations.pass.sub;
- NEXT_PASS (pass_early_warn_uninitialized);
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);
@@ -593,35 +580,38 @@ init_optimization_passes (void)
/* These passes are run after IPA passes on every function that is being
output to the assembler file. */
p = &all_passes;
- NEXT_PASS (pass_O0_always_inline);
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_strip_predict_hints);
+ 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);
@@ -631,21 +621,19 @@ init_optimization_passes (void)
NEXT_PASS (pass_sra);
NEXT_PASS (pass_rename_ssa_copies);
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_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);
@@ -686,14 +674,12 @@ init_optimization_passes (void)
NEXT_PASS (pass_reassoc);
NEXT_PASS (pass_vrp);
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_cd_dce);
NEXT_PASS (pass_tracer);
@@ -722,6 +708,7 @@ init_optimization_passes (void)
NEXT_PASS (pass_warn_function_noreturn);
NEXT_PASS (pass_free_datastructures);
NEXT_PASS (pass_mudflap_2);
+
NEXT_PASS (pass_free_cfg_annotations);
NEXT_PASS (pass_expand);
NEXT_PASS (pass_rest_of_compilation);
@@ -781,6 +768,7 @@ init_optimization_passes (void)
NEXT_PASS (pass_subregs_of_mode_init);
NEXT_PASS (pass_local_alloc);
NEXT_PASS (pass_global_alloc);
+ NEXT_PASS (pass_ira);
NEXT_PASS (pass_subregs_of_mode_finish);
NEXT_PASS (pass_postreload);
{
@@ -961,12 +949,10 @@ execute_function_todo (void *data)
if (flags & TODO_remove_unused_locals)
remove_unused_locals ();
- if ((flags & TODO_dump_func)
- && dump_file && current_function_decl)
+ if ((flags & TODO_dump_func) && dump_file && current_function_decl)
{
if (cfun->curr_properties & PROP_trees)
- dump_function_to_file (current_function_decl,
- dump_file, dump_flags);
+ dump_function_to_file (current_function_decl, dump_file, dump_flags);
else
{
if (dump_flags & TDF_SLIM)
@@ -977,7 +963,7 @@ execute_function_todo (void *data)
else
print_rtl (dump_file, get_insns ());
- if (cfun->curr_properties & PROP_cfg
+ if ((cfun->curr_properties & PROP_cfg)
&& graph_dump_format != no_graph
&& (dump_flags & TDF_GRAPH))
print_rtl_graph_with_bb (dump_file_name, get_insns ());
@@ -1046,8 +1032,7 @@ execute_todo (unsigned int flags)
cgraph_remove_unreachable_nodes (true, dump_file);
}
- if ((flags & TODO_dump_cgraph)
- && dump_file && !current_function_decl)
+ if ((flags & TODO_dump_cgraph) && dump_file && !current_function_decl)
{
gcc_assert (!cfun);
dump_cgraph (dump_file);
@@ -1057,9 +1042,7 @@ execute_todo (unsigned int flags)
}
if (flags & TODO_ggc_collect)
- {
- ggc_collect ();
- }
+ ggc_collect ();
/* Now that the dumping has been done, we can get rid of the optional
df problems. */
@@ -1228,8 +1211,6 @@ execute_one_ipa_transform_pass (struct cgraph_node *node,
pass_fini_dump_file (pass);
current_pass = NULL;
- /* Reset in_gimple_form to not break non-unit-at-a-time mode. */
- in_gimple_form = false;
}
static bool
@@ -1261,6 +1242,7 @@ execute_one_pass (struct opt_pass *pass)
}
current_pass = pass;
+
/* See if we're supposed to run this pass. */
if (pass->gate && !pass->gate ())
return false;
@@ -1329,8 +1311,6 @@ execute_one_pass (struct opt_pass *pass)
|| pass->type != RTL_PASS);
current_pass = NULL;
- /* Reset in_gimple_form to not break non-unit-at-a-time mode. */
- in_gimple_form = false;
return true;
}
diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog
index 92ce6b27606..23f72f3fd9f 100644
--- a/gcc/po/ChangeLog
+++ b/gcc/po/ChangeLog
@@ -1,3 +1,15 @@
+2008-08-30 Joseph S. Myers <joseph@codesourcery.com>
+
+ * fi.po: New.
+
+2008-08-27 Joseph S. Myers <joseph@codesourcery.com>
+
+ * gcc.pot: Regenerate.
+
+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/gcc.pot b/gcc/po/gcc.pot
index 2e4c1bbbfb8..85a5b79ce5a 100644
--- a/gcc/po/gcc.pot
+++ b/gcc/po/gcc.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n"
-"POT-Creation-Date: 2008-02-01 16:21+0000\n"
+"POT-Creation-Date: 2008-08-27 17:39+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -16,334 +16,319 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: c-decl.c:3813
+#: c-decl.c:3799
msgid "<anonymous>"
msgstr ""
-#: c-format.c:357 c-format.c:381
+#: c-format.c:361 c-format.c:385 config/i386/msformat-c.c:49
msgid "' ' flag"
msgstr ""
-#: c-format.c:357 c-format.c:381
+#: c-format.c:361 c-format.c:385 config/i386/msformat-c.c:49
msgid "the ' ' printf flag"
msgstr ""
-#: c-format.c:358 c-format.c:382 c-format.c:416 c-format.c:428 c-format.c:487
+#: c-format.c:362 c-format.c:386 c-format.c:420 c-format.c:432 c-format.c:491
+#: config/i386/msformat-c.c:50
msgid "'+' flag"
msgstr ""
-#: c-format.c:358 c-format.c:382 c-format.c:416 c-format.c:428
+#: c-format.c:362 c-format.c:386 c-format.c:420 c-format.c:432
+#: config/i386/msformat-c.c:50
msgid "the '+' printf flag"
msgstr ""
-#: c-format.c:359 c-format.c:383 c-format.c:429 c-format.c:463
+#: c-format.c:363 c-format.c:387 c-format.c:433 c-format.c:467
+#: config/i386/msformat-c.c:51 config/i386/msformat-c.c:86
msgid "'#' flag"
msgstr ""
-#: c-format.c:359 c-format.c:383 c-format.c:429
+#: c-format.c:363 c-format.c:387 c-format.c:433 config/i386/msformat-c.c:51
msgid "the '#' printf flag"
msgstr ""
-#: c-format.c:360 c-format.c:384 c-format.c:461
+#: c-format.c:364 c-format.c:388 c-format.c:465 config/i386/msformat-c.c:52
msgid "'0' flag"
msgstr ""
-#: c-format.c:360 c-format.c:384
+#: c-format.c:364 c-format.c:388 config/i386/msformat-c.c:52
msgid "the '0' printf flag"
msgstr ""
-#: c-format.c:361 c-format.c:385 c-format.c:460 c-format.c:490
+#: c-format.c:365 c-format.c:389 c-format.c:464 c-format.c:494
+#: config/i386/msformat-c.c:53
msgid "'-' flag"
msgstr ""
-#: c-format.c:361 c-format.c:385
+#: c-format.c:365 c-format.c:389 config/i386/msformat-c.c:53
msgid "the '-' printf flag"
msgstr ""
-#: c-format.c:362 c-format.c:443
+#: c-format.c:366 c-format.c:447 config/i386/msformat-c.c:54
+#: config/i386/msformat-c.c:74
msgid "''' flag"
msgstr ""
-#: c-format.c:362
+#: c-format.c:366 config/i386/msformat-c.c:54
msgid "the ''' printf flag"
msgstr ""
-#: c-format.c:363 c-format.c:444
+#: c-format.c:367 c-format.c:448
msgid "'I' flag"
msgstr ""
-#: c-format.c:363
+#: c-format.c:367
msgid "the 'I' printf flag"
msgstr ""
-#: c-format.c:364 c-format.c:386 c-format.c:441 c-format.c:464 c-format.c:491
-#: c-format.c:1623 config/sol2-c.c:45
+#: c-format.c:368 c-format.c:390 c-format.c:445 c-format.c:468 c-format.c:495
+#: c-format.c:1629 config/sol2-c.c:45 config/i386/msformat-c.c:55
+#: config/i386/msformat-c.c:72
msgid "field width"
msgstr ""
-#: c-format.c:364 c-format.c:386 config/sol2-c.c:45
+#: c-format.c:368 c-format.c:390 config/sol2-c.c:45
+#: config/i386/msformat-c.c:55
msgid "field width in printf format"
msgstr ""
-#: c-format.c:365 c-format.c:387 c-format.c:418 c-format.c:431
+#: c-format.c:369 c-format.c:391 c-format.c:422 c-format.c:435
+#: config/i386/msformat-c.c:56
msgid "precision"
msgstr ""
-#: c-format.c:365 c-format.c:387 c-format.c:418 c-format.c:431
+#: c-format.c:369 c-format.c:391 c-format.c:422 c-format.c:435
+#: config/i386/msformat-c.c:56
msgid "precision in printf format"
msgstr ""
-#: c-format.c:366 c-format.c:388 c-format.c:419 c-format.c:432 c-format.c:442
-#: c-format.c:494 config/sol2-c.c:46
+#: c-format.c:370 c-format.c:392 c-format.c:423 c-format.c:436 c-format.c:446
+#: c-format.c:498 config/sol2-c.c:46 config/i386/msformat-c.c:57
+#: config/i386/msformat-c.c:73
msgid "length modifier"
msgstr ""
-#: c-format.c:366 c-format.c:388 c-format.c:419 c-format.c:432
-#: config/sol2-c.c:46
+#: c-format.c:370 c-format.c:392 c-format.c:423 c-format.c:436
+#: config/sol2-c.c:46 config/i386/msformat-c.c:57
msgid "length modifier in printf format"
msgstr ""
-#: c-format.c:417 c-format.c:430
+#: c-format.c:421 c-format.c:434
msgid "'q' flag"
msgstr ""
-#: c-format.c:417 c-format.c:430
+#: c-format.c:421 c-format.c:434
msgid "the 'q' diagnostic flag"
msgstr ""
-#: c-format.c:438
+#: c-format.c:442 config/i386/msformat-c.c:70
msgid "assignment suppression"
msgstr ""
-#: c-format.c:438
+#: c-format.c:442 config/i386/msformat-c.c:70
msgid "the assignment suppression scanf feature"
msgstr ""
-#: c-format.c:439
+#: c-format.c:443 config/i386/msformat-c.c:71
msgid "'a' flag"
msgstr ""
-#: c-format.c:439
+#: c-format.c:443 config/i386/msformat-c.c:71
msgid "the 'a' scanf flag"
msgstr ""
-#: c-format.c:440
+#: c-format.c:444
msgid "'m' flag"
msgstr ""
-#: c-format.c:440
+#: c-format.c:444
msgid "the 'm' scanf flag"
msgstr ""
-#: c-format.c:441
+#: c-format.c:445 config/i386/msformat-c.c:72
msgid "field width in scanf format"
msgstr ""
-#: c-format.c:442
+#: c-format.c:446 config/i386/msformat-c.c:73
msgid "length modifier in scanf format"
msgstr ""
-#: c-format.c:443
+#: c-format.c:447 config/i386/msformat-c.c:74
msgid "the ''' scanf flag"
msgstr ""
-#: c-format.c:444
+#: c-format.c:448
msgid "the 'I' scanf flag"
msgstr ""
-#: c-format.c:459
+#: c-format.c:463
msgid "'_' flag"
msgstr ""
-#: c-format.c:459
+#: c-format.c:463
msgid "the '_' strftime flag"
msgstr ""
-#: c-format.c:460
+#: c-format.c:464
msgid "the '-' strftime flag"
msgstr ""
-#: c-format.c:461
+#: c-format.c:465
msgid "the '0' strftime flag"
msgstr ""
-#: c-format.c:462 c-format.c:486
+#: c-format.c:466 c-format.c:490
msgid "'^' flag"
msgstr ""
-#: c-format.c:462
+#: c-format.c:466
msgid "the '^' strftime flag"
msgstr ""
-#: c-format.c:463
+#: c-format.c:467 config/i386/msformat-c.c:86
msgid "the '#' strftime flag"
msgstr ""
-#: c-format.c:464
+#: c-format.c:468
msgid "field width in strftime format"
msgstr ""
-#: c-format.c:465
+#: c-format.c:469
msgid "'E' modifier"
msgstr ""
-#: c-format.c:465
+#: c-format.c:469
msgid "the 'E' strftime modifier"
msgstr ""
-#: c-format.c:466
+#: c-format.c:470
msgid "'O' modifier"
msgstr ""
-#: c-format.c:466
+#: c-format.c:470
msgid "the 'O' strftime modifier"
msgstr ""
-#: c-format.c:467
+#: c-format.c:471
msgid "the 'O' modifier"
msgstr ""
-#: c-format.c:485
+#: c-format.c:489
msgid "fill character"
msgstr ""
-#: c-format.c:485
+#: c-format.c:489
msgid "fill character in strfmon format"
msgstr ""
-#: c-format.c:486
+#: c-format.c:490
msgid "the '^' strfmon flag"
msgstr ""
-#: c-format.c:487
+#: c-format.c:491
msgid "the '+' strfmon flag"
msgstr ""
-#: c-format.c:488
+#: c-format.c:492
msgid "'(' flag"
msgstr ""
-#: c-format.c:488
+#: c-format.c:492
msgid "the '(' strfmon flag"
msgstr ""
-#: c-format.c:489
+#: c-format.c:493
msgid "'!' flag"
msgstr ""
-#: c-format.c:489
+#: c-format.c:493
msgid "the '!' strfmon flag"
msgstr ""
-#: c-format.c:490
+#: c-format.c:494
msgid "the '-' strfmon flag"
msgstr ""
-#: c-format.c:491
+#: c-format.c:495
msgid "field width in strfmon format"
msgstr ""
-#: c-format.c:492
+#: c-format.c:496
msgid "left precision"
msgstr ""
-#: c-format.c:492
+#: c-format.c:496
msgid "left precision in strfmon format"
msgstr ""
-#: c-format.c:493
+#: c-format.c:497
msgid "right precision"
msgstr ""
-#: c-format.c:493
+#: c-format.c:497
msgid "right precision in strfmon format"
msgstr ""
-#: c-format.c:494
+#: c-format.c:498
msgid "length modifier in strfmon format"
msgstr ""
-#: c-format.c:1725
+#: c-format.c:1731
msgid "field precision"
msgstr ""
-#: c-incpath.c:74
-#, c-format
-msgid "ignoring duplicate directory \"%s\"\n"
-msgstr ""
-
-#: c-incpath.c:77
-#, c-format
-msgid " as it is a non-system directory that duplicates a system directory\n"
-msgstr ""
-
-#: c-incpath.c:81
-#, c-format
-msgid "ignoring nonexistent directory \"%s\"\n"
-msgstr ""
-
-#: c-incpath.c:344
-#, c-format
-msgid "#include \"...\" search starts here:\n"
-msgstr ""
-
-#: c-incpath.c:348
-#, c-format
-msgid "#include <...> search starts here:\n"
-msgstr ""
-
-#: c-incpath.c:353
-#, c-format
-msgid "End of search list.\n"
-msgstr ""
-
-#: c-opts.c:1505
+#: c-opts.c:1455 fortran/cpp.c:548
msgid "<built-in>"
msgstr ""
-#: c-opts.c:1523
+#. Handle deferred options from command-line.
+#: c-opts.c:1473 fortran/cpp.c:553
msgid "<command-line>"
msgstr ""
-#: c-typeck.c:2459 c-typeck.c:4862 c-typeck.c:4864 c-typeck.c:4872
-#: c-typeck.c:4902 c-typeck.c:6278
+#: c-typeck.c:2460 c-typeck.c:4890 c-typeck.c:4893 c-typeck.c:4901
+#: c-typeck.c:4931 c-typeck.c:6301
msgid "initializer element is not constant"
msgstr ""
-#: c-typeck.c:4665
+#: c-typeck.c:4680
msgid "array initialized from parenthesized string constant"
msgstr ""
-#: c-typeck.c:4726 cp/typeck2.c:677
+#: c-typeck.c:4742 cp/typeck2.c:752
#, gcc-internal-format
msgid "char-array initialized from wide string"
msgstr ""
-#: c-typeck.c:4731
-msgid "wchar_t-array initialized from non-wide string"
+#: c-typeck.c:4750
+msgid "wide character array initialized from non-wide string"
+msgstr ""
+
+#: c-typeck.c:4756
+msgid "wide character array initialized from incompatible wide string"
msgstr ""
-#: c-typeck.c:4749 cp/typeck2.c:697
+#: c-typeck.c:4774 cp/typeck2.c:780
#, gcc-internal-format
msgid "initializer-string for array of chars is too long"
msgstr ""
-#: c-typeck.c:4755
+#: c-typeck.c:4780
msgid "array of inappropriate type initialized from string constant"
msgstr ""
#. ??? This should not be an error when inlining calls to
#. unprototyped functions.
-#: c-typeck.c:4819 c-typeck.c:4344 cp/typeck.c:1563
+#: c-typeck.c:4847 c-typeck.c:4353 cp/typeck.c:1609
#, gcc-internal-format
msgid "invalid use of non-lvalue array"
msgstr ""
-#: c-typeck.c:4845
+#: c-typeck.c:4873
msgid "array initialized from non-constant array expression"
msgstr ""
-#: c-typeck.c:4909 c-typeck.c:6282
+#: c-typeck.c:4938 c-typeck.c:6306
#, gcc-internal-format
msgid "initializer element is not computable at load time"
msgstr ""
@@ -352,287 +337,287 @@ msgstr ""
#. of VLAs themselves count as VLAs, it does not make
#. sense to permit them to be initialized given that
#. ordinary VLAs may not be initialized.
-#: c-typeck.c:4920 c-decl.c:3220 c-decl.c:3235
+#: c-typeck.c:4949 c-decl.c:3204 c-decl.c:3219
#, gcc-internal-format
msgid "variable-sized object may not be initialized"
msgstr ""
-#: c-typeck.c:4924
+#: c-typeck.c:4953
msgid "invalid initializer"
msgstr ""
-#: c-typeck.c:5398
+#: c-typeck.c:5427
msgid "extra brace group at end of initializer"
msgstr ""
-#: c-typeck.c:5418
+#: c-typeck.c:5447
msgid "missing braces around initializer"
msgstr ""
-#: c-typeck.c:5479
+#: c-typeck.c:5508
msgid "braces around scalar initializer"
msgstr ""
-#: c-typeck.c:5536
+#: c-typeck.c:5565
msgid "initialization of flexible array member in a nested context"
msgstr ""
-#: c-typeck.c:5538
+#: c-typeck.c:5568
msgid "initialization of a flexible array member"
msgstr ""
-#: c-typeck.c:5565
+#: c-typeck.c:5596
msgid "missing initializer"
msgstr ""
-#: c-typeck.c:5587
+#: c-typeck.c:5618
msgid "empty scalar initializer"
msgstr ""
-#: c-typeck.c:5592
+#: c-typeck.c:5623
msgid "extra elements in scalar initializer"
msgstr ""
-#: c-typeck.c:5689 c-typeck.c:5749
+#: c-typeck.c:5720 c-typeck.c:5780
msgid "array index in non-array initializer"
msgstr ""
-#: c-typeck.c:5694 c-typeck.c:5802
+#: c-typeck.c:5725 c-typeck.c:5833
msgid "field name not in record or union initializer"
msgstr ""
-#: c-typeck.c:5740
+#: c-typeck.c:5771
msgid "array index in initializer not of integer type"
msgstr ""
-#: c-typeck.c:5745 c-typeck.c:5747
+#: c-typeck.c:5776 c-typeck.c:5778
msgid "nonconstant array index in initializer"
msgstr ""
-#: c-typeck.c:5751 c-typeck.c:5754
+#: c-typeck.c:5782 c-typeck.c:5785
msgid "array index in initializer exceeds array bounds"
msgstr ""
-#: c-typeck.c:5765
+#: c-typeck.c:5796
msgid "empty index range in initializer"
msgstr ""
-#: c-typeck.c:5774
+#: c-typeck.c:5805
msgid "array index range in initializer exceeds array bounds"
msgstr ""
-#: c-typeck.c:5849 c-typeck.c:5872 c-typeck.c:6346
+#: c-typeck.c:5880 c-typeck.c:5903 c-typeck.c:6370
msgid "initialized field with side-effects overwritten"
msgstr ""
-#: c-typeck.c:5851 c-typeck.c:5874 c-typeck.c:6348
+#: c-typeck.c:5882 c-typeck.c:5905 c-typeck.c:6372
msgid "initialized field overwritten"
msgstr ""
-#: c-typeck.c:6556
+#: c-typeck.c:6580
msgid "excess elements in char array initializer"
msgstr ""
-#: c-typeck.c:6563 c-typeck.c:6609
+#: c-typeck.c:6587 c-typeck.c:6634
msgid "excess elements in struct initializer"
msgstr ""
-#: c-typeck.c:6624
+#: c-typeck.c:6649
msgid "non-static initialization of a flexible array member"
msgstr ""
-#: c-typeck.c:6692
+#: c-typeck.c:6718
msgid "excess elements in union initializer"
msgstr ""
-#: c-typeck.c:6779
+#: c-typeck.c:6806
msgid "excess elements in array initializer"
msgstr ""
-#: c-typeck.c:6809
+#: c-typeck.c:6837
msgid "excess elements in vector initializer"
msgstr ""
-#: c-typeck.c:6833
+#: c-typeck.c:6862
msgid "excess elements in scalar initializer"
msgstr ""
-#: cfgrtl.c:1923
+#: cfgrtl.c:1915
msgid "flow control insn inside a basic block"
msgstr ""
-#: cfgrtl.c:2052
+#: cfgrtl.c:2044
msgid "wrong insn in the fallthru edge"
msgstr ""
-#: cfgrtl.c:2108
+#: cfgrtl.c:2100
msgid "insn outside basic block"
msgstr ""
-#: cfgrtl.c:2115
+#: cfgrtl.c:2107
msgid "return not followed by barrier"
msgstr ""
-#: cgraph.c:340 ipa-inline.c:417
+#: cgraph.c:635 ipa-inline.c:423
msgid "function body not available"
msgstr ""
-#: cgraph.c:342 cgraphbuild.c:96
+#: cgraph.c:637 cgraphbuild.c:95
msgid "redefined extern inline functions are not considered for inlining"
msgstr ""
-#: cgraph.c:345 cgraphbuild.c:103
+#: cgraph.c:640 cgraphbuild.c:102
msgid "function not considered for inlining"
msgstr ""
-#: cgraph.c:347 cgraphbuild.c:99
+#: cgraph.c:642 cgraphbuild.c:98
msgid "function not inlinable"
msgstr ""
-#: cgraphbuild.c:101
+#: cgraphbuild.c:100
msgid "mismatched arguments"
msgstr ""
-#: collect2.c:382 gcc.c:6896
+#: collect2.c:395 gcc.c:6990
#, c-format
msgid "internal gcc abort in %s, at %s:%d"
msgstr ""
-#: collect2.c:903
+#: collect2.c:909
#, c-format
msgid "no arguments"
msgstr ""
-#: collect2.c:1277 collect2.c:1425 collect2.c:1460
+#: collect2.c:1283 collect2.c:1431 collect2.c:1466
#, c-format
msgid "fopen %s"
msgstr ""
-#: collect2.c:1280 collect2.c:1430 collect2.c:1463
+#: collect2.c:1286 collect2.c:1436 collect2.c:1469
#, c-format
msgid "fclose %s"
msgstr ""
-#: collect2.c:1289
+#: collect2.c:1295
#, c-format
msgid "collect2 version %s"
msgstr ""
-#: collect2.c:1379
+#: collect2.c:1385
#, c-format
msgid "%d constructor(s) found\n"
msgstr ""
-#: collect2.c:1380
+#: collect2.c:1386
#, c-format
msgid "%d destructor(s) found\n"
msgstr ""
-#: collect2.c:1381
+#: collect2.c:1387
#, c-format
msgid "%d frame table(s) found\n"
msgstr ""
-#: collect2.c:1518
+#: collect2.c:1524
#, c-format
msgid "can't get program status"
msgstr ""
-#: collect2.c:1587
+#: collect2.c:1593
#, c-format
msgid "could not open response file %s"
msgstr ""
-#: collect2.c:1592
+#: collect2.c:1598
#, c-format
msgid "could not write to response file %s"
msgstr ""
-#: collect2.c:1597
+#: collect2.c:1603
#, c-format
msgid "could not close response file %s"
msgstr ""
-#: collect2.c:1615
+#: collect2.c:1621
#, c-format
msgid "[cannot find %s]"
msgstr ""
-#: collect2.c:1630
+#: collect2.c:1636
#, c-format
msgid "cannot find '%s'"
msgstr ""
-#: collect2.c:1634 collect2.c:2126 collect2.c:2281 gcc.c:2974
+#: collect2.c:1640 collect2.c:2131 collect2.c:2286 gcc.c:2997
#, c-format
msgid "pex_init failed"
msgstr ""
-#: collect2.c:1672
+#: collect2.c:1678
#, c-format
msgid "[Leaving %s]\n"
msgstr ""
-#: collect2.c:1892
+#: collect2.c:1899
#, c-format
msgid ""
"\n"
"write_c_file - output name is %s, prefix is %s\n"
msgstr ""
-#: collect2.c:2100
+#: collect2.c:2105
#, c-format
msgid "cannot find 'nm'"
msgstr ""
-#: collect2.c:2147
+#: collect2.c:2152
#, c-format
msgid "can't open nm output"
msgstr ""
-#: collect2.c:2191
+#: collect2.c:2196
#, c-format
msgid "init function found in object %s"
msgstr ""
-#: collect2.c:2199
+#: collect2.c:2204
#, c-format
msgid "fini function found in object %s"
msgstr ""
-#: collect2.c:2302
+#: collect2.c:2307
#, c-format
msgid "can't open ldd output"
msgstr ""
-#: collect2.c:2305
+#: collect2.c:2310
#, c-format
msgid ""
"\n"
"ldd output with constructors/destructors.\n"
msgstr ""
-#: collect2.c:2320
+#: collect2.c:2325
#, c-format
msgid "dynamic dependency %s not found"
msgstr ""
-#: collect2.c:2332
+#: collect2.c:2337
#, c-format
msgid "unable to open dynamic dependency '%s'"
msgstr ""
-#: collect2.c:2488
+#: collect2.c:2493
#, c-format
msgid "%s: not a COFF file"
msgstr ""
-#: collect2.c:2608
+#: collect2.c:2613
#, c-format
msgid "%s: cannot open as COFF file"
msgstr ""
-#: collect2.c:2666
+#: collect2.c:2671
#, c-format
msgid "library lib%s not found"
msgstr ""
@@ -647,17 +632,12 @@ msgstr ""
msgid "too many input files"
msgstr ""
-#: diagnostic.c:188
-#, c-format
-msgid "%s:%d: confused by earlier errors, bailing out\n"
-msgstr ""
-
-#: diagnostic.c:235
+#: diagnostic.c:186
#, c-format
msgid "compilation terminated due to -Wfatal-errors.\n"
msgstr ""
-#: diagnostic.c:244
+#: diagnostic.c:195
#, c-format
msgid ""
"Please submit a full bug report,\n"
@@ -665,21 +645,26 @@ msgid ""
"See %s for instructions.\n"
msgstr ""
-#: diagnostic.c:253
+#: diagnostic.c:204
#, c-format
msgid "compilation terminated.\n"
msgstr ""
-#: diagnostic.c:641
+#: diagnostic.c:382
+#, c-format
+msgid "%s:%d: confused by earlier errors, bailing out\n"
+msgstr ""
+
+#: diagnostic.c:680
#, c-format
msgid "Internal compiler error: Error reporting routines re-entered.\n"
msgstr ""
-#: final.c:1136
+#: final.c:1131
msgid "negative insn length"
msgstr ""
-#: final.c:2615
+#: final.c:2601
msgid "could not split insn"
msgstr ""
@@ -723,118 +708,118 @@ msgstr ""
#. handle them.
#. We can't handle floating point constants;
#. PRINT_OPERAND must handle them.
-#: final.c:3446 vmsdbgout.c:487 config/i386/i386.c:8195
-#: config/pdp11/pdp11.c:1704
+#: final.c:3456 vmsdbgout.c:487 config/i386/i386.c:9651
+#: config/pdp11/pdp11.c:1708
#, c-format
msgid "floating constant misused"
msgstr ""
-#: final.c:3507 vmsdbgout.c:544 config/i386/i386.c:8276
-#: config/pdp11/pdp11.c:1751
+#: final.c:3518 vmsdbgout.c:544 config/i386/i386.c:9732
+#: config/pdp11/pdp11.c:1755
#, c-format
msgid "invalid expression as operand"
msgstr ""
-#: gcc.c:1704
+#: gcc.c:1719
#, c-format
msgid "Using built-in specs.\n"
msgstr ""
-#: gcc.c:1883
+#: gcc.c:1897
#, c-format
msgid ""
"Setting spec %s to '%s'\n"
"\n"
msgstr ""
-#: gcc.c:1998
+#: gcc.c:2012
#, c-format
msgid "Reading specs from %s\n"
msgstr ""
-#: gcc.c:2094 gcc.c:2113
+#: gcc.c:2108 gcc.c:2127
#, c-format
msgid "specs %%include syntax malformed after %ld characters"
msgstr ""
-#: gcc.c:2121
+#: gcc.c:2135
#, c-format
msgid "could not find specs file %s\n"
msgstr ""
-#: gcc.c:2138 gcc.c:2146 gcc.c:2155 gcc.c:2164
+#: gcc.c:2152 gcc.c:2160 gcc.c:2169 gcc.c:2178
#, c-format
msgid "specs %%rename syntax malformed after %ld characters"
msgstr ""
-#: gcc.c:2173
+#: gcc.c:2187
#, c-format
msgid "specs %s spec was not found to be renamed"
msgstr ""
-#: gcc.c:2180
+#: gcc.c:2194
#, c-format
msgid "%s: attempt to rename spec '%s' to already defined spec '%s'"
msgstr ""
-#: gcc.c:2185
+#: gcc.c:2199
#, c-format
msgid "rename spec %s to %s\n"
msgstr ""
-#: gcc.c:2187
+#: gcc.c:2201
#, c-format
msgid ""
"spec is '%s'\n"
"\n"
msgstr ""
-#: gcc.c:2200
+#: gcc.c:2214
#, c-format
msgid "specs unknown %% command after %ld characters"
msgstr ""
-#: gcc.c:2211 gcc.c:2224
+#: gcc.c:2225 gcc.c:2238
#, c-format
msgid "specs file malformed after %ld characters"
msgstr ""
-#: gcc.c:2277
+#: gcc.c:2290
#, c-format
msgid "spec file has no spec for linking"
msgstr ""
-#: gcc.c:2605 gcc.c:4745
+#: gcc.c:2618 gcc.c:4827
#, c-format
msgid "%s\n"
msgstr ""
-#: gcc.c:2805
+#: gcc.c:2819
#, c-format
msgid "system path '%s' is not absolute"
msgstr ""
-#: gcc.c:2868
+#: gcc.c:2891
#, c-format
msgid "-pipe not supported"
msgstr ""
-#: gcc.c:2930
+#: gcc.c:2953
#, c-format
msgid ""
"\n"
"Go ahead? (y or n) "
msgstr ""
-#: gcc.c:3013
+#: gcc.c:3036
msgid "failed to get exit status"
msgstr ""
-#: gcc.c:3019
+#: gcc.c:3042
msgid "failed to get process times"
msgstr ""
-#: gcc.c:3045
+#: gcc.c:3068
#, c-format
msgid ""
"Internal error: %s (program %s)\n"
@@ -842,213 +827,217 @@ msgid ""
"See %s for instructions."
msgstr ""
-#: gcc.c:3071
+#: gcc.c:3094
#, c-format
msgid "# %s %.2f %.2f\n"
msgstr ""
-#: gcc.c:3205
+#: gcc.c:3228
#, c-format
msgid "Usage: %s [options] file...\n"
msgstr ""
-#: gcc.c:3206
+#: gcc.c:3229
msgid "Options:\n"
msgstr ""
-#: gcc.c:3208
+#: gcc.c:3231
msgid " -pass-exit-codes Exit with highest error code from a phase\n"
msgstr ""
-#: gcc.c:3209
+#: gcc.c:3232
msgid " --help Display this information\n"
msgstr ""
-#: gcc.c:3210
+#: gcc.c:3233
msgid ""
" --target-help Display target specific command line options\n"
msgstr ""
-#: gcc.c:3211
+#: gcc.c:3234
msgid ""
" --help={target|optimizers|warnings|undocumented|params}[,{[^]joined|[^]"
"separate}]\n"
msgstr ""
-#: gcc.c:3212
+#: gcc.c:3235
msgid ""
" Display specific types of command line options\n"
msgstr ""
-#: gcc.c:3214
+#: gcc.c:3237
msgid " (Use '-v --help' to display command line options of sub-processes)\n"
msgstr ""
-#: gcc.c:3215
+#: gcc.c:3238
msgid " -dumpspecs Display all of the built in spec strings\n"
msgstr ""
-#: gcc.c:3216
+#: gcc.c:3239
msgid " -dumpversion Display the version of the compiler\n"
msgstr ""
-#: gcc.c:3217
+#: gcc.c:3240
msgid " -dumpmachine Display the compiler's target processor\n"
msgstr ""
-#: gcc.c:3218
+#: gcc.c:3241
msgid ""
" -print-search-dirs Display the directories in the compiler's search "
"path\n"
msgstr ""
-#: gcc.c:3219
+#: gcc.c:3242
msgid ""
" -print-libgcc-file-name Display the name of the compiler's companion "
"library\n"
msgstr ""
-#: gcc.c:3220
+#: gcc.c:3243
msgid " -print-file-name=<lib> Display the full path to library <lib>\n"
msgstr ""
-#: gcc.c:3221
+#: gcc.c:3244
msgid ""
" -print-prog-name=<prog> Display the full path to compiler component "
"<prog>\n"
msgstr ""
-#: gcc.c:3222
+#: gcc.c:3245
msgid ""
" -print-multi-directory Display the root directory for versions of "
"libgcc\n"
msgstr ""
-#: gcc.c:3223
+#: gcc.c:3246
msgid ""
" -print-multi-lib Display the mapping between command line options "
"and\n"
" multiple library search directories\n"
msgstr ""
-#: gcc.c:3226
+#: gcc.c:3249
msgid " -print-multi-os-directory Display the relative path to OS libraries\n"
msgstr ""
-#: gcc.c:3227
+#: gcc.c:3250
+msgid " -print-sysroot Display the target libraries directory\n"
+msgstr ""
+
+#: gcc.c:3251
msgid ""
" -print-sysroot-headers-suffix Display the sysroot suffix used to find "
"headers\n"
msgstr ""
-#: gcc.c:3228
+#: gcc.c:3252
msgid ""
" -Wa,<options> Pass comma-separated <options> on to the "
"assembler\n"
msgstr ""
-#: gcc.c:3229
+#: gcc.c:3253
msgid ""
" -Wp,<options> Pass comma-separated <options> on to the "
"preprocessor\n"
msgstr ""
-#: gcc.c:3230
+#: gcc.c:3254
msgid ""
" -Wl,<options> Pass comma-separated <options> on to the linker\n"
msgstr ""
-#: gcc.c:3231
+#: gcc.c:3255
msgid " -Xassembler <arg> Pass <arg> on to the assembler\n"
msgstr ""
-#: gcc.c:3232
+#: gcc.c:3256
msgid " -Xpreprocessor <arg> Pass <arg> on to the preprocessor\n"
msgstr ""
-#: gcc.c:3233
+#: gcc.c:3257
msgid " -Xlinker <arg> Pass <arg> on to the linker\n"
msgstr ""
-#: gcc.c:3234
+#: gcc.c:3258
msgid ""
" -combine Pass multiple source files to compiler at once\n"
msgstr ""
-#: gcc.c:3235
+#: gcc.c:3259
msgid " -save-temps Do not delete intermediate files\n"
msgstr ""
-#: gcc.c:3236
+#: gcc.c:3260
msgid " -pipe Use pipes rather than intermediate files\n"
msgstr ""
-#: gcc.c:3237
+#: gcc.c:3261
msgid " -time Time the execution of each subprocess\n"
msgstr ""
-#: gcc.c:3238
+#: gcc.c:3262
msgid ""
" -specs=<file> Override built-in specs with the contents of "
"<file>\n"
msgstr ""
-#: gcc.c:3239
+#: gcc.c:3263
msgid ""
" -std=<standard> Assume that the input sources are for <standard>\n"
msgstr ""
-#: gcc.c:3240
+#: gcc.c:3264
msgid ""
" --sysroot=<directory> Use <directory> as the root directory for "
"headers\n"
" and libraries\n"
msgstr ""
-#: gcc.c:3243
+#: gcc.c:3267
msgid ""
" -B <directory> Add <directory> to the compiler's search paths\n"
msgstr ""
-#: gcc.c:3244
+#: gcc.c:3268
msgid " -b <machine> Run gcc for target <machine>, if installed\n"
msgstr ""
-#: gcc.c:3245
+#: gcc.c:3269
msgid ""
" -V <version> Run gcc version number <version>, if installed\n"
msgstr ""
-#: gcc.c:3246
+#: gcc.c:3270
msgid ""
" -v Display the programs invoked by the compiler\n"
msgstr ""
-#: gcc.c:3247
+#: gcc.c:3271
msgid ""
" -### Like -v but options quoted and commands not "
"executed\n"
msgstr ""
-#: gcc.c:3248
+#: gcc.c:3272
msgid ""
" -E Preprocess only; do not compile, assemble or "
"link\n"
msgstr ""
-#: gcc.c:3249
+#: gcc.c:3273
msgid " -S Compile only; do not assemble or link\n"
msgstr ""
-#: gcc.c:3250
+#: gcc.c:3274
msgid " -c Compile and assemble, but do not link\n"
msgstr ""
-#: gcc.c:3251
+#: gcc.c:3275
msgid " -o <file> Place the output into <file>\n"
msgstr ""
-#: gcc.c:3252
+#: gcc.c:3276
msgid ""
" -x <language> Specify the language of the following input "
"files\n"
@@ -1059,7 +1048,7 @@ msgid ""
"extension\n"
msgstr ""
-#: gcc.c:3259
+#: gcc.c:3283
#, c-format
msgid ""
"\n"
@@ -1068,27 +1057,27 @@ msgid ""
" other options on to these processes the -W<letter> options must be used.\n"
msgstr ""
-#: gcc.c:3383
+#: gcc.c:3406
#, c-format
msgid "'-%c' option must have argument"
msgstr ""
-#: gcc.c:3405
+#: gcc.c:3427
#, c-format
msgid "couldn't run '%s': %s"
msgstr ""
#. translate_options () has turned --version into -fversion.
-#: gcc.c:3606
+#: gcc.c:3628
#, c-format
msgid "%s %s%s\n"
msgstr ""
-#: gcc.c:3609 gcov.c:426 fortran/gfortranspec.c:380 java/jcf-dump.c:1168
+#: gcc.c:3631 gcov.c:427 fortran/gfortranspec.c:383 java/jcf-dump.c:1170
msgid "(C)"
msgstr ""
-#: gcc.c:3610 java/jcf-dump.c:1169
+#: gcc.c:3632 java/jcf-dump.c:1171
#, c-format
msgid ""
"This is free software; see the source for copying conditions. There is NO\n"
@@ -1096,207 +1085,212 @@ msgid ""
"\n"
msgstr ""
-#: gcc.c:3722
+#: gcc.c:3746
#, c-format
msgid "argument to '-Xlinker' is missing"
msgstr ""
-#: gcc.c:3730
+#: gcc.c:3754
#, c-format
msgid "argument to '-Xpreprocessor' is missing"
msgstr ""
-#: gcc.c:3737
+#: gcc.c:3761
#, c-format
msgid "argument to '-Xassembler' is missing"
msgstr ""
-#: gcc.c:3744
+#: gcc.c:3768
#, c-format
msgid "argument to '-l' is missing"
msgstr ""
-#: gcc.c:3765
+#: gcc.c:3789
#, c-format
msgid "argument to '-specs' is missing"
msgstr ""
-#: gcc.c:3779
+#: gcc.c:3803
#, c-format
msgid "argument to '-specs=' is missing"
msgstr ""
-#: gcc.c:3820
+#: gcc.c:3825
+#, c-format
+msgid "argument to '-wrapper' is missing"
+msgstr ""
+
+#: gcc.c:3853
#, c-format
msgid "'-%c' must come at the start of the command line"
msgstr ""
-#: gcc.c:3829
+#: gcc.c:3862
#, c-format
msgid "argument to '-B' is missing"
msgstr ""
-#: gcc.c:4179
+#: gcc.c:4216
#, c-format
msgid "argument to '-x' is missing"
msgstr ""
-#: gcc.c:4207
+#: gcc.c:4244
#, c-format
msgid "argument to '-%s' is missing"
msgstr ""
-#: gcc.c:4535
+#: gcc.c:4617
#, c-format
msgid "switch '%s' does not start with '-'"
msgstr ""
-#: gcc.c:4679
+#: gcc.c:4761
#, c-format
msgid "spec '%s' invalid"
msgstr ""
-#: gcc.c:4818
+#: gcc.c:4900
#, c-format
msgid "spec '%s' has invalid '%%0%c'"
msgstr ""
-#: gcc.c:5047
+#: gcc.c:5129
#, c-format
msgid "could not open temporary response file %s"
msgstr ""
-#: gcc.c:5053
+#: gcc.c:5135
#, c-format
msgid "could not write to temporary response file %s"
msgstr ""
-#: gcc.c:5059
+#: gcc.c:5141
#, c-format
msgid "could not close temporary response file %s"
msgstr ""
-#: gcc.c:5093
+#: gcc.c:5175
#, c-format
msgid "spec '%s' has invalid '%%W%c"
msgstr ""
-#: gcc.c:5113
+#: gcc.c:5195
#, c-format
msgid "spec '%s' has invalid '%%x%c'"
msgstr ""
-#: gcc.c:5335
+#: gcc.c:5417
#, c-format
msgid "Processing spec %c%s%c, which is '%s'\n"
msgstr ""
-#: gcc.c:5459
+#: gcc.c:5541
#, c-format
msgid "unknown spec function '%s'"
msgstr ""
-#: gcc.c:5478
+#: gcc.c:5560
#, c-format
msgid "error in args to spec function '%s'"
msgstr ""
-#: gcc.c:5526
+#: gcc.c:5608
#, c-format
msgid "malformed spec function name"
msgstr ""
#. )
-#: gcc.c:5529
+#: gcc.c:5611
#, c-format
msgid "no arguments for spec function"
msgstr ""
-#: gcc.c:5548
+#: gcc.c:5630
#, c-format
msgid "malformed spec function arguments"
msgstr ""
-#: gcc.c:5794
+#: gcc.c:5876
#, c-format
msgid "braced spec '%s' is invalid at '%c'"
msgstr ""
-#: gcc.c:5882
+#: gcc.c:5964
#, c-format
msgid "braced spec body '%s' is invalid"
msgstr ""
-#: gcc.c:6420
+#: gcc.c:6502
#, c-format
msgid "install: %s%s\n"
msgstr ""
-#: gcc.c:6423
+#: gcc.c:6505
#, c-format
msgid "programs: %s\n"
msgstr ""
-#: gcc.c:6425
+#: gcc.c:6507
#, c-format
msgid "libraries: %s\n"
msgstr ""
#. The error status indicates that only one set of fixed
#. headers should be built.
-#: gcc.c:6479
+#: gcc.c:6573
#, c-format
msgid "not configured with sysroot headers suffix"
msgstr ""
-#: gcc.c:6488
+#: gcc.c:6582
#, c-format
msgid ""
"\n"
"For bug reporting instructions, please see:\n"
msgstr ""
-#: gcc.c:6504
+#: gcc.c:6598
#, c-format
msgid "Target: %s\n"
msgstr ""
-#: gcc.c:6505
+#: gcc.c:6599
#, c-format
msgid "Configured with: %s\n"
msgstr ""
-#: gcc.c:6519
+#: gcc.c:6613
#, c-format
msgid "Thread model: %s\n"
msgstr ""
-#: gcc.c:6530
+#: gcc.c:6624
#, c-format
msgid "gcc version %s %s\n"
msgstr ""
-#: gcc.c:6532
+#: gcc.c:6626
#, c-format
msgid "gcc driver version %s %sexecuting gcc version %s\n"
msgstr ""
-#: gcc.c:6540
+#: gcc.c:6634
#, c-format
msgid "no input files"
msgstr ""
-#: gcc.c:6589
+#: gcc.c:6683
#, c-format
msgid "cannot specify -o with -c or -S with multiple files"
msgstr ""
-#: gcc.c:6623
+#: gcc.c:6717
#, c-format
msgid "spec '%s' is invalid"
msgstr ""
-#: gcc.c:6759
+#: gcc.c:6853
#, c-format
msgid ""
"\n"
@@ -1305,59 +1299,59 @@ msgid ""
"\n"
msgstr ""
-#: gcc.c:6760
+#: gcc.c:6854
#, c-format
msgid ""
"Use \"-Wl,OPTION\" to pass \"OPTION\" to the linker.\n"
"\n"
msgstr ""
-#: gcc.c:7111
+#: gcc.c:7206
#, c-format
msgid "multilib spec '%s' is invalid"
msgstr ""
-#: gcc.c:7302
+#: gcc.c:7397
#, c-format
msgid "multilib exclusions '%s' is invalid"
msgstr ""
-#: gcc.c:7360 gcc.c:7501
+#: gcc.c:7455 gcc.c:7596
#, c-format
msgid "multilib select '%s' is invalid"
msgstr ""
-#: gcc.c:7539
+#: gcc.c:7634
#, c-format
msgid "multilib exclusion '%s' is invalid"
msgstr ""
-#: gcc.c:7745
+#: gcc.c:7840
#, c-format
msgid "environment variable \"%s\" not defined"
msgstr ""
-#: gcc.c:7836 gcc.c:7841
+#: gcc.c:7931 gcc.c:7936
#, c-format
msgid "invalid version number `%s'"
msgstr ""
-#: gcc.c:7884
+#: gcc.c:7979
#, c-format
msgid "too few arguments to %%:version-compare"
msgstr ""
-#: gcc.c:7890
+#: gcc.c:7985
#, c-format
msgid "too many arguments to %%:version-compare"
msgstr ""
-#: gcc.c:7931
+#: gcc.c:8026
#, c-format
msgid "unknown operator '%s' in %%:version-compare"
msgstr ""
-#: gcc.c:7965
+#: gcc.c:8060
#, c-format
msgid ""
"Assembler options\n"
@@ -1365,92 +1359,92 @@ msgid ""
"\n"
msgstr ""
-#: gcc.c:7966
+#: gcc.c:8061
#, c-format
msgid ""
"Use \"-Wa,OPTION\" to pass \"OPTION\" to the assembler.\n"
"\n"
msgstr ""
-#: gcov.c:399
+#: gcov.c:400
#, c-format
msgid ""
"Usage: gcov [OPTION]... SOURCEFILE...\n"
"\n"
msgstr ""
-#: gcov.c:400
+#: gcov.c:401
#, c-format
msgid ""
"Print code coverage information.\n"
"\n"
msgstr ""
-#: gcov.c:401
+#: gcov.c:402
#, c-format
msgid " -h, --help Print this help, then exit\n"
msgstr ""
-#: gcov.c:402
+#: gcov.c:403
#, c-format
msgid " -v, --version Print version number, then exit\n"
msgstr ""
-#: gcov.c:403
+#: gcov.c:404
#, c-format
msgid ""
" -a, --all-blocks Show information for every basic block\n"
msgstr ""
-#: gcov.c:404
+#: gcov.c:405
#, c-format
msgid ""
" -b, --branch-probabilities Include branch probabilities in output\n"
msgstr ""
-#: gcov.c:405
+#: gcov.c:406
#, c-format
msgid ""
" -c, --branch-counts Given counts of branches taken\n"
" rather than percentages\n"
msgstr ""
-#: gcov.c:407
+#: gcov.c:408
#, c-format
msgid " -n, --no-output Do not create an output file\n"
msgstr ""
-#: gcov.c:408
+#: gcov.c:409
#, c-format
msgid ""
" -l, --long-file-names Use long output file names for included\n"
" source files\n"
msgstr ""
-#: gcov.c:410
+#: gcov.c:411
#, c-format
msgid " -f, --function-summaries Output summaries for each function\n"
msgstr ""
-#: gcov.c:411
+#: gcov.c:412
#, c-format
msgid ""
" -o, --object-directory DIR|FILE Search for object files in DIR or called "
"FILE\n"
msgstr ""
-#: gcov.c:412
+#: gcov.c:413
#, c-format
msgid " -p, --preserve-paths Preserve all pathname components\n"
msgstr ""
-#: gcov.c:413
+#: gcov.c:414
#, c-format
msgid ""
" -u, --unconditional-branches Show unconditional branch counts too\n"
msgstr ""
-#: gcov.c:414
+#: gcov.c:415
#, c-format
msgid ""
"\n"
@@ -1458,12 +1452,12 @@ msgid ""
"%s.\n"
msgstr ""
-#: gcov.c:424
+#: gcov.c:425
#, c-format
msgid "gcov %s%s\n"
msgstr ""
-#: gcov.c:428
+#: gcov.c:429
#, c-format
msgid ""
"This is free software; see the source for copying conditions.\n"
@@ -1472,209 +1466,239 @@ msgid ""
"\n"
msgstr ""
-#: gcov.c:524
+#: gcov.c:525
#, c-format
msgid "%s:no functions found\n"
msgstr ""
-#: gcov.c:556 gcov.c:584 fortran/dump-parse-tree.c:63
+#: gcov.c:557 gcov.c:585
#, c-format
msgid "\n"
msgstr ""
-#: gcov.c:571
+#: gcov.c:572
#, c-format
msgid "%s:creating '%s'\n"
msgstr ""
-#: gcov.c:575
+#: gcov.c:576
#, c-format
msgid "%s:error writing output file '%s'\n"
msgstr ""
-#: gcov.c:580
+#: gcov.c:581
#, c-format
msgid "%s:could not open output file '%s'\n"
msgstr ""
-#: gcov.c:729
+#: gcov.c:730
#, c-format
msgid "%s:source file is newer than graph file '%s'\n"
msgstr ""
-#: gcov.c:734
+#: gcov.c:735
#, c-format
msgid "(the message is only displayed one per source file)\n"
msgstr ""
-#: gcov.c:758
+#: gcov.c:759
#, c-format
msgid "%s:cannot open graph file\n"
msgstr ""
-#: gcov.c:764
+#: gcov.c:765
#, c-format
msgid "%s:not a gcov graph file\n"
msgstr ""
-#: gcov.c:777
+#: gcov.c:778
#, c-format
msgid "%s:version '%.4s', prefer '%.4s'\n"
msgstr ""
-#: gcov.c:829
+#: gcov.c:830
#, c-format
msgid "%s:already seen blocks for '%s'\n"
msgstr ""
-#: gcov.c:947
+#: gcov.c:948
#, c-format
msgid "%s:corrupted\n"
msgstr ""
-#: gcov.c:1023
+#: gcov.c:1024
#, c-format
msgid "%s:cannot open data file, assuming not executed\n"
msgstr ""
-#: gcov.c:1030
+#: gcov.c:1031
#, c-format
msgid "%s:not a gcov data file\n"
msgstr ""
-#: gcov.c:1043
+#: gcov.c:1044
#, c-format
msgid "%s:version '%.4s', prefer version '%.4s'\n"
msgstr ""
-#: gcov.c:1049
+#: gcov.c:1050
#, c-format
msgid "%s:stamp mismatch with graph file\n"
msgstr ""
-#: gcov.c:1078
+#: gcov.c:1079
#, c-format
msgid "%s:unknown function '%u'\n"
msgstr ""
-#: gcov.c:1091
+#: gcov.c:1092
#, c-format
msgid "%s:profile mismatch for '%s'\n"
msgstr ""
-#: gcov.c:1110
+#: gcov.c:1111
#, c-format
msgid "%s:overflowed\n"
msgstr ""
-#: gcov.c:1134
+#: gcov.c:1135
#, c-format
msgid "%s:'%s' lacks entry and/or exit blocks\n"
msgstr ""
-#: gcov.c:1139
+#: gcov.c:1140
#, c-format
msgid "%s:'%s' has arcs to entry block\n"
msgstr ""
-#: gcov.c:1147
+#: gcov.c:1148
#, c-format
msgid "%s:'%s' has arcs from exit block\n"
msgstr ""
-#: gcov.c:1355
+#: gcov.c:1356
#, c-format
msgid "%s:graph is unsolvable for '%s'\n"
msgstr ""
-#: gcov.c:1435
+#: gcov.c:1436
#, c-format
msgid "%s '%s'\n"
msgstr ""
-#: gcov.c:1438
+#: gcov.c:1439
#, c-format
msgid "Lines executed:%s of %d\n"
msgstr ""
-#: gcov.c:1442
+#: gcov.c:1443
#, c-format
msgid "No executable lines\n"
msgstr ""
-#: gcov.c:1448
+#: gcov.c:1449
#, c-format
msgid "Branches executed:%s of %d\n"
msgstr ""
-#: gcov.c:1452
+#: gcov.c:1453
#, c-format
msgid "Taken at least once:%s of %d\n"
msgstr ""
-#: gcov.c:1458
+#: gcov.c:1459
#, c-format
msgid "No branches\n"
msgstr ""
-#: gcov.c:1460
+#: gcov.c:1461
#, c-format
msgid "Calls executed:%s of %d\n"
msgstr ""
-#: gcov.c:1464
+#: gcov.c:1465
#, c-format
msgid "No calls\n"
msgstr ""
-#: gcov.c:1611
+#: gcov.c:1612
#, c-format
msgid "%s:no lines for '%s'\n"
msgstr ""
-#: gcov.c:1806
+#: gcov.c:1807
#, c-format
msgid "call %2d returned %s\n"
msgstr ""
-#: gcov.c:1811
+#: gcov.c:1812
#, c-format
msgid "call %2d never executed\n"
msgstr ""
-#: gcov.c:1816
+#: gcov.c:1817
#, c-format
msgid "branch %2d taken %s%s\n"
msgstr ""
-#: gcov.c:1820
+#: gcov.c:1821
#, c-format
msgid "branch %2d never executed\n"
msgstr ""
-#: gcov.c:1825
+#: gcov.c:1826
#, c-format
msgid "unconditional %2d taken %s\n"
msgstr ""
-#: gcov.c:1828
+#: gcov.c:1829
#, c-format
msgid "unconditional %2d never executed\n"
msgstr ""
-#: gcov.c:1864
+#: gcov.c:1865
#, c-format
msgid "%s:cannot open source file\n"
msgstr ""
-#: gcse.c:679
+#: gcse.c:692
msgid "GCSE disabled"
msgstr ""
-#: gcse.c:6584
+#: gcse.c:6512
msgid "jump bypassing disabled"
msgstr ""
+#: incpath.c:76
+#, c-format
+msgid "ignoring duplicate directory \"%s\"\n"
+msgstr ""
+
+#: incpath.c:79
+#, c-format
+msgid " as it is a non-system directory that duplicates a system directory\n"
+msgstr ""
+
+#: incpath.c:83
+#, c-format
+msgid "ignoring nonexistent directory \"%s\"\n"
+msgstr ""
+
+#: incpath.c:345
+#, c-format
+msgid "#include \"...\" search starts here:\n"
+msgstr ""
+
+#: incpath.c:349
+#, c-format
+msgid "#include <...> search starts here:\n"
+msgstr ""
+
+#: incpath.c:354
+#, c-format
+msgid "End of search list.\n"
+msgstr ""
+
#. Opening quotation mark.
#: intl.c:57
msgid "`"
@@ -1685,182 +1709,197 @@ msgstr ""
msgid "'"
msgstr ""
-#: ipa-inline.c:377
+#: ipa-inline.c:383
msgid "--param large-function-growth limit reached"
msgstr ""
-#: ipa-inline.c:392
+#: ipa-inline.c:398
msgid "--param large-stack-frame-growth limit reached"
msgstr ""
-#: ipa-inline.c:410
+#: ipa-inline.c:416
msgid "function not inline candidate"
msgstr ""
-#: ipa-inline.c:426
+#: ipa-inline.c:432
msgid "--param max-inline-insns-single limit reached"
msgstr ""
-#: ipa-inline.c:435
+#: ipa-inline.c:441
msgid "--param max-inline-insns-auto limit reached"
msgstr ""
-#: ipa-inline.c:461 ipa-inline.c:914 ipa-inline.c:1105 ipa-inline.c:1225
+#: ipa-inline.c:467 ipa-inline.c:942 ipa-inline.c:1160 ipa-inline.c:1286
msgid "recursive inlining"
msgstr ""
-#: ipa-inline.c:922
+#: ipa-inline.c:950
msgid "call is unlikely and code size would grow"
msgstr ""
-#: ipa-inline.c:925
+#: ipa-inline.c:953
msgid "function not declared inline and code size would grow"
msgstr ""
-#: ipa-inline.c:927
+#: ipa-inline.c:955
msgid "optimizing for size and code size would grow"
msgstr ""
-#: ipa-inline.c:1013
+#: ipa-inline.c:980
+msgid "target specific option mismatch"
+msgstr ""
+
+#: ipa-inline.c:1056
msgid "--param inline-unit-growth limit reached"
msgstr ""
-#: langhooks.c:389
+#: langhooks.c:390
msgid "At top level:"
msgstr ""
-#: langhooks.c:407
+#: langhooks.c:410
#, c-format
msgid "In member function %qs"
msgstr ""
-#: langhooks.c:411
+#: langhooks.c:414
#, c-format
msgid "In function %qs"
msgstr ""
-#: langhooks.c:461
+#: langhooks.c:465
#, c-format
msgid " inlined from %qs at %s:%d:%d"
msgstr ""
-#: langhooks.c:467
+#: langhooks.c:470
#, c-format
msgid " inlined from %qs at %s:%d"
msgstr ""
-#: langhooks.c:473
+#: langhooks.c:476
#, c-format
msgid " inlined from %qs"
msgstr ""
-#: loop-iv.c:2806 tree-ssa-loop-niter.c:1818
+#: loop-iv.c:2806 tree-ssa-loop-niter.c:1845
msgid "assuming that the loop is not infinite"
msgstr ""
-#: loop-iv.c:2807 tree-ssa-loop-niter.c:1819
+#: loop-iv.c:2807 tree-ssa-loop-niter.c:1846
msgid "cannot optimize possibly infinite loops"
msgstr ""
-#: loop-iv.c:2815 tree-ssa-loop-niter.c:1823
+#: loop-iv.c:2815 tree-ssa-loop-niter.c:1850
msgid "assuming that the loop counter does not overflow"
msgstr ""
-#: loop-iv.c:2816 tree-ssa-loop-niter.c:1824
+#: loop-iv.c:2816 tree-ssa-loop-niter.c:1851
msgid "cannot optimize loop, the loop counter may overflow"
msgstr ""
-#. What to print when a switch has no documentation.
-#: opts.c:340
+#: opts.c:339
msgid "This switch lacks documentation"
msgstr ""
-#: opts.c:1161
+#: opts.c:1310
msgid "[enabled]"
msgstr ""
-#: opts.c:1161
+#: opts.c:1310
msgid "[disabled]"
msgstr ""
-#: opts.c:1172
+#: opts.c:1325
#, c-format
msgid " No options with the desired characteristics were found\n"
msgstr ""
-#: opts.c:1174
+#: opts.c:1334
+#, c-format
+msgid ""
+" None found. Use --help=%s to show *all* the options supported by the %s "
+"front-end\n"
+msgstr ""
+
+#: opts.c:1340
#, c-format
msgid ""
" All options with the desired characteristics have already been displayed\n"
msgstr ""
-#: opts.c:1228
+#: opts.c:1394
msgid "The following options are target specific"
msgstr ""
-#: opts.c:1231
+#: opts.c:1397
msgid "The following options control compiler warning messages"
msgstr ""
-#: opts.c:1234
+#: opts.c:1400
msgid "The following options control optimizations"
msgstr ""
-#: opts.c:1237 opts.c:1275
+#: opts.c:1403 opts.c:1438
msgid "The following options are language-independent"
msgstr ""
-#: opts.c:1240
+#: opts.c:1406
msgid "The --param option recognizes the following as parameters"
msgstr ""
-#: opts.c:1247
-msgid "The following options are specific to the language "
+#: opts.c:1412
+msgid "The following options are specific to just the language "
msgstr ""
-#: opts.c:1251
+#: opts.c:1414
msgid "The following options are supported by the language "
msgstr ""
-#: opts.c:1262
+#: opts.c:1425
msgid "The following options are not documented"
msgstr ""
-#: opts.c:1273
+#: opts.c:1436
msgid "The following options are language-related"
msgstr ""
-#: opts.c:1405
+#: opts.c:1591
#, c-format
-msgid "warning: unrecognized argument to --help= switch: %.*s\n"
+msgid "warning: --help argument %.*s is ambiguous, please be more specific\n"
msgstr ""
-#: protoize.c:582
+#: opts.c:1599
+#, c-format
+msgid "warning: unrecognized argument to --help= option: %.*s\n"
+msgstr ""
+
+#: protoize.c:583
#, c-format
msgid "%s: error writing file '%s': %s\n"
msgstr ""
-#: protoize.c:626
+#: protoize.c:627
#, c-format
msgid "%s: usage '%s [ -VqfnkN ] [ -i <istring> ] [ filename ... ]'\n"
msgstr ""
-#: protoize.c:629
+#: protoize.c:630
#, c-format
msgid "%s: usage '%s [ -VqfnkNlgC ] [ -B <dirname> ] [ filename ... ]'\n"
msgstr ""
-#: protoize.c:730
+#: protoize.c:731
#, c-format
msgid "%s: warning: no read access for file '%s'\n"
msgstr ""
-#: protoize.c:738
+#: protoize.c:739
#, c-format
msgid "%s: warning: no write access for file '%s'\n"
msgstr ""
-#: protoize.c:746
+#: protoize.c:747
#, c-format
msgid "%s: warning: no write access for dir containing '%s'\n"
msgstr ""
@@ -1868,303 +1907,303 @@ msgstr ""
#. Catch cases like /.. where we try to backup to a
#. point above the absolute root of the logical file
#. system.
-#: protoize.c:1133
+#: protoize.c:1134
#, c-format
msgid "%s: invalid file name: %s\n"
msgstr ""
-#: protoize.c:1281
+#: protoize.c:1282
#, c-format
msgid "%s: %s: can't get status: %s\n"
msgstr ""
-#: protoize.c:1302
+#: protoize.c:1303
#, c-format
msgid ""
"\n"
"%s: fatal error: aux info file corrupted at line %d\n"
msgstr ""
-#: protoize.c:1631
+#: protoize.c:1632
#, c-format
msgid "%s:%d: declaration of function '%s' takes different forms\n"
msgstr ""
-#: protoize.c:1886
+#: protoize.c:1887
#, c-format
msgid "%s: compiling '%s'\n"
msgstr ""
-#: protoize.c:1909
+#: protoize.c:1910
#, c-format
msgid "%s: wait: %s\n"
msgstr ""
-#: protoize.c:1914
+#: protoize.c:1915
#, c-format
msgid "%s: subprocess got fatal signal %d\n"
msgstr ""
-#: protoize.c:1922
+#: protoize.c:1923
#, c-format
msgid "%s: %s exited with status %d\n"
msgstr ""
-#: protoize.c:1971
+#: protoize.c:1972
#, c-format
msgid "%s: warning: missing SYSCALLS file '%s'\n"
msgstr ""
-#: protoize.c:1980 protoize.c:2009
+#: protoize.c:1981 protoize.c:2010
#, c-format
msgid "%s: can't read aux info file '%s': %s\n"
msgstr ""
-#: protoize.c:2025 protoize.c:2053
+#: protoize.c:2026 protoize.c:2054
#, c-format
msgid "%s: can't get status of aux info file '%s': %s\n"
msgstr ""
-#: protoize.c:2081
+#: protoize.c:2082
#, c-format
msgid "%s: can't open aux info file '%s' for reading: %s\n"
msgstr ""
-#: protoize.c:2099
+#: protoize.c:2100
#, c-format
msgid "%s: error reading aux info file '%s': %s\n"
msgstr ""
-#: protoize.c:2112
+#: protoize.c:2113
#, c-format
msgid "%s: error closing aux info file '%s': %s\n"
msgstr ""
-#: protoize.c:2128
+#: protoize.c:2129
#, c-format
msgid "%s: can't delete aux info file '%s': %s\n"
msgstr ""
-#: protoize.c:2210 protoize.c:4180
+#: protoize.c:2211 protoize.c:4181
#, c-format
msgid "%s: can't delete file '%s': %s\n"
msgstr ""
-#: protoize.c:2288
+#: protoize.c:2289
#, c-format
msgid "%s: warning: can't rename file '%s' to '%s': %s\n"
msgstr ""
-#: protoize.c:2410
+#: protoize.c:2411
#, c-format
msgid "%s: conflicting extern definitions of '%s'\n"
msgstr ""
-#: protoize.c:2414
+#: protoize.c:2415
#, c-format
msgid "%s: declarations of '%s' will not be converted\n"
msgstr ""
-#: protoize.c:2416
+#: protoize.c:2417
#, c-format
msgid "%s: conflict list for '%s' follows:\n"
msgstr ""
-#: protoize.c:2449
+#: protoize.c:2450
#, c-format
msgid "%s: warning: using formals list from %s(%d) for function '%s'\n"
msgstr ""
-#: protoize.c:2489
+#: protoize.c:2490
#, c-format
msgid "%s: %d: '%s' used but missing from SYSCALLS\n"
msgstr ""
-#: protoize.c:2495
+#: protoize.c:2496
#, c-format
msgid "%s: %d: warning: no extern definition for '%s'\n"
msgstr ""
-#: protoize.c:2525
+#: protoize.c:2526
#, c-format
msgid "%s: warning: no static definition for '%s' in file '%s'\n"
msgstr ""
-#: protoize.c:2531
+#: protoize.c:2532
#, c-format
msgid "%s: multiple static defs of '%s' in file '%s'\n"
msgstr ""
-#: protoize.c:2701 protoize.c:2704
+#: protoize.c:2702 protoize.c:2705
#, c-format
msgid "%s: %d: warning: source too confusing\n"
msgstr ""
-#: protoize.c:2899
+#: protoize.c:2900
#, c-format
msgid "%s: %d: warning: varargs function declaration not converted\n"
msgstr ""
-#: protoize.c:2914
+#: protoize.c:2915
#, c-format
msgid "%s: declaration of function '%s' not converted\n"
msgstr ""
-#: protoize.c:3037
+#: protoize.c:3038
#, c-format
msgid "%s: warning: too many parameter lists in declaration of '%s'\n"
msgstr ""
-#: protoize.c:3058
+#: protoize.c:3059
#, c-format
msgid ""
"\n"
"%s: warning: too few parameter lists in declaration of '%s'\n"
msgstr ""
-#: protoize.c:3154
+#: protoize.c:3155
#, c-format
msgid "%s: %d: warning: found '%s' but expected '%s'\n"
msgstr ""
-#: protoize.c:3329
+#: protoize.c:3330
#, c-format
msgid "%s: local declaration for function '%s' not inserted\n"
msgstr ""
-#: protoize.c:3356
+#: protoize.c:3357
#, c-format
msgid ""
"\n"
"%s: %d: warning: can't add declaration of '%s' into macro call\n"
msgstr ""
-#: protoize.c:3428
+#: protoize.c:3429
#, c-format
msgid "%s: global declarations for file '%s' not inserted\n"
msgstr ""
-#: protoize.c:3518 protoize.c:3548
+#: protoize.c:3519 protoize.c:3549
#, c-format
msgid "%s: definition of function '%s' not converted\n"
msgstr ""
-#: protoize.c:3537
+#: protoize.c:3538
#, c-format
msgid "%s: %d: warning: definition of %s not converted\n"
msgstr ""
-#: protoize.c:3863
+#: protoize.c:3864
#, c-format
msgid "%s: found definition of '%s' at %s(%d)\n"
msgstr ""
#. If we make it here, then we did not know about this
#. function definition.
-#: protoize.c:3879
+#: protoize.c:3880
#, c-format
msgid "%s: %d: warning: '%s' excluded by preprocessing\n"
msgstr ""
-#: protoize.c:3882
+#: protoize.c:3883
#, c-format
msgid "%s: function definition not converted\n"
msgstr ""
-#: protoize.c:3940
+#: protoize.c:3941
#, c-format
msgid "%s: '%s' not converted\n"
msgstr ""
-#: protoize.c:3948
+#: protoize.c:3949
#, c-format
msgid "%s: would convert file '%s'\n"
msgstr ""
-#: protoize.c:3951
+#: protoize.c:3952
#, c-format
msgid "%s: converting file '%s'\n"
msgstr ""
-#: protoize.c:3961
+#: protoize.c:3962
#, c-format
msgid "%s: can't get status for file '%s': %s\n"
msgstr ""
-#: protoize.c:4003
+#: protoize.c:4004
#, c-format
msgid "%s: can't open file '%s' for reading: %s\n"
msgstr ""
-#: protoize.c:4018
+#: protoize.c:4019
#, c-format
msgid ""
"\n"
"%s: error reading input file '%s': %s\n"
msgstr ""
-#: protoize.c:4052
+#: protoize.c:4053
#, c-format
msgid "%s: can't create/open clean file '%s': %s\n"
msgstr ""
-#: protoize.c:4157
+#: protoize.c:4158
#, c-format
msgid "%s: warning: file '%s' already saved in '%s'\n"
msgstr ""
-#: protoize.c:4165
+#: protoize.c:4166
#, c-format
msgid "%s: can't link file '%s' to '%s': %s\n"
msgstr ""
-#: protoize.c:4195
+#: protoize.c:4196
#, c-format
msgid "%s: can't create/open output file '%s': %s\n"
msgstr ""
-#: protoize.c:4228
+#: protoize.c:4229
#, c-format
msgid "%s: can't change mode of file '%s': %s\n"
msgstr ""
-#: protoize.c:4404
+#: protoize.c:4405
#, c-format
msgid "%s: cannot get working directory: %s\n"
msgstr ""
-#: protoize.c:4502
+#: protoize.c:4503
#, c-format
msgid "%s: input file names must have .c suffixes: %s\n"
msgstr ""
-#: reload.c:3744
+#: reload.c:3786
msgid "unable to generate reloads for:"
msgstr ""
-#: reload1.c:2000
+#: reload1.c:2098
msgid "this is the insn:"
msgstr ""
#. It's the compiler's fault.
-#: reload1.c:5363
+#: reload1.c:5644
msgid "could not find a spill register"
msgstr ""
#. It's the compiler's fault.
-#: reload1.c:7038
+#: reload1.c:7597
msgid "VOIDmode on an output"
msgstr ""
-#: reload1.c:8043
+#: reload1.c:8352
msgid "Failure trying to reload:"
msgstr ""
-#: rtl-error.c:127
+#: rtl-error.c:120
msgid "unrecognizable insn:"
msgstr ""
-#: rtl-error.c:129
+#: rtl-error.c:122
msgid "insn does not satisfy its constraints:"
msgstr ""
@@ -2184,95 +2223,95 @@ msgstr ""
msgid "time in %s: %ld.%06ld (%ld%%)\n"
msgstr ""
-#: tlink.c:383
+#: tlink.c:382
#, c-format
msgid "collect: reading %s\n"
msgstr ""
-#: tlink.c:477
+#: tlink.c:476
#, c-format
msgid "removing .rpo file"
msgstr ""
-#: tlink.c:479
+#: tlink.c:478
#, c-format
msgid "renaming .rpo file"
msgstr ""
-#: tlink.c:533
+#: tlink.c:532
#, c-format
msgid "collect: recompiling %s\n"
msgstr ""
-#: tlink.c:737
+#: tlink.c:739
#, c-format
msgid "collect: tweaking %s in %s\n"
msgstr ""
-#: tlink.c:787
+#: tlink.c:789
#, c-format
msgid "collect: relinking\n"
msgstr ""
-#: toplev.c:606
+#: toplev.c:595
#, c-format
msgid "unrecoverable error"
msgstr ""
-#: toplev.c:1180
+#: toplev.c:1108
#, c-format
msgid ""
"%s%s%s %sversion %s (%s)\n"
"%s\tcompiled by GNU C version %s, "
msgstr ""
-#: toplev.c:1182
+#: toplev.c:1110
#, c-format
msgid "%s%s%s %sversion %s (%s) compiled by CC, "
msgstr ""
-#: toplev.c:1186
+#: toplev.c:1114
#, c-format
msgid "GMP version %s, MPFR version %s.\n"
msgstr ""
-#: toplev.c:1188
+#: toplev.c:1116
#, c-format
-msgid "warning: %s header version %s differs from library version %s.\n"
+msgid "%s%swarning: %s header version %s differs from library version %s.\n"
msgstr ""
-#: toplev.c:1190
+#: toplev.c:1118
#, c-format
msgid ""
"%s%sGGC heuristics: --param ggc-min-expand=%d --param ggc-min-heapsize=%d\n"
msgstr ""
-#: toplev.c:1340
+#: toplev.c:1270
msgid "options passed: "
msgstr ""
-#: toplev.c:1374
+#: toplev.c:1304
msgid "options enabled: "
msgstr ""
-#: toplev.c:1509
+#: toplev.c:1439
#, c-format
msgid "created and used with differing settings of '%s'"
msgstr ""
-#: toplev.c:1511
+#: toplev.c:1441
msgid "out of memory"
msgstr ""
-#: toplev.c:1526
+#: toplev.c:1456
msgid "created and used with different settings of -fpic"
msgstr ""
-#: toplev.c:1528
+#: toplev.c:1458
msgid "created and used with different settings of -fpie"
msgstr ""
-#: tree-inline.c:2657
+#: tree-inline.c:3110
msgid "originally indirect function call not considered for inlining"
msgstr ""
@@ -2309,604 +2348,614 @@ msgstr ""
msgid "debug: "
msgstr ""
-#: params.def:46
-msgid ""
-"The maximum number of fields in a structure variable without direct "
-"structure accesses that GCC will attempt to track separately"
+#. These two would be re-classified as DK_WARNING or DK_ERROR, so the
+#. prefix does not matter.
+#: diagnostic.def:25
+msgid "pedwarn: "
msgstr ""
-#: params.def:53
-msgid ""
-"The maximum number of elements in an array for wich we track its elements "
-"separately"
+#: diagnostic.def:26
+msgid "permerror: "
msgstr ""
-#: params.def:62
+#: params.def:47
msgid ""
"The maximum structure size (in bytes) for which GCC will use by-element "
"copies"
msgstr ""
-#: params.def:71
+#: params.def:56
msgid ""
"The maximum number of structure fields for which GCC will use by-element "
"copies"
msgstr ""
-#: params.def:83
+#: params.def:68
msgid ""
"The threshold ratio between instantiated fields and the total structure size"
msgstr ""
-#: params.def:93
+#: params.def:78
msgid "The threshold ratio between current and hottest structure counts"
msgstr ""
-#: params.def:110
+#: params.def:95
msgid ""
"The maximum number of instructions in a single function eligible for inlining"
msgstr ""
-#: params.def:122
+#: params.def:107
msgid "The maximum number of instructions when automatically inlining"
msgstr ""
-#: params.def:127
+#: params.def:112
msgid ""
"The maximum number of instructions inline function can grow to via recursive "
"inlining"
msgstr ""
-#: params.def:132
+#: params.def:117
msgid ""
"The maximum number of instructions non-inline function can grow to via "
"recursive inlining"
msgstr ""
-#: params.def:137
+#: params.def:122
msgid "The maximum depth of recursive inlining for inline functions"
msgstr ""
-#: params.def:142
+#: params.def:127
msgid "The maximum depth of recursive inlining for non-inline functions"
msgstr ""
-#: params.def:147
+#: params.def:132
msgid ""
"Inline recursively only when the probability of call being executed exceeds "
"the parameter"
msgstr ""
-#: params.def:154
+#: params.def:139
msgid ""
"If -fvariable-expansion-in-unroller is used, the maximum number of times "
"that an individual variable will be expanded during loop unrolling"
msgstr ""
-#: params.def:160
+#: params.def:145
msgid ""
"If -ftree-vectorize is used, the minimal loop bound of a loop to be "
"considered for vectorization"
msgstr ""
-#: params.def:171
+#: params.def:156
msgid "The maximum number of instructions to consider to fill a delay slot"
msgstr ""
-#: params.def:182
+#: params.def:167
msgid ""
"The maximum number of instructions to consider to find accurate live "
"register information"
msgstr ""
-#: params.def:192
+#: params.def:177
msgid "The maximum length of scheduling's pending operations list"
msgstr ""
-#: params.def:197
+#: params.def:182
msgid "The size of function body to be considered large"
msgstr ""
-#: params.def:201
+#: params.def:186
msgid "Maximal growth due to inlining of large function (in percent)"
msgstr ""
-#: params.def:205
+#: params.def:190
msgid "The size of translation unit to be considered large"
msgstr ""
-#: params.def:209
+#: params.def:194
msgid ""
"how much can given compilation unit grow because of the inlining (in percent)"
msgstr ""
-#: params.def:213
+#: params.def:198
+msgid ""
+"how much can given compilation unit grow because of the interprocedural "
+"constant propagation (in percent)"
+msgstr ""
+
+#: params.def:202
msgid "expense of call operation relative to ordinary arithmetic operations"
msgstr ""
-#: params.def:217
+#: params.def:206
msgid "The size of stack frame to be considered large"
msgstr ""
-#: params.def:221
+#: params.def:210
msgid "Maximal stack frame growth due to inlining (in percent)"
msgstr ""
-#: params.def:228
+#: params.def:217
msgid "The maximum amount of memory to be allocated by GCSE"
msgstr ""
-#: params.def:233
+#: params.def:222
msgid "The maximum number of passes to make when doing GCSE"
msgstr ""
-#: params.def:243
+#: params.def:232
msgid ""
"The threshold ratio for performing partial redundancy elimination after "
"reload"
msgstr ""
-#: params.def:250
+#: params.def:239
msgid ""
"The threshold ratio of critical edges execution count that permit performing "
"redundancy elimination after reload"
msgstr ""
-#: params.def:261
+#: params.def:250
msgid "The maximum number of instructions to consider to unroll in a loop"
msgstr ""
-#: params.def:267
+#: params.def:256
msgid ""
"The maximum number of instructions to consider to unroll in a loop on average"
msgstr ""
-#: params.def:272
+#: params.def:261
msgid "The maximum number of unrollings of a single loop"
msgstr ""
-#: params.def:277
+#: params.def:266
msgid "The maximum number of insns of a peeled loop"
msgstr ""
-#: params.def:282
+#: params.def:271
msgid "The maximum number of peelings of a single loop"
msgstr ""
-#: params.def:287
+#: params.def:276
msgid "The maximum number of insns of a completely peeled loop"
msgstr ""
-#: params.def:292
+#: params.def:281
msgid ""
"The maximum number of peelings of a single loop that is peeled completely"
msgstr ""
-#: params.def:297
+#: params.def:286
msgid "The maximum number of insns of a peeled loop that rolls only once"
msgstr ""
-#: params.def:303
+#: params.def:292
msgid "The maximum number of insns of an unswitched loop"
msgstr ""
-#: params.def:308
+#: params.def:297
msgid "The maximum number of unswitchings in a single loop"
msgstr ""
-#: params.def:315
+#: params.def:304
msgid ""
"Bound on the number of iterations the brute force # of iterations analysis "
"algorithm evaluates"
msgstr ""
-#: params.def:321
+#: params.def:310
msgid "Bound on the cost of an expression to compute the number of iterations"
msgstr ""
-#: params.def:327
+#: params.def:316
msgid ""
"A factor for tuning the upper bound that swing modulo scheduler uses for "
"scheduling a loop"
msgstr ""
-#: params.def:331
+#: params.def:320
msgid ""
"The number of cycles the swing modulo scheduler considers when checking "
"conflicts using DFA"
msgstr ""
-#: params.def:335
+#: params.def:324
msgid ""
"A threshold on the average loop count considered by the swing modulo "
"scheduler"
msgstr ""
-#: params.def:340
+#: params.def:329
msgid ""
"Select fraction of the maximal count of repetitions of basic block in "
"program given basic block needs to have to be considered hot"
msgstr ""
-#: params.def:344
+#: params.def:333
msgid ""
"Select fraction of the maximal frequency of executions of basic block in "
"function given basic block needs to have to be considered hot"
msgstr ""
-#: params.def:349
+#: params.def:338
msgid ""
"Select fraction of the maximal frequency of executions of basic block in "
"function given basic block get alignment"
msgstr ""
-#: params.def:354
+#: params.def:343
msgid ""
"Loops iterating at least selected number of iterations will get loop "
"alignement."
msgstr ""
-#: params.def:370
+#: params.def:359
msgid "The maximum number of loop iterations we predict statically"
msgstr ""
-#: params.def:374
+#: params.def:363
msgid ""
"The percentage of function, weighted by execution frequency, that must be "
"covered by trace formation. Used when profile feedback is available"
msgstr ""
-#: params.def:378
+#: params.def:367
msgid ""
"The percentage of function, weighted by execution frequency, that must be "
"covered by trace formation. Used when profile feedback is not available"
msgstr ""
-#: params.def:382
+#: params.def:371
msgid "Maximal code growth caused by tail duplication (in percent)"
msgstr ""
-#: params.def:386
+#: params.def:375
msgid ""
"Stop reverse growth if the reverse probability of best edge is less than "
"this threshold (in percent)"
msgstr ""
-#: params.def:390
+#: params.def:379
msgid ""
"Stop forward growth if the probability of best edge is less than this "
"threshold (in percent). Used when profile feedback is available"
msgstr ""
-#: params.def:394
+#: params.def:383
msgid ""
"Stop forward growth if the probability of best edge is less than this "
"threshold (in percent). Used when profile feedback is not available"
msgstr ""
-#: params.def:400
+#: params.def:389
msgid "The maximum number of incoming edges to consider for crossjumping"
msgstr ""
-#: params.def:406
+#: params.def:395
msgid ""
"The minimum number of matching instructions to consider for crossjumping"
msgstr ""
-#: params.def:412
+#: params.def:401
msgid "The maximum expansion factor when copying basic blocks"
msgstr ""
-#: params.def:418
+#: params.def:407
msgid ""
"The maximum number of insns to duplicate when unfactoring computed gotos"
msgstr ""
-#: params.def:424
+#: params.def:413
msgid "The maximum length of path considered in cse"
msgstr ""
-#: params.def:428
+#: params.def:417
msgid "The maximum instructions CSE process before flushing"
msgstr ""
-#: params.def:435
+#: params.def:424
msgid ""
"The minimum cost of an expensive expression in the loop invariant motion"
msgstr ""
-#: params.def:444
+#: params.def:433
msgid ""
"Bound on number of candidates below that all candidates are considered in iv "
"optimizations"
msgstr ""
-#: params.def:452
+#: params.def:441
msgid "Bound on number of iv uses in loop optimized in iv optimizations"
msgstr ""
-#: params.def:460
+#: params.def:449
msgid ""
"If number of candidates in the set is smaller, we always try to remove "
"unused ivs during its optimization"
msgstr ""
-#: params.def:465
+#: params.def:454
msgid "Bound on size of expressions used in the scalar evolutions analyzer"
msgstr ""
-#: params.def:470
+#: params.def:459
msgid "Bound on the number of variables in Omega constraint systems"
msgstr ""
-#: params.def:475
+#: params.def:464
msgid "Bound on the number of inequalities in Omega constraint systems"
msgstr ""
-#: params.def:480
+#: params.def:469
msgid "Bound on the number of equalities in Omega constraint systems"
msgstr ""
-#: params.def:485
+#: params.def:474
msgid "Bound on the number of wild cards in Omega constraint systems"
msgstr ""
-#: params.def:490
+#: params.def:479
msgid "Bound on the size of the hash table in Omega constraint systems"
msgstr ""
-#: params.def:495
+#: params.def:484
msgid "Bound on the number of keys in Omega constraint systems"
msgstr ""
-#: params.def:500
+#: params.def:489
msgid ""
"When set to 1, use expensive methods to eliminate all redundant constraints"
msgstr ""
-#: params.def:505
+#: params.def:494
msgid ""
"Bound on number of runtime checks inserted by the vectorizer's loop "
"versioning for alignment check"
msgstr ""
-#: params.def:510
+#: params.def:499
msgid ""
"Bound on number of runtime checks inserted by the vectorizer's loop "
"versioning for alias check"
msgstr ""
-#: params.def:515
+#: params.def:504
msgid "The maximum memory locations recorded by cselib"
msgstr ""
-#: params.def:519
-msgid "The maximum memory locations recorded by flow"
-msgstr ""
-
-#: params.def:532
+#: params.def:517
msgid ""
"Minimum heap expansion to trigger garbage collection, as a percentage of the "
"total size of the heap"
msgstr ""
-#: params.def:537
+#: params.def:522
msgid "Minimum heap size before we start collecting garbage, in kilobytes"
msgstr ""
-#: params.def:545
+#: params.def:530
msgid ""
"The maximum number of instructions to search backward when looking for "
"equivalent reload"
msgstr ""
-#: params.def:550
+#: params.def:535
msgid ""
"The maximum number of virtual operators that a function is allowed to have "
"before triggering memory partitioning heuristics"
msgstr ""
-#: params.def:555
+#: params.def:540
msgid ""
"The average number of virtual operators that memory statements are allowed "
"to have before triggering memory partitioning heuristics"
msgstr ""
-#: params.def:560
+#: params.def:545
msgid ""
"The maximum number of blocks in a region to be considered for interblock "
"scheduling"
msgstr ""
-#: params.def:565
+#: params.def:550
msgid ""
"The maximum number of insns in a region to be considered for interblock "
"scheduling"
msgstr ""
-#: params.def:570
+#: params.def:555
msgid ""
"The minimum probability of reaching a source block for interblock "
"speculative scheduling"
msgstr ""
-#: params.def:575
+#: params.def:560
msgid "The maximum number of iterations through CFG to extend regions"
msgstr ""
-#: params.def:580
+#: params.def:565
msgid ""
"The maximum conflict delay for an insn to be considered for speculative "
"motion"
msgstr ""
-#: params.def:585
+#: params.def:570
msgid ""
"The minimal probability of speculation success (in percents), so that "
"speculative insn will be scheduled."
msgstr ""
-#: params.def:590
+#: params.def:575
msgid ""
"The maximum number of RTL nodes that can be recorded as combiner's last value"
msgstr ""
-#: params.def:598
+#: params.def:583
msgid "The upper bound for sharing integer constants"
msgstr ""
-#: params.def:617
+#: params.def:602
msgid ""
"Minimum number of virtual mappings to consider switching to full virtual "
"renames"
msgstr ""
-#: params.def:622
+#: params.def:607
msgid ""
"Ratio between virtual mappings and virtual symbols to do full virtual renames"
msgstr ""
-#: params.def:627
+#: params.def:612
msgid ""
"The lower bound for a buffer to be considered for stack smashing protection"
msgstr ""
-#: params.def:645
+#: params.def:630
msgid ""
"Maximum number of statements allowed in a block that needs to be duplicated "
"when threading jumps"
msgstr ""
-#: params.def:654
+#: params.def:639
msgid ""
"Maximum number of fields in a structure before pointer analysis treats the "
"structure as a single variable"
msgstr ""
-#: params.def:659
+#: params.def:644
msgid ""
"The maximum number of instructions ready to be issued to be considered by "
"the scheduler during the first scheduling pass"
msgstr ""
-#: params.def:669
+#: params.def:654
msgid "The number of insns executed before prefetch is completed"
msgstr ""
-#: params.def:676
+#: params.def:661
msgid "The number of prefetches that can run at the same time"
msgstr ""
-#: params.def:683
+#: params.def:668
msgid "The size of L1 cache"
msgstr ""
-#: params.def:690
+#: params.def:675
msgid "The size of L1 cache line"
msgstr ""
-#: params.def:697
+#: params.def:682
msgid "The size of L2 cache"
msgstr ""
-#: params.def:708
+#: params.def:693
msgid "Whether to use canonical types"
msgstr ""
-#: params.def:713
+#: params.def:698
msgid ""
"Maximum length of partial antic set when performing tree pre optimization"
msgstr ""
-#: params.def:723
+#: params.def:708
msgid "Maximum size of a SCC before SCCVN stops processing a function"
msgstr ""
-#: params.def:729
+#: params.def:714
msgid "Multiplier used for determining the double-queueing threshold"
msgstr ""
-#: config/alpha/alpha.c:5020
+#: params.def:719
+msgid "max loops number for regional RA"
+msgstr ""
+
+#: params.def:727
+msgid ""
+"The maximum ratio between array size and switch branches for a switch "
+"conversion to take place"
+msgstr ""
+
+#: config/alpha/alpha.c:5023
#, c-format
msgid "invalid %%H value"
msgstr ""
-#: config/alpha/alpha.c:5041 config/bfin/bfin.c:1516
+#: config/alpha/alpha.c:5044 config/bfin/bfin.c:1514
#, c-format
msgid "invalid %%J value"
msgstr ""
-#: config/alpha/alpha.c:5071 config/ia64/ia64.c:4719
+#: config/alpha/alpha.c:5074 config/ia64/ia64.c:4727
#, c-format
msgid "invalid %%r value"
msgstr ""
-#: config/alpha/alpha.c:5081 config/ia64/ia64.c:4673
-#: config/rs6000/rs6000.c:11866 config/xtensa/xtensa.c:2042
+#: config/alpha/alpha.c:5084 config/ia64/ia64.c:4681
+#: config/rs6000/rs6000.c:12028 config/xtensa/xtensa.c:2063
#, c-format
msgid "invalid %%R value"
msgstr ""
-#: config/alpha/alpha.c:5087 config/rs6000/rs6000.c:11785
-#: config/xtensa/xtensa.c:2009
+#: config/alpha/alpha.c:5090 config/rs6000/rs6000.c:11947
+#: config/xtensa/xtensa.c:2030
#, c-format
msgid "invalid %%N value"
msgstr ""
-#: config/alpha/alpha.c:5095 config/rs6000/rs6000.c:11813
+#: config/alpha/alpha.c:5098 config/rs6000/rs6000.c:11975
#, c-format
msgid "invalid %%P value"
msgstr ""
-#: config/alpha/alpha.c:5103
+#: config/alpha/alpha.c:5106
#, c-format
msgid "invalid %%h value"
msgstr ""
-#: config/alpha/alpha.c:5111 config/xtensa/xtensa.c:2035
+#: config/alpha/alpha.c:5114 config/xtensa/xtensa.c:2056
#, c-format
msgid "invalid %%L value"
msgstr ""
-#: config/alpha/alpha.c:5150 config/rs6000/rs6000.c:11767
+#: config/alpha/alpha.c:5153 config/rs6000/rs6000.c:11929
#, c-format
msgid "invalid %%m value"
msgstr ""
-#: config/alpha/alpha.c:5158 config/rs6000/rs6000.c:11775
+#: config/alpha/alpha.c:5161 config/rs6000/rs6000.c:11937
#, c-format
msgid "invalid %%M value"
msgstr ""
-#: config/alpha/alpha.c:5202
+#: config/alpha/alpha.c:5205
#, c-format
msgid "invalid %%U value"
msgstr ""
-#: config/alpha/alpha.c:5214 config/alpha/alpha.c:5228
-#: config/rs6000/rs6000.c:11874
+#: config/alpha/alpha.c:5217 config/alpha/alpha.c:5231
+#: config/rs6000/rs6000.c:12036
#, c-format
msgid "invalid %%s value"
msgstr ""
-#: config/alpha/alpha.c:5251
+#: config/alpha/alpha.c:5254
#, c-format
msgid "invalid %%C value"
msgstr ""
-#: config/alpha/alpha.c:5288 config/rs6000/rs6000.c:11602
-#: config/rs6000/rs6000.c:11621
+#: config/alpha/alpha.c:5291 config/rs6000/rs6000.c:11764
+#: config/rs6000/rs6000.c:11783
#, c-format
msgid "invalid %%E value"
msgstr ""
-#: config/alpha/alpha.c:5313 config/alpha/alpha.c:5361
+#: config/alpha/alpha.c:5316 config/alpha/alpha.c:5364
#, c-format
msgid "unknown relocation unspec"
msgstr ""
-#: config/alpha/alpha.c:5322 config/crx/crx.c:1081
-#: config/rs6000/rs6000.c:12201 config/spu/spu.c:1482
+#: config/alpha/alpha.c:5325 config/crx/crx.c:1081
+#: config/rs6000/rs6000.c:12367 config/spu/spu.c:1488
#, c-format
msgid "invalid %%xn code"
msgstr ""
@@ -2933,110 +2982,106 @@ msgstr ""
#. Unknown flag.
#. Undocumented flag.
-#: config/arc/arc.c:1800 config/m32r/m32r.c:1926 config/sparc/sparc.c:6998
+#: config/arc/arc.c:1800 config/m32r/m32r.c:1926 config/sparc/sparc.c:7003
#, c-format
msgid "invalid operand output code"
msgstr ""
-#: config/arm/arm.c:12521 config/arm/arm.c:12539
+#: config/arm/arm.c:12744 config/arm/arm.c:12762
#, c-format
msgid "predicated Thumb instruction"
msgstr ""
-#: config/arm/arm.c:12527
+#: config/arm/arm.c:12750
#, c-format
msgid "predicated instruction in conditional sequence"
msgstr ""
-#: config/arm/arm.c:12686
+#: config/arm/arm.c:12909
#, c-format
msgid "invalid shift operand"
msgstr ""
-#: config/arm/arm.c:12733 config/arm/arm.c:12743 config/arm/arm.c:12753
-#: config/arm/arm.c:12763 config/arm/arm.c:12773 config/arm/arm.c:12812
-#: config/arm/arm.c:12830 config/arm/arm.c:12865 config/arm/arm.c:12884
-#: config/arm/arm.c:12899 config/arm/arm.c:12927 config/arm/arm.c:12934
-#: config/arm/arm.c:12942 config/arm/arm.c:12963 config/arm/arm.c:12970
-#: config/bfin/bfin.c:1529 config/bfin/bfin.c:1536 config/bfin/bfin.c:1543
-#: config/bfin/bfin.c:1550 config/bfin/bfin.c:1559 config/bfin/bfin.c:1566
-#: config/bfin/bfin.c:1573 config/bfin/bfin.c:1580
+#: config/arm/arm.c:12956 config/arm/arm.c:12966 config/arm/arm.c:12976
+#: config/arm/arm.c:12986 config/arm/arm.c:12996 config/arm/arm.c:13035
+#: config/arm/arm.c:13053 config/arm/arm.c:13088 config/arm/arm.c:13107
+#: config/arm/arm.c:13122 config/arm/arm.c:13150 config/arm/arm.c:13157
+#: config/arm/arm.c:13165 config/arm/arm.c:13186 config/arm/arm.c:13193
+#: config/bfin/bfin.c:1527 config/bfin/bfin.c:1534 config/bfin/bfin.c:1541
+#: config/bfin/bfin.c:1548 config/bfin/bfin.c:1557 config/bfin/bfin.c:1564
+#: config/bfin/bfin.c:1571 config/bfin/bfin.c:1578
#, c-format
msgid "invalid operand for code '%c'"
msgstr ""
-#: config/arm/arm.c:12825
+#: config/arm/arm.c:13048
#, c-format
msgid "instruction never executed"
msgstr ""
-#: config/arm/arm.c:13037
+#: config/arm/arm.c:13260
#, c-format
msgid "missing operand"
msgstr ""
-#: config/avr/avr.c:1043
+#: config/avr/avr.c:1175
#, c-format
msgid "address operand requires constraint for X, Y, or Z register"
msgstr ""
-#: config/avr/avr.c:1150
+#: config/avr/avr.c:1287
msgid "bad address, not (reg+disp):"
msgstr ""
-#: config/avr/avr.c:1157
+#: config/avr/avr.c:1294
msgid "bad address, not post_inc or pre_dec:"
msgstr ""
-#: config/avr/avr.c:1168
+#: config/avr/avr.c:1305
msgid "internal compiler error. Bad address:"
msgstr ""
-#: config/avr/avr.c:1181
+#: config/avr/avr.c:1318
msgid "internal compiler error. Unknown mode:"
msgstr ""
-#: config/avr/avr.c:1796 config/avr/avr.c:2484
+#: config/avr/avr.c:1913 config/avr/avr.c:2601
msgid "invalid insn:"
msgstr ""
-#: config/avr/avr.c:1835 config/avr/avr.c:1921 config/avr/avr.c:1970
-#: config/avr/avr.c:1998 config/avr/avr.c:2093 config/avr/avr.c:2262
-#: config/avr/avr.c:2523 config/avr/avr.c:2635
+#: config/avr/avr.c:1952 config/avr/avr.c:2038 config/avr/avr.c:2087
+#: config/avr/avr.c:2115 config/avr/avr.c:2210 config/avr/avr.c:2379
+#: config/avr/avr.c:2640 config/avr/avr.c:2752
msgid "incorrect insn:"
msgstr ""
-#: config/avr/avr.c:2017 config/avr/avr.c:2178 config/avr/avr.c:2333
-#: config/avr/avr.c:2701
+#: config/avr/avr.c:2134 config/avr/avr.c:2295 config/avr/avr.c:2450
+#: config/avr/avr.c:2818
msgid "unknown move insn:"
msgstr ""
-#: config/avr/avr.c:2931
+#: config/avr/avr.c:3048
msgid "bad shift insn:"
msgstr ""
-#: config/avr/avr.c:3047 config/avr/avr.c:3467 config/avr/avr.c:3825
+#: config/avr/avr.c:3164 config/avr/avr.c:3584 config/avr/avr.c:3942
msgid "internal compiler error. Incorrect shift:"
msgstr ""
-#: config/bfin/bfin.c:1478
+#: config/bfin/bfin.c:1476
#, c-format
msgid "invalid %%j value"
msgstr ""
-#: config/bfin/bfin.c:1671
+#: config/bfin/bfin.c:1669
#, c-format
msgid "invalid const_double operand"
msgstr ""
-#. Use `%s' to print the string in case there are any escape
-#. characters in the message.
-#: config/cris/cris.c:504 fortran/dump-parse-tree.c:78
-#: fortran/dump-parse-tree.c:430 fortran/dump-parse-tree.c:798
-#: fortran/dump-parse-tree.c:843 c-typeck.c:4618 c-typeck.c:4633
-#: c-typeck.c:4648 final.c:2997 final.c:2999 gcc.c:4731 loop-iv.c:2808
-#: loop-iv.c:2817 rtl-error.c:112 toplev.c:610 tree-ssa-loop-niter.c:1829
-#: cp/parser.c:2192 cp/typeck.c:4556 java/expr.c:409
+#: config/cris/cris.c:504 c-typeck.c:4629 c-typeck.c:4645 c-typeck.c:4662
+#: final.c:2997 final.c:2999 gcc.c:4813 loop-iv.c:2808 loop-iv.c:2817
+#: rtl-error.c:105 toplev.c:599 tree-ssa-loop-niter.c:1856 cp/typeck.c:4600
+#: java/expr.c:410
#, gcc-internal-format
msgid "%s"
msgstr ""
@@ -3113,21 +3158,21 @@ msgstr ""
msgid "unrecognized address"
msgstr ""
-#: config/cris/cris.c:2209
+#: config/cris/cris.c:2215
msgid "unrecognized supposed constant"
msgstr ""
-#: config/cris/cris.c:2638 config/cris/cris.c:2702
+#: config/cris/cris.c:2644 config/cris/cris.c:2708
msgid "unexpected side-effects in address"
msgstr ""
#. Can't possibly get a GOT-needing-fixup for a function-call,
#. right?
-#: config/cris/cris.c:3539
+#: config/cris/cris.c:3545
msgid "Unidentifiable call op"
msgstr ""
-#: config/cris/cris.c:3590
+#: config/cris/cris.c:3596
#, c-format
msgid "PIC register isn't set up"
msgstr ""
@@ -3270,28 +3315,28 @@ msgstr ""
msgid " (frv)"
msgstr ""
-#: config/i386/i386.c:8270
+#: config/i386/i386.c:9726
#, c-format
msgid "invalid UNSPEC as operand"
msgstr ""
-#: config/i386/i386.c:8976
+#: config/i386/i386.c:10438
#, c-format
msgid ""
"operand is neither a constant nor a condition code, invalid operand code 'c'"
msgstr ""
-#: config/i386/i386.c:9092
+#: config/i386/i386.c:10562
#, c-format
msgid "invalid operand code '%c'"
msgstr ""
-#: config/i386/i386.c:9141
+#: config/i386/i386.c:10611
#, c-format
msgid "invalid constraints for operand"
msgstr ""
-#: config/i386/i386.c:16418
+#: config/i386/i386.c:17897
msgid "unknown insn mode"
msgstr ""
@@ -3312,34 +3357,34 @@ msgstr ""
msgid "environment variable DJGPP points to corrupt file '%s'"
msgstr ""
-#: config/ia64/ia64.c:4771
+#: config/ia64/ia64.c:4779
#, c-format
msgid "ia64_print_operand: unknown code"
msgstr ""
-#: config/ia64/ia64.c:9890
+#: config/ia64/ia64.c:9897
msgid "invalid conversion from %<__fpreg%>"
msgstr ""
-#: config/ia64/ia64.c:9893
+#: config/ia64/ia64.c:9900
msgid "invalid conversion to %<__fpreg%>"
msgstr ""
-#: config/ia64/ia64.c:9906 config/ia64/ia64.c:9917
+#: config/ia64/ia64.c:9913 config/ia64/ia64.c:9924
msgid "invalid operation on %<__fpreg%>"
msgstr ""
-#: config/iq2000/iq2000.c:3122
+#: config/iq2000/iq2000.c:3121
#, c-format
msgid "invalid %%P operand"
msgstr ""
-#: config/iq2000/iq2000.c:3130 config/rs6000/rs6000.c:11803
+#: config/iq2000/iq2000.c:3129 config/rs6000/rs6000.c:11965
#, c-format
msgid "invalid %%p value"
msgstr ""
-#: config/iq2000/iq2000.c:3186
+#: config/iq2000/iq2000.c:3185
#, c-format
msgid "invalid use of %%d, %%x, or %%X"
msgstr ""
@@ -3381,7 +3426,7 @@ msgid "post-increment address is not a register"
msgstr ""
#: config/m32r/m32r.c:2030 config/m32r/m32r.c:2044
-#: config/rs6000/rs6000.c:20072
+#: config/rs6000/rs6000.c:20642
msgid "bad address"
msgstr ""
@@ -3427,18 +3472,18 @@ msgstr ""
msgid "invalid Z register replacement for insn"
msgstr ""
-#: config/mips/mips.c:6371 config/mips/mips.c:6392 config/mips/mips.c:6496
+#: config/mips/mips.c:6997 config/mips/mips.c:7018 config/mips/mips.c:7122
#, c-format
msgid "'%%%c' is not a valid operand prefix"
msgstr ""
-#: config/mips/mips.c:6440 config/mips/mips.c:6447 config/mips/mips.c:6454
-#: config/mips/mips.c:6514
+#: config/mips/mips.c:7066 config/mips/mips.c:7073 config/mips/mips.c:7080
+#: config/mips/mips.c:7140
#, c-format
msgid "invalid use of '%%%c'"
msgstr ""
-#: config/mips/mips.c:6761
+#: config/mips/mips.c:7388
msgid "mips_debugger_offset called with non stack/frame/arg pointer"
msgstr ""
@@ -3483,195 +3528,188 @@ msgstr ""
msgid "MMIX Internal: This is not a constant:"
msgstr ""
-#: config/mt/mt.c:299
-msgid "mt_final_prescan_insn, invalid insn #1"
-msgstr ""
-
-#: config/mt/mt.c:370
-msgid "PRINT_OPERAND_ADDRESS, 2 regs"
-msgstr ""
-
-#: config/mt/mt.c:394
-msgid "PRINT_OPERAND_ADDRESS, invalid insn #1"
-msgstr ""
-
-#: config/rs6000/host-darwin.c:96
+#: config/rs6000/host-darwin.c:97
#, c-format
msgid "Out of stack space.\n"
msgstr ""
-#: config/rs6000/host-darwin.c:117
+#: config/rs6000/host-darwin.c:118
#, c-format
msgid "Try running '%s' in the shell to raise its limit.\n"
msgstr ""
-#: config/rs6000/rs6000.c:11630
+#: config/rs6000/rs6000.c:11792
#, c-format
msgid "invalid %%f value"
msgstr ""
-#: config/rs6000/rs6000.c:11639
+#: config/rs6000/rs6000.c:11801
#, c-format
msgid "invalid %%F value"
msgstr ""
-#: config/rs6000/rs6000.c:11648
+#: config/rs6000/rs6000.c:11810
#, c-format
msgid "invalid %%G value"
msgstr ""
-#: config/rs6000/rs6000.c:11683
+#: config/rs6000/rs6000.c:11845
#, c-format
msgid "invalid %%j code"
msgstr ""
-#: config/rs6000/rs6000.c:11693
+#: config/rs6000/rs6000.c:11855
#, c-format
msgid "invalid %%J code"
msgstr ""
-#: config/rs6000/rs6000.c:11703
+#: config/rs6000/rs6000.c:11865
#, c-format
msgid "invalid %%k value"
msgstr ""
-#: config/rs6000/rs6000.c:11723 config/xtensa/xtensa.c:2028
+#: config/rs6000/rs6000.c:11885 config/xtensa/xtensa.c:2049
#, c-format
msgid "invalid %%K value"
msgstr ""
-#: config/rs6000/rs6000.c:11793
+#: config/rs6000/rs6000.c:11955
#, c-format
msgid "invalid %%O value"
msgstr ""
-#: config/rs6000/rs6000.c:11840
+#: config/rs6000/rs6000.c:12002
#, c-format
msgid "invalid %%q value"
msgstr ""
-#: config/rs6000/rs6000.c:11884
+#: config/rs6000/rs6000.c:12046
#, c-format
msgid "invalid %%S value"
msgstr ""
-#: config/rs6000/rs6000.c:11924
+#: config/rs6000/rs6000.c:12086
#, c-format
msgid "invalid %%T value"
msgstr ""
-#: config/rs6000/rs6000.c:11934
+#: config/rs6000/rs6000.c:12096
#, c-format
msgid "invalid %%u value"
msgstr ""
-#: config/rs6000/rs6000.c:11943 config/xtensa/xtensa.c:1998
+#: config/rs6000/rs6000.c:12105 config/xtensa/xtensa.c:2019
#, c-format
msgid "invalid %%v value"
msgstr ""
-#: config/rs6000/rs6000.c:21931
+#: config/rs6000/rs6000.c:12326
+#, c-format
+msgid "invalid %%y value, try using the 'Z' constraint"
+msgstr ""
+
+#: config/rs6000/rs6000.c:22506
msgid "AltiVec argument passed to unprototyped function"
msgstr ""
-#: config/s390/s390.c:4560
+#: config/s390/s390.c:4932
#, c-format
msgid "cannot decompose address"
msgstr ""
-#: config/s390/s390.c:4770
+#: config/s390/s390.c:5145
msgid "UNKNOWN in print_operand !?"
msgstr ""
-#: config/score/score3.c:1262 config/score/score3.c:1282
-#: config/score/score7.c:1253
+#: config/score/score3.c:1263 config/score/score3.c:1283
+#: config/score/score7.c:1254
#, c-format
msgid "invalid operand for code: '%c'"
msgstr ""
-#: config/sh/sh.c:749
+#: config/sh/sh.c:779
#, c-format
msgid "invalid operand to %%R"
msgstr ""
-#: config/sh/sh.c:776
+#: config/sh/sh.c:806
#, c-format
msgid "invalid operand to %%S"
msgstr ""
-#: config/sh/sh.c:8098
+#: config/sh/sh.c:8414
msgid "created and used with different architectures / ABIs"
msgstr ""
-#: config/sh/sh.c:8100
+#: config/sh/sh.c:8416
msgid "created and used with different ABIs"
msgstr ""
-#: config/sh/sh.c:8102
+#: config/sh/sh.c:8418
msgid "created and used with different endianness"
msgstr ""
-#: config/sparc/sparc.c:6806 config/sparc/sparc.c:6812
+#: config/sparc/sparc.c:6811 config/sparc/sparc.c:6817
#, c-format
msgid "invalid %%Y operand"
msgstr ""
-#: config/sparc/sparc.c:6882
+#: config/sparc/sparc.c:6887
#, c-format
msgid "invalid %%A operand"
msgstr ""
-#: config/sparc/sparc.c:6892
+#: config/sparc/sparc.c:6897
#, c-format
msgid "invalid %%B operand"
msgstr ""
-#: config/sparc/sparc.c:6931
+#: config/sparc/sparc.c:6936
#, c-format
msgid "invalid %%c operand"
msgstr ""
-#: config/sparc/sparc.c:6953
+#: config/sparc/sparc.c:6958
#, c-format
msgid "invalid %%d operand"
msgstr ""
-#: config/sparc/sparc.c:6970
+#: config/sparc/sparc.c:6975
#, c-format
msgid "invalid %%f operand"
msgstr ""
-#: config/sparc/sparc.c:6984
+#: config/sparc/sparc.c:6989
#, c-format
msgid "invalid %%s operand"
msgstr ""
-#: config/sparc/sparc.c:7038
+#: config/sparc/sparc.c:7043
#, c-format
msgid "long long constant not a valid immediate operand"
msgstr ""
-#: config/sparc/sparc.c:7041
+#: config/sparc/sparc.c:7046
#, c-format
msgid "floating point constant not a valid immediate operand"
msgstr ""
-#: config/stormy16/stormy16.c:1748 config/stormy16/stormy16.c:1819
+#: config/stormy16/stormy16.c:1750 config/stormy16/stormy16.c:1821
#, c-format
msgid "'B' operand is not constant"
msgstr ""
-#: config/stormy16/stormy16.c:1775
+#: config/stormy16/stormy16.c:1777
#, c-format
msgid "'B' operand has multiple bits set"
msgstr ""
-#: config/stormy16/stormy16.c:1801
+#: config/stormy16/stormy16.c:1803
#, c-format
msgid "'o' operand is not constant"
msgstr ""
-#: config/stormy16/stormy16.c:1833
+#: config/stormy16/stormy16.c:1835
#, c-format
msgid "xstormy16_print_operand: unknown code"
msgstr ""
@@ -3684,64 +3722,64 @@ msgstr ""
msgid "output_move_single:"
msgstr ""
-#: config/xtensa/xtensa.c:656 config/xtensa/xtensa.c:688
-#: config/xtensa/xtensa.c:697
+#: config/xtensa/xtensa.c:670 config/xtensa/xtensa.c:702
+#: config/xtensa/xtensa.c:711
msgid "bad test"
msgstr ""
-#: config/xtensa/xtensa.c:1986
+#: config/xtensa/xtensa.c:2007
#, c-format
msgid "invalid %%D value"
msgstr ""
-#: config/xtensa/xtensa.c:2023
+#: config/xtensa/xtensa.c:2044
msgid "invalid mask"
msgstr ""
-#: config/xtensa/xtensa.c:2049
+#: config/xtensa/xtensa.c:2070
#, c-format
msgid "invalid %%x value"
msgstr ""
-#: config/xtensa/xtensa.c:2056
+#: config/xtensa/xtensa.c:2077
#, c-format
msgid "invalid %%d value"
msgstr ""
-#: config/xtensa/xtensa.c:2077 config/xtensa/xtensa.c:2087
+#: config/xtensa/xtensa.c:2098 config/xtensa/xtensa.c:2108
#, c-format
msgid "invalid %%t/%%b value"
msgstr ""
-#: config/xtensa/xtensa.c:2129
+#: config/xtensa/xtensa.c:2150
msgid "invalid address"
msgstr ""
-#: config/xtensa/xtensa.c:2154
+#: config/xtensa/xtensa.c:2175
msgid "no register in address"
msgstr ""
-#: config/xtensa/xtensa.c:2162
+#: config/xtensa/xtensa.c:2183
msgid "address offset not a constant"
msgstr ""
-#: cp/call.c:2500
+#: cp/call.c:2602
msgid "candidates are:"
msgstr ""
-#: cp/call.c:6474
+#: cp/call.c:6775
msgid "candidate 1:"
msgstr ""
-#: cp/call.c:6475
+#: cp/call.c:6776
msgid "candidate 2:"
msgstr ""
-#: cp/decl2.c:668
+#: cp/decl2.c:670
msgid "candidates are: %+#D"
msgstr ""
-#: cp/decl2.c:670
+#: cp/decl2.c:672
msgid "candidate is: %+#D"
msgstr ""
@@ -3778,55 +3816,55 @@ msgstr ""
msgid "Integer outside symmetric range implied by Standard Fortran at %L"
msgstr ""
-#: fortran/arith.c:1472
+#: fortran/arith.c:1477
msgid "elemental binary operation"
msgstr ""
-#: fortran/arith.c:2044
+#: fortran/arith.c:2055
#, no-c-format
msgid "Arithmetic OK converting %s to %s at %L"
msgstr ""
-#: fortran/arith.c:2048
+#: fortran/arith.c:2059
#, no-c-format
msgid ""
"Arithmetic overflow converting %s to %s at %L. This check can be disabled "
"with the option -fno-range-check"
msgstr ""
-#: fortran/arith.c:2053
+#: fortran/arith.c:2064
#, no-c-format
msgid "Arithmetic underflow converting %s to %s at %L"
msgstr ""
-#: fortran/arith.c:2057
+#: fortran/arith.c:2068
#, no-c-format
msgid "Arithmetic NaN converting %s to %s at %L"
msgstr ""
-#: fortran/arith.c:2061
+#: fortran/arith.c:2072
#, no-c-format
msgid "Division by zero converting %s to %s at %L"
msgstr ""
-#: fortran/arith.c:2065
+#: fortran/arith.c:2076
#, no-c-format
msgid "Array operands are incommensurate converting %s to %s at %L"
msgstr ""
-#: fortran/arith.c:2069
+#: fortran/arith.c:2080
#, no-c-format
msgid ""
"Integer outside symmetric range implied by Standard Fortran converting %s to "
"%s at %L"
msgstr ""
-#: fortran/arith.c:2402
+#: fortran/arith.c:2413
#, no-c-format
msgid "The Hollerith constant at %L is too long to convert to %s"
msgstr ""
-#: fortran/arith.c:2560
+#: fortran/arith.c:2572
#, no-c-format
msgid "Enumerator exceeds the C integer type at %C"
msgstr ""
@@ -3856,76 +3894,91 @@ msgstr ""
msgid "Variable '%s' at %L in this context must be constant"
msgstr ""
-#: fortran/array.c:299
+#: fortran/array.c:314
#, no-c-format
msgid "Expected expression in array specification at %C"
msgstr ""
-#: fortran/array.c:386
+#: fortran/array.c:396
#, no-c-format
msgid "Bad array specification for an explicitly shaped array at %C"
msgstr ""
-#: fortran/array.c:396
+#: fortran/array.c:406
#, no-c-format
msgid "Bad array specification for assumed shape array at %C"
msgstr ""
-#: fortran/array.c:410
+#: fortran/array.c:420
#, no-c-format
msgid "Bad specification for deferred shape array at %C"
msgstr ""
-#: fortran/array.c:414
+#: fortran/array.c:424
#, no-c-format
msgid "Bad specification for assumed size array at %C"
msgstr ""
-#: fortran/array.c:423
+#: fortran/array.c:433
#, no-c-format
msgid "Expected another dimension in array declaration at %C"
msgstr ""
-#: fortran/array.c:429
+#: fortran/array.c:439
#, no-c-format
msgid "Array specification at %C has more than %d dimensions"
msgstr ""
-#: fortran/array.c:635
+#: fortran/array.c:445
+#, no-c-format
+msgid "Fortran 2008: Array specification at %C with more than 7 dimensions"
+msgstr ""
+
+#: fortran/array.c:651
#, no-c-format
msgid "duplicated initializer"
msgstr ""
-#: fortran/array.c:727
+#: fortran/array.c:743
#, no-c-format
msgid "DO-iterator '%s' at %L is inside iterator of the same name"
msgstr ""
-#: fortran/array.c:829 fortran/array.c:938
+#: fortran/array.c:845 fortran/array.c:987
#, no-c-format
msgid "Syntax error in array constructor at %C"
msgstr ""
-#: fortran/array.c:884
+#: fortran/array.c:902
#, no-c-format
msgid "Fortran 2003: [...] style array constructors at %C"
msgstr ""
-#: fortran/array.c:898
+#: fortran/array.c:922
+#, no-c-format
+msgid "Fortran 2003: Array constructor including type specification at %C"
+msgstr ""
+
+#: fortran/array.c:937
#, no-c-format
msgid "Empty array constructor at %C is not allowed"
msgstr ""
-#: fortran/array.c:982
+#: fortran/array.c:1034
#, no-c-format
msgid "Element in %s array constructor at %L is %s"
msgstr ""
-#: fortran/array.c:1309
+#: fortran/array.c:1371
#, no-c-format
msgid "Iterator step at %L cannot be zero"
msgstr ""
+#: fortran/array.c:1657
+#, no-c-format
+msgid "Different CHARACTER lengths (%d/%d) in array constructor at %L"
+msgstr ""
+
#: fortran/check.c:44
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be a scalar"
@@ -3941,7 +3994,7 @@ msgstr ""
msgid "'%s' argument of '%s' intrinsic at %L must be a numeric type"
msgstr ""
-#: fortran/check.c:101 fortran/check.c:810 fortran/check.c:820
+#: fortran/check.c:101 fortran/check.c:825 fortran/check.c:835
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be INTEGER or REAL"
msgstr ""
@@ -4017,752 +4070,811 @@ msgstr ""
msgid "Unequal character lengths (%ld and %ld) in %s intrinsic at %L"
msgstr ""
-#: fortran/check.c:528 fortran/check.c:1932 fortran/check.c:1947
+#: fortran/check.c:532 fortran/check.c:2025 fortran/check.c:2040
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be ALLOCATABLE"
msgstr ""
-#: fortran/check.c:552 fortran/check.c:3697
+#: fortran/check.c:556 fortran/check.c:3872
#, no-c-format
msgid "'%s' and '%s' arguments of '%s' intrinsic at %L must have the same type"
msgstr ""
-#: fortran/check.c:561 fortran/check.c:1137 fortran/check.c:1280
-#: fortran/check.c:1354 fortran/check.c:1610
+#: fortran/check.c:565 fortran/check.c:1197 fortran/check.c:1340
+#: fortran/check.c:1414 fortran/check.c:1703
#, no-c-format
msgid "Extension: Different type kinds at %L"
msgstr ""
-#: fortran/check.c:601 fortran/check.c:2016
+#: fortran/check.c:605 fortran/check.c:2109
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be a POINTER"
msgstr ""
-#: fortran/check.c:621
+#: fortran/check.c:625
#, no-c-format
msgid ""
"'%s' argument of '%s' intrinsic at %L must be a pointer or target VARIABLE "
"or FUNCTION"
msgstr ""
-#: fortran/check.c:629
+#: fortran/check.c:633
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be a POINTER or a TARGET"
msgstr ""
-#: fortran/check.c:645
+#: fortran/check.c:649
#, no-c-format
msgid ""
"Array section with a vector subscript at %L shall not be the target of a "
"pointer"
msgstr ""
-#: fortran/check.c:656
+#: fortran/check.c:660
#, no-c-format
msgid ""
"NULL pointer at %L is not permitted as actual argument of '%s' intrinsic "
"function"
msgstr ""
-#: fortran/check.c:791 fortran/check.c:910
+#: fortran/check.c:806 fortran/check.c:930
#, no-c-format
msgid ""
"'%s' argument of '%s' intrinsic at %L must not be present if 'x' is COMPLEX"
msgstr ""
-#: fortran/check.c:841 fortran/check.c:1199 fortran/check.c:1302
-#: fortran/check.c:1461 fortran/check.c:1478 fortran/check.c:2312
-#: fortran/check.c:2438 fortran/check.c:2773 fortran/check.c:2815
+#: fortran/check.c:856 fortran/check.c:1259 fortran/check.c:1362
+#: fortran/check.c:1521 fortran/check.c:1538 fortran/check.c:2413
+#: fortran/check.c:2555 fortran/check.c:2898 fortran/check.c:2959
#, no-c-format
msgid "Fortran 2003: '%s' intrinsic with KIND argument at %L"
msgstr ""
-#: fortran/check.c:959 fortran/check.c:1706 fortran/check.c:1714
+#: fortran/check.c:881
+#, no-c-format
+msgid "SHIFT argument at %L of CSHIFT must have rank %d or be a scalar"
+msgstr ""
+
+#: fortran/check.c:979 fortran/check.c:1799 fortran/check.c:1807
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be numeric or LOGICAL"
msgstr ""
-#: fortran/check.c:973
+#: fortran/check.c:993
#, no-c-format
msgid ""
"Different shape for arguments '%s' and '%s' at %L for intrinsic 'dot_product'"
msgstr ""
-#: fortran/check.c:992 fortran/check.c:1000
+#: fortran/check.c:1012 fortran/check.c:1020
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be default real"
msgstr ""
-#: fortran/check.c:1250
+#: fortran/check.c:1047
+#, no-c-format
+msgid "SHIFT argument at %L of EOSHIFT must have rank %d or be a scalar"
+msgstr ""
+
+#: fortran/check.c:1067
+#, no-c-format
+msgid "BOUNDARY argument at %L of EOSHIFT must have rank %d or be a scalar"
+msgstr ""
+
+#: fortran/check.c:1078
+#, no-c-format
+msgid ""
+"Different shape in dimension %d for SHIFT and BOUNDARY arguments of EOSHIFT "
+"at %L"
+msgstr ""
+
+#: fortran/check.c:1310
#, no-c-format
msgid "Argument of %s at %L must be of length one"
msgstr ""
-#: fortran/check.c:1309
+#: fortran/check.c:1369
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be the same kind as '%s'"
msgstr ""
-#: fortran/check.c:1434
+#: fortran/check.c:1494
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be a non-derived type"
msgstr ""
-#: fortran/check.c:1583
+#: fortran/check.c:1676
#, no-c-format
msgid "Intrinsic '%s' at %L must have at least two arguments"
msgstr ""
-#: fortran/check.c:1616
+#: fortran/check.c:1709
#, no-c-format
msgid "'a%d' argument of '%s' intrinsic at %L must be %s(%d)"
msgstr ""
-#: fortran/check.c:1649
+#: fortran/check.c:1742
#, no-c-format
msgid "Fortran 2003: '%s' intrinsic with CHARACTER argument at %L"
msgstr ""
-#: fortran/check.c:1656
+#: fortran/check.c:1749
#, no-c-format
msgid ""
"'a1' argument of '%s' intrinsic at %L must be INTEGER, REAL or CHARACTER"
msgstr ""
-#: fortran/check.c:1728
+#: fortran/check.c:1821
#, no-c-format
msgid ""
"Different shape on dimension 1 for arguments '%s' and '%s' at %L for "
"intrinsic matmul"
msgstr ""
-#: fortran/check.c:1747
+#: fortran/check.c:1840
#, no-c-format
msgid ""
"Different shape on dimension 2 for argument '%s' and dimension 1 for "
"argument '%s' at %L for intrinsic matmul"
msgstr ""
-#: fortran/check.c:1756
+#: fortran/check.c:1849
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be of rank 1 or 2"
msgstr ""
-#: fortran/check.c:1958
+#: fortran/check.c:2051
#, no-c-format
msgid ""
"the '%s' and '%s' arguments of '%s' intrinsic at %L must have the same rank %"
"d/%d"
msgstr ""
-#: fortran/check.c:1967
+#: fortran/check.c:2060
#, no-c-format
msgid ""
"the '%s' and '%s' arguments of '%s' intrinsic at %L must be of the same kind "
"%d/%d"
msgstr ""
-#: fortran/check.c:2063
+#: fortran/check.c:2156
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be of type REAL or COMPLEX"
msgstr ""
-#: fortran/check.c:2084
+#: fortran/check.c:2177
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be of a dummy variable"
msgstr ""
-#: fortran/check.c:2092
+#: fortran/check.c:2185
#, no-c-format
msgid ""
"'%s' argument of '%s' intrinsic at %L must be of an OPTIONAL dummy variable"
msgstr ""
-#: fortran/check.c:2108
+#: fortran/check.c:2201
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must not be a subobject of '%s'"
msgstr ""
-#: fortran/check.c:2225
+#: fortran/check.c:2326
#, no-c-format
msgid ""
"'shape' argument of 'reshape' intrinsic at %L must be an array of constant "
"size"
msgstr ""
-#: fortran/check.c:2235
+#: fortran/check.c:2336
#, no-c-format
msgid "'shape' argument of 'reshape' intrinsic at %L has more than %d elements"
msgstr ""
-#: fortran/check.c:2273
+#: fortran/check.c:2374
#, no-c-format
msgid ""
"Without padding, there are not enough elements in the intrinsic RESHAPE "
"source at %L to match the shape"
msgstr ""
-#: fortran/check.c:2358
+#: fortran/check.c:2475
#, no-c-format
msgid "Missing arguments to %s intrinsic at %L"
msgstr ""
-#: fortran/check.c:2399
+#: fortran/check.c:2516
#, no-c-format
msgid ""
"'source' argument of 'shape' intrinsic at %L must not be an assumed size "
"array"
msgstr ""
-#: fortran/check.c:2473
+#: fortran/check.c:2590
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be less than rank %d"
msgstr ""
-#: fortran/check.c:2725
+#: fortran/check.c:2850
#, no-c-format
msgid "'MOLD' argument of 'TRANSFER' intrinsic at %L must not be %s"
msgstr ""
-#: fortran/check.c:3044
+#: fortran/check.c:2924
+#, no-c-format
+msgid ""
+"FIELD argument at %L of UNPACK must have the same rank as MASK or be a scalar"
+msgstr ""
+
+#: fortran/check.c:2935
+#, no-c-format
+msgid ""
+"Different shape in dimension %d for MASK and FIELD arguments of UNPACK at %L"
+msgstr ""
+
+#: fortran/check.c:3194
#, no-c-format
msgid "Too many arguments to %s at %L"
msgstr ""
-#: fortran/check.c:3156 fortran/check.c:3610 fortran/check.c:3634
+#: fortran/check.c:3306 fortran/check.c:3783 fortran/check.c:3807
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be INTEGER or PROCEDURE"
msgstr ""
-#: fortran/check.c:3332
+#: fortran/check.c:3489
#, no-c-format
msgid ""
"'%s' argument of '%s' intrinsic at %L must be of a kind not wider than the "
"default kind (%d)"
msgstr ""
-#: fortran/check.c:3681 fortran/check.c:3689
+#: fortran/check.c:3856 fortran/check.c:3864
#, no-c-format
msgid "'%s' argument of '%s' intrinsic at %L must be INTEGER or LOGICAL"
msgstr ""
+#: fortran/cpp.c:374 c-opts.c:887
+#, gcc-internal-format
+msgid "output filename specified twice"
+msgstr ""
+
+#: fortran/cpp.c:432
+#, no-c-format
+msgid "To enable preprocessing, use -cpp"
+msgstr ""
+
+#: fortran/cpp.c:521 fortran/cpp.c:531
+#, no-c-format
+msgid "opening output file %s: %s"
+msgstr ""
+
#: fortran/data.c:64
#, no-c-format
msgid "non-constant array in DATA statement %L"
msgstr ""
-#: fortran/data.c:193
+#: fortran/data.c:191
#, no-c-format
msgid "failure to simplify substring reference in DATA statement at %L"
msgstr ""
-#: fortran/data.c:224
+#: fortran/data.c:216
#, no-c-format
msgid "initialization string truncated to match variable at %L"
msgstr ""
-#: fortran/data.c:293
+#: fortran/data.c:295
#, no-c-format
msgid "'%s' at %L already is initialized at %L"
msgstr ""
-#: fortran/data.c:412
+#: fortran/data.c:319
+#, no-c-format
+msgid "Data element below array lower bound at %L"
+msgstr ""
+
+#: fortran/data.c:331
+#, no-c-format
+msgid "Data element above array upper bound at %L"
+msgstr ""
+
+#: fortran/data.c:432
#, no-c-format
msgid "Extension: re-initialization of '%s' at %L"
msgstr ""
-#: fortran/decl.c:253
+#: fortran/decl.c:258
#, no-c-format
msgid "Host associated variable '%s' may not be in the DATA statement at %C"
msgstr ""
-#: fortran/decl.c:260
+#: fortran/decl.c:265
#, no-c-format
msgid ""
"Extension: initialization of common block variable '%s' in DATA statement at "
"%C"
msgstr ""
-#: fortran/decl.c:365
+#: fortran/decl.c:370
#, no-c-format
msgid "Symbol '%s' must be a PARAMETER in DATA statement at %C"
msgstr ""
-#: fortran/decl.c:390
+#: fortran/decl.c:395
#, no-c-format
msgid "Invalid initializer %s in Data statement at %C"
msgstr ""
-#: fortran/decl.c:493
+#: fortran/decl.c:498
#, no-c-format
msgid "Initialization at %C is not allowed in a PURE procedure"
msgstr ""
-#: fortran/decl.c:552
+#: fortran/decl.c:557
#, no-c-format
msgid "DATA statement at %C is not allowed in a PURE procedure"
msgstr ""
-#: fortran/decl.c:581
+#: fortran/decl.c:586
#, no-c-format
msgid "Bad INTENT specification at %C"
msgstr ""
-#: fortran/decl.c:623
+#: fortran/decl.c:633
#, no-c-format
msgid "Conflict in attributes of function argument at %C"
msgstr ""
-#: fortran/decl.c:676
+#: fortran/decl.c:686
#, no-c-format
msgid "Syntax error in character length specification at %C"
msgstr ""
-#: fortran/decl.c:795
+#: fortran/decl.c:805
#, no-c-format
msgid "Procedure '%s' at %C is already defined at %L"
msgstr ""
-#: fortran/decl.c:803
+#: fortran/decl.c:813
#, no-c-format
msgid "Name '%s' at %C is already defined as a generic interface at %L"
msgstr ""
-#: fortran/decl.c:816
+#: fortran/decl.c:826
#, no-c-format
msgid ""
"Procedure '%s' at %C has an explicit interface and must not have attributes "
"declared at %L"
msgstr ""
-#: fortran/decl.c:888
+#: fortran/decl.c:898
#, no-c-format
msgid ""
"Procedure '%s' at %L must have the BIND(C) attribute to be C interoperable"
msgstr ""
-#: fortran/decl.c:918
+#: fortran/decl.c:928
#, no-c-format
msgid ""
"Type '%s' at %L is a parameter to the BIND(C) procedure '%s' but is not C "
"interoperable because derived type '%s' is not C interoperable"
msgstr ""
-#: fortran/decl.c:925
+#: fortran/decl.c:935
#, no-c-format
msgid ""
"Variable '%s' at %L is a parameter to the BIND(C) procedure '%s' but may not "
"be C interoperable"
msgstr ""
-#: fortran/decl.c:940
+#: fortran/decl.c:950
#, no-c-format
msgid ""
"Character argument '%s' at %L must be length 1 because procedure '%s' is BIND"
"(C)"
msgstr ""
-#: fortran/decl.c:954
+#: fortran/decl.c:964
#, no-c-format
msgid ""
"Variable '%s' at %L cannot have the ALLOCATABLE attribute because procedure "
"'%s' is BIND(C)"
msgstr ""
-#: fortran/decl.c:963
+#: fortran/decl.c:973
#, no-c-format
msgid ""
"Variable '%s' at %L cannot have the POINTER attribute because procedure '%s' "
"is BIND(C)"
msgstr ""
-#: fortran/decl.c:972
+#: fortran/decl.c:982
#, no-c-format
msgid ""
"Variable '%s' at %L cannot have the OPTIONAL attribute because procedure '%"
"s' is BIND(C)"
msgstr ""
-#: fortran/decl.c:985
+#: fortran/decl.c:995
#, no-c-format
msgid ""
"Assumed-shape array '%s' at %L cannot be an argument to the procedure '%s' "
"at %L because the procedure is BIND(C)"
msgstr ""
-#: fortran/decl.c:995
+#: fortran/decl.c:1005
#, no-c-format
msgid ""
"Deferred-shape array '%s' at %L cannot be an argument to the procedure '%s' "
"at %L because the procedure is BIND(C)"
msgstr ""
-#: fortran/decl.c:1071
+#: fortran/decl.c:1081
#, no-c-format
msgid ""
"Variable '%s' in common block '%s' at %C must be declared with a C "
"interoperable kind since common block '%s' is BIND(C)"
msgstr ""
-#: fortran/decl.c:1107
+#: fortran/decl.c:1120
#, no-c-format
msgid "CHARACTER expression at %L is being truncated (%d/%d)"
msgstr ""
-#: fortran/decl.c:1113
+#: fortran/decl.c:1127
#, no-c-format
msgid ""
"The CHARACTER elements of the array constructor at %L must have the same "
"length (%d/%d)"
msgstr ""
-#: fortran/decl.c:1203
+#: fortran/decl.c:1217
#, no-c-format
msgid "Initializer not allowed for PARAMETER '%s' at %C"
msgstr ""
-#: fortran/decl.c:1213
+#: fortran/decl.c:1227
#, no-c-format
msgid "PARAMETER at %L is missing an initializer"
msgstr ""
-#: fortran/decl.c:1223
+#: fortran/decl.c:1237
#, no-c-format
msgid ""
"Variable '%s' at %C with an initializer already appears in a DATA statement"
msgstr ""
-#: fortran/decl.c:1373
+#: fortran/decl.c:1387
#, no-c-format
msgid "Component at %C must have the POINTER attribute"
msgstr ""
-#: fortran/decl.c:1381
+#: fortran/decl.c:1395
#, no-c-format
msgid "Array component of structure at %C must have explicit or deferred shape"
msgstr ""
-#: fortran/decl.c:1425
+#: fortran/decl.c:1468
#, no-c-format
msgid "Allocatable component at %C must be an array"
msgstr ""
-#: fortran/decl.c:1436
+#: fortran/decl.c:1479
#, no-c-format
msgid "Pointer array component of structure at %C must have a deferred shape"
msgstr ""
-#: fortran/decl.c:1445
+#: fortran/decl.c:1488
#, no-c-format
msgid "Allocatable component of structure at %C must have a deferred shape"
msgstr ""
-#: fortran/decl.c:1454
+#: fortran/decl.c:1497
#, no-c-format
msgid "Array component of structure at %C must have an explicit shape"
msgstr ""
-#: fortran/decl.c:1480
+#: fortran/decl.c:1523
#, no-c-format
msgid "NULL() initialization at %C is ambiguous"
msgstr ""
-#: fortran/decl.c:1603 fortran/decl.c:5395
+#: fortran/decl.c:1646 fortran/decl.c:5534
#, no-c-format
msgid "Duplicate array spec for Cray pointee at %C"
msgstr ""
-#: fortran/decl.c:1663
+#: fortran/decl.c:1706
#, no-c-format
msgid "the type of '%s' at %C has not been declared within the interface"
msgstr ""
-#: fortran/decl.c:1679
+#: fortran/decl.c:1722
#, no-c-format
msgid "Function name '%s' not allowed at %C"
msgstr ""
-#: fortran/decl.c:1695
+#: fortran/decl.c:1738
#, no-c-format
msgid "Extension: Old-style initialization at %C"
msgstr ""
-#: fortran/decl.c:1710
+#: fortran/decl.c:1753 fortran/decl.c:4236
#, no-c-format
msgid "Initialization at %C isn't for a pointer variable"
msgstr ""
-#: fortran/decl.c:1718
+#: fortran/decl.c:1761 fortran/decl.c:4244
#, no-c-format
msgid "Pointer initialization requires a NULL() at %C"
msgstr ""
-#: fortran/decl.c:1724
+#: fortran/decl.c:1767 fortran/decl.c:4250
#, no-c-format
msgid "Initialization of pointer at %C is not allowed in a PURE procedure"
msgstr ""
-#: fortran/decl.c:1737
+#: fortran/decl.c:1780
#, no-c-format
msgid "Pointer initialization at %C requires '=>', not '='"
msgstr ""
-#: fortran/decl.c:1746 fortran/decl.c:6361
+#: fortran/decl.c:1789 fortran/decl.c:6610
#, no-c-format
msgid "Expected an initialization expression at %C"
msgstr ""
-#: fortran/decl.c:1752
+#: fortran/decl.c:1795
#, no-c-format
msgid "Initialization of variable at %C is not allowed in a PURE procedure"
msgstr ""
-#: fortran/decl.c:1765
+#: fortran/decl.c:1808
#, no-c-format
msgid "Initialization of allocatable component at %C is not allowed"
msgstr ""
-#: fortran/decl.c:1819 fortran/decl.c:1828
+#: fortran/decl.c:1862 fortran/decl.c:1871
#, no-c-format
msgid "Old-style type declaration %s*%d not supported at %C"
msgstr ""
-#: fortran/decl.c:1833
+#: fortran/decl.c:1876
#, no-c-format
msgid "Nonstandard type declaration %s*%d at %C"
msgstr ""
-#: fortran/decl.c:1884 fortran/decl.c:1948
+#: fortran/decl.c:1927 fortran/decl.c:1992
#, no-c-format
msgid "Missing right parenthesis at %C"
msgstr ""
-#: fortran/decl.c:1897 fortran/decl.c:1993
+#: fortran/decl.c:1940 fortran/decl.c:2037
#, no-c-format
msgid "Expected initialization expression at %C"
msgstr ""
-#: fortran/decl.c:1905 fortran/decl.c:1999
+#: fortran/decl.c:1948 fortran/decl.c:2043
#, no-c-format
msgid "Expected scalar initialization expression at %C"
msgstr ""
-#: fortran/decl.c:1936
+#: fortran/decl.c:1979
#, no-c-format
msgid "Kind %d not supported for type %s at %C"
msgstr ""
-#: fortran/decl.c:1946
+#: fortran/decl.c:1990
#, no-c-format
msgid "Missing right parenthesis or comma at %C"
msgstr ""
-#: fortran/decl.c:2019
+#: fortran/decl.c:2063
#, no-c-format
msgid "Kind %d is not supported for CHARACTER at %C"
msgstr ""
-#: fortran/decl.c:2148
+#: fortran/decl.c:2192
#, no-c-format
msgid "Syntax error in CHARACTER declaration at %C"
msgstr ""
-#: fortran/decl.c:2233
+#: fortran/decl.c:2277
#, no-c-format
msgid "Extension: BYTE type at %C"
msgstr ""
-#: fortran/decl.c:2239
+#: fortran/decl.c:2283
#, no-c-format
msgid "BYTE type used at %C is not available on the target machine"
msgstr ""
-#: fortran/decl.c:2288
+#: fortran/decl.c:2332
#, no-c-format
msgid "DOUBLE COMPLEX at %C does not conform to the Fortran 95 standard"
msgstr ""
-#: fortran/decl.c:2328 fortran/decl.c:2337 fortran/decl.c:2649
-#: fortran/decl.c:2657
+#: fortran/decl.c:2372 fortran/decl.c:2381 fortran/decl.c:2696
+#: fortran/decl.c:2704
#, no-c-format
msgid "Type name '%s' at %C is ambiguous"
msgstr ""
-#: fortran/decl.c:2412
+#: fortran/decl.c:2457
#, no-c-format
msgid "Missing character range in IMPLICIT at %C"
msgstr ""
-#: fortran/decl.c:2458
+#: fortran/decl.c:2503
#, no-c-format
msgid "Letters must be in alphabetic order in IMPLICIT statement at %C"
msgstr ""
-#: fortran/decl.c:2512
+#: fortran/decl.c:2559
#, no-c-format
msgid "Empty IMPLICIT statement at %C"
msgstr ""
-#: fortran/decl.c:2615
+#: fortran/decl.c:2662
#, no-c-format
msgid "IMPORT statement at %C only permitted in an INTERFACE body"
msgstr ""
-#: fortran/decl.c:2620
+#: fortran/decl.c:2667
#, no-c-format
msgid "Fortran 2003: IMPORT statement at %C"
msgstr ""
-#: fortran/decl.c:2635
+#: fortran/decl.c:2682
#, no-c-format
msgid "Expecting list of named entities at %C"
msgstr ""
-#: fortran/decl.c:2663
+#: fortran/decl.c:2710
#, no-c-format
msgid "Cannot IMPORT '%s' from host scoping unit at %C - does not exist."
msgstr ""
-#: fortran/decl.c:2670
+#: fortran/decl.c:2717
#, no-c-format
msgid "'%s' is already IMPORTed from host scoping unit at %C."
msgstr ""
-#: fortran/decl.c:2699
+#: fortran/decl.c:2746
#, no-c-format
msgid "Syntax error in IMPORT statement at %C"
msgstr ""
-#: fortran/decl.c:2941
+#: fortran/decl.c:2995
#, no-c-format
msgid "Missing dimension specification at %C"
msgstr ""
-#: fortran/decl.c:3015
+#: fortran/decl.c:3069
#, no-c-format
msgid "Duplicate %s attribute at %L"
msgstr ""
-#: fortran/decl.c:3034
+#: fortran/decl.c:3088
#, no-c-format
msgid "Fortran 2003: ALLOCATABLE attribute at %C in a TYPE definition"
msgstr ""
-#: fortran/decl.c:3044
+#: fortran/decl.c:3098
#, no-c-format
msgid "Attribute at %L is not allowed in a TYPE definition"
msgstr ""
-#: fortran/decl.c:3062
+#: fortran/decl.c:3116
#, no-c-format
msgid "Fortran 2003: Attribute %s at %L in a TYPE definition"
msgstr ""
-#: fortran/decl.c:3073
+#: fortran/decl.c:3127
#, no-c-format
msgid ""
"%s attribute at %L is not allowed outside of the specification part of a "
"module"
msgstr ""
-#: fortran/decl.c:3125 fortran/decl.c:5635
+#: fortran/decl.c:3179 fortran/decl.c:5774
#, no-c-format
msgid "PROTECTED at %C only allowed in specification part of a module"
msgstr ""
-#: fortran/decl.c:3131
+#: fortran/decl.c:3185
#, no-c-format
msgid "Fortran 2003: PROTECTED attribute at %C"
msgstr ""
-#: fortran/decl.c:3162
+#: fortran/decl.c:3216
#, no-c-format
msgid "Fortran 2003: VALUE attribute at %C"
msgstr ""
-#: fortran/decl.c:3172
+#: fortran/decl.c:3226
#, no-c-format
msgid "Fortran 2003: VOLATILE attribute at %C"
msgstr ""
-#: fortran/decl.c:3212
+#: fortran/decl.c:3266
#, no-c-format
msgid "Multiple identifiers provided with single NAME= specifier at %C"
msgstr ""
#. Print an error, but continue parsing line.
-#: fortran/decl.c:3261
+#: fortran/decl.c:3315
#, no-c-format
msgid "C kind parameter is for type %s but symbol '%s' at %L is of type %s"
msgstr ""
-#: fortran/decl.c:3325
+#: fortran/decl.c:3383
#, no-c-format
msgid ""
"Implicitly declared BIND(C) function '%s' at %L may not be C interoperable"
msgstr ""
-#: fortran/decl.c:3347
+#: fortran/decl.c:3405
#, no-c-format
msgid ""
"Variable '%s' in common block '%s' at %L may not be a C interoperable kind "
"though common block '%s' is BIND(C)"
msgstr ""
-#: fortran/decl.c:3356
+#: fortran/decl.c:3414
#, no-c-format
msgid "Type declaration '%s' at %L is not C interoperable but it is BIND(C)"
msgstr ""
-#: fortran/decl.c:3360
+#: fortran/decl.c:3418
#, no-c-format
msgid "Variable '%s' at %L may not be a C interoperable kind but it is bind(c)"
msgstr ""
-#: fortran/decl.c:3372
+#: fortran/decl.c:3430
#, no-c-format
msgid ""
"Variable '%s' in common block '%s' at %L cannot be declared with BIND(C) "
"since it is not a global"
msgstr ""
-#: fortran/decl.c:3386
+#: fortran/decl.c:3444
#, no-c-format
msgid "Variable '%s' at %L cannot have both the POINTER and BIND(C) attributes"
msgstr ""
-#: fortran/decl.c:3394
+#: fortran/decl.c:3452
#, no-c-format
msgid ""
"Variable '%s' at %L cannot have both the ALLOCATABLE and BIND(C) attributes"
msgstr ""
-#: fortran/decl.c:3404
+#: fortran/decl.c:3464
#, no-c-format
msgid "Return type of BIND(C) function '%s' at %L cannot be an array"
msgstr ""
-#: fortran/decl.c:3412
+#: fortran/decl.c:3472
#, no-c-format
msgid "Return type of BIND(C) function '%s' at %L cannot be a character string"
msgstr ""
#. Use gfc_warning_now because we won't say that the symbol fails
#. just because of this.
-#: fortran/decl.c:3424
+#: fortran/decl.c:3483
#, no-c-format
msgid ""
"Symbol '%s' at %L is marked PRIVATE but has been given the binding label '%s'"
msgstr ""
-#: fortran/decl.c:3499
+#: fortran/decl.c:3558
#, no-c-format
msgid ""
"Need either entity or common block name for attribute specification "
"statement at %C"
msgstr ""
-#: fortran/decl.c:3546
+#: fortran/decl.c:3605
#, no-c-format
msgid ""
"Missing entity or common block name for attribute specification statement at "
@@ -4771,1538 +4883,640 @@ msgstr ""
#. Now we have an error, which we signal, and then fix up
#. because the knock-on is plain and simple confusing.
-#: fortran/decl.c:3653
+#: fortran/decl.c:3712
#, no-c-format
msgid ""
"Derived type at %C has not been previously defined and so cannot appear in a "
"derived type definition"
msgstr ""
-#: fortran/decl.c:3685
+#: fortran/decl.c:3744
#, no-c-format
msgid "Syntax error in data declaration at %C"
msgstr ""
-#: fortran/decl.c:3832
+#: fortran/decl.c:3901
#, no-c-format
msgid "Name '%s' at %C is the name of the procedure"
msgstr ""
-#: fortran/decl.c:3844
+#: fortran/decl.c:3913
#, no-c-format
msgid "Unexpected junk in formal argument list at %C"
msgstr ""
-#: fortran/decl.c:3861
+#: fortran/decl.c:3930
#, no-c-format
msgid "Duplicate symbol '%s' in formal argument list at %C"
msgstr ""
-#: fortran/decl.c:3912
+#: fortran/decl.c:3981
#, no-c-format
msgid "RESULT variable at %C must be different than function name"
msgstr ""
-#: fortran/decl.c:3990
+#: fortran/decl.c:4059
#, no-c-format
msgid "Unexpected junk after function declaration at %C"
msgstr ""
-#: fortran/decl.c:4000 fortran/decl.c:4734
+#: fortran/decl.c:4069 fortran/decl.c:4869
#, no-c-format
msgid ""
-"Extension: BIND(C) attribute at %L may not be specified for an internal "
+"Fortran 2008: BIND(C) attribute at %L may not be specified for an internal "
"procedure"
msgstr ""
-#: fortran/decl.c:4066
+#: fortran/decl.c:4136
#, no-c-format
msgid "Interface '%s' at %C may not be generic"
msgstr ""
-#: fortran/decl.c:4071
+#: fortran/decl.c:4141
#, no-c-format
msgid "Interface '%s' at %C may not be a statement function"
msgstr ""
-#: fortran/decl.c:4082
+#: fortran/decl.c:4154
#, no-c-format
msgid "Intrinsic procedure '%s' not allowed in PROCEDURE statement at %C"
msgstr ""
-#: fortran/decl.c:4118
+#: fortran/decl.c:4190
#, no-c-format
msgid "BIND(C) attribute at %C requires an interface with BIND(C)"
msgstr ""
-#: fortran/decl.c:4125
+#: fortran/decl.c:4197
#, no-c-format
msgid "BIND(C) procedure with NAME may not have POINTER attribute at %C"
msgstr ""
-#: fortran/decl.c:4131
+#: fortran/decl.c:4203
#, no-c-format
msgid "Dummy procedure at %C may not have BIND(C) attribute with NAME"
msgstr ""
-#: fortran/decl.c:4167 fortran/decl.c:4210
+#: fortran/decl.c:4273 fortran/decl.c:4321
#, no-c-format
msgid "Syntax error in PROCEDURE statement at %C"
msgstr ""
-#: fortran/decl.c:4184
+#: fortran/decl.c:4295
#, no-c-format
msgid "PROCEDURE at %C must be in a generic interface"
msgstr ""
-#: fortran/decl.c:4235
+#: fortran/decl.c:4348
#, no-c-format
msgid ""
"Fortran 2003: Procedure components at %C are not yet implemented in gfortran"
msgstr ""
-#: fortran/decl.c:4245
+#: fortran/decl.c:4361
#, no-c-format
msgid "Fortran 2003: PROCEDURE statement at %C"
msgstr ""
-#: fortran/decl.c:4293
+#: fortran/decl.c:4425
#, no-c-format
msgid "Expected formal argument list in function definition at %C"
msgstr ""
-#: fortran/decl.c:4317 fortran/decl.c:4321 fortran/decl.c:4520
-#: fortran/decl.c:4524 fortran/decl.c:4702 fortran/decl.c:4706
-#: fortran/symbol.c:1402
+#: fortran/decl.c:4449 fortran/decl.c:4453 fortran/decl.c:4655
+#: fortran/decl.c:4659 fortran/decl.c:4837 fortran/decl.c:4841
+#: fortran/symbol.c:1450
#, no-c-format
msgid "BIND(C) attribute at %L can only be used for variables or common blocks"
msgstr ""
-#: fortran/decl.c:4353
+#: fortran/decl.c:4485
#, no-c-format
msgid "Function '%s' at %C already has a type of %s"
msgstr ""
-#: fortran/decl.c:4441
+#: fortran/decl.c:4576
#, no-c-format
msgid "ENTRY statement at %C cannot appear within a PROGRAM"
msgstr ""
-#: fortran/decl.c:4444
+#: fortran/decl.c:4579
#, no-c-format
msgid "ENTRY statement at %C cannot appear within a MODULE"
msgstr ""
-#: fortran/decl.c:4447
+#: fortran/decl.c:4582
#, no-c-format
msgid "ENTRY statement at %C cannot appear within a BLOCK DATA"
msgstr ""
-#: fortran/decl.c:4451
+#: fortran/decl.c:4586
#, no-c-format
msgid "ENTRY statement at %C cannot appear within an INTERFACE"
msgstr ""
-#: fortran/decl.c:4455
+#: fortran/decl.c:4590
#, no-c-format
msgid "ENTRY statement at %C cannot appear within a DERIVED TYPE block"
msgstr ""
-#: fortran/decl.c:4459
+#: fortran/decl.c:4594
#, no-c-format
msgid "ENTRY statement at %C cannot appear within an IF-THEN block"
msgstr ""
-#: fortran/decl.c:4463
+#: fortran/decl.c:4598
#, no-c-format
msgid "ENTRY statement at %C cannot appear within a DO block"
msgstr ""
-#: fortran/decl.c:4467
+#: fortran/decl.c:4602
#, no-c-format
msgid "ENTRY statement at %C cannot appear within a SELECT block"
msgstr ""
-#: fortran/decl.c:4471
+#: fortran/decl.c:4606
#, no-c-format
msgid "ENTRY statement at %C cannot appear within a FORALL block"
msgstr ""
-#: fortran/decl.c:4475
+#: fortran/decl.c:4610
#, no-c-format
msgid "ENTRY statement at %C cannot appear within a WHERE block"
msgstr ""
-#: fortran/decl.c:4479
+#: fortran/decl.c:4614
#, no-c-format
msgid "ENTRY statement at %C cannot appear within a contained subprogram"
msgstr ""
-#: fortran/decl.c:4497
+#: fortran/decl.c:4632
#, no-c-format
msgid "ENTRY statement at %C cannot appear in a contained procedure"
msgstr ""
-#: fortran/decl.c:4552 fortran/decl.c:4742
+#: fortran/decl.c:4687 fortran/decl.c:4877
#, no-c-format
msgid "Missing required parentheses before BIND(C) at %C"
msgstr ""
-#: fortran/decl.c:4801 fortran/decl.c:4817
+#: fortran/decl.c:4939 fortran/decl.c:4955
#, no-c-format
msgid "Syntax error in NAME= specifier for binding label at %C"
msgstr ""
-#: fortran/decl.c:4832
+#: fortran/decl.c:4970
#, no-c-format
msgid "Missing closing quote '\"' for binding label at %C"
msgstr ""
-#: fortran/decl.c:4841
+#: fortran/decl.c:4979
#, no-c-format
msgid "Missing closing quote ''' for binding label at %C"
msgstr ""
-#: fortran/decl.c:4851
+#: fortran/decl.c:4989
#, no-c-format
msgid "Missing closing paren for binding label at %C"
msgstr ""
-#: fortran/decl.c:4857
+#: fortran/decl.c:4995
#, no-c-format
msgid "No binding name is allowed in BIND(C) at %C"
msgstr ""
-#: fortran/decl.c:4863
+#: fortran/decl.c:5001
#, no-c-format
msgid "For dummy procedure %s, no binding name is allowed in BIND(C) at %C"
msgstr ""
-#: fortran/decl.c:4894
+#: fortran/decl.c:5032
#, no-c-format
msgid "NAME not allowed on BIND(C) for ABSTRACT INTERFACE at %C"
msgstr ""
-#: fortran/decl.c:5066
+#: fortran/decl.c:5205
#, no-c-format
msgid "Unexpected END statement at %C"
msgstr ""
#. We would have required END [something].
-#: fortran/decl.c:5075
+#: fortran/decl.c:5214
#, no-c-format
msgid "%s statement expected at %L"
msgstr ""
-#: fortran/decl.c:5086
+#: fortran/decl.c:5225
#, no-c-format
msgid "Expecting %s statement at %C"
msgstr ""
-#: fortran/decl.c:5101
+#: fortran/decl.c:5240
#, no-c-format
msgid "Expected block name of '%s' in %s statement at %C"
msgstr ""
-#: fortran/decl.c:5118
+#: fortran/decl.c:5257
#, no-c-format
msgid "Expected terminating name at %C"
msgstr ""
-#: fortran/decl.c:5127
+#: fortran/decl.c:5266
#, no-c-format
msgid "Expected label '%s' for %s statement at %C"
msgstr ""
-#: fortran/decl.c:5181
+#: fortran/decl.c:5320
#, no-c-format
msgid "Missing array specification at %L in DIMENSION statement"
msgstr ""
-#: fortran/decl.c:5189
+#: fortran/decl.c:5328
#, no-c-format
msgid "Dimensions specified for %s at %L after its initialisation"
msgstr ""
-#: fortran/decl.c:5198
+#: fortran/decl.c:5337
#, no-c-format
msgid "Array specification must be deferred at %L"
msgstr ""
-#: fortran/decl.c:5275
+#: fortran/decl.c:5414
#, no-c-format
msgid "Unexpected character in variable list at %C"
msgstr ""
-#: fortran/decl.c:5312
+#: fortran/decl.c:5451
#, no-c-format
msgid "Expected '(' at %C"
msgstr ""
-#: fortran/decl.c:5326 fortran/decl.c:5366
+#: fortran/decl.c:5465 fortran/decl.c:5505
#, no-c-format
msgid "Expected variable name at %C"
msgstr ""
-#: fortran/decl.c:5342
+#: fortran/decl.c:5481
#, no-c-format
msgid "Cray pointer at %C must be an integer"
msgstr ""
-#: fortran/decl.c:5346
+#: fortran/decl.c:5485
#, no-c-format
msgid ""
"Cray pointer at %C has %d bytes of precision; memory addresses require %d "
"bytes"
msgstr ""
-#: fortran/decl.c:5352
+#: fortran/decl.c:5491
#, no-c-format
msgid "Expected \",\" at %C"
msgstr ""
-#: fortran/decl.c:5415
+#: fortran/decl.c:5554
#, no-c-format
msgid "Expected \")\" at %C"
msgstr ""
-#: fortran/decl.c:5427
+#: fortran/decl.c:5566
#, no-c-format
msgid "Expected \",\" or end of statement at %C"
msgstr ""
-#: fortran/decl.c:5491
+#: fortran/decl.c:5630
#, no-c-format
msgid "Cray pointer declaration at %C requires -fcray-pointer flag"
msgstr ""
-#: fortran/decl.c:5586
+#: fortran/decl.c:5725
#, no-c-format
msgid ""
"Access specification of the %s operator at %C has already been specified"
msgstr ""
-#: fortran/decl.c:5603
+#: fortran/decl.c:5742
#, no-c-format
msgid ""
"Access specification of the .%s. operator at %C has already been specified"
msgstr ""
-#: fortran/decl.c:5641
+#: fortran/decl.c:5780
#, no-c-format
msgid "Fortran 2003: PROTECTED statement at %C"
msgstr ""
-#: fortran/decl.c:5681
+#: fortran/decl.c:5820
#, no-c-format
msgid "Syntax error in PROTECTED statement at %C"
msgstr ""
-#: fortran/decl.c:5702
+#: fortran/decl.c:5844
#, no-c-format
msgid ""
"PRIVATE statement at %C is only allowed in the specification part of a module"
msgstr ""
-#: fortran/decl.c:5739
+#: fortran/decl.c:5881
#, no-c-format
msgid ""
"PUBLIC statement at %C is only allowed in the specification part of a module"
msgstr ""
-#: fortran/decl.c:5766
+#: fortran/decl.c:5908
#, no-c-format
msgid "Expected variable name at %C in PARAMETER statement"
msgstr ""
-#: fortran/decl.c:5773
+#: fortran/decl.c:5915
#, no-c-format
msgid "Expected = sign in PARAMETER statement at %C"
msgstr ""
-#: fortran/decl.c:5779
+#: fortran/decl.c:5921
#, no-c-format
msgid "Expected expression at %C in PARAMETER statement"
msgstr ""
-#: fortran/decl.c:5799
+#: fortran/decl.c:5941
#, no-c-format
msgid "Initializing already initialized variable at %C"
msgstr ""
-#: fortran/decl.c:5844
+#: fortran/decl.c:6003
#, no-c-format
msgid "Unexpected characters in PARAMETER statement at %C"
msgstr ""
-#: fortran/decl.c:5868
+#: fortran/decl.c:6027
#, no-c-format
msgid "Blanket SAVE statement at %C follows previous SAVE statement"
msgstr ""
-#: fortran/decl.c:5880
+#: fortran/decl.c:6039
#, no-c-format
msgid "SAVE statement at %C follows blanket SAVE statement"
msgstr ""
-#: fortran/decl.c:5927
+#: fortran/decl.c:6086
#, no-c-format
msgid "Syntax error in SAVE statement at %C"
msgstr ""
-#: fortran/decl.c:5938
+#: fortran/decl.c:6097
#, no-c-format
msgid "Fortran 2003: VALUE statement at %C"
msgstr ""
-#: fortran/decl.c:5978
+#: fortran/decl.c:6137
#, no-c-format
msgid "Syntax error in VALUE statement at %C"
msgstr ""
-#: fortran/decl.c:5989
+#: fortran/decl.c:6148
#, no-c-format
msgid "Fortran 2003: VOLATILE statement at %C"
msgstr ""
-#: fortran/decl.c:6031
+#: fortran/decl.c:6190
#, no-c-format
msgid "Syntax error in VOLATILE statement at %C"
msgstr ""
-#: fortran/decl.c:6054
+#: fortran/decl.c:6213
#, no-c-format
msgid "MODULE PROCEDURE at %C must be in a generic module interface"
msgstr ""
-#: fortran/decl.c:6142
+#: fortran/decl.c:6295
+#, no-c-format
+msgid "Ambiguous symbol in TYPE definition at %C"
+msgstr ""
+
+#: fortran/decl.c:6301
+#, no-c-format
+msgid "No such symbol in TYPE definition at %C"
+msgstr ""
+
+#: fortran/decl.c:6307
+#, no-c-format
+msgid "'%s' in EXTENDS expression at %C is not a derived type"
+msgstr ""
+
+#: fortran/decl.c:6314
+#, no-c-format
+msgid "'%s' cannot be extended at %C because it is BIND(C)"
+msgstr ""
+
+#: fortran/decl.c:6321
+#, no-c-format
+msgid "'%s' cannot be extended at %C because it is a SEQUENCE type"
+msgstr ""
+
+#: fortran/decl.c:6344
#, no-c-format
msgid ""
"Derived type at %C can only be PRIVATE in the specification part of a module"
msgstr ""
-#: fortran/decl.c:6154
+#: fortran/decl.c:6356
#, no-c-format
msgid ""
"Derived type at %C can only be PUBLIC in the specification part of a module"
msgstr ""
-#: fortran/decl.c:6211
+#: fortran/decl.c:6432
#, no-c-format
msgid "Expected :: in TYPE definition at %C"
msgstr ""
-#: fortran/decl.c:6222
+#: fortran/decl.c:6443
#, no-c-format
msgid "Type name '%s' at %C cannot be the same as an intrinsic type"
msgstr ""
-#: fortran/decl.c:6232
+#: fortran/decl.c:6453
#, no-c-format
msgid "Derived type name '%s' at %C already has a basic type of %s"
msgstr ""
-#: fortran/decl.c:6248
+#: fortran/decl.c:6469
#, no-c-format
msgid "Derived type definition of '%s' at %C has already been defined"
msgstr ""
-#: fortran/decl.c:6286
+#: fortran/decl.c:6535
#, no-c-format
msgid "Cray Pointee at %C cannot be assumed shape array"
msgstr ""
-#: fortran/decl.c:6306
+#: fortran/decl.c:6555
#, no-c-format
msgid "Fortran 2003: ENUM and ENUMERATOR at %C"
msgstr ""
-#: fortran/decl.c:6378
+#: fortran/decl.c:6627
#, no-c-format
msgid "ENUMERATOR %L not initialized with integer expression"
msgstr ""
-#: fortran/decl.c:6427
+#: fortran/decl.c:6676
#, no-c-format
msgid "ENUM definition statement expected before %C"
msgstr ""
-#: fortran/decl.c:6460
+#: fortran/decl.c:6709
#, no-c-format
msgid "Syntax error in ENUMERATOR definition at %C"
msgstr ""
-#: fortran/dump-parse-tree.c:48
-#, c-format
-msgid "%-5d "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:50
-#, c-format
-msgid " "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:73 fortran/dump-parse-tree.c:637
-#, c-format
-msgid "(%s "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:86 fortran/dump-parse-tree.c:1091
-#: fortran/dump-parse-tree.c:1135 fortran/dump-parse-tree.c:1145
-#, c-format
-msgid "%d"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:90 fortran/dump-parse-tree.c:116
-#: fortran/dump-parse-tree.c:159 fortran/dump-parse-tree.c:395
-#: fortran/dump-parse-tree.c:518 fortran/dump-parse-tree.c:624
-#: fortran/dump-parse-tree.c:647
-#, c-format
-msgid ")"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:99 fortran/dump-parse-tree.c:435
-#, c-format
-msgid "("
-msgstr ""
-
-#: fortran/dump-parse-tree.c:105
-#, c-format
-msgid "%s = "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:109
-#, c-format
-msgid "(arg not-present)"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:113 fortran/dump-parse-tree.c:389
-#: fortran/dump-parse-tree.c:514
-#, c-format
-msgid " "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:130 fortran/dump-parse-tree.c:325
-#, c-format
-msgid "()"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:134
-#, c-format
-msgid "(%d"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:148
-#, c-format
-msgid " %s "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:175
-#, c-format
-msgid "FULL"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:206 fortran/dump-parse-tree.c:215
-#: fortran/dump-parse-tree.c:288
-#, c-format
-msgid " , "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:220
-#, c-format
-msgid "UNKNOWN"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:244
-#, c-format
-msgid " %% %s"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:302
-#, c-format
-msgid "''"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:307
-#, c-format
-msgid "' // ACHAR("
-msgstr ""
-
-#: fortran/dump-parse-tree.c:309
-#, c-format
-msgid ") // '"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:337
-#, c-format
-msgid "%s("
-msgstr ""
-
-#: fortran/dump-parse-tree.c:343
-#, c-format
-msgid "(/ "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:345
-#, c-format
-msgid " /)"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:351
-#, c-format
-msgid "NULL()"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:361 fortran/dump-parse-tree.c:374
-#: fortran/dump-parse-tree.c:387 fortran/dump-parse-tree.c:393
-#, c-format
-msgid "_%d"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:366
-#, c-format
-msgid ".true."
-msgstr ""
-
-#: fortran/dump-parse-tree.c:368
-#, c-format
-msgid ".false."
-msgstr ""
-
-#: fortran/dump-parse-tree.c:383
-#, c-format
-msgid "(complex "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:399
-#, c-format
-msgid "%dH"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:408
-#, c-format
-msgid "???"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:414
-#, c-format
-msgid " {"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:418
-#, c-format
-msgid "%.2x"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:429 fortran/dump-parse-tree.c:754
-#, c-format
-msgid "%s:"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:439
-#, c-format
-msgid "U+ "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:442
-#, c-format
-msgid "U- "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:445
-#, c-format
-msgid "+ "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:448
-#, c-format
-msgid "- "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:451
-#, c-format
-msgid "* "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:454
-#, c-format
-msgid "/ "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:457
-#, c-format
-msgid "** "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:460
-#, c-format
-msgid "// "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:463
-#, c-format
-msgid "AND "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:466
-#, c-format
-msgid "OR "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:469
-#, c-format
-msgid "EQV "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:472
-#, c-format
-msgid "NEQV "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:476
-#, c-format
-msgid "= "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:480
-#, c-format
-msgid "/= "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:484
-#, c-format
-msgid "> "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:488
-#, c-format
-msgid ">= "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:492
-#, c-format
-msgid "< "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:496
-#, c-format
-msgid "<= "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:499
-#, c-format
-msgid "NOT "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:502
-#, c-format
-msgid "parens"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:524
-#, c-format
-msgid "%s["
-msgstr ""
-
-#: fortran/dump-parse-tree.c:530
-#, c-format
-msgid "%s[["
-msgstr ""
-
-#: fortran/dump-parse-tree.c:560
-#, c-format
-msgid "(%s %s %s %s %s"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:567
-#, c-format
-msgid " ALLOCATABLE"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:569 fortran/dump-parse-tree.c:642
-#, c-format
-msgid " DIMENSION"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:571
-#, c-format
-msgid " EXTERNAL"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:573
-#, c-format
-msgid " INTRINSIC"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:575
-#, c-format
-msgid " OPTIONAL"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:577 fortran/dump-parse-tree.c:640
-#, c-format
-msgid " POINTER"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:579
-#, c-format
-msgid " PROTECTED"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:581
-#, c-format
-msgid " VALUE"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:583
-#, c-format
-msgid " VOLATILE"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:585
-#, c-format
-msgid " THREADPRIVATE"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:587
-#, c-format
-msgid " TARGET"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:589
-#, c-format
-msgid " DUMMY"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:591
-#, c-format
-msgid " RESULT"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:593
-#, c-format
-msgid " ENTRY"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:595
-#, c-format
-msgid " BIND(C)"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:598
-#, c-format
-msgid " DATA"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:600
-#, c-format
-msgid " USE-ASSOC"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:602
-#, c-format
-msgid " IN-NAMELIST"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:604
-#, c-format
-msgid " IN-COMMON"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:607
-#, c-format
-msgid " ABSTRACT INTERFACE"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:609
-#, c-format
-msgid " FUNCTION"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:611
-#, c-format
-msgid " SUBROUTINE"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:613
-#, c-format
-msgid " IMPLICIT-TYPE"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:616
-#, c-format
-msgid " SEQUENCE"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:618
-#, c-format
-msgid " ELEMENTAL"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:620
-#, c-format
-msgid " PURE"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:622
-#, c-format
-msgid " RECURSIVE"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:646 fortran/dump-parse-tree.c:693
-#: fortran/dump-parse-tree.c:717 fortran/dump-parse-tree.c:757
-#: fortran/dump-parse-tree.c:1298 fortran/dump-parse-tree.c:1304
-#: fortran/dump-parse-tree.c:1806
-#, c-format
-msgid " %s"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:670
-#, c-format
-msgid "symbol %s "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:677
-#, c-format
-msgid "value: "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:684
-#, c-format
-msgid "Array spec:"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:691
-#, c-format
-msgid "Generic interfaces:"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:699
-#, c-format
-msgid "result: %s"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:705
-#, c-format
-msgid "components: "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:712
-#, c-format
-msgid "Formal arglist:"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:719
-#, c-format
-msgid " [Alt Return]"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:726
-#, c-format
-msgid "Formal namespace"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:793
-#, c-format
-msgid "common: /%s/ "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:801 fortran/dump-parse-tree.c:1742
-#, c-format
-msgid ", "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:813
-#, c-format
-msgid "symtree: %s Ambig %d"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:816
-#, c-format
-msgid " from namespace %s"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:842
-#, c-format
-msgid "%s,"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:874
-#, c-format
-msgid "!$OMP %s"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:889 fortran/dump-parse-tree.c:1032
-#, c-format
-msgid " (%s)"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:894
-#, c-format
-msgid " ("
-msgstr ""
-
-#: fortran/dump-parse-tree.c:910
-#, c-format
-msgid " IF("
-msgstr ""
-
-#: fortran/dump-parse-tree.c:916
-#, c-format
-msgid " NUM_THREADS("
-msgstr ""
-
-#: fortran/dump-parse-tree.c:932
-#, c-format
-msgid " SCHEDULE (%s"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:952
-#, c-format
-msgid " DEFAULT(%s)"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:955
-#, c-format
-msgid " ORDERED"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:980
-#, c-format
-msgid " REDUCTION(%s:"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:994
-#, c-format
-msgid " %s("
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1010
-#, c-format
-msgid "!$OMP SECTION\n"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1019
-#, c-format
-msgid "!$OMP END %s"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1024
-#, c-format
-msgid " COPYPRIVATE("
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1029
-#, c-format
-msgid " NOWAIT"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1056
-#, c-format
-msgid "NOP"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1060
-#, c-format
-msgid "CONTINUE"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1064
-#, c-format
-msgid "ENTRY %s"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1069
-#, c-format
-msgid "ASSIGN "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1076
-#, c-format
-msgid "LABEL ASSIGN "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1078
-#, c-format
-msgid " %d"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1082
-#, c-format
-msgid "POINTER ASSIGN "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1089
-#, c-format
-msgid "GOTO "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1098
-#, c-format
-msgid ", ("
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1114 fortran/dump-parse-tree.c:1116
-#, c-format
-msgid "CALL %s "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1118
-#, c-format
-msgid "CALL ?? "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1124
-#, c-format
-msgid "RETURN "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1130
-#, c-format
-msgid "PAUSE "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1140
-#, c-format
-msgid "STOP "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1150 fortran/dump-parse-tree.c:1158
-#, c-format
-msgid "IF "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1152
-#, c-format
-msgid " %d, %d, %d"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1169
-#, c-format
-msgid "ELSE\n"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1172
-#, c-format
-msgid "ELSE IF "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1182
-#, c-format
-msgid "ENDIF"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1187
-#, c-format
-msgid "SELECT CASE "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1195
-#, c-format
-msgid "CASE "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1211
-#, c-format
-msgid "END SELECT"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1215
-#, c-format
-msgid "WHERE "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1226
-#, c-format
-msgid "ELSE WHERE "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1233
-#, c-format
-msgid "END WHERE"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1238
-#, c-format
-msgid "FORALL "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1263
-#, c-format
-msgid "END FORALL"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1267
-#, c-format
-msgid "DO "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1281 fortran/dump-parse-tree.c:1292
-#, c-format
-msgid "END DO"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1285
-#, c-format
-msgid "DO WHILE "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1296
-#, c-format
-msgid "CYCLE"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1302
-#, c-format
-msgid "EXIT"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1308
-#, c-format
-msgid "ALLOCATE "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1311 fortran/dump-parse-tree.c:1327
-#, c-format
-msgid " STAT="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1324
-#, c-format
-msgid "DEALLOCATE "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1340
-#, c-format
-msgid "OPEN"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1345 fortran/dump-parse-tree.c:1424
-#: fortran/dump-parse-tree.c:1466 fortran/dump-parse-tree.c:1489
-#: fortran/dump-parse-tree.c:1641
-#, c-format
-msgid " UNIT="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1350 fortran/dump-parse-tree.c:1429
-#: fortran/dump-parse-tree.c:1471 fortran/dump-parse-tree.c:1500
-#: fortran/dump-parse-tree.c:1658
-#, c-format
-msgid " IOMSG="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1355 fortran/dump-parse-tree.c:1434
-#: fortran/dump-parse-tree.c:1476 fortran/dump-parse-tree.c:1505
-#: fortran/dump-parse-tree.c:1663
-#, c-format
-msgid " IOSTAT="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1360 fortran/dump-parse-tree.c:1494
-#, c-format
-msgid " FILE="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1365 fortran/dump-parse-tree.c:1439
-#, c-format
-msgid " STATUS="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1370 fortran/dump-parse-tree.c:1535
-#, c-format
-msgid " ACCESS="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1375 fortran/dump-parse-tree.c:1551
-#, c-format
-msgid " FORM="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1380 fortran/dump-parse-tree.c:1566
-#, c-format
-msgid " RECL="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1385 fortran/dump-parse-tree.c:1576
-#, c-format
-msgid " BLANK="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1390 fortran/dump-parse-tree.c:1581
-#, c-format
-msgid " POSITION="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1395 fortran/dump-parse-tree.c:1586
-#, c-format
-msgid " ACTION="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1400 fortran/dump-parse-tree.c:1606
-#, c-format
-msgid " DELIM="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1405 fortran/dump-parse-tree.c:1611
-#, c-format
-msgid " PAD="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1410 fortran/dump-parse-tree.c:1616
-#, c-format
-msgid " CONVERT="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1414 fortran/dump-parse-tree.c:1443
-#: fortran/dump-parse-tree.c:1480 fortran/dump-parse-tree.c:1621
-#: fortran/dump-parse-tree.c:1698
-#, c-format
-msgid " ERR=%d"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1419
-#, c-format
-msgid "CLOSE"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1447
-#, c-format
-msgid "BACKSPACE"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1451
-#, c-format
-msgid "ENDFILE"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1455
-#, c-format
-msgid "REWIND"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1459
-#, c-format
-msgid "FLUSH"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1484
-#, c-format
-msgid "INQUIRE"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1510
-#, c-format
-msgid " EXIST="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1515
-#, c-format
-msgid " OPENED="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1520
-#, c-format
-msgid " NUMBER="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1525
-#, c-format
-msgid " NAMED="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1530
-#, c-format
-msgid " NAME="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1540
-#, c-format
-msgid " SEQUENTIAL="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1546
-#, c-format
-msgid " DIRECT="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1556
-#, c-format
-msgid " FORMATTED"
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1561
-#, c-format
-msgid " UNFORMATTED="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1571
-#, c-format
-msgid " NEXTREC="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1591
-#, c-format
-msgid " READ="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1596
-#, c-format
-msgid " WRITE="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1601
-#, c-format
-msgid " READWRITE="
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1625
-#, c-format
-msgid "IOLENGTH "
-msgstr ""
-
-#: fortran/dump-parse-tree.c:1631
-#, c-format
-msgid "READ"
+#: fortran/decl.c:6751
+#, no-c-format
+msgid "Binding attributes already specify passing, illegal NOPASS at %C"
msgstr ""
-#: fortran/dump-parse-tree.c:1635
-#, c-format
-msgid "WRITE"
+#: fortran/decl.c:6769
+#, no-c-format
+msgid "Duplicate NON_OVERRIDABLE at %C"
msgstr ""
-#: fortran/dump-parse-tree.c:1647
-#, c-format
-msgid " FMT="
+#: fortran/decl.c:6784
+#, no-c-format
+msgid "DEFERRED not yet implemented at %C"
msgstr ""
-#: fortran/dump-parse-tree.c:1652
-#, c-format
-msgid " FMT=%d"
+#: fortran/decl.c:6798
+#, no-c-format
+msgid "Binding attributes already specify passing, illegal PASS at %C"
msgstr ""
-#: fortran/dump-parse-tree.c:1654
-#, c-format
-msgid " NML=%s"
+#: fortran/decl.c:6824 fortran/decl.c:6839
+#, no-c-format
+msgid "Duplicate access-specifier at %C"
msgstr ""
-#: fortran/dump-parse-tree.c:1668
-#, c-format
-msgid " SIZE="
+#. Nothing matching found.
+#: fortran/decl.c:6848
+#, no-c-format
+msgid "Expected binding attribute at %C"
msgstr ""
-#: fortran/dump-parse-tree.c:1673
-#, c-format
-msgid " REC="
+#: fortran/decl.c:6885
+#, no-c-format
+msgid "Procedure with interface only allowed in abstract types at %C"
msgstr ""
-#: fortran/dump-parse-tree.c:1678
-#, c-format
-msgid " ADVANCE="
+#: fortran/decl.c:6907
+#, no-c-format
+msgid "Expected '::' after binding-attributes at %C"
msgstr ""
-#: fortran/dump-parse-tree.c:1689
-#, c-format
-msgid "TRANSFER "
+#: fortran/decl.c:6917
+#, no-c-format
+msgid "Expected binding name at %C"
msgstr ""
-#: fortran/dump-parse-tree.c:1694
-#, c-format
-msgid "DT_END"
+#: fortran/decl.c:6930
+#, no-c-format
+msgid "'::' needed in PROCEDURE binding with explicit target at %C"
msgstr ""
-#: fortran/dump-parse-tree.c:1700
-#, c-format
-msgid " END=%d"
+#: fortran/decl.c:6940
+#, no-c-format
+msgid "Expected binding target after '=>' at %C"
msgstr ""
-#: fortran/dump-parse-tree.c:1702
-#, c-format
-msgid " EOR=%d"
+#: fortran/decl.c:6952
+#, no-c-format
+msgid "Junk after PROCEDURE declaration at %C"
msgstr ""
-#: fortran/dump-parse-tree.c:1736
-#, c-format
-msgid "Equivalence: "
+#: fortran/decl.c:6969
+#, no-c-format
+msgid ""
+"There's already a procedure with binding name '%s' for the derived type '%s' "
+"at %C"
msgstr ""
-#: fortran/dump-parse-tree.c:1762
-#, c-format
-msgid "Namespace:"
+#: fortran/decl.c:6999
+#, no-c-format
+msgid "FINAL declaration at %C must be inside a derived type CONTAINS section"
msgstr ""
-#: fortran/dump-parse-tree.c:1776
-#, c-format
-msgid " %c-%c: "
+#: fortran/decl.c:7010
+#, no-c-format
+msgid ""
+"Derived type declaration with FINAL at %C must be in the specification part "
+"of a MODULE"
msgstr ""
-#: fortran/dump-parse-tree.c:1778
-#, c-format
-msgid " %c: "
+#: fortran/decl.c:7032
+#, no-c-format
+msgid "Empty FINAL at %C"
msgstr ""
-#: fortran/dump-parse-tree.c:1787
-#, c-format
-msgid "procedure name = %s"
+#: fortran/decl.c:7039
+#, no-c-format
+msgid "Expected module procedure name at %C"
msgstr ""
-#: fortran/dump-parse-tree.c:1803
-#, c-format
-msgid "Operator interfaces for %s:"
+#: fortran/decl.c:7049
+#, no-c-format
+msgid "Expected ',' at %C"
msgstr ""
-#: fortran/dump-parse-tree.c:1812
-#, c-format
-msgid "User operators:\n"
+#: fortran/decl.c:7055
+#, no-c-format
+msgid "Unknown procedure name \"%s\" at %C"
msgstr ""
-#: fortran/dump-parse-tree.c:1828
-#, c-format
-msgid "CONTAINS\n"
+#: fortran/decl.c:7069
+#, no-c-format
+msgid "'%s' at %C is already defined as FINAL procedure!"
msgstr ""
-#: fortran/error.c:213
+#: fortran/error.c:278
#, no-c-format
msgid " Included at %s:%d:"
msgstr ""
-#: fortran/error.c:318
+#: fortran/error.c:370
#, no-c-format
msgid "<During initialization>\n"
msgstr ""
-#: fortran/error.c:651
+#: fortran/error.c:703
#, no-c-format
msgid "Error count reached limit of %d."
msgstr ""
-#: fortran/error.c:670 fortran/error.c:724 fortran/error.c:761
+#: fortran/error.c:722 fortran/error.c:776 fortran/error.c:813
msgid "Warning:"
msgstr ""
-#: fortran/error.c:726 fortran/error.c:809 fortran/error.c:835
+#: fortran/error.c:778 fortran/error.c:861 fortran/error.c:887
msgid "Error:"
msgstr ""
-#: fortran/error.c:859
+#: fortran/error.c:911
msgid "Fatal Error:"
msgstr ""
-#: fortran/error.c:878
+#: fortran/error.c:930
#, no-c-format
msgid "Internal Error at (1):"
msgstr ""
-#: fortran/expr.c:253
+#: fortran/expr.c:252
#, c-format
msgid "Constant expression required at %C"
msgstr ""
-#: fortran/expr.c:256
+#: fortran/expr.c:255
#, c-format
msgid "Integer expression required at %C"
msgstr ""
-#: fortran/expr.c:261
+#: fortran/expr.c:260
#, c-format
msgid "Integer value too large in expression at %C"
msgstr ""
@@ -6312,348 +5526,350 @@ msgstr ""
msgid "Index in dimension %d is out of bounds at %L"
msgstr ""
-#: fortran/expr.c:1208 fortran/expr.c:1259
+#: fortran/expr.c:1209 fortran/expr.c:1260
#, no-c-format
msgid "index in dimension %d is out of bounds at %L"
msgstr ""
-#: fortran/expr.c:1808
+#: fortran/expr.c:1825
#, no-c-format
msgid "elemental function arguments at %C are not compliant"
msgstr ""
-#: fortran/expr.c:1852
+#: fortran/expr.c:1869
#, no-c-format
msgid "Numeric or CHARACTER operands are required in expression at %L"
msgstr ""
-#: fortran/expr.c:1872
+#: fortran/expr.c:1889
#, no-c-format
msgid "Fortran 2003: Noninteger exponent in an initialization expression at %L"
msgstr ""
-#: fortran/expr.c:1887
+#: fortran/expr.c:1904
#, no-c-format
msgid ""
"Concatenation operator in expression at %L must have two CHARACTER operands"
msgstr ""
-#: fortran/expr.c:1894
+#: fortran/expr.c:1911
#, no-c-format
msgid "Concat operator at %L must concatenate strings of the same kind"
msgstr ""
-#: fortran/expr.c:1904
+#: fortran/expr.c:1921
#, no-c-format
msgid ".NOT. operator in expression at %L must have a LOGICAL operand"
msgstr ""
-#: fortran/expr.c:1920
+#: fortran/expr.c:1937
#, no-c-format
msgid "LOGICAL operands are required in expression at %L"
msgstr ""
-#: fortran/expr.c:1931
+#: fortran/expr.c:1948
#, no-c-format
msgid "Only intrinsic operators can be used in expression at %L"
msgstr ""
-#: fortran/expr.c:1939
+#: fortran/expr.c:1956
#, no-c-format
msgid "Numeric operands are required in expression at %L"
msgstr ""
-#: fortran/expr.c:2030
+#: fortran/expr.c:2047
#, no-c-format
msgid "Assumed character length variable '%s' in constant expression at %L"
msgstr ""
-#: fortran/expr.c:2076 fortran/expr.c:2082
+#: fortran/expr.c:2093 fortran/expr.c:2099
#, no-c-format
msgid ""
"transformational intrinsic '%s' at %L is not permitted in an initialization "
"expression"
msgstr ""
-#: fortran/expr.c:2114
+#: fortran/expr.c:2131
#, no-c-format
msgid "Extension: Evaluation of nonstandard initialization expression at %L"
msgstr ""
-#: fortran/expr.c:2167
+#: fortran/expr.c:2188
#, no-c-format
msgid ""
"Function '%s' in initialization expression at %L must be an intrinsic or a "
"specification function"
msgstr ""
-#: fortran/expr.c:2179
+#: fortran/expr.c:2200
#, no-c-format
msgid ""
"Intrinsic function '%s' at %L is not permitted in an initialization "
"expression"
msgstr ""
-#: fortran/expr.c:2214
+#: fortran/expr.c:2232
#, no-c-format
msgid "PARAMETER '%s' is used at %L before its definition is complete"
msgstr ""
-#: fortran/expr.c:2234
+#: fortran/expr.c:2252
#, no-c-format
msgid ""
"Assumed size array '%s' at %L is not permitted in an initialization "
"expression"
msgstr ""
-#: fortran/expr.c:2240
+#: fortran/expr.c:2258
#, no-c-format
msgid ""
"Assumed shape array '%s' at %L is not permitted in an initialization "
"expression"
msgstr ""
-#: fortran/expr.c:2246
+#: fortran/expr.c:2264
#, no-c-format
msgid ""
"Deferred array '%s' at %L is not permitted in an initialization expression"
msgstr ""
-#: fortran/expr.c:2252
+#: fortran/expr.c:2270
#, no-c-format
msgid ""
"Array '%s' at %L is a variable, which does not reduce to a constant "
"expression"
msgstr ""
-#: fortran/expr.c:2262
+#: fortran/expr.c:2280
#, no-c-format
msgid ""
"Parameter '%s' at %L has not been declared or is a variable, which does not "
"reduce to a constant expression"
msgstr ""
-#: fortran/expr.c:2350
+#: fortran/expr.c:2368
#, no-c-format
msgid "Initialization expression didn't reduce %C"
msgstr ""
-#: fortran/expr.c:2393
+#: fortran/expr.c:2411
#, no-c-format
msgid "Specification function '%s' at %L cannot be a statement function"
msgstr ""
-#: fortran/expr.c:2400
+#: fortran/expr.c:2418
#, no-c-format
msgid "Specification function '%s' at %L cannot be an internal function"
msgstr ""
-#: fortran/expr.c:2407
+#: fortran/expr.c:2425
#, no-c-format
msgid "Specification function '%s' at %L must be PURE"
msgstr ""
-#: fortran/expr.c:2414
+#: fortran/expr.c:2432
#, no-c-format
msgid "Specification function '%s' at %L cannot be RECURSIVE"
msgstr ""
-#: fortran/expr.c:2476
+#: fortran/expr.c:2494
#, no-c-format
msgid "Dummy argument '%s' not allowed in expression at %L"
msgstr ""
-#: fortran/expr.c:2483
+#: fortran/expr.c:2501
#, no-c-format
msgid "Dummy argument '%s' at %L cannot be OPTIONAL"
msgstr ""
-#: fortran/expr.c:2490
+#: fortran/expr.c:2508
#, no-c-format
msgid "Dummy argument '%s' at %L cannot be INTENT(OUT)"
msgstr ""
-#: fortran/expr.c:2513
+#: fortran/expr.c:2531
#, no-c-format
msgid "Variable '%s' cannot appear in the expression at %L"
msgstr ""
-#: fortran/expr.c:2562
+#: fortran/expr.c:2580
#, no-c-format
-msgid "Expression at %L must be of INTEGER type"
+msgid "Expression at %L must be of INTEGER type, found %s"
msgstr ""
-#: fortran/expr.c:2571
+#: fortran/expr.c:2590
#, no-c-format
msgid "Function '%s' at %L must be PURE"
msgstr ""
-#: fortran/expr.c:2580
+#: fortran/expr.c:2599
#, no-c-format
msgid "Expression at %L must be scalar"
msgstr ""
-#: fortran/expr.c:2607
+#: fortran/expr.c:2626
#, no-c-format
msgid "Incompatible ranks in %s (%d and %d) at %L"
msgstr ""
-#: fortran/expr.c:2621
+#: fortran/expr.c:2640
#, no-c-format
msgid "Different shape for %s at %L on dimension %d (%d and %d)"
msgstr ""
-#: fortran/expr.c:2667 fortran/expr.c:2884
+#: fortran/expr.c:2686 fortran/expr.c:2916
#, no-c-format
msgid "Cannot assign to INTENT(IN) variable '%s' at %L"
msgstr ""
-#: fortran/expr.c:2719
+#: fortran/expr.c:2738
#, no-c-format
msgid "'%s' at %L is not a VALUE"
msgstr ""
-#: fortran/expr.c:2726
+#: fortran/expr.c:2745
#, no-c-format
msgid "Incompatible ranks %d and %d in assignment at %L"
msgstr ""
-#: fortran/expr.c:2733
+#: fortran/expr.c:2752
#, no-c-format
msgid "Variable type is UNKNOWN in assignment at %L"
msgstr ""
-#: fortran/expr.c:2745
+#: fortran/expr.c:2764
#, no-c-format
msgid "NULL appears on right-hand side in assignment at %L"
msgstr ""
-#: fortran/expr.c:2756
+#: fortran/expr.c:2775
#, no-c-format
msgid "Vector assignment to assumed-size Cray Pointee at %L is illegal"
msgstr ""
-#: fortran/expr.c:2765
+#: fortran/expr.c:2784
#, no-c-format
msgid "POINTER valued function appears on right-hand side of assignment at %L"
msgstr ""
-#: fortran/expr.c:2770
+#: fortran/expr.c:2789
msgid "array assignment"
msgstr ""
-#: fortran/expr.c:2775
+#: fortran/expr.c:2794
#, no-c-format
msgid ""
"Extension: BOZ literal at %L used to initialize non-integer variable '%s'"
msgstr ""
-#: fortran/expr.c:2781 fortran/resolve.c:5983
+#: fortran/expr.c:2800 fortran/resolve.c:6041
#, no-c-format
msgid ""
"Extension: BOZ literal at %L outside a DATA statement and outside INT/REAL/"
"DBLE/CMPLX"
msgstr ""
-#: fortran/expr.c:2791 fortran/resolve.c:5993
+#: fortran/expr.c:2810 fortran/resolve.c:6051
#, no-c-format
msgid "BOZ literal at %L is bitwise transferred non-integer symbol '%s'"
msgstr ""
-#: fortran/expr.c:2799 fortran/resolve.c:6002
+#: fortran/expr.c:2818 fortran/resolve.c:6060
#, no-c-format
msgid ""
"Arithmetic underflow of bit-wise transferred BOZ at %L. This check can be "
"disabled with the option -fno-range-check"
msgstr ""
-#: fortran/expr.c:2803 fortran/resolve.c:6006
+#: fortran/expr.c:2822 fortran/resolve.c:6064
#, no-c-format
msgid ""
"Arithmetic overflow of bit-wise transferred BOZ at %L. This check can be "
"disabled with the option -fno-range-check"
msgstr ""
-#: fortran/expr.c:2807 fortran/resolve.c:6010
+#: fortran/expr.c:2826 fortran/resolve.c:6068
#, no-c-format
msgid ""
"Arithmetic NaN of bit-wise transferred BOZ at %L. This check can be disabled "
"with the option -fno-range-check"
msgstr ""
-#: fortran/expr.c:2828
+#: fortran/expr.c:2848
#, no-c-format
-msgid "Incompatible types in assignment at %L, %s to %s"
+msgid ""
+"Incompatible types in DATA statement at %L; attempted conversion of %s to %s"
msgstr ""
-#: fortran/expr.c:2853
+#: fortran/expr.c:2884
#, no-c-format
msgid "Pointer assignment target is not a POINTER at %L"
msgstr ""
-#: fortran/expr.c:2861
+#: fortran/expr.c:2892
#, no-c-format
msgid ""
"'%s' in the pointer assignment at %L cannot be an l-value since it is a "
"procedure"
msgstr ""
-#: fortran/expr.c:2891
+#: fortran/expr.c:2923
#, no-c-format
msgid "Pointer assignment to non-POINTER at %L"
msgstr ""
-#: fortran/expr.c:2900
+#: fortran/expr.c:2932
#, no-c-format
msgid "Bad pointer object in PURE procedure at %L"
msgstr ""
-#: fortran/expr.c:2912
+#: fortran/expr.c:2948
#, no-c-format
-msgid "Different types in pointer assignment at %L"
+msgid ""
+"Different types in pointer assignment at %L; attempted assignment of %s to %s"
msgstr ""
-#: fortran/expr.c:2919
+#: fortran/expr.c:2956
#, no-c-format
msgid "Different kind type parameters in pointer assignment at %L"
msgstr ""
-#: fortran/expr.c:2926
+#: fortran/expr.c:2963
#, no-c-format
msgid "Different ranks in pointer assignment at %L"
msgstr ""
-#: fortran/expr.c:2941
+#: fortran/expr.c:2978
#, no-c-format
msgid "Different character lengths in pointer assignment at %L"
msgstr ""
-#: fortran/expr.c:2952
+#: fortran/expr.c:2989
#, no-c-format
msgid "Pointer assignment target is neither TARGET nor POINTER at %L"
msgstr ""
-#: fortran/expr.c:2959
+#: fortran/expr.c:2996
#, no-c-format
msgid "Bad target in pointer assignment in PURE procedure at %L"
msgstr ""
-#: fortran/expr.c:2965
+#: fortran/expr.c:3002
#, no-c-format
msgid "Pointer assignment with vector subscript on rhs at %L"
msgstr ""
-#: fortran/expr.c:2972
+#: fortran/expr.c:3009
#, no-c-format
-msgid "Pointer assigment target has PROTECTED attribute at %L"
+msgid "Pointer assignment target has PROTECTED attribute at %L"
msgstr ""
-#: fortran/gfortranspec.c:248
+#: fortran/gfortranspec.c:251
#, c-format
msgid "overflowed output arg list for '%s'"
msgstr ""
-#: fortran/gfortranspec.c:381
+#: fortran/gfortranspec.c:384
#, c-format
msgid ""
"GNU Fortran comes with NO WARRANTY, to the extent permitted by law.\n"
@@ -6663,17 +5879,22 @@ msgid ""
"\n"
msgstr ""
-#: fortran/gfortranspec.c:403
+#: fortran/gfortranspec.c:406 fortran/gfortranspec.c:445
#, c-format
msgid "argument to '%s' missing"
msgstr ""
-#: fortran/gfortranspec.c:407
+#: fortran/gfortranspec.c:410
#, c-format
msgid "no input files; unwilling to write output files"
msgstr ""
-#: fortran/gfortranspec.c:566
+#: fortran/gfortranspec.c:432
+#, c-format
+msgid "Warning: Using -M <directory> is deprecated, use -J instead\n"
+msgstr ""
+
+#: fortran/gfortranspec.c:578
#, c-format
msgid "Driving:"
msgstr ""
@@ -6753,187 +5974,192 @@ msgstr ""
msgid "Assignment operator interface at %L must have two arguments"
msgstr ""
-#: fortran/interface.c:620
+#: fortran/interface.c:625
#, no-c-format
msgid ""
"Assignment operator interface at %L must not redefine an INTRINSIC type "
"assignment"
msgstr ""
-#: fortran/interface.c:629
+#: fortran/interface.c:634
#, no-c-format
msgid "Intrinsic operator interface at %L must be a FUNCTION"
msgstr ""
-#: fortran/interface.c:639
+#: fortran/interface.c:644
#, no-c-format
msgid ""
-"First argument of defined assignment at %L must be INTENT(IN) or INTENT"
+"First argument of defined assignment at %L must be INTENT(OUT) or INTENT"
"(INOUT)"
msgstr ""
-#: fortran/interface.c:643
+#: fortran/interface.c:648
#, no-c-format
msgid "Second argument of defined assignment at %L must be INTENT(IN)"
msgstr ""
-#: fortran/interface.c:649 fortran/resolve.c:8935
+#: fortran/interface.c:654 fortran/resolve.c:9590
#, no-c-format
msgid "First argument of operator interface at %L must be INTENT(IN)"
msgstr ""
-#: fortran/interface.c:653 fortran/resolve.c:8947
+#: fortran/interface.c:658 fortran/resolve.c:9602
#, no-c-format
msgid "Second argument of operator interface at %L must be INTENT(IN)"
msgstr ""
-#: fortran/interface.c:756
+#: fortran/interface.c:761
#, no-c-format
msgid "Operator interface at %L conflicts with intrinsic interface"
msgstr ""
-#: fortran/interface.c:1117
+#: fortran/interface.c:1122
#, no-c-format
msgid "Procedure '%s' in %s at %L has no explicit interface"
msgstr ""
-#: fortran/interface.c:1120
+#: fortran/interface.c:1125
#, no-c-format
msgid "Procedure '%s' in %s at %L is neither function nor subroutine"
msgstr ""
-#: fortran/interface.c:1175 fortran/interface.c:1181
+#: fortran/interface.c:1180 fortran/interface.c:1186
#, no-c-format
msgid "Ambiguous interfaces '%s' and '%s' in %s at %L"
msgstr ""
-#: fortran/interface.c:1217
+#: fortran/interface.c:1222
#, no-c-format
msgid "'%s' at %L is not a module procedure"
msgstr ""
-#: fortran/interface.c:1465 fortran/interface.c:2411
+#: fortran/interface.c:1470 fortran/interface.c:2429
#, no-c-format
msgid "Type/rank mismatch in argument '%s' at %L"
msgstr ""
-#: fortran/interface.c:1474
+#: fortran/interface.c:1479
#, no-c-format
msgid "Type mismatch in argument '%s' at %L; passed %s to %s"
msgstr ""
-#: fortran/interface.c:1492 fortran/interface.c:1532
+#: fortran/interface.c:1497 fortran/interface.c:1537
#, no-c-format
msgid "Rank mismatch in argument '%s' at %L (%d and %d)"
msgstr ""
-#: fortran/interface.c:1519
+#: fortran/interface.c:1524
#, no-c-format
msgid ""
"Fortran 2003: Scalar CHARACTER actual argument with array dummy argument '%"
"s' at %L"
msgstr ""
-#: fortran/interface.c:1544
+#: fortran/interface.c:1549
#, no-c-format
msgid "Element of assumed-shaped array passed to dummy argument '%s' at %L"
msgstr ""
-#: fortran/interface.c:1861
+#: fortran/interface.c:1866
#, no-c-format
msgid "Keyword argument '%s' at %L is not in the procedure"
msgstr ""
-#: fortran/interface.c:1869
+#: fortran/interface.c:1874
#, no-c-format
msgid ""
"Keyword argument '%s' at %L is already associated with another actual "
"argument"
msgstr ""
-#: fortran/interface.c:1879
+#: fortran/interface.c:1884
#, no-c-format
msgid "More actual than formal arguments in procedure call at %L"
msgstr ""
-#: fortran/interface.c:1891 fortran/interface.c:2110
+#: fortran/interface.c:1896 fortran/interface.c:2128
#, no-c-format
msgid "Missing alternate return spec in subroutine call at %L"
msgstr ""
-#: fortran/interface.c:1899
+#: fortran/interface.c:1904
#, no-c-format
msgid "Unexpected alternate return spec in subroutine call at %L"
msgstr ""
-#: fortran/interface.c:1922
+#: fortran/interface.c:1927
#, no-c-format
msgid ""
"Character length mismatch (%ld/%ld) between actual argument and pointer or "
"allocatable dummy argument '%s' at %L"
msgstr ""
-#: fortran/interface.c:1929
+#: fortran/interface.c:1934
#, no-c-format
msgid ""
"Character length mismatch (%ld/%ld) between actual argument and assumed-"
"shape dummy argument '%s' at %L"
msgstr ""
-#: fortran/interface.c:1943
+#: fortran/interface.c:1950
#, no-c-format
msgid ""
"Character length of actual argument shorter than of dummy argument '%s' (%lu/"
"%lu) at %L"
msgstr ""
-#: fortran/interface.c:1948
+#: fortran/interface.c:1955
#, no-c-format
msgid ""
"Actual argument contains too few elements for dummy argument '%s' (%lu/%lu) "
"at %L"
msgstr ""
-#: fortran/interface.c:1962
+#: fortran/interface.c:1968
+#, no-c-format
+msgid "Expected a procedure pointer for argument '%s' at %L"
+msgstr ""
+
+#: fortran/interface.c:1980
#, no-c-format
msgid "Expected a procedure for argument '%s' at %L"
msgstr ""
-#: fortran/interface.c:1972
+#: fortran/interface.c:1990
#, no-c-format
msgid "Expected a PURE procedure for argument '%s' at %L"
msgstr ""
-#: fortran/interface.c:1986
+#: fortran/interface.c:2004
#, no-c-format
msgid "Actual argument for '%s' cannot be an assumed-size array at %L"
msgstr ""
-#: fortran/interface.c:1995
+#: fortran/interface.c:2013
#, no-c-format
msgid "Actual argument for '%s' must be a pointer at %L"
msgstr ""
-#: fortran/interface.c:2004
+#: fortran/interface.c:2022
#, no-c-format
msgid "Actual argument for '%s' must be ALLOCATABLE at %L"
msgstr ""
-#: fortran/interface.c:2017
+#: fortran/interface.c:2035
#, no-c-format
msgid ""
"Actual argument at %L must be definable as the dummy argument '%s' is INTENT "
"= OUT/INOUT"
msgstr ""
-#: fortran/interface.c:2026
+#: fortran/interface.c:2044
#, no-c-format
msgid ""
"Actual argument at %L is use-associated with PROTECTED attribute and dummy "
"argument '%s' is INTENT = OUT/INOUT"
msgstr ""
-#: fortran/interface.c:2039
+#: fortran/interface.c:2057
#, no-c-format
msgid ""
"Array-section actual argument with vector subscripts at %L is incompatible "
@@ -6941,757 +6167,868 @@ msgid ""
"'%s'"
msgstr ""
-#: fortran/interface.c:2056
+#: fortran/interface.c:2074
#, no-c-format
msgid ""
"Assumed-shape actual argument at %L is incompatible with the non-assumed-"
"shape dummy argument '%s' due to VOLATILE attribute"
msgstr ""
-#: fortran/interface.c:2068
+#: fortran/interface.c:2086
#, no-c-format
msgid ""
"Array-section actual argument at %L is incompatible with the non-assumed-"
"shape dummy argument '%s' due to VOLATILE attribute"
msgstr ""
-#: fortran/interface.c:2087
+#: fortran/interface.c:2105
#, no-c-format
msgid ""
"Pointer-array actual argument at %L requires an assumed-shape or pointer-"
"array dummy argument '%s' due to VOLATILE attribute"
msgstr ""
-#: fortran/interface.c:2117
+#: fortran/interface.c:2135
#, no-c-format
msgid "Missing actual argument for argument '%s' at %L"
msgstr ""
-#: fortran/interface.c:2303
+#: fortran/interface.c:2321
#, no-c-format
msgid ""
"Same actual argument associated with INTENT(%s) argument '%s' and INTENT(%s) "
"argument '%s' at %L"
msgstr ""
-#: fortran/interface.c:2359
+#: fortran/interface.c:2377
#, no-c-format
msgid ""
"Procedure argument at %L is INTENT(IN) while interface specifies INTENT(%s)"
msgstr ""
-#: fortran/interface.c:2369
+#: fortran/interface.c:2387
#, no-c-format
msgid ""
"Procedure argument at %L is local to a PURE procedure and is passed to an "
"INTENT(%s) argument"
msgstr ""
-#: fortran/interface.c:2377
+#: fortran/interface.c:2395
#, no-c-format
msgid ""
"Procedure argument at %L is local to a PURE procedure and has the POINTER "
"attribute"
msgstr ""
-#: fortran/interface.c:2400
+#: fortran/interface.c:2418
#, no-c-format
msgid "Procedure '%s' called with an implicit interface at %L"
msgstr ""
-#: fortran/interface.c:2629
+#: fortran/interface.c:2443
+#, no-c-format
+msgid "Keyword argument requires explicit interface for procedure '%s' at %L"
+msgstr ""
+
+#: fortran/interface.c:2663
#, no-c-format
msgid "Function '%s' called in lieu of an operator at %L must be PURE"
msgstr ""
-#: fortran/interface.c:2708
+#: fortran/interface.c:2743
#, no-c-format
msgid "Entity '%s' at %C is already present in the interface"
msgstr ""
-#: fortran/intrinsic.c:2923
+#: fortran/intrinsic.c:840
+#, no-c-format
+msgid ""
+"The intrinsic '%s' at %L is not included in the selected standard but %s and "
+"'%s' will be treated as if declared EXTERNAL. Use an appropriate -std=* "
+"option or define -fall-intrinsics to allow this intrinsic."
+msgstr ""
+
+#: fortran/intrinsic.c:3065
#, no-c-format
msgid "Too many arguments in call to '%s' at %L"
msgstr ""
-#: fortran/intrinsic.c:2938
+#: fortran/intrinsic.c:3080
#, no-c-format
msgid ""
"The argument list functions %%VAL, %%LOC or %%REF are not allowed in this "
"context at %L"
msgstr ""
-#: fortran/intrinsic.c:2941
+#: fortran/intrinsic.c:3083
#, no-c-format
msgid "Can't find keyword named '%s' in call to '%s' at %L"
msgstr ""
-#: fortran/intrinsic.c:2948
+#: fortran/intrinsic.c:3090
#, no-c-format
msgid "Argument '%s' is appears twice in call to '%s' at %L"
msgstr ""
-#: fortran/intrinsic.c:2962
+#: fortran/intrinsic.c:3104
#, no-c-format
msgid "Missing actual argument '%s' in call to '%s' at %L"
msgstr ""
-#: fortran/intrinsic.c:2977
+#: fortran/intrinsic.c:3119
#, no-c-format
msgid "ALTERNATE RETURN not permitted at %L"
msgstr ""
-#: fortran/intrinsic.c:3026
+#: fortran/intrinsic.c:3176
#, no-c-format
msgid "Type of argument '%s' in call to '%s' at %L should be %s, not %s"
msgstr ""
-#: fortran/intrinsic.c:3342
+#: fortran/intrinsic.c:3545
#, no-c-format
-msgid "Intrinsic '%s' at %L is not included in the selected standard"
+msgid "Intrinsic '%s' (is %s) is used at %L"
msgstr ""
-#: fortran/intrinsic.c:3398
+#: fortran/intrinsic.c:3607
#, no-c-format
msgid "Fortran 2003: Function '%s' as initialization expression at %L"
msgstr ""
-#: fortran/intrinsic.c:3463
+#: fortran/intrinsic.c:3672
#, no-c-format
msgid ""
"Fortran 2003: Elemental function as initialization expression with non-"
"integer/non-character arguments at %L"
msgstr ""
-#: fortran/intrinsic.c:3524
+#: fortran/intrinsic.c:3730
#, no-c-format
msgid "Subroutine call to intrinsic '%s' at %L is not PURE"
msgstr ""
-#: fortran/intrinsic.c:3595
+#: fortran/intrinsic.c:3801
#, no-c-format
msgid "Extension: Conversion from %s to %s at %L"
msgstr ""
-#: fortran/intrinsic.c:3598
+#: fortran/intrinsic.c:3804
#, no-c-format
msgid "Conversion from %s to %s at %L"
msgstr ""
-#: fortran/intrinsic.c:3645
+#: fortran/intrinsic.c:3851
#, no-c-format
msgid "Can't convert %s to %s at %L"
msgstr ""
-#: fortran/io.c:156 fortran/primary.c:750
+#: fortran/intrinsic.c:3947
+#, no-c-format
+msgid ""
+"'%s' declared at %L may shadow the intrinsic of the same name. In order to "
+"call the intrinsic, explicit INTRINSIC declarations may be required."
+msgstr ""
+
+#: fortran/intrinsic.c:3952
+#, no-c-format
+msgid ""
+"'%s' declared at %L is also the name of an intrinsic. It can only be called "
+"via an explicit interface or if declared EXTERNAL."
+msgstr ""
+
+#: fortran/io.c:164 fortran/primary.c:768
#, no-c-format
msgid "Extension: backslash character at %C"
msgstr ""
-#: fortran/io.c:187 fortran/io.c:190
+#: fortran/io.c:198 fortran/io.c:201
#, no-c-format
msgid "Extension: Tab character in format at %C"
msgstr ""
-#: fortran/io.c:450
+#: fortran/io.c:437
+#, no-c-format
+msgid "Fortran 2003: DP format specifier not allowed at %C"
+msgstr ""
+
+#: fortran/io.c:444
+#, no-c-format
+msgid "Fortran 2003: DC format specifier not allowed at %C"
+msgstr ""
+
+#: fortran/io.c:480
msgid "Positive width required"
msgstr ""
-#: fortran/io.c:451
+#: fortran/io.c:481
msgid "Nonnegative width required"
msgstr ""
-#: fortran/io.c:452
-msgid "Unexpected element"
+#: fortran/io.c:482
+msgid "Unexpected element '%c' in format string at %L"
msgstr ""
-#: fortran/io.c:453
+#: fortran/io.c:484
msgid "Unexpected end of format string"
msgstr ""
-#: fortran/io.c:472
+#: fortran/io.c:485
+msgid "Zero width in format descriptor"
+msgstr ""
+
+#: fortran/io.c:486
+msgid "Specifying precision with G0 not allowed"
+msgstr ""
+
+#: fortran/io.c:505
msgid "Missing leading left parenthesis"
msgstr ""
-#: fortran/io.c:519
+#: fortran/io.c:552
msgid "Expected P edit descriptor"
msgstr ""
#. P requires a prior number.
-#: fortran/io.c:527
+#: fortran/io.c:560
msgid "P descriptor requires leading scale factor"
msgstr ""
#. X requires a prior number if we're being pedantic.
-#: fortran/io.c:532
+#: fortran/io.c:565
#, no-c-format
msgid "Extension: X descriptor requires leading space count at %C"
msgstr ""
-#: fortran/io.c:554
+#: fortran/io.c:589
#, no-c-format
msgid "Extension: $ descriptor at %C"
msgstr ""
-#: fortran/io.c:559
+#: fortran/io.c:594
#, no-c-format
msgid "$ should be the last specifier in format at %C"
msgstr ""
-#: fortran/io.c:604
+#: fortran/io.c:641
msgid "Repeat count cannot follow P descriptor"
msgstr ""
-#: fortran/io.c:624
+#: fortran/io.c:661
#, no-c-format
msgid "Extension: Missing positive width after L descriptor at %C"
msgstr ""
-#: fortran/io.c:670 fortran/io.c:672 fortran/io.c:733 fortran/io.c:735
+#: fortran/io.c:705
+#, no-c-format
+msgid "Fortran 2008: 'G0' in format at %C"
+msgstr ""
+
+#: fortran/io.c:734 fortran/io.c:736 fortran/io.c:797 fortran/io.c:799
#, no-c-format
msgid "Period required in format specifier at %C"
msgstr ""
-#: fortran/io.c:704
+#: fortran/io.c:768
msgid "Positive exponent width required"
msgstr ""
-#: fortran/io.c:753
+#: fortran/io.c:817
#, no-c-format
msgid "The H format specifier at %C is a Fortran 95 deleted feature"
msgstr ""
-#: fortran/io.c:838 fortran/io.c:895
+#: fortran/io.c:902 fortran/io.c:959
#, no-c-format
msgid "Extension: Missing comma at %C"
msgstr ""
-#: fortran/io.c:905
+#: fortran/io.c:972
#, no-c-format
-msgid "%s in format string at %C"
+msgid "%s in format string at %L"
msgstr ""
-#: fortran/io.c:946
+#: fortran/io.c:1017
#, no-c-format
msgid "Format statement in module main block at %C"
msgstr ""
-#: fortran/io.c:952
+#: fortran/io.c:1023
#, no-c-format
msgid "Missing format label at %C"
msgstr ""
-#: fortran/io.c:1010 fortran/io.c:1034
+#: fortran/io.c:1083 fortran/io.c:1114 fortran/io.c:1175
+#, no-c-format
+msgid "Invalid value for %s specification at %C"
+msgstr ""
+
+#: fortran/io.c:1089 fortran/io.c:1120
#, no-c-format
msgid "Duplicate %s specification at %C"
msgstr ""
-#: fortran/io.c:1041
+#: fortran/io.c:1127
#, no-c-format
msgid "Variable tag cannot be INTENT(IN) at %C"
msgstr ""
-#: fortran/io.c:1048
+#: fortran/io.c:1134
#, no-c-format
msgid "Variable tag cannot be assigned in PURE procedure at %C"
msgstr ""
-#: fortran/io.c:1085
+#: fortran/io.c:1181
#, no-c-format
msgid "Duplicate %s label specification at %C"
msgstr ""
-#: fortran/io.c:1106
+#: fortran/io.c:1201
#, no-c-format
msgid ""
"Constant expression in FORMAT tag at %L must be of type default CHARACTER"
msgstr ""
-#: fortran/io.c:1119
+#: fortran/io.c:1214
#, no-c-format
msgid "FORMAT tag at %L must be of type CHARACTER or INTEGER"
msgstr ""
-#: fortran/io.c:1125
+#: fortran/io.c:1220
#, no-c-format
msgid "Deleted feature: ASSIGNED variable in FORMAT tag at %L"
msgstr ""
-#: fortran/io.c:1131
+#: fortran/io.c:1226
#, no-c-format
msgid "Variable '%s' at %L has not been assigned a format label"
msgstr ""
-#: fortran/io.c:1138
+#: fortran/io.c:1233
#, no-c-format
msgid "Scalar '%s' in FORMAT tag at %L is not an ASSIGNED variable"
msgstr ""
-#: fortran/io.c:1151
+#: fortran/io.c:1246
#, no-c-format
msgid "Extension: Character array in FORMAT tag at %L"
msgstr ""
-#: fortran/io.c:1157
+#: fortran/io.c:1252
#, no-c-format
msgid "Extension: Non-character in FORMAT tag at %L"
msgstr ""
-#: fortran/io.c:1182
+#: fortran/io.c:1277
#, no-c-format
msgid "%s tag at %L must be of type %s"
msgstr ""
-#: fortran/io.c:1189
+#: fortran/io.c:1284
#, no-c-format
msgid "%s tag at %L must be scalar"
msgstr ""
-#: fortran/io.c:1195
+#: fortran/io.c:1290
#, no-c-format
msgid "Fortran 2003: IOMSG tag at %L"
msgstr ""
-#: fortran/io.c:1203
+#: fortran/io.c:1298
#, no-c-format
msgid "Fortran 95 requires default INTEGER in %s tag at %L"
msgstr ""
-#: fortran/io.c:1211
+#: fortran/io.c:1306
#, no-c-format
msgid "Extension: CONVERT tag at %L"
msgstr ""
-#: fortran/io.c:1367 fortran/io.c:1375
+#: fortran/io.c:1487 fortran/io.c:1495
#, no-c-format
msgid "Fortran 2003: %s specifier in %s statement at %C has value '%s'"
msgstr ""
-#: fortran/io.c:1393 fortran/io.c:1401
+#: fortran/io.c:1514 fortran/io.c:1522
#, no-c-format
msgid "Extension: %s specifier in %s statement at %C has value '%s'"
msgstr ""
-#: fortran/io.c:1413 fortran/io.c:1419
+#: fortran/io.c:1535 fortran/io.c:1543
#, no-c-format
msgid "%s specifier in %s statement at %C has invalid value '%s'"
msgstr ""
-#: fortran/io.c:1473
+#: fortran/io.c:1598
#, no-c-format
msgid "OPEN statement not allowed in PURE procedure at %C"
msgstr ""
-#: fortran/io.c:1818
+#: fortran/io.c:1631
+#, no-c-format
+msgid "Fortran 2003: ASYNCHRONOUS= at %C not allowed in Fortran 95"
+msgstr ""
+
+#: fortran/io.c:1649 fortran/io.c:3025
+#, no-c-format
+msgid "Fortran 2003: BLANK= at %C not allowed in Fortran 95"
+msgstr ""
+
+#: fortran/io.c:1667 fortran/io.c:3004
+#, no-c-format
+msgid "Fortran 2003: DECIMAL= at %C not allowed in Fortran 95"
+msgstr ""
+
+#: fortran/io.c:1685 fortran/io.c:3115
+#, no-c-format
+msgid "Fortran 2003: DELIM= at %C not allowed in Fortran 95"
+msgstr ""
+
+#: fortran/io.c:1703
+#, no-c-format
+msgid "Fortran 2003: ENCODING= at %C not allowed in Fortran 95"
+msgstr ""
+
+#. When implemented, change the following to use gfc_notify_std F2003.
+#: fortran/io.c:1755
+#, no-c-format
+msgid "Fortran F2003: ROUND= specifier at %C not implemented"
+msgstr ""
+
+#: fortran/io.c:1774
+#, no-c-format
+msgid "Fortran 2003: SIGN= at %C not allowed in Fortran 95"
+msgstr ""
+
+#: fortran/io.c:1987
#, no-c-format
msgid "CLOSE statement not allowed in PURE procedure at %C"
msgstr ""
-#: fortran/io.c:1955 fortran/match.c:1911
+#: fortran/io.c:2124 fortran/match.c:1965
#, no-c-format
msgid "%s statement not allowed in PURE procedure at %C"
msgstr ""
-#: fortran/io.c:2011
+#: fortran/io.c:2180
#, no-c-format
msgid "Fortran 2003: FLUSH statement at %C"
msgstr ""
-#: fortran/io.c:2072
+#: fortran/io.c:2236
#, no-c-format
msgid "Duplicate UNIT specification at %C"
msgstr ""
-#: fortran/io.c:2132
+#: fortran/io.c:2296
#, no-c-format
msgid "Duplicate format specification at %C"
msgstr ""
-#: fortran/io.c:2149
+#: fortran/io.c:2313
#, no-c-format
msgid "Symbol '%s' in namelist '%s' is INTENT(IN) at %C"
msgstr ""
-#: fortran/io.c:2185
+#: fortran/io.c:2349
#, no-c-format
msgid "Duplicate NML specification at %C"
msgstr ""
-#: fortran/io.c:2194
+#: fortran/io.c:2358
#, no-c-format
msgid "Symbol '%s' at %C must be a NAMELIST group name"
msgstr ""
-#: fortran/io.c:2235
+#: fortran/io.c:2423
#, no-c-format
msgid "END tag at %C not allowed in output statement"
msgstr ""
-#: fortran/io.c:2292
+#: fortran/io.c:2497
#, no-c-format
msgid ""
"UNIT specification at %L must be an INTEGER expression or a CHARACTER "
"variable"
msgstr ""
-#: fortran/io.c:2301
+#: fortran/io.c:2522
+#, no-c-format
+msgid "Invalid form of WRITE statement at %L, UNIT required"
+msgstr ""
+
+#: fortran/io.c:2533
#, no-c-format
msgid "Internal unit with vector subscript at %L"
msgstr ""
-#: fortran/io.c:2308
+#: fortran/io.c:2540
#, no-c-format
msgid "External IO UNIT cannot be an array at %L"
msgstr ""
-#: fortran/io.c:2318
+#: fortran/io.c:2545
+#, no-c-format
+msgid "Extension: Comma before i/o item list at %L"
+msgstr ""
+
+#: fortran/io.c:2555
#, no-c-format
msgid "ERR tag label %d at %L not defined"
msgstr ""
-#: fortran/io.c:2330
+#: fortran/io.c:2567
#, no-c-format
msgid "END tag label %d at %L not defined"
msgstr ""
-#: fortran/io.c:2342
+#: fortran/io.c:2579
#, no-c-format
msgid "EOR tag label %d at %L not defined"
msgstr ""
-#: fortran/io.c:2352
+#: fortran/io.c:2589
#, no-c-format
msgid "FORMAT label %d at %L not defined"
msgstr ""
-#: fortran/io.c:2473
+#: fortran/io.c:2710
#, no-c-format
msgid "Syntax error in I/O iterator at %C"
msgstr ""
-#: fortran/io.c:2504
+#: fortran/io.c:2741
#, no-c-format
msgid "Expected variable in READ statement at %C"
msgstr ""
-#: fortran/io.c:2510
+#: fortran/io.c:2747
#, no-c-format
msgid "Expected expression in %s statement at %C"
msgstr ""
-#: fortran/io.c:2520
+#: fortran/io.c:2757
#, no-c-format
msgid "Variable '%s' in input list at %C cannot be INTENT(IN)"
msgstr ""
-#: fortran/io.c:2529
+#: fortran/io.c:2766
#, no-c-format
msgid "Cannot read to variable '%s' in PURE procedure at %C"
msgstr ""
-#: fortran/io.c:2545
+#: fortran/io.c:2782
#, no-c-format
msgid "Cannot write to internal file unit '%s' at %C inside a PURE procedure"
msgstr ""
#. A general purpose syntax error.
-#: fortran/io.c:2606 fortran/io.c:3013 fortran/gfortran.h:2002
+#: fortran/io.c:2843 fortran/io.c:3442 fortran/gfortran.h:2113
#, no-c-format
msgid "Syntax error in %s statement at %C"
msgstr ""
-#: fortran/io.c:2679
+#: fortran/io.c:2924
#, no-c-format
msgid "Fortran 2003: Internal file at %L with namelist"
msgstr ""
-#: fortran/io.c:2842
+#: fortran/io.c:2978
#, no-c-format
-msgid "PRINT namelist at %C is an extension"
+msgid "ASYNCHRONOUS= specifier at %L must be an initialization expression"
+msgstr ""
+
+#: fortran/io.c:3046
+#, no-c-format
+msgid "Fortran 2003: PAD= at %C not allowed in Fortran 95"
msgstr ""
-#: fortran/io.c:2974
+#. When implemented, change the following to use gfc_notify_std F2003.
+#. if (gfc_notify_std (GFC_STD_F2003, "Fortran 2003: ROUND= at %C "
+#. "not allowed in Fortran 95") == FAILURE)
+#. return MATCH_ERROR;
+#: fortran/io.c:3071
#, no-c-format
-msgid "Extension: Comma before i/o item list at %C"
+msgid "F2003 Feature: ROUND= specifier at %C not implemented"
+msgstr ""
+
+#: fortran/io.c:3260
+#, no-c-format
+msgid "PRINT namelist at %C is an extension"
msgstr ""
-#: fortran/io.c:2983
+#: fortran/io.c:3412
#, no-c-format
msgid "Expected comma in I/O list at %C"
msgstr ""
-#: fortran/io.c:3045
+#: fortran/io.c:3476
#, no-c-format
msgid "PRINT statement at %C not allowed within PURE procedure"
msgstr ""
-#: fortran/io.c:3185 fortran/io.c:3236
+#: fortran/io.c:3630 fortran/io.c:3681
#, no-c-format
msgid "INQUIRE statement not allowed in PURE procedure at %C"
msgstr ""
-#: fortran/io.c:3212
+#: fortran/io.c:3657
#, no-c-format
msgid "IOLENGTH tag invalid in INQUIRE statement at %C"
msgstr ""
-#: fortran/io.c:3222 fortran/trans-io.c:1145
+#: fortran/io.c:3667 fortran/trans-io.c:1178
#, no-c-format
msgid "INQUIRE statement at %L cannot contain both FILE and UNIT specifiers"
msgstr ""
-#: fortran/io.c:3229
+#: fortran/io.c:3674
#, no-c-format
msgid "INQUIRE statement at %L requires either FILE or UNIT specifier"
msgstr ""
-#: fortran/match.c:156
+#: fortran/io.c:3687
#, no-c-format
-msgid "Missing ')' in statement before %L"
+msgid ""
+"INQUIRE statement at %L requires a PENDING= specifier with the ID= specifier"
+msgstr ""
+
+#: fortran/io.c:3846
+#, no-c-format
+msgid "Fortran 2003: WAIT at %C not allowed in Fortran 95"
msgstr ""
-#: fortran/match.c:161
+#: fortran/io.c:3852
#, no-c-format
-msgid "Missing '(' in statement before %L"
+msgid "WAIT statement not allowed in PURE procedure at %C"
msgstr ""
-#: fortran/match.c:332
+#: fortran/match.c:158
+#, no-c-format
+msgid "Missing ')' in statement at or before %L"
+msgstr ""
+
+#: fortran/match.c:163
+#, no-c-format
+msgid "Missing '(' in statement at or before %L"
+msgstr ""
+
+#: fortran/match.c:360
#, no-c-format
msgid "Integer too large at %C"
msgstr ""
-#: fortran/match.c:425 fortran/parse.c:589
+#: fortran/match.c:453 fortran/parse.c:597
#, no-c-format
msgid "Too many digits in statement label at %C"
msgstr ""
-#: fortran/match.c:431
+#: fortran/match.c:459
#, no-c-format
msgid "Statement label at %C is zero"
msgstr ""
-#: fortran/match.c:464
+#: fortran/match.c:492
#, no-c-format
msgid "Label name '%s' at %C is ambiguous"
msgstr ""
-#: fortran/match.c:470
+#: fortran/match.c:498
#, no-c-format
msgid "Duplicate construct label '%s' at %C"
msgstr ""
-#: fortran/match.c:500
+#: fortran/match.c:529
#, no-c-format
msgid "Invalid character in name at %C"
msgstr ""
-#: fortran/match.c:513 fortran/match.c:585
+#: fortran/match.c:542 fortran/match.c:623
#, no-c-format
msgid "Name at %C is too long"
msgstr ""
-#: fortran/match.c:568 fortran/match.c:614
+#: fortran/match.c:553
+#, no-c-format
+msgid ""
+"Invalid character '$' at %C. Use -fdollar-ok to allow it as an extension"
+msgstr ""
+
+#: fortran/match.c:604 fortran/match.c:652
#, no-c-format
msgid "Invalid C name in NAME= specifier at %C"
msgstr ""
-#: fortran/match.c:605
+#: fortran/match.c:643
#, no-c-format
msgid "Embedded space in NAME= specifier at %C"
msgstr ""
-#: fortran/match.c:930
+#: fortran/match.c:968
#, no-c-format
msgid "Loop variable at %C cannot be a sub-component"
msgstr ""
-#: fortran/match.c:936
+#: fortran/match.c:974
#, no-c-format
msgid "Loop variable '%s' at %C cannot be INTENT(IN)"
msgstr ""
-#: fortran/match.c:969
+#: fortran/match.c:1007
#, no-c-format
msgid "Expected a step value in iterator at %C"
msgstr ""
-#: fortran/match.c:981
+#: fortran/match.c:1019
#, no-c-format
msgid "Syntax error in iterator at %C"
msgstr ""
-#: fortran/match.c:1217
+#: fortran/match.c:1260
#, no-c-format
msgid "Invalid form of PROGRAM statement at %C"
msgstr ""
-#: fortran/match.c:1258
+#: fortran/match.c:1301
#, no-c-format
msgid "Setting value of PROTECTED variable at %C"
msgstr ""
-#: fortran/match.c:1311
+#: fortran/match.c:1359
#, no-c-format
msgid "Assigning to a PROTECTED pointer at %C"
msgstr ""
-#: fortran/match.c:1354 fortran/match.c:1435
+#: fortran/match.c:1402 fortran/match.c:1483
#, no-c-format
msgid "Obsolescent: arithmetic IF statement at %C"
msgstr ""
-#: fortran/match.c:1410
+#: fortran/match.c:1458
#, no-c-format
msgid "Syntax error in IF-expression at %C"
msgstr ""
-#: fortran/match.c:1421
+#: fortran/match.c:1469
#, no-c-format
msgid "Block label not appropriate for arithmetic IF statement at %C"
msgstr ""
-#: fortran/match.c:1459
+#: fortran/match.c:1507
#, no-c-format
msgid "Block label is not appropriate for IF statement at %C"
msgstr ""
-#: fortran/match.c:1538 fortran/primary.c:2551
+#: fortran/match.c:1587 fortran/primary.c:2822
#, no-c-format
msgid "Cannot assign to a named constant at %C"
msgstr ""
-#: fortran/match.c:1548
+#: fortran/match.c:1597
#, no-c-format
msgid "Unclassifiable statement in IF-clause at %C"
msgstr ""
-#: fortran/match.c:1555
+#: fortran/match.c:1604
#, no-c-format
msgid "Syntax error in IF-clause at %C"
msgstr ""
-#: fortran/match.c:1599
+#: fortran/match.c:1648
#, no-c-format
msgid "Unexpected junk after ELSE statement at %C"
msgstr ""
-#: fortran/match.c:1605 fortran/match.c:1640
+#: fortran/match.c:1654 fortran/match.c:1689
#, no-c-format
msgid "Label '%s' at %C doesn't match IF label '%s'"
msgstr ""
-#: fortran/match.c:1634
+#: fortran/match.c:1683
#, no-c-format
msgid "Unexpected junk after ELSE IF statement at %C"
msgstr ""
-#: fortran/match.c:1797
+#: fortran/match.c:1851
#, no-c-format
msgid "Name '%s' in %s statement at %C is not a loop name"
msgstr ""
-#: fortran/match.c:1813
+#: fortran/match.c:1867
#, no-c-format
msgid "%s statement at %C is not within a loop"
msgstr ""
-#: fortran/match.c:1816
+#: fortran/match.c:1870
#, no-c-format
msgid "%s statement at %C is not within loop '%s'"
msgstr ""
-#: fortran/match.c:1824
+#: fortran/match.c:1878
#, no-c-format
msgid "%s statement at %C leaving OpenMP structured block"
msgstr ""
-#: fortran/match.c:1837
+#: fortran/match.c:1891
#, no-c-format
msgid "EXIT statement at %C terminating !$OMP DO loop"
msgstr ""
-#: fortran/match.c:1889
+#: fortran/match.c:1943
#, no-c-format
msgid "Too many digits in STOP code at %C"
msgstr ""
-#: fortran/match.c:1942
+#: fortran/match.c:1996
#, no-c-format
msgid "Deleted feature: PAUSE statement at %C"
msgstr ""
-#: fortran/match.c:1990
+#: fortran/match.c:2044
#, no-c-format
msgid "Deleted feature: ASSIGN statement at %C"
msgstr ""
-#: fortran/match.c:2036
+#: fortran/match.c:2090
#, no-c-format
msgid "Deleted feature: Assigned GOTO statement at %C"
msgstr ""
-#: fortran/match.c:2083 fortran/match.c:2135
+#: fortran/match.c:2137 fortran/match.c:2189
#, no-c-format
msgid "Statement label list in GOTO at %C cannot be empty"
msgstr ""
-#: fortran/match.c:2219
+#: fortran/match.c:2273
#, no-c-format
msgid "Bad allocate-object in ALLOCATE statement at %C for a PURE procedure"
msgstr ""
-#: fortran/match.c:2243
-#, no-c-format
-msgid "STAT variable '%s' of ALLOCATE statement at %C cannot be INTENT(IN)"
-msgstr ""
-
-#: fortran/match.c:2250
-#, no-c-format
-msgid "Illegal STAT variable in ALLOCATE statement at %C for a PURE procedure"
-msgstr ""
-
-#: fortran/match.c:2288 fortran/match.c:2452
-#, no-c-format
-msgid "STAT expression at %C must be a variable"
-msgstr ""
-
-#: fortran/match.c:2342
+#: fortran/match.c:2341
#, no-c-format
msgid "Illegal variable in NULLIFY at %C for a PURE procedure"
msgstr ""
-#: fortran/match.c:2419
+#: fortran/match.c:2418
#, no-c-format
msgid "Illegal deallocate-expression in DEALLOCATE at %C for a PURE procedure"
msgstr ""
-#: fortran/match.c:2438
-#, no-c-format
-msgid "STAT variable '%s' of DEALLOCATE statement at %C cannot be INTENT(IN)"
-msgstr ""
-
-#: fortran/match.c:2445
-#, no-c-format
-msgid ""
-"Illegal STAT variable in DEALLOCATE statement at %C for a PURE procedure"
-msgstr ""
-
-#: fortran/match.c:2494
+#: fortran/match.c:2470
#, no-c-format
msgid "Alternate RETURN statement at %C is only allowed within a SUBROUTINE"
msgstr ""
-#: fortran/match.c:2525
+#: fortran/match.c:2501
#, no-c-format
msgid "Extension: RETURN statement in main program at %C"
msgstr ""
-#: fortran/match.c:2735
+#: fortran/match.c:2711
#, no-c-format
msgid "Syntax error in common block name at %C"
msgstr ""
-#: fortran/match.c:2771
+#: fortran/match.c:2747
#, no-c-format
msgid "Symbol '%s' at %C is already an external symbol that is not COMMON"
msgstr ""
@@ -7699,131 +7036,131 @@ msgstr ""
#. If we find an error, just print it and continue,
#. cause it's just semantic, and we can see if there
#. are more errors.
-#: fortran/match.c:2830
+#: fortran/match.c:2806
#, no-c-format
msgid ""
"Variable '%s' at %L in common block '%s' at %C must be declared with a C "
"interoperable kind since common block '%s' is bind(c)"
msgstr ""
-#: fortran/match.c:2839
+#: fortran/match.c:2815
#, no-c-format
msgid ""
"Variable '%s' in common block '%s' at %C can not be bind(c) since it is not "
"global"
msgstr ""
-#: fortran/match.c:2846
+#: fortran/match.c:2822
#, no-c-format
msgid "Symbol '%s' at %C is already in a COMMON block"
msgstr ""
-#: fortran/match.c:2854
+#: fortran/match.c:2830
#, no-c-format
msgid "Initialized symbol '%s' at %C can only be COMMON in BLOCK DATA"
msgstr ""
-#: fortran/match.c:2881
+#: fortran/match.c:2857
#, no-c-format
msgid "Array specification for symbol '%s' in COMMON at %C must be explicit"
msgstr ""
-#: fortran/match.c:2891
+#: fortran/match.c:2867
#, no-c-format
msgid "Symbol '%s' in COMMON at %C cannot be a POINTER array"
msgstr ""
-#: fortran/match.c:2923
+#: fortran/match.c:2899
#, no-c-format
msgid ""
"Symbol '%s', in COMMON block '%s' at %C is being indirectly equivalenced to "
"another COMMON block '%s'"
msgstr ""
-#: fortran/match.c:3031
+#: fortran/match.c:3007
#, no-c-format
msgid "Namelist group name '%s' at %C already has a basic type of %s"
msgstr ""
-#: fortran/match.c:3039
+#: fortran/match.c:3015
#, no-c-format
msgid ""
"Namelist group name '%s' at %C already is USE associated and cannot be "
"respecified."
msgstr ""
-#: fortran/match.c:3066
+#: fortran/match.c:3042
#, no-c-format
msgid "Assumed size array '%s' in namelist '%s' at %C is not allowed"
msgstr ""
-#: fortran/match.c:3073
+#: fortran/match.c:3049
#, no-c-format
msgid "Assumed character length '%s' in namelist '%s' at %C is not allowed"
msgstr ""
-#: fortran/match.c:3200
+#: fortran/match.c:3176
#, no-c-format
msgid "Derived type component %C is not a permitted EQUIVALENCE member"
msgstr ""
-#: fortran/match.c:3208
+#: fortran/match.c:3184
#, no-c-format
msgid "Array reference in EQUIVALENCE at %C cannot be an array section"
msgstr ""
-#: fortran/match.c:3236
+#: fortran/match.c:3212
#, no-c-format
msgid "EQUIVALENCE at %C requires two or more objects"
msgstr ""
-#: fortran/match.c:3250
+#: fortran/match.c:3226
#, no-c-format
msgid ""
"Attempt to indirectly overlap COMMON blocks %s and %s by EQUIVALENCE at %C"
msgstr ""
-#: fortran/match.c:3376
+#: fortran/match.c:3352
#, no-c-format
msgid "Statement function at %L is recursive"
msgstr ""
-#: fortran/match.c:3464
+#: fortran/match.c:3440
#, no-c-format
msgid "Expected initialization expression in CASE at %C"
msgstr ""
-#: fortran/match.c:3487
+#: fortran/match.c:3463
#, no-c-format
msgid "Expected the name of the SELECT CASE construct at %C"
msgstr ""
-#: fortran/match.c:3499
+#: fortran/match.c:3475
#, no-c-format
msgid "Expected case name of '%s' at %C"
msgstr ""
-#: fortran/match.c:3543
+#: fortran/match.c:3519
#, no-c-format
msgid "Unexpected CASE statement at %C"
msgstr ""
-#: fortran/match.c:3595
+#: fortran/match.c:3571
#, no-c-format
msgid "Syntax error in CASE-specification at %C"
msgstr ""
-#: fortran/match.c:3715
+#: fortran/match.c:3691
#, no-c-format
msgid "ELSEWHERE statement at %C not enclosed in WHERE block"
msgstr ""
-#: fortran/match.c:3753
+#: fortran/match.c:3729
#, no-c-format
msgid "Label '%s' at %C doesn't match WHERE label '%s'"
msgstr ""
-#: fortran/match.c:3853
+#: fortran/match.c:3829
#, no-c-format
msgid "Syntax error in FORALL iterator at %C"
msgstr ""
@@ -7843,18 +7180,18 @@ msgstr ""
msgid "The name '%s' cannot be used as a defined operator at %C"
msgstr ""
-#: fortran/matchexp.c:187
+#: fortran/matchexp.c:180
#, no-c-format
msgid "Expected a right parenthesis in expression at %C"
msgstr ""
-#: fortran/matchexp.c:312
+#: fortran/matchexp.c:305
#, no-c-format
msgid "Expected exponent in expression at %C"
msgstr ""
-#: fortran/matchexp.c:350 fortran/matchexp.c:355 fortran/matchexp.c:459
-#: fortran/matchexp.c:464
+#: fortran/matchexp.c:343 fortran/matchexp.c:348 fortran/matchexp.c:452
+#: fortran/matchexp.c:457
#, no-c-format
msgid ""
"Extension: Unary operator following arithmetic operator (use parentheses) at "
@@ -7866,259 +7203,259 @@ msgstr ""
msgid "Out of memory-- malloc() failed"
msgstr ""
-#: fortran/module.c:516
+#: fortran/module.c:517
#, no-c-format
msgid "Fortran 2003: module nature in USE statement at %C"
msgstr ""
-#: fortran/module.c:528
+#: fortran/module.c:529
#, no-c-format
msgid ""
"Module nature in USE statement at %C shall be either INTRINSIC or "
"NON_INTRINSIC"
msgstr ""
-#: fortran/module.c:541
+#: fortran/module.c:542
#, no-c-format
msgid "\"::\" was expected after module nature at %C but was not found"
msgstr ""
-#: fortran/module.c:550
+#: fortran/module.c:551
#, no-c-format
msgid "Fortran 2003: \"USE :: module\" at %C"
msgstr ""
-#: fortran/module.c:602
+#: fortran/module.c:603
#, no-c-format
msgid "Missing generic specification in USE statement at %C"
msgstr ""
-#: fortran/module.c:610
+#: fortran/module.c:611
#, no-c-format
msgid "Fortran 2003: Renaming operators in USE statements at %C"
msgstr ""
-#: fortran/module.c:652
+#: fortran/module.c:653
#, no-c-format
msgid "The name '%s' at %C has already been used as an external module name."
msgstr ""
-#: fortran/module.c:930
+#: fortran/module.c:931
#, no-c-format
msgid "Reading module %s at line %d column %d: %s"
msgstr ""
-#: fortran/module.c:934
+#: fortran/module.c:935
#, no-c-format
msgid "Writing module %s at line %d column %d: %s"
msgstr ""
-#: fortran/module.c:938
+#: fortran/module.c:939
#, no-c-format
msgid "Module %s at line %d column %d: %s"
msgstr ""
-#: fortran/module.c:978
+#: fortran/module.c:979
msgid "Unexpected EOF"
msgstr ""
-#: fortran/module.c:1010
+#: fortran/module.c:1011
msgid "Unexpected end of module in string constant"
msgstr ""
-#: fortran/module.c:1064
+#: fortran/module.c:1065
msgid "Integer overflow"
msgstr ""
-#: fortran/module.c:1095
+#: fortran/module.c:1096
msgid "Name too long"
msgstr ""
-#: fortran/module.c:1202
+#: fortran/module.c:1203
msgid "Bad name"
msgstr ""
-#: fortran/module.c:1246
+#: fortran/module.c:1247
msgid "Expected name"
msgstr ""
-#: fortran/module.c:1249
+#: fortran/module.c:1250
msgid "Expected left parenthesis"
msgstr ""
-#: fortran/module.c:1252
+#: fortran/module.c:1253
msgid "Expected right parenthesis"
msgstr ""
-#: fortran/module.c:1255
+#: fortran/module.c:1256
msgid "Expected integer"
msgstr ""
-#: fortran/module.c:1258
+#: fortran/module.c:1259
msgid "Expected string"
msgstr ""
-#: fortran/module.c:1282
+#: fortran/module.c:1283
msgid "find_enum(): Enum not found"
msgstr ""
-#: fortran/module.c:1296
+#: fortran/module.c:1297
#, no-c-format
msgid "Error writing modules file: %s"
msgstr ""
-#: fortran/module.c:1691
+#: fortran/module.c:1820
msgid "Expected attribute bit name"
msgstr ""
-#: fortran/module.c:2503
+#: fortran/module.c:2639
msgid "Expected integer string"
msgstr ""
-#: fortran/module.c:2507
+#: fortran/module.c:2643
msgid "Error converting integer"
msgstr ""
-#: fortran/module.c:2529
+#: fortran/module.c:2665
msgid "Expected real string"
msgstr ""
-#: fortran/module.c:2730
+#: fortran/module.c:2866
msgid "Expected expression type"
msgstr ""
-#: fortran/module.c:2784
+#: fortran/module.c:2920
msgid "Bad operator"
msgstr ""
-#: fortran/module.c:2869
+#: fortran/module.c:3009
msgid "Bad type in constant expression"
msgstr ""
-#: fortran/module.c:2906
+#: fortran/module.c:3046
#, no-c-format
msgid "Namelist %s cannot be renamed by USE association to %s"
msgstr ""
-#: fortran/module.c:3847
+#: fortran/module.c:4069
#, no-c-format
msgid "Symbol '%s' referenced at %L not found in module '%s'"
msgstr ""
-#: fortran/module.c:3854
+#: fortran/module.c:4076
#, no-c-format
msgid "User operator '%s' referenced at %L not found in module '%s'"
msgstr ""
-#: fortran/module.c:3859
+#: fortran/module.c:4081
#, no-c-format
msgid "Intrinsic operator '%s' referenced at %L not found in module '%s'"
msgstr ""
-#: fortran/module.c:4400
+#: fortran/module.c:4622
#, no-c-format
msgid "Can't open module file '%s' for writing at %C: %s"
msgstr ""
-#: fortran/module.c:4438
+#: fortran/module.c:4660
#, no-c-format
msgid "Error writing module file '%s' for writing: %s"
msgstr ""
-#: fortran/module.c:4468 fortran/module.c:4550
+#: fortran/module.c:4690 fortran/module.c:4772
#, no-c-format
msgid ""
"Symbol '%s' referenced at %L does not exist in intrinsic module "
"ISO_C_BINDING."
msgstr ""
-#: fortran/module.c:4581
+#: fortran/module.c:4803
#, no-c-format
msgid ""
"Symbol '%s' referenced at %L not found in intrinsic module ISO_C_BINDING"
msgstr ""
-#: fortran/module.c:4603
+#: fortran/module.c:4825
#, no-c-format
msgid "Symbol '%s' already declared"
msgstr ""
-#: fortran/module.c:4658
+#: fortran/module.c:4880
#, no-c-format
msgid ""
"Use of intrinsic module '%s' at %C conflicts with non-intrinsic module name "
"used previously"
msgstr ""
-#: fortran/module.c:4671
+#: fortran/module.c:4893
#, no-c-format
msgid ""
"Symbol '%s' referenced at %L does not exist in intrinsic module "
"ISO_FORTRAN_ENV"
msgstr ""
-#: fortran/module.c:4679
+#: fortran/module.c:4901
#, no-c-format
msgid ""
"Use of the NUMERIC_STORAGE_SIZE named constant from intrinsic module "
"ISO_FORTRAN_ENV at %L is incompatible with option %s"
msgstr ""
-#: fortran/module.c:4707
+#: fortran/module.c:4929
#, no-c-format
msgid ""
"Use of the NUMERIC_STORAGE_SIZE named constant from intrinsic module "
"ISO_FORTRAN_ENV at %C is incompatible with option %s"
msgstr ""
-#: fortran/module.c:4723
+#: fortran/module.c:4945
#, no-c-format
msgid ""
"Symbol '%s' referenced at %L not found in intrinsic module ISO_FORTRAN_ENV"
msgstr ""
-#: fortran/module.c:4756
+#: fortran/module.c:4978
#, no-c-format
msgid "Fortran 2003: ISO_FORTRAN_ENV intrinsic module at %C"
msgstr ""
-#: fortran/module.c:4764
+#: fortran/module.c:4986
#, no-c-format
msgid "Fortran 2003: ISO_C_BINDING module at %C"
msgstr ""
-#: fortran/module.c:4774
+#: fortran/module.c:4996
#, no-c-format
msgid "Can't find an intrinsic module named '%s' at %C"
msgstr ""
-#: fortran/module.c:4779
+#: fortran/module.c:5001
#, no-c-format
msgid "Can't open module file '%s' for reading at %C: %s"
msgstr ""
-#: fortran/module.c:4787
+#: fortran/module.c:5009
#, no-c-format
msgid ""
"Use of non-intrinsic module '%s' at %C conflicts with intrinsic module name "
"used previously"
msgstr ""
-#: fortran/module.c:4802
+#: fortran/module.c:5024
msgid "Unexpected end of module"
msgstr ""
-#: fortran/module.c:4807
+#: fortran/module.c:5029
#, no-c-format
msgid "File '%s' opened at %C is not a GFORTRAN module file"
msgstr ""
-#: fortran/module.c:4817
+#: fortran/module.c:5039
#, no-c-format
msgid "Can't USE the same module we're building!"
msgstr ""
-#: fortran/openmp.c:134 fortran/openmp.c:499
+#: fortran/openmp.c:134 fortran/openmp.c:562
#, no-c-format
msgid "COMMON block /%s/ not found at %C"
msgstr ""
@@ -8128,249 +7465,259 @@ msgstr ""
msgid "Syntax error in OpenMP variable list at %C"
msgstr ""
-#: fortran/openmp.c:291
+#: fortran/openmp.c:293
#, no-c-format
msgid "%s is not INTRINSIC procedure name at %C"
msgstr ""
-#: fortran/openmp.c:478
+#: fortran/openmp.c:404
+#, no-c-format
+msgid "COLLAPSE clause argument not constant positive integer at %C"
+msgstr ""
+
+#: fortran/openmp.c:541
#, no-c-format
msgid "Threadprivate variable at %C is an element of a COMMON block"
msgstr ""
-#: fortran/openmp.c:518
+#: fortran/openmp.c:581
#, no-c-format
msgid "Syntax error in !$OMP THREADPRIVATE list at %C"
msgstr ""
-#: fortran/openmp.c:696 fortran/resolve.c:5895 fortran/resolve.c:6243
+#: fortran/openmp.c:759 fortran/resolve.c:5950 fortran/resolve.c:6301
#, no-c-format
msgid "IF clause at %L requires a scalar LOGICAL expression"
msgstr ""
-#: fortran/openmp.c:704
+#: fortran/openmp.c:767
#, no-c-format
msgid "NUM_THREADS clause at %L requires a scalar INTEGER expression"
msgstr ""
-#: fortran/openmp.c:712
+#: fortran/openmp.c:775
#, no-c-format
msgid "SCHEDULE clause's chunk_size at %L requires a scalar INTEGER expression"
msgstr ""
-#: fortran/openmp.c:726 fortran/openmp.c:736 fortran/openmp.c:743
-#: fortran/openmp.c:753
+#: fortran/openmp.c:815
#, no-c-format
-msgid "Symbol '%s' present on multiple clauses at %L"
+msgid "Object '%s' is not a variable at %L"
msgstr ""
-#: fortran/openmp.c:776
+#: fortran/openmp.c:823 fortran/openmp.c:833 fortran/openmp.c:840
+#: fortran/openmp.c:850
#, no-c-format
-msgid "Non-THREADPRIVATE object '%s' in COPYIN clause at %L"
+msgid "Symbol '%s' present on multiple clauses at %L"
msgstr ""
-#: fortran/openmp.c:779
+#: fortran/openmp.c:873
#, no-c-format
-msgid "COPYIN clause object '%s' is ALLOCATABLE at %L"
+msgid "Non-THREADPRIVATE object '%s' in COPYIN clause at %L"
msgstr ""
-#: fortran/openmp.c:782
+#: fortran/openmp.c:876
#, no-c-format
msgid "COPYIN clause object '%s' at %L has ALLOCATABLE components"
msgstr ""
-#: fortran/openmp.c:790
+#: fortran/openmp.c:884
#, no-c-format
msgid "Assumed size array '%s' in COPYPRIVATE clause at %L"
msgstr ""
-#: fortran/openmp.c:793
-#, no-c-format
-msgid "COPYPRIVATE clause object '%s' is ALLOCATABLE at %L"
-msgstr ""
-
-#: fortran/openmp.c:796
+#: fortran/openmp.c:887
#, no-c-format
msgid "COPYPRIVATE clause object '%s' at %L has ALLOCATABLE components"
msgstr ""
-#: fortran/openmp.c:804
+#: fortran/openmp.c:895
#, no-c-format
msgid "THREADPRIVATE object '%s' in SHARED clause at %L"
msgstr ""
-#: fortran/openmp.c:807
+#: fortran/openmp.c:898
#, no-c-format
msgid "Cray pointee '%s' in SHARED clause at %L"
msgstr ""
-#: fortran/openmp.c:815
+#: fortran/openmp.c:906
#, no-c-format
msgid "THREADPRIVATE object '%s' in %s clause at %L"
msgstr ""
-#: fortran/openmp.c:818
+#: fortran/openmp.c:909
#, no-c-format
msgid "Cray pointee '%s' in %s clause at %L"
msgstr ""
-#: fortran/openmp.c:823
+#: fortran/openmp.c:914
#, no-c-format
msgid "POINTER object '%s' in %s clause at %L"
msgstr ""
-#: fortran/openmp.c:826
-#, no-c-format
-msgid "%s clause object '%s' is ALLOCATABLE at %L"
-msgstr ""
-
-#: fortran/openmp.c:831
+#: fortran/openmp.c:919
#, no-c-format
msgid "%s clause object '%s' has ALLOCATABLE components at %L"
msgstr ""
-#: fortran/openmp.c:834
+#: fortran/openmp.c:922
#, no-c-format
msgid "Cray pointer '%s' in %s clause at %L"
msgstr ""
-#: fortran/openmp.c:838
+#: fortran/openmp.c:926
#, no-c-format
msgid "Assumed size array '%s' in %s clause at %L"
msgstr ""
-#: fortran/openmp.c:843
+#: fortran/openmp.c:931
#, no-c-format
msgid "Variable '%s' in %s clause is used in NAMELIST statement at %L"
msgstr ""
-#: fortran/openmp.c:852
+#: fortran/openmp.c:940
#, no-c-format
msgid "%c REDUCTION variable '%s' at %L must be of numeric type, got %s"
msgstr ""
-#: fortran/openmp.c:863
+#: fortran/openmp.c:951
#, no-c-format
msgid "%s REDUCTION variable '%s' must be LOGICAL at %L"
msgstr ""
-#: fortran/openmp.c:874
+#: fortran/openmp.c:962
#, no-c-format
msgid "%s REDUCTION variable '%s' must be INTEGER or REAL at %L"
msgstr ""
-#: fortran/openmp.c:883
+#: fortran/openmp.c:971
#, no-c-format
msgid "%s REDUCTION variable '%s' must be INTEGER at %L"
msgstr ""
-#: fortran/openmp.c:995
+#: fortran/openmp.c:1083
#, no-c-format
msgid ""
"!$OMP ATOMIC statement must set a scalar variable of intrinsic type at %L"
msgstr ""
-#: fortran/openmp.c:1035
+#: fortran/openmp.c:1123
#, no-c-format
msgid ""
"!$OMP ATOMIC assignment operator must be +, *, -, /, .AND., .OR., .EQV. or ."
"NEQV. at %L"
msgstr ""
-#: fortran/openmp.c:1083
+#: fortran/openmp.c:1171
#, no-c-format
msgid ""
"!$OMP ATOMIC assignment must be var = var op expr or var = expr op var at %L"
msgstr ""
-#: fortran/openmp.c:1097
+#: fortran/openmp.c:1185
#, no-c-format
msgid ""
"!$OMP ATOMIC var = var op expr not mathematically equivalent to var = var op "
"(expr) at %L"
msgstr ""
-#: fortran/openmp.c:1129
+#: fortran/openmp.c:1217
#, no-c-format
msgid ""
"expr in !$OMP ATOMIC assignment var = var op expr must be scalar and cannot "
"reference var at %L"
msgstr ""
-#: fortran/openmp.c:1153
+#: fortran/openmp.c:1241
#, no-c-format
msgid ""
"!$OMP ATOMIC assignment intrinsic IAND, IOR or IEOR must have two arguments "
"at %L"
msgstr ""
-#: fortran/openmp.c:1160
+#: fortran/openmp.c:1248
#, no-c-format
msgid ""
"!$OMP ATOMIC assignment intrinsic must be MIN, MAX, IAND, IOR or IEOR at %L"
msgstr ""
-#: fortran/openmp.c:1176
+#: fortran/openmp.c:1264
#, no-c-format
msgid ""
"!$OMP ATOMIC intrinsic arguments except one must not reference '%s' at %L"
msgstr ""
-#: fortran/openmp.c:1179
+#: fortran/openmp.c:1267
#, no-c-format
msgid "!$OMP ATOMIC intrinsic arguments must be scalar at %L"
msgstr ""
-#: fortran/openmp.c:1185
+#: fortran/openmp.c:1273
#, no-c-format
msgid "First or last !$OMP ATOMIC intrinsic argument must be '%s' at %L"
msgstr ""
-#: fortran/openmp.c:1203
+#: fortran/openmp.c:1291
#, no-c-format
msgid ""
"!$OMP ATOMIC assignment must have an operator or intrinsic on right hand "
"side at %L"
msgstr ""
-#: fortran/openmp.c:1305
+#: fortran/openmp.c:1426
#, no-c-format
msgid "!$OMP DO cannot be a DO WHILE or DO without loop control at %L"
msgstr ""
-#: fortran/openmp.c:1311
+#: fortran/openmp.c:1432
#, no-c-format
msgid "!$OMP DO iteration variable must be of type integer at %L"
msgstr ""
-#: fortran/openmp.c:1315
+#: fortran/openmp.c:1436
#, no-c-format
msgid "!$OMP DO iteration variable must not be THREADPRIVATE at %L"
msgstr ""
-#: fortran/openmp.c:1323
+#: fortran/openmp.c:1444
#, no-c-format
msgid ""
"!$OMP DO iteration variable present on clause other than PRIVATE or "
"LASTPRIVATE at %L"
msgstr ""
-#: fortran/options.c:219
+#: fortran/openmp.c:1462
+#, no-c-format
+msgid "!$OMP DO collapsed loops don't form rectangular iteration space at %L"
+msgstr ""
+
+#: fortran/openmp.c:1476
+#, no-c-format
+msgid "collapsed !$OMP DO loops not perfectly nested at %L"
+msgstr ""
+
+#: fortran/openmp.c:1485 fortran/openmp.c:1492
+#, no-c-format
+msgid "not enough DO loops for collapsed !$OMP DO at %L"
+msgstr ""
+
+#: fortran/options.c:227
#, no-c-format
msgid "Option -fwhole-program is not supported for Fortran"
msgstr ""
-#: fortran/options.c:273
+#: fortran/options.c:281
#, no-c-format
msgid "Reading file '%s' as free form"
msgstr ""
-#: fortran/options.c:283
+#: fortran/options.c:291
#, no-c-format
msgid "'-fd-lines-as-comments' has no effect in free form"
msgstr ""
-#: fortran/options.c:286
+#: fortran/options.c:294
#, no-c-format
msgid "'-fd-lines-as-code' has no effect in free form"
msgstr ""
@@ -8400,882 +7747,979 @@ msgstr ""
msgid "Flag -fmax-stack-var-size=%d overwrites -frecursive implied by -fopenmp"
msgstr ""
-#: fortran/options.c:392
-#, c-format
-msgid "gfortran: Only one -M option allowed\n"
-msgstr ""
-
#: fortran/options.c:398
-#, c-format
-msgid "gfortran: Directory required after -M\n"
+#, no-c-format
+msgid "gfortran: Only one -J option allowed"
msgstr ""
-#: fortran/options.c:443
+#: fortran/options.c:441
#, no-c-format
msgid "Argument to -ffpe-trap is not valid: %s"
msgstr ""
-#: fortran/options.c:573
+#: fortran/options.c:590
#, no-c-format
msgid "Fixed line length must be at least seven."
msgstr ""
-#: fortran/options.c:591
+#: fortran/options.c:608
#, no-c-format
msgid "Free line length must be at least three."
msgstr ""
-#: fortran/options.c:605
+#: fortran/options.c:622
#, no-c-format
msgid "-static-libgfortran is not supported in this configuration"
msgstr ""
-#: fortran/options.c:649
+#: fortran/options.c:666
#, no-c-format
msgid "Maximum supported identifier length is %d"
msgstr ""
-#: fortran/options.c:681
+#: fortran/options.c:698
#, no-c-format
msgid "Unrecognized option to -finit-logical: %s"
msgstr ""
-#: fortran/options.c:695
+#: fortran/options.c:712
#, no-c-format
msgid "Unrecognized option to -finit-real: %s"
msgstr ""
-#: fortran/options.c:711
+#: fortran/options.c:728
#, no-c-format
msgid "The value of n in -finit-character=n must be between 0 and 127"
msgstr ""
-#: fortran/options.c:794
+#: fortran/options.c:819
#, no-c-format
msgid "Maximum subrecord length cannot exceed %d"
msgstr ""
-#: fortran/parse.c:451
+#: fortran/parse.c:453
#, no-c-format
msgid "Unclassifiable statement at %C"
msgstr ""
-#: fortran/parse.c:475
+#: fortran/parse.c:477
#, no-c-format
msgid "OpenMP directives at %C may not appear in PURE or ELEMENTAL procedures"
msgstr ""
-#: fortran/parse.c:553
+#: fortran/parse.c:558
#, no-c-format
msgid "Unclassifiable OpenMP directive at %C"
msgstr ""
-#: fortran/parse.c:592 fortran/parse.c:733
+#: fortran/parse.c:600 fortran/parse.c:741
#, no-c-format
msgid "Zero is not a valid statement label at %C"
msgstr ""
-#: fortran/parse.c:599 fortran/parse.c:725
+#: fortran/parse.c:607 fortran/parse.c:733
#, no-c-format
msgid "Non-numeric character in statement label at %C"
msgstr ""
-#: fortran/parse.c:611 fortran/parse.c:647 fortran/parse.c:773
+#: fortran/parse.c:619 fortran/parse.c:655 fortran/parse.c:781
#, no-c-format
msgid "Semicolon at %C needs to be preceded by statement"
msgstr ""
-#: fortran/parse.c:619 fortran/parse.c:785
+#: fortran/parse.c:627 fortran/parse.c:793
#, no-c-format
msgid "Ignoring statement label in empty statement at %C"
msgstr ""
-#: fortran/parse.c:712 fortran/parse.c:752
+#: fortran/parse.c:720 fortran/parse.c:760
#, no-c-format
msgid "Bad continuation line at %C"
msgstr ""
-#: fortran/parse.c:811
+#: fortran/parse.c:819
#, no-c-format
msgid "Line truncated at %C"
msgstr ""
-#: fortran/parse.c:997
+#: fortran/parse.c:1006
#, no-c-format
msgid "FORMAT statement at %L does not have a statement label"
msgstr ""
-#: fortran/parse.c:1069
+#: fortran/parse.c:1078
msgid "arithmetic IF"
msgstr ""
-#: fortran/parse.c:1075
+#: fortran/parse.c:1084
msgid "attribute declaration"
msgstr ""
-#: fortran/parse.c:1105
+#: fortran/parse.c:1114
msgid "data declaration"
msgstr ""
-#: fortran/parse.c:1114
+#: fortran/parse.c:1123
msgid "derived type declaration"
msgstr ""
-#: fortran/parse.c:1193
+#: fortran/parse.c:1202
msgid "block IF"
msgstr ""
-#: fortran/parse.c:1202
+#: fortran/parse.c:1211
msgid "implied END DO"
msgstr ""
-#: fortran/parse.c:1275
+#: fortran/parse.c:1287
msgid "assignment"
msgstr ""
-#: fortran/parse.c:1278
+#: fortran/parse.c:1290
msgid "pointer assignment"
msgstr ""
-#: fortran/parse.c:1287
+#: fortran/parse.c:1299
msgid "simple IF"
msgstr ""
-#: fortran/parse.c:1503
+#: fortran/parse.c:1524
#, no-c-format
msgid "Unexpected %s statement at %C"
msgstr ""
-#: fortran/parse.c:1642
+#: fortran/parse.c:1664
#, no-c-format
msgid "%s statement at %C cannot follow %s statement at %L"
msgstr ""
-#: fortran/parse.c:1659
+#: fortran/parse.c:1681
#, no-c-format
msgid "Unexpected end of file in '%s'"
msgstr ""
-#: fortran/parse.c:1714
+#: fortran/parse.c:1724
#, no-c-format
-msgid "Fortran 2003: Derived type definition at %C without components"
+msgid "Derived-type '%s' with SEQUENCE must not have a CONTAINS section at %C"
+msgstr ""
+
+#: fortran/parse.c:1727
+#, no-c-format
+msgid "Derived-type '%s' with BIND(C) must not have a CONTAINS section at %C"
+msgstr ""
+
+#: fortran/parse.c:1745
+#, no-c-format
+msgid "Components in TYPE at %C must precede CONTAINS"
+msgstr ""
+
+#: fortran/parse.c:1750
+#, no-c-format
+msgid "Fortran 2003: Type-bound procedure at %C"
+msgstr ""
+
+#: fortran/parse.c:1760
+#, no-c-format
+msgid "Fortran 2003: FINAL procedure declaration at %C"
msgstr ""
-#: fortran/parse.c:1725
+#: fortran/parse.c:1772
+#, no-c-format
+msgid "Fortran 2008: Derived type definition at %C with empty CONTAINS section"
+msgstr ""
+
+#: fortran/parse.c:1783 fortran/parse.c:1899
#, no-c-format
msgid "PRIVATE statement in TYPE at %C must be inside a MODULE"
msgstr ""
-#: fortran/parse.c:1733
+#: fortran/parse.c:1791
#, no-c-format
-msgid "PRIVATE statement at %C must precede structure components"
+msgid "PRIVATE statement at %C must precede procedure bindings"
msgstr ""
-#: fortran/parse.c:1741
+#: fortran/parse.c:1799 fortran/parse.c:1915
#, no-c-format
msgid "Duplicate PRIVATE statement at %C"
msgstr ""
-#: fortran/parse.c:1753
+#: fortran/parse.c:1808
+#, no-c-format
+msgid "SEQUENCE statement at %C must precede CONTAINS"
+msgstr ""
+
+#: fortran/parse.c:1813
+#, no-c-format
+msgid "Already inside a CONTAINS block at %C"
+msgstr ""
+
+#: fortran/parse.c:1874
+#, no-c-format
+msgid "PROCEDURE binding at %C must be inside CONTAINS"
+msgstr ""
+
+#: fortran/parse.c:1879
+#, no-c-format
+msgid "FINAL declaration at %C must be inside CONTAINS"
+msgstr ""
+
+#: fortran/parse.c:1888
+#, no-c-format
+msgid "Fortran 2003: Derived type definition at %C without components"
+msgstr ""
+
+#: fortran/parse.c:1907
+#, no-c-format
+msgid "PRIVATE statement at %C must precede structure components"
+msgstr ""
+
+#: fortran/parse.c:1928
#, no-c-format
msgid "SEQUENCE statement at %C must precede structure components"
msgstr ""
-#: fortran/parse.c:1760
+#: fortran/parse.c:1935
#, no-c-format
msgid "SEQUENCE attribute at %C already specified in TYPE statement"
msgstr ""
-#: fortran/parse.c:1765
+#: fortran/parse.c:1940
#, no-c-format
msgid "Duplicate SEQUENCE statement at %C"
msgstr ""
-#: fortran/parse.c:1856
+#: fortran/parse.c:1951
+#, no-c-format
+msgid "Fortran 2003: CONTAINS block in derived type definition at %C"
+msgstr ""
+
+#: fortran/parse.c:2042
#, no-c-format
msgid "ENUM declaration at %C has no ENUMERATORS"
msgstr ""
-#: fortran/parse.c:1934
+#: fortran/parse.c:2136
#, no-c-format
msgid "Unexpected %s statement in INTERFACE block at %C"
msgstr ""
-#: fortran/parse.c:1960
+#: fortran/parse.c:2162
#, no-c-format
msgid "SUBROUTINE at %C does not belong in a generic function interface"
msgstr ""
-#: fortran/parse.c:1964
+#: fortran/parse.c:2166
#, no-c-format
msgid "FUNCTION at %C does not belong in a generic subroutine interface"
msgstr ""
-#: fortran/parse.c:1974
+#: fortran/parse.c:2176
#, no-c-format
msgid ""
"Name '%s' of ABSTRACT INTERFACE at %C cannot be the same as an intrinsic type"
msgstr ""
-#: fortran/parse.c:2005
+#: fortran/parse.c:2207
#, no-c-format
msgid "Unexpected %s statement at %C in INTERFACE body"
msgstr ""
-#: fortran/parse.c:2019
+#: fortran/parse.c:2221
#, no-c-format
msgid ""
"INTERFACE procedure '%s' at %L has the same name as the enclosing procedure"
msgstr ""
-#: fortran/parse.c:2134
+#: fortran/parse.c:2406
#, no-c-format
msgid "%s statement must appear in a MODULE"
msgstr ""
-#: fortran/parse.c:2141
+#: fortran/parse.c:2413
#, no-c-format
msgid "%s statement at %C follows another accessibility specification"
msgstr ""
-#: fortran/parse.c:2191
+#: fortran/parse.c:2463
#, no-c-format
msgid "Bad kind expression for function '%s' at %L"
msgstr ""
-#: fortran/parse.c:2195
+#: fortran/parse.c:2467
#, no-c-format
msgid "The type for function '%s' at %L is not accessible"
msgstr ""
-#: fortran/parse.c:2253
+#: fortran/parse.c:2525
#, no-c-format
msgid "ELSEWHERE statement at %C follows previous unmasked ELSEWHERE"
msgstr ""
-#: fortran/parse.c:2274
+#: fortran/parse.c:2546
#, no-c-format
msgid "Unexpected %s statement in WHERE block at %C"
msgstr ""
-#: fortran/parse.c:2333
+#: fortran/parse.c:2605
#, no-c-format
msgid "Unexpected %s statement in FORALL block at %C"
msgstr ""
-#: fortran/parse.c:2384
+#: fortran/parse.c:2656
#, no-c-format
msgid "ELSE IF statement at %C cannot follow ELSE statement at %L"
msgstr ""
-#: fortran/parse.c:2402
+#: fortran/parse.c:2674
#, no-c-format
msgid "Duplicate ELSE statements at %L and %C"
msgstr ""
-#: fortran/parse.c:2463
+#: fortran/parse.c:2735
#, no-c-format
msgid "Expected a CASE or END SELECT statement following SELECT CASE at %C"
msgstr ""
-#: fortran/parse.c:2521
+#: fortran/parse.c:2793
#, no-c-format
msgid "Variable '%s' at %C cannot be redefined inside loop beginning at %L"
msgstr ""
-#: fortran/parse.c:2555
+#: fortran/parse.c:2827
#, no-c-format
msgid "End of nonblock DO statement at %C is within another block"
msgstr ""
-#: fortran/parse.c:2564
+#: fortran/parse.c:2836
#, no-c-format
msgid "End of nonblock DO statement at %C is interwoven with another DO loop"
msgstr ""
-#: fortran/parse.c:2613
+#: fortran/parse.c:2885
#, no-c-format
msgid "Statement label in ENDDO at %C doesn't match DO label"
msgstr ""
-#: fortran/parse.c:2629
+#: fortran/parse.c:2901
#, no-c-format
msgid "named block DO at %L requires matching ENDDO name"
msgstr ""
-#: fortran/parse.c:2885
+#: fortran/parse.c:3160
#, no-c-format
msgid "Name after !$omp critical and !$omp end critical does not match at %C"
msgstr ""
-#: fortran/parse.c:2941
+#: fortran/parse.c:3216
#, no-c-format
msgid "%s statement at %C cannot terminate a non-block DO loop"
msgstr ""
-#: fortran/parse.c:3126
+#: fortran/parse.c:3402
#, no-c-format
msgid "Contained procedure '%s' at %C is already ambiguous"
msgstr ""
-#: fortran/parse.c:3176
+#: fortran/parse.c:3452
#, no-c-format
msgid "Unexpected %s statement in CONTAINS section at %C"
msgstr ""
-#. This is valid in Fortran 2008.
-#: fortran/parse.c:3201
+#: fortran/parse.c:3476
#, no-c-format
msgid ""
-"Extension: CONTAINS statement without FUNCTION or SUBROUTINE statement at %C"
+"Fortran 2008: CONTAINS statement without FUNCTION or SUBROUTINE statement at "
+"%C"
msgstr ""
-#: fortran/parse.c:3272
+#: fortran/parse.c:3547
#, no-c-format
msgid "CONTAINS statement at %C is already in a contained program unit"
msgstr ""
-#: fortran/parse.c:3321
+#: fortran/parse.c:3596
#, no-c-format
msgid "Global name '%s' at %L is already being used as a %s at %L"
msgstr ""
-#: fortran/parse.c:3342
+#: fortran/parse.c:3617
#, no-c-format
msgid "Blank BLOCK DATA at %C conflicts with prior BLOCK DATA at %L"
msgstr ""
-#: fortran/parse.c:3368
+#: fortran/parse.c:3643
#, no-c-format
msgid "Unexpected %s statement in BLOCK DATA at %C"
msgstr ""
-#: fortran/parse.c:3411
+#: fortran/parse.c:3686
#, no-c-format
msgid "Unexpected %s statement in MODULE at %C"
msgstr ""
#. If we see a duplicate main program, shut down. If the second
-#. instance is an implied main program, ie data decls or executable
+#. instance is an implied main program, i.e. data decls or executable
#. statements, we're in for lots of errors.
-#: fortran/parse.c:3594
+#: fortran/parse.c:3869
#, no-c-format
msgid "Two main PROGRAMs at %L and %C"
msgstr ""
-#: fortran/primary.c:87
+#: fortran/primary.c:90
#, no-c-format
msgid "Missing kind-parameter at %C"
msgstr ""
-#: fortran/primary.c:210
+#: fortran/primary.c:214
#, no-c-format
msgid "Integer kind %d at %C not available"
msgstr ""
-#: fortran/primary.c:218
+#: fortran/primary.c:222
#, no-c-format
msgid ""
"Integer too big for its kind at %C. This check can be disabled with the "
"option -fno-range-check"
msgstr ""
-#: fortran/primary.c:247
+#: fortran/primary.c:251
#, no-c-format
msgid "Extension: Hollerith constant at %C"
msgstr ""
-#: fortran/primary.c:259
+#: fortran/primary.c:263
#, no-c-format
msgid "Invalid Hollerith constant: %L must contain at least one character"
msgstr ""
-#: fortran/primary.c:265
+#: fortran/primary.c:269
#, no-c-format
msgid "Invalid Hollerith constant: Integer kind at %L should be default"
msgstr ""
-#: fortran/primary.c:353
+#: fortran/primary.c:286
+#, no-c-format
+msgid "Invalid Hollerith constant at %L contains a wide character"
+msgstr ""
+
+#: fortran/primary.c:367
#, no-c-format
msgid "Extension: Hexadecimal constant at %C uses non-standard syntax"
msgstr ""
-#: fortran/primary.c:363
+#: fortran/primary.c:377
#, no-c-format
msgid "Empty set of digits in BOZ constant at %C"
msgstr ""
-#: fortran/primary.c:369
+#: fortran/primary.c:383
#, no-c-format
msgid "Illegal character in BOZ constant at %C"
msgstr ""
-#: fortran/primary.c:392
+#: fortran/primary.c:406
#, no-c-format
msgid "Extension: BOZ constant at %C uses non-standard postfix syntax"
msgstr ""
-#: fortran/primary.c:423
+#: fortran/primary.c:437
#, no-c-format
msgid "Integer too big for integer kind %i at %C"
msgstr ""
-#: fortran/primary.c:429
+#: fortran/primary.c:443
#, no-c-format
msgid "Fortran 2003: BOZ used outside a DATA statement at %C"
msgstr ""
-#: fortran/primary.c:529
+#: fortran/primary.c:543
#, no-c-format
msgid "Missing exponent in real number at %C"
msgstr ""
-#: fortran/primary.c:585
+#: fortran/primary.c:599
#, no-c-format
msgid "Real number at %C has a 'd' exponent and an explicit kind"
msgstr ""
-#: fortran/primary.c:598
+#: fortran/primary.c:612
#, no-c-format
msgid "Invalid real kind %d at %C"
msgstr ""
-#: fortran/primary.c:612
+#: fortran/primary.c:626
#, no-c-format
msgid "Real constant overflows its kind at %C"
msgstr ""
-#: fortran/primary.c:617
+#: fortran/primary.c:631
#, no-c-format
msgid "Real constant underflows its kind at %C"
msgstr ""
-#: fortran/primary.c:709
+#: fortran/primary.c:723
#, no-c-format
msgid "Syntax error in SUBSTRING specification at %C"
msgstr ""
-#: fortran/primary.c:914
+#: fortran/primary.c:935
#, no-c-format
msgid "Invalid kind %d for CHARACTER constant at %C"
msgstr ""
-#: fortran/primary.c:935
+#: fortran/primary.c:956
#, no-c-format
msgid "Unterminated character constant beginning at %C"
msgstr ""
-#: fortran/primary.c:1047
+#: fortran/primary.c:997
+#, no-c-format
+msgid ""
+"Character '%s' in string at %C is not representable in character kind %d"
+msgstr ""
+
+#: fortran/primary.c:1080
#, no-c-format
msgid "Bad kind for logical constant at %C"
msgstr ""
-#: fortran/primary.c:1086
+#: fortran/primary.c:1119
#, no-c-format
msgid "Expected PARAMETER symbol in complex constant at %C"
msgstr ""
-#: fortran/primary.c:1092
+#: fortran/primary.c:1125
#, no-c-format
msgid "Numeric PARAMETER required in complex constant at %C"
msgstr ""
-#: fortran/primary.c:1098
+#: fortran/primary.c:1131
#, no-c-format
msgid "Scalar PARAMETER required in complex constant at %C"
msgstr ""
-#: fortran/primary.c:1102
+#: fortran/primary.c:1135
#, no-c-format
msgid "Fortran 2003: PARAMETER symbol in complex constant at %C"
msgstr ""
-#: fortran/primary.c:1132
+#: fortran/primary.c:1165
#, no-c-format
msgid "Error converting PARAMETER constant in complex constant at %C"
msgstr ""
-#: fortran/primary.c:1261
+#: fortran/primary.c:1294
#, no-c-format
msgid "Syntax error in COMPLEX constant at %C"
msgstr ""
-#: fortran/primary.c:1442
+#: fortran/primary.c:1475
#, no-c-format
msgid "Keyword '%s' at %C has already appeared in the current argument list"
msgstr ""
-#: fortran/primary.c:1506
+#: fortran/primary.c:1539
#, no-c-format
msgid "Extension: argument list function at %C"
msgstr ""
-#: fortran/primary.c:1573
+#: fortran/primary.c:1606
#, no-c-format
msgid "Expected alternate return label at %C"
msgstr ""
-#: fortran/primary.c:1591
+#: fortran/primary.c:1624
#, no-c-format
msgid "Missing keyword name in actual argument list at %C"
msgstr ""
-#: fortran/primary.c:1636
+#: fortran/primary.c:1669
#, no-c-format
msgid "Syntax error in argument list at %C"
msgstr ""
-#: fortran/primary.c:1723
+#: fortran/primary.c:1756
#, no-c-format
msgid "Expected structure component name at %C"
msgstr ""
-#: fortran/primary.c:1980
+#: fortran/primary.c:2041
+#, no-c-format
+msgid ""
+"Fortran 2003: Structure constructor with missing optional arguments at %C"
+msgstr ""
+
+#: fortran/primary.c:2049
+#, no-c-format
+msgid ""
+"No initializer for component '%s' given in the structure constructor at %C!"
+msgstr ""
+
+#: fortran/primary.c:2125
+#, no-c-format
+msgid "Fortran 2003: Structure constructor with named arguments at %C"
+msgstr ""
+
+#: fortran/primary.c:2140
+#, no-c-format
+msgid "Component initializer without name after component named %s at %C!"
+msgstr ""
+
+#: fortran/primary.c:2143
#, no-c-format
-msgid "Too many components in structure constructor at %C"
+msgid "Too many components in structure constructor at %C!"
msgstr ""
-#: fortran/primary.c:1993
+#: fortran/primary.c:2176
#, no-c-format
-msgid "Structure constructor for '%s' at %C has PRIVATE components"
+msgid "Component '%s' is initialized twice in the structure constructor at %C!"
msgstr ""
-#: fortran/primary.c:2003
+#: fortran/primary.c:2231
#, no-c-format
-msgid "Too few components in structure constructor at %C"
+msgid ""
+"component '%s' at %L has already been set by a parent derived type "
+"constructor"
msgstr ""
-#: fortran/primary.c:2021
+#: fortran/primary.c:2254
#, no-c-format
msgid "Syntax error in structure constructor at %C"
msgstr ""
-#: fortran/primary.c:2105
+#: fortran/primary.c:2344
#, no-c-format
msgid ""
"'%s' at %C is the name of a recursive function and so refers to the result "
"variable. Use an explicit RESULT variable for direct recursion (12.5.2.1)"
msgstr ""
-#: fortran/primary.c:2207
+#: fortran/primary.c:2470
#, no-c-format
msgid "Unexpected use of subroutine name '%s' at %C"
msgstr ""
-#: fortran/primary.c:2238
+#: fortran/primary.c:2501
#, no-c-format
msgid "Statement function '%s' requires argument list at %C"
msgstr ""
-#: fortran/primary.c:2241
+#: fortran/primary.c:2504
#, no-c-format
msgid "Function '%s' requires an argument list at %C"
msgstr ""
-#: fortran/primary.c:2286
+#: fortran/primary.c:2549
#, no-c-format
msgid "Missing argument to '%s' at %C"
msgstr ""
-#: fortran/primary.c:2427
+#: fortran/primary.c:2690
#, no-c-format
msgid "Missing argument list in function '%s' at %C"
msgstr ""
-#: fortran/primary.c:2455
+#: fortran/primary.c:2718
#, no-c-format
msgid "Symbol at %C is not appropriate for an expression"
msgstr ""
-#: fortran/primary.c:2523
+#: fortran/primary.c:2786
#, no-c-format
msgid "Assigning to PROTECTED variable at %C"
msgstr ""
-#: fortran/primary.c:2549
+#: fortran/primary.c:2820
#, no-c-format
msgid "Named constant at %C in an EQUIVALENCE"
msgstr ""
-#: fortran/primary.c:2571
+#: fortran/primary.c:2855
#, no-c-format
msgid "'%s' at %C is not a variable"
msgstr ""
-#: fortran/resolve.c:121
+#: fortran/resolve.c:124
#, no-c-format
msgid ""
"Alternate return specifier in elemental subroutine '%s' at %L is not allowed"
msgstr ""
-#: fortran/resolve.c:125
+#: fortran/resolve.c:128
#, no-c-format
msgid "Alternate return specifier in function '%s' at %L is not allowed"
msgstr ""
-#: fortran/resolve.c:138
+#: fortran/resolve.c:141
#, no-c-format
msgid "Dummy procedure '%s' of PURE procedure at %L must also be PURE"
msgstr ""
-#: fortran/resolve.c:145
+#: fortran/resolve.c:148
#, no-c-format
msgid "Dummy procedure at %L not allowed in ELEMENTAL procedure"
msgstr ""
-#: fortran/resolve.c:158 fortran/resolve.c:1138
+#: fortran/resolve.c:161 fortran/resolve.c:1147
#, no-c-format
msgid ""
"Unable to find a specific INTRINSIC procedure for the reference '%s' at %L"
msgstr ""
-#: fortran/resolve.c:202
+#: fortran/resolve.c:209
#, no-c-format
msgid "Argument '%s' of pure function '%s' at %L must be INTENT(IN)"
msgstr ""
-#: fortran/resolve.c:207
+#: fortran/resolve.c:214
#, no-c-format
msgid ""
"Argument '%s' of pure subroutine '%s' at %L must have its INTENT specified"
msgstr ""
-#: fortran/resolve.c:216
+#: fortran/resolve.c:223
#, no-c-format
msgid "Argument '%s' of elemental procedure at %L must be scalar"
msgstr ""
-#: fortran/resolve.c:223
+#: fortran/resolve.c:230
#, no-c-format
msgid ""
"Argument '%s' of elemental procedure at %L cannot have the POINTER attribute"
msgstr ""
-#: fortran/resolve.c:231
+#: fortran/resolve.c:238
#, no-c-format
msgid "Dummy procedure '%s' not allowed in elemental procedure '%s' at %L"
msgstr ""
-#: fortran/resolve.c:243
+#: fortran/resolve.c:250
#, no-c-format
msgid "Argument '%s' of statement function at %L must be scalar"
msgstr ""
-#: fortran/resolve.c:253
+#: fortran/resolve.c:260
#, no-c-format
msgid ""
"Character-valued argument '%s' of statement function at %L must have "
"constant length"
msgstr ""
-#: fortran/resolve.c:310
+#: fortran/resolve.c:317
#, no-c-format
msgid "Contained function '%s' at %L has no IMPLICIT type"
msgstr ""
-#: fortran/resolve.c:313
+#: fortran/resolve.c:320
#, no-c-format
msgid "Result '%s' of contained function '%s' at %L has no IMPLICIT type"
msgstr ""
-#: fortran/resolve.c:330
+#: fortran/resolve.c:337
#, no-c-format
msgid ""
"Character-valued internal function '%s' at %L must not be assumed length"
msgstr ""
-#: fortran/resolve.c:501
+#: fortran/resolve.c:508
#, no-c-format
msgid "Function %s at %L has entries with mismatched array specifications"
msgstr ""
-#: fortran/resolve.c:518
+#: fortran/resolve.c:525
#, no-c-format
msgid ""
"Extension: Function %s at %L with entries returning variables of different "
"string lengths"
msgstr ""
-#: fortran/resolve.c:545
+#: fortran/resolve.c:552
#, no-c-format
msgid "FUNCTION result %s can't be an array in FUNCTION %s at %L"
msgstr ""
-#: fortran/resolve.c:549
+#: fortran/resolve.c:556
#, no-c-format
msgid "ENTRY result %s can't be an array in FUNCTION %s at %L"
msgstr ""
-#: fortran/resolve.c:556
+#: fortran/resolve.c:563
#, no-c-format
msgid "FUNCTION result %s can't be a POINTER in FUNCTION %s at %L"
msgstr ""
-#: fortran/resolve.c:560
+#: fortran/resolve.c:567
#, no-c-format
msgid "ENTRY result %s can't be a POINTER in FUNCTION %s at %L"
msgstr ""
-#: fortran/resolve.c:598
+#: fortran/resolve.c:605
#, no-c-format
msgid "FUNCTION result %s can't be of type %s in FUNCTION %s at %L"
msgstr ""
-#: fortran/resolve.c:603
+#: fortran/resolve.c:610
#, no-c-format
msgid "ENTRY result %s can't be of type %s in FUNCTION %s at %L"
msgstr ""
-#: fortran/resolve.c:661
+#: fortran/resolve.c:668
#, no-c-format
msgid ""
"Variable '%s' at %L is in COMMON but only in BLOCK DATA initialization is "
"allowed"
msgstr ""
-#: fortran/resolve.c:665
+#: fortran/resolve.c:672
#, no-c-format
msgid ""
"Initialized variable '%s' at %L is in a blank COMMON but initialization is "
"only allowed in named common blocks"
msgstr ""
-#: fortran/resolve.c:676
+#: fortran/resolve.c:683
#, no-c-format
msgid ""
"Derived type variable '%s' in COMMON at %L has neither the SEQUENCE nor the "
"BIND(C) attribute"
msgstr ""
-#: fortran/resolve.c:680
+#: fortran/resolve.c:687
#, no-c-format
msgid ""
"Derived type variable '%s' in COMMON at %L has an ultimate component that is "
"allocatable"
msgstr ""
-#: fortran/resolve.c:684
+#: fortran/resolve.c:691
#, no-c-format
msgid ""
"Derived type variable '%s' in COMMON at %L may not have default initializer"
msgstr ""
-#: fortran/resolve.c:711
+#: fortran/resolve.c:718
#, no-c-format
msgid "COMMON block '%s' at %L is used as PARAMETER at %L"
msgstr ""
-#: fortran/resolve.c:715
+#: fortran/resolve.c:722
#, no-c-format
msgid "COMMON block '%s' at %L is also an intrinsic procedure"
msgstr ""
-#: fortran/resolve.c:719
+#: fortran/resolve.c:726
#, no-c-format
msgid "Fortran 2003: COMMON block '%s' at %L that is also a function result"
msgstr ""
-#: fortran/resolve.c:724
+#: fortran/resolve.c:731
#, no-c-format
msgid "Fortran 2003: COMMON block '%s' at %L that is also a global procedure"
msgstr ""
-#: fortran/resolve.c:786
+#: fortran/resolve.c:793
#, no-c-format
msgid "Components of structure constructor '%s' at %L are PRIVATE"
msgstr ""
-#: fortran/resolve.c:808
+#: fortran/resolve.c:815
#, no-c-format
msgid ""
"The rank of the element in the derived type constructor at %L does not match "
"that of the component (%d/%d)"
msgstr ""
-#: fortran/resolve.c:821
+#: fortran/resolve.c:828
#, no-c-format
msgid ""
"The element in the derived type constructor at %L, for pointer component '%"
"s', is %s but should be %s"
msgstr ""
-#: fortran/resolve.c:838
+#: fortran/resolve.c:841
+#, no-c-format
+msgid ""
+"The NULL in the derived type constructor at %L is being applied to component "
+"'%s', which is neither a POINTER nor ALLOCATABLE"
+msgstr ""
+
+#: fortran/resolve.c:855
#, no-c-format
msgid ""
"The element in the derived type constructor at %L, for pointer component '%"
"s' should be a POINTER or a TARGET"
msgstr ""
-#: fortran/resolve.c:965
+#: fortran/resolve.c:974
#, no-c-format
msgid ""
"The upper bound in the last dimension must appear in the reference to the "
"assumed size array '%s' at %L"
msgstr ""
-#: fortran/resolve.c:1029 fortran/resolve.c:5501 fortran/resolve.c:6208
+#: fortran/resolve.c:1038 fortran/resolve.c:5556 fortran/resolve.c:6266
#, no-c-format
msgid "Label %d referenced at %L is never defined"
msgstr ""
-#: fortran/resolve.c:1039
+#: fortran/resolve.c:1048
#, no-c-format
msgid "'%s' at %L is ambiguous"
msgstr ""
-#: fortran/resolve.c:1075
+#: fortran/resolve.c:1084
#, no-c-format
msgid "Statement function '%s' at %L is not allowed as an actual argument"
msgstr ""
-#: fortran/resolve.c:1083
+#: fortran/resolve.c:1092
#, no-c-format
msgid "Intrinsic '%s' at %L is not allowed as an actual argument"
msgstr ""
-#: fortran/resolve.c:1090
+#: fortran/resolve.c:1099
#, no-c-format
msgid "Internal procedure '%s' is not allowed as an actual argument at %L"
msgstr ""
-#: fortran/resolve.c:1096
+#: fortran/resolve.c:1105
#, no-c-format
msgid ""
"ELEMENTAL non-INTRINSIC procedure '%s' is not allowed as an actual argument "
"at %L"
msgstr ""
-#: fortran/resolve.c:1116
+#: fortran/resolve.c:1125
#, no-c-format
msgid "GENERIC procedure '%s' is not allowed as an actual argument at %L"
msgstr ""
-#: fortran/resolve.c:1157
+#: fortran/resolve.c:1166
#, no-c-format
msgid "Symbol '%s' at %L is ambiguous"
msgstr ""
-#: fortran/resolve.c:1206
+#: fortran/resolve.c:1215
#, no-c-format
msgid "By-value argument at %L is not of numeric type"
msgstr ""
-#: fortran/resolve.c:1213
+#: fortran/resolve.c:1222
#, no-c-format
msgid "By-value argument at %L cannot be an array or an array section"
msgstr ""
-#: fortran/resolve.c:1227
+#: fortran/resolve.c:1236
#, no-c-format
msgid "By-value argument at %L is not allowed in this context"
msgstr ""
-#: fortran/resolve.c:1239
+#: fortran/resolve.c:1248
#, no-c-format
msgid "Passing internal procedure at %L by location not allowed"
msgstr ""
-#: fortran/resolve.c:1356
+#: fortran/resolve.c:1365
#, no-c-format
msgid ""
"'%s' at %L is an array and OPTIONAL; IF IT IS MISSING, it cannot be the "
@@ -9283,758 +8727,763 @@ msgid ""
"argument with the same rank (12.4.1.5)"
msgstr ""
-#: fortran/resolve.c:1378
+#: fortran/resolve.c:1387
msgid "elemental procedure"
msgstr ""
-#: fortran/resolve.c:1395
+#: fortran/resolve.c:1404
#, no-c-format
msgid ""
"Actual argument at %L for INTENT(%s) dummy '%s' of ELEMENTAL subroutine '%s' "
"is a scalar, but another actual argument is an array"
msgstr ""
-#: fortran/resolve.c:1531
+#: fortran/resolve.c:1540
#, no-c-format
msgid "There is no specific function for the generic '%s' at %L"
msgstr ""
-#: fortran/resolve.c:1540
+#: fortran/resolve.c:1549
#, no-c-format
msgid ""
"Generic function '%s' at %L is not consistent with a specific intrinsic "
"interface"
msgstr ""
-#: fortran/resolve.c:1594
+#: fortran/resolve.c:1604
#, no-c-format
msgid ""
"Function '%s' at %L is INTRINSIC but is not compatible with an intrinsic"
msgstr ""
-#: fortran/resolve.c:1640
+#: fortran/resolve.c:1650
#, no-c-format
msgid "Unable to resolve the specific function '%s' at %L"
msgstr ""
-#: fortran/resolve.c:1696 fortran/resolve.c:8868
+#: fortran/resolve.c:1706 fortran/resolve.c:9523
#, no-c-format
msgid "Function '%s' at %L has no IMPLICIT type"
msgstr ""
-#: fortran/resolve.c:1907
+#: fortran/resolve.c:1917
#, no-c-format
msgid "Argument to '%s' at %L is not a variable"
msgstr ""
-#: fortran/resolve.c:1979
+#: fortran/resolve.c:1989
#, no-c-format
msgid "More actual than formal arguments in '%s' call at %L"
msgstr ""
-#: fortran/resolve.c:1991
+#: fortran/resolve.c:2001
#, no-c-format
msgid ""
"Parameter '%s' to '%s' at %L must be either a TARGET or an associated pointer"
msgstr ""
-#: fortran/resolve.c:2017
+#: fortran/resolve.c:2027
#, no-c-format
msgid ""
"Allocatable variable '%s' used as a parameter to '%s' at %L must not be an "
"array of zero size"
msgstr ""
-#: fortran/resolve.c:2034
+#: fortran/resolve.c:2044
#, no-c-format
msgid ""
"Assumed-shape array '%s' at %L cannot be an argument to the procedure '%s' "
"because it is not C interoperable"
msgstr ""
-#: fortran/resolve.c:2044
+#: fortran/resolve.c:2054
#, no-c-format
msgid ""
"Deferred-shape array '%s' at %L cannot be an argument to the procedure '%s' "
"because it is not C interoperable"
msgstr ""
-#: fortran/resolve.c:2067 fortran/resolve.c:2106
+#: fortran/resolve.c:2077 fortran/resolve.c:2116
#, no-c-format
msgid "CHARACTER argument '%s' to '%s' at %L must have a length of 1"
msgstr ""
#. Case 1c, section 15.1.2.5, J3/04-007: an associated
#. scalar pointer.
-#: fortran/resolve.c:2082
+#: fortran/resolve.c:2092
#, no-c-format
msgid "Argument '%s' to '%s' at %L must be an associated scalar POINTER"
msgstr ""
-#: fortran/resolve.c:2098
+#: fortran/resolve.c:2108
#, no-c-format
msgid "Parameter '%s' to '%s' at %L must be a scalar"
msgstr ""
#. TODO: Update this error message to allow for procedure
#. pointers once they are implemented.
-#: fortran/resolve.c:2120
+#: fortran/resolve.c:2130
#, no-c-format
msgid "Parameter '%s' to '%s' at %L must be a procedure"
msgstr ""
-#: fortran/resolve.c:2128
+#: fortran/resolve.c:2138
#, no-c-format
msgid "Parameter '%s' to '%s' at %L must be BIND(C)"
msgstr ""
-#: fortran/resolve.c:2170
+#: fortran/resolve.c:2180
#, no-c-format
msgid "'%s' at %L is not a function"
msgstr ""
-#: fortran/resolve.c:2176
+#: fortran/resolve.c:2186
#, no-c-format
msgid "ABSTRACT INTERFACE '%s' must not be referenced at %L"
msgstr ""
#. Internal procedures are taken care of in resolve_contained_fntype.
-#: fortran/resolve.c:2219
+#: fortran/resolve.c:2229
#, no-c-format
msgid ""
"Function '%s' is declared CHARACTER(*) and cannot be used at %L since it is "
"not a dummy argument"
msgstr ""
-#: fortran/resolve.c:2272
+#: fortran/resolve.c:2282
#, no-c-format
msgid ""
"User defined non-ELEMENTAL function '%s' at %L not allowed in WORKSHARE "
"construct"
msgstr ""
-#: fortran/resolve.c:2321
+#: fortran/resolve.c:2331
#, no-c-format
msgid "reference to non-PURE function '%s' at %L inside a FORALL %s"
msgstr ""
-#: fortran/resolve.c:2328
+#: fortran/resolve.c:2338
#, no-c-format
msgid ""
"Function reference to '%s' at %L is to a non-PURE procedure within a PURE "
"procedure"
msgstr ""
-#: fortran/resolve.c:2343
+#: fortran/resolve.c:2353
#, no-c-format
msgid "Function '%s' at %L cannot call itself, as it is not RECURSIVE"
msgstr ""
-#: fortran/resolve.c:2351
+#: fortran/resolve.c:2361
#, no-c-format
msgid ""
"Call to ENTRY '%s' at %L is recursive, but function '%s' is not declared as "
"RECURSIVE"
msgstr ""
-#: fortran/resolve.c:2393
+#: fortran/resolve.c:2408
#, no-c-format
msgid "Subroutine call to '%s' in FORALL block at %L is not PURE"
msgstr ""
-#: fortran/resolve.c:2396
+#: fortran/resolve.c:2411
#, no-c-format
msgid "Subroutine call to '%s' at %L is not PURE"
msgstr ""
-#: fortran/resolve.c:2459
+#: fortran/resolve.c:2474
#, no-c-format
msgid "There is no specific subroutine for the generic '%s' at %L"
msgstr ""
-#: fortran/resolve.c:2468
+#: fortran/resolve.c:2483
#, no-c-format
msgid ""
"Generic subroutine '%s' at %L is not consistent with an intrinsic subroutine "
"interface"
msgstr ""
-#: fortran/resolve.c:2576
+#: fortran/resolve.c:2591
#, no-c-format
msgid "Missing SHAPE parameter for call to %s at %L"
msgstr ""
-#: fortran/resolve.c:2584
+#: fortran/resolve.c:2599
#, no-c-format
msgid "SHAPE parameter for call to %s at %L must be a rank 1 INTEGER array"
msgstr ""
-#: fortran/resolve.c:2667
+#: fortran/resolve.c:2683
#, no-c-format
msgid ""
"Subroutine '%s' at %L is INTRINSIC but is not compatible with an intrinsic"
msgstr ""
-#: fortran/resolve.c:2711
+#: fortran/resolve.c:2727
#, no-c-format
msgid "Unable to resolve the specific subroutine '%s' at %L"
msgstr ""
-#: fortran/resolve.c:2768
+#: fortran/resolve.c:2784
#, no-c-format
msgid "'%s' at %L has a type, which is not consistent with the CALL at %L"
msgstr ""
-#: fortran/resolve.c:2787
+#: fortran/resolve.c:2803
#, no-c-format
msgid "SUBROUTINE '%s' at %L cannot call itself, as it is not RECURSIVE"
msgstr ""
-#: fortran/resolve.c:2795
+#: fortran/resolve.c:2811
#, no-c-format
msgid ""
"Call to ENTRY '%s' at %L is recursive, but subroutine '%s' is not declared "
"as RECURSIVE"
msgstr ""
-#: fortran/resolve.c:2865
+#: fortran/resolve.c:2881
#, no-c-format
msgid "Shapes for operands at %L and %L are not conformable"
msgstr ""
-#: fortran/resolve.c:2916
+#: fortran/resolve.c:2932
#, c-format
msgid "Invalid context for NULL() pointer at %%L"
msgstr ""
-#: fortran/resolve.c:2932
+#: fortran/resolve.c:2948
#, c-format
msgid "Operand of unary numeric operator '%s' at %%L is %s"
msgstr ""
-#: fortran/resolve.c:2948
+#: fortran/resolve.c:2964
#, c-format
msgid "Operands of binary numeric operator '%s' at %%L are %s/%s"
msgstr ""
-#: fortran/resolve.c:2962
+#: fortran/resolve.c:2979
#, c-format
msgid "Operands of string concatenation operator at %%L are %s/%s"
msgstr ""
-#: fortran/resolve.c:2981
+#: fortran/resolve.c:2998
#, c-format
msgid "Operands of logical operator '%s' at %%L are %s/%s"
msgstr ""
-#: fortran/resolve.c:2995
+#: fortran/resolve.c:3012
#, c-format
msgid "Operand of .not. operator at %%L is %s"
msgstr ""
-#: fortran/resolve.c:3009
+#: fortran/resolve.c:3026
msgid "COMPLEX quantities cannot be compared at %L"
msgstr ""
-#: fortran/resolve.c:3037
+#: fortran/resolve.c:3055
#, c-format
msgid "Logicals at %%L must be compared with %s instead of %s"
msgstr ""
-#: fortran/resolve.c:3043
+#: fortran/resolve.c:3061
#, c-format
msgid "Operands of comparison operator '%s' at %%L are %s/%s"
msgstr ""
-#: fortran/resolve.c:3051
+#: fortran/resolve.c:3069
#, c-format
msgid "Unknown operator '%s' at %%L"
msgstr ""
-#: fortran/resolve.c:3053
+#: fortran/resolve.c:3071
#, c-format
msgid "Operand of user operator '%s' at %%L is %s"
msgstr ""
-#: fortran/resolve.c:3056
+#: fortran/resolve.c:3074
#, c-format
msgid "Operands of user operator '%s' at %%L are %s/%s"
msgstr ""
-#: fortran/resolve.c:3142
+#: fortran/resolve.c:3160
#, c-format
msgid "Inconsistent ranks for operator at %%L and %%L"
msgstr ""
-#: fortran/resolve.c:3339
+#: fortran/resolve.c:3357
#, no-c-format
msgid "Array reference at %L is out of bounds (%ld < %ld) in dimension %d"
msgstr ""
-#: fortran/resolve.c:3347
+#: fortran/resolve.c:3365
#, no-c-format
msgid "Array reference at %L is out of bounds (%ld > %ld) in dimension %d"
msgstr ""
-#: fortran/resolve.c:3366
+#: fortran/resolve.c:3384
#, no-c-format
msgid "Illegal stride of zero at %L"
msgstr ""
-#: fortran/resolve.c:3383
+#: fortran/resolve.c:3401
#, no-c-format
msgid ""
"Lower array reference at %L is out of bounds (%ld < %ld) in dimension %d"
msgstr ""
-#: fortran/resolve.c:3391
+#: fortran/resolve.c:3409
#, no-c-format
msgid ""
"Lower array reference at %L is out of bounds (%ld > %ld) in dimension %d"
msgstr ""
-#: fortran/resolve.c:3407
+#: fortran/resolve.c:3425
#, no-c-format
msgid ""
"Upper array reference at %L is out of bounds (%ld < %ld) in dimension %d"
msgstr ""
-#: fortran/resolve.c:3416
+#: fortran/resolve.c:3434
#, no-c-format
msgid ""
"Upper array reference at %L is out of bounds (%ld > %ld) in dimension %d"
msgstr ""
-#: fortran/resolve.c:3455
+#: fortran/resolve.c:3473
#, no-c-format
msgid "Rightmost upper bound of assumed size array section not specified at %L"
msgstr ""
-#: fortran/resolve.c:3465
+#: fortran/resolve.c:3483
#, no-c-format
msgid "Rank mismatch in array reference at %L (%d/%d)"
msgstr ""
-#: fortran/resolve.c:3493
+#: fortran/resolve.c:3511
#, no-c-format
msgid "Array index at %L must be scalar"
msgstr ""
-#: fortran/resolve.c:3499
+#: fortran/resolve.c:3517
#, no-c-format
-msgid "Array index at %L must be of INTEGER type"
+msgid "Array index at %L must be of INTEGER type, found %s"
msgstr ""
-#: fortran/resolve.c:3505
+#: fortran/resolve.c:3523
#, no-c-format
msgid "Extension: REAL array index at %L"
msgstr ""
-#: fortran/resolve.c:3535
+#: fortran/resolve.c:3553
#, no-c-format
msgid "Argument dim at %L must be scalar"
msgstr ""
-#: fortran/resolve.c:3542
+#: fortran/resolve.c:3560
#, no-c-format
msgid "Argument dim at %L must be of INTEGER type"
msgstr ""
-#: fortran/resolve.c:3663
+#: fortran/resolve.c:3681
#, no-c-format
msgid "Array index at %L is an array of rank %d"
msgstr ""
-#: fortran/resolve.c:3700
+#: fortran/resolve.c:3718
#, no-c-format
msgid "Substring start index at %L must be of type INTEGER"
msgstr ""
-#: fortran/resolve.c:3707
+#: fortran/resolve.c:3725
#, no-c-format
msgid "Substring start index at %L must be scalar"
msgstr ""
-#: fortran/resolve.c:3716
+#: fortran/resolve.c:3734
#, no-c-format
msgid "Substring start index at %L is less than one"
msgstr ""
-#: fortran/resolve.c:3729
+#: fortran/resolve.c:3747
#, no-c-format
msgid "Substring end index at %L must be of type INTEGER"
msgstr ""
-#: fortran/resolve.c:3736
+#: fortran/resolve.c:3754
#, no-c-format
msgid "Substring end index at %L must be scalar"
msgstr ""
-#: fortran/resolve.c:3746
+#: fortran/resolve.c:3764
#, no-c-format
msgid "Substring end index at %L exceeds the string length"
msgstr ""
-#: fortran/resolve.c:3884
+#: fortran/resolve.c:3902
#, no-c-format
msgid ""
"Component to the right of a part reference with nonzero rank must not have "
"the POINTER attribute at %L"
msgstr ""
-#: fortran/resolve.c:3891
+#: fortran/resolve.c:3909
#, no-c-format
msgid ""
"Component to the right of a part reference with nonzero rank must not have "
"the ALLOCATABLE attribute at %L"
msgstr ""
-#: fortran/resolve.c:3910
+#: fortran/resolve.c:3928
#, no-c-format
msgid ""
"Two or more part references with nonzero rank must not be specified at %L"
msgstr ""
-#: fortran/resolve.c:4085
+#: fortran/resolve.c:4103
#, no-c-format
msgid ""
"Variable '%s', used in a specification expression, is referenced at %L "
"before the ENTRY statement in which it is a parameter"
msgstr ""
-#: fortran/resolve.c:4090
+#: fortran/resolve.c:4108
#, no-c-format
msgid ""
"Variable '%s' is used at %L before the ENTRY statement in which it is a "
"parameter"
msgstr ""
-#: fortran/resolve.c:4367
+#: fortran/resolve.c:4385
#, no-c-format
msgid "%s at %L must be a scalar"
msgstr ""
-#: fortran/resolve.c:4377
+#: fortran/resolve.c:4395
#, no-c-format
msgid "Deleted feature: %s at %L must be integer"
msgstr ""
-#: fortran/resolve.c:4381 fortran/resolve.c:4388
+#: fortran/resolve.c:4399 fortran/resolve.c:4406
#, no-c-format
msgid "%s at %L must be INTEGER"
msgstr ""
-#: fortran/resolve.c:4408
+#: fortran/resolve.c:4426
#, no-c-format
msgid "Cannot assign to loop variable in PURE procedure at %L"
msgstr ""
-#: fortran/resolve.c:4432
+#: fortran/resolve.c:4450
#, no-c-format
msgid "Step expression in DO loop at %L cannot be zero"
msgstr ""
-#: fortran/resolve.c:4508
+#: fortran/resolve.c:4526
#, no-c-format
msgid "FORALL index-name at %L must be a scalar INTEGER"
msgstr ""
-#: fortran/resolve.c:4513
+#: fortran/resolve.c:4531
#, no-c-format
msgid "FORALL start expression at %L must be a scalar INTEGER"
msgstr ""
-#: fortran/resolve.c:4520
+#: fortran/resolve.c:4538
#, no-c-format
msgid "FORALL end expression at %L must be a scalar INTEGER"
msgstr ""
-#: fortran/resolve.c:4528
+#: fortran/resolve.c:4546
#, no-c-format
msgid "FORALL stride expression at %L must be a scalar %s"
msgstr ""
-#: fortran/resolve.c:4533
+#: fortran/resolve.c:4551
#, no-c-format
msgid "FORALL stride expression at %L cannot be zero"
msgstr ""
-#: fortran/resolve.c:4549
+#: fortran/resolve.c:4567
#, no-c-format
msgid "FORALL index '%s' may not appear in triplet specification at %L"
msgstr ""
-#: fortran/resolve.c:4629
+#: fortran/resolve.c:4647
#, no-c-format
msgid ""
"Expression in DEALLOCATE statement at %L must be ALLOCATABLE or a POINTER"
msgstr ""
-#: fortran/resolve.c:4636
+#: fortran/resolve.c:4654
#, no-c-format
msgid "Cannot deallocate INTENT(IN) variable '%s' at %L"
msgstr ""
-#: fortran/resolve.c:4740
+#: fortran/resolve.c:4758
#, no-c-format
msgid ""
"The STAT variable '%s' in an ALLOCATE statement must not be allocated in the "
"same statement at %L"
msgstr ""
-#: fortran/resolve.c:4776
+#: fortran/resolve.c:4794
#, no-c-format
msgid "Expression in ALLOCATE statement at %L must be ALLOCATABLE or a POINTER"
msgstr ""
-#: fortran/resolve.c:4784
+#: fortran/resolve.c:4802
#, no-c-format
msgid "Cannot allocate INTENT(IN) variable '%s' at %L"
msgstr ""
-#: fortran/resolve.c:4808
+#: fortran/resolve.c:4826
#, no-c-format
msgid "Array specification required in ALLOCATE statement at %L"
msgstr ""
-#: fortran/resolve.c:4838
+#: fortran/resolve.c:4856
#, no-c-format
msgid "Bad array specification in ALLOCATE statement at %L"
msgstr ""
-#: fortran/resolve.c:4856
+#: fortran/resolve.c:4876
#, no-c-format
msgid ""
-"'%s' must not appear an the array specification at %L in the same ALLOCATE "
+"'%s' must not appear in the array specification at %L in the same ALLOCATE "
"statement where it is itself allocated"
msgstr ""
+#: fortran/resolve.c:4899
+#, no-c-format
+msgid "STAT variable '%s' of %s statement at %C cannot be INTENT(IN)"
+msgstr ""
+
+#: fortran/resolve.c:4903
+#, no-c-format
+msgid "Illegal STAT variable in %s statement at %C for a PURE procedure"
+msgstr ""
+
+#: fortran/resolve.c:4908
+#, no-c-format
+msgid "STAT tag in %s statement at %L must be of type INTEGER"
+msgstr ""
+
#. The cases overlap, or they are the same
#. element in the list. Either way, we must
#. issue an error and get the next case from P.
#. FIXME: Sort P and Q by line number.
-#: fortran/resolve.c:5016
+#: fortran/resolve.c:5071
#, no-c-format
msgid "CASE label at %L overlaps with CASE label at %L"
msgstr ""
-#: fortran/resolve.c:5067
+#: fortran/resolve.c:5122
#, no-c-format
msgid "Expression in CASE statement at %L must be of type %s"
msgstr ""
-#: fortran/resolve.c:5078
+#: fortran/resolve.c:5133
#, no-c-format
-msgid "Expression in CASE statement at %L must be kind %d"
+msgid "Expression in CASE statement at %L must be of kind %d"
msgstr ""
-#: fortran/resolve.c:5090
+#: fortran/resolve.c:5145
#, no-c-format
msgid "Expression in CASE statement at %L must be scalar"
msgstr ""
-#: fortran/resolve.c:5136
+#: fortran/resolve.c:5191
#, no-c-format
msgid ""
"Selection expression in computed GOTO statement at %L must be a scalar "
"integer expression"
msgstr ""
-#: fortran/resolve.c:5154
+#: fortran/resolve.c:5209
#, no-c-format
msgid "Argument of SELECT statement at %L cannot be %s"
msgstr ""
-#: fortran/resolve.c:5163
+#: fortran/resolve.c:5218
#, no-c-format
msgid "Argument of SELECT statement at %L must be a scalar expression"
msgstr ""
-#: fortran/resolve.c:5228
+#: fortran/resolve.c:5283
#, no-c-format
msgid ""
"The DEFAULT CASE at %L cannot be followed by a second DEFAULT CASE at %L"
msgstr ""
-#: fortran/resolve.c:5254
+#: fortran/resolve.c:5309
#, no-c-format
msgid "Logical range in CASE statement at %L is not allowed"
msgstr ""
-#: fortran/resolve.c:5266
+#: fortran/resolve.c:5321
#, no-c-format
msgid "constant logical value in CASE statement is repeated at %L"
msgstr ""
-#: fortran/resolve.c:5280
+#: fortran/resolve.c:5335
#, no-c-format
msgid "Range specification at %L can never be matched"
msgstr ""
-#: fortran/resolve.c:5383
+#: fortran/resolve.c:5438
#, no-c-format
msgid "Logical SELECT CASE block at %L has more that two cases"
msgstr ""
-#: fortran/resolve.c:5421
+#: fortran/resolve.c:5476
#, no-c-format
msgid "Data transfer element at %L cannot have POINTER components"
msgstr ""
-#: fortran/resolve.c:5428
+#: fortran/resolve.c:5483
#, no-c-format
msgid "Data transfer element at %L cannot have ALLOCATABLE components"
msgstr ""
-#: fortran/resolve.c:5435
+#: fortran/resolve.c:5490
#, no-c-format
msgid "Data transfer element at %L cannot have PRIVATE components"
msgstr ""
-#: fortran/resolve.c:5444
+#: fortran/resolve.c:5499
#, no-c-format
msgid ""
"Data transfer element at %L cannot be a full reference to an assumed-size "
"array"
msgstr ""
-#: fortran/resolve.c:5508
+#: fortran/resolve.c:5563
#, no-c-format
msgid ""
"Statement at %L is not a valid branch target statement for the branch "
"statement at %L"
msgstr ""
-#: fortran/resolve.c:5517
+#: fortran/resolve.c:5572
#, no-c-format
-msgid "Branch at %L causes an infinite loop"
+msgid "Branch at %L may result in an infinite loop"
msgstr ""
#. The label is not in an enclosing block, so illegal. This was
#. allowed in Fortran 66, so we allow it as extension. No
#. further checks are necessary in this case.
-#: fortran/resolve.c:5530
+#: fortran/resolve.c:5585
#, no-c-format
msgid "Label at %L is not in the same block as the GOTO statement at %L"
msgstr ""
-#: fortran/resolve.c:5545 fortran/resolve.c:5559
+#: fortran/resolve.c:5600 fortran/resolve.c:5614
#, no-c-format
msgid "Deleted feature: GOTO at %L jumps to END of construct at %L"
msgstr ""
-#: fortran/resolve.c:5636
+#: fortran/resolve.c:5691
#, no-c-format
msgid "WHERE mask at %L has inconsistent shape"
msgstr ""
-#: fortran/resolve.c:5652
+#: fortran/resolve.c:5707
#, no-c-format
msgid "WHERE assignment target at %L has inconsistent shape"
msgstr ""
-#: fortran/resolve.c:5660 fortran/resolve.c:5745
+#: fortran/resolve.c:5715 fortran/resolve.c:5800
#, no-c-format
-msgid "Non-ELEMETAL user-defined assignment in WHERE at %L"
+msgid "Non-ELEMENTAL user-defined assignment in WHERE at %L"
msgstr ""
-#: fortran/resolve.c:5670 fortran/resolve.c:5755
+#: fortran/resolve.c:5725 fortran/resolve.c:5810
#, no-c-format
msgid "Unsupported statement inside WHERE at %L"
msgstr ""
-#: fortran/resolve.c:5701
+#: fortran/resolve.c:5756
#, no-c-format
msgid "Assignment to a FORALL index variable at %L"
msgstr ""
-#: fortran/resolve.c:5709
+#: fortran/resolve.c:5764
#, no-c-format
msgid ""
"The FORALL with index '%s' cause more than one assignment to this object at %"
"L"
msgstr ""
-#: fortran/resolve.c:5847
+#: fortran/resolve.c:5902
#, no-c-format
msgid "An outer FORALL construct already has an index with this name %L"
msgstr ""
-#: fortran/resolve.c:5903
+#: fortran/resolve.c:5958
#, no-c-format
msgid "WHERE/ELSEWHERE clause at %L requires a LOGICAL array"
msgstr ""
-#: fortran/resolve.c:5962
+#: fortran/resolve.c:6020
#, no-c-format
msgid "Subroutine '%s' called instead of assignment at %L must be PURE"
msgstr ""
-#: fortran/resolve.c:6035
+#: fortran/resolve.c:6093
#, no-c-format
msgid "CHARACTER expression will be truncated in assignment (%d/%d) at %L"
msgstr ""
-#: fortran/resolve.c:6060
+#: fortran/resolve.c:6118
#, no-c-format
msgid "Cannot assign to variable '%s' in PURE procedure at %L"
msgstr ""
-#: fortran/resolve.c:6072
+#: fortran/resolve.c:6130
#, no-c-format
msgid ""
"The impure variable at %L is assigned to a derived type variable with a "
"POINTER component in a PURE procedure (12.6)"
msgstr ""
-#: fortran/resolve.c:6176
+#: fortran/resolve.c:6234
#, no-c-format
msgid "ASSIGNED GOTO statement at %L requires an INTEGER variable"
msgstr ""
-#: fortran/resolve.c:6179
+#: fortran/resolve.c:6237
#, no-c-format
msgid "Variable '%s' has not been assigned a target label at %L"
msgstr ""
-#: fortran/resolve.c:6190
+#: fortran/resolve.c:6248
#, no-c-format
msgid ""
"Alternate RETURN statement at %L requires a SCALAR-INTEGER return specifier"
msgstr ""
-#: fortran/resolve.c:6216
+#: fortran/resolve.c:6274
#, no-c-format
msgid "ASSIGN statement at %L requires a scalar default INTEGER variable"
msgstr ""
-#: fortran/resolve.c:6231
+#: fortran/resolve.c:6289
#, no-c-format
msgid "Arithmetic IF statement at %L requires a numeric expression"
msgstr ""
-#: fortran/resolve.c:6273
+#: fortran/resolve.c:6331
#, no-c-format
msgid ""
"Exit condition of DO WHILE loop at %L must be a scalar LOGICAL expression"
msgstr ""
-#: fortran/resolve.c:6280
-#, no-c-format
-msgid "STAT tag in ALLOCATE statement at %L must be of type INTEGER"
-msgstr ""
-
-#: fortran/resolve.c:6292
-#, no-c-format
-msgid "STAT tag in DEALLOCATE statement at %L must be of type INTEGER"
-msgstr ""
-
-#: fortran/resolve.c:6357
+#: fortran/resolve.c:6413
#, no-c-format
msgid "FORALL mask clause at %L requires a LOGICAL expression"
msgstr ""
-#: fortran/resolve.c:6427 fortran/resolve.c:6483
+#: fortran/resolve.c:6485 fortran/resolve.c:6541
#, no-c-format
msgid ""
"Binding label '%s' for common block '%s' at %L collides with the global "
@@ -10042,14 +9491,14 @@ msgid ""
msgstr ""
#. Common block names match but binding labels do not.
-#: fortran/resolve.c:6448
+#: fortran/resolve.c:6506
#, no-c-format
msgid ""
"Binding label '%s' for common block '%s' at %L does not match the binding "
"label '%s' for common block '%s' at %L"
msgstr ""
-#: fortran/resolve.c:6495
+#: fortran/resolve.c:6553
#, no-c-format
msgid ""
"Binding label '%s' for common block '%s' at %L collides with global entity '%"
@@ -10057,57 +9506,57 @@ msgid ""
msgstr ""
#. Make sure global procedures don't collide with anything.
-#: fortran/resolve.c:6547
+#: fortran/resolve.c:6605
#, no-c-format
msgid "Binding label '%s' at %L collides with the global entity '%s' at %L"
msgstr ""
#. Make sure procedures in interface bodies don't collide.
-#: fortran/resolve.c:6560
+#: fortran/resolve.c:6618
#, no-c-format
msgid ""
"Binding label '%s' in interface body at %L collides with the global entity '%"
"s' at %L"
msgstr ""
-#: fortran/resolve.c:6573
+#: fortran/resolve.c:6631
#, no-c-format
msgid "Binding label '%s' at %L collides with global entity '%s' at %L"
msgstr ""
-#: fortran/resolve.c:6650
+#: fortran/resolve.c:6708
#, no-c-format
msgid "CHARACTER variable has zero length at %L"
msgstr ""
-#: fortran/resolve.c:6938
+#: fortran/resolve.c:6995
#, no-c-format
msgid "Allocatable array '%s' at %L must have a deferred shape"
msgstr ""
-#: fortran/resolve.c:6941
+#: fortran/resolve.c:6998
#, no-c-format
msgid "Scalar object '%s' at %L may not be ALLOCATABLE"
msgstr ""
-#: fortran/resolve.c:6948
+#: fortran/resolve.c:7005
#, no-c-format
msgid "Array pointer '%s' at %L must have a deferred shape"
msgstr ""
-#: fortran/resolve.c:6959
+#: fortran/resolve.c:7016
#, no-c-format
msgid "Array '%s' at %L cannot have a deferred shape"
msgstr ""
-#: fortran/resolve.c:6988
+#: fortran/resolve.c:7045
#, no-c-format
msgid ""
"The type '%s' cannot be host associated at %L because it is blocked by an "
"incompatible object of the same name declared at %L"
msgstr ""
-#: fortran/resolve.c:7011
+#: fortran/resolve.c:7068
#, no-c-format
msgid ""
"Object '%s' at %L must have the SAVE attribute for default initialization of "
@@ -10116,540 +9565,738 @@ msgstr ""
#. The shape of a main program or module array needs to be
#. constant.
-#: fortran/resolve.c:7058
+#: fortran/resolve.c:7115
#, no-c-format
msgid "The module or main program array '%s' at %L must have constant shape"
msgstr ""
-#: fortran/resolve.c:7071
+#: fortran/resolve.c:7128
#, no-c-format
msgid ""
"Entity with assumed character length at %L must be a dummy argument or a "
"PARAMETER"
msgstr ""
-#: fortran/resolve.c:7090
+#: fortran/resolve.c:7147
#, no-c-format
msgid "'%s' at %L must have constant character length in this context"
msgstr ""
-#: fortran/resolve.c:7122
+#: fortran/resolve.c:7179
#, no-c-format
msgid "Allocatable '%s' at %L cannot have an initializer"
msgstr ""
-#: fortran/resolve.c:7125
+#: fortran/resolve.c:7182
#, no-c-format
msgid "External '%s' at %L cannot have an initializer"
msgstr ""
-#: fortran/resolve.c:7129
+#: fortran/resolve.c:7186
#, no-c-format
msgid "Dummy '%s' at %L cannot have an initializer"
msgstr ""
-#: fortran/resolve.c:7132
+#: fortran/resolve.c:7189
#, no-c-format
msgid "Intrinsic '%s' at %L cannot have an initializer"
msgstr ""
-#: fortran/resolve.c:7135
+#: fortran/resolve.c:7192
#, no-c-format
msgid "Function result '%s' at %L cannot have an initializer"
msgstr ""
-#: fortran/resolve.c:7138
+#: fortran/resolve.c:7195
#, no-c-format
msgid "Automatic array '%s' at %L cannot have an initializer"
msgstr ""
-#: fortran/resolve.c:7161
+#: fortran/resolve.c:7218
#, no-c-format
msgid "Although not referenced, '%s' at %L has ambiguous interfaces"
msgstr ""
-#: fortran/resolve.c:7180
+#: fortran/resolve.c:7237
#, no-c-format
msgid ""
"Character-valued statement function '%s' at %L must have constant length"
msgstr ""
-#: fortran/resolve.c:7188
+#: fortran/resolve.c:7245
#, no-c-format
msgid ""
"Automatic character length function '%s' at %L must have an explicit "
"interface"
msgstr ""
-#: fortran/resolve.c:7213
+#: fortran/resolve.c:7270
#, no-c-format
msgid ""
"Fortran 2003: '%s' is of a PRIVATE type and cannot be a dummy argument of '%"
"s', which is PUBLIC at %L"
msgstr ""
-#: fortran/resolve.c:7236 fortran/resolve.c:7261
+#: fortran/resolve.c:7293 fortran/resolve.c:7318
#, no-c-format
msgid ""
"Fortran 2003: Procedure '%s' in PUBLIC interface '%s' at %L takes dummy "
"arguments of '%s' which is PRIVATE"
msgstr ""
-#: fortran/resolve.c:7278
+#: fortran/resolve.c:7336
#, no-c-format
msgid "Function '%s' at %L cannot have an initializer"
msgstr ""
-#: fortran/resolve.c:7287
+#: fortran/resolve.c:7345
#, no-c-format
msgid "External object '%s' at %L may not have an initializer"
msgstr ""
-#: fortran/resolve.c:7295
+#: fortran/resolve.c:7353
#, no-c-format
msgid "ELEMENTAL function '%s' at %L must have a scalar result"
msgstr ""
-#: fortran/resolve.c:7316
+#: fortran/resolve.c:7374
#, no-c-format
msgid "CHARACTER(*) function '%s' at %L cannot be array-valued"
msgstr ""
-#: fortran/resolve.c:7320
+#: fortran/resolve.c:7378
#, no-c-format
msgid "CHARACTER(*) function '%s' at %L cannot be pointer-valued"
msgstr ""
-#: fortran/resolve.c:7324
+#: fortran/resolve.c:7382
#, no-c-format
msgid "CHARACTER(*) function '%s' at %L cannot be pure"
msgstr ""
-#: fortran/resolve.c:7328
+#: fortran/resolve.c:7386
#, no-c-format
msgid "CHARACTER(*) function '%s' at %L cannot be recursive"
msgstr ""
-#: fortran/resolve.c:7337
+#: fortran/resolve.c:7395
#, no-c-format
msgid "CHARACTER(*) function '%s' at %L is obsolescent in fortran 95"
msgstr ""
-#: fortran/resolve.c:7409
+#: fortran/resolve.c:7448
+#, no-c-format
+msgid "PROCEDURE attribute conflicts with SAVE attribute in '%s' at %L"
+msgstr ""
+
+#: fortran/resolve.c:7455
+#, no-c-format
+msgid "PROCEDURE attribute conflicts with INTENT attribute in '%s' at %L"
+msgstr ""
+
+#: fortran/resolve.c:7499
+#, no-c-format
+msgid "FINAL procedure '%s' at %L is not a SUBROUTINE"
+msgstr ""
+
+#: fortran/resolve.c:7507
+#, no-c-format
+msgid "FINAL procedure at %L must have exactly one argument"
+msgstr ""
+
+#: fortran/resolve.c:7516
+#, no-c-format
+msgid "Argument of FINAL procedure at %L must be of type '%s'"
+msgstr ""
+
+#: fortran/resolve.c:7524
+#, no-c-format
+msgid "Argument of FINAL procedure at %L must not be a POINTER"
+msgstr ""
+
+#: fortran/resolve.c:7530
+#, no-c-format
+msgid "Argument of FINAL procedure at %L must not be ALLOCATABLE"
+msgstr ""
+
+#: fortran/resolve.c:7536
+#, no-c-format
+msgid "Argument of FINAL procedure at %L must not be OPTIONAL"
+msgstr ""
+
+#: fortran/resolve.c:7544
+#, no-c-format
+msgid "Argument of FINAL procedure at %L must not be INTENT(OUT)"
+msgstr ""
+
+#: fortran/resolve.c:7552
+#, no-c-format
+msgid "Non-scalar FINAL procedure at %L should have assumed shape argument"
+msgstr ""
+
+#: fortran/resolve.c:7571
+#, no-c-format
+msgid "FINAL procedure '%s' declared at %L has the same rank (%d) as '%s'"
+msgstr ""
+
+#: fortran/resolve.c:7604
+#, no-c-format
+msgid ""
+"Only array FINAL procedures declared for derived type '%s' defined at %L, "
+"suggest also scalar one"
+msgstr ""
+
+#. TODO: Remove this error when finalization is finished.
+#: fortran/resolve.c:7609
+#, no-c-format
+msgid "Finalization at %L is not yet implemented"
+msgstr ""
+
+#: fortran/resolve.c:7636
+#, no-c-format
+msgid "'%s' at %L overrides a procedure binding declared NON_OVERRIDABLE"
+msgstr ""
+
+#: fortran/resolve.c:7644
+#, no-c-format
+msgid "'%s' at %L overrides a PURE procedure and must also be PURE"
+msgstr ""
+
+#: fortran/resolve.c:7653
+#, no-c-format
+msgid "'%s' at %L overrides an ELEMENTAL procedure and must also be ELEMENTAL"
+msgstr ""
+
+#: fortran/resolve.c:7659
+#, no-c-format
+msgid ""
+"'%s' at %L overrides a non-ELEMENTAL procedure and must not be ELEMENTAL, "
+"either"
+msgstr ""
+
+#: fortran/resolve.c:7668
+#, no-c-format
+msgid "'%s' at %L overrides a SUBROUTINE and must also be a SUBROUTINE"
+msgstr ""
+
+#: fortran/resolve.c:7679
+#, no-c-format
+msgid "'%s' at %L overrides a FUNCTION and must also be a FUNCTION"
+msgstr ""
+
+#: fortran/resolve.c:7690
+#, no-c-format
+msgid ""
+"'%s' at %L and the overridden FUNCTION should have matching result types"
+msgstr ""
+
+#: fortran/resolve.c:7701
+#, no-c-format
+msgid "'%s' at %L overrides a PUBLIC procedure and must not be PRIVATE"
+msgstr ""
+
+#: fortran/resolve.c:7730
+#, no-c-format
+msgid ""
+"Dummy argument '%s' of '%s' at %L should be named '%s' as to match the "
+"corresponding argument of the overridden procedure"
+msgstr ""
+
+#: fortran/resolve.c:7743
+#, no-c-format
+msgid ""
+"Types mismatch for dummy argument '%s' of '%s' %L in in respect to the "
+"overridden procedure"
+msgstr ""
+
+#: fortran/resolve.c:7753
+#, no-c-format
+msgid ""
+"'%s' at %L must have the same number of formal arguments as the overridden "
+"procedure"
+msgstr ""
+
+#: fortran/resolve.c:7762
+#, no-c-format
+msgid "'%s' at %L overrides a NOPASS binding and must also be NOPASS"
+msgstr ""
+
+#: fortran/resolve.c:7773
+#, no-c-format
+msgid "'%s' at %L overrides a binding with PASS and must also be PASS"
+msgstr ""
+
+#: fortran/resolve.c:7780
+#, no-c-format
+msgid ""
+"Passed-object dummy argument of '%s' at %L must be at the same position as "
+"the passed-object dummy argument of the overridden procedure"
+msgstr ""
+
+#: fortran/resolve.c:7824
+#, no-c-format
+msgid ""
+"'%s' must be a module procedure or an external procedure with an explicit "
+"interface at %L"
+msgstr ""
+
+#: fortran/resolve.c:7858
+#, no-c-format
+msgid "Procedure '%s' with PASS(%s) at %L has no argument '%s'"
+msgstr ""
+
+#: fortran/resolve.c:7872
+#, no-c-format
+msgid "Procedure '%s' with PASS at %L must have at least one argument"
+msgstr ""
+
+#: fortran/resolve.c:7884
+#, no-c-format
+msgid ""
+"Argument '%s' of '%s' with PASS(%s) at %L must be of the derived-type '%s'"
+msgstr ""
+
+#: fortran/resolve.c:7906
+#, no-c-format
+msgid "Procedure '%s' at %L has the same name as a component of '%s'"
+msgstr ""
+
+#: fortran/resolve.c:7915
+#, no-c-format
+msgid ""
+"Procedure '%s' at %L has the same name as an inherited component of '%s'"
+msgstr ""
+
+#: fortran/resolve.c:7926
+#, no-c-format
+msgid "Type-bound procedures are not yet implemented at %L"
+msgstr ""
+
+#: fortran/resolve.c:7989
+#, no-c-format
+msgid ""
+"Component '%s' of '%s' at %L has the same name as an inherited type-bound "
+"procedure"
+msgstr ""
+
+#: fortran/resolve.c:8001
#, no-c-format
msgid ""
"Character length of component '%s' needs to be a constant specification "
"expression at %L"
msgstr ""
-#: fortran/resolve.c:7424
+#: fortran/resolve.c:8016
#, no-c-format
msgid ""
"The component '%s' is a PRIVATE type and cannot be a component of '%s', "
"which is PUBLIC at %L"
msgstr ""
-#: fortran/resolve.c:7434
+#: fortran/resolve.c:8026
#, no-c-format
msgid ""
"Component %s of SEQUENCE type declared at %L does not have the SEQUENCE "
"attribute"
msgstr ""
-#: fortran/resolve.c:7444
+#: fortran/resolve.c:8037
#, no-c-format
msgid ""
"The pointer component '%s' of '%s' at %L is a type that has not been declared"
msgstr ""
-#: fortran/resolve.c:7462
+#: fortran/resolve.c:8065
#, no-c-format
msgid "Component '%s' of '%s' at %L must have constant array bounds"
msgstr ""
-#: fortran/resolve.c:7505
+#: fortran/resolve.c:8106
#, no-c-format
msgid ""
"NAMELIST object '%s' was declared PRIVATE and cannot be member of PUBLIC "
"namelist '%s' at %L"
msgstr ""
-#: fortran/resolve.c:7515
+#: fortran/resolve.c:8116
#, no-c-format
msgid ""
"NAMELIST object '%s' has use-associated PRIVATE components and cannot be "
"member of namelist '%s' at %L"
msgstr ""
-#: fortran/resolve.c:7528
+#: fortran/resolve.c:8129
#, no-c-format
msgid ""
"NAMELIST object '%s' has PRIVATE components and cannot be a member of PUBLIC "
"namelist '%s' at %L"
msgstr ""
-#: fortran/resolve.c:7540
+#: fortran/resolve.c:8141
#, no-c-format
msgid ""
"NAMELIST array object '%s' must not have assumed shape in namelist '%s' at %L"
msgstr ""
-#: fortran/resolve.c:7549
+#: fortran/resolve.c:8150
#, no-c-format
msgid ""
"NAMELIST array object '%s' must have constant shape in namelist '%s' at %L"
msgstr ""
-#: fortran/resolve.c:7561
+#: fortran/resolve.c:8162
#, no-c-format
msgid ""
"NAMELIST object '%s' in namelist '%s' at %L cannot have ALLOCATABLE "
"components"
msgstr ""
-#: fortran/resolve.c:7569
+#: fortran/resolve.c:8170
#, no-c-format
msgid ""
"NAMELIST object '%s' in namelist '%s' at %L cannot have POINTER components"
msgstr ""
-#: fortran/resolve.c:7595
+#: fortran/resolve.c:8196
#, no-c-format
msgid "PROCEDURE attribute conflicts with NAMELIST attribute in '%s' at %L"
msgstr ""
-#: fortran/resolve.c:7614
+#: fortran/resolve.c:8215
#, no-c-format
msgid "Parameter array '%s' at %L cannot be automatic or of deferred shape"
msgstr ""
-#: fortran/resolve.c:7625
+#: fortran/resolve.c:8226
#, no-c-format
msgid ""
"Implicitly typed PARAMETER '%s' at %L doesn't match a later IMPLICIT type"
msgstr ""
-#: fortran/resolve.c:7636
+#: fortran/resolve.c:8237
#, no-c-format
msgid "Incompatible derived type in PARAMETER at %L"
msgstr ""
-#: fortran/resolve.c:7695
+#: fortran/resolve.c:8296
#, no-c-format
msgid ""
"Interface '%s', used by procedure '%s' at %L, is declared in a later "
"PROCEDURE statement"
msgstr ""
-#: fortran/resolve.c:7709
+#: fortran/resolve.c:8320
#, no-c-format
msgid "Interface '%s' of procedure '%s' at %L must be explicit"
msgstr ""
-#: fortran/resolve.c:7734
+#: fortran/resolve.c:8353
#, no-c-format
msgid "Type specified for intrinsic function '%s' at %L is ignored"
msgstr ""
-#: fortran/resolve.c:7741
+#: fortran/resolve.c:8360
#, no-c-format
msgid "Intrinsic subroutine '%s' at %L shall not have a type specifier"
msgstr ""
-#: fortran/resolve.c:7748
+#: fortran/resolve.c:8367
+#, no-c-format
+msgid "'%s' declared INTRINSIC at %L does not exist"
+msgstr ""
+
+#: fortran/resolve.c:8376
#, no-c-format
-msgid "Intrinsic '%s' at %L does not exist"
+msgid ""
+"The intrinsic '%s' declared INTRINSIC at %L is not available in the current "
+"standard settings but %s. Use an appropriate -std=* option or enable -fall-"
+"intrinsics in order to use it."
msgstr ""
-#: fortran/resolve.c:7788
+#: fortran/resolve.c:8420
#, no-c-format
msgid "Assumed size array at %L must be a dummy argument"
msgstr ""
-#: fortran/resolve.c:7791
+#: fortran/resolve.c:8423
#, no-c-format
msgid "Assumed shape array at %L must be a dummy argument"
msgstr ""
-#: fortran/resolve.c:7803
+#: fortran/resolve.c:8435
#, no-c-format
msgid "Symbol at %L is not a DUMMY variable"
msgstr ""
-#: fortran/resolve.c:7809
+#: fortran/resolve.c:8441
#, no-c-format
msgid ""
"'%s' at %L cannot have the VALUE attribute because it is not a dummy argument"
msgstr ""
-#: fortran/resolve.c:7819
+#: fortran/resolve.c:8451
#, no-c-format
msgid ""
"Character dummy variable '%s' at %L with VALUE attribute must have constant "
"length"
msgstr ""
-#: fortran/resolve.c:7828
+#: fortran/resolve.c:8460
#, no-c-format
msgid ""
"C interoperable character dummy variable '%s' at %L with VALUE attribute "
"must have length one"
msgstr ""
-#: fortran/resolve.c:7854
+#: fortran/resolve.c:8486
#, no-c-format
msgid ""
"Variable '%s' at %L cannot be BIND(C) because it is neither a COMMON block "
"nor declared at the module level scope"
msgstr ""
-#: fortran/resolve.c:7907
+#: fortran/resolve.c:8539
#, no-c-format
msgid "The derived type '%s' at %L is of type '%s', which has not been defined"
msgstr ""
-#: fortran/resolve.c:7924
+#: fortran/resolve.c:8579
#, no-c-format
msgid "Fortran 2003: PUBLIC %s '%s' at %L of PRIVATE derived type '%s'"
msgstr ""
-#: fortran/resolve.c:7943
+#: fortran/resolve.c:8598
#, no-c-format
msgid ""
"The INTENT(OUT) dummy argument '%s' at %L is ASSUMED SIZE and so cannot have "
"a default initializer"
msgstr ""
-#: fortran/resolve.c:8002
+#: fortran/resolve.c:8657
#, no-c-format
msgid "Threadprivate at %L isn't SAVEd"
msgstr ""
-#: fortran/resolve.c:8080
+#: fortran/resolve.c:8735
#, no-c-format
msgid "BLOCK DATA element '%s' at %L must be in COMMON"
msgstr ""
-#: fortran/resolve.c:8086
+#: fortran/resolve.c:8741
#, no-c-format
msgid "DATA array '%s' at %L must be specified in a previous declaration"
msgstr ""
-#: fortran/resolve.c:8131
+#: fortran/resolve.c:8786
#, no-c-format
msgid "Nonconstant array section at %L in DATA statement"
msgstr ""
-#: fortran/resolve.c:8144
+#: fortran/resolve.c:8799
#, no-c-format
msgid "DATA statement at %L has more variables than values"
msgstr ""
-#: fortran/resolve.c:8238
+#: fortran/resolve.c:8893
#, no-c-format
msgid "iterator start at %L does not simplify"
msgstr ""
-#: fortran/resolve.c:8245
+#: fortran/resolve.c:8900
#, no-c-format
msgid "iterator end at %L does not simplify"
msgstr ""
-#: fortran/resolve.c:8252
+#: fortran/resolve.c:8907
#, no-c-format
msgid "iterator step at %L does not simplify"
msgstr ""
-#: fortran/resolve.c:8378
+#: fortran/resolve.c:9033
#, no-c-format
msgid "DATA statement at %L has more values than variables"
msgstr ""
-#: fortran/resolve.c:8469
+#: fortran/resolve.c:9124
#, no-c-format
msgid "Label %d at %L defined but not used"
msgstr ""
-#: fortran/resolve.c:8474
+#: fortran/resolve.c:9129
#, no-c-format
msgid "Label %d at %L defined but cannot be used"
msgstr ""
-#: fortran/resolve.c:8559
+#: fortran/resolve.c:9214
#, no-c-format
msgid ""
"Derived type variable '%s' at %L must have SEQUENCE attribute to be an "
"EQUIVALENCE object"
msgstr ""
-#: fortran/resolve.c:8568
+#: fortran/resolve.c:9223
#, no-c-format
msgid ""
"Derived type variable '%s' at %L cannot have ALLOCATABLE components to be an "
"EQUIVALENCE object"
msgstr ""
-#: fortran/resolve.c:8576
+#: fortran/resolve.c:9231
#, no-c-format
msgid ""
"Derived type variable '%s' at %L with default initialization cannot be in "
"EQUIVALENCE with a variable in COMMON"
msgstr ""
-#: fortran/resolve.c:8593
+#: fortran/resolve.c:9248
#, no-c-format
msgid ""
"Derived type variable '%s' at %L with pointer component(s) cannot be an "
"EQUIVALENCE object"
msgstr ""
-#: fortran/resolve.c:8698
+#: fortran/resolve.c:9353
#, no-c-format
msgid "Syntax error in EQUIVALENCE statement at %L"
msgstr ""
-#: fortran/resolve.c:8713
+#: fortran/resolve.c:9368
#, no-c-format
msgid ""
"Either all or none of the objects in the EQUIVALENCE set at %L shall have "
"the PROTECTED attribute"
msgstr ""
-#: fortran/resolve.c:8725
+#: fortran/resolve.c:9380
#, no-c-format
msgid ""
"Common block member '%s' at %L cannot be an EQUIVALENCE object in the pure "
"procedure '%s'"
msgstr ""
-#: fortran/resolve.c:8734
+#: fortran/resolve.c:9389
#, no-c-format
msgid "Named constant '%s' at %L cannot be an EQUIVALENCE object"
msgstr ""
-#: fortran/resolve.c:8813
+#: fortran/resolve.c:9468
#, no-c-format
msgid ""
"Array '%s' at %L with non-constant bounds cannot be an EQUIVALENCE object"
msgstr ""
-#: fortran/resolve.c:8824
+#: fortran/resolve.c:9479
#, no-c-format
msgid "Structure component '%s' at %L cannot be an EQUIVALENCE object"
msgstr ""
-#: fortran/resolve.c:8835
+#: fortran/resolve.c:9490
#, no-c-format
msgid "Substring at %L has length zero"
msgstr ""
-#: fortran/resolve.c:8878
+#: fortran/resolve.c:9533
#, no-c-format
msgid "PUBLIC function '%s' at %L cannot be of PRIVATE type '%s'"
msgstr ""
-#: fortran/resolve.c:8890
+#: fortran/resolve.c:9545
#, no-c-format
msgid "ENTRY '%s' at %L has no IMPLICIT type"
msgstr ""
-#: fortran/resolve.c:8916
+#: fortran/resolve.c:9571
#, no-c-format
msgid "User operator procedure '%s' at %L must be a FUNCTION"
msgstr ""
-#: fortran/resolve.c:8923
+#: fortran/resolve.c:9578
#, no-c-format
msgid "User operator procedure '%s' at %L cannot be assumed character length"
msgstr ""
-#: fortran/resolve.c:8929
+#: fortran/resolve.c:9584
#, no-c-format
msgid "User operator procedure '%s' at %L must have at least one argument"
msgstr ""
-#: fortran/resolve.c:8939
+#: fortran/resolve.c:9594
#, no-c-format
msgid "First argument of operator interface at %L cannot be optional"
msgstr ""
-#: fortran/resolve.c:8951
+#: fortran/resolve.c:9606
#, no-c-format
msgid "Second argument of operator interface at %L cannot be optional"
msgstr ""
-#: fortran/resolve.c:8955
+#: fortran/resolve.c:9610
#, no-c-format
msgid "Operator interface at %L must have, at most, two arguments"
msgstr ""
-#: fortran/resolve.c:8996
+#: fortran/resolve.c:9651
#, no-c-format
msgid "Contained procedure '%s' at %L of a PURE procedure must also be PURE"
msgstr ""
-#: fortran/scanner.c:530
+#: fortran/scanner.c:718
#, no-c-format
msgid ""
"!$OMP at %C starts a commented line as it neither is followed by a space nor "
"is a continuation line"
msgstr ""
-#: fortran/scanner.c:820 fortran/scanner.c:941
+#: fortran/scanner.c:1021 fortran/scanner.c:1145
#, no-c-format
msgid "Limit of %d continuations exceeded in statement at %C"
msgstr ""
-#: fortran/scanner.c:865
+#: fortran/scanner.c:1069
#, no-c-format
msgid "Missing '&' in continued character constant at %C"
msgstr ""
-#: fortran/scanner.c:1075
+#: fortran/scanner.c:1295
#, no-c-format
msgid "Nonconforming tab character at %C"
msgstr ""
-#: fortran/scanner.c:1158 fortran/scanner.c:1161
+#: fortran/scanner.c:1383 fortran/scanner.c:1386
#, no-c-format
msgid "'&' not allowed by itself in line %d"
msgstr ""
-#: fortran/scanner.c:1207
+#: fortran/scanner.c:1430
#, no-c-format
msgid "Nonconforming tab character in column %d of line %d"
msgstr ""
-#: fortran/scanner.c:1405
+#: fortran/scanner.c:1635
#, no-c-format
msgid "%s:%d: file %s left but not entered"
msgstr ""
-#: fortran/scanner.c:1438
+#: fortran/scanner.c:1669
#, no-c-format
msgid "%s:%d: Illegal preprocessor directive"
msgstr ""
-#: fortran/scanner.c:1533
+#: fortran/scanner.c:1770
#, no-c-format
msgid "File '%s' is being included recursively"
msgstr ""
-#: fortran/scanner.c:1548
+#: fortran/scanner.c:1785
#, no-c-format
msgid "Can't open file '%s'"
msgstr ""
-#: fortran/scanner.c:1557
+#: fortran/scanner.c:1794
#, no-c-format
msgid "Can't open included file '%s'"
msgstr ""
-#: fortran/scanner.c:1701
-#, c-format
-msgid "%s:%3d %s\n"
-msgstr ""
-
#: fortran/simplify.c:82
#, no-c-format
msgid "Result of %s overflows its kind at %L"
@@ -10680,175 +10327,182 @@ msgstr ""
msgid "Invalid KIND parameter of %s at %L"
msgstr ""
-#: fortran/simplify.c:282
+#: fortran/simplify.c:276
+#, no-c-format
+msgid "Argument of %s function at %L is negative"
+msgstr ""
+
+#: fortran/simplify.c:283
#, no-c-format
-msgid "Argument of ACHAR function at %L outside of range [0,127]"
+msgid "Argument of %s function at %L outside of range [0,127]"
msgstr ""
-#: fortran/simplify.c:307
+#: fortran/simplify.c:301
+#, no-c-format
+msgid ""
+"Argument of %s function at %L is too large for the collating sequence of "
+"kind %d"
+msgstr ""
+
+#: fortran/simplify.c:337
#, no-c-format
msgid "Argument of ACOS at %L must be between -1 and 1"
msgstr ""
-#: fortran/simplify.c:329
+#: fortran/simplify.c:359
#, no-c-format
msgid "Argument of ACOSH at %L must not be less than 1"
msgstr ""
-#: fortran/simplify.c:546
+#: fortran/simplify.c:576
#, no-c-format
msgid "Argument of ASIN at %L must be between -1 and 1"
msgstr ""
-#: fortran/simplify.c:602
+#: fortran/simplify.c:632
#, no-c-format
msgid "Argument of ATANH at %L must be inside the range -1 to 1"
msgstr ""
-#: fortran/simplify.c:627
+#: fortran/simplify.c:655
#, no-c-format
msgid ""
"If first argument of ATAN2 %L is zero, then the second argument must not be "
"zero"
msgstr ""
-#: fortran/simplify.c:714
-#, no-c-format
-msgid "Argument of CHAR function at %L outside of range [0,255]"
-msgstr ""
-
-#: fortran/simplify.c:1293
+#: fortran/simplify.c:1485
#, no-c-format
msgid "Argument of IACHAR at %L must be of length one"
msgstr ""
-#: fortran/simplify.c:1300
+#: fortran/simplify.c:1492
#, no-c-format
msgid "Argument of IACHAR function at %L outside of range 0..127"
msgstr ""
-#: fortran/simplify.c:1339
+#: fortran/simplify.c:1531
#, no-c-format
msgid "Invalid second argument of IBCLR at %L"
msgstr ""
-#: fortran/simplify.c:1347
+#: fortran/simplify.c:1539
#, no-c-format
msgid "Second argument of IBCLR exceeds bit size at %L"
msgstr ""
-#: fortran/simplify.c:1381
+#: fortran/simplify.c:1573
#, no-c-format
msgid "Invalid second argument of IBITS at %L"
msgstr ""
-#: fortran/simplify.c:1387
+#: fortran/simplify.c:1579
#, no-c-format
msgid "Invalid third argument of IBITS at %L"
msgstr ""
-#: fortran/simplify.c:1397
+#: fortran/simplify.c:1589
#, no-c-format
msgid "Sum of second and third arguments of IBITS exceeds bit size at %L"
msgstr ""
-#: fortran/simplify.c:1439
+#: fortran/simplify.c:1636
#, no-c-format
msgid "Invalid second argument of IBSET at %L"
msgstr ""
-#: fortran/simplify.c:1447
+#: fortran/simplify.c:1644
#, no-c-format
msgid "Second argument of IBSET exceeds bit size at %L"
msgstr ""
-#: fortran/simplify.c:1477
+#: fortran/simplify.c:1674
#, no-c-format
msgid "Argument of ICHAR at %L must be of length one"
msgstr ""
-#: fortran/simplify.c:1692
+#: fortran/simplify.c:1877
#, no-c-format
msgid "Argument of INT at %L is not a valid type"
msgstr ""
-#: fortran/simplify.c:1734
+#: fortran/simplify.c:1908
#, no-c-format
msgid "Argument of %s at %L is not a valid type"
msgstr ""
-#: fortran/simplify.c:1832
+#: fortran/simplify.c:2005
#, no-c-format
msgid "Invalid second argument of ISHFT at %L"
msgstr ""
-#: fortran/simplify.c:1847
+#: fortran/simplify.c:2020
#, no-c-format
msgid "Magnitude of second argument of ISHFT exceeds bit size at %L"
msgstr ""
-#: fortran/simplify.c:1911
+#: fortran/simplify.c:2084
#, no-c-format
msgid "Invalid second argument of ISHFTC at %L"
msgstr ""
-#: fortran/simplify.c:1925
+#: fortran/simplify.c:2098
#, no-c-format
msgid "Invalid third argument of ISHFTC at %L"
msgstr ""
-#: fortran/simplify.c:1931
+#: fortran/simplify.c:2104
#, no-c-format
msgid ""
"Magnitude of third argument of ISHFTC exceeds BIT_SIZE of first argument at %"
"L"
msgstr ""
-#: fortran/simplify.c:1947
+#: fortran/simplify.c:2120
#, no-c-format
msgid "Magnitude of second argument of ISHFTC exceeds third argument at %L"
msgstr ""
-#: fortran/simplify.c:1950
+#: fortran/simplify.c:2123
#, no-c-format
msgid ""
"Magnitude of second argument of ISHFTC exceeds BIT_SIZE of first argument at "
"%L"
msgstr ""
-#: fortran/simplify.c:2021
+#: fortran/simplify.c:2194
#, no-c-format
msgid "Argument of KIND at %L is a DERIVED type"
msgstr ""
-#: fortran/simplify.c:2209
+#: fortran/simplify.c:2385
#, no-c-format
msgid "DIM argument at %L is out of bounds"
msgstr ""
-#: fortran/simplify.c:2364
+#: fortran/simplify.c:2537
#, no-c-format
msgid "Argument of LOG at %L cannot be less than or equal to zero"
msgstr ""
-#: fortran/simplify.c:2377
+#: fortran/simplify.c:2550
#, no-c-format
msgid "Complex argument of LOG at %L cannot be zero"
msgstr ""
-#: fortran/simplify.c:2420
+#: fortran/simplify.c:2591
#, no-c-format
msgid "Argument of LOG10 at %L cannot be less than or equal to zero"
msgstr ""
#. Result is processor-dependent.
-#: fortran/simplify.c:2628
+#: fortran/simplify.c:2801
#, no-c-format
msgid "Second argument MOD at %L is zero"
msgstr ""
#. Result is processor-dependent.
-#: fortran/simplify.c:2639
+#: fortran/simplify.c:2812
#, no-c-format
msgid "Second argument of MOD at %L is zero"
msgstr ""
@@ -10856,121 +10510,127 @@ msgstr ""
#. Result is processor-dependent. This processor just opts
#. to not handle it at all.
#. Result is processor-dependent.
-#: fortran/simplify.c:2687 fortran/simplify.c:2699
+#: fortran/simplify.c:2854 fortran/simplify.c:2866
#, no-c-format
msgid "Second argument of MODULO at %L is zero"
msgstr ""
-#: fortran/simplify.c:2751
+#: fortran/simplify.c:2912
#, no-c-format
msgid "Second argument of NEAREST at %L shall not be zero"
msgstr ""
-#: fortran/simplify.c:2787
+#: fortran/simplify.c:2947
#, no-c-format
msgid "Result of NEAREST is NaN at %L"
msgstr ""
-#: fortran/simplify.c:3062
+#: fortran/simplify.c:3228
#, no-c-format
msgid "Argument NCOPIES of REPEAT intrinsic is negative at %L"
msgstr ""
-#: fortran/simplify.c:3117
+#: fortran/simplify.c:3283
#, no-c-format
msgid "Argument NCOPIES of REPEAT intrinsic is too large at %L"
msgstr ""
-#: fortran/simplify.c:3232
+#: fortran/simplify.c:3397
#, no-c-format
msgid "Integer too large in shape specification at %L"
msgstr ""
-#: fortran/simplify.c:3242
+#: fortran/simplify.c:3405
#, no-c-format
msgid "Too many dimensions in shape specification for RESHAPE at %L"
msgstr ""
-#: fortran/simplify.c:3250
+#: fortran/simplify.c:3413
#, no-c-format
msgid "Shape specification at %L cannot be negative"
msgstr ""
-#: fortran/simplify.c:3260
+#: fortran/simplify.c:3425
#, no-c-format
msgid "Shape specification at %L cannot be the null array"
msgstr ""
-#: fortran/simplify.c:3281
+#: fortran/simplify.c:3446
#, no-c-format
msgid ""
"ORDER parameter of RESHAPE at %L is not the same size as SHAPE parameter"
msgstr ""
-#: fortran/simplify.c:3288
+#: fortran/simplify.c:3453
#, no-c-format
msgid "Error in ORDER parameter of RESHAPE at %L"
msgstr ""
-#: fortran/simplify.c:3298
+#: fortran/simplify.c:3461
#, no-c-format
msgid "ORDER parameter of RESHAPE at %L is out of range"
msgstr ""
-#: fortran/simplify.c:3307
+#: fortran/simplify.c:3471
#, no-c-format
msgid "Invalid permutation in ORDER parameter at %L"
msgstr ""
-#: fortran/simplify.c:3363
+#: fortran/simplify.c:3530
#, no-c-format
msgid "PAD parameter required for short SOURCE parameter at %L"
msgstr ""
-#: fortran/simplify.c:3482
+#: fortran/simplify.c:3649
#, no-c-format
msgid "Result of SCALE overflows its kind at %L"
msgstr ""
-#: fortran/simplify.c:4056
+#: fortran/simplify.c:4283
#, no-c-format
msgid "Argument of SQRT at %L has a negative value"
msgstr ""
-#: fortran/simplify.c:4190
+#: fortran/simplify.c:4417
#, no-c-format
msgid ""
"Intrinsic TRANSFER at %L has partly undefined result: source size %ld < "
"result size %ld"
msgstr ""
-#: fortran/symbol.c:120
+#: fortran/simplify.c:4782
+#, no-c-format
+msgid ""
+"Character '%s' in string at %L cannot be converted into character kind %d"
+msgstr ""
+
+#: fortran/symbol.c:121
#, no-c-format
msgid "Duplicate IMPLICIT NONE statement at %C"
msgstr ""
-#: fortran/symbol.c:160
+#: fortran/symbol.c:161
#, no-c-format
msgid "Letter '%c' already set in IMPLICIT statement at %C"
msgstr ""
-#: fortran/symbol.c:182
+#: fortran/symbol.c:183
#, no-c-format
msgid "Cannot specify IMPLICIT at %C after IMPLICIT NONE"
msgstr ""
-#: fortran/symbol.c:193
+#: fortran/symbol.c:194
#, no-c-format
msgid "Letter %c already has an IMPLICIT type at %C"
msgstr ""
-#: fortran/symbol.c:247
+#: fortran/symbol.c:248
#, no-c-format
msgid "Symbol '%s' at %L has no IMPLICIT type"
msgstr ""
#. BIND(C) variables should not be implicitly declared.
-#: fortran/symbol.c:261
+#: fortran/symbol.c:262
#, no-c-format
msgid ""
"Implicitly declared BIND(C) variable '%s' at %L may not be C interoperable"
@@ -10978,221 +10638,260 @@ msgstr ""
#. Dummy args to a BIND(C) routine may not be interoperable if
#. they are implicitly typed.
-#: fortran/symbol.c:275
+#: fortran/symbol.c:276
#, no-c-format
msgid ""
-"Implicity declared variable '%s' at %L may not be C interoperable but it is "
+"Implicitly declared variable '%s' at %L may not be C interoperable but it is "
"a dummy argument to the BIND(C) procedure '%s' at %L"
msgstr ""
-#: fortran/symbol.c:316
+#: fortran/symbol.c:317
#, no-c-format
msgid "Function result '%s' at %L has no IMPLICIT type"
msgstr ""
-#: fortran/symbol.c:395
+#: fortran/symbol.c:396
#, no-c-format
msgid "%s attribute not allowed in BLOCK DATA program unit at %L"
msgstr ""
-#: fortran/symbol.c:561
+#: fortran/symbol.c:600
#, no-c-format
-msgid ""
-"Fortran 2003: Procedure pointers at %L are not yet implemented in gfortran"
+msgid "%s attribute applied to %s %s at %L"
+msgstr ""
+
+#: fortran/symbol.c:607
+#, no-c-format
+msgid "BIND(C) applied to %s %s at %L"
msgstr ""
-#: fortran/symbol.c:690 fortran/symbol.c:1300
+#: fortran/symbol.c:703 fortran/symbol.c:1348
#, no-c-format
msgid "%s attribute conflicts with %s attribute at %L"
msgstr ""
-#: fortran/symbol.c:693
+#: fortran/symbol.c:706
#, no-c-format
msgid "%s attribute conflicts with %s attribute in '%s' at %L"
msgstr ""
-#: fortran/symbol.c:701
+#: fortran/symbol.c:714
#, no-c-format
msgid "Fortran 2003: %s attribute with %s attribute at %L"
msgstr ""
-#: fortran/symbol.c:707
+#: fortran/symbol.c:720
#, no-c-format
msgid "Fortran 2003: %s attribute with %s attribute in '%s' at %L"
msgstr ""
-#: fortran/symbol.c:751
+#: fortran/symbol.c:764
#, no-c-format
msgid "Cannot change attributes of USE-associated symbol at %L"
msgstr ""
-#: fortran/symbol.c:754
+#: fortran/symbol.c:767
#, no-c-format
msgid "Cannot change attributes of USE-associated symbol %s at %L"
msgstr ""
-#: fortran/symbol.c:770
+#: fortran/symbol.c:783
#, no-c-format
msgid "Duplicate %s attribute specified at %L"
msgstr ""
-#: fortran/symbol.c:912
+#: fortran/symbol.c:816
+#, no-c-format
+msgid "ALLOCATABLE specified outside of INTERFACE body at %L"
+msgstr ""
+
+#: fortran/symbol.c:842
+#, no-c-format
+msgid "DIMENSION specified for '%s' outside its INTERFACE body at %L"
+msgstr ""
+
+#: fortran/symbol.c:960
#, no-c-format
msgid "Cray Pointee at %L appears in multiple pointer() statements"
msgstr ""
-#: fortran/symbol.c:931
+#: fortran/symbol.c:979
#, no-c-format
msgid "Duplicate PROTECTED attribute specified at %L"
msgstr ""
-#: fortran/symbol.c:964
+#: fortran/symbol.c:1012
#, no-c-format
msgid "SAVE attribute at %L cannot be specified in a PURE procedure"
msgstr ""
-#: fortran/symbol.c:972
+#: fortran/symbol.c:1020
#, no-c-format
msgid "Duplicate SAVE attribute specified at %L"
msgstr ""
-#: fortran/symbol.c:993
+#: fortran/symbol.c:1041
#, no-c-format
msgid "Duplicate VALUE attribute specified at %L"
msgstr ""
-#: fortran/symbol.c:1013
+#: fortran/symbol.c:1061
#, no-c-format
msgid "Duplicate VOLATILE attribute specified at %L"
msgstr ""
-#: fortran/symbol.c:1296
+#: fortran/symbol.c:1344
#, no-c-format
msgid "%s attribute of '%s' conflicts with %s attribute at %L"
msgstr ""
-#: fortran/symbol.c:1330
+#: fortran/symbol.c:1378
#, no-c-format
msgid "%s procedure at %L is already declared as %s procedure"
msgstr ""
-#: fortran/symbol.c:1365
+#: fortran/symbol.c:1413
#, no-c-format
msgid "INTENT (%s) conflicts with INTENT(%s) at %L"
msgstr ""
-#: fortran/symbol.c:1388
+#: fortran/symbol.c:1436
#, no-c-format
msgid "ACCESS specification at %L was already specified"
msgstr ""
-#: fortran/symbol.c:1405
+#: fortran/symbol.c:1453
#, no-c-format
msgid "Duplicate BIND attribute specified at %L"
msgstr ""
-#: fortran/symbol.c:1412
+#: fortran/symbol.c:1460
#, no-c-format
msgid "Fortran 2003: BIND(C) at %L"
msgstr ""
-#: fortran/symbol.c:1434
+#: fortran/symbol.c:1477
+#, no-c-format
+msgid "Duplicate EXTENDS attribute specified at %L"
+msgstr ""
+
+#: fortran/symbol.c:1481
+#, no-c-format
+msgid "Fortran 2003: EXTENDS at %L"
+msgstr ""
+
+#: fortran/symbol.c:1503
#, no-c-format
msgid "Symbol '%s' at %L already has an explicit interface"
msgstr ""
-#: fortran/symbol.c:1479
+#: fortran/symbol.c:1510
+#, no-c-format
+msgid "'%s' at %L has attributes specified outside its INTERFACE body"
+msgstr ""
+
+#: fortran/symbol.c:1557
#, no-c-format
msgid "Symbol '%s' at %L cannot have a type"
msgstr ""
-#: fortran/symbol.c:1636
+#: fortran/symbol.c:1716
#, no-c-format
msgid "Component '%s' at %C already declared at %L"
msgstr ""
-#: fortran/symbol.c:1714
+#: fortran/symbol.c:1727
+#, no-c-format
+msgid "Component '%s' at %C already in the parent type at %L"
+msgstr ""
+
+#: fortran/symbol.c:1802
#, no-c-format
msgid "Symbol '%s' at %C is ambiguous"
msgstr ""
-#: fortran/symbol.c:1746
+#: fortran/symbol.c:1834
#, no-c-format
msgid "Derived type '%s' at %C is being used before it is defined"
msgstr ""
-#: fortran/symbol.c:1774
+#: fortran/symbol.c:1875
#, no-c-format
msgid "'%s' at %C is not a member of the '%s' structure"
msgstr ""
-#: fortran/symbol.c:1781
+#: fortran/symbol.c:1883
#, no-c-format
msgid "Component '%s' at %C is a PRIVATE component of '%s'"
msgstr ""
-#: fortran/symbol.c:1938
+#: fortran/symbol.c:1893
+#, no-c-format
+msgid "All components of '%s' are PRIVATE in structure constructor at %C"
+msgstr ""
+
+#: fortran/symbol.c:2022
#, no-c-format
msgid "Duplicate statement label %d at %L and %L"
msgstr ""
-#: fortran/symbol.c:1948
+#: fortran/symbol.c:2032
#, no-c-format
msgid "Label %d at %C already referenced as branch target"
msgstr ""
-#: fortran/symbol.c:1957
+#: fortran/symbol.c:2041
#, no-c-format
msgid "Label %d at %C already referenced as a format label"
msgstr ""
-#: fortran/symbol.c:1999
+#: fortran/symbol.c:2083
#, no-c-format
msgid "Label %d at %C previously used as a FORMAT label"
msgstr ""
-#: fortran/symbol.c:2007
+#: fortran/symbol.c:2091
#, no-c-format
msgid "Label %d at %C previously used as branch target"
msgstr ""
-#: fortran/symbol.c:2314
+#: fortran/symbol.c:2403
#, no-c-format
msgid "Name '%s' at %C is an ambiguous reference to '%s' from module '%s'"
msgstr ""
-#: fortran/symbol.c:2317
+#: fortran/symbol.c:2406
#, no-c-format
msgid ""
"Name '%s' at %C is an ambiguous reference to '%s' from current program unit"
msgstr ""
#. Symbol is from another namespace.
-#: fortran/symbol.c:2461
+#: fortran/symbol.c:2550
#, no-c-format
msgid "Symbol '%s' at %C has already been host associated"
msgstr ""
-#: fortran/symbol.c:3189
+#: fortran/symbol.c:3309
#, no-c-format
msgid ""
"Derived type '%s' declared at %L must have the BIND attribute to be C "
"interoperable"
msgstr ""
-#: fortran/symbol.c:3200
+#: fortran/symbol.c:3320
#, no-c-format
msgid "Derived type '%s' at %L is empty"
msgstr ""
-#: fortran/symbol.c:3217
+#: fortran/symbol.c:3337
#, no-c-format
msgid ""
"Component '%s' at %L cannot have the POINTER attribute because it is a "
"member of the BIND(C) derived type '%s' at %L"
msgstr ""
-#: fortran/symbol.c:3229
+#: fortran/symbol.c:3349
#, no-c-format
msgid ""
"Component '%s' at %L cannot have the ALLOCATABLE attribute because it is a "
@@ -11201,7 +10900,7 @@ msgstr ""
#. If the derived type is bind(c), all fields must be
#. interop.
-#: fortran/symbol.c:3268
+#: fortran/symbol.c:3388
#, no-c-format
msgid ""
"Component '%s' in derived type '%s' at %L may not be C interoperable, even "
@@ -11211,69 +10910,90 @@ msgstr ""
#. If derived type is param to bind(c) routine, or to one
#. of the iso_c_binding procs, it must be interoperable, so
#. all fields must interop too.
-#: fortran/symbol.c:3277
+#: fortran/symbol.c:3397
#, no-c-format
msgid "Component '%s' in derived type '%s' at %L may not be C interoperable"
msgstr ""
-#: fortran/symbol.c:3291
+#: fortran/symbol.c:3411
#, no-c-format
msgid ""
"Derived type '%s' at %L cannot be declared with both PRIVATE and BIND(C) "
"attributes"
msgstr ""
-#: fortran/symbol.c:3299
+#: fortran/symbol.c:3419
#, no-c-format
msgid ""
"Derived type '%s' at %L cannot have the SEQUENCE attribute because it is BIND"
"(C)"
msgstr ""
-#: fortran/target-memory.c:548
+#: fortran/symbol.c:4233
+#, no-c-format
+msgid "Symbol '%s' is used before it is typed at %L"
+msgstr ""
+
+#: fortran/symbol.c:4239
+#, no-c-format
+msgid "Extension: Symbol '%s' is used before it is typed at %L"
+msgstr ""
+
+#: fortran/target-memory.c:609
#, no-c-format
msgid "Overlapping unequal initializers in EQUIVALENCE at %L"
msgstr ""
-#: fortran/target-memory.c:635
+#: fortran/target-memory.c:696
#, no-c-format
msgid "BOZ constant at %L is too large (%ld vs %ld bits)"
msgstr ""
-#: fortran/trans-common.c:390
+#: fortran/trans-array.c:592 fortran/trans-array.c:4316
+#: fortran/trans-array.c:5245 fortran/trans-intrinsic.c:3498
+#, no-c-format
+msgid "Creating array temporary at %L"
+msgstr ""
+
+#: fortran/trans-array.c:5242
+#, no-c-format
+msgid "Creating array temporary at %L for argument '%s'"
+msgstr ""
+
+#: fortran/trans-common.c:399
#, no-c-format
msgid "Named COMMON block '%s' at %L shall be of the same size"
msgstr ""
-#: fortran/trans-common.c:824
+#: fortran/trans-common.c:835
#, no-c-format
msgid "Bad array reference at %L"
msgstr ""
-#: fortran/trans-common.c:832
+#: fortran/trans-common.c:843
#, no-c-format
msgid "Illegal reference type at %L as EQUIVALENCE object"
msgstr ""
-#: fortran/trans-common.c:872
+#: fortran/trans-common.c:883
#, no-c-format
msgid "Inconsistent equivalence rules involving '%s' at %L and '%s' at %L"
msgstr ""
#. Aligning this field would misalign a previous field.
-#: fortran/trans-common.c:1005
+#: fortran/trans-common.c:1016
#, no-c-format
msgid ""
"The equivalence set for variable '%s' declared at %L violates alignment "
"requirements"
msgstr ""
-#: fortran/trans-common.c:1070
+#: fortran/trans-common.c:1081
#, no-c-format
msgid "Equivalence for '%s' does not match ordering of COMMON '%s' at %L"
msgstr ""
-#: fortran/trans-common.c:1085
+#: fortran/trans-common.c:1096
#, no-c-format
msgid ""
"The equivalence set for '%s' cause an invalid extension to COMMON '%s' at %L"
@@ -11282,220 +11002,230 @@ msgstr ""
#. The required offset conflicts with previous alignment
#. requirements. Insert padding immediately before this
#. segment.
-#: fortran/trans-common.c:1096
+#: fortran/trans-common.c:1107
#, no-c-format
msgid "Padding of %d bytes required before '%s' in COMMON '%s' at %L"
msgstr ""
-#: fortran/trans-common.c:1122
+#: fortran/trans-common.c:1133
#, no-c-format
msgid "COMMON '%s' at %L does not exist"
msgstr ""
-#: fortran/trans-common.c:1129
+#: fortran/trans-common.c:1140
#, no-c-format
msgid "COMMON '%s' at %L requires %d bytes of padding at start"
msgstr ""
-#: fortran/trans-decl.c:3006
+#: fortran/trans-decl.c:2773 fortran/trans-decl.c:3468
+#, no-c-format
+msgid "Return value of function '%s' at %L not set"
+msgstr ""
+
+#: fortran/trans-decl.c:3109
#, no-c-format
msgid "Dummy argument '%s' at %L was declared INTENT(OUT) but was not set"
msgstr ""
-#: fortran/trans-decl.c:3010
+#: fortran/trans-decl.c:3113
#, no-c-format
msgid "Unused dummy argument '%s' at %L"
msgstr ""
-#: fortran/trans-decl.c:3016
+#: fortran/trans-decl.c:3119
#, no-c-format
msgid "Unused variable '%s' declared at %L"
msgstr ""
-#: fortran/trans-decl.c:3042
+#: fortran/trans-decl.c:3145
#, no-c-format
msgid "Unused parameter '%s' declared at %L"
msgstr ""
-#: fortran/trans-expr.c:2201
+#: fortran/trans-decl.c:3159
+#, no-c-format
+msgid "Return value '%s' of function '%s' declared at %L not set"
+msgstr ""
+
+#: fortran/trans-expr.c:2275
#, no-c-format
msgid "Unknown argument list function at %L"
msgstr ""
-#: fortran/trans-intrinsic.c:829
+#: fortran/trans-intrinsic.c:853
#, no-c-format
msgid "'dim' argument of %s intrinsic at %L is not a valid dimension index"
msgstr ""
-#: fortran/trans-io.c:1851
+#: fortran/trans-io.c:2006
#, no-c-format
msgid "Derived type '%s' at %L has PRIVATE components"
msgstr ""
-#: fortran/trans-stmt.c:436
+#: fortran/trans-stmt.c:438
#, no-c-format
msgid "An alternate return at %L without a * dummy argument"
msgstr ""
-#: fortran/trans.c:49
+#: fortran/trans.c:50
msgid "Array bound mismatch"
msgstr ""
-#: fortran/trans.c:50
+#: fortran/trans.c:51
msgid "Array reference out of bounds"
msgstr ""
-#: fortran/trans.c:51
+#: fortran/trans.c:52
msgid "Incorrect function return value"
msgstr ""
-#: fortran/trans.c:465 fortran/trans.c:859
+#: fortran/trans.c:485 fortran/trans.c:878
msgid "Attempt to allocate a negative amount of memory."
msgstr ""
-#: fortran/trans.c:479
+#: fortran/trans.c:503
msgid "Memory allocation failed"
msgstr ""
-#: fortran/trans.c:567
+#: fortran/trans.c:585
msgid ""
"Attempt to allocate negative amount of memory. Possible integer overflow"
msgstr ""
-#: fortran/trans.c:598 fortran/trans.c:876
+#: fortran/trans.c:616 fortran/trans.c:895
msgid "Out of memory"
msgstr ""
-#: fortran/trans.c:678
+#: fortran/trans.c:696
msgid "Attempting to allocate already allocated array"
msgstr ""
-#: fortran/trans.c:776
+#: fortran/trans.c:795
msgid "Attempt to DEALLOCATE unallocated memory."
msgstr ""
-#: java/jcf-dump.c:1066
+#: java/jcf-dump.c:1068
#, c-format
msgid "Not a valid Java .class file.\n"
msgstr ""
-#: java/jcf-dump.c:1072
+#: java/jcf-dump.c:1074
#, c-format
msgid "error while parsing constant pool\n"
msgstr ""
-#: java/jcf-dump.c:1078 java/jcf-parse.c:1458
+#: java/jcf-dump.c:1080 java/jcf-parse.c:1436
#, gcc-internal-format
msgid "error in constant pool entry #%d\n"
msgstr ""
-#: java/jcf-dump.c:1088
+#: java/jcf-dump.c:1090
#, c-format
msgid "error while parsing fields\n"
msgstr ""
-#: java/jcf-dump.c:1094
+#: java/jcf-dump.c:1096
#, c-format
msgid "error while parsing methods\n"
msgstr ""
-#: java/jcf-dump.c:1100
+#: java/jcf-dump.c:1102
#, c-format
msgid "error while parsing final attributes\n"
msgstr ""
-#: java/jcf-dump.c:1137
+#: java/jcf-dump.c:1139
#, c-format
msgid "Try 'jcf-dump --help' for more information.\n"
msgstr ""
-#: java/jcf-dump.c:1144
+#: java/jcf-dump.c:1146
#, c-format
msgid ""
"Usage: jcf-dump [OPTION]... CLASS...\n"
"\n"
msgstr ""
-#: java/jcf-dump.c:1145
+#: java/jcf-dump.c:1147
#, c-format
msgid ""
"Display contents of a class file in readable form.\n"
"\n"
msgstr ""
-#: java/jcf-dump.c:1146
+#: java/jcf-dump.c:1148
#, c-format
msgid " -c Disassemble method bodies\n"
msgstr ""
-#: java/jcf-dump.c:1147
+#: java/jcf-dump.c:1149
#, c-format
msgid " --javap Generate output in 'javap' format\n"
msgstr ""
-#: java/jcf-dump.c:1149
+#: java/jcf-dump.c:1151
#, c-format
msgid " --classpath PATH Set path to find .class files\n"
msgstr ""
-#: java/jcf-dump.c:1150
+#: java/jcf-dump.c:1152
#, c-format
msgid " -IDIR Append directory to class path\n"
msgstr ""
-#: java/jcf-dump.c:1151
+#: java/jcf-dump.c:1153
#, c-format
msgid " --bootclasspath PATH Override built-in class path\n"
msgstr ""
-#: java/jcf-dump.c:1152
+#: java/jcf-dump.c:1154
#, c-format
msgid " --extdirs PATH Set extensions directory path\n"
msgstr ""
-#: java/jcf-dump.c:1153
+#: java/jcf-dump.c:1155
#, c-format
msgid " -o FILE Set output file name\n"
msgstr ""
-#: java/jcf-dump.c:1155
+#: java/jcf-dump.c:1157
#, c-format
msgid " --help Print this help, then exit\n"
msgstr ""
-#: java/jcf-dump.c:1156
+#: java/jcf-dump.c:1158
#, c-format
msgid " --version Print version number, then exit\n"
msgstr ""
-#: java/jcf-dump.c:1157
+#: java/jcf-dump.c:1159
#, c-format
msgid " -v, --verbose Print extra information while running\n"
msgstr ""
-#: java/jcf-dump.c:1159
+#: java/jcf-dump.c:1161
#, c-format
msgid ""
"For bug reporting instructions, please see:\n"
"%s.\n"
msgstr ""
-#: java/jcf-dump.c:1187 java/jcf-dump.c:1255
+#: java/jcf-dump.c:1189 java/jcf-dump.c:1257
#, c-format
msgid "jcf-dump: no classes specified\n"
msgstr ""
-#: java/jcf-dump.c:1275
+#: java/jcf-dump.c:1277
#, c-format
msgid "Cannot open '%s' for output.\n"
msgstr ""
-#: java/jcf-dump.c:1321
+#: java/jcf-dump.c:1323
#, c-format
msgid "bad format of .zip/.jar archive\n"
msgstr ""
-#: java/jcf-dump.c:1439
+#: java/jcf-dump.c:1441
#, c-format
msgid "Bad byte codes.\n"
msgstr ""
@@ -11550,32 +11280,24 @@ msgstr ""
msgid "cannot specify 'main' class when not linking"
msgstr ""
-#: config/i386/nwld.h:34
-msgid "Static linking is not supported.\n"
-msgstr ""
-
-#: config/i386/cygwin.h:28
-msgid "mno-cygwin and mno-win32 are not compatible"
-msgstr ""
-
-#: config/i386/cygwin.h:74 config/i386/mingw32.h:74
+#: config/i386/mingw32.h:74 config/i386/cygwin.h:74
msgid "shared and mdll are not compatible"
msgstr ""
-#: config/i386/sco5.h:188
-msgid "-pg not supported on this platform"
+#: fortran/lang-specs.h:45 fortran/lang-specs.h:58
+msgid "gfortran does not support -E without -cpp"
msgstr ""
-#: config/i386/sco5.h:189
-msgid "-p and -pp specified - pick one"
+#: java/lang-specs.h:33
+msgid "-fjni and -femit-class-files are incompatible"
msgstr ""
-#: config/i386/sco5.h:258
-msgid "-G and -static are mutually exclusive"
+#: java/lang-specs.h:34
+msgid "-fjni and -femit-class-file are incompatible"
msgstr ""
-#: java/jvspec.c:80 gcc.c:820 ada/lang-specs.h:33
-msgid "-pg and -fomit-frame-pointer are incompatible"
+#: java/lang-specs.h:35 java/lang-specs.h:36
+msgid "-femit-class-file should used along with -fsyntax-only"
msgstr ""
#: config/vax/netbsd-elf.h:41
@@ -11590,115 +11312,120 @@ msgstr ""
msgid "SH2a does not support little-endian"
msgstr ""
-#: config/cris/cris.h:207
-msgid "Do not specify both -march=... and -mcpu=..."
+#: config/arc/arc.h:61 config/mips/mips.h:1132
+msgid "may not use both -EB and -EL"
msgstr ""
-#: gcc.c:792
-msgid "GCC does not support -C or -CC without -E"
+#: config/bfin/elf.h:29
+msgid "no processor type specified for linking"
msgstr ""
-#: gcc.c:1002
-msgid "-E or -x required when input is from standard input"
+#: config/i386/nwld.h:34
+msgid "Static linking is not supported.\n"
msgstr ""
-#: config/mcore/mcore.h:56
-msgid "the m210 does not have little endian support"
+#: gcc.c:803
+msgid "GCC does not support -C or -CC without -E"
msgstr ""
-#: config/linux.h:106 config/linux.h:108 config/rs6000/sysv4.h:897
-#: config/rs6000/sysv4.h:899 config/alpha/linux-elf.h:33
-#: config/alpha/linux-elf.h:35 config/sparc/linux.h:126
-#: config/sparc/linux.h:128 config/sparc/linux64.h:152
-#: config/sparc/linux64.h:154 config/rs6000/linux64.h:347
-#: config/rs6000/linux64.h:349
-msgid "-mglibc and -muclibc used together"
+#: gcc.c:831 java/jvspec.c:80
+msgid "-pg and -fomit-frame-pointer are incompatible"
msgstr ""
-#: config/lynx.h:70
-msgid "cannot use mthreads and mlegacy-threads together"
+#: gcc.c:1016
+msgid "-E or -x required when input is from standard input"
msgstr ""
-#: config/lynx.h:95
-msgid "cannot use mshared and static together"
+#: config/i386/cygwin.h:28
+msgid "mno-cygwin and mno-win32 are not compatible"
msgstr ""
-#: config/s390/tpf.h:119
-msgid "static is not supported on TPF-OS"
+#: config/mcore/mcore.h:56
+msgid "the m210 does not have little endian support"
msgstr ""
-#: config/mips/mips.h:1042 config/arc/arc.h:61
-msgid "may not use both -EB and -EL"
+#: config/darwin.h:269
+msgid "-current_version only allowed with -dynamiclib"
msgstr ""
-#: config/mips/r3900.h:34
-msgid "-mhard-float not supported"
+#: config/darwin.h:271
+msgid "-install_name only allowed with -dynamiclib"
msgstr ""
-#: config/mips/r3900.h:36
-msgid "-msingle-float and -msoft-float cannot both be specified"
+#: config/darwin.h:276
+msgid "-bundle not allowed with -dynamiclib"
msgstr ""
-#: java/lang-specs.h:33
-msgid "-fjni and -femit-class-files are incompatible"
+#: config/darwin.h:277
+msgid "-bundle_loader not allowed with -dynamiclib"
msgstr ""
-#: java/lang-specs.h:34
-msgid "-fjni and -femit-class-file are incompatible"
+#: config/darwin.h:278
+msgid "-client_name not allowed with -dynamiclib"
msgstr ""
-#: java/lang-specs.h:35 java/lang-specs.h:36
-msgid "-femit-class-file should used along with -fsyntax-only"
+#: config/darwin.h:283
+msgid "-force_flat_namespace not allowed with -dynamiclib"
msgstr ""
-#: config/sparc/linux64.h:211 config/sparc/linux64.h:222
-#: config/sparc/netbsd-elf.h:125 config/sparc/netbsd-elf.h:144
-#: config/sparc/sol2-bi.h:217 config/sparc/sol2-bi.h:227
-msgid "may not use both -m32 and -m64"
+#: config/darwin.h:285
+msgid "-keep_private_externs not allowed with -dynamiclib"
msgstr ""
-#: config/rs6000/darwin.h:95
-msgid " conflicting code gen style switches are used"
+#: config/darwin.h:286
+msgid "-private_bundle not allowed with -dynamiclib"
msgstr ""
-#: ada/lang-specs.h:34
-msgid "-c or -S required for Ada"
+#: config/s390/tpf.h:119
+msgid "static is not supported on TPF-OS"
+msgstr ""
+
+#: config/rs6000/sysv4.h:899 config/rs6000/sysv4.h:901
+#: config/alpha/linux-elf.h:33 config/alpha/linux-elf.h:35 config/linux.h:106
+#: config/linux.h:108 config/rs6000/linux64.h:345 config/rs6000/linux64.h:347
+msgid "-mglibc and -muclibc used together"
msgstr ""
#: config/vxworks.h:71
msgid "-Xbind-now and -Xbind-lazy are incompatible"
msgstr ""
-#: config/darwin.h:269
-msgid "-current_version only allowed with -dynamiclib"
+#: config/arm/arm.h:148
+msgid "-msoft-float and -mhard_float may not be used together"
msgstr ""
-#: config/darwin.h:271
-msgid "-install_name only allowed with -dynamiclib"
+#: config/arm/arm.h:150
+msgid "-mbig-endian and -mlittle-endian may not be used together"
msgstr ""
-#: config/darwin.h:276
-msgid "-bundle not allowed with -dynamiclib"
+#: config/cris/cris.h:207
+msgid "Do not specify both -march=... and -mcpu=..."
msgstr ""
-#: config/darwin.h:277
-msgid "-bundle_loader not allowed with -dynamiclib"
+#: config/sparc/linux64.h:165 config/sparc/linux64.h:176
+#: config/sparc/netbsd-elf.h:125 config/sparc/netbsd-elf.h:144
+#: config/sparc/sol2-bi.h:217 config/sparc/sol2-bi.h:227
+msgid "may not use both -m32 and -m64"
msgstr ""
-#: config/darwin.h:278
-msgid "-client_name not allowed with -dynamiclib"
+#: config/rs6000/darwin.h:95
+msgid " conflicting code gen style switches are used"
msgstr ""
-#: config/darwin.h:283
-msgid "-force_flat_namespace not allowed with -dynamiclib"
+#: config/mips/r3900.h:34
+msgid "-mhard-float not supported"
msgstr ""
-#: config/darwin.h:285
-msgid "-keep_private_externs not allowed with -dynamiclib"
+#: config/mips/r3900.h:36
+msgid "-msingle-float and -msoft-float cannot both be specified"
msgstr ""
-#: config/darwin.h:286
-msgid "-private_bundle not allowed with -dynamiclib"
+#: config/lynx.h:70
+msgid "cannot use mthreads and mlegacy-threads together"
+msgstr ""
+
+#: config/lynx.h:95
+msgid "cannot use mshared and static together"
msgstr ""
#: config/sparc/sol2-bi.h:189 config/sparc/sol2-bi.h:194
@@ -11706,14 +11433,6 @@ msgstr ""
msgid "does not support multilib"
msgstr ""
-#: config/arm/arm.h:147
-msgid "-msoft-float and -mhard_float may not be used together"
-msgstr ""
-
-#: config/arm/arm.h:149
-msgid "-mbig-endian and -mlittle-endian may not be used together"
-msgstr ""
-
#: java/lang.opt:65
msgid "Warn if a deprecated compiler feature, class, method, or field is used"
msgstr ""
@@ -11824,300 +11543,322 @@ msgstr ""
msgid "Set the target VM version"
msgstr ""
-#: ada/lang.opt:96
+#: ada/gcc-interface/lang.opt:100
msgid "Specify options to GNAT"
msgstr ""
-#: fortran/lang.opt:29
+#: fortran/lang.opt:53
msgid "Add a directory for INCLUDE and MODULE searching"
msgstr ""
-#: fortran/lang.opt:33
+#: fortran/lang.opt:57
msgid "Put MODULE files in 'directory'"
msgstr ""
-#: fortran/lang.opt:41
+#: fortran/lang.opt:73
msgid "Warn about possible aliasing of dummy arguments"
msgstr ""
-#: fortran/lang.opt:45
+#: fortran/lang.opt:77
msgid "Warn about missing ampersand in continued character constants"
msgstr ""
-#: fortran/lang.opt:49
+#: fortran/lang.opt:81
+msgid "Warn about creation of array temporaries"
+msgstr ""
+
+#: fortran/lang.opt:85
msgid "Warn about truncated character expressions"
msgstr ""
-#: fortran/lang.opt:53
+#: fortran/lang.opt:89
msgid "Warn about implicit conversion"
msgstr ""
-#: fortran/lang.opt:57
+#: fortran/lang.opt:93
msgid "Warn about calls with implicit interface"
msgstr ""
-#: fortran/lang.opt:61
+#: fortran/lang.opt:97
msgid "Warn about truncated source lines"
msgstr ""
-#: fortran/lang.opt:65
-msgid "Warn about usage of non-standard intrinsics"
+#: fortran/lang.opt:101
+msgid "Warn on intrinsics not part of the selected standard"
msgstr ""
-#: fortran/lang.opt:69
+#: fortran/lang.opt:109
msgid "Warn about \"suspicious\" constructs"
msgstr ""
-#: fortran/lang.opt:73
+#: fortran/lang.opt:113
msgid "Permit nonconforming uses of the tab character"
msgstr ""
-#: fortran/lang.opt:77
+#: fortran/lang.opt:117
msgid "Warn about underflow of numerical constant expressions"
msgstr ""
-#: fortran/lang.opt:81
+#: fortran/lang.opt:121
+msgid "Warn if a user-procedure has the same name as an intrinsic"
+msgstr ""
+
+#: fortran/lang.opt:125
+msgid "Enable preprocessing"
+msgstr ""
+
+#: fortran/lang.opt:129
+msgid "Disable preprocessing"
+msgstr ""
+
+#: fortran/lang.opt:133
+msgid "Dump details about macro names and definitions during preprocessing"
+msgstr ""
+
+#: fortran/lang.opt:137
msgid "All intrinsics procedures are available regardless of selected standard"
msgstr ""
-#: fortran/lang.opt:89
+#: fortran/lang.opt:145
msgid ""
"Do not treat local variables and COMMON blocks as if they were named in SAVE "
"statements"
msgstr ""
-#: fortran/lang.opt:93
+#: fortran/lang.opt:149
msgid "Specify that backslash in string introduces an escape character"
msgstr ""
-#: fortran/lang.opt:97
+#: fortran/lang.opt:153
msgid "Produce a backtrace when a runtime error is encountered"
msgstr ""
-#: fortran/lang.opt:101
+#: fortran/lang.opt:157
msgid ""
"-fblas-matmul-limit=<n> Size of the smallest matrix for which matmul "
"will use BLAS"
msgstr ""
-#: fortran/lang.opt:105
+#: fortran/lang.opt:161
+msgid ""
+"Produce a warning at runtime if a array temporary has been created for a "
+"procedure argument"
+msgstr ""
+
+#: fortran/lang.opt:165
msgid "Use big-endian format for unformatted files"
msgstr ""
-#: fortran/lang.opt:109
+#: fortran/lang.opt:169
msgid "Use little-endian format for unformatted files"
msgstr ""
-#: fortran/lang.opt:113
+#: fortran/lang.opt:173
msgid "Use native format for unformatted files"
msgstr ""
-#: fortran/lang.opt:117
+#: fortran/lang.opt:177
msgid "Swap endianness for unformatted files"
msgstr ""
-#: fortran/lang.opt:121
+#: fortran/lang.opt:181
msgid "Use the Cray Pointer extension"
msgstr ""
-#: fortran/lang.opt:125
+#: fortran/lang.opt:185
msgid "Ignore 'D' in column one in fixed form"
msgstr ""
-#: fortran/lang.opt:129
+#: fortran/lang.opt:189
msgid "Treat lines with 'D' in column one as comments"
msgstr ""
-#: fortran/lang.opt:133
+#: fortran/lang.opt:193
msgid "Set the default double precision kind to an 8 byte wide type"
msgstr ""
-#: fortran/lang.opt:137
+#: fortran/lang.opt:197
msgid "Set the default integer kind to an 8 byte wide type"
msgstr ""
-#: fortran/lang.opt:141
+#: fortran/lang.opt:201
msgid "Set the default real kind to an 8 byte wide type"
msgstr ""
-#: fortran/lang.opt:145
+#: fortran/lang.opt:205
msgid "Allow dollar signs in entity names"
msgstr ""
-#: fortran/lang.opt:149
+#: fortran/lang.opt:209
msgid "Dump a core file when a runtime error occurs"
msgstr ""
-#: fortran/lang.opt:153
+#: fortran/lang.opt:213
msgid "Display the code tree after parsing"
msgstr ""
-#: fortran/lang.opt:157
+#: fortran/lang.opt:217
msgid ""
"Specify that an external BLAS library should be used for matmul calls on "
"large-size arrays"
msgstr ""
-#: fortran/lang.opt:161
+#: fortran/lang.opt:221
msgid "Use f2c calling convention"
msgstr ""
-#: fortran/lang.opt:165
+#: fortran/lang.opt:225
msgid "Assume that the source file is fixed form"
msgstr ""
-#: fortran/lang.opt:169
+#: fortran/lang.opt:229
msgid "Specify where to find the compiled intrinsic modules"
msgstr ""
-#: fortran/lang.opt:173
+#: fortran/lang.opt:233
msgid "Allow arbitrary character line width in fixed mode"
msgstr ""
-#: fortran/lang.opt:177
+#: fortran/lang.opt:237
msgid "Use n as character line width in fixed mode"
msgstr ""
-#: fortran/lang.opt:181
+#: fortran/lang.opt:241
msgid "Stop on following floating point exceptions"
msgstr ""
-#: fortran/lang.opt:185
+#: fortran/lang.opt:245
msgid "Assume that the source file is free form"
msgstr ""
-#: fortran/lang.opt:189
+#: fortran/lang.opt:249
msgid "Allow arbitrary character line width in free mode"
msgstr ""
-#: fortran/lang.opt:193
+#: fortran/lang.opt:253
msgid "Use n as character line width in free mode"
msgstr ""
-#: fortran/lang.opt:197
+#: fortran/lang.opt:257
msgid ""
"Specify that no implicit typing is allowed, unless overridden by explicit "
"IMPLICIT statements"
msgstr ""
-#: fortran/lang.opt:201
+#: fortran/lang.opt:261
msgid ""
"-finit-character=<n> Initialize local character variables to ASCII value n"
msgstr ""
-#: fortran/lang.opt:205
+#: fortran/lang.opt:265
msgid "-finit-integer=<n> Initialize local integer variables to n"
msgstr ""
-#: fortran/lang.opt:209
+#: fortran/lang.opt:269
msgid "Initialize local variables to zero (from g77)"
msgstr ""
-#: fortran/lang.opt:213
+#: fortran/lang.opt:273
msgid "-finit-logical=<true|false> Initialize local logical variables"
msgstr ""
-#: fortran/lang.opt:217
+#: fortran/lang.opt:277
msgid "-finit-real=<zero|nan|inf|-inf> Initialize local real variables"
msgstr ""
-#: fortran/lang.opt:221
+#: fortran/lang.opt:281
msgid "Maximum number of errors to report"
msgstr ""
-#: fortran/lang.opt:225
+#: fortran/lang.opt:285
msgid "Maximum identifier length"
msgstr ""
-#: fortran/lang.opt:229
+#: fortran/lang.opt:289
msgid "Maximum length for subrecords"
msgstr ""
-#: fortran/lang.opt:233
+#: fortran/lang.opt:293
msgid "Size in bytes of the largest array that will be put on the stack"
msgstr ""
-#: fortran/lang.opt:237
+#: fortran/lang.opt:297
msgid "Set default accessibility of module entities to PRIVATE."
msgstr ""
-#: fortran/lang.opt:241
+#: fortran/lang.opt:301
msgid "Enable OpenMP (also sets frecursive)"
msgstr ""
-#: fortran/lang.opt:245
+#: fortran/lang.opt:305
msgid "Try to lay out derived types as compactly as possible"
msgstr ""
-#: fortran/lang.opt:249
+#: fortran/lang.opt:309
msgid "Treat the input file as preprocessed"
msgstr ""
-#: fortran/lang.opt:253
+#: fortran/lang.opt:313
msgid "Enable range checking during compilation"
msgstr ""
-#: fortran/lang.opt:257
+#: fortran/lang.opt:317
msgid "Use a 4-byte record marker for unformatted files"
msgstr ""
-#: fortran/lang.opt:261
+#: fortran/lang.opt:321
msgid "Use an 8-byte record marker for unformatted files"
msgstr ""
-#: fortran/lang.opt:265
+#: fortran/lang.opt:325
msgid "Allocate local variables on the stack to allow indirect recursion"
msgstr ""
-#: fortran/lang.opt:269
+#: fortran/lang.opt:329
msgid "Copy array sections into a contiguous block on procedure entry"
msgstr ""
-#: fortran/lang.opt:273
+#: fortran/lang.opt:333
msgid "Append a second underscore if the name already contains an underscore"
msgstr ""
-#: fortran/lang.opt:277 c.opt:718
+#: fortran/lang.opt:337 c.opt:721
msgid "Use the narrowest integer type possible for enumeration types"
msgstr ""
-#: fortran/lang.opt:281
+#: fortran/lang.opt:341
msgid "Apply negative sign to zero values"
msgstr ""
-#: fortran/lang.opt:285
+#: fortran/lang.opt:345
msgid "Append underscores to externally visible names"
msgstr ""
-#: fortran/lang.opt:289
+#: fortran/lang.opt:381
msgid "Statically link the GNU Fortran helper library (libgfortran)"
msgstr ""
-#: fortran/lang.opt:293
+#: fortran/lang.opt:385
msgid "Conform to the ISO Fortran 2003 standard"
msgstr ""
-#: fortran/lang.opt:297
+#: fortran/lang.opt:389
+msgid "Conform to the ISO Fortran 2008 standard"
+msgstr ""
+
+#: fortran/lang.opt:393
msgid "Conform to the ISO Fortran 95 standard"
msgstr ""
-#: fortran/lang.opt:301
+#: fortran/lang.opt:397
msgid "Conform to nothing in particular"
msgstr ""
-#: fortran/lang.opt:305
+#: fortran/lang.opt:401
msgid "Accept extensions to support legacy code"
msgstr ""
-#: treelang/lang.opt:30
-msgid "Trace lexical analysis"
-msgstr ""
-
-#: treelang/lang.opt:34
-msgid "Trace the parsing process"
-msgstr ""
-
-#: config/alpha/alpha.opt:23 config/i386/i386.opt:155
+#: config/alpha/alpha.opt:23 config/i386/i386.opt:197
msgid "Do not use hardware fp"
msgstr ""
@@ -12427,7 +12168,7 @@ msgstr ""
msgid "64 bit ABI"
msgstr ""
-#: config/s390/s390.opt:31 config/i386/i386.opt:59 config/spu/spu.opt:60
+#: config/s390/s390.opt:31 config/i386/i386.opt:93 config/spu/spu.opt:60
msgid "Generate code for given CPU"
msgstr ""
@@ -12480,7 +12221,7 @@ msgid ""
msgstr ""
#: config/s390/s390.opt:87 config/ia64/ia64.opt:97 config/sparc/sparc.opt:95
-#: config/i386/i386.opt:183 config/rs6000/rs6000.opt:226 config/spu/spu.opt:64
+#: config/i386/i386.opt:225 config/rs6000/rs6000.opt:226 config/spu/spu.opt:64
msgid "Schedule code for given CPU"
msgstr ""
@@ -12588,7 +12329,8 @@ msgstr ""
msgid "Enable earlier placing stop bits for better scheduling"
msgstr ""
-#: config/ia64/ia64.opt:89 config/spu/spu.opt:56 config/pa/pa.opt:51
+#: config/ia64/ia64.opt:89 config/spu/spu.opt:56 config/sh/sh.opt:253
+#: config/pa/pa.opt:51
msgid "Specify range of registers to make fixed"
msgstr ""
@@ -12645,7 +12387,7 @@ msgid ""
"Count speculative dependencies while calculating priority of instructions"
msgstr ""
-#: config/m32c/m32c.opt:24 config/bfin/bfin.opt:23 config/mt/mt.opt:27
+#: config/m32c/m32c.opt:24 config/bfin/bfin.opt:23
msgid "Use simulator runtime"
msgstr ""
@@ -12965,7 +12707,11 @@ msgstr ""
msgid "Tune for the specified target CPU or architecture"
msgstr ""
-#: config/m68k/ieee.opt:24 config/i386/i386.opt:95
+#: config/m68k/m68k.opt:184
+msgid "Support more than 8192 GOT entries on ColdFire"
+msgstr ""
+
+#: config/m68k/ieee.opt:24 config/i386/i386.opt:133
msgid "Use IEEE math for fp comparisons"
msgstr ""
@@ -12973,229 +12719,249 @@ msgstr ""
msgid "Ignored (obsolete)"
msgstr ""
-#: config/i386/i386.opt:23
+#: config/i386/i386.opt:57
msgid "sizeof(long double) is 16"
msgstr ""
-#: config/i386/i386.opt:27 config/i386/i386.opt:91
+#: config/i386/i386.opt:61 config/i386/i386.opt:129
msgid "Use hardware fp"
msgstr ""
-#: config/i386/i386.opt:31
+#: config/i386/i386.opt:65
msgid "sizeof(long double) is 12"
msgstr ""
-#: config/i386/i386.opt:35
+#: config/i386/i386.opt:69
msgid "Reserve space for outgoing arguments in the function prologue"
msgstr ""
-#: config/i386/i386.opt:39
+#: config/i386/i386.opt:73
msgid "Align some doubles on dword boundary"
msgstr ""
-#: config/i386/i386.opt:43
+#: config/i386/i386.opt:77
msgid "Function starts are aligned to this power of 2"
msgstr ""
-#: config/i386/i386.opt:47
+#: config/i386/i386.opt:81
msgid "Jump targets are aligned to this power of 2"
msgstr ""
-#: config/i386/i386.opt:51
+#: config/i386/i386.opt:85
msgid "Loop code aligned to this power of 2"
msgstr ""
-#: config/i386/i386.opt:55
+#: config/i386/i386.opt:89
msgid "Align destination of the string operations"
msgstr ""
-#: config/i386/i386.opt:63
+#: config/i386/i386.opt:97
msgid "Use given assembler dialect"
msgstr ""
-#: config/i386/i386.opt:67
+#: config/i386/i386.opt:101
msgid "Branches are this expensive (1-5, arbitrary units)"
msgstr ""
-#: config/i386/i386.opt:71
+#: config/i386/i386.opt:105
msgid ""
"Data greater than given threshold will go into .ldata section in x86-64 "
"medium model"
msgstr ""
-#: config/i386/i386.opt:75
+#: config/i386/i386.opt:109
msgid "Use given x86-64 code model"
msgstr ""
-#: config/i386/i386.opt:79
+#: config/i386/i386.opt:113
msgid "Generate sin, cos, sqrt for FPU"
msgstr ""
-#: config/i386/i386.opt:83
+#: config/i386/i386.opt:117
+msgid "Always use Dynamic Realigned Argument Pointer (DRAP) to realign stack"
+msgstr ""
+
+#: config/i386/i386.opt:121
msgid "Return values of functions in FPU registers"
msgstr ""
-#: config/i386/i386.opt:87
+#: config/i386/i386.opt:125
msgid "Generate floating point mathematics using given instruction set"
msgstr ""
-#: config/i386/i386.opt:99
+#: config/i386/i386.opt:137
msgid "Inline all known string operations"
msgstr ""
-#: config/i386/i386.opt:103
+#: config/i386/i386.opt:141
msgid ""
"Inline memset/memcpy string operations, but perform inline version only for "
"small blocks"
msgstr ""
-#: config/i386/i386.opt:111
+#: config/i386/i386.opt:149
msgid "Use native (MS) bitfield layout"
msgstr ""
-#: config/i386/i386.opt:127
+#: config/i386/i386.opt:165
msgid "Omit the frame pointer in leaf functions"
msgstr ""
-#: config/i386/i386.opt:131
+#: config/i386/i386.opt:169
msgid "Set 80387 floating-point precision (-mpc32, -mpc64, -mpc80)"
msgstr ""
-#: config/i386/i386.opt:135
+#: config/i386/i386.opt:173
msgid "Attempt to keep stack aligned to this power of 2"
msgstr ""
-#: config/i386/i386.opt:139
+#: config/i386/i386.opt:177
+msgid "Assume incoming stack aligned to this power of 2"
+msgstr ""
+
+#: config/i386/i386.opt:181
msgid "Use push instructions to save outgoing arguments"
msgstr ""
-#: config/i386/i386.opt:143
+#: config/i386/i386.opt:185
msgid "Use red-zone in the x86-64 code"
msgstr ""
-#: config/i386/i386.opt:147
+#: config/i386/i386.opt:189
msgid "Number of registers used to pass integer arguments"
msgstr ""
-#: config/i386/i386.opt:151
+#: config/i386/i386.opt:193
msgid "Alternate calling convention"
msgstr ""
-#: config/i386/i386.opt:159
+#: config/i386/i386.opt:201
msgid "Use SSE register passing conventions for SF and DF mode"
msgstr ""
-#: config/i386/i386.opt:163
+#: config/i386/i386.opt:205
msgid "Realign stack in prologue"
msgstr ""
-#: config/i386/i386.opt:167
+#: config/i386/i386.opt:209
msgid "Enable stack probing"
msgstr ""
-#: config/i386/i386.opt:171
+#: config/i386/i386.opt:213
msgid "Chose strategy to generate stringop using"
msgstr ""
-#: config/i386/i386.opt:175
+#: config/i386/i386.opt:217
msgid "Use given thread-local storage dialect"
msgstr ""
-#: config/i386/i386.opt:179
+#: config/i386/i386.opt:221
#, c-format
msgid "Use direct references against %gs when accessing tls data"
msgstr ""
-#: config/i386/i386.opt:187
+#: config/i386/i386.opt:229
msgid "Vector library ABI to use"
msgstr ""
-#: config/i386/i386.opt:193
+#: config/i386/i386.opt:233
+msgid "Generate reciprocals instead of divss and sqrtss."
+msgstr ""
+
+#: config/i386/i386.opt:237
+msgid "Generate cld instruction in the function prologue."
+msgstr ""
+
+#: config/i386/i386.opt:244
+msgid ""
+"Enable automatic generation of fused floating point multiply-add instructions"
+msgstr ""
+
+#: config/i386/i386.opt:252
msgid "Generate 32bit i386 code"
msgstr ""
-#: config/i386/i386.opt:197
+#: config/i386/i386.opt:256
msgid "Generate 64bit x86-64 code"
msgstr ""
-#: config/i386/i386.opt:201
+#: config/i386/i386.opt:260
msgid "Support MMX built-in functions"
msgstr ""
-#: config/i386/i386.opt:205
+#: config/i386/i386.opt:264
msgid "Support 3DNow! built-in functions"
msgstr ""
-#: config/i386/i386.opt:209
+#: config/i386/i386.opt:268
msgid "Support Athlon 3Dnow! built-in functions"
msgstr ""
-#: config/i386/i386.opt:213
+#: config/i386/i386.opt:272
msgid "Support MMX and SSE built-in functions and code generation"
msgstr ""
-#: config/i386/i386.opt:217
+#: config/i386/i386.opt:276
msgid "Support MMX, SSE and SSE2 built-in functions and code generation"
msgstr ""
-#: config/i386/i386.opt:221
+#: config/i386/i386.opt:280
msgid "Support MMX, SSE, SSE2 and SSE3 built-in functions and code generation"
msgstr ""
-#: config/i386/i386.opt:225
+#: config/i386/i386.opt:284
msgid ""
"Support MMX, SSE, SSE2, SSE3 and SSSE3 built-in functions and code generation"
msgstr ""
-#: config/i386/i386.opt:229
+#: config/i386/i386.opt:288
msgid ""
"Support MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1 built-in functions and code "
"generation"
msgstr ""
-#: config/i386/i386.opt:233 config/i386/i386.opt:237
+#: config/i386/i386.opt:292 config/i386/i386.opt:296
msgid ""
"Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and SSE4.2 built-in functions "
"and code generation"
msgstr ""
-#: config/i386/i386.opt:241
+#: config/i386/i386.opt:300
msgid "Do not support SSE4.1 and SSE4.2 built-in functions and code generation"
msgstr ""
-#: config/i386/i386.opt:245
+#: config/i386/i386.opt:304
msgid ""
"Support MMX, SSE, SSE2, SSE3 and SSE4A built-in functions and code generation"
msgstr ""
-#: config/i386/i386.opt:249
+#: config/i386/i386.opt:308
msgid "Support SSE5 built-in functions and code generation"
msgstr ""
-#: config/i386/i386.opt:255
+#: config/i386/i386.opt:312
msgid ""
"Support code generation of Advanced Bit Manipulation (ABM) instructions."
msgstr ""
-#: config/i386/i386.opt:259
-msgid "Support code generation of cmpxchg16b instruction."
+#: config/i386/i386.opt:316
+msgid "Support code generation of popcnt instruction."
msgstr ""
-#: config/i386/i386.opt:263
-msgid "Support code generation of popcnt instruction."
+#: config/i386/i386.opt:320
+msgid "Support code generation of cmpxchg16b instruction."
msgstr ""
-#: config/i386/i386.opt:267
+#: config/i386/i386.opt:324
msgid "Support code generation of sahf instruction in 64bit x86-64 code."
msgstr ""
-#: config/i386/i386.opt:271
-msgid "Generate reciprocals instead of divss and sqrtss."
+#: config/i386/i386.opt:328
+msgid "Support AES built-in functions and code generation"
msgstr ""
-#: config/i386/i386.opt:275
-msgid ""
-"Enable automatic generation of fused floating point multiply-add instructions"
+#: config/i386/i386.opt:332
+msgid "Support PCLMUL built-in functions and code generation"
msgstr ""
#: config/i386/cygming.opt:23
@@ -13226,10 +12992,6 @@ msgstr ""
msgid "Create GUI application"
msgstr ""
-#: config/i386/sco5.opt:24
-msgid "Generate ELF output"
-msgstr ""
-
#: config/rs6000/aix41.opt:24 config/rs6000/aix64.opt:32
msgid "Support message passing with the Parallel Environment"
msgstr ""
@@ -13238,11 +13000,11 @@ msgstr ""
msgid "Conform more closely to IBM XLC semantics"
msgstr ""
-#: config/rs6000/darwin.opt:24 config/rs6000/sysv4.opt:132
+#: config/rs6000/darwin.opt:24 config/rs6000/sysv4.opt:128
msgid "Generate 64-bit code"
msgstr ""
-#: config/rs6000/darwin.opt:28 config/rs6000/sysv4.opt:136
+#: config/rs6000/darwin.opt:28 config/rs6000/sysv4.opt:132
msgid "Generate 32-bit code"
msgstr ""
@@ -13504,7 +13266,7 @@ msgstr ""
#: config/rs6000/sysv4.opt:70 config/rs6000/sysv4.opt:74
#: config/rs6000/sysv4.opt:83 config/rs6000/sysv4.opt:100
-#: config/rs6000/sysv4.opt:128 config/rs6000/sysv4.opt:140
+#: config/rs6000/sysv4.opt:124 config/rs6000/sysv4.opt:136
msgid "no description yet"
msgstr ""
@@ -13544,15 +13306,11 @@ msgstr ""
msgid "Set the PPC_EMB bit in the ELF flags header"
msgstr ""
-#: config/rs6000/sysv4.opt:124
-msgid "Use the WindISS simulator"
-msgstr ""
-
-#: config/rs6000/sysv4.opt:144
+#: config/rs6000/sysv4.opt:140
msgid "Generate code to use a non-exec PLT and GOT"
msgstr ""
-#: config/rs6000/sysv4.opt:148
+#: config/rs6000/sysv4.opt:144
msgid "Generate code for old exec BSS PLT"
msgstr ""
@@ -13839,115 +13597,119 @@ msgid "Generate 32-bit offsets in switch tables"
msgstr ""
#: config/sh/sh.opt:217
-msgid "Cost to assume for a branch insn"
+msgid "Generate bit instructions"
msgstr ""
#: config/sh/sh.opt:221
-msgid "Enable cbranchdi4 pattern"
+msgid "Cost to assume for a branch insn"
msgstr ""
#: config/sh/sh.opt:225
-msgid "Expand cbranchdi4 pattern early into separate comparisons and branches."
+msgid "Enable cbranchdi4 pattern"
msgstr ""
#: config/sh/sh.opt:229
+msgid "Expand cbranchdi4 pattern early into separate comparisons and branches."
+msgstr ""
+
+#: config/sh/sh.opt:233
msgid ""
"Emit cmpeqdi_t pattern even when -mcbranchdi and -mexpand-cbranchdi are in "
"effect."
msgstr ""
-#: config/sh/sh.opt:233
+#: config/sh/sh.opt:237
msgid "Enable SH5 cut2 workaround"
msgstr ""
-#: config/sh/sh.opt:237
+#: config/sh/sh.opt:241
msgid "Align doubles at 64-bit boundaries"
msgstr ""
-#: config/sh/sh.opt:241
+#: config/sh/sh.opt:245
msgid ""
"Division strategy, one of: call, call2, fp, inv, inv:minlat, inv20u, inv20l, "
"inv:call, inv:call2, inv:fp, call-div1, call-fp, call-table"
msgstr ""
-#: config/sh/sh.opt:245
+#: config/sh/sh.opt:249
msgid "Specify name for 32 bit signed division function"
msgstr ""
-#: config/sh/sh.opt:252
+#: config/sh/sh.opt:260
msgid ""
"Enable the use of the fused floating point multiply-accumulate operation"
msgstr ""
-#: config/sh/sh.opt:256
+#: config/sh/sh.opt:264
msgid "Cost to assume for gettr insn"
msgstr ""
-#: config/sh/sh.opt:260 config/sh/sh.opt:310
+#: config/sh/sh.opt:268 config/sh/sh.opt:318
msgid "Follow Renesas (formerly Hitachi) / SuperH calling conventions"
msgstr ""
-#: config/sh/sh.opt:264
+#: config/sh/sh.opt:272
msgid "Increase the IEEE compliance for floating-point code"
msgstr ""
-#: config/sh/sh.opt:268
+#: config/sh/sh.opt:276
msgid "Enable the use of the indexed addressing mode for SHmedia32/SHcompact"
msgstr ""
-#: config/sh/sh.opt:272
+#: config/sh/sh.opt:280
msgid ""
"inline code to invalidate instruction cache entries after setting up nested "
"function trampolines"
msgstr ""
-#: config/sh/sh.opt:276
+#: config/sh/sh.opt:284
msgid "Assume symbols might be invalid"
msgstr ""
-#: config/sh/sh.opt:280
+#: config/sh/sh.opt:288
msgid "Annotate assembler instructions with estimated addresses"
msgstr ""
-#: config/sh/sh.opt:284
+#: config/sh/sh.opt:292
msgid "Generate code in little endian mode"
msgstr ""
-#: config/sh/sh.opt:288
+#: config/sh/sh.opt:296
msgid "Mark MAC register as call-clobbered"
msgstr ""
-#: config/sh/sh.opt:294
+#: config/sh/sh.opt:302
msgid "Make structs a multiple of 4 bytes (warning: ABI altered)"
msgstr ""
-#: config/sh/sh.opt:298
+#: config/sh/sh.opt:306
msgid "Emit function-calls using global offset table when generating PIC"
msgstr ""
-#: config/sh/sh.opt:302
+#: config/sh/sh.opt:310
msgid "Assume pt* instructions won't trap"
msgstr ""
-#: config/sh/sh.opt:306
+#: config/sh/sh.opt:314
msgid "Shorten address references during linking"
msgstr ""
-#: config/sh/sh.opt:314
+#: config/sh/sh.opt:322
msgid "Deprecated. Use -Os instead"
msgstr ""
-#: config/sh/sh.opt:318
+#: config/sh/sh.opt:326
msgid "Cost to assume for a multiply insn"
msgstr ""
-#: config/sh/sh.opt:322
+#: config/sh/sh.opt:330
msgid ""
"Don't generate privileged-mode only code; implies -mno-inline-ic_invalidate "
"if the inline code would not work in user mode."
msgstr ""
-#: config/sh/sh.opt:328
+#: config/sh/sh.opt:336
msgid "Pretend a branch-around-a-move is a conditional move."
msgstr ""
@@ -13959,6 +13721,10 @@ msgstr ""
msgid "Runtime name."
msgstr ""
+#: config/arm/eabi.opt:23
+msgid "Generate code for the Android operating system."
+msgstr ""
+
#: config/arm/arm.opt:23
msgid "Specify an ABI"
msgstr ""
@@ -14305,6 +14071,10 @@ msgstr ""
msgid "Intersperse literal pools with code in the text section"
msgstr ""
+#: config/xtensa/xtensa.opt:43
+msgid "Do not serialize volatile memory references with MEMW instructions"
+msgstr ""
+
#: config/stormy16/stormy16.opt:24
msgid "Provide libraries for the simulator"
msgstr ""
@@ -14448,117 +14218,123 @@ msgid "Use GP-relative addressing to access small data"
msgstr ""
#: config/mips/mips.opt:165
-msgid "Allow the use of hardware floating-point ABI and instructions"
+msgid ""
+"When generating -mabicalls code, allow executables to use PLTs and copy "
+"relocations"
msgstr ""
#: config/mips/mips.opt:169
-msgid "Generate code that can be safely linked with MIPS16 code."
+msgid "Allow the use of hardware floating-point ABI and instructions"
msgstr ""
#: config/mips/mips.opt:173
-msgid "Generate code for ISA level N"
+msgid "Generate code that can be safely linked with MIPS16 code."
msgstr ""
#: config/mips/mips.opt:177
-msgid "Generate MIPS16 code"
+msgid "Generate code for ISA level N"
msgstr ""
#: config/mips/mips.opt:181
-msgid "Use MIPS-3D instructions"
+msgid "Generate MIPS16 code"
msgstr ""
#: config/mips/mips.opt:185
-msgid "Use ll, sc and sync instructions"
+msgid "Use MIPS-3D instructions"
msgstr ""
#: config/mips/mips.opt:189
-msgid "Use -G for object-local data"
+msgid "Use ll, sc and sync instructions"
msgstr ""
#: config/mips/mips.opt:193
-msgid "Use indirect calls"
+msgid "Use -G for object-local data"
msgstr ""
#: config/mips/mips.opt:197
-msgid "Use a 32-bit long type"
+msgid "Use indirect calls"
msgstr ""
#: config/mips/mips.opt:201
-msgid "Use a 64-bit long type"
+msgid "Use a 32-bit long type"
msgstr ""
#: config/mips/mips.opt:205
-msgid "Don't optimize block moves"
+msgid "Use a 64-bit long type"
msgstr ""
#: config/mips/mips.opt:209
-msgid "Use the mips-tfile postpass"
+msgid "Don't optimize block moves"
msgstr ""
#: config/mips/mips.opt:213
-msgid "Allow the use of MT instructions"
+msgid "Use the mips-tfile postpass"
msgstr ""
#: config/mips/mips.opt:217
-msgid "Do not use a cache-flushing function before calling stack trampolines"
+msgid "Allow the use of MT instructions"
msgstr ""
#: config/mips/mips.opt:221
-msgid "Do not use MDMX instructions"
+msgid "Do not use a cache-flushing function before calling stack trampolines"
msgstr ""
#: config/mips/mips.opt:225
-msgid "Generate normal-mode code"
+msgid "Do not use MDMX instructions"
msgstr ""
#: config/mips/mips.opt:229
-msgid "Do not use MIPS-3D instructions"
+msgid "Generate normal-mode code"
msgstr ""
#: config/mips/mips.opt:233
-msgid "Use paired-single floating-point instructions"
+msgid "Do not use MIPS-3D instructions"
msgstr ""
#: config/mips/mips.opt:237
+msgid "Use paired-single floating-point instructions"
+msgstr ""
+
+#: config/mips/mips.opt:241
msgid ""
"When generating -mabicalls code, make the code suitable for use in shared "
"libraries"
msgstr ""
-#: config/mips/mips.opt:241
+#: config/mips/mips.opt:245
msgid ""
"Restrict the use of hardware floating-point instructions to 32-bit operations"
msgstr ""
-#: config/mips/mips.opt:245
+#: config/mips/mips.opt:249
msgid "Use SmartMIPS instructions"
msgstr ""
-#: config/mips/mips.opt:249
+#: config/mips/mips.opt:253
msgid "Prevent the use of all hardware floating-point instructions"
msgstr ""
-#: config/mips/mips.opt:253
+#: config/mips/mips.opt:257
msgid "Optimize lui/addiu address loads"
msgstr ""
-#: config/mips/mips.opt:257
+#: config/mips/mips.opt:261
msgid "Assume all symbols have 32-bit values"
msgstr ""
-#: config/mips/mips.opt:261
+#: config/mips/mips.opt:265
msgid "Optimize the output for PROCESSOR"
msgstr ""
-#: config/mips/mips.opt:265 config/iq2000/iq2000.opt:44
+#: config/mips/mips.opt:269 config/iq2000/iq2000.opt:44
msgid "Put uninitialized constants in ROM (needs -membedded-data)"
msgstr ""
-#: config/mips/mips.opt:269
+#: config/mips/mips.opt:273
msgid "Perform VR4130-specific alignment optimizations"
msgstr ""
-#: config/mips/mips.opt:273
+#: config/mips/mips.opt:277
msgid "Lift restrictions on GOT size"
msgstr ""
@@ -14722,14 +14498,6 @@ msgstr ""
msgid "Warn when a stackframe is larger than the specified size"
msgstr ""
-#: config/cris/aout.opt:27
-msgid "Compile for the MMU-less Etrax 100-based elinux system"
-msgstr ""
-
-#: config/cris/aout.opt:33
-msgid "For elinux, request a specified stack-size for this program"
-msgstr ""
-
#: config/h8300/h8300.opt:23
msgid "Generate H8S code"
msgstr ""
@@ -14908,7 +14676,7 @@ msgstr ""
msgid "Set start-address of data"
msgstr ""
-#: config/iq2000/iq2000.opt:23 config/mt/mt.opt:55
+#: config/iq2000/iq2000.opt:23
msgid "Specify CPU for code generation purposes"
msgstr ""
@@ -14961,17 +14729,20 @@ msgstr ""
msgid "Do stack checking using bounds in L1 scratch memory"
msgstr ""
-#: config/mt/mt.opt:23
-msgid "Use byte loads and stores when generating code."
+#: config/bfin/bfin.opt:85
+msgid "Enable multicore support"
+msgstr ""
+
+#: config/bfin/bfin.opt:89
+msgid "Build for Core A"
msgstr ""
-#: config/mt/mt.opt:31
-msgid "Do not include crt0.o in the startup files"
+#: config/bfin/bfin.opt:93
+msgid "Build for Core B"
msgstr ""
-#: config/mt/mt.opt:35 config/mt/mt.opt:39 config/mt/mt.opt:43
-#: config/mt/mt.opt:47 config/mt/mt.opt:51
-msgid "Internal debug switch"
+#: config/bfin/bfin.opt:97
+msgid "Build for SDRAM"
msgstr ""
#: config/vxworks.opt:24
@@ -15086,7 +14857,7 @@ msgstr ""
msgid "Print the name of header files as they are used"
msgstr ""
-#: c.opt:68 c.opt:863
+#: c.opt:68 c.opt:866
msgid "Add <dir> to the end of the main include path"
msgstr ""
@@ -15150,88 +14921,86 @@ msgstr ""
#: c.opt:128
msgid ""
-"Warn if a comparison is always true or always false due to the limited range "
-"of the data type"
-msgstr ""
-
-#: c.opt:132
-msgid ""
"Warn whenever an Objective-C assignment is being intercepted by the garbage "
"collector"
msgstr ""
-#: c.opt:136
+#: c.opt:132
msgid "Warn about casting functions to incompatible types"
msgstr ""
-#: c.opt:140
+#: c.opt:136
msgid "Warn about C constructs that are not in the common subset of C and C++"
msgstr ""
-#: c.opt:144
+#: c.opt:140
msgid ""
"Warn about C++ constructs whose meaning differs between ISO C++ 1998 and ISO "
"C++ 200x"
msgstr ""
-#: c.opt:148
+#: c.opt:144
msgid "Warn about casts which discard qualifiers"
msgstr ""
-#: c.opt:152
+#: c.opt:148
msgid "Warn about subscripts whose type is \"char\""
msgstr ""
-#: c.opt:156
+#: c.opt:152
msgid "Warn about variables that might be changed by \"longjmp\" or \"vfork\""
msgstr ""
-#: c.opt:160
+#: c.opt:156
msgid ""
"Warn about possibly nested block comments, and C++ comments spanning more "
"than one physical line"
msgstr ""
-#: c.opt:164
+#: c.opt:160
msgid "Synonym for -Wcomment"
msgstr ""
-#: c.opt:168
+#: c.opt:164
msgid "Warn for implicit type conversions that may change a value"
msgstr ""
-#: c.opt:172
+#: c.opt:168
msgid "Warn for implicit type conversions between signed and unsigned integers"
msgstr ""
-#: c.opt:176
+#: c.opt:172
msgid "Warn when all constructors and destructors are private"
msgstr ""
-#: c.opt:180
+#: c.opt:176
msgid "Warn when a declaration is found after a statement"
msgstr ""
-#: c.opt:184
+#: c.opt:180
msgid "Warn about deprecated compiler features"
msgstr ""
-#: c.opt:188
+#: c.opt:184
msgid "Warn about compile-time integer division by zero"
msgstr ""
-#: c.opt:192
+#: c.opt:188
msgid "Warn about violations of Effective C++ style rules"
msgstr ""
-#: c.opt:196
+#: c.opt:192
msgid "Warn about an empty body in an if or else statement"
msgstr ""
-#: c.opt:200
+#: c.opt:196
msgid "Warn about stray tokens after #elif and #endif"
msgstr ""
+#: c.opt:200
+msgid "Warn about comparison of different enum types"
+msgstr ""
+
#: c.opt:208
msgid ""
"This switch is deprecated; use -Werror=implicit-function-declaration instead"
@@ -15285,555 +15054,555 @@ msgstr ""
msgid "Warn when a declaration does not specify a type"
msgstr ""
-#: c.opt:266
-msgid "Deprecated. This switch has no effect"
-msgstr ""
-
-#: c.opt:270
+#: c.opt:269
msgid ""
"Warn when there is a cast to a pointer from an integer of a different size"
msgstr ""
-#: c.opt:274
+#: c.opt:273
msgid "Warn about invalid uses of the \"offsetof\" macro"
msgstr ""
-#: c.opt:278
+#: c.opt:277
msgid "Warn about PCH files that are found but not used"
msgstr ""
-#: c.opt:282
+#: c.opt:281
msgid "Do not warn about using \"long long\" when -pedantic"
msgstr ""
-#: c.opt:286
+#: c.opt:285
msgid "Warn about suspicious declarations of \"main\""
msgstr ""
-#: c.opt:290
+#: c.opt:289
msgid "Warn about possibly missing braces around initializers"
msgstr ""
-#: c.opt:294
+#: c.opt:293
msgid "Warn about global functions without previous declarations"
msgstr ""
-#: c.opt:298
+#: c.opt:297
msgid "Warn about missing fields in struct initializers"
msgstr ""
-#: c.opt:302
+#: c.opt:301
msgid "Warn about functions which might be candidates for format attributes"
msgstr ""
-#: c.opt:306
+#: c.opt:305
msgid "Warn about user-specified include directories that do not exist"
msgstr ""
-#: c.opt:310
+#: c.opt:309
msgid ""
"Warn about function parameters declared without a type specifier in K&R-"
"style functions"
msgstr ""
-#: c.opt:314
+#: c.opt:313
msgid "Warn about global functions without prototypes"
msgstr ""
-#: c.opt:318
+#: c.opt:317
msgid "Warn about use of multi-character character constants"
msgstr ""
-#: c.opt:322
+#: c.opt:321
msgid "Warn about \"extern\" declarations not at file scope"
msgstr ""
-#: c.opt:326
+#: c.opt:325
msgid ""
"Warn when non-templatized friend functions are declared within a template"
msgstr ""
-#: c.opt:330
+#: c.opt:329
msgid "Warn about non-virtual destructors"
msgstr ""
-#: c.opt:334
+#: c.opt:333
msgid ""
"Warn about NULL being passed to argument slots marked as requiring non-NULL"
msgstr ""
-#: c.opt:338
+#: c.opt:337
msgid "Warn about non-normalised Unicode strings"
msgstr ""
-#: c.opt:342
+#: c.opt:341
msgid "Warn if a C-style cast is used in a program"
msgstr ""
-#: c.opt:346
+#: c.opt:345
msgid "Warn for obsolescent usage in a declaration"
msgstr ""
-#: c.opt:350
+#: c.opt:349
msgid "Warn if an old-style parameter definition is used"
msgstr ""
-#: c.opt:354
+#: c.opt:353
msgid ""
"Warn if a string is longer than the maximum portable length specified by the "
"standard"
msgstr ""
-#: c.opt:358
+#: c.opt:357
msgid "Warn about overloaded virtual function names"
msgstr ""
-#: c.opt:362
+#: c.opt:361
msgid "Warn about overriding initializers without side effects"
msgstr ""
-#: c.opt:366
+#: c.opt:365
msgid "Warn about possibly missing parentheses"
msgstr ""
-#: c.opt:370
+#: c.opt:369
msgid "Warn when converting the type of pointers to member functions"
msgstr ""
-#: c.opt:374
+#: c.opt:373
msgid "Warn about function pointer arithmetic"
msgstr ""
-#: c.opt:378
+#: c.opt:377
msgid "Warn when a pointer is cast to an integer of a different size"
msgstr ""
-#: c.opt:382
+#: c.opt:381
msgid "Warn about misuses of pragmas"
msgstr ""
-#: c.opt:386
+#: c.opt:385
msgid "Warn if inherited methods are unimplemented"
msgstr ""
-#: c.opt:390
+#: c.opt:389
msgid "Warn about multiple declarations of the same object"
msgstr ""
-#: c.opt:394
+#: c.opt:393
msgid "Warn when the compiler reorders code"
msgstr ""
-#: c.opt:398
+#: c.opt:397
msgid ""
"Warn whenever a function's return type defaults to \"int\" (C), or about "
"inconsistent return types (C++)"
msgstr ""
-#: c.opt:402
+#: c.opt:401
msgid "Warn if a selector has multiple methods"
msgstr ""
-#: c.opt:406
+#: c.opt:405
msgid "Warn about possible violations of sequence point rules"
msgstr ""
-#: c.opt:410
+#: c.opt:409
msgid "Warn about signed-unsigned comparisons"
msgstr ""
-#: c.opt:414
+#: c.opt:413
msgid "Warn when overload promotes from unsigned to signed"
msgstr ""
-#: c.opt:418
+#: c.opt:417
msgid "Warn about uncasted NULL used as sentinel"
msgstr ""
-#: c.opt:422
+#: c.opt:421
msgid "Warn about unprototyped function declarations"
msgstr ""
-#: c.opt:426
+#: c.opt:425
msgid "Warn if type signatures of candidate methods do not match exactly"
msgstr ""
-#: c.opt:430
-msgid "Warn when synthesis behavior differs from Cfront"
+#: c.opt:429
+msgid "Deprecated. This switch has no effect"
msgstr ""
-#: c.opt:434 common.opt:183
+#: c.opt:433 common.opt:198
msgid "Do not suppress warnings from system headers"
msgstr ""
-#: c.opt:438
+#: c.opt:437
msgid "Warn about features not present in traditional C"
msgstr ""
-#: c.opt:442
+#: c.opt:441
msgid ""
"Warn of prototypes causing type conversions different from what would happen "
"in the absence of prototype"
msgstr ""
-#: c.opt:446
+#: c.opt:445
msgid ""
"Warn if trigraphs are encountered that might affect the meaning of the "
"program"
msgstr ""
-#: c.opt:450
+#: c.opt:449
msgid "Warn about @selector()s without previously declared methods"
msgstr ""
-#: c.opt:454
+#: c.opt:453
msgid "Warn if an undefined macro is used in an #if directive"
msgstr ""
-#: c.opt:458
+#: c.opt:457
msgid "Warn about unrecognized pragmas"
msgstr ""
-#: c.opt:462
+#: c.opt:461
msgid "Warn about macros defined in the main file that are not used"
msgstr ""
-#: c.opt:466
+#: c.opt:465
msgid "Do not warn about using variadic macros when -pedantic"
msgstr ""
-#: c.opt:470
+#: c.opt:469
msgid "Warn if a variable length array is used"
msgstr ""
-#: c.opt:474
+#: c.opt:473
+msgid "Warn when a register variable is declared volatile"
+msgstr ""
+
+#: c.opt:477
msgid ""
"In C++, nonzero means warn about deprecated conversion from string literals "
"to `char *'. In C, similar warning, except that the conversion is of course "
"not deprecated by the ISO C standard."
msgstr ""
-#: c.opt:478
+#: c.opt:481
msgid "Warn when a pointer differs in signedness in an assignment"
msgstr ""
-#: c.opt:482
+#: c.opt:485
msgid "A synonym for -std=c89 (for C) or -std=c++98 (for C++)"
msgstr ""
-#: c.opt:490
+#: c.opt:493
msgid "Enforce class member access control semantics"
msgstr ""
-#: c.opt:497
+#: c.opt:500
msgid "Change when template instances are emitted"
msgstr ""
-#: c.opt:501
+#: c.opt:504
msgid "Recognize the \"asm\" keyword"
msgstr ""
-#: c.opt:505
+#: c.opt:508
msgid "Recognize built-in functions"
msgstr ""
-#: c.opt:512
+#: c.opt:515
msgid "Check the return value of new"
msgstr ""
-#: c.opt:516
+#: c.opt:519
msgid "Allow the arguments of the '?' operator to have different types"
msgstr ""
-#: c.opt:520
+#: c.opt:523
msgid "Reduce the size of object files"
msgstr ""
-#: c.opt:524
+#: c.opt:527
msgid "Use class <name> for constant strings"
msgstr ""
-#: c.opt:528
+#: c.opt:531
msgid "Inline member functions by default"
msgstr ""
-#: c.opt:532
+#: c.opt:535
msgid "Preprocess directives only."
msgstr ""
-#: c.opt:536
+#: c.opt:539
msgid "Permit '$' as an identifier character"
msgstr ""
-#: c.opt:543
+#: c.opt:546
msgid "Generate code to check exception specifications"
msgstr ""
-#: c.opt:550
+#: c.opt:553
msgid "Convert all strings and character constants to character set <cset>"
msgstr ""
-#: c.opt:554
+#: c.opt:557
msgid "Permit universal character names (\\u and \\U) in identifiers"
msgstr ""
-#: c.opt:558
+#: c.opt:561
msgid "Specify the default character set for source files"
msgstr ""
-#: c.opt:566
+#: c.opt:569
msgid "Scope of for-init-statement variables is local to the loop"
msgstr ""
-#: c.opt:570
+#: c.opt:573
msgid "Do not assume that standard C libraries and \"main\" exist"
msgstr ""
-#: c.opt:574
+#: c.opt:577
msgid "Recognize GNU-defined keywords"
msgstr ""
-#: c.opt:578
+#: c.opt:581
msgid "Generate code for GNU runtime environment"
msgstr ""
-#: c.opt:582
+#: c.opt:585
msgid "Use traditional GNU semantics for inline functions"
msgstr ""
-#: c.opt:595
+#: c.opt:598
msgid "Assume normal C execution environment"
msgstr ""
-#: c.opt:599
+#: c.opt:602
msgid "Enable support for huge objects"
msgstr ""
-#: c.opt:603
+#: c.opt:606
msgid "Export functions even if they can be inlined"
msgstr ""
-#: c.opt:607
+#: c.opt:610
msgid "Emit implicit instantiations of inline templates"
msgstr ""
-#: c.opt:611
+#: c.opt:614
msgid "Emit implicit instantiations of templates"
msgstr ""
-#: c.opt:615
+#: c.opt:618
msgid "Inject friend functions into enclosing namespace"
msgstr ""
-#: c.opt:622
+#: c.opt:625
msgid ""
"Allow implicit conversions between vectors with differing numbers of "
"subparts and/or differing element types."
msgstr ""
-#: c.opt:626
+#: c.opt:629
msgid "Don't warn about uses of Microsoft extensions"
msgstr ""
-#: c.opt:636
+#: c.opt:639
msgid "Generate code for NeXT (Apple Mac OS X) runtime environment"
msgstr ""
-#: c.opt:640
+#: c.opt:643
msgid "Assume that receivers of Objective-C messages may be nil"
msgstr ""
-#: c.opt:652
+#: c.opt:655
msgid ""
"Generate special Objective-C methods to initialize/destroy non-POD C++ "
"ivars, if needed"
msgstr ""
-#: c.opt:656
+#: c.opt:659
msgid "Allow fast jumps to the message dispatcher"
msgstr ""
-#: c.opt:662
+#: c.opt:665
msgid "Enable Objective-C exception and synchronization syntax"
msgstr ""
-#: c.opt:666
+#: c.opt:669
msgid "Enable garbage collection (GC) in Objective-C/Objective-C++ programs"
msgstr ""
-#: c.opt:671
+#: c.opt:674
msgid "Enable Objective-C setjmp exception handling runtime"
msgstr ""
-#: c.opt:675
+#: c.opt:678
msgid "Enable OpenMP"
msgstr ""
-#: c.opt:679
-msgid "Recognize C++ kewords like \"compl\" and \"xor\""
+#: c.opt:682
+msgid "Recognize C++ keywords like \"compl\" and \"xor\""
msgstr ""
-#: c.opt:683
+#: c.opt:686
msgid "Enable optional diagnostics"
msgstr ""
-#: c.opt:690
+#: c.opt:693
msgid "Look for and use PCH files even when preprocessing"
msgstr ""
-#: c.opt:694
+#: c.opt:697
msgid "Downgrade conformance errors to warnings"
msgstr ""
-#: c.opt:698
+#: c.opt:701
msgid "Treat the input file as already preprocessed"
msgstr ""
-#: c.opt:702
+#: c.opt:705
msgid ""
"Used in Fix-and-Continue mode to indicate that object files may be swapped "
"in at runtime"
msgstr ""
-#: c.opt:706
+#: c.opt:709
msgid "Enable automatic template instantiation"
msgstr ""
-#: c.opt:710
+#: c.opt:713
msgid "Generate run time type descriptor information"
msgstr ""
-#: c.opt:714
+#: c.opt:717
msgid "Use the same size for double as for float"
msgstr ""
-#: c.opt:722
+#: c.opt:725
msgid "Force the underlying type for \"wchar_t\" to be \"unsigned short\""
msgstr ""
-#: c.opt:726
+#: c.opt:729
msgid "When \"signed\" or \"unsigned\" is not given make the bitfield signed"
msgstr ""
-#: c.opt:730
+#: c.opt:733
msgid "Make \"char\" signed by default"
msgstr ""
-#: c.opt:737
+#: c.opt:740
msgid "Display statistics accumulated during compilation"
msgstr ""
-#: c.opt:744
+#: c.opt:747
msgid "Distance between tab stops for column reporting"
msgstr ""
-#: c.opt:748
+#: c.opt:751
msgid "Specify maximum template instantiation depth"
msgstr ""
-#: c.opt:755
+#: c.opt:758
msgid "Do not generate thread-safe code for initializing local statics"
msgstr ""
-#: c.opt:759
+#: c.opt:762
msgid "When \"signed\" or \"unsigned\" is not given make the bitfield unsigned"
msgstr ""
-#: c.opt:763
+#: c.opt:766
msgid "Make \"char\" unsigned by default"
msgstr ""
-#: c.opt:767
+#: c.opt:770
msgid "Use __cxa_atexit to register destructors"
msgstr ""
-#: c.opt:771
+#: c.opt:774
msgid "Use __cxa_get_exception_ptr in exception handling"
msgstr ""
-#: c.opt:775
+#: c.opt:778
msgid "Marks all inlined methods as having hidden visibility"
msgstr ""
-#: c.opt:779
+#: c.opt:782
msgid "Changes visibility to match Microsoft Visual Studio by default"
msgstr ""
-#: c.opt:783
+#: c.opt:786
msgid "Discard unused virtual functions"
msgstr ""
-#: c.opt:787
+#: c.opt:790
msgid "Implement vtables using thunks"
msgstr ""
-#: c.opt:791
+#: c.opt:794
msgid "Emit common-like symbols as weak symbols"
msgstr ""
-#: c.opt:795
+#: c.opt:798
msgid ""
"Convert all wide strings and character constants to character set <cset>"
msgstr ""
-#: c.opt:799
+#: c.opt:802
msgid "Generate a #line directive pointing at the current working directory"
msgstr ""
-#: c.opt:803
+#: c.opt:806
msgid "Emit cross referencing information"
msgstr ""
-#: c.opt:807
+#: c.opt:810
msgid ""
"Generate lazy class lookup (via objc_getClass()) for use in Zero-Link mode"
msgstr ""
-#: c.opt:811
+#: c.opt:814
msgid "Dump declarations to a .decl file"
msgstr ""
-#: c.opt:815
+#: c.opt:818
msgid "Aggressive reduced debug info for structs"
msgstr ""
-#: c.opt:819
+#: c.opt:822
msgid "Conservative reduced debug info for structs"
msgstr ""
-#: c.opt:823
+#: c.opt:826
msgid "Detailed reduced debug info for structs"
msgstr ""
-#: c.opt:827 c.opt:859
+#: c.opt:830 c.opt:862
msgid "Add <dir> to the end of the system include path"
msgstr ""
-#: c.opt:831
+#: c.opt:834
msgid "Accept definition of macros in <file>"
msgstr ""
-#: c.opt:835
+#: c.opt:838
msgid "-imultilib <dir> Set <dir> to be the multilib include subdirectory"
msgstr ""
-#: c.opt:839
+#: c.opt:842
msgid "Include the contents of <file> before other files"
msgstr ""
-#: c.opt:843
+#: c.opt:846
msgid "Specify <path> as a prefix for next two options"
msgstr ""
-#: c.opt:847
+#: c.opt:850
msgid "Set <dir> to be the system root directory"
msgstr ""
-#: c.opt:851
+#: c.opt:854
msgid "Add <dir> to the start of the system include path"
msgstr ""
-#: c.opt:855
+#: c.opt:858
msgid "Add <dir> to the end of the quote include path"
msgstr ""
@@ -15986,1117 +15755,1203 @@ msgid "Warn when an optimization pass is disabled"
msgstr ""
#: common.opt:99
-msgid "Treat all warnings as errors"
+msgid "Warn on calls to these functions"
msgstr ""
#: common.opt:103
-msgid "Treat specified warning as error"
+msgid "Treat all warnings as errors"
msgstr ""
#: common.opt:107
-msgid "Print extra (possibly unwanted) warnings"
+msgid "Treat specified warning as error"
msgstr ""
#: common.opt:111
-msgid "Exit on the first error occurred"
+msgid "Print extra (possibly unwanted) warnings"
msgstr ""
#: common.opt:115
-msgid "Warn when an inlined function cannot be inlined"
+msgid "Exit on the first error occurred"
msgstr ""
#: common.opt:119
-msgid "Warn if an object is larger than <number> bytes"
+msgid ""
+"-Wframe-larger-than=<number> Warn if a function's stack frame requires more "
+"than <number> bytes"
msgstr ""
#: common.opt:123
+msgid "Warn when an inlined function cannot be inlined"
+msgstr ""
+
+#: common.opt:130
+msgid "Warn if an object is larger than <number> bytes"
+msgstr ""
+
+#: common.opt:134
msgid ""
"Warn when a logical operator is suspicously always evaluating to true or "
"false"
msgstr ""
-#: common.opt:127
+#: common.opt:138
msgid "Warn if the loop cannot be optimized due to nontrivial assumptions."
msgstr ""
-#: common.opt:131
+#: common.opt:142
msgid ""
"Warn about functions which might be candidates for __attribute__((noreturn))"
msgstr ""
-#: common.opt:135
+#: common.opt:146
+msgid "Warn about constructs not instrumented by -fmudflap"
+msgstr ""
+
+#: common.opt:150
msgid "Warn about overflow in arithmetic expressions"
msgstr ""
-#: common.opt:139
+#: common.opt:154
msgid "Warn when the packed attribute has no effect on struct layout"
msgstr ""
-#: common.opt:143
+#: common.opt:158
msgid "Warn when padding is required to align structure members"
msgstr ""
-#: common.opt:147
+#: common.opt:162
msgid "Warn when one local variable shadows another"
msgstr ""
-#: common.opt:151
+#: common.opt:166
msgid "Warn when not issuing stack smashing protection for some reason"
msgstr ""
-#: common.opt:155 common.opt:159
+#: common.opt:170 common.opt:174
msgid "Warn about code which might break strict aliasing rules"
msgstr ""
-#: common.opt:163 common.opt:167
+#: common.opt:178 common.opt:182
msgid "Warn about optimizations that assume that signed overflow is undefined"
msgstr ""
-#: common.opt:171
+#: common.opt:186
msgid "Warn about enumerated switches, with no default, missing a case"
msgstr ""
-#: common.opt:175
+#: common.opt:190
msgid "Warn about enumerated switches missing a \"default:\" statement"
msgstr ""
-#: common.opt:179
+#: common.opt:194
msgid "Warn about all enumerated switches missing a specific case"
msgstr ""
-#: common.opt:187
+#: common.opt:202
+msgid ""
+"Warn if a comparison is always true or always false due to the limited range "
+"of the data type"
+msgstr ""
+
+#: common.opt:206
msgid "Warn about uninitialized automatic variables"
msgstr ""
-#: common.opt:191
+#: common.opt:210
msgid "Warn about code that will never be executed"
msgstr ""
-#: common.opt:195
+#: common.opt:214
msgid "Enable all -Wunused- warnings"
msgstr ""
-#: common.opt:199
+#: common.opt:218
msgid "Warn when a function is unused"
msgstr ""
-#: common.opt:203
+#: common.opt:222
msgid "Warn when a label is unused"
msgstr ""
-#: common.opt:207
+#: common.opt:226
msgid "Warn when a function parameter is unused"
msgstr ""
-#: common.opt:211
+#: common.opt:230
msgid "Warn when an expression value is unused"
msgstr ""
-#: common.opt:215
+#: common.opt:234
msgid "Warn when a variable is unused"
msgstr ""
-#: common.opt:219
-msgid "Warn when a register variable is declared volatile"
-msgstr ""
-
-#: common.opt:223
+#: common.opt:238
msgid "Warn instead of error in case profiles in -fprofile-use do not match"
msgstr ""
-#: common.opt:227
+#: common.opt:242
msgid "Emit declaration information into <file>"
msgstr ""
-#: common.opt:240
+#: common.opt:255
msgid "Enable dumps from specific passes of the compiler"
msgstr ""
-#: common.opt:244
+#: common.opt:259
msgid "Set the file basename to be used for dumps"
msgstr ""
-#: common.opt:264
+#: common.opt:279
msgid "Align the start of functions"
msgstr ""
-#: common.opt:271
+#: common.opt:286
msgid "Align labels which are only reached by jumping"
msgstr ""
-#: common.opt:278
+#: common.opt:293
msgid "Align all labels"
msgstr ""
-#: common.opt:285
+#: common.opt:300
msgid "Align the start of loops"
msgstr ""
-#: common.opt:300
+#: common.opt:315
msgid "Specify that arguments may alias each other and globals"
msgstr ""
-#: common.opt:304
+#: common.opt:319
msgid "Assume arguments may alias globals but not each other"
msgstr ""
-#: common.opt:308
+#: common.opt:323
msgid "Assume arguments alias neither each other nor globals"
msgstr ""
-#: common.opt:312
+#: common.opt:327
msgid "Assume arguments alias no other storage"
msgstr ""
-#: common.opt:316
+#: common.opt:331
msgid "Generate unwind tables that are exact at each instruction boundary"
msgstr ""
-#: common.opt:320
+#: common.opt:335
msgid "Generate auto-inc/dec instructions"
msgstr ""
-#: common.opt:328
+#: common.opt:343
msgid "Generate code to check bounds before indexing arrays"
msgstr ""
-#: common.opt:332
+#: common.opt:347
msgid "Replace add, compare, branch with branch on count register"
msgstr ""
-#: common.opt:336
+#: common.opt:351
msgid "Use profiling information for branch probabilities"
msgstr ""
-#: common.opt:340
+#: common.opt:355
msgid ""
"Perform branch target load optimization before prologue / epilogue threading"
msgstr ""
-#: common.opt:344
+#: common.opt:359
msgid ""
"Perform branch target load optimization after prologue / epilogue threading"
msgstr ""
-#: common.opt:348
+#: common.opt:363
msgid ""
"Restrict target load migration not to re-use registers in any basic block"
msgstr ""
-#: common.opt:352
+#: common.opt:367
msgid "Mark <register> as being preserved across functions"
msgstr ""
-#: common.opt:356
+#: common.opt:371
msgid "Mark <register> as being corrupted by function calls"
msgstr ""
-#: common.opt:363
+#: common.opt:378
msgid "Save registers around function calls"
msgstr ""
-#: common.opt:367
+#: common.opt:382
msgid "Compare the results of several data dependence analyzers."
msgstr ""
-#: common.opt:371
+#: common.opt:386
msgid "Do not put uninitialized globals in the common section"
msgstr ""
-#: common.opt:375
+#: common.opt:390
msgid "Perform a register copy-propagation optimization pass"
msgstr ""
-#: common.opt:379
+#: common.opt:394
msgid "Perform cross-jumping optimization"
msgstr ""
-#: common.opt:383
+#: common.opt:398
msgid "When running CSE, follow jumps to their targets"
msgstr ""
-#: common.opt:387
+#: common.opt:402
msgid "When running CSE, follow conditional jumps"
msgstr ""
-#: common.opt:391
+#: common.opt:406
msgid "Omit range reduction step when performing complex division"
msgstr ""
-#: common.opt:395
+#: common.opt:410
+msgid "Complex multiplication and division follow Fortran rules"
+msgstr ""
+
+#: common.opt:414
msgid "Place data items into their own section"
msgstr ""
-#: common.opt:399
+#: common.opt:418
msgid "List all available debugging counters with their limits and counts."
msgstr ""
-#: common.opt:403
+#: common.opt:422
msgid ""
"-fdbg-cnt=<counter>:<limit>[,<counter>:<limit>,...] Set the debug counter "
"limit. "
msgstr ""
-#: common.opt:407
+#: common.opt:426
msgid "Map one directory name to another in debug information"
msgstr ""
-#: common.opt:413
+#: common.opt:432
msgid "Defer popping functions args from stack until later"
msgstr ""
-#: common.opt:417
+#: common.opt:436
msgid "Attempt to fill delay slots of branch instructions"
msgstr ""
-#: common.opt:421
+#: common.opt:440
msgid "Delete useless null pointer checks"
msgstr ""
-#: common.opt:425
+#: common.opt:444
msgid ""
"How often to emit source location at the beginning of line-wrapped "
"diagnostics"
msgstr ""
-#: common.opt:429
+#: common.opt:448
msgid ""
"Amend appropriate diagnostic messages with the command line option that "
"controls them"
msgstr ""
-#: common.opt:433
+#: common.opt:452
msgid "Dump various compiler internals to a file"
msgstr ""
-#: common.opt:437
+#: common.opt:456
msgid "Suppress output of addresses in debugging dumps"
msgstr ""
-#: common.opt:441
+#: common.opt:460
msgid ""
"Suppress output of instruction numbers, line number notes and addresses in "
"debugging dumps"
msgstr ""
-#: common.opt:445
+#: common.opt:464
+msgid "Enable CFI tables via GAS assembler directives."
+msgstr ""
+
+#: common.opt:468
msgid "Perform early inlining"
msgstr ""
-#: common.opt:449
+#: common.opt:472
msgid "Perform DWARF2 duplicate elimination"
msgstr ""
-#: common.opt:453 common.opt:457
+#: common.opt:476 common.opt:480
msgid "Perform unused type elimination in debug info"
msgstr ""
-#: common.opt:461
+#: common.opt:484
msgid "Do not suppress C++ class debug information."
msgstr ""
-#: common.opt:465
+#: common.opt:488
msgid "Enable exception handling"
msgstr ""
-#: common.opt:469
+#: common.opt:492
msgid "Perform a number of minor, expensive optimizations"
msgstr ""
-#: common.opt:476
+#: common.opt:499
msgid "Assume no NaNs or infinities are generated"
msgstr ""
-#: common.opt:480
+#: common.opt:503
msgid "Mark <register> as being unavailable to the compiler"
msgstr ""
-#: common.opt:484
+#: common.opt:507
msgid "Don't allocate floats and doubles in extended-precision registers"
msgstr ""
-#: common.opt:488 common.opt:647 common.opt:855 common.opt:986 common.opt:1061
+#: common.opt:511 common.opt:702 common.opt:923 common.opt:1056
+#: common.opt:1131 common.opt:1191
msgid "Does nothing. Preserved for backward compatibility."
msgstr ""
-#: common.opt:492
+#: common.opt:515
msgid "Perform a forward propagation pass on RTL"
msgstr ""
-#: common.opt:499
+#: common.opt:522
msgid "Allow function addresses to be held in registers"
msgstr ""
-#: common.opt:503
+#: common.opt:526
msgid "Place each function into its own section"
msgstr ""
-#: common.opt:507
+#: common.opt:530
msgid "Perform global common subexpression elimination"
msgstr ""
-#: common.opt:511
+#: common.opt:534
msgid ""
"Perform enhanced load motion during global common subexpression elimination"
msgstr ""
-#: common.opt:515
+#: common.opt:538
msgid "Perform store motion after global common subexpression elimination"
msgstr ""
-#: common.opt:519
+#: common.opt:542
msgid ""
"Perform redundant load after store elimination in global common subexpression"
msgstr ""
-#: common.opt:524
+#: common.opt:547
msgid ""
"Perform global common subexpression elimination after register allocation"
msgstr ""
-#: common.opt:529
+#: common.opt:552
msgid "Enable guessing of branch probabilities"
msgstr ""
-#: common.opt:537
+#: common.opt:560
msgid "Process #ident directives"
msgstr ""
-#: common.opt:541
+#: common.opt:564
msgid "Perform conversion of conditional jumps to branchless equivalents"
msgstr ""
-#: common.opt:545
+#: common.opt:568
msgid "Perform conversion of conditional jumps to conditional execution"
msgstr ""
-#: common.opt:553
+#: common.opt:576
msgid "Do not generate .size directives"
msgstr ""
-#: common.opt:562
+#: common.opt:580
+msgid "Perform indirect inlining"
+msgstr ""
+
+#: common.opt:589
msgid "Pay attention to the \"inline\" keyword"
msgstr ""
-#: common.opt:566
+#: common.opt:593
msgid ""
"Integrate simple functions into their callers when code size is known to not "
"growth"
msgstr ""
-#: common.opt:570
+#: common.opt:597
msgid "Integrate simple functions into their callers"
msgstr ""
-#: common.opt:574
+#: common.opt:601
msgid "Integrate functions called once into their callers"
msgstr ""
-#: common.opt:581
+#: common.opt:608
msgid "Limit the size of inlined functions to <number>"
msgstr ""
-#: common.opt:585
+#: common.opt:612
msgid "Instrument function entry and exit with profiling calls"
msgstr ""
-#: common.opt:589
+#: common.opt:616
msgid ""
"-finstrument-functions-exclude-function-list=name,... Do not instrument "
"listed functions"
msgstr ""
-#: common.opt:593
+#: common.opt:620
msgid ""
"-finstrument-functions-exclude-file-list=filename,... Do not instrument "
"functions listed in files"
msgstr ""
-#: common.opt:597
+#: common.opt:624
msgid "Perform Interprocedural constant propagation"
msgstr ""
-#: common.opt:601
+#: common.opt:628
+msgid "Perform cloning to make Interprocedural constant propagation stronger"
+msgstr ""
+
+#: common.opt:632
msgid "Discover pure and const functions"
msgstr ""
-#: common.opt:605
+#: common.opt:636
msgid "Perform interprocedural points-to analysis"
msgstr ""
-#: common.opt:609
+#: common.opt:640
msgid "Discover readonly and non addressable static variables"
msgstr ""
-#: common.opt:613
+#: common.opt:644
msgid "Type based escape and alias analysis"
msgstr ""
-#: common.opt:617
+#: common.opt:648
msgid "Perform matrix layout flattening and transposing based"
msgstr ""
-#: common.opt:622
+#: common.opt:653
msgid "Perform structure layout optimizations based"
msgstr ""
-#: common.opt:627
+#: common.opt:658
+msgid "Use integrated register allocator."
+msgstr ""
+
+#: common.opt:662
+msgid "-fira-algorithm=[regional|CB|mixed] Set the used IRA algorithm"
+msgstr ""
+
+#: common.opt:666
+msgid "Do optimistic coalescing."
+msgstr ""
+
+#: common.opt:670
+msgid "Share slots for saving different hard registers."
+msgstr ""
+
+#: common.opt:674
+msgid "Share stack slots for spilled pseudo-registers."
+msgstr ""
+
+#: common.opt:678
+msgid "-fira-verbose=<number> Control IRA's level of diagnostic messages."
+msgstr ""
+
+#: common.opt:682
msgid "Optimize induction variables on trees"
msgstr ""
-#: common.opt:631
+#: common.opt:686
msgid "Use jump tables for sufficiently large switch statements"
msgstr ""
-#: common.opt:635
+#: common.opt:690
msgid "Generate code for functions even if they are fully inlined"
msgstr ""
-#: common.opt:639
+#: common.opt:694
msgid "Emit static const variables even if they are not used"
msgstr ""
-#: common.opt:643
+#: common.opt:698
msgid "Give external symbols a leading underscore"
msgstr ""
-#: common.opt:651
+#: common.opt:706
msgid "Set errno after built-in math functions"
msgstr ""
-#: common.opt:655
+#: common.opt:710
msgid "Report on permanent memory allocation"
msgstr ""
-#: common.opt:662
+#: common.opt:717
msgid "Attempt to merge identical constants and constant variables"
msgstr ""
-#: common.opt:666
+#: common.opt:721
msgid "Attempt to merge identical constants across compilation units"
msgstr ""
-#: common.opt:670
+#: common.opt:725
msgid "Attempt to merge identical debug strings across compilation units"
msgstr ""
-#: common.opt:674
+#: common.opt:729
msgid ""
"Limit diagnostics to <number> characters per line. 0 suppresses line-"
"wrapping"
msgstr ""
-#: common.opt:678
+#: common.opt:733
msgid "Perform SMS based modulo scheduling before the first scheduling pass"
msgstr ""
-#: common.opt:682
+#: common.opt:737
msgid "Perform SMS based modulo scheduling with register moves allowed"
msgstr ""
-#: common.opt:686
+#: common.opt:741
msgid "Move loop invariant computations out of loops"
msgstr ""
-#: common.opt:690
+#: common.opt:745
msgid "Add mudflap bounds-checking instrumentation for single-threaded program"
msgstr ""
-#: common.opt:694
+#: common.opt:749
msgid "Add mudflap bounds-checking instrumentation for multi-threaded program"
msgstr ""
-#: common.opt:698
+#: common.opt:753
msgid "Ignore read operations when inserting mudflap instrumentation"
msgstr ""
-#: common.opt:702
+#: common.opt:757
msgid "Use the RTL dead code elimination pass"
msgstr ""
-#: common.opt:706
+#: common.opt:761
msgid "Use the RTL dead store elimination pass"
msgstr ""
-#: common.opt:710
+#: common.opt:765
msgid ""
"Enable/Disable the traditional scheduling in loops that already passed "
"modulo scheduling"
msgstr ""
-#: common.opt:714
+#: common.opt:769
msgid "Support synchronous non-call exceptions"
msgstr ""
-#: common.opt:718
+#: common.opt:773
msgid "When possible do not generate stack frames"
msgstr ""
-#: common.opt:722
-msgid "Expand OpenMP operations on SSA form"
-msgstr ""
-
-#: common.opt:726
+#: common.opt:777
msgid "Do the full register move optimization pass"
msgstr ""
-#: common.opt:730
+#: common.opt:781
msgid "Optimize sibling and tail recursive calls"
msgstr ""
-#: common.opt:734 common.opt:738
+#: common.opt:785 common.opt:789
msgid "Report on memory allocation before interprocedural optimization"
msgstr ""
-#: common.opt:742
+#: common.opt:793
msgid "Pack structure members together without holes"
msgstr ""
-#: common.opt:746
+#: common.opt:797
msgid "Set initial maximum structure member alignment"
msgstr ""
-#: common.opt:750
+#: common.opt:801
msgid "Return small aggregates in memory, not registers"
msgstr ""
-#: common.opt:754
+#: common.opt:805
msgid "Perform loop peeling"
msgstr ""
-#: common.opt:758
+#: common.opt:809
msgid "Enable machine specific peephole optimizations"
msgstr ""
-#: common.opt:762
+#: common.opt:813
msgid "Enable an RTL peephole pass before sched2"
msgstr ""
-#: common.opt:766
+#: common.opt:817
msgid "Generate position-independent code if possible (large mode)"
msgstr ""
-#: common.opt:770
+#: common.opt:821
msgid ""
"Generate position-independent code for executables if possible (large mode)"
msgstr ""
-#: common.opt:774
+#: common.opt:825
msgid "Generate position-independent code if possible (small mode)"
msgstr ""
-#: common.opt:778
+#: common.opt:829
msgid ""
"Generate position-independent code for executables if possible (small mode)"
msgstr ""
-#: common.opt:782
+#: common.opt:833
msgid "Run predictive commoning optimization."
msgstr ""
-#: common.opt:786
+#: common.opt:837
msgid "Generate prefetch instructions, if available, for arrays in loops"
msgstr ""
-#: common.opt:790
+#: common.opt:841
msgid "Enable basic program profiling code"
msgstr ""
-#: common.opt:794
+#: common.opt:845
msgid "Insert arc-based program profiling code"
msgstr ""
-#: common.opt:798
+#: common.opt:849
+msgid "Set the top-level directory for storing the profile data."
+msgstr ""
+
+#: common.opt:854
+msgid "Enable correction of flow inconsistent profile data input"
+msgstr ""
+
+#: common.opt:858
msgid ""
"Enable common options for generating profile info for profile feedback "
"directed optimizations"
msgstr ""
-#: common.opt:802
+#: common.opt:862
+msgid ""
+"Enable common options for generating profile info for profile feedback "
+"directed optimizations, and set -fprofile-dir="
+msgstr ""
+
+#: common.opt:866
msgid ""
"Enable common options for performing profile feedback directed optimizations"
msgstr ""
-#: common.opt:806
+#: common.opt:870
+msgid ""
+"Enable common options for performing profile feedback directed "
+"optimizations, and set -fprofile-dir="
+msgstr ""
+
+#: common.opt:874
msgid "Insert code to profile values of expressions"
msgstr ""
-#: common.opt:813
+#: common.opt:881
msgid "Make compile reproducible using <string>"
msgstr ""
-#: common.opt:823
+#: common.opt:891
msgid "Record gcc command line switches in the object file."
msgstr ""
-#: common.opt:827
+#: common.opt:895
msgid "Return small aggregates in registers"
msgstr ""
-#: common.opt:831
+#: common.opt:899
msgid "Enables a register move optimization"
msgstr ""
-#: common.opt:835
+#: common.opt:903
msgid "Perform a register renaming optimization pass"
msgstr ""
-#: common.opt:839
+#: common.opt:907
msgid "Reorder basic blocks to improve code placement"
msgstr ""
-#: common.opt:843
+#: common.opt:911
msgid "Reorder basic blocks and partition into hot and cold sections"
msgstr ""
-#: common.opt:847
+#: common.opt:915
msgid "Reorder functions to improve code placement"
msgstr ""
-#: common.opt:851
+#: common.opt:919
msgid "Add a common subexpression elimination pass after loop optimizations"
msgstr ""
-#: common.opt:859
+#: common.opt:927
msgid "Disable optimizations that assume default FP rounding behavior"
msgstr ""
-#: common.opt:863
+#: common.opt:931
msgid "Enable scheduling across basic blocks"
msgstr ""
-#: common.opt:867
+#: common.opt:935
msgid "Allow speculative motion of non-loads"
msgstr ""
-#: common.opt:871
+#: common.opt:939
msgid "Allow speculative motion of some loads"
msgstr ""
-#: common.opt:875
+#: common.opt:943
msgid "Allow speculative motion of more loads"
msgstr ""
-#: common.opt:879
+#: common.opt:947
msgid "Set the verbosity level of the scheduler"
msgstr ""
-#: common.opt:883
+#: common.opt:951
msgid "If scheduling post reload, do superblock scheduling"
msgstr ""
-#: common.opt:887
+#: common.opt:955
msgid "If scheduling post reload, do trace scheduling"
msgstr ""
-#: common.opt:891
+#: common.opt:959
msgid "Reschedule instructions before register allocation"
msgstr ""
-#: common.opt:895
+#: common.opt:963
msgid "Reschedule instructions after register allocation"
msgstr ""
-#: common.opt:901
+#: common.opt:969
msgid "Allow premature scheduling of queued insns"
msgstr ""
-#: common.opt:905
+#: common.opt:973
msgid "Set number of queued insns that can be prematurely scheduled"
msgstr ""
-#: common.opt:913 common.opt:917
+#: common.opt:981 common.opt:985
msgid ""
"Set dependence distance checking in premature scheduling of queued insns"
msgstr ""
-#: common.opt:921
+#: common.opt:989
msgid "Access data in the same section from shared anchor points"
msgstr ""
-#: common.opt:925
+#: common.opt:993
msgid "Perform sequence abstraction optimization on RTL"
msgstr ""
-#: common.opt:929
+#: common.opt:997
msgid "Eliminate redundant sign extensions using LCM."
msgstr ""
-#: common.opt:933
+#: common.opt:1001
msgid "Show column numbers in diagnostics, when available. Default off"
msgstr ""
-#: common.opt:937
+#: common.opt:1005
msgid "Disable optimizations observable by IEEE signaling NaNs"
msgstr ""
-#: common.opt:941
+#: common.opt:1009
msgid ""
"Disable floating point optimizations that ignore the IEEE signedness of zero"
msgstr ""
-#: common.opt:945
+#: common.opt:1013
msgid "Convert floating point constants to single precision constants"
msgstr ""
-#: common.opt:949
+#: common.opt:1017
msgid "Split lifetimes of induction variables when loops are unrolled"
msgstr ""
-#: common.opt:953
+#: common.opt:1021
msgid "Split wide types into independent registers"
msgstr ""
-#: common.opt:957
+#: common.opt:1025
msgid "Apply variable expansion when loops are unrolled"
msgstr ""
-#: common.opt:963
+#: common.opt:1029
msgid "Insert stack checking code into the program"
msgstr ""
-#: common.opt:970
+#: common.opt:1033
+msgid ""
+"Insert stack checking code into the program. Same as -fstack-check=specific"
+msgstr ""
+
+#: common.opt:1040
msgid "Trap if the stack goes past <register>"
msgstr ""
-#: common.opt:974
+#: common.opt:1044
msgid "Trap if the stack goes past symbol <name>"
msgstr ""
-#: common.opt:978
+#: common.opt:1048
msgid "Use propolice as a stack protection method"
msgstr ""
-#: common.opt:982
+#: common.opt:1052
msgid "Use a stack protection method for every function"
msgstr ""
-#: common.opt:994
+#: common.opt:1064
msgid "Assume strict aliasing rules apply"
msgstr ""
-#: common.opt:998
+#: common.opt:1068
msgid "Treat signed overflow as undefined"
msgstr ""
-#: common.opt:1002
+#: common.opt:1072
msgid "Check for syntax errors, then stop"
msgstr ""
-#: common.opt:1006
+#: common.opt:1076
msgid "Create data files needed by \"gcov\""
msgstr ""
-#: common.opt:1010
+#: common.opt:1080
msgid "Perform jump threading optimizations"
msgstr ""
-#: common.opt:1014
+#: common.opt:1084
msgid "Report the time taken by each compiler pass"
msgstr ""
-#: common.opt:1018
+#: common.opt:1088
msgid "Set the default thread-local storage code generation model"
msgstr ""
-#: common.opt:1022
+#: common.opt:1092
msgid "Reorder top level functions, variables, and asms"
msgstr ""
-#: common.opt:1026
+#: common.opt:1096
msgid "Perform superblock formation via tail duplication"
msgstr ""
-#: common.opt:1033
+#: common.opt:1103
msgid "Assume floating-point operations can trap"
msgstr ""
-#: common.opt:1037
+#: common.opt:1107
msgid "Trap for signed overflow in addition, subtraction and multiplication"
msgstr ""
-#: common.opt:1041
+#: common.opt:1111
msgid "Enable SSA-CCP optimization on trees"
msgstr ""
-#: common.opt:1045
+#: common.opt:1115
msgid "Enable SSA-CCP optimization for stores and loads"
msgstr ""
-#: common.opt:1049
+#: common.opt:1119
msgid "Enable loop header copying on trees"
msgstr ""
-#: common.opt:1053
+#: common.opt:1123
msgid "Replace SSA temporaries with better names in copies"
msgstr ""
-#: common.opt:1057
+#: common.opt:1127
msgid "Enable copy propagation on trees"
msgstr ""
-#: common.opt:1065
+#: common.opt:1135
msgid "Transform condition stores into unconditional ones"
msgstr ""
-#: common.opt:1069
+#: common.opt:1139
+msgid "Perform conversions of switch initializations."
+msgstr ""
+
+#: common.opt:1143
msgid "Enable SSA dead code elimination optimization on trees"
msgstr ""
-#: common.opt:1073
+#: common.opt:1147
msgid "Enable dominator optimizations"
msgstr ""
-#: common.opt:1077
+#: common.opt:1151
msgid "Enable dead store elimination"
msgstr ""
-#: common.opt:1081
+#: common.opt:1155
msgid "Enable Full Redundancy Elimination (FRE) on trees"
msgstr ""
-#: common.opt:1085
+#: common.opt:1159
+msgid "Enable loop distribution on trees"
+msgstr ""
+
+#: common.opt:1163
msgid "Enable loop invariant motion on trees"
msgstr ""
-#: common.opt:1089
+#: common.opt:1167
msgid "Enable linear loop transforms on trees"
msgstr ""
-#: common.opt:1093
+#: common.opt:1171
msgid "Create canonical induction variables in loops"
msgstr ""
-#: common.opt:1097
+#: common.opt:1175
msgid "Enable loop optimizations on tree level"
msgstr ""
-#: common.opt:1101
+#: common.opt:1179
msgid "Enable automatic parallelization of loops"
msgstr ""
-#: common.opt:1105
+#: common.opt:1183
msgid "Enable SSA-PRE optimization on trees"
msgstr ""
-#: common.opt:1109
+#: common.opt:1187
msgid "Enable reassociation on tree level"
msgstr ""
-#: common.opt:1113
-msgid "Perform structural alias analysis"
-msgstr ""
-
-#: common.opt:1117
+#: common.opt:1195
msgid "Enable SSA code sinking on trees"
msgstr ""
-#: common.opt:1121
+#: common.opt:1199
msgid "Perform scalar replacement of aggregates"
msgstr ""
-#: common.opt:1125
+#: common.opt:1203
msgid "Replace temporary expressions in the SSA->normal pass"
msgstr ""
-#: common.opt:1129
+#: common.opt:1207
msgid "Perform live range splitting during the SSA->normal pass"
msgstr ""
-#: common.opt:1133
+#: common.opt:1211
msgid "Perform Value Range Propagation on trees"
msgstr ""
-#: common.opt:1137
+#: common.opt:1215
msgid "Compile whole compilation unit at a time"
msgstr ""
-#: common.opt:1141
+#: common.opt:1219
msgid "Perform loop unrolling when iteration count is known"
msgstr ""
-#: common.opt:1145
+#: common.opt:1223
msgid "Perform loop unrolling for all loops"
msgstr ""
-#: common.opt:1152
+#: common.opt:1230
msgid "Allow loop optimizations to assume that the loops behave in normal way"
msgstr ""
-#: common.opt:1156
+#: common.opt:1234
msgid "Allow optimization for floating-point arithmetic which may change the"
msgstr ""
-#: common.opt:1161
+#: common.opt:1239
msgid "Same as -fassociative-math for expressions which include division."
msgstr ""
-#: common.opt:1169
+#: common.opt:1247
msgid "Allow math optimizations that may violate IEEE or ISO standards"
msgstr ""
-#: common.opt:1173
+#: common.opt:1251
msgid "Perform loop unswitching"
msgstr ""
-#: common.opt:1177
+#: common.opt:1255
msgid "Just generate unwind tables for exception handling"
msgstr ""
-#: common.opt:1181
+#: common.opt:1259
msgid "Perform variable tracking"
msgstr ""
-#: common.opt:1185
+#: common.opt:1263
msgid "Perform variable tracking and also tag variables that are uninitialized"
msgstr ""
-#: common.opt:1189
+#: common.opt:1267
msgid "Enable loop vectorization on trees"
msgstr ""
-#: common.opt:1193
+#: common.opt:1271
msgid "Enable use of cost model in vectorization"
msgstr ""
-#: common.opt:1197
+#: common.opt:1275
msgid "Enable loop versioning when doing loop vectorization on trees"
msgstr ""
-#: common.opt:1201
+#: common.opt:1279
msgid "Set the verbosity level of the vectorizer"
msgstr ""
-#: common.opt:1205
+#: common.opt:1283
msgid "Enable copy propagation of scalar-evolution information."
msgstr ""
-#: common.opt:1215
+#: common.opt:1293
msgid "Add extra commentary to assembler output"
msgstr ""
-#: common.opt:1219
+#: common.opt:1297
msgid "Set the default symbol visibility"
msgstr ""
-#: common.opt:1224
+#: common.opt:1302
msgid "Use expression value profiles in optimizations"
msgstr ""
-#: common.opt:1228
+#: common.opt:1306
msgid "Construct webs and split unrelated uses of single variable"
msgstr ""
-#: common.opt:1232
+#: common.opt:1310
+msgid "Enable conditional dead code elimination for builtin calls"
+msgstr ""
+
+#: common.opt:1314
msgid "Perform whole program optimizations"
msgstr ""
-#: common.opt:1236
+#: common.opt:1318
msgid "Assume signed arithmetic overflow wraps around"
msgstr ""
-#: common.opt:1240
+#: common.opt:1322
msgid "Put zero initialized data in the bss section"
msgstr ""
-#: common.opt:1244
+#: common.opt:1326
msgid "Generate debug information in default format"
msgstr ""
-#: common.opt:1248
+#: common.opt:1330
msgid "Generate debug information in COFF format"
msgstr ""
-#: common.opt:1252
+#: common.opt:1334
msgid "Generate debug information in DWARF v2 format"
msgstr ""
-#: common.opt:1256
+#: common.opt:1338
msgid "Generate debug information in default extended format"
msgstr ""
-#: common.opt:1260
+#: common.opt:1342
msgid "Generate debug information in STABS format"
msgstr ""
-#: common.opt:1264
+#: common.opt:1346
msgid "Generate debug information in extended STABS format"
msgstr ""
-#: common.opt:1268
+#: common.opt:1350
msgid "Generate debug information in VMS format"
msgstr ""
-#: common.opt:1272
+#: common.opt:1354
msgid "Generate debug information in XCOFF format"
msgstr ""
-#: common.opt:1276
+#: common.opt:1358
msgid "Generate debug information in extended XCOFF format"
msgstr ""
-#: common.opt:1280
+#: common.opt:1362
msgid "Place output into <file>"
msgstr ""
-#: common.opt:1284
+#: common.opt:1366
msgid "Enable function profiling"
msgstr ""
-#: common.opt:1288
+#: common.opt:1370
msgid "Issue warnings needed for strict compliance to the standard"
msgstr ""
-#: common.opt:1292
+#: common.opt:1374
msgid "Like -pedantic but issue them as errors"
msgstr ""
-#: common.opt:1296
+#: common.opt:1378
msgid "Do not display functions compiled or elapsed time"
msgstr ""
-#: common.opt:1300
+#: common.opt:1382
msgid "Display the compiler's version"
msgstr ""
-#: common.opt:1304
+#: common.opt:1386
msgid "Suppress warnings"
msgstr ""
-#: common.opt:1308
+#: common.opt:1390
msgid "Create a shared library"
msgstr ""
-#: common.opt:1312
+#: common.opt:1394
msgid "Create a position independent executable"
msgstr ""
-#: attribs.c:244
+#: attribs.c:284
#, gcc-internal-format
msgid "%qs attribute directive ignored"
msgstr ""
-#: attribs.c:252
+#: attribs.c:292
#, gcc-internal-format
msgid "wrong number of arguments specified for %qs attribute"
msgstr ""
-#: attribs.c:270
+#: attribs.c:310
#, gcc-internal-format
msgid "%qs attribute does not apply to types"
msgstr ""
-#: attribs.c:317
+#: attribs.c:361
#, gcc-internal-format
msgid "%qs attribute only applies to function types"
msgstr ""
-#: attribs.c:327
+#: attribs.c:371
#, gcc-internal-format
msgid "type attributes ignored after type is already defined"
msgstr ""
-#: bb-reorder.c:1860
+#: bb-reorder.c:1878
#, gcc-internal-format
msgid "multiple hot/cold transitions found (bb %i)"
msgstr ""
@@ -17107,52 +16962,52 @@ msgid ""
"branch target register load optimization is not intended to be run twice"
msgstr ""
-#: builtins.c:451
+#: builtins.c:453
#, gcc-internal-format
msgid "offset outside bounds of constant string"
msgstr ""
-#: builtins.c:1015
+#: builtins.c:1016
#, gcc-internal-format
msgid "second argument to %<__builtin_prefetch%> must be a constant"
msgstr ""
-#: builtins.c:1022
+#: builtins.c:1023
#, gcc-internal-format
msgid "invalid second argument to %<__builtin_prefetch%>; using zero"
msgstr ""
-#: builtins.c:1030
+#: builtins.c:1031
#, gcc-internal-format
msgid "third argument to %<__builtin_prefetch%> must be a constant"
msgstr ""
-#: builtins.c:1037
+#: builtins.c:1038
#, gcc-internal-format
msgid "invalid third argument to %<__builtin_prefetch%>; using zero"
msgstr ""
-#: builtins.c:4608
+#: builtins.c:4610
#, gcc-internal-format
msgid "argument of %<__builtin_args_info%> must be constant"
msgstr ""
-#: builtins.c:4614
+#: builtins.c:4616
#, gcc-internal-format
msgid "argument of %<__builtin_args_info%> out of range"
msgstr ""
-#: builtins.c:4620
+#: builtins.c:4622
#, gcc-internal-format
msgid "missing argument in %<__builtin_args_info%>"
msgstr ""
-#: builtins.c:4709 gimplify.c:2118
+#: builtins.c:4758 gimplify.c:2314
#, gcc-internal-format
msgid "too few arguments to function %<va_start%>"
msgstr ""
-#: builtins.c:4872
+#: builtins.c:4916
#, gcc-internal-format
msgid "first argument to %<va_arg%> not of type %<va_list%>"
msgstr ""
@@ -17160,103 +17015,88 @@ msgstr ""
#. 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.
-#: builtins.c:4886
+#: builtins.c:4931
#, gcc-internal-format
msgid "%qT is promoted to %qT when passed through %<...%>"
msgstr ""
-#: builtins.c:4891
+#: builtins.c:4936
#, gcc-internal-format
msgid "(so you should pass %qT not %qT to %<va_arg%>)"
msgstr ""
#. We can, however, treat "undefined" any way we please.
#. Call abort to encourage the user to fix the program.
-#: builtins.c:4897 c-typeck.c:2419
+#: builtins.c:4943 c-typeck.c:2414
#, gcc-internal-format
msgid "if this code is reached, the program will abort"
msgstr ""
-#: builtins.c:5015
+#: builtins.c:5064
#, gcc-internal-format
msgid "invalid argument to %<__builtin_frame_address%>"
msgstr ""
-#: builtins.c:5017
+#: builtins.c:5066
#, gcc-internal-format
msgid "invalid argument to %<__builtin_return_address%>"
msgstr ""
-#: builtins.c:5030
+#: builtins.c:5079
#, gcc-internal-format
msgid "unsupported argument to %<__builtin_frame_address%>"
msgstr ""
-#: builtins.c:5032
+#: builtins.c:5081
#, gcc-internal-format
msgid "unsupported argument to %<__builtin_return_address%>"
msgstr ""
-#: builtins.c:5579
+#: builtins.c:5627
#, gcc-internal-format
msgid "both arguments to %<__builtin___clear_cache%> must be pointers"
msgstr ""
#. All valid uses of __builtin_va_arg_pack () are removed during
#. inlining.
-#: builtins.c:6291 expr.c:8030
+#: builtins.c:6346 expr.c:8025
msgid "%Kinvalid use of %<__builtin_va_arg_pack ()%>"
msgstr ""
#. All valid uses of __builtin_va_arg_pack_len () are removed during
#. inlining.
-#: builtins.c:6297
+#: builtins.c:6352
msgid "%Kinvalid use of %<__builtin_va_arg_pack_len ()%>"
msgstr ""
-#: builtins.c:6593
+#: builtins.c:6648
#, gcc-internal-format
msgid "%<__builtin_longjmp%> second argument must be 1"
msgstr ""
-#: builtins.c:7224
+#: builtins.c:7282
#, gcc-internal-format
msgid "target format does not support infinity"
msgstr ""
-#: builtins.c:9638 builtins.c:9727 builtins.c:10082
-#, gcc-internal-format
-msgid "non-floating-point argument to function %qs"
-msgstr ""
-
-#: builtins.c:10446 builtins.c:10466
-#, gcc-internal-format
-msgid "too few arguments to function %qs"
-msgstr ""
-
-#: builtins.c:10452 builtins.c:10472
-#, gcc-internal-format
-msgid "too many arguments to function %qs"
-msgstr ""
-
-#: builtins.c:11375
+#: builtins.c:11534
#, gcc-internal-format
msgid "%<va_start%> used in function with fixed args"
msgstr ""
-#: builtins.c:11383
+#: builtins.c:11542
#, gcc-internal-format
msgid "wrong number of arguments to function %<va_start%>"
msgstr ""
#. Evidently an out of date version of <stdarg.h>; can't validate
#. va_start's second argument, but can still work as intended.
-#: builtins.c:11396
+#: builtins.c:11555
#, gcc-internal-format
msgid "%<__builtin_next_arg%> called without an argument"
msgstr ""
-#: builtins.c:11401
+#: builtins.c:11560
#, gcc-internal-format
msgid "wrong number of arguments to function %<__builtin_next_arg%>"
msgstr ""
@@ -17266,945 +17106,1034 @@ msgstr ""
#. argument. We just warn and set the arg to be the last
#. argument so that we will get wrong-code because of
#. it.
-#: builtins.c:11430
+#: builtins.c:11587
#, gcc-internal-format
msgid "second parameter of %<va_start%> not last named argument"
msgstr ""
-#: builtins.c:11544
+#: builtins.c:11597
+#, gcc-internal-format
+msgid ""
+"undefined behaviour when second parameter of %<va_start%> is declared with %"
+"<register%> storage"
+msgstr ""
+
+#: builtins.c:11712
msgid "%Kfirst argument of %D must be a pointer, second integer constant"
msgstr ""
-#: builtins.c:11557
+#: builtins.c:11725
msgid "%Klast argument of %D is not integer constant between 0 and 3"
msgstr ""
-#: builtins.c:11601 builtins.c:11765 builtins.c:11824
+#: builtins.c:11769 builtins.c:11933 builtins.c:11992
msgid "%Kcall to %D will always overflow destination buffer"
msgstr ""
-#: builtins.c:11755
+#: builtins.c:11923
msgid "%Kcall to %D might overflow destination buffer"
msgstr ""
-#: c-common.c:859
+#: builtins.c:12013
+msgid "%Kattempt to free a non-heap object %qD"
+msgstr ""
+
+#: builtins.c:12015
+msgid "%Kattempt to free a non-heap object"
+msgstr ""
+
+#: c-common.c:1047
#, gcc-internal-format
msgid "%qD is not defined outside of function scope"
msgstr ""
-#. Translators: The %d after 'ISO C' will be 90 or 99. Do not
-#. 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.
-#: c-common.c:891
+#: c-common.c:1097
#, gcc-internal-format
msgid ""
"string length %qd is greater than the length %qd ISO C%d compilers are "
"required to support"
msgstr ""
-#: c-common.c:941
+#: c-common.c:1144 c-common.c:1156
#, gcc-internal-format
msgid "overflow in constant expression"
msgstr ""
-#: c-common.c:963
+#: c-common.c:1178
#, gcc-internal-format
msgid "integer overflow in expression"
msgstr ""
-#: c-common.c:967
+#: c-common.c:1182
#, gcc-internal-format
msgid "floating point overflow in expression"
msgstr ""
-#: c-common.c:971
+#: c-common.c:1186
#, gcc-internal-format
msgid "fixed-point overflow in expression"
msgstr ""
-#: c-common.c:975
+#: c-common.c:1190
#, gcc-internal-format
msgid "vector overflow in expression"
msgstr ""
-#: c-common.c:980
+#: c-common.c:1195
#, gcc-internal-format
msgid "complex integer overflow in expression"
msgstr ""
-#: c-common.c:982
+#: c-common.c:1197
#, gcc-internal-format
msgid "complex floating point overflow in expression"
msgstr ""
-#: c-common.c:1013
+#: c-common.c:1228
#, gcc-internal-format
msgid "logical %<%s%> with non-zero constant will always evaluate as true"
msgstr ""
-#: c-common.c:1046
+#: c-common.c:1266
#, gcc-internal-format
msgid "type-punning to incomplete type might break strict-aliasing rules"
msgstr ""
-#: c-common.c:1060
+#: c-common.c:1281
#, gcc-internal-format
msgid "dereferencing type-punned pointer will break strict-aliasing rules"
msgstr ""
-#: c-common.c:1067 c-common.c:1085
+#: c-common.c:1288 c-common.c:1306
#, gcc-internal-format
msgid "dereferencing type-punned pointer might break strict-aliasing rules"
msgstr ""
-#: c-common.c:1111
+#: c-common.c:1332
#, gcc-internal-format
msgid "%Hsuggest braces around empty body in an %<if%> statement"
msgstr ""
-#: c-common.c:1115
+#: c-common.c:1336
#, gcc-internal-format
msgid "%Hsuggest braces around empty body in an %<else%> statement"
msgstr ""
-#: c-common.c:1141
+#: c-common.c:1362
#, gcc-internal-format
msgid "first argument of %q+D should be %<int%>"
msgstr ""
-#: c-common.c:1149
+#: c-common.c:1371
#, gcc-internal-format
msgid "second argument of %q+D should be %<char **%>"
msgstr ""
-#: c-common.c:1158
+#: c-common.c:1380
#, gcc-internal-format
msgid "third argument of %q+D should probably be %<char **%>"
msgstr ""
-#: c-common.c:1168
+#: c-common.c:1390
#, gcc-internal-format
msgid "%q+D takes only zero or two arguments"
msgstr ""
-#: c-common.c:1203
+#: c-common.c:1439
#, gcc-internal-format
msgid ""
"use -flax-vector-conversions to permit conversions between vectors with "
"differing element types or numbers of subparts"
msgstr ""
-#: c-common.c:1241
+#: c-common.c:1594
+#, gcc-internal-format
+msgid "conversion to %qT from boolean expression"
+msgstr ""
+
+#: c-common.c:1616
#, gcc-internal-format
msgid "negative integer implicitly converted to unsigned type"
msgstr ""
-#: c-common.c:1244
+#: c-common.c:1618
#, gcc-internal-format
msgid "conversion of unsigned constant value to negative integer"
msgstr ""
-#: c-common.c:1270
+#: c-common.c:1645
#, gcc-internal-format
msgid "conversion to %qT alters %qT constant value"
msgstr ""
-#: c-common.c:1299
+#: c-common.c:1737
#, gcc-internal-format
msgid "conversion to %qT from %qT may change the sign of the result"
msgstr ""
-#: c-common.c:1328
+#: c-common.c:1769
#, gcc-internal-format
msgid "conversion to %qT from %qT may alter its value"
msgstr ""
-#: c-common.c:1356
+#: c-common.c:1797
#, gcc-internal-format
msgid "large integer implicitly truncated to unsigned type"
msgstr ""
-#: c-common.c:1362 c-common.c:1369 c-common.c:1377
+#: c-common.c:1803 c-common.c:1810 c-common.c:1818
#, gcc-internal-format
msgid "overflow in implicit constant conversion"
msgstr ""
-#: c-common.c:1531
+#: c-common.c:1974
#, gcc-internal-format
msgid "operation on %qE may be undefined"
msgstr ""
-#: c-common.c:1824
+#: c-common.c:2268
#, gcc-internal-format
msgid "case label does not reduce to an integer constant"
msgstr ""
-#: c-common.c:1864
+#: c-common.c:2308
#, gcc-internal-format
msgid "case label value is less than minimum value for type"
msgstr ""
-#: c-common.c:1872
+#: c-common.c:2316
#, gcc-internal-format
msgid "case label value exceeds maximum value for type"
msgstr ""
-#: c-common.c:1880
+#: c-common.c:2324
#, gcc-internal-format
msgid "lower value in case label range less than minimum value for type"
msgstr ""
-#: c-common.c:1889
+#: c-common.c:2333
#, gcc-internal-format
msgid "upper value in case label range exceeds maximum value for type"
msgstr ""
-#: c-common.c:1963
+#: c-common.c:2407
#, gcc-internal-format
msgid ""
"GCC cannot support operators with integer types and fixed-point types that "
"have too many integral and fractional bits together"
msgstr ""
-#: c-common.c:2453
+#: c-common.c:2921
#, gcc-internal-format
msgid "invalid operands to binary %s (have %qT and %qT)"
msgstr ""
-#: c-common.c:2689
+#: c-common.c:3157
#, gcc-internal-format
msgid "comparison is always false due to limited range of data type"
msgstr ""
-#: c-common.c:2691
+#: c-common.c:3159
#, gcc-internal-format
msgid "comparison is always true due to limited range of data type"
msgstr ""
-#: c-common.c:2770
+#: c-common.c:3238
#, gcc-internal-format
msgid "comparison of unsigned expression >= 0 is always true"
msgstr ""
-#: c-common.c:2780
+#: c-common.c:3248
#, gcc-internal-format
msgid "comparison of unsigned expression < 0 is always false"
msgstr ""
-#: c-common.c:2821
+#: c-common.c:3289
#, gcc-internal-format
msgid "pointer of type %<void *%> used in arithmetic"
msgstr ""
-#: c-common.c:2827
+#: c-common.c:3295
#, gcc-internal-format
msgid "pointer to a function used in arithmetic"
msgstr ""
-#: c-common.c:2833
+#: c-common.c:3301
#, gcc-internal-format
msgid "pointer to member function used in arithmetic"
msgstr ""
-#: c-common.c:2985
+#: c-common.c:3453
#, gcc-internal-format
msgid "the address of %qD will always evaluate as %<true%>"
msgstr ""
-#: c-common.c:3054 cp/semantics.c:597 cp/typeck.c:6427
+#: c-common.c:3521 cp/semantics.c:600 cp/typeck.c:6554
#, gcc-internal-format
msgid "suggest parentheses around assignment used as truth value"
msgstr ""
-#: c-common.c:3126 c-typeck.c:8969
+#: c-common.c:3593 c-typeck.c:8850
#, gcc-internal-format
msgid "invalid use of %<restrict%>"
msgstr ""
-#: c-common.c:3346
+#: c-common.c:3810
#, gcc-internal-format
msgid "invalid application of %<sizeof%> to a function type"
msgstr ""
-#: c-common.c:3356
+#: c-common.c:3823
#, gcc-internal-format
msgid "invalid application of %qs to a void type"
msgstr ""
-#: c-common.c:3362
+#: c-common.c:3831
#, gcc-internal-format
msgid "invalid application of %qs to incomplete type %qT "
msgstr ""
-#: c-common.c:3403
+#: c-common.c:3872
#, gcc-internal-format
msgid "%<__alignof%> applied to a bit-field"
msgstr ""
-#: c-common.c:3976
+#: c-common.c:4493
#, gcc-internal-format
msgid "cannot disable built-in function %qs"
msgstr ""
-#: c-common.c:4179
+#: c-common.c:4684
#, gcc-internal-format
msgid "pointers are not permitted as case values"
msgstr ""
-#: c-common.c:4185
+#: c-common.c:4691
#, gcc-internal-format
msgid "range expressions in switch statements are non-standard"
msgstr ""
-#: c-common.c:4211
+#: c-common.c:4717
#, gcc-internal-format
msgid "empty range specified"
msgstr ""
-#: c-common.c:4271
+#: c-common.c:4777
#, gcc-internal-format
msgid "duplicate (or overlapping) case value"
msgstr ""
-#: c-common.c:4272
+#: c-common.c:4778
#, gcc-internal-format
msgid "%Jthis is the first entry overlapping that value"
msgstr ""
-#: c-common.c:4276
+#: c-common.c:4782
#, gcc-internal-format
msgid "duplicate case value"
msgstr ""
-#: c-common.c:4277
+#: c-common.c:4783
#, gcc-internal-format
msgid "%Jpreviously used here"
msgstr ""
-#: c-common.c:4281
+#: c-common.c:4787
#, gcc-internal-format
msgid "multiple default labels in one switch"
msgstr ""
-#: c-common.c:4282
+#: c-common.c:4788
#, gcc-internal-format
msgid "%Jthis is the first default label"
msgstr ""
-#: c-common.c:4331
+#: c-common.c:4839
#, gcc-internal-format
msgid "%Jcase value %qs not in enumerated type"
msgstr ""
-#: c-common.c:4334
+#: c-common.c:4843
#, gcc-internal-format
msgid "%Jcase value %qs not in enumerated type %qT"
msgstr ""
-#: c-common.c:4392
+#: c-common.c:4902
#, gcc-internal-format
msgid "%Hswitch missing default case"
msgstr ""
-#: c-common.c:4455
+#: c-common.c:4973
#, gcc-internal-format
msgid "%Henumeration value %qE not handled in switch"
msgstr ""
-#: c-common.c:4479
+#: c-common.c:5006
#, gcc-internal-format
msgid "taking the address of a label is non-standard"
msgstr ""
-#: c-common.c:4629
+#: c-common.c:5159
#, gcc-internal-format
msgid "%qE attribute ignored for field of type %qT"
msgstr ""
-#: c-common.c:4640 c-common.c:4659 c-common.c:4677 c-common.c:4704
-#: c-common.c:4731 c-common.c:4757 c-common.c:4776 c-common.c:4800
-#: c-common.c:4823 c-common.c:4846 c-common.c:4867 c-common.c:4888
-#: c-common.c:4912 c-common.c:4938 c-common.c:4975 c-common.c:5002
-#: c-common.c:5045 c-common.c:5129 c-common.c:5159 c-common.c:5178
-#: c-common.c:5498 c-common.c:5558 c-common.c:5579 c-common.c:5643
-#: c-common.c:5761 c-common.c:5827 c-common.c:5876 c-common.c:5922
-#: c-common.c:5992 c-common.c:6016 c-common.c:6301 c-common.c:6324
-#: c-common.c:6363
+#: c-common.c:5170 c-common.c:5189 c-common.c:5207 c-common.c:5234
+#: c-common.c:5287 c-common.c:5339 c-common.c:5358 c-common.c:5382
+#: c-common.c:5405 c-common.c:5428 c-common.c:5449 c-common.c:5470
+#: c-common.c:5494 c-common.c:5520 c-common.c:5557 c-common.c:5584
+#: c-common.c:5627 c-common.c:5711 c-common.c:5741 c-common.c:5760
+#: c-common.c:6095 c-common.c:6154 c-common.c:6175 c-common.c:6239
+#: c-common.c:6357 c-common.c:6423 c-common.c:6467 c-common.c:6513
+#: c-common.c:6583 c-common.c:6607 c-common.c:6892 c-common.c:6915
+#: c-common.c:6954 c-common.c:7044 c-common.c:7186
#, gcc-internal-format
msgid "%qE attribute ignored"
msgstr ""
-#: c-common.c:4722 c-common.c:4748
+#: c-common.c:5252 c-common.c:5304
#, gcc-internal-format
msgid "%qE attribute conflicts with attribute %s"
msgstr ""
-#: c-common.c:4969
+#: c-common.c:5551
#, gcc-internal-format
msgid "%qE attribute have effect only on public objects"
msgstr ""
-#: c-common.c:5066
+#: c-common.c:5648
#, gcc-internal-format
msgid "destructor priorities are not supported"
msgstr ""
-#: c-common.c:5068
+#: c-common.c:5650
#, gcc-internal-format
msgid "constructor priorities are not supported"
msgstr ""
-#: c-common.c:5085
+#: c-common.c:5667
#, gcc-internal-format
msgid "destructor priorities from 0 to %d are reserved for the implementation"
msgstr ""
-#: c-common.c:5090
+#: c-common.c:5672
#, gcc-internal-format
msgid "constructor priorities from 0 to %d are reserved for the implementation"
msgstr ""
-#: c-common.c:5098
+#: c-common.c:5680
#, gcc-internal-format
msgid "destructor priorities must be integers from 0 to %d inclusive"
msgstr ""
-#: c-common.c:5101
+#: c-common.c:5683
#, gcc-internal-format
msgid "constructor priorities must be integers from 0 to %d inclusive"
msgstr ""
-#: c-common.c:5220
+#: c-common.c:5804
#, gcc-internal-format
msgid "unknown machine mode %qs"
msgstr ""
-#: c-common.c:5249
+#: c-common.c:5833
#, gcc-internal-format
msgid "specifying vector types with __attribute__ ((mode)) is deprecated"
msgstr ""
-#: c-common.c:5252
+#: c-common.c:5836
#, gcc-internal-format
msgid "use __attribute__ ((vector_size)) instead"
msgstr ""
-#: c-common.c:5261
+#: c-common.c:5845
#, gcc-internal-format
msgid "unable to emulate %qs"
msgstr ""
-#: c-common.c:5271
+#: c-common.c:5855
#, gcc-internal-format
msgid "invalid pointer mode %qs"
msgstr ""
-#: c-common.c:5288
+#: c-common.c:5872
#, gcc-internal-format
msgid "signness of type and machine mode %qs don't match"
msgstr ""
-#: c-common.c:5299
+#: c-common.c:5883
#, gcc-internal-format
msgid "no data type for mode %qs"
msgstr ""
-#: c-common.c:5309
+#: c-common.c:5893
#, gcc-internal-format
msgid "cannot use mode %qs for enumeral types"
msgstr ""
-#: c-common.c:5336
+#: c-common.c:5920
#, gcc-internal-format
msgid "mode %qs applied to inappropriate type"
msgstr ""
-#: c-common.c:5367
+#: c-common.c:5951
#, gcc-internal-format
msgid "%Jsection attribute cannot be specified for local variables"
msgstr ""
-#: c-common.c:5378 config/bfin/bfin.c:4982 config/bfin/bfin.c:5033
+#: c-common.c:5962 config/bfin/bfin.c:5007 config/bfin/bfin.c:5058
#, gcc-internal-format
msgid "section of %q+D conflicts with previous declaration"
msgstr ""
-#: c-common.c:5387
+#: c-common.c:5970
+#, gcc-internal-format
+msgid "section of %q+D cannot be overridden"
+msgstr ""
+
+#: c-common.c:5978
#, gcc-internal-format
msgid "section attribute not allowed for %q+D"
msgstr ""
-#: c-common.c:5393
+#: c-common.c:5984
#, gcc-internal-format
msgid "%Jsection attributes are not supported for this target"
msgstr ""
-#: c-common.c:5425
+#: c-common.c:6016
#, gcc-internal-format
msgid "requested alignment is not a constant"
msgstr ""
-#: c-common.c:5430
+#: c-common.c:6021
#, gcc-internal-format
msgid "requested alignment is not a power of 2"
msgstr ""
-#: c-common.c:5435
+#: c-common.c:6026
#, gcc-internal-format
msgid "requested alignment is too large"
msgstr ""
-#: c-common.c:5461
+#: c-common.c:6052
#, gcc-internal-format
msgid "alignment may not be specified for %q+D"
msgstr ""
-#: c-common.c:5468
+#: c-common.c:6059
#, gcc-internal-format
msgid ""
"alignment for %q+D was previously specified as %d and may not be decreased"
msgstr ""
-#: c-common.c:5472
+#: c-common.c:6063
#, gcc-internal-format
msgid "alignment for %q+D must be at least %d"
msgstr ""
-#: c-common.c:5521
+#: c-common.c:6088
+#, gcc-internal-format
+msgid "inline function %q+D cannot be declared weak"
+msgstr ""
+
+#: c-common.c:6117
#, gcc-internal-format
msgid "%q+D defined both normally and as an alias"
msgstr ""
-#: c-common.c:5537
+#: c-common.c:6133
#, gcc-internal-format
msgid "alias argument not a string"
msgstr ""
-#: c-common.c:5600
+#: c-common.c:6196
#, gcc-internal-format
msgid "%Jweakref attribute must appear before alias attribute"
msgstr ""
-#: c-common.c:5630
+#: c-common.c:6226
#, gcc-internal-format
msgid "%qE attribute ignored on non-class types"
msgstr ""
-#: c-common.c:5636
+#: c-common.c:6232
#, gcc-internal-format
msgid "%qE attribute ignored because %qT is already defined"
msgstr ""
-#: c-common.c:5649
+#: c-common.c:6245
#, gcc-internal-format
msgid "visibility argument not a string"
msgstr ""
-#: c-common.c:5661
+#: c-common.c:6257
#, gcc-internal-format
msgid "%qE attribute ignored on types"
msgstr ""
-#: c-common.c:5677
+#: c-common.c:6273
#, gcc-internal-format
msgid ""
"visibility argument must be one of \"default\", \"hidden\", \"protected\" or "
"\"internal\""
msgstr ""
-#: c-common.c:5688
+#: c-common.c:6284
#, gcc-internal-format
msgid "%qD redeclared with different visibility"
msgstr ""
-#: c-common.c:5691 c-common.c:5695
+#: c-common.c:6287 c-common.c:6291
#, gcc-internal-format
msgid "%qD was declared %qs which implies default visibility"
msgstr ""
-#: c-common.c:5769
+#: c-common.c:6365
#, gcc-internal-format
msgid "tls_model argument not a string"
msgstr ""
-#: c-common.c:5782
+#: c-common.c:6378
#, gcc-internal-format
msgid ""
"tls_model argument must be one of \"local-exec\", \"initial-exec\", \"local-"
"dynamic\" or \"global-dynamic\""
msgstr ""
-#: c-common.c:5801 c-common.c:5896
+#: c-common.c:6397 c-common.c:6487
#, gcc-internal-format
msgid "%J%qE attribute applies only to functions"
msgstr ""
-#: c-common.c:5806 c-common.c:5901
+#: c-common.c:6402 c-common.c:6492
#, gcc-internal-format
msgid "%Jcan%'t set %qE attribute after definition"
msgstr ""
-#: c-common.c:5857
+#: c-common.c:6448
#, gcc-internal-format
msgid "alloc_size parameter outside range"
msgstr ""
-#: c-common.c:5990
+#: c-common.c:6581
#, gcc-internal-format
msgid "%qE attribute ignored for %qE"
msgstr ""
-#: c-common.c:6049
+#: c-common.c:6640
#, gcc-internal-format
msgid "invalid vector type for attribute %qE"
msgstr ""
-#: c-common.c:6055
+#: c-common.c:6646
#, gcc-internal-format
msgid "vector size not an integral multiple of component size"
msgstr ""
-#: c-common.c:6061
+#: c-common.c:6652
#, gcc-internal-format
msgid "zero vector size"
msgstr ""
-#: c-common.c:6069
+#: c-common.c:6660
#, gcc-internal-format
msgid "number of components of the vector not a power of two"
msgstr ""
-#: c-common.c:6097
+#: c-common.c:6688
#, gcc-internal-format
msgid "nonnull attribute without arguments on a non-prototype"
msgstr ""
-#: c-common.c:6112
+#: c-common.c:6703
#, gcc-internal-format
msgid "nonnull argument has invalid operand number (argument %lu)"
msgstr ""
-#: c-common.c:6131
+#: c-common.c:6722
#, gcc-internal-format
msgid ""
"nonnull argument with out-of-range operand number (argument %lu, operand %lu)"
msgstr ""
-#: c-common.c:6139
+#: c-common.c:6730
#, gcc-internal-format
msgid ""
"nonnull argument references non-pointer operand (argument %lu, operand %lu)"
msgstr ""
-#: c-common.c:6215
+#: c-common.c:6806
#, gcc-internal-format
msgid "not enough variable arguments to fit a sentinel"
msgstr ""
-#: c-common.c:6229
+#: c-common.c:6820
#, gcc-internal-format
msgid "missing sentinel in function call"
msgstr ""
-#: c-common.c:6270
+#: c-common.c:6861
#, gcc-internal-format
msgid "null argument where non-null required (argument %lu)"
msgstr ""
-#: c-common.c:6335
+#: c-common.c:6926
#, gcc-internal-format
msgid "cleanup argument not an identifier"
msgstr ""
-#: c-common.c:6342
+#: c-common.c:6933
#, gcc-internal-format
msgid "cleanup argument not a function"
msgstr ""
-#: c-common.c:6381
+#: c-common.c:6972
#, gcc-internal-format
msgid "%qE attribute requires prototypes with named arguments"
msgstr ""
-#: c-common.c:6392
+#: c-common.c:6983
#, gcc-internal-format
msgid "%qE attribute only applies to variadic functions"
msgstr ""
-#: c-common.c:6404
+#: c-common.c:6995
#, gcc-internal-format
msgid "requested position is not an integer constant"
msgstr ""
-#: c-common.c:6412
+#: c-common.c:7003
#, gcc-internal-format
msgid "requested position is less than zero"
msgstr ""
-#: c-common.c:6736
+#: c-common.c:7051
+#, gcc-internal-format
+msgid "%qE attribute is not supported on this machine"
+msgstr ""
+
+#: c-common.c:7135
+#, gcc-internal-format
+msgid "Bad option %s to optimize attribute."
+msgstr ""
+
+#: c-common.c:7138
+#, gcc-internal-format
+msgid "Bad option %s to pragma attribute"
+msgstr ""
+
+#: c-common.c:7326
+#, gcc-internal-format
+msgid "not enough arguments to function %qE"
+msgstr ""
+
+#: c-common.c:7331 c-typeck.c:2527
+#, gcc-internal-format
+msgid "too many arguments to function %qE"
+msgstr ""
+
+#: c-common.c:7361 c-common.c:7407
+#, gcc-internal-format
+msgid "non-floating-point argument in call to function %qE"
+msgstr ""
+
+#: c-common.c:7384
+#, gcc-internal-format
+msgid "non-floating-point arguments in call to function %qE"
+msgstr ""
+
+#: c-common.c:7400
+#, gcc-internal-format
+msgid "non-const integer argument %u in call to function %qE"
+msgstr ""
+
+#: c-common.c:7626
#, gcc-internal-format
msgid ""
"%Hignoring return value of %qD, declared with attribute warn_unused_result"
msgstr ""
-#: c-common.c:6740
+#: c-common.c:7630
#, gcc-internal-format
msgid ""
"%Hignoring return value of function declared with attribute "
"warn_unused_result"
msgstr ""
-#: c-common.c:6793
+#: c-common.c:7684
#, gcc-internal-format
msgid "cannot apply %<offsetof%> to static data member %qD"
msgstr ""
-#: c-common.c:6797
+#: c-common.c:7689
#, gcc-internal-format
msgid "cannot apply %<offsetof%> when %<operator[]%> is overloaded"
msgstr ""
-#: c-common.c:6818 cp/typeck.c:4522
+#: c-common.c:7710 cp/typeck.c:4565
#, gcc-internal-format
msgid "attempt to take address of bit-field structure member %qD"
msgstr ""
-#: c-common.c:6871
+#: c-common.c:7763
#, gcc-internal-format
msgid "lvalue required as left operand of assignment"
msgstr ""
-#: c-common.c:6874
+#: c-common.c:7766
#, gcc-internal-format
msgid "lvalue required as increment operand"
msgstr ""
-#: c-common.c:6877
+#: c-common.c:7769
#, gcc-internal-format
msgid "lvalue required as decrement operand"
msgstr ""
-#: c-common.c:6880
+#: c-common.c:7772
#, gcc-internal-format
msgid "lvalue required as unary %<&%> operand"
msgstr ""
-#: c-common.c:6883
+#: c-common.c:7775
#, gcc-internal-format
msgid "lvalue required in asm statement"
msgstr ""
-#: c-common.c:7005
+#: c-common.c:7897
#, gcc-internal-format
msgid "size of array is too large"
msgstr ""
-#: c-common.c:7041 c-common.c:7090 c-typeck.c:2716
+#: c-common.c:7933 c-common.c:7982 c-typeck.c:2717
#, gcc-internal-format
msgid "too few arguments to function %qE"
msgstr ""
#. ??? This should not be an error when inlining calls to
#. unprototyped functions.
-#: c-common.c:7058 c-typeck.c:4385
+#: c-common.c:7950 c-typeck.c:4396
#, gcc-internal-format
msgid "incompatible type for argument %d of %qE"
msgstr ""
-#: c-common.c:7250
+#: c-common.c:8142
#, gcc-internal-format
msgid "array subscript has type %<char%>"
msgstr ""
-#: c-common.c:7273
+#: c-common.c:8165
#, gcc-internal-format
msgid "suggest parentheses around + or - inside shift"
msgstr ""
-#: c-common.c:7281
+#: c-common.c:8173
#, gcc-internal-format
msgid "suggest parentheses around && within ||"
msgstr ""
-#: c-common.c:7291
+#: c-common.c:8183
#, gcc-internal-format
msgid "suggest parentheses around arithmetic in operand of |"
msgstr ""
-#: c-common.c:7296
+#: c-common.c:8188
#, gcc-internal-format
msgid "suggest parentheses around comparison in operand of |"
msgstr ""
-#: c-common.c:7306
+#: c-common.c:8198
#, gcc-internal-format
msgid "suggest parentheses around arithmetic in operand of ^"
msgstr ""
-#: c-common.c:7311
+#: c-common.c:8203
#, gcc-internal-format
msgid "suggest parentheses around comparison in operand of ^"
msgstr ""
-#: c-common.c:7319
+#: c-common.c:8211
#, gcc-internal-format
msgid "suggest parentheses around + or - in operand of &"
msgstr ""
-#: c-common.c:7324
+#: c-common.c:8216
#, gcc-internal-format
msgid "suggest parentheses around comparison in operand of &"
msgstr ""
-#: c-common.c:7332
+#: c-common.c:8224
#, gcc-internal-format
msgid "suggest parentheses around comparison in operand of %s"
msgstr ""
-#: c-common.c:7341
+#: c-common.c:8233
#, gcc-internal-format
msgid "comparisons like X<=Y<=Z do not have their mathematical meaning"
msgstr ""
-#: c-common.c:7354
+#: c-common.c:8246
#, gcc-internal-format
msgid "label %q+D defined but not used"
msgstr ""
-#: c-common.c:7356
+#: c-common.c:8248
#, gcc-internal-format
msgid "label %q+D declared but not defined"
msgstr ""
-#: c-common.c:7375
+#: c-common.c:8267
#, gcc-internal-format
msgid "division by zero"
msgstr ""
+#: c-common.c:8295
+#, gcc-internal-format
+msgid "comparison between types %qT and %qT"
+msgstr ""
+
+#: c-common.c:8343
+#, gcc-internal-format
+msgid "comparison between signed and unsigned integer expressions"
+msgstr ""
+
+#: c-common.c:8394
+#, gcc-internal-format
+msgid "promoted ~unsigned is always non-zero"
+msgstr ""
+
+#: c-common.c:8397
+#, gcc-internal-format
+msgid "comparison of promoted ~unsigned with constant"
+msgstr ""
+
+#: c-common.c:8407
+#, gcc-internal-format
+msgid "comparison of promoted ~unsigned with unsigned"
+msgstr ""
+
#. Except for passing an argument to an unprototyped function,
#. this is a constraint violation. When passing an argument to
#. an unprototyped function, it is compile-time undefined;
#. making it a constraint in that case was rejected in
#. DR#252.
-#: c-convert.c:95 c-typeck.c:1785 c-typeck.c:4023 cp/typeck.c:1537
-#: cp/typeck.c:5714 cp/typeck.c:6341 fortran/convert.c:88
-#: treelang/tree-convert.c:79
+#: c-convert.c:95 c-typeck.c:1784 c-typeck.c:4027 cp/typeck.c:1583
+#: cp/typeck.c:5813 cp/typeck.c:6462 fortran/convert.c:88
#, gcc-internal-format
msgid "void value not ignored as it ought to be"
msgstr ""
-#: c-convert.c:118 fortran/convert.c:121 java/typeck.c:152
-#: treelang/tree-convert.c:105
+#: c-convert.c:118 fortran/convert.c:121 java/typeck.c:151
#, gcc-internal-format
msgid "conversion to non-scalar type requested"
msgstr ""
-#: c-decl.c:547
+#: c-decl.c:549
#, gcc-internal-format
msgid "array %q+D assumed to have one element"
msgstr ""
-#: c-decl.c:652
+#: c-decl.c:654
#, gcc-internal-format
msgid "GCC supports only %u nested scopes"
msgstr ""
-#: c-decl.c:738 cp/decl.c:359
+#: c-decl.c:740 cp/decl.c:359
#, gcc-internal-format
msgid "label %q+D used but not defined"
msgstr ""
-#: c-decl.c:779
+#: c-decl.c:781
#, gcc-internal-format
msgid "nested function %q+D declared but never defined"
msgstr ""
-#: c-decl.c:789
+#: c-decl.c:791
#, gcc-internal-format
msgid "inline function %q+D declared but never defined"
msgstr ""
-#: c-decl.c:802 cp/decl.c:609
+#: c-decl.c:804 cp/decl.c:604
#, gcc-internal-format
msgid "unused variable %q+D"
msgstr ""
-#: c-decl.c:806
+#: c-decl.c:808
#, gcc-internal-format
msgid "type of array %q+D completed incompatibly with implicit initialization"
msgstr ""
-#: c-decl.c:1040
+#: c-decl.c:1032
#, gcc-internal-format
msgid ""
"a parameter list with an ellipsis can%'t match an empty parameter name list "
"declaration"
msgstr ""
-#: c-decl.c:1047
+#: c-decl.c:1039
#, gcc-internal-format
msgid ""
"an argument type that has a default promotion can%'t match an empty "
"parameter name list declaration"
msgstr ""
-#: c-decl.c:1088
+#: c-decl.c:1080
#, gcc-internal-format
msgid ""
"prototype for %q+D declares more arguments than previous old-style definition"
msgstr ""
-#: c-decl.c:1094
+#: c-decl.c:1086
#, gcc-internal-format
msgid ""
"prototype for %q+D declares fewer arguments than previous old-style "
"definition"
msgstr ""
-#: c-decl.c:1103
+#: c-decl.c:1095
#, gcc-internal-format
msgid "prototype for %q+D declares argument %d with incompatible type"
msgstr ""
#. If we get here, no errors were found, but do issue a warning
#. for this poor-style construct.
-#: c-decl.c:1116
+#: c-decl.c:1108
#, gcc-internal-format
msgid "prototype for %q+D follows non-prototype definition"
msgstr ""
-#: c-decl.c:1131
+#: c-decl.c:1123
#, gcc-internal-format
msgid "previous definition of %q+D was here"
msgstr ""
-#: c-decl.c:1133
+#: c-decl.c:1125
#, gcc-internal-format
msgid "previous implicit declaration of %q+D was here"
msgstr ""
-#: c-decl.c:1135
+#: c-decl.c:1127
#, gcc-internal-format
msgid "previous declaration of %q+D was here"
msgstr ""
-#: c-decl.c:1175
+#: c-decl.c:1167
#, gcc-internal-format
msgid "%q+D redeclared as different kind of symbol"
msgstr ""
-#: c-decl.c:1179
+#: c-decl.c:1171
#, gcc-internal-format
msgid "built-in function %q+D declared as non-function"
msgstr ""
-#: c-decl.c:1182 c-decl.c:1299 c-decl.c:1988
+#: c-decl.c:1174 c-decl.c:1294 c-decl.c:1969
#, gcc-internal-format
msgid "declaration of %q+D shadows a built-in function"
msgstr ""
-#: c-decl.c:1191
+#: c-decl.c:1183
#, gcc-internal-format
msgid "redeclaration of enumerator %q+D"
msgstr ""
@@ -18212,279 +18141,269 @@ msgstr ""
#. If types don't match for a built-in, throw away the
#. built-in. No point in calling locate_old_decl here, it
#. won't print anything.
-#: c-decl.c:1212
+#: c-decl.c:1204
#, gcc-internal-format
msgid "conflicting types for built-in function %q+D"
msgstr ""
-#: c-decl.c:1236 c-decl.c:1249 c-decl.c:1259
+#: c-decl.c:1229 c-decl.c:1242 c-decl.c:1251
#, gcc-internal-format
msgid "conflicting types for %q+D"
msgstr ""
-#: c-decl.c:1257
+#: c-decl.c:1249
#, gcc-internal-format
msgid "conflicting type qualifiers for %q+D"
msgstr ""
#. Allow OLDDECL to continue in use.
-#: c-decl.c:1274
+#: c-decl.c:1269
#, gcc-internal-format
msgid "redefinition of typedef %q+D"
msgstr ""
-#: c-decl.c:1325 c-decl.c:1427
+#: c-decl.c:1320 c-decl.c:1422
#, gcc-internal-format
msgid "redefinition of %q+D"
msgstr ""
-#: c-decl.c:1360 c-decl.c:1465
+#: c-decl.c:1355 c-decl.c:1460
#, gcc-internal-format
msgid "static declaration of %q+D follows non-static declaration"
msgstr ""
-#: c-decl.c:1370 c-decl.c:1377 c-decl.c:1454 c-decl.c:1462
+#: c-decl.c:1365 c-decl.c:1373 c-decl.c:1450 c-decl.c:1457
#, gcc-internal-format
msgid "non-static declaration of %q+D follows static declaration"
msgstr ""
-#: c-decl.c:1394
+#: c-decl.c:1389
#, gcc-internal-format
msgid "%<gnu_inline%> attribute present on %q+D"
msgstr ""
-#: c-decl.c:1396
+#: c-decl.c:1391
#, gcc-internal-format
msgid "%Jbut not here"
msgstr ""
-#: c-decl.c:1414
+#: c-decl.c:1409
#, gcc-internal-format
msgid "thread-local declaration of %q+D follows non-thread-local declaration"
msgstr ""
-#: c-decl.c:1417
+#: c-decl.c:1412
#, gcc-internal-format
msgid "non-thread-local declaration of %q+D follows thread-local declaration"
msgstr ""
-#: c-decl.c:1447
+#: c-decl.c:1442
#, gcc-internal-format
msgid "extern declaration of %q+D follows declaration with no linkage"
msgstr ""
-#: c-decl.c:1483
+#: c-decl.c:1478
#, gcc-internal-format
msgid "declaration of %q+D with no linkage follows extern declaration"
msgstr ""
-#: c-decl.c:1489
+#: c-decl.c:1484
#, gcc-internal-format
msgid "redeclaration of %q+D with no linkage"
msgstr ""
-#: c-decl.c:1503
+#: c-decl.c:1498
#, gcc-internal-format
msgid ""
"redeclaration of %q+D with different visibility (old visibility preserved)"
msgstr ""
-#: c-decl.c:1514
+#: c-decl.c:1509
#, gcc-internal-format
msgid "inline declaration of %qD follows declaration with attribute noinline"
msgstr ""
-#: c-decl.c:1521
+#: c-decl.c:1516
#, gcc-internal-format
msgid "declaration of %q+D with attribute noinline follows inline declaration "
msgstr ""
-#: c-decl.c:1540
-#, gcc-internal-format
-msgid "%q+D declared inline after being called"
-msgstr ""
-
-#: c-decl.c:1545
-#, gcc-internal-format
-msgid "%q+D declared inline after its definition"
-msgstr ""
-
-#: c-decl.c:1564
+#: c-decl.c:1534
#, gcc-internal-format
msgid "redefinition of parameter %q+D"
msgstr ""
-#: c-decl.c:1591
+#: c-decl.c:1561
#, gcc-internal-format
msgid "redundant redeclaration of %q+D"
msgstr ""
-#: c-decl.c:1975
+#: c-decl.c:1956
#, gcc-internal-format
msgid "declaration of %q+D shadows previous non-variable"
msgstr ""
-#: c-decl.c:1980
+#: c-decl.c:1961
#, gcc-internal-format
msgid "declaration of %q+D shadows a parameter"
msgstr ""
-#: c-decl.c:1983
+#: c-decl.c:1964
#, gcc-internal-format
msgid "declaration of %q+D shadows a global declaration"
msgstr ""
-#: c-decl.c:1993
+#: c-decl.c:1974
#, gcc-internal-format
msgid "declaration of %q+D shadows a previous local"
msgstr ""
-#: c-decl.c:1996 cp/name-lookup.c:987 cp/name-lookup.c:1018
-#: cp/name-lookup.c:1026
+#: c-decl.c:1977 cp/name-lookup.c:1031 cp/name-lookup.c:1062
+#: cp/name-lookup.c:1070
#, gcc-internal-format
msgid "%Jshadowed declaration is here"
msgstr ""
-#: c-decl.c:2188
+#: c-decl.c:2169
#, gcc-internal-format
msgid "nested extern declaration of %qD"
msgstr ""
-#: c-decl.c:2351 c-decl.c:2354
+#: c-decl.c:2335 c-decl.c:2338
#, gcc-internal-format
msgid "implicit declaration of function %qE"
msgstr ""
-#: c-decl.c:2416
+#: c-decl.c:2400
#, gcc-internal-format
msgid "incompatible implicit declaration of built-in function %qD"
msgstr ""
-#: c-decl.c:2425
+#: c-decl.c:2409
#, gcc-internal-format
msgid "incompatible implicit declaration of function %qD"
msgstr ""
-#: c-decl.c:2478
+#: c-decl.c:2462
#, gcc-internal-format
msgid "%H%qE undeclared here (not in a function)"
msgstr ""
-#: c-decl.c:2483
+#: c-decl.c:2467
#, gcc-internal-format
msgid "%H%qE undeclared (first use in this function)"
msgstr ""
-#: c-decl.c:2487
+#: c-decl.c:2471
#, gcc-internal-format
msgid "%H(Each undeclared identifier is reported only once"
msgstr ""
-#: c-decl.c:2488
+#: c-decl.c:2472
#, gcc-internal-format
msgid "%Hfor each function it appears in.)"
msgstr ""
-#: c-decl.c:2526 cp/decl.c:2399
+#: c-decl.c:2510 cp/decl.c:2391
#, gcc-internal-format
msgid "label %qE referenced outside of any function"
msgstr ""
-#: c-decl.c:2568
+#: c-decl.c:2552
#, gcc-internal-format
msgid "duplicate label declaration %qE"
msgstr ""
-#: c-decl.c:2604
+#: c-decl.c:2588
#, gcc-internal-format
msgid "%Hduplicate label %qD"
msgstr ""
-#: c-decl.c:2614
+#: c-decl.c:2598
#, gcc-internal-format
msgid "%Jjump into statement expression"
msgstr ""
-#: c-decl.c:2616
+#: c-decl.c:2600
#, gcc-internal-format
msgid "%Jjump into scope of identifier with variably modified type"
msgstr ""
-#: c-decl.c:2631
+#: c-decl.c:2615
#, gcc-internal-format
msgid ""
"%Htraditional C lacks a separate namespace for labels, identifier %qE "
"conflicts"
msgstr ""
-#: c-decl.c:2706
+#: c-decl.c:2690
#, gcc-internal-format
msgid "%H%qE defined as wrong kind of tag"
msgstr ""
-#: c-decl.c:2908
+#: c-decl.c:2888
#, gcc-internal-format
msgid "unnamed struct/union that defines no instances"
msgstr ""
-#: c-decl.c:2916
+#: c-decl.c:2897
#, gcc-internal-format
msgid "empty declaration with storage class specifier does not redeclare tag"
msgstr ""
-#: c-decl.c:2927
+#: c-decl.c:2909
#, gcc-internal-format
msgid "empty declaration with type qualifier does not redeclare tag"
msgstr ""
-#: c-decl.c:2948 c-decl.c:2955
+#: c-decl.c:2931 c-decl.c:2938
#, gcc-internal-format
msgid "useless type name in empty declaration"
msgstr ""
-#: c-decl.c:2963
+#: c-decl.c:2946
#, gcc-internal-format
msgid "%<inline%> in empty declaration"
msgstr ""
-#: c-decl.c:2969
+#: c-decl.c:2952
#, gcc-internal-format
msgid "%<auto%> in file-scope empty declaration"
msgstr ""
-#: c-decl.c:2975
+#: c-decl.c:2958
#, gcc-internal-format
msgid "%<register%> in file-scope empty declaration"
msgstr ""
-#: c-decl.c:2981
+#: c-decl.c:2964
#, gcc-internal-format
msgid "useless storage class specifier in empty declaration"
msgstr ""
-#: c-decl.c:2987
+#: c-decl.c:2970
#, gcc-internal-format
msgid "useless %<__thread%> in empty declaration"
msgstr ""
-#: c-decl.c:2995
+#: c-decl.c:2978
#, gcc-internal-format
msgid "useless type qualifier in empty declaration"
msgstr ""
-#: c-decl.c:3002
+#: c-decl.c:2985 c-parser.c:1170
#, gcc-internal-format
msgid "empty declaration"
msgstr ""
-#: c-decl.c:3068
+#: c-decl.c:3052
#, gcc-internal-format
msgid ""
"ISO C90 does not support %<static%> or type qualifiers in parameter array "
"declarators"
msgstr ""
-#: c-decl.c:3071
+#: c-decl.c:3056
#, gcc-internal-format
msgid "ISO C90 does not support %<[*]%> array declarators"
msgstr ""
@@ -18492,248 +18411,248 @@ msgstr ""
#. C99 6.7.5.2p4
#. A function definition isn't function prototype scope C99 6.2.1p4.
#. C99 6.7.5.2p4
-#: c-decl.c:3078 c-decl.c:5014
+#: c-decl.c:3063 c-decl.c:4990
#, gcc-internal-format
msgid "%<[*]%> not allowed in other than function prototype scope"
msgstr ""
-#: c-decl.c:3181
+#: c-decl.c:3165
#, gcc-internal-format
msgid "%q+D is usually a function"
msgstr ""
-#: c-decl.c:3190 cp/decl.c:3992 cp/decl2.c:773
+#: c-decl.c:3174 cp/decl2.c:775
#, gcc-internal-format
msgid "typedef %qD is initialized (use __typeof__ instead)"
msgstr ""
-#: c-decl.c:3195
+#: c-decl.c:3179
#, gcc-internal-format
msgid "function %qD is initialized like a variable"
msgstr ""
#. DECL_INITIAL in a PARM_DECL is really DECL_ARG_TYPE.
-#: c-decl.c:3201
+#: c-decl.c:3185
#, gcc-internal-format
msgid "parameter %qD is initialized"
msgstr ""
-#: c-decl.c:3226
+#: c-decl.c:3210
#, gcc-internal-format
msgid "variable %qD has initializer but incomplete type"
msgstr ""
-#: c-decl.c:3314 c-decl.c:6107 cp/decl.c:4034 cp/decl.c:11070
+#: c-decl.c:3299 c-decl.c:6088 cp/decl.c:4045 cp/decl.c:11279
#, gcc-internal-format
msgid "inline function %q+D given attribute noinline"
msgstr ""
-#: c-decl.c:3326
+#: c-decl.c:3312
#, gcc-internal-format
msgid "%q+D is static but declared in inline function %qD which is not static"
msgstr ""
-#: c-decl.c:3417
+#: c-decl.c:3403
#, gcc-internal-format
msgid "initializer fails to determine size of %q+D"
msgstr ""
-#: c-decl.c:3422
+#: c-decl.c:3408
#, gcc-internal-format
msgid "array size missing in %q+D"
msgstr ""
-#: c-decl.c:3434
+#: c-decl.c:3420
#, gcc-internal-format
msgid "zero or negative size array %q+D"
msgstr ""
-#: c-decl.c:3489 varasm.c:2067
+#: c-decl.c:3475 varasm.c:2111
#, gcc-internal-format
msgid "storage size of %q+D isn%'t known"
msgstr ""
-#: c-decl.c:3499
+#: c-decl.c:3486
#, gcc-internal-format
msgid "storage size of %q+D isn%'t constant"
msgstr ""
-#: c-decl.c:3544
+#: c-decl.c:3533
#, gcc-internal-format
msgid "ignoring asm-specifier for non-static local variable %q+D"
msgstr ""
-#: c-decl.c:3572 fortran/f95-lang.c:655
+#: c-decl.c:3561 fortran/f95-lang.c:627
#, gcc-internal-format
msgid "cannot put object with volatile field into register"
msgstr ""
-#: c-decl.c:3701
+#: c-decl.c:3687
#, gcc-internal-format
msgid "ISO C forbids forward parameter declarations"
msgstr ""
-#: c-decl.c:3820
+#: c-decl.c:3806
#, gcc-internal-format
msgid "bit-field %qs width not an integer constant"
msgstr ""
-#: c-decl.c:3828
+#: c-decl.c:3814
#, gcc-internal-format
msgid "negative width in bit-field %qs"
msgstr ""
-#: c-decl.c:3833
+#: c-decl.c:3819
#, gcc-internal-format
msgid "zero width for bit-field %qs"
msgstr ""
-#: c-decl.c:3843
+#: c-decl.c:3829
#, gcc-internal-format
msgid "bit-field %qs has invalid type"
msgstr ""
-#: c-decl.c:3853
+#: c-decl.c:3839
#, gcc-internal-format
msgid "type of bit-field %qs is a GCC extension"
msgstr ""
-#: c-decl.c:3859
+#: c-decl.c:3845
#, gcc-internal-format
msgid "width of %qs exceeds its type"
msgstr ""
-#: c-decl.c:3872
+#: c-decl.c:3858
#, gcc-internal-format
msgid "%qs is narrower than values of its type"
msgstr ""
-#: c-decl.c:3891
+#: c-decl.c:3876
#, gcc-internal-format
msgid "ISO C90 forbids array %qs whose size can%'t be evaluated"
msgstr ""
-#: c-decl.c:3895
+#: c-decl.c:3880
#, gcc-internal-format
msgid "ISO C90 forbids array whose size can%'t be evaluated"
msgstr ""
-#: c-decl.c:3901
+#: c-decl.c:3886
#, gcc-internal-format
msgid "ISO C90 forbids variable length array %qs"
msgstr ""
-#: c-decl.c:3904
+#: c-decl.c:3889
#, gcc-internal-format
msgid "ISO C90 forbids variable length array"
msgstr ""
-#: c-decl.c:3913
+#: c-decl.c:3898
#, gcc-internal-format
msgid "the size of array %qs can%'t be evaluated"
msgstr ""
-#: c-decl.c:3917
+#: c-decl.c:3902
#, gcc-internal-format
msgid "the size of array can %'t be evaluated"
msgstr ""
-#: c-decl.c:3923
+#: c-decl.c:3908
#, gcc-internal-format
msgid "variable length array %qs is used"
msgstr ""
-#: c-decl.c:3927 cp/decl.c:7065
+#: c-decl.c:3912 cp/decl.c:7145
#, gcc-internal-format
msgid "variable length array is used"
msgstr ""
-#: c-decl.c:4050 c-decl.c:4327
+#: c-decl.c:4034 c-decl.c:4315
#, gcc-internal-format
msgid "variably modified %qs at file scope"
msgstr ""
-#: c-decl.c:4068
+#: c-decl.c:4052
#, gcc-internal-format
msgid "type defaults to %<int%> in declaration of %qs"
msgstr ""
-#: c-decl.c:4096
+#: c-decl.c:4080
#, gcc-internal-format
msgid "duplicate %<const%>"
msgstr ""
-#: c-decl.c:4098
+#: c-decl.c:4082
#, gcc-internal-format
msgid "duplicate %<restrict%>"
msgstr ""
-#: c-decl.c:4100
+#: c-decl.c:4084
#, gcc-internal-format
msgid "duplicate %<volatile%>"
msgstr ""
-#: c-decl.c:4119
+#: c-decl.c:4104
#, gcc-internal-format
msgid "function definition declared %<auto%>"
msgstr ""
-#: c-decl.c:4121
+#: c-decl.c:4106
#, gcc-internal-format
msgid "function definition declared %<register%>"
msgstr ""
-#: c-decl.c:4123
+#: c-decl.c:4108
#, gcc-internal-format
msgid "function definition declared %<typedef%>"
msgstr ""
-#: c-decl.c:4125
+#: c-decl.c:4110
#, gcc-internal-format
msgid "function definition declared %<__thread%>"
msgstr ""
-#: c-decl.c:4141
+#: c-decl.c:4126
#, gcc-internal-format
msgid "storage class specified for structure field %qs"
msgstr ""
-#: c-decl.c:4145 cp/decl.c:7935
+#: c-decl.c:4130 cp/decl.c:8031
#, gcc-internal-format
msgid "storage class specified for parameter %qs"
msgstr ""
-#: c-decl.c:4148 cp/decl.c:7937
+#: c-decl.c:4133 cp/decl.c:8033
#, gcc-internal-format
msgid "storage class specified for typename"
msgstr ""
-#: c-decl.c:4165 cp/decl.c:7954
+#: c-decl.c:4150 cp/decl.c:9270
#, gcc-internal-format
msgid "%qs initialized and declared %<extern%>"
msgstr ""
-#: c-decl.c:4168 cp/decl.c:7957
+#: c-decl.c:4153 cp/decl.c:9274
#, gcc-internal-format
msgid "%qs has both %<extern%> and initializer"
msgstr ""
-#: c-decl.c:4173
+#: c-decl.c:4158
#, gcc-internal-format
msgid "file-scope declaration of %qs specifies %<auto%>"
msgstr ""
-#: c-decl.c:4175
+#: c-decl.c:4161
#, gcc-internal-format
msgid "file-scope declaration of %qs specifies %<register%>"
msgstr ""
-#: c-decl.c:4180 cp/decl.c:7961
+#: c-decl.c:4166 cp/decl.c:8044
#, gcc-internal-format
msgid "nested function %qs declared %<extern%>"
msgstr ""
-#: c-decl.c:4183 cp/decl.c:7971
+#: c-decl.c:4169 cp/decl.c:8054
#, gcc-internal-format
msgid "function-scope %qs implicitly auto and declared %<__thread%>"
msgstr ""
@@ -18741,470 +18660,474 @@ msgstr ""
#. Only the innermost declarator (making a parameter be of
#. array type which is converted to pointer type)
#. may have static or type qualifiers.
-#: c-decl.c:4230 c-decl.c:4471
+#: c-decl.c:4216 c-decl.c:4460
#, gcc-internal-format
msgid "static or type qualifiers in non-parameter array declarator"
msgstr ""
-#: c-decl.c:4277
+#: c-decl.c:4263
#, gcc-internal-format
msgid "declaration of %qs as array of voids"
msgstr ""
-#: c-decl.c:4283
+#: c-decl.c:4269
#, gcc-internal-format
msgid "declaration of %qs as array of functions"
msgstr ""
-#: c-decl.c:4288
+#: c-decl.c:4275
#, gcc-internal-format
msgid "invalid use of structure with flexible array member"
msgstr ""
-#: c-decl.c:4308
+#: c-decl.c:4295
#, gcc-internal-format
msgid "size of array %qs has non-integer type"
msgstr ""
-#: c-decl.c:4313
+#: c-decl.c:4301
#, gcc-internal-format
msgid "ISO C forbids zero-size array %qs"
msgstr ""
-#: c-decl.c:4320
+#: c-decl.c:4308
#, gcc-internal-format
msgid "size of array %qs is negative"
msgstr ""
-#: c-decl.c:4374 c-decl.c:4630 cp/decl.c:8436
+#: c-decl.c:4362 c-decl.c:4621 cp/decl.c:8524
#, gcc-internal-format
msgid "size of array %qs is too large"
msgstr ""
-#: c-decl.c:4385
+#: c-decl.c:4374
#, gcc-internal-format
msgid "ISO C90 does not support flexible array members"
msgstr ""
#. C99 6.7.5.2p4
-#: c-decl.c:4398
+#: c-decl.c:4387
#, gcc-internal-format
msgid "%<[*]%> not allowed in other than a declaration"
msgstr ""
-#: c-decl.c:4421
+#: c-decl.c:4410
#, gcc-internal-format
msgid "array type has incomplete element type"
msgstr ""
-#: c-decl.c:4503 cp/decl.c:8062
+#: c-decl.c:4492 cp/decl.c:8149
#, gcc-internal-format
msgid "%qs declared as function returning a function"
msgstr ""
-#: c-decl.c:4508 cp/decl.c:8067
+#: c-decl.c:4497 cp/decl.c:8154
#, gcc-internal-format
msgid "%qs declared as function returning an array"
msgstr ""
-#: c-decl.c:4530
+#: c-decl.c:4520
#, gcc-internal-format
msgid "function definition has qualified void return type"
msgstr ""
-#: c-decl.c:4533 cp/decl.c:8051 cp/pt.c:8679
+#: c-decl.c:4523 cp/decl.c:8138
#, gcc-internal-format
msgid "type qualifiers ignored on function return type"
msgstr ""
-#: c-decl.c:4562 c-decl.c:4643 c-decl.c:4731 c-decl.c:4824
+#: c-decl.c:4553 c-decl.c:4635 c-decl.c:4725 c-decl.c:4814
#, gcc-internal-format
msgid "ISO C forbids qualified function types"
msgstr ""
-#: c-decl.c:4651
+#: c-decl.c:4643
#, gcc-internal-format
msgid "typedef %q+D declared %<inline%>"
msgstr ""
-#: c-decl.c:4666
+#: c-decl.c:4659
#, gcc-internal-format
msgid "ISO C forbids const or volatile function types"
msgstr ""
-#. C99 6.7.2.1p8
-#: c-decl.c:4676
+#: c-decl.c:4670
#, gcc-internal-format
msgid "a member of a structure or union cannot have a variably modified type"
msgstr ""
-#: c-decl.c:4692
+#: c-decl.c:4686
#, gcc-internal-format
msgid "variable or field %qs declared void"
msgstr ""
-#: c-decl.c:4724
+#: c-decl.c:4717
#, gcc-internal-format
msgid "attributes in parameter array declarator ignored"
msgstr ""
-#: c-decl.c:4759
+#: c-decl.c:4751
#, gcc-internal-format
msgid "parameter %q+D declared %<inline%>"
msgstr ""
-#: c-decl.c:4772
+#: c-decl.c:4764
#, gcc-internal-format
msgid "field %qs declared as a function"
msgstr ""
-#: c-decl.c:4778
+#: c-decl.c:4770
#, gcc-internal-format
msgid "field %qs has incomplete type"
msgstr ""
-#: c-decl.c:4795 c-decl.c:4807 c-decl.c:4811
+#: c-decl.c:4787 c-decl.c:4797 c-decl.c:4800
#, gcc-internal-format
msgid "invalid storage class for function %qs"
msgstr ""
-#: c-decl.c:4830
+#: c-decl.c:4820
#, gcc-internal-format
msgid "%<noreturn%> function returns non-void value"
msgstr ""
-#: c-decl.c:4866
+#: c-decl.c:4856
#, gcc-internal-format
msgid "cannot inline function %<main%>"
msgstr ""
-#: c-decl.c:4909
+#: c-decl.c:4885
#, gcc-internal-format
msgid "variable previously declared %<static%> redeclared %<extern%>"
msgstr ""
-#: c-decl.c:4919
+#: c-decl.c:4895
#, gcc-internal-format
msgid "variable %q+D declared %<inline%>"
msgstr ""
#. C99 6.7.5.2p2
-#: c-decl.c:4950
+#: c-decl.c:4926
#, gcc-internal-format
msgid "object with variably modified type must have no linkage"
msgstr ""
-#: c-decl.c:5019 c-decl.c:6198
+#: c-decl.c:4995 c-decl.c:6182
#, gcc-internal-format
msgid "function declaration isn%'t a prototype"
msgstr ""
-#: c-decl.c:5027
+#: c-decl.c:5003
#, gcc-internal-format
msgid "parameter names (without types) in function declaration"
msgstr ""
-#: c-decl.c:5060
+#: c-decl.c:5036
#, gcc-internal-format
msgid "parameter %u (%q+D) has incomplete type"
msgstr ""
-#: c-decl.c:5063
+#: c-decl.c:5039
#, gcc-internal-format
msgid "%Jparameter %u has incomplete type"
msgstr ""
-#: c-decl.c:5072
+#: c-decl.c:5048
#, gcc-internal-format
msgid "parameter %u (%q+D) has void type"
msgstr ""
-#: c-decl.c:5075
+#: c-decl.c:5051
#, gcc-internal-format
msgid "%Jparameter %u has void type"
msgstr ""
-#: c-decl.c:5137
+#: c-decl.c:5113
#, gcc-internal-format
msgid "%<void%> as only parameter may not be qualified"
msgstr ""
-#: c-decl.c:5141 c-decl.c:5175
+#: c-decl.c:5117 c-decl.c:5151
#, gcc-internal-format
msgid "%<void%> must be the only parameter"
msgstr ""
-#: c-decl.c:5169
+#: c-decl.c:5145
#, gcc-internal-format
msgid "parameter %q+D has just a forward declaration"
msgstr ""
#. The %s will be one of 'struct', 'union', or 'enum'.
-#: c-decl.c:5214
+#: c-decl.c:5190
#, gcc-internal-format
msgid "%<%s %E%> declared inside parameter list"
msgstr ""
#. The %s will be one of 'struct', 'union', or 'enum'.
-#: c-decl.c:5218
+#: c-decl.c:5194
#, gcc-internal-format
msgid "anonymous %s declared inside parameter list"
msgstr ""
-#: c-decl.c:5223
+#: c-decl.c:5199
#, gcc-internal-format
msgid ""
"its scope is only this definition or declaration, which is probably not what "
"you want"
msgstr ""
-#: c-decl.c:5357
+#: c-decl.c:5333
#, gcc-internal-format
msgid "redefinition of %<union %E%>"
msgstr ""
-#: c-decl.c:5359
+#: c-decl.c:5335
#, gcc-internal-format
msgid "redefinition of %<struct %E%>"
msgstr ""
-#: c-decl.c:5364
+#: c-decl.c:5340
#, gcc-internal-format
msgid "nested redefinition of %<union %E%>"
msgstr ""
-#: c-decl.c:5366
+#: c-decl.c:5342
#, gcc-internal-format
msgid "nested redefinition of %<struct %E%>"
msgstr ""
-#: c-decl.c:5441 cp/decl.c:3785
+#: c-decl.c:5420 cp/decl.c:3783
#, gcc-internal-format
msgid "declaration does not declare anything"
msgstr ""
-#: c-decl.c:5445
+#: c-decl.c:5423
#, gcc-internal-format
msgid "ISO C doesn%'t support unnamed structs/unions"
msgstr ""
-#: c-decl.c:5489 c-decl.c:5505
+#: c-decl.c:5467 c-decl.c:5483
#, gcc-internal-format
msgid "duplicate member %q+D"
msgstr ""
-#: c-decl.c:5544
+#: c-decl.c:5522
#, gcc-internal-format
msgid "union has no named members"
msgstr ""
-#: c-decl.c:5546
+#: c-decl.c:5524
#, gcc-internal-format
msgid "union has no members"
msgstr ""
-#: c-decl.c:5551
+#: c-decl.c:5529
#, gcc-internal-format
msgid "struct has no named members"
msgstr ""
-#: c-decl.c:5553
+#: c-decl.c:5531
#, gcc-internal-format
msgid "struct has no members"
msgstr ""
-#: c-decl.c:5615
+#: c-decl.c:5593
#, gcc-internal-format
msgid "%Jflexible array member in union"
msgstr ""
-#: c-decl.c:5620
+#: c-decl.c:5598
#, gcc-internal-format
msgid "%Jflexible array member not at end of struct"
msgstr ""
-#: c-decl.c:5625
+#: c-decl.c:5603
#, gcc-internal-format
msgid "%Jflexible array member in otherwise empty struct"
msgstr ""
-#: c-decl.c:5632
+#: c-decl.c:5611
#, gcc-internal-format
msgid "%Jinvalid use of structure with flexible array member"
msgstr ""
-#: c-decl.c:5741
+#: c-decl.c:5720
#, gcc-internal-format
msgid "union cannot be made transparent"
msgstr ""
-#: c-decl.c:5812
+#: c-decl.c:5791
#, gcc-internal-format
msgid "nested redefinition of %<enum %E%>"
msgstr ""
#. This enum is a named one that has been declared already.
-#: c-decl.c:5819
+#: c-decl.c:5798
#, gcc-internal-format
msgid "redeclaration of %<enum %E%>"
msgstr ""
-#: c-decl.c:5882
+#: c-decl.c:5861
#, gcc-internal-format
msgid "enumeration values exceed range of largest integer"
msgstr ""
-#: c-decl.c:5899
+#: c-decl.c:5878
#, gcc-internal-format
msgid "specified mode too small for enumeral values"
msgstr ""
-#: c-decl.c:5995
+#: c-decl.c:5977
#, gcc-internal-format
msgid "enumerator value for %qE is not an integer constant"
msgstr ""
-#: c-decl.c:6012
+#: c-decl.c:5994
#, gcc-internal-format
msgid "overflow in enumeration values"
msgstr ""
-#: c-decl.c:6017
+#: c-decl.c:6002
#, gcc-internal-format
msgid "ISO C restricts enumerator values to range of %<int%>"
msgstr ""
-#: c-decl.c:6124
+#: c-decl.c:6106
#, gcc-internal-format
msgid "return type is an incomplete type"
msgstr ""
-#: c-decl.c:6132
+#: c-decl.c:6116
#, gcc-internal-format
msgid "return type defaults to %<int%>"
msgstr ""
-#: c-decl.c:6205
+#: c-decl.c:6189
#, gcc-internal-format
msgid "no previous prototype for %q+D"
msgstr ""
-#: c-decl.c:6214
+#: c-decl.c:6198
#, gcc-internal-format
msgid "%q+D was used with no prototype before its definition"
msgstr ""
-#: c-decl.c:6220 cp/decl.c:11211
+#: c-decl.c:6204 cp/decl.c:11420
#, gcc-internal-format
msgid "no previous declaration for %q+D"
msgstr ""
-#: c-decl.c:6230
+#: c-decl.c:6214
#, gcc-internal-format
msgid "%q+D was used with no declaration before its definition"
msgstr ""
-#: c-decl.c:6253 c-decl.c:6722
+#: c-decl.c:6237
#, gcc-internal-format
msgid "return type of %q+D is not %<int%>"
msgstr ""
-#: c-decl.c:6258
+#: c-decl.c:6242
#, gcc-internal-format
msgid "%q+D is normally a non-static function"
msgstr ""
-#: c-decl.c:6292
+#: c-decl.c:6276
#, gcc-internal-format
msgid "%Jold-style parameter declarations in prototyped function definition"
msgstr ""
-#: c-decl.c:6306
+#: c-decl.c:6290
#, gcc-internal-format
msgid "%Jtraditional C rejects ISO C style function definitions"
msgstr ""
-#: c-decl.c:6322
+#: c-decl.c:6306
#, gcc-internal-format
msgid "%Jparameter name omitted"
msgstr ""
-#: c-decl.c:6356
+#: c-decl.c:6340
#, gcc-internal-format
msgid "%Jold-style function definition"
msgstr ""
-#: c-decl.c:6365
+#: c-decl.c:6349
#, gcc-internal-format
msgid "%Jparameter name missing from parameter list"
msgstr ""
-#: c-decl.c:6376
+#: c-decl.c:6360
#, gcc-internal-format
msgid "%q+D declared as a non-parameter"
msgstr ""
-#: c-decl.c:6381
+#: c-decl.c:6365
#, gcc-internal-format
msgid "multiple parameters named %q+D"
msgstr ""
-#: c-decl.c:6389
+#: c-decl.c:6373
#, gcc-internal-format
msgid "parameter %q+D declared with void type"
msgstr ""
-#: c-decl.c:6406 c-decl.c:6408
+#: c-decl.c:6390 c-decl.c:6392
#, gcc-internal-format
msgid "type of %q+D defaults to %<int%>"
msgstr ""
-#: c-decl.c:6427
+#: c-decl.c:6411
#, gcc-internal-format
msgid "parameter %q+D has incomplete type"
msgstr ""
-#: c-decl.c:6433
+#: c-decl.c:6417
#, gcc-internal-format
msgid "declaration for parameter %q+D but no such parameter"
msgstr ""
-#: c-decl.c:6483
+#: c-decl.c:6467
#, gcc-internal-format
msgid "number of arguments doesn%'t match built-in prototype"
msgstr ""
-#: c-decl.c:6487
+#: c-decl.c:6471
#, gcc-internal-format
msgid "number of arguments doesn%'t match prototype"
msgstr ""
-#: c-decl.c:6488 c-decl.c:6528 c-decl.c:6541
+#: c-decl.c:6472 c-decl.c:6524
#, gcc-internal-format
msgid "%Hprototype declaration"
msgstr ""
-#: c-decl.c:6522
+#: c-decl.c:6506
#, gcc-internal-format
msgid "promoted argument %qD doesn%'t match built-in prototype"
msgstr ""
-#: c-decl.c:6526
+#: c-decl.c:6510
#, gcc-internal-format
msgid "promoted argument %qD doesn%'t match prototype"
msgstr ""
-#: c-decl.c:6536
+#: c-decl.c:6513
+#, gcc-internal-format
+msgid "prototype declaration"
+msgstr ""
+
+#: c-decl.c:6519
#, gcc-internal-format
msgid "argument %qD doesn%'t match built-in prototype"
msgstr ""
-#: c-decl.c:6540
+#: c-decl.c:6523
#, gcc-internal-format
msgid "argument %qD doesn%'t match prototype"
msgstr ""
-#: c-decl.c:6767 cp/decl.c:11905
+#: c-decl.c:6732 cp/decl.c:12116
#, gcc-internal-format
msgid "no return statement in function returning non-void"
msgstr ""
@@ -19212,443 +19135,443 @@ msgstr ""
#. If we get here, declarations have been used in a for loop without
#. the C99 for loop scope. This doesn't make much sense, so don't
#. allow it.
-#: c-decl.c:6840
+#: c-decl.c:6805
#, gcc-internal-format
msgid "%<for%> loop initial declaration used outside C99 mode"
msgstr ""
-#: c-decl.c:6869
+#: c-decl.c:6834
#, gcc-internal-format
msgid "declaration of static variable %q+D in %<for%> loop initial declaration"
msgstr ""
-#: c-decl.c:6872
+#: c-decl.c:6837
#, gcc-internal-format
msgid ""
"declaration of %<extern%> variable %q+D in %<for%> loop initial declaration"
msgstr ""
-#: c-decl.c:6877
+#: c-decl.c:6842
#, gcc-internal-format
msgid "%<struct %E%> declared in %<for%> loop initial declaration"
msgstr ""
-#: c-decl.c:6881
+#: c-decl.c:6846
#, gcc-internal-format
msgid "%<union %E%> declared in %<for%> loop initial declaration"
msgstr ""
-#: c-decl.c:6885
+#: c-decl.c:6850
#, gcc-internal-format
msgid "%<enum %E%> declared in %<for%> loop initial declaration"
msgstr ""
-#: c-decl.c:6889
+#: c-decl.c:6854
#, gcc-internal-format
msgid "declaration of non-variable %q+D in %<for%> loop initial declaration"
msgstr ""
-#: c-decl.c:7177 c-decl.c:7419 c-decl.c:7715
+#: c-decl.c:7146 c-decl.c:7388 c-decl.c:7684
#, gcc-internal-format
msgid "duplicate %qE"
msgstr ""
-#: c-decl.c:7200 c-decl.c:7429 c-decl.c:7616
+#: c-decl.c:7171 c-decl.c:7398 c-decl.c:7585
#, gcc-internal-format
msgid "two or more data types in declaration specifiers"
msgstr ""
-#: c-decl.c:7212 cp/parser.c:2152
+#: c-decl.c:7183
#, gcc-internal-format
msgid "%<long long long%> is too long for GCC"
msgstr ""
-#: c-decl.c:7219 c-decl.c:7519
+#: c-decl.c:7190 c-decl.c:7488
#, gcc-internal-format
msgid "both %<long long%> and %<double%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7225
+#: c-decl.c:7195
#, gcc-internal-format
msgid "ISO C90 does not support %<long long%>"
msgstr ""
-#: c-decl.c:7230 c-decl.c:7259
+#: c-decl.c:7200 c-decl.c:7229
#, gcc-internal-format
msgid "both %<long%> and %<short%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7233 c-decl.c:7436
+#: c-decl.c:7203 c-decl.c:7405
#, gcc-internal-format
msgid "both %<long%> and %<void%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7236 c-decl.c:7458
+#: c-decl.c:7206 c-decl.c:7427
#, gcc-internal-format
msgid "both %<long%> and %<_Bool%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7239 c-decl.c:7480
+#: c-decl.c:7209 c-decl.c:7449
#, gcc-internal-format
msgid "both %<long%> and %<char%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7242 c-decl.c:7500
+#: c-decl.c:7212 c-decl.c:7469
#, gcc-internal-format
msgid "both %<long%> and %<float%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7245
+#: c-decl.c:7215
#, gcc-internal-format
msgid "both %<long%> and %<_Decimal32%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7248
+#: c-decl.c:7218
#, gcc-internal-format
msgid "both %<long%> and %<_Decimal64%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7251
+#: c-decl.c:7221
#, gcc-internal-format
msgid "both %<long%> and %<_Decimal128%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7262 c-decl.c:7439
+#: c-decl.c:7232 c-decl.c:7408
#, gcc-internal-format
msgid "both %<short%> and %<void%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7265 c-decl.c:7461
+#: c-decl.c:7235 c-decl.c:7430
#, gcc-internal-format
msgid "both %<short%> and %<_Bool%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7268 c-decl.c:7483
+#: c-decl.c:7238 c-decl.c:7452
#, gcc-internal-format
msgid "both %<short%> and %<char%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7271 c-decl.c:7503
+#: c-decl.c:7241 c-decl.c:7472
#, gcc-internal-format
msgid "both %<short%> and %<float%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7274 c-decl.c:7522
+#: c-decl.c:7244 c-decl.c:7491
#, gcc-internal-format
msgid "both %<short%> and %<double%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7277
+#: c-decl.c:7247
#, gcc-internal-format
msgid "both %<short%> and %<_Decimal32%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7280
+#: c-decl.c:7250
#, gcc-internal-format
msgid "both %<short%> and %<_Decimal64%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7283
+#: c-decl.c:7253
#, gcc-internal-format
msgid "both %<short%> and %<_Decimal128%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7291 c-decl.c:7320
+#: c-decl.c:7261 c-decl.c:7290
#, gcc-internal-format
msgid "both %<signed%> and %<unsigned%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7294 c-decl.c:7442
+#: c-decl.c:7264 c-decl.c:7411
#, gcc-internal-format
msgid "both %<signed%> and %<void%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7297 c-decl.c:7464
+#: c-decl.c:7267 c-decl.c:7433
#, gcc-internal-format
msgid "both %<signed%> and %<_Bool%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7300 c-decl.c:7506
+#: c-decl.c:7270 c-decl.c:7475
#, gcc-internal-format
msgid "both %<signed%> and %<float%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7303 c-decl.c:7525
+#: c-decl.c:7273 c-decl.c:7494
#, gcc-internal-format
msgid "both %<signed%> and %<double%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7306
+#: c-decl.c:7276
#, gcc-internal-format
msgid "both %<signed%> and %<_Decimal32%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7309
+#: c-decl.c:7279
#, gcc-internal-format
msgid "both %<signed%> and %<_Decimal64%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7312
+#: c-decl.c:7282
#, gcc-internal-format
msgid "both %<signed%> and %<_Decimal128%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7323 c-decl.c:7445
+#: c-decl.c:7293 c-decl.c:7414
#, gcc-internal-format
msgid "both %<unsigned%> and %<void%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7326 c-decl.c:7467
+#: c-decl.c:7296 c-decl.c:7436
#, gcc-internal-format
msgid "both %<unsigned%> and %<_Bool%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7329 c-decl.c:7509
+#: c-decl.c:7299 c-decl.c:7478
#, gcc-internal-format
msgid "both %<unsigned%> and %<float%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7332 c-decl.c:7528
+#: c-decl.c:7302 c-decl.c:7497
#, gcc-internal-format
msgid "both %<unsigned%> and %<double%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7335
+#: c-decl.c:7305
#, gcc-internal-format
msgid "both %<unsigned%> and %<_Decimal32%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7338
+#: c-decl.c:7308
#, gcc-internal-format
msgid "both %<unsigned%> and %<_Decimal64%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7341
+#: c-decl.c:7311
#, gcc-internal-format
msgid "both %<unsigned%> and %<_Decimal128%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7349
+#: c-decl.c:7319
#, gcc-internal-format
msgid "ISO C90 does not support complex types"
msgstr ""
-#: c-decl.c:7351 c-decl.c:7448
+#: c-decl.c:7321 c-decl.c:7417
#, gcc-internal-format
msgid "both %<complex%> and %<void%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7354 c-decl.c:7470
+#: c-decl.c:7324 c-decl.c:7439
#, gcc-internal-format
msgid "both %<complex%> and %<_Bool%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7357
+#: c-decl.c:7327
#, gcc-internal-format
msgid "both %<complex%> and %<_Decimal32%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7360
+#: c-decl.c:7330
#, gcc-internal-format
msgid "both %<complex%> and %<_Decimal64%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7363
+#: c-decl.c:7333
#, gcc-internal-format
msgid "both %<complex%> and %<_Decimal128%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7366
+#: c-decl.c:7336
#, gcc-internal-format
msgid "both %<complex%> and %<_Fract%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7369
+#: c-decl.c:7339
#, gcc-internal-format
msgid "both %<complex%> and %<_Accum%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7372
+#: c-decl.c:7342
#, gcc-internal-format
msgid "both %<complex%> and %<_Sat%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7380
+#: c-decl.c:7349
#, gcc-internal-format
msgid "ISO C does not support saturating types"
msgstr ""
-#: c-decl.c:7382 c-decl.c:7451
+#: c-decl.c:7351 c-decl.c:7420
#, gcc-internal-format
msgid "both %<_Sat%> and %<void%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7385 c-decl.c:7473
+#: c-decl.c:7354 c-decl.c:7442
#, gcc-internal-format
msgid "both %<_Sat%> and %<_Bool%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7388 c-decl.c:7486
+#: c-decl.c:7357 c-decl.c:7455
#, gcc-internal-format
msgid "both %<_Sat%> and %<char%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7391 c-decl.c:7493
+#: c-decl.c:7360 c-decl.c:7462
#, gcc-internal-format
msgid "both %<_Sat%> and %<int%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7394 c-decl.c:7512
+#: c-decl.c:7363 c-decl.c:7481
#, gcc-internal-format
msgid "both %<_Sat%> and %<float%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7397 c-decl.c:7531
+#: c-decl.c:7366 c-decl.c:7500
#, gcc-internal-format
msgid "both %<_Sat%> and %<double%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7400
+#: c-decl.c:7369
#, gcc-internal-format
msgid "both %<_Sat%> and %<_Decimal32%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7403
+#: c-decl.c:7372
#, gcc-internal-format
msgid "both %<_Sat%> and %<_Decimal64%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7406
+#: c-decl.c:7375
#, gcc-internal-format
msgid "both %<_Sat%> and %<_Decimal128%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7409
+#: c-decl.c:7378
#, gcc-internal-format
msgid "both %<_Sat%> and %<complex%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7548
+#: c-decl.c:7517
#, gcc-internal-format
msgid "both %<long long%> and %<%s%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7551
+#: c-decl.c:7520
#, gcc-internal-format
msgid "both %<long%> and %<%s%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7554
+#: c-decl.c:7523
#, gcc-internal-format
msgid "both %<short%> and %<%s%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7557
+#: c-decl.c:7526
#, gcc-internal-format
msgid "both %<signed%> and %<%s%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7560
+#: c-decl.c:7529
#, gcc-internal-format
msgid "both %<unsigned%> and %<%s%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7563 c-decl.c:7589
+#: c-decl.c:7532 c-decl.c:7558
#, gcc-internal-format
msgid "both %<complex%> and %<%s%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7566
+#: c-decl.c:7535
#, gcc-internal-format
msgid "both %<_Sat%> and %<%s%> in declaration specifiers"
msgstr ""
-#: c-decl.c:7576
+#: c-decl.c:7545
#, gcc-internal-format
msgid "decimal floating point not supported for this target"
msgstr ""
-#: c-decl.c:7578
+#: c-decl.c:7547
#, gcc-internal-format
msgid "ISO C does not support decimal floating point"
msgstr ""
-#: c-decl.c:7597
+#: c-decl.c:7566
#, gcc-internal-format
msgid "fixed-point types not supported for this target"
msgstr ""
-#: c-decl.c:7599
+#: c-decl.c:7568
#, gcc-internal-format
msgid "ISO C does not support fixed-point types"
msgstr ""
-#: c-decl.c:7633
+#: c-decl.c:7602
#, gcc-internal-format
msgid "%qE fails to be a typedef or built in type"
msgstr ""
-#: c-decl.c:7666
+#: c-decl.c:7635
#, gcc-internal-format
msgid "%qE is not at beginning of declaration"
msgstr ""
-#: c-decl.c:7680
+#: c-decl.c:7649
#, gcc-internal-format
msgid "%<__thread%> used with %<auto%>"
msgstr ""
-#: c-decl.c:7682
+#: c-decl.c:7651
#, gcc-internal-format
msgid "%<__thread%> used with %<register%>"
msgstr ""
-#: c-decl.c:7684
+#: c-decl.c:7653
#, gcc-internal-format
msgid "%<__thread%> used with %<typedef%>"
msgstr ""
-#: c-decl.c:7695
+#: c-decl.c:7664
#, gcc-internal-format
msgid "%<__thread%> before %<extern%>"
msgstr ""
-#: c-decl.c:7704
+#: c-decl.c:7673
#, gcc-internal-format
msgid "%<__thread%> before %<static%>"
msgstr ""
-#: c-decl.c:7720
+#: c-decl.c:7689
#, gcc-internal-format
msgid "multiple storage classes in declaration specifiers"
msgstr ""
-#: c-decl.c:7727
+#: c-decl.c:7696
#, gcc-internal-format
msgid "%<__thread%> used with %qE"
msgstr ""
-#: c-decl.c:7774
+#: c-decl.c:7743
#, gcc-internal-format
msgid "%<_Sat%> is used without %<_Fract%> or %<_Accum%>"
msgstr ""
-#: c-decl.c:7786
+#: c-decl.c:7755
#, gcc-internal-format
msgid "ISO C does not support plain %<complex%> meaning %<double complex%>"
msgstr ""
-#: c-decl.c:7831 c-decl.c:7857
+#: c-decl.c:7800 c-decl.c:7826
#, gcc-internal-format
msgid "ISO C does not support complex integer types"
msgstr ""
-#: c-decl.c:8007 toplev.c:847
+#: c-decl.c:7976 toplev.c:836
#, gcc-internal-format
msgid "%q+F used but never defined"
msgstr ""
-#: c-format.c:98 c-format.c:207
+#: c-format.c:98 c-format.c:209
#, gcc-internal-format
msgid "format string has invalid operand number"
msgstr ""
@@ -19668,615 +19591,615 @@ msgstr ""
msgid "unrecognized format specifier"
msgstr ""
-#: c-format.c:199
+#: c-format.c:201
#, gcc-internal-format
msgid "%qE is an unrecognized format function type"
msgstr ""
-#: c-format.c:213
+#: c-format.c:215
#, gcc-internal-format
msgid "%<...%> has invalid operand number"
msgstr ""
-#: c-format.c:220
+#: c-format.c:222
#, gcc-internal-format
msgid "format string argument follows the args to be formatted"
msgstr ""
-#: c-format.c:927
+#: c-format.c:933
#, gcc-internal-format
msgid "function might be possible candidate for %qs format attribute"
msgstr ""
-#: c-format.c:1019 c-format.c:1040 c-format.c:2058
+#: c-format.c:1025 c-format.c:1046 c-format.c:2065
#, gcc-internal-format
msgid "missing $ operand number in format"
msgstr ""
-#: c-format.c:1049
+#: c-format.c:1055
#, gcc-internal-format
msgid "%s does not support %%n$ operand number formats"
msgstr ""
-#: c-format.c:1056
+#: c-format.c:1062
#, gcc-internal-format
msgid "operand number out of range in format"
msgstr ""
-#: c-format.c:1079
+#: c-format.c:1085
#, gcc-internal-format
msgid "format argument %d used more than once in %s format"
msgstr ""
-#: c-format.c:1111
+#: c-format.c:1117
#, gcc-internal-format
msgid "$ operand number used after format without operand number"
msgstr ""
-#: c-format.c:1142
+#: c-format.c:1148
#, gcc-internal-format
msgid "format argument %d unused before used argument %d in $-style format"
msgstr ""
-#: c-format.c:1237
+#: c-format.c:1243
#, gcc-internal-format
msgid "format not a string literal, format string not checked"
msgstr ""
-#: c-format.c:1252 c-format.c:1255
+#: c-format.c:1258 c-format.c:1261
#, gcc-internal-format
msgid "format not a string literal and no format arguments"
msgstr ""
-#: c-format.c:1258
+#: c-format.c:1264
#, gcc-internal-format
msgid "format not a string literal, argument types not checked"
msgstr ""
-#: c-format.c:1271
+#: c-format.c:1277
#, gcc-internal-format
msgid "too many arguments for format"
msgstr ""
-#: c-format.c:1274
+#: c-format.c:1280
#, gcc-internal-format
msgid "unused arguments in $-style format"
msgstr ""
-#: c-format.c:1277
+#: c-format.c:1283
#, gcc-internal-format
msgid "zero-length %s format string"
msgstr ""
-#: c-format.c:1281
+#: c-format.c:1287
#, gcc-internal-format
msgid "format is a wide character string"
msgstr ""
-#: c-format.c:1284
+#: c-format.c:1290
#, gcc-internal-format
msgid "unterminated format string"
msgstr ""
-#: c-format.c:1492
+#: c-format.c:1498
#, gcc-internal-format
msgid "embedded %<\\0%> in format"
msgstr ""
-#: c-format.c:1507
+#: c-format.c:1513
#, gcc-internal-format
msgid "spurious trailing %<%%%> in format"
msgstr ""
-#: c-format.c:1551 c-format.c:1821
+#: c-format.c:1557 c-format.c:1828
#, gcc-internal-format
msgid "repeated %s in format"
msgstr ""
-#: c-format.c:1564
+#: c-format.c:1570
#, gcc-internal-format
msgid "missing fill character at end of strfmon format"
msgstr ""
-#: c-format.c:1608 c-format.c:1710 c-format.c:2005 c-format.c:2070
+#: c-format.c:1614 c-format.c:1716 c-format.c:2012 c-format.c:2077
#, gcc-internal-format
msgid "too few arguments for format"
msgstr ""
-#: c-format.c:1649
+#: c-format.c:1655
#, gcc-internal-format
msgid "zero width in %s format"
msgstr ""
-#: c-format.c:1667
+#: c-format.c:1673
#, gcc-internal-format
msgid "empty left precision in %s format"
msgstr ""
-#: c-format.c:1740
+#: c-format.c:1746
#, gcc-internal-format
msgid "empty precision in %s format"
msgstr ""
-#: c-format.c:1805
+#: c-format.c:1812
#, gcc-internal-format
msgid "%s does not support the %qs %s length modifier"
msgstr ""
-#: c-format.c:1838
+#: c-format.c:1845
#, gcc-internal-format
msgid "conversion lacks type at end of format"
msgstr ""
-#: c-format.c:1849
+#: c-format.c:1856
#, gcc-internal-format
msgid "unknown conversion type character %qc in format"
msgstr ""
-#: c-format.c:1852
+#: c-format.c:1859
#, gcc-internal-format
msgid "unknown conversion type character 0x%x in format"
msgstr ""
-#: c-format.c:1859
+#: c-format.c:1866
#, gcc-internal-format
msgid "%s does not support the %<%%%c%> %s format"
msgstr ""
-#: c-format.c:1875
+#: c-format.c:1882
#, gcc-internal-format
msgid "%s used with %<%%%c%> %s format"
msgstr ""
-#: c-format.c:1884
+#: c-format.c:1891
#, gcc-internal-format
msgid "%s does not support %s"
msgstr ""
-#: c-format.c:1894
+#: c-format.c:1901
#, gcc-internal-format
msgid "%s does not support %s with the %<%%%c%> %s format"
msgstr ""
-#: c-format.c:1930
+#: c-format.c:1937
#, gcc-internal-format
msgid "%s ignored with %s and %<%%%c%> %s format"
msgstr ""
-#: c-format.c:1934
+#: c-format.c:1941
#, gcc-internal-format
msgid "%s ignored with %s in %s format"
msgstr ""
-#: c-format.c:1941
+#: c-format.c:1948
#, gcc-internal-format
msgid "use of %s and %s together with %<%%%c%> %s format"
msgstr ""
-#: c-format.c:1945
+#: c-format.c:1952
#, gcc-internal-format
msgid "use of %s and %s together in %s format"
msgstr ""
-#: c-format.c:1964
+#: c-format.c:1971
#, gcc-internal-format
msgid "%<%%%c%> yields only last 2 digits of year in some locales"
msgstr ""
-#: c-format.c:1967
+#: c-format.c:1974
#, gcc-internal-format
msgid "%<%%%c%> yields only last 2 digits of year"
msgstr ""
#. The end of the format string was reached.
-#: c-format.c:1984
+#: c-format.c:1991
#, gcc-internal-format
msgid "no closing %<]%> for %<%%[%> format"
msgstr ""
-#: c-format.c:1998
+#: c-format.c:2005
#, gcc-internal-format
msgid "use of %qs length modifier with %qc type character"
msgstr ""
-#: c-format.c:2020
+#: c-format.c:2027
#, gcc-internal-format
msgid "%s does not support the %<%%%s%c%> %s format"
msgstr ""
-#: c-format.c:2037
+#: c-format.c:2044
#, gcc-internal-format
msgid "operand number specified with suppressed assignment"
msgstr ""
-#: c-format.c:2040
+#: c-format.c:2047
#, gcc-internal-format
msgid "operand number specified for format taking no argument"
msgstr ""
-#: c-format.c:2173
+#: c-format.c:2180
#, gcc-internal-format
msgid "writing through null pointer (argument %d)"
msgstr ""
-#: c-format.c:2181
+#: c-format.c:2188
#, gcc-internal-format
msgid "reading through null pointer (argument %d)"
msgstr ""
-#: c-format.c:2201
+#: c-format.c:2208
#, gcc-internal-format
msgid "writing into constant object (argument %d)"
msgstr ""
-#: c-format.c:2212
+#: c-format.c:2219
#, gcc-internal-format
msgid "extra type qualifiers in format argument (argument %d)"
msgstr ""
-#: c-format.c:2323
+#: c-format.c:2330
#, gcc-internal-format
msgid "%s should have type %<%s%s%>, but argument %d has type %qT"
msgstr ""
-#: c-format.c:2327
+#: c-format.c:2334
#, gcc-internal-format
msgid "format %q.*s expects type %<%s%s%>, but argument %d has type %qT"
msgstr ""
-#: c-format.c:2335
+#: c-format.c:2342
#, gcc-internal-format
msgid "%s should have type %<%T%s%>, but argument %d has type %qT"
msgstr ""
-#: c-format.c:2339
+#: c-format.c:2346
#, gcc-internal-format
msgid "format %q.*s expects type %<%T%s%>, but argument %d has type %qT"
msgstr ""
-#: c-format.c:2398 c-format.c:2404 c-format.c:2554
+#: c-format.c:2405 c-format.c:2411 c-format.c:2562
#, gcc-internal-format
msgid "%<__gcc_host_wide_int__%> is not defined as a type"
msgstr ""
-#: c-format.c:2411 c-format.c:2564
+#: c-format.c:2418 c-format.c:2572
#, gcc-internal-format
msgid "%<__gcc_host_wide_int__%> is not defined as %<long%> or %<long long%>"
msgstr ""
-#: c-format.c:2460
+#: c-format.c:2468
#, gcc-internal-format
msgid "%<locus%> is not defined as a type"
msgstr ""
-#: c-format.c:2513
+#: c-format.c:2521
#, gcc-internal-format
msgid "%<location_t%> is not defined as a type"
msgstr ""
-#: c-format.c:2530
+#: c-format.c:2538
#, gcc-internal-format
msgid "%<tree%> is not defined as a type"
msgstr ""
-#: c-format.c:2535
+#: c-format.c:2543
#, gcc-internal-format
msgid "%<tree%> is not defined as a pointer type"
msgstr ""
-#: c-format.c:2758
+#: c-format.c:2844
#, gcc-internal-format
msgid "args to be formatted is not %<...%>"
msgstr ""
-#: c-format.c:2767
+#: c-format.c:2856
#, gcc-internal-format
msgid "strftime formats cannot format arguments"
msgstr ""
-#: c-lex.c:245
+#: c-lex.c:232
#, gcc-internal-format
msgid "badly nested C headers from preprocessor"
msgstr ""
-#: c-lex.c:293
+#: c-lex.c:267
#, gcc-internal-format
msgid "%Hignoring #pragma %s %s"
msgstr ""
#. ... or not.
-#: c-lex.c:419
+#: c-lex.c:382
#, gcc-internal-format
msgid "%Hstray %<@%> in program"
msgstr ""
-#: c-lex.c:436
+#: c-lex.c:397
#, gcc-internal-format
msgid "stray %qs in program"
msgstr ""
-#: c-lex.c:446
+#: c-lex.c:407
#, gcc-internal-format
msgid "missing terminating %c character"
msgstr ""
-#: c-lex.c:448
+#: c-lex.c:409
#, gcc-internal-format
msgid "stray %qc in program"
msgstr ""
-#: c-lex.c:450
+#: c-lex.c:411
#, gcc-internal-format
msgid "stray %<\\%o%> in program"
msgstr ""
-#: c-lex.c:605
+#: c-lex.c:570
#, gcc-internal-format
msgid "this decimal constant is unsigned only in ISO C90"
msgstr ""
-#: c-lex.c:609
+#: c-lex.c:574
#, gcc-internal-format
msgid "this decimal constant would be unsigned in ISO C90"
msgstr ""
-#: c-lex.c:625
+#: c-lex.c:590
#, gcc-internal-format
msgid "integer constant is too large for %qs type"
msgstr ""
-#: c-lex.c:674
+#: c-lex.c:639
#, gcc-internal-format
msgid "unsupported non-standard suffix on floating constant"
msgstr ""
-#: c-lex.c:680
+#: c-lex.c:645
#, gcc-internal-format
msgid "non-standard suffix on floating constant"
msgstr ""
-#: c-lex.c:722 c-lex.c:724
+#: c-lex.c:687 c-lex.c:689
#, gcc-internal-format
msgid "floating constant exceeds range of %qT"
msgstr ""
-#: c-lex.c:732
+#: c-lex.c:697
#, gcc-internal-format
msgid "floating constant truncated to zero"
msgstr ""
-#: c-lex.c:941
+#: c-lex.c:888
#, gcc-internal-format
-msgid "traditional C rejects string constant concatenation"
+msgid "unsupported non-standard concatenation of string literals"
msgstr ""
-#: c-omp.c:106
+#: c-lex.c:910
#, gcc-internal-format
-msgid "invalid expression type for %<#pragma omp atomic%>"
+msgid "traditional C rejects string constant concatenation"
msgstr ""
-#: c-omp.c:219
+#: c-omp.c:119
#, gcc-internal-format
-msgid "%Hinvalid type for iteration variable %qE"
+msgid "invalid expression type for %<#pragma omp atomic%>"
msgstr ""
-#: c-omp.c:223
+#: c-omp.c:245 cp/semantics.c:4295
#, gcc-internal-format
-msgid "%Hiteration variable %qE is unsigned"
+msgid "%Hinvalid type for iteration variable %qE"
msgstr ""
-#: c-omp.c:234
+#: c-omp.c:258
#, gcc-internal-format
msgid "%H%qE is not initialized"
msgstr ""
-#: c-omp.c:247 cp/semantics.c:3868
+#: c-omp.c:271 cp/semantics.c:4209
#, gcc-internal-format
msgid "%Hmissing controlling predicate"
msgstr ""
-#: c-omp.c:305
+#: c-omp.c:332 cp/semantics.c:3968
#, gcc-internal-format
msgid "%Hinvalid controlling predicate"
msgstr ""
-#: c-omp.c:312 cp/semantics.c:3874
+#: c-omp.c:339 cp/semantics.c:4215
#, gcc-internal-format
msgid "%Hmissing increment expression"
msgstr ""
-#: c-omp.c:362
+#: c-omp.c:405 cp/semantics.c:4073
#, gcc-internal-format
msgid "%Hinvalid increment expression"
msgstr ""
-#: c-opts.c:153
+#: c-opts.c:150
#, gcc-internal-format
msgid "no class name specified with %qs"
msgstr ""
-#: c-opts.c:157
+#: c-opts.c:154
#, gcc-internal-format
msgid "assertion missing after %qs"
msgstr ""
-#: c-opts.c:162
+#: c-opts.c:159
#, gcc-internal-format
msgid "macro name missing after %qs"
msgstr ""
-#: c-opts.c:171
+#: c-opts.c:168
#, gcc-internal-format
msgid "missing path after %qs"
msgstr ""
-#: c-opts.c:180
+#: c-opts.c:177
#, gcc-internal-format
msgid "missing filename after %qs"
msgstr ""
-#: c-opts.c:185
+#: c-opts.c:182
#, gcc-internal-format
msgid "missing makefile target after %qs"
msgstr ""
-#: c-opts.c:337
+#: c-opts.c:321
#, gcc-internal-format
msgid "-I- specified twice"
msgstr ""
-#: c-opts.c:340
+#: c-opts.c:324
#, gcc-internal-format
msgid "obsolete option -I- used, please use -iquote instead"
msgstr ""
-#: c-opts.c:510
+#: c-opts.c:491
#, gcc-internal-format
msgid "argument %qs to %<-Wnormalized%> not recognized"
msgstr ""
-#: c-opts.c:597
+#: c-opts.c:578
#, gcc-internal-format
msgid "switch %qs is no longer supported"
msgstr ""
-#: c-opts.c:707
+#: c-opts.c:685
#, gcc-internal-format
msgid ""
"-fhandle-exceptions has been renamed -fexceptions (and is now on by default)"
msgstr ""
-#: c-opts.c:913
-#, gcc-internal-format
-msgid "output filename specified twice"
-msgstr ""
-
-#: c-opts.c:1053
+#: c-opts.c:1021
#, gcc-internal-format
msgid "-fno-gnu89-inline is only supported in GNU99 or C99 mode"
msgstr ""
-#: c-opts.c:1142
+#: c-opts.c:1090
#, gcc-internal-format
msgid "-Wformat-y2k ignored without -Wformat"
msgstr ""
-#: c-opts.c:1144
+#: c-opts.c:1092
#, gcc-internal-format
msgid "-Wformat-extra-args ignored without -Wformat"
msgstr ""
-#: c-opts.c:1146
+#: c-opts.c:1094
#, gcc-internal-format
msgid "-Wformat-zero-length ignored without -Wformat"
msgstr ""
-#: c-opts.c:1148
+#: c-opts.c:1096
#, gcc-internal-format
msgid "-Wformat-nonliteral ignored without -Wformat"
msgstr ""
-#: c-opts.c:1150
+#: c-opts.c:1098
#, gcc-internal-format
msgid "-Wformat-contains-nul ignored without -Wformat"
msgstr ""
-#: c-opts.c:1152
+#: c-opts.c:1100
#, gcc-internal-format
msgid "-Wformat-security ignored without -Wformat"
msgstr ""
-#: c-opts.c:1176
+#: c-opts.c:1124
#, gcc-internal-format
msgid "opening output file %s: %m"
msgstr ""
-#: c-opts.c:1181
+#: c-opts.c:1129
#, gcc-internal-format
msgid "too many filenames given. Type %s --help for usage"
msgstr ""
-#: c-opts.c:1265
+#: c-opts.c:1213
#, gcc-internal-format
msgid "The C parser does not support -dy, option ignored"
msgstr ""
-#: c-opts.c:1269
+#: c-opts.c:1217
#, gcc-internal-format
msgid "The Objective-C parser does not support -dy, option ignored"
msgstr ""
-#: c-opts.c:1272
+#: c-opts.c:1220
#, gcc-internal-format
msgid "The C++ parser does not support -dy, option ignored"
msgstr ""
-#: c-opts.c:1276
+#: c-opts.c:1224
#, gcc-internal-format
msgid "The Objective-C++ parser does not support -dy, option ignored"
msgstr ""
-#: c-opts.c:1326
+#: c-opts.c:1274
#, gcc-internal-format
msgid "opening dependency file %s: %m"
msgstr ""
-#: c-opts.c:1336
+#: c-opts.c:1284
#, gcc-internal-format
msgid "closing dependency file %s: %m"
msgstr ""
-#: c-opts.c:1339
+#: c-opts.c:1287
#, gcc-internal-format
msgid "when writing output to %s: %m"
msgstr ""
-#: c-opts.c:1419
+#: c-opts.c:1367
#, gcc-internal-format
msgid "to generate dependencies you must specify either -M or -MM"
msgstr ""
-#: c-opts.c:1469
+#: c-opts.c:1390
+#, gcc-internal-format
+msgid "-MG may only be used with -M or -MM"
+msgstr ""
+
+#: c-opts.c:1419
#, gcc-internal-format
msgid "-fdirectives-only is incompatible with -Wunused_macros"
msgstr ""
-#: c-opts.c:1471
+#: c-opts.c:1421
#, gcc-internal-format
msgid "-fdirectives-only is incompatible with -traditional"
msgstr ""
-#: c-opts.c:1609
+#: c-opts.c:1559
#, gcc-internal-format
msgid "too late for # directive to set debug directory"
msgstr ""
-#: c-parser.c:1072
+#: c-parser.c:225
#, gcc-internal-format
-msgid "%HISO C forbids an empty source file"
+msgid "%Hidentifier %qs conflicts with C++ keyword"
msgstr ""
-#: c-parser.c:1158 c-parser.c:6150
+#: c-parser.c:971
#, gcc-internal-format
-msgid "%HISO C does not allow extra %<;%> outside of a function"
+msgid "ISO C forbids an empty translation unit"
msgstr ""
-#: c-parser.c:1261 c-parser.c:6699
+#: c-parser.c:1056 c-parser.c:6058
#, gcc-internal-format
-msgid "expected declaration specifiers"
+msgid "ISO C does not allow extra %<;%> outside of a function"
msgstr ""
-#: c-parser.c:1273
+#: c-parser.c:1158 c-parser.c:6616
#, gcc-internal-format
-msgid "%Hempty declaration"
+msgid "expected declaration specifiers"
msgstr ""
-#: c-parser.c:1309
+#: c-parser.c:1206
#, gcc-internal-format
-msgid "%Hdata definition has no type or storage class"
+msgid "data definition has no type or storage class"
msgstr ""
-#: c-parser.c:1364
+#: c-parser.c:1260
#, gcc-internal-format
msgid "expected %<,%> or %<;%>"
msgstr ""
@@ -20284,190 +20207,189 @@ msgstr ""
#. This can appear in many cases looking nothing like a
#. function definition, so we don't give a more specific
#. error suggesting there was one.
-#: c-parser.c:1371 c-parser.c:1388
+#: c-parser.c:1267 c-parser.c:1283
#, gcc-internal-format
msgid "expected %<=%>, %<,%>, %<;%>, %<asm%> or %<__attribute__%>"
msgstr ""
-#: c-parser.c:1380
+#: c-parser.c:1275
#, gcc-internal-format
-msgid "%HISO C forbids nested functions"
+msgid "ISO C forbids nested functions"
msgstr ""
-#: c-parser.c:1745 c-parser.c:2555 c-parser.c:3191 c-parser.c:3447
-#: c-parser.c:4367 c-parser.c:4954 c-parser.c:5357 c-parser.c:5377
-#: c-parser.c:5493 c-parser.c:5641 c-parser.c:5658 c-parser.c:5790
-#: c-parser.c:5802 c-parser.c:5827 c-parser.c:5962 c-parser.c:5991
-#: c-parser.c:5999 c-parser.c:6027 c-parser.c:6041 c-parser.c:6260
-#: c-parser.c:6359 c-parser.c:6862 c-parser.c:7493
+#: c-parser.c:1641 c-parser.c:2456 c-parser.c:3093 c-parser.c:3345
+#: c-parser.c:4273 c-parser.c:4859 c-parser.c:5265 c-parser.c:5285
+#: c-parser.c:5401 c-parser.c:5551 c-parser.c:5568 c-parser.c:5700
+#: c-parser.c:5712 c-parser.c:5737 c-parser.c:5871 c-parser.c:5900
+#: c-parser.c:5908 c-parser.c:5936 c-parser.c:5950 c-parser.c:6166
+#: c-parser.c:6265 c-parser.c:6786 c-parser.c:7485
#, gcc-internal-format
msgid "expected identifier"
msgstr ""
-#: c-parser.c:1775
+#: c-parser.c:1675 cp/parser.c:11835
#, gcc-internal-format
-msgid "%Hcomma at end of enumerator list"
+msgid "comma at end of enumerator list"
msgstr ""
-#: c-parser.c:1781
+#: c-parser.c:1681
#, gcc-internal-format
msgid "expected %<,%> or %<}%>"
msgstr ""
-#: c-parser.c:1795 c-parser.c:1979 c-parser.c:6117
+#: c-parser.c:1695 c-parser.c:1878 c-parser.c:6025
#, gcc-internal-format
msgid "expected %<{%>"
msgstr ""
-#: c-parser.c:1806
+#: c-parser.c:1707
#, gcc-internal-format
-msgid "%HISO C forbids forward references to %<enum%> types"
+msgid "ISO C forbids forward references to %<enum%> types"
msgstr ""
-#: c-parser.c:1913
+#: c-parser.c:1813
#, gcc-internal-format
msgid "expected class name"
msgstr ""
-#: c-parser.c:1932 c-parser.c:5894
+#: c-parser.c:1832 c-parser.c:5804
#, gcc-internal-format
-msgid "%Hextra semicolon in struct or union specified"
+msgid "extra semicolon in struct or union specified"
msgstr ""
-#: c-parser.c:1961
+#: c-parser.c:1861
#, gcc-internal-format
-msgid "%Hno semicolon at end of struct or union"
+msgid "no semicolon at end of struct or union"
msgstr ""
-#: c-parser.c:1965
+#: c-parser.c:1864
#, gcc-internal-format
msgid "expected %<;%>"
msgstr ""
-#: c-parser.c:2044 c-parser.c:3016
+#: c-parser.c:1943 c-parser.c:2922
#, gcc-internal-format
msgid "expected specifier-qualifier-list"
msgstr ""
-#: c-parser.c:2054
+#: c-parser.c:1953
#, gcc-internal-format
-msgid "%HISO C forbids member declarations with no members"
+msgid "ISO C forbids member declarations with no members"
msgstr ""
-#: c-parser.c:2128
+#: c-parser.c:2029
#, gcc-internal-format
msgid "expected %<,%>, %<;%> or %<}%>"
msgstr ""
-#: c-parser.c:2135
+#: c-parser.c:2036
#, gcc-internal-format
msgid "expected %<:%>, %<,%>, %<;%>, %<}%> or %<__attribute__%>"
msgstr ""
-#: c-parser.c:2186
+#: c-parser.c:2087
#, gcc-internal-format
msgid "%H%<typeof%> applied to a bit-field"
msgstr ""
-#: c-parser.c:2423
+#: c-parser.c:2324
#, gcc-internal-format
msgid "expected identifier or %<(%>"
msgstr ""
-#: c-parser.c:2624
+#: c-parser.c:2525
#, gcc-internal-format
msgid "%HISO C requires a named argument before %<...%>"
msgstr ""
-#: c-parser.c:2731
+#: c-parser.c:2632
#, gcc-internal-format
msgid "expected declaration specifiers or %<...%>"
msgstr ""
-#: c-parser.c:2781
+#: c-parser.c:2682
#, gcc-internal-format
msgid "%Hwide string literal in %<asm%>"
msgstr ""
-#: c-parser.c:2788 c-parser.c:6754 cp/parser.c:20480
+#: c-parser.c:2689 c-parser.c:6671
#, gcc-internal-format
msgid "expected string literal"
msgstr ""
-#: c-parser.c:3109
+#: c-parser.c:3014
#, gcc-internal-format
-msgid "%HISO C forbids empty initializer braces"
+msgid "ISO C forbids empty initializer braces"
msgstr ""
-#. Use the colon as the error location.
-#: c-parser.c:3156
+#: c-parser.c:3060
#, gcc-internal-format
-msgid "%Hobsolete use of designated initializer with %<:%>"
+msgid "obsolete use of designated initializer with %<:%>"
msgstr ""
-#: c-parser.c:3287
+#: c-parser.c:3190
#, gcc-internal-format
-msgid "%HISO C forbids specifying range of elements to initialize"
+msgid "ISO C forbids specifying range of elements to initialize"
msgstr ""
-#: c-parser.c:3300
+#: c-parser.c:3203
#, gcc-internal-format
-msgid "%HISO C90 forbids specifying subobject to initialize"
+msgid "ISO C90 forbids specifying subobject to initialize"
msgstr ""
-#: c-parser.c:3309
+#: c-parser.c:3210
#, gcc-internal-format
-msgid "%Hobsolete use of designated initializer without %<=%>"
+msgid "obsolete use of designated initializer without %<=%>"
msgstr ""
-#: c-parser.c:3318
+#: c-parser.c:3216
#, gcc-internal-format
msgid "expected %<=%>"
msgstr ""
-#: c-parser.c:3463
+#: c-parser.c:3360
#, gcc-internal-format
-msgid "%HISO C forbids label declarations"
+msgid "ISO C forbids label declarations"
msgstr ""
-#: c-parser.c:3468 c-parser.c:3543
+#: c-parser.c:3365 c-parser.c:3441
#, gcc-internal-format
msgid "expected declaration or statement"
msgstr ""
-#: c-parser.c:3496 c-parser.c:3524
+#: c-parser.c:3395 c-parser.c:3423
#, gcc-internal-format
-msgid "%HISO C90 forbids mixed declarations and code"
+msgid "ISO C90 forbids mixed declarations and code"
msgstr ""
-#: c-parser.c:3550
+#: c-parser.c:3448
#, gcc-internal-format
msgid "%Hexpected %<}%> before %<else%>"
msgstr ""
-#: c-parser.c:3555
+#: c-parser.c:3453 cp/parser.c:7077
#, gcc-internal-format
msgid "%H%<else%> without a previous %<if%>"
msgstr ""
-#: c-parser.c:3571
+#: c-parser.c:3469
#, gcc-internal-format
msgid "%Hlabel at end of compound statement"
msgstr ""
-#: c-parser.c:3614
+#: c-parser.c:3512
#, gcc-internal-format
msgid "expected %<:%> or %<...%>"
msgstr ""
-#: c-parser.c:3647
+#: c-parser.c:3545
#, gcc-internal-format
msgid ""
"%Ha label can only be part of a statement and a declaration is not a "
"statement"
msgstr ""
-#: c-parser.c:3810
+#: c-parser.c:3708
#, gcc-internal-format
msgid "expected identifier or %<*%>"
msgstr ""
@@ -20476,240 +20398,275 @@ msgstr ""
#. c_parser_skip_until_found stops at a closing nesting
#. delimiter without consuming it, but here we need to consume
#. it to proceed further.
-#: c-parser.c:3872
+#: c-parser.c:3770
#, gcc-internal-format
msgid "expected statement"
msgstr ""
-#: c-parser.c:4095
+#: c-parser.c:4005
#, gcc-internal-format
msgid "%Hsuggest braces around empty body in %<do%> statement"
msgstr ""
-#: c-parser.c:4251
+#: c-parser.c:4157
#, gcc-internal-format
msgid "%H%E qualifier ignored on asm"
msgstr ""
-#: c-parser.c:4532
+#: c-parser.c:4438
#, gcc-internal-format
-msgid "%HISO C forbids omitting the middle term of a ?: expression"
+msgid "ISO C forbids omitting the middle term of a ?: expression"
msgstr ""
-#: c-parser.c:4922
+#: c-parser.c:4827
#, gcc-internal-format
msgid "%Htraditional C rejects the unary plus operator"
msgstr ""
#. C99 6.7.5.2p4
-#: c-parser.c:5033
+#: c-parser.c:4938
#, gcc-internal-format
msgid "%H%<[*]%> not allowed in other than a declaration"
msgstr ""
-#: c-parser.c:5047
+#: c-parser.c:4952
#, gcc-internal-format
msgid "%H%<sizeof%> applied to a bit-field"
msgstr ""
-#: c-parser.c:5191 c-parser.c:5535 c-parser.c:5557
+#: c-parser.c:5100 c-parser.c:5443 c-parser.c:5465
#, gcc-internal-format
msgid "expected expression"
msgstr ""
-#: c-parser.c:5218
+#: c-parser.c:5127
#, gcc-internal-format
msgid "%Hbraced-group within expression allowed only inside a function"
msgstr ""
-#: c-parser.c:5232
+#: c-parser.c:5141
#, gcc-internal-format
-msgid "%HISO C forbids braced-groups within expressions"
+msgid "ISO C forbids braced-groups within expressions"
msgstr ""
-#: c-parser.c:5417
+#: c-parser.c:5325
#, gcc-internal-format
msgid "%Hfirst argument to %<__builtin_choose_expr%> not a constant"
msgstr ""
-#: c-parser.c:5586
+#: c-parser.c:5494
#, gcc-internal-format
msgid "%Hcompound literal has variable size"
msgstr ""
-#: c-parser.c:5594
+#: c-parser.c:5502
#, gcc-internal-format
-msgid "%HISO C90 forbids compound literals"
+msgid "ISO C90 forbids compound literals"
msgstr ""
-#: c-parser.c:6112
+#: c-parser.c:6021
#, gcc-internal-format
-msgid "%Hextra semicolon in method definition specified"
+msgid "extra semicolon in method definition specified"
msgstr ""
-#: c-parser.c:6659 cp/parser.c:20523
+#: c-parser.c:6565
#, gcc-internal-format
msgid "%<#pragma omp barrier%> may only be used in compound statements"
msgstr ""
-#: c-parser.c:6670 cp/parser.c:20538
+#: c-parser.c:6576
#, gcc-internal-format
msgid "%<#pragma omp flush%> may only be used in compound statements"
msgstr ""
-#: c-parser.c:6682
+#: c-parser.c:6587
+#, gcc-internal-format
+msgid "%<#pragma omp taskwait%> may only be used in compound statements"
+msgstr ""
+
+#: c-parser.c:6599 cp/parser.c:21794
#, gcc-internal-format
msgid ""
"%H%<#pragma omp section%> may only be used in %<#pragma omp sections%> "
"construct"
msgstr ""
-#: c-parser.c:6689 cp/parser.c:20513
+#: c-parser.c:6606
#, gcc-internal-format
msgid "%<#pragma GCC pch_preprocess%> must be first"
msgstr ""
-#: c-parser.c:6840 cp/parser.c:19357
+#: c-parser.c:6764
#, gcc-internal-format
msgid "too many %qs clauses"
msgstr ""
-#: c-parser.c:6965
+#: c-parser.c:6859 cp/parser.c:20137
+#, gcc-internal-format
+msgid "%Hcollapse argument needs positive constant integer expression"
+msgstr ""
+
+#: c-parser.c:6925
#, gcc-internal-format
msgid "expected %<none%> or %<shared%>"
msgstr ""
-#: c-parser.c:7008
+#: c-parser.c:6968
#, gcc-internal-format
msgid "expected %<(%>"
msgstr ""
-#: c-parser.c:7052 c-parser.c:7229
+#: c-parser.c:7012 c-parser.c:7194
#, gcc-internal-format
msgid "expected integer expression"
msgstr ""
-#: c-parser.c:7061
+#: c-parser.c:7021
#, gcc-internal-format
msgid "%H%<num_threads%> value must be positive"
msgstr ""
-#: c-parser.c:7141
+#: c-parser.c:7101
#, gcc-internal-format
msgid "expected %<+%>, %<*%>, %<-%>, %<&%>, %<^%>, %<|%>, %<&&%>, or %<||%>"
msgstr ""
-#: c-parser.c:7224
+#: c-parser.c:7186 cp/parser.c:20426
#, gcc-internal-format
msgid "%Hschedule %<runtime%> does not take a %<chunk_size%> parameter"
msgstr ""
-#: c-parser.c:7242
+#: c-parser.c:7189 cp/parser.c:20429
+#, gcc-internal-format
+msgid "%Hschedule %<auto%> does not take a %<chunk_size%> parameter"
+msgstr ""
+
+#: c-parser.c:7207
#, gcc-internal-format
msgid "invalid schedule kind"
msgstr ""
-#: c-parser.c:7336
+#: c-parser.c:7325
#, gcc-internal-format
msgid "expected %<#pragma omp%> clause"
msgstr ""
-#: c-parser.c:7345
+#: c-parser.c:7334 cp/parser.c:20577
#, gcc-internal-format
msgid "%H%qs is not valid for %qs"
msgstr ""
-#: c-parser.c:7445
+#: c-parser.c:7435
#, gcc-internal-format
msgid "invalid operator for %<#pragma omp atomic%>"
msgstr ""
-#: c-parser.c:7496 c-parser.c:7516
+#: c-parser.c:7488 c-parser.c:7508
#, gcc-internal-format
msgid "expected %<(%> or end of line"
msgstr ""
-#: c-parser.c:7534
+#: c-parser.c:7540
#, gcc-internal-format
msgid "for statement expected"
msgstr ""
-#: c-parser.c:7609 cp/semantics.c:3854 cp/semantics.c:3898
+#: c-parser.c:7587
#, gcc-internal-format
msgid "expected iteration declaration or initialization"
msgstr ""
-#: c-parser.c:7735
+#: c-parser.c:7646
+#, gcc-internal-format
+msgid "not enough perfectly nested loops"
+msgstr ""
+
+#: c-parser.c:7694
+#, gcc-internal-format
+msgid "collapsed loops not perfectly nested"
+msgstr ""
+
+#: c-parser.c:7730 cp/parser.c:21113 cp/parser.c:21151
+#, gcc-internal-format
+msgid "%Hiteration variable %qD should not be firstprivate"
+msgstr ""
+
+#: c-parser.c:7880
#, gcc-internal-format
msgid "%Hexpected %<#pragma omp section%> or %<}%>"
msgstr ""
-#: c-parser.c:7968 cp/semantics.c:3746
+#: c-parser.c:8151
+#, gcc-internal-format
+msgid "%qD is not a variable"
+msgstr ""
+
+#: c-parser.c:8153 cp/semantics.c:3829
#, gcc-internal-format
msgid "%qE declared %<threadprivate%> after first use"
msgstr ""
-#: c-parser.c:7970 cp/semantics.c:3748
+#: c-parser.c:8155 cp/semantics.c:3831
#, gcc-internal-format
msgid "automatic variable %qE cannot be %<threadprivate%>"
msgstr ""
-#: c-parser.c:7972 cp/semantics.c:3750
+#: c-parser.c:8159 cp/semantics.c:3833
#, gcc-internal-format
msgid "%<threadprivate%> %qE has incomplete type"
msgstr ""
-#: c-pch.c:132
+#: c-pch.c:131
#, gcc-internal-format
msgid "can%'t create precompiled header %s: %m"
msgstr ""
-#: c-pch.c:153
+#: c-pch.c:152
#, gcc-internal-format
msgid "can%'t write to %s: %m"
msgstr ""
-#: c-pch.c:159
+#: c-pch.c:158
#, gcc-internal-format
msgid "%qs is not a valid output file"
msgstr ""
-#: c-pch.c:188 c-pch.c:203 c-pch.c:217
+#: c-pch.c:187 c-pch.c:202 c-pch.c:216
#, gcc-internal-format
msgid "can%'t write %s: %m"
msgstr ""
-#: c-pch.c:193 c-pch.c:210
+#: c-pch.c:192 c-pch.c:209
#, gcc-internal-format
msgid "can%'t seek in %s: %m"
msgstr ""
-#: c-pch.c:201 c-pch.c:243 c-pch.c:283 c-pch.c:334
+#: c-pch.c:200 c-pch.c:242 c-pch.c:283 c-pch.c:334
#, gcc-internal-format
msgid "can%'t read %s: %m"
msgstr ""
-#: c-pch.c:466
+#: c-pch.c:465
#, gcc-internal-format
msgid "pch_preprocess pragma should only be used with -fpreprocessed"
msgstr ""
-#: c-pch.c:467
+#: c-pch.c:466
#, gcc-internal-format
msgid "use #include instead"
msgstr ""
-#: c-pch.c:473
+#: c-pch.c:472
#, gcc-internal-format
msgid "%s: couldn%'t open PCH file: %m"
msgstr ""
-#: c-pch.c:478
+#: c-pch.c:477
#, gcc-internal-format
msgid "use -Winvalid-pch for more information"
msgstr ""
-#: c-pch.c:479
+#: c-pch.c:478
#, gcc-internal-format
msgid "%s: PCH file was invalid"
msgstr ""
@@ -20780,178 +20737,281 @@ msgstr ""
msgid "alignment must be a small power of two, not %d"
msgstr ""
-#: c-pragma.c:290
+#: c-pragma.c:291
#, gcc-internal-format
msgid "missing %<(%> after %<#pragma push_macro%> - ignored"
msgstr ""
-#: c-pragma.c:298
+#: c-pragma.c:299
#, gcc-internal-format
msgid "invalid constant in %<#pragma push_macro%> - ignored"
msgstr ""
-#: c-pragma.c:301
+#: c-pragma.c:302
#, gcc-internal-format
msgid "missing %<)%> after %<#pragma push_macro%> - ignored"
msgstr ""
-#: c-pragma.c:304
+#: c-pragma.c:305
#, gcc-internal-format
msgid "junk at end of %<#pragma push_macro%>"
msgstr ""
-#: c-pragma.c:347
+#: c-pragma.c:348
#, gcc-internal-format
msgid "missing %<(%> after %<#pragma pop_macro%> - ignored"
msgstr ""
-#: c-pragma.c:355
+#: c-pragma.c:356
#, gcc-internal-format
msgid "invalid constant in %<#pragma pop_macro%> - ignored"
msgstr ""
-#: c-pragma.c:358
+#: c-pragma.c:359
#, gcc-internal-format
msgid "missing %<)%> after %<#pragma pop_macro%> - ignored"
msgstr ""
-#: c-pragma.c:361
+#: c-pragma.c:362
#, gcc-internal-format
msgid "junk at end of %<#pragma pop_macro%>"
msgstr ""
-#: c-pragma.c:406
+#: c-pragma.c:408
#, gcc-internal-format
msgid ""
"applying #pragma weak %q+D after first use results in unspecified behavior"
msgstr ""
-#: c-pragma.c:480 c-pragma.c:485
+#: c-pragma.c:482 c-pragma.c:487
#, gcc-internal-format
msgid "malformed #pragma weak, ignored"
msgstr ""
-#: c-pragma.c:489
+#: c-pragma.c:491
#, gcc-internal-format
msgid "junk at end of %<#pragma weak%>"
msgstr ""
-#: c-pragma.c:557 c-pragma.c:559
+#: c-pragma.c:559 c-pragma.c:561
#, gcc-internal-format
msgid "malformed #pragma redefine_extname, ignored"
msgstr ""
-#: c-pragma.c:562
+#: c-pragma.c:564
#, gcc-internal-format
msgid "junk at end of %<#pragma redefine_extname%>"
msgstr ""
-#: c-pragma.c:568
+#: c-pragma.c:570
#, gcc-internal-format
msgid "#pragma redefine_extname not supported on this target"
msgstr ""
-#: c-pragma.c:585 c-pragma.c:672
+#: c-pragma.c:587 c-pragma.c:674
#, gcc-internal-format
msgid "#pragma redefine_extname ignored due to conflict with previous rename"
msgstr ""
-#: c-pragma.c:608
+#: c-pragma.c:610
#, gcc-internal-format
msgid ""
"#pragma redefine_extname ignored due to conflict with previous #pragma "
"redefine_extname"
msgstr ""
-#: c-pragma.c:627
+#: c-pragma.c:629
#, gcc-internal-format
msgid "malformed #pragma extern_prefix, ignored"
msgstr ""
-#: c-pragma.c:630
+#: c-pragma.c:632
#, gcc-internal-format
msgid "junk at end of %<#pragma extern_prefix%>"
msgstr ""
-#: c-pragma.c:637
+#: c-pragma.c:639
#, gcc-internal-format
msgid "#pragma extern_prefix not supported on this target"
msgstr ""
-#: c-pragma.c:663
+#: c-pragma.c:665
#, gcc-internal-format
msgid "asm declaration ignored due to conflict with previous rename"
msgstr ""
-#: c-pragma.c:694
+#: c-pragma.c:696
#, gcc-internal-format
msgid ""
"#pragma redefine_extname ignored due to conflict with __asm__ declaration"
msgstr ""
-#: c-pragma.c:756
+#: c-pragma.c:758
#, gcc-internal-format
msgid ""
"#pragma GCC visibility push() must specify default, internal, hidden or "
"protected"
msgstr ""
-#: c-pragma.c:791
+#: c-pragma.c:793
#, gcc-internal-format
msgid "#pragma GCC visibility must be followed by push or pop"
msgstr ""
-#: c-pragma.c:797
+#: c-pragma.c:799
#, gcc-internal-format
msgid "no matching push for %<#pragma GCC visibility pop%>"
msgstr ""
-#: c-pragma.c:804 c-pragma.c:811
+#: c-pragma.c:806 c-pragma.c:813
#, gcc-internal-format
msgid "missing %<(%> after %<#pragma GCC visibility push%> - ignored"
msgstr ""
-#: c-pragma.c:807
+#: c-pragma.c:809
#, gcc-internal-format
msgid "malformed #pragma GCC visibility push"
msgstr ""
-#: c-pragma.c:815
+#: c-pragma.c:817
#, gcc-internal-format
msgid "junk at end of %<#pragma GCC visibility%>"
msgstr ""
-#: c-pragma.c:831
+#: c-pragma.c:833
#, gcc-internal-format
msgid "#pragma GCC diagnostic not allowed inside functions"
msgstr ""
-#: c-pragma.c:837
+#: c-pragma.c:839
#, gcc-internal-format
msgid "missing [error|warning|ignored] after %<#pragma GCC diagnostic%>"
msgstr ""
-#: c-pragma.c:846
+#: c-pragma.c:848
#, gcc-internal-format
msgid "expected [error|warning|ignored] after %<#pragma GCC diagnostic%>"
msgstr ""
-#: c-pragma.c:850
+#: c-pragma.c:852
#, gcc-internal-format
msgid "missing option after %<#pragma GCC diagnostic%> kind"
msgstr ""
-#: c-pragma.c:864
+#: c-pragma.c:866
#, gcc-internal-format
msgid "unknown option after %<#pragma GCC diagnostic%> kind"
msgstr ""
+#: c-pragma.c:883
+#, gcc-internal-format
+msgid "#pragma GCC option is not allowed inside functions"
+msgstr ""
+
+#: c-pragma.c:889
+#, gcc-internal-format
+msgid "#pragma GCC option is not supported for this system"
+msgstr ""
+
+#: c-pragma.c:921
+#, gcc-internal-format
+msgid "%<#pragma GCC option pop%> without a %<#pragma GCC option push%>"
+msgstr ""
+
+#: c-pragma.c:938 c-pragma.c:969
+#, gcc-internal-format
+msgid "%<#pragma GCC option%> is not a string or push/pop/reset"
+msgstr ""
+
+#: c-pragma.c:949
+#, gcc-internal-format
+msgid "%<#pragma GCC option ([push|pop|reset])%> does not have a final %<)%>."
+msgstr ""
+
+#: c-pragma.c:955
+#, gcc-internal-format
+msgid "%<#pragma GCC option [push|pop|reset]%> is badly formed"
+msgstr ""
+
+#: c-pragma.c:996
+#, gcc-internal-format
+msgid ""
+"%<#pragma GCC option (string [,string]...)%> does not have a final %<)%>."
+msgstr ""
+
+#: c-pragma.c:1002
+#, gcc-internal-format
+msgid "#pragma GCC option string... is badly formed"
+msgstr ""
+
+#: c-pragma.c:1030
+#, gcc-internal-format
+msgid "#pragma GCC optimize is not allowed inside functions"
+msgstr ""
+
+#: c-pragma.c:1064
+#, gcc-internal-format
+msgid "%<#pragma GCC optimize pop%> without a %<#pragma GCC optimize push%>"
+msgstr ""
+
+#: c-pragma.c:1096
+#, gcc-internal-format
+msgid "%<#pragma GCC optimize%> is not a string or push/pop/reset"
+msgstr ""
+
+#: c-pragma.c:1107
+#, gcc-internal-format
+msgid ""
+"%<#pragma GCC optimize ([push|pop|reset])%> does not have a final %<)%>."
+msgstr ""
+
+#: c-pragma.c:1113
+#, gcc-internal-format
+msgid "%<#pragma GCC optimize [push|pop|reset]%> is badly formed"
+msgstr ""
+
+#: c-pragma.c:1128
+#, gcc-internal-format
+msgid "%<#pragma GCC optimize%> is not a string, number, or push/pop/reset"
+msgstr ""
+
+#: c-pragma.c:1155
+#, gcc-internal-format
+msgid ""
+"%<#pragma GCC optimize (string [,string]...)%> does not have a final %<)%>."
+msgstr ""
+
+#: c-pragma.c:1161
+#, gcc-internal-format
+msgid "#pragma GCC optimize string... is badly formed"
+msgstr ""
+
+#: c-pragma.c:1191 c-pragma.c:1198
+#, gcc-internal-format
+msgid "expected a string after %<#pragma message%>"
+msgstr ""
+
+#: c-pragma.c:1193
+#, gcc-internal-format
+msgid "malformed %<#pragma message%>, ignored"
+msgstr ""
+
+#: c-pragma.c:1203
+#, gcc-internal-format
+msgid "junk at end of %<#pragma message%>"
+msgstr ""
+
+#: c-pragma.c:1206
+#, gcc-internal-format
+msgid "#pragma message: %s"
+msgstr ""
+
#: c-typeck.c:174
#, gcc-internal-format
msgid "%qD has an incomplete type"
msgstr ""
-#: c-typeck.c:195 cp/call.c:2771
+#: c-typeck.c:195 cp/call.c:2914
#, gcc-internal-format
msgid "invalid use of void expression"
msgstr ""
@@ -21012,47 +21072,47 @@ msgstr ""
msgid "arithmetic on pointer to an incomplete type"
msgstr ""
-#: c-typeck.c:1922
+#: c-typeck.c:1921
#, gcc-internal-format
msgid "%qT has no member named %qE"
msgstr ""
-#: c-typeck.c:1963
+#: c-typeck.c:1962
#, gcc-internal-format
msgid "request for member %qE in something not a structure or union"
msgstr ""
-#: c-typeck.c:2007
+#: c-typeck.c:2005
#, gcc-internal-format
msgid "dereferencing pointer to incomplete type"
msgstr ""
-#: c-typeck.c:2011
+#: c-typeck.c:2009
#, gcc-internal-format
msgid "dereferencing %<void *%> pointer"
msgstr ""
-#: c-typeck.c:2028
+#: c-typeck.c:2026
#, gcc-internal-format
msgid "invalid type argument of %qs (have %qT)"
msgstr ""
-#: c-typeck.c:2056 cp/typeck.c:2559
+#: c-typeck.c:2054 cp/typeck.c:2634
#, gcc-internal-format
msgid "subscripted value is neither array nor pointer"
msgstr ""
-#: c-typeck.c:2067 cp/typeck.c:2478 cp/typeck.c:2564
+#: c-typeck.c:2065 cp/typeck.c:2553 cp/typeck.c:2639
#, gcc-internal-format
msgid "array subscript is not an integer"
msgstr ""
-#: c-typeck.c:2073
+#: c-typeck.c:2071
#, gcc-internal-format
msgid "subscripted value is pointer to function"
msgstr ""
-#: c-typeck.c:2120
+#: c-typeck.c:2119
#, gcc-internal-format
msgid "ISO C forbids subscripting %<register%> array"
msgstr ""
@@ -21062,12 +21122,12 @@ msgstr ""
msgid "ISO C90 forbids subscripting non-lvalue array"
msgstr ""
-#: c-typeck.c:2239
+#: c-typeck.c:2236
#, gcc-internal-format
-msgid "%H%qD is static but used in inline function %qD which is not static"
+msgid "%qD is static but used in inline function %qD which is not static"
msgstr ""
-#: c-typeck.c:2387
+#: c-typeck.c:2384
#, gcc-internal-format
msgid "called object %qE is not a function"
msgstr ""
@@ -21075,85 +21135,80 @@ msgstr ""
#. 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.
-#: c-typeck.c:2415
+#: c-typeck.c:2411
#, gcc-internal-format
msgid "function called through a non-compatible type"
msgstr ""
-#: c-typeck.c:2526
-#, gcc-internal-format
-msgid "too many arguments to function %qE"
-msgstr ""
-
-#: c-typeck.c:2547
+#: c-typeck.c:2548
#, gcc-internal-format
msgid "type of formal parameter %d is incomplete"
msgstr ""
-#: c-typeck.c:2560
+#: c-typeck.c:2561
#, gcc-internal-format
msgid ""
"passing argument %d of %qE as integer rather than floating due to prototype"
msgstr ""
-#: c-typeck.c:2565
+#: c-typeck.c:2566
#, gcc-internal-format
msgid ""
"passing argument %d of %qE as integer rather than complex due to prototype"
msgstr ""
-#: c-typeck.c:2570
+#: c-typeck.c:2571
#, gcc-internal-format
msgid ""
"passing argument %d of %qE as complex rather than floating due to prototype"
msgstr ""
-#: c-typeck.c:2575
+#: c-typeck.c:2576
#, gcc-internal-format
msgid ""
"passing argument %d of %qE as floating rather than integer due to prototype"
msgstr ""
-#: c-typeck.c:2580
+#: c-typeck.c:2581
#, gcc-internal-format
msgid ""
"passing argument %d of %qE as complex rather than integer due to prototype"
msgstr ""
-#: c-typeck.c:2585
+#: c-typeck.c:2586
#, gcc-internal-format
msgid ""
"passing argument %d of %qE as floating rather than complex due to prototype"
msgstr ""
-#: c-typeck.c:2598
+#: c-typeck.c:2599
#, gcc-internal-format
msgid ""
"passing argument %d of %qE as %<float%> rather than %<double%> due to "
"prototype"
msgstr ""
-#: c-typeck.c:2623
+#: c-typeck.c:2624
#, gcc-internal-format
msgid "passing argument %d of %qE as %qT rather than %qT due to prototype"
msgstr ""
-#: c-typeck.c:2644
+#: c-typeck.c:2645
#, gcc-internal-format
msgid "passing argument %d of %qE with different width due to prototype"
msgstr ""
-#: c-typeck.c:2667
+#: c-typeck.c:2668
#, gcc-internal-format
msgid "passing argument %d of %qE as unsigned due to prototype"
msgstr ""
-#: c-typeck.c:2671
+#: c-typeck.c:2672
#, gcc-internal-format
msgid "passing argument %d of %qE as signed due to prototype"
msgstr ""
-#: c-typeck.c:2777 c-typeck.c:2781
+#: c-typeck.c:2778 c-typeck.c:2782
#, gcc-internal-format
msgid "comparison with string literal results in unspecified behavior"
msgstr ""
@@ -21163,7 +21218,7 @@ msgstr ""
msgid "pointer of type %<void *%> used in subtraction"
msgstr ""
-#: c-typeck.c:2808
+#: c-typeck.c:2809
#, gcc-internal-format
msgid "pointer to a function used in subtraction"
msgstr ""
@@ -21208,22 +21263,22 @@ msgstr ""
msgid "ISO C does not support %<++%> and %<--%> on complex types"
msgstr ""
-#: c-typeck.c:3043 c-typeck.c:3075
+#: c-typeck.c:3042 c-typeck.c:3074
#, gcc-internal-format
msgid "wrong type argument to increment"
msgstr ""
-#: c-typeck.c:3045 c-typeck.c:3077
+#: c-typeck.c:3044 c-typeck.c:3077
#, gcc-internal-format
msgid "wrong type argument to decrement"
msgstr ""
-#: c-typeck.c:3066
+#: c-typeck.c:3065
#, gcc-internal-format
msgid "increment of pointer to unknown structure"
msgstr ""
-#: c-typeck.c:3068
+#: c-typeck.c:3067
#, gcc-internal-format
msgid "decrement of pointer to unknown structure"
msgstr ""
@@ -21323,1091 +21378,1080 @@ msgstr ""
msgid "signed and unsigned type in conditional expression"
msgstr ""
-#: c-typeck.c:3460
+#: c-typeck.c:3461
#, gcc-internal-format
msgid "ISO C forbids conditional expr with only one void side"
msgstr ""
-#: c-typeck.c:3474 c-typeck.c:3482
+#: c-typeck.c:3476 c-typeck.c:3485
#, gcc-internal-format
msgid "ISO C forbids conditional expr between %<void *%> and function pointer"
msgstr ""
-#: c-typeck.c:3489
+#: c-typeck.c:3493
#, gcc-internal-format
msgid "pointer type mismatch in conditional expression"
msgstr ""
-#: c-typeck.c:3496 c-typeck.c:3506
+#: c-typeck.c:3501 c-typeck.c:3512
#, gcc-internal-format
msgid "pointer/integer type mismatch in conditional expression"
msgstr ""
-#: c-typeck.c:3520 tree-cfg.c:3807
+#: c-typeck.c:3526
#, gcc-internal-format
msgid "type mismatch in conditional expression"
msgstr ""
-#: c-typeck.c:3563
+#: c-typeck.c:3567
#, gcc-internal-format
msgid "left-hand operand of comma expression has no effect"
msgstr ""
-#: c-typeck.c:3600
+#: c-typeck.c:3604
#, gcc-internal-format
msgid "cast specifies array type"
msgstr ""
-#: c-typeck.c:3606
+#: c-typeck.c:3610
#, gcc-internal-format
msgid "cast specifies function type"
msgstr ""
-#: c-typeck.c:3623
+#: c-typeck.c:3626
#, gcc-internal-format
msgid "ISO C forbids casting nonscalar to the same type"
msgstr ""
-#: c-typeck.c:3640
+#: c-typeck.c:3643
#, gcc-internal-format
msgid "ISO C forbids casts to union type"
msgstr ""
-#: c-typeck.c:3648
+#: c-typeck.c:3650
#, gcc-internal-format
msgid "cast to union type from type not present in union"
msgstr ""
-#: c-typeck.c:3694
+#: c-typeck.c:3696
#, gcc-internal-format
msgid "cast adds new qualifiers to function type"
msgstr ""
#. There are qualifiers present in IN_OTYPE that are not
#. present in IN_TYPE.
-#: c-typeck.c:3699
+#: c-typeck.c:3701
#, gcc-internal-format
msgid "cast discards qualifiers from pointer target type"
msgstr ""
-#: c-typeck.c:3715
+#: c-typeck.c:3717
#, gcc-internal-format
msgid "cast increases required alignment of target type"
msgstr ""
-#: c-typeck.c:3726
+#: c-typeck.c:3728
#, gcc-internal-format
msgid "cast from pointer to integer of different size"
msgstr ""
-#: c-typeck.c:3730
+#: c-typeck.c:3732
#, gcc-internal-format
msgid "cast from function call of type %qT to non-matching type %qT"
msgstr ""
-#: c-typeck.c:3738
+#: c-typeck.c:3740
#, gcc-internal-format
msgid "cast to pointer from integer of different size"
msgstr ""
-#: c-typeck.c:3752
+#: c-typeck.c:3754
#, gcc-internal-format
msgid "ISO C forbids conversion of function pointer to object pointer type"
msgstr ""
-#: c-typeck.c:3760
+#: c-typeck.c:3763
#, gcc-internal-format
msgid "ISO C forbids conversion of object pointer to function pointer type"
msgstr ""
-#: c-typeck.c:4037
+#: c-typeck.c:4041
#, gcc-internal-format
msgid "cannot pass rvalue to reference parameter"
msgstr ""
-#: c-typeck.c:4150 c-typeck.c:4317
+#: c-typeck.c:4155 c-typeck.c:4325
#, gcc-internal-format
msgid ""
"passing argument %d of %qE makes qualified function pointer from unqualified"
msgstr ""
-#: c-typeck.c:4153 c-typeck.c:4320
+#: c-typeck.c:4158 c-typeck.c:4328
#, gcc-internal-format
msgid "assignment makes qualified function pointer from unqualified"
msgstr ""
-#: c-typeck.c:4156 c-typeck.c:4322
+#: c-typeck.c:4161 c-typeck.c:4330
#, gcc-internal-format
msgid "initialization makes qualified function pointer from unqualified"
msgstr ""
-#: c-typeck.c:4159 c-typeck.c:4324
+#: c-typeck.c:4164 c-typeck.c:4332
#, gcc-internal-format
msgid "return makes qualified function pointer from unqualified"
msgstr ""
-#: c-typeck.c:4163 c-typeck.c:4284
+#: c-typeck.c:4169 c-typeck.c:4290
#, gcc-internal-format
msgid "passing argument %d of %qE discards qualifiers from pointer target type"
msgstr ""
-#: c-typeck.c:4165 c-typeck.c:4286
+#: c-typeck.c:4171 c-typeck.c:4292
#, gcc-internal-format
msgid "assignment discards qualifiers from pointer target type"
msgstr ""
-#: c-typeck.c:4167 c-typeck.c:4288
+#: c-typeck.c:4173 c-typeck.c:4294
#, gcc-internal-format
msgid "initialization discards qualifiers from pointer target type"
msgstr ""
-#: c-typeck.c:4169 c-typeck.c:4290
+#: c-typeck.c:4175 c-typeck.c:4296
#, gcc-internal-format
msgid "return discards qualifiers from pointer target type"
msgstr ""
-#: c-typeck.c:4176
+#: c-typeck.c:4183
#, gcc-internal-format
msgid "ISO C prohibits argument conversion to union type"
msgstr ""
-#: c-typeck.c:4212
+#: c-typeck.c:4216
#, gcc-internal-format
msgid "request for implicit conversion from %qT to %qT not permitted in C++"
msgstr ""
-#: c-typeck.c:4225
+#: c-typeck.c:4229
#, gcc-internal-format
msgid "argument %d of %qE might be a candidate for a format attribute"
msgstr ""
-#: c-typeck.c:4231
+#: c-typeck.c:4235
#, gcc-internal-format
msgid "assignment left-hand side might be a candidate for a format attribute"
msgstr ""
-#: c-typeck.c:4236
+#: c-typeck.c:4240
#, gcc-internal-format
msgid ""
"initialization left-hand side might be a candidate for a format attribute"
msgstr ""
-#: c-typeck.c:4241
+#: c-typeck.c:4245
#, gcc-internal-format
msgid "return type might be a candidate for a format attribute"
msgstr ""
-#: c-typeck.c:4264
+#: c-typeck.c:4269
#, gcc-internal-format
msgid ""
"ISO C forbids passing argument %d of %qE between function pointer and %<void "
"*%>"
msgstr ""
-#: c-typeck.c:4267
+#: c-typeck.c:4272
#, gcc-internal-format
msgid "ISO C forbids assignment between function pointer and %<void *%>"
msgstr ""
-#: c-typeck.c:4269
+#: c-typeck.c:4274
#, gcc-internal-format
msgid "ISO C forbids initialization between function pointer and %<void *%>"
msgstr ""
-#: c-typeck.c:4271
+#: c-typeck.c:4276
#, gcc-internal-format
msgid "ISO C forbids return between function pointer and %<void *%>"
msgstr ""
-#: c-typeck.c:4300
+#: c-typeck.c:4307
#, gcc-internal-format
msgid "pointer targets in passing argument %d of %qE differ in signedness"
msgstr ""
-#: c-typeck.c:4302
+#: c-typeck.c:4309
#, gcc-internal-format
msgid "pointer targets in assignment differ in signedness"
msgstr ""
-#: c-typeck.c:4304
+#: c-typeck.c:4311
#, gcc-internal-format
msgid "pointer targets in initialization differ in signedness"
msgstr ""
-#: c-typeck.c:4306
+#: c-typeck.c:4313
#, gcc-internal-format
msgid "pointer targets in return differ in signedness"
msgstr ""
-#: c-typeck.c:4331
+#: c-typeck.c:4340
#, gcc-internal-format
msgid "passing argument %d of %qE from incompatible pointer type"
msgstr ""
-#: c-typeck.c:4333
+#: c-typeck.c:4342
#, gcc-internal-format
msgid "assignment from incompatible pointer type"
msgstr ""
-#: c-typeck.c:4334
+#: c-typeck.c:4343
#, gcc-internal-format
msgid "initialization from incompatible pointer type"
msgstr ""
-#: c-typeck.c:4336
+#: c-typeck.c:4345
#, gcc-internal-format
msgid "return from incompatible pointer type"
msgstr ""
-#: c-typeck.c:4353
+#: c-typeck.c:4363
#, gcc-internal-format
msgid "passing argument %d of %qE makes pointer from integer without a cast"
msgstr ""
-#: c-typeck.c:4355
+#: c-typeck.c:4365
#, gcc-internal-format
msgid "assignment makes pointer from integer without a cast"
msgstr ""
-#: c-typeck.c:4357
+#: c-typeck.c:4367
#, gcc-internal-format
msgid "initialization makes pointer from integer without a cast"
msgstr ""
-#: c-typeck.c:4359
+#: c-typeck.c:4369
#, gcc-internal-format
msgid "return makes pointer from integer without a cast"
msgstr ""
-#: c-typeck.c:4366
+#: c-typeck.c:4377
#, gcc-internal-format
msgid "passing argument %d of %qE makes integer from pointer without a cast"
msgstr ""
-#: c-typeck.c:4368
+#: c-typeck.c:4379
#, gcc-internal-format
msgid "assignment makes integer from pointer without a cast"
msgstr ""
-#: c-typeck.c:4370
+#: c-typeck.c:4381
#, gcc-internal-format
msgid "initialization makes integer from pointer without a cast"
msgstr ""
-#: c-typeck.c:4372
+#: c-typeck.c:4383
#, gcc-internal-format
msgid "return makes integer from pointer without a cast"
msgstr ""
-#: c-typeck.c:4388
+#: c-typeck.c:4399
#, gcc-internal-format
msgid "incompatible types in assignment"
msgstr ""
-#: c-typeck.c:4391
+#: c-typeck.c:4402
#, gcc-internal-format
msgid "incompatible types in initialization"
msgstr ""
-#: c-typeck.c:4394
+#: c-typeck.c:4405
#, gcc-internal-format
msgid "incompatible types in return"
msgstr ""
-#: c-typeck.c:4450
+#: c-typeck.c:4461
#, gcc-internal-format
msgid "traditional C rejects automatic aggregate initialization"
msgstr ""
-#: c-typeck.c:4621 c-typeck.c:4636 c-typeck.c:4651
+#: c-typeck.c:4632 c-typeck.c:4648 c-typeck.c:4665
#, gcc-internal-format
msgid "(near initialization for %qs)"
msgstr ""
-#: c-typeck.c:5191 cp/decl.c:4984
+#: c-typeck.c:5220 cp/decl.c:5075
#, gcc-internal-format
msgid "opaque vector types cannot be initialized"
msgstr ""
-#: c-typeck.c:5814
+#: c-typeck.c:5845
#, gcc-internal-format
msgid "unknown field %qE specified in initializer"
msgstr ""
-#: c-typeck.c:6714
+#: c-typeck.c:6740
#, gcc-internal-format
msgid "traditional C rejects initialization of unions"
msgstr ""
-#: c-typeck.c:7022
+#: c-typeck.c:7051
#, gcc-internal-format
msgid "jump into statement expression"
msgstr ""
-#: c-typeck.c:7028
+#: c-typeck.c:7057
#, gcc-internal-format
msgid "jump into scope of identifier with variably modified type"
msgstr ""
-#: c-typeck.c:7065
+#: c-typeck.c:7093
#, gcc-internal-format
msgid "ISO C forbids %<goto *expr;%>"
msgstr ""
-#: c-typeck.c:7080 cp/typeck.c:6608
+#: c-typeck.c:7108 cp/typeck.c:6736
#, gcc-internal-format
msgid "function declared %<noreturn%> has a %<return%> statement"
msgstr ""
-#: c-typeck.c:7088
+#: c-typeck.c:7117
#, gcc-internal-format
msgid "%<return%> with no value, in function returning non-void"
msgstr ""
-#: c-typeck.c:7097
+#: c-typeck.c:7127
#, gcc-internal-format
msgid "%<return%> with a value, in function returning void"
msgstr ""
-#: c-typeck.c:7099
+#: c-typeck.c:7129
#, gcc-internal-format
msgid "ISO C forbids %<return%> with expression, in function returning void"
msgstr ""
-#: c-typeck.c:7156
+#: c-typeck.c:7186
#, gcc-internal-format
msgid "function returns address of local variable"
msgstr ""
-#: c-typeck.c:7228 cp/semantics.c:952
+#: c-typeck.c:7261 cp/semantics.c:961
#, gcc-internal-format
msgid "switch quantity not an integer"
msgstr ""
-#: c-typeck.c:7240
+#: c-typeck.c:7273
#, gcc-internal-format
msgid "%<long%> switch expression not converted to %<int%> in ISO C"
msgstr ""
-#: c-typeck.c:7280
+#: c-typeck.c:7316
#, gcc-internal-format
msgid ""
"case label in statement expression not containing enclosing switch statement"
msgstr ""
-#: c-typeck.c:7283
+#: c-typeck.c:7319
#, gcc-internal-format
msgid ""
"%<default%> label in statement expression not containing enclosing switch "
"statement"
msgstr ""
-#: c-typeck.c:7289
+#: c-typeck.c:7325
#, gcc-internal-format
msgid ""
"case label in scope of identifier with variably modified type not containing "
"enclosing switch statement"
msgstr ""
-#: c-typeck.c:7292
+#: c-typeck.c:7328
#, gcc-internal-format
msgid ""
"%<default%> label in scope of identifier with variably modified type not "
"containing enclosing switch statement"
msgstr ""
-#: c-typeck.c:7296 cp/parser.c:6808
+#: c-typeck.c:7332
#, gcc-internal-format
msgid "case label not within a switch statement"
msgstr ""
-#: c-typeck.c:7298
+#: c-typeck.c:7334
#, gcc-internal-format
msgid "%<default%> label not within a switch statement"
msgstr ""
-#: c-typeck.c:7375
+#: c-typeck.c:7411
#, gcc-internal-format
msgid "%Hsuggest explicit braces to avoid ambiguous %<else%>"
msgstr ""
-#: c-typeck.c:7486 cp/cp-gimplify.c:97 cp/parser.c:7413
+#: c-typeck.c:7522 cp/cp-gimplify.c:92
#, gcc-internal-format
msgid "break statement not within loop or switch"
msgstr ""
-#: c-typeck.c:7488 cp/parser.c:7434
+#: c-typeck.c:7524
#, gcc-internal-format
msgid "continue statement not within a loop"
msgstr ""
-#: c-typeck.c:7493 cp/parser.c:7424
+#: c-typeck.c:7529
#, gcc-internal-format
msgid "break statement used with OpenMP for loop"
msgstr ""
-#: c-typeck.c:7516
+#: c-typeck.c:7555
#, gcc-internal-format
msgid "%Hstatement with no effect"
msgstr ""
-#: c-typeck.c:7538
+#: c-typeck.c:7577
#, gcc-internal-format
msgid "expression statement has incomplete type"
msgstr ""
-#: c-typeck.c:8093 cp/typeck.c:3290
+#: c-typeck.c:8132 cp/typeck.c:3402
#, gcc-internal-format
msgid "right shift count is negative"
msgstr ""
-#: c-typeck.c:8100 cp/typeck.c:3294
+#: c-typeck.c:8139 cp/typeck.c:3408
#, gcc-internal-format
msgid "right shift count >= width of type"
msgstr ""
-#: c-typeck.c:8122 cp/typeck.c:3313
+#: c-typeck.c:8161 cp/typeck.c:3429
#, gcc-internal-format
msgid "left shift count is negative"
msgstr ""
-#: c-typeck.c:8125 cp/typeck.c:3315
+#: c-typeck.c:8164 cp/typeck.c:3434
#, gcc-internal-format
msgid "left shift count >= width of type"
msgstr ""
-#: c-typeck.c:8143 cp/typeck.c:3353
+#: c-typeck.c:8182 cp/typeck.c:3480
#, gcc-internal-format
msgid "comparing floating point with == or != is unsafe"
msgstr ""
-#: c-typeck.c:8167 c-typeck.c:8174
+#: c-typeck.c:8206 c-typeck.c:8213
#, gcc-internal-format
msgid "ISO C forbids comparison of %<void *%> with function pointer"
msgstr ""
-#: c-typeck.c:8180 c-typeck.c:8238
+#: c-typeck.c:8220 c-typeck.c:8280
#, gcc-internal-format
msgid "comparison of distinct pointer types lacks a cast"
msgstr ""
-#: c-typeck.c:8189 c-typeck.c:8197 cp/typeck.c:3373 cp/typeck.c:3382
+#: c-typeck.c:8229 c-typeck.c:8237 cp/typeck.c:3503 cp/typeck.c:3515
#, gcc-internal-format
msgid "the address of %qD will never be NULL"
msgstr ""
-#: c-typeck.c:8204 c-typeck.c:8209 c-typeck.c:8256 c-typeck.c:8261
+#: c-typeck.c:8244 c-typeck.c:8249 c-typeck.c:8302 c-typeck.c:8307
#, gcc-internal-format
msgid "comparison between pointer and integer"
msgstr ""
-#: c-typeck.c:8230
+#: c-typeck.c:8271
#, gcc-internal-format
msgid "comparison of complete and incomplete pointers"
msgstr ""
-#: c-typeck.c:8233
+#: c-typeck.c:8273
#, gcc-internal-format
msgid "ISO C forbids ordered comparisons of pointers to functions"
msgstr ""
-#: c-typeck.c:8245 c-typeck.c:8251
+#: c-typeck.c:8288 c-typeck.c:8291 c-typeck.c:8297
#, gcc-internal-format
msgid "ordered comparison of pointer with integer zero"
msgstr ""
-#: c-typeck.c:8511
-#, gcc-internal-format
-msgid "comparison between signed and unsigned"
-msgstr ""
-
-#: c-typeck.c:8557 cp/typeck.c:3827
-#, gcc-internal-format
-msgid "comparison of promoted ~unsigned with constant"
-msgstr ""
-
-#: c-typeck.c:8565 cp/typeck.c:3835
-#, gcc-internal-format
-msgid "comparison of promoted ~unsigned with unsigned"
-msgstr ""
-
-#: c-typeck.c:8623
+#: c-typeck.c:8471
#, gcc-internal-format
msgid "used array that cannot be converted to pointer where scalar is required"
msgstr ""
-#: c-typeck.c:8627
+#: c-typeck.c:8475
#, gcc-internal-format
msgid "used struct type value where scalar is required"
msgstr ""
-#: c-typeck.c:8631
+#: c-typeck.c:8479
#, gcc-internal-format
msgid "used union type value where scalar is required"
msgstr ""
-#: c-typeck.c:8736 cp/semantics.c:3551
+#: c-typeck.c:8615 cp/semantics.c:3712
#, gcc-internal-format
msgid "%qE has invalid type for %<reduction%>"
msgstr ""
-#: c-typeck.c:8770 cp/semantics.c:3564
+#: c-typeck.c:8649 cp/semantics.c:3725
#, gcc-internal-format
msgid "%qE has invalid type for %<reduction(%s)%>"
msgstr ""
-#: c-typeck.c:8786 cp/semantics.c:3574
+#: c-typeck.c:8665 cp/semantics.c:3735
#, gcc-internal-format
msgid "%qE must be %<threadprivate%> for %<copyin%>"
msgstr ""
-#: c-typeck.c:8795 cp/semantics.c:3379
+#: c-typeck.c:8674 cp/semantics.c:3532
#, gcc-internal-format
msgid "%qE is not a variable in clause %qs"
msgstr ""
-#: c-typeck.c:8802 c-typeck.c:8822 c-typeck.c:8842 cp/semantics.c:3405
-#: cp/semantics.c:3424
+#: c-typeck.c:8681 c-typeck.c:8701 c-typeck.c:8721
#, gcc-internal-format
msgid "%qE appears more than once in data clauses"
msgstr ""
-#: c-typeck.c:8816 cp/semantics.c:3399
+#: c-typeck.c:8695 cp/semantics.c:3555
#, gcc-internal-format
msgid "%qE is not a variable in clause %<firstprivate%>"
msgstr ""
-#: c-typeck.c:8836 cp/semantics.c:3418
+#: c-typeck.c:8715 cp/semantics.c:3577
#, gcc-internal-format
msgid "%qE is not a variable in clause %<lastprivate%>"
msgstr ""
-#: c-typeck.c:8894 cp/semantics.c:3615
+#: c-typeck.c:8775 cp/semantics.c:3776
#, gcc-internal-format
msgid "%qE is predetermined %qs for %qs"
msgstr ""
-#: calls.c:2032
+#: calls.c:2047
#, gcc-internal-format
msgid "function call has aggregate value"
msgstr ""
-#: cfgexpand.c:1887
+#: cfgexpand.c:298
+#, gcc-internal-format
+msgid "Unrecognized GIMPLE statement during RTL expansion"
+msgstr ""
+
+#: cfgexpand.c:2292
#, gcc-internal-format
msgid "not protecting local variables: variable length buffer"
msgstr ""
-#: cfgexpand.c:1890
+#: cfgexpand.c:2295
#, gcc-internal-format
msgid "not protecting function: no buffer at least %d bytes long"
msgstr ""
-#: cfghooks.c:97
+#: cfghooks.c:98
#, gcc-internal-format
msgid "bb %d on wrong place"
msgstr ""
-#: cfghooks.c:103
+#: cfghooks.c:104
#, gcc-internal-format
msgid "prev_bb of %d should be %d, not %d"
msgstr ""
-#: cfghooks.c:120
+#: cfghooks.c:121
#, gcc-internal-format
msgid "verify_flow_info: Block %i has loop_father, but there are no loops"
msgstr ""
-#: cfghooks.c:126
+#: cfghooks.c:127
#, gcc-internal-format
msgid "verify_flow_info: Block %i lacks loop_father"
msgstr ""
-#: cfghooks.c:132
+#: cfghooks.c:133
#, gcc-internal-format
msgid "verify_flow_info: Wrong count of block %i %i"
msgstr ""
-#: cfghooks.c:138
+#: cfghooks.c:139
#, gcc-internal-format
msgid "verify_flow_info: Wrong frequency of block %i %i"
msgstr ""
-#: cfghooks.c:146
+#: cfghooks.c:147
#, gcc-internal-format
msgid "verify_flow_info: Duplicate edge %i->%i"
msgstr ""
-#: cfghooks.c:152
+#: cfghooks.c:153
#, gcc-internal-format
msgid "verify_flow_info: Wrong probability of edge %i->%i %i"
msgstr ""
-#: cfghooks.c:158
+#: cfghooks.c:159
#, gcc-internal-format
msgid "verify_flow_info: Wrong count of edge %i->%i %i"
msgstr ""
-#: cfghooks.c:170
+#: cfghooks.c:171
#, gcc-internal-format
msgid "verify_flow_info: Basic block %d succ edge is corrupted"
msgstr ""
-#: cfghooks.c:184 cfgrtl.c:1838
+#: cfghooks.c:185 cfgrtl.c:1830
#, gcc-internal-format
msgid "wrong amount of branch edges after unconditional jump %i"
msgstr ""
-#: cfghooks.c:192 cfghooks.c:203
+#: cfghooks.c:193 cfghooks.c:204
#, gcc-internal-format
msgid "basic block %d pred edge is corrupted"
msgstr ""
-#: cfghooks.c:204
+#: cfghooks.c:205
#, gcc-internal-format
msgid "its dest_idx should be %d, not %d"
msgstr ""
-#: cfghooks.c:233
+#: cfghooks.c:234
#, gcc-internal-format
msgid "basic block %i edge lists are corrupted"
msgstr ""
-#: cfghooks.c:246
+#: cfghooks.c:247
#, gcc-internal-format
msgid "verify_flow_info failed"
msgstr ""
-#: cfghooks.c:307
+#: cfghooks.c:308
#, gcc-internal-format
msgid "%s does not support redirect_edge_and_branch"
msgstr ""
-#: cfghooks.c:327
+#: cfghooks.c:328
#, gcc-internal-format
msgid "%s does not support can_remove_branch_p"
msgstr ""
-#: cfghooks.c:381
+#: cfghooks.c:382
#, gcc-internal-format
msgid "%s does not support redirect_edge_and_branch_force"
msgstr ""
-#: cfghooks.c:417
+#: cfghooks.c:418
#, gcc-internal-format
msgid "%s does not support split_block"
msgstr ""
-#: cfghooks.c:460
+#: cfghooks.c:461
#, gcc-internal-format
msgid "%s does not support move_block_after"
msgstr ""
-#: cfghooks.c:473
+#: cfghooks.c:474
#, gcc-internal-format
msgid "%s does not support delete_basic_block"
msgstr ""
-#: cfghooks.c:523
+#: cfghooks.c:524
#, gcc-internal-format
msgid "%s does not support split_edge"
msgstr ""
-#: cfghooks.c:596
+#: cfghooks.c:597
#, gcc-internal-format
msgid "%s does not support create_basic_block"
msgstr ""
-#: cfghooks.c:624
+#: cfghooks.c:625
#, gcc-internal-format
msgid "%s does not support can_merge_blocks_p"
msgstr ""
-#: cfghooks.c:635
+#: cfghooks.c:636
#, gcc-internal-format
msgid "%s does not support predict_edge"
msgstr ""
-#: cfghooks.c:644
+#: cfghooks.c:645
#, gcc-internal-format
msgid "%s does not support predicted_by_p"
msgstr ""
-#: cfghooks.c:658
+#: cfghooks.c:659
#, gcc-internal-format
msgid "%s does not support merge_blocks"
msgstr ""
-#: cfghooks.c:711
+#: cfghooks.c:712
#, gcc-internal-format
msgid "%s does not support make_forwarder_block"
msgstr ""
-#: cfghooks.c:845
+#: cfghooks.c:846
#, gcc-internal-format
msgid "%s does not support can_duplicate_block_p"
msgstr ""
-#: cfghooks.c:867
+#: cfghooks.c:868
#, gcc-internal-format
msgid "%s does not support duplicate_block"
msgstr ""
-#: cfghooks.c:944
+#: cfghooks.c:945
#, gcc-internal-format
msgid "%s does not support block_ends_with_call_p"
msgstr ""
-#: cfghooks.c:955
+#: cfghooks.c:956
#, gcc-internal-format
msgid "%s does not support block_ends_with_condjump_p"
msgstr ""
-#: cfghooks.c:973
+#: cfghooks.c:974
#, gcc-internal-format
msgid "%s does not support flow_call_edges_add"
msgstr ""
-#: cfgloop.c:1328
+#: cfgloop.c:1331
#, gcc-internal-format
msgid "size of loop %d should be %d, not %d"
msgstr ""
-#: cfgloop.c:1342
+#: cfgloop.c:1345
#, gcc-internal-format
msgid "bb %d do not belong to loop %d"
msgstr ""
-#: cfgloop.c:1357
+#: cfgloop.c:1360
#, gcc-internal-format
msgid "loop %d's header does not have exactly 2 entries"
msgstr ""
-#: cfgloop.c:1364
+#: cfgloop.c:1367
#, gcc-internal-format
msgid "loop %d's latch does not have exactly 1 successor"
msgstr ""
-#: cfgloop.c:1369
+#: cfgloop.c:1372
#, gcc-internal-format
msgid "loop %d's latch does not have header as successor"
msgstr ""
-#: cfgloop.c:1374
+#: cfgloop.c:1377
#, gcc-internal-format
msgid "loop %d's latch does not belong directly to it"
msgstr ""
-#: cfgloop.c:1380
+#: cfgloop.c:1383
#, gcc-internal-format
msgid "loop %d's header does not belong directly to it"
msgstr ""
-#: cfgloop.c:1386
+#: cfgloop.c:1389
#, gcc-internal-format
msgid "loop %d's latch is marked as part of irreducible region"
msgstr ""
-#: cfgloop.c:1419
+#: cfgloop.c:1422
#, gcc-internal-format
msgid "basic block %d should be marked irreducible"
msgstr ""
-#: cfgloop.c:1425
+#: cfgloop.c:1428
#, gcc-internal-format
msgid "basic block %d should not be marked irreducible"
msgstr ""
-#: cfgloop.c:1433
+#: cfgloop.c:1436
#, gcc-internal-format
msgid "edge from %d to %d should be marked irreducible"
msgstr ""
-#: cfgloop.c:1440
+#: cfgloop.c:1443
#, gcc-internal-format
msgid "edge from %d to %d should not be marked irreducible"
msgstr ""
-#: cfgloop.c:1455
+#: cfgloop.c:1458
#, gcc-internal-format
msgid "corrupted head of the exits list of loop %d"
msgstr ""
-#: cfgloop.c:1473
+#: cfgloop.c:1476
#, gcc-internal-format
msgid "corrupted exits list of loop %d"
msgstr ""
-#: cfgloop.c:1482
+#: cfgloop.c:1485
#, gcc-internal-format
msgid "nonempty exits list of loop %d, but exits are not recorded"
msgstr ""
-#: cfgloop.c:1508
+#: cfgloop.c:1511
#, gcc-internal-format
msgid "Exit %d->%d not recorded"
msgstr ""
-#: cfgloop.c:1526
+#: cfgloop.c:1529
#, gcc-internal-format
msgid "Wrong list of exited loops for edge %d->%d"
msgstr ""
-#: cfgloop.c:1535
+#: cfgloop.c:1538
#, gcc-internal-format
msgid "Too many loop exits recorded"
msgstr ""
-#: cfgloop.c:1546
+#: cfgloop.c:1549
#, gcc-internal-format
msgid "%d exits recorded for loop %d (having %d exits)"
msgstr ""
-#: cfgrtl.c:1732
+#: cfgrtl.c:1724
#, gcc-internal-format
msgid "BB_RTL flag not set for block %d"
msgstr ""
-#: cfgrtl.c:1739
+#: cfgrtl.c:1731
#, gcc-internal-format
msgid "insn %d basic block pointer is %d, should be %d"
msgstr ""
-#: cfgrtl.c:1750
+#: cfgrtl.c:1742
#, gcc-internal-format
msgid "insn %d in header of bb %d has non-NULL basic block"
msgstr ""
-#: cfgrtl.c:1758
+#: cfgrtl.c:1750
#, gcc-internal-format
msgid "insn %d in footer of bb %d has non-NULL basic block"
msgstr ""
-#: cfgrtl.c:1780
+#: cfgrtl.c:1772
#, gcc-internal-format
msgid "verify_flow_info: REG_BR_PROB does not match cfg %wi %i"
msgstr ""
-#: cfgrtl.c:1795
+#: cfgrtl.c:1787
#, gcc-internal-format
msgid "fallthru edge crosses section boundary (bb %i)"
msgstr ""
-#: cfgrtl.c:1820
+#: cfgrtl.c:1812
#, gcc-internal-format
msgid "missing REG_EH_REGION note in the end of bb %i"
msgstr ""
-#: cfgrtl.c:1828
+#: cfgrtl.c:1820
#, gcc-internal-format
msgid "too many outgoing branch edges from bb %i"
msgstr ""
-#: cfgrtl.c:1833
+#: cfgrtl.c:1825
#, gcc-internal-format
msgid "fallthru edge after unconditional jump %i"
msgstr ""
-#: cfgrtl.c:1844
+#: cfgrtl.c:1836
#, gcc-internal-format
msgid "wrong amount of branch edges after conditional jump %i"
msgstr ""
-#: cfgrtl.c:1850
+#: cfgrtl.c:1842
#, gcc-internal-format
msgid "call edges for non-call insn in bb %i"
msgstr ""
-#: cfgrtl.c:1859
+#: cfgrtl.c:1851
#, gcc-internal-format
msgid "abnormal edges for no purpose in bb %i"
msgstr ""
-#: cfgrtl.c:1871
+#: cfgrtl.c:1863
#, gcc-internal-format
msgid "insn %d inside basic block %d but block_for_insn is NULL"
msgstr ""
-#: cfgrtl.c:1875
+#: cfgrtl.c:1867
#, gcc-internal-format
msgid "insn %d inside basic block %d but block_for_insn is %i"
msgstr ""
-#: cfgrtl.c:1889 cfgrtl.c:1899
+#: cfgrtl.c:1881 cfgrtl.c:1891
#, gcc-internal-format
msgid "NOTE_INSN_BASIC_BLOCK is missing for block %d"
msgstr ""
-#: cfgrtl.c:1912
+#: cfgrtl.c:1904
#, gcc-internal-format
msgid "NOTE_INSN_BASIC_BLOCK %d in middle of basic block %d"
msgstr ""
-#: cfgrtl.c:1922
+#: cfgrtl.c:1914
#, gcc-internal-format
msgid "in basic block %d:"
msgstr ""
-#: cfgrtl.c:1975 cfgrtl.c:2065
+#: cfgrtl.c:1967 cfgrtl.c:2057
#, gcc-internal-format
msgid "insn %d outside of basic blocks has non-NULL bb field"
msgstr ""
-#: cfgrtl.c:1983
+#: cfgrtl.c:1975
#, gcc-internal-format
msgid "end insn %d for block %d not found in the insn stream"
msgstr ""
-#: cfgrtl.c:1996
+#: cfgrtl.c:1988
#, gcc-internal-format
msgid "insn %d is in multiple basic blocks (%d and %d)"
msgstr ""
-#: cfgrtl.c:2008
+#: cfgrtl.c:2000
#, gcc-internal-format
msgid "head insn %d for block %d not found in the insn stream"
msgstr ""
-#: cfgrtl.c:2028
+#: cfgrtl.c:2020
#, gcc-internal-format
msgid "missing barrier after block %i"
msgstr ""
-#: cfgrtl.c:2041
+#: cfgrtl.c:2033
#, gcc-internal-format
msgid "verify_flow_info: Incorrect blocks for fallthru %i->%i"
msgstr ""
-#: cfgrtl.c:2050
+#: cfgrtl.c:2042
#, gcc-internal-format
msgid "verify_flow_info: Incorrect fallthru %i->%i"
msgstr ""
-#: cfgrtl.c:2083
+#: cfgrtl.c:2075
#, gcc-internal-format
msgid "basic blocks not laid down consecutively"
msgstr ""
-#: cfgrtl.c:2122
+#: cfgrtl.c:2114
#, gcc-internal-format
msgid "number of bb notes in insn chain (%d) != n_basic_blocks (%d)"
msgstr ""
-#: cgraph.c:840
+#: cgraph.c:1165
#, gcc-internal-format
msgid "%D renamed after being referenced in assembly"
msgstr ""
-#: cgraphunit.c:675
+#: cgraphunit.c:572
#, gcc-internal-format
msgid "aux field set for edge %s->%s"
msgstr ""
-#: cgraphunit.c:681
+#: cgraphunit.c:578
#, gcc-internal-format
msgid "Execution count is negative"
msgstr ""
-#: cgraphunit.c:688
+#: cgraphunit.c:585
#, gcc-internal-format
msgid "caller edge count is negative"
msgstr ""
-#: cgraphunit.c:693
+#: cgraphunit.c:590
#, gcc-internal-format
msgid "caller edge frequency is negative"
msgstr ""
-#: cgraphunit.c:698
+#: cgraphunit.c:595
#, gcc-internal-format
msgid "caller edge frequency is too large"
msgstr ""
-#: cgraphunit.c:707
+#: cgraphunit.c:604
#, gcc-internal-format
msgid "inlined_to pointer is wrong"
msgstr ""
-#: cgraphunit.c:712
+#: cgraphunit.c:609
#, gcc-internal-format
msgid "multiple inline callers"
msgstr ""
-#: cgraphunit.c:719
+#: cgraphunit.c:616
#, gcc-internal-format
msgid "inlined_to pointer set for noninline callers"
msgstr ""
-#: cgraphunit.c:725
+#: cgraphunit.c:622
#, gcc-internal-format
msgid "inlined_to pointer is set but no predecessors found"
msgstr ""
-#: cgraphunit.c:730
+#: cgraphunit.c:627
#, gcc-internal-format
msgid "inlined_to pointer refers to itself"
msgstr ""
-#: cgraphunit.c:740
+#: cgraphunit.c:637
#, gcc-internal-format
msgid "node not found in cgraph_hash"
msgstr ""
-#: cgraphunit.c:768
+#: cgraphunit.c:667
#, gcc-internal-format
msgid "shared call_stmt:"
msgstr ""
-#: cgraphunit.c:775
+#: cgraphunit.c:674
#, gcc-internal-format
msgid "edge points to wrong declaration:"
msgstr ""
-#: cgraphunit.c:784
+#: cgraphunit.c:683
#, gcc-internal-format
msgid "missing callgraph edge for call stmt:"
msgstr ""
-#: cgraphunit.c:800
+#: cgraphunit.c:699
#, gcc-internal-format
msgid "edge %s->%s has no corresponding call_stmt"
msgstr ""
-#: cgraphunit.c:812
+#: cgraphunit.c:711
#, gcc-internal-format
msgid "verify_cgraph_node failed"
msgstr ""
-#: cgraphunit.c:915 cgraphunit.c:938
+#: cgraphunit.c:804 cgraphunit.c:827
#, gcc-internal-format
msgid "%J%<externally_visible%> attribute have effect only on public objects"
msgstr ""
-#: cgraphunit.c:1128
+#: cgraphunit.c:1010
#, gcc-internal-format
msgid "failed to reclaim unneeded function"
msgstr ""
-#: cgraphunit.c:1460
+#: cgraphunit.c:1338
#, gcc-internal-format
-msgid "nodes with no released memory found"
+msgid "nodes with unreleased memory found"
msgstr ""
-#: collect2.c:1203
+#: collect2.c:1209
#, gcc-internal-format
msgid "unknown demangling style '%s'"
msgstr ""
-#: collect2.c:1526
+#: collect2.c:1532
#, gcc-internal-format
msgid "%s terminated with signal %d [%s]%s"
msgstr ""
-#: collect2.c:1544
+#: collect2.c:1550
#, gcc-internal-format
msgid "%s returned %d exit status"
msgstr ""
-#: collect2.c:2256
+#: collect2.c:2261
#, gcc-internal-format
msgid "cannot find 'ldd'"
msgstr ""
@@ -22417,368 +22461,373 @@ msgstr ""
msgid "cannot convert to a pointer type"
msgstr ""
-#: convert.c:333
+#: convert.c:332
#, gcc-internal-format
msgid "pointer value used where a floating point value was expected"
msgstr ""
-#: convert.c:337
+#: convert.c:336
#, gcc-internal-format
msgid "aggregate value used where a float was expected"
msgstr ""
-#: convert.c:362
+#: convert.c:361
#, gcc-internal-format
msgid "conversion to incomplete type"
msgstr ""
-#: convert.c:731 convert.c:807
+#: convert.c:730 convert.c:806
#, gcc-internal-format
msgid "can't convert between vector values of different size"
msgstr ""
-#: convert.c:737
+#: convert.c:736
#, gcc-internal-format
msgid "aggregate value used where an integer was expected"
msgstr ""
-#: convert.c:787
+#: convert.c:786
#, gcc-internal-format
msgid "pointer value used where a complex was expected"
msgstr ""
-#: convert.c:791
+#: convert.c:790
#, gcc-internal-format
msgid "aggregate value used where a complex was expected"
msgstr ""
-#: convert.c:813
+#: convert.c:812
#, gcc-internal-format
msgid "can't convert value to a vector"
msgstr ""
-#: convert.c:852
+#: convert.c:851
#, gcc-internal-format
msgid "aggregate value used where a fixed-point was expected"
msgstr ""
-#: coverage.c:182
+#: coverage.c:184
#, gcc-internal-format
msgid "%qs is not a gcov data file"
msgstr ""
-#: coverage.c:193
+#: coverage.c:195
#, gcc-internal-format
msgid "%qs is version %q.*s, expected version %q.*s"
msgstr ""
-#: coverage.c:273 coverage.c:281
+#: coverage.c:275 coverage.c:283
#, gcc-internal-format
msgid "coverage mismatch for function %u while reading execution counters"
msgstr ""
-#: coverage.c:275 coverage.c:370
+#: coverage.c:277 coverage.c:372
#, gcc-internal-format
msgid "checksum is %x instead of %x"
msgstr ""
-#: coverage.c:283 coverage.c:372
+#: coverage.c:285 coverage.c:374
#, gcc-internal-format
msgid "number of counters is %d instead of %d"
msgstr ""
-#: coverage.c:289
+#: coverage.c:291
#, gcc-internal-format
msgid "cannot merge separate %s counters for function %u"
msgstr ""
-#: coverage.c:310
+#: coverage.c:312
#, gcc-internal-format
msgid "%qs has overflowed"
msgstr ""
-#: coverage.c:347
+#: coverage.c:349
#, gcc-internal-format
msgid "no coverage for function %qs found"
msgstr ""
-#: coverage.c:361 coverage.c:364
+#: coverage.c:363 coverage.c:366
#, gcc-internal-format
msgid "coverage mismatch for function %qs while reading counter %qs"
msgstr ""
-#: coverage.c:380
+#: coverage.c:382
#, gcc-internal-format
msgid "coverage mismatch ignored due to -Wcoverage-mismatch"
msgstr ""
-#: coverage.c:382
+#: coverage.c:384
#, gcc-internal-format
msgid "execution counts estimated"
msgstr ""
-#: coverage.c:385
+#: coverage.c:387
#, gcc-internal-format
msgid "this can result in poorly optimized code"
msgstr ""
-#: coverage.c:543
+#: coverage.c:567
#, gcc-internal-format
msgid "cannot open %s"
msgstr ""
-#: coverage.c:578
+#: coverage.c:602
#, gcc-internal-format
msgid "error writing %qs"
msgstr ""
-#: dbgcnt.c:127
+#: dbgcnt.c:134
#, gcc-internal-format
msgid "Can not find a valid counter:value pair:"
msgstr ""
-#: dbgcnt.c:128
+#: dbgcnt.c:135
#, gcc-internal-format
msgid "-fdbg-cnt=%s"
msgstr ""
-#: dbgcnt.c:129
+#: dbgcnt.c:136
#, gcc-internal-format
msgid " %s"
msgstr ""
-#: diagnostic.c:660
+#: dbxout.c:3227
+#, gcc-internal-format
+msgid "common symbol debug info is not structured as symbol+offset"
+msgstr ""
+
+#: diagnostic.c:699
#, gcc-internal-format
msgid "in %s, at %s:%d"
msgstr ""
-#: dominance.c:983
+#: dominance.c:984
#, gcc-internal-format
msgid "dominator of %d status unknown"
msgstr ""
-#: dominance.c:990
+#: dominance.c:991
#, gcc-internal-format
msgid "dominator of %d should be %d, not %d"
msgstr ""
-#: dwarf2out.c:3686
+#: dwarf2out.c:4464
#, gcc-internal-format
msgid "DW_LOC_OP %s not implemented"
msgstr ""
-#: emit-rtl.c:2262
+#: emit-rtl.c:2300
#, gcc-internal-format
msgid "invalid rtl sharing found in the insn"
msgstr ""
-#: emit-rtl.c:2264
+#: emit-rtl.c:2302
#, gcc-internal-format
msgid "shared rtx"
msgstr ""
-#: emit-rtl.c:2266
+#: emit-rtl.c:2304
#, gcc-internal-format
msgid "internal consistency failure"
msgstr ""
-#: emit-rtl.c:3365
+#: emit-rtl.c:3364
#, gcc-internal-format
msgid "ICE: emit_insn used where emit_jump_insn needed:\n"
msgstr ""
-#: errors.c:132
+#: errors.c:133
#, gcc-internal-format
msgid "abort in %s, at %s:%d"
msgstr ""
-#: except.c:337
+#: except.c:307
#, gcc-internal-format
msgid "exception handling disabled, use -fexceptions to enable"
msgstr ""
-#: except.c:2889
+#: except.c:2854
#, gcc-internal-format
msgid "argument of %<__builtin_eh_return_regno%> must be constant"
msgstr ""
-#: except.c:3022
+#: except.c:2987
#, gcc-internal-format
msgid "__builtin_eh_return not supported on this target"
msgstr ""
-#: except.c:3903 except.c:3912
+#: except.c:3861 except.c:3870
#, gcc-internal-format
msgid "region_array is corrupted for region %i"
msgstr ""
-#: except.c:3917
+#: except.c:3875
#, gcc-internal-format
msgid "outer block of region %i is wrong"
msgstr ""
-#: except.c:3922
+#: except.c:3880
#, gcc-internal-format
msgid "region %i may contain throw and is contained in region that may not"
msgstr ""
-#: except.c:3928
+#: except.c:3886
#, gcc-internal-format
msgid "negative nesting depth of region %i"
msgstr ""
-#: except.c:3948
+#: except.c:3906
#, gcc-internal-format
msgid "tree list ends on depth %i"
msgstr ""
-#: except.c:3953
+#: except.c:3911
#, gcc-internal-format
msgid "array does not match the region tree"
msgstr ""
-#: except.c:3959
+#: except.c:3917
#, gcc-internal-format
msgid "verify_eh_tree failed"
msgstr ""
-#: explow.c:1258
+#: explow.c:1260
#, gcc-internal-format
msgid "stack limits not supported on this target"
msgstr ""
-#: expr.c:8037
+#: expr.c:8032
msgid "%Kcall to %qs declared with attribute error: %s"
msgstr ""
-#: expr.c:8043
+#: expr.c:8038
msgid "%Kcall to %qs declared with attribute warning: %s"
msgstr ""
-#: final.c:1431
+#: final.c:1429
#, gcc-internal-format
msgid "invalid argument %qs to -fdebug-prefix-map"
msgstr ""
+#: final.c:1530
+#, gcc-internal-format
+msgid "the frame size of %wd bytes is larger than %wd bytes"
+msgstr ""
+
#: fixed-value.c:104
#, gcc-internal-format
msgid "large fixed-point constant implicitly truncated to fixed-point type"
msgstr ""
-#: fold-const.c:992 tree-ssa-loop-niter.c:1827 tree-vrp.c:5072
+#: fold-const.c:990 tree-ssa-loop-niter.c:1854 tree-vrp.c:5516 tree-vrp.c:5557
#, gcc-internal-format
msgid "%H%s"
msgstr ""
-#: fold-const.c:1363
+#: fold-const.c:1360
#, gcc-internal-format
msgid "assuming signed overflow does not occur when negating a division"
msgstr ""
-#: fold-const.c:4003 fold-const.c:4014
-#, gcc-internal-format
-msgid "comparison is always %d due to width of bit-field"
-msgstr ""
-
-#: fold-const.c:5331
+#: fold-const.c:5129
#, gcc-internal-format
msgid "assuming signed overflow does not occur when simplifying range test"
msgstr ""
-#: fold-const.c:5705 fold-const.c:5720
+#: fold-const.c:5505 fold-const.c:5520
#, gcc-internal-format
msgid "comparison is always %d"
msgstr ""
-#: fold-const.c:5849
+#: fold-const.c:5537
#, gcc-internal-format
msgid "%<or%> of unmatched not-equal tests is always 1"
msgstr ""
-#: fold-const.c:5854
+#: fold-const.c:5542
#, gcc-internal-format
msgid "%<and%> of mutually exclusive equal-tests is always 0"
msgstr ""
-#: fold-const.c:8639
+#: fold-const.c:8380
#, gcc-internal-format
msgid ""
"assuming signed overflow does not occur when reducing constant in comparison"
msgstr ""
-#: fold-const.c:8893
+#: fold-const.c:8753
#, gcc-internal-format
msgid ""
"assuming signed overflow does not occur when combining constants around a "
"comparison"
msgstr ""
-#: fold-const.c:13426
+#: fold-const.c:13312
#, gcc-internal-format
msgid "fold check: original tree changed by fold"
msgstr ""
-#: function.c:380
+#: function.c:317
#, gcc-internal-format
msgid "%Jtotal size of local objects too large"
msgstr ""
-#: function.c:840 varasm.c:2095
+#: function.c:813 varasm.c:2139
#, gcc-internal-format
msgid "size of variable %q+D is too large"
msgstr ""
-#: function.c:1557 gimplify.c:4401
+#: function.c:1556 gimplify.c:4750
#, gcc-internal-format
msgid "impossible constraint in %<asm%>"
msgstr ""
-#: function.c:3543
+#: function.c:3596
#, gcc-internal-format
msgid "variable %q+D might be clobbered by %<longjmp%> or %<vfork%>"
msgstr ""
-#: function.c:3564
+#: function.c:3617
#, gcc-internal-format
msgid "argument %q+D might be clobbered by %<longjmp%> or %<vfork%>"
msgstr ""
-#: function.c:4013
+#: function.c:4068
#, gcc-internal-format
msgid "function returns an aggregate"
msgstr ""
-#: function.c:4410
+#: function.c:4469
#, gcc-internal-format
msgid "unused parameter %q+D"
msgstr ""
-#: gcc.c:1286
+#: gcc.c:1301
#, gcc-internal-format
msgid "ambiguous abbreviation %s"
msgstr ""
-#: gcc.c:1313
+#: gcc.c:1328
#, gcc-internal-format
msgid "incomplete '%s' option"
msgstr ""
-#: gcc.c:1324
+#: gcc.c:1339
#, gcc-internal-format
msgid "missing argument to '%s' option"
msgstr ""
-#: gcc.c:1337
+#: gcc.c:1352
#, gcc-internal-format
msgid "extraneous argument to '%s' option"
msgstr ""
-#: gcc.c:3981
+#: gcc.c:4014
#, gcc-internal-format
msgid "warning: -pipe ignored because -save-temps specified"
msgstr ""
-#: gcc.c:4270
+#: gcc.c:4307
#, gcc-internal-format
msgid "warning: '-x %s' after last input file has no effect"
msgstr ""
@@ -22786,230 +22835,252 @@ msgstr ""
#. Catch the case where a spec string contains something like
#. '%{foo:%*}'. i.e. there is no * in the pattern on the left
#. hand side of the :.
-#: gcc.c:5308
+#: gcc.c:5390
#, gcc-internal-format
msgid "spec failure: '%%*' has not been initialized by pattern match"
msgstr ""
-#: gcc.c:5317
+#: gcc.c:5399
#, gcc-internal-format
msgid "warning: use of obsolete %%[ operator in specs"
msgstr ""
-#: gcc.c:5398
+#: gcc.c:5480
#, gcc-internal-format
msgid "spec failure: unrecognized spec option '%c'"
msgstr ""
-#: gcc.c:6304
+#: gcc.c:6386
#, gcc-internal-format
msgid "spec failure: more than one arg to SYSROOT_SUFFIX_SPEC"
msgstr ""
-#: gcc.c:6327
+#: gcc.c:6409
#, gcc-internal-format
msgid "spec failure: more than one arg to SYSROOT_HEADERS_SUFFIX_SPEC"
msgstr ""
-#: gcc.c:6414
+#: gcc.c:6496
#, gcc-internal-format
msgid "unrecognized option '-%s'"
msgstr ""
-#: gcc.c:6614 gcc.c:6677
+#: gcc.c:6708 gcc.c:6771
#, gcc-internal-format
msgid "%s: %s compiler not installed on this system"
msgstr ""
-#: gcc.c:6777
+#: gcc.c:6871
#, gcc-internal-format
msgid "%s: linker input file unused because linking not done"
msgstr ""
-#: gcc.c:6817
+#: gcc.c:6911
#, gcc-internal-format
msgid "language %s not recognized"
msgstr ""
-#: gcc.c:6888
+#: gcc.c:6982
#, gcc-internal-format
msgid "%s: %s"
msgstr ""
-#: gcse.c:6644
+#: gcse.c:6572
#, gcc-internal-format
msgid "%s: %d basic blocks and %d edges/basic block"
msgstr ""
-#: gcse.c:6657
+#: gcse.c:6585
#, gcc-internal-format
msgid "%s: %d basic blocks and %d registers"
msgstr ""
-#: ggc-common.c:403 ggc-common.c:411 ggc-common.c:479 ggc-common.c:498
-#: ggc-page.c:2138 ggc-page.c:2169 ggc-page.c:2176 ggc-zone.c:2290
-#: ggc-zone.c:2305
+#: ggc-common.c:400 ggc-common.c:408 ggc-common.c:476 ggc-common.c:495
+#: ggc-page.c:2173 ggc-page.c:2204 ggc-page.c:2211 ggc-zone.c:2437
+#: ggc-zone.c:2448 ggc-zone.c:2452
#, gcc-internal-format
msgid "can't write PCH file: %m"
msgstr ""
-#: ggc-common.c:491 config/i386/host-cygwin.c:57
+#: ggc-common.c:488 config/i386/host-cygwin.c:57
#, gcc-internal-format
msgid "can't get position in PCH file: %m"
msgstr ""
-#: ggc-common.c:501
+#: ggc-common.c:498
#, gcc-internal-format
msgid "can't write padding to PCH file: %m"
msgstr ""
-#: ggc-common.c:556 ggc-common.c:564 ggc-common.c:571 ggc-common.c:574
-#: ggc-common.c:584 ggc-common.c:587 ggc-page.c:2266 ggc-zone.c:2324
+#: ggc-common.c:553 ggc-common.c:561 ggc-common.c:568 ggc-common.c:571
+#: ggc-common.c:581 ggc-common.c:584 ggc-page.c:2301 ggc-zone.c:2471
#, gcc-internal-format
msgid "can't read PCH file: %m"
msgstr ""
-#: ggc-common.c:579
+#: ggc-common.c:576
#, gcc-internal-format
msgid "had to relocate PCH"
msgstr ""
-#: ggc-page.c:1471
+#: ggc-page.c:1505
#, gcc-internal-format
msgid "open /dev/zero: %m"
msgstr ""
-#: ggc-page.c:2154 ggc-page.c:2160
+#: ggc-page.c:2189 ggc-page.c:2195
#, gcc-internal-format
msgid "can't write PCH file"
msgstr ""
-#: ggc-zone.c:2287 ggc-zone.c:2298
+#: ggc-zone.c:2434 ggc-zone.c:2445
#, gcc-internal-format
msgid "can't seek PCH file: %m"
msgstr ""
-#: ggc-zone.c:2301
+#: gimple.c:1111
#, gcc-internal-format
-msgid "can't write PCH fle: %m"
+msgid "gimple check: expected %s(%s), have %s(%s) in %s, at %s:%d"
msgstr ""
-#: gimplify.c:4290
+#: gimple.c:1151
+#, gcc-internal-format
+msgid "gimple check: %s, have %s in %s, at %s:%d"
+msgstr ""
+
+#: gimplify.c:4635
#, gcc-internal-format
msgid "invalid lvalue in asm output %d"
msgstr ""
-#: gimplify.c:4402
+#: gimplify.c:4751
#, gcc-internal-format
msgid "non-memory input %d must stay in memory"
msgstr ""
-#: gimplify.c:4415
+#: gimplify.c:4764
#, gcc-internal-format
msgid "memory input %d is not directly addressable"
msgstr ""
-#: gimplify.c:4894
+#: gimplify.c:5258
#, gcc-internal-format
msgid "%qs not specified in enclosing parallel"
msgstr ""
-#: gimplify.c:4896
+#: gimplify.c:5260
#, gcc-internal-format
msgid "%Henclosing parallel"
msgstr ""
-#: gimplify.c:4950
+#: gimplify.c:5351
#, gcc-internal-format
msgid "iteration variable %qs should be private"
msgstr ""
-#: gimplify.c:4964
+#: gimplify.c:5365
#, gcc-internal-format
msgid "iteration variable %qs should not be firstprivate"
msgstr ""
-#: gimplify.c:4967
+#: gimplify.c:5368
#, gcc-internal-format
msgid "iteration variable %qs should not be reduction"
msgstr ""
-#: gimplify.c:5091
+#: gimplify.c:5531
#, gcc-internal-format
msgid "%s variable %qs is private in outer context"
msgstr ""
-#: gimplify.c:6277
+#: gimplify.c:7021
#, gcc-internal-format
msgid "gimplification failed"
msgstr ""
-#: global.c:284 global.c:297 global.c:311
+#: global.c:272 global.c:285 global.c:299 ira.c:1305 ira.c:1318 ira.c:1332
#, gcc-internal-format
msgid "%s cannot be used in asm here"
msgstr ""
-#: graph.c:401 java/jcf-parse.c:1759 java/jcf-parse.c:1899 objc/objc-act.c:500
+#: graph.c:401 java/jcf-parse.c:1724 java/jcf-parse.c:1864 objc/objc-act.c:493
#, gcc-internal-format
msgid "can't open %s: %m"
msgstr ""
-#: haifa-sched.c:184
+#: haifa-sched.c:185
#, gcc-internal-format
msgid "fix_sched_param: unknown param: %s"
msgstr ""
-#: omp-low.c:1289
+#: omp-low.c:1817
+#, gcc-internal-format
+msgid ""
+"barrier region may not be closely nested inside of work-sharing, critical, "
+"ordered, master or explicit task region"
+msgstr ""
+
+#: omp-low.c:1822
#, gcc-internal-format
msgid ""
"work-sharing region may not be closely nested inside of work-sharing, "
-"critical, ordered or master region"
+"critical, ordered, master or explicit task region"
msgstr ""
-#: omp-low.c:1305
+#: omp-low.c:1840
#, gcc-internal-format
-msgid "master region may not be closely nested inside of work-sharing region"
+msgid ""
+"master region may not be closely nested inside of work-sharing or explicit "
+"task region"
msgstr ""
-#: omp-low.c:1319
+#: omp-low.c:1855
#, gcc-internal-format
-msgid "ordered region may not be closely nested inside of critical region"
+msgid ""
+"ordered region may not be closely nested inside of critical or explicit task "
+"region"
msgstr ""
-#: omp-low.c:1325
+#: omp-low.c:1861
#, gcc-internal-format
msgid ""
"ordered region must be closely nested inside a loop region with an ordered "
"clause"
msgstr ""
-#: omp-low.c:1339
+#: omp-low.c:1876
#, gcc-internal-format
msgid ""
"critical region may not be nested inside a critical region with the same name"
msgstr ""
-#: omp-low.c:5132 cp/decl.c:2662 cp/parser.c:7421 cp/parser.c:7441
+#: omp-low.c:6610 cp/decl.c:2654
#, gcc-internal-format
msgid "invalid exit from OpenMP structured block"
msgstr ""
-#: omp-low.c:5134
+#: omp-low.c:6612 omp-low.c:6617
#, gcc-internal-format
msgid "invalid entry to OpenMP structured block"
msgstr ""
-#: opts.c:165
+#. Otherwise, be vague and lazy, but efficient.
+#: omp-low.c:6620
+#, gcc-internal-format
+msgid "invalid branch to/from an OpenMP structured block"
+msgstr ""
+
+#: opts.c:168
#, gcc-internal-format
msgid "argument %qs to %<-femit-struct-debug-detailed%> not recognized"
msgstr ""
-#: opts.c:199
+#: opts.c:202
#, gcc-internal-format
msgid "argument %qs to %<-femit-struct-debug-detailed%> unknown"
msgstr ""
-#: opts.c:205
+#: opts.c:208
#, gcc-internal-format
msgid ""
"%<-femit-struct-debug-detailed=dir:...%> must allow at least as much as %<-"
@@ -23017,114 +23088,127 @@ msgid ""
msgstr ""
#. Eventually this should become a hard error IMO.
-#: opts.c:430
+#: opts.c:444
#, gcc-internal-format
msgid "command line option \"%s\" is valid for %s but not for %s"
msgstr ""
-#: opts.c:484
+#: opts.c:475 opts.c:795
#, gcc-internal-format
-msgid "command line option %qs is not supported by this configuration"
+msgid "unrecognized command line option \"%s\""
msgstr ""
-#: opts.c:537
+#: opts.c:536
#, gcc-internal-format
-msgid "missing argument to \"%s\""
+msgid "command line option %qs is not supported by this configuration"
msgstr ""
-#: opts.c:547
+#: opts.c:589
#, gcc-internal-format
-msgid "argument to \"%s\" should be a non-negative integer"
+msgid "missing argument to \"%s\""
msgstr ""
-#: opts.c:720
+#: opts.c:599
#, gcc-internal-format
-msgid "unrecognized command line option \"%s\""
+msgid "argument to \"%s\" should be a non-negative integer"
msgstr ""
-#: opts.c:939
+#: opts.c:757
#, gcc-internal-format
-msgid "-Wuninitialized is not supported without -O"
+msgid "disallowed call to %qs"
msgstr ""
-#: opts.c:951
+#: opts.c:877
#, gcc-internal-format
-msgid ""
-"-funit-at-a-time is required for inlining of functions that are only called "
-"once"
+msgid "Section anchors must be disabled when toplevel reorder is disabled."
msgstr ""
-#: opts.c:964
+#: opts.c:1097
#, gcc-internal-format
msgid "-freorder-blocks-and-partition does not work with exceptions"
msgstr ""
-#: opts.c:975
+#: opts.c:1108
#, gcc-internal-format
msgid "-freorder-blocks-and-partition does not support unwind info"
msgstr ""
-#: opts.c:989
+#: opts.c:1122
#, gcc-internal-format
msgid "-freorder-blocks-and-partition does not work on this architecture"
msgstr ""
-#: opts.c:1265
+#: opts.c:1130
+#, gcc-internal-format
+msgid "-fira does not work on this architecture"
+msgstr ""
+
+#: opts.c:1428
#, gcc-internal-format
msgid "unrecognized include_flags 0x%x passed to print_specific_help"
msgstr ""
-#: opts.c:1595
+#: opts.c:1804
#, gcc-internal-format
msgid "structure alignment must be a small power of two, not %d"
msgstr ""
-#: opts.c:1658
+#: opts.c:1880
#, gcc-internal-format
msgid "unrecognized visibility value \"%s\""
msgstr ""
-#: opts.c:1706
+#: opts.c:1933
+#, gcc-internal-format
+msgid "unknown stack check parameter \"%s\""
+msgstr ""
+
+#: opts.c:1959
#, gcc-internal-format
msgid "unrecognized register name \"%s\""
msgstr ""
-#: opts.c:1730
+#: opts.c:1983
#, gcc-internal-format
msgid "unknown tls-model \"%s\""
msgstr ""
-#: opts.c:1807
+#: opts.c:1994
+#, gcc-internal-format
+msgid "unknown ira algorithm \"%s\""
+msgstr ""
+
+#: opts.c:2076
#, gcc-internal-format
msgid "%s: --param arguments should be of the form NAME=VALUE"
msgstr ""
-#: opts.c:1812
+#: opts.c:2081
#, gcc-internal-format
msgid "invalid --param value %qs"
msgstr ""
-#: opts.c:1934
+#: opts.c:2199
#, gcc-internal-format
msgid "target system does not support debug output"
msgstr ""
-#: opts.c:1941
+#: opts.c:2206
#, gcc-internal-format
msgid "debug format \"%s\" conflicts with prior selection"
msgstr ""
-#: opts.c:1957
+#: opts.c:2222
#, gcc-internal-format
msgid "unrecognised debug output level \"%s\""
msgstr ""
-#: opts.c:1959
+#: opts.c:2224
#, gcc-internal-format
msgid "debug output level %s is too high"
msgstr ""
-#: opts.c:2041
+#: opts.c:2306
#, gcc-internal-format
msgid "-Werror=%s: No option -%s"
msgstr ""
@@ -23145,29 +23229,39 @@ msgstr ""
msgid "invalid parameter %qs"
msgstr ""
-#: profile.c:304
+#: profile.c:364
+#, gcc-internal-format
+msgid "corrupted profile info: edge from %i to %i exceeds maximal count"
+msgstr ""
+
+#: profile.c:409
#, gcc-internal-format
msgid "corrupted profile info: run_max * runs < sum_max"
msgstr ""
-#: profile.c:310
+#: profile.c:415
#, gcc-internal-format
msgid "corrupted profile info: sum_all is smaller than sum_max"
msgstr ""
-#: profile.c:355
+#: profile.c:582
#, gcc-internal-format
-msgid "corrupted profile info: edge from %i to %i exceeds maximal count"
+msgid "correcting inconsistent profile data"
+msgstr ""
+
+#: profile.c:592
+#, gcc-internal-format
+msgid "corrupted profile info: profile data is not flow-consistent"
msgstr ""
-#: profile.c:519
+#: profile.c:610
#, gcc-internal-format
msgid ""
"corrupted profile info: number of iterations for basic block %d thought to "
"be %i"
msgstr ""
-#: profile.c:540
+#: profile.c:631
#, gcc-internal-format
msgid ""
"corrupted profile info: number of executions for edge %d-%d thought to be %i"
@@ -23198,109 +23292,109 @@ msgstr ""
msgid "output operand %d must use %<&%> constraint"
msgstr ""
-#: regclass.c:875
+#: regclass.c:873
#, gcc-internal-format
msgid "can't use '%s' as a %s register"
msgstr ""
-#: regclass.c:890 config/ia64/ia64.c:5139 config/ia64/ia64.c:5146
-#: config/pa/pa.c:362 config/pa/pa.c:369 config/spu/spu.c:3875
-#: config/spu/spu.c:3882
+#: regclass.c:888 config/ia64/ia64.c:5147 config/ia64/ia64.c:5154
+#: config/pa/pa.c:362 config/pa/pa.c:369 config/sh/sh.c:7996
+#: config/sh/sh.c:8003 config/spu/spu.c:3876 config/spu/spu.c:3883
#, gcc-internal-format
msgid "unknown register name: %s"
msgstr ""
-#: regclass.c:900
+#: regclass.c:898
#, gcc-internal-format
msgid "global register variable follows a function definition"
msgstr ""
-#: regclass.c:904
+#: regclass.c:902
#, gcc-internal-format
msgid "register used for two global register variables"
msgstr ""
-#: regclass.c:909
+#: regclass.c:907
#, gcc-internal-format
msgid "call-clobbered register used for global register variable"
msgstr ""
-#: regrename.c:1893
+#: regrename.c:1892
#, gcc-internal-format
msgid "validate_value_data: [%u] Bad next_regno for empty chain (%u)"
msgstr ""
-#: regrename.c:1905
+#: regrename.c:1904
#, gcc-internal-format
msgid "validate_value_data: Loop in regno chain (%u)"
msgstr ""
-#: regrename.c:1908
+#: regrename.c:1907
#, gcc-internal-format
msgid "validate_value_data: [%u] Bad oldest_regno (%u)"
msgstr ""
-#: regrename.c:1920
+#: regrename.c:1919
#, gcc-internal-format
msgid "validate_value_data: [%u] Non-empty reg in chain (%s %u %i)"
msgstr ""
-#: reload.c:1256
+#: reload.c:1258
#, gcc-internal-format
msgid "cannot reload integer constant operand in %<asm%>"
msgstr ""
-#: reload.c:1270
+#: reload.c:1272
#, gcc-internal-format
msgid "impossible register constraint in %<asm%>"
msgstr ""
-#: reload.c:3574
+#: reload.c:3616
#, gcc-internal-format
msgid "%<&%> constraint used with no register class"
msgstr ""
-#: reload.c:3745 reload.c:3991
+#: reload.c:3787 reload.c:4045
#, gcc-internal-format
msgid "inconsistent operand constraints in an %<asm%>"
msgstr ""
-#: reload1.c:1301
+#: reload1.c:1327
#, gcc-internal-format
msgid "%<asm%> operand has impossible constraints"
msgstr ""
-#: reload1.c:1321
+#: reload1.c:1347
#, gcc-internal-format
msgid "frame size too large for reliable stack checking"
msgstr ""
-#: reload1.c:1324
+#: reload1.c:1350
#, gcc-internal-format
msgid "try reducing the number of local variables"
msgstr ""
-#: reload1.c:1987
+#: reload1.c:2085
#, gcc-internal-format
msgid "can't find a register in class %qs while reloading %<asm%>"
msgstr ""
-#: reload1.c:1992
+#: reload1.c:2090
#, gcc-internal-format
msgid "unable to find a register to spill in class %qs"
msgstr ""
-#: reload1.c:4160
+#: reload1.c:4303
#, gcc-internal-format
msgid "%<asm%> operand requires impossible reload"
msgstr ""
-#: reload1.c:5368
+#: reload1.c:5649
#, gcc-internal-format
msgid "%<asm%> operand constraint incompatible with operand size"
msgstr ""
-#: reload1.c:7039
+#: reload1.c:7598
#, gcc-internal-format
msgid "output operand is constant in %<asm%>"
msgstr ""
@@ -23350,122 +23444,122 @@ msgstr ""
msgid "RTL flag check: %s used with unexpected rtx code '%s' in %s, at %s:%d"
msgstr ""
-#: stmt.c:317
+#: stmt.c:316
#, gcc-internal-format
msgid "output operand constraint lacks %<=%>"
msgstr ""
-#: stmt.c:332
+#: stmt.c:331
#, gcc-internal-format
msgid "output constraint %qc for operand %d is not at the beginning"
msgstr ""
-#: stmt.c:355
+#: stmt.c:354
#, gcc-internal-format
msgid "operand constraint contains incorrectly positioned %<+%> or %<=%>"
msgstr ""
-#: stmt.c:362 stmt.c:461
+#: stmt.c:361 stmt.c:460
#, gcc-internal-format
msgid "%<%%%> constraint used with last operand"
msgstr ""
-#: stmt.c:381
+#: stmt.c:380
#, gcc-internal-format
msgid "matching constraint not valid in output operand"
msgstr ""
-#: stmt.c:452
+#: stmt.c:451
#, gcc-internal-format
msgid "input operand constraint contains %qc"
msgstr ""
-#: stmt.c:494
+#: stmt.c:493
#, gcc-internal-format
msgid "matching constraint references invalid operand number"
msgstr ""
-#: stmt.c:532
+#: stmt.c:531
#, gcc-internal-format
msgid "invalid punctuation %qc in constraint"
msgstr ""
-#: stmt.c:556
+#: stmt.c:555
#, gcc-internal-format
msgid "matching constraint does not allow a register"
msgstr ""
-#: stmt.c:610
+#: stmt.c:609
#, gcc-internal-format
msgid "asm-specifier for variable %qs conflicts with asm clobber list"
msgstr ""
-#: stmt.c:702
+#: stmt.c:699
#, gcc-internal-format
msgid "unknown register name %qs in %<asm%>"
msgstr ""
-#: stmt.c:710
+#: stmt.c:707
#, gcc-internal-format
msgid "PIC register %qs clobbered in %<asm%>"
msgstr ""
-#: stmt.c:757
+#: stmt.c:754
#, gcc-internal-format
msgid "more than %d operands in %<asm%>"
msgstr ""
-#: stmt.c:820
+#: stmt.c:817
#, gcc-internal-format
msgid "output number %d not directly addressable"
msgstr ""
-#: stmt.c:903
+#: stmt.c:900
#, gcc-internal-format
msgid "asm operand %d probably doesn%'t match constraints"
msgstr ""
-#: stmt.c:913
+#: stmt.c:910
#, gcc-internal-format
msgid "use of memory input without lvalue in asm operand %d is deprecated"
msgstr ""
-#: stmt.c:1060
+#: stmt.c:1057
#, gcc-internal-format
msgid "asm clobber conflict with output operand"
msgstr ""
-#: stmt.c:1065
+#: stmt.c:1062
#, gcc-internal-format
msgid "asm clobber conflict with input operand"
msgstr ""
-#: stmt.c:1143
+#: stmt.c:1140
#, gcc-internal-format
msgid "too many alternatives in %<asm%>"
msgstr ""
-#: stmt.c:1155
+#: stmt.c:1152
#, gcc-internal-format
msgid "operand constraints for %<asm%> differ in number of alternatives"
msgstr ""
-#: stmt.c:1208
+#: stmt.c:1205
#, gcc-internal-format
msgid "duplicate asm operand name %qs"
msgstr ""
-#: stmt.c:1306
+#: stmt.c:1303
#, gcc-internal-format
msgid "missing close brace for named operand"
msgstr ""
-#: stmt.c:1334
+#: stmt.c:1331
#, gcc-internal-format
msgid "undefined named operand %qs"
msgstr ""
-#: stmt.c:1482
+#: stmt.c:1475
#, gcc-internal-format
msgid "%Hvalue computed is not used"
msgstr ""
@@ -23537,751 +23631,744 @@ msgstr ""
msgid "alignment of array elements is greater than element size"
msgstr ""
-#: targhooks.c:120
+#: targhooks.c:116
#, gcc-internal-format
msgid "__builtin_saveregs not supported by this target"
msgstr ""
-#: tlink.c:483
+#: tlink.c:482
#, gcc-internal-format
msgid "repository file '%s' does not contain command-line arguments"
msgstr ""
-#: tlink.c:728
+#: tlink.c:730
#, gcc-internal-format
msgid ""
"'%s' was assigned to '%s', but was not defined during recompilation, or vice "
"versa"
msgstr ""
-#: tlink.c:798
+#: tlink.c:800
#, gcc-internal-format
msgid "ld returned %d exit status"
msgstr ""
-#: toplev.c:528
+#: toplev.c:517
#, gcc-internal-format
msgid "invalid option argument %qs"
msgstr ""
-#: toplev.c:626
+#: toplev.c:615
#, gcc-internal-format
msgid "getting core file size maximum limit: %m"
msgstr ""
-#: toplev.c:629
+#: toplev.c:618
#, gcc-internal-format
msgid "setting core file size limit to maximum: %m"
msgstr ""
-#: toplev.c:849
+#: toplev.c:838
#, gcc-internal-format
msgid "%q+F declared %<static%> but never defined"
msgstr ""
-#: toplev.c:877
+#: toplev.c:866
#, gcc-internal-format
msgid "%q+D defined but not used"
msgstr ""
-#: toplev.c:920
+#: toplev.c:909
#, gcc-internal-format
msgid "%qD is deprecated (declared at %s:%d)"
msgstr ""
-#: toplev.c:943
+#: toplev.c:932
#, gcc-internal-format
msgid "%qs is deprecated (declared at %s:%d)"
msgstr ""
-#: toplev.c:947
+#: toplev.c:936
#, gcc-internal-format
msgid "type is deprecated (declared at %s:%d)"
msgstr ""
-#: toplev.c:953
+#: toplev.c:942
#, gcc-internal-format
msgid "%qs is deprecated"
msgstr ""
-#: toplev.c:955
+#: toplev.c:944
#, gcc-internal-format
msgid "type is deprecated"
msgstr ""
-#: toplev.c:975 toplev.c:1002
-#, gcc-internal-format
-msgid "GCC supports only %d input file changes"
-msgstr ""
-
-#: toplev.c:1160
+#: toplev.c:1088
#, gcc-internal-format
msgid "unrecognized gcc debugging option: %c"
msgstr ""
-#: toplev.c:1411
+#: toplev.c:1341
#, gcc-internal-format
msgid "can%'t open %s for writing: %m"
msgstr ""
-#: toplev.c:1432
+#: toplev.c:1362
#, gcc-internal-format
msgid "-frecord-gcc-switches is not supported by the current target"
msgstr ""
-#: toplev.c:1745
+#: toplev.c:1686
#, gcc-internal-format
msgid "this target does not support %qs"
msgstr ""
-#: toplev.c:1794
+#: toplev.c:1732
#, gcc-internal-format
msgid "instruction scheduling not supported on this target machine"
msgstr ""
-#: toplev.c:1798
+#: toplev.c:1736
#, gcc-internal-format
msgid "this target machine does not have delayed branches"
msgstr ""
-#: toplev.c:1812
+#: toplev.c:1750
#, gcc-internal-format
msgid "-f%sleading-underscore not supported on this target machine"
msgstr ""
-#: toplev.c:1885
+#: toplev.c:1823
#, gcc-internal-format
msgid "target system does not support the \"%s\" debug format"
msgstr ""
-#: toplev.c:1898
+#: toplev.c:1836
#, gcc-internal-format
msgid "variable tracking requested, but useless unless producing debug info"
msgstr ""
-#: toplev.c:1901
+#: toplev.c:1839
#, gcc-internal-format
msgid "variable tracking requested, but not supported by this debug format"
msgstr ""
-#: toplev.c:1935
+#: toplev.c:1873
#, gcc-internal-format
msgid "can%'t open %s: %m"
msgstr ""
-#: toplev.c:1942
+#: toplev.c:1880
#, gcc-internal-format
msgid "-ffunction-sections not supported for this target"
msgstr ""
-#: toplev.c:1947
+#: toplev.c:1885
#, gcc-internal-format
msgid "-fdata-sections not supported for this target"
msgstr ""
-#: toplev.c:1954
+#: toplev.c:1892
#, gcc-internal-format
msgid "-ffunction-sections disabled; it makes profiling impossible"
msgstr ""
-#: toplev.c:1961
+#: toplev.c:1899
#, gcc-internal-format
msgid "-fprefetch-loop-arrays not supported for this target"
msgstr ""
-#: toplev.c:1967
+#: toplev.c:1905
#, gcc-internal-format
msgid ""
"-fprefetch-loop-arrays not supported for this target (try -march switches)"
msgstr ""
-#: toplev.c:1976
+#: toplev.c:1914
#, gcc-internal-format
msgid "-fprefetch-loop-arrays is not supported with -Os"
msgstr ""
-#: toplev.c:1983
-#, gcc-internal-format
-msgid "-ffunction-sections may affect debugging on some targets"
-msgstr ""
-
-#: toplev.c:1994
+#: toplev.c:1925
#, gcc-internal-format
msgid "-fassociative-math disabled; other options take precedence"
msgstr ""
-#: toplev.c:2006
+#: toplev.c:1941
#, gcc-internal-format
msgid "-fstack-protector not supported for this target"
msgstr ""
-#: toplev.c:2019
+#: toplev.c:1954
#, gcc-internal-format
msgid "unwind tables currently require a frame pointer for correctness"
msgstr ""
-#: toplev.c:2205
+#: toplev.c:2138
#, gcc-internal-format
msgid "error writing to %s: %m"
msgstr ""
-#: toplev.c:2207 java/jcf-parse.c:1778
+#: toplev.c:2140 java/jcf-parse.c:1743
#, gcc-internal-format
msgid "error closing %s: %m"
msgstr ""
-#: tree-cfg.c:1451 tree-cfg.c:2087 tree-cfg.c:2090
+#: tree-cfg.c:1497 tree-cfg.c:2151
#, gcc-internal-format
msgid "%Hwill never be executed"
msgstr ""
-#: tree-cfg.c:3153
+#: tree-cfg.c:2785
#, gcc-internal-format
msgid "SSA name in freelist but still referenced"
msgstr ""
-#: tree-cfg.c:3162
+#: tree-cfg.c:2794
#, gcc-internal-format
msgid "ASSERT_EXPR with an always-false condition"
msgstr ""
-#: tree-cfg.c:3175
+#: tree-cfg.c:2804
#, gcc-internal-format
msgid "GIMPLE register modified with BIT_FIELD_REF"
msgstr ""
-#: tree-cfg.c:3210
-#, gcc-internal-format
-msgid "invariant not recomputed when ADDR_EXPR changed"
-msgstr ""
-
-#: tree-cfg.c:3216
+#: tree-cfg.c:2827
#, gcc-internal-format
msgid "constant not recomputed when ADDR_EXPR changed"
msgstr ""
-#: tree-cfg.c:3221
+#: tree-cfg.c:2832
#, gcc-internal-format
msgid "side effects not recomputed when ADDR_EXPR changed"
msgstr ""
-#: tree-cfg.c:3237
+#: tree-cfg.c:2848
#, gcc-internal-format
msgid "address taken, but ADDRESSABLE bit not set"
msgstr ""
-#: tree-cfg.c:3252
+#: tree-cfg.c:2859
#, gcc-internal-format
msgid "non-integral used in condition"
msgstr ""
-#: tree-cfg.c:3257
+#: tree-cfg.c:2864
#, gcc-internal-format
msgid "invalid conditional operand"
msgstr ""
-#: tree-cfg.c:3309
+#: tree-cfg.c:2911
#, gcc-internal-format
-msgid "invalid reference prefix"
-msgstr ""
-
-#: tree-cfg.c:3320
-#, gcc-internal-format
-msgid "invalid operand to plus/minus, type is a pointer"
+msgid "invalid position or size operand to BIT_FIELD_REF"
msgstr ""
-#: tree-cfg.c:3331
+#: tree-cfg.c:2918
#, gcc-internal-format
-msgid "invalid operand to pointer plus, first operand is not a pointer"
+msgid ""
+"integral result type precision does not match field size of BIT_FIELD_REF"
msgstr ""
-#: tree-cfg.c:3339
+#: tree-cfg.c:2926
#, gcc-internal-format
msgid ""
-"invalid operand to pointer plus, second operand is not an integer with type "
-"of sizetype."
+"mode precision of non-integral result does not match field size of "
+"BIT_FIELD_REF"
msgstr ""
-#: tree-cfg.c:3406 tree-cfg.c:3822
+#: tree-cfg.c:2937
#, gcc-internal-format
-msgid "invalid operand in unary expression"
+msgid "invalid reference prefix"
msgstr ""
-#: tree-cfg.c:3416
+#: tree-cfg.c:2948
#, gcc-internal-format
-msgid "type mismatch in unary expression"
+msgid "invalid operand to plus/minus, type is a pointer"
msgstr ""
-#: tree-cfg.c:3437
+#: tree-cfg.c:2959
#, gcc-internal-format
-msgid "invalid operands in binary expression"
+msgid "invalid operand to pointer plus, first operand is not a pointer"
msgstr ""
-#: tree-cfg.c:3448
+#: tree-cfg.c:2967
#, gcc-internal-format
-msgid "type mismatch in binary expression"
+msgid ""
+"invalid operand to pointer plus, second operand is not an integer with type "
+"of sizetype."
msgstr ""
-#: tree-cfg.c:3473
+#: tree-cfg.c:3039
#, gcc-internal-format
msgid "invalid expression for min lvalue"
msgstr ""
-#: tree-cfg.c:3480
+#: tree-cfg.c:3046
#, gcc-internal-format
msgid "invalid operand in indirect reference"
msgstr ""
-#: tree-cfg.c:3487
+#: tree-cfg.c:3053
#, gcc-internal-format
msgid "type mismatch in indirect reference"
msgstr ""
-#: tree-cfg.c:3515
+#: tree-cfg.c:3081
#, gcc-internal-format
msgid "invalid operands to array reference"
msgstr ""
-#: tree-cfg.c:3526
+#: tree-cfg.c:3092
#, gcc-internal-format
msgid "type mismatch in array reference"
msgstr ""
-#: tree-cfg.c:3535
+#: tree-cfg.c:3101
#, gcc-internal-format
msgid "type mismatch in array range reference"
msgstr ""
-#: tree-cfg.c:3546
+#: tree-cfg.c:3112
#, gcc-internal-format
msgid "type mismatch in real/imagpart reference"
msgstr ""
-#: tree-cfg.c:3556
+#: tree-cfg.c:3122
#, gcc-internal-format
msgid "type mismatch in component reference"
msgstr ""
-#: tree-cfg.c:3610
+#: tree-cfg.c:3176
+#, gcc-internal-format
+msgid "Invalid GIMPLE operand"
+msgstr ""
+
+#: tree-cfg.c:3257 tree-cfg.c:3295
#, gcc-internal-format
msgid "invalid operand in conversion"
msgstr ""
-#: tree-cfg.c:3638
+#: tree-cfg.c:3282
#, gcc-internal-format
msgid "invalid types in nop conversion"
msgstr ""
-#: tree-cfg.c:3652
+#: tree-cfg.c:3302
+#, gcc-internal-format
+msgid "invalid types in fixed-point conversion"
+msgstr ""
+
+#: tree-cfg.c:3315
#, gcc-internal-format
msgid "invalid operand in int to float conversion"
msgstr ""
-#: tree-cfg.c:3658
+#: tree-cfg.c:3321
#, gcc-internal-format
msgid "invalid types in conversion to floating point"
msgstr ""
-#: tree-cfg.c:3671
+#: tree-cfg.c:3334
#, gcc-internal-format
msgid "invalid operand in float to int conversion"
msgstr ""
-#: tree-cfg.c:3677
+#: tree-cfg.c:3340
#, gcc-internal-format
msgid "invalid types in conversion to integer"
msgstr ""
-#: tree-cfg.c:3691
+#: tree-cfg.c:3353
#, gcc-internal-format
msgid "invalid operands in complex expression"
msgstr ""
-#: tree-cfg.c:3704
+#: tree-cfg.c:3363
#, gcc-internal-format
msgid "type mismatch in complex expression"
msgstr ""
-#: tree-cfg.c:3718
-#, gcc-internal-format
-msgid "constructor not allowed for non-vector types"
-msgstr ""
-
-#: tree-cfg.c:3735
+#: tree-cfg.c:3388
#, gcc-internal-format
msgid "invalid operands in shift expression"
msgstr ""
-#: tree-cfg.c:3741
+#: tree-cfg.c:3395
#, gcc-internal-format
msgid "type mismatch in shift expression"
msgstr ""
-#: tree-cfg.c:3759
+#: tree-cfg.c:3412
#, gcc-internal-format
msgid "invalid (pointer) operands to plus/minus"
msgstr ""
-#: tree-cfg.c:3772
+#: tree-cfg.c:3424
#, gcc-internal-format
msgid "invalid operands in pointer plus expression"
msgstr ""
-#: tree-cfg.c:3779
+#: tree-cfg.c:3431
#, gcc-internal-format
msgid "type mismatch in pointer plus expression"
msgstr ""
-#: tree-cfg.c:3798
+#: tree-cfg.c:3446
#, gcc-internal-format
-msgid "invalid operands in conditional expression"
+msgid "invalid operand in unary expression"
msgstr ""
-#: tree-cfg.c:3831
+#: tree-cfg.c:3456
#, gcc-internal-format
msgid "type mismatch in address expression"
msgstr ""
-#: tree-cfg.c:3851
+#: tree-cfg.c:3475
#, gcc-internal-format
msgid "invalid operands in truth expression"
msgstr ""
-#: tree-cfg.c:3860
+#: tree-cfg.c:3484
#, gcc-internal-format
msgid "type mismatch in binary truth expression"
msgstr ""
-#: tree-cfg.c:3876
+#: tree-cfg.c:3498
#, gcc-internal-format
msgid "invalid operand in unary not"
msgstr ""
-#: tree-cfg.c:3885
+#: tree-cfg.c:3507
#, gcc-internal-format
msgid "type mismatch in not expression"
msgstr ""
-#: tree-cfg.c:3924
+#: tree-cfg.c:3533
#, gcc-internal-format
-msgid "invalid operands in comparison expression"
+msgid "tree node that should already be gimple."
msgstr ""
-#: tree-cfg.c:3941
+#: tree-cfg.c:3551 tree-cfg.c:3563
#, gcc-internal-format
-msgid "type mismatch in comparison expression"
+msgid "non-trivial conversion at assignment"
msgstr ""
-#: tree-cfg.c:3971
+#: tree-cfg.c:3574
#, gcc-internal-format
-msgid "non-trivial conversion at assignment"
+msgid "invalid operands in comparison expression"
msgstr ""
-#: tree-cfg.c:4012 tree-cfg.c:4160
+#: tree-cfg.c:3592
#, gcc-internal-format
-msgid "is not a valid GIMPLE statement"
+msgid "type mismatch in comparison expression"
msgstr ""
-#: tree-cfg.c:4039
+#: tree-cfg.c:3631
#, gcc-internal-format
msgid "invalid operand to switch statement"
msgstr ""
-#: tree-cfg.c:4050
+#: tree-cfg.c:3790
#, gcc-internal-format
-msgid "type error in return expression"
+msgid "verify_gimple failed"
msgstr ""
-#: tree-cfg.c:4128
+#: tree-cfg.c:3824
#, gcc-internal-format
-msgid "verify_gimple failed"
+msgid "invalid function in call statement"
msgstr ""
-#: tree-cfg.c:4180
+#: tree-cfg.c:3835
#, gcc-internal-format
-msgid "statement marked for throw, but doesn%'t"
+msgid "invalid pure const state for function"
msgstr ""
-#: tree-cfg.c:4185
+#: tree-cfg.c:3845 tree-ssa.c:832 tree-ssa.c:842
#, gcc-internal-format
-msgid "statement marked for throw in middle of block"
+msgid "in statement"
+msgstr ""
+
+#: tree-cfg.c:3859
+#, gcc-internal-format
+msgid "statement marked for throw, but doesn%'t"
msgstr ""
-#: tree-cfg.c:4256
+#: tree-cfg.c:3864
#, gcc-internal-format
-msgid "unexpected non-tuple"
+msgid "statement marked for throw in middle of block"
msgstr ""
-#: tree-cfg.c:4285
+#: tree-cfg.c:3936
#, gcc-internal-format
msgid "Dead STMT in EH table"
msgstr ""
-#: tree-cfg.c:4319
+#: tree-cfg.c:3974
#, gcc-internal-format
-msgid "bb_for_stmt (phi) is set to a wrong basic block"
+msgid "gimple_bb (phi) is set to a wrong basic block"
msgstr ""
-#: tree-cfg.c:4330
+#: tree-cfg.c:3985
#, gcc-internal-format
msgid "missing PHI def"
msgstr ""
-#: tree-cfg.c:4341
+#: tree-cfg.c:3996
#, gcc-internal-format
-msgid "PHI def is not a GIMPLE value"
+msgid "PHI argument is not a GIMPLE value"
msgstr ""
-#: tree-cfg.c:4357 tree-cfg.c:4383
+#: tree-cfg.c:4005 tree-cfg.c:4050
#, gcc-internal-format
msgid "incorrect sharing of tree nodes"
msgstr ""
-#: tree-cfg.c:4374
+#: tree-cfg.c:4020
#, gcc-internal-format
-msgid "bb_for_stmt (stmt) is set to a wrong basic block"
+msgid "invalid GIMPLE statement"
msgstr ""
-#: tree-cfg.c:4397
+#: tree-cfg.c:4029
+#, gcc-internal-format
+msgid "gimple_bb (stmt) is set to a wrong basic block"
+msgstr ""
+
+#: tree-cfg.c:4041
+#, gcc-internal-format
+msgid "incorrect entry in label_to_block_map.\n"
+msgstr ""
+
+#: tree-cfg.c:4066
#, gcc-internal-format
msgid "verify_stmts failed"
msgstr ""
-#: tree-cfg.c:4420
+#: tree-cfg.c:4089
#, gcc-internal-format
msgid "ENTRY_BLOCK has IL associated with it"
msgstr ""
-#: tree-cfg.c:4426
+#: tree-cfg.c:4095
#, gcc-internal-format
msgid "EXIT_BLOCK has IL associated with it"
msgstr ""
-#: tree-cfg.c:4433
+#: tree-cfg.c:4102
#, gcc-internal-format
msgid "fallthru to exit from bb %d"
msgstr ""
-#: tree-cfg.c:4455
+#: tree-cfg.c:4126
#, gcc-internal-format
msgid "nonlocal label "
msgstr ""
-#: tree-cfg.c:4464 tree-cfg.c:4474 tree-cfg.c:4499
+#: tree-cfg.c:4135 tree-cfg.c:4144 tree-cfg.c:4169
#, gcc-internal-format
msgid "label "
msgstr ""
-#: tree-cfg.c:4489
+#: tree-cfg.c:4159
#, gcc-internal-format
msgid "control flow in the middle of basic block %d"
msgstr ""
-#: tree-cfg.c:4519
+#: tree-cfg.c:4189
#, gcc-internal-format
msgid "fallthru edge after a control statement in bb %d"
msgstr ""
-#: tree-cfg.c:4532
+#: tree-cfg.c:4202
#, gcc-internal-format
-msgid "true/false edge after a non-COND_EXPR in bb %d"
+msgid "true/false edge after a non-GIMPLE_COND in bb %d"
msgstr ""
-#: tree-cfg.c:4548
-#, gcc-internal-format
-msgid "COND_EXPR with code in branches at the end of bb %d"
-msgstr ""
-
-#: tree-cfg.c:4562 tree-cfg.c:4584 tree-cfg.c:4597 tree-cfg.c:4668
+#: tree-cfg.c:4225 tree-cfg.c:4247 tree-cfg.c:4260 tree-cfg.c:4329
#, gcc-internal-format
msgid "wrong outgoing edge flags at end of bb %d"
msgstr ""
-#: tree-cfg.c:4572
+#: tree-cfg.c:4235
#, gcc-internal-format
msgid "explicit goto at end of bb %d"
msgstr ""
-#: tree-cfg.c:4602
+#: tree-cfg.c:4265
#, gcc-internal-format
msgid "return edge does not point to exit in bb %d"
msgstr ""
-#: tree-cfg.c:4635
+#: tree-cfg.c:4295
#, gcc-internal-format
-msgid "found default case not at end of case vector"
+msgid "found default case not at the start of case vector"
msgstr ""
-#: tree-cfg.c:4641
+#: tree-cfg.c:4303
#, gcc-internal-format
msgid "case labels not sorted: "
msgstr ""
-#: tree-cfg.c:4652
-#, gcc-internal-format
-msgid "no default case found at end of case vector"
-msgstr ""
-
-#: tree-cfg.c:4660
+#: tree-cfg.c:4320
#, gcc-internal-format
msgid "extra outgoing edge %d->%d"
msgstr ""
-#: tree-cfg.c:4682
+#: tree-cfg.c:4343
#, gcc-internal-format
msgid "missing edge %i->%i"
msgstr ""
-#: tree-cfg.c:7025 tree-cfg.c:7029
+#: tree-cfg.c:6796
#, gcc-internal-format
msgid "%H%<noreturn%> function does return"
msgstr ""
-#: tree-cfg.c:7051 tree-cfg.c:7056
+#: tree-cfg.c:6816
#, gcc-internal-format
-msgid "%Hcontrol reaches end of non-void function"
+msgid "control reaches end of non-void function"
msgstr ""
-#: tree-cfg.c:7117
+#: tree-cfg.c:6878
#, gcc-internal-format
msgid "%Jfunction might be possible candidate for attribute %<noreturn%>"
msgstr ""
-#: tree-dump.c:933
+#: tree-dump.c:927
#, gcc-internal-format
msgid "could not open dump file %qs: %s"
msgstr ""
-#: tree-dump.c:1068
+#: tree-dump.c:1060
#, gcc-internal-format
msgid "ignoring unknown option %q.*s in %<-fdump-%s%>"
msgstr ""
-#: tree-eh.c:1805
+#: tree-eh.c:1993
#, gcc-internal-format
msgid "EH edge %i->%i is missing"
msgstr ""
-#: tree-eh.c:1810
+#: tree-eh.c:1998
#, gcc-internal-format
msgid "EH edge %i->%i miss EH flag"
msgstr ""
#. ??? might not be mistake.
-#: tree-eh.c:1816
+#: tree-eh.c:2004
#, gcc-internal-format
msgid "EH edge %i->%i has duplicated regions"
msgstr ""
-#: tree-eh.c:1850
+#: tree-eh.c:2039
#, gcc-internal-format
msgid "BB %i can not throw but has EH edges"
msgstr ""
-#: tree-eh.c:1857
+#: tree-eh.c:2046
#, gcc-internal-format
msgid "BB %i last statement has incorrectly set region"
msgstr ""
-#: tree-eh.c:1868
+#: tree-eh.c:2057
#, gcc-internal-format
msgid "unnecessary EH edge %i->%i"
msgstr ""
-#: tree-inline.c:1880
+#: tree-inline.c:2314
+#, gcc-internal-format
+msgid ""
+"function %q+F can never be inlined because it uses variable sized variables"
+msgstr ""
+
+#: tree-inline.c:2348
#, gcc-internal-format
msgid ""
"function %q+F can never be inlined because it uses alloca (override using "
"the always_inline attribute)"
msgstr ""
-#: tree-inline.c:1892
+#: tree-inline.c:2362
#, gcc-internal-format
msgid "function %q+F can never be inlined because it uses setjmp"
msgstr ""
-#: tree-inline.c:1906
+#: tree-inline.c:2376
#, gcc-internal-format
msgid ""
"function %q+F can never be inlined because it uses variable argument lists"
msgstr ""
-#: tree-inline.c:1917
+#: tree-inline.c:2388
#, gcc-internal-format
msgid ""
"function %q+F can never be inlined because it uses setjmp-longjmp exception "
"handling"
msgstr ""
-#: tree-inline.c:1924
+#: tree-inline.c:2396
#, gcc-internal-format
msgid "function %q+F can never be inlined because it uses non-local goto"
msgstr ""
-#: tree-inline.c:1935
+#: tree-inline.c:2408
#, gcc-internal-format
msgid ""
"function %q+F can never be inlined because it uses __builtin_return or "
"__builtin_apply_args"
msgstr ""
-#: tree-inline.c:1954
+#: tree-inline.c:2428
#, gcc-internal-format
msgid "function %q+F can never be inlined because it contains a computed goto"
msgstr ""
-#: tree-inline.c:1968
+#: tree-inline.c:2443
#, gcc-internal-format
msgid "function %q+F can never be inlined because it receives a non-local goto"
msgstr ""
-#: tree-inline.c:1993
-#, gcc-internal-format
-msgid ""
-"function %q+F can never be inlined because it uses variable sized variables"
-msgstr ""
-
-#: tree-inline.c:2015
+#: tree-inline.c:2469
#, gcc-internal-format
msgid ""
"function %q+F can never be inlined because it saves address of local label "
"in a static variable"
msgstr ""
-#: tree-inline.c:2091
+#: tree-inline.c:2559
#, gcc-internal-format
msgid ""
"function %q+F can never be inlined because it is suppressed using -fno-inline"
msgstr ""
-#: tree-inline.c:2105
+#: tree-inline.c:2573
#, gcc-internal-format
msgid ""
"function %q+F can never be inlined because it uses attributes conflicting "
"with inlining"
msgstr ""
-#: tree-inline.c:2674 tree-inline.c:2684
+#: tree-inline.c:3133 tree-inline.c:3143
#, gcc-internal-format
msgid "inlining failed in call to %q+F: %s"
msgstr ""
-#: tree-inline.c:2675 tree-inline.c:2686
+#: tree-inline.c:3134 tree-inline.c:3145
#, gcc-internal-format
msgid "called from here"
msgstr ""
-#: tree-mudflap.c:864
+#: tree-mudflap.c:852
#, gcc-internal-format
msgid "mudflap checking not yet implemented for ARRAY_RANGE_REF"
msgstr ""
-#: tree-mudflap.c:1050
+#: tree-mudflap.c:1043
#, gcc-internal-format
msgid "mudflap cannot track %qs in stub function"
msgstr ""
-#: tree-mudflap.c:1279
+#: tree-mudflap.c:1287
#, gcc-internal-format
msgid "mudflap cannot track unknown size extern %qs"
msgstr ""
@@ -24291,48 +24378,48 @@ msgstr ""
msgid "mudflap: this language is not supported"
msgstr ""
-#: tree-optimize.c:430
+#: tree-optimize.c:443
#, gcc-internal-format
msgid "size of return value of %q+D is %u bytes"
msgstr ""
-#: tree-optimize.c:433
+#: tree-optimize.c:446
#, gcc-internal-format
msgid "size of return value of %q+D is larger than %wd bytes"
msgstr ""
-#: tree-outof-ssa.c:638 tree-outof-ssa.c:689 tree-ssa-coalesce.c:936
-#: tree-ssa-coalesce.c:951 tree-ssa-coalesce.c:1163 tree-ssa-live.c:1053
+#: tree-outof-ssa.c:638 tree-outof-ssa.c:691 tree-ssa-coalesce.c:939
+#: tree-ssa-coalesce.c:954 tree-ssa-coalesce.c:1176 tree-ssa-live.c:1075
#, gcc-internal-format
msgid "SSA corruption"
msgstr ""
-#: tree-outof-ssa.c:1263
+#: tree-outof-ssa.c:1261
#, gcc-internal-format
msgid " Pending stmts not issued on PRED edge (%d, %d)\n"
msgstr ""
-#: tree-outof-ssa.c:1269
+#: tree-outof-ssa.c:1267
#, gcc-internal-format
msgid " Pending stmts not issued on SUCC edge (%d, %d)\n"
msgstr ""
-#: tree-outof-ssa.c:1276
+#: tree-outof-ssa.c:1274
#, gcc-internal-format
msgid " Pending stmts not issued on ENTRY edge (%d, %d)\n"
msgstr ""
-#: tree-outof-ssa.c:1282
+#: tree-outof-ssa.c:1280
#, gcc-internal-format
msgid " Pending stmts not issued on EXIT edge (%d, %d)\n"
msgstr ""
-#: tree-profile.c:356
+#: tree-profile.c:368
#, gcc-internal-format
msgid "unimplemented functionality"
msgstr ""
-#: tree-ssa-alias-warnings.c:814
+#: tree-ssa-alias-warnings.c:843
#, gcc-internal-format
msgid ""
"%Hlikely type-punning may break strict-aliasing rules: object %<%s%s%> of "
@@ -24340,531 +24427,536 @@ msgid ""
"<%s%s%> of main type %qT which is referenced at or around %s:%d."
msgstr ""
-#: tree-ssa.c:110
+#: tree-ssa-alias-warnings.c:969
+#, gcc-internal-format
+msgid "dereferencing type-punned pointer %D will break strict-aliasing rules"
+msgstr ""
+
+#: tree-ssa.c:239
#, gcc-internal-format
msgid "expected an SSA_NAME object"
msgstr ""
-#: tree-ssa.c:116
+#: tree-ssa.c:245
#, gcc-internal-format
msgid "type mismatch between an SSA_NAME and its symbol"
msgstr ""
-#: tree-ssa.c:122
+#: tree-ssa.c:251
#, gcc-internal-format
msgid "found an SSA_NAME that had been released into the free pool"
msgstr ""
-#: tree-ssa.c:128
+#: tree-ssa.c:257
#, gcc-internal-format
msgid "found a virtual definition for a GIMPLE register"
msgstr ""
-#: tree-ssa.c:134
+#: tree-ssa.c:263
#, gcc-internal-format
msgid "found a real definition for a non-register"
msgstr ""
-#: tree-ssa.c:141
-#, gcc-internal-format
-msgid "found real variable when subvariables should have appeared"
-msgstr ""
-
-#: tree-ssa.c:148
+#: tree-ssa.c:270
#, gcc-internal-format
msgid "found a default name with a non-empty defining statement"
msgstr ""
-#: tree-ssa.c:176
+#: tree-ssa.c:298
#, gcc-internal-format
msgid "SSA_NAME created in two different blocks %i and %i"
msgstr ""
-#: tree-ssa.c:185
+#: tree-ssa.c:307
#, gcc-internal-format
msgid "SSA_NAME_DEF_STMT is wrong"
msgstr ""
-#: tree-ssa.c:237
+#: tree-ssa.c:359
#, gcc-internal-format
msgid "missing definition"
msgstr ""
-#: tree-ssa.c:243
+#: tree-ssa.c:365
#, gcc-internal-format
msgid "definition in block %i does not dominate use in block %i"
msgstr ""
-#: tree-ssa.c:251
+#: tree-ssa.c:373
#, gcc-internal-format
msgid "definition in block %i follows the use"
msgstr ""
-#: tree-ssa.c:258
+#: tree-ssa.c:380
#, gcc-internal-format
msgid "SSA_NAME_OCCURS_IN_ABNORMAL_PHI should be set"
msgstr ""
-#: tree-ssa.c:266
+#: tree-ssa.c:388
#, gcc-internal-format
msgid "no immediate_use list"
msgstr ""
-#: tree-ssa.c:278
+#: tree-ssa.c:400
#, gcc-internal-format
msgid "wrong immediate use list"
msgstr ""
-#: tree-ssa.c:312
+#: tree-ssa.c:434
#, gcc-internal-format
msgid "incoming edge count does not match number of PHI arguments"
msgstr ""
-#: tree-ssa.c:326
+#: tree-ssa.c:448
#, gcc-internal-format
msgid "PHI argument is missing for edge %d->%d"
msgstr ""
-#: tree-ssa.c:335
+#: tree-ssa.c:457
#, gcc-internal-format
msgid "PHI argument is not SSA_NAME, or invariant"
msgstr ""
-#: tree-ssa.c:348
+#: tree-ssa.c:470
#, gcc-internal-format
msgid "wrong edge %d->%d for PHI argument"
msgstr ""
-#: tree-ssa.c:398
+#: tree-ssa.c:520
#, gcc-internal-format
msgid "non-addressable variable inside an alias set"
msgstr ""
-#: tree-ssa.c:409
+#: tree-ssa.c:531
#, gcc-internal-format
msgid "verify_flow_insensitive_alias_info failed"
msgstr ""
-#: tree-ssa.c:451
+#: tree-ssa.c:573
#, gcc-internal-format
msgid "dereferenced pointers should have a name or a symbol tag"
msgstr ""
-#: tree-ssa.c:458
+#: tree-ssa.c:580
#, gcc-internal-format
msgid "pointers with a memory tag, should have points-to sets"
msgstr ""
-#: tree-ssa.c:470
+#: tree-ssa.c:594
#, gcc-internal-format
msgid "pointer escapes but its name tag is not call-clobbered"
msgstr ""
-#: tree-ssa.c:480
+#: tree-ssa.c:604
#, gcc-internal-format
msgid "verify_flow_sensitive_alias_info failed"
msgstr ""
-#: tree-ssa.c:508
+#: tree-ssa.c:632
#, gcc-internal-format
msgid "variable in call_clobbered_vars but not marked call_clobbered"
msgstr ""
-#: tree-ssa.c:527
+#: tree-ssa.c:651
#, gcc-internal-format
msgid "variable marked call_clobbered but not in call_clobbered_vars bitmap."
msgstr ""
-#: tree-ssa.c:537
+#: tree-ssa.c:661
#, gcc-internal-format
msgid "verify_call_clobbering failed"
msgstr ""
-#: tree-ssa.c:558
+#: tree-ssa.c:682
#, gcc-internal-format
msgid "Memory partitions should have at least one symbol"
msgstr ""
-#: tree-ssa.c:568
+#: tree-ssa.c:692
#, gcc-internal-format
msgid "Partitioned symbols should belong to exactly one partition"
msgstr ""
-#: tree-ssa.c:581
+#: tree-ssa.c:705
#, gcc-internal-format
msgid "verify_memory_partitions failed"
msgstr ""
-#: tree-ssa.c:653
+#: tree-ssa.c:777
#, gcc-internal-format
msgid "AUX pointer initialized for edge %d->%d"
msgstr ""
-#: tree-ssa.c:677
+#: tree-ssa.c:802
#, gcc-internal-format
msgid "stmt (%p) marked modified after optimization pass: "
msgstr ""
-#: tree-ssa.c:697
+#: tree-ssa.c:822
#, gcc-internal-format
msgid "statement makes a memory store, but has no VDEFS"
msgstr ""
-#: tree-ssa.c:707 tree-ssa.c:717
-#, gcc-internal-format
-msgid "in statement"
-msgstr ""
-
-#: tree-ssa.c:756
+#: tree-ssa.c:881
#, gcc-internal-format
msgid "verify_ssa failed"
msgstr ""
-#: tree-ssa.c:1293
+#: tree-ssa.c:1430
#, gcc-internal-format
msgid "%J%qD was declared here"
msgstr ""
-#. We only do data flow with SSA_NAMEs, so that's all we
-#. can warn about.
-#: tree-ssa.c:1311
+#: tree-ssa.c:1494
#, gcc-internal-format
-msgid "%H%qD is used uninitialized in this function"
+msgid "%qD is used uninitialized in this function"
msgstr ""
-#: tree-ssa.c:1349
+#: tree-ssa.c:1497 tree-ssa.c:1536
#, gcc-internal-format
-msgid "%H%qD may be used uninitialized in this function"
+msgid "%qD may be used uninitialized in this function"
msgstr ""
-#: tree-vrp.c:4380
+#: tree-vrp.c:4861
#, gcc-internal-format
msgid "%Harray subscript is outside array bounds"
msgstr ""
-#: tree-vrp.c:4394
+#: tree-vrp.c:4875
#, gcc-internal-format
msgid "%Harray subscript is above array bounds"
msgstr ""
-#: tree-vrp.c:4401
+#: tree-vrp.c:4882
#, gcc-internal-format
msgid "%Harray subscript is below array bounds"
msgstr ""
-#: tree-vrp.c:5054
+#: tree-vrp.c:5498
#, gcc-internal-format
msgid ""
"assuming signed overflow does not occur when simplifying conditional to "
"constant"
msgstr ""
-#: tree-vrp.c:5060
+#: tree-vrp.c:5504
#, gcc-internal-format
msgid "assuming signed overflow does not occur when simplifying conditional"
msgstr ""
-#: tree.c:3682
+#: tree-vrp.c:5541
+#, gcc-internal-format
+msgid "comparison always false due to limited range of data type"
+msgstr ""
+
+#: tree-vrp.c:5544
+#, gcc-internal-format
+msgid "comparison always true due to limited range of data type"
+msgstr ""
+
+#: tree.c:3685
#, gcc-internal-format
msgid "ignoring attributes applied to %qT after definition"
msgstr ""
-#: tree.c:3966
+#: tree.c:3969
#, gcc-internal-format
msgid "%q+D already declared with dllexport attribute: dllimport ignored"
msgstr ""
-#: tree.c:3978
+#: tree.c:3981
#, gcc-internal-format
msgid ""
"%q+D redeclared without dllimport attribute after being referenced with dll "
"linkage"
msgstr ""
-#: tree.c:3994
+#: tree.c:3996
#, gcc-internal-format
msgid "%q+D redeclared without dllimport attribute: previous dllimport ignored"
msgstr ""
-#: tree.c:4053 tree.c:4065 config/darwin.c:1460 config/arm/arm.c:3099
-#: config/arm/arm.c:3127 config/avr/avr.c:4619 config/h8300/h8300.c:5281
-#: config/h8300/h8300.c:5305 config/i386/i386.c:3087 config/i386/i386.c:22594
-#: config/ia64/ia64.c:586 config/m68hc11/m68hc11.c:1118
-#: config/rs6000/rs6000.c:19859 config/sh/symbian.c:408
-#: config/sh/symbian.c:415
+#: tree.c:4055 tree.c:4067 tree.c:4077 config/darwin.c:1456
+#: config/arm/arm.c:3125 config/arm/arm.c:3153 config/avr/avr.c:4737
+#: config/h8300/h8300.c:5282 config/h8300/h8300.c:5306 config/i386/i386.c:4099
+#: config/i386/i386.c:24408 config/ia64/ia64.c:592
+#: config/m68hc11/m68hc11.c:1118 config/rs6000/rs6000.c:20429
+#: config/sh/symbian.c:408 config/sh/symbian.c:415
#, gcc-internal-format
msgid "%qs attribute ignored"
msgstr ""
-#: tree.c:4081
+#: tree.c:4093
#, gcc-internal-format
msgid "inline function %q+D declared as dllimport: attribute ignored"
msgstr ""
-#: tree.c:4089
+#: tree.c:4101
#, gcc-internal-format
msgid "function %q+D definition is marked dllimport"
msgstr ""
-#: tree.c:4097 config/sh/symbian.c:430
+#: tree.c:4109 config/sh/symbian.c:430
#, gcc-internal-format
msgid "variable %q+D definition is marked dllimport"
msgstr ""
-#: tree.c:4120 config/sh/symbian.c:505
+#: tree.c:4132 config/sh/symbian.c:505
#, gcc-internal-format
msgid "external linkage required for symbol %q+D because of %qs attribute"
msgstr ""
-#: tree.c:4134
+#: tree.c:4146
#, gcc-internal-format
msgid ""
"%qs implies default visibility, but %qD has already been declared with a "
"different visibility"
msgstr ""
-#: tree.c:5648
+#: tree.c:5699
#, gcc-internal-format
msgid "arrays of functions are not meaningful"
msgstr ""
-#: tree.c:5801
+#: tree.c:5850
#, gcc-internal-format
msgid "function return type cannot be function"
msgstr ""
-#: tree.c:6818 tree.c:6903 tree.c:6964
+#: tree.c:6865 tree.c:6950 tree.c:7011
#, gcc-internal-format
msgid "tree check: %s, have %s in %s, at %s:%d"
msgstr ""
-#: tree.c:6855
+#: tree.c:6902
#, gcc-internal-format
msgid "tree check: expected none of %s, have %s in %s, at %s:%d"
msgstr ""
-#: tree.c:6868
+#: tree.c:6915
#, gcc-internal-format
msgid "tree check: expected class %qs, have %qs (%s) in %s, at %s:%d"
msgstr ""
-#: tree.c:6917
+#: tree.c:6964
#, gcc-internal-format
msgid "tree check: did not expect class %qs, have %qs (%s) in %s, at %s:%d"
msgstr ""
-#: tree.c:6930
+#: tree.c:6977
#, gcc-internal-format
msgid "tree check: expected omp_clause %s, have %s in %s, at %s:%d"
msgstr ""
-#: tree.c:6990
+#: tree.c:7037
#, gcc-internal-format
msgid ""
"tree check: expected tree that contains %qs structure, have %qs in %s, at %s:"
"%d"
msgstr ""
-#: tree.c:7004
+#: tree.c:7051
#, gcc-internal-format
msgid "tree check: accessed elt %d of tree_vec with %d elts in %s, at %s:%d"
msgstr ""
-#: tree.c:7016
-#, gcc-internal-format
-msgid "tree check: accessed elt %d of phi_node with %d elts in %s, at %s:%d"
-msgstr ""
-
-#: tree.c:7029
+#: tree.c:7064
#, gcc-internal-format
msgid "tree check: accessed operand %d of %s with %d operands in %s, at %s:%d"
msgstr ""
-#: tree.c:7042
+#: tree.c:7077
#, gcc-internal-format
msgid ""
"tree check: accessed operand %d of omp_clause %s with %d operands in %s, at %"
"s:%d"
msgstr ""
-#: value-prof.c:351
+#: value-prof.c:376
#, gcc-internal-format
msgid "Dead histogram"
msgstr ""
-#: value-prof.c:380
+#: value-prof.c:407
#, gcc-internal-format
msgid ""
-"Histogram value statement does not correspond to statement it is associated "
-"with"
+"Histogram value statement does not correspond to the statement it is "
+"associated with"
msgstr ""
-#: value-prof.c:393
+#: value-prof.c:420
#, gcc-internal-format
msgid "verify_histograms failed"
msgstr ""
-#: value-prof.c:434
+#: value-prof.c:467
+#, gcc-internal-format
+msgid ""
+"Correcting inconsistent value profile: %s profiler overall count (%d) does "
+"not match BB count (%d)"
+msgstr ""
+
+#: value-prof.c:477
#, gcc-internal-format
msgid ""
"%HCorrupted value profile: %s profiler overall count (%d) does not match BB "
"count (%d)"
msgstr ""
-#: varasm.c:546
+#: varasm.c:575
#, gcc-internal-format
msgid "%+D causes a section type conflict"
msgstr ""
-#: varasm.c:1089
+#: varasm.c:1118
#, gcc-internal-format
msgid ""
"alignment of %q+D is greater than maximum object file alignment. Using %d"
msgstr ""
-#: varasm.c:1310 varasm.c:1318
+#: varasm.c:1344 varasm.c:1352
#, gcc-internal-format
msgid "register name not specified for %q+D"
msgstr ""
-#: varasm.c:1320
+#: varasm.c:1354
#, gcc-internal-format
msgid "invalid register name for %q+D"
msgstr ""
-#: varasm.c:1322
+#: varasm.c:1356
#, gcc-internal-format
msgid "data type of %q+D isn%'t suitable for a register"
msgstr ""
-#: varasm.c:1325
+#: varasm.c:1359
#, gcc-internal-format
msgid "register specified for %q+D isn%'t suitable for data type"
msgstr ""
-#: varasm.c:1335
+#: varasm.c:1369
#, gcc-internal-format
msgid "global register variable has initial value"
msgstr ""
-#: varasm.c:1339
+#: varasm.c:1373
#, gcc-internal-format
msgid "optimization may eliminate reads and/or writes to register variables"
msgstr ""
-#: varasm.c:1377
+#: varasm.c:1411
#, gcc-internal-format
msgid "register name given for non-register variable %q+D"
msgstr ""
-#: varasm.c:1446
+#: varasm.c:1480
#, gcc-internal-format
msgid "global destructors not supported on this target"
msgstr ""
-#: varasm.c:1512
+#: varasm.c:1546
#, gcc-internal-format
msgid "global constructors not supported on this target"
msgstr ""
-#: varasm.c:1898
+#: varasm.c:1932
#, gcc-internal-format
msgid "thread-local COMMON data not implemented"
msgstr ""
-#: varasm.c:1927
+#: varasm.c:1961
#, gcc-internal-format
msgid ""
"requested alignment for %q+D is greater than implemented alignment of %wu"
msgstr ""
-#: varasm.c:4386
+#: varasm.c:4429
#, gcc-internal-format
msgid "initializer for integer/fixed-point value is too complicated"
msgstr ""
-#: varasm.c:4391
+#: varasm.c:4434
#, gcc-internal-format
msgid "initializer for floating value is not a floating constant"
msgstr ""
-#: varasm.c:4664
+#: varasm.c:4707
#, gcc-internal-format
msgid "invalid initial value for member %qs"
msgstr ""
-#: varasm.c:4864 varasm.c:4908
+#: varasm.c:4903 varasm.c:4947
#, gcc-internal-format
msgid "weak declaration of %q+D must precede definition"
msgstr ""
-#: varasm.c:4872
+#: varasm.c:4911
#, gcc-internal-format
msgid ""
"weak declaration of %q+D after first use results in unspecified behavior"
msgstr ""
-#: varasm.c:4906
+#: varasm.c:4945
#, gcc-internal-format
msgid "weak declaration of %q+D must be public"
msgstr ""
-#: varasm.c:4915
+#: varasm.c:4949
#, gcc-internal-format
msgid "weak declaration of %q+D not supported"
msgstr ""
-#: varasm.c:4941
+#: varasm.c:4975
#, gcc-internal-format
msgid "only weak aliases are supported in this configuration"
msgstr ""
-#: varasm.c:5176
+#: varasm.c:5210
#, gcc-internal-format
msgid "%Jweakref is not supported in this configuration"
msgstr ""
-#: varasm.c:5257
+#: varasm.c:5291
#, gcc-internal-format
msgid "%q+D aliased to undefined symbol %qs"
msgstr ""
-#: varasm.c:5262
+#: varasm.c:5296
#, gcc-internal-format
msgid "%q+D aliased to external symbol %qs"
msgstr ""
-#: varasm.c:5301
+#: varasm.c:5335
#, gcc-internal-format
msgid "weakref %q+D ultimately targets itself"
msgstr ""
-#: varasm.c:5310
+#: varasm.c:5344
#, gcc-internal-format
msgid "weakref %q+D must have static linkage"
msgstr ""
-#: varasm.c:5316
+#: varasm.c:5350
#, gcc-internal-format
msgid "%Jalias definitions not supported in this configuration"
msgstr ""
-#: varasm.c:5321
+#: varasm.c:5355
#, gcc-internal-format
msgid "%Jonly weak aliases are supported in this configuration"
msgstr ""
-#: varasm.c:5378
+#: varasm.c:5415
#, gcc-internal-format
msgid "visibility attribute not supported in this configuration; ignored"
msgstr ""
-#: varray.c:195
+#: varray.c:197
#, gcc-internal-format
msgid "virtual array %s[%lu]: element %lu out of bounds in %s, at %s:%d"
msgstr ""
-#: varray.c:205
+#: varray.c:207
#, gcc-internal-format
msgid "underflowed virtual array %s in %s, at %s:%d"
msgstr ""
@@ -24941,18 +25033,18 @@ msgstr ""
msgid "Unknown value %qs of -mmacosx-version-min"
msgstr ""
-#: config/darwin.c:1433
+#: config/darwin.c:1429
#, gcc-internal-format
msgid ""
"%<%s%> 2.95 vtable-compatibility attribute applies only when compiling a kext"
msgstr ""
-#: config/darwin.c:1440
+#: config/darwin.c:1436
#, gcc-internal-format
msgid "%<%s%> 2.95 vtable-compatibility attribute applies only to C++ classes"
msgstr ""
-#: config/darwin.c:1565
+#: config/darwin.c:1561
#, gcc-internal-format
msgid ""
"internal and protected visibility attributes not supported in this "
@@ -25024,7 +25116,7 @@ msgstr ""
msgid "ignoring %<#pragma align%> for explicitly aligned %q+D"
msgstr ""
-#: config/vxworks.c:69
+#: config/vxworks.c:146
#, gcc-internal-format
msgid "PIC is only supported for RTPs"
msgstr ""
@@ -25045,12 +25137,7 @@ msgstr ""
msgid "profiler support for VxWorks"
msgstr ""
-#: config/windiss.h:36
-#, gcc-internal-format
-msgid "profiler support for WindISS"
-msgstr ""
-
-#: config/alpha/alpha.c:232 config/rs6000/rs6000.c:2011
+#: config/alpha/alpha.c:232 config/rs6000/rs6000.c:2115
#, gcc-internal-format
msgid "bad value %qs for -mtls-size switch"
msgstr ""
@@ -25125,8 +25212,8 @@ msgstr ""
msgid "bad value %qs for -mmemory-latency"
msgstr ""
-#: config/alpha/alpha.c:6519 config/alpha/alpha.c:6522 config/s390/s390.c:8295
-#: config/s390/s390.c:8298
+#: config/alpha/alpha.c:6505 config/alpha/alpha.c:6508 config/s390/s390.c:8715
+#: config/s390/s390.c:8718
#, gcc-internal-format
msgid "bad builtin fcode"
msgstr ""
@@ -25141,195 +25228,196 @@ msgstr ""
msgid "argument of %qs attribute is not \"ilink1\" or \"ilink2\""
msgstr ""
-#: config/arm/arm.c:1050
+#: config/arm/arm.c:1067
#, gcc-internal-format
msgid "switch -mcpu=%s conflicts with -march= switch"
msgstr ""
-#: config/arm/arm.c:1060 config/rs6000/rs6000.c:1520 config/sparc/sparc.c:764
+#: config/arm/arm.c:1077 config/rs6000/rs6000.c:1582 config/sparc/sparc.c:764
#, gcc-internal-format
msgid "bad value (%s) for %s switch"
msgstr ""
-#: config/arm/arm.c:1170
+#: config/arm/arm.c:1187
#, gcc-internal-format
msgid "target CPU does not support ARM mode"
msgstr ""
-#: config/arm/arm.c:1174
+#: config/arm/arm.c:1191
#, gcc-internal-format
msgid "target CPU does not support interworking"
msgstr ""
-#: config/arm/arm.c:1180
+#: config/arm/arm.c:1197
#, gcc-internal-format
msgid "target CPU does not support THUMB instructions"
msgstr ""
-#: config/arm/arm.c:1198
+#: config/arm/arm.c:1215
#, gcc-internal-format
msgid ""
"enabling backtrace support is only meaningful when compiling for the Thumb"
msgstr ""
-#: config/arm/arm.c:1201
+#: config/arm/arm.c:1218
#, gcc-internal-format
msgid ""
"enabling callee interworking support is only meaningful when compiling for "
"the Thumb"
msgstr ""
-#: config/arm/arm.c:1204
+#: config/arm/arm.c:1221
#, gcc-internal-format
msgid ""
"enabling caller interworking support is only meaningful when compiling for "
"the Thumb"
msgstr ""
-#: config/arm/arm.c:1208
+#: config/arm/arm.c:1225
#, gcc-internal-format
msgid "-mapcs-stack-check incompatible with -mno-apcs-frame"
msgstr ""
-#: config/arm/arm.c:1216
+#: config/arm/arm.c:1233
#, gcc-internal-format
msgid "-fpic and -mapcs-reent are incompatible"
msgstr ""
-#: config/arm/arm.c:1219
+#: config/arm/arm.c:1236
#, gcc-internal-format
msgid "APCS reentrant code not supported. Ignored"
msgstr ""
-#: config/arm/arm.c:1227
+#: config/arm/arm.c:1244
#, gcc-internal-format
msgid "-g with -mno-apcs-frame may not give sensible debugging"
msgstr ""
-#: config/arm/arm.c:1230
+#: config/arm/arm.c:1247
#, gcc-internal-format
msgid "passing floating point arguments in fp regs not yet supported"
msgstr ""
-#: config/arm/arm.c:1275
+#: config/arm/arm.c:1292
#, gcc-internal-format
msgid "invalid ABI option: -mabi=%s"
msgstr ""
-#: config/arm/arm.c:1281
+#: config/arm/arm.c:1298
#, gcc-internal-format
msgid "iwmmxt requires an AAPCS compatible ABI for proper operation"
msgstr ""
-#: config/arm/arm.c:1284
+#: config/arm/arm.c:1301
#, gcc-internal-format
msgid "iwmmxt abi requires an iwmmxt capable cpu"
msgstr ""
-#: config/arm/arm.c:1294
+#: config/arm/arm.c:1311
#, gcc-internal-format
msgid "invalid floating point emulation option: -mfpe=%s"
msgstr ""
-#: config/arm/arm.c:1311
+#: config/arm/arm.c:1328
#, gcc-internal-format
msgid "invalid floating point option: -mfpu=%s"
msgstr ""
-#: config/arm/arm.c:1351
+#: config/arm/arm.c:1368
#, gcc-internal-format
msgid "invalid floating point abi: -mfloat-abi=%s"
msgstr ""
-#: config/arm/arm.c:1358
+#: config/arm/arm.c:1375
#, gcc-internal-format
msgid "-mfloat-abi=hard and VFP"
msgstr ""
-#: config/arm/arm.c:1364
+#: config/arm/arm.c:1381
#, gcc-internal-format
msgid "iWMMXt and hardware floating point"
msgstr ""
-#: config/arm/arm.c:1368
+#: config/arm/arm.c:1385
#, gcc-internal-format
msgid "Thumb-2 iWMMXt"
msgstr ""
-#: config/arm/arm.c:1391
+#: config/arm/arm.c:1408
#, gcc-internal-format
msgid "invalid thread pointer option: -mtp=%s"
msgstr ""
-#: config/arm/arm.c:1404
+#: config/arm/arm.c:1421
#, gcc-internal-format
msgid "can not use -mtp=cp15 with 16-bit Thumb"
msgstr ""
-#: config/arm/arm.c:1418
+#: config/arm/arm.c:1435
#, gcc-internal-format
msgid "structure size boundary can only be set to %s"
msgstr ""
-#: config/arm/arm.c:1424
+#: config/arm/arm.c:1441
#, gcc-internal-format
msgid "RTP PIC is incompatible with Thumb"
msgstr ""
-#: config/arm/arm.c:1433
+#: config/arm/arm.c:1450
#, gcc-internal-format
msgid "RTP PIC is incompatible with -msingle-pic-base"
msgstr ""
-#: config/arm/arm.c:1445
+#: config/arm/arm.c:1462
#, gcc-internal-format
msgid "-mpic-register= is useless without -fpic"
msgstr ""
-#: config/arm/arm.c:1454
+#: config/arm/arm.c:1471
#, gcc-internal-format
msgid "unable to use '%s' for PIC register"
msgstr ""
-#: config/arm/arm.c:3067 config/arm/arm.c:3085 config/avr/avr.c:4639
-#: config/avr/avr.c:4681 config/bfin/bfin.c:4881 config/h8300/h8300.c:5257
-#: config/i386/i386.c:3040 config/m68hc11/m68hc11.c:1155
-#: config/m68k/m68k.c:741 config/mcore/mcore.c:3032 config/mips/mips.c:1151
-#: config/mips/mips.c:1153 config/mt/mt.c:1275 config/rs6000/rs6000.c:19785
-#: config/sh/sh.c:7987 config/sh/sh.c:8008 config/sh/sh.c:8031
-#: config/stormy16/stormy16.c:2225 config/v850/v850.c:2048
+#: config/arm/arm.c:3093 config/arm/arm.c:3111 config/avr/avr.c:4757
+#: config/avr/avr.c:4799 config/bfin/bfin.c:4906 config/h8300/h8300.c:5258
+#: config/i386/i386.c:4061 config/i386/i386.c:24353
+#: config/m68hc11/m68hc11.c:1155 config/m68k/m68k.c:783
+#: config/mcore/mcore.c:3032 config/mips/mips.c:1196 config/mips/mips.c:1198
+#: config/rs6000/rs6000.c:20355 config/sh/sh.c:8162 config/sh/sh.c:8180
+#: config/sh/sh.c:8209 config/sh/sh.c:8291 config/sh/sh.c:8314
+#: config/stormy16/stormy16.c:2227 config/v850/v850.c:2048
#, gcc-internal-format
msgid "%qs attribute only applies to functions"
msgstr ""
-#: config/arm/arm.c:14012
+#: config/arm/arm.c:14223
#, gcc-internal-format
msgid "unable to compute real location of stacked parameter"
msgstr ""
-#: config/arm/arm.c:15451
+#: config/arm/arm.c:15729
#, gcc-internal-format
msgid "argument must be a constant"
msgstr ""
#. @@@ better error message
-#: config/arm/arm.c:15759 config/arm/arm.c:15796
+#: config/arm/arm.c:16037 config/arm/arm.c:16074
#, gcc-internal-format
msgid "selector must be an immediate"
msgstr ""
#. @@@ better error message
-#: config/arm/arm.c:15839 config/i386/i386.c:20730 config/i386/i386.c:20764
+#: config/arm/arm.c:16117
#, gcc-internal-format
msgid "mask must be an immediate"
msgstr ""
-#: config/arm/arm.c:16498
+#: config/arm/arm.c:16778
#, gcc-internal-format
msgid "no low registers available for popping high registers"
msgstr ""
-#: config/arm/arm.c:16721
+#: config/arm/arm.c:17001
#, gcc-internal-format
msgid "interrupt Service Routines cannot be coded in Thumb mode"
msgstr ""
@@ -25344,102 +25432,117 @@ msgstr ""
msgid "static variable %q+D is marked dllimport"
msgstr ""
-#: config/avr/avr.c:707
-#, gcc-internal-format
-msgid "large frame pointer change (%d) with -mtiny-stack"
-msgstr ""
-
-#: config/avr/avr.c:4612
+#: config/avr/avr.c:4730
#, gcc-internal-format
msgid "only initialized variables can be placed into program memory area"
msgstr ""
-#: config/avr/avr.c:4656
+#: config/avr/avr.c:4774
#, gcc-internal-format
msgid "%qs appears to be a misspelled interrupt handler"
msgstr ""
-#: config/avr/avr.c:4664
+#: config/avr/avr.c:4782
#, gcc-internal-format
msgid "%qs appears to be a misspelled signal handler"
msgstr ""
-#: config/avr/avr.c:4772
+#: config/avr/avr.c:4890
#, gcc-internal-format
msgid "only uninitialized variables can be placed in the .noinit section"
msgstr ""
-#: config/avr/avr.c:4786
+#: config/avr/avr.c:4904
#, gcc-internal-format
msgid "MCU %qs supported for assembler only"
msgstr ""
-#: config/avr/avr.h:730
+#: config/avr/avr.h:763
#, gcc-internal-format
msgid "trampolines not supported"
msgstr ""
-#: config/bfin/bfin.c:2352 config/m68k/m68k.c:488
+#: config/bfin/bfin.c:2344 config/m68k/m68k.c:500
#, gcc-internal-format
msgid "-mshared-library-id=%s is not between 0 and %d"
msgstr ""
-#: config/bfin/bfin.c:2372
+#: config/bfin/bfin.c:2364
#, gcc-internal-format
msgid "-mcpu=%s is not valid"
msgstr ""
-#: config/bfin/bfin.c:2410
+#: config/bfin/bfin.c:2400
#, gcc-internal-format
msgid "-mcpu=%s has invalid silicon revision"
msgstr ""
-#: config/bfin/bfin.c:2427
+#: config/bfin/bfin.c:2417
#, gcc-internal-format
msgid "bf561 support is incomplete yet."
msgstr ""
-#: config/bfin/bfin.c:2470
+#: config/bfin/bfin.c:2468
#, gcc-internal-format
msgid "-mshared-library-id= specified without -mid-shared-library"
msgstr ""
-#: config/bfin/bfin.c:2473
+#: config/bfin/bfin.c:2471
#, gcc-internal-format
msgid "Can't use multiple stack checking methods together."
msgstr ""
-#: config/bfin/bfin.c:2476
+#: config/bfin/bfin.c:2474
#, gcc-internal-format
msgid "ID shared libraries and FD-PIC mode can't be used together."
msgstr ""
-#: config/bfin/bfin.c:2481 config/m68k/m68k.c:582
+#: config/bfin/bfin.c:2479 config/m68k/m68k.c:608
#, gcc-internal-format
msgid "cannot specify both -msep-data and -mid-shared-library"
msgstr ""
-#: config/bfin/bfin.c:4886
+#: config/bfin/bfin.c:2499
+#, gcc-internal-format
+msgid "-mmulticore can only be used with BF561"
+msgstr ""
+
+#: config/bfin/bfin.c:2502
+#, gcc-internal-format
+msgid "-mcorea should be used with -mmulticore"
+msgstr ""
+
+#: config/bfin/bfin.c:2505
+#, gcc-internal-format
+msgid "-mcoreb should be used with -mmulticore"
+msgstr ""
+
+#: config/bfin/bfin.c:2508
+#, gcc-internal-format
+msgid "-mcorea and -mcoreb can't be used together"
+msgstr ""
+
+#: config/bfin/bfin.c:4911
#, gcc-internal-format
msgid "multiple function type attributes specified"
msgstr ""
-#: config/bfin/bfin.c:4942 config/bfin/bfin.c:4971 config/spu/spu.c:2965
+#: config/bfin/bfin.c:4967 config/bfin/bfin.c:4996 config/spu/spu.c:2978
#, gcc-internal-format
msgid "`%s' attribute only applies to functions"
msgstr ""
-#: config/bfin/bfin.c:4953
+#: config/bfin/bfin.c:4978
#, gcc-internal-format
msgid "can't apply both longcall and shortcall attributes to the same function"
msgstr ""
-#: config/bfin/bfin.c:5003
+#: config/bfin/bfin.c:5028
#, gcc-internal-format
msgid "`%s' attribute only applies to variables"
msgstr ""
-#: config/bfin/bfin.c:5010
+#: config/bfin/bfin.c:5035
#, gcc-internal-format
msgid "`%s' attribute cannot be specified for local variables"
msgstr ""
@@ -25474,57 +25577,57 @@ msgid "unknown cc_attr value"
msgstr ""
#. If we get here, the caller got its initial tests wrong.
-#: config/cris/cris.c:2040
+#: config/cris/cris.c:2046
#, gcc-internal-format
msgid "internal error: cris_side_effect_mode_ok with bad operands"
msgstr ""
-#: config/cris/cris.c:2332
+#: config/cris/cris.c:2338
#, gcc-internal-format
msgid "-max-stackframe=%d is not usable, not between 0 and %d"
msgstr ""
-#: config/cris/cris.c:2360
+#: config/cris/cris.c:2366
#, gcc-internal-format
msgid "unknown CRIS version specification in -march= or -mcpu= : %s"
msgstr ""
-#: config/cris/cris.c:2396
+#: config/cris/cris.c:2402
#, gcc-internal-format
msgid "unknown CRIS cpu version specification in -mtune= : %s"
msgstr ""
-#: config/cris/cris.c:2417
+#: config/cris/cris.c:2423
#, gcc-internal-format
msgid "-fPIC and -fpic are not supported in this configuration"
msgstr ""
-#: config/cris/cris.c:2432
+#: config/cris/cris.c:2438
#, gcc-internal-format
msgid "that particular -g option is invalid with -maout and -melinux"
msgstr ""
-#: config/cris/cris.c:2658
+#: config/cris/cris.c:2664
#, gcc-internal-format
msgid "Unknown src"
msgstr ""
-#: config/cris/cris.c:2719
+#: config/cris/cris.c:2725
#, gcc-internal-format
msgid "Unknown dest"
msgstr ""
-#: config/cris/cris.c:3004
+#: config/cris/cris.c:3010
#, gcc-internal-format
msgid "stackframe too big: %d bytes"
msgstr ""
-#: config/cris/cris.c:3498 config/cris/cris.c:3526
+#: config/cris/cris.c:3504 config/cris/cris.c:3532
#, gcc-internal-format
msgid "expand_binop failed in movsi got"
msgstr ""
-#: config/cris/cris.c:3607
+#: config/cris/cris.c:3613
#, gcc-internal-format
msgid "emitting PIC operand, but PIC register isn't set up"
msgstr ""
@@ -25578,7 +25681,7 @@ msgstr ""
#. See cris.c for TARGET_ASM_FUNCTION_PROLOGUE and
#. TARGET_ASM_FUNCTION_EPILOGUE.
#. Node: Profiling
-#: config/cris/cris.h:947
+#: config/cris/cris.h:950
#, gcc-internal-format
msgid "no FUNCTION_PROFILER for CRIS"
msgstr ""
@@ -25593,72 +25696,72 @@ msgstr ""
msgid "Trampoline support for CRX"
msgstr ""
-#: config/frv/frv.c:8626
+#: config/frv/frv.c:8627
#, gcc-internal-format
msgid "accumulator is not a constant integer"
msgstr ""
-#: config/frv/frv.c:8631
+#: config/frv/frv.c:8632
#, gcc-internal-format
msgid "accumulator number is out of bounds"
msgstr ""
-#: config/frv/frv.c:8642
+#: config/frv/frv.c:8643
#, gcc-internal-format
msgid "inappropriate accumulator for %qs"
msgstr ""
-#: config/frv/frv.c:8719
+#: config/frv/frv.c:8720
#, gcc-internal-format
msgid "invalid IACC argument"
msgstr ""
-#: config/frv/frv.c:8742
+#: config/frv/frv.c:8743
#, gcc-internal-format
msgid "%qs expects a constant argument"
msgstr ""
-#: config/frv/frv.c:8747
+#: config/frv/frv.c:8748
#, gcc-internal-format
msgid "constant argument out of range for %qs"
msgstr ""
-#: config/frv/frv.c:9228
+#: config/frv/frv.c:9229
#, gcc-internal-format
msgid "media functions are not available unless -mmedia is used"
msgstr ""
-#: config/frv/frv.c:9240
+#: config/frv/frv.c:9241
#, gcc-internal-format
msgid "this media function is only available on the fr500"
msgstr ""
-#: config/frv/frv.c:9268
+#: config/frv/frv.c:9269
#, gcc-internal-format
msgid "this media function is only available on the fr400 and fr550"
msgstr ""
-#: config/frv/frv.c:9287
+#: config/frv/frv.c:9288
#, gcc-internal-format
msgid "this builtin function is only available on the fr405 and fr450"
msgstr ""
-#: config/frv/frv.c:9296
+#: config/frv/frv.c:9297
#, gcc-internal-format
msgid "this builtin function is only available on the fr500 and fr550"
msgstr ""
-#: config/frv/frv.c:9308
+#: config/frv/frv.c:9309
#, gcc-internal-format
msgid "this builtin function is only available on the fr450"
msgstr ""
-#: config/h8300/h8300.c:330
+#: config/h8300/h8300.c:331
#, gcc-internal-format
msgid "-ms2600 is used without -ms"
msgstr ""
-#: config/h8300/h8300.c:336
+#: config/h8300/h8300.c:337
#, gcc-internal-format
msgid "-mn is used without -mh or -ms"
msgstr ""
@@ -25673,315 +25776,340 @@ msgstr ""
msgid "can't set position in PCH file: %m"
msgstr ""
-#: config/i386/i386.c:2158 config/i386/i386.c:2358
+#: config/i386/i386.c:2619 config/i386/i386.c:2836
#, gcc-internal-format
-msgid "bad value (%s) for -mtune= switch"
+msgid "bad value (%s) for %stune=%s %s"
msgstr ""
-#: config/i386/i386.c:2199
+#: config/i386/i386.c:2661
#, gcc-internal-format
-msgid "bad value (%s) for -mstringop-strategy= switch"
+msgid "bad value (%s) for %sstringop-strategy=%s %s"
msgstr ""
-#: config/i386/i386.c:2202
+#: config/i386/i386.c:2665
#, gcc-internal-format
msgid ""
-"-mtune=x86-64 is deprecated. Use -mtune=k8 or -mtune=generic instead as "
-"appropriate."
+"%stune=x86-64%s is deprecated. Use %stune=k8%s or %stune=generic%s instead "
+"as appropriate."
msgstr ""
-#: config/i386/i386.c:2211
+#: config/i386/i386.c:2675
#, gcc-internal-format
-msgid "generic CPU can be used only for -mtune= switch"
+msgid "generic CPU can be used only for %stune=%s %s"
msgstr ""
-#: config/i386/i386.c:2213 config/i386/i386.c:2322 config/mt/mt.c:804
+#: config/i386/i386.c:2678 config/i386/i386.c:2799
#, gcc-internal-format
-msgid "bad value (%s) for -march= switch"
+msgid "bad value (%s) for %sarch=%s %s"
msgstr ""
-#: config/i386/i386.c:2224
+#: config/i386/i386.c:2690
#, gcc-internal-format
msgid "code model %s does not support PIC mode"
msgstr ""
-#: config/i386/i386.c:2230 config/sparc/sparc.c:728
+#: config/i386/i386.c:2696
#, gcc-internal-format
-msgid "bad value (%s) for -mcmodel= switch"
+msgid "bad value (%s) for %scmodel=%s %s"
msgstr ""
-#: config/i386/i386.c:2253
+#: config/i386/i386.c:2720
#, gcc-internal-format
-msgid "bad value (%s) for -masm= switch"
+msgid "bad value (%s) for %sasm=%s %s"
msgstr ""
-#: config/i386/i386.c:2256
+#: config/i386/i386.c:2724
#, gcc-internal-format
msgid "code model %qs not supported in the %s bit mode"
msgstr ""
-#: config/i386/i386.c:2259
+#: config/i386/i386.c:2727
#, gcc-internal-format
msgid "%i-bit mode not compiled in"
msgstr ""
-#: config/i386/i386.c:2270 config/i386/i386.c:2344
+#: config/i386/i386.c:2738 config/i386/i386.c:2822
#, gcc-internal-format
msgid "CPU you selected does not support x86-64 instruction set"
msgstr ""
-#: config/i386/i386.c:2376
+#: config/i386/i386.c:2855
#, gcc-internal-format
-msgid "-mregparm is ignored in 64-bit mode"
+msgid "%sregparm%s is ignored in 64-bit mode"
msgstr ""
-#: config/i386/i386.c:2379
+#: config/i386/i386.c:2858
#, gcc-internal-format
-msgid "-mregparm=%d is not between 0 and %d"
+msgid "%sregparm=%d%s is not between 0 and %d"
msgstr ""
-#: config/i386/i386.c:2391
+#: config/i386/i386.c:2871
#, gcc-internal-format
-msgid "-malign-loops is obsolete, use -falign-loops"
+msgid "%salign-loops%s is obsolete, use %salign-loops%s"
msgstr ""
-#: config/i386/i386.c:2396 config/i386/i386.c:2409 config/i386/i386.c:2422
+#: config/i386/i386.c:2877 config/i386/i386.c:2892 config/i386/i386.c:2907
#, gcc-internal-format
-msgid "-malign-loops=%d is not between 0 and %d"
+msgid "%salign-loops=%d%s is not between 0 and %d"
msgstr ""
-#: config/i386/i386.c:2404
+#: config/i386/i386.c:2886
#, gcc-internal-format
-msgid "-malign-jumps is obsolete, use -falign-jumps"
+msgid "%salign-jumps%s is obsolete, use %salign-jumps%s"
msgstr ""
-#: config/i386/i386.c:2417
+#: config/i386/i386.c:2901
#, gcc-internal-format
-msgid "-malign-functions is obsolete, use -falign-functions"
+msgid "%salign-functions%s is obsolete, use %salign-functions%s"
msgstr ""
-#: config/i386/i386.c:2450
+#: config/i386/i386.c:2936
#, gcc-internal-format
-msgid "-mbranch-cost=%d is not between 0 and 5"
+msgid "%sbranch-cost=%d%s is not between 0 and 5"
msgstr ""
-#: config/i386/i386.c:2458
+#: config/i386/i386.c:2944
#, gcc-internal-format
-msgid "-mlarge-data-threshold=%d is negative"
+msgid "%slarge-data-threshold=%d%s is negative"
msgstr ""
-#: config/i386/i386.c:2472
+#: config/i386/i386.c:2958
#, gcc-internal-format
-msgid "bad value (%s) for -mtls-dialect= switch"
+msgid "bad value (%s) for %stls-dialect=%s %s"
msgstr ""
-#: config/i386/i386.c:2480
+#: config/i386/i386.c:2966
#, gcc-internal-format
msgid "pc%d is not valid precision setting (32, 64 or 80)"
msgstr ""
-#: config/i386/i386.c:2496
+#: config/i386/i386.c:2982
+#, gcc-internal-format
+msgid "%srtd%s is ignored in 64bit mode"
+msgstr ""
+
+#: config/i386/i386.c:3037
#, gcc-internal-format
-msgid "-mrtd is ignored in 64bit mode"
+msgid "%spreferred-stack-boundary=%d%s is not between %d and 12"
msgstr ""
-#: config/i386/i386.c:2585
+#: config/i386/i386.c:3058
#, gcc-internal-format
-msgid "-mpreferred-stack-boundary=%d is not between %d and 12"
+msgid "-mincoming-stack-boundary=%d is not between %d and 12"
msgstr ""
-#: config/i386/i386.c:2594
+#: config/i386/i386.c:3071
#, gcc-internal-format
-msgid "-msseregparm used without SSE enabled"
+msgid "%ssseregparm%s used without SSE enabled"
msgstr ""
-#: config/i386/i386.c:2605 config/i386/i386.c:2616
+#: config/i386/i386.c:3082 config/i386/i386.c:3096
#, gcc-internal-format
msgid "SSE instruction set disabled, using 387 arithmetics"
msgstr ""
-#: config/i386/i386.c:2621
+#: config/i386/i386.c:3101
#, gcc-internal-format
msgid "387 instruction set disabled, using SSE arithmetics"
msgstr ""
-#: config/i386/i386.c:2628
+#: config/i386/i386.c:3108
#, gcc-internal-format
-msgid "bad value (%s) for -mfpmath= switch"
+msgid "bad value (%s) for %sfpmath=%s %s"
msgstr ""
-#: config/i386/i386.c:2641
+#: config/i386/i386.c:3124
#, gcc-internal-format
-msgid "unknown vectorization library ABI type (%s) for -mveclibabi= switch"
+msgid "unknown vectorization library ABI type (%s) for %sveclibabi=%s %s"
msgstr ""
-#: config/i386/i386.c:2660
+#: config/i386/i386.c:3144
#, gcc-internal-format
msgid ""
-"unwind tables currently require either a frame pointer or -maccumulate-"
-"outgoing-args for correctness"
+"unwind tables currently require either a frame pointer or %saccumulate-"
+"outgoing-args%s for correctness"
msgstr ""
-#: config/i386/i386.c:3053 config/i386/i386.c:3106
+#: config/i386/i386.c:3157
#, gcc-internal-format
-msgid "fastcall and regparm attributes are not compatible"
+msgid "stack probing requires %saccumulate-outgoing-args%s for correctness"
msgstr ""
-#: config/i386/i386.c:3060
+#: config/i386/i386.c:3491
#, gcc-internal-format
-msgid "%qs attribute requires an integer constant argument"
+msgid "attribute(option(\"%s\")) is unknown"
msgstr ""
-#: config/i386/i386.c:3066
+#: config/i386/i386.c:3513
#, gcc-internal-format
-msgid "argument to %qs attribute larger than %d"
+msgid "option(\"%s\") was already specified"
+msgstr ""
+
+#: config/i386/i386.c:4074 config/i386/i386.c:4118
+#, gcc-internal-format
+msgid "fastcall and regparm attributes are not compatible"
msgstr ""
-#: config/i386/i386.c:3076
+#: config/i386/i386.c:4081
#, gcc-internal-format
-msgid "%s functions limited to %d register parameters"
+msgid "%qs attribute requires an integer constant argument"
msgstr ""
-#: config/i386/i386.c:3098 config/i386/i386.c:3133
+#: config/i386/i386.c:4087
+#, gcc-internal-format
+msgid "argument to %qs attribute larger than %d"
+msgstr ""
+
+#: config/i386/i386.c:4110 config/i386/i386.c:4145
#, gcc-internal-format
msgid "fastcall and cdecl attributes are not compatible"
msgstr ""
-#: config/i386/i386.c:3102
+#: config/i386/i386.c:4114
#, gcc-internal-format
msgid "fastcall and stdcall attributes are not compatible"
msgstr ""
-#: config/i386/i386.c:3116 config/i386/i386.c:3129
+#: config/i386/i386.c:4128 config/i386/i386.c:4141
#, gcc-internal-format
msgid "stdcall and cdecl attributes are not compatible"
msgstr ""
-#: config/i386/i386.c:3120
+#: config/i386/i386.c:4132
#, gcc-internal-format
msgid "stdcall and fastcall attributes are not compatible"
msgstr ""
-#: config/i386/i386.c:3269
+#: config/i386/i386.c:4221
+#, gcc-internal-format
+msgid "nested functions are limited to 2 register parameters"
+msgstr ""
+
+#: config/i386/i386.c:4305
#, gcc-internal-format
msgid "Calling %qD with attribute sseregparm without SSE/SSE2 enabled"
msgstr ""
-#: config/i386/i386.c:3272
+#: config/i386/i386.c:4308
#, gcc-internal-format
msgid "Calling %qT with attribute sseregparm without SSE/SSE2 enabled"
msgstr ""
-#: config/i386/i386.c:3968
+#: config/i386/i386.c:5115
#, gcc-internal-format
msgid "SSE register return with SSE disabled"
msgstr ""
-#: config/i386/i386.c:3974
+#: config/i386/i386.c:5121
#, gcc-internal-format
msgid "SSE register argument with SSE disabled"
msgstr ""
-#: config/i386/i386.c:3990
+#: config/i386/i386.c:5137
#, gcc-internal-format
msgid "x87 register return with x87 disabled"
msgstr ""
-#: config/i386/i386.c:4311
+#: config/i386/i386.c:5459
#, gcc-internal-format
msgid "SSE vector argument without SSE enabled changes the ABI"
msgstr ""
-#: config/i386/i386.c:4329
+#: config/i386/i386.c:5478
#, gcc-internal-format
msgid "MMX vector argument without MMX enabled changes the ABI"
msgstr ""
-#: config/i386/i386.c:4856
+#: config/i386/i386.c:6043
#, gcc-internal-format
msgid "SSE vector return without SSE enabled changes the ABI"
msgstr ""
-#: config/i386/i386.c:4866
+#: config/i386/i386.c:6053
#, gcc-internal-format
msgid "MMX vector return without MMX enabled changes the ABI"
msgstr ""
-#: config/i386/i386.c:6217
+#: config/i386/i386.c:10084
#, gcc-internal-format
-msgid "-mstackrealign ignored for nested functions"
+msgid "extended registers have no high halves"
msgstr ""
-#: config/i386/i386.c:6219
+#: config/i386/i386.c:10099
#, gcc-internal-format
-msgid "%s not supported for nested functions"
+msgid "unsupported operand size for extended register"
msgstr ""
-#: config/i386/i386.c:8628
+#: config/i386/i386.c:21664
#, gcc-internal-format
-msgid "extended registers have no high halves"
+msgid "last argument must be an immediate"
msgstr ""
-#: config/i386/i386.c:8643
+#: config/i386/i386.c:21957
#, gcc-internal-format
-msgid "unsupported operand size for extended register"
+msgid "the fifth argument must be a 8-bit immediate"
msgstr ""
-#: config/i386/i386.c:19689
+#: config/i386/i386.c:22052
#, gcc-internal-format
-msgid "the third argument must be a 4-bit immediate"
+msgid "the third argument must be a 8-bit immediate"
msgstr ""
-#: config/i386/i386.c:19693
+#: config/i386/i386.c:22348
#, gcc-internal-format
-msgid "the third argument must be an 8-bit immediate"
+msgid "the last argument must be a 4-bit immediate"
msgstr ""
-#: config/i386/i386.c:19915
+#: config/i386/i386.c:22352
#, gcc-internal-format
-msgid "last argument must be an immediate"
+msgid "the last argument must be a 2-bit immediate"
msgstr ""
-#: config/i386/i386.c:20042
+#: config/i386/i386.c:22361
#, gcc-internal-format
-msgid "the second argument must be a 4-bit immediate"
+msgid "the next to last argument must be an 8-bit immediate"
msgstr ""
-#: config/i386/i386.c:20288
+#: config/i386/i386.c:22365 config/i386/i386.c:22517
#, gcc-internal-format
-msgid "the fifth argument must be a 8-bit immediate"
+msgid "the last argument must be an 8-bit immediate"
msgstr ""
-#: config/i386/i386.c:20383
+#: config/i386/i386.c:22575 config/rs6000/rs6000.c:8381
#, gcc-internal-format
-msgid "the third argument must be a 8-bit immediate"
+msgid "selector must be an integer constant in the range 0..%wi"
msgstr ""
-#: config/i386/i386.c:20453 config/rs6000/rs6000.c:8229
+#: config/i386/i386.c:22718
#, gcc-internal-format
-msgid "selector must be an integer constant in the range 0..%wi"
+msgid "%qE needs unknown isa option"
msgstr ""
-#: config/i386/i386.c:20853 config/i386/i386.c:21049
+#: config/i386/i386.c:22722
#, gcc-internal-format
-msgid "shift must be an immediate"
+msgid "%qE needs isa option %s"
msgstr ""
-#: config/i386/i386.c:21112 config/i386/i386.c:21154
+#: config/i386/i386.c:24360
#, gcc-internal-format
-msgid "index mask must be an immediate"
+msgid "%qs attribute only available for 64-bit"
msgstr ""
-#: config/i386/i386.c:21117 config/i386/i386.c:21159
+#: config/i386/i386.c:24371 config/i386/i386.c:24380
#, gcc-internal-format
-msgid "length mask must be an immediate"
+msgid "ms_abi and sysv_abi attributes are not compatible"
msgstr ""
-#: config/i386/i386.c:22604 config/rs6000/rs6000.c:19868
+#: config/i386/i386.c:24418 config/rs6000/rs6000.c:20438
#, gcc-internal-format
msgid "%qs incompatible attribute ignored"
msgstr ""
+#: config/i386/netware.c:253
+#, gcc-internal-format
+msgid "-fPIC and -fpic are not supported for this target"
+msgstr ""
+
#: config/i386/winnt-cxx.c:71 config/sh/symbian.c:172
#, gcc-internal-format
msgid "definition of static data member %q+D of dllimport'd class"
@@ -26003,12 +26131,12 @@ msgstr ""
msgid "%q+D:'selectany' attribute applies only to initialized objects"
msgstr ""
-#: config/i386/winnt.c:445
+#: config/i386/winnt.c:454
#, gcc-internal-format
msgid "%q+D causes a section type conflict"
msgstr ""
-#: config/i386/cygming.h:162
+#: config/i386/cygming.h:150
#, gcc-internal-format
msgid "-f%s ignored for target (all code is position independent)"
msgstr ""
@@ -26028,52 +26156,54 @@ msgstr ""
msgid "malformed #pragma builtin"
msgstr ""
-#: config/ia64/ia64.c:554 config/m32r/m32r.c:373
+#: config/ia64/ia64.c:560 config/m32r/m32r.c:373
#, gcc-internal-format
msgid "invalid argument of %qs attribute"
msgstr ""
-#: config/ia64/ia64.c:566
+#: config/ia64/ia64.c:572
#, gcc-internal-format
msgid "%Jan address area attribute cannot be specified for local variables"
msgstr ""
-#: config/ia64/ia64.c:573
+#: config/ia64/ia64.c:579
#, gcc-internal-format
msgid "address area of %q+D conflicts with previous declaration"
msgstr ""
-#: config/ia64/ia64.c:580
+#: config/ia64/ia64.c:586
#, gcc-internal-format
msgid "%Jaddress area attribute cannot be specified for functions"
msgstr ""
-#: config/ia64/ia64.c:5127 config/pa/pa.c:350 config/spu/spu.c:3864
+#: config/ia64/ia64.c:5135 config/pa/pa.c:350 config/sh/sh.c:7985
+#: config/spu/spu.c:3865
#, gcc-internal-format
msgid "value of -mfixed-range must have form REG1-REG2"
msgstr ""
-#: config/ia64/ia64.c:5154 config/pa/pa.c:377 config/spu/spu.c:3890
+#: config/ia64/ia64.c:5162 config/pa/pa.c:377 config/sh/sh.c:8011
+#: config/spu/spu.c:3891
#, gcc-internal-format
msgid "%s-%s is an empty range"
msgstr ""
-#: config/ia64/ia64.c:5182
+#: config/ia64/ia64.c:5190
#, gcc-internal-format
msgid "bad value %<%s%> for -mtls-size= switch"
msgstr ""
-#: config/ia64/ia64.c:5210
+#: config/ia64/ia64.c:5218
#, gcc-internal-format
msgid "bad value %<%s%> for -mtune= switch"
msgstr ""
-#: config/ia64/ia64.c:5229
+#: config/ia64/ia64.c:5237
#, gcc-internal-format
msgid "not yet implemented: latency-optimized inline square root"
msgstr ""
-#: config/ia64/ia64.c:9951
+#: config/ia64/ia64.c:9965
#, gcc-internal-format
msgid "version attribute is not a string"
msgstr ""
@@ -26083,22 +26213,22 @@ msgstr ""
msgid "gp_offset (%ld) or end_offset (%ld) is less than zero"
msgstr ""
-#: config/iq2000/iq2000.c:2587
+#: config/iq2000/iq2000.c:2586
#, gcc-internal-format
msgid "argument %qd is not a constant"
msgstr ""
-#: config/iq2000/iq2000.c:2889 config/mt/mt.c:349 config/xtensa/xtensa.c:2124
+#: config/iq2000/iq2000.c:2888 config/xtensa/xtensa.c:2145
#, gcc-internal-format
msgid "PRINT_OPERAND_ADDRESS, null pointer"
msgstr ""
-#: config/iq2000/iq2000.c:3044
+#: config/iq2000/iq2000.c:3043
#, gcc-internal-format
msgid "PRINT_OPERAND: Unknown punctuation '%c'"
msgstr ""
-#: config/iq2000/iq2000.c:3053 config/xtensa/xtensa.c:1978
+#: config/iq2000/iq2000.c:3052 config/xtensa/xtensa.c:1999
#, gcc-internal-format
msgid "PRINT_OPERAND null pointer"
msgstr ""
@@ -26123,22 +26253,22 @@ msgstr ""
msgid "invalid target memregs value '%d'"
msgstr ""
-#: config/m32c/m32c.c:2766
+#: config/m32c/m32c.c:2787
#, gcc-internal-format
msgid "`%s' attribute is not supported for R8C target"
msgstr ""
-#: config/m32c/m32c.c:2774
+#: config/m32c/m32c.c:2795
#, gcc-internal-format
msgid "`%s' attribute applies only to functions"
msgstr ""
-#: config/m32c/m32c.c:2782
+#: config/m32c/m32c.c:2803 config/sh/sh.c:8217
#, gcc-internal-format
msgid "`%s' attribute argument not an integer constant"
msgstr ""
-#: config/m32c/m32c.c:2791
+#: config/m32c/m32c.c:2812
#, gcc-internal-format
msgid "`%s' attribute argument should be between 18 to 255"
msgstr ""
@@ -26158,163 +26288,168 @@ msgstr ""
msgid "%<trap%> attribute is already used"
msgstr ""
-#: config/m68k/m68k.c:533
+#: config/m68k/m68k.c:549
#, gcc-internal-format
msgid "-mcpu=%s conflicts with -march=%s"
msgstr ""
-#: config/m68k/m68k.c:594
+#: config/m68k/m68k.c:620
#, gcc-internal-format
msgid "-mpcrel -fPIC is not currently supported on selected cpu"
msgstr ""
-#: config/m68k/m68k.c:656
+#: config/m68k/m68k.c:682
#, gcc-internal-format
msgid "-falign-labels=%d is not supported"
msgstr ""
-#: config/m68k/m68k.c:661
+#: config/m68k/m68k.c:687
#, gcc-internal-format
msgid "-falign-loops=%d is not supported"
msgstr ""
-#: config/m68k/m68k.c:748
+#: config/m68k/m68k.c:790
#, gcc-internal-format
msgid "multiple interrupt attributes not allowed"
msgstr ""
-#: config/m68k/m68k.c:755
+#: config/m68k/m68k.c:797
#, gcc-internal-format
msgid "interrupt_thread is available only on fido"
msgstr ""
-#: config/m68k/m68k.c:1072 config/rs6000/rs6000.c:15211
+#: config/m68k/m68k.c:1119 config/rs6000/rs6000.c:15384
#, gcc-internal-format
msgid "stack limit expression is not supported"
msgstr ""
-#: config/mips/mips.c:1163
+#: config/mips/mips.c:1208
#, gcc-internal-format
msgid "%qs cannot have both %<mips16%> and %<nomips16%> attributes"
msgstr ""
-#: config/mips/mips.c:1185 config/mips/mips.c:1188
+#: config/mips/mips.c:1230 config/mips/mips.c:1233
#, gcc-internal-format
msgid "%qs redeclared with conflicting %qs attributes"
msgstr ""
-#: config/mips/mips.c:2382
+#: config/mips/mips.c:2691
#, gcc-internal-format
msgid "MIPS16 TLS"
msgstr ""
-#: config/mips/mips.c:5500
+#: config/mips/mips.c:6022
#, gcc-internal-format
msgid "cannot handle inconsistent calls to %qs"
msgstr ""
-#: config/mips/mips.c:10337
+#: config/mips/mips.c:11443
#, gcc-internal-format
msgid "invalid argument to built-in function"
msgstr ""
-#: config/mips/mips.c:10609
+#: config/mips/mips.c:11684
#, gcc-internal-format
msgid "built-in function %qs not supported for MIPS16"
msgstr ""
-#: config/mips/mips.c:11751 config/mips/mips.c:12137
+#: config/mips/mips.c:12855
#, gcc-internal-format
-msgid "MIPS16 PIC"
+msgid "MIPS16 PIC for ABIs other than o32 and o64"
msgstr ""
-#: config/mips/mips.c:11754
+#: config/mips/mips.c:12858
+#, gcc-internal-format
+msgid "MIPS16 -mxgot code"
+msgstr ""
+
+#: config/mips/mips.c:12861
#, gcc-internal-format
msgid "hard-float MIPS16 code for ABIs other than o32 and o64"
msgstr ""
-#: config/mips/mips.c:11882
+#: config/mips/mips.c:12990
#, gcc-internal-format
msgid "CPU names must be lower case"
msgstr ""
-#: config/mips/mips.c:12010
+#: config/mips/mips.c:13122
#, gcc-internal-format
msgid ""
"%<-%s%> conflicts with the other architecture options, which specify a %s "
"processor"
msgstr ""
-#: config/mips/mips.c:12026
+#: config/mips/mips.c:13138
#, gcc-internal-format
msgid "%<-march=%s%> is not compatible with the selected ABI"
msgstr ""
-#: config/mips/mips.c:12041
+#: config/mips/mips.c:13153
#, gcc-internal-format
msgid "%<-mgp64%> used with a 32-bit processor"
msgstr ""
-#: config/mips/mips.c:12043
+#: config/mips/mips.c:13155
#, gcc-internal-format
msgid "%<-mgp32%> used with a 64-bit ABI"
msgstr ""
-#: config/mips/mips.c:12045
+#: config/mips/mips.c:13157
#, gcc-internal-format
msgid "%<-mgp64%> used with a 32-bit ABI"
msgstr ""
-#: config/mips/mips.c:12061 config/mips/mips.c:12063 config/mips/mips.c:12130
+#: config/mips/mips.c:13173 config/mips/mips.c:13175 config/mips/mips.c:13242
#, gcc-internal-format
msgid "unsupported combination: %s"
msgstr ""
-#: config/mips/mips.c:12067
+#: config/mips/mips.c:13179
#, gcc-internal-format
msgid ""
"%<-mgp32%> and %<-mfp64%> can only be combined if the target supports the "
"mfhc1 and mthc1 instructions"
msgstr ""
-#: config/mips/mips.c:12070
+#: config/mips/mips.c:13182
#, gcc-internal-format
msgid "%<-mgp32%> and %<-mfp64%> can only be combined when using the o32 ABI"
msgstr ""
-#: config/mips/mips.c:12124
+#: config/mips/mips.c:13236
#, gcc-internal-format
msgid "the %qs architecture does not support branch-likely instructions"
msgstr ""
-#: config/mips/mips.c:12170
+#: config/mips/mips.c:13276
#, gcc-internal-format
msgid "%<-mno-gpopt%> needs %<-mexplicit-relocs%>"
msgstr ""
-#: config/mips/mips.c:12178 config/mips/mips.c:12181
+#: config/mips/mips.c:13284 config/mips/mips.c:13287
#, gcc-internal-format
msgid "cannot use small-data accesses for %qs"
msgstr ""
-#: config/mips/mips.c:12195
+#: config/mips/mips.c:13301
#, gcc-internal-format
msgid "%<-mips3d%> requires %<-mpaired-single%>"
msgstr ""
-#: config/mips/mips.c:12204
+#: config/mips/mips.c:13310
#, gcc-internal-format
msgid "%qs must be used with %qs"
msgstr ""
-#: config/mips/mips.c:12211
+#: config/mips/mips.c:13317
#, gcc-internal-format
msgid "the %qs architecture does not support paired-single instructions"
msgstr ""
#. Output assembler code to FILE to increment profiler label # LABELNO
#. for profiling a function entry.
-#: config/mips/mips.h:2111
+#: config/mips/mips.h:2234
#, gcc-internal-format
msgid "mips16 function profiling"
msgstr ""
@@ -26372,11 +26507,6 @@ msgstr ""
msgid "MMIX Internal: %s is not a shiftable int"
msgstr ""
-#: config/mt/mt.c:312
-#, gcc-internal-format
-msgid "info pointer NULL"
-msgstr ""
-
#: config/pa/pa.c:482
#, gcc-internal-format
msgid "PIC code generation is not supported in the portable runtime model"
@@ -26397,7 +26527,7 @@ msgstr ""
msgid "-g option disabled"
msgstr ""
-#: config/pa/pa.c:8354
+#: config/pa/pa.c:8369
#, gcc-internal-format
msgid ""
"alignment (%u) for %s exceeds maximum alignment for global common data. "
@@ -26409,22 +26539,22 @@ msgstr ""
msgid "-munix=98 option required for C89 Amendment 1 features.\n"
msgstr ""
-#: config/rs6000/host-darwin.c:61
+#: config/rs6000/host-darwin.c:62
#, gcc-internal-format
msgid "Segmentation Fault (code)"
msgstr ""
-#: config/rs6000/host-darwin.c:131
+#: config/rs6000/host-darwin.c:132
#, gcc-internal-format
msgid "Segmentation Fault"
msgstr ""
-#: config/rs6000/host-darwin.c:145
+#: config/rs6000/host-darwin.c:146
#, gcc-internal-format
msgid "While setting up signal stack: %m"
msgstr ""
-#: config/rs6000/host-darwin.c:151
+#: config/rs6000/host-darwin.c:152
#, gcc-internal-format
msgid "While setting up signal handler: %m"
msgstr ""
@@ -26468,238 +26598,248 @@ msgstr ""
msgid "junk at end of #pragma longcall"
msgstr ""
-#: config/rs6000/rs6000-c.c:2553
+#: config/rs6000/rs6000-c.c:2714
#, gcc-internal-format
msgid "passing arg %d of %qE discards qualifiers frompointer target type"
msgstr ""
-#: config/rs6000/rs6000-c.c:2596
+#: config/rs6000/rs6000-c.c:2757
#, gcc-internal-format
msgid "invalid parameter combination for AltiVec intrinsic"
msgstr ""
-#: config/rs6000/rs6000.c:1310
+#: config/rs6000/rs6000.c:1361
#, gcc-internal-format
msgid "-mdynamic-no-pic overrides -fpic or -fPIC"
msgstr ""
-#: config/rs6000/rs6000.c:1321
+#: config/rs6000/rs6000.c:1372
#, gcc-internal-format
msgid "-m64 requires PowerPC64 architecture, enabling"
msgstr ""
-#: config/rs6000/rs6000.c:1544
+#: config/rs6000/rs6000.c:1594
+#, gcc-internal-format
+msgid "AltiVec not supported in this target"
+msgstr ""
+
+#: config/rs6000/rs6000.c:1596
+#, gcc-internal-format
+msgid "Spe not supported in this target"
+msgstr ""
+
+#: config/rs6000/rs6000.c:1616
#, gcc-internal-format
msgid "-mmultiple is not supported on little endian systems"
msgstr ""
-#: config/rs6000/rs6000.c:1551
+#: config/rs6000/rs6000.c:1623
#, gcc-internal-format
msgid "-mstring is not supported on little endian systems"
msgstr ""
-#: config/rs6000/rs6000.c:1565
+#: config/rs6000/rs6000.c:1637
#, gcc-internal-format
msgid "unknown -mdebug-%s switch"
msgstr ""
-#: config/rs6000/rs6000.c:1577
+#: config/rs6000/rs6000.c:1649
#, gcc-internal-format
msgid ""
"unknown -mtraceback arg %qs; expecting %<full%>, %<partial%> or %<none%>"
msgstr ""
-#: config/rs6000/rs6000.c:1994
+#: config/rs6000/rs6000.c:2098
#, gcc-internal-format
msgid "unknown -m%s= option specified: '%s'"
msgstr ""
-#: config/rs6000/rs6000.c:2207
+#: config/rs6000/rs6000.c:2326
#, gcc-internal-format
msgid "not configured for ABI: '%s'"
msgstr ""
-#: config/rs6000/rs6000.c:2220
+#: config/rs6000/rs6000.c:2339
#, gcc-internal-format
msgid "Using darwin64 ABI"
msgstr ""
-#: config/rs6000/rs6000.c:2225
+#: config/rs6000/rs6000.c:2344
#, gcc-internal-format
msgid "Using old darwin ABI"
msgstr ""
-#: config/rs6000/rs6000.c:2232
+#: config/rs6000/rs6000.c:2351
#, gcc-internal-format
msgid "Using IBM extended precision long double"
msgstr ""
-#: config/rs6000/rs6000.c:2238
+#: config/rs6000/rs6000.c:2357
#, gcc-internal-format
msgid "Using IEEE extended precision long double"
msgstr ""
-#: config/rs6000/rs6000.c:2243
+#: config/rs6000/rs6000.c:2362
#, gcc-internal-format
msgid "unknown ABI specified: '%s'"
msgstr ""
-#: config/rs6000/rs6000.c:2270
+#: config/rs6000/rs6000.c:2389
#, gcc-internal-format
msgid "invalid option for -mfloat-gprs: '%s'"
msgstr ""
-#: config/rs6000/rs6000.c:2280
+#: config/rs6000/rs6000.c:2399
#, gcc-internal-format
msgid "Unknown switch -mlong-double-%s"
msgstr ""
-#: config/rs6000/rs6000.c:2301
+#: config/rs6000/rs6000.c:2420
#, gcc-internal-format
msgid ""
"-malign-power is not supported for 64-bit Darwin; it is incompatible with "
"the installed C and C++ libraries"
msgstr ""
-#: config/rs6000/rs6000.c:2309
+#: config/rs6000/rs6000.c:2428
#, gcc-internal-format
msgid "unknown -malign-XXXXX option specified: '%s'"
msgstr ""
-#: config/rs6000/rs6000.c:5076
+#: config/rs6000/rs6000.c:5226
#, gcc-internal-format
msgid ""
"GCC vector returned by reference: non-standard ABI extension with no "
"compatibility guarantee"
msgstr ""
-#: config/rs6000/rs6000.c:5149
+#: config/rs6000/rs6000.c:5299
#, gcc-internal-format
msgid ""
"cannot return value in vector register because altivec instructions are "
"disabled, use -maltivec to enable them"
msgstr ""
-#: config/rs6000/rs6000.c:5407
+#: config/rs6000/rs6000.c:5557
#, gcc-internal-format
msgid ""
"cannot pass argument in vector register because altivec instructions are "
"disabled, use -maltivec to enable them"
msgstr ""
-#: config/rs6000/rs6000.c:6311
+#: config/rs6000/rs6000.c:6456
#, gcc-internal-format
msgid ""
"GCC vector passed by reference: non-standard ABI extension with no "
"compatibility guarantee"
msgstr ""
-#: config/rs6000/rs6000.c:7557
+#: config/rs6000/rs6000.c:7709
#, gcc-internal-format
msgid "argument 1 must be a 5-bit signed literal"
msgstr ""
-#: config/rs6000/rs6000.c:7660 config/rs6000/rs6000.c:8571
+#: config/rs6000/rs6000.c:7812 config/rs6000/rs6000.c:8723
#, gcc-internal-format
msgid "argument 2 must be a 5-bit unsigned literal"
msgstr ""
-#: config/rs6000/rs6000.c:7700
+#: config/rs6000/rs6000.c:7852
#, gcc-internal-format
msgid "argument 1 of __builtin_altivec_predicate must be a constant"
msgstr ""
-#: config/rs6000/rs6000.c:7753
+#: config/rs6000/rs6000.c:7905
#, gcc-internal-format
msgid "argument 1 of __builtin_altivec_predicate is out of range"
msgstr ""
-#: config/rs6000/rs6000.c:8002
+#: config/rs6000/rs6000.c:8154
#, gcc-internal-format
msgid "argument 3 must be a 4-bit unsigned literal"
msgstr ""
-#: config/rs6000/rs6000.c:8174
+#: config/rs6000/rs6000.c:8326
#, gcc-internal-format
msgid "argument to %qs must be a 2-bit unsigned literal"
msgstr ""
-#: config/rs6000/rs6000.c:8316
+#: config/rs6000/rs6000.c:8468
#, gcc-internal-format
msgid "unresolved overload for Altivec builtin %qF"
msgstr ""
-#: config/rs6000/rs6000.c:8398
+#: config/rs6000/rs6000.c:8550
#, gcc-internal-format
msgid "argument to dss must be a 2-bit unsigned literal"
msgstr ""
-#: config/rs6000/rs6000.c:8691
+#: config/rs6000/rs6000.c:8843
#, gcc-internal-format
msgid "argument 1 of __builtin_paired_predicate must be a constant"
msgstr ""
-#: config/rs6000/rs6000.c:8738
+#: config/rs6000/rs6000.c:8890
#, gcc-internal-format
msgid "argument 1 of __builtin_paired_predicate is out of range"
msgstr ""
-#: config/rs6000/rs6000.c:8763
+#: config/rs6000/rs6000.c:8915
#, gcc-internal-format
msgid "argument 1 of __builtin_spe_predicate must be a constant"
msgstr ""
-#: config/rs6000/rs6000.c:8835
+#: config/rs6000/rs6000.c:8987
#, gcc-internal-format
msgid "argument 1 of __builtin_spe_predicate is out of range"
msgstr ""
-#: config/rs6000/rs6000.c:15174
+#: config/rs6000/rs6000.c:15347
#, gcc-internal-format
msgid "stack frame too large"
msgstr ""
-#: config/rs6000/rs6000.c:17796
+#: config/rs6000/rs6000.c:18361
#, gcc-internal-format
msgid "no profiling of 64-bit code for this ABI"
msgstr ""
-#: config/rs6000/rs6000.c:19672
+#: config/rs6000/rs6000.c:20240
#, gcc-internal-format
msgid "use of %<long%> in AltiVec types is invalid for 64-bit code"
msgstr ""
-#: config/rs6000/rs6000.c:19674
+#: config/rs6000/rs6000.c:20242
#, gcc-internal-format
msgid "use of %<long%> in AltiVec types is deprecated; use %<int%>"
msgstr ""
-#: config/rs6000/rs6000.c:19678
+#: config/rs6000/rs6000.c:20246
#, gcc-internal-format
msgid "use of %<long long%> in AltiVec types is invalid"
msgstr ""
-#: config/rs6000/rs6000.c:19680
+#: config/rs6000/rs6000.c:20248
#, gcc-internal-format
msgid "use of %<double%> in AltiVec types is invalid"
msgstr ""
-#: config/rs6000/rs6000.c:19682
+#: config/rs6000/rs6000.c:20250
#, gcc-internal-format
msgid "use of %<long double%> in AltiVec types is invalid"
msgstr ""
-#: config/rs6000/rs6000.c:19684
+#: config/rs6000/rs6000.c:20252
#, gcc-internal-format
msgid "use of boolean types in AltiVec types is invalid"
msgstr ""
-#: config/rs6000/rs6000.c:19686
+#: config/rs6000/rs6000.c:20254
#, gcc-internal-format
msgid "use of %<complex%> in AltiVec types is invalid"
msgstr ""
-#: config/rs6000/rs6000.c:19688
+#: config/rs6000/rs6000.c:20256
#, gcc-internal-format
msgid "use of decimal floating point types in AltiVec types is invalid"
msgstr ""
@@ -26729,22 +26869,22 @@ msgid ""
"-maix64 required: 64-bit computation with 32-bit addressing not yet supported"
msgstr ""
-#: config/rs6000/e500.h:41
+#: config/rs6000/e500.h:39
#, gcc-internal-format
msgid "AltiVec and E500 instructions cannot coexist"
msgstr ""
-#: config/rs6000/e500.h:43
+#: config/rs6000/e500.h:41
#, gcc-internal-format
msgid "64-bit E500 not supported"
msgstr ""
-#: config/rs6000/e500.h:45
+#: config/rs6000/e500.h:43
#, gcc-internal-format
msgid "E500 and FPRs not supported"
msgstr ""
-#: config/rs6000/eabispe.h:43 config/rs6000/linuxspe.h:42
+#: config/rs6000/eabispe.h:41 config/rs6000/linuxspe.h:40
#, gcc-internal-format
msgid "-m64 not supported in this configuration"
msgstr ""
@@ -26766,7 +26906,7 @@ msgstr ""
#. Number of bytes into the frame return addresses can be found. See
#. rs6000_stack_info in rs6000.c for more information on how the different
#. abi's store the return address.
-#: config/rs6000/rs6000.h:1569
+#: config/rs6000/rs6000.h:1621
#, gcc-internal-format
msgid "RETURN_ADDRESS_OFFSET not supported"
msgstr ""
@@ -26834,126 +26974,141 @@ msgstr ""
msgid "-m%s not supported in this configuration"
msgstr ""
-#: config/s390/s390.c:1395
+#: config/s390/s390.c:1534
#, gcc-internal-format
msgid "stack guard value must be an exact power of 2"
msgstr ""
-#: config/s390/s390.c:1402
+#: config/s390/s390.c:1541
#, gcc-internal-format
msgid "stack size must be an exact power of 2"
msgstr ""
-#: config/s390/s390.c:1447
+#: config/s390/s390.c:1586
#, gcc-internal-format
msgid "z/Architecture mode not supported on %s"
msgstr ""
-#: config/s390/s390.c:1449
+#: config/s390/s390.c:1588
#, gcc-internal-format
msgid "64-bit ABI not supported in ESA/390 mode"
msgstr ""
-#: config/s390/s390.c:1456
+#: config/s390/s390.c:1595
#, gcc-internal-format
msgid "Hardware decimal floating point instructions not available on %s"
msgstr ""
-#: config/s390/s390.c:1459
+#: config/s390/s390.c:1598
#, gcc-internal-format
msgid ""
"Hardware decimal floating point instructions not available in ESA/390 mode"
msgstr ""
-#: config/s390/s390.c:1469
+#: config/s390/s390.c:1608
#, gcc-internal-format
msgid "-mhard-dfp can't be used in conjunction with -msoft-float"
msgstr ""
-#: config/s390/s390.c:1483
+#: config/s390/s390.c:1630
#, gcc-internal-format
msgid ""
"-mbackchain -mpacked-stack -mhard-float are not supported in combination"
msgstr ""
-#: config/s390/s390.c:1489
+#: config/s390/s390.c:1636
#, gcc-internal-format
msgid "stack size must be greater than the stack guard value"
msgstr ""
-#: config/s390/s390.c:1491
+#: config/s390/s390.c:1638
#, gcc-internal-format
msgid "stack size must not be greater than 64k"
msgstr ""
-#: config/s390/s390.c:1494
+#: config/s390/s390.c:1641
#, gcc-internal-format
msgid "-mstack-guard implies use of -mstack-size"
msgstr ""
-#: config/s390/s390.c:6639
+#: config/s390/s390.c:7061
#, gcc-internal-format
msgid "total size of local variables exceeds architecture limit"
msgstr ""
-#: config/s390/s390.c:7309
+#: config/s390/s390.c:7731
#, gcc-internal-format
msgid "frame size of function %qs is "
msgstr ""
-#: config/s390/s390.c:7339
+#: config/s390/s390.c:7761
#, gcc-internal-format
msgid "frame size of %qs is "
msgstr ""
-#: config/s390/s390.c:7343
+#: config/s390/s390.c:7765
#, gcc-internal-format
msgid "%qs uses dynamic stack allocation"
msgstr ""
-#: config/score/score3.c:654 config/score/score7.c:653
+#: config/score/score3.c:655 config/score/score7.c:654
#, gcc-internal-format
msgid "-fPIC and -G are incompatible"
msgstr ""
-#: config/sh/sh.c:6897
+#: config/sh/sh.c:7006
#, gcc-internal-format
msgid "__builtin_saveregs not supported by this subtarget"
msgstr ""
-#: config/sh/sh.c:7907
+#: config/sh/sh.c:8073
#, gcc-internal-format
msgid "%qs attribute only applies to interrupt functions"
msgstr ""
-#: config/sh/sh.c:7993
+#: config/sh/sh.c:8156
+#, gcc-internal-format
+msgid "%qs attribute is supported only for SH2A"
+msgstr ""
+
+#: config/sh/sh.c:8186
#, gcc-internal-format
msgid "attribute interrupt_handler is not compatible with -m5-compact"
msgstr ""
+#: config/sh/sh.c:8203
+#, gcc-internal-format
+msgid "%qs attribute only applies to SH2A"
+msgstr ""
+
+#: config/sh/sh.c:8225
+#, gcc-internal-format
+msgid "`%s' attribute argument should be between 0 to 255"
+msgstr ""
+
#. The argument must be a constant string.
-#: config/sh/sh.c:8015
+#: config/sh/sh.c:8298
#, gcc-internal-format
msgid "%qs attribute argument not a string constant"
msgstr ""
#. The argument must be a constant integer.
-#: config/sh/sh.c:8040
+#: config/sh/sh.c:8323
#, gcc-internal-format
msgid "%qs attribute argument not an integer constant"
msgstr ""
-#: config/sh/sh.c:10084
+#: config/sh/sh.c:10411
#, gcc-internal-format
msgid "r0 needs to be available as a call-clobbered register"
msgstr ""
-#: config/sh/sh.c:10105
+#: config/sh/sh.c:10432
#, gcc-internal-format
msgid "Need a second call-clobbered general purpose register"
msgstr ""
-#: config/sh/sh.c:10113
+#: config/sh/sh.c:10440
#, gcc-internal-format
msgid "Need a call-clobbered target register"
msgstr ""
@@ -26986,7 +27141,7 @@ msgstr ""
msgid "%s %q+D %s after being referenced with dllimport linkage"
msgstr ""
-#: config/sh/symbian.c:891 cp/tree.c:2757
+#: config/sh/symbian.c:891 cp/tree.c:2796
#, gcc-internal-format
msgid "lang_* check: failed in %s, at %s:%d"
msgstr ""
@@ -27000,12 +27155,6 @@ msgstr ""
#. There are no delay slots on SHmedia.
#. Relaxation isn't yet supported for SHmedia
#. After reload, if conversion does little good but can cause ICEs: - find_if_block doesn't do anything for SH because we don't have conditional execution patterns. (We use conditional move patterns, which are handled differently, and only before reload). - find_cond_trap doesn't do anything for the SH because we #. don't have conditional traps. - find_if_case_1 uses redirect_edge_and_branch_force in the only path that does an optimization, and this causes an ICE when branch targets are in registers. - find_if_case_2 doesn't do anything for the SHmedia after reload except when it can redirect a tablejump - and that's rather rare.
-#. -fprofile-arcs needs a working libgcov . In unified tree configurations with newlib, this requires to configure with --with-newlib --with-headers. But there is no way to check here we have a working libgcov, so just assume that we have.
-#: config/sh/sh.h:631
-#, gcc-internal-format
-msgid "profiling is still experimental for this target"
-msgstr ""
-
#. Only the sh64-elf assembler fully supports .quad properly.
#. Pick one that makes most sense for the target in general. It is not much good to use different functions depending on -Os, since then we'll end up with two different functions when some of the code is compiled for size, and some for speed.
#. SH4 tends to emphasize speed.
@@ -27016,9 +27165,9 @@ msgstr ""
#. User supplied - leave it alone.
#. The debugging information is sufficient, but gdb doesn't implement this yet
#. Never run scheduling before reload, since that can break global alloc, and generates slower code anyway due to the pressure on R0.
-#. Enable sched1 for SH4; ready queue will be reordered by the target hooks when pressure is high. We can not do this for SH3 and lower as they give spill failures for R0.
+#. Enable sched1 for SH4; ready queue will be reordered by the target hooks when pressure is high. We can not do this for PIC, SH3 and lower as they give spill failures for R0.
#. ??? Current exception handling places basic block boundaries after call_insns. It causes the high pressure on R0 and gives spill failures for R0 in reload. See PR 22553 and the thread on gcc-patches <http://gcc.gnu.org/ml/gcc-patches/2005-10/msg00816.html>.
-#: config/sh/sh.h:730
+#: config/sh/sh.h:726
#, gcc-internal-format
msgid "ignoring -fschedule-insns because of exception handling bug"
msgstr ""
@@ -27039,77 +27188,82 @@ msgstr ""
msgid "-mlong-double-64 not allowed with -m64"
msgstr ""
+#: config/sparc/sparc.c:728
+#, gcc-internal-format
+msgid "bad value (%s) for -mcmodel= switch"
+msgstr ""
+
#: config/sparc/sparc.c:733
#, gcc-internal-format
msgid "-mcmodel= is not supported on 32 bit systems"
msgstr ""
-#: config/spu/spu-c.c:77
+#: config/spu/spu-c.c:135
#, gcc-internal-format
msgid "insufficient arguments to overloaded function %s"
msgstr ""
-#: config/spu/spu-c.c:112
+#: config/spu/spu-c.c:170
#, gcc-internal-format
msgid "too many arguments to overloaded function %s"
msgstr ""
-#: config/spu/spu-c.c:124
+#: config/spu/spu-c.c:182
#, gcc-internal-format
msgid "parameter list does not match a valid signature for %s()"
msgstr ""
-#: config/spu/spu.c:341 config/spu/spu.c:352
+#: config/spu/spu.c:342 config/spu/spu.c:353
#, gcc-internal-format
msgid "Unknown architecture '%s'"
msgstr ""
-#: config/spu/spu.c:3023
+#: config/spu/spu.c:3036
#, gcc-internal-format
msgid "`%s' attribute ignored"
msgstr ""
-#: config/spu/spu.c:5207
+#: config/spu/spu.c:5215
#, gcc-internal-format
msgid "%s expects an integer literal in the range [%d, %d]."
msgstr ""
-#: config/spu/spu.c:5227
+#: config/spu/spu.c:5235
#, gcc-internal-format
msgid "%s expects an integer literal in the range [%d, %d]. ("
msgstr ""
-#: config/spu/spu.c:5257
+#: config/spu/spu.c:5265
#, gcc-internal-format
msgid "%d least significant bits of %s are ignored."
msgstr ""
-#: config/stormy16/stormy16.c:1080
+#: config/stormy16/stormy16.c:1085
#, gcc-internal-format
msgid "local variable memory requirements exceed capacity"
msgstr ""
-#: config/stormy16/stormy16.c:1246
+#: config/stormy16/stormy16.c:1251
#, gcc-internal-format
msgid "function_profiler support"
msgstr ""
-#: config/stormy16/stormy16.c:1335
+#: config/stormy16/stormy16.c:1340
#, gcc-internal-format
msgid "cannot use va_start in interrupt function"
msgstr ""
-#: config/stormy16/stormy16.c:1879
+#: config/stormy16/stormy16.c:1881
#, gcc-internal-format
msgid "switch statement of size %lu entries too large"
msgstr ""
-#: config/stormy16/stormy16.c:2247
+#: config/stormy16/stormy16.c:2249
#, gcc-internal-format
msgid "%<__BELOW100__%> attribute only applies to variables"
msgstr ""
-#: config/stormy16/stormy16.c:2254
+#: config/stormy16/stormy16.c:2256
#, gcc-internal-format
msgid "__BELOW100__ attribute not allowed with auto storage class"
msgstr ""
@@ -27234,250 +27388,246 @@ msgstr ""
msgid "too much stack space to prepare: %d"
msgstr ""
-#: config/xtensa/xtensa.c:1865
+#: config/xtensa/xtensa.c:1886
#, gcc-internal-format
msgid "boolean registers required for the floating-point option"
msgstr ""
-#: config/xtensa/xtensa.c:1900
+#: config/xtensa/xtensa.c:1921
#, gcc-internal-format
msgid "-f%s is not supported with CONST16 instructions"
msgstr ""
-#: config/xtensa/xtensa.c:1905
+#: config/xtensa/xtensa.c:1926
#, gcc-internal-format
msgid "PIC is required but not supported with CONST16 instructions"
msgstr ""
-#: config/xtensa/xtensa.c:2770 config/xtensa/xtensa.c:2790
+#: config/xtensa/xtensa.c:2798 config/xtensa/xtensa.c:2818
#, gcc-internal-format
msgid "bad builtin code"
msgstr ""
-#: config/xtensa/xtensa.c:2898
+#: config/xtensa/xtensa.c:2927
#, gcc-internal-format
msgid "only uninitialized variables can be placed in a .bss section"
msgstr ""
-#: ada/misc.c:260
-#, gcc-internal-format
-msgid "missing argument to \"-%s\""
-msgstr ""
-
-#: ada/misc.c:310
-#, gcc-internal-format
-msgid "%<-gnat%> misspelled as %<-gant%>"
-msgstr ""
-
-#: cp/call.c:2448
+#: cp/call.c:2550
#, gcc-internal-format
msgid "%s %D(%T, %T, %T) <built-in>"
msgstr ""
-#: cp/call.c:2453
+#: cp/call.c:2555
#, gcc-internal-format
msgid "%s %D(%T, %T) <built-in>"
msgstr ""
-#: cp/call.c:2457
+#: cp/call.c:2559
#, gcc-internal-format
msgid "%s %D(%T) <built-in>"
msgstr ""
-#: cp/call.c:2461
+#: cp/call.c:2563
#, gcc-internal-format
msgid "%s %T <conversion>"
msgstr ""
-#: cp/call.c:2463
+#: cp/call.c:2565
#, gcc-internal-format
msgid "%s %+#D <near match>"
msgstr ""
-#: cp/call.c:2465 cp/pt.c:1403
+#: cp/call.c:2567 cp/pt.c:1404
#, gcc-internal-format
msgid "%s %+#D"
msgstr ""
-#: cp/call.c:2706
+#: cp/call.c:2849
#, gcc-internal-format
msgid "conversion from %qT to %qT is ambiguous"
msgstr ""
-#: cp/call.c:2859 cp/call.c:2877 cp/call.c:2940
+#: cp/call.c:3004 cp/call.c:3024 cp/call.c:3088
#, gcc-internal-format
msgid "no matching function for call to %<%D(%A)%>"
msgstr ""
-#: cp/call.c:2880 cp/call.c:2943
+#: cp/call.c:3027 cp/call.c:3091
#, gcc-internal-format
msgid "call of overloaded %<%D(%A)%> is ambiguous"
msgstr ""
#. It's no good looking for an overloaded operator() on a
#. pointer-to-member-function.
-#: cp/call.c:3015
+#: cp/call.c:3164
#, gcc-internal-format
msgid ""
"pointer-to-member function %E cannot be called without an object; consider "
"using .* or ->*"
msgstr ""
-#: cp/call.c:3089
+#: cp/call.c:3240
#, gcc-internal-format
msgid "no match for call to %<(%T) (%A)%>"
msgstr ""
-#: cp/call.c:3098
+#: cp/call.c:3252
#, gcc-internal-format
msgid "call of %<(%T) (%A)%> is ambiguous"
msgstr ""
-#: cp/call.c:3136
+#: cp/call.c:3293
#, gcc-internal-format
msgid "%s for ternary %<operator?:%> in %<%E ? %E : %E%>"
msgstr ""
-#: cp/call.c:3142
+#: cp/call.c:3299
#, gcc-internal-format
msgid "%s for %<operator%s%> in %<%E%s%>"
msgstr ""
-#: cp/call.c:3146
+#: cp/call.c:3303
#, gcc-internal-format
msgid "%s for %<operator[]%> in %<%E[%E]%>"
msgstr ""
-#: cp/call.c:3151
+#: cp/call.c:3308
#, gcc-internal-format
msgid "%s for %qs in %<%s %E%>"
msgstr ""
-#: cp/call.c:3156
+#: cp/call.c:3313
#, gcc-internal-format
msgid "%s for %<operator%s%> in %<%E %s %E%>"
msgstr ""
-#: cp/call.c:3159
+#: cp/call.c:3316
#, gcc-internal-format
msgid "%s for %<operator%s%> in %<%s%E%>"
msgstr ""
-#: cp/call.c:3251
+#: cp/call.c:3410
#, gcc-internal-format
msgid "ISO C++ forbids omitting the middle term of a ?: expression"
msgstr ""
-#: cp/call.c:3329
+#: cp/call.c:3490
#, gcc-internal-format
msgid ""
"second operand to the conditional operator is of type %<void%>, but the "
"third operand is neither a throw-expression nor of type %<void%>"
msgstr ""
-#: cp/call.c:3334
+#: cp/call.c:3495
#, gcc-internal-format
msgid ""
"third operand to the conditional operator is of type %<void%>, but the "
"second operand is neither a throw-expression nor of type %<void%>"
msgstr ""
-#: cp/call.c:3375 cp/call.c:3595
+#: cp/call.c:3537 cp/call.c:3773
#, gcc-internal-format
msgid "operands to ?: have different types %qT and %qT"
msgstr ""
-#: cp/call.c:3549
+#: cp/call.c:3720
#, gcc-internal-format
msgid "enumeral mismatch in conditional expression: %qT vs %qT"
msgstr ""
-#: cp/call.c:3556
+#: cp/call.c:3731
#, gcc-internal-format
msgid "enumeral and non-enumeral type in conditional expression"
msgstr ""
-#: cp/call.c:3860
+#: cp/call.c:4043
#, gcc-internal-format
msgid "no %<%D(int)%> declared for postfix %qs, trying prefix operator instead"
msgstr ""
-#: cp/call.c:3936
+#: cp/call.c:4121
#, gcc-internal-format
msgid "comparison between %q#T and %q#T"
msgstr ""
-#: cp/call.c:4218
+#: cp/call.c:4406
#, gcc-internal-format
-msgid "no corresponding deallocation function for `%D'"
+msgid "no corresponding deallocation function for %qD"
msgstr ""
-#: cp/call.c:4223
+#: cp/call.c:4411
#, gcc-internal-format
msgid "no suitable %<operator %s%> for %qT"
msgstr ""
-#: cp/call.c:4241
+#: cp/call.c:4429
#, gcc-internal-format
msgid "%q+#D is private"
msgstr ""
-#: cp/call.c:4243
+#: cp/call.c:4431
#, gcc-internal-format
msgid "%q+#D is protected"
msgstr ""
-#: cp/call.c:4245
+#: cp/call.c:4433
#, gcc-internal-format
msgid "%q+#D is inaccessible"
msgstr ""
-#: cp/call.c:4246
+#: cp/call.c:4434
#, gcc-internal-format
msgid "within this context"
msgstr ""
-#: cp/call.c:4292
+#: cp/call.c:4480
#, gcc-internal-format
msgid "passing NULL to non-pointer argument %P of %qD"
msgstr ""
-#: cp/call.c:4295
+#: cp/call.c:4483
#, gcc-internal-format
msgid "converting to non-pointer type %qT from NULL"
msgstr ""
-#: cp/call.c:4301
+#: cp/call.c:4489
#, gcc-internal-format
msgid "converting %<false%> to pointer type for argument %P of %qD"
msgstr ""
-#: cp/call.c:4345 cp/cvt.c:217
+#: cp/call.c:4540 cp/cvt.c:217
#, gcc-internal-format
msgid "invalid conversion from %qT to %qT"
msgstr ""
-#: cp/call.c:4347
+#: cp/call.c:4542
#, gcc-internal-format
msgid " initializing argument %P of %qD"
msgstr ""
-#: cp/call.c:4487
+#: cp/call.c:4566
+#, gcc-internal-format
+msgid ""
+"converting to %qT from initializer list would use explicit constructor %qD"
+msgstr ""
+
+#: cp/call.c:4723
#, gcc-internal-format
msgid "cannot bind bitfield %qE to %qT"
msgstr ""
-#: cp/call.c:4490 cp/call.c:4506
+#: cp/call.c:4726 cp/call.c:4744
#, gcc-internal-format
msgid "cannot bind packed field %qE to %qT"
msgstr ""
-#: cp/call.c:4493
+#: cp/call.c:4729
#, gcc-internal-format
msgid "cannot bind rvalue %qE to %qT"
msgstr ""
-#: cp/call.c:4607
+#: cp/call.c:4853
#, gcc-internal-format
msgid ""
"cannot pass objects of non-POD type %q#T through %<...%>; call will abort at "
@@ -27485,108 +27635,108 @@ msgid ""
msgstr ""
#. Undefined behavior [expr.call] 5.2.2/7.
-#: cp/call.c:4635
+#: cp/call.c:4881
#, gcc-internal-format
msgid ""
"cannot receive objects of non-POD type %q#T through %<...%>; call will abort "
"at runtime"
msgstr ""
-#: cp/call.c:4683
+#: cp/call.c:4929
#, gcc-internal-format
msgid "the default argument for parameter %d of %qD has not yet been parsed"
msgstr ""
-#: cp/call.c:4693
+#: cp/call.c:4939
#, gcc-internal-format
msgid "recursive evaluation of default argument for %q#D"
msgstr ""
-#: cp/call.c:4798
+#: cp/call.c:5046
#, gcc-internal-format
msgid "argument of function call might be a candidate for a format attribute"
msgstr ""
-#: cp/call.c:4946
+#: cp/call.c:5196
#, gcc-internal-format
msgid "passing %qT as %<this%> argument of %q#D discards qualifiers"
msgstr ""
-#: cp/call.c:4965
+#: cp/call.c:5218
#, gcc-internal-format
msgid "%qT is not an accessible base of %qT"
msgstr ""
-#: cp/call.c:5225
+#: cp/call.c:5490
#, gcc-internal-format
msgid "could not find class$ field in java interface type %qT"
msgstr ""
-#: cp/call.c:5466
+#: cp/call.c:5733
#, gcc-internal-format
msgid "call to non-function %qD"
msgstr ""
-#: cp/call.c:5591
+#: cp/call.c:5872
#, gcc-internal-format
msgid "no matching function for call to %<%T::%s(%A)%#V%>"
msgstr ""
-#: cp/call.c:5609
+#: cp/call.c:5893
#, gcc-internal-format
msgid "call of overloaded %<%s(%A)%> is ambiguous"
msgstr ""
-#: cp/call.c:5635
+#: cp/call.c:5922
#, gcc-internal-format
msgid "cannot call member function %qD without object"
msgstr ""
-#: cp/call.c:6294
+#: cp/call.c:6593
#, gcc-internal-format
msgid "passing %qT chooses %qT over %qT"
msgstr ""
-#: cp/call.c:6296 cp/name-lookup.c:4322 cp/name-lookup.c:4757
+#: cp/call.c:6595 cp/name-lookup.c:4413 cp/name-lookup.c:4857
#, gcc-internal-format
msgid " in call to %qD"
msgstr ""
-#: cp/call.c:6353
+#: cp/call.c:6652
#, gcc-internal-format
msgid "choosing %qD over %qD"
msgstr ""
-#: cp/call.c:6354
+#: cp/call.c:6653
#, gcc-internal-format
msgid " for conversion from %qT to %qT"
msgstr ""
-#: cp/call.c:6356
+#: cp/call.c:6656
#, gcc-internal-format
msgid " because conversion sequence for the argument is better"
msgstr ""
-#: cp/call.c:6470
+#: cp/call.c:6772
#, gcc-internal-format
msgid ""
"ISO C++ says that these are ambiguous, even though the worst conversion for "
"the first is better than the worst conversion for the second:"
msgstr ""
-#: cp/call.c:6614
+#: cp/call.c:6916
#, gcc-internal-format
msgid "could not convert %qE to %qT"
msgstr ""
-#: cp/call.c:6748
+#: cp/call.c:7122
#, gcc-internal-format
msgid ""
"invalid initialization of non-const reference of type %qT from a temporary "
"of type %qT"
msgstr ""
-#: cp/call.c:6752
+#: cp/call.c:7126
#, gcc-internal-format
msgid ""
"invalid initialization of reference of type %qT from expression of type %qT"
@@ -27597,357 +27747,357 @@ msgstr ""
msgid "cannot convert from base %qT to derived type %qT via virtual base %qT"
msgstr ""
-#: cp/class.c:971
+#: cp/class.c:975
#, gcc-internal-format
msgid "Java class %qT cannot have a destructor"
msgstr ""
-#: cp/class.c:973
+#: cp/class.c:977
#, gcc-internal-format
msgid "Java class %qT cannot have an implicit non-trivial destructor"
msgstr ""
-#: cp/class.c:1074
+#: cp/class.c:1078
#, gcc-internal-format
msgid "repeated using declaration %q+D"
msgstr ""
-#: cp/class.c:1076
+#: cp/class.c:1080
#, gcc-internal-format
msgid "using declaration %q+D conflicts with a previous using declaration"
msgstr ""
-#: cp/class.c:1081
+#: cp/class.c:1085
#, gcc-internal-format
msgid "%q+#D cannot be overloaded"
msgstr ""
-#: cp/class.c:1082
+#: cp/class.c:1086
#, gcc-internal-format
msgid "with %q+#D"
msgstr ""
-#: cp/class.c:1149
+#: cp/class.c:1153
#, gcc-internal-format
msgid "conflicting access specifications for method %q+D, ignored"
msgstr ""
-#: cp/class.c:1152
+#: cp/class.c:1156
#, gcc-internal-format
msgid "conflicting access specifications for field %qE, ignored"
msgstr ""
-#: cp/class.c:1213 cp/class.c:1221
+#: cp/class.c:1217 cp/class.c:1225
#, gcc-internal-format
msgid "%q+D invalid in %q#T"
msgstr ""
-#: cp/class.c:1214
+#: cp/class.c:1218
#, gcc-internal-format
msgid " because of local method %q+#D with same name"
msgstr ""
-#: cp/class.c:1222
+#: cp/class.c:1226
#, gcc-internal-format
msgid " because of local member %q+#D with same name"
msgstr ""
-#: cp/class.c:1265
+#: cp/class.c:1269
#, gcc-internal-format
msgid "base class %q#T has a non-virtual destructor"
msgstr ""
-#: cp/class.c:1582
+#: cp/class.c:1586
#, gcc-internal-format
msgid "all member functions in class %qT are private"
msgstr ""
-#: cp/class.c:1594
+#: cp/class.c:1598
#, gcc-internal-format
msgid "%q#T only defines a private destructor and has no friends"
msgstr ""
-#: cp/class.c:1638
+#: cp/class.c:1643
#, gcc-internal-format
msgid "%q#T only defines private constructors and has no friends"
msgstr ""
-#: cp/class.c:2031
+#: cp/class.c:2036
#, gcc-internal-format
msgid "no unique final overrider for %qD in %qT"
msgstr ""
#. Here we know it is a hider, and no overrider exists.
-#: cp/class.c:2451
+#: cp/class.c:2456
#, gcc-internal-format
msgid "%q+D was hidden"
msgstr ""
-#: cp/class.c:2452
+#: cp/class.c:2457
#, gcc-internal-format
msgid " by %q+D"
msgstr ""
-#: cp/class.c:2495 cp/decl2.c:1153
+#: cp/class.c:2500 cp/decl2.c:1263
#, gcc-internal-format
msgid "%q+#D invalid; an anonymous union can only have non-static data members"
msgstr ""
-#: cp/class.c:2498
+#: cp/class.c:2503
#, gcc-internal-format
msgid ""
"%q+#D invalid; an anonymous struct can only have non-static data members"
msgstr ""
-#: cp/class.c:2506 cp/decl2.c:1159
+#: cp/class.c:2511 cp/decl2.c:1269
#, gcc-internal-format
msgid "private member %q+#D in anonymous union"
msgstr ""
-#: cp/class.c:2508
+#: cp/class.c:2513
#, gcc-internal-format
msgid "private member %q+#D in anonymous struct"
msgstr ""
-#: cp/class.c:2513 cp/decl2.c:1161
+#: cp/class.c:2518 cp/decl2.c:1271
#, gcc-internal-format
msgid "protected member %q+#D in anonymous union"
msgstr ""
-#: cp/class.c:2515
+#: cp/class.c:2520
#, gcc-internal-format
msgid "protected member %q+#D in anonymous struct"
msgstr ""
-#: cp/class.c:2689
+#: cp/class.c:2699
#, gcc-internal-format
msgid "bit-field %q+#D with non-integral type"
msgstr ""
-#: cp/class.c:2702
+#: cp/class.c:2712
#, gcc-internal-format
msgid "bit-field %q+D width not an integer constant"
msgstr ""
-#: cp/class.c:2707
+#: cp/class.c:2717
#, gcc-internal-format
msgid "negative width in bit-field %q+D"
msgstr ""
-#: cp/class.c:2712
+#: cp/class.c:2722
#, gcc-internal-format
msgid "zero width for bit-field %q+D"
msgstr ""
-#: cp/class.c:2718
+#: cp/class.c:2728
#, gcc-internal-format
msgid "width of %q+D exceeds its type"
msgstr ""
-#: cp/class.c:2727
+#: cp/class.c:2737
#, gcc-internal-format
msgid "%q+D is too small to hold all values of %q#T"
msgstr ""
-#: cp/class.c:2784
+#: cp/class.c:2794
#, gcc-internal-format
msgid "member %q+#D with constructor not allowed in union"
msgstr ""
-#: cp/class.c:2787
+#: cp/class.c:2797
#, gcc-internal-format
msgid "member %q+#D with destructor not allowed in union"
msgstr ""
-#: cp/class.c:2789
+#: cp/class.c:2799
#, gcc-internal-format
msgid "member %q+#D with copy assignment operator not allowed in union"
msgstr ""
-#: cp/class.c:2813
+#: cp/class.c:2823
#, gcc-internal-format
msgid "multiple fields in union %qT initialized"
msgstr ""
-#: cp/class.c:2902
+#: cp/class.c:2912
#, gcc-internal-format
msgid "%q+D may not be static because it is a member of a union"
msgstr ""
-#: cp/class.c:2907
+#: cp/class.c:2917
#, gcc-internal-format
msgid "%q+D may not have reference type %qT because it is a member of a union"
msgstr ""
-#: cp/class.c:2918
+#: cp/class.c:2928
#, gcc-internal-format
msgid "field %q+D invalidly declared function type"
msgstr ""
-#: cp/class.c:2924
+#: cp/class.c:2934
#, gcc-internal-format
msgid "field %q+D invalidly declared method type"
msgstr ""
-#: cp/class.c:2956
-#, gcc-internal-format
-msgid "non-static reference %q+#D in class without a constructor"
-msgstr ""
-
-#: cp/class.c:2967
+#: cp/class.c:2972
#, gcc-internal-format
msgid "ignoring packed attribute because of unpacked non-POD field %q+#D"
msgstr ""
-#: cp/class.c:3034
-#, gcc-internal-format
-msgid "non-static const member %q+#D in class without a constructor"
-msgstr ""
-
-#: cp/class.c:3049
+#: cp/class.c:3051
#, gcc-internal-format
msgid "field %q+#D with same name as class"
msgstr ""
-#: cp/class.c:3080
+#: cp/class.c:3082
#, gcc-internal-format
msgid "%q#T has pointer data members"
msgstr ""
-#: cp/class.c:3085
+#: cp/class.c:3087
#, gcc-internal-format
msgid " but does not override %<%T(const %T&)%>"
msgstr ""
-#: cp/class.c:3087
+#: cp/class.c:3089
#, gcc-internal-format
msgid " or %<operator=(const %T&)%>"
msgstr ""
-#: cp/class.c:3091
+#: cp/class.c:3093
#, gcc-internal-format
msgid " but does not override %<operator=(const %T&)%>"
msgstr ""
-#: cp/class.c:3552
+#: cp/class.c:3554
#, gcc-internal-format
msgid ""
"offset of empty base %qT may not be ABI-compliant and maychange in a future "
"version of GCC"
msgstr ""
-#: cp/class.c:3677
+#: cp/class.c:3679
#, gcc-internal-format
msgid "class %qT will be considered nearly empty in a future version of GCC"
msgstr ""
-#: cp/class.c:3759
+#: cp/class.c:3761
#, gcc-internal-format
msgid "initializer specified for non-virtual method %q+D"
msgstr ""
-#: cp/class.c:4424
+#: cp/class.c:4328
+#, gcc-internal-format
+msgid "non-static reference %q+#D in class without a constructor"
+msgstr ""
+
+#: cp/class.c:4333
+#, gcc-internal-format
+msgid "non-static const member %q+#D in class without a constructor"
+msgstr ""
+
+#: cp/class.c:4588
#, gcc-internal-format
msgid ""
"offset of virtual base %qT is not ABI-compliant and may change in a future "
"version of GCC"
msgstr ""
-#: cp/class.c:4525
+#: cp/class.c:4689
#, gcc-internal-format
msgid "direct base %qT inaccessible in %qT due to ambiguity"
msgstr ""
-#: cp/class.c:4537
+#: cp/class.c:4701
#, gcc-internal-format
msgid "virtual base %qT inaccessible in %qT due to ambiguity"
msgstr ""
-#: cp/class.c:4716
+#: cp/class.c:4880
#, gcc-internal-format
msgid ""
"size assigned to %qT may not be ABI-compliant and may change in a future "
"version of GCC"
msgstr ""
-#: cp/class.c:4756
+#: cp/class.c:4920
#, gcc-internal-format
msgid ""
"the offset of %qD may not be ABI-compliant and may change in a future "
"version of GCC"
msgstr ""
-#: cp/class.c:4784
+#: cp/class.c:4948
#, gcc-internal-format
msgid ""
"offset of %q+D is not ABI-compliant and may change in a future version of GCC"
msgstr ""
-#: cp/class.c:4793
+#: cp/class.c:4957
#, gcc-internal-format
msgid ""
"%q+D contains empty classes which may cause base classes to be placed at "
"different locations in a future version of GCC"
msgstr ""
-#: cp/class.c:4880
+#: cp/class.c:5044
#, gcc-internal-format
msgid ""
"layout of classes derived from empty class %qT may change in a future "
"version of GCC"
msgstr ""
-#: cp/class.c:5026 cp/parser.c:14686
+#: cp/class.c:5190
#, gcc-internal-format
msgid "redefinition of %q#T"
msgstr ""
-#: cp/class.c:5182
+#: cp/class.c:5346
#, gcc-internal-format
msgid "%q#T has virtual functions and accessible non-virtual destructor"
msgstr ""
-#: cp/class.c:5284
+#: cp/class.c:5448
#, gcc-internal-format
msgid "trying to finish struct, but kicked out due to previous parse errors"
msgstr ""
-#: cp/class.c:5744
+#: cp/class.c:5907
#, gcc-internal-format
msgid "language string %<\"%E\"%> not recognized"
msgstr ""
-#: cp/class.c:5833
+#: cp/class.c:5996
#, gcc-internal-format
msgid "cannot resolve overloaded function %qD based on conversion to type %qT"
msgstr ""
-#: cp/class.c:5962
+#: cp/class.c:6125
#, gcc-internal-format
msgid "no matches converting function %qD to type %q#T"
msgstr ""
-#: cp/class.c:5985
+#: cp/class.c:6148
#, gcc-internal-format
msgid "converting overloaded function %qD to type %q#T is ambiguous"
msgstr ""
-#: cp/class.c:6011
+#: cp/class.c:6174
#, gcc-internal-format
msgid "assuming pointer to member %qD"
msgstr ""
-#: cp/class.c:6014
+#: cp/class.c:6177
#, gcc-internal-format
msgid "(a pointer to member can only be formed with %<&%E%>)"
msgstr ""
-#: cp/class.c:6070 cp/class.c:6104
+#: cp/class.c:6233 cp/class.c:6267
#, gcc-internal-format
msgid "not enough type information"
msgstr ""
-#: cp/class.c:6087
+#: cp/class.c:6250
#, gcc-internal-format
msgid "argument of type %qT does not match %qT"
msgstr ""
@@ -27957,26 +28107,31 @@ msgstr ""
#. 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.
-#: cp/class.c:6374 cp/decl.c:1200 cp/name-lookup.c:525
+#: cp/class.c:6537 cp/decl.c:1195 cp/name-lookup.c:526
#, gcc-internal-format
msgid "declaration of %q#D"
msgstr ""
-#: cp/class.c:6375
+#: cp/class.c:6538
#, gcc-internal-format
msgid "changes meaning of %qD from %q+#D"
msgstr ""
-#: cp/cp-gimplify.c:99
+#: cp/cp-gimplify.c:94
#, gcc-internal-format
msgid "continue statement not within loop or switch"
msgstr ""
-#: cp/cp-gimplify.c:371
+#: cp/cp-gimplify.c:409
#, gcc-internal-format
msgid "statement with no effect"
msgstr ""
+#: cp/cp-gimplify.c:1086
+#, gcc-internal-format
+msgid "%qE implicitly determined as %<firstprivate%> has reference type"
+msgstr ""
+
#: cp/cvt.c:90
#, gcc-internal-format
msgid "can't convert from incomplete type %qT to %qT"
@@ -27997,200 +28152,204 @@ msgstr ""
msgid "conversion from %qT to %qT discards qualifiers"
msgstr ""
-#: cp/cvt.c:470 cp/typeck.c:5254
+#: cp/cvt.c:470 cp/typeck.c:5326
#, gcc-internal-format
msgid "casting %qT to %qT does not dereference pointer"
msgstr ""
-#: cp/cvt.c:497
+#: cp/cvt.c:498
#, gcc-internal-format
msgid "cannot convert type %qT to type %qT"
msgstr ""
-#: cp/cvt.c:656
+#: cp/cvt.c:652
#, gcc-internal-format
msgid "conversion from %q#T to %q#T"
msgstr ""
-#: cp/cvt.c:668 cp/cvt.c:688
+#: cp/cvt.c:667
+#, gcc-internal-format
+msgid ""
+"the result of the conversion is unspecified because %qE is outside the range "
+"of type %qT"
+msgstr ""
+
+#: cp/cvt.c:678 cp/cvt.c:698
#, gcc-internal-format
msgid "%q#T used where a %qT was expected"
msgstr ""
-#: cp/cvt.c:703
+#: cp/cvt.c:713
#, gcc-internal-format
msgid "%q#T used where a floating point value was expected"
msgstr ""
-#: cp/cvt.c:750
+#: cp/cvt.c:763
#, gcc-internal-format
msgid "conversion from %qT to non-scalar type %qT requested"
msgstr ""
-#: cp/cvt.c:784
+#: cp/cvt.c:798
#, gcc-internal-format
msgid "pseudo-destructor is not called"
msgstr ""
-#: cp/cvt.c:844
+#: cp/cvt.c:860
#, gcc-internal-format
msgid "object of incomplete type %qT will not be accessed in %s"
msgstr ""
-#: cp/cvt.c:849
+#: cp/cvt.c:868
#, gcc-internal-format
msgid "object of type %qT will not be accessed in %s"
msgstr ""
-#: cp/cvt.c:865
+#: cp/cvt.c:885
#, gcc-internal-format
msgid "object %qE of incomplete type %qT will not be accessed in %s"
msgstr ""
-#. [over.over] enumerates the places where we can take the address
-#. of an overloaded function, and this is not one of them.
-#: cp/cvt.c:902
+#: cp/cvt.c:923
#, gcc-internal-format
msgid "%s cannot resolve address of overloaded function"
msgstr ""
-#. Only warn when there is no &.
-#: cp/cvt.c:909
+#: cp/cvt.c:933
#, gcc-internal-format
msgid "%s is a reference, not call, to function %qE"
msgstr ""
-#: cp/cvt.c:926
+#: cp/cvt.c:951
#, gcc-internal-format
msgid "%s has no effect"
msgstr ""
-#: cp/cvt.c:958
+#: cp/cvt.c:985
#, gcc-internal-format
msgid "value computed is not used"
msgstr ""
-#: cp/cvt.c:1068
+#: cp/cvt.c:1095
#, gcc-internal-format
msgid "converting NULL to non-pointer type"
msgstr ""
-#: cp/cvt.c:1174
+#: cp/cvt.c:1201
#, gcc-internal-format
msgid "ambiguous default type conversion from %qT"
msgstr ""
-#: cp/cvt.c:1176
+#: cp/cvt.c:1203
#, gcc-internal-format
msgid " candidate conversions include %qD and %qD"
msgstr ""
-#: cp/decl.c:1063
+#: cp/decl.c:1058
#, gcc-internal-format
msgid "%qD was declared %<extern%> and later %<static%>"
msgstr ""
-#: cp/decl.c:1064 cp/decl.c:1619 objc/objc-act.c:2931 objc/objc-act.c:7503
+#: cp/decl.c:1059 cp/decl.c:1606 objc/objc-act.c:2920 objc/objc-act.c:7490
#, gcc-internal-format
msgid "previous declaration of %q+D"
msgstr ""
-#: cp/decl.c:1097
+#: cp/decl.c:1092
#, gcc-internal-format
msgid "declaration of %qF throws different exceptions"
msgstr ""
-#: cp/decl.c:1098
+#: cp/decl.c:1093
#, gcc-internal-format
msgid "from previous declaration %q+F"
msgstr ""
-#: cp/decl.c:1154
+#: cp/decl.c:1149
#, gcc-internal-format
msgid "function %q+D redeclared as inline"
msgstr ""
-#: cp/decl.c:1156
+#: cp/decl.c:1151
#, gcc-internal-format
msgid "previous declaration of %q+D with attribute noinline"
msgstr ""
-#: cp/decl.c:1163
+#: cp/decl.c:1158
#, gcc-internal-format
msgid "function %q+D redeclared with attribute noinline"
msgstr ""
-#: cp/decl.c:1165
+#: cp/decl.c:1160
#, gcc-internal-format
msgid "previous declaration of %q+D was inline"
msgstr ""
-#: cp/decl.c:1187 cp/decl.c:1260
+#: cp/decl.c:1182 cp/decl.c:1255
#, gcc-internal-format
msgid "shadowing %s function %q#D"
msgstr ""
-#: cp/decl.c:1196
+#: cp/decl.c:1191
#, gcc-internal-format
msgid "library function %q#D redeclared as non-function %q#D"
msgstr ""
-#: cp/decl.c:1201
+#: cp/decl.c:1196
#, gcc-internal-format
msgid "conflicts with built-in declaration %q#D"
msgstr ""
-#: cp/decl.c:1255 cp/decl.c:1381 cp/decl.c:1397
+#: cp/decl.c:1250 cp/decl.c:1376 cp/decl.c:1392
#, gcc-internal-format
msgid "new declaration %q#D"
msgstr ""
-#: cp/decl.c:1256
+#: cp/decl.c:1251
#, gcc-internal-format
msgid "ambiguates built-in declaration %q#D"
msgstr ""
-#: cp/decl.c:1345
+#: cp/decl.c:1340
#, gcc-internal-format
msgid "%q#D redeclared as different kind of symbol"
msgstr ""
-#: cp/decl.c:1348
+#: cp/decl.c:1343
#, gcc-internal-format
msgid "previous declaration of %q+#D"
msgstr ""
-#: cp/decl.c:1367
+#: cp/decl.c:1362
#, gcc-internal-format
msgid "declaration of template %q#D"
msgstr ""
-#: cp/decl.c:1368 cp/name-lookup.c:526
+#: cp/decl.c:1363 cp/name-lookup.c:527 cp/name-lookup.c:801
#, gcc-internal-format
msgid "conflicts with previous declaration %q+#D"
msgstr ""
-#: cp/decl.c:1382 cp/decl.c:1398
+#: cp/decl.c:1377 cp/decl.c:1393
#, gcc-internal-format
msgid "ambiguates old declaration %q+#D"
msgstr ""
-#: cp/decl.c:1390
+#: cp/decl.c:1385
#, gcc-internal-format
msgid "declaration of C function %q#D conflicts with"
msgstr ""
-#: cp/decl.c:1392
+#: cp/decl.c:1387
#, gcc-internal-format
msgid "previous declaration %q+#D here"
msgstr ""
-#: cp/decl.c:1406
+#: cp/decl.c:1401
#, gcc-internal-format
msgid "conflicting declaration %q#D"
msgstr ""
-#: cp/decl.c:1407
+#: cp/decl.c:1402
#, gcc-internal-format
msgid "%q+D has a previous declaration as %q#D"
msgstr ""
@@ -28202,65 +28361,65 @@ msgstr ""
#. A namespace-name defined at global scope shall not be
#. declared as the name of any other entity in any global scope
#. of the program.
-#: cp/decl.c:1459
+#: cp/decl.c:1454
#, gcc-internal-format
msgid "declaration of namespace %qD conflicts with"
msgstr ""
-#: cp/decl.c:1460
+#: cp/decl.c:1455
#, gcc-internal-format
msgid "previous declaration of namespace %q+D here"
msgstr ""
-#: cp/decl.c:1471
+#: cp/decl.c:1466
#, gcc-internal-format
msgid "%q+#D previously defined here"
msgstr ""
#. Prototype decl follows defn w/o prototype.
-#: cp/decl.c:1481
+#: cp/decl.c:1476
#, gcc-internal-format
msgid "prototype for %q+#D"
msgstr ""
-#: cp/decl.c:1482
+#: cp/decl.c:1477
#, gcc-internal-format
msgid "%Jfollows non-prototype definition here"
msgstr ""
-#: cp/decl.c:1522
+#: cp/decl.c:1517
#, gcc-internal-format
msgid "previous declaration of %q+#D with %qL linkage"
msgstr ""
-#: cp/decl.c:1524
+#: cp/decl.c:1519
#, gcc-internal-format
msgid "conflicts with new declaration with %qL linkage"
msgstr ""
-#: cp/decl.c:1547 cp/decl.c:1553
+#: cp/decl.c:1542 cp/decl.c:1548
#, gcc-internal-format
msgid "default argument given for parameter %d of %q#D"
msgstr ""
-#: cp/decl.c:1549 cp/decl.c:1555
+#: cp/decl.c:1544 cp/decl.c:1550
#, gcc-internal-format
msgid "after previous specification in %q+#D"
msgstr ""
-#: cp/decl.c:1564
+#: cp/decl.c:1605
#, gcc-internal-format
-msgid "%q#D was used before it was declared inline"
+msgid "redundant redeclaration of %qD in same scope"
msgstr ""
-#: cp/decl.c:1565
+#: cp/decl.c:1611
#, gcc-internal-format
-msgid "%Jprevious non-inline declaration here"
+msgid "deleted definition of %qD"
msgstr ""
-#: cp/decl.c:1618
+#: cp/decl.c:1612
#, gcc-internal-format
-msgid "redundant redeclaration of %qD in same scope"
+msgid "after previous declaration %q+D"
msgstr ""
#. From [temp.expl.spec]:
@@ -28271,324 +28430,324 @@ msgstr ""
#. that specialization that would cause an implicit
#. instantiation to take place, in every translation unit in
#. which such a use occurs.
-#: cp/decl.c:1934
+#: cp/decl.c:1926
#, gcc-internal-format
msgid "explicit specialization of %qD after first use"
msgstr ""
-#: cp/decl.c:2030
+#: cp/decl.c:2016
#, gcc-internal-format
msgid "%q+D: visibility attribute ignored because it"
msgstr ""
-#: cp/decl.c:2032
+#: cp/decl.c:2018
#, gcc-internal-format
msgid "%Jconflicts with previous declaration here"
msgstr ""
-#: cp/decl.c:2459
+#: cp/decl.c:2451
#, gcc-internal-format
msgid "jump to label %qD"
msgstr ""
-#: cp/decl.c:2461
+#: cp/decl.c:2453
#, gcc-internal-format
msgid "jump to case label"
msgstr ""
-#: cp/decl.c:2463
+#: cp/decl.c:2455
#, gcc-internal-format
msgid "%H from here"
msgstr ""
-#: cp/decl.c:2482 cp/decl.c:2645
+#: cp/decl.c:2474 cp/decl.c:2637
#, gcc-internal-format
msgid " exits OpenMP structured block"
msgstr ""
-#: cp/decl.c:2503
+#: cp/decl.c:2495
#, gcc-internal-format
msgid " crosses initialization of %q+#D"
msgstr ""
-#: cp/decl.c:2505 cp/decl.c:2620
+#: cp/decl.c:2497 cp/decl.c:2612
#, gcc-internal-format
msgid " enters scope of non-POD %q+#D"
msgstr ""
-#: cp/decl.c:2518 cp/decl.c:2624
+#: cp/decl.c:2510 cp/decl.c:2616
#, gcc-internal-format
msgid " enters try block"
msgstr ""
-#: cp/decl.c:2520 cp/decl.c:2626
+#: cp/decl.c:2512 cp/decl.c:2618
#, gcc-internal-format
msgid " enters catch block"
msgstr ""
-#: cp/decl.c:2530 cp/decl.c:2629
+#: cp/decl.c:2522 cp/decl.c:2621
#, gcc-internal-format
msgid " enters OpenMP structured block"
msgstr ""
-#: cp/decl.c:2601 cp/decl.c:2641
+#: cp/decl.c:2593 cp/decl.c:2633
#, gcc-internal-format
msgid "jump to label %q+D"
msgstr ""
-#: cp/decl.c:2602 cp/decl.c:2642
+#: cp/decl.c:2594 cp/decl.c:2634
#, gcc-internal-format
msgid " from here"
msgstr ""
#. Can't skip init of __exception_info.
-#: cp/decl.c:2614
+#: cp/decl.c:2606
#, gcc-internal-format
msgid "%J enters catch block"
msgstr ""
-#: cp/decl.c:2618
+#: cp/decl.c:2610
#, gcc-internal-format
msgid " skips initialization of %q+#D"
msgstr ""
-#: cp/decl.c:2694
+#: cp/decl.c:2686
#, gcc-internal-format
msgid "label named wchar_t"
msgstr ""
-#: cp/decl.c:2698
+#: cp/decl.c:2690
#, gcc-internal-format
msgid "duplicate label %qD"
msgstr ""
-#: cp/decl.c:2964
+#: cp/decl.c:2956
#, gcc-internal-format
msgid "%qD is not a type"
msgstr ""
-#: cp/decl.c:2970 cp/parser.c:4037
+#: cp/decl.c:2962
#, gcc-internal-format
msgid "%qD used without template parameters"
msgstr ""
-#: cp/decl.c:2985
+#: cp/decl.c:2977
#, gcc-internal-format
msgid "%q#T is not a class"
msgstr ""
-#: cp/decl.c:2997 cp/decl.c:3065
+#: cp/decl.c:2989 cp/decl.c:3057
#, gcc-internal-format
msgid "no class template named %q#T in %q#T"
msgstr ""
-#: cp/decl.c:3005
+#: cp/decl.c:2997
#, gcc-internal-format
msgid "%<typename %T::%D%> names %q#T, which is not a class template"
msgstr ""
-#: cp/decl.c:3012
+#: cp/decl.c:3004
#, gcc-internal-format
msgid "%<typename %T::%D%> names %q#T, which is not a type"
msgstr ""
-#: cp/decl.c:3074
+#: cp/decl.c:3066
#, gcc-internal-format
msgid "template parameters do not match template"
msgstr ""
-#: cp/decl.c:3075 cp/friend.c:321 cp/friend.c:329
+#: cp/decl.c:3067 cp/friend.c:321 cp/friend.c:329
#, gcc-internal-format
msgid "%q+D declared here"
msgstr ""
-#: cp/decl.c:3716
+#: cp/decl.c:3714
#, gcc-internal-format
msgid "%Jan anonymous struct cannot have function members"
msgstr ""
-#: cp/decl.c:3718
+#: cp/decl.c:3716
#, gcc-internal-format
msgid "%Jan anonymous union cannot have function members"
msgstr ""
-#: cp/decl.c:3736
+#: cp/decl.c:3734
#, gcc-internal-format
msgid "member %q+#D with constructor not allowed in anonymous aggregate"
msgstr ""
-#: cp/decl.c:3739
+#: cp/decl.c:3737
#, gcc-internal-format
msgid "member %q+#D with destructor not allowed in anonymous aggregate"
msgstr ""
-#: cp/decl.c:3742
+#: cp/decl.c:3740
#, gcc-internal-format
msgid ""
"member %q+#D with copy assignment operator not allowed in anonymous aggregate"
msgstr ""
-#: cp/decl.c:3767
+#: cp/decl.c:3765
#, gcc-internal-format
msgid "multiple types in one declaration"
msgstr ""
-#: cp/decl.c:3771
+#: cp/decl.c:3769
#, gcc-internal-format
msgid "redeclaration of C++ built-in type %qT"
msgstr ""
-#: cp/decl.c:3808
+#: cp/decl.c:3806
#, gcc-internal-format
msgid "missing type-name in typedef-declaration"
msgstr ""
-#: cp/decl.c:3816
+#: cp/decl.c:3813
#, gcc-internal-format
msgid "ISO C++ prohibits anonymous structs"
msgstr ""
-#: cp/decl.c:3823
+#: cp/decl.c:3820
#, gcc-internal-format
msgid "%qs can only be specified for functions"
msgstr ""
-#: cp/decl.c:3829
+#: cp/decl.c:3826
#, gcc-internal-format
msgid "%<friend%> can only be specified inside a class"
msgstr ""
-#: cp/decl.c:3831
+#: cp/decl.c:3828
#, gcc-internal-format
msgid "%<explicit%> can only be specified for constructors"
msgstr ""
-#: cp/decl.c:3833
+#: cp/decl.c:3830
#, gcc-internal-format
msgid "a storage class can only be specified for objects and functions"
msgstr ""
-#: cp/decl.c:3839
+#: cp/decl.c:3836
#, gcc-internal-format
msgid "qualifiers can only be specified for objects and functions"
msgstr ""
-#: cp/decl.c:3842
+#: cp/decl.c:3839
#, gcc-internal-format
msgid "%<typedef%> was ignored in this declaration"
msgstr ""
-#: cp/decl.c:3871
+#: cp/decl.c:3868
#, gcc-internal-format
msgid "attribute ignored in declaration of %q+#T"
msgstr ""
-#: cp/decl.c:3872
+#: cp/decl.c:3869
#, gcc-internal-format
msgid "attribute for %q+#T must follow the %qs keyword"
msgstr ""
-#: cp/decl.c:3914
+#: cp/decl.c:3911
#, gcc-internal-format
msgid "ignoring attributes applied to class type %qT outside of definition"
msgstr ""
#. A template type parameter or other dependent type.
-#: cp/decl.c:3918
+#: cp/decl.c:3915
#, gcc-internal-format
msgid ""
"ignoring attributes applied to dependent type %qT without an associated "
"declaration"
msgstr ""
-#: cp/decl.c:3996
+#: cp/decl.c:3991
#, gcc-internal-format
-msgid "function %q#D is initialized like a variable"
+msgid "typedef %qD is initialized (use decltype instead)"
msgstr ""
-#: cp/decl.c:4007
+#: cp/decl.c:4009
#, gcc-internal-format
msgid "declaration of %q#D has %<extern%> and is initialized"
msgstr ""
-#: cp/decl.c:4023
+#: cp/decl.c:4034
#, gcc-internal-format
msgid "definition of %q#D is marked %<dllimport%>"
msgstr ""
-#: cp/decl.c:4042
+#: cp/decl.c:4053
#, gcc-internal-format
msgid "%q#D is not a static member of %q#T"
msgstr ""
-#: cp/decl.c:4048
+#: cp/decl.c:4059
#, gcc-internal-format
msgid "ISO C++ does not permit %<%T::%D%> to be defined as %<%T::%D%>"
msgstr ""
-#: cp/decl.c:4057
+#: cp/decl.c:4068
#, gcc-internal-format
msgid ""
"template header not allowed in member definition of explicitly specialized "
"class"
msgstr ""
-#: cp/decl.c:4065
+#: cp/decl.c:4076
#, gcc-internal-format
msgid "duplicate initialization of %qD"
msgstr ""
-#: cp/decl.c:4104
+#: cp/decl.c:4115
#, gcc-internal-format
msgid "declaration of %q#D outside of class is not definition"
msgstr ""
-#: cp/decl.c:4197
+#: cp/decl.c:4208
#, gcc-internal-format
msgid "variable %q#D has initializer but incomplete type"
msgstr ""
-#: cp/decl.c:4203 cp/decl.c:4915
+#: cp/decl.c:4214 cp/decl.c:4950
#, gcc-internal-format
msgid "elements of array %q#D have incomplete type"
msgstr ""
-#: cp/decl.c:4209
+#: cp/decl.c:4220
#, gcc-internal-format
msgid "aggregate %q#D has incomplete type and cannot be defined"
msgstr ""
-#: cp/decl.c:4245
+#: cp/decl.c:4256
#, gcc-internal-format
msgid "%qD declared as reference but not initialized"
msgstr ""
-#: cp/decl.c:4251
+#: cp/decl.c:4262
#, gcc-internal-format
msgid "ISO C++ forbids use of initializer list to initialize reference %qD"
msgstr ""
-#: cp/decl.c:4277
+#: cp/decl.c:4288
#, gcc-internal-format
msgid "cannot initialize %qT from %qT"
msgstr ""
-#: cp/decl.c:4305
+#: cp/decl.c:4349
#, gcc-internal-format
msgid "name %qD used in a GNU-style designated initializer for an array"
msgstr ""
-#: cp/decl.c:4354
+#: cp/decl.c:4398
#, gcc-internal-format
msgid "initializer fails to determine size of %qD"
msgstr ""
-#: cp/decl.c:4361
+#: cp/decl.c:4405
#, gcc-internal-format
msgid "array size missing in %qD"
msgstr ""
-#: cp/decl.c:4373
+#: cp/decl.c:4417
#, gcc-internal-format
msgid "zero-size array %qD"
msgstr ""
@@ -28596,260 +28755,273 @@ msgstr ""
#. An automatic variable with an incomplete type: that is an error.
#. Don't talk about array types here, since we took care of that
#. message in grokdeclarator.
-#: cp/decl.c:4416
+#: cp/decl.c:4460
#, gcc-internal-format
msgid "storage size of %qD isn't known"
msgstr ""
-#: cp/decl.c:4438
+#: cp/decl.c:4483
#, gcc-internal-format
msgid "storage size of %qD isn't constant"
msgstr ""
-#: cp/decl.c:4487
+#: cp/decl.c:4534
#, gcc-internal-format
msgid ""
"sorry: semantics of inline function static data %q+#D are wrong (you'll wind "
"up with multiple copies)"
msgstr ""
-#: cp/decl.c:4490
+#: cp/decl.c:4537
#, gcc-internal-format
msgid "%J you can work around this by removing the initializer"
msgstr ""
-#: cp/decl.c:4517
+#: cp/decl.c:4564
#, gcc-internal-format
msgid "uninitialized const %qD"
msgstr ""
-#: cp/decl.c:4629
+#: cp/decl.c:4676
#, gcc-internal-format
msgid "invalid type %qT as initializer for a vector of type %qT"
msgstr ""
-#: cp/decl.c:4671
+#: cp/decl.c:4718
#, gcc-internal-format
msgid "initializer for %qT must be brace-enclosed"
msgstr ""
-#: cp/decl.c:4689
+#: cp/decl.c:4736
#, gcc-internal-format
msgid "%qT has no non-static data member named %qD"
msgstr ""
-#: cp/decl.c:4740
+#: cp/decl.c:4789
#, gcc-internal-format
msgid "braces around scalar initializer for type %qT"
msgstr ""
-#: cp/decl.c:4823
+#: cp/decl.c:4875
#, gcc-internal-format
msgid "missing braces around initializer for %qT"
msgstr ""
-#: cp/decl.c:4880
+#: cp/decl.c:4932
#, gcc-internal-format
msgid "too many initializers for %qT"
msgstr ""
-#: cp/decl.c:4923
+#: cp/decl.c:4952
+#, gcc-internal-format
+msgid "elements of array %q#T have incomplete type"
+msgstr ""
+
+#: cp/decl.c:4961
#, gcc-internal-format
msgid "variable-sized object %qD may not be initialized"
msgstr ""
-#: cp/decl.c:4929
+#: cp/decl.c:4963
#, gcc-internal-format
-msgid "%qD has incomplete type"
+msgid "variable-sized compound literal"
msgstr ""
-#: cp/decl.c:4944
+#: cp/decl.c:5017
#, gcc-internal-format
-msgid "scalar object %qD requires one element in initializer"
+msgid "%qD has incomplete type"
msgstr ""
-#. A non-aggregate that is not a scalar cannot be initialized
-#. via an initializer-list in C++98.
-#: cp/decl.c:4954
+#: cp/decl.c:5037
#, gcc-internal-format
-msgid "braces around initializer for non-aggregate type %qT"
+msgid "scalar object %qD requires one element in initializer"
msgstr ""
-#: cp/decl.c:5004
+#: cp/decl.c:5068
#, gcc-internal-format
-msgid "%qD must be initialized by constructor, not by %<{...}%>"
+msgid "in C++98 %qD must be initialized by constructor, not by %<{...}%>"
msgstr ""
-#: cp/decl.c:5040
+#: cp/decl.c:5100
#, gcc-internal-format
msgid "array %qD initialized by parenthesized string literal %qE"
msgstr ""
-#: cp/decl.c:5055
+#: cp/decl.c:5114
#, gcc-internal-format
msgid "structure %qD with uninitialized const members"
msgstr ""
-#: cp/decl.c:5057
+#: cp/decl.c:5116
#, gcc-internal-format
msgid "structure %qD with uninitialized reference members"
msgstr ""
-#: cp/decl.c:5353
+#: cp/decl.c:5412
#, gcc-internal-format
msgid "assignment (not initialization) in declaration"
msgstr ""
-#: cp/decl.c:5449
+#: cp/decl.c:5508
#, gcc-internal-format
msgid "shadowing previous type declaration of %q#D"
msgstr ""
-#: cp/decl.c:5479
+#: cp/decl.c:5538
#, gcc-internal-format
msgid "%qD cannot be thread-local because it has non-POD type %qT"
msgstr ""
-#: cp/decl.c:5511
+#: cp/decl.c:5570
#, gcc-internal-format
msgid "Java object %qD not allocated with %<new%>"
msgstr ""
-#: cp/decl.c:5528
+#: cp/decl.c:5587
#, gcc-internal-format
msgid "%qD is thread-local and so cannot be dynamically initialized"
msgstr ""
-#: cp/decl.c:5546
+#: cp/decl.c:5605
#, gcc-internal-format
msgid ""
"%qD cannot be initialized by a non-constant expression when being declared"
msgstr ""
-#: cp/decl.c:5586
+#: cp/decl.c:5645
#, gcc-internal-format
msgid "non-static data member %qD has Java class type"
msgstr ""
-#: cp/decl.c:6221
+#: cp/decl.c:5711 cp/decl2.c:834
+#, gcc-internal-format
+msgid "%qD cannot be defaulted"
+msgstr ""
+
+#: cp/decl.c:5722
+#, gcc-internal-format
+msgid "function %q#D is initialized like a variable"
+msgstr ""
+
+#: cp/decl.c:6309
#, gcc-internal-format
msgid "destructor for alien class %qT cannot be a member"
msgstr ""
-#: cp/decl.c:6223
+#: cp/decl.c:6311
#, gcc-internal-format
msgid "constructor for alien class %qT cannot be a member"
msgstr ""
-#: cp/decl.c:6244
+#: cp/decl.c:6332
#, gcc-internal-format
msgid "%qD declared as a %<virtual%> %s"
msgstr ""
-#: cp/decl.c:6246
+#: cp/decl.c:6334
#, gcc-internal-format
msgid "%qD declared as an %<inline%> %s"
msgstr ""
-#: cp/decl.c:6248
+#: cp/decl.c:6336
#, gcc-internal-format
msgid ""
"%<const%> and %<volatile%> function specifiers on %qD invalid in %s "
"declaration"
msgstr ""
-#: cp/decl.c:6252
+#: cp/decl.c:6340
#, gcc-internal-format
msgid "%q+D declared as a friend"
msgstr ""
-#: cp/decl.c:6258
+#: cp/decl.c:6346
#, gcc-internal-format
msgid "%q+D declared with an exception specification"
msgstr ""
-#: cp/decl.c:6292
+#: cp/decl.c:6380
#, gcc-internal-format
msgid "definition of %qD is not in namespace enclosing %qT"
msgstr ""
-#: cp/decl.c:6403
+#: cp/decl.c:6491
#, gcc-internal-format
msgid "defining explicit specialization %qD in friend declaration"
msgstr ""
#. Something like `template <class T> friend void f<T>()'.
-#: cp/decl.c:6413
+#: cp/decl.c:6501
#, gcc-internal-format
msgid "invalid use of template-id %qD in declaration of primary template"
msgstr ""
-#: cp/decl.c:6443
+#: cp/decl.c:6531
#, gcc-internal-format
msgid ""
"default arguments are not allowed in declaration of friend template "
"specialization %qD"
msgstr ""
-#: cp/decl.c:6451
+#: cp/decl.c:6539
#, gcc-internal-format
msgid ""
"%<inline%> is not allowed in declaration of friend template specialization %"
"qD"
msgstr ""
-#: cp/decl.c:6494
+#: cp/decl.c:6582
#, gcc-internal-format
msgid "cannot declare %<::main%> to be a template"
msgstr ""
-#: cp/decl.c:6496
+#: cp/decl.c:6584
#, gcc-internal-format
msgid "cannot declare %<::main%> to be inline"
msgstr ""
-#: cp/decl.c:6498
+#: cp/decl.c:6586
#, gcc-internal-format
msgid "cannot declare %<::main%> to be static"
msgstr ""
-#: cp/decl.c:6526
+#: cp/decl.c:6614
#, gcc-internal-format
msgid "non-local function %q#D uses anonymous type"
msgstr ""
-#: cp/decl.c:6529 cp/decl.c:6809
+#: cp/decl.c:6617 cp/decl.c:6893
#, gcc-internal-format
msgid ""
"%q+#D does not refer to the unqualified type, so it is not used for linkage"
msgstr ""
-#: cp/decl.c:6535
+#: cp/decl.c:6623
#, gcc-internal-format
msgid "non-local function %q#D uses local type %qT"
msgstr ""
-#: cp/decl.c:6559
+#: cp/decl.c:6642
#, gcc-internal-format
msgid "static member function %qD cannot have cv-qualifier"
msgstr ""
-#: cp/decl.c:6560
+#: cp/decl.c:6643
#, gcc-internal-format
msgid "non-member function %qD cannot have cv-qualifier"
msgstr ""
-#: cp/decl.c:6608
+#: cp/decl.c:6691
#, gcc-internal-format
msgid "%<::main%> must return %<int%>"
msgstr ""
-#: cp/decl.c:6647
+#: cp/decl.c:6731
#, gcc-internal-format
msgid "definition of implicitly-declared %qD"
msgstr ""
-#: cp/decl.c:6664 cp/decl2.c:677
+#: cp/decl.c:6748 cp/decl2.c:679
#, gcc-internal-format
msgid "no %q#D member function declared in class %qT"
msgstr ""
@@ -28858,561 +29030,566 @@ msgstr ""
#. no linkage can only be used to declare extern "C"
#. entities. Since it's not always an error in the
#. ISO C++ 90 Standard, we only issue a warning.
-#: cp/decl.c:6806
+#: cp/decl.c:6890
#, gcc-internal-format
msgid "non-local variable %q#D uses anonymous type"
msgstr ""
-#: cp/decl.c:6815
+#: cp/decl.c:6899
#, gcc-internal-format
msgid "non-local variable %q#D uses local type %qT"
msgstr ""
-#: cp/decl.c:6937
+#: cp/decl.c:7022
#, gcc-internal-format
msgid ""
"invalid in-class initialization of static data member of non-integral type %"
"qT"
msgstr ""
-#: cp/decl.c:6947
+#: cp/decl.c:7032
#, gcc-internal-format
msgid "ISO C++ forbids in-class initialization of non-const static member %qD"
msgstr ""
-#: cp/decl.c:6951
+#: cp/decl.c:7036
#, gcc-internal-format
msgid ""
"ISO C++ forbids initialization of member constant %qD of non-integral type %"
"qT"
msgstr ""
-#: cp/decl.c:6976
+#: cp/decl.c:7061
#, gcc-internal-format
msgid "size of array %qD has non-integral type %qT"
msgstr ""
-#: cp/decl.c:6978
+#: cp/decl.c:7063
#, gcc-internal-format
msgid "size of array has non-integral type %qT"
msgstr ""
-#: cp/decl.c:7026
+#: cp/decl.c:7106
#, gcc-internal-format
msgid "size of array %qD is negative"
msgstr ""
-#: cp/decl.c:7028
+#: cp/decl.c:7108
#, gcc-internal-format
msgid "size of array is negative"
msgstr ""
-#: cp/decl.c:7036
+#: cp/decl.c:7116
#, gcc-internal-format
msgid "ISO C++ forbids zero-size array %qD"
msgstr ""
-#: cp/decl.c:7038
+#: cp/decl.c:7118
#, gcc-internal-format
msgid "ISO C++ forbids zero-size array"
msgstr ""
-#: cp/decl.c:7045
+#: cp/decl.c:7125
#, gcc-internal-format
msgid "size of array %qD is not an integral constant-expression"
msgstr ""
-#: cp/decl.c:7048
+#: cp/decl.c:7128
#, gcc-internal-format
msgid "size of array is not an integral constant-expression"
msgstr ""
-#: cp/decl.c:7054
+#: cp/decl.c:7134
#, gcc-internal-format
msgid "ISO C++ forbids variable length array %qD"
msgstr ""
-#: cp/decl.c:7056
+#: cp/decl.c:7136
#, gcc-internal-format
msgid "ISO C++ forbids variable length array"
msgstr ""
-#: cp/decl.c:7062
+#: cp/decl.c:7142
#, gcc-internal-format
msgid "variable length array %qD is used"
msgstr ""
-#: cp/decl.c:7096
+#: cp/decl.c:7177
#, gcc-internal-format
msgid "overflow in array dimension"
msgstr ""
-#: cp/decl.c:7177
+#: cp/decl.c:7258
#, gcc-internal-format
msgid "declaration of %qD as %s"
msgstr ""
-#: cp/decl.c:7179
+#: cp/decl.c:7260
#, gcc-internal-format
msgid "creating %s"
msgstr ""
-#: cp/decl.c:7191
+#: cp/decl.c:7272
#, gcc-internal-format
msgid ""
"declaration of %qD as multidimensional array must have bounds for all "
"dimensions except the first"
msgstr ""
-#: cp/decl.c:7195
+#: cp/decl.c:7276
#, gcc-internal-format
msgid ""
"multidimensional array must have bounds for all dimensions except the first"
msgstr ""
-#: cp/decl.c:7230
+#: cp/decl.c:7311
#, gcc-internal-format
msgid "return type specification for constructor invalid"
msgstr ""
-#: cp/decl.c:7240
+#: cp/decl.c:7321
#, gcc-internal-format
msgid "return type specification for destructor invalid"
msgstr ""
-#: cp/decl.c:7253
+#: cp/decl.c:7334
#, gcc-internal-format
msgid "return type specified for %<operator %T%>"
msgstr ""
-#: cp/decl.c:7275
+#: cp/decl.c:7356
#, gcc-internal-format
msgid "unnamed variable or field declared void"
msgstr ""
-#: cp/decl.c:7279
+#: cp/decl.c:7360
#, gcc-internal-format
msgid "variable or field %qE declared void"
msgstr ""
-#: cp/decl.c:7282
+#: cp/decl.c:7363
#, gcc-internal-format
msgid "variable or field declared void"
msgstr ""
-#: cp/decl.c:7449
+#: cp/decl.c:7533
#, gcc-internal-format
msgid "invalid use of qualified-name %<::%D%>"
msgstr ""
-#: cp/decl.c:7452
+#: cp/decl.c:7536
#, gcc-internal-format
msgid "invalid use of qualified-name %<%T::%D%>"
msgstr ""
-#: cp/decl.c:7455
+#: cp/decl.c:7539
#, gcc-internal-format
msgid "invalid use of qualified-name %<%D::%D%>"
msgstr ""
-#: cp/decl.c:7467
+#: cp/decl.c:7551
#, gcc-internal-format
msgid "type %qT is not derived from type %qT"
msgstr ""
-#: cp/decl.c:7483 cp/decl.c:7573 cp/decl.c:8721
+#: cp/decl.c:7567 cp/decl.c:7657 cp/decl.c:8807
#, gcc-internal-format
msgid "declaration of %qD as non-function"
msgstr ""
-#: cp/decl.c:7489
+#: cp/decl.c:7573
#, gcc-internal-format
msgid "declaration of %qD as non-member"
msgstr ""
-#: cp/decl.c:7518
+#: cp/decl.c:7602
#, gcc-internal-format
msgid "declarator-id missing; using reserved word %qD"
msgstr ""
-#: cp/decl.c:7565
+#: cp/decl.c:7649
#, gcc-internal-format
msgid "function definition does not declare parameters"
msgstr ""
-#: cp/decl.c:7607
+#: cp/decl.c:7691
#, gcc-internal-format
msgid "two or more data types in declaration of %qs"
msgstr ""
-#: cp/decl.c:7613
+#: cp/decl.c:7697
#, gcc-internal-format
msgid "conflicting specifiers in declaration of %qs"
msgstr ""
-#: cp/decl.c:7684 cp/decl.c:7687
+#: cp/decl.c:7768 cp/decl.c:7771 cp/decl.c:7774
#, gcc-internal-format
msgid "ISO C++ forbids declaration of %qs with no type"
msgstr ""
-#: cp/decl.c:7712
+#: cp/decl.c:7799 cp/decl.c:7817
#, gcc-internal-format
msgid "%<signed%> or %<unsigned%> invalid for %qs"
msgstr ""
-#: cp/decl.c:7714
+#: cp/decl.c:7801
#, gcc-internal-format
msgid "%<signed%> and %<unsigned%> specified together for %qs"
msgstr ""
-#: cp/decl.c:7716
+#: cp/decl.c:7803
#, gcc-internal-format
msgid "%<long long%> invalid for %qs"
msgstr ""
-#: cp/decl.c:7718
+#: cp/decl.c:7805
#, gcc-internal-format
msgid "%<long%> invalid for %qs"
msgstr ""
-#: cp/decl.c:7720
+#: cp/decl.c:7807
#, gcc-internal-format
msgid "%<short%> invalid for %qs"
msgstr ""
-#: cp/decl.c:7722
+#: cp/decl.c:7809
#, gcc-internal-format
msgid "%<long%> or %<short%> invalid for %qs"
msgstr ""
-#: cp/decl.c:7724
+#: cp/decl.c:7811
#, gcc-internal-format
msgid "%<long%> or %<short%> specified with char for %qs"
msgstr ""
-#: cp/decl.c:7726
+#: cp/decl.c:7813
#, gcc-internal-format
msgid "%<long%> and %<short%> specified together for %qs"
msgstr ""
-#: cp/decl.c:7732
+#: cp/decl.c:7819
+#, gcc-internal-format
+msgid "%<short%> or %<long%> invalid for %qs"
+msgstr ""
+
+#: cp/decl.c:7827
#, gcc-internal-format
msgid "long, short, signed or unsigned used invalidly for %qs"
msgstr ""
-#: cp/decl.c:7796
+#: cp/decl.c:7891
#, gcc-internal-format
msgid "complex invalid for %qs"
msgstr ""
-#: cp/decl.c:7825
+#: cp/decl.c:7920
#, gcc-internal-format
msgid "qualifiers are not allowed on declaration of %<operator %T%>"
msgstr ""
-#: cp/decl.c:7837 cp/typeck.c:7028
+#: cp/decl.c:7933 cp/typeck.c:7168
#, gcc-internal-format
msgid "ignoring %qV qualifiers added to function type %qT"
msgstr ""
-#: cp/decl.c:7860
+#: cp/decl.c:7956
#, gcc-internal-format
msgid "member %qD cannot be declared both virtual and static"
msgstr ""
-#: cp/decl.c:7868
+#: cp/decl.c:7964
#, gcc-internal-format
msgid "%<%T::%D%> is not a valid declarator"
msgstr ""
-#: cp/decl.c:7877
+#: cp/decl.c:7973
#, gcc-internal-format
msgid "typedef declaration invalid in parameter declaration"
msgstr ""
-#: cp/decl.c:7883
+#: cp/decl.c:7979
#, gcc-internal-format
msgid "storage class specifiers invalid in parameter declarations"
msgstr ""
-#: cp/decl.c:7890
+#: cp/decl.c:7986
#, gcc-internal-format
-msgid "virtual outside class declaration"
+msgid "%<virtual%> outside class declaration"
msgstr ""
-#: cp/decl.c:7908
+#: cp/decl.c:8004
#, gcc-internal-format
msgid "multiple storage classes in declaration of %qs"
msgstr ""
-#: cp/decl.c:7931
+#: cp/decl.c:8027
#, gcc-internal-format
msgid "storage class specified for %qs"
msgstr ""
-#: cp/decl.c:7965
+#: cp/decl.c:8048
#, gcc-internal-format
msgid "top-level declaration of %qs specifies %<auto%>"
msgstr ""
-#: cp/decl.c:7977
+#: cp/decl.c:8061
#, gcc-internal-format
msgid "storage class specifiers invalid in friend function declarations"
msgstr ""
-#: cp/decl.c:8104
+#: cp/decl.c:8191
#, gcc-internal-format
msgid "destructor cannot be static member function"
msgstr ""
-#: cp/decl.c:8109
+#: cp/decl.c:8196
#, gcc-internal-format
msgid "destructors may not be cv-qualified"
msgstr ""
-#: cp/decl.c:8127
+#: cp/decl.c:8214
#, gcc-internal-format
msgid "constructors cannot be declared virtual"
msgstr ""
-#: cp/decl.c:8140
+#: cp/decl.c:8227
#, gcc-internal-format
msgid "can't initialize friend function %qs"
msgstr ""
#. Cannot be both friend and virtual.
-#: cp/decl.c:8144
+#: cp/decl.c:8231
#, gcc-internal-format
msgid "virtual functions cannot be friends"
msgstr ""
-#: cp/decl.c:8148
+#: cp/decl.c:8235
#, gcc-internal-format
msgid "friend declaration not in class definition"
msgstr ""
-#: cp/decl.c:8150
+#: cp/decl.c:8237
#, gcc-internal-format
msgid "can't define friend function %qs in a local class definition"
msgstr ""
-#: cp/decl.c:8163
+#: cp/decl.c:8250
#, gcc-internal-format
msgid "destructors may not have parameters"
msgstr ""
-#: cp/decl.c:8182
+#: cp/decl.c:8269
#, gcc-internal-format
msgid "cannot declare pointer to %q#T"
msgstr ""
-#: cp/decl.c:8195 cp/decl.c:8202
+#: cp/decl.c:8282 cp/decl.c:8289
#, gcc-internal-format
msgid "cannot declare reference to %q#T"
msgstr ""
-#: cp/decl.c:8204
+#: cp/decl.c:8291
#, gcc-internal-format
msgid "cannot declare pointer to %q#T member"
msgstr ""
-#: cp/decl.c:8255
+#: cp/decl.c:8342
#, gcc-internal-format
msgid ""
"cannot declare reference to %q#T, which is not a typedef or a template type "
"argument"
msgstr ""
-#: cp/decl.c:8299
+#: cp/decl.c:8386
#, gcc-internal-format
msgid "template-id %qD used as a declarator"
msgstr ""
-#: cp/decl.c:8350
+#: cp/decl.c:8437
#, gcc-internal-format
msgid "member functions are implicitly friends of their class"
msgstr ""
-#: cp/decl.c:8354
+#: cp/decl.c:8442
#, gcc-internal-format
msgid "extra qualification %<%T::%> on member %qs"
msgstr ""
-#: cp/decl.c:8386
+#: cp/decl.c:8474
#, gcc-internal-format
msgid "cannot define member function %<%T::%s%> within %<%T%>"
msgstr ""
-#: cp/decl.c:8403
+#: cp/decl.c:8491
#, gcc-internal-format
msgid "cannot declare member %<%T::%s%> within %qT"
msgstr ""
-#: cp/decl.c:8426
+#: cp/decl.c:8514
#, gcc-internal-format
msgid "non-parameter %qs cannot be a parameter pack"
msgstr ""
-#: cp/decl.c:8447
+#: cp/decl.c:8535
#, gcc-internal-format
msgid "data member may not have variably modified type %qT"
msgstr ""
-#: cp/decl.c:8449
+#: cp/decl.c:8537
#, gcc-internal-format
msgid "parameter may not have variably modified type %qT"
msgstr ""
#. [dcl.fct.spec] The explicit specifier shall only be used in
#. declarations of constructors within a class definition.
-#: cp/decl.c:8457
+#: cp/decl.c:8545
#, gcc-internal-format
msgid "only declarations of constructors can be %<explicit%>"
msgstr ""
-#: cp/decl.c:8465
+#: cp/decl.c:8553
#, gcc-internal-format
msgid "non-member %qs cannot be declared %<mutable%>"
msgstr ""
-#: cp/decl.c:8470
+#: cp/decl.c:8558
#, gcc-internal-format
msgid "non-object member %qs cannot be declared %<mutable%>"
msgstr ""
-#: cp/decl.c:8476
+#: cp/decl.c:8564
#, gcc-internal-format
msgid "function %qs cannot be declared %<mutable%>"
msgstr ""
-#: cp/decl.c:8481
+#: cp/decl.c:8569
#, gcc-internal-format
msgid "static %qs cannot be declared %<mutable%>"
msgstr ""
-#: cp/decl.c:8486
+#: cp/decl.c:8574
#, gcc-internal-format
msgid "const %qs cannot be declared %<mutable%>"
msgstr ""
-#: cp/decl.c:8523
+#: cp/decl.c:8611
#, gcc-internal-format
msgid "%Jtypedef name may not be a nested-name-specifier"
msgstr ""
-#: cp/decl.c:8539
+#: cp/decl.c:8627
#, gcc-internal-format
msgid "ISO C++ forbids nested type %qD with same name as enclosing class"
msgstr ""
-#: cp/decl.c:8625
+#: cp/decl.c:8711
#, gcc-internal-format
msgid ""
"qualified function types cannot be used to declare static member functions"
msgstr ""
-#: cp/decl.c:8627
+#: cp/decl.c:8713
#, gcc-internal-format
msgid "qualified function types cannot be used to declare free functions"
msgstr ""
-#: cp/decl.c:8653
+#: cp/decl.c:8739
#, gcc-internal-format
msgid "type qualifiers specified for friend class declaration"
msgstr ""
-#: cp/decl.c:8658
+#: cp/decl.c:8744
#, gcc-internal-format
msgid "%<inline%> specified for friend class declaration"
msgstr ""
-#: cp/decl.c:8666
+#: cp/decl.c:8752
#, gcc-internal-format
msgid "template parameters cannot be friends"
msgstr ""
-#: cp/decl.c:8668
+#: cp/decl.c:8754
#, gcc-internal-format
msgid "friend declaration requires class-key, i.e. %<friend class %T::%D%>"
msgstr ""
-#: cp/decl.c:8672
+#: cp/decl.c:8758
#, gcc-internal-format
msgid "friend declaration requires class-key, i.e. %<friend %#T%>"
msgstr ""
-#: cp/decl.c:8685
+#: cp/decl.c:8771
#, gcc-internal-format
msgid "trying to make class %qT a friend of global scope"
msgstr ""
-#: cp/decl.c:8696
+#: cp/decl.c:8782
#, gcc-internal-format
msgid "invalid qualifiers on non-member function type"
msgstr ""
-#: cp/decl.c:8711
+#: cp/decl.c:8797
#, gcc-internal-format
msgid "abstract declarator %qT used as declaration"
msgstr ""
-#: cp/decl.c:8740
+#: cp/decl.c:8826
#, gcc-internal-format
msgid "cannot use %<::%> in parameter declaration"
msgstr ""
#. Something like struct S { int N::j; };
-#: cp/decl.c:8786
+#: cp/decl.c:8872
#, gcc-internal-format
msgid "invalid use of %<::%>"
msgstr ""
-#: cp/decl.c:8801
+#: cp/decl.c:8887
#, gcc-internal-format
msgid "can't make %qD into a method -- not in a class"
msgstr ""
-#: cp/decl.c:8810
+#: cp/decl.c:8896
#, gcc-internal-format
msgid "function %qD declared virtual inside a union"
msgstr ""
-#: cp/decl.c:8819
+#: cp/decl.c:8905
#, gcc-internal-format
msgid "%qD cannot be declared virtual, since it is always static"
msgstr ""
-#: cp/decl.c:8835
+#: cp/decl.c:8921
#, gcc-internal-format
msgid "expected qualified name in friend declaration for destructor %qD"
msgstr ""
-#: cp/decl.c:8845
+#: cp/decl.c:8931
#, gcc-internal-format
msgid "declaration of %qD as member of %qT"
msgstr ""
-#: cp/decl.c:8852
+#: cp/decl.c:8938
#, gcc-internal-format
msgid "expected qualified name in friend declaration for constructor %qD"
msgstr ""
-#: cp/decl.c:8928
+#: cp/decl.c:9008
#, gcc-internal-format
msgid "field %qD has incomplete type"
msgstr ""
-#: cp/decl.c:8930
+#: cp/decl.c:9010
#, gcc-internal-format
msgid "name %qT has incomplete type"
msgstr ""
-#: cp/decl.c:8939
+#: cp/decl.c:9019
#, gcc-internal-format
msgid " in instantiation of template %qT"
msgstr ""
-#: cp/decl.c:8948
+#: cp/decl.c:9028
#, gcc-internal-format
msgid "%qE is neither function nor member function; cannot be declared friend"
msgstr ""
@@ -29429,112 +29606,112 @@ msgstr ""
#. the rest of the compiler does not correctly
#. handle the initialization unless the member is
#. static so we make it static below.
-#: cp/decl.c:9000
+#: cp/decl.c:9080
#, gcc-internal-format
msgid "ISO C++ forbids initialization of member %qD"
msgstr ""
-#: cp/decl.c:9002
+#: cp/decl.c:9082
#, gcc-internal-format
msgid "making %qD static"
msgstr ""
-#: cp/decl.c:9067
+#: cp/decl.c:9147
#, gcc-internal-format
msgid "storage class %<auto%> invalid for function %qs"
msgstr ""
-#: cp/decl.c:9069
+#: cp/decl.c:9149
#, gcc-internal-format
msgid "storage class %<register%> invalid for function %qs"
msgstr ""
-#: cp/decl.c:9071
+#: cp/decl.c:9151
#, gcc-internal-format
msgid "storage class %<__thread%> invalid for function %qs"
msgstr ""
-#: cp/decl.c:9082
+#: cp/decl.c:9163
#, gcc-internal-format
msgid ""
"%<static%> specified invalid for function %qs declared out of global scope"
msgstr ""
-#: cp/decl.c:9085
+#: cp/decl.c:9167
#, gcc-internal-format
msgid ""
"%<inline%> specifier invalid for function %qs declared out of global scope"
msgstr ""
-#: cp/decl.c:9093
+#: cp/decl.c:9175
#, gcc-internal-format
msgid "virtual non-class function %qs"
msgstr ""
-#: cp/decl.c:9124
+#: cp/decl.c:9206
#, gcc-internal-format
msgid "cannot declare member function %qD to have static linkage"
msgstr ""
#. FIXME need arm citation
-#: cp/decl.c:9131
+#: cp/decl.c:9213
#, gcc-internal-format
msgid "cannot declare static function inside another function"
msgstr ""
-#: cp/decl.c:9161
+#: cp/decl.c:9243
#, gcc-internal-format
msgid ""
"%<static%> may not be used when defining (as opposed to declaring) a static "
"data member"
msgstr ""
-#: cp/decl.c:9168
+#: cp/decl.c:9250
#, gcc-internal-format
msgid "static member %qD declared %<register%>"
msgstr ""
-#: cp/decl.c:9173
+#: cp/decl.c:9256
#, gcc-internal-format
msgid "cannot explicitly declare member %q#D to have extern linkage"
msgstr ""
-#: cp/decl.c:9302
+#: cp/decl.c:9400
#, gcc-internal-format
msgid "default argument for %q#D has type %qT"
msgstr ""
-#: cp/decl.c:9305
+#: cp/decl.c:9403
#, gcc-internal-format
msgid "default argument for parameter of type %qT has type %qT"
msgstr ""
-#: cp/decl.c:9321
+#: cp/decl.c:9419
#, gcc-internal-format
msgid "default argument %qE uses local variable %qD"
msgstr ""
-#: cp/decl.c:9388
+#: cp/decl.c:9486
#, gcc-internal-format
msgid "parameter %qD has Java class type"
msgstr ""
-#: cp/decl.c:9401
+#: cp/decl.c:9499
#, gcc-internal-format
msgid "parameter %qD invalidly declared method type"
msgstr ""
-#: cp/decl.c:9425
+#: cp/decl.c:9523
#, gcc-internal-format
msgid "parameter %qD includes %s to array of unknown bound %qT"
msgstr ""
-#: cp/decl.c:9439
+#: cp/decl.c:9537
#, gcc-internal-format
msgid "parameter packs must be at the end of the parameter list"
msgstr ""
-#: cp/decl.c:9444
+#: cp/decl.c:9542
#, gcc-internal-format
msgid "multiple parameters named %qE"
msgstr ""
@@ -29554,139 +29731,139 @@ msgstr ""
#. or implicitly defined), there's no need to worry about their
#. existence. Theoretically, they should never even be
#. instantiated, but that's hard to forestall.
-#: cp/decl.c:9659
+#: cp/decl.c:9765
#, gcc-internal-format
msgid "invalid constructor; you probably meant %<%T (const %T&)%>"
msgstr ""
-#: cp/decl.c:9781
+#: cp/decl.c:9887
#, gcc-internal-format
msgid "%qD may not be declared within a namespace"
msgstr ""
-#: cp/decl.c:9786
+#: cp/decl.c:9892
#, gcc-internal-format
msgid "%qD may not be declared as static"
msgstr ""
-#: cp/decl.c:9812
+#: cp/decl.c:9918
#, gcc-internal-format
msgid "%qD must be a nonstatic member function"
msgstr ""
-#: cp/decl.c:9821
+#: cp/decl.c:9927
#, gcc-internal-format
msgid ""
"%qD must be either a non-static member function or a non-member function"
msgstr ""
-#: cp/decl.c:9842
+#: cp/decl.c:9949
#, gcc-internal-format
msgid "%qD must have an argument of class or enumerated type"
msgstr ""
-#: cp/decl.c:9883
+#: cp/decl.c:9990
#, gcc-internal-format
msgid "conversion to %s%s will never use a type conversion operator"
msgstr ""
#. 13.4.0.3
-#: cp/decl.c:9891
+#: cp/decl.c:9998
#, gcc-internal-format
msgid "ISO C++ prohibits overloading operator ?:"
msgstr ""
-#: cp/decl.c:9896
+#: cp/decl.c:10003
#, gcc-internal-format
msgid "%qD must not have variable number of arguments"
msgstr ""
-#: cp/decl.c:9947
+#: cp/decl.c:10054
#, gcc-internal-format
msgid "postfix %qD must take %<int%> as its argument"
msgstr ""
-#: cp/decl.c:9950
+#: cp/decl.c:10057
#, gcc-internal-format
msgid "postfix %qD must take %<int%> as its second argument"
msgstr ""
-#: cp/decl.c:9958
+#: cp/decl.c:10065
#, gcc-internal-format
msgid "%qD must take either zero or one argument"
msgstr ""
-#: cp/decl.c:9960
+#: cp/decl.c:10067
#, gcc-internal-format
msgid "%qD must take either one or two arguments"
msgstr ""
-#: cp/decl.c:9982
+#: cp/decl.c:10089
#, gcc-internal-format
msgid "prefix %qD should return %qT"
msgstr ""
-#: cp/decl.c:9988
+#: cp/decl.c:10095
#, gcc-internal-format
msgid "postfix %qD should return %qT"
msgstr ""
-#: cp/decl.c:9997
+#: cp/decl.c:10104
#, gcc-internal-format
msgid "%qD must take %<void%>"
msgstr ""
-#: cp/decl.c:9999 cp/decl.c:10008
+#: cp/decl.c:10106 cp/decl.c:10115
#, gcc-internal-format
msgid "%qD must take exactly one argument"
msgstr ""
-#: cp/decl.c:10010
+#: cp/decl.c:10117
#, gcc-internal-format
msgid "%qD must take exactly two arguments"
msgstr ""
-#: cp/decl.c:10019
+#: cp/decl.c:10126
#, gcc-internal-format
msgid "user-defined %qD always evaluates both arguments"
msgstr ""
-#: cp/decl.c:10033
+#: cp/decl.c:10140
#, gcc-internal-format
msgid "%qD should return by value"
msgstr ""
-#: cp/decl.c:10045 cp/decl.c:10049
+#: cp/decl.c:10151 cp/decl.c:10156
#, gcc-internal-format
msgid "%qD cannot have default arguments"
msgstr ""
-#: cp/decl.c:10107
+#: cp/decl.c:10214
#, gcc-internal-format
msgid "using template type parameter %qT after %qs"
msgstr ""
-#: cp/decl.c:10122
+#: cp/decl.c:10229
#, gcc-internal-format
msgid "using typedef-name %qD after %qs"
msgstr ""
-#: cp/decl.c:10123
+#: cp/decl.c:10230
#, gcc-internal-format
msgid "%q+D has a previous declaration here"
msgstr ""
-#: cp/decl.c:10131
+#: cp/decl.c:10238
#, gcc-internal-format
msgid "%qT referred to as %qs"
msgstr ""
-#: cp/decl.c:10132 cp/decl.c:10139
+#: cp/decl.c:10239 cp/decl.c:10246
#, gcc-internal-format
msgid "%q+T has a previous declaration here"
msgstr ""
-#: cp/decl.c:10138
+#: cp/decl.c:10245
#, gcc-internal-format
msgid "%qT referred to as enum"
msgstr ""
@@ -29698,269 +29875,278 @@ msgstr ""
#. void f(class C); // No template header here
#.
#. then the required template argument is missing.
-#: cp/decl.c:10153
+#: cp/decl.c:10260
#, gcc-internal-format
msgid "template argument required for %<%s %T%>"
msgstr ""
-#: cp/decl.c:10201 cp/name-lookup.c:2700
+#: cp/decl.c:10308 cp/name-lookup.c:2789
#, gcc-internal-format
msgid "%qD has the same name as the class in which it is declared"
msgstr ""
-#: cp/decl.c:10231 cp/name-lookup.c:2209 cp/parser.c:4040 cp/parser.c:14097
-#: cp/parser.c:16314
+#: cp/decl.c:10338 cp/name-lookup.c:2297
#, gcc-internal-format
msgid "reference to %qD is ambiguous"
msgstr ""
-#: cp/decl.c:10345
+#: cp/decl.c:10452
#, gcc-internal-format
msgid "use of enum %q#D without previous declaration"
msgstr ""
-#: cp/decl.c:10366
+#: cp/decl.c:10473
#, gcc-internal-format
msgid "redeclaration of %qT as a non-template"
msgstr ""
-#: cp/decl.c:10367
+#: cp/decl.c:10474
#, gcc-internal-format
msgid "previous declaration %q+D"
msgstr ""
-#: cp/decl.c:10478
+#: cp/decl.c:10585
#, gcc-internal-format
msgid "derived union %qT invalid"
msgstr ""
-#: cp/decl.c:10487
+#: cp/decl.c:10594
#, gcc-internal-format
msgid "Java class %qT cannot have multiple bases"
msgstr ""
-#: cp/decl.c:10498
+#: cp/decl.c:10605
#, gcc-internal-format
msgid "Java class %qT cannot have virtual bases"
msgstr ""
-#: cp/decl.c:10521
+#: cp/decl.c:10625
#, gcc-internal-format
msgid "base type %qT fails to be a struct or class type"
msgstr ""
-#: cp/decl.c:10554
+#: cp/decl.c:10658
#, gcc-internal-format
msgid "recursive type %qT undefined"
msgstr ""
-#: cp/decl.c:10556
+#: cp/decl.c:10660
#, gcc-internal-format
msgid "duplicate base type %qT invalid"
msgstr ""
-#: cp/decl.c:10633
+#: cp/decl.c:10744
#, gcc-internal-format
msgid "multiple definition of %q#T"
msgstr ""
-#: cp/decl.c:10634
+#: cp/decl.c:10745
#, gcc-internal-format
msgid "%Jprevious definition here"
msgstr ""
+#: cp/decl.c:10789
+#, gcc-internal-format
+msgid "underlying type %<%T%> of %<%T%> must be an integral type"
+msgstr ""
+
#. DR 377
#.
#. IF no integral type can represent all the enumerator values, the
#. enumeration is ill-formed.
-#: cp/decl.c:10773
+#: cp/decl.c:10921
#, gcc-internal-format
msgid "no integral type can represent all of the enumerator values for %qT"
msgstr ""
-#: cp/decl.c:10884
+#: cp/decl.c:11052
#, gcc-internal-format
msgid "enumerator value for %qD is not an integer constant"
msgstr ""
-#: cp/decl.c:10912
+#: cp/decl.c:11080
#, gcc-internal-format
msgid "overflow in enumeration values at %qD"
msgstr ""
-#: cp/decl.c:10989
+#: cp/decl.c:11099
+#, gcc-internal-format
+msgid "enumerator value %E is too large for underlying type %<%T%>"
+msgstr ""
+
+#: cp/decl.c:11198
#, gcc-internal-format
msgid "return type %q#T is incomplete"
msgstr ""
-#: cp/decl.c:10991
+#: cp/decl.c:11200
#, gcc-internal-format
msgid "return type has Java class type %q#T"
msgstr ""
-#: cp/decl.c:11116 cp/typeck.c:6728
+#: cp/decl.c:11325 cp/typeck.c:6855
#, gcc-internal-format
msgid "%<operator=%> should return a reference to %<*this%>"
msgstr ""
-#: cp/decl.c:11505
+#: cp/decl.c:11719
#, gcc-internal-format
msgid "parameter %qD declared void"
msgstr ""
-#: cp/decl.c:11993
+#: cp/decl.c:12206
#, gcc-internal-format
msgid "invalid member function declaration"
msgstr ""
-#: cp/decl.c:12008
+#: cp/decl.c:12221
#, gcc-internal-format
msgid "%qD is already defined in class %qT"
msgstr ""
-#: cp/decl.c:12255
+#: cp/decl.c:12467
#, gcc-internal-format
msgid "static member function %q#D declared with type qualifiers"
msgstr ""
-#: cp/decl2.c:268
+#: cp/decl2.c:270
#, gcc-internal-format
msgid "name missing for member function"
msgstr ""
-#: cp/decl2.c:339 cp/decl2.c:353
+#: cp/decl2.c:341 cp/decl2.c:355
#, gcc-internal-format
msgid "ambiguous conversion for array subscript"
msgstr ""
-#: cp/decl2.c:347
+#: cp/decl2.c:349
#, gcc-internal-format
msgid "invalid types %<%T[%T]%> for array subscript"
msgstr ""
-#: cp/decl2.c:390
+#: cp/decl2.c:392
#, gcc-internal-format
msgid "deleting array %q#D"
msgstr ""
-#: cp/decl2.c:396
+#: cp/decl2.c:398
#, gcc-internal-format
msgid "type %q#T argument given to %<delete%>, expected pointer"
msgstr ""
-#: cp/decl2.c:408
+#: cp/decl2.c:410
#, gcc-internal-format
msgid ""
"cannot delete a function. Only pointer-to-objects are valid arguments to %"
"<delete%>"
msgstr ""
-#: cp/decl2.c:416
+#: cp/decl2.c:418
#, gcc-internal-format
msgid "deleting %qT is undefined"
msgstr ""
-#: cp/decl2.c:459 cp/pt.c:3845
+#: cp/decl2.c:461 cp/pt.c:3833
#, gcc-internal-format
msgid "template declaration of %q#D"
msgstr ""
-#: cp/decl2.c:511
+#: cp/decl2.c:513
#, gcc-internal-format
msgid "Java method %qD has non-Java return type %qT"
msgstr ""
-#: cp/decl2.c:528
+#: cp/decl2.c:530
#, gcc-internal-format
msgid "Java method %qD has non-Java parameter type %qT"
msgstr ""
-#: cp/decl2.c:639
+#: cp/decl2.c:641
#, gcc-internal-format
msgid "prototype for %q#D does not match any in class %qT"
msgstr ""
-#: cp/decl2.c:719
+#: cp/decl2.c:721
#, gcc-internal-format
msgid "local class %q#T shall not have static data member %q#D"
msgstr ""
-#: cp/decl2.c:727
+#: cp/decl2.c:729
#, gcc-internal-format
msgid "initializer invalid for static member with constructor"
msgstr ""
-#: cp/decl2.c:730
+#: cp/decl2.c:732
#, gcc-internal-format
msgid "(an out of class initialization is required)"
msgstr ""
-#: cp/decl2.c:790
+#: cp/decl2.c:792
#, gcc-internal-format
msgid "member %qD conflicts with virtual function table field name"
msgstr ""
-#: cp/decl2.c:810
+#: cp/decl2.c:812
#, gcc-internal-format
msgid "%qD is already defined in %qT"
msgstr ""
-#: cp/decl2.c:831
+#: cp/decl2.c:850
#, gcc-internal-format
msgid "initializer specified for static member function %qD"
msgstr ""
-#: cp/decl2.c:854
+#: cp/decl2.c:873
#, gcc-internal-format
msgid "field initializer is not constant"
msgstr ""
-#: cp/decl2.c:881
+#: cp/decl2.c:900
#, gcc-internal-format
msgid "%<asm%> specifiers are not permitted on non-static data members"
msgstr ""
-#: cp/decl2.c:932
+#: cp/decl2.c:952
#, gcc-internal-format
msgid "bit-field %qD with non-integral type"
msgstr ""
-#: cp/decl2.c:938
+#: cp/decl2.c:958
#, gcc-internal-format
msgid "cannot declare %qD to be a bit-field type"
msgstr ""
-#: cp/decl2.c:948
+#: cp/decl2.c:968
#, gcc-internal-format
msgid "cannot declare bit-field %qD with function type"
msgstr ""
-#: cp/decl2.c:955
+#: cp/decl2.c:975
#, gcc-internal-format
msgid "%qD is already defined in the class %qT"
msgstr ""
-#: cp/decl2.c:962
+#: cp/decl2.c:982
#, gcc-internal-format
msgid "static member %qD cannot be a bit-field"
msgstr ""
-#: cp/decl2.c:1140
+#: cp/decl2.c:1250
#, gcc-internal-format
msgid "anonymous struct not inside named type"
msgstr ""
-#: cp/decl2.c:1224
+#: cp/decl2.c:1334
#, gcc-internal-format
msgid "namespace-scope anonymous aggregates must be static"
msgstr ""
-#: cp/decl2.c:1233
+#: cp/decl2.c:1343
#, gcc-internal-format
msgid "anonymous union with no members"
msgstr ""
-#: cp/decl2.c:1269
+#: cp/decl2.c:1379
#, gcc-internal-format
msgid "%<operator new%> must return type %qT"
msgstr ""
@@ -29969,118 +30155,128 @@ msgstr ""
#.
#. The first parameter shall not have an associated default
#. argument.
-#: cp/decl2.c:1280
+#: cp/decl2.c:1390
#, gcc-internal-format
msgid "the first parameter of %<operator new%> cannot have a default argument"
msgstr ""
-#: cp/decl2.c:1296
+#: cp/decl2.c:1406
#, gcc-internal-format
msgid "%<operator new%> takes type %<size_t%> (%qT) as first parameter"
msgstr ""
-#: cp/decl2.c:1325
+#: cp/decl2.c:1435
#, gcc-internal-format
msgid "%<operator delete%> must return type %qT"
msgstr ""
-#: cp/decl2.c:1334
+#: cp/decl2.c:1444
#, gcc-internal-format
msgid "%<operator delete%> takes type %qT as first parameter"
msgstr ""
-#: cp/decl2.c:2003
+#: cp/decl2.c:2121
#, gcc-internal-format
msgid "%qT has a field %qD whose type uses the anonymous namespace"
msgstr ""
-#: cp/decl2.c:2010
+#: cp/decl2.c:2128
#, gcc-internal-format
msgid "%qT declared with greater visibility than the type of its field %qD"
msgstr ""
-#: cp/decl2.c:2023
+#: cp/decl2.c:2141
#, gcc-internal-format
msgid "%qT has a base %qT whose type uses the anonymous namespace"
msgstr ""
-#: cp/decl2.c:2029
+#: cp/decl2.c:2147
#, gcc-internal-format
msgid "%qT declared with greater visibility than its base %qT"
msgstr ""
-#: cp/decl2.c:3414
+#: cp/decl2.c:3575
#, gcc-internal-format
msgid "inline function %q+D used but never defined"
msgstr ""
-#: cp/decl2.c:3562
+#: cp/decl2.c:3724
#, gcc-internal-format
msgid "default argument missing for parameter %P of %q+#D"
msgstr ""
+#: cp/decl2.c:3836 cp/search.c:1919
+#, gcc-internal-format
+msgid "deleted function %q+D"
+msgstr ""
+
+#: cp/decl2.c:3837
+#, gcc-internal-format
+msgid "used here"
+msgstr ""
+
#. We really want to suppress this warning in system headers,
#. because libstdc++ uses variadic templates even when we aren't
#. in C++0x mode.
-#: cp/error.c:2712
+#: cp/error.c:2695
#, gcc-internal-format
-msgid "ISO C++ does not include variadic templates"
+msgid "%s only available with -std=c++0x or -std=gnu++0x"
msgstr ""
#. Can't throw a reference.
-#: cp/except.c:269
+#: cp/except.c:286
#, gcc-internal-format
msgid "type %qT is disallowed in Java %<throw%> or %<catch%>"
msgstr ""
-#: cp/except.c:280
+#: cp/except.c:297
#, gcc-internal-format
msgid "call to Java %<catch%> or %<throw%> with %<jthrowable%> undefined"
msgstr ""
#. Thrown object must be a Throwable.
-#: cp/except.c:287
+#: cp/except.c:304
#, gcc-internal-format
msgid "type %qT is not derived from %<java::lang::Throwable%>"
msgstr ""
-#: cp/except.c:350
+#: cp/except.c:367
#, gcc-internal-format
msgid "mixing C++ and Java catches in a single translation unit"
msgstr ""
-#: cp/except.c:620
+#: cp/except.c:638
#, gcc-internal-format
msgid "throwing NULL, which has integral, not pointer type"
msgstr ""
-#: cp/except.c:643 cp/init.c:1780
+#: cp/except.c:661 cp/init.c:1945
#, gcc-internal-format
msgid "%qD should never be overloaded"
msgstr ""
-#: cp/except.c:739
+#: cp/except.c:758
#, gcc-internal-format
msgid " in thrown expression"
msgstr ""
-#: cp/except.c:895
+#: cp/except.c:914
#, gcc-internal-format
msgid ""
"expression %qE of abstract class type %qT cannot be used in throw-expression"
msgstr ""
-#: cp/except.c:980
+#: cp/except.c:999
#, gcc-internal-format
msgid "%Hexception of type %qT will be caught"
msgstr ""
-#: cp/except.c:982
+#: cp/except.c:1001
#, gcc-internal-format
msgid "%H by earlier handler for %qT"
msgstr ""
-#: cp/except.c:1012
+#: cp/except.c:1031
#, gcc-internal-format
msgid "%H%<...%> handler must be the last handler for its try block"
msgstr ""
@@ -30149,288 +30345,295 @@ msgstr ""
msgid "%qT is already a friend of %qT"
msgstr ""
-#: cp/friend.c:494
+#: cp/friend.c:501
#, gcc-internal-format
msgid "member %qD declared as friend before type %qT defined"
msgstr ""
-#: cp/friend.c:543
+#: cp/friend.c:550
#, gcc-internal-format
msgid "friend declaration %qD in local class without prior declaration"
msgstr ""
-#: cp/friend.c:564
+#: cp/friend.c:573
#, gcc-internal-format
msgid "friend declaration %q#D declares a non-template function"
msgstr ""
-#: cp/friend.c:568
+#: cp/friend.c:577
#, gcc-internal-format
msgid ""
"(if this is not what you intended, make sure the function template has "
"already been declared and add <> after the function name here) "
msgstr ""
-#: cp/init.c:334
+#: cp/init.c:372
+#, gcc-internal-format
+msgid "value-initialization of reference"
+msgstr ""
+
+#: cp/init.c:479
#, gcc-internal-format
msgid "%J%qD should be initialized in the member initialization list"
msgstr ""
-#: cp/init.c:382
+#. TYPE_NEEDS_CONSTRUCTING can be set just because we have a
+#. vtable; still give this diagnostic.
+#: cp/init.c:525 cp/init.c:548
#, gcc-internal-format
-msgid "%Jdefault-initialization of %q#D, which has reference type"
+msgid "%Juninitialized member %qD with %<const%> type %qT"
msgstr ""
-#: cp/init.c:388
+#: cp/init.c:539
#, gcc-internal-format
-msgid "%Juninitialized reference member %qD"
+msgid "%Jdefault-initialization of %q#D, which has reference type"
msgstr ""
-#: cp/init.c:391
+#: cp/init.c:545
#, gcc-internal-format
-msgid "%Juninitialized member %qD with %<const%> type %qT"
+msgid "%Juninitialized reference member %qD"
msgstr ""
-#: cp/init.c:534
+#: cp/init.c:693
#, gcc-internal-format
msgid "%q+D will be initialized after"
msgstr ""
-#: cp/init.c:537
+#: cp/init.c:696
#, gcc-internal-format
msgid "base %qT will be initialized after"
msgstr ""
-#: cp/init.c:540
+#: cp/init.c:699
#, gcc-internal-format
msgid " %q+#D"
msgstr ""
-#: cp/init.c:542
+#: cp/init.c:701
#, gcc-internal-format
msgid " base %qT"
msgstr ""
-#: cp/init.c:543
+#: cp/init.c:702
#, gcc-internal-format
msgid "%J when initialized here"
msgstr ""
-#: cp/init.c:559
+#: cp/init.c:718
#, gcc-internal-format
msgid "%Jmultiple initializations given for %qD"
msgstr ""
-#: cp/init.c:562
+#: cp/init.c:721
#, gcc-internal-format
msgid "%Jmultiple initializations given for base %qT"
msgstr ""
-#: cp/init.c:629
+#: cp/init.c:788
#, gcc-internal-format
msgid "%Jinitializations for multiple members of %qT"
msgstr ""
-#: cp/init.c:691
+#: cp/init.c:851
#, gcc-internal-format
msgid ""
"%Jbase class %q#T should be explicitly initialized in the copy constructor"
msgstr ""
-#: cp/init.c:915 cp/init.c:934
+#: cp/init.c:1080 cp/init.c:1099
#, gcc-internal-format
msgid "class %qT does not have any field named %qD"
msgstr ""
-#: cp/init.c:921
+#: cp/init.c:1086
#, gcc-internal-format
msgid ""
"%q#D is a static data member; it can only be initialized at its definition"
msgstr ""
-#: cp/init.c:928
+#: cp/init.c:1093
#, gcc-internal-format
msgid "%q#D is not a non-static data member of %qT"
msgstr ""
-#: cp/init.c:967
+#: cp/init.c:1132
#, gcc-internal-format
msgid "unnamed initializer for %qT, which has no base classes"
msgstr ""
-#: cp/init.c:975
+#: cp/init.c:1140
#, gcc-internal-format
msgid "unnamed initializer for %qT, which uses multiple inheritance"
msgstr ""
-#: cp/init.c:1021
+#: cp/init.c:1186
#, gcc-internal-format
msgid "%qD is both a direct base and an indirect virtual base"
msgstr ""
-#: cp/init.c:1029
+#: cp/init.c:1194
#, gcc-internal-format
msgid "type %qT is not a direct or virtual base of %qT"
msgstr ""
-#: cp/init.c:1032
+#: cp/init.c:1197
#, gcc-internal-format
msgid "type %qT is not a direct base of %qT"
msgstr ""
-#: cp/init.c:1112
+#: cp/init.c:1278
#, gcc-internal-format
msgid "bad array initializer"
msgstr ""
-#: cp/init.c:1287
+#: cp/init.c:1457 cp/semantics.c:2497
#, gcc-internal-format
-msgid "%qT is not an aggregate type"
+msgid "%qT is not a class type"
msgstr ""
-#: cp/init.c:1341
+#: cp/init.c:1511
#, gcc-internal-format
msgid "incomplete type %qT does not have member %qD"
msgstr ""
-#: cp/init.c:1354
+#: cp/init.c:1524
#, gcc-internal-format
msgid "invalid pointer to bit-field %qD"
msgstr ""
-#: cp/init.c:1431
+#: cp/init.c:1602
#, gcc-internal-format
msgid "invalid use of non-static member function %qD"
msgstr ""
-#: cp/init.c:1437
+#: cp/init.c:1608
#, gcc-internal-format
msgid "invalid use of non-static data member %qD"
msgstr ""
-#: cp/init.c:1714
+#: cp/init.c:1887
#, gcc-internal-format
msgid "invalid type %<void%> for new"
msgstr ""
-#: cp/init.c:1724
+#: cp/init.c:1900
#, gcc-internal-format
msgid "uninitialized const in %<new%> of %q#T"
msgstr ""
-#: cp/init.c:1775
+#: cp/init.c:1939
#, gcc-internal-format
msgid "call to Java constructor with %qs undefined"
msgstr ""
-#: cp/init.c:1791
+#: cp/init.c:1957
#, gcc-internal-format
msgid "Java class %q#T object allocated using placement new"
msgstr ""
-#: cp/init.c:1820
+#: cp/init.c:1987
#, gcc-internal-format
msgid "no suitable %qD found in class %qT"
msgstr ""
-#: cp/init.c:1825
+#: cp/init.c:1994
#, gcc-internal-format
msgid "request for member %qD is ambiguous"
msgstr ""
-#: cp/init.c:1977
+#: cp/init.c:2174
#, gcc-internal-format
msgid "ISO C++ forbids initialization in array new"
msgstr ""
-#: cp/init.c:2179
+#: cp/init.c:2390
#, gcc-internal-format
msgid "size in array new must have integral type"
msgstr ""
-#: cp/init.c:2188
+#: cp/init.c:2403
#, gcc-internal-format
msgid "new cannot be applied to a reference type"
msgstr ""
-#: cp/init.c:2194
+#: cp/init.c:2412
#, gcc-internal-format
msgid "new cannot be applied to a function type"
msgstr ""
-#: cp/init.c:2233
+#: cp/init.c:2451
#, gcc-internal-format
msgid "call to Java constructor, while %<jclass%> undefined"
msgstr ""
-#: cp/init.c:2251
+#: cp/init.c:2469
#, gcc-internal-format
msgid "can't find %<class$%> in %qT"
msgstr ""
-#: cp/init.c:2612
+#: cp/init.c:2837
#, gcc-internal-format
msgid "initializer ends prematurely"
msgstr ""
-#: cp/init.c:2667
+#: cp/init.c:2895
#, gcc-internal-format
msgid "cannot initialize multi-dimensional array with initializer"
msgstr ""
-#: cp/init.c:2804
+#: cp/init.c:3038
#, gcc-internal-format
msgid "possible problem detected in invocation of delete operator:"
msgstr ""
-#: cp/init.c:2807
+#: cp/init.c:3042
#, gcc-internal-format
msgid ""
"neither the destructor nor the class-specific operator delete will be "
"called, even if they are declared when the class is defined."
msgstr ""
-#: cp/init.c:2828
+#: cp/init.c:3064
#, gcc-internal-format
msgid "unknown array size in delete"
msgstr ""
-#: cp/init.c:3075
+#: cp/init.c:3317
#, gcc-internal-format
msgid "type to vector delete is neither pointer or array type"
msgstr ""
-#: cp/lex.c:489
+#: cp/lex.c:318
#, gcc-internal-format
msgid "junk at end of #pragma %s"
msgstr ""
-#: cp/lex.c:496
+#: cp/lex.c:325
#, gcc-internal-format
msgid "invalid #pragma %s"
msgstr ""
-#: cp/lex.c:504
+#: cp/lex.c:333
#, gcc-internal-format
msgid "#pragma vtable no longer supported"
msgstr ""
-#: cp/lex.c:583
+#: cp/lex.c:405
#, gcc-internal-format
msgid "#pragma implementation for %qs appears after file is included"
msgstr ""
-#: cp/lex.c:608
+#: cp/lex.c:429
#, gcc-internal-format
msgid "junk at end of #pragma GCC java_exceptions"
msgstr ""
-#: cp/lex.c:622
+#: cp/lex.c:443
#, gcc-internal-format
msgid "%qD not defined"
msgstr ""
-#: cp/lex.c:626
+#: cp/lex.c:447
#, gcc-internal-format
msgid "%qD was not declared in this scope"
msgstr ""
@@ -30445,63 +30648,63 @@ msgstr ""
#. 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.
-#: cp/lex.c:663
+#: cp/lex.c:484
#, gcc-internal-format
msgid ""
"there are no arguments to %qD that depend on a template parameter, so a "
"declaration of %qD must be available"
msgstr ""
-#: cp/lex.c:672
+#: cp/lex.c:493
#, gcc-internal-format
msgid ""
"(if you use %<-fpermissive%>, G++ will accept your code, but allowing the "
"use of an undeclared name is deprecated)"
msgstr ""
-#: cp/mangle.c:1691
+#: cp/mangle.c:1647
#, gcc-internal-format
msgid "mangling typeof, use decltype instead"
msgstr ""
-#: cp/mangle.c:2211
+#: cp/mangle.c:2171
#, gcc-internal-format
msgid "call_expr cannot be mangled due to a defect in the C++ ABI"
msgstr ""
-#: cp/mangle.c:2219
+#: cp/mangle.c:2179
#, gcc-internal-format
msgid "zero-operand casts cannot be mangled due to a defect in the C++ ABI"
msgstr ""
-#: cp/mangle.c:2269
+#: cp/mangle.c:2229
#, gcc-internal-format
msgid "omitted middle operand to %<?:%> operand cannot be mangled"
msgstr ""
-#: cp/mangle.c:2587
+#: cp/mangle.c:2542
#, gcc-internal-format
msgid "the mangled name of %qD will change in a future version of GCC"
msgstr ""
-#: cp/method.c:462
+#: cp/method.c:461
#, gcc-internal-format
msgid "generic thunk code fails for method %q#D which uses %<...%>"
msgstr ""
-#: cp/method.c:698
+#: cp/method.c:697
#, gcc-internal-format
msgid "non-static const member %q#D, can't use default assignment operator"
msgstr ""
-#: cp/method.c:704
+#: cp/method.c:703
#, gcc-internal-format
msgid "non-static reference member %q#D, can't use default assignment operator"
msgstr ""
#: cp/method.c:816
#, gcc-internal-format
-msgid "%Hsynthesized method %qD first required here "
+msgid "synthesized method %qD first required here "
msgstr ""
#: cp/method.c:1159
@@ -30511,7 +30714,7 @@ msgid ""
"future version of GCC due to implicit virtual destructor"
msgstr ""
-#: cp/name-lookup.c:727
+#: cp/name-lookup.c:728
#, gcc-internal-format
msgid "redeclaration of %<wchar_t%> as %qT"
msgstr ""
@@ -30522,1047 +30725,1138 @@ msgstr ""
#. [basic.start.main]
#.
#. This function shall not be overloaded.
-#: cp/name-lookup.c:757
+#: cp/name-lookup.c:758
#, gcc-internal-format
msgid "invalid redeclaration of %q+D"
msgstr ""
-#: cp/name-lookup.c:758
+#: cp/name-lookup.c:759
#, gcc-internal-format
msgid "as %qD"
msgstr ""
-#: cp/name-lookup.c:849
+#: cp/name-lookup.c:799
+#, gcc-internal-format
+msgid "declaration of %q#D with C language linkage"
+msgstr ""
+
+#: cp/name-lookup.c:803
+#, gcc-internal-format
+msgid "due to different exception specifications"
+msgstr ""
+
+#: cp/name-lookup.c:893
#, gcc-internal-format
msgid "type mismatch with previous external decl of %q#D"
msgstr ""
-#: cp/name-lookup.c:850
+#: cp/name-lookup.c:894
#, gcc-internal-format
msgid "previous external decl of %q+#D"
msgstr ""
-#: cp/name-lookup.c:941
+#: cp/name-lookup.c:985
#, gcc-internal-format
msgid "extern declaration of %q#D doesn't match"
msgstr ""
-#: cp/name-lookup.c:942
+#: cp/name-lookup.c:986
#, gcc-internal-format
msgid "global declaration %q+#D"
msgstr ""
-#: cp/name-lookup.c:979 cp/name-lookup.c:986
+#: cp/name-lookup.c:1023 cp/name-lookup.c:1030
#, gcc-internal-format
msgid "declaration of %q#D shadows a parameter"
msgstr ""
#. Location of previous decl is not useful in this case.
-#: cp/name-lookup.c:1011
+#: cp/name-lookup.c:1055
#, gcc-internal-format
msgid "declaration of %qD shadows a member of 'this'"
msgstr ""
-#: cp/name-lookup.c:1017
+#: cp/name-lookup.c:1061
#, gcc-internal-format
msgid "declaration of %qD shadows a previous local"
msgstr ""
-#: cp/name-lookup.c:1024
+#: cp/name-lookup.c:1068
#, gcc-internal-format
msgid "declaration of %qD shadows a global declaration"
msgstr ""
-#: cp/name-lookup.c:1147
+#: cp/name-lookup.c:1191
#, gcc-internal-format
msgid "name lookup of %qD changed"
msgstr ""
-#: cp/name-lookup.c:1148
+#: cp/name-lookup.c:1192
#, gcc-internal-format
msgid " matches this %q+D under ISO standard rules"
msgstr ""
-#: cp/name-lookup.c:1150
+#: cp/name-lookup.c:1194
#, gcc-internal-format
msgid " matches this %q+D under old rules"
msgstr ""
-#: cp/name-lookup.c:1168 cp/name-lookup.c:1176
+#: cp/name-lookup.c:1212 cp/name-lookup.c:1220
#, gcc-internal-format
-msgid "name lookup of %qD changed for new ISO %<for%> scoping"
+msgid "name lookup of %qD changed for ISO %<for%> scoping"
msgstr ""
-#: cp/name-lookup.c:1170
+#: cp/name-lookup.c:1214
#, gcc-internal-format
msgid " cannot use obsolete binding at %q+D because it has a destructor"
msgstr ""
-#: cp/name-lookup.c:1178
+#: cp/name-lookup.c:1223
#, gcc-internal-format
msgid " using obsolete binding at %q+D"
msgstr ""
-#: cp/name-lookup.c:1231
+#: cp/name-lookup.c:1229 cp/parser.c:10022
+#, gcc-internal-format
+msgid "(if you use %<-fpermissive%> G++ will accept your code)"
+msgstr ""
+
+#: cp/name-lookup.c:1285
#, gcc-internal-format
msgid "%s %s(%E) %p %d\n"
msgstr ""
-#: cp/name-lookup.c:1234
+#: cp/name-lookup.c:1288
#, gcc-internal-format
msgid "%s %s %p %d\n"
msgstr ""
-#: cp/name-lookup.c:1361
+#: cp/name-lookup.c:1416
#, gcc-internal-format
msgid "XXX is_class_level != (current_scope == class_scope)\n"
msgstr ""
-#: cp/name-lookup.c:1922
+#: cp/name-lookup.c:2010
#, gcc-internal-format
msgid "%q#D hides constructor for %q#T"
msgstr ""
-#: cp/name-lookup.c:1939
+#: cp/name-lookup.c:2027
#, gcc-internal-format
msgid "%q#D conflicts with previous using declaration %q#D"
msgstr ""
-#: cp/name-lookup.c:1962
+#: cp/name-lookup.c:2050
#, gcc-internal-format
msgid "previous non-function declaration %q+#D"
msgstr ""
-#: cp/name-lookup.c:1963
+#: cp/name-lookup.c:2051
#, gcc-internal-format
msgid "conflicts with function declaration %q#D"
msgstr ""
#. It's a nested name with template parameter dependent scope.
#. This can only be using-declaration for class member.
-#: cp/name-lookup.c:2041 cp/name-lookup.c:2066
+#: cp/name-lookup.c:2129 cp/name-lookup.c:2154
#, gcc-internal-format
msgid "%qT is not a namespace"
msgstr ""
#. 7.3.3/5
#. A using-declaration shall not name a template-id.
-#: cp/name-lookup.c:2051
+#: cp/name-lookup.c:2139
#, gcc-internal-format
msgid "a using-declaration cannot specify a template-id. Try %<using %D%>"
msgstr ""
-#: cp/name-lookup.c:2058
+#: cp/name-lookup.c:2146
#, gcc-internal-format
msgid "namespace %qD not allowed in using-declaration"
msgstr ""
-#: cp/name-lookup.c:2094
+#: cp/name-lookup.c:2182
#, gcc-internal-format
msgid "%qD not declared"
msgstr ""
-#: cp/name-lookup.c:2130 cp/name-lookup.c:2167 cp/name-lookup.c:2201
-#: cp/name-lookup.c:2216
+#: cp/name-lookup.c:2218 cp/name-lookup.c:2255 cp/name-lookup.c:2289
+#: cp/name-lookup.c:2304
#, gcc-internal-format
msgid "%qD is already declared in this scope"
msgstr ""
-#: cp/name-lookup.c:2819
+#: cp/name-lookup.c:2908
#, gcc-internal-format
msgid "using-declaration for non-member at class scope"
msgstr ""
-#: cp/name-lookup.c:2826
+#: cp/name-lookup.c:2915
#, gcc-internal-format
msgid "%<%T::%D%> names destructor"
msgstr ""
-#: cp/name-lookup.c:2831
+#: cp/name-lookup.c:2920
#, gcc-internal-format
msgid "%<%T::%D%> names constructor"
msgstr ""
-#: cp/name-lookup.c:2836
+#: cp/name-lookup.c:2925
#, gcc-internal-format
msgid "%<%T::%D%> names constructor in %qT"
msgstr ""
-#: cp/name-lookup.c:2886
+#: cp/name-lookup.c:2975
#, gcc-internal-format
msgid "no members matching %<%T::%D%> in %q#T"
msgstr ""
-#: cp/name-lookup.c:2954
+#: cp/name-lookup.c:3043
#, gcc-internal-format
msgid "declaration of %qD not in a namespace surrounding %qD"
msgstr ""
-#: cp/name-lookup.c:2962
+#: cp/name-lookup.c:3051
#, gcc-internal-format
msgid "explicit qualification in declaration of %qD"
msgstr ""
-#: cp/name-lookup.c:3005
+#: cp/name-lookup.c:3094
#, gcc-internal-format
msgid "%qD should have been declared inside %qD"
msgstr ""
-#: cp/name-lookup.c:3050
+#: cp/name-lookup.c:3139
#, gcc-internal-format
msgid "%qD attribute requires a single NTBS argument"
msgstr ""
-#: cp/name-lookup.c:3057
+#: cp/name-lookup.c:3146
#, gcc-internal-format
msgid ""
"%qD attribute is meaningless since members of the anonymous namespace get "
"local symbols"
msgstr ""
-#: cp/name-lookup.c:3066 cp/name-lookup.c:3435
+#: cp/name-lookup.c:3155 cp/name-lookup.c:3524
#, gcc-internal-format
msgid "%qD attribute directive ignored"
msgstr ""
-#: cp/name-lookup.c:3111
+#: cp/name-lookup.c:3200
#, gcc-internal-format
msgid "namespace alias %qD not allowed here, assuming %qD"
msgstr ""
-#: cp/name-lookup.c:3423
+#: cp/name-lookup.c:3512
#, gcc-internal-format
msgid "strong using only meaningful at namespace scope"
msgstr ""
-#: cp/name-lookup.c:3427
+#: cp/name-lookup.c:3516
#, gcc-internal-format
msgid "current namespace %qD does not enclose strongly used namespace %qD"
msgstr ""
-#: cp/name-lookup.c:4320
+#: cp/name-lookup.c:4411
#, gcc-internal-format
msgid "%q+D is not a function,"
msgstr ""
-#: cp/name-lookup.c:4321
+#: cp/name-lookup.c:4412
#, gcc-internal-format
msgid " conflict with %q+D"
msgstr ""
-#: cp/name-lookup.c:4756
+#: cp/name-lookup.c:4856
#, gcc-internal-format
msgid "argument dependent lookup finds %q+D"
msgstr ""
-#: cp/name-lookup.c:5188
+#: cp/name-lookup.c:5289
#, gcc-internal-format
msgid "XXX entering pop_everything ()\n"
msgstr ""
-#: cp/name-lookup.c:5197
+#: cp/name-lookup.c:5298
#, gcc-internal-format
msgid "XXX leaving pop_everything ()\n"
msgstr ""
-#: cp/parser.c:451
+#: cp/parser.c:441
#, gcc-internal-format
msgid "identifier %<%s%> will become a keyword in C++0x"
msgstr ""
-#: cp/parser.c:2069
+#: cp/parser.c:2077
#, gcc-internal-format
-msgid "%<#pragma%> is not allowed here"
+msgid "%H%<#pragma%> is not allowed here"
msgstr ""
-#: cp/parser.c:2099
+#: cp/parser.c:2108
#, gcc-internal-format
-msgid "%<%E::%E%> has not been declared"
+msgid "%H%<%E::%E%> has not been declared"
msgstr ""
-#: cp/parser.c:2102
+#: cp/parser.c:2111
#, gcc-internal-format
-msgid "%<::%E%> has not been declared"
+msgid "%H%<::%E%> has not been declared"
msgstr ""
-#: cp/parser.c:2105
+#: cp/parser.c:2114
#, gcc-internal-format
-msgid "request for member %qE in non-class type %qT"
+msgid "%Hrequest for member %qE in non-class type %qT"
msgstr ""
-#: cp/parser.c:2108
+#: cp/parser.c:2117
#, gcc-internal-format
-msgid "%<%T::%E%> has not been declared"
+msgid "%H%<%T::%E%> has not been declared"
msgstr ""
-#: cp/parser.c:2111
+#: cp/parser.c:2120
#, gcc-internal-format
-msgid "%qE has not been declared"
+msgid "%H%qE has not been declared"
msgstr ""
-#: cp/parser.c:2114
+#: cp/parser.c:2123
#, gcc-internal-format
-msgid "%<%E::%E%> %s"
+msgid "%H%<%E::%E%> %s"
msgstr ""
-#: cp/parser.c:2116
+#: cp/parser.c:2125
#, gcc-internal-format
-msgid "%<::%E%> %s"
+msgid "%H%<::%E%> %s"
msgstr ""
-#: cp/parser.c:2118
+#: cp/parser.c:2127
#, gcc-internal-format
-msgid "%qE %s"
+msgid "%H%qE %s"
msgstr ""
-#: cp/parser.c:2155
+#: cp/parser.c:2162
#, gcc-internal-format
-msgid "ISO C++ 1998 does not support %<long long%>"
+msgid "%H%<long long long%> is too long for GCC"
msgstr ""
-#: cp/parser.c:2175
+#: cp/parser.c:2166
#, gcc-internal-format
-msgid "duplicate %qs"
+msgid "ISO C++ 1998 does not support %<long long%>"
msgstr ""
-#: cp/parser.c:2218
+#: cp/parser.c:2186
#, gcc-internal-format
-msgid "new types may not be defined in a return type"
+msgid "%Hduplicate %qs"
msgstr ""
-#: cp/parser.c:2219
+#: cp/parser.c:2230
#, gcc-internal-format
-msgid "(perhaps a semicolon is missing after the definition of %qT)"
+msgid "%Hnew types may not be defined in a return type"
msgstr ""
-#: cp/parser.c:2238 cp/parser.c:4081 cp/pt.c:5520
+#: cp/parser.c:2232
#, gcc-internal-format
-msgid "%qT is not a template"
+msgid "(perhaps a semicolon is missing after the definition of %qT)"
msgstr ""
-#: cp/parser.c:2240
+#: cp/parser.c:2252
#, gcc-internal-format
-msgid "%qE is not a template"
+msgid "%H%qT is not a template"
msgstr ""
-#: cp/parser.c:2242
+#: cp/parser.c:2254
#, gcc-internal-format
-msgid "invalid template-id"
+msgid "%H%qE is not a template"
msgstr ""
-#: cp/parser.c:2271
+#: cp/parser.c:2256
#, gcc-internal-format
-msgid "%s cannot appear in a constant-expression"
+msgid "%Hinvalid template-id"
msgstr ""
-#: cp/parser.c:2296
+#: cp/parser.c:2318
#, gcc-internal-format
-msgid "invalid use of template-name %qE without an argument list"
+msgid "%Hinvalid use of template-name %qE without an argument list"
msgstr ""
-#: cp/parser.c:2298
+#: cp/parser.c:2321
#, gcc-internal-format
-msgid "invalid use of destructor %qD as a type"
+msgid "%Hinvalid use of destructor %qD as a type"
msgstr ""
#. Something like 'unsigned A a;'
-#: cp/parser.c:2301
+#: cp/parser.c:2324
#, gcc-internal-format
-msgid "invalid combination of multiple type-specifiers"
+msgid "%Hinvalid combination of multiple type-specifiers"
msgstr ""
#. Issue an error message.
-#: cp/parser.c:2305
+#: cp/parser.c:2329
#, gcc-internal-format
-msgid "%qE does not name a type"
+msgid "%H%qE does not name a type"
msgstr ""
-#: cp/parser.c:2337
+#: cp/parser.c:2362
#, gcc-internal-format
msgid "(perhaps %<typename %T::%E%> was intended)"
msgstr ""
-#: cp/parser.c:2352
+#: cp/parser.c:2377
#, gcc-internal-format
-msgid "%qE in namespace %qE does not name a type"
+msgid "%H%qE in namespace %qE does not name a type"
msgstr ""
-#: cp/parser.c:2355
+#: cp/parser.c:2380
#, gcc-internal-format
-msgid "%qE in class %qT does not name a type"
+msgid "%H%qE in class %qT does not name a type"
msgstr ""
-#: cp/parser.c:3164
+#: cp/parser.c:2942
+#, gcc-internal-format
+msgid "%Hunsupported non-standard concatenation of string literals"
+msgstr ""
+
+#: cp/parser.c:3220
#, gcc-internal-format
msgid "ISO C++ forbids braced-groups within expressions"
msgstr ""
-#: cp/parser.c:3175
+#: cp/parser.c:3231
#, gcc-internal-format
msgid ""
-"statement-expressions are not allowed outside functions nor in template-"
+"%Hstatement-expressions are not allowed outside functions nor in template-"
"argument lists"
msgstr ""
-#: cp/parser.c:3233
+#: cp/parser.c:3290
+#, gcc-internal-format
+msgid "%H%<this%> may not be used in this context"
+msgstr ""
+
+#: cp/parser.c:3476
+#, gcc-internal-format
+msgid "%Hlocal variable %qD may not appear in this context"
+msgstr ""
+
+#: cp/parser.c:3776
#, gcc-internal-format
-msgid "%<this%> may not be used in this context"
+msgid "%Hscope %qT before %<~%> is not a class-name"
msgstr ""
-#: cp/parser.c:3416
+#: cp/parser.c:3878
#, gcc-internal-format
-msgid "local variable %qD may not appear in this context"
+msgid "%Hdeclaration of %<~%T%> as member of %qT"
msgstr ""
-#: cp/parser.c:3715
+#: cp/parser.c:3892
#, gcc-internal-format
-msgid "scope %qT before %<~%> is not a class-name"
+msgid "%Htypedef-name %qD used as destructor declarator"
msgstr ""
-#: cp/parser.c:3816
+#: cp/parser.c:4106
#, gcc-internal-format
-msgid "declaration of %<~%T%> as member of %qT"
+msgid "%H%qD used without template parameters"
msgstr ""
-#: cp/parser.c:3830
+#: cp/parser.c:4110 cp/parser.c:14633 cp/parser.c:16909
#, gcc-internal-format
-msgid "typedef-name %qD used as destructor declarator"
+msgid "%Hreference to %qD is ambiguous"
msgstr ""
-#: cp/parser.c:4484
+#: cp/parser.c:4156 cp/pt.c:5594
+#, gcc-internal-format
+msgid "%qT is not a template"
+msgstr ""
+
+#. Warn the user that a compound literal is not
+#. allowed in standard C++.
+#: cp/parser.c:4579
#, gcc-internal-format
msgid "ISO C++ forbids compound-literals"
msgstr ""
-#: cp/parser.c:4841
+#: cp/parser.c:4947
#, gcc-internal-format
-msgid "%qE does not have class type"
+msgid "%H%qE does not have class type"
msgstr ""
-#: cp/parser.c:4924 cp/typeck.c:2013
+#: cp/parser.c:5031
#, gcc-internal-format
-msgid "invalid use of %qD"
+msgid "%Hinvalid use of %qD"
msgstr ""
-#: cp/parser.c:5484
+#: cp/parser.c:5607
#, gcc-internal-format
-msgid "array bound forbidden after parenthesized type-id"
+msgid "%Harray bound forbidden after parenthesized type-id"
msgstr ""
-#: cp/parser.c:5485
+#: cp/parser.c:5610
#, gcc-internal-format
msgid "try removing the parentheses around the type-id"
msgstr ""
-#: cp/parser.c:5675
+#: cp/parser.c:5803
#, gcc-internal-format
-msgid "expression in new-declarator must have integral or enumeration type"
+msgid "%Hexpression in new-declarator must have integral or enumeration type"
msgstr ""
-#: cp/parser.c:5864
+#: cp/parser.c:6002
#, gcc-internal-format
msgid "use of old-style cast"
msgstr ""
-#: cp/parser.c:5990
+#: cp/parser.c:6129
#, gcc-internal-format
msgid "%H%<>>%> operator will be treated as two right angle brackets in C++0x"
msgstr ""
-#: cp/parser.c:5993
+#: cp/parser.c:6132
#, gcc-internal-format
msgid "suggest parentheses around %<>>%> expression"
msgstr ""
-#: cp/parser.c:6797
+#: cp/parser.c:6947
#, gcc-internal-format
-msgid "case label %qE not within a switch statement"
+msgid "%Hcase label %qE not within a switch statement"
msgstr ""
-#: cp/parser.c:6926
+#: cp/parser.c:6959
#, gcc-internal-format
-msgid "%<else%> without a previous %<if%>"
+msgid "%Hcase label not within a switch statement"
msgstr ""
-#: cp/parser.c:7212
+#: cp/parser.c:7377
#, gcc-internal-format
msgid ""
"suggest a space before %<;%> or explicit braces around empty body in %<%s%> "
"statement"
msgstr ""
-#: cp/parser.c:7472
+#: cp/parser.c:7579
+#, gcc-internal-format
+msgid "%Hbreak statement not within loop or switch"
+msgstr ""
+
+#: cp/parser.c:7587 cp/parser.c:7607
+#, gcc-internal-format
+msgid "%Hinvalid exit from OpenMP structured block"
+msgstr ""
+
+#: cp/parser.c:7590
+#, gcc-internal-format
+msgid "%Hbreak statement used with OpenMP for loop"
+msgstr ""
+
+#: cp/parser.c:7600
+#, gcc-internal-format
+msgid "%Hcontinue statement not within a loop"
+msgstr ""
+
+#. Issue a warning about this use of a GNU extension.
+#: cp/parser.c:7643
#, gcc-internal-format
msgid "ISO C++ forbids computed gotos"
msgstr ""
-#: cp/parser.c:7612
+#: cp/parser.c:7783 cp/parser.c:15503
#, gcc-internal-format
msgid "extra %<;%>"
msgstr ""
-#: cp/parser.c:7829
+#: cp/parser.c:8004
#, gcc-internal-format
-msgid "%<__label__%> not at the beginning of a block"
+msgid "%H%<__label__%> not at the beginning of a block"
msgstr ""
-#: cp/parser.c:7962
+#: cp/parser.c:8140
#, gcc-internal-format
-msgid "mixing declarations and function-definitions is forbidden"
+msgid "%Hmixing declarations and function-definitions is forbidden"
msgstr ""
-#: cp/parser.c:8094
+#: cp/parser.c:8280
#, gcc-internal-format
-msgid "%<friend%> used outside of class"
+msgid "%H%<friend%> used outside of class"
msgstr ""
-#: cp/parser.c:8248
+#: cp/parser.c:8336
#, gcc-internal-format
-msgid "class definition may not be declared a friend"
+msgid "%H%<auto%> will change meaning in C++0x; please remove it"
msgstr ""
-#: cp/parser.c:8312 cp/parser.c:15233
+#. We do not yet support the use of `auto' as a
+#. type-specifier.
+#: cp/parser.c:8346 cp/parser.c:11078
#, gcc-internal-format
-msgid "templates may not be %<virtual%>"
+msgid "%HC++0x %<auto%> specifier not supported"
msgstr ""
-#: cp/parser.c:8784
+#: cp/parser.c:8456
#, gcc-internal-format
-msgid "only constructors take base initializers"
+msgid "%Hclass definition may not be declared a friend"
msgstr ""
-#: cp/parser.c:8804
+#: cp/parser.c:8526 cp/parser.c:15817
#, gcc-internal-format
-msgid "cannot expand initializer for member %<%D%>"
+msgid "%Htemplates may not be %<virtual%>"
msgstr ""
-#: cp/parser.c:8856
+#: cp/parser.c:9003
+#, gcc-internal-format
+msgid "%Honly constructors take base initializers"
+msgstr ""
+
+#: cp/parser.c:9025
+#, gcc-internal-format
+msgid "%Hcannot expand initializer for member %<%D%>"
+msgstr ""
+
+#: cp/parser.c:9080
#, gcc-internal-format
msgid "anachronistic old-style base class initializer"
msgstr ""
-#: cp/parser.c:8901
+#: cp/parser.c:9136
#, gcc-internal-format
msgid ""
-"keyword %<typename%> not allowed in this context (a qualified member "
+"%Hkeyword %<typename%> not allowed in this context (a qualified member "
"initializer is implicitly a type)"
msgstr ""
#. Warn that we do not support `export'.
-#: cp/parser.c:9246
+#: cp/parser.c:9482
#, gcc-internal-format
msgid "keyword %<export%> not implemented, and will be ignored"
msgstr ""
-#: cp/parser.c:9417 cp/parser.c:9515 cp/parser.c:9616
+#: cp/parser.c:9664 cp/parser.c:9762 cp/parser.c:9868
#, gcc-internal-format
-msgid "template parameter pack %qD cannot have a default argument"
+msgid "%Htemplate parameter pack %qD cannot have a default argument"
msgstr ""
-#: cp/parser.c:9420
+#: cp/parser.c:9667
#, gcc-internal-format
-msgid "template parameter pack cannot have a default argument"
+msgid "%Htemplate parameter pack cannot have a default argument"
msgstr ""
-#: cp/parser.c:9518 cp/parser.c:9619
+#: cp/parser.c:9765 cp/parser.c:9872
#, gcc-internal-format
-msgid "template parameter packs cannot have default arguments"
+msgid "%Htemplate parameter packs cannot have default arguments"
msgstr ""
-#. Otherwise, emit an error about the invalid digraph, but continue
-#. parsing because we got our argument list.
-#: cp/parser.c:9756
+#: cp/parser.c:10014
#, gcc-internal-format
msgid "%<<::%> cannot begin a template-argument list"
msgstr ""
-#: cp/parser.c:9757
+#: cp/parser.c:10018
#, gcc-internal-format
msgid ""
"%<<:%> is an alternate spelling for %<[%>. Insert whitespace between %<<%> "
"and %<::%>"
msgstr ""
-#: cp/parser.c:9764
-#, gcc-internal-format
-msgid "(if you use -fpermissive G++ will accept your code)"
-msgstr ""
-
-#: cp/parser.c:9837
+#: cp/parser.c:10096
#, gcc-internal-format
-msgid "parse error in template argument list"
+msgid "%Hparse error in template argument list"
msgstr ""
#. Explain what went wrong.
-#: cp/parser.c:9950
+#: cp/parser.c:10211
#, gcc-internal-format
-msgid "non-template %qD used as template"
+msgid "%Hnon-template %qD used as template"
msgstr ""
-#: cp/parser.c:9951
+#: cp/parser.c:10213
#, gcc-internal-format
msgid "use %<%T::template %D%> to indicate that it is a template"
msgstr ""
-#: cp/parser.c:10474
+#: cp/parser.c:10750
#, gcc-internal-format
-msgid "template specialization with C linkage"
+msgid "%Htemplate specialization with C linkage"
msgstr ""
-#: cp/parser.c:11065
+#: cp/parser.c:11402
#, gcc-internal-format
msgid "using %<typename%> outside of template"
msgstr ""
-#: cp/parser.c:11224
+#: cp/parser.c:11566
#, gcc-internal-format
msgid "declaration %qD does not declare anything"
msgstr ""
-#: cp/parser.c:11308
+#: cp/parser.c:11651
#, gcc-internal-format
msgid "attributes ignored on uninstantiated type"
msgstr ""
-#: cp/parser.c:11312
+#: cp/parser.c:11655
#, gcc-internal-format
msgid "attributes ignored on template instantiation"
msgstr ""
-#: cp/parser.c:11317
+#: cp/parser.c:11660
#, gcc-internal-format
msgid ""
"attributes ignored on elaborated-type-specifier that is not a forward "
"declaration"
msgstr ""
-#: cp/parser.c:11439
+#: cp/parser.c:11930
#, gcc-internal-format
-msgid "comma at end of enumerator list"
+msgid "%H%qD is not a namespace-name"
msgstr ""
-#: cp/parser.c:11531
+#: cp/parser.c:12057
#, gcc-internal-format
-msgid "%qD is not a namespace-name"
-msgstr ""
-
-#: cp/parser.c:11632
-#, gcc-internal-format
-msgid "%<namespace%> definition is not allowed here"
+msgid "%H%<namespace%> definition is not allowed here"
msgstr ""
#. [namespace.udecl]
#.
#. A using declaration shall not name a template-id.
-#: cp/parser.c:11771
+#: cp/parser.c:12197
#, gcc-internal-format
-msgid "a template-id may not appear in a using-declaration"
+msgid "%Ha template-id may not appear in a using-declaration"
msgstr ""
-#: cp/parser.c:12133
+#: cp/parser.c:12571
#, gcc-internal-format
-msgid "an asm-specification is not allowed on a function-definition"
+msgid "%Han asm-specification is not allowed on a function-definition"
msgstr ""
-#: cp/parser.c:12135
+#: cp/parser.c:12575
#, gcc-internal-format
-msgid "attributes are not allowed on a function-definition"
+msgid "%Hattributes are not allowed on a function-definition"
msgstr ""
-#: cp/parser.c:12268
+#: cp/parser.c:12721
#, gcc-internal-format
-msgid "initializer provided for function"
+msgid "%Hinitializer provided for function"
msgstr ""
-#: cp/parser.c:12288
+#: cp/parser.c:12743
#, gcc-internal-format
msgid "attributes after parenthesized initializer ignored"
msgstr ""
-#: cp/parser.c:12669 cp/pt.c:8902
+#: cp/parser.c:13124
#, gcc-internal-format
-msgid "array bound is not an integer constant"
+msgid "%Harray bound is not an integer constant"
msgstr ""
-#: cp/parser.c:12778
+#: cp/parser.c:13236
#, gcc-internal-format
-msgid "%<%T::%E%> is not a type"
+msgid "%H%<%T::%E%> is not a type"
msgstr ""
-#: cp/parser.c:12804
+#: cp/parser.c:13263
#, gcc-internal-format
-msgid "invalid use of constructor as a template"
+msgid "%Hinvalid use of constructor as a template"
msgstr ""
-#: cp/parser.c:12805
+#: cp/parser.c:13265
#, gcc-internal-format
msgid ""
"use %<%T::%D%> instead of %<%T::%D%> to name the constructor in a qualified "
"name"
msgstr ""
-#: cp/parser.c:12977
+#: cp/parser.c:13438
#, gcc-internal-format
-msgid "%qD is a namespace"
+msgid "%H%qD is a namespace"
msgstr ""
-#: cp/parser.c:13052
+#: cp/parser.c:13513
#, gcc-internal-format
-msgid "duplicate cv-qualifier"
+msgid "%Hduplicate cv-qualifier"
msgstr ""
-#: cp/parser.c:13638
+#: cp/parser.c:14146
#, gcc-internal-format
-msgid "file ends in default argument"
+msgid "%Hfile ends in default argument"
msgstr ""
-#: cp/parser.c:13681
+#: cp/parser.c:14192
#, gcc-internal-format
msgid "deprecated use of default argument for parameter of non-function"
msgstr ""
-#: cp/parser.c:13684
+#: cp/parser.c:14195
#, gcc-internal-format
-msgid "default arguments are only permitted for function parameters"
+msgid "%Hdefault arguments are only permitted for function parameters"
msgstr ""
-#: cp/parser.c:13700
+#: cp/parser.c:14213
#, gcc-internal-format
-msgid "%sparameter pack %qD cannot have a default argument"
+msgid "%H%sparameter pack %qD cannot have a default argument"
msgstr ""
-#: cp/parser.c:13703
+#: cp/parser.c:14217
#, gcc-internal-format
-msgid "%sparameter pack cannot have a default argument"
+msgid "%H%sparameter pack cannot have a default argument"
msgstr ""
-#: cp/parser.c:13945
+#: cp/parser.c:14480
#, gcc-internal-format
msgid "ISO C++ does not allow designated initializers"
msgstr ""
-#: cp/parser.c:14545
+#: cp/parser.c:15096
#, gcc-internal-format
-msgid "invalid class name in declaration of %qD"
+msgid "%Hinvalid class name in declaration of %qD"
msgstr ""
-#: cp/parser.c:14557
+#: cp/parser.c:15109
#, gcc-internal-format
-msgid "declaration of %qD in namespace %qD which does not enclose %qD"
+msgid "%Hdeclaration of %qD in namespace %qD which does not enclose %qD"
msgstr ""
-#: cp/parser.c:14560
+#: cp/parser.c:15114
#, gcc-internal-format
-msgid "declaration of %qD in %qD which does not enclose %qD"
+msgid "%Hdeclaration of %qD in %qD which does not enclose %qD"
msgstr ""
-#: cp/parser.c:14573
+#: cp/parser.c:15128
#, gcc-internal-format
-msgid "extra qualification ignored"
+msgid "%Hextra qualification not allowed"
msgstr ""
-#: cp/parser.c:14584
+#: cp/parser.c:15140
#, gcc-internal-format
-msgid "an explicit specialization must be preceded by %<template <>%>"
+msgid "%Han explicit specialization must be preceded by %<template <>%>"
msgstr ""
-#: cp/parser.c:14611
+#: cp/parser.c:15169
#, gcc-internal-format
-msgid "function template %qD redeclared as a class template"
+msgid "%Hfunction template %qD redeclared as a class template"
msgstr ""
-#: cp/parser.c:14687
+#: cp/parser.c:15251
#, gcc-internal-format
-msgid "previous definition of %q+#T"
+msgid "%Hredefinition of %q#T"
msgstr ""
-#: cp/parser.c:14933
+#: cp/parser.c:15253
#, gcc-internal-format
-msgid "%Hextra %<;%>"
+msgid "%Hprevious definition of %q+#T"
msgstr ""
-#: cp/parser.c:14951
+#: cp/parser.c:15521
#, gcc-internal-format
-msgid "a class-key must be used when declaring a friend"
+msgid "%Ha class-key must be used when declaring a friend"
msgstr ""
-#: cp/parser.c:14965
+#: cp/parser.c:15536
#, gcc-internal-format
-msgid "friend declaration does not name a class or function"
+msgid "%Hfriend declaration does not name a class or function"
msgstr ""
-#: cp/parser.c:15142
+#: cp/parser.c:15716
#, gcc-internal-format
-msgid "pure-specifier on function-definition"
+msgid "%Hpure-specifier on function-definition"
msgstr ""
-#: cp/parser.c:15436
+#: cp/parser.c:16021
#, gcc-internal-format
-msgid "keyword %<typename%> not allowed outside of templates"
+msgid "%Hkeyword %<typename%> not allowed outside of templates"
msgstr ""
-#: cp/parser.c:15438
+#: cp/parser.c:16024
#, gcc-internal-format
msgid ""
-"keyword %<typename%> not allowed in this context (the base class is "
+"%Hkeyword %<typename%> not allowed in this context (the base class is "
"implicitly a type)"
msgstr ""
-#: cp/parser.c:16487
+#: cp/parser.c:17087
#, gcc-internal-format
-msgid "too few template-parameter-lists"
+msgid "%Htoo few template-parameter-lists"
msgstr ""
#. Otherwise, there are too many template parameter lists. We have
#. something like:
#.
#. template <class T> template <class U> void S::f();
-#: cp/parser.c:16502
+#: cp/parser.c:17102
#, gcc-internal-format
-msgid "too many template-parameter-lists"
+msgid "%Htoo many template-parameter-lists"
msgstr ""
#. Issue an error message.
-#: cp/parser.c:16774
+#: cp/parser.c:17376
#, gcc-internal-format
-msgid "named return values are no longer supported"
+msgid "%Hnamed return values are no longer supported"
msgstr ""
#. 14.5.2.2 [temp.mem]
#.
#. A local class shall not have member templates.
-#: cp/parser.c:16846
+#: cp/parser.c:17451
#, gcc-internal-format
-msgid "invalid declaration of member template in local class"
+msgid "%Hinvalid declaration of member template in local class"
msgstr ""
-#: cp/parser.c:16855
+#: cp/parser.c:17461
#, gcc-internal-format
-msgid "template with C linkage"
+msgid "%Htemplate with C linkage"
msgstr ""
-#: cp/parser.c:16999
+#: cp/parser.c:17608
#, gcc-internal-format
-msgid "template declaration of %qs"
+msgid "%Htemplate declaration of %qs"
msgstr ""
-#: cp/parser.c:17062
+#: cp/parser.c:17672
#, gcc-internal-format
-msgid "explicit template specialization cannot have a storage class"
+msgid "%Hexplicit template specialization cannot have a storage class"
msgstr ""
-#: cp/parser.c:17251
+#: cp/parser.c:17890
#, gcc-internal-format
msgid "%H%<>>%> should be %<> >%> within a nested template argument list"
msgstr ""
-#: cp/parser.c:17264
+#: cp/parser.c:17903
#, gcc-internal-format
-msgid "spurious %<>>%>, use %<>%> to terminate a template argument list"
+msgid "%Hspurious %<>>%>, use %<>%> to terminate a template argument list"
msgstr ""
-#: cp/parser.c:17599
+#: cp/parser.c:18232
#, gcc-internal-format
-msgid "invalid use of %qD in linkage specification"
+msgid "%Hinvalid use of %qD in linkage specification"
msgstr ""
-#: cp/parser.c:17612
+#: cp/parser.c:18245
#, gcc-internal-format
-msgid "%<__thread%> before %qD"
+msgid "%H%<__thread%> before %qD"
msgstr ""
-#: cp/parser.c:17927
+#: cp/parser.c:18566
#, gcc-internal-format
msgid "%qs tag used in naming %q#T"
msgstr ""
-#: cp/parser.c:17948
+#: cp/parser.c:18587
#, gcc-internal-format
-msgid "%qD redeclared with different access"
+msgid "%H%qD redeclared with different access"
msgstr ""
-#: cp/parser.c:17965
+#: cp/parser.c:18605
#, gcc-internal-format
-msgid "%<template%> (as a disambiguator) is only allowed within templates"
+msgid "%H%<template%> (as a disambiguator) is only allowed within templates"
msgstr ""
-#: cp/parser.c:18218 cp/parser.c:19141 cp/parser.c:19272
+#: cp/parser.c:18871 cp/parser.c:19798 cp/parser.c:19930
#, gcc-internal-format
-msgid "misplaced %<@%D%> Objective-C++ construct"
+msgid "%Hmisplaced %<@%D%> Objective-C++ construct"
msgstr ""
-#: cp/parser.c:18359
+#: cp/parser.c:19015
#, gcc-internal-format
-msgid "%<@encode%> must specify a type as an argument"
+msgid "%H%<@encode%> must specify a type as an argument"
msgstr ""
-#: cp/parser.c:18674
+#: cp/parser.c:19331
#, gcc-internal-format
-msgid "invalid Objective-C++ selector name"
+msgid "%Hinvalid Objective-C++ selector name"
msgstr ""
-#: cp/parser.c:19005
+#: cp/parser.c:19662
#, gcc-internal-format
-msgid "identifier expected after %<@protocol%>"
+msgid "%Hidentifier expected after %<@protocol%>"
msgstr ""
-#: cp/parser.c:19706
+#: cp/parser.c:20023
#, gcc-internal-format
-msgid "schedule %<runtime%> does not take a %<chunk_size%> parameter"
+msgid "%Htoo many %qs clauses"
msgstr ""
-#: cp/parser.c:19822
+#: cp/parser.c:21001
#, gcc-internal-format
-msgid "%qs is not valid for %qs"
+msgid "parenthesized initialization is not allowed in OpenMP %<for%> loop"
msgstr ""
-#: cp/parser.c:20477
+#: cp/parser.c:21155
#, gcc-internal-format
-msgid "junk at end of %<#pragma GCC pch_preprocess%>"
+msgid "%Hiteration variable %qD should not be reduction"
msgstr ""
-#: cp/parser.c:20564
+#: cp/parser.c:21231
#, gcc-internal-format
-msgid ""
-"%<#pragma omp section%> may only be used in %<#pragma omp sections%> "
-"construct"
+msgid "%Hnot enough collapsed for loops"
msgstr ""
-#: cp/parser.c:20622
+#: cp/parser.c:21277
+#, gcc-internal-format
+msgid "%Hcollapsed loops not perfectly nested"
+msgstr ""
+
+#: cp/parser.c:21688
+#, gcc-internal-format
+msgid "%Hjunk at end of %<#pragma GCC pch_preprocess%>"
+msgstr ""
+
+#: cp/parser.c:21692
+#, gcc-internal-format
+msgid "%Hexpected string literal"
+msgstr ""
+
+#: cp/parser.c:21725
+#, gcc-internal-format
+msgid "%H%<#pragma GCC pch_preprocess%> must be first"
+msgstr ""
+
+#: cp/parser.c:21736
+#, gcc-internal-format
+msgid "%H%<#pragma omp barrier%> may only be used in compound statements"
+msgstr ""
+
+#: cp/parser.c:21751
+#, gcc-internal-format
+msgid "%H%<#pragma omp flush%> may only be used in compound statements"
+msgstr ""
+
+#: cp/parser.c:21766
+#, gcc-internal-format
+msgid "%H%<#pragma omp taskwait%> may only be used in compound statements"
+msgstr ""
+
+#: cp/parser.c:21852
#, gcc-internal-format
msgid "inter-module optimizations not implemented for C++"
msgstr ""
-#: cp/pt.c:250
+#: cp/pt.c:252
#, gcc-internal-format
msgid "data member %qD cannot be a member template"
msgstr ""
-#: cp/pt.c:262
+#: cp/pt.c:264
#, gcc-internal-format
msgid "invalid member template declaration %qD"
msgstr ""
-#: cp/pt.c:610
+#: cp/pt.c:611
#, gcc-internal-format
msgid "explicit specialization in non-namespace scope %qD"
msgstr ""
-#: cp/pt.c:624
+#: cp/pt.c:625
#, gcc-internal-format
msgid "enclosing class templates are not explicitly specialized"
msgstr ""
-#: cp/pt.c:712
+#: cp/pt.c:713
#, gcc-internal-format
msgid "specialization of %qD in different namespace"
msgstr ""
-#: cp/pt.c:713 cp/pt.c:810
+#: cp/pt.c:714 cp/pt.c:815
#, gcc-internal-format
msgid " from definition of %q+#D"
msgstr ""
-#: cp/pt.c:730
+#: cp/pt.c:731
#, gcc-internal-format
msgid ""
"explicit instantiation of %qD in namespace %qD (which does not enclose "
"namespace %qD)"
msgstr ""
-#: cp/pt.c:748
+#: cp/pt.c:749
#, gcc-internal-format
msgid "name of class shadows template template parameter %qD"
msgstr ""
-#: cp/pt.c:777
+#: cp/pt.c:782
#, gcc-internal-format
msgid "specialization of %qT after instantiation"
msgstr ""
-#: cp/pt.c:809
+#: cp/pt.c:814
#, gcc-internal-format
msgid "specializing %q#T in different namespace"
msgstr ""
-#: cp/pt.c:824
+#: cp/pt.c:829
#, gcc-internal-format
msgid "specialization %qT after instantiation %qT"
msgstr ""
-#: cp/pt.c:837
+#: cp/pt.c:842
#, gcc-internal-format
msgid "explicit specialization of non-template %qT"
msgstr ""
-#: cp/pt.c:1244
+#: cp/pt.c:1249
#, gcc-internal-format
msgid "specialization of %qD after instantiation"
msgstr ""
-#: cp/pt.c:1470
+#: cp/pt.c:1471
#, gcc-internal-format
msgid "%qD is not a function template"
msgstr ""
-#: cp/pt.c:1679
+#: cp/pt.c:1680
#, gcc-internal-format
msgid "template-id %qD for %q+D does not match any template declaration"
msgstr ""
-#: cp/pt.c:1687
+#: cp/pt.c:1688
#, gcc-internal-format
msgid "ambiguous template specialization %qD for %q+D"
msgstr ""
#. This case handles bogus declarations like template <>
#. template <class T> void f<int>();
-#: cp/pt.c:1922 cp/pt.c:1976
+#: cp/pt.c:1923 cp/pt.c:1977
#, gcc-internal-format
msgid "template-id %qD in declaration of primary template"
msgstr ""
-#: cp/pt.c:1935
+#: cp/pt.c:1936
#, gcc-internal-format
msgid "template parameter list used in explicit instantiation"
msgstr ""
-#: cp/pt.c:1941
+#: cp/pt.c:1942
#, gcc-internal-format
msgid "definition provided for explicit instantiation"
msgstr ""
-#: cp/pt.c:1949
+#: cp/pt.c:1950
#, gcc-internal-format
msgid "too many template parameter lists in declaration of %qD"
msgstr ""
-#: cp/pt.c:1952
+#: cp/pt.c:1953
#, gcc-internal-format
msgid "too few template parameter lists in declaration of %qD"
msgstr ""
-#: cp/pt.c:1954
+#: cp/pt.c:1955
#, gcc-internal-format
msgid "explicit specialization of %qD must be introduced by %<template <>%>"
msgstr ""
-#: cp/pt.c:1973
+#: cp/pt.c:1974
#, gcc-internal-format
msgid "function template partial specialization %qD is not allowed"
msgstr ""
-#: cp/pt.c:2005
+#: cp/pt.c:2006
#, gcc-internal-format
msgid "default argument specified in explicit specialization"
msgstr ""
-#: cp/pt.c:2035
+#: cp/pt.c:2036
#, gcc-internal-format
msgid "%qD is not a template function"
msgstr ""
-#: cp/pt.c:2043
+#: cp/pt.c:2044
#, gcc-internal-format
msgid "%qD is not declared in %qD"
msgstr ""
@@ -31575,104 +31869,104 @@ msgstr ""
#. program is ill-formed.
#.
#. Similar language is found in [temp.explicit].
-#: cp/pt.c:2105
+#: cp/pt.c:2106
#, gcc-internal-format
msgid "specialization of implicitly-declared special member function"
msgstr ""
-#: cp/pt.c:2149
+#: cp/pt.c:2150
#, gcc-internal-format
msgid "no member function %qD declared in %qT"
msgstr ""
-#: cp/pt.c:2635
+#: cp/pt.c:2627
#, gcc-internal-format
msgid "base initializer expansion %<%T%> contains no parameter packs"
msgstr ""
-#: cp/pt.c:2694
+#: cp/pt.c:2686
#, gcc-internal-format
msgid "expansion pattern %<%T%> contains no argument packs"
msgstr ""
-#: cp/pt.c:2696
+#: cp/pt.c:2688
#, gcc-internal-format
msgid "expansion pattern %<%E%> contains no argument packs"
msgstr ""
-#: cp/pt.c:2737
+#: cp/pt.c:2729
#, gcc-internal-format
-msgid "parameter packs not expanded with `...':"
+msgid "parameter packs not expanded with %<...%>:"
msgstr ""
-#: cp/pt.c:2752 cp/pt.c:3375
+#: cp/pt.c:2744 cp/pt.c:3360
#, gcc-internal-format
msgid " %qD"
msgstr ""
-#: cp/pt.c:2754
+#: cp/pt.c:2746
#, gcc-internal-format
msgid " <anonymous>"
msgstr ""
-#: cp/pt.c:2866
+#: cp/pt.c:2854
#, gcc-internal-format
msgid "declaration of %q+#D"
msgstr ""
-#: cp/pt.c:2867
+#: cp/pt.c:2855
#, gcc-internal-format
msgid " shadows template parm %q+#D"
msgstr ""
-#: cp/pt.c:3371
+#: cp/pt.c:3356
#, gcc-internal-format
msgid "template parameters not used in partial specialization:"
msgstr ""
-#: cp/pt.c:3386
+#: cp/pt.c:3371
#, gcc-internal-format
msgid "partial specialization %qT does not specialize any template arguments"
msgstr ""
-#: cp/pt.c:3431
+#: cp/pt.c:3416
#, gcc-internal-format
msgid ""
"parameter pack argument %qE must be at the end of the template argument list"
msgstr ""
-#: cp/pt.c:3433
+#: cp/pt.c:3418
#, gcc-internal-format
msgid ""
"parameter pack argument %qT must be at the end of the template argument list"
msgstr ""
-#: cp/pt.c:3454
+#: cp/pt.c:3439
#, gcc-internal-format
msgid "template argument %qE involves template parameter(s)"
msgstr ""
-#: cp/pt.c:3498
+#: cp/pt.c:3483
#, gcc-internal-format
msgid "type %qT of template argument %qE depends on template parameter(s)"
msgstr ""
-#: cp/pt.c:3605
+#: cp/pt.c:3590
#, gcc-internal-format
msgid "no default argument for %qD"
msgstr ""
-#: cp/pt.c:3623
+#: cp/pt.c:3608
#, gcc-internal-format
msgid "parameter pack %qE must be at the end of the template parameter list"
msgstr ""
-#: cp/pt.c:3626
+#: cp/pt.c:3611
#, gcc-internal-format
msgid "parameter pack %qT must be at the end of the template parameter list"
msgstr ""
-#: cp/pt.c:3813
+#: cp/pt.c:3799
#, gcc-internal-format
msgid "template class without a name"
msgstr ""
@@ -31680,7 +31974,7 @@ msgstr ""
#. [temp.mem]
#.
#. A destructor shall not be a member template.
-#: cp/pt.c:3821
+#: cp/pt.c:3809
#, gcc-internal-format
msgid "destructor %qD declared as member template"
msgstr ""
@@ -31690,72 +31984,72 @@ msgstr ""
#. An allocation function can be a function
#. template. ... Template allocation functions shall
#. have two or more parameters.
-#: cp/pt.c:3836
+#: cp/pt.c:3824
#, gcc-internal-format
msgid "invalid template declaration of %qD"
msgstr ""
-#: cp/pt.c:3950
+#: cp/pt.c:3941
#, gcc-internal-format
msgid "template definition of non-template %q#D"
msgstr ""
-#: cp/pt.c:3993
+#: cp/pt.c:3984
#, gcc-internal-format
msgid "expected %d levels of template parms for %q#D, got %d"
msgstr ""
-#: cp/pt.c:4005
+#: cp/pt.c:3996
#, gcc-internal-format
msgid "got %d template parameters for %q#D"
msgstr ""
-#: cp/pt.c:4008
+#: cp/pt.c:3999
#, gcc-internal-format
msgid "got %d template parameters for %q#T"
msgstr ""
-#: cp/pt.c:4010
+#: cp/pt.c:4001
#, gcc-internal-format
msgid " but %d required"
msgstr ""
-#: cp/pt.c:4028
+#: cp/pt.c:4019
#, gcc-internal-format
msgid "template arguments to %qD do not match original template %qD"
msgstr ""
-#: cp/pt.c:4032
+#: cp/pt.c:4023
#, gcc-internal-format
msgid "use template<> for an explicit specialization"
msgstr ""
-#: cp/pt.c:4128
+#: cp/pt.c:4119
#, gcc-internal-format
msgid "%qT is not a template type"
msgstr ""
-#: cp/pt.c:4141
+#: cp/pt.c:4132
#, gcc-internal-format
msgid "template specifiers not specified in declaration of %qD"
msgstr ""
-#: cp/pt.c:4151
+#: cp/pt.c:4142
#, gcc-internal-format
msgid "redeclared with %d template parameter(s)"
msgstr ""
-#: cp/pt.c:4153
+#: cp/pt.c:4144
#, gcc-internal-format
msgid "previous declaration %q+D used %d template parameter(s)"
msgstr ""
-#: cp/pt.c:4187
+#: cp/pt.c:4178
#, gcc-internal-format
msgid "template parameter %q+#D"
msgstr ""
-#: cp/pt.c:4188
+#: cp/pt.c:4179
#, gcc-internal-format
msgid "redeclared here as %q#D"
msgstr ""
@@ -31764,203 +32058,203 @@ msgstr ""
#.
#. A template-parameter may not be given default arguments
#. by two different declarations in the same scope.
-#: cp/pt.c:4198
+#: cp/pt.c:4189
#, gcc-internal-format
msgid "redefinition of default argument for %q#D"
msgstr ""
-#: cp/pt.c:4199
+#: cp/pt.c:4190
#, gcc-internal-format
msgid "%Joriginal definition appeared here"
msgstr ""
-#: cp/pt.c:4303
+#: cp/pt.c:4294
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument for type %qT because function %qD has "
"not external linkage"
msgstr ""
-#: cp/pt.c:4344
+#: cp/pt.c:4335
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument for type %qT because string literals "
"can never be used in this context"
msgstr ""
-#: cp/pt.c:4421
+#: cp/pt.c:4412
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument for type %qT because it is a non-"
"constant expression"
msgstr ""
-#: cp/pt.c:4465
+#: cp/pt.c:4456
#, gcc-internal-format
msgid ""
"%qD is not a valid template argument because %qD is a variable, not the "
"address of a variable"
msgstr ""
-#: cp/pt.c:4483
+#: cp/pt.c:4474
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument of type %qT because %qE is not a "
"variable"
msgstr ""
-#: cp/pt.c:4490
+#: cp/pt.c:4481
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument of type %qT because %qD does not have "
"external linkage"
msgstr ""
-#: cp/pt.c:4520
+#: cp/pt.c:4511
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument for type %qT because of conflicts in cv-"
"qualification"
msgstr ""
-#: cp/pt.c:4527
+#: cp/pt.c:4518
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument for type %qT because it is not an lvalue"
msgstr ""
-#: cp/pt.c:4540
+#: cp/pt.c:4531
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument for type %qT because object %qD has not "
"external linkage"
msgstr ""
-#: cp/pt.c:4580
+#: cp/pt.c:4571
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument for type %qT because it is a pointer"
msgstr ""
-#: cp/pt.c:4582
+#: cp/pt.c:4573
#, gcc-internal-format
msgid "try using %qE instead"
msgstr ""
-#: cp/pt.c:4617
+#: cp/pt.c:4608
#, gcc-internal-format
msgid ""
"%qE is not a valid template argument for type %qT because it is of type %qT"
msgstr ""
-#: cp/pt.c:4620
+#: cp/pt.c:4611
#, gcc-internal-format
msgid "standard conversions are not allowed in this context"
msgstr ""
-#: cp/pt.c:4871
+#: cp/pt.c:4945
#, gcc-internal-format
msgid "to refer to a type member of a template parameter, use %<typename %E%>"
msgstr ""
-#: cp/pt.c:4887 cp/pt.c:4906 cp/pt.c:4956
+#: cp/pt.c:4961 cp/pt.c:4980 cp/pt.c:5030
#, gcc-internal-format
msgid "type/value mismatch at argument %d in template parameter list for %qD"
msgstr ""
-#: cp/pt.c:4891
+#: cp/pt.c:4965
#, gcc-internal-format
msgid " expected a constant of type %qT, got %qT"
msgstr ""
-#: cp/pt.c:4895
+#: cp/pt.c:4969
#, gcc-internal-format
msgid " expected a class template, got %qE"
msgstr ""
-#: cp/pt.c:4897
+#: cp/pt.c:4971
#, gcc-internal-format
msgid " expected a type, got %qE"
msgstr ""
-#: cp/pt.c:4910
+#: cp/pt.c:4984
#, gcc-internal-format
msgid " expected a type, got %qT"
msgstr ""
-#: cp/pt.c:4912
+#: cp/pt.c:4986
#, gcc-internal-format
msgid " expected a class template, got %qT"
msgstr ""
-#: cp/pt.c:4959
+#: cp/pt.c:5033
#, gcc-internal-format
msgid " expected a template of type %qD, got %qD"
msgstr ""
-#: cp/pt.c:5002
+#: cp/pt.c:5076
#, gcc-internal-format
msgid "could not convert template argument %qE to %qT"
msgstr ""
-#: cp/pt.c:5058
+#: cp/pt.c:5132
#, gcc-internal-format
msgid "wrong number of template arguments (%d, should be %d)"
msgstr ""
-#: cp/pt.c:5190
+#: cp/pt.c:5264
#, gcc-internal-format
msgid "wrong number of template arguments (%d, should be %d%s)"
msgstr ""
-#: cp/pt.c:5194
+#: cp/pt.c:5268
#, gcc-internal-format
msgid "provided for %q+D"
msgstr ""
-#: cp/pt.c:5253
+#: cp/pt.c:5327
#, gcc-internal-format
msgid "cannot expand %<%E%> into a fixed-length argument list"
msgstr ""
-#: cp/pt.c:5256
+#: cp/pt.c:5330
#, gcc-internal-format
msgid "cannot expand %<%T%> into a fixed-length argument list"
msgstr ""
-#: cp/pt.c:5272
+#: cp/pt.c:5346
#, gcc-internal-format
msgid "template argument %d is invalid"
msgstr ""
-#: cp/pt.c:5532
+#: cp/pt.c:5606
#, gcc-internal-format
msgid "non-template type %qT used as a template"
msgstr ""
-#: cp/pt.c:5534
+#: cp/pt.c:5608
#, gcc-internal-format
msgid "for template declaration %q+D"
msgstr ""
-#: cp/pt.c:6232
+#: cp/pt.c:6310
#, gcc-internal-format
msgid ""
"template instantiation depth exceeds maximum of %d (use -ftemplate-depth-NN "
"to increase the maximum) instantiating %qD"
msgstr ""
-#: cp/pt.c:7344
+#: cp/pt.c:7440
#, gcc-internal-format
msgid "mismatched argument pack lengths while expanding %<%T%>"
msgstr ""
-#: cp/pt.c:7348
+#: cp/pt.c:7444
#, gcc-internal-format
msgid "mismatched argument pack lengths while expanding %<%E%>"
msgstr ""
-#: cp/pt.c:8300
+#: cp/pt.c:8398
#, gcc-internal-format
msgid "instantiation of %q+D as type %qT"
msgstr ""
@@ -31978,241 +32272,263 @@ msgstr ""
#.
#. is an attempt to declare a variable with function
#. type.
-#: cp/pt.c:8435
+#: cp/pt.c:8533
#, gcc-internal-format
msgid "variable %qD has function type"
msgstr ""
-#: cp/pt.c:8582
+#: cp/pt.c:8680
#, gcc-internal-format
msgid "invalid parameter type %qT"
msgstr ""
-#: cp/pt.c:8584
+#: cp/pt.c:8682
#, gcc-internal-format
msgid "in declaration %q+D"
msgstr ""
-#: cp/pt.c:8661
+#: cp/pt.c:8759
#, gcc-internal-format
msgid "function returning an array"
msgstr ""
-#: cp/pt.c:8663
+#: cp/pt.c:8761
#, gcc-internal-format
msgid "function returning a function"
msgstr ""
-#: cp/pt.c:8697
+#: cp/pt.c:8788
#, gcc-internal-format
msgid "creating pointer to member function of non-class type %qT"
msgstr ""
-#: cp/pt.c:8922
+#: cp/pt.c:8995
+#, gcc-internal-format
+msgid "array bound is not an integer constant"
+msgstr ""
+
+#: cp/pt.c:9015
#, gcc-internal-format
msgid "creating array with negative size (%qE)"
msgstr ""
-#: cp/pt.c:9177
+#: cp/pt.c:9264
#, gcc-internal-format
msgid "forming reference to void"
msgstr ""
-#: cp/pt.c:9179
+#: cp/pt.c:9266
#, gcc-internal-format
msgid "forming %s to reference type %qT"
msgstr ""
-#: cp/pt.c:9230
+#: cp/pt.c:9317
#, gcc-internal-format
msgid "creating pointer to member of non-class type %qT"
msgstr ""
-#: cp/pt.c:9236
+#: cp/pt.c:9323
#, gcc-internal-format
msgid "creating pointer to member reference type %qT"
msgstr ""
-#: cp/pt.c:9242
+#: cp/pt.c:9329
#, gcc-internal-format
msgid "creating pointer to member of type void"
msgstr ""
-#: cp/pt.c:9309
+#: cp/pt.c:9396
#, gcc-internal-format
msgid "creating array of %qT"
msgstr ""
-#: cp/pt.c:9315
+#: cp/pt.c:9402
#, gcc-internal-format
msgid "creating array of %qT, which is an abstract class type"
msgstr ""
-#: cp/pt.c:9366
+#: cp/pt.c:9453
#, gcc-internal-format
msgid "%qT is not a class, struct, or union type"
msgstr ""
-#: cp/pt.c:9401
+#: cp/pt.c:9488
#, gcc-internal-format
msgid "%qT resolves to %qT, which is not an enumeration type"
msgstr ""
-#: cp/pt.c:9404
+#: cp/pt.c:9491
#, gcc-internal-format
msgid "%qT resolves to %qT, which is is not a class type"
msgstr ""
-#: cp/pt.c:9505
+#: cp/pt.c:9592
#, gcc-internal-format
msgid "use of %qs in template"
msgstr ""
-#: cp/pt.c:9642
+#: cp/pt.c:9729
#, gcc-internal-format
msgid ""
"dependent-name %qE is parsed as a non-type, but instantiation yields a type"
msgstr ""
-#: cp/pt.c:9644
+#: cp/pt.c:9731
#, gcc-internal-format
msgid "say %<typename %E%> if a type is meant"
msgstr ""
-#: cp/pt.c:9773
+#: cp/pt.c:9860
#, gcc-internal-format
msgid "using invalid field %qD"
msgstr ""
-#: cp/pt.c:10082 cp/pt.c:10562
+#: cp/pt.c:10190 cp/pt.c:10844
#, gcc-internal-format
msgid "invalid use of pack expansion expression"
msgstr ""
-#: cp/pt.c:10086 cp/pt.c:10566
+#: cp/pt.c:10194 cp/pt.c:10848
#, gcc-internal-format
msgid "use %<...%> to expand argument pack"
msgstr ""
-#: cp/pt.c:10724
+#: cp/pt.c:10336
+#, gcc-internal-format
+msgid "iteration variable %qD should not be firstprivate"
+msgstr ""
+
+#: cp/pt.c:10339
+#, gcc-internal-format
+msgid "iteration variable %qD should not be reduction"
+msgstr ""
+
+#: cp/pt.c:11008
#, gcc-internal-format
msgid ""
"a cast to a type other than an integral or enumeration type cannot appear in "
"a constant-expression"
msgstr ""
-#: cp/pt.c:11190
+#: cp/pt.c:11480
#, gcc-internal-format
msgid "%qT is not a class or namespace"
msgstr ""
-#: cp/pt.c:11193
+#: cp/pt.c:11483
#, gcc-internal-format
msgid "%qD is not a class or namespace"
msgstr ""
-#: cp/pt.c:11403
+#: cp/pt.c:11697
#, gcc-internal-format
msgid "%qT is/uses anonymous type"
msgstr ""
-#: cp/pt.c:11405
+#: cp/pt.c:11699
#, gcc-internal-format
msgid "template argument for %qD uses local type %qT"
msgstr ""
-#: cp/pt.c:11415
+#: cp/pt.c:11709
#, gcc-internal-format
msgid "%qT is a variably modified type"
msgstr ""
-#: cp/pt.c:11426
+#: cp/pt.c:11720
#, gcc-internal-format
msgid "integral expression %qE is not constant"
msgstr ""
-#: cp/pt.c:11431
+#: cp/pt.c:11725
#, gcc-internal-format
msgid " trying to instantiate %qD"
msgstr ""
-#: cp/pt.c:14180
+#: cp/pt.c:14504
#, gcc-internal-format
msgid "ambiguous class template instantiation for %q#T"
msgstr ""
-#: cp/pt.c:14183
+#: cp/pt.c:14507
#, gcc-internal-format
msgid "%s %+#T"
msgstr ""
-#: cp/pt.c:14206 cp/pt.c:14289
+#: cp/pt.c:14530 cp/pt.c:14613
#, gcc-internal-format
msgid "explicit instantiation of non-template %q#D"
msgstr ""
-#: cp/pt.c:14221
+#: cp/pt.c:14545
#, gcc-internal-format
msgid "%qD is not a static data member of a class template"
msgstr ""
-#: cp/pt.c:14227 cp/pt.c:14284
+#: cp/pt.c:14551 cp/pt.c:14608
#, gcc-internal-format
msgid "no matching template for %qD found"
msgstr ""
-#: cp/pt.c:14232
+#: cp/pt.c:14556
#, gcc-internal-format
msgid ""
"type %qT for explicit instantiation %qD does not match declared type %qT"
msgstr ""
-#: cp/pt.c:14240
+#: cp/pt.c:14564
#, gcc-internal-format
msgid "explicit instantiation of %q#D"
msgstr ""
-#: cp/pt.c:14276
+#: cp/pt.c:14600
#, gcc-internal-format
msgid "duplicate explicit instantiation of %q#D"
msgstr ""
-#: cp/pt.c:14298
+#: cp/pt.c:14623 cp/pt.c:14715
#, gcc-internal-format
-msgid "ISO C++ forbids the use of %<extern%> on explicit instantiations"
+msgid "ISO C++ 1998 forbids the use of %<extern%> on explicit instantiations"
msgstr ""
-#: cp/pt.c:14303 cp/pt.c:14396
+#: cp/pt.c:14628 cp/pt.c:14732
#, gcc-internal-format
msgid "storage class %qD applied to template instantiation"
msgstr ""
-#: cp/pt.c:14368
+#: cp/pt.c:14693
#, gcc-internal-format
msgid "explicit instantiation of non-template type %qT"
msgstr ""
-#: cp/pt.c:14377
+#: cp/pt.c:14702
#, gcc-internal-format
msgid "explicit instantiation of %q#T before definition of template"
msgstr ""
-#: cp/pt.c:14385
+#: cp/pt.c:14720
#, gcc-internal-format
msgid "ISO C++ forbids the use of %qE on explicit instantiations"
msgstr ""
-#: cp/pt.c:14430
+#: cp/pt.c:14766
#, gcc-internal-format
msgid "duplicate explicit instantiation of %q#T"
msgstr ""
-#: cp/pt.c:14878
+#. [temp.explicit]
+#.
+#. The definition of a non-exported function template, a
+#. non-exported member function template, or a non-exported
+#. member function or static data member of a class template
+#. shall be present in every translation unit in which it is
+#. explicitly instantiated.
+#: cp/pt.c:15210
#, gcc-internal-format
msgid "explicit instantiation of %qD but no definition available"
msgstr ""
-#: cp/pt.c:15072
+#: cp/pt.c:15401
#, gcc-internal-format
msgid ""
"template instantiation depth exceeds maximum of %d instantiating %q+D, "
@@ -32220,7 +32536,7 @@ msgid ""
"the maximum)"
msgstr ""
-#: cp/pt.c:15414
+#: cp/pt.c:15756
#, gcc-internal-format
msgid "%q#T is not a valid type for a template constant parameter"
msgstr ""
@@ -32240,808 +32556,871 @@ msgstr ""
msgid "can't create repository information file %qs"
msgstr ""
-#: cp/rtti.c:271
+#: cp/rtti.c:288
#, gcc-internal-format
msgid "cannot use typeid with -fno-rtti"
msgstr ""
-#: cp/rtti.c:277
+#: cp/rtti.c:294
#, gcc-internal-format
msgid "must #include <typeinfo> before using typeid"
msgstr ""
-#: cp/rtti.c:360
+#: cp/rtti.c:377
#, gcc-internal-format
msgid ""
"cannot create type information for type %qT because it involves types of "
"variable size"
msgstr ""
-#: cp/rtti.c:615 cp/rtti.c:629
+#: cp/rtti.c:635 cp/rtti.c:650
#, gcc-internal-format
msgid "dynamic_cast of %q#D to %q#T can never succeed"
msgstr ""
-#: cp/rtti.c:639
+#: cp/rtti.c:661
#, gcc-internal-format
msgid "%<dynamic_cast%> not permitted with -fno-rtti"
msgstr ""
-#: cp/rtti.c:716
+#: cp/rtti.c:738
#, gcc-internal-format
msgid "cannot dynamic_cast %qE (of type %q#T) to type %q#T (%s)"
msgstr ""
-#: cp/search.c:257
+#: cp/search.c:258
#, gcc-internal-format
msgid "%qT is an ambiguous base of %qT"
msgstr ""
-#: cp/search.c:275
+#: cp/search.c:276
#, gcc-internal-format
msgid "%qT is an inaccessible base of %qT"
msgstr ""
-#: cp/search.c:1868
+#: cp/search.c:1869
#, gcc-internal-format
msgid "deprecated covariant return type for %q+#D"
msgstr ""
-#: cp/search.c:1870 cp/search.c:1885 cp/search.c:1890 cp/search.c:1909
+#: cp/search.c:1871 cp/search.c:1886 cp/search.c:1891 cp/search.c:1910
#, gcc-internal-format
msgid " overriding %q+#D"
msgstr ""
-#: cp/search.c:1884
+#: cp/search.c:1885
#, gcc-internal-format
msgid "invalid covariant return type for %q+#D"
msgstr ""
-#: cp/search.c:1889
+#: cp/search.c:1890
#, gcc-internal-format
msgid "conflicting return type specified for %q+#D"
msgstr ""
-#: cp/search.c:1899
+#: cp/search.c:1900
#, gcc-internal-format
msgid "looser throw specifier for %q+#F"
msgstr ""
-#: cp/search.c:1900
+#: cp/search.c:1901
#, gcc-internal-format
msgid " overriding %q+#F"
msgstr ""
-#: cp/search.c:1908
+#: cp/search.c:1909
#, gcc-internal-format
msgid "conflicting type attributes specified for %q+#D"
msgstr ""
+#: cp/search.c:1920
+#, gcc-internal-format
+msgid "overriding non-deleted function %q+D"
+msgstr ""
+
+#: cp/search.c:1924
+#, gcc-internal-format
+msgid "non-deleted function %q+D"
+msgstr ""
+
+#: cp/search.c:1925
+#, gcc-internal-format
+msgid "overriding deleted function %q+D"
+msgstr ""
+
#. A static member function cannot match an inherited
#. virtual member function.
-#: cp/search.c:2002
+#: cp/search.c:2017
#, gcc-internal-format
msgid "%q+#D cannot be declared"
msgstr ""
-#: cp/search.c:2003
+#: cp/search.c:2018
#, gcc-internal-format
msgid " since %q+#D declared in base class"
msgstr ""
-#: cp/semantics.c:764
+#: cp/semantics.c:768
#, gcc-internal-format
msgid "suggest explicit braces around empty body in %<do%> statement"
msgstr ""
-#: cp/semantics.c:1294
+#: cp/semantics.c:1306
#, gcc-internal-format
msgid "type of asm operand %qE could not be determined"
msgstr ""
-#: cp/semantics.c:1350
+#: cp/semantics.c:1362
#, gcc-internal-format
msgid "__label__ declarations are only allowed in function scopes"
msgstr ""
-#: cp/semantics.c:1438
+#: cp/semantics.c:1450
#, gcc-internal-format
msgid "invalid use of member %q+D in static member function"
msgstr ""
-#: cp/semantics.c:1440
+#: cp/semantics.c:1452
#, gcc-internal-format
msgid "invalid use of non-static data member %q+D"
msgstr ""
-#: cp/semantics.c:1441 cp/semantics.c:1480
+#: cp/semantics.c:1453 cp/semantics.c:1492
#, gcc-internal-format
msgid "from this location"
msgstr ""
-#: cp/semantics.c:1479
+#: cp/semantics.c:1491
#, gcc-internal-format
msgid "object missing in reference to %q+D"
msgstr ""
-#: cp/semantics.c:1947
+#: cp/semantics.c:1970
#, gcc-internal-format
msgid "arguments to destructor are not allowed"
msgstr ""
-#: cp/semantics.c:1997
+#: cp/semantics.c:2020
#, gcc-internal-format
msgid "%<this%> is unavailable for static member functions"
msgstr ""
-#: cp/semantics.c:2003
+#: cp/semantics.c:2026
#, gcc-internal-format
msgid "invalid use of %<this%> in non-member function"
msgstr ""
-#: cp/semantics.c:2005
+#: cp/semantics.c:2028
#, gcc-internal-format
msgid "invalid use of %<this%> at top level"
msgstr ""
-#: cp/semantics.c:2029
+#: cp/semantics.c:2052
#, gcc-internal-format
msgid "invalid qualifying scope in pseudo-destructor name"
msgstr ""
-#: cp/semantics.c:2034 cp/typeck.c:2039
+#: cp/semantics.c:2057 cp/typeck.c:2094
#, gcc-internal-format
msgid "qualified type %qT does not match destructor name ~%qT"
msgstr ""
-#: cp/semantics.c:2056
+#: cp/semantics.c:2079
#, gcc-internal-format
msgid "%qE is not of type %qT"
msgstr ""
-#: cp/semantics.c:2100
+#: cp/semantics.c:2120
#, gcc-internal-format
msgid "compound literal of non-object type %qT"
msgstr ""
-#: cp/semantics.c:2177
+#: cp/semantics.c:2204
#, gcc-internal-format
msgid "template type parameters must use the keyword %<class%> or %<typename%>"
msgstr ""
-#: cp/semantics.c:2218
+#: cp/semantics.c:2245
#, gcc-internal-format
msgid ""
"invalid use of type %qT as a default value for a template template-parameter"
msgstr ""
-#: cp/semantics.c:2221
+#: cp/semantics.c:2248
#, gcc-internal-format
msgid "invalid default argument for a template template parameter"
msgstr ""
-#: cp/semantics.c:2238
+#: cp/semantics.c:2265
#, gcc-internal-format
msgid "definition of %q#T inside template parameter list"
msgstr ""
-#: cp/semantics.c:2249
+#: cp/semantics.c:2276
#, gcc-internal-format
msgid "invalid definition of qualified type %qT"
msgstr ""
-#: cp/semantics.c:2465
+#: cp/semantics.c:2492
#, gcc-internal-format
msgid "invalid base-class specification"
msgstr ""
-#: cp/semantics.c:2474
+#: cp/semantics.c:2504
#, gcc-internal-format
msgid "base class %qT has cv qualifiers"
msgstr ""
-#: cp/semantics.c:2496
+#: cp/semantics.c:2529
#, gcc-internal-format
-msgid "incomplete type %qT used in nested name specifier"
+msgid "%Hincomplete type %qT used in nested name specifier"
msgstr ""
-#: cp/semantics.c:2499
+#: cp/semantics.c:2533
#, gcc-internal-format
-msgid "reference to %<%T::%D%> is ambiguous"
+msgid "%Hreference to %<%T::%D%> is ambiguous"
msgstr ""
-#: cp/semantics.c:2503 cp/typeck.c:1848
+#: cp/semantics.c:2537
#, gcc-internal-format
-msgid "%qD is not a member of %qT"
+msgid "%H%qD is not a member of %qT"
msgstr ""
-#: cp/semantics.c:2506
+#: cp/semantics.c:2540
#, gcc-internal-format
-msgid "%qD is not a member of %qD"
+msgid "%H%qD is not a member of %qD"
msgstr ""
-#: cp/semantics.c:2508
+#: cp/semantics.c:2542
#, gcc-internal-format
-msgid "%<::%D%> has not been declared"
+msgid "%H%<::%D%> has not been declared"
msgstr ""
-#: cp/semantics.c:2649
+#: cp/semantics.c:2683
#, gcc-internal-format
msgid "use of %<auto%> variable from containing function"
msgstr ""
-#: cp/semantics.c:2651
+#: cp/semantics.c:2685
#, gcc-internal-format
msgid " %q+#D declared here"
msgstr ""
-#: cp/semantics.c:2689
+#: cp/semantics.c:2723
#, gcc-internal-format
msgid ""
"template parameter %qD of type %qT is not allowed in an integral constant "
"expression because it is not of integral or enumeration type"
msgstr ""
-#: cp/semantics.c:2858
+#: cp/semantics.c:2892
#, gcc-internal-format
msgid "%qD cannot appear in a constant-expression"
msgstr ""
-#: cp/semantics.c:2866
+#: cp/semantics.c:2900
#, gcc-internal-format
msgid "use of namespace %qD as expression"
msgstr ""
-#: cp/semantics.c:2871
+#: cp/semantics.c:2905
#, gcc-internal-format
msgid "use of class template %qT as expression"
msgstr ""
#. Ambiguous reference to base members.
-#: cp/semantics.c:2877
+#: cp/semantics.c:2911
#, gcc-internal-format
msgid "request for member %qD is ambiguous in multiple inheritance lattice"
msgstr ""
-#: cp/semantics.c:2998 cp/semantics.c:4255
+#: cp/semantics.c:3033 cp/semantics.c:4670
#, gcc-internal-format
msgid "type of %qE is unknown"
msgstr ""
-#: cp/semantics.c:3013
+#: cp/semantics.c:3048
#, gcc-internal-format
msgid "cannot apply %<offsetof%> to destructor %<~%T%>"
msgstr ""
-#: cp/semantics.c:3024
+#: cp/semantics.c:3059
#, gcc-internal-format
msgid "cannot apply %<offsetof%> to member function %qD"
msgstr ""
-#: cp/semantics.c:3377
+#: cp/semantics.c:3530
#, gcc-internal-format
msgid "%qD is not a variable in clause %qs"
msgstr ""
-#: cp/semantics.c:3386
+#: cp/semantics.c:3539 cp/semantics.c:3561 cp/semantics.c:3583
#, gcc-internal-format
msgid "%qD appears more than once in data clauses"
msgstr ""
-#: cp/semantics.c:3446
+#: cp/semantics.c:3553
+#, gcc-internal-format
+msgid "%qD is not a variable in clause %<firstprivate%>"
+msgstr ""
+
+#: cp/semantics.c:3575
+#, gcc-internal-format
+msgid "%qD is not a variable in clause %<lastprivate%>"
+msgstr ""
+
+#: cp/semantics.c:3605
#, gcc-internal-format
msgid "num_threads expression must be integral"
msgstr ""
-#: cp/semantics.c:3460
+#: cp/semantics.c:3619
#, gcc-internal-format
msgid "schedule chunk size expression must be integral"
msgstr ""
-#: cp/semantics.c:3590
+#: cp/semantics.c:3751
#, gcc-internal-format
msgid "%qE has reference type for %qs"
msgstr ""
-#: cp/semantics.c:3752
+#: cp/semantics.c:3822
#, gcc-internal-format
-msgid "%<threadprivate%> %qE is not file, namespace or block scope variable"
+msgid "%<threadprivate%> %qD is not file, namespace or block scope variable"
+msgstr ""
+
+#: cp/semantics.c:3836
+#, gcc-internal-format
+msgid "%<threadprivate%> %qE directive not in %qT definition"
+msgstr ""
+
+#: cp/semantics.c:3978
+#, gcc-internal-format
+msgid "%Hdifference between %qE and %qD does not have integer type"
+msgstr ""
+
+#: cp/semantics.c:4198 cp/semantics.c:4269
+#, gcc-internal-format
+msgid "%Hexpected iteration declaration or initialization"
msgstr ""
#. Report the error.
-#: cp/semantics.c:4068
+#: cp/semantics.c:4471
#, gcc-internal-format
msgid "static assertion failed: %E"
msgstr ""
-#: cp/semantics.c:4070
+#: cp/semantics.c:4473
#, gcc-internal-format
msgid "non-constant condition for static assertion"
msgstr ""
-#: cp/semantics.c:4095 cp/semantics.c:4190
+#: cp/semantics.c:4498 cp/semantics.c:4593
#, gcc-internal-format
msgid "argument to decltype must be an expression"
msgstr ""
-#: cp/semantics.c:4141
+#: cp/semantics.c:4544
#, gcc-internal-format
msgid "%qE refers to a set of overloaded functions"
msgstr ""
-#: cp/semantics.c:4411
+#: cp/semantics.c:4626
+#, gcc-internal-format
+msgid "unable to determine the declared type of expression %<%E%>"
+msgstr ""
+
+#: cp/semantics.c:4839
#, gcc-internal-format
msgid "__is_convertible_to"
msgstr ""
-#: cp/semantics.c:4440
+#: cp/semantics.c:4868
#, gcc-internal-format
msgid "incomplete type %qT not allowed"
msgstr ""
-#: cp/tree.c:831
+#: cp/tree.c:862
#, gcc-internal-format
msgid "%qV qualifiers cannot be applied to %qT"
msgstr ""
-#: cp/tree.c:2136
+#: cp/tree.c:2172
#, gcc-internal-format
msgid "%qE attribute can only be applied to Java class definitions"
msgstr ""
-#: cp/tree.c:2165
+#: cp/tree.c:2201
#, gcc-internal-format
msgid "%qE attribute can only be applied to class definitions"
msgstr ""
-#: cp/tree.c:2171
+#: cp/tree.c:2207
#, gcc-internal-format
msgid "%qE is obsolete; g++ vtables are now COM-compatible by default"
msgstr ""
-#: cp/tree.c:2195
+#: cp/tree.c:2231
#, gcc-internal-format
msgid "requested init_priority is not an integer constant"
msgstr ""
-#: cp/tree.c:2216
+#: cp/tree.c:2252
#, gcc-internal-format
msgid ""
"can only use %qE attribute on file-scope definitions of objects of class type"
msgstr ""
-#: cp/tree.c:2224
+#: cp/tree.c:2260
#, gcc-internal-format
msgid "requested init_priority is out of range"
msgstr ""
-#: cp/tree.c:2234
+#: cp/tree.c:2270
#, gcc-internal-format
msgid "requested init_priority is reserved for internal use"
msgstr ""
-#: cp/tree.c:2245
+#: cp/tree.c:2281
#, gcc-internal-format
msgid "%qE attribute is not supported on this platform"
msgstr ""
-#: cp/typeck.c:432 cp/typeck.c:446 cp/typeck.c:546
+#: cp/typeck.c:438 cp/typeck.c:453 cp/typeck.c:555
#, gcc-internal-format
msgid "%s between distinct pointer types %qT and %qT lacks a cast"
msgstr ""
-#: cp/typeck.c:508
+#: cp/typeck.c:515
#, gcc-internal-format
msgid ""
"ISO C++ forbids %s between pointer of type %<void *%> and pointer-to-function"
msgstr ""
-#: cp/typeck.c:566
+#: cp/typeck.c:576
#, gcc-internal-format
msgid "%s between distinct pointer-to-member types %qT and %qT lacks a cast"
msgstr ""
-#: cp/typeck.c:1155
+#: cp/typeck.c:1164
#, gcc-internal-format
msgid "canonical types differ for identical types %T and %T"
msgstr ""
-#: cp/typeck.c:1162
+#: cp/typeck.c:1171
#, gcc-internal-format
msgid "same canonical type node for different types %T and %T"
msgstr ""
-#: cp/typeck.c:1274
+#: cp/typeck.c:1284
#, gcc-internal-format
msgid "invalid application of %qs to a member function"
msgstr ""
-#: cp/typeck.c:1324
+#: cp/typeck.c:1352
#, gcc-internal-format
msgid "invalid application of %<sizeof%> to a bit-field"
msgstr ""
-#: cp/typeck.c:1329
+#: cp/typeck.c:1360
#, gcc-internal-format
msgid "ISO C++ forbids applying %<sizeof%> to an expression of function type"
msgstr ""
-#: cp/typeck.c:1372
+#: cp/typeck.c:1409
#, gcc-internal-format
msgid "invalid application of %<__alignof%> to a bit-field"
msgstr ""
-#: cp/typeck.c:1380
+#: cp/typeck.c:1420
#, gcc-internal-format
msgid ""
"ISO C++ forbids applying %<__alignof%> to an expression of function type"
msgstr ""
-#: cp/typeck.c:1431
+#: cp/typeck.c:1478
#, gcc-internal-format
msgid "invalid use of non-static member function"
msgstr ""
-#: cp/typeck.c:1704
+#: cp/typeck.c:1740
#, gcc-internal-format
msgid "deprecated conversion from string constant to %qT"
msgstr ""
-#: cp/typeck.c:1819 cp/typeck.c:2167
+#: cp/typeck.c:1863 cp/typeck.c:2224
#, gcc-internal-format
msgid "request for member %qD in %qE, which is of non-class type %qT"
msgstr ""
-#: cp/typeck.c:1846
+#: cp/typeck.c:1892
#, gcc-internal-format
msgid "invalid use of nonstatic data member %qE"
msgstr ""
-#: cp/typeck.c:1898 cp/typeck.c:1926
+#: cp/typeck.c:1894
+#, gcc-internal-format
+msgid "%qD is not a member of %qT"
+msgstr ""
+
+#: cp/typeck.c:1947
#, gcc-internal-format
msgid "invalid access to non-static data member %qD of NULL object"
msgstr ""
-#: cp/typeck.c:1901 cp/typeck.c:1928
+#: cp/typeck.c:1950 cp/typeck.c:1981
#, gcc-internal-format
msgid "(perhaps the %<offsetof%> macro was used incorrectly)"
msgstr ""
-#: cp/typeck.c:2045
+#: cp/typeck.c:1978
+#, gcc-internal-format
+msgid "invalid access to non-static data member %qD of NULL object"
+msgstr ""
+
+#: cp/typeck.c:2068
+#, gcc-internal-format
+msgid "invalid use of %qD"
+msgstr ""
+
+#: cp/typeck.c:2100
#, gcc-internal-format
msgid "the type being destroyed is %qT, but the destructor refers to %qT"
msgstr ""
-#: cp/typeck.c:2084 cp/typeck.c:2104
+#: cp/typeck.c:2139 cp/typeck.c:2159
#, gcc-internal-format
msgid "%qD is not a template"
msgstr ""
-#: cp/typeck.c:2205
+#: cp/typeck.c:2263
#, gcc-internal-format
msgid "%<%D::%D%> is not a member of %qT"
msgstr ""
-#: cp/typeck.c:2220
+#: cp/typeck.c:2279
#, gcc-internal-format
msgid "%qT is not a base of %qT"
msgstr ""
-#: cp/typeck.c:2239
+#: cp/typeck.c:2299
#, gcc-internal-format
msgid "%qD has no member named %qE"
msgstr ""
-#: cp/typeck.c:2254
+#: cp/typeck.c:2315
#, gcc-internal-format
msgid "%qD is not a member template function"
msgstr ""
-#. A pointer to incomplete type (other than cv void) can be
-#. dereferenced [expr.unary.op]/1
-#: cp/typeck.c:2387
+#: cp/typeck.c:2458
#, gcc-internal-format
msgid "%qT is not a pointer-to-object type"
msgstr ""
-#: cp/typeck.c:2412
+#: cp/typeck.c:2486
#, gcc-internal-format
msgid "invalid use of %qs on pointer to member"
msgstr ""
-#: cp/typeck.c:2416
+#: cp/typeck.c:2490
#, gcc-internal-format
msgid "invalid type argument of %qs"
msgstr ""
-#: cp/typeck.c:2418
+#: cp/typeck.c:2492
#, gcc-internal-format
msgid "invalid type argument"
msgstr ""
-#: cp/typeck.c:2441
+#: cp/typeck.c:2515
#, gcc-internal-format
msgid "subscript missing in array reference"
msgstr ""
-#: cp/typeck.c:2515
+#: cp/typeck.c:2590
#, gcc-internal-format
msgid "ISO C++ forbids subscripting non-lvalue array"
msgstr ""
-#: cp/typeck.c:2526
+#: cp/typeck.c:2601
#, gcc-internal-format
msgid "subscripting array declared %<register%>"
msgstr ""
-#: cp/typeck.c:2611
+#: cp/typeck.c:2688
#, gcc-internal-format
msgid "object missing in use of %qE"
msgstr ""
-#: cp/typeck.c:2728
+#: cp/typeck.c:2817
#, gcc-internal-format
msgid "ISO C++ forbids calling %<::main%> from within program"
msgstr ""
-#: cp/typeck.c:2753
+#: cp/typeck.c:2836
#, gcc-internal-format
msgid ""
-"must use %<.*%> or %<->*%> to call pointer-to-member function in %<%E (...)%>"
+"must use %<.*%> or %<->*%> to call pointer-to-member function in %<%E (...)%"
+">, e.g. %<(... ->* %E) (...)%>"
msgstr ""
-#: cp/typeck.c:2767
+#: cp/typeck.c:2851
#, gcc-internal-format
msgid "%qE cannot be used as a function"
msgstr ""
-#: cp/typeck.c:2857
+#: cp/typeck.c:2944
#, gcc-internal-format
msgid "too many arguments to %s %q+#D"
msgstr ""
-#: cp/typeck.c:2858 cp/typeck.c:2962
+#: cp/typeck.c:2946 cp/typeck.c:3059
#, gcc-internal-format
msgid "at this point in file"
msgstr ""
-#: cp/typeck.c:2861
+#: cp/typeck.c:2949
#, gcc-internal-format
msgid "too many arguments to function"
msgstr ""
-#: cp/typeck.c:2891
+#: cp/typeck.c:2984
#, gcc-internal-format
msgid "parameter %P of %qD has incomplete type %qT"
msgstr ""
-#: cp/typeck.c:2894
+#: cp/typeck.c:2987
#, gcc-internal-format
msgid "parameter %P has incomplete type %qT"
msgstr ""
-#: cp/typeck.c:2961
+#: cp/typeck.c:3057
#, gcc-internal-format
msgid "too few arguments to %s %q+#D"
msgstr ""
-#: cp/typeck.c:2965
+#: cp/typeck.c:3062
#, gcc-internal-format
msgid "too few arguments to function"
msgstr ""
-#: cp/typeck.c:3129 cp/typeck.c:3139
+#: cp/typeck.c:3238 cp/typeck.c:3249
#, gcc-internal-format
msgid "assuming cast to type %qT from overloaded function"
msgstr ""
-#: cp/typeck.c:3335
+#: cp/typeck.c:3457
#, gcc-internal-format
msgid "left rotate count is negative"
msgstr ""
-#: cp/typeck.c:3336
+#: cp/typeck.c:3458
#, gcc-internal-format
msgid "right rotate count is negative"
msgstr ""
-#: cp/typeck.c:3339
+#: cp/typeck.c:3464
#, gcc-internal-format
msgid "left rotate count >= width of type"
msgstr ""
-#: cp/typeck.c:3340
+#: cp/typeck.c:3465
#, gcc-internal-format
msgid "right rotate count >= width of type"
msgstr ""
-#: cp/typeck.c:3356 cp/typeck.c:3538
+#: cp/typeck.c:3484 cp/typeck.c:3692
#, gcc-internal-format
msgid "comparison with string literal results in unspecified behaviour"
msgstr ""
-#: cp/typeck.c:3389 cp/typeck.c:3394 cp/typeck.c:3556 cp/typeck.c:3561
+#: cp/typeck.c:3524 cp/typeck.c:3532 cp/typeck.c:3712 cp/typeck.c:3720
#, gcc-internal-format
msgid "ISO C++ forbids comparison between pointer and integer"
msgstr ""
-#: cp/typeck.c:3575
+#: cp/typeck.c:3737
#, gcc-internal-format
msgid "unordered comparison on non-floating point argument"
msgstr ""
-#: cp/typeck.c:3613
+#: cp/typeck.c:3776
#, gcc-internal-format
msgid "invalid operands of types %qT and %qT to binary %qO"
msgstr ""
-#: cp/typeck.c:3746
-#, gcc-internal-format
-msgid "comparison between types %q#T and %q#T"
-msgstr ""
-
-#: cp/typeck.c:3783
-#, gcc-internal-format
-msgid "comparison between signed and unsigned integer expressions"
-msgstr ""
-
#. Some sort of arithmetic operation involving NULL was
#. performed. Note that pointer-difference and pointer-addition
#. have already been handled above, and so we don't end up here in
#. that case.
-#: cp/typeck.c:3855
+#: cp/typeck.c:3866
#, gcc-internal-format
msgid "NULL used in arithmetic"
msgstr ""
-#: cp/typeck.c:3924
+#: cp/typeck.c:3933
#, gcc-internal-format
msgid "ISO C++ forbids using pointer of type %<void *%> in subtraction"
msgstr ""
-#: cp/typeck.c:3926
+#: cp/typeck.c:3935
#, gcc-internal-format
msgid "ISO C++ forbids using pointer to a function in subtraction"
msgstr ""
-#: cp/typeck.c:3928
+#: cp/typeck.c:3937
#, gcc-internal-format
msgid "ISO C++ forbids using pointer to a method in subtraction"
msgstr ""
-#: cp/typeck.c:3940
+#: cp/typeck.c:3949
#, gcc-internal-format
msgid "invalid use of a pointer to an incomplete type in pointer arithmetic"
msgstr ""
-#: cp/typeck.c:4000
+#: cp/typeck.c:4009
#, gcc-internal-format
msgid "invalid use of %qE to form a pointer-to-member-function"
msgstr ""
-#: cp/typeck.c:4003
+#: cp/typeck.c:4012
#, gcc-internal-format
msgid " a qualified-id is required"
msgstr ""
-#: cp/typeck.c:4008
+#: cp/typeck.c:4017
#, gcc-internal-format
msgid ""
"parentheses around %qE cannot be used to form a pointer-to-member-function"
msgstr ""
-#: cp/typeck.c:4031
+#: cp/typeck.c:4040
#, gcc-internal-format
msgid "taking address of temporary"
msgstr ""
-#: cp/typeck.c:4284
+#: cp/typeck.c:4303
#, gcc-internal-format
msgid "ISO C++ forbids incrementing an enum"
msgstr ""
-#: cp/typeck.c:4285
+#: cp/typeck.c:4304
#, gcc-internal-format
msgid "ISO C++ forbids decrementing an enum"
msgstr ""
-#: cp/typeck.c:4296
+#: cp/typeck.c:4320
#, gcc-internal-format
msgid "cannot increment a pointer to incomplete type %qT"
msgstr ""
-#: cp/typeck.c:4297
+#: cp/typeck.c:4321
#, gcc-internal-format
msgid "cannot decrement a pointer to incomplete type %qT"
msgstr ""
-#: cp/typeck.c:4303
+#: cp/typeck.c:4332
#, gcc-internal-format
msgid "ISO C++ forbids incrementing a pointer of type %qT"
msgstr ""
-#: cp/typeck.c:4304
+#: cp/typeck.c:4333
#, gcc-internal-format
msgid "ISO C++ forbids decrementing a pointer of type %qT"
msgstr ""
-#: cp/typeck.c:4324
+#: cp/typeck.c:4359
#, gcc-internal-format
msgid "invalid use of Boolean expression as operand to %<operator--%>"
msgstr ""
-#. ARM $3.4
-#: cp/typeck.c:4354
+#: cp/typeck.c:4391
#, gcc-internal-format
msgid "ISO C++ forbids taking address of function %<::main%>"
msgstr ""
#. An expression like &memfn.
-#: cp/typeck.c:4410
+#: cp/typeck.c:4452
#, gcc-internal-format
msgid ""
"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%>"
msgstr ""
-#: cp/typeck.c:4415
+#: cp/typeck.c:4457
#, gcc-internal-format
msgid ""
"ISO C++ forbids taking the address of a bound member function to form a "
"pointer to member function. Say %<&%T::%D%>"
msgstr ""
-#: cp/typeck.c:4440
+#: cp/typeck.c:4486
#, gcc-internal-format
msgid "ISO C++ forbids taking the address of a cast to a non-lvalue expression"
msgstr ""
-#: cp/typeck.c:4464
+#: cp/typeck.c:4514
#, gcc-internal-format
msgid "cannot create pointer to reference member %qD"
msgstr ""
-#: cp/typeck.c:4675
+#: cp/typeck.c:4728
#, gcc-internal-format
msgid "cannot take the address of %<this%>, which is an rvalue expression"
msgstr ""
-#: cp/typeck.c:4698
+#: cp/typeck.c:4751
#, gcc-internal-format
msgid "address of explicit register variable %qD requested"
msgstr ""
-#: cp/typeck.c:4703
+#: cp/typeck.c:4756
#, gcc-internal-format
msgid "address requested for %qD, which is declared %<register%>"
msgstr ""
-#: cp/typeck.c:4769
+#: cp/typeck.c:4823
#, gcc-internal-format
msgid "%s expression list treated as compound expression"
msgstr ""
-#: cp/typeck.c:5172
+#: cp/typeck.c:4913
+#, gcc-internal-format
+msgid "cast from type %qT to type %qT casts away constness"
+msgstr ""
+
+#: cp/typeck.c:4918
+#, gcc-internal-format
+msgid "static_cast from type %qT to type %qT casts away constness"
+msgstr ""
+
+#: cp/typeck.c:4923
+#, gcc-internal-format
+msgid "reinterpret_cast from type %qT to type %qT casts away constness"
+msgstr ""
+
+#: cp/typeck.c:5241
#, gcc-internal-format
msgid "invalid static_cast from type %qT to type %qT"
msgstr ""
-#: cp/typeck.c:5194
+#: cp/typeck.c:5264
#, gcc-internal-format
msgid "converting from %qT to %qT"
msgstr ""
-#: cp/typeck.c:5242
+#: cp/typeck.c:5313
#, gcc-internal-format
msgid "invalid cast of an rvalue expression of type %qT to type %qT"
msgstr ""
-#: cp/typeck.c:5301
+#: cp/typeck.c:5375
#, gcc-internal-format
msgid "cast from %qT to %qT loses precision"
msgstr ""
-#: cp/typeck.c:5328
+#: cp/typeck.c:5405
#, gcc-internal-format
msgid "cast from %qT to %qT increases required alignment of target type"
msgstr ""
@@ -33050,692 +33429,692 @@ msgstr ""
#. where possible, and it is necessary in some cases. DR 195
#. addresses this issue, but as of 2004/10/26 is still in
#. drafting.
-#: cp/typeck.c:5348
+#: cp/typeck.c:5424
#, gcc-internal-format
msgid ""
"ISO C++ forbids casting between pointer-to-function and pointer-to-object"
msgstr ""
-#: cp/typeck.c:5359
+#: cp/typeck.c:5436
#, gcc-internal-format
msgid "invalid cast from type %qT to type %qT"
msgstr ""
-#: cp/typeck.c:5415
+#: cp/typeck.c:5492
#, gcc-internal-format
msgid ""
"invalid use of const_cast with type %qT, which is not a pointer, reference, "
"nor a pointer-to-data-member type"
msgstr ""
-#: cp/typeck.c:5424
+#: cp/typeck.c:5501
#, gcc-internal-format
msgid ""
"invalid use of const_cast with type %qT, which is a pointer or reference to "
"a function type"
msgstr ""
-#: cp/typeck.c:5449
+#: cp/typeck.c:5526
#, gcc-internal-format
msgid "invalid const_cast of an rvalue of type %qT to type %qT"
msgstr ""
-#: cp/typeck.c:5500
+#: cp/typeck.c:5575
#, gcc-internal-format
msgid "invalid const_cast from type %qT to type %qT"
msgstr ""
-#: cp/typeck.c:5568 cp/typeck.c:5573
+#: cp/typeck.c:5652 cp/typeck.c:5660
#, gcc-internal-format
msgid "ISO C++ forbids casting to an array type %qT"
msgstr ""
-#: cp/typeck.c:5581
+#: cp/typeck.c:5669
#, gcc-internal-format
msgid "invalid cast to function type %qT"
msgstr ""
-#: cp/typeck.c:5801
+#: cp/typeck.c:5907
#, gcc-internal-format
msgid " in evaluation of %<%Q(%#T, %#T)%>"
msgstr ""
-#: cp/typeck.c:5870
+#: cp/typeck.c:5982
#, gcc-internal-format
msgid "incompatible types in assignment of %qT to %qT"
msgstr ""
-#: cp/typeck.c:5881
+#: cp/typeck.c:5995
#, gcc-internal-format
msgid "array used as initializer"
msgstr ""
-#: cp/typeck.c:5883
+#: cp/typeck.c:5997
#, gcc-internal-format
msgid "invalid array assignment"
msgstr ""
-#: cp/typeck.c:5995
+#: cp/typeck.c:6113
#, gcc-internal-format
msgid " in pointer to member function conversion"
msgstr ""
-#: cp/typeck.c:6006
+#: cp/typeck.c:6124
#, gcc-internal-format
msgid "pointer to member conversion via virtual base %qT"
msgstr ""
-#: cp/typeck.c:6046 cp/typeck.c:6058
+#: cp/typeck.c:6164 cp/typeck.c:6176
#, gcc-internal-format
msgid " in pointer to member conversion"
msgstr ""
-#: cp/typeck.c:6137
+#: cp/typeck.c:6254
#, gcc-internal-format
msgid "invalid conversion to type %qT from type %qT"
msgstr ""
-#: cp/typeck.c:6400
+#: cp/typeck.c:6523
#, gcc-internal-format
msgid "cannot convert %qT to %qT for argument %qP to %qD"
msgstr ""
-#: cp/typeck.c:6403
+#: cp/typeck.c:6526
#, gcc-internal-format
msgid "cannot convert %qT to %qT in %s"
msgstr ""
-#: cp/typeck.c:6414
+#: cp/typeck.c:6540
#, gcc-internal-format
msgid "%s might be a candidate for a format attribute"
msgstr ""
-#: cp/typeck.c:6501 cp/typeck.c:6503
+#: cp/typeck.c:6629 cp/typeck.c:6631
#, gcc-internal-format
msgid "in passing argument %P of %q+D"
msgstr ""
-#: cp/typeck.c:6553
+#: cp/typeck.c:6681
#, gcc-internal-format
msgid "returning reference to temporary"
msgstr ""
-#: cp/typeck.c:6560
+#: cp/typeck.c:6688
#, gcc-internal-format
msgid "reference to non-lvalue returned"
msgstr ""
-#: cp/typeck.c:6576
+#: cp/typeck.c:6704
#, gcc-internal-format
msgid "reference to local variable %q+D returned"
msgstr ""
-#: cp/typeck.c:6579
+#: cp/typeck.c:6707
#, gcc-internal-format
msgid "address of local variable %q+D returned"
msgstr ""
-#: cp/typeck.c:6614
+#: cp/typeck.c:6742
#, gcc-internal-format
msgid "returning a value from a destructor"
msgstr ""
#. If a return statement appears in a handler of the
#. function-try-block of a constructor, the program is ill-formed.
-#: cp/typeck.c:6622
+#: cp/typeck.c:6750
#, gcc-internal-format
msgid "cannot return from a handler of a function-try-block of a constructor"
msgstr ""
#. You can't return a value from a constructor.
-#: cp/typeck.c:6625
+#: cp/typeck.c:6753
#, gcc-internal-format
msgid "returning a value from a constructor"
msgstr ""
-#: cp/typeck.c:6650
+#: cp/typeck.c:6778
#, gcc-internal-format
msgid "return-statement with no value, in function returning %qT"
msgstr ""
-#: cp/typeck.c:6671
+#: cp/typeck.c:6799
#, gcc-internal-format
msgid "return-statement with a value, in function returning 'void'"
msgstr ""
-#: cp/typeck.c:6702
+#: cp/typeck.c:6829
#, gcc-internal-format
msgid ""
"%<operator new%> must not return NULL unless it is declared %<throw()%> (or -"
"fcheck-new is in effect)"
msgstr ""
-#: cp/typeck2.c:53
+#: cp/typeck2.c:54
#, gcc-internal-format
msgid "type %qT is not a base type for type %qT"
msgstr ""
-#: cp/typeck2.c:96
+#: cp/typeck2.c:97
#, gcc-internal-format
msgid "%s of read-only parameter %qD"
msgstr ""
-#: cp/typeck2.c:101
+#: cp/typeck2.c:102
#, gcc-internal-format
msgid "%s of read-only reference %qD"
msgstr ""
-#: cp/typeck2.c:103
+#: cp/typeck2.c:104
#, gcc-internal-format
msgid "%s of read-only named return value %qD"
msgstr ""
-#: cp/typeck2.c:105
+#: cp/typeck2.c:106
#, gcc-internal-format
msgid "%s of function %qD"
msgstr ""
-#: cp/typeck2.c:107
+#: cp/typeck2.c:108
#, gcc-internal-format
msgid "%s of read-only location %qE"
msgstr ""
-#: cp/typeck2.c:287
+#: cp/typeck2.c:288
#, gcc-internal-format
msgid "cannot declare variable %q+D to be of abstract type %qT"
msgstr ""
-#: cp/typeck2.c:290
+#: cp/typeck2.c:291
#, gcc-internal-format
msgid "cannot declare parameter %q+D to be of abstract type %qT"
msgstr ""
-#: cp/typeck2.c:293
+#: cp/typeck2.c:294
#, gcc-internal-format
msgid "cannot declare field %q+D to be of abstract type %qT"
msgstr ""
-#: cp/typeck2.c:297
+#: cp/typeck2.c:298
#, gcc-internal-format
msgid "invalid abstract return type for member function %q+#D"
msgstr ""
-#: cp/typeck2.c:299
+#: cp/typeck2.c:300
#, gcc-internal-format
msgid "invalid abstract return type for function %q+#D"
msgstr ""
#. Here we do not have location information.
-#: cp/typeck2.c:302
+#: cp/typeck2.c:303
#, gcc-internal-format
msgid "invalid abstract type %qT for %qE"
msgstr ""
-#: cp/typeck2.c:304
+#: cp/typeck2.c:305
#, gcc-internal-format
msgid "invalid abstract type for %q+D"
msgstr ""
-#: cp/typeck2.c:307
+#: cp/typeck2.c:308
#, gcc-internal-format
msgid "cannot allocate an object of abstract type %qT"
msgstr ""
-#: cp/typeck2.c:315
+#: cp/typeck2.c:316
#, gcc-internal-format
msgid "%J because the following virtual functions are pure within %qT:"
msgstr ""
-#: cp/typeck2.c:319
+#: cp/typeck2.c:320
#, gcc-internal-format
msgid "\t%+#D"
msgstr ""
-#: cp/typeck2.c:326
+#: cp/typeck2.c:327
#, gcc-internal-format
msgid "%J since type %qT has pure virtual functions"
msgstr ""
-#: cp/typeck2.c:593
+#: cp/typeck2.c:603
#, gcc-internal-format
msgid "constructor syntax used, but no constructor declared for type %qT"
msgstr ""
-#: cp/typeck2.c:607
+#: cp/typeck2.c:617
#, gcc-internal-format
msgid "cannot initialize arrays using this syntax"
msgstr ""
-#: cp/typeck2.c:683
+#: cp/typeck2.c:703
+#, gcc-internal-format
+msgid "narrowing conversion of %qE to %qT inside { }"
+msgstr ""
+
+#: cp/typeck2.c:760
#, gcc-internal-format
msgid "int-array initialized from non-wide string"
msgstr ""
-#: cp/typeck2.c:738
+#: cp/typeck2.c:765
+#, gcc-internal-format
+msgid "int-array initialized from incompatible wide string"
+msgstr ""
+
+#: cp/typeck2.c:824
#, gcc-internal-format
msgid "cannot initialize aggregate of type %qT with a compound literal"
msgstr ""
-#: cp/typeck2.c:747
+#: cp/typeck2.c:833
#, gcc-internal-format
msgid "array must be initialized with a brace-enclosed initializer"
msgstr ""
-#: cp/typeck2.c:823 cp/typeck2.c:924
+#: cp/typeck2.c:915 cp/typeck2.c:1017
#, gcc-internal-format
msgid "non-trivial designated initializers not supported"
msgstr ""
-#: cp/typeck2.c:947 cp/typeck2.c:961
+#: cp/typeck2.c:1041 cp/typeck2.c:1055
#, gcc-internal-format
msgid "missing initializer for member %qD"
msgstr ""
-#: cp/typeck2.c:952
+#: cp/typeck2.c:1046
#, gcc-internal-format
msgid "uninitialized const member %qD"
msgstr ""
-#: cp/typeck2.c:954
+#: cp/typeck2.c:1048
#, gcc-internal-format
msgid "member %qD with uninitialized const fields"
msgstr ""
-#: cp/typeck2.c:956
+#: cp/typeck2.c:1050
#, gcc-internal-format
msgid "member %qD is uninitialized reference"
msgstr ""
-#: cp/typeck2.c:1011
+#: cp/typeck2.c:1105
#, gcc-internal-format
msgid "no field %qD found in union being initialized"
msgstr ""
-#: cp/typeck2.c:1020
+#: cp/typeck2.c:1114
#, gcc-internal-format
msgid "index value instead of field name in union initializer"
msgstr ""
-#: cp/typeck2.c:1175
+#: cp/typeck2.c:1269
#, gcc-internal-format
msgid "circular pointer delegation detected"
msgstr ""
-#: cp/typeck2.c:1188
+#: cp/typeck2.c:1282
#, gcc-internal-format
msgid "base operand of %<->%> has non-pointer type %qT"
msgstr ""
-#: cp/typeck2.c:1212
+#: cp/typeck2.c:1306
#, gcc-internal-format
msgid "result of %<operator->()%> yields non-pointer result"
msgstr ""
-#: cp/typeck2.c:1214
+#: cp/typeck2.c:1308
#, gcc-internal-format
msgid "base operand of %<->%> is not a pointer"
msgstr ""
-#: cp/typeck2.c:1236
+#: cp/typeck2.c:1330
#, gcc-internal-format
msgid "%qE cannot be used as a member pointer, since it is of type %qT"
msgstr ""
-#: cp/typeck2.c:1245
+#: cp/typeck2.c:1339
#, gcc-internal-format
msgid "cannot apply member pointer %qE to %qE, which is of non-class type %qT"
msgstr ""
-#: cp/typeck2.c:1267
+#: cp/typeck2.c:1361
#, gcc-internal-format
msgid "pointer to member type %qT incompatible with object type %qT"
msgstr ""
-#: cp/typeck2.c:1495
+#: cp/typeck2.c:1602
#, gcc-internal-format
msgid "call to function %qD which throws incomplete type %q#T"
msgstr ""
-#: cp/typeck2.c:1498
+#: cp/typeck2.c:1605
#, gcc-internal-format
msgid "call to function which throws incomplete type %q#T"
msgstr ""
-#: fortran/f95-lang.c:235
+#: fortran/f95-lang.c:208
#, gcc-internal-format
msgid "Unexpected type in truthvalue_conversion"
msgstr ""
-#: fortran/f95-lang.c:291
+#: fortran/f95-lang.c:270
#, gcc-internal-format
msgid "can't open input file: %s"
msgstr ""
-#: fortran/f95-lang.c:631
+#: fortran/f95-lang.c:603
#, gcc-internal-format
msgid "global register variable %qs used in nested function"
msgstr ""
-#: fortran/f95-lang.c:635
+#: fortran/f95-lang.c:607
#, gcc-internal-format
msgid "register variable %qs used in nested function"
msgstr ""
-#: fortran/f95-lang.c:642
+#: fortran/f95-lang.c:614
#, gcc-internal-format
msgid "address of global register variable %qs requested"
msgstr ""
-#: fortran/f95-lang.c:660
+#: fortran/f95-lang.c:632
#, gcc-internal-format
msgid "address of register variable %qs requested"
msgstr ""
-#: fortran/trans-array.c:3805
+#: fortran/trans-array.c:3904
#, gcc-internal-format
msgid "Possible frontend bug: array constructor not expanded"
msgstr ""
-#: fortran/trans-array.c:5499
+#: fortran/trans-array.c:5659
#, gcc-internal-format
msgid ""
"Possible frontend bug: Deferred array size without pointer, allocatable "
"attribute or derived type without allocatable components."
msgstr ""
-#: fortran/trans-array.c:5975
+#: fortran/trans-array.c:6140
#, gcc-internal-format
msgid "bad expression type during walk (%d)"
msgstr ""
-#: fortran/trans-const.c:270
+#: fortran/trans-const.c:320
#, gcc-internal-format
msgid "gfc_conv_constant_to_tree(): invalid type: %s"
msgstr ""
-#: fortran/trans-decl.c:976
+#: fortran/trans-decl.c:981
#, gcc-internal-format
msgid "intrinsic variable which isn't a procedure"
msgstr ""
-#: fortran/trans-decl.c:2671
-#, gcc-internal-format
-msgid "Function does not return a value"
-msgstr ""
-
-#: fortran/trans-decl.c:2859
+#: fortran/trans-decl.c:2962
#, gcc-internal-format
msgid "backend decl for module variable %s already exists"
msgstr ""
-#: fortran/trans-decl.c:3341
-#, gcc-internal-format
-msgid "Function return value not set"
-msgstr ""
-
-#: fortran/trans-expr.c:1179
+#: fortran/trans-expr.c:1235
#, gcc-internal-format
msgid "Unknown intrinsic op"
msgstr ""
-#: fortran/trans-intrinsic.c:714
+#: fortran/trans-intrinsic.c:733
#, gcc-internal-format
msgid "Intrinsic function %s(%d) not recognized"
msgstr ""
-#: fortran/trans-io.c:1929
+#: fortran/trans-io.c:2105
#, gcc-internal-format
msgid "Bad IO basetype (%d)"
msgstr ""
-#: fortran/trans-types.c:387
+#: fortran/trans-types.c:392
#, gcc-internal-format
msgid "integer kind=8 not available for -fdefault-integer-8 option"
msgstr ""
-#: fortran/trans-types.c:410
+#: fortran/trans-types.c:415
#, gcc-internal-format
msgid "real kind=8 not available for -fdefault-real-8 option"
msgstr ""
-#: fortran/trans-types.c:423
+#: fortran/trans-types.c:428
#, gcc-internal-format
msgid "Use of -fdefault-double-8 requires -fdefault-real-8"
msgstr ""
-#: fortran/trans-types.c:1185
+#: fortran/trans-types.c:1261
#, gcc-internal-format
msgid "Array element size too big"
msgstr ""
-#: fortran/trans.c:1151
+#: fortran/trans.c:1167
#, gcc-internal-format
msgid "gfc_trans_code(): Bad statement code"
msgstr ""
-#: java/class.c:835
+#: java/class.c:833
#, gcc-internal-format
msgid "bad method signature"
msgstr ""
-#: java/class.c:891
+#: java/class.c:889
#, gcc-internal-format
msgid "misplaced ConstantValue attribute (not in any field)"
msgstr ""
-#: java/class.c:894
+#: java/class.c:892
#, gcc-internal-format
msgid "duplicate ConstantValue attribute for field '%s'"
msgstr ""
-#: java/class.c:905
+#: java/class.c:903
#, gcc-internal-format
msgid "ConstantValue attribute of field '%s' has wrong type"
msgstr ""
-#: java/class.c:1595
+#: java/class.c:1601
#, gcc-internal-format
msgid "%Jabstract method in non-abstract class"
msgstr ""
-#: java/class.c:2665
+#: java/class.c:2669
#, gcc-internal-format
msgid "non-static method %q+D overrides static method"
msgstr ""
-#: java/decl.c:1154
+#: java/decl.c:1155
#, gcc-internal-format
msgid "%q+D used prior to declaration"
msgstr ""
-#: java/decl.c:1577
+#: java/decl.c:1578
#, gcc-internal-format
msgid "In %+D: overlapped variable and exception ranges at %d"
msgstr ""
-#: java/decl.c:1640
+#: java/decl.c:1629
#, gcc-internal-format
msgid "bad type in parameter debug info"
msgstr ""
-#: java/decl.c:1649
+#: java/decl.c:1638
#, gcc-internal-format
msgid "bad PC range for debug info for local %q+D"
msgstr ""
-#: java/expr.c:376
+#: java/expr.c:377
#, gcc-internal-format
msgid "need to insert runtime check for %s"
msgstr ""
-#: java/expr.c:524 java/expr.c:571
+#: java/expr.c:525 java/expr.c:572
#, gcc-internal-format
msgid "assert: %s is assign compatible with %s"
msgstr ""
-#: java/expr.c:689
+#: java/expr.c:690
#, gcc-internal-format
msgid "stack underflow - dup* operation"
msgstr ""
-#: java/expr.c:1676
+#: java/expr.c:1688
#, gcc-internal-format
msgid "reference %qs is ambiguous: appears in interface %qs and interface %qs"
msgstr ""
-#: java/expr.c:1704
+#: java/expr.c:1716
#, gcc-internal-format
msgid "field %qs not found"
msgstr ""
-#: java/expr.c:2243
+#: java/expr.c:2255
#, gcc-internal-format
msgid "method '%s' not found in class"
msgstr ""
-#: java/expr.c:2448
+#: java/expr.c:2460
#, gcc-internal-format
msgid "failed to find class '%s'"
msgstr ""
-#: java/expr.c:2489
+#: java/expr.c:2501
#, gcc-internal-format
msgid "class '%s' has no method named '%s' matching signature '%s'"
msgstr ""
-#: java/expr.c:2520
+#: java/expr.c:2532
#, gcc-internal-format
msgid "invokestatic on non static method"
msgstr ""
-#: java/expr.c:2525
+#: java/expr.c:2537
#, gcc-internal-format
msgid "invokestatic on abstract method"
msgstr ""
-#: java/expr.c:2533
+#: java/expr.c:2545
#, gcc-internal-format
msgid "invoke[non-static] on static method"
msgstr ""
-#: java/expr.c:2890
+#: java/expr.c:2902
#, gcc-internal-format
msgid "missing field '%s' in '%s'"
msgstr ""
-#: java/expr.c:2897
+#: java/expr.c:2909
#, gcc-internal-format
msgid "mismatching signature for field '%s' in '%s'"
msgstr ""
-#: java/expr.c:2926
+#: java/expr.c:2938
#, gcc-internal-format
msgid "assignment to final field %q+D not in field's class"
msgstr ""
-#: java/expr.c:3148
+#: java/expr.c:3161
#, gcc-internal-format
msgid "invalid PC in line number table"
msgstr ""
-#: java/expr.c:3198
+#: java/expr.c:3211
#, gcc-internal-format
msgid "unreachable bytecode from %d to before %d"
msgstr ""
-#: java/expr.c:3242
+#: java/expr.c:3253
#, gcc-internal-format
msgid "unreachable bytecode from %d to the end of the method"
msgstr ""
#. duplicate code from LOAD macro
-#: java/expr.c:3547
+#: java/expr.c:3560
#, gcc-internal-format
msgid "unrecogized wide sub-instruction"
msgstr ""
-#: java/jcf-parse.c:521
+#: java/jcf-parse.c:508
#, gcc-internal-format
msgid "<constant pool index %d not in range>"
msgstr ""
-#: java/jcf-parse.c:531
+#: java/jcf-parse.c:518
#, gcc-internal-format
msgid "<constant pool index %d unexpected type"
msgstr ""
-#: java/jcf-parse.c:1111
+#: java/jcf-parse.c:1098
#, gcc-internal-format
msgid "bad string constant"
msgstr ""
-#: java/jcf-parse.c:1129
+#: java/jcf-parse.c:1116
#, gcc-internal-format
msgid "bad value constant type %d, index %d"
msgstr ""
-#: java/jcf-parse.c:1421 java/jcf-parse.c:1427
+#: java/jcf-parse.c:1399 java/jcf-parse.c:1405
#, gcc-internal-format
msgid "cannot find file for class %s"
msgstr ""
-#: java/jcf-parse.c:1452
+#: java/jcf-parse.c:1430
#, gcc-internal-format
msgid "not a valid Java .class file"
msgstr ""
-#: java/jcf-parse.c:1455
+#: java/jcf-parse.c:1433
#, gcc-internal-format
msgid "error while parsing constant pool"
msgstr ""
#. FIXME - where was first time
-#: java/jcf-parse.c:1470
+#: java/jcf-parse.c:1448
#, gcc-internal-format
msgid "reading class %s for the second time from %s"
msgstr ""
-#: java/jcf-parse.c:1488
+#: java/jcf-parse.c:1466
#, gcc-internal-format
msgid "error while parsing fields"
msgstr ""
-#: java/jcf-parse.c:1491
+#: java/jcf-parse.c:1469
#, gcc-internal-format
msgid "error while parsing methods"
msgstr ""
-#: java/jcf-parse.c:1494
+#: java/jcf-parse.c:1472
#, gcc-internal-format
msgid "error while parsing final attributes"
msgstr ""
-#: java/jcf-parse.c:1541
+#: java/jcf-parse.c:1512
#, gcc-internal-format
msgid "%Hduplicate class will only be compiled once"
msgstr ""
-#: java/jcf-parse.c:1638
+#: java/jcf-parse.c:1607
#, gcc-internal-format
msgid "missing Code attribute"
msgstr ""
-#: java/jcf-parse.c:1860
+#: java/jcf-parse.c:1825
#, gcc-internal-format
msgid "no input file specified"
msgstr ""
-#: java/jcf-parse.c:1895
+#: java/jcf-parse.c:1860
#, gcc-internal-format
msgid "can't close input file %s: %m"
msgstr ""
-#: java/jcf-parse.c:1942
+#: java/jcf-parse.c:1905
#, gcc-internal-format
msgid "bad zip/jar file %s"
msgstr ""
-#: java/jcf-parse.c:2152
+#: java/jcf-parse.c:2112
#, gcc-internal-format
msgid "error while reading %s from zip file"
msgstr ""
@@ -33745,22 +34124,22 @@ msgstr ""
msgid "warning: already-compiled .class files ignored with -C"
msgstr ""
-#: java/lang.c:594
+#: java/lang.c:543
#, gcc-internal-format
msgid "-findirect-dispatch is incompatible with -freduced-reflection"
msgstr ""
-#: java/lang.c:597
+#: java/lang.c:546
#, gcc-internal-format
msgid "-fjni is incompatible with -freduced-reflection"
msgstr ""
-#: java/lang.c:608
+#: java/lang.c:557
#, gcc-internal-format
msgid "can't do dependency tracking with input from stdin"
msgstr ""
-#: java/lang.c:624
+#: java/lang.c:573
#, gcc-internal-format
msgid "couldn't determine target name for dependency tracking"
msgstr ""
@@ -33770,7 +34149,7 @@ msgstr ""
msgid "internal error - invalid Utf8 name"
msgstr ""
-#: java/typeck.c:491
+#: java/typeck.c:490
#, gcc-internal-format
msgid "junk at end of signature string"
msgstr ""
@@ -33790,234 +34169,234 @@ msgstr ""
msgid "bad pc in exception_table"
msgstr ""
-#: objc/objc-act.c:705
+#: objc/objc-act.c:698
#, gcc-internal-format
msgid "%<@end%> must appear in an @implementation context"
msgstr ""
-#: objc/objc-act.c:734
+#: objc/objc-act.c:727
#, gcc-internal-format
msgid "method declaration not in @interface context"
msgstr ""
-#: objc/objc-act.c:745
+#: objc/objc-act.c:738
#, gcc-internal-format
msgid "method definition not in @implementation context"
msgstr ""
-#: objc/objc-act.c:1177
+#: objc/objc-act.c:1167
#, gcc-internal-format
msgid "comparison of distinct Objective-C types lacks a cast"
msgstr ""
-#: objc/objc-act.c:1181
+#: objc/objc-act.c:1171
#, gcc-internal-format
msgid "initialization from distinct Objective-C type"
msgstr ""
-#: objc/objc-act.c:1185
+#: objc/objc-act.c:1175
#, gcc-internal-format
msgid "assignment from distinct Objective-C type"
msgstr ""
-#: objc/objc-act.c:1189
+#: objc/objc-act.c:1179
#, gcc-internal-format
msgid "distinct Objective-C type in return"
msgstr ""
-#: objc/objc-act.c:1193
+#: objc/objc-act.c:1183
#, gcc-internal-format
msgid "passing argument %d of %qE from distinct Objective-C type"
msgstr ""
-#: objc/objc-act.c:1348
+#: objc/objc-act.c:1339
#, gcc-internal-format
msgid "statically allocated instance of Objective-C class %qs"
msgstr ""
-#: objc/objc-act.c:1425
+#: objc/objc-act.c:1416
#, gcc-internal-format
msgid "protocol %qs has circular dependency"
msgstr ""
-#: objc/objc-act.c:1450 objc/objc-act.c:6583
+#: objc/objc-act.c:1441 objc/objc-act.c:6570
#, gcc-internal-format
msgid "cannot find protocol declaration for %qs"
msgstr ""
-#: objc/objc-act.c:1914 objc/objc-act.c:3350 objc/objc-act.c:7196
-#: objc/objc-act.c:7532 objc/objc-act.c:7586 objc/objc-act.c:7611
+#: objc/objc-act.c:1905 objc/objc-act.c:3338 objc/objc-act.c:7183
+#: objc/objc-act.c:7519 objc/objc-act.c:7573 objc/objc-act.c:7598
#, gcc-internal-format
msgid "cannot find interface declaration for %qs"
msgstr ""
-#: objc/objc-act.c:1918
+#: objc/objc-act.c:1909
#, gcc-internal-format
msgid "interface %qs does not have valid constant string layout"
msgstr ""
-#: objc/objc-act.c:1923
+#: objc/objc-act.c:1914
#, gcc-internal-format
msgid "cannot find reference tag for class %qs"
msgstr ""
-#: objc/objc-act.c:2550
+#: objc/objc-act.c:2539
#, gcc-internal-format
msgid "%Hcreating selector for nonexistent method %qE"
msgstr ""
-#: objc/objc-act.c:2752
+#: objc/objc-act.c:2741
#, gcc-internal-format
msgid "%qs is not an Objective-C class name or alias"
msgstr ""
-#: objc/objc-act.c:2878 objc/objc-act.c:2909 objc/objc-act.c:7460
-#: objc/objc-act.c:7761 objc/objc-act.c:7791
+#: objc/objc-act.c:2867 objc/objc-act.c:2898 objc/objc-act.c:7447
+#: objc/objc-act.c:7748 objc/objc-act.c:7778
#, gcc-internal-format
msgid "Objective-C declarations may only appear in global scope"
msgstr ""
-#: objc/objc-act.c:2883
+#: objc/objc-act.c:2872
#, gcc-internal-format
msgid "cannot find class %qs"
msgstr ""
-#: objc/objc-act.c:2885
+#: objc/objc-act.c:2874
#, gcc-internal-format
msgid "class %qs already exists"
msgstr ""
-#: objc/objc-act.c:2929 objc/objc-act.c:7501
+#: objc/objc-act.c:2918 objc/objc-act.c:7488
#, gcc-internal-format
msgid "%qs redeclared as different kind of symbol"
msgstr ""
-#: objc/objc-act.c:3203
+#: objc/objc-act.c:3191
#, gcc-internal-format
msgid "strong-cast assignment has been intercepted"
msgstr ""
-#: objc/objc-act.c:3245
+#: objc/objc-act.c:3233
#, gcc-internal-format
msgid "strong-cast may possibly be needed"
msgstr ""
-#: objc/objc-act.c:3255
+#: objc/objc-act.c:3243
#, gcc-internal-format
msgid "instance variable assignment has been intercepted"
msgstr ""
-#: objc/objc-act.c:3274
+#: objc/objc-act.c:3262
#, gcc-internal-format
msgid "pointer arithmetic for garbage-collected objects not allowed"
msgstr ""
-#: objc/objc-act.c:3280
+#: objc/objc-act.c:3268
#, gcc-internal-format
msgid "global/static variable assignment has been intercepted"
msgstr ""
-#: objc/objc-act.c:3463
+#: objc/objc-act.c:3451
#, gcc-internal-format
msgid "use %<-fobjc-exceptions%> to enable Objective-C exception syntax"
msgstr ""
-#: objc/objc-act.c:3804
+#: objc/objc-act.c:3792
#, gcc-internal-format
msgid "@catch parameter is not a known Objective-C class type"
msgstr ""
-#: objc/objc-act.c:3820
+#: objc/objc-act.c:3808
#, gcc-internal-format
msgid "exception of type %<%T%> will be caught"
msgstr ""
-#: objc/objc-act.c:3822
+#: objc/objc-act.c:3810
#, gcc-internal-format
msgid "%H by earlier handler for %<%T%>"
msgstr ""
-#: objc/objc-act.c:3875
+#: objc/objc-act.c:3863
#, gcc-internal-format
msgid "%<@try%> without %<@catch%> or %<@finally%>"
msgstr ""
-#: objc/objc-act.c:3923
+#: objc/objc-act.c:3911
#, gcc-internal-format
msgid "%<@throw%> (rethrow) used outside of a @catch block"
msgstr ""
-#: objc/objc-act.c:4324
+#: objc/objc-act.c:4312
#, gcc-internal-format
msgid "type %q+D does not have a known size"
msgstr ""
-#: objc/objc-act.c:4957
+#: objc/objc-act.c:4945
#, gcc-internal-format
msgid "%J%s %qs"
msgstr ""
-#: objc/objc-act.c:4980 objc/objc-act.c:4999
+#: objc/objc-act.c:4968 objc/objc-act.c:4987
#, gcc-internal-format
msgid "inconsistent instance variable specification"
msgstr ""
-#: objc/objc-act.c:5857
+#: objc/objc-act.c:5845
#, gcc-internal-format
msgid "can not use an object as parameter to a method"
msgstr ""
-#: objc/objc-act.c:6080
+#: objc/objc-act.c:6068
#, gcc-internal-format
msgid "multiple %s named %<%c%s%> found"
msgstr ""
-#: objc/objc-act.c:6307
+#: objc/objc-act.c:6294
#, gcc-internal-format
msgid "no super class declared in @interface for %qs"
msgstr ""
-#: objc/objc-act.c:6345
+#: objc/objc-act.c:6332
#, gcc-internal-format
msgid "found %<-%s%> instead of %<+%s%> in protocol(s)"
msgstr ""
-#: objc/objc-act.c:6404
+#: objc/objc-act.c:6391
#, gcc-internal-format
msgid "invalid receiver type %qs"
msgstr ""
-#: objc/objc-act.c:6419
+#: objc/objc-act.c:6406
#, gcc-internal-format
msgid "%<%c%s%> not found in protocol(s)"
msgstr ""
-#: objc/objc-act.c:6433
+#: objc/objc-act.c:6420
#, gcc-internal-format
msgid "%qs may not respond to %<%c%s%>"
msgstr ""
-#: objc/objc-act.c:6441
+#: objc/objc-act.c:6428
#, gcc-internal-format
msgid "no %<%c%s%> method found"
msgstr ""
-#: objc/objc-act.c:6447
+#: objc/objc-act.c:6434
#, gcc-internal-format
msgid "(Messages without a matching method signature"
msgstr ""
-#: objc/objc-act.c:6448
+#: objc/objc-act.c:6435
#, gcc-internal-format
msgid "will be assumed to return %<id%> and accept"
msgstr ""
-#: objc/objc-act.c:6449
+#: objc/objc-act.c:6436
#, gcc-internal-format
msgid "%<...%> as arguments.)"
msgstr ""
-#: objc/objc-act.c:6682
+#: objc/objc-act.c:6669
#, gcc-internal-format
msgid "undeclared selector %qs"
msgstr ""
@@ -34031,191 +34410,161 @@ msgstr ""
#. to an instance variable. It's better to catch the cases
#. where this is done unknowingly than to support the above
#. paradigm.
-#: objc/objc-act.c:6724
+#: objc/objc-act.c:6711
#, gcc-internal-format
msgid "instance variable %qs accessed in class method"
msgstr ""
-#: objc/objc-act.c:6957
+#: objc/objc-act.c:6944
#, gcc-internal-format
msgid "duplicate declaration of method %<%c%s%>"
msgstr ""
-#: objc/objc-act.c:7018
+#: objc/objc-act.c:7005
#, gcc-internal-format
msgid "duplicate interface declaration for category %<%s(%s)%>"
msgstr ""
-#: objc/objc-act.c:7045
+#: objc/objc-act.c:7032
#, gcc-internal-format
msgid "illegal reference type specified for instance variable %qs"
msgstr ""
-#: objc/objc-act.c:7056
+#: objc/objc-act.c:7043
#, gcc-internal-format
msgid "instance variable %qs has unknown size"
msgstr ""
-#: objc/objc-act.c:7081
+#: objc/objc-act.c:7068
#, gcc-internal-format
msgid "type %qs has no default constructor to call"
msgstr ""
-#: objc/objc-act.c:7087
+#: objc/objc-act.c:7074
#, gcc-internal-format
msgid "destructor for %qs shall not be run either"
msgstr ""
#. Vtable pointers are Real Bad(tm), since Obj-C cannot
#. initialize them.
-#: objc/objc-act.c:7099
+#: objc/objc-act.c:7086
#, gcc-internal-format
msgid "type %qs has virtual member functions"
msgstr ""
-#: objc/objc-act.c:7100
+#: objc/objc-act.c:7087
#, gcc-internal-format
msgid "illegal aggregate type %qs specified for instance variable %qs"
msgstr ""
-#: objc/objc-act.c:7110
+#: objc/objc-act.c:7097
#, gcc-internal-format
msgid "type %qs has a user-defined constructor"
msgstr ""
-#: objc/objc-act.c:7112
+#: objc/objc-act.c:7099
#, gcc-internal-format
msgid "type %qs has a user-defined destructor"
msgstr ""
-#: objc/objc-act.c:7116
+#: objc/objc-act.c:7103
#, gcc-internal-format
msgid ""
"C++ constructors and destructors will not be invoked for Objective-C fields"
msgstr ""
-#: objc/objc-act.c:7225
+#: objc/objc-act.c:7212
#, gcc-internal-format
msgid "instance variable %qs is declared private"
msgstr ""
-#: objc/objc-act.c:7236
+#: objc/objc-act.c:7223
#, gcc-internal-format
msgid "instance variable %qs is %s; this will be a hard error in the future"
msgstr ""
-#: objc/objc-act.c:7243
+#: objc/objc-act.c:7230
#, gcc-internal-format
msgid "instance variable %qs is declared %s"
msgstr ""
-#: objc/objc-act.c:7269 objc/objc-act.c:7357
+#: objc/objc-act.c:7256 objc/objc-act.c:7344
#, gcc-internal-format
msgid "incomplete implementation of class %qs"
msgstr ""
-#: objc/objc-act.c:7273 objc/objc-act.c:7362
+#: objc/objc-act.c:7260 objc/objc-act.c:7349
#, gcc-internal-format
msgid "incomplete implementation of category %qs"
msgstr ""
-#: objc/objc-act.c:7278 objc/objc-act.c:7367
+#: objc/objc-act.c:7265 objc/objc-act.c:7354
#, gcc-internal-format
msgid "method definition for %<%c%s%> not found"
msgstr ""
-#: objc/objc-act.c:7408
+#: objc/objc-act.c:7395
#, gcc-internal-format
msgid "%s %qs does not fully implement the %qs protocol"
msgstr ""
-#: objc/objc-act.c:7466 objc/objc-act.c:9156
+#: objc/objc-act.c:7453 objc/objc-act.c:9153
#, gcc-internal-format
msgid "%<@end%> missing in implementation context"
msgstr ""
-#: objc/objc-act.c:7485
+#: objc/objc-act.c:7472
#, gcc-internal-format
msgid "cannot find interface declaration for %qs, superclass of %qs"
msgstr ""
-#: objc/objc-act.c:7515
+#: objc/objc-act.c:7502
#, gcc-internal-format
msgid "reimplementation of class %qs"
msgstr ""
-#: objc/objc-act.c:7547
+#: objc/objc-act.c:7534
#, gcc-internal-format
msgid "conflicting super class name %qs"
msgstr ""
-#: objc/objc-act.c:7549
+#: objc/objc-act.c:7536
#, gcc-internal-format
msgid "previous declaration of %qs"
msgstr ""
-#: objc/objc-act.c:7565 objc/objc-act.c:7563
+#: objc/objc-act.c:7552 objc/objc-act.c:7550
#, gcc-internal-format
msgid "duplicate interface declaration for class %qs"
msgstr ""
-#: objc/objc-act.c:7819
+#: objc/objc-act.c:7806
#, gcc-internal-format
msgid "duplicate declaration for protocol %qs"
msgstr ""
#. Add a readable method name to the warning.
-#: objc/objc-act.c:8397
+#: objc/objc-act.c:8394
#, gcc-internal-format
msgid "%J%s %<%c%s%>"
msgstr ""
-#: objc/objc-act.c:8727
+#: objc/objc-act.c:8724
#, gcc-internal-format
msgid "no super class declared in interface for %qs"
msgstr ""
-#: objc/objc-act.c:8776
+#: objc/objc-act.c:8773
#, gcc-internal-format
msgid "[super ...] must appear in a method context"
msgstr ""
-#: objc/objc-act.c:8816
+#: objc/objc-act.c:8813
#, gcc-internal-format
msgid "method possibly missing a [super dealloc] call"
msgstr ""
-#: objc/objc-act.c:9446
+#: objc/objc-act.c:9443
#, gcc-internal-format
msgid "local declaration of %qs hides instance variable"
msgstr ""
-
-#: treelang/tree1.c:278
-#, gcc-internal-format
-msgid "%HDuplicate name %q.*s."
-msgstr ""
-
-#: treelang/treetree.c:796
-#, gcc-internal-format
-msgid "Global register variable %qD used in nested function."
-msgstr ""
-
-#: treelang/treetree.c:800
-#, gcc-internal-format
-msgid "Register variable %qD used in nested function."
-msgstr ""
-
-#: treelang/treetree.c:806
-#, gcc-internal-format
-msgid "Address of global register variable %qD requested."
-msgstr ""
-
-#: treelang/treetree.c:811
-#, gcc-internal-format
-msgid "Address of register variable %qD requested."
-msgstr ""
-
-#: treelang/treetree.c:1169
-#, gcc-internal-format
-msgid "%qD attribute ignored"
-msgstr ""
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/postreload-gcse.c b/gcc/postreload-gcse.c
index 27889d01f2e..884830abebd 100644
--- a/gcc/postreload-gcse.c
+++ b/gcc/postreload-gcse.c
@@ -1066,7 +1066,7 @@ eliminate_partially_redundant_load (basic_block bb, rtx insn,
if (/* No load can be replaced by copy. */
npred_ok == 0
/* Prevent exploding the code. */
- || (optimize_size && npred_ok > 1)
+ || (optimize_bb_for_size_p (bb) && npred_ok > 1)
/* If we don't have profile information we cannot tell if splitting
a critical edge is profitable or not so don't do it. */
|| ((! profile_info || ! flag_branch_probabilities
@@ -1306,7 +1306,8 @@ gcse_after_reload_main (rtx f ATTRIBUTE_UNUSED)
static bool
gate_handle_gcse2 (void)
{
- return (optimize > 0 && flag_gcse_after_reload);
+ return (optimize > 0 && flag_gcse_after_reload
+ && optimize_function_for_speed_p (cfun));
}
diff --git a/gcc/postreload.c b/gcc/postreload.c
index 5f6fec1e953..7659bab435a 100644
--- a/gcc/postreload.c
+++ b/gcc/postreload.c
@@ -1565,7 +1565,7 @@ move2add_note_store (rtx dst, const_rtx set, void *data ATTRIBUTE_UNUSED)
static bool
gate_handle_postreload (void)
{
- return (optimize > 0);
+ return (optimize > 0 && reload_completed);
}
diff --git a/gcc/predict.c b/gcc/predict.c
index f85786e1a1d..6ca1a0cddc2 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;
@@ -136,6 +138,27 @@ maybe_hot_bb_p (const_basic_block bb)
return maybe_hot_frequency_p (bb->frequency);
}
+/* Return true if the call can be hot. */
+
+bool
+cgraph_maybe_hot_edge_p (struct cgraph_edge *edge)
+{
+ if (profile_info && flag_branch_probabilities
+ && (edge->count
+ <= profile_info->sum_max / PARAM_VALUE (HOT_BB_COUNT_FRACTION)))
+ return false;
+ if (lookup_attribute ("cold", DECL_ATTRIBUTES (edge->callee->decl))
+ || lookup_attribute ("cold", DECL_ATTRIBUTES (edge->caller->decl)))
+ return false;
+ if (lookup_attribute ("hot", DECL_ATTRIBUTES (edge->caller->decl)))
+ return true;
+ if (flag_guess_branch_prob
+ && edge->frequency < (CGRAPH_FREQ_MAX
+ / PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION)))
+ return false;
+ return true;
+}
+
/* Return true in case BB can be CPU intensive and should be optimized
for maximal performance. */
@@ -178,6 +201,163 @@ probably_never_executed_bb_p (const_basic_block bb)
return false;
}
+/* Return true when current function should always be optimized for size. */
+
+bool
+optimize_function_for_size_p (struct function *fun)
+{
+ return (optimize_size
+ || fun->function_frequency == FUNCTION_FREQUENCY_UNLIKELY_EXECUTED);
+}
+
+/* Return true when current function should always be optimized for speed. */
+
+bool
+optimize_function_for_speed_p (struct function *fun)
+{
+ return !optimize_function_for_size_p (fun);
+}
+
+/* Return TRUE when BB should be optimized for size. */
+
+bool
+optimize_bb_for_size_p (const_basic_block bb)
+{
+ return optimize_function_for_size_p (cfun) || !maybe_hot_bb_p (bb);
+}
+
+/* Return TRUE when BB should be optimized for speed. */
+
+bool
+optimize_bb_for_speed_p (const_basic_block bb)
+{
+ return !optimize_bb_for_size_p (bb);
+}
+
+/* Return TRUE when BB should be optimized for size. */
+
+bool
+optimize_edge_for_size_p (edge e)
+{
+ return optimize_function_for_size_p (cfun) || !maybe_hot_edge_p (e);
+}
+
+/* Return TRUE when BB should be optimized for speed. */
+
+bool
+optimize_edge_for_speed_p (edge e)
+{
+ return !optimize_edge_for_size_p (e);
+}
+
+/* Return TRUE when BB should be optimized for size. */
+
+bool
+optimize_insn_for_size_p (void)
+{
+ return optimize_function_for_size_p (cfun) || !crtl->maybe_hot_insn_p;
+}
+
+/* Return TRUE when BB should be optimized for speed. */
+
+bool
+optimize_insn_for_speed_p (void)
+{
+ return !optimize_insn_for_size_p ();
+}
+
+/* Return TRUE when LOOP should be optimized for size. */
+
+bool
+optimize_loop_for_size_p (struct loop *loop)
+{
+ return optimize_bb_for_size_p (loop->header);
+}
+
+/* Return TRUE when LOOP should be optimized for speed. */
+
+bool
+optimize_loop_for_speed_p (struct loop *loop)
+{
+ return optimize_bb_for_speed_p (loop->header);
+}
+
+/* Return TRUE when LOOP nest should be optimized for speed. */
+
+bool
+optimize_loop_nest_for_speed_p (struct loop *loop)
+{
+ struct loop *l = loop;
+ if (optimize_loop_for_speed_p (loop))
+ return true;
+ l = loop->inner;
+ while (l && l != loop)
+ {
+ if (optimize_loop_for_speed_p (l))
+ return true;
+ if (l->inner)
+ l = l->inner;
+ else if (l->next)
+ l = l->next;
+ else
+ {
+ while (l != loop && !l->next)
+ l = loop_outer (l);
+ if (l != loop)
+ l = l->next;
+ }
+ }
+ return false;
+}
+
+/* Return TRUE when LOOP nest should be optimized for size. */
+
+bool
+optimize_loop_nest_for_size_p (struct loop *loop)
+{
+ return !optimize_loop_nest_for_speed_p (loop);
+}
+
+/* Return true when edge E is likely to be well predictable by branch
+ predictor. */
+
+bool
+predictable_edge_p (edge e)
+{
+ if (profile_status == PROFILE_ABSENT)
+ return false;
+ if ((e->probability
+ <= PARAM_VALUE (PARAM_PREDICTABLE_BRANCH_OUTCOME) * REG_BR_PROB_BASE / 100)
+ || (REG_BR_PROB_BASE - e->probability
+ <= PARAM_VALUE (PARAM_PREDICTABLE_BRANCH_OUTCOME) * REG_BR_PROB_BASE / 100))
+ return true;
+ return false;
+}
+
+
+/* Set RTL expansion for BB profile. */
+
+void
+rtl_profile_for_bb (basic_block bb)
+{
+ crtl->maybe_hot_insn_p = maybe_hot_bb_p (bb);
+}
+
+/* Set RTL expansion for edge profile. */
+
+void
+rtl_profile_for_edge (edge e)
+{
+ crtl->maybe_hot_insn_p = maybe_hot_edge_p (e);
+}
+
+/* Set RTL expansion to default mode (i.e. when profile info is not known). */
+void
+default_rtl_profile (void)
+{
+ crtl->maybe_hot_insn_p = true;
+}
+
/* Return true if the one of outgoing edges is already predicted by
PREDICTOR. */
@@ -203,7 +383,7 @@ static struct pointer_map_t *bb_predictions;
PREDICTOR. */
bool
-tree_predicted_by_p (const_basic_block bb, enum br_predictor predictor)
+gimple_predicted_by_p (const_basic_block bb, enum br_predictor predictor)
{
struct edge_prediction *i;
void **preds = pointer_map_contains (bb_predictions, bb);
@@ -305,7 +485,7 @@ rtl_predict_edge (edge e, enum br_predictor predictor, int probability)
/* Predict edge E with the given PROBABILITY. */
void
-tree_predict_edge (edge e, enum br_predictor predictor, int probability)
+gimple_predict_edge (edge e, enum br_predictor predictor, int probability)
{
gcc_assert (profile_status != PROFILE_GUESSED);
if ((e->src != ENTRY_BLOCK_PTR && EDGE_COUNT (e->src->succs) > 1)
@@ -947,36 +1127,38 @@ guess_outgoing_edge_probabilities (basic_block bb)
combine_predictions_for_insn (BB_END (bb), bb);
}
-/* Return constant EXPR will likely have at execution time, NULL if unknown.
- The function is used by builtin_expect branch predictor so the evidence
- must come from this construct and additional possible constant folding.
-
- We may want to implement more involved value guess (such as value range
- propagation based prediction), but such tricks shall go to new
- implementation. */
+static tree expr_expected_value (tree, bitmap);
+
+/* Helper function for expr_expected_value. */
static tree
-expr_expected_value (tree expr, bitmap visited)
+expr_expected_value_1 (tree type, tree op0, enum tree_code code, tree op1, bitmap visited)
{
- if (TREE_CONSTANT (expr))
- return expr;
- else if (TREE_CODE (expr) == SSA_NAME)
+ gimple def;
+
+ if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS)
{
- tree def = SSA_NAME_DEF_STMT (expr);
+ if (TREE_CONSTANT (op0))
+ return op0;
+
+ if (code != SSA_NAME)
+ return NULL_TREE;
+
+ def = SSA_NAME_DEF_STMT (op0);
/* If we were already here, break the infinite cycle. */
- if (bitmap_bit_p (visited, SSA_NAME_VERSION (expr)))
+ if (bitmap_bit_p (visited, SSA_NAME_VERSION (op0)))
return NULL;
- bitmap_set_bit (visited, SSA_NAME_VERSION (expr));
+ bitmap_set_bit (visited, SSA_NAME_VERSION (op0));
- if (TREE_CODE (def) == PHI_NODE)
+ if (gimple_code (def) == GIMPLE_PHI)
{
/* All the arguments of the PHI node must have the same constant
length. */
- int i;
+ int i, n = gimple_phi_num_args (def);
tree val = NULL, new_val;
- for (i = 0; i < PHI_NUM_ARGS (def); i++)
+ for (i = 0; i < n; i++)
{
tree arg = PHI_ARG_DEF (def, i);
@@ -999,111 +1181,157 @@ expr_expected_value (tree expr, bitmap visited)
}
return val;
}
- if (TREE_CODE (def) != GIMPLE_MODIFY_STMT
- || GIMPLE_STMT_OPERAND (def, 0) != expr)
- return NULL;
- return expr_expected_value (GIMPLE_STMT_OPERAND (def, 1), visited);
- }
- else if (TREE_CODE (expr) == CALL_EXPR)
- {
- tree decl = get_callee_fndecl (expr);
- if (!decl)
- return NULL;
- if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
- && DECL_FUNCTION_CODE (decl) == BUILT_IN_EXPECT)
+ if (is_gimple_assign (def))
{
- tree val;
+ if (gimple_assign_lhs (def) != op0)
+ return NULL;
+
+ return expr_expected_value_1 (TREE_TYPE (gimple_assign_lhs (def)),
+ gimple_assign_rhs1 (def),
+ gimple_assign_rhs_code (def),
+ gimple_assign_rhs2 (def),
+ visited);
+ }
- if (call_expr_nargs (expr) != 2)
+ if (is_gimple_call (def))
+ {
+ tree decl = gimple_call_fndecl (def);
+ if (!decl)
return NULL;
- val = CALL_EXPR_ARG (expr, 0);
- if (TREE_CONSTANT (val))
- return val;
- return CALL_EXPR_ARG (expr, 1);
+ if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
+ && DECL_FUNCTION_CODE (decl) == BUILT_IN_EXPECT)
+ {
+ tree val;
+
+ if (gimple_call_num_args (def) != 2)
+ return NULL;
+ val = gimple_call_arg (def, 0);
+ if (TREE_CONSTANT (val))
+ return val;
+ return gimple_call_arg (def, 1);
+ }
}
+
+ return NULL;
}
- if (BINARY_CLASS_P (expr) || COMPARISON_CLASS_P (expr))
+
+ if (get_gimple_rhs_class (code) == GIMPLE_BINARY_RHS)
{
- tree op0, op1, res;
- op0 = expr_expected_value (TREE_OPERAND (expr, 0), visited);
+ tree res;
+ op0 = expr_expected_value (op0, visited);
if (!op0)
return NULL;
- op1 = expr_expected_value (TREE_OPERAND (expr, 1), visited);
+ op1 = expr_expected_value (op1, visited);
if (!op1)
return NULL;
- res = fold_build2 (TREE_CODE (expr), TREE_TYPE (expr), op0, op1);
+ res = fold_build2 (code, type, op0, op1);
if (TREE_CONSTANT (res))
return res;
return NULL;
}
- if (UNARY_CLASS_P (expr))
+ if (get_gimple_rhs_class (code) == GIMPLE_UNARY_RHS)
{
- tree op0, res;
- op0 = expr_expected_value (TREE_OPERAND (expr, 0), visited);
+ tree res;
+ op0 = expr_expected_value (op0, visited);
if (!op0)
return NULL;
- res = fold_build1 (TREE_CODE (expr), TREE_TYPE (expr), op0);
+ res = fold_build1 (code, type, op0);
if (TREE_CONSTANT (res))
return res;
return NULL;
}
return NULL;
}
+
+/* Return constant EXPR will likely have at execution time, NULL if unknown.
+ The function is used by builtin_expect branch predictor so the evidence
+ must come from this construct and additional possible constant folding.
+
+ We may want to implement more involved value guess (such as value range
+ propagation based prediction), but such tricks shall go to new
+ implementation. */
+
+static tree
+expr_expected_value (tree expr, bitmap visited)
+{
+ enum tree_code code;
+ tree op0, op1;
+
+ if (TREE_CONSTANT (expr))
+ return expr;
+
+ extract_ops_from_tree (expr, &code, &op0, &op1);
+ return expr_expected_value_1 (TREE_TYPE (expr),
+ op0, code, op1, visited);
+}
+
-/* Get rid of all builtin_expect calls we no longer need. */
-static void
-strip_builtin_expect (void)
+/* Get rid of all builtin_expect calls and GIMPLE_PREDICT statements
+ we no longer need. */
+static unsigned int
+strip_predict_hints (void)
{
basic_block bb;
+ gimple ass_stmt;
+ tree var;
+
FOR_EACH_BB (bb)
{
- block_stmt_iterator bi;
- for (bi = bsi_start (bb); !bsi_end_p (bi); bsi_next (&bi))
+ gimple_stmt_iterator bi;
+ for (bi = gsi_start_bb (bb); !gsi_end_p (bi);)
{
- tree stmt = bsi_stmt (bi);
- tree fndecl;
- tree call;
-
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && (call = GIMPLE_STMT_OPERAND (stmt, 1))
- && TREE_CODE (call) == CALL_EXPR
- && (fndecl = get_callee_fndecl (call))
- && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
- && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_EXPECT
- && call_expr_nargs (call) == 2)
+ gimple stmt = gsi_stmt (bi);
+
+ if (gimple_code (stmt) == GIMPLE_PREDICT)
{
- GIMPLE_STMT_OPERAND (stmt, 1) = CALL_EXPR_ARG (call, 0);
- update_stmt (stmt);
+ gsi_remove (&bi, true);
+ continue;
+ }
+ else if (gimple_code (stmt) == GIMPLE_CALL)
+ {
+ tree fndecl = gimple_call_fndecl (stmt);
+
+ if (fndecl
+ && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
+ && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_EXPECT
+ && gimple_call_num_args (stmt) == 2)
+ {
+ var = gimple_call_lhs (stmt);
+ ass_stmt = gimple_build_assign (var, gimple_call_arg (stmt, 0));
+
+ gsi_replace (&bi, ass_stmt, true);
+ }
}
+ gsi_next (&bi);
}
}
+ return 0;
}
/* Predict using opcode of the last statement in basic block. */
static void
tree_predict_by_opcode (basic_block bb)
{
- tree stmt = last_stmt (bb);
+ gimple stmt = last_stmt (bb);
edge then_edge;
- tree cond;
- tree op0;
+ tree op0, op1;
tree type;
tree val;
+ enum tree_code cmp;
bitmap visited;
edge_iterator ei;
- if (!stmt || TREE_CODE (stmt) != COND_EXPR)
+ if (!stmt || gimple_code (stmt) != GIMPLE_COND)
return;
FOR_EACH_EDGE (then_edge, ei, bb->succs)
if (then_edge->flags & EDGE_TRUE_VALUE)
break;
- cond = TREE_OPERAND (stmt, 0);
- if (!COMPARISON_CLASS_P (cond))
- return;
- op0 = TREE_OPERAND (cond, 0);
+ op0 = gimple_cond_lhs (stmt);
+ op1 = gimple_cond_rhs (stmt);
+ cmp = gimple_cond_code (stmt);
type = TREE_TYPE (op0);
visited = BITMAP_ALLOC (NULL);
- val = expr_expected_value (cond, visited);
+ val = expr_expected_value_1 (boolean_type_node, op0, cmp, op1, visited);
BITMAP_FREE (visited);
if (val)
{
@@ -1118,9 +1346,9 @@ tree_predict_by_opcode (basic_block bb)
Similarly, a comparison ptr1 == ptr2 is predicted as false. */
if (POINTER_TYPE_P (type))
{
- if (TREE_CODE (cond) == EQ_EXPR)
+ if (cmp == EQ_EXPR)
predict_edge_def (then_edge, PRED_TREE_POINTER, NOT_TAKEN);
- else if (TREE_CODE (cond) == NE_EXPR)
+ else if (cmp == NE_EXPR)
predict_edge_def (then_edge, PRED_TREE_POINTER, TAKEN);
}
else
@@ -1129,7 +1357,7 @@ tree_predict_by_opcode (basic_block bb)
EQ tests are usually false and NE tests are usually true. Also,
most quantities are positive, so we can make the appropriate guesses
about signed comparisons against zero. */
- switch (TREE_CODE (cond))
+ switch (cmp)
{
case EQ_EXPR:
case UNEQ_EXPR:
@@ -1140,8 +1368,7 @@ tree_predict_by_opcode (basic_block bb)
;
/* Comparisons with 0 are often used for booleans and there is
nothing useful to predict about them. */
- else if (integer_zerop (op0)
- || integer_zerop (TREE_OPERAND (cond, 1)))
+ else if (integer_zerop (op0) || integer_zerop (op1))
;
else
predict_edge_def (then_edge, PRED_TREE_OPCODE_NONEQUAL, NOT_TAKEN);
@@ -1157,7 +1384,7 @@ tree_predict_by_opcode (basic_block bb)
/* Comparisons with 0 are often used for booleans and there is
nothing useful to predict about them. */
else if (integer_zerop (op0)
- || integer_zerop (TREE_OPERAND (cond, 1)))
+ || integer_zerop (op1))
;
else
predict_edge_def (then_edge, PRED_TREE_OPCODE_NONEQUAL, TAKEN);
@@ -1173,23 +1400,23 @@ tree_predict_by_opcode (basic_block bb)
case LE_EXPR:
case LT_EXPR:
- if (integer_zerop (TREE_OPERAND (cond, 1))
- || integer_onep (TREE_OPERAND (cond, 1))
- || integer_all_onesp (TREE_OPERAND (cond, 1))
- || real_zerop (TREE_OPERAND (cond, 1))
- || real_onep (TREE_OPERAND (cond, 1))
- || real_minus_onep (TREE_OPERAND (cond, 1)))
+ if (integer_zerop (op1)
+ || integer_onep (op1)
+ || integer_all_onesp (op1)
+ || real_zerop (op1)
+ || real_onep (op1)
+ || real_minus_onep (op1))
predict_edge_def (then_edge, PRED_TREE_OPCODE_POSITIVE, NOT_TAKEN);
break;
case GE_EXPR:
case GT_EXPR:
- if (integer_zerop (TREE_OPERAND (cond, 1))
- || integer_onep (TREE_OPERAND (cond, 1))
- || integer_all_onesp (TREE_OPERAND (cond, 1))
- || real_zerop (TREE_OPERAND (cond, 1))
- || real_onep (TREE_OPERAND (cond, 1))
- || real_minus_onep (TREE_OPERAND (cond, 1)))
+ if (integer_zerop (op1)
+ || integer_onep (op1)
+ || integer_all_onesp (op1)
+ || real_zerop (op1)
+ || real_onep (op1)
+ || real_minus_onep (op1))
predict_edge_def (then_edge, PRED_TREE_OPCODE_POSITIVE, TAKEN);
break;
@@ -1199,6 +1426,7 @@ tree_predict_by_opcode (basic_block bb)
}
/* Try to guess whether the value of return means error code. */
+
static enum br_predictor
return_prediction (tree val, enum prediction *prediction)
{
@@ -1243,10 +1471,10 @@ return_prediction (tree val, enum prediction *prediction)
static void
apply_return_prediction (void)
{
- tree return_stmt = NULL;
+ gimple return_stmt = NULL;
tree return_val;
edge e;
- tree phi;
+ gimple phi;
int phi_num_args, i;
enum br_predictor pred;
enum prediction direction;
@@ -1256,26 +1484,20 @@ apply_return_prediction (void)
{
return_stmt = last_stmt (e->src);
if (return_stmt
- && TREE_CODE (return_stmt) == RETURN_EXPR)
+ && gimple_code (return_stmt) == GIMPLE_RETURN)
break;
}
if (!e)
return;
- return_val = TREE_OPERAND (return_stmt, 0);
+ return_val = gimple_return_retval (return_stmt);
if (!return_val)
return;
- if (TREE_CODE (return_val) == GIMPLE_MODIFY_STMT)
- return_val = GIMPLE_STMT_OPERAND (return_val, 1);
if (TREE_CODE (return_val) != SSA_NAME
|| !SSA_NAME_DEF_STMT (return_val)
- || TREE_CODE (SSA_NAME_DEF_STMT (return_val)) != PHI_NODE)
- return;
- for (phi = SSA_NAME_DEF_STMT (return_val); phi; phi = PHI_CHAIN (phi))
- if (PHI_RESULT (phi) == return_val)
- break;
- if (!phi)
+ || gimple_code (SSA_NAME_DEF_STMT (return_val)) != GIMPLE_PHI)
return;
- phi_num_args = PHI_NUM_ARGS (phi);
+ phi = SSA_NAME_DEF_STMT (return_val);
+ phi_num_args = gimple_phi_num_args (phi);
pred = return_prediction (PHI_ARG_DEF (phi, 0), &direction);
/* Avoid the degenerate case where all return values form the function
@@ -1289,7 +1511,7 @@ apply_return_prediction (void)
{
pred = return_prediction (PHI_ARG_DEF (phi, i), &direction);
if (pred != PRED_NO_PREDICTION)
- predict_paths_leading_to (PHI_ARG_EDGE (phi, i)->src, pred,
+ predict_paths_leading_to (gimple_phi_arg_edge (phi, i)->src, pred,
direction);
}
}
@@ -1307,46 +1529,32 @@ tree_bb_level_predictions (void)
FOR_EACH_BB (bb)
{
- block_stmt_iterator bsi = bsi_last (bb);
+ gimple_stmt_iterator gsi;
- for (bsi = bsi_start (bb); !bsi_end_p (bsi);)
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
tree decl;
- bool next = false;
- switch (TREE_CODE (stmt))
+ if (is_gimple_call (stmt))
{
- case GIMPLE_MODIFY_STMT:
- if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == CALL_EXPR)
- {
- stmt = GIMPLE_STMT_OPERAND (stmt, 1);
- goto call_expr;
- }
- break;
- case CALL_EXPR:
-call_expr:;
- if (call_expr_flags (stmt) & ECF_NORETURN)
- predict_paths_leading_to (bb, PRED_NORETURN,
- NOT_TAKEN);
- decl = get_callee_fndecl (stmt);
- if (decl
- && lookup_attribute ("cold",
- DECL_ATTRIBUTES (decl)))
- predict_paths_leading_to (bb, PRED_COLD_FUNCTION,
- NOT_TAKEN);
- break;
- case PREDICT_EXPR:
- predict_paths_leading_to (bb, PREDICT_EXPR_PREDICTOR (stmt),
- PREDICT_EXPR_OUTCOME (stmt));
- bsi_remove (&bsi, true);
- next = true;
- break;
- default:
- break;
+ if (gimple_call_flags (stmt) & ECF_NORETURN)
+ predict_paths_leading_to (bb, PRED_NORETURN,
+ NOT_TAKEN);
+ decl = gimple_call_fndecl (stmt);
+ if (decl
+ && lookup_attribute ("cold",
+ DECL_ATTRIBUTES (decl)))
+ predict_paths_leading_to (bb, PRED_COLD_FUNCTION,
+ NOT_TAKEN);
+ }
+ else if (gimple_code (stmt) == GIMPLE_PREDICT)
+ {
+ predict_paths_leading_to (bb, gimple_predict_predictor (stmt),
+ gimple_predict_outcome (stmt));
+ /* Keep GIMPLE_PREDICT around so early inlining will propagate
+ hints to callers. */
}
- if (!next)
- bsi_next (&bsi);
}
}
}
@@ -1416,7 +1624,7 @@ tree_estimate_probability (void)
&& e->dest != EXIT_BLOCK_PTR
&& single_succ_p (e->dest)
&& single_succ_edge (e->dest)->dest == EXIT_BLOCK_PTR
- && TREE_CODE (last_stmt (e->dest)) == RETURN_EXPR)
+ && gimple_code (last_stmt (e->dest)) == GIMPLE_RETURN)
{
edge e1;
edge_iterator ei1;
@@ -1442,23 +1650,20 @@ tree_estimate_probability (void)
&& dominated_by_p (CDI_DOMINATORS, e->dest, e->src)
&& !dominated_by_p (CDI_POST_DOMINATORS, e->src, e->dest))
{
- block_stmt_iterator bi;
+ gimple_stmt_iterator bi;
/* The call heuristic claims that a guarded function call
is improbable. This is because such calls are often used
to signal exceptional situations such as printing error
messages. */
- for (bi = bsi_start (e->dest); !bsi_end_p (bi);
- bsi_next (&bi))
+ for (bi = gsi_start_bb (e->dest); !gsi_end_p (bi);
+ gsi_next (&bi))
{
- tree stmt = bsi_stmt (bi);
- if ((TREE_CODE (stmt) == CALL_EXPR
- || (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1))
- == CALL_EXPR))
+ gimple stmt = gsi_stmt (bi);
+ if (is_gimple_call (stmt)
/* Constant and pure calls are hardly used to signalize
something exceptional. */
- && TREE_SIDE_EFFECTS (stmt))
+ && gimple_has_side_effects (stmt))
{
predict_edge_def (e, PRED_CALL, NOT_TAKEN);
break;
@@ -1477,13 +1682,12 @@ tree_estimate_probability (void)
pointer_map_destroy (bb_predictions);
bb_predictions = NULL;
- strip_builtin_expect ();
estimate_bb_frequencies ();
free_dominance_info (CDI_POST_DOMINATORS);
remove_fake_exit_edges ();
loop_optimizer_finalize ();
if (dump_file && (dump_flags & TDF_DETAILS))
- dump_tree_cfg (dump_file, dump_flags);
+ gimple_dump_cfg (dump_file, dump_flags);
if (profile_status == PROFILE_ABSENT)
profile_status = PROFILE_GUESSED;
return 0;
@@ -1974,3 +2178,22 @@ struct gimple_opt_pass pass_profile =
TODO_ggc_collect | TODO_verify_ssa /* todo_flags_finish */
}
};
+
+struct gimple_opt_pass pass_strip_predict_hints =
+{
+ {
+ GIMPLE_PASS,
+ "", /* name */
+ NULL, /* gate */
+ strip_predict_hints, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_BRANCH_PROB, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_ggc_collect | TODO_verify_ssa /* todo_flags_finish */
+ }
+};
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 09ca2849a7e..16ba3929fab 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "ggc.h"
#include "langhooks.h"
#include "tree-iterator.h"
+#include "diagnostic.h"
#include "tree-flow.h"
/* Define the hash table of nodes already seen.
@@ -73,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. */
@@ -87,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)));
@@ -98,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))
{
@@ -187,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;
@@ -197,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
@@ -209,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;
@@ -250,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)));
@@ -261,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))
{
@@ -281,7 +282,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
if (indent <= 4)
print_node_brief (file, "type", TREE_TYPE (node), indent + 4);
}
- else if (!GIMPLE_TUPLE_P (node))
+ else
{
print_node (file, "type", TREE_TYPE (node), indent + 4);
if (TREE_TYPE (node))
@@ -375,8 +376,8 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
if (TREE_CODE (node) == FUNCTION_DECL
&& DECL_FUNCTION_SPECIFIC_OPTIMIZATION (node))
fputs (" function-specific-opt", file);
- if (TREE_CODE (node) == FUNCTION_DECL && DECL_INLINE (node))
- fputs (DECL_DECLARED_INLINE_P (node) ? " inline" : " autoinline", file);
+ if (TREE_CODE (node) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (node))
+ fputs (" autoinline", file);
if (TREE_CODE (node) == FUNCTION_DECL && DECL_BUILT_IN (node))
fputs (" built-in", file);
if (TREE_CODE (node) == FUNCTION_DECL && DECL_NO_STATIC_CHAIN (node))
@@ -460,8 +461,7 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
print_node (file, "size", DECL_SIZE (node), indent + 4);
print_node (file, "unit size", DECL_SIZE_UNIT (node), indent + 4);
- if (TREE_CODE (node) != FUNCTION_DECL
- || DECL_INLINE (node) || DECL_BUILT_IN (node))
+ if (TREE_CODE (node) != FUNCTION_DECL || DECL_BUILT_IN (node))
indent_to (file, indent + 3);
if (DECL_USER_ALIGN (node))
@@ -712,18 +712,6 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
print_node (file, "chain", TREE_CHAIN (node), indent + 4);
break;
- case tcc_gimple_stmt:
- len = TREE_CODE_LENGTH (TREE_CODE (node));
-
- for (i = 0; i < len; i++)
- {
- char temp[10];
-
- sprintf (temp, "arg %d", i);
- print_node (file, temp, GIMPLE_STMT_OPERAND (node, i), indent + 4);
- }
- break;
-
case tcc_constant:
case tcc_exceptional:
switch (TREE_CODE (node))
@@ -896,8 +884,8 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
case SSA_NAME:
print_node_brief (file, "var", SSA_NAME_VAR (node), indent + 4);
- print_node_brief (file, "def_stmt",
- SSA_NAME_DEF_STMT (node), indent + 4);
+ fprintf (file, "def_stmt ");
+ print_gimple_stmt (file, SSA_NAME_DEF_STMT (node), indent + 4, 0);
indent_to (file, indent + 4);
fprintf (file, "version %u", SSA_NAME_VERSION (node));
@@ -917,12 +905,6 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
}
break;
- case PHI_NODE:
- print_node (file, "result", PHI_RESULT (node), indent + 4);
- for (i = 0; i < PHI_NUM_ARGS (node); i++)
- print_node (file, "arg", PHI_ARG_DEF (node, i), indent + 4);
- break;
-
case OMP_CLAUSE:
{
int i;
diff --git a/gcc/profile.c b/gcc/profile.c
index 78568228e1f..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,9 +82,9 @@ 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)
+
/* Counter summary from the last set of coverage counts read. */
const struct gcov_ctr_summary *profile_info;
@@ -123,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.
@@ -277,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. */
@@ -372,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);
@@ -501,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. */
@@ -671,7 +762,7 @@ compute_value_histograms (histogram_values values)
for (i = 0; i < VEC_length (histogram_value, values); i++)
{
histogram_value hist = VEC_index (histogram_value, values, i);
- tree stmt = hist->hvalue.stmt;
+ gimple stmt = hist->hvalue.stmt;
t = (int) hist->type;
@@ -793,16 +884,16 @@ branch_prob (void)
FOR_EACH_EDGE (e, ei, bb->succs)
{
- block_stmt_iterator bsi;
- tree last = NULL;
+ gimple_stmt_iterator gsi;
+ gimple last = NULL;
/* It may happen that there are compiler generated statements
without a locus at all. Go through the basic block from the
last to the first statement looking for a locus. */
- for (bsi = bsi_last (bb); !bsi_end_p (bsi); bsi_prev (&bsi))
+ for (gsi = gsi_last_bb (bb); !gsi_end_p (gsi); gsi_prev (&gsi))
{
- last = bsi_stmt (bsi);
- if (EXPR_LOCUS (last))
+ last = gsi_stmt (gsi);
+ if (gimple_has_location (last))
break;
}
@@ -811,16 +902,17 @@ branch_prob (void)
Don't do that when the locuses match, so
if (blah) goto something;
is not computed twice. */
- if (last && EXPR_LOCUS (last)
- && e->goto_locus
+ if (last
+ && gimple_has_location (last)
+ && e->goto_locus != UNKNOWN_LOCATION
&& !single_succ_p (bb)
&& (LOCATION_FILE (e->goto_locus)
- != LOCATION_FILE (EXPR_LOCATION (last))
+ != LOCATION_FILE (gimple_location (last))
|| (LOCATION_LINE (e->goto_locus)
- != LOCATION_LINE (EXPR_LOCATION (last)))))
+ != 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)
@@ -982,7 +1074,7 @@ branch_prob (void)
FOR_EACH_BB (bb)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
offset = 0;
@@ -994,26 +1086,18 @@ branch_prob (void)
&offset, 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))
{
- tree stmt = bsi_stmt (bsi);
- if (EXPR_HAS_LOCATION (stmt))
- output_location (EXPR_FILENAME (stmt), EXPR_LINENO (stmt),
- &offset, bb);
- /* Take into account modify statements nested in return
- produced by C++ NRV transformation. */
- if (TREE_CODE (stmt) == RETURN_EXPR
- && TREE_OPERAND (stmt, 0)
- && TREE_CODE (TREE_OPERAND (stmt, 0)) == MODIFY_EXPR
- && EXPR_HAS_LOCATION (TREE_OPERAND (stmt, 0)))
- output_location (EXPR_FILENAME (TREE_OPERAND (stmt, 0)),
- EXPR_LINENO (TREE_OPERAND (stmt, 0)),
+ gimple stmt = gsi_stmt (gsi);
+ if (gimple_has_location (stmt))
+ output_location (gimple_filename (stmt), gimple_lineno (stmt),
&offset, bb);
}
/* Notice GOTO expressions we eliminated while constructing the
CFG. */
- if (single_succ_p (bb) && single_succ_edge (bb)->goto_locus)
+ if (single_succ_p (bb)
+ && single_succ_edge (bb)->goto_locus != UNKNOWN_LOCATION)
{
location_t curr_location = single_succ_edge (bb)->goto_locus;
/* ??? The FILE/LINE API is inconsistent for these cases. */
@@ -1063,7 +1147,7 @@ branch_prob (void)
instrument_values (values);
/* Commit changes done by instrumentation. */
- bsi_commit_edge_inserts ();
+ gsi_commit_edge_inserts ();
}
free_aux_for_edges ();
@@ -1251,4 +1335,3 @@ tree_register_profile_hooks (void)
gcc_assert (current_ir_type () == IR_GIMPLE);
profile_hooks = &tree_profile_hooks;
}
-
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 cd47155ad4e..8da4e205f7d 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -2630,10 +2630,29 @@ split_insn (rtx insn)
/* Split insns here to get max fine-grain parallelism. */
rtx first = PREV_INSN (insn);
rtx last = try_split (PATTERN (insn), insn, 1);
+ rtx insn_set, last_set, note;
if (last == insn)
return NULL_RTX;
+ /* If the original instruction was a single set that was known to be
+ equivalent to a constant, see if we can say the same about the last
+ instruction in the split sequence. The two instructions must set
+ the same destination. */
+ insn_set = single_set (insn);
+ if (insn_set)
+ {
+ last_set = single_set (last);
+ if (last_set && rtx_equal_p (SET_DEST (last_set), SET_DEST (insn_set)))
+ {
+ note = find_reg_equal_equiv_note (insn);
+ if (note && CONSTANT_P (XEXP (note, 0)))
+ set_unique_reg_note (last, REG_EQUAL, XEXP (note, 0));
+ else if (CONSTANT_P (SET_SRC (insn_set)))
+ set_unique_reg_note (last, REG_EQUAL, SET_SRC (insn_set));
+ }
+ }
+
/* try_split returns the NOTE that INSN became. */
SET_INSN_DELETED (insn);
@@ -2651,6 +2670,7 @@ split_insn (rtx insn)
first = NEXT_INSN (first);
}
}
+
return last;
}
@@ -2672,6 +2692,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 +2735,7 @@ split_all_insns (void)
}
}
+ default_rtl_profile ();
if (changed)
find_many_sub_basic_blocks (blocks);
@@ -2966,6 +2988,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;
@@ -3182,6 +3205,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/regclass.c b/gcc/regclass.c
index 386214dbe0d..b12d4168506 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -178,7 +178,7 @@ static enum reg_class reg_class_superclasses[N_REG_CLASSES][N_REG_CLASSES];
/* For each reg class, table listing all the classes contained in it. */
-static enum reg_class reg_class_subclasses[N_REG_CLASSES][N_REG_CLASSES];
+enum reg_class reg_class_subclasses[N_REG_CLASSES][N_REG_CLASSES];
/* For each pair of reg classes,
a largest reg class contained in their union. */
@@ -211,24 +211,22 @@ bool have_regs_of_mode [MAX_MACHINE_MODE];
/* 1 if class does contain register of given mode. */
-static char contains_reg_of_mode [N_REG_CLASSES] [MAX_MACHINE_MODE];
-
-typedef unsigned short move_table[N_REG_CLASSES];
+char contains_reg_of_mode [N_REG_CLASSES] [MAX_MACHINE_MODE];
/* Maximum cost of moving from a register in one class to a register in
another class. Based on REGISTER_MOVE_COST. */
-static move_table *move_cost[MAX_MACHINE_MODE];
+move_table *move_cost[MAX_MACHINE_MODE];
/* Similar, but here we don't have to move if the first index is a subset
of the second so in that case the cost is zero. */
-static move_table *may_move_in_cost[MAX_MACHINE_MODE];
+move_table *may_move_in_cost[MAX_MACHINE_MODE];
/* Similar, but here we don't have to move if the first index is a superset
of the second so in that case the cost is zero. */
-static move_table *may_move_out_cost[MAX_MACHINE_MODE];
+move_table *may_move_out_cost[MAX_MACHINE_MODE];
/* Keep track of the last mode we initialized move costs for. */
static int last_mode_for_init_move_cost;
@@ -313,7 +311,7 @@ init_reg_sets (void)
/* Initialize may_move_cost and friends for mode M. */
-static void
+void
init_move_cost (enum machine_mode m)
{
static unsigned short last_move_cost[N_REG_CLASSES][N_REG_CLASSES];
@@ -1024,6 +1022,7 @@ reg_preferred_class (int regno)
{
if (reg_pref == 0)
return GENERAL_REGS;
+
return (enum reg_class) reg_pref[regno].prefclass;
}
@@ -2283,6 +2282,32 @@ auto_inc_dec_reg_p (rtx reg, enum machine_mode mode)
}
#endif
+
+/* Allocate space for reg info. */
+void
+allocate_reg_info (void)
+{
+ int size = max_reg_num ();
+
+ gcc_assert (! reg_pref && ! reg_renumber);
+ reg_renumber = XNEWVEC (short, size);
+ reg_pref = XCNEWVEC (struct reg_pref, size);
+ memset (reg_renumber, -1, size * sizeof (short));
+}
+
+
+/* Resize reg info. The new elements will be uninitialized. */
+void
+resize_reg_info (void)
+{
+ int size = max_reg_num ();
+
+ gcc_assert (reg_pref && reg_renumber);
+ reg_renumber = XRESIZEVEC (short, reg_renumber, size);
+ reg_pref = XRESIZEVEC (struct reg_pref, reg_pref, size);
+}
+
+
/* Free up the space allocated by allocate_reg_info. */
void
free_reg_info (void)
@@ -2300,6 +2325,21 @@ free_reg_info (void)
}
}
+
+
+
+/* Set up preferred and alternate classes for REGNO as PREFCLASS and
+ ALTCLASS. */
+void
+setup_reg_classes (int regno,
+ enum reg_class prefclass, enum reg_class altclass)
+{
+ if (reg_pref == NULL)
+ return;
+ reg_pref[regno].prefclass = prefclass;
+ reg_pref[regno].altclass = altclass;
+}
+
/* This is the `regscan' pass of the compiler, run just before cse and
again just before loop. It finds the first and last use of each
diff --git a/gcc/regmove.c b/gcc/regmove.c
index 7de8d0d5b98..e25dbec7fe9 100644
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -1117,7 +1117,8 @@ regmove_optimize (rtx f, int nregs)
for (pass = 0; pass <= 2; pass++)
{
- if (! flag_regmove && pass >= flag_expensive_optimizations)
+ /* We need fewer optimizations for IRA. */
+ if ((! flag_regmove || flag_ira) && pass >= flag_expensive_optimizations)
goto done;
if (dump_file)
@@ -1165,7 +1166,9 @@ regmove_optimize (rtx f, int nregs)
}
}
}
- if (! flag_regmove)
+
+ /* All optimizations important for IRA have been done. */
+ if (! flag_regmove || flag_ira)
continue;
if (! find_matches (insn, &match))
diff --git a/gcc/regs.h b/gcc/regs.h
index 20587ac27b2..00be997695f 100644
--- a/gcc/regs.h
+++ b/gcc/regs.h
@@ -262,9 +262,27 @@ extern int caller_save_needed;
#define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE) 0
#endif
+/* 1 if the corresponding class does contain register of given
+ mode. */
+extern char contains_reg_of_mode [N_REG_CLASSES] [MAX_MACHINE_MODE];
+
+typedef unsigned short move_table[N_REG_CLASSES];
+
+/* Maximum cost of moving from a register in one class to a register
+ in another class. */
+extern move_table *move_cost[MAX_MACHINE_MODE];
+
/* Specify number of hard registers given machine mode occupy. */
extern unsigned char hard_regno_nregs[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
+/* Similar, but here we don't have to move if the first index is a
+ subset of the second so in that case the cost is zero. */
+extern move_table *may_move_in_cost[MAX_MACHINE_MODE];
+
+/* Similar, but here we don't have to move if the first index is a
+ superset of the second so in that case the cost is zero. */
+extern move_table *may_move_out_cost[MAX_MACHINE_MODE];
+
/* Return an exclusive upper bound on the registers occupied by hard
register (reg:MODE REGNO). */
diff --git a/gcc/reload.c b/gcc/reload.c
index a6ea4ff4e5a..e353c50acdb 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;
@@ -1526,8 +1549,10 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc,
&& reg_mentioned_p (XEXP (note, 0), in)
/* Check that a former pseudo is valid; see find_dummy_reload. */
&& (ORIGINAL_REGNO (XEXP (note, 0)) < FIRST_PSEUDO_REGISTER
- || (!bitmap_bit_p (DF_LIVE_OUT (ENTRY_BLOCK_PTR),
- ORIGINAL_REGNO (XEXP (note, 0)))
+ || (! bitmap_bit_p (flag_ira
+ ? DF_LR_OUT (ENTRY_BLOCK_PTR)
+ : DF_LIVE_OUT (ENTRY_BLOCK_PTR),
+ ORIGINAL_REGNO (XEXP (note, 0)))
&& hard_regno_nregs[regno][GET_MODE (XEXP (note, 0))] == 1))
&& ! refers_to_regno_for_reload_p (regno,
end_hard_regno (rel_mode,
@@ -2004,7 +2029,9 @@ find_dummy_reload (rtx real_in, rtx real_out, rtx *inloc, rtx *outloc,
can ignore the conflict). We must never introduce writes
to such hardregs, as they would clobber the other live
pseudo. See PR 20973. */
- || (!bitmap_bit_p (DF_LIVE_OUT (ENTRY_BLOCK_PTR),
+ || (!bitmap_bit_p (flag_ira
+ ? DF_LR_OUT (ENTRY_BLOCK_PTR)
+ : DF_LIVE_OUT (ENTRY_BLOCK_PTR),
ORIGINAL_REGNO (in))
/* Similarly, only do this if we can be sure that the death
note is still valid. global can assign some hardreg to
@@ -2972,12 +2999,11 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
if (REG_P (SUBREG_REG (operand))
&& REGNO (SUBREG_REG (operand)) < FIRST_PSEUDO_REGISTER)
{
- if (!subreg_offset_representable_p
- (REGNO (SUBREG_REG (operand)),
- GET_MODE (SUBREG_REG (operand)),
- SUBREG_BYTE (operand),
- GET_MODE (operand)))
- force_reload = 1;
+ if (simplify_subreg_regno (REGNO (SUBREG_REG (operand)),
+ GET_MODE (SUBREG_REG (operand)),
+ SUBREG_BYTE (operand),
+ GET_MODE (operand)) < 0)
+ force_reload = 1;
offset += subreg_regno_offset (REGNO (SUBREG_REG (operand)),
GET_MODE (SUBREG_REG (operand)),
SUBREG_BYTE (operand),
@@ -3843,49 +3869,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/reload.h b/gcc/reload.h
index 3873f5c9746..17d8a3e04b2 100644
--- a/gcc/reload.h
+++ b/gcc/reload.h
@@ -1,6 +1,6 @@
-/* Communication between reload.c and reload1.c.
- Copyright (C) 1987, 1991, 1992, 1993, 1994, 1995, 1997, 1998,
- 1999, 2000, 2001, 2003, 2004, 2007 Free Software Foundation, Inc.
+/* Communication between reload.c, reload1.c and the rest of compiler.
+ Copyright (C) 1987, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 1999,
+ 2000, 2001, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
@@ -209,8 +209,9 @@ struct insn_chain
int block;
/* The rtx of the insn. */
rtx insn;
- /* Register life information: record all live hard registers, and all
- live pseudos that have a hard register. */
+ /* Register life information: record all live hard registers, and
+ all live pseudos that have a hard register. This set also
+ contains pseudos spilled by IRA. */
regset_head live_throughout;
regset_head dead_or_set;
diff --git a/gcc/reload1.c b/gcc/reload1.c
index f28b01c2714..bb0d423e91b 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -44,6 +44,7 @@ along with GCC; see the file COPYING3. If not see
#include "toplev.h"
#include "except.h"
#include "tree.h"
+#include "ira.h"
#include "df.h"
#include "target.h"
#include "dse.h"
@@ -257,6 +258,9 @@ static unsigned int spill_stack_slot_width[FIRST_PSEUDO_REGISTER];
/* Record which pseudos needed to be spilled. */
static regset_head spilled_pseudos;
+/* Record which pseudos changed their allocation in finish_spills. */
+static regset_head changed_allocation_pseudos;
+
/* Used for communication between order_regs_for_reload and count_pseudo.
Used to avoid counting one pseudo twice. */
static regset_head pseudos_counted;
@@ -389,7 +393,7 @@ static void delete_caller_save_insns (void);
static void spill_failure (rtx, enum reg_class);
static void count_spilled_pseudo (int, int, int);
static void delete_dead_insn (rtx);
-static void alter_reg (int, int);
+static void alter_reg (int, int, bool);
static void set_label_offsets (rtx, rtx, int);
static void check_eliminable_occurrences (rtx);
static void elimination_effects (rtx, enum machine_mode);
@@ -443,6 +447,8 @@ static rtx inc_for_reload (rtx, rtx, rtx, int);
static void add_auto_inc_notes (rtx, rtx);
#endif
static void copy_eh_notes (rtx, rtx);
+static void substitute (rtx *, const_rtx, rtx);
+static bool gen_reload_chain_without_interm_reg_p (int, int);
static int reloads_conflict (int, int);
static rtx gen_reload (rtx, rtx, int, enum reload_type);
static rtx emit_insn_if_valid_for_reload (rtx);
@@ -501,6 +507,7 @@ init_reload (void)
reload_startobj = XOBNEWVAR (&reload_obstack, char, 0);
INIT_REG_SET (&spilled_pseudos);
+ INIT_REG_SET (&changed_allocation_pseudos);
INIT_REG_SET (&pseudos_counted);
}
@@ -546,11 +553,11 @@ compute_use_by_pseudos (HARD_REG_SET *to, regset from)
if (r < 0)
{
- /* reload_combine uses the information from
- DF_LIVE_IN (BASIC_BLOCK), which might still
- contain registers that have not actually been allocated
- since they have an equivalence. */
- gcc_assert (reload_completed);
+ /* reload_combine uses the information from DF_LIVE_IN,
+ which might still contain registers that have not
+ actually been allocated since they have an
+ equivalence. */
+ gcc_assert ((flag_ira && optimize) || reload_completed);
}
else
add_to_hard_reg_set (to, PSEUDO_REGNO_MODE (regno), r);
@@ -684,6 +691,9 @@ static int something_needs_operands_changed;
/* Nonzero means we couldn't get enough spill regs. */
static int failure;
+/* Temporary array of pseudo-register number. */
+static int *temp_pseudo_reg_arr;
+
/* Main entry point for the reload pass.
FIRST is the first insn of the function being compiled.
@@ -700,7 +710,7 @@ static int failure;
int
reload (rtx first, int global)
{
- int i;
+ int i, n;
rtx insn;
struct elim_table *ep;
basic_block bb;
@@ -883,12 +893,21 @@ reload (rtx first, int global)
offsets_known_at = XNEWVEC (char, num_labels);
offsets_at = (HOST_WIDE_INT (*)[NUM_ELIMINABLE_REGS]) xmalloc (num_labels * NUM_ELIMINABLE_REGS * sizeof (HOST_WIDE_INT));
- /* Alter each pseudo-reg rtx to contain its hard reg number.
- Assign stack slots to the pseudos that lack hard regs or equivalents.
+ /* Alter each pseudo-reg rtx to contain its hard reg number. Assign
+ stack slots to the pseudos that lack hard regs or equivalents.
Do not touch virtual registers. */
- for (i = LAST_VIRTUAL_REGISTER + 1; i < max_regno; i++)
- alter_reg (i, -1);
+ temp_pseudo_reg_arr = XNEWVEC (int, max_regno - LAST_VIRTUAL_REGISTER - 1);
+ for (n = 0, i = LAST_VIRTUAL_REGISTER + 1; i < max_regno; i++)
+ temp_pseudo_reg_arr[n++] = i;
+
+ if (flag_ira && optimize)
+ /* Ask IRA to order pseudo-registers for better stack slot
+ sharing. */
+ ira_sort_regnos_for_alter_reg (temp_pseudo_reg_arr, n, reg_max_ref_width);
+
+ for (i = 0; i < n; i++)
+ alter_reg (temp_pseudo_reg_arr[i], -1, false);
/* If we have some registers we think can be eliminated, scan all insns to
see if there is an insn that sets one of these registers to something
@@ -1002,7 +1021,7 @@ reload (rtx first, int global)
the loop. */
reg_equiv_memory_loc[i] = 0;
reg_equiv_init[i] = 0;
- alter_reg (i, -1);
+ alter_reg (i, -1, true);
}
}
@@ -1036,7 +1055,12 @@ reload (rtx first, int global)
calculate_needs_all_insns (global);
- CLEAR_REG_SET (&spilled_pseudos);
+ if (! flag_ira || ! optimize)
+ /* Don't do it for IRA. We need this info because we don't
+ change live_throughout and dead_or_set for chains when IRA
+ is used. */
+ CLEAR_REG_SET (&spilled_pseudos);
+
did_spill = 0;
something_changed = 0;
@@ -1094,6 +1118,11 @@ reload (rtx first, int global)
obstack_free (&reload_obstack, reload_firstobj);
}
+ if (flag_ira && optimize)
+ /* Restore the original insn chain order for correct reload work
+ (e.g. for correct inheritance). */
+ ira_sort_insn_chain (false);
+
/* If global-alloc was run, notify it of any register eliminations we have
done. */
if (global)
@@ -1163,6 +1192,7 @@ reload (rtx first, int global)
regs. */
failed:
+ CLEAR_REG_SET (&changed_allocation_pseudos);
CLEAR_REG_SET (&spilled_pseudos);
reload_in_progress = 0;
@@ -1301,9 +1331,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;
@@ -1333,6 +1363,8 @@ reload (rtx first, int global)
VEC_free (rtx, gc, reg_equiv_memory_loc_vec);
reg_equiv_memory_loc = 0;
+ free (temp_pseudo_reg_arr);
+
if (offsets_known_at)
free (offsets_known_at);
if (offsets_at)
@@ -1573,10 +1605,24 @@ calculate_needs_all_insns (int global)
{
rtx set = single_set (insn);
if (set
- && SET_SRC (set) == SET_DEST (set)
- && REG_P (SET_SRC (set))
- && REGNO (SET_SRC (set)) >= FIRST_PSEUDO_REGISTER)
+ &&
+ ((SET_SRC (set) == SET_DEST (set)
+ && REG_P (SET_SRC (set))
+ && REGNO (SET_SRC (set)) >= FIRST_PSEUDO_REGISTER)
+ || (REG_P (SET_SRC (set)) && REG_P (SET_DEST (set))
+ && reg_renumber[REGNO (SET_SRC (set))] < 0
+ && reg_renumber[REGNO (SET_DEST (set))] < 0
+ && reg_equiv_memory_loc[REGNO (SET_SRC (set))] != NULL
+ && reg_equiv_memory_loc[REGNO (SET_DEST (set))] != NULL
+ && rtx_equal_p (reg_equiv_memory_loc
+ [REGNO (SET_SRC (set))],
+ reg_equiv_memory_loc
+ [REGNO (SET_DEST (set))]))))
{
+ if (flag_ira && optimize)
+ /* Inform IRA about the insn deletion. */
+ ira_mark_memory_move_deletion (REGNO (SET_DEST (set)),
+ REGNO (SET_SRC (set)));
delete_insn (insn);
/* Delete it from the reload chain. */
if (chain->prev)
@@ -1665,6 +1711,10 @@ static int spill_cost[FIRST_PSEUDO_REGISTER];
only the first hard reg for a multi-reg pseudo. */
static int spill_add_cost[FIRST_PSEUDO_REGISTER];
+/* Map of hard regno to pseudo regno currently occupying the hard
+ reg. */
+static int hard_regno_to_pseudo_regno[FIRST_PSEUDO_REGISTER];
+
/* Update the spill cost arrays, considering that pseudo REG is live. */
static void
@@ -1675,7 +1725,10 @@ count_pseudo (int reg)
int nregs;
if (REGNO_REG_SET_P (&pseudos_counted, reg)
- || REGNO_REG_SET_P (&spilled_pseudos, reg))
+ || REGNO_REG_SET_P (&spilled_pseudos, reg)
+ /* Ignore spilled pseudo-registers which can be here only if IRA
+ is used. */
+ || (flag_ira && optimize && r < 0))
return;
SET_REGNO_REG_SET (&pseudos_counted, reg);
@@ -1683,10 +1736,12 @@ count_pseudo (int reg)
gcc_assert (r >= 0);
spill_add_cost[r] += freq;
-
nregs = hard_regno_nregs[r][PSEUDO_REGNO_MODE (reg)];
while (nregs-- > 0)
- spill_cost[r + nregs] += freq;
+ {
+ hard_regno_to_pseudo_regno[r + nregs] = reg;
+ spill_cost[r + nregs] += freq;
+ }
}
/* Calculate the SPILL_COST and SPILL_ADD_COST arrays and determine the
@@ -1704,6 +1759,8 @@ order_regs_for_reload (struct insn_chain *chain)
memset (spill_cost, 0, sizeof spill_cost);
memset (spill_add_cost, 0, sizeof spill_add_cost);
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ hard_regno_to_pseudo_regno[i] = -1;
/* Count number of uses of each hard reg by pseudo regs allocated to it
and then order them by decreasing use. First exclude hard registers
@@ -1746,18 +1803,25 @@ static HARD_REG_SET used_spill_regs_local;
static void
count_spilled_pseudo (int spilled, int spilled_nregs, int reg)
{
+ int freq = REG_FREQ (reg);
int r = reg_renumber[reg];
int nregs = hard_regno_nregs[r][PSEUDO_REGNO_MODE (reg)];
- if (REGNO_REG_SET_P (&spilled_pseudos, reg)
+ /* Ignore spilled pseudo-registers which can be here only if IRA is
+ used. */
+ if ((flag_ira && optimize && r < 0)
+ || REGNO_REG_SET_P (&spilled_pseudos, reg)
|| spilled + spilled_nregs <= r || r + nregs <= spilled)
return;
SET_REGNO_REG_SET (&spilled_pseudos, reg);
- spill_add_cost[r] -= REG_FREQ (reg);
+ spill_add_cost[r] -= freq;
while (nregs-- > 0)
- spill_cost[r + nregs] -= REG_FREQ (reg);
+ {
+ hard_regno_to_pseudo_regno[r + nregs] = -1;
+ spill_cost[r + nregs] -= freq;
+ }
}
/* Find reload register to use for reload number ORDER. */
@@ -1769,11 +1833,13 @@ find_reg (struct insn_chain *chain, int order)
struct reload *rl = rld + rnum;
int best_cost = INT_MAX;
int best_reg = -1;
- unsigned int i, j;
+ unsigned int i, j, n;
int k;
HARD_REG_SET not_usable;
HARD_REG_SET used_by_other_reload;
reg_set_iterator rsi;
+ static int regno_pseudo_regs[FIRST_PSEUDO_REGISTER];
+ static int best_regno_pseudo_regs[FIRST_PSEUDO_REGISTER];
COPY_HARD_REG_SET (not_usable, bad_spill_regs);
IOR_HARD_REG_SET (not_usable, bad_spill_regs_global);
@@ -1791,7 +1857,11 @@ find_reg (struct insn_chain *chain, int order)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
{
+#ifdef REG_ALLOC_ORDER
+ unsigned int regno = reg_alloc_order[i];
+#else
unsigned int regno = i;
+#endif
if (! TEST_HARD_REG_BIT (not_usable, regno)
&& ! TEST_HARD_REG_BIT (used_by_other_reload, regno)
@@ -1810,6 +1880,38 @@ find_reg (struct insn_chain *chain, int order)
}
if (! ok)
continue;
+
+ if (flag_ira && optimize)
+ {
+ /* Ask IRA to find a better pseudo-register for
+ spilling. */
+ for (n = j = 0; j < this_nregs; j++)
+ {
+ int r = hard_regno_to_pseudo_regno[regno + j];
+
+ if (r < 0)
+ continue;
+ if (n == 0 || regno_pseudo_regs[n - 1] != r)
+ regno_pseudo_regs[n++] = r;
+ }
+ regno_pseudo_regs[n++] = -1;
+ if (best_reg < 0
+ || ira_better_spill_reload_regno_p (regno_pseudo_regs,
+ best_regno_pseudo_regs,
+ rl->in, rl->out,
+ chain->insn))
+ {
+ best_reg = regno;
+ for (j = 0;; j++)
+ {
+ best_regno_pseudo_regs[j] = regno_pseudo_regs[j];
+ if (regno_pseudo_regs[j] < 0)
+ break;
+ }
+ }
+ continue;
+ }
+
if (rl->in && REG_P (rl->in) && REGNO (rl->in) == regno)
this_cost--;
if (rl->out && REG_P (rl->out) && REGNO (rl->out) == regno)
@@ -1857,6 +1959,7 @@ find_reg (struct insn_chain *chain, int order)
{
gcc_assert (spill_cost[best_reg + i] == 0);
gcc_assert (spill_add_cost[best_reg + i] == 0);
+ gcc_assert (hard_regno_to_pseudo_regno[best_reg + i] == -1);
SET_HARD_REG_BIT (used_spill_regs_local, best_reg + i);
}
return 1;
@@ -2026,7 +2129,7 @@ delete_dead_insn (rtx insn)
can share one stack slot. */
static void
-alter_reg (int i, int from_reg)
+alter_reg (int i, int from_reg, bool dont_share_p)
{
/* When outputting an inline function, this can happen
for a reg that isn't actually used. */
@@ -2059,7 +2162,15 @@ alter_reg (int i, int from_reg)
unsigned int total_size = MAX (inherent_size, reg_max_ref_width[i]);
unsigned int min_align = reg_max_ref_width[i] * BITS_PER_UNIT;
int adjust = 0;
-
+ bool shared_p = false;
+
+ if (flag_ira && optimize)
+ /* Mark the spill for IRA. */
+ SET_REGNO_REG_SET (&spilled_pseudos, i);
+ x = (dont_share_p || ! flag_ira || ! optimize
+ ? NULL_RTX : ira_reuse_stack_slot (i, inherent_size, total_size));
+ if (x)
+ shared_p = true;
/* Each pseudo reg has an inherent size which comes from its own mode,
and a total size which provides room for paradoxical subregs
which refer to the pseudo reg in wider modes.
@@ -2068,7 +2179,7 @@ alter_reg (int i, int from_reg)
enough inherent space and enough total space.
Otherwise, we allocate a new slot, making sure that it has no less
inherent space, and no less total space, then the previous slot. */
- if (from_reg == -1)
+ else if (from_reg == -1 || (! dont_share_p && flag_ira && optimize))
{
alias_set_type alias_set = new_alias_set ();
@@ -2086,6 +2197,10 @@ alter_reg (int i, int from_reg)
/* Nothing can alias this slot except this pseudo. */
set_mem_alias_set (x, alias_set);
dse_record_singleton_alias_set (alias_set, mode);
+
+ if (! dont_share_p && flag_ira && optimize)
+ /* Inform IRA about allocation a new stack slot. */
+ ira_mark_new_stack_slot (x, i, total_size);
}
/* Reuse a stack slot if possible. */
@@ -2164,8 +2279,13 @@ alter_reg (int i, int from_reg)
/* If we have a decl for the original register, set it for the
memory. If this is a shared MEM, make a copy. */
- if (REG_EXPR (regno_reg_rtx[i])
- && DECL_P (REG_EXPR (regno_reg_rtx[i])))
+ if (shared_p)
+ {
+ x = copy_rtx (x);
+ set_mem_attrs_from_reg (x, regno_reg_rtx[i]);
+ }
+ else if (REG_EXPR (regno_reg_rtx[i])
+ && DECL_P (REG_EXPR (regno_reg_rtx[i])))
{
rtx decl = DECL_RTL_IF_SET (REG_EXPR (regno_reg_rtx[i]));
@@ -2441,7 +2561,7 @@ eliminate_regs_1 (rtx x, enum machine_mode mem_mode, rtx insn,
/* There exists at least one use of REGNO that cannot be
eliminated. Prevent the defining insn from being deleted. */
reg_equiv_init[regno] = NULL_RTX;
- alter_reg (regno, -1);
+ alter_reg (regno, -1, true);
}
return x;
@@ -3663,8 +3783,11 @@ update_eliminables (HARD_REG_SET *pset)
frame_pointer_needed = 1;
for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
{
- if (ep->can_eliminate && ep->from == FRAME_POINTER_REGNUM
- && ep->to != HARD_FRAME_POINTER_REGNUM)
+ if (ep->can_eliminate
+ && ep->from == FRAME_POINTER_REGNUM
+ && ep->to != HARD_FRAME_POINTER_REGNUM
+ && (! SUPPORTS_STACK_ALIGNMENT
+ || ! crtl->stack_realign_needed))
frame_pointer_needed = 0;
if (! ep->can_eliminate && ep->can_eliminate_previous)
@@ -3720,7 +3843,10 @@ init_elim_table (void)
ep->to = ep1->to;
ep->can_eliminate = ep->can_eliminate_previous
= (CAN_ELIMINATE (ep->from, ep->to)
- && ! (ep->to == STACK_POINTER_REGNUM && frame_pointer_needed));
+ && ! (ep->to == STACK_POINTER_REGNUM
+ && frame_pointer_needed
+ && (! SUPPORTS_STACK_ALIGNMENT
+ || ! stack_realign_fp)));
}
#else
reg_eliminate[0].from = reg_eliminate_1[0].from;
@@ -3811,18 +3937,22 @@ finish_spills (int global)
spill_reg_order[i] = -1;
EXECUTE_IF_SET_IN_REG_SET (&spilled_pseudos, FIRST_PSEUDO_REGISTER, i, rsi)
- {
- /* Record the current hard register the pseudo is allocated to in
- pseudo_previous_regs so we avoid reallocating it to the same
- hard reg in a later pass. */
- gcc_assert (reg_renumber[i] >= 0);
-
- SET_HARD_REG_BIT (pseudo_previous_regs[i], reg_renumber[i]);
- /* Mark it as no longer having a hard register home. */
- reg_renumber[i] = -1;
- /* We will need to scan everything again. */
- something_changed = 1;
- }
+ if (! flag_ira || ! optimize || reg_renumber[i] >= 0)
+ {
+ /* Record the current hard register the pseudo is allocated to
+ in pseudo_previous_regs so we avoid reallocating it to the
+ same hard reg in a later pass. */
+ gcc_assert (reg_renumber[i] >= 0);
+
+ SET_HARD_REG_BIT (pseudo_previous_regs[i], reg_renumber[i]);
+ /* Mark it as no longer having a hard register home. */
+ reg_renumber[i] = -1;
+ if (flag_ira && optimize)
+ /* Inform IRA about the change. */
+ ira_mark_allocation_change (i);
+ /* We will need to scan everything again. */
+ something_changed = 1;
+ }
/* Retry global register allocation if possible. */
if (global)
@@ -3847,24 +3977,50 @@ finish_spills (int global)
}
}
- /* Retry allocating the spilled pseudos. For each reg, merge the
- various reg sets that indicate which hard regs can't be used,
- and call retry_global_alloc.
- We change spill_pseudos here to only contain pseudos that did not
- get a new hard register. */
- for (i = FIRST_PSEUDO_REGISTER; i < (unsigned)max_regno; i++)
- if (reg_old_renumber[i] != reg_renumber[i])
- {
- HARD_REG_SET forbidden;
- COPY_HARD_REG_SET (forbidden, bad_spill_regs_global);
- IOR_HARD_REG_SET (forbidden, pseudo_forbidden_regs[i]);
- IOR_HARD_REG_SET (forbidden, pseudo_previous_regs[i]);
- retry_global_alloc (i, forbidden);
- if (reg_renumber[i] >= 0)
- CLEAR_REGNO_REG_SET (&spilled_pseudos, i);
- }
+ if (! flag_ira || ! optimize)
+ {
+ /* Retry allocating the spilled pseudos. For each reg,
+ merge the various reg sets that indicate which hard regs
+ can't be used, and call retry_global_alloc. We change
+ spill_pseudos here to only contain pseudos that did not
+ get a new hard register. */
+ for (i = FIRST_PSEUDO_REGISTER; i < (unsigned)max_regno; i++)
+ if (reg_old_renumber[i] != reg_renumber[i])
+ {
+ HARD_REG_SET forbidden;
+
+ COPY_HARD_REG_SET (forbidden, bad_spill_regs_global);
+ IOR_HARD_REG_SET (forbidden, pseudo_forbidden_regs[i]);
+ IOR_HARD_REG_SET (forbidden, pseudo_previous_regs[i]);
+ retry_global_alloc (i, forbidden);
+ if (reg_renumber[i] >= 0)
+ CLEAR_REGNO_REG_SET (&spilled_pseudos, i);
+ }
+ }
+ else
+ {
+ /* Retry allocating the pseudos spilled in IRA and the
+ reload. For each reg, merge the various reg sets that
+ indicate which hard regs can't be used, and call
+ ira_reassign_pseudos. */
+ unsigned int n;
+
+ for (n = 0, i = FIRST_PSEUDO_REGISTER; i < (unsigned) max_regno; i++)
+ if (reg_old_renumber[i] != reg_renumber[i])
+ {
+ if (reg_renumber[i] < 0)
+ temp_pseudo_reg_arr[n++] = i;
+ else
+ CLEAR_REGNO_REG_SET (&spilled_pseudos, i);
+ }
+ if (ira_reassign_pseudos (temp_pseudo_reg_arr, n,
+ bad_spill_regs_global,
+ pseudo_forbidden_regs, pseudo_previous_regs,
+ &spilled_pseudos))
+ something_changed = 1;
+
+ }
}
-
/* Fix up the register information in the insn chain.
This involves deleting those of the spilled pseudos which did not get
a new hard register home from the live_{before,after} sets. */
@@ -3873,9 +4029,14 @@ finish_spills (int global)
HARD_REG_SET used_by_pseudos;
HARD_REG_SET used_by_pseudos2;
- AND_COMPL_REG_SET (&chain->live_throughout, &spilled_pseudos);
- AND_COMPL_REG_SET (&chain->dead_or_set, &spilled_pseudos);
-
+ if (! flag_ira || ! optimize)
+ {
+ /* Don't do it for IRA because IRA and the reload still can
+ assign hard registers to the spilled pseudos on next
+ reload iterations. */
+ AND_COMPL_REG_SET (&chain->live_throughout, &spilled_pseudos);
+ AND_COMPL_REG_SET (&chain->dead_or_set, &spilled_pseudos);
+ }
/* Mark any unallocated hard regs as available for spills. That
makes inheritance work somewhat better. */
if (chain->need_reload)
@@ -3884,20 +4045,18 @@ finish_spills (int global)
REG_SET_TO_HARD_REG_SET (used_by_pseudos2, &chain->dead_or_set);
IOR_HARD_REG_SET (used_by_pseudos, used_by_pseudos2);
- /* Save the old value for the sanity test below. */
- COPY_HARD_REG_SET (used_by_pseudos2, chain->used_spill_regs);
-
compute_use_by_pseudos (&used_by_pseudos, &chain->live_throughout);
compute_use_by_pseudos (&used_by_pseudos, &chain->dead_or_set);
+ /* Value of chain->used_spill_regs from previous iteration
+ may be not included in the value calculated here because
+ of possible removing caller-saves insns (see function
+ delete_caller_save_insns. */
COMPL_HARD_REG_SET (chain->used_spill_regs, used_by_pseudos);
AND_HARD_REG_SET (chain->used_spill_regs, used_spill_regs);
-
- /* Make sure we only enlarge the set. */
- gcc_assert (hard_reg_set_subset_p (used_by_pseudos2,
- chain->used_spill_regs));
}
}
+ CLEAR_REG_SET (&changed_allocation_pseudos);
/* Let alter_reg modify the reg rtx's for the modified pseudos. */
for (i = FIRST_PSEUDO_REGISTER; i < (unsigned)max_regno; i++)
{
@@ -3905,7 +4064,9 @@ finish_spills (int global)
if (reg_old_renumber[i] == regno)
continue;
- alter_reg (i, reg_old_renumber[i]);
+ SET_REGNO_REG_SET (&changed_allocation_pseudos, i);
+
+ alter_reg (i, reg_old_renumber[i], false);
reg_old_renumber[i] = regno;
if (dump_file)
{
@@ -4289,8 +4450,8 @@ reload_as_needed (int live_known)
be partially clobbered by the call. */
else if (CALL_P (insn))
{
- AND_COMPL_HARD_REG_SET (reg_reloaded_valid, call_used_reg_set);
- AND_COMPL_HARD_REG_SET (reg_reloaded_valid, reg_reloaded_call_part_clobbered);
+ AND_COMPL_HARD_REG_SET (reg_reloaded_valid, call_used_reg_set);
+ AND_COMPL_HARD_REG_SET (reg_reloaded_valid, reg_reloaded_call_part_clobbered);
}
}
@@ -4961,6 +5122,126 @@ reloads_unique_chain_p (int r1, int r2)
return true;
}
+
+/* The recursive function change all occurrences of WHAT in *WHERE
+ onto REPL. */
+static void
+substitute (rtx *where, const_rtx what, rtx repl)
+{
+ const char *fmt;
+ int i;
+ enum rtx_code code;
+
+ if (*where == 0)
+ return;
+
+ if (*where == what || rtx_equal_p (*where, what))
+ {
+ *where = repl;
+ return;
+ }
+
+ code = GET_CODE (*where);
+ fmt = GET_RTX_FORMAT (code);
+ for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
+ {
+ if (fmt[i] == 'E')
+ {
+ int j;
+
+ for (j = XVECLEN (*where, i) - 1; j >= 0; j--)
+ substitute (&XVECEXP (*where, i, j), what, repl);
+ }
+ else if (fmt[i] == 'e')
+ substitute (&XEXP (*where, i), what, repl);
+ }
+}
+
+/* The function returns TRUE if chain of reload R1 and R2 (in any
+ order) can be evaluated without usage of intermediate register for
+ the reload containing another reload. It is important to see
+ gen_reload to understand what the function is trying to do. As an
+ example, let us have reload chain
+
+ r2: const
+ r1: <something> + const
+
+ and reload R2 got reload reg HR. The function returns true if
+ there is a correct insn HR = HR + <something>. Otherwise,
+ gen_reload will use intermediate register (and this is the reload
+ reg for R1) to reload <something>.
+
+ We need this function to find a conflict for chain reloads. In our
+ example, if HR = HR + <something> is incorrect insn, then we cannot
+ use HR as a reload register for R2. If we do use it then we get a
+ wrong code:
+
+ HR = const
+ HR = <something>
+ HR = HR + HR
+
+*/
+static bool
+gen_reload_chain_without_interm_reg_p (int r1, int r2)
+{
+ bool result;
+ int regno, n, code;
+ rtx out, in, tem, insn;
+ rtx last = get_last_insn ();
+
+ /* Make r2 a component of r1. */
+ if (reg_mentioned_p (rld[r1].in, rld[r2].in))
+ {
+ n = r1;
+ r1 = r2;
+ r2 = n;
+ }
+ gcc_assert (reg_mentioned_p (rld[r2].in, rld[r1].in));
+ regno = rld[r1].regno >= 0 ? rld[r1].regno : rld[r2].regno;
+ gcc_assert (regno >= 0);
+ out = gen_rtx_REG (rld[r1].mode, regno);
+ in = copy_rtx (rld[r1].in);
+ substitute (&in, rld[r2].in, gen_rtx_REG (rld[r2].mode, regno));
+
+ /* If IN is a paradoxical SUBREG, remove it and try to put the
+ opposite SUBREG on OUT. Likewise for a paradoxical SUBREG on OUT. */
+ if (GET_CODE (in) == SUBREG
+ && (GET_MODE_SIZE (GET_MODE (in))
+ > GET_MODE_SIZE (GET_MODE (SUBREG_REG (in))))
+ && (tem = gen_lowpart_common (GET_MODE (SUBREG_REG (in)), out)) != 0)
+ in = SUBREG_REG (in), out = tem;
+
+ if (GET_CODE (in) == PLUS
+ && (REG_P (XEXP (in, 0))
+ || GET_CODE (XEXP (in, 0)) == SUBREG
+ || MEM_P (XEXP (in, 0)))
+ && (REG_P (XEXP (in, 1))
+ || GET_CODE (XEXP (in, 1)) == SUBREG
+ || CONSTANT_P (XEXP (in, 1))
+ || MEM_P (XEXP (in, 1))))
+ {
+ insn = emit_insn (gen_rtx_SET (VOIDmode, out, in));
+ code = recog_memoized (insn);
+ result = false;
+
+ if (code >= 0)
+ {
+ extract_insn (insn);
+ /* We want constrain operands to treat this insn strictly in
+ its validity determination, i.e., the way it would after
+ reload has completed. */
+ result = constrain_operands (1);
+ }
+
+ delete_insns_since (last);
+ return result;
+ }
+
+ /* It looks like other cases in gen_reload are not possible for
+ chain reloads or do need an intermediate hard registers. */
+ return true;
+}
+
/* Return 1 if the reloads denoted by R1 and R2 cannot share a register.
Return 0 otherwise.
@@ -5010,7 +5291,8 @@ reloads_conflict (int r1, int r2)
case RELOAD_FOR_OPERAND_ADDRESS:
return (r2_type == RELOAD_FOR_INPUT || r2_type == RELOAD_FOR_INSN
|| (r2_type == RELOAD_FOR_OPERAND_ADDRESS
- && !reloads_unique_chain_p (r1, r2)));
+ && (!reloads_unique_chain_p (r1, r2)
+ || !gen_reload_chain_without_interm_reg_p (r1, r2))));
case RELOAD_FOR_OPADDR_ADDR:
return (r2_type == RELOAD_FOR_INPUT
@@ -6718,7 +7000,10 @@ emit_input_reload_insns (struct insn_chain *chain, struct reload *rl,
&& REG_N_SETS (REGNO (old)) == 1)
{
reg_renumber[REGNO (old)] = REGNO (reloadreg);
- alter_reg (REGNO (old), -1);
+ if (flag_ira && optimize)
+ /* Inform IRA about the change. */
+ ira_mark_allocation_change (REGNO (old));
+ alter_reg (REGNO (old), -1, false);
}
special = 1;
}
@@ -8003,9 +8288,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)),
@@ -8153,7 +8440,7 @@ delete_output_reload (rtx insn, int j, int last_reload_reg, rtx new_reload_reg)
n_occurrences += count_occurrences (PATTERN (insn),
eliminate_regs (substed, 0,
NULL_RTX), 0);
- for (i1 = reg_equiv_alt_mem_list [REGNO (reg)]; i1; i1 = XEXP (i1, 1))
+ for (i1 = reg_equiv_alt_mem_list[REGNO (reg)]; i1; i1 = XEXP (i1, 1))
{
gcc_assert (!rtx_equal_p (XEXP (i1, 0), substed));
n_occurrences += count_occurrences (PATTERN (insn), XEXP (i1, 0), 0);
@@ -8254,7 +8541,10 @@ delete_output_reload (rtx insn, int j, int last_reload_reg, rtx new_reload_reg)
/* For the debugging info, say the pseudo lives in this reload reg. */
reg_renumber[REGNO (reg)] = REGNO (new_reload_reg);
- alter_reg (REGNO (reg), -1);
+ if (flag_ira && optimize)
+ /* Inform IRA about the change. */
+ ira_mark_allocation_change (REGNO (reg));
+ alter_reg (REGNO (reg), -1, false);
}
else
{
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 25f410aad2d..97570e858dd 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
{
@@ -3439,7 +3439,7 @@ relax_delay_slots (rtx first)
Only do so if optimizing for size since this results in slower, but
smaller code. */
- if (optimize_size
+ if (optimize_function_for_size_p (cfun)
&& GET_CODE (PATTERN (delay_insn)) == RETURN
&& next
&& JUMP_P (next)
diff --git a/gcc/rtl.h b/gcc/rtl.h
index b2b561c3421..9e7d40ad6e5 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1084,6 +1084,8 @@ extern unsigned int subreg_regno_offset (unsigned int, enum machine_mode,
extern bool subreg_offset_representable_p (unsigned int, enum machine_mode,
unsigned int, enum machine_mode);
extern unsigned int subreg_regno (const_rtx);
+extern int simplify_subreg_regno (unsigned int, enum machine_mode,
+ unsigned int, enum machine_mode);
extern unsigned int subreg_nregs (const_rtx);
extern unsigned int subreg_nregs_with_regno (unsigned int, const_rtx);
extern unsigned HOST_WIDE_INT nonzero_bits (const_rtx, enum machine_mode);
@@ -1572,6 +1574,7 @@ extern rtx simplify_subtraction (rtx);
/* In function.c */
extern rtx assign_stack_local (enum machine_mode, HOST_WIDE_INT, int);
+extern rtx assign_stack_local_1 (enum machine_mode, HOST_WIDE_INT, int, bool);
extern rtx assign_stack_temp (enum machine_mode, HOST_WIDE_INT, int);
extern rtx assign_stack_temp_for_type (enum machine_mode,
HOST_WIDE_INT, int, tree);
@@ -1804,6 +1807,12 @@ rtx remove_list_elem (rtx, rtx *);
/* regclass.c */
+/* Initialize may_move_cost and friends for mode M. */
+extern void init_move_cost (enum machine_mode);
+/* Allocate register info memory. */
+extern void allocate_reg_info (void);
+/* Resize reg info. */
+extern void resize_reg_info (void);
/* Free up register info memory. */
extern void free_reg_info (void);
@@ -1814,6 +1823,7 @@ extern const char *decode_asm_operands (rtx, rtx *, rtx **, const char **,
extern enum reg_class reg_preferred_class (int);
extern enum reg_class reg_alternate_class (int);
+extern void setup_reg_classes (int, enum reg_class, enum reg_class);
extern void split_all_insns (void);
extern unsigned int split_all_insns_noflow (void);
@@ -2182,12 +2192,16 @@ extern bool can_copy_p (enum machine_mode);
extern rtx fis_get_condition (rtx);
/* In global.c */
+#ifdef HARD_CONST
+extern HARD_REG_SET eliminable_regset;
+#endif
extern void mark_elimination (int, int);
extern void dump_global_regs (FILE *);
#ifdef HARD_CONST
/* Yes, this ifdef is silly, but HARD_REG_SET is not always defined. */
extern void retry_global_alloc (int, HARD_REG_SET);
#endif
+extern void build_insn_chain (void);
/* In regclass.c */
extern int reg_classes_intersect_p (enum reg_class, enum reg_class);
@@ -2213,6 +2227,7 @@ extern void dbr_schedule (rtx);
/* In local-alloc.c */
extern void dump_local_alloc (FILE *);
+extern int update_equiv_regs (void);
/* In reload1.c */
extern int function_invariant_p (const_rtx);
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index fb4a5df7dc8..9c5a1e53c7f 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -3244,6 +3244,64 @@ subreg_offset_representable_p (unsigned int xregno, enum machine_mode xmode,
return info.representable_p;
}
+/* Return the number of a YMODE register to which
+
+ (subreg:YMODE (reg:XMODE XREGNO) OFFSET)
+
+ can be simplified. Return -1 if the subreg can't be simplified.
+
+ XREGNO is a hard register number. */
+
+int
+simplify_subreg_regno (unsigned int xregno, enum machine_mode xmode,
+ unsigned int offset, enum machine_mode ymode)
+{
+ struct subreg_info info;
+ unsigned int yregno;
+
+#ifdef CANNOT_CHANGE_MODE_CLASS
+ /* Give the backend a chance to disallow the mode change. */
+ if (GET_MODE_CLASS (xmode) != MODE_COMPLEX_INT
+ && GET_MODE_CLASS (xmode) != MODE_COMPLEX_FLOAT
+ && REG_CANNOT_CHANGE_MODE_P (xregno, xmode, ymode))
+ return -1;
+#endif
+
+ /* We shouldn't simplify stack-related registers. */
+ if ((!reload_completed || frame_pointer_needed)
+ && (xregno == FRAME_POINTER_REGNUM
+ || xregno == HARD_FRAME_POINTER_REGNUM))
+ return -1;
+
+ if (FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
+ && xregno == ARG_POINTER_REGNUM)
+ return -1;
+
+ if (xregno == STACK_POINTER_REGNUM)
+ return -1;
+
+ /* Try to get the register offset. */
+ subreg_get_info (xregno, xmode, offset, ymode, &info);
+ if (!info.representable_p)
+ return -1;
+
+ /* Make sure that the offsetted register value is in range. */
+ yregno = xregno + info.offset;
+ if (!HARD_REGISTER_NUM_P (yregno))
+ return -1;
+
+ /* See whether (reg:YMODE YREGNO) is valid.
+
+ ??? We allow invalid registers if (reg:XMODE XREGNO) is also invalid.
+ This is a kludge to work around how float/complex arguments are passed
+ on 32-bit SPARC and should be fixed. */
+ if (!HARD_REGNO_MODE_OK (yregno, ymode)
+ && HARD_REGNO_MODE_OK (xregno, xmode))
+ return -1;
+
+ return (int) yregno;
+}
+
/* Return the final regno that a subreg expression refers to. */
unsigned int
subreg_regno (const_rtx x)
@@ -3399,7 +3457,7 @@ keep_with_call_p (const_rtx insn)
if (SET_DEST (set) == stack_pointer_rtx)
{
/* This CONST_CAST is okay because next_nonnote_insn just
- returns it's argument and we assign it to a const_rtx
+ returns its argument and we assign it to a const_rtx
variable. */
const_rtx i2 = next_nonnote_insn (CONST_CAST_RTX(insn));
if (i2 && keep_with_call_p (i2))
diff --git a/gcc/scan.c b/gcc/scan.c
index f697d26ec02..c6d04716271 100644
--- a/gcc/scan.c
+++ b/gcc/scan.c
@@ -35,7 +35,7 @@ make_sstring_space (sstring *str, int count)
if (new_size <= cur_size)
return;
- str->base = xrealloc (str->base, new_size);
+ str->base = (char *) xrealloc (str->base, new_size);
str->ptr = str->base + cur_size;
str->limit = str->base + new_size;
}
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/sdbout.c b/gcc/sdbout.c
index 8836a975e38..e6f14fa2f78 100644
--- a/gcc/sdbout.c
+++ b/gcc/sdbout.c
@@ -329,7 +329,7 @@ const struct gcc_debug_hooks sdb_debug_hooks =
debug_nothing_tree, /* function_decl */
sdbout_global_decl, /* global_decl */
sdbout_symbol, /* type_decl */
- debug_nothing_tree_tree, /* imported_module_or_decl */
+ debug_nothing_tree_tree_tree_bool, /* imported_module_or_decl */
debug_nothing_tree, /* deferred_inline_function */
debug_nothing_tree, /* outlining_inline_function */
sdbout_label, /* label */
diff --git a/gcc/see.c b/gcc/see.c
index 3dfaa41245f..a465d529e30 100644
--- a/gcc/see.c
+++ b/gcc/see.c
@@ -2809,7 +2809,7 @@ see_merge_one_def_extension (void **slot, void *b)
enum rtx_code code;
enum rtx_code extension_code;
enum machine_mode source_extension_mode;
- enum machine_mode source_mode;
+ enum machine_mode source_mode = VOIDmode;
enum machine_mode dest_extension_mode;
bool merge_success = false;
int i;
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 262c9194937..606a850622c 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;
@@ -5071,35 +5069,13 @@ simplify_subreg (enum machine_mode outermode, rtx op,
suppress this simplification. If the hard register is the stack,
frame, or argument pointer, leave this as a SUBREG. */
- if (REG_P (op)
- && REGNO (op) < FIRST_PSEUDO_REGISTER
-#ifdef CANNOT_CHANGE_MODE_CLASS
- && ! (REG_CANNOT_CHANGE_MODE_P (REGNO (op), innermode, outermode)
- && GET_MODE_CLASS (innermode) != MODE_COMPLEX_INT
- && GET_MODE_CLASS (innermode) != MODE_COMPLEX_FLOAT)
-#endif
- && ((reload_completed && !frame_pointer_needed)
- || (REGNO (op) != FRAME_POINTER_REGNUM
-#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
- && REGNO (op) != HARD_FRAME_POINTER_REGNUM
-#endif
- ))
-#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
- && REGNO (op) != ARG_POINTER_REGNUM
-#endif
- && REGNO (op) != STACK_POINTER_REGNUM
- && subreg_offset_representable_p (REGNO (op), innermode,
- byte, outermode))
+ if (REG_P (op) && HARD_REGISTER_P (op))
{
- unsigned int regno = REGNO (op);
- unsigned int final_regno
- = regno + subreg_regno_offset (regno, innermode, byte, outermode);
-
- /* ??? We do allow it if the current REG is not valid for
- its mode. This is a kludge to work around how float/complex
- arguments are passed on 32-bit SPARC and should be fixed. */
- if (HARD_REGNO_MODE_OK (final_regno, outermode)
- || ! HARD_REGNO_MODE_OK (regno, innermode))
+ unsigned int regno, final_regno;
+
+ regno = REGNO (op);
+ final_regno = simplify_subreg_regno (regno, innermode, byte, outermode);
+ if (HARD_REGISTER_NUM_P (final_regno))
{
rtx x;
int final_offset = byte;
diff --git a/gcc/stmt.c b/gcc/stmt.c
index af02f3402ce..2464466b376 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1356,9 +1356,6 @@ expand_expr_stmt (tree exp)
tree type;
value = expand_expr (exp, const0_rtx, VOIDmode, EXPAND_NORMAL);
- if (GIMPLE_TUPLE_P (exp))
- type = void_type_node;
- else
type = TREE_TYPE (exp);
/* If all we do is reference a volatile value in memory,
@@ -1412,7 +1409,6 @@ warn_if_unused_value (const_tree exp, location_t locus)
case PREDECREMENT_EXPR:
case POSTDECREMENT_EXPR:
case MODIFY_EXPR:
- case GIMPLE_MODIFY_STMT:
case INIT_EXPR:
case TARGET_EXPR:
case CALL_EXPR:
@@ -1581,10 +1577,10 @@ expand_return (tree retval)
expand_null_return ();
return;
}
- else if ((TREE_CODE (retval) == GIMPLE_MODIFY_STMT
+ else if ((TREE_CODE (retval) == MODIFY_EXPR
|| TREE_CODE (retval) == INIT_EXPR)
- && TREE_CODE (GENERIC_TREE_OPERAND (retval, 0)) == RESULT_DECL)
- retval_rhs = GENERIC_TREE_OPERAND (retval, 1);
+ && TREE_CODE (TREE_OPERAND (retval, 0)) == RESULT_DECL)
+ retval_rhs = TREE_OPERAND (retval, 1);
else
retval_rhs = retval;
@@ -1603,7 +1599,7 @@ expand_return (tree retval)
(and in expand_call). */
else if (retval_rhs != 0
- && TYPE_MODE (GENERIC_TREE_TYPE (retval_rhs)) == BLKmode
+ && TYPE_MODE (TREE_TYPE (retval_rhs)) == BLKmode
&& REG_P (result_rtl))
{
int i;
@@ -1817,7 +1813,7 @@ expand_nl_goto_receiver (void)
{
/* Now restore our arg pointer from the address at which it
was saved in our stack frame. */
- emit_move_insn (virtual_incoming_args_rtx,
+ emit_move_insn (crtl->args.internal_arg_pointer,
copy_to_reg (get_arg_pointer_save_area ()));
}
}
@@ -1871,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. */
@@ -1903,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
@@ -1940,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. */
@@ -2459,7 +2419,7 @@ expand_case (tree exp)
else if (count < case_values_threshold ()
|| compare_tree_int (range,
- (optimize_size ? 3 : 10) * count) > 0
+ (optimize_insn_for_size_p () ? 3 : 10) * count) > 0
/* RANGE may be signed, and really large ranges will show up
as negative numbers. */
|| compare_tree_int (range, 0) < 0
@@ -2529,7 +2489,7 @@ expand_case (tree exp)
/* Index jumptables from zero for suitable values of
minval to avoid a subtraction. */
- if (! optimize_size
+ if (optimize_insn_for_speed_p ()
&& compare_tree_int (minval, 0) > 0
&& compare_tree_int (minval, 3) < 0)
{
diff --git a/gcc/system.h b/gcc/system.h
index be70b026ff4..80bfe619c3d 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -786,8 +786,9 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
change after the fact). Beyond these uses, most other cases of
using this macro should be viewed with extreme caution. */
-#if defined(__GNUC__) && GCC_VERSION != 4000
-/* GCC 4.0.x has a bug where it may ICE on this expression. */
+#if defined(__GNUC__) && GCC_VERSION > 4000
+/* GCC 4.0.x has a bug where it may ICE on this expression,
+ so does GCC 3.4.x (PR17436). */
#define CONST_CAST2(TOTYPE,FROMTYPE,X) ((__extension__(union {FROMTYPE _q; TOTYPE _nq;})(X))._nq)
#else
#define CONST_CAST2(TOTYPE,FROMTYPE,X) ((TOTYPE)(FROMTYPE)(X))
@@ -796,6 +797,7 @@ extern void fancy_abort (const char *, int, const char *) ATTRIBUTE_NORETURN;
#define CONST_CAST_TREE(X) CONST_CAST(union tree_node *, (X))
#define CONST_CAST_RTX(X) CONST_CAST(struct rtx_def *, (X))
#define CONST_CAST_BB(X) CONST_CAST(struct basic_block_def *, (X))
+#define CONST_CAST_GIMPLE(X) CONST_CAST(union gimple_statement_d *, (X))
/* Activate certain diagnostics as warnings (not errors via the
-Werror flag). */
diff --git a/gcc/target-def.h b/gcc/target-def.h
index 1d138e5fb68..817cae4a1d2 100644
--- a/gcc/target-def.h
+++ b/gcc/target-def.h
@@ -364,6 +364,7 @@
#define TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST 0
#define TARGET_VECTOR_ALIGNMENT_REACHABLE \
default_builtin_vector_alignment_reachable
+#define TARGET_VECTORIZE_BUILTIN_VEC_PERM 0
#define TARGET_VECTORIZE \
{ \
@@ -373,7 +374,8 @@
TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN, \
TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD, \
TARGET_VECTORIZE_BUILTIN_VECTORIZATION_COST, \
- TARGET_VECTOR_ALIGNMENT_REACHABLE \
+ TARGET_VECTOR_ALIGNMENT_REACHABLE, \
+ TARGET_VECTORIZE_BUILTIN_VEC_PERM \
}
#define TARGET_DEFAULT_TARGET_FLAGS 0
@@ -571,6 +573,8 @@
#define TARGET_FUNCTION_VALUE default_function_value
#define TARGET_INTERNAL_ARG_POINTER default_internal_arg_pointer
+#define TARGET_UPDATE_STACK_BOUNDARY NULL
+#define TARGET_GET_DRAP_RTX NULL
#define TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS hook_bool_void_true
#define TARGET_CALLS { \
@@ -592,6 +596,8 @@
TARGET_INVALID_ARG_FOR_UNPROTOTYPED_FN, \
TARGET_FUNCTION_VALUE, \
TARGET_INTERNAL_ARG_POINTER, \
+ TARGET_UPDATE_STACK_BOUNDARY, \
+ TARGET_GET_DRAP_RTX, \
TARGET_ALLOCATE_STACK_SLOTS_FOR_ARGS \
}
@@ -760,7 +766,8 @@
/* Function specific option attribute support. */
#ifndef TARGET_OPTION_VALID_ATTRIBUTE_P
-#define TARGET_OPTION_VALID_ATTRIBUTE_P NULL
+#define TARGET_OPTION_VALID_ATTRIBUTE_P \
+ default_target_option_valid_attribute_p
#endif
#ifndef TARGET_OPTION_SAVE
@@ -776,7 +783,7 @@
#endif
#ifndef TARGET_OPTION_PRAGMA_PARSE
-#define TARGET_OPTION_PRAGMA_PARSE NULL
+#define TARGET_OPTION_PRAGMA_PARSE default_target_option_pragma_parse
#endif
#ifndef TARGET_OPTION_CAN_INLINE_P
diff --git a/gcc/target.h b/gcc/target.h
index 468e5d7f083..a44eb921a60 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -438,7 +438,10 @@ struct gcc_target
/* Return true if vector alignment is reachable (by peeling N
iterations) for the given type. */
bool (* vector_alignment_reachable) (const_tree, bool);
- } vectorize;
+
+ /* Target builtin that implements vector permute. */
+ tree (* builtin_vec_perm) (tree, tree*);
+} vectorize;
/* The initial value of target_flags. */
int default_target_flags;
@@ -707,8 +710,8 @@ struct gcc_target
void (* expand_builtin_va_start) (tree valist, rtx nextarg);
/* Gimplifies a VA_ARG_EXPR. */
- tree (* gimplify_va_arg_expr) (tree valist, tree type, tree *pre_p,
- tree *post_p);
+ tree (* gimplify_va_arg_expr) (tree valist, tree type, gimple_seq *pre_p,
+ gimple_seq *post_p);
/* Validity-checking routines for PCH files, target-specific.
get_pch_validity returns a pointer to the data to be stored,
@@ -754,10 +757,9 @@ struct gcc_target
void (* dwarf_handle_frame_unspec) (const char *, rtx, int);
/* Perform architecture specific checking of statements gimplified
- from VA_ARG_EXPR. LHS is left hand side of MODIFY_EXPR, RHS
- is right hand side. Returns true if the statements doesn't need
- to be checked for va_list references. */
- bool (* stdarg_optimize_hook) (struct stdarg_info *ai, const_tree lhs, const_tree rhs);
+ from VA_ARG_EXPR. STMT is the statement. Returns true if the statement
+ doesn't need to be checked for va_list references. */
+ bool (* stdarg_optimize_hook) (struct stdarg_info *ai, const_gimple stmt);
/* This target hook allows the operating system to override the DECL
that represents the external variable that contains the stack
@@ -840,6 +842,13 @@ struct gcc_target
current function. */
rtx (*internal_arg_pointer) (void);
+ /* Update the current function stack boundary if needed. */
+ void (*update_stack_boundary) (void);
+
+ /* Handle stack alignment and return an rtx for Dynamic Realign
+ Argument Pointer if necessary. */
+ rtx (*get_drap_rtx) (void);
+
/* Return true if all function parameters should be spilled to the
stack. */
bool (*allocate_stack_slots_for_args) (void);
@@ -982,10 +991,10 @@ struct gcc_target
void (*print) (FILE *, int, struct cl_target_option *);
/* Function to parse arguments to be validated for #pragma option, and to
- change the state if the options are valid. If the arguments are NULL,
- use the default target options. Return true if the options are valid,
- and set the current state. */
- bool (*pragma_parse) (tree);
+ change the state if the options are valid. If the first argument is
+ NULL, the second argument specifies the default options to use. Return
+ true if the options are valid, and set the current state. */
+ bool (*pragma_parse) (tree, tree);
/* Function to determine if one function can inline another function. */
bool (*can_inline_p) (tree, tree);
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 4e9b9ad0675..8edfcfce846 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -715,6 +715,19 @@ default_target_option_valid_attribute_p (tree ARG_UNUSED (fndecl),
tree ARG_UNUSED (args),
int ARG_UNUSED (flags))
{
+ warning (OPT_Wattributes,
+ "target attribute is not supported on this machine");
+
+ return false;
+}
+
+bool
+default_target_option_pragma_parse (tree ARG_UNUSED (args),
+ tree ARG_UNUSED (pop_target))
+{
+ warning (OPT_Wpragmas,
+ "#pragma GCC target is not supported for this machine");
+
return false;
}
diff --git a/gcc/targhooks.h b/gcc/targhooks.h
index efb487c0d8b..f8d75e881c8 100644
--- a/gcc/targhooks.h
+++ b/gcc/targhooks.h
@@ -99,4 +99,5 @@ extern tree default_emutls_var_fields (tree, tree *);
extern tree default_emutls_var_init (tree, tree, tree);
extern bool default_hard_regno_scratch_ok (unsigned int);
extern bool default_target_option_valid_attribute_p (tree, tree, tree, int);
+extern bool default_target_option_pragma_parse (tree, tree);
extern bool default_target_option_can_inline_p (tree, tree);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 96e602b5ef2..5f940c11b19 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,2410 @@
+2008-08-30 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/36895
+ * gfortran.dg/namelist_53.f90: New test.
+
+2008-08-29 Michael Meissner <gnu@the-meissners.org>
+
+ * gcc.target/i386/sse-22.c: Change #pragma GCC option to #pragma
+ GCC target. Change attribute((option(...))) to
+ attribute((target(...))).
+ * gcc.target/i386/sse-23.c: Ditto.
+ * gcc.target/i386/funcspec-1.c: Ditto.
+ * gcc.target/i386/funcspec-2.c: Ditto.
+ * gcc.target/i386/funcspec-3.c: Ditto.
+ * gcc.target/i386/funcspec-4.c: Ditto.
+ * gcc.target/i386/funcspec-5.c: Ditto.
+ * gcc.target/i386/funcspec-6.c: Ditto.
+ * gcc.target/i386/funcspec-7.c: Ditto.
+ * gcc.target/i386/funcspec-8.c: Ditto.
+ * gcc.target/i386/funcspec-9.c: Ditto.
+ * gcc.target/i386/funcspec-10.c: Ditto.
+ * gcc.target/i386/funcspec-11.c: Ditto.
+
+ * gcc.target/i386/cold-1.c: Delete.
+ * gcc.target/i386/hot-1.c: Ditto.
+
+ * gcc.dg/pr36997.c: Add -msse2 to the target flags.
+
+ * gcc.target/i386/funcspec-8.c: #pragma GCC option push is now
+ #pragma GCC push_options, and #pragma GCC option pop is now
+ #pragma GCC pop_options.
+ * gcc.target/i386/opt-2.c: Ditto.
+
+2008-08-29 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/abi/mangle-neon.C: Add substitution test.
+
+2008-08-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/37261
+ * gcc.dg/pr37261.c: New test.
+
+ PR fortran/23057
+ * gfortran.dg/debug/pr35154-dwarf2.f: Adjust for replacement
+ of DW_TAG_member with DW_TAG_variable.
+
+2008-08-29 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/ipa/modif-1.c: Update template.
+
+2008-08-29 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/ipa/ipa-1.c: Fix template for better debug output.
+ * gcc.dg/ipa/ipa-2.c: Fix template for better debug output.
+ * gcc.dg/ipa/ipa-3.c: Fix template for better debug output.
+ * gcc.dg/ipa/ipa-4.c: Fix template for better debug output.
+ * gcc.dg/ipa/ipa-5.c: Fix template for better debug output.
+ * gcc.dg/ipa/ipa-7.c: Fix template for better debug output.
+
+2008-08-29 Richard Guenther <rguenther@suse.de>
+
+ * gfortran.fortran-torture/compile/20080805-1.f90: New testcase.
+
+2008-08-29 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/37236
+ * gfortran.fortran-torture/compile/pr37236.f: New testcase.
+
+2008-08-29 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37207
+ * gcc.dg/tree-ssa/vrp46.c: New testcase.
+
+2008-08-28 Adam Nemet <anemet@caviumnetworks.com>
+
+ * gcc.target/mips/octeon-bbit-1.c: New test.
+ * gcc.target/mips/octeon-bbit-2.c: New test.
+ * gcc.target/mips/octeon-bbit-3.c: New test.
+
+2008-08-28 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+ Andrew Pinski <pinskia@gcc.gnu.org>
+
+ PR 18050
+ * gcc.dg/Wsequence-point-pr18050.c: New.
+ * g++.dg/warn/Wsequence-point-pr18050.C: New.
+
+2008-08-28 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/37260
+ * g++.dg/parse/crash44.C: New.
+
+2008-08-28 Adam Nemet <anemet@caviumnetworks.com>
+
+ * gcc.target/mips/octeon-dmul-1.c: New test.
+ * gcc.target/mips/octeon-dmul-2.c: New test.
+ * gcc.target/mips/dmult-1.c: New test.
+
+2008-08-28 Xuepeng Guo <xuepeng.guo@intel.com>
+ Joey Ye <joey.ye@intel.com>
+ H.J. Lu <hongjiu.lu@intel.com>
+
+ * gcc.dg/compat/vector-1b_main.c: New.
+ * gcc.dg/compat/vector-1b_x.c: Likewise.
+ * gcc.dg/compat/vector-1b_y.c: Likewise.
+ * gcc.dg/compat/vector-2b_main.c: Likewise.
+ * gcc.dg/compat/vector-2b_x.c: Likewise.
+ * gcc.dg/compat/vector-2b_y.c: Likewise.
+ * gcc.target/i386/aes-avx-check.h: Likewise.
+ * gcc.target/i386/avx-1.c: Likewise.
+ * gcc.target/i386/avx-2.c: Likewise.
+ * gcc.target/i386/avx-3.c: Likewise.
+ * gcc.target/i386/avx-check.h: Likewise.
+ * gcc.target/i386/avx-set1-epi32-1.c: Likewise.
+ * gcc.target/i386/avx-set1-pd-256-1.c: Likewise.
+ * gcc.target/i386/avx-set1-ps-256-1.c: Likewise.
+ * gcc.target/i386/avx-set-v16hi-1.c: Likewise.
+ * gcc.target/i386/avx-set-v16hi-2.c: Likewise.
+ * gcc.target/i386/avx-set-v16hi-3.c: Likewise.
+ * gcc.target/i386/avx-set-v16hi-4.c: Likewise.
+ * gcc.target/i386/avx-set-v16hi-5.c: Likewise.
+ * gcc.target/i386/avx-set-v32qi-1.c: Likewise.
+ * gcc.target/i386/avx-set-v32qi-2.c: Likewise.
+ * gcc.target/i386/avx-set-v32qi-3.c: Likewise.
+ * gcc.target/i386/avx-set-v32qi-4.c: Likewise.
+ * gcc.target/i386/avx-set-v32qi-5.c: Likewise.
+ * gcc.target/i386/avx-set-v4df-1.c: Likewise.
+ * gcc.target/i386/avx-set-v4df-2.c: Likewise.
+ * gcc.target/i386/avx-set-v4df-3.c: Likewise.
+ * gcc.target/i386/avx-set-v4df-4.c: Likewise.
+ * gcc.target/i386/avx-set-v4df-5.c: Likewise.
+ * gcc.target/i386/avx-set-v4di-1.c: Likewise.
+ * gcc.target/i386/avx-set-v4di-2.c: Likewise.
+ * gcc.target/i386/avx-set-v4di-3.c: Likewise.
+ * gcc.target/i386/avx-set-v4di-4.c: Likewise.
+ * gcc.target/i386/avx-set-v4di-5.c: Likewise.
+ * gcc.target/i386/avx-set-v8sf-1.c: Likewise.
+ * gcc.target/i386/avx-set-v8sf-2.c: Likewise.
+ * gcc.target/i386/avx-set-v8sf-3.c: Likewise.
+ * gcc.target/i386/avx-set-v8sf-4.c: Likewise.
+ * gcc.target/i386/avx-set-v8sf-5.c: Likewise.
+ * gcc.target/i386/avx-set-v8si-1.c: Likewise.
+ * gcc.target/i386/avx-set-v8si-2.c: Likewise.
+ * gcc.target/i386/avx-set-v8si-3.c: Likewise.
+ * gcc.target/i386/avx-set-v8si-4.c: Likewise.
+ * gcc.target/i386/avx-set-v8si-5.c: Likewise.
+ * gcc.target/i386/avx-setzero-pd-256-1.c: Likewise.
+ * gcc.target/i386/avx-setzero-ps-256-1.c: Likewise.
+ * gcc.target/i386/avx-setzero-si256-1.c: Likewise.
+ * gcc.target/i386/avx-vaddpd-1.c: Likewise.
+ * gcc.target/i386/avx-vaddpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vaddps-1.c: Likewise.
+ * gcc.target/i386/avx-vaddps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vaddsd-1.c: Likewise.
+ * gcc.target/i386/avx-vaddss-1.c: Likewise.
+ * gcc.target/i386/avx-vaddsubpd-1.c: Likewise.
+ * gcc.target/i386/avx-vaddsubpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vaddsubps-1.c: Likewise.
+ * gcc.target/i386/avx-vaddsubps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vaesdec-1.c: Likewise.
+ * gcc.target/i386/avx-vaesdeclast-1.c: Likewise.
+ * gcc.target/i386/avx-vaesenc-1.c: Likewise.
+ * gcc.target/i386/avx-vaesenclast-1.c: Likewise.
+ * gcc.target/i386/avx-vaesimc-1.c: Likewise.
+ * gcc.target/i386/avx-vaeskeygenassist-1.c: Likewise.
+ * gcc.target/i386/avx-vandnpd-1.c: Likewise.
+ * gcc.target/i386/avx-vandnpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vandnps-1.c: Likewise.
+ * gcc.target/i386/avx-vandnps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vandpd-1.c: Likewise.
+ * gcc.target/i386/avx-vandpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vandps-1.c: Likewise.
+ * gcc.target/i386/avx-vandps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vblendpd-1.c: Likewise.
+ * gcc.target/i386/avx-vblendpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vblendps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vblendvpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vblendvps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vbroadcastf128-256-1.c: Likewise.
+ * gcc.target/i386/avx-vbroadcastf128-256-2.c: Likewise.
+ * gcc.target/i386/avx-vbroadcastsd-1.c: Likewise.
+ * gcc.target/i386/avx-vbroadcastss-1.c: Likewise.
+ * gcc.target/i386/avx-vbroadcastss-2.c: Likewise.
+ * gcc.target/i386/avx-vcmppd-1.c: Likewise.
+ * gcc.target/i386/avx-vcmppd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vcmpps-1.c: Likewise.
+ * gcc.target/i386/avx-vcmpps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vcmpsd-1.c: Likewise.
+ * gcc.target/i386/avx-vcmpss-1.c: Likewise.
+ * gcc.target/i386/avx-vcomisd-1.c: Likewise.
+ * gcc.target/i386/avx-vcomisd-2.c: Likewise.
+ * gcc.target/i386/avx-vcomisd-3.c: Likewise.
+ * gcc.target/i386/avx-vcomisd-4.c: Likewise.
+ * gcc.target/i386/avx-vcomisd-5.c: Likewise.
+ * gcc.target/i386/avx-vcomisd-6.c: Likewise.
+ * gcc.target/i386/avx-vcomiss-1.c: Likewise.
+ * gcc.target/i386/avx-vcomiss-2.c: Likewise.
+ * gcc.target/i386/avx-vcomiss-3.c: Likewise.
+ * gcc.target/i386/avx-vcomiss-4.c: Likewise.
+ * gcc.target/i386/avx-vcomiss-5.c: Likewise.
+ * gcc.target/i386/avx-vcomiss-6.c: Likewise.
+ * gcc.target/i386/avx-vcvtdq2pd-1.c: Likewise.
+ * gcc.target/i386/avx-vcvtdq2pd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vcvtdq2ps-1.c: Likewise.
+ * gcc.target/i386/avx-vcvtpd2dq-1.c: Likewise.
+ * gcc.target/i386/avx-vcvtpd2dq-256-1.c: Likewise.
+ * gcc.target/i386/avx-vcvtpd2ps-1.c: Likewise.
+ * gcc.target/i386/avx-vcvtpd2ps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vcvtps2dq-1.c: Likewise.
+ * gcc.target/i386/avx-vcvtps2dq-256-1.c: Likewise.
+ * gcc.target/i386/avx-vcvtps2pd-1.c: Likewise.
+ * gcc.target/i386/avx-vcvtps2pd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vcvtsd2si-1.c: Likewise.
+ * gcc.target/i386/avx-vcvtsd2si-2.c: Likewise.
+ * gcc.target/i386/avx-vcvtsd2ss-1.c: Likewise.
+ * gcc.target/i386/avx-vcvtsi2sd-1.c: Likewise.
+ * gcc.target/i386/avx-vcvtsi2sd-2.c: Likewise.
+ * gcc.target/i386/avx-vcvtsi2ss-1.c: Likewise.
+ * gcc.target/i386/avx-vcvtsi2ss-2.c: Likewise.
+ * gcc.target/i386/avx-vcvtss2sd-1.c: Likewise.
+ * gcc.target/i386/avx-vcvtss2si-1.c: Likewise.
+ * gcc.target/i386/avx-vcvtss2si-2.c: Likewise.
+ * gcc.target/i386/avx-vcvttpd2dq-1.c: Likewise.
+ * gcc.target/i386/avx-vcvttpd2dq-256-1.c: Likewise.
+ * gcc.target/i386/avx-vcvttps2dq-1.c: Likewise.
+ * gcc.target/i386/avx-vcvttps2dq-256-1.c: Likewise.
+ * gcc.target/i386/avx-vcvttsd2si-1.c: Likewise.
+ * gcc.target/i386/avx-vcvttsd2si-2.c: Likewise.
+ * gcc.target/i386/avx-vcvttss2si-1.c: Likewise.
+ * gcc.target/i386/avx-vcvttss2si-2.c: Likewise.
+ * gcc.target/i386/avx-vdivpd-1.c: Likewise.
+ * gcc.target/i386/avx-vdivpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vdivps-1.c: Likewise.
+ * gcc.target/i386/avx-vdivps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vdivsd-1.c: Likewise.
+ * gcc.target/i386/avx-vdivss-1.c: Likewise.
+ * gcc.target/i386/avx-vdppd-1.c: Likewise.
+ * gcc.target/i386/avx-vdppd-2.c: Likewise.
+ * gcc.target/i386/avx-vdpps-1.c: Likewise.
+ * gcc.target/i386/avx-vdpps-2.c: Likewise.
+ * gcc.target/i386/avx-vextractf128-256-1.c: Likewise.
+ * gcc.target/i386/avx-vextractf128-256-2.c: Likewise.
+ * gcc.target/i386/avx-vextractps-1.c: Likewise.
+ * gcc.target/i386/avx-vhaddpd-1.c: Likewise.
+ * gcc.target/i386/avx-vhaddpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vhaddps-1.c: Likewise.
+ * gcc.target/i386/avx-vhaddps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vhsubpd-1.c: Likewise.
+ * gcc.target/i386/avx-vhsubpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vhsubps-1.c: Likewise.
+ * gcc.target/i386/avx-vhsubps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vinsertf128-256-1.c: Likewise.
+ * gcc.target/i386/avx-vinsertf128-256-2.c: Likewise.
+ * gcc.target/i386/avx-vinsertf128-256-3.c: Likewise.
+ * gcc.target/i386/avx-vinsertps-1.c: Likewise.
+ * gcc.target/i386/avx-vinsertps-2.c: Likewise.
+ * gcc.target/i386/avx-vlddqu-1.c: Likewise.
+ * gcc.target/i386/avx-vlddqu-256-1.c: Likewise.
+ * gcc.target/i386/avx-vmaskmovpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vmaskmovpd-256-2.c: Likewise.
+ * gcc.target/i386/avx-vmaskmovps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vmaskmovps-256-2.c: Likewise.
+ * gcc.target/i386/avx-vmaxpd-1.c: Likewise.
+ * gcc.target/i386/avx-vmaxpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vmaxps-1.c: Likewise.
+ * gcc.target/i386/avx-vmaxps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vmaxsd-1.c: Likewise.
+ * gcc.target/i386/avx-vmaxss-1.c: Likewise.
+ * gcc.target/i386/avx-vminpd-1.c: Likewise.
+ * gcc.target/i386/avx-vminpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vminps-1.c: Likewise.
+ * gcc.target/i386/avx-vminps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vminsd-1.c: Likewise.
+ * gcc.target/i386/avx-vminss-1.c: Likewise.
+ * gcc.target/i386/avx-vmovapd-1.c: Likewise.
+ * gcc.target/i386/avx-vmovapd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vmovapd-256-2.c: Likewise.
+ * gcc.target/i386/avx-vmovapd-2.c: Likewise.
+ * gcc.target/i386/avx-vmovaps-1.c: Likewise.
+ * gcc.target/i386/avx-vmovaps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vmovaps-256-2.c: Likewise.
+ * gcc.target/i386/avx-vmovaps-2.c: Likewise.
+ * gcc.target/i386/avx-vmovd-1.c: Likewise.
+ * gcc.target/i386/avx-vmovd-2.c: Likewise.
+ * gcc.target/i386/avx-vmovddup-1.c: Likewise.
+ * gcc.target/i386/avx-vmovddup-256-1.c: Likewise.
+ * gcc.target/i386/avx-vmovdqa-1.c: Likewise.
+ * gcc.target/i386/avx-vmovdqa-256-1.c: Likewise.
+ * gcc.target/i386/avx-vmovdqa-256-2.c: Likewise.
+ * gcc.target/i386/avx-vmovdqa-2.c: Likewise.
+ * gcc.target/i386/avx-vmovdqu-1.c: Likewise.
+ * gcc.target/i386/avx-vmovdqu-256-1.c: Likewise.
+ * gcc.target/i386/avx-vmovdqu-256-2.c: Likewise.
+ * gcc.target/i386/avx-vmovdqu-2.c: Likewise.
+ * gcc.target/i386/avx-vmovhlps-1.c: Likewise.
+ * gcc.target/i386/avx-vmovhpd-1.c: Likewise.
+ * gcc.target/i386/avx-vmovhpd-2.c: Likewise.
+ * gcc.target/i386/avx-vmovhps-1.c: Likewise.
+ * gcc.target/i386/avx-vmovhps-2.c: Likewise.
+ * gcc.target/i386/avx-vmovlhps-1.c: Likewise.
+ * gcc.target/i386/avx-vmovlpd-1.c: Likewise.
+ * gcc.target/i386/avx-vmovlpd-2.c: Likewise.
+ * gcc.target/i386/avx-vmovmskpd-1.c: Likewise.
+ * gcc.target/i386/avx-vmovmskpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vmovmskps-1.c: Likewise.
+ * gcc.target/i386/avx-vmovmskps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vmovntdq-1.c: Likewise.
+ * gcc.target/i386/avx-vmovntdqa-1.c: Likewise.
+ * gcc.target/i386/avx-vmovntpd-1.c: Likewise.
+ * gcc.target/i386/avx-vmovntps-1.c: Likewise.
+ * gcc.target/i386/avx-vmovq-1.c: Likewise.
+ * gcc.target/i386/avx-vmovq-2.c: Likewise.
+ * gcc.target/i386/avx-vmovq-3.c: Likewise.
+ * gcc.target/i386/avx-vmovsd-1.c: Likewise.
+ * gcc.target/i386/avx-vmovsd-2.c: Likewise.
+ * gcc.target/i386/avx-vmovshdup-1.c: Likewise.
+ * gcc.target/i386/avx-vmovshdup-256-1.c: Likewise.
+ * gcc.target/i386/avx-vmovsldup-1.c: Likewise.
+ * gcc.target/i386/avx-vmovsldup-256-1.c: Likewise.
+ * gcc.target/i386/avx-vmovss-1.c: Likewise.
+ * gcc.target/i386/avx-vmovss-2.c: Likewise.
+ * gcc.target/i386/avx-vmovss-3.c: Likewise.
+ * gcc.target/i386/avx-vmovupd-1.c: Likewise.
+ * gcc.target/i386/avx-vmovupd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vmovupd-256-2.c: Likewise.
+ * gcc.target/i386/avx-vmovupd-2.c: Likewise.
+ * gcc.target/i386/avx-vmovups-1.c: Likewise.
+ * gcc.target/i386/avx-vmovups-256-1.c: Likewise.
+ * gcc.target/i386/avx-vmovups-256-2.c: Likewise.
+ * gcc.target/i386/avx-vmovups-2.c: Likewise.
+ * gcc.target/i386/avx-vmpsadbw-1.c: Likewise.
+ * gcc.target/i386/avx-vmulpd-1.c: Likewise.
+ * gcc.target/i386/avx-vmulpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vmulps-1.c: Likewise.
+ * gcc.target/i386/avx-vmulps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vmulsd-1.c: Likewise.
+ * gcc.target/i386/avx-vmulss-1.c: Likewise.
+ * gcc.target/i386/avx-vorpd-1.c: Likewise.
+ * gcc.target/i386/avx-vorpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vorps-1.c: Likewise.
+ * gcc.target/i386/avx-vorps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vpabsb-1.c: Likewise.
+ * gcc.target/i386/avx-vpabsd-1.c: Likewise.
+ * gcc.target/i386/avx-vpabsw-1.c: Likewise.
+ * gcc.target/i386/avx-vpackssdw-1.c: Likewise.
+ * gcc.target/i386/avx-vpacksswb-1.c: Likewise.
+ * gcc.target/i386/avx-vpackusdw-1.c: Likewise.
+ * gcc.target/i386/avx-vpackuswb-1.c: Likewise.
+ * gcc.target/i386/avx-vpaddb-1.c: Likewise.
+ * gcc.target/i386/avx-vpaddd-1.c: Likewise.
+ * gcc.target/i386/avx-vpaddq-1.c: Likewise.
+ * gcc.target/i386/avx-vpaddsb-1.c: Likewise.
+ * gcc.target/i386/avx-vpaddsw-1.c: Likewise.
+ * gcc.target/i386/avx-vpaddusb-1.c: Likewise.
+ * gcc.target/i386/avx-vpaddusw-1.c: Likewise.
+ * gcc.target/i386/avx-vpaddw-1.c: Likewise.
+ * gcc.target/i386/avx-vpalignr-1.c: Likewise.
+ * gcc.target/i386/avx-vpand-1.c: Likewise.
+ * gcc.target/i386/avx-vpandn-1.c: Likewise.
+ * gcc.target/i386/avx-vpavgb-1.c: Likewise.
+ * gcc.target/i386/avx-vpavgw-1.c: Likewise.
+ * gcc.target/i386/avx-vpblendvb-1.c: Likewise.
+ * gcc.target/i386/avx-vpblendw-1.c: Likewise.
+ * gcc.target/i386/avx-vpcmpeqb-1.c: Likewise.
+ * gcc.target/i386/avx-vpcmpeqd-1.c: Likewise.
+ * gcc.target/i386/avx-vpcmpeqq-1.c: Likewise.
+ * gcc.target/i386/avx-vpcmpeqw-1.c: Likewise.
+ * gcc.target/i386/avx-vpcmpestri-1.c: Likewise.
+ * gcc.target/i386/avx-vpcmpestri-2.c: Likewise.
+ * gcc.target/i386/avx-vpcmpestrm-1.c: Likewise.
+ * gcc.target/i386/avx-vpcmpestrm-2.c: Likewise.
+ * gcc.target/i386/avx-vpcmpgtb-1.c: Likewise.
+ * gcc.target/i386/avx-vpcmpgtd-1.c: Likewise.
+ * gcc.target/i386/avx-vpcmpgtq-1.c: Likewise.
+ * gcc.target/i386/avx-vpcmpgtw-1.c: Likewise.
+ * gcc.target/i386/avx-vpcmpistri-1.c: Likewise.
+ * gcc.target/i386/avx-vpcmpistri-2.c: Likewise.
+ * gcc.target/i386/avx-vpcmpistrm-1.c: Likewise.
+ * gcc.target/i386/avx-vpcmpistrm-2.c: Likewise.
+ * gcc.target/i386/avx-vperm2f128-256-1.c: Likewise.
+ * gcc.target/i386/avx-vperm2f128-256-2.c: Likewise.
+ * gcc.target/i386/avx-vperm2f128-256-3.c: Likewise.
+ * gcc.target/i386/avx-vpermil2pd-1.c: Likewise.
+ * gcc.target/i386/avx-vpermil2pd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vpermil2ps-1.c: Likewise.
+ * gcc.target/i386/avx-vpermil2ps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vpermilpd-1.c: Likewise.
+ * gcc.target/i386/avx-vpermilpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vpermilpd-256-2.c: Likewise.
+ * gcc.target/i386/avx-vpermilpd-2.c: Likewise.
+ * gcc.target/i386/avx-vpermilps-1.c: Likewise.
+ * gcc.target/i386/avx-vpermilps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vpermilps-256-2.c: Likewise.
+ * gcc.target/i386/avx-vpermilps-2.c: Likewise.
+ * gcc.target/i386/avx-vpextrb-1.c: Likewise.
+ * gcc.target/i386/avx-vpextrd-1.c: Likewise.
+ * gcc.target/i386/avx-vpextrq-1.c: Likewise.
+ * gcc.target/i386/avx-vpextrw-1.c: Likewise.
+ * gcc.target/i386/avx-vphaddd-1.c: Likewise.
+ * gcc.target/i386/avx-vphaddsw-1.c: Likewise.
+ * gcc.target/i386/avx-vphaddw-1.c: Likewise.
+ * gcc.target/i386/avx-vphminposuw-1.c: Likewise.
+ * gcc.target/i386/avx-vphsubd-1.c: Likewise.
+ * gcc.target/i386/avx-vphsubsw-1.c: Likewise.
+ * gcc.target/i386/avx-vphsubw-1.c: Likewise.
+ * gcc.target/i386/avx-vpinsrb-1.c: Likewise.
+ * gcc.target/i386/avx-vpinsrd-1.c: Likewise.
+ * gcc.target/i386/avx-vpinsrq-1.c: Likewise.
+ * gcc.target/i386/avx-vpmaddubsw-1.c: Likewise.
+ * gcc.target/i386/avx-vpmaxsb-1.c: Likewise.
+ * gcc.target/i386/avx-vpmaxsd-1.c: Likewise.
+ * gcc.target/i386/avx-vpmaxsw-1.c: Likewise.
+ * gcc.target/i386/avx-vpmaxub-1.c: Likewise.
+ * gcc.target/i386/avx-vpmaxud-1.c: Likewise.
+ * gcc.target/i386/avx-vpmaxuw-1.c: Likewise.
+ * gcc.target/i386/avx-vpminsb-1.c: Likewise.
+ * gcc.target/i386/avx-vpminsd-1.c: Likewise.
+ * gcc.target/i386/avx-vpminsw-1.c: Likewise.
+ * gcc.target/i386/avx-vpminub-1.c: Likewise.
+ * gcc.target/i386/avx-vpminud-1.c: Likewise.
+ * gcc.target/i386/avx-vpminuw-1.c: Likewise.
+ * gcc.target/i386/avx-vpmovmskb-1.c: Likewise.
+ * gcc.target/i386/avx-vpmovsxbd-1.c: Likewise.
+ * gcc.target/i386/avx-vpmovsxbq-1.c: Likewise.
+ * gcc.target/i386/avx-vpmovsxbw-1.c: Likewise.
+ * gcc.target/i386/avx-vpmovsxdq-1.c: Likewise.
+ * gcc.target/i386/avx-vpmovsxwd-1.c: Likewise.
+ * gcc.target/i386/avx-vpmovsxwq-1.c: Likewise.
+ * gcc.target/i386/avx-vpmovzxbd-1.c: Likewise.
+ * gcc.target/i386/avx-vpmovzxbq-1.c: Likewise.
+ * gcc.target/i386/avx-vpmovzxbw-1.c: Likewise.
+ * gcc.target/i386/avx-vpmovzxdq-1.c: Likewise.
+ * gcc.target/i386/avx-vpmovzxwd-1.c: Likewise.
+ * gcc.target/i386/avx-vpmovzxwq-1.c: Likewise.
+ * gcc.target/i386/avx-vpmuldq-1.c: Likewise.
+ * gcc.target/i386/avx-vpmulhrsw-1.c: Likewise.
+ * gcc.target/i386/avx-vpmulhuw-1.c: Likewise.
+ * gcc.target/i386/avx-vpmulhw-1.c: Likewise.
+ * gcc.target/i386/avx-vpmulld-1.c: Likewise.
+ * gcc.target/i386/avx-vpmullw-1.c: Likewise.
+ * gcc.target/i386/avx-vpmuludq-1.c: Likewise.
+ * gcc.target/i386/avx-vpor-1.c: Likewise.
+ * gcc.target/i386/avx-vpsadbw-1.c: Likewise.
+ * gcc.target/i386/avx-vpshufb-1.c: Likewise.
+ * gcc.target/i386/avx-vpshufd-1.c: Likewise.
+ * gcc.target/i386/avx-vpshufhw-1.c: Likewise.
+ * gcc.target/i386/avx-vpshuflw-1.c: Likewise.
+ * gcc.target/i386/avx-vpsignb-1.c: Likewise.
+ * gcc.target/i386/avx-vpsignd-1.c: Likewise.
+ * gcc.target/i386/avx-vpsignw-1.c: Likewise.
+ * gcc.target/i386/avx-vpslld-1.c: Likewise.
+ * gcc.target/i386/avx-vpslld-2.c: Likewise.
+ * gcc.target/i386/avx-vpslldq-1.c: Likewise.
+ * gcc.target/i386/avx-vpsllq-1.c: Likewise.
+ * gcc.target/i386/avx-vpsllq-2.c: Likewise.
+ * gcc.target/i386/avx-vpsllw-1.c: Likewise.
+ * gcc.target/i386/avx-vpsllw-2.c: Likewise.
+ * gcc.target/i386/avx-vpsrad-1.c: Likewise.
+ * gcc.target/i386/avx-vpsrad-2.c: Likewise.
+ * gcc.target/i386/avx-vpsraw-1.c: Likewise.
+ * gcc.target/i386/avx-vpsraw-2.c: Likewise.
+ * gcc.target/i386/avx-vpsrld-1.c: Likewise.
+ * gcc.target/i386/avx-vpsrld-2.c: Likewise.
+ * gcc.target/i386/avx-vpsrldq-1.c: Likewise.
+ * gcc.target/i386/avx-vpsrlq-1.c: Likewise.
+ * gcc.target/i386/avx-vpsrlq-2.c: Likewise.
+ * gcc.target/i386/avx-vpsrlw-1.c: Likewise.
+ * gcc.target/i386/avx-vpsrlw-2.c: Likewise.
+ * gcc.target/i386/avx-vpsubb-1.c: Likewise.
+ * gcc.target/i386/avx-vpsubd-1.c: Likewise.
+ * gcc.target/i386/avx-vpsubq-1.c: Likewise.
+ * gcc.target/i386/avx-vpsubsb-1.c: Likewise.
+ * gcc.target/i386/avx-vpsubsw-1.c: Likewise.
+ * gcc.target/i386/avx-vpsubw-1.c: Likewise.
+ * gcc.target/i386/avx-vptest-1.c: Likewise.
+ * gcc.target/i386/avx-vptest-256-1.c: Likewise.
+ * gcc.target/i386/avx-vptest-256-2.c: Likewise.
+ * gcc.target/i386/avx-vptest-256-3.c: Likewise.
+ * gcc.target/i386/avx-vptest-2.c: Likewise.
+ * gcc.target/i386/avx-vptest-3.c: Likewise.
+ * gcc.target/i386/avx-vpunpckhbw-1.c: Likewise.
+ * gcc.target/i386/avx-vpunpckhdq-1.c: Likewise.
+ * gcc.target/i386/avx-vpunpckhqdq-1.c: Likewise.
+ * gcc.target/i386/avx-vpunpckhwd-1.c: Likewise.
+ * gcc.target/i386/avx-vpunpcklbw-1.c: Likewise.
+ * gcc.target/i386/avx-vpunpckldq-1.c: Likewise.
+ * gcc.target/i386/avx-vpunpcklqdq-1.c: Likewise.
+ * gcc.target/i386/avx-vpunpcklwd-1.c: Likewise.
+ * gcc.target/i386/avx-vpxor-1.c: Likewise.
+ * gcc.target/i386/avx-vrcpps-1.c: Likewise.
+ * gcc.target/i386/avx-vrcpps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vroundpd-1.c: Likewise.
+ * gcc.target/i386/avx-vroundpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vroundpd-256-2.c: Likewise.
+ * gcc.target/i386/avx-vroundpd-256-3.c: Likewise.
+ * gcc.target/i386/avx-vroundpd-2.c: Likewise.
+ * gcc.target/i386/avx-vroundpd-3.c: Likewise.
+ * gcc.target/i386/avx-vroundps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vrsqrtps-1.c: Likewise.
+ * gcc.target/i386/avx-vrsqrtps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vshufpd-1.c: Likewise.
+ * gcc.target/i386/avx-vshufpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vshufps-1.c: Likewise.
+ * gcc.target/i386/avx-vshufps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vsqrtpd-1.c: Likewise.
+ * gcc.target/i386/avx-vsqrtpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vsqrtps-1.c: Likewise.
+ * gcc.target/i386/avx-vsqrtps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vsubpd-1.c: Likewise.
+ * gcc.target/i386/avx-vsubpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vsubps-1.c: Likewise.
+ * gcc.target/i386/avx-vsubps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vsubsd-1.c: Likewise.
+ * gcc.target/i386/avx-vsubss-1.c: Likewise.
+ * gcc.target/i386/avx-vtestpd-1.c: Likewise.
+ * gcc.target/i386/avx-vtestpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vtestpd-256-2.c: Likewise.
+ * gcc.target/i386/avx-vtestpd-256-3.c: Likewise.
+ * gcc.target/i386/avx-vtestpd-2.c: Likewise.
+ * gcc.target/i386/avx-vtestpd-3.c: Likewise.
+ * gcc.target/i386/avx-vtestps-1.c: Likewise.
+ * gcc.target/i386/avx-vtestps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vtestps-256-2.c: Likewise.
+ * gcc.target/i386/avx-vtestps-256-3.c: Likewise.
+ * gcc.target/i386/avx-vtestps-2.c: Likewise.
+ * gcc.target/i386/avx-vtestps-3.c: Likewise.
+ * gcc.target/i386/avx-vucomisd-1.c: Likewise.
+ * gcc.target/i386/avx-vucomisd-2.c: Likewise.
+ * gcc.target/i386/avx-vucomisd-3.c: Likewise.
+ * gcc.target/i386/avx-vucomisd-4.c: Likewise.
+ * gcc.target/i386/avx-vucomisd-5.c: Likewise.
+ * gcc.target/i386/avx-vucomisd-6.c: Likewise.
+ * gcc.target/i386/avx-vucomiss-1.c: Likewise.
+ * gcc.target/i386/avx-vucomiss-2.c: Likewise.
+ * gcc.target/i386/avx-vucomiss-3.c: Likewise.
+ * gcc.target/i386/avx-vucomiss-4.c: Likewise.
+ * gcc.target/i386/avx-vucomiss-5.c: Likewise.
+ * gcc.target/i386/avx-vucomiss-6.c: Likewise.
+ * gcc.target/i386/avx-vunpckhpd-1.c: Likewise.
+ * gcc.target/i386/avx-vunpckhpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vunpckhps-1.c: Likewise.
+ * gcc.target/i386/avx-vunpckhps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vunpcklpd-1.c: Likewise.
+ * gcc.target/i386/avx-vunpcklpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vunpcklps-1.c: Likewise.
+ * gcc.target/i386/avx-vunpcklps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vxorpd-1.c: Likewise.
+ * gcc.target/i386/avx-vxorpd-256-1.c: Likewise.
+ * gcc.target/i386/avx-vxorps-1.c: Likewise.
+ * gcc.target/i386/avx-vxorps-256-1.c: Likewise.
+ * gcc.target/i386/avx-vzeroall-1.c: Likewise.
+ * gcc.target/i386/avx-vzeroall-2.c: Likewise.
+ * gcc.target/i386/avx-vzeroupper-1.c: Likewise.
+ * gcc.target/i386/avx-vzeroupper-2.c: Likewise.
+ * gcc.target/i386/m256-1.c: Likewise.
+ * gcc.target/i386/m256-2.c: Likewise.
+ * gcc.target/i386/m256-check.h: Likewise.
+ * gcc.target/i386/sse2-addpd-1.c: Likewise.
+ * gcc.target/i386/sse2-addsd-1.c: Likewise.
+ * gcc.target/i386/sse2-andnpd-1.c: Likewise.
+ * gcc.target/i386/sse2-andpd-1.c: Likewise.
+ * gcc.target/i386/sse2-comisd-1.c: Likewise.
+ * gcc.target/i386/sse2-comisd-2.c: Likewise.
+ * gcc.target/i386/sse2-comisd-3.c: Likewise.
+ * gcc.target/i386/sse2-comisd-4.c: Likewise.
+ * gcc.target/i386/sse2-comisd-5.c: Likewise.
+ * gcc.target/i386/sse2-comisd-6.c: Likewise.
+ * gcc.target/i386/sse2-cvtdq2pd-1.c: Likewise.
+ * gcc.target/i386/sse2-cvtdq2ps-1.c: Likewise.
+ * gcc.target/i386/sse2-cvtpd2dq-1.c: Likewise.
+ * gcc.target/i386/sse2-cvtpd2ps-1.c: Likewise.
+ * gcc.target/i386/sse2-cvtps2dq-1.c: Likewise.
+ * gcc.target/i386/sse2-cvtps2pd-1.c: Likewise.
+ * gcc.target/i386/sse2-cvtsd2si-1.c: Likewise.
+ * gcc.target/i386/sse2-cvtsd2si-2.c: Likewise.
+ * gcc.target/i386/sse2-cvtsd2ss-1.c: Likewise.
+ * gcc.target/i386/sse2-cvtsi2sd-1.c: Likewise.
+ * gcc.target/i386/sse2-cvtsi2sd-2.c: Likewise.
+ * gcc.target/i386/sse2-cvtss2sd-1.c: Likewise.
+ * gcc.target/i386/sse2-cvttpd2dq-1.c: Likewise.
+ * gcc.target/i386/sse2-cvttps2dq-1.c: Likewise.
+ * gcc.target/i386/sse2-cvttsd2si-1.c: Likewise.
+ * gcc.target/i386/sse2-cvttsd2si-2.c: Likewise.
+ * gcc.target/i386/sse2-divpd-1.c: Likewise.
+ * gcc.target/i386/sse2-divsd-1.c: Likewise.
+ * gcc.target/i386/sse2-maxpd-1.c: Likewise.
+ * gcc.target/i386/sse2-maxsd-1.c: Likewise.
+ * gcc.target/i386/sse2-minpd-1.c: Likewise.
+ * gcc.target/i386/sse2-minsd-1.c: Likewise.
+ * gcc.target/i386/sse2-movapd-1.c: Likewise.
+ * gcc.target/i386/sse2-movapd-2.c: Likewise.
+ * gcc.target/i386/sse2-movd-1.c: Likewise.
+ * gcc.target/i386/sse2-movd-2.c: Likewise.
+ * gcc.target/i386/sse2-movdqa-1.c: Likewise.
+ * gcc.target/i386/sse2-movdqa-2.c: Likewise.
+ * gcc.target/i386/sse2-movdqu-1.c: Likewise.
+ * gcc.target/i386/sse2-movdqu-2.c: Likewise.
+ * gcc.target/i386/sse2-movhpd-1.c: Likewise.
+ * gcc.target/i386/sse2-movhpd-2.c: Likewise.
+ * gcc.target/i386/sse2-movlpd-1.c: Likewise.
+ * gcc.target/i386/sse2-movlpd-2.c: Likewise.
+ * gcc.target/i386/sse2-movmskpd-1.c: Likewise.
+ * gcc.target/i386/sse2-movntdq-1.c: Likewise.
+ * gcc.target/i386/sse2-movntpd-1.c: Likewise.
+ * gcc.target/i386/sse2-movq-1.c: Likewise.
+ * gcc.target/i386/sse2-movq-2.c: Likewise.
+ * gcc.target/i386/sse2-movq-3.c: Likewise.
+ * gcc.target/i386/sse2-movsd-1.c: Likewise.
+ * gcc.target/i386/sse2-movsd-2.c: Likewise.
+ * gcc.target/i386/sse2-movupd-1.c: Likewise.
+ * gcc.target/i386/sse2-movupd-2.c: Likewise.
+ * gcc.target/i386/sse2-mulpd-1.c: Likewise.
+ * gcc.target/i386/sse2-mulsd-1.c: Likewise.
+ * gcc.target/i386/sse2-orpd-1.c: Likewise.
+ * gcc.target/i386/sse2-packssdw-1.c: Likewise.
+ * gcc.target/i386/sse2-packsswb-1.c: Likewise.
+ * gcc.target/i386/sse2-packuswb-1.c: Likewise.
+ * gcc.target/i386/sse2-paddb-1.c: Likewise.
+ * gcc.target/i386/sse2-paddd-1.c: Likewise.
+ * gcc.target/i386/sse2-paddq-1.c: Likewise.
+ * gcc.target/i386/sse2-paddsb-1.c: Likewise.
+ * gcc.target/i386/sse2-paddsw-1.c: Likewise.
+ * gcc.target/i386/sse2-paddusb-1.c: Likewise.
+ * gcc.target/i386/sse2-paddusw-1.c: Likewise.
+ * gcc.target/i386/sse2-paddw-1.c: Likewise.
+ * gcc.target/i386/sse2-pand-1.c: Likewise.
+ * gcc.target/i386/sse2-pandn-1.c: Likewise.
+ * gcc.target/i386/sse2-pavgb-1.c: Likewise.
+ * gcc.target/i386/sse2-pavgw-1.c: Likewise.
+ * gcc.target/i386/sse2-pcmpeqb-1.c: Likewise.
+ * gcc.target/i386/sse2-pcmpeqd-1.c: Likewise.
+ * gcc.target/i386/sse2-pcmpeqw-1.c: Likewise.
+ * gcc.target/i386/sse2-pcmpgtb-1.c: Likewise.
+ * gcc.target/i386/sse2-pcmpgtd-1.c: Likewise.
+ * gcc.target/i386/sse2-pcmpgtw-1.c: Likewise.
+ * gcc.target/i386/sse2-pmaddwd-1.c: Likewise.
+ * gcc.target/i386/sse2-pmaxsw-1.c: Likewise.
+ * gcc.target/i386/sse2-pmaxub-1.c: Likewise.
+ * gcc.target/i386/sse2-pminsw-1.c: Likewise.
+ * gcc.target/i386/sse2-pminub-1.c: Likewise.
+ * gcc.target/i386/sse2-pmovmskb-1.c: Likewise.
+ * gcc.target/i386/sse2-pmulhuw-1.c: Likewise.
+ * gcc.target/i386/sse2-pmulhw-1.c: Likewise.
+ * gcc.target/i386/sse2-pmullw-1.c: Likewise.
+ * gcc.target/i386/sse2-pmuludq-1.c: Likewise.
+ * gcc.target/i386/sse2-por-1.c: Likewise.
+ * gcc.target/i386/sse2-psadbw-1.c: Likewise.
+ * gcc.target/i386/sse2-pshufd-1.c: Likewise.
+ * gcc.target/i386/sse2-pshufhw-1.c: Likewise.
+ * gcc.target/i386/sse2-pshuflw-1.c: Likewise.
+ * gcc.target/i386/sse2-pslld-1.c: Likewise.
+ * gcc.target/i386/sse2-pslld-2.c: Likewise.
+ * gcc.target/i386/sse2-pslldq-1.c: Likewise.
+ * gcc.target/i386/sse2-psllq-1.c: Likewise.
+ * gcc.target/i386/sse2-psllq-2.c: Likewise.
+ * gcc.target/i386/sse2-psllw-1.c: Likewise.
+ * gcc.target/i386/sse2-psllw-2.c: Likewise.
+ * gcc.target/i386/sse2-psrad-1.c: Likewise.
+ * gcc.target/i386/sse2-psrad-2.c: Likewise.
+ * gcc.target/i386/sse2-psraw-1.c: Likewise.
+ * gcc.target/i386/sse2-psraw-2.c: Likewise.
+ * gcc.target/i386/sse2-psrld-1.c: Likewise.
+ * gcc.target/i386/sse2-psrld-2.c: Likewise.
+ * gcc.target/i386/sse2-psrldq-1.c: Likewise.
+ * gcc.target/i386/sse2-psrlq-1.c: Likewise.
+ * gcc.target/i386/sse2-psrlq-2.c: Likewise.
+ * gcc.target/i386/sse2-psrlw-1.c: Likewise.
+ * gcc.target/i386/sse2-psrlw-2.c: Likewise.
+ * gcc.target/i386/sse2-psubb-1.c: Likewise.
+ * gcc.target/i386/sse2-psubd-1.c: Likewise.
+ * gcc.target/i386/sse2-psubq-1.c: Likewise.
+ * gcc.target/i386/sse2-psubsb-1.c: Likewise.
+ * gcc.target/i386/sse2-psubsw-1.c: Likewise.
+ * gcc.target/i386/sse2-psubw-1.c: Likewise.
+ * gcc.target/i386/sse2-punpckhbw-1.c: Likewise.
+ * gcc.target/i386/sse2-punpckhdq-1.c: Likewise.
+ * gcc.target/i386/sse2-punpckhqdq-1.c: Likewise.
+ * gcc.target/i386/sse2-punpckhwd-1.c: Likewise.
+ * gcc.target/i386/sse2-punpcklbw-1.c: Likewise.
+ * gcc.target/i386/sse2-punpckldq-1.c: Likewise.
+ * gcc.target/i386/sse2-punpcklqdq-1.c: Likewise.
+ * gcc.target/i386/sse2-punpcklwd-1.c: Likewise.
+ * gcc.target/i386/sse2-pxor-1.c: Likewise.
+ * gcc.target/i386/sse2-shufpd-1.c: Likewise.
+ * gcc.target/i386/sse2-shufps-1.c: Likewise.
+ * gcc.target/i386/sse2-sqrtpd-1.c: Likewise.
+ * gcc.target/i386/sse2-subpd-1.c: Likewise.
+ * gcc.target/i386/sse2-subsd-1.c: Likewise.
+ * gcc.target/i386/sse2-ucomisd-1.c: Likewise.
+ * gcc.target/i386/sse2-ucomisd-2.c: Likewise.
+ * gcc.target/i386/sse2-ucomisd-3.c: Likewise.
+ * gcc.target/i386/sse2-ucomisd-4.c: Likewise.
+ * gcc.target/i386/sse2-ucomisd-5.c: Likewise.
+ * gcc.target/i386/sse2-ucomisd-6.c: Likewise.
+ * gcc.target/i386/sse2-unpckhpd-1.c: Likewise.
+ * gcc.target/i386/sse2-unpcklpd-1.c: Likewise.
+ * gcc.target/i386/sse2-xorpd-1.c: Likewise.
+ * gcc.target/i386/sse-addps-1.c: Likewise.
+ * gcc.target/i386/sse-addss-1.c: Likewise.
+ * gcc.target/i386/sse-andnps-1.c: Likewise.
+ * gcc.target/i386/sse-andps-1.c: Likewise.
+ * gcc.target/i386/sse-comiss-1.c: Likewise.
+ * gcc.target/i386/sse-comiss-2.c: Likewise.
+ * gcc.target/i386/sse-comiss-3.c: Likewise.
+ * gcc.target/i386/sse-comiss-4.c: Likewise.
+ * gcc.target/i386/sse-comiss-5.c: Likewise.
+ * gcc.target/i386/sse-comiss-6.c: Likewise.
+ * gcc.target/i386/sse-cvtsi2ss-1.c: Likewise.
+ * gcc.target/i386/sse-cvtsi2ss-2.c: Likewise.
+ * gcc.target/i386/sse-cvtss2si-1.c: Likewise.
+ * gcc.target/i386/sse-cvtss2si-2.c: Likewise.
+ * gcc.target/i386/sse-cvttss2si-1.c: Likewise.
+ * gcc.target/i386/sse-cvttss2si-2.c: Likewise.
+ * gcc.target/i386/sse-divps-1.c: Likewise.
+ * gcc.target/i386/sse-divss-1.c: Likewise.
+ * gcc.target/i386/sse-maxps-1.c: Likewise.
+ * gcc.target/i386/sse-maxss-1.c: Likewise.
+ * gcc.target/i386/sse-minps-1.c: Likewise.
+ * gcc.target/i386/sse-minss-1.c: Likewise.
+ * gcc.target/i386/sse-movaps-1.c: Likewise.
+ * gcc.target/i386/sse-movaps-2.c: Likewise.
+ * gcc.target/i386/sse-movhlps-1.c: Likewise.
+ * gcc.target/i386/sse-movhps-1.c: Likewise.
+ * gcc.target/i386/sse-movhps-2.c: Likewise.
+ * gcc.target/i386/sse-movlhps-1.c: Likewise.
+ * gcc.target/i386/sse-movmskps-1.c: Likewise.
+ * gcc.target/i386/sse-movntps-1.c: Likewise.
+ * gcc.target/i386/sse-movss-1.c: Likewise.
+ * gcc.target/i386/sse-movss-2.c: Likewise.
+ * gcc.target/i386/sse-movss-3.c: Likewise.
+ * gcc.target/i386/sse-movups-1.c: Likewise.
+ * gcc.target/i386/sse-movups-2.c: Likewise.
+ * gcc.target/i386/sse-mulps-1.c: Likewise.
+ * gcc.target/i386/sse-mulss-1.c: Likewise.
+ * gcc.target/i386/sse-orps-1.c: Likewise.
+ * gcc.target/i386/sse-rcpps-1.c: Likewise.
+ * gcc.target/i386/sse-rsqrtps-1.c: Likewise.
+ * gcc.target/i386/sse-sqrtps-1.c: Likewise.
+ * gcc.target/i386/sse-subps-1.c: Likewise.
+ * gcc.target/i386/sse-subss-1.c: Likewise.
+ * gcc.target/i386/sse-ucomiss-1.c: Likewise.
+ * gcc.target/i386/sse-ucomiss-2.c: Likewise.
+ * gcc.target/i386/sse-ucomiss-3.c: Likewise.
+ * gcc.target/i386/sse-ucomiss-4.c: Likewise.
+ * gcc.target/i386/sse-ucomiss-5.c: Likewise.
+ * gcc.target/i386/sse-ucomiss-6.c: Likewise.
+ * gcc.target/i386/sse-unpckhps-1.c: Likewise.
+ * gcc.target/i386/sse-unpcklps-1.c: Likewise.
+ * gcc.target/i386/sse-xorps-1.c: Likewise.
+ * gcc.target/i386/vararg-10.c: Likewise.
+ * gcc.target/i386/vararg-3.c: Likewise.
+ * gcc.target/i386/vararg-4.c: Likewise.
+ * gcc.target/i386/vararg-5.c: Likewise.
+ * gcc.target/i386/vararg-6.c: Likewise.
+ * gcc.target/i386/vararg-7.c: Likewise.
+ * gcc.target/i386/vararg-8.c: Likewise.
+ * gcc.target/i386/vararg-9.c: Likewise.
+ * g++.dg/other/i386-5.C: Likewise.
+ * g++.dg/other/i386-6.C: Likewise.
+
+ * gcc.target/i386/aesdec.c (CHECK_H): New.
+ (TEST): New.
+ Include CHECK_H instead of "XXX-check.h" and run TEST
+ instead of XXX_test.
+ * gcc.target/i386/aesdeclast.c: Likewise.
+ * gcc.target/i386/aesenc.c: Likewise.
+ * gcc.target/i386/aesenclast.c: Likewise.
+ * gcc.target/i386/aesimc.c: Likewise.
+ * gcc.target/i386/aeskeygenassist.c: Likewise.
+ * gcc.target/i386/sse3-addsubpd.c: Likewise.
+ * gcc.target/i386/sse3-addsubps.c: Likewise.
+ * gcc.target/i386/sse3-haddpd.c: Likewise.
+ * gcc.target/i386/sse3-haddps.c: Likewise.
+ * gcc.target/i386/sse3-hsubpd.c: Likewise.
+ * gcc.target/i386/sse3-hsubps.c: Likewise.
+ * gcc.target/i386/sse3-lddqu.c: Likewise.
+ * gcc.target/i386/sse3-movddup.c: Likewise.
+ * gcc.target/i386/sse3-movshdup.c: Likewise.
+ * gcc.target/i386/sse3-movsldup.c: Likewise.
+ * gcc.target/i386/sse4_1-blendpd.c: Likewise.
+ * gcc.target/i386/sse4_1-blendps.c: Likewise.
+ * gcc.target/i386/sse4_1-dppd-1.c: Likewise.
+ * gcc.target/i386/sse4_1-dppd-2.c: Likewise.
+ * gcc.target/i386/sse4_1-dpps-1.c: Likewise.
+ * gcc.target/i386/sse4_1-dpps-2.c: Likewise.
+ * gcc.target/i386/sse4_1-extractps.c: Likewise.
+ * gcc.target/i386/sse4_1-insertps-1.c: Likewise.
+ * gcc.target/i386/sse4_1-insertps-2.c: Likewise.
+ * gcc.target/i386/sse4_1-movntdqa.c: Likewise.
+ * gcc.target/i386/sse4_1-mpsadbw.c: Likewise.
+ * gcc.target/i386/sse4_1-packusdw.c: Likewise.
+ * gcc.target/i386/sse4_1-pblendvb.c: Likewise.
+ * gcc.target/i386/sse4_1-pblendw.c: Likewise.
+ * gcc.target/i386/sse4_1-pcmpeqq.c: Likewise.
+ * gcc.target/i386/sse4_1-pextrb.c: Likewise.
+ * gcc.target/i386/sse4_1-pextrd.c: Likewise.
+ * gcc.target/i386/sse4_1-pextrq.c: Likewise.
+ * gcc.target/i386/sse4_1-pextrw.c: Likewise.
+ * gcc.target/i386/sse4_1-phminposuw.c: Likewise.
+ * gcc.target/i386/sse4_1-pinsrb.c: Likewise.
+ * gcc.target/i386/sse4_1-pinsrd.c: Likewise.
+ * gcc.target/i386/sse4_1-pinsrq.c: Likewise.
+ * gcc.target/i386/sse4_1-pmaxsb.c: Likewise.
+ * gcc.target/i386/sse4_1-pmaxsd.c: Likewise.
+ * gcc.target/i386/sse4_1-pmaxud.c: Likewise.
+ * gcc.target/i386/sse4_1-pmaxuw.c: Likewise.
+ * gcc.target/i386/sse4_1-pminsb.c: Likewise.
+ * gcc.target/i386/sse4_1-pminsd.c: Likewise.
+ * gcc.target/i386/sse4_1-pminud.c: Likewise.
+ * gcc.target/i386/sse4_1-pminuw.c: Likewise.
+ * gcc.target/i386/sse4_1-pmovsxbd.c: Likewise.
+ * gcc.target/i386/sse4_1-pmovsxbq.c: Likewise.
+ * gcc.target/i386/sse4_1-pmovsxbw.c: Likewise.
+ * gcc.target/i386/sse4_1-pmovsxdq.c: Likewise.
+ * gcc.target/i386/sse4_1-pmovsxwd.c: Likewise.
+ * gcc.target/i386/sse4_1-pmovsxwq.c: Likewise.
+ * gcc.target/i386/sse4_1-pmovzxbd.c: Likewise.
+ * gcc.target/i386/sse4_1-pmovzxbq.c: Likewise.
+ * gcc.target/i386/sse4_1-pmovzxbw.c: Likewise.
+ * gcc.target/i386/sse4_1-pmovzxdq.c: Likewise.
+ * gcc.target/i386/sse4_1-pmovzxwd.c: Likewise.
+ * gcc.target/i386/sse4_1-pmovzxwq.c: Likewise.
+ * gcc.target/i386/sse4_1-pmuldq.c: Likewise.
+ * gcc.target/i386/sse4_1-pmulld.c: Likewise.
+ * gcc.target/i386/sse4_1-ptest-1.c: Likewise.
+ * gcc.target/i386/sse4_1-ptest-2.c: Likewise.
+ * gcc.target/i386/sse4_1-ptest-3.c: Likewise.
+ * gcc.target/i386/sse4_1-roundpd-1.c: Likewise.
+ * gcc.target/i386/sse4_1-roundpd-2.c: Likewise.
+ * gcc.target/i386/sse4_1-roundpd-3.c: Likewise.
+ * gcc.target/i386/sse4_2-pcmpestri-1.c: Likewise.
+ * gcc.target/i386/sse4_2-pcmpestri-2.c: Likewise.
+ * gcc.target/i386/sse4_2-pcmpestrm-1.c: Likewise.
+ * gcc.target/i386/sse4_2-pcmpestrm-2.c: Likewise.
+ * gcc.target/i386/sse4_2-pcmpgtq.c: Likewise.
+ * gcc.target/i386/sse4_2-pcmpistri-1.c: Likewise.
+ * gcc.target/i386/sse4_2-pcmpistri-2.c: Likewise.
+ * gcc.target/i386/sse4_2-pcmpistrm-1.c: Likewise.
+ * gcc.target/i386/sse4_2-pcmpistrm-2.c: Likewise.
+ * gcc.target/i386/ssse3-pabsb.c: Likewise. Don't run MMX
+ tests for AVX.
+ * gcc.target/i386/ssse3-pabsd.c: Likewise.
+ * gcc.target/i386/ssse3-pabsw.c: Likewise.
+ * gcc.target/i386/ssse3-palignr.c: Likewise.
+ * gcc.target/i386/ssse3-phaddd.c: Likewise.
+ * gcc.target/i386/ssse3-phaddsw.c: Likewise.
+ * gcc.target/i386/ssse3-phaddw.c: Likewise.
+ * gcc.target/i386/ssse3-phsubd.c: Likewise.
+ * gcc.target/i386/ssse3-phsubsw.c: Likewise.
+ * gcc.target/i386/ssse3-phsubw.c: Likewise.
+ * gcc.target/i386/ssse3-pmaddubsw.c: Likewise.
+ * gcc.target/i386/ssse3-pmulhrsw.c: Likewise.
+ * gcc.target/i386/ssse3-pshufb.c: Likewise.
+ * gcc.target/i386/ssse3-psignb.c: Likewise.
+ * gcc.target/i386/ssse3-psignd.c: Likewise.
+ * gcc.target/i386/ssse3-psignw.c: Likewise.
+
+ * gcc.target/i386/i386.exp (check_effective_target_vaes): New.
+
+ * gcc.target/i386/m128-check.h: Include <xmmintrin.h>. Include
+ <emmintrin.h> for SSE2.
+ (union128i_b): Defined only for SSE2.
+ (union128i_w): Likewise.
+ (union128i_d): Likewise.
+ (union128i_q): Likewise.
+ (union128d): Likewise.
+ (check_union128i_b): Likewise.
+ (check_union128i_w): Likewise.
+ (check_union128i_d): Likewise.
+ (check_union128i_q): Likewise.
+ (check_union128d): Likewise.
+ (union128i_ub): New.
+ (union128i_uw): Likewise.
+ (check_union128i_ub): Likewise.
+ (check_union128i_uw): Likewise.
+ (ESP_FLOAT): Likewise.
+ (ESP_DOUBLE): Likewise.
+ (CHECK_ARRAY): Likewise.
+ (checkVd): Likewise.
+ (checkVf): Likewise.
+ (ieee754_float): Likewise.
+ (ieee754_double): Likewise.
+
+ * gcc.target/i386/sse-check.h: Include "m128-check.h".
+
+ * gcc.target/x86_64/abi/abi-x86_64.exp: Replace asm-support.s
+ with asm-support.S.
+
+ * gcc.target/x86_64/abi/asm-support.s: Renamed to ...
+ * gcc.target/x86_64/abi/asm-support.S: This. Add
+ ".sse_check none" if __AVX__ is defined.
+
+ * lib/target-supports.exp (check_effective_target_avx): New.
+
+2008-08-28 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c/30949
+ * gcc.dg/pr30949.c: New.
+ * gcc.dg/transparent-union-1.c: Update.
+ * gcc.dg/cleanup-1.c: Update.
+ * gcc.dg/assign-warn-2.c: Update.
+ * gcc.dg/conv-2.c: Update.
+ * gcc.dg/Wpointer-sign-pedantic.c: Update.
+ * gcc.dg/Wpointer-sign-Wall.c: Update.
+ * gcc.dg/assign-warn-1.c: Update.
+ * gcc.dg/dfp/composite-type.c: Update.
+ * gcc.dg/noncompile/20020213-1.c: Update.
+
+2008-08-28 Daniel Kraft <d@domob.eu>
+
+ * gfortran.dg/typebound_call_1.f03: New test.
+ * gfortran.dg/typebound_call_2.f03: New test.
+ * gfortran.dg/typebound_call_3.f03: New test.
+ * gfortran.dg/typebound_call_4.f03: New test.
+ * gfortran.dg/typebound_call_5.f03: New test.
+ * gfortran.dg/typebound_call_6.f03: New test.
+ * gfortran.dg/typebound_proc_1.f08: Don't expect not-implemented error.
+ * gfortran.dg/typebound_proc_2.f90: Ditto.
+ * gfortran.dg/typebound_proc_5.f03: Ditto.
+ * gfortran.dg/typebound_proc_6.f03: Ditto.
+ * gfortran.dg/typebound_proc_7.f03: Ditto.
+ * gfortran.dg/typebound_proc_8.f03: Ditto.
+
+2008-08-28 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/37207
+ * gcc.c-torture/compile/pr37207.c: New testcase.
+
+2008-08-28 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/37253
+ * gfortran.dg/proc_ptr_10.f90: New.
+
+2008-08-28 Dodji Seketeli <dodji@redhat.com>
+
+ PR c++/36741
+ * g++.dg/other/new-size-type.C: New test.
+
+2008-08-28 Ira Rosen <irar@il.ibm.com>
+
+ * lib/target-supports.exp (check_effective_target_vect_perm): New.
+ * gcc.dg/vect/slp-perm-1.c: New testcase.
+ * gcc.dg/vect/slp-perm-2.c: New testcase.
+ * gcc.dg/vect/slp-perm-3.c: New testcase.
+ * gcc.dg/vect/slp-perm-4.c: New testcase.
+ * gcc.dg/vect/slp-perm-5.c: New testcase.
+ * gcc.dg/vect/slp-perm-6.c: New testcase.
+ * gcc.dg/vect/slp-perm-7.c: New testcase.
+ * gcc.dg/vect/slp-perm-8.c: New testcase.
+ * gcc.dg/vect/slp-perm-9.c: New testcase.
+
+2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 37217
+ * gcc.dg/pr37217.c: New.
+
+2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c/31673
+ * gcc.dg/c90-fordecl-1.c: Update.
+
+2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c/37186
+ * gcc.dg/pr37186.c: New.
+
+2008-08-27 Janis Johnson <janis187@us.ibm.com>
+
+ * gcc.dg/torture/type-generic-1.c: Revert previous change.
+ * g++.dg/torture/type-generic-1.C: Ditto.
+
+2008-08-27 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/ipa/ipacost-1.c: Remove template matching only x86-64
+ * gcc.dg/ipa/ipacost-2.c: Add -fipa-cp-clone; remove template matching
+ only x86-64
+ * gcc.dg/ipa/ipa-1.c: Add -fipa-cp-clone
+ * gcc.dg/ipa/ipa-2.c: Add -fipa-cp-clone
+ * gcc.dg/ipa/ipa-3.c: Add -fipa-cp-clone
+ * gcc.dg/ipa/ipa-4.c: Add -fipa-cp-clone
+ * gcc.dg/ipa/ipa-5.c: Add -fipa-cp-clone
+ * gcc.dg/ipa/ipa-7.c: Add -fipa-cp-clone
+
+2008-08-27 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/35321
+ * g++.dg/parse/offsetof8.C: New.
+
+2008-08-27 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c++/17880
+ * g++.dg/warn/sequence-pt-1.C: New.
+ * g++.dg/warn/sequence-pt-pr17880.C: New.
+
+2008-08-26 Douglas Gregor <doug.gregor@gmail.com>
+
+ * g++.dg/cpp0x/scoped_enum_examples.C: New.
+ * g++.dg/cpp0x/scoped_enum.C: New.
+ * g++.dg/cpp0x/scoped_enum_98.C: New.
+ * g++.dg/cpp0x/enum_base_warn.C: New.
+ * g++.dg/cpp0x/enum_base.C: New.
+
+2008-08-26 Janis Johnson <janis187@us.ibm.com>
+
+ * gcc.target/powerpc/altivec-macros.c: Fix dg-message directives.
+ * gcc.target/powerpc/ppu-intrinsics.c: Ignore some warnings.
+ * gcc.target/powerpc/darwin-save-world-1.c: Require AltiVec hardware.
+ * gcc.target/powerpc/altivec-types-1.c: Expect some notes.
+ * gcc.dg/Wstrict-aliasing-bogus-ref-all-2.c: Ignore a warning.
+ * g++.dg/ext/altivec-2.C: Initialize a local variable.
+ * g++.dg/ext/altivec-3.C: Move AltiVec code out of main.
+
+ * gcc.dg/torture/type-generic-1.c: Don't use IBM 128-bit long double.
+ * g++.dg/torture/type-generic-1.C: Ditto.
+
+2008-08-26 Victor Kaplansky <victork@il.ibm.com>
+
+ * gcc.dg/vect/slp-18.c: Require vect_intfloat_cvt.
+ * gcc.dg/vect/slp-11.c: Likewise.
+ * gcc.dg/vect/fast-math-pr35982.c: Likewise.
+ * lib/target-supports.exp:
+ (check_effective_target_vect_pack_trunc): Add SPU to the list.
+ (check_effective_target_vect_extract_even_odd): Likewise.
+ (check_effective_target_vect_extract_even_odd_wide): Likewise.
+ (check_effective_target_vect_interleave): Likewise.
+
+2008-08-25 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
+ Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ * gcc.target/powerpc/altivec-volatile.c: New test.
+
+2008-08-25 Daniel Kraft <d@domob.eu>
+
+ * gfortran.dg/extends_7.f03: New test.
+ * gfortran.dg/typebound_proc_7.f03: New test.
+ * gfortran.dg/typebound_proc_8.f03: New test.
+
+2008-08-24 Adam Nemet <anemet@caviumnetworks.com>
+
+ * gcc.target/mips/octeon-pop-1.c: New test.
+
+2008-08-24 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/37201
+ * gfortran.dg/bind_c_18.f90: New.
+
+2008-08-24 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/ipa/ipacost-1.c: New testcase.
+ * gcc.dg/ipa/ipacost-2.c: New testcase.
+ * gcc.dg/ipa/ipa-7.c: Update template.
+
+2008-08-24 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/37201
+ * gfortran.dg/bind_c_usage_17.f90: New.
+ * gfortran.dg/bind_c_usage_17_c.c: New.
+
+2008-08-24 Daniel Kraft <d@domob.eu>
+
+ * gfortran.dg/finalize_5.f03: Adapted expected error message to changes
+ to handling of CONTAINS in derived-type declarations.
+ * gfortran.dg/typebound_proc_1.f08: New test.
+ * gfortran.dg/typebound_proc_2.f90: New test.
+ * gfortran.dg/typebound_proc_3.f03: New test.
+ * gfortran.dg/typebound_proc_4.f03: New test.
+ * gfortran.dg/typebound_proc_5.f03: New test.
+ * gfortran.dg/typebound_proc_6.f03: New test.
+
+2008-08-23 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/37076
+ * gfortran.dg/widechar_9.f90: New.
+
+2008-08-23 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/37025
+ * gfortran.dg/widechar_8.f90: New.
+
+2008-08-23 Ira Rosen <irar@il.ibm.com>
+
+ PR tree-optimization/37174
+ * g++.dg/vect/pr37174.cc: New test.
+
+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
+ * gcc.dg/torture/pr36978.c: New testcase.
+
+2008-07-31 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat.dg/sync_iface_test.ad[s,b]: New test.
+
+ * gnat.dg/specs/sync_iface_test.ads: New test.
+ * gnat.dg/specs/null_aggr_bug.ads: New test.
+
+2008-07-31 H.J. Lu <hongjiu.lu@intel.com>
+
+ * gcc.dg/torture/stackalign/pr16660-1.c: Include "check.h".
+ (f): Align to 64 byte. Use check instead of asm statement.
+
+2008-07-31 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat.dg/missing_acc_check.adb: New test.
+
+2008-07-31 Richard Guenther <rguenther@suse.de>
+
+ * gcc.dg/uninit-1-O0.c: New testcase.
+ * gcc.dg/uninit-2-O0.c: Likewise.
+ * gcc.dg/uninit-3-O0.c: Likewise.
+ * gcc.dg/uninit-4-O0.c: Likewise.
+ * gcc.dg/uninit-5-O0.c: Likewise.
+ * gcc.dg/uninit-6-O0.c: Likewise.
+ * gcc.dg/uninit-8-O0.c: Likewise.
+ * gcc.dg/uninit-9-O0.c: Likewise.
+ * gcc.dg/uninit-A-O0.c: Likewise.
+ * gcc.dg/uninit-B-O0.c: Likewise.
+ * gcc.dg/uninit-C-O0.c: Likewise.
+ * gcc.dg/uninit-D-O0.c: Likewise.
+ * gcc.dg/uninit-E-O0.c: Likewise.
+ * gcc.dg/uninit-F-O0.c: Likewise.
+ * gcc.dg/uninit-G-O0.c: Likewise.
+ * gcc.dg/uninit-H-O0.c: Likewise.
+ * gcc.dg/uninit-I-O0.c: Likewise.
+ * gcc.dg/uninit-10-O0.c: Likewise.
+ * gcc.dg/uninit-11-O0.c: Likewise.
+ * gcc.dg/uninit-12-O0.c: Likewise.
+ * gcc.dg/uninit-13-O0.c: Likewise.
+ * gcc.dg/uninit-14-O0.c: Likewise.
+ * gcc.dg/uninit-15-O0.c: Likewise.
+ * gcc.dg/Wall.c: Avoid uninitialized warning.
+ * gcc.dg/Wno-all.c: Likewise.
+ * gcc.dg/pr3074-1.c: Likewise.
+
+2008-07-31 Arnaud Charlet <charlet@adacore.com>
+
+ * gnat.dg/specs/genericppc.ads: New test.
+
+2008-07-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/36970
+ * gcc.dg/free-1.c: New test.
+ * gcc.dg/free-2.c: New test.
+
+ 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.
+ * gcc.dg/pch/cpp-3b.h: New file.
+
+2008-07-30 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/boolean_expr.ad[sb]: New test.
+
+2008-07-30 H.J. Lu <hongjiu.lu@intel.com>
+ Joey Ye <joey.ye@intel.com>
+
+ * gcc.dg/dfp/func-vararg-alternate-d128-2.c: New.
+ * gcc.dg/dfp/func-vararg-mixed-2.c: Likewise.
+ * gcc.dg/torture/stackalign/alloca-1.c: Likewise.
+ * gcc.dg/torture/stackalign/builtin-apply-1.c: Likewise.
+ * gcc.dg/torture/stackalign/builtin-apply-2.c: Likewise.
+ * gcc.dg/torture/stackalign/builtin-apply-3.c: Likewise.
+ * gcc.dg/torture/stackalign/builtin-apply-4.c: Likewise.
+ * gcc.dg/torture/stackalign/builtin-return-1.c: Likewise.
+ * gcc.dg/torture/stackalign/check.h: Likewise.
+ * gcc.dg/torture/stackalign/comp-goto-1.c: Likewise.
+ * gcc.dg/torture/stackalign/fastcall-1.c: Likewise.
+ * gcc.dg/torture/stackalign/global-1.c: Likewise.
+ * gcc.dg/torture/stackalign/inline-1.c: Likewise.
+ * gcc.dg/torture/stackalign/inline-2.c: Likewise.
+ * gcc.dg/torture/stackalign/nested-1.c: Likewise.
+ * gcc.dg/torture/stackalign/nested-2.c: Likewise.
+ * gcc.dg/torture/stackalign/nested-3.c: Likewise.
+ * gcc.dg/torture/stackalign/nested-4.c: Likewise.
+ * gcc.dg/torture/stackalign/nested-5.c: Likewise.
+ * gcc.dg/torture/stackalign/nested-6.c: Likewise.
+ * gcc.dg/torture/stackalign/non-local-goto-1.c: Likewise.
+ * gcc.dg/torture/stackalign/non-local-goto-2.c: Likewise.
+ * gcc.dg/torture/stackalign/non-local-goto-3.c: Likewise.
+ * gcc.dg/torture/stackalign/non-local-goto-4.c: Likewise.
+ * gcc.dg/torture/stackalign/non-local-goto-5.c: Likewise.
+ * gcc.dg/torture/stackalign/pr16660-1.c: Likewise.
+ * gcc.dg/torture/stackalign/pr16660-2.c: Likewise.
+ * gcc.dg/torture/stackalign/pr16660-3.c: Likewise.
+ * gcc.dg/torture/stackalign/regparm-1.c: Likewise.
+ * gcc.dg/torture/stackalign/ret-struct-1.c: Likewise.
+ * gcc.dg/torture/stackalign/setjmp-1.c: Likewise.
+ * gcc.dg/torture/stackalign/setjmp-2.c: Likewise.
+ * gcc.dg/torture/stackalign/setjmp-3.c: Likewise.
+ * gcc.dg/torture/stackalign/setjmp-4.c: Likewise.
+ * gcc.dg/torture/stackalign/sibcall-1.c: Likewise.
+ * gcc.dg/torture/stackalign/stackalign.exp: Likewise.
+ * gcc.dg/torture/stackalign/struct-1.c: Likewise.
+ * gcc.dg/torture/stackalign/vararg-1.c: Likewise.
+ * gcc.dg/torture/stackalign/vararg-2.c: Likewise.
+ * gcc.target/i386/align-main-1.c: Likewise.
+ * gcc.target/i386/align-main-2.c: Likewise.
+ * gcc.target/i386/pr32000-2.c: Likewise.
+ * gcc.target/i386/stackalign/asm-1.c: Likewise.
+ * gcc.target/i386/stackalign/return-1.c: Likewise.
+ * gcc.target/i386/stackalign/return-2.c: Likewise.
+ * gcc.target/i386/stackalign/return-3.c: Likewise.
+ * gcc.target/i386/stackalign/return-4.c: Likewise.
+ * gcc.target/i386/stackalign/return-5.c: Likewise.
+ * gcc.target/i386/stackalign/return-6.c: Likewise.
+ * gcc.target/i386/stackalign/stackalign.exp: Likewise.
+ * g++.dg/torture/stackalign/check.h: Likewise.
+ * g++.dg/torture/stackalign/eh-alloca-1.C: Likewise.
+ * g++.dg/torture/stackalign/eh-fastcall-1.C: Likewise.
+ * g++.dg/torture/stackalign/eh-global-1.C: Likewise.
+ * g++.dg/torture/stackalign/eh-inline-1.C: Likewise.
+ * g++.dg/torture/stackalign/eh-inline-2.C: Likewise.
+ * g++.dg/torture/stackalign/eh-vararg-1.C: Likewise.
+ * g++.dg/torture/stackalign/eh-vararg-2.C: Likewise.
+ * g++.dg/torture/stackalign/stackalign.exp: Likewise.
+ * g++.dg/torture/stackalign/stdcall-1.C: Likewise.
+ * g++.dg/torture/stackalign/test-unwind.h: Likewise.
+ * g++.dg/torture/stackalign/throw-1.C: Likewise.
+ * g++.dg/torture/stackalign/throw-2.C: Likewise.
+ * g++.dg/torture/stackalign/throw-3.C: Likewise.
+ * g++.dg/torture/stackalign/throw-4.C: Likewise.
+ * g++.dg/torture/stackalign/unwind-0.C: Likewise.
+ * g++.dg/torture/stackalign/unwind-1.C: Likewise.
+ * g++.dg/torture/stackalign/unwind-2.C: Likewise.
+ * g++.dg/torture/stackalign/unwind-3.C: Likewise.
+ * g++.dg/torture/stackalign/unwind-4.C: Likewise.
+ * g++.dg/torture/stackalign/unwind-5.C: Likewise.
+ * g++.dg/torture/stackalign/unwind-6.C: Likewise.
+
+ * gcc.target/i386/20060512-1.c: Add -mpreferred-stack-boundary=4.
+ (main): Move "popl" after check.
+ * gcc.target/i386/20060512-3.c: Likewise.
+
+ * gcc.target/i386/20060512-2.c: Add -mpreferred-stack-boundary=4.
+ Remove dg-error.
+
+ * gcc.target/i386/20060512-4.c: Add -mpreferred-stack-boundary=4.
+ Remove dg-warning.
+
+ * lib/target-supports.exp (check_effective_target_unaligned_stack):
+ Always return 0.
+ (check_effective_target_automatic_stack_alignment): New.
+
+2008-07-30 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36967
+ * gfortran.dg/pr36967.f: New testcase.
+
+2008-07-30 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-07-30 Dodji Seketeli <dseketel@redhat.com>
+
+ PR c++/36767
+ * g++.dg/parse/crash42.C: New test.
+
+2008-07-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 34389
+ * gcc.dg/Wconversion-pr34389.c: New.
+ * g++.dg/warn/Wconversion-pr34389.C: New.
+
+2008-07-29 Steve Ellcey <sje@cup.hp.com>
+
+ * gcc.dg/pr32370.c: Force 64 bits on IA64.
+
+2008-07-29 Paul Thomas <pault@gcc.gnu.org>
+
+ * gfortran.dg/extends_1.f03: New test.
+ * gfortran.dg/extends_2.f03: New test.
+ * gfortran.dg/extends_3.f03: New test.
+ * gfortran.dg/extends_4.f03: New test.
+ * gfortran.dg/extends_5.f03: New test.
+ * gfortran.dg/extends_6.f03: New test.
+ * gfortran.dg/private_type_6.f90: Modify error message.
+ * gfortran.dg/structure_constructor_7.f03: Modify error message.
+ * gfortran.dg/structure_constructor_8.f03: Modify error message.
+
+2008-07-29 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/36945
+ * gcc.dg/tree-ssa/ssa-pre-18.c: New testcase.
+
+2008-07-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/36852
+ * g++.dg/pch/array-1.C: New test.
+ * g++.dg/pch/array-1.Hs: New file.
+
+2008-07-29 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/20040206-1.c: Expect frontend warning now.
+
+2008-07-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 34985
+ * gcc.dg/pr34985.c: New.
+ * g++.dg/warn/pr34985.C: New.
+
+2008-07-29 Daniel Kraft <d@domob.eu>
+
+ PR fortran/36403
+ * gfortran.dg/char_eoshift_5.f90: New test.
+ * gfortran.dg/intrinsic_optional_char_arg_1.f90: New test.
+
+2008-07-28 Richard Guenther <rguenther@suse.de>
+
+ Merge from gimple-tuples-branch.
+
+ * gcc.c-torture/compile/20080721-1.c: New testcase.
+ * gcc.dg/torture/20080716-1.c: Likewise.
+ * gcc.dg/tree-ssa/tailcall-3.c: Likewise.
+ * gcc.dg/tree-ssa/20080530.c: Likewise.
+ * gcc.dg/20080615-1.c: Likewise.
+ * g++.dg/torture/pr36826.C: Likewise.
+ * gcc.dg/fold-alloca-1.c: Look into cleanup_cfg1 dump instead of
+ useless dump.
+ * gcc.dg/tree-ssa/pr21658.c: Update search pattern.
+ * gfortran.dg/gomp/block-1.f90: Adjust dg-error.
+ * gcc.dg/tree-ssa/20030728-1.c: Test final_cleanup instead of
+ optimized dump.
+
+2008-07-28 Simon Baldwin <simonb@google.com>
+
+ * gcc.dg/pragma-message.c: New.
+
+2008-07-27 Victor Kaplansky <victork@il.ibm.com>
+
+ PR tree-optimization/35252
+ * gcc.dg/vect/vect-complex-1.c, gcc.dg/vect/vect-complex-2.c,
+ gcc.dg/vect/fast-math-vect-complex-3.c,
+ gcc.dg/vect/vect-complex-4.c: New tests.
+
+2008-07-27 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR c++/36944
+ * g++.dg/other/pr36944.C: New.
+
+2008-07-27 Daniel Franke <franke.daniel@gmail.com>
+
+ PR fortran/36724
+ * gfortran.dg/pointer_to_substring.f90: New test.
+
+2008-07-27 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/36132
+ PR fortran/29952
+ PR fortran/36909
+ * gfortran.dg/internal_pack_4.f90: New.
+ * gfortran.dg/internal_pack_5.f90: New.
+ * gfortran.dg/array_temporaries_2.f90: New.
+
+2008-07-26 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/36934
+ * gfortran.dg/allocatable_module_1.f90: New test case.
+
+2008-07-25 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/36936
+ * gcc.target/i386/cmov8.c: New.
+ * gcc.target/i386/funcspec-10.c: Likewise.
+ * gcc.target/i386/funcspec-11.c: Likewise.
+
+2008-07-25 Joseph Myers <joseph@codesourcery.com>
+
+ * lib/target-supports.exp (check_effective_target_arm_thumb1_ok):
+ New.
+ * g++.dg/inherit/thunk8.C: Use it.
+
+2008-07-24 Jan Hubicka <jh@suse.cz>
+
+ * gcc.dg/winline-4.c: Remove.
+ * gcc.dg/pch/valid-3.hs: Remove.
+ * gcc.dg/pch/valid-3.c: Remove.
+ * g++.old-deja/g++.brendan/crash52.C: Accept returning void warning
+ * g++.old-deja/g++.jason/report.C: Likewise.
+ * testsuite/g++.dg/warn/pr23075.C: We get returning void warning
+ instead of control flow warning.
+
+2008-07-24 Daniel Kraft <d@domob.eu>
+
+ PR fortran/33141
+ * gfortran.dg/intrinsic_shadow_1.f03: New test for -Wintrinsic-shadow.
+ * gfortran.dg/intrinsic_shadow_2.f03: Ditto.
+ * gfortran.dg/intrinsic_shadow_3.f03: Ditto.
+ * gfortran.dg/intrinsic_std_1.f90: New test for -Wintrinsics-std.
+ * gfortran.dg/intrinsic_std_2.f90: Ditto.
+ * gfortran.dg/intrinsic_std_3.f90: Ditto.
+ * gfortran.dg/intrinsic_std_4.f90: Ditto.
+ * gfortran.dg/warn_std_1.f90: Removed option -Wnonstd-intrinsics.
+ * gfortran.dg/warn_std_2.f90: Replaced -Wnonstd-intrinsics by
+ -Wintrinsics-std and adapted expected errors/warnings.
+ * gfortran.dg/warn_std_3.f90: Ditto.
+ * gfortran.dg/c_sizeof_2.f90: Adapted expected error/warning message.
+ * gfortran.dg/gamma_2.f90: Ditto.
+ * gfortran.dg/selected_char_kind_3.f90: Ditto.
+ * gfortran.dg/fmt_g0_2.f08: Call with -fall-intrinsics to allow abort.
+
+2008-07-24 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/29952
+ * gfortran.dg/array_temporaries_1.f90: New test case.
+
+2008-07-23 Ian Lance Taylor <iant@google.com>
+
+ * gcc.target/i386/20080723-1.c: New test.
+
+2008-07-24 Ben Elliston <bje@au.ibm.com>
+
+ * gcc.target/spu/vector.c: New test.
+ * gcc.target/spu/vector-ansi.c: Likewise.
+
+2008-07-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR 35058
+ * gcc.dg/Wdeclaration-after-statement-3.c: New.
+ * gcc/testsuite/gcc.dg/Wpointer-arith.c: New.
+
2008-07-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/36852
@@ -28,16 +2435,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>
@@ -3394,7 +5801,7 @@
PR fortran/35780
* gfortran.dg/simplify_argN_1.f90: New test.
-2008-04-06 Tobias Schlüter <tobi@gcc.gnu.org>
+2008-04-06 Tobias Schl�ter <tobi@gcc.gnu.org>
PR fortran/35832
* gfortran.dg/io_constraints_2.f90: Adapt to new error message.
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/abi/mangle-neon.C b/gcc/testsuite/g++.dg/abi/mangle-neon.C
index 9f88f8baba3..a3fa65c104f 100644
--- a/gcc/testsuite/g++.dg/abi/mangle-neon.C
+++ b/gcc/testsuite/g++.dg/abi/mangle-neon.C
@@ -26,6 +26,8 @@ void f15 (float32x4_t a) {}
void f16 (poly8x16_t a) {}
void f17 (poly16x8_t a) {}
+void f18 (int8x16_t, int8x16_t) {}
+
// { dg-final { scan-assembler "_Z2f015__simd64_int8_t:" } }
// { dg-final { scan-assembler "_Z2f116__simd64_int16_t:" } }
// { dg-final { scan-assembler "_Z2f216__simd64_int32_t:" } }
@@ -44,4 +46,4 @@ void f17 (poly16x8_t a) {}
// { dg-final { scan-assembler "_Z3f1519__simd128_float32_t:" } }
// { dg-final { scan-assembler "_Z3f1617__simd128_poly8_t:" } }
// { dg-final { scan-assembler "_Z3f1718__simd128_poly16_t:" } }
-
+// { dg-final { scan-assembler "_Z3f1816__simd128_int8_tS_:" } }
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/initlist1.C b/gcc/testsuite/g++.dg/cpp0x/initlist1.C
index b7583da7829..ff45f7176f6 100644
--- a/gcc/testsuite/g++.dg/cpp0x/initlist1.C
+++ b/gcc/testsuite/g++.dg/cpp0x/initlist1.C
@@ -56,6 +56,9 @@ void i(initializer_list<int> l)
if (p != l.end()) abort();
}
+struct U { U(int, int) {} };
+U ua[] = { { 3, 2 } };
+
int main()
{
g({1,2,3});
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/expr/anew4.C b/gcc/testsuite/g++.dg/expr/anew4.C
index d86d5251412..4ce1d8899f9 100644
--- a/gcc/testsuite/g++.dg/expr/anew4.C
+++ b/gcc/testsuite/g++.dg/expr/anew4.C
@@ -1,5 +1,4 @@
-// { dg-do run { xfail *-*-* } }
-// XFAILed until PR2123 is fixed
+// { dg-do run }
// PR 11228: array operator new, with zero-initialization and a variable sized array.
// Regression test for PR
// Author: Matt Austern <austern@apple.com>
diff --git a/gcc/testsuite/g++.dg/ext/altivec-2.C b/gcc/testsuite/g++.dg/ext/altivec-2.C
index 6a404b266d8..268ff998946 100644
--- a/gcc/testsuite/g++.dg/ext/altivec-2.C
+++ b/gcc/testsuite/g++.dg/ext/altivec-2.C
@@ -10,7 +10,7 @@
int main (int argc, const char * argv[])
{
- int i;
+ int i = 0;
const float cf = 1.0;
vector float v;
const vector float cv = (vector float){1.0, 2.0, 3.0, 4.0};
diff --git a/gcc/testsuite/g++.dg/ext/altivec-3.C b/gcc/testsuite/g++.dg/ext/altivec-3.C
index da029eed77d..d42303d8140 100644
--- a/gcc/testsuite/g++.dg/ext/altivec-3.C
+++ b/gcc/testsuite/g++.dg/ext/altivec-3.C
@@ -120,16 +120,19 @@ void baz2 (int i, ... )
CHECK_INVARIANT (vec_all_eq (vxi.v, vx_g.v));
}
-int main(void)
+void main1(void)
{
CHECK_INVARIANT (sizeof(struct foo) == 8 && sizeof(struct vfoo) == 48);
- altivec_check();
-
bar(i_1, x_g, (short)i_2, (float)d_2, ld_1, (char)i_1, d_3);
baz(i_1, v_g, i_1, vx_g, i_1, v2_g, i_1, vx2_g);
quux(i_1, v_g, v_g);
baz2(i_1, vx_g);
-
+}
+
+int main(void)
+{
+ altivec_check();
+ main1();
return 0;
}
diff --git a/gcc/testsuite/g++.dg/inherit/thunk8.C b/gcc/testsuite/g++.dg/inherit/thunk8.C
index f7761349f8e..ef645356898 100644
--- a/gcc/testsuite/g++.dg/inherit/thunk8.C
+++ b/gcc/testsuite/g++.dg/inherit/thunk8.C
@@ -3,7 +3,7 @@
Make sure that won't happen anymore. */
/* { dg-do compile } */
-/* { dg-require-effective-target arm32 } */
+/* { dg-require-effective-target arm_thumb1_ok } */
/* { dg-options "-mthumb -fPIC" } */
struct A {
diff --git a/gcc/testsuite/g++.dg/ipa/iinline-1.C b/gcc/testsuite/g++.dg/ipa/iinline-1.C
new file mode 100644
index 00000000000..a7bb374f7f9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/iinline-1.C
@@ -0,0 +1,47 @@
+/* Verify that simple indirect calls are inlined even without early
+ inlining.. */
+/* { dg-do compile } */
+/* { dg-options "-O3 -c -fdump-ipa-inline -fno-early-inlining" } */
+
+extern void non_existent (const char *, int);
+
+class String
+{
+private:
+ const char *data;
+
+public:
+ String (const char *d) : data(d)
+ {}
+
+ int funcOne (int delim) const;
+ int printStuffTwice (int delim) const;
+};
+
+
+int String::funcOne (int delim) const
+{
+ int i;
+ for (i = 0; i < delim; i++)
+ non_existent(data, i);
+
+ return 1;
+}
+
+int docalling (int (String::* f)(int delim) const)
+{
+ String S ("muhehehe");
+
+ return (S.*f)(4);
+}
+
+int main (int argc, char *argv[])
+{
+ int i;
+ i = docalling (&String::funcOne);
+ non_existent ("done", i);
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump "String::funcOne\[^\\n\]*inline copy in int main" "inline" } } */
+/* { dg-final { cleanup-ipa-dump "inline" } } */
diff --git a/gcc/testsuite/g++.dg/lookup/new1.C b/gcc/testsuite/g++.dg/lookup/new1.C
index b9d0bef88f6..ae1121339cf 100644
--- a/gcc/testsuite/g++.dg/lookup/new1.C
+++ b/gcc/testsuite/g++.dg/lookup/new1.C
@@ -4,10 +4,10 @@
int main() {
int i;
- void* operator new(unsigned s, int* p);
+ void* operator new(__SIZE_TYPE__ s, int* p);
int* e = new(&i) int; // { dg-error "no matching function" }
int* f = new int;
return 0;
}
-// { dg-excess-errors "operator new" }
+// { dg-error "candidate" "" { target *-*-* } 0 }
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/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/crash27.C b/gcc/testsuite/g++.dg/parse/crash27.C
index 069436666d3..217928781d3 100644
--- a/gcc/testsuite/g++.dg/parse/crash27.C
+++ b/gcc/testsuite/g++.dg/parse/crash27.C
@@ -1,5 +1,4 @@
// Bug: 23225
void Dispatcher()
- (__builtin_offsetof (ArgsType, largeMsgLen))
- /* { dg-error "function " "function" { target *-*-* } 4 } */
+ (__builtin_offsetof (ArgsType, largeMsgLen)) // { dg-error "initialize|end of input" }
diff --git a/gcc/testsuite/g++.dg/parse/error15.C b/gcc/testsuite/g++.dg/parse/error15.C
index 5903a585e97..5d30b554369 100644
--- a/gcc/testsuite/g++.dg/parse/error15.C
+++ b/gcc/testsuite/g++.dg/parse/error15.C
@@ -35,4 +35,4 @@ struct C
typename N::A f7; // { dg-error "15: error: invalid use of template-name 'N::A' without an argument list" }
};
-// { dg-bogus "bogus excess errors in declaration" "bogus excess errors in declaration" { xfail *-*-* } 17 }
+// { dg-bogus "bogus excess errors in declaration" "bogus excess errors in declaration" { target *-*-* } 17 }
diff --git a/gcc/testsuite/g++.dg/template/crash60.C b/gcc/testsuite/g++.dg/template/crash60.C
index 9e1d88b2432..c579775917e 100644
--- a/gcc/testsuite/g++.dg/template/crash60.C
+++ b/gcc/testsuite/g++.dg/template/crash60.C
@@ -5,5 +5,5 @@ struct A
template<int> void foo(X); // { dg-error "declared" }
};
-template<int> void f()(0); // { dg-error "initialized" }
+template<int> void f()(0); // { dg-error "initialize" }
diff --git a/gcc/testsuite/g++.dg/template/crash7.C b/gcc/testsuite/g++.dg/template/crash7.C
index 5b17928f5bb..ae07d91e739 100644
--- a/gcc/testsuite/g++.dg/template/crash7.C
+++ b/gcc/testsuite/g++.dg/template/crash7.C
@@ -6,8 +6,10 @@
// nested type.
template <typename> struct A
-{ // { dg-error "candidates" }
+{ // { not-dg-error "candidates" }
template <typename> A(typename A::X) {} // { dg-error "no type" }
};
-A<void> a; // { dg-error "instantiated|no match" }
+A<void> a; // { not-dg-error "instantiated|no match" }
+// We currently don't give the "no match" error because we don't add the
+// invalid constructor template to TYPE_METHODS.
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/check.h b/gcc/testsuite/g++.dg/torture/stackalign/check.h
new file mode 100644
index 00000000000..af198851274
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/check.h
@@ -0,0 +1,36 @@
+#include <stddef.h>
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" void abort (void);
+#else
+extern void abort (void);
+#endif
+
+int
+check_int (int *i, int align)
+{
+ *i = 20;
+ if ((((ptrdiff_t) i) & (align - 1)) != 0)
+ {
+#ifdef DEBUG
+ printf ("\nUnalign address (%d): %p!\n", align, i);
+#endif
+ abort ();
+ }
+ return *i;
+}
+
+void
+check (void *p, int align)
+{
+ if ((((ptrdiff_t) p) & (align - 1)) != 0)
+ {
+#ifdef DEBUG
+ printf ("\nUnalign address (%d): %p!\n", align, p);
+#endif
+ abort ();
+ }
+}
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/eh-alloca-1.C b/gcc/testsuite/g++.dg/torture/stackalign/eh-alloca-1.C
new file mode 100644
index 00000000000..a20f074bcd2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/eh-alloca-1.C
@@ -0,0 +1,56 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+class Base {};
+
+struct A : virtual public Base
+{
+ A() {}
+};
+
+struct B {};
+
+void
+foo (int size) throw (B,A)
+{
+ char *p = (char*) __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 ();
+
+ throw A();
+}
+
+int
+main()
+{
+ try { foo (5); }
+ catch (A& a) { }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/eh-fastcall-1.C b/gcc/testsuite/g++.dg/torture/stackalign/eh-fastcall-1.C
new file mode 100644
index 00000000000..4b849a2e42e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/eh-fastcall-1.C
@@ -0,0 +1,43 @@
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+class Base {};
+
+struct A : virtual public Base
+{
+ A() {}
+};
+
+struct B {};
+
+__attribute__ ((fastcall))
+void
+foo (int j, int k, int m, int n, int o) throw (B,A)
+{
+ aligned i;
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+
+ if (i != 20 || j != 1 || k != 2 || m != 3 || n != 4 || o != 5)
+ abort ();
+
+ throw A();
+}
+
+int
+main()
+{
+ try { foo (1, 2, 3, 4, 5); }
+ catch (A& a) { }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/eh-global-1.C b/gcc/testsuite/g++.dg/torture/stackalign/eh-global-1.C
new file mode 100644
index 00000000000..2692f947c7b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/eh-global-1.C
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+class Base {};
+
+struct A : virtual public Base
+{
+ A() {}
+};
+
+struct B {};
+
+void
+foo (void) throw (B,A)
+{
+ aligned i;
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+
+ throw A();
+}
+
+int
+main()
+{
+ try { foo (); }
+ catch (A& a) { }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/eh-inline-1.C b/gcc/testsuite/g++.dg/torture/stackalign/eh-inline-1.C
new file mode 100644
index 00000000000..72ac7fd2443
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/eh-inline-1.C
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+class Base {};
+
+struct A : virtual public Base
+{
+ A() {}
+};
+
+struct B {};
+
+static void
+inline __attribute__((always_inline))
+foo (void) throw (B,A)
+{
+ aligned i;
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+ throw A();
+}
+
+int
+main()
+{
+ try { foo (); }
+ catch (A& a) { }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/eh-inline-2.C b/gcc/testsuite/g++.dg/torture/stackalign/eh-inline-2.C
new file mode 100644
index 00000000000..4feb3f09fc7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/eh-inline-2.C
@@ -0,0 +1,57 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+class Base {};
+
+struct A : virtual public Base
+{
+ A() {}
+};
+
+struct B {};
+
+static void
+inline __attribute__((always_inline))
+foo (int size) throw (B,A)
+{
+ char *p = (char *) __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 ();
+
+ throw A();
+}
+
+int
+main()
+{
+ try { foo (5); }
+ catch (A& a) { }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/eh-vararg-1.C b/gcc/testsuite/g++.dg/torture/stackalign/eh-vararg-1.C
new file mode 100644
index 00000000000..74b48faa599
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/eh-vararg-1.C
@@ -0,0 +1,72 @@
+/* { dg-do run } */
+
+#include <stdarg.h>
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+class Base {};
+
+struct A : virtual public Base
+{
+ A() {}
+};
+
+struct B {};
+
+void
+foo (const char *fmt, ...) throw (B,A)
+{
+ va_list arg;
+ char *p;
+ aligned i;
+ int size;
+ double x;
+
+ va_start (arg, fmt);
+ size = va_arg (arg, int);
+ if (size != 5)
+ abort ();
+ p = (char *) __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 ();
+
+ throw A();
+
+ va_end (arg);
+}
+
+int
+main()
+{
+ try { foo ("foo", 5, 5.0); }
+ catch (A& a) { }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/eh-vararg-2.C b/gcc/testsuite/g++.dg/torture/stackalign/eh-vararg-2.C
new file mode 100644
index 00000000000..719c839a748
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/eh-vararg-2.C
@@ -0,0 +1,77 @@
+/* { dg-do run } */
+
+#include <stdarg.h>
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+class Base {};
+
+struct A : virtual public Base
+{
+ A() {}
+};
+
+struct B {};
+
+void
+test (va_list arg) throw (B,A)
+{
+ char *p;
+ aligned i;
+ int size;
+ double x;
+
+ size = va_arg (arg, int);
+ if (size != 5)
+ abort ();
+
+ p = (char *) __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 ();
+
+ throw A();
+}
+
+void
+foo (const char *fmt, ...)
+{
+ va_list arg;
+ va_start (arg, fmt);
+ test (arg);
+ va_end (arg);
+}
+int
+main()
+{
+ try { foo ("foo", 5, 5.0); }
+ catch (A& a) { }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/stackalign.exp b/gcc/testsuite/g++.dg/torture/stackalign/stackalign.exp
new file mode 100644
index 00000000000..bfa413eab48
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/stackalign.exp
@@ -0,0 +1,39 @@
+# Copyright (C) 2008
+# Free Software Foundation, Inc.
+
+# This program 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 of the License, or
+# (at your option) any later version.
+#
+# This program 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/>.
+
+# This harness is for tests that should be run at all optimisation levels.
+
+load_lib g++-dg.exp
+
+# Only run on targets which support automatic stack alignment.
+if { ![check_effective_target_automatic_stack_alignment] } then {
+ return
+}
+
+set additional_flags ""
+if { [istarget i?86*-*-*] || [istarget x86_64-*-*] } then {
+ lappend additional_flags "-mstackrealign"
+ lappend additional_flags "-mpreferred-stack-boundary=5"
+}
+
+dg-init
+gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.C]] $additional_flags
+if { [check_effective_target_fpic] } then {
+ lappend additional_flags "-fpic"
+ gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.C]] $additional_flags
+}
+dg-finish
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/stdcall-1.C b/gcc/testsuite/g++.dg/torture/stackalign/stdcall-1.C
new file mode 100644
index 00000000000..393b37e7b6b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/stdcall-1.C
@@ -0,0 +1,17 @@
+// { dg-do compile { target { { i?86-*-* x86_64-*-* } && ilp32 } } }
+
+// This case is to detect an assertion failure in stack branch development.
+
+bool f();
+struct S {
+ __attribute__ ((stdcall)) ~S();
+};
+void g() {
+ for (;;) {
+ S s1, s2, s3;
+ if (f())
+ continue;
+ if (f())
+ return;
+ }
+}
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/test-unwind.h b/gcc/testsuite/g++.dg/torture/stackalign/test-unwind.h
new file mode 100644
index 00000000000..e6493ffedb2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/test-unwind.h
@@ -0,0 +1,132 @@
+#include "check.h"
+
+#ifdef __cplusplus
+extern "C" void abort (void);
+#else
+extern void abort (void);
+#endif
+
+extern void foo(void);
+
+#define INIT_EDI 1
+#define INIT_ESI 2
+#define INIT_EBX 3
+
+/* Set DI/SI/BX to wrong value
+ Use following template so that RA will save/restore callee
+ save registers in prologue/epilogue */
+#define ALTER_REGS() \
+ { \
+ int dummy; \
+ __asm__ __volatile__ (\
+ "movl %1, %0" : "=D" (dummy) : "i" (-INIT_EDI)\
+ );\
+ __asm__ __volatile__ (\
+ "movl %1, %0" : "=S" (dummy) : "i" (-INIT_ESI)\
+ );\
+ __asm__ __volatile__ (\
+ "movl %1, %0" : "=b" (dummy) : "i" (-INIT_EBX)\
+ );\
+ }
+
+#ifdef __PIC__
+int
+main ()
+{
+ return 0;
+}
+#else
+void __attribute__ ((noinline))
+copy (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+int g_edi=INIT_EDI, g_esi=INIT_ESI, g_ebx=INIT_EBX;
+int g_ebp, g_ebp_save, g_esp, g_esp_save;
+int n_error;
+
+int
+main()
+{
+ int dummy;
+ // Init registers to correct value.
+ // Use following template so that RA will save/restore callee
+ // save registers in prologue/epilogue
+ __asm__ __volatile__ (
+ "movl %1, %0"
+ : "=D" (dummy)
+ : "i" (INIT_EDI)
+ );
+ __asm__ __volatile__ (
+ "movl %1, %0"
+ : "=S" (dummy)
+ : "i" (INIT_ESI)
+ );
+ __asm__ __volatile__ (
+ "movl %1, %0"
+ : "=b" (dummy)
+ : "i" (INIT_EBX)
+ );
+ __asm__ __volatile__ (
+ "movl %ebp, g_ebp_save\n\t"
+ "movl %esp, g_esp_save\n\t"
+ );
+ try {
+ foo();
+ }
+ catch (...)
+ {
+ }
+
+ // Get DI/SI/BX register value after exception caught
+ __asm__ __volatile__ (
+ "movl %edi, g_edi\n\t"
+ "movl %esi, g_esi\n\t"
+ "movl %ebx, g_ebx\n\t"
+ "movl %ebp, g_ebp\n\t"
+ "movl %esp, g_esp\n\t"
+ );
+
+ // Check if DI/SI/BX register value are the same as before calling
+ // foo.
+ if (g_edi != INIT_EDI)
+ {
+ n_error++;
+#ifdef DEBUG
+ printf("edi=%d, correct value:%d\n", g_edi, INIT_EDI);
+#endif
+ }
+ if (g_esi != INIT_ESI)
+ {
+ n_error++;
+#ifdef DEBUG
+ printf("esi=%d, correct value:%d\n", g_esi, INIT_ESI);
+#endif
+ }
+ if (g_ebx != INIT_EBX)
+ {
+ n_error++;
+#ifdef DEBUG
+ printf("ebx=%d, correct value:%d\n", g_ebx, INIT_EBX);
+#endif
+ }
+ if (g_ebp != g_ebp_save)
+ {
+ n_error++;
+#ifdef DEBUG
+ printf("ebp=0x%x, correct value:0x%x\n", g_ebp, g_ebp_save);
+#endif
+ }
+ if (g_esp != g_esp_save)
+ {
+ n_error++;
+#ifdef DEBUG
+ printf("esp=0x%x, correct value:0x%x\n", g_esp, g_esp_save);
+#endif
+ }
+ if (n_error !=0)
+ abort();
+ return 0;
+}
+#endif
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/throw-1.C b/gcc/testsuite/g++.dg/torture/stackalign/throw-1.C
new file mode 100644
index 00000000000..b1d2e278953
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/throw-1.C
@@ -0,0 +1,61 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int t_align __attribute__((aligned(ALIGNMENT)));
+
+
+int global, global2;
+void bar()
+{
+ volatile t_align a = 1;
+ int i,j,k,l,m,n;
+ i=j=k=0;
+ for (i=0; i < global; i++)
+ for (j=0; j < i; j++)
+ for (k=0; k < j; k++)
+ for (l=0; l < k; l++)
+ for (m=0; m < l; m++)
+ for (n=0; n < m; n++)
+ global2 = k;
+ if (check_int ((int *) &a, __alignof__(a)) != a)
+ abort ();
+ throw 0;
+}
+
+void foo()
+{
+ bar();
+}
+
+int main()
+{
+ int ll = 1;
+ int i = 0,j = 1,k = 2,l = 3,m = 4,n = 5;
+ try {
+ for (; i < global; i++)
+ for (; j < i; j++)
+ for (; k < j; k++)
+ for (; l < k; l++)
+ for (; m < l; m++)
+ for (; n < m; n++)
+ global2 = k;
+ foo();
+ }
+ catch (...)
+ {
+ }
+ ll = i+j+k+l+m+n;
+ if (ll != 15)
+ {
+#ifdef DEBUG
+ printf("FAIL: sum %d != 15\n", ll);
+#endif
+ abort();
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/throw-2.C b/gcc/testsuite/g++.dg/torture/stackalign/throw-2.C
new file mode 100644
index 00000000000..5f3f1dc0737
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/throw-2.C
@@ -0,0 +1,52 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int t_align __attribute__((aligned(ALIGNMENT)));
+
+
+int global, global2;
+void bar()
+{
+ volatile t_align a = 1;
+ int i,j,k;
+ i=j=k=0;
+ for (i=0; i < global; i++)
+ for (j=0; j < i; j++)
+ global2 = k;
+ if (check_int ((int *) &a, __alignof__(a)) != a)
+ abort ();
+ throw 0;
+}
+
+int main()
+{
+ int ll = 1;
+ int i = 0,j = 1,k = 2,l = 3,m = 4,n = 5;
+ try {
+ for (; i < global; i++)
+ for (; j < i; j++)
+ for (; k < j; k++)
+ for (; l < k; l++)
+ for (; m < l; m++)
+ for (; n < m; n++)
+ global2 = k;
+ bar ();
+ }
+ catch (...)
+ {
+ }
+ ll = i+j+k+l+m+n;
+ if (ll != 15)
+ {
+#ifdef DEBUG
+ printf("FAIL: sum %d != 15\n", ll);
+#endif
+ abort();
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/throw-3.C b/gcc/testsuite/g++.dg/torture/stackalign/throw-3.C
new file mode 100644
index 00000000000..d3e53b8292d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/throw-3.C
@@ -0,0 +1,52 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int t_align __attribute__((aligned(ALIGNMENT)));
+
+
+int global, global2;
+void bar()
+{
+ volatile t_align a = 1;
+ int i,j,k;
+ i=j=k=0;
+ for (i=0; i < global; i++)
+ for (j=0; j < i; j++)
+ global2 = k;
+ throw 0;
+ if (check_int ((int *) &a, __alignof__(a)) != a)
+ abort ();
+}
+
+int main()
+{
+ int ll = 1;
+ int i = 0,j = 1,k = 2,l = 3,m = 4,n = 5;
+ try {
+ for (; i < global; i++)
+ for (; j < i; j++)
+ for (; k < j; k++)
+ for (; l < k; l++)
+ for (; m < l; m++)
+ for (; n < m; n++)
+ global2 = k;
+ bar ();
+ }
+ catch (...)
+ {
+ }
+ ll = i+j+k+l+m+n;
+ if (ll != 15)
+ {
+#ifdef DEBUG
+ printf("FAIL: sum %d != 15\n", ll);
+#endif
+ abort();
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/throw-4.C b/gcc/testsuite/g++.dg/torture/stackalign/throw-4.C
new file mode 100644
index 00000000000..a9c15bd43c9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/throw-4.C
@@ -0,0 +1,54 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int t_align __attribute__((aligned(ALIGNMENT)));
+
+
+int global, global2;
+void bar()
+{
+ volatile t_align a = 1;
+ int i,j,k;
+ i=j=k=0;
+ for (i=0; i < global; i++)
+ for (j=0; j < i; j++)
+ {
+ global2 = k;
+ throw 0;
+ }
+ if (check_int ((int *) &a, __alignof__(a)) != a)
+ abort ();
+}
+
+int main()
+{
+ int ll = 1;
+ int i = 0,j = 1,k = 2,l = 3,m = 4,n = 5;
+ try {
+ for (; i < global; i++)
+ for (; j < i; j++)
+ for (; k < j; k++)
+ for (; l < k; l++)
+ for (; m < l; m++)
+ for (; n < m; n++)
+ global2 = k;
+ bar ();
+ }
+ catch (...)
+ {
+ }
+ ll = i+j+k+l+m+n;
+ if (ll != 15)
+ {
+#ifdef DEBUG
+ printf("FAIL: sum %d != 15\n", ll);
+#endif
+ abort();
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/unwind-0.C b/gcc/testsuite/g++.dg/torture/stackalign/unwind-0.C
new file mode 100644
index 00000000000..546123bdd0e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/unwind-0.C
@@ -0,0 +1,12 @@
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+#include "test-unwind.h"
+
+#ifndef __PIC__
+void __attribute__ ((noinline)) foo()
+{
+ ALTER_REGS();
+ // Throw the except and expect returning to main
+ throw 1;
+}
+#endif
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/unwind-1.C b/gcc/testsuite/g++.dg/torture/stackalign/unwind-1.C
new file mode 100644
index 00000000000..3b809642ab7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/unwind-1.C
@@ -0,0 +1,16 @@
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+#include "test-unwind.h"
+
+#ifndef __PIC__
+/* Test situation 1: Stack really realign without DRAP */
+void __attribute__ ((noinline))
+foo ()
+{
+ int __attribute__ ((aligned(64))) a=1;
+ if (check_int (&a, __alignof__(a)) != a)
+ abort ();
+ ALTER_REGS();
+ throw a;
+}
+#endif
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/unwind-2.C b/gcc/testsuite/g++.dg/torture/stackalign/unwind-2.C
new file mode 100644
index 00000000000..1569ed84b7d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/unwind-2.C
@@ -0,0 +1,29 @@
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+#include "test-unwind.h"
+
+#ifndef __PIC__
+/* Test situation 2: stack really realign with DRAP reg CX */
+void __attribute__ ((noinline))
+foo ()
+{
+ int __attribute__ ((aligned(64))) a=4;
+ char * s = (char *) __builtin_alloca (a + 1);
+
+ copy (s, a);
+ if (__builtin_strncmp (s, "good", a) != 0)
+ {
+#ifdef DEBUG
+ s[a] = '\0';
+ printf ("Failed: %s != good\n", s);
+#endif
+ abort ();
+ }
+
+ if (check_int (&a, __alignof__(a)) != a)
+ abort ();
+
+ ALTER_REGS();
+ throw a;
+}
+#endif
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/unwind-3.C b/gcc/testsuite/g++.dg/torture/stackalign/unwind-3.C
new file mode 100644
index 00000000000..48eddaf5565
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/unwind-3.C
@@ -0,0 +1,35 @@
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+#include "test-unwind.h"
+
+#ifndef __PIC__
+/* Test situation 3: Stack realign really happen with DRAP reg DI */
+void __attribute__ ((noinline)) __attribute__ ((regparm(3)))
+bar (int arg1, int arg2, int arg3)
+{
+ int __attribute__ ((aligned(64))) a=1;
+ char * s = (char *) __builtin_alloca (arg3 + 1);
+
+ copy (s, arg3);
+ if (__builtin_strncmp (s, "good", arg3) != 0)
+ {
+#ifdef DEBUG
+ s[arg3] = '\0';
+ printf ("Failed: %s != good\n", s);
+#endif
+ abort ();
+ }
+
+ if (check_int (&a, __alignof__(a)) != a)
+ abort ();
+
+ ALTER_REGS();
+ throw arg1+arg2+arg3+a;
+}
+
+void
+foo()
+{
+ bar (1,2,3);
+}
+#endif
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/unwind-4.C b/gcc/testsuite/g++.dg/torture/stackalign/unwind-4.C
new file mode 100644
index 00000000000..dacbd3dede9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/unwind-4.C
@@ -0,0 +1,17 @@
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+#include "test-unwind.h"
+
+#ifndef __PIC__
+volatile int __attribute__ ((aligned(32))) g_a=1;
+/* Test situation 4: no Drap and stack realign doesn't really happen */
+void __attribute__ ((noinline))
+foo()
+{
+ int i;
+ ALTER_REGS();
+ for (i=0; i < 10; i++)
+ g_a++;
+ throw g_a;
+}
+#endif
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/unwind-5.C b/gcc/testsuite/g++.dg/torture/stackalign/unwind-5.C
new file mode 100644
index 00000000000..fde430bfb72
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/unwind-5.C
@@ -0,0 +1,31 @@
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+#include "test-unwind.h"
+
+#ifndef __PIC__
+double g_f=1.0;
+/* Test situation 5: Stack realign dosn't really happen with DRAP reg CX */
+void __attribute__ ((noinline)) __attribute__ ((regparm(2)))
+bar(int arg1, int arg2, int arg3, int arg4)
+{
+ char * s = (char *) __builtin_alloca (arg4 + 1);
+
+ copy (s, arg4);
+ if (__builtin_strncmp (s, "good", arg4) != 0)
+ {
+#ifdef DEBUG
+ s[arg4] = '\0';
+ printf ("Failed: %s != good\n", s);
+#endif
+ abort ();
+ }
+ ALTER_REGS();
+ if (g_f) throw arg1+arg2+arg3+ g_f;
+}
+
+void __attribute__((noinline))
+foo()
+{
+ bar(1,2,3,4);
+}
+#endif
diff --git a/gcc/testsuite/g++.dg/torture/stackalign/unwind-6.C b/gcc/testsuite/g++.dg/torture/stackalign/unwind-6.C
new file mode 100644
index 00000000000..7c9dee13338
--- /dev/null
+++ b/gcc/testsuite/g++.dg/torture/stackalign/unwind-6.C
@@ -0,0 +1,31 @@
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+#include "test-unwind.h"
+
+#ifndef __PIC__
+double g_f=1.0;
+/* Test situation 6: Stack realign dosn't really happen with DRAP reg DI */
+void __attribute__ ((noinline)) __attribute__ ((regparm(3)))
+bar(int arg1, int arg2, int arg3, int arg4)
+{
+ char * s = (char *) __builtin_alloca (arg4 + 1);
+
+ copy (s, arg4);
+ if (__builtin_strncmp (s, "good", arg4) != 0)
+ {
+#ifdef DEBUG
+ s[arg4] = '\0';
+ printf ("Failed: %s != good\n", s);
+#endif
+ abort ();
+ }
+ ALTER_REGS();
+ if (g_f) throw arg1+arg2+arg3+ g_f;
+}
+
+void __attribute__((noinline))
+foo()
+{
+ bar(1,2,3,4);
+}
+#endif
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr31146-2.C b/gcc/testsuite/g++.dg/tree-ssa/pr31146-2.C
index 0fd60275b53..d2edb1953a3 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr31146-2.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr31146-2.C
@@ -20,5 +20,5 @@ double foo (void)
return v.a[2];
}
-/* { dg-final { scan-tree-dump "Replaced .*iftmp.* != 0B. with .1" "forwprop1" } } */
+/* { dg-final { scan-tree-dump "Replaced .* != 0B. with .1" "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/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-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/pr23075.C b/gcc/testsuite/g++.dg/warn/pr23075.C
index 1521b658139..e5b1b483d76 100644
--- a/gcc/testsuite/g++.dg/warn/pr23075.C
+++ b/gcc/testsuite/g++.dg/warn/pr23075.C
@@ -6,4 +6,4 @@ int
foo (void)
{
return; // { dg-error "with no value" }
-} // { dg-bogus "control reaches end" }
+} // { dg-warning "no return statement" }
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/crash52.C b/gcc/testsuite/g++.old-deja/g++.brendan/crash52.C
index 9e72fb5cbb0..74df601554e 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/crash52.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/crash52.C
@@ -10,4 +10,4 @@ public:
A &f(A &a) {// { dg-error "" } new decl.*
std::cout << "Blah\n";
-}
+} // { dg-error "no return statement" }
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/report.C b/gcc/testsuite/g++.old-deja/g++.jason/report.C
index e2d805e082c..f4e02a4dc35 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/report.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/report.C
@@ -56,7 +56,7 @@ bar2 baz (X::Y y) // { dg-error "" } in this context
bar2 wa [5];
wa[0] = baz(f);
undef2 (1); // { dg-error "" } implicit declaration
-}
+} // { dg-error "no return statement" }
int ninny ()
{
@@ -71,4 +71,4 @@ int ninny ()
int darg (char X::*p)
{
undef3 (1); // { dg-error "" } implicit declaration
-}
+} // { dg-error "no return statement" }
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/g++.old-deja/g++.pt/error2.C b/gcc/testsuite/g++.old-deja/g++.pt/error2.C
index 2f777afdc70..40f7a7cb67f 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/error2.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/error2.C
@@ -2,7 +2,7 @@
// Origin: Carl Nygard <cnygard@bellatlantic.net>
template <class RT>
-class Test { // { dg-error "" } in instantiation
+class Test {
public:
Test(const RT& c = RT()) {} // { dg-error "" } reference to void
};
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/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/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.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/20040206-1.c b/gcc/testsuite/gcc.dg/20040206-1.c
index b4b509bfc7e..c9c776f0bd0 100644
--- a/gcc/testsuite/gcc.dg/20040206-1.c
+++ b/gcc/testsuite/gcc.dg/20040206-1.c
@@ -7,5 +7,5 @@
The warning about "no return statement in function
returning non-void" is PR 13000. */
-static int foo (int a __attribute__((unused)) ) { } /* { dg-warning "control reaches end of non-void" } */
+static int foo (int a __attribute__((unused)) ) { } /* { dg-warning "no return statement" } */
int main (void) { return foo (0); }
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/Wall.c b/gcc/testsuite/gcc.dg/Wall.c
index 86a359b49cd..89848471780 100644
--- a/gcc/testsuite/gcc.dg/Wall.c
+++ b/gcc/testsuite/gcc.dg/Wall.c
@@ -3,8 +3,7 @@
/* { dg-do compile } */
/* { dg-options "-Wall" } */
-void foo()
+void foo(int a)
{
- int a;
5 * (a == 1) | (a == 2); /* { dg-warning "no effect" "no effect" } */
}
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-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/Wno-all.c b/gcc/testsuite/gcc.dg/Wno-all.c
index 3275eb6cd50..de55bbcdacb 100644
--- a/gcc/testsuite/gcc.dg/Wno-all.c
+++ b/gcc/testsuite/gcc.dg/Wno-all.c
@@ -3,9 +3,8 @@
/* { dg-do compile } */
/* { dg-options "-Wall -Wno-all" } */
-void foo()
+void foo(int a)
{
- int a;
5 * (a == 1) | (a == 2); /* { dg-bogus "no effect" "no effect" } */
}
diff --git a/gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c b/gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c
index e72d37a18ce..302d50e5cf1 100644
--- a/gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c
+++ b/gcc/testsuite/gcc.dg/Wpointer-sign-Wall.c
@@ -2,7 +2,8 @@
/* { dg-options "-Wall" } */
-void foo(unsigned long* ulp);
+void foo(unsigned long* ulp); /* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" { target *-*-* } 5 } */
+
void bar(long* lp) {
foo(lp); /* { dg-warning "differ in signedness" } */
diff --git a/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c b/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c
index 25e25209e52..8b92110988d 100644
--- a/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c
+++ b/gcc/testsuite/gcc.dg/Wpointer-sign-pedantic.c
@@ -2,7 +2,7 @@
/* { dg-options "-pedantic" } */
-void foo(unsigned long* ulp);
+void foo(unsigned long* ulp);/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 5 } */
void bar(long* lp) {
foo(lp); /* { dg-warning "differ in signedness" } */
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/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/assign-warn-1.c b/gcc/testsuite/gcc.dg/assign-warn-1.c
index 1587c20d7b4..4c603829d59 100644
--- a/gcc/testsuite/gcc.dg/assign-warn-1.c
+++ b/gcc/testsuite/gcc.dg/assign-warn-1.c
@@ -121,3 +121,6 @@ TESTARP(istrb, int, struct s); /* { dg-error "incompatible type for argument 1 o
TESTASS(istrc, int, struct s); /* { dg-error "incompatible types in assignment" } */
TESTINI(istrd, int, struct s); /* { dg-error "incompatible types in initialization" } */
TESTRET(istre, int, struct s); /* { dg-error "incompatible types in return" } */
+
+/* Match all extra informative notes. */
+/* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" { target *-*-* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/assign-warn-2.c b/gcc/testsuite/gcc.dg/assign-warn-2.c
index 0ef6ebe33b3..4656961f6c4 100644
--- a/gcc/testsuite/gcc.dg/assign-warn-2.c
+++ b/gcc/testsuite/gcc.dg/assign-warn-2.c
@@ -122,3 +122,4 @@ TESTARP(istrb, int, struct s); /* { dg-error "incompatible type for argument 1 o
TESTASS(istrc, int, struct s); /* { dg-error "incompatible types in assignment" } */
TESTINI(istrd, int, struct s); /* { dg-error "incompatible types in initialization" } */
TESTRET(istre, int, struct s); /* { dg-error "incompatible types in return" } */
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 0 } */
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/c90-fordecl-1.c b/gcc/testsuite/gcc.dg/c90-fordecl-1.c
index 8e48dd61752..4aa3c583022 100644
--- a/gcc/testsuite/gcc.dg/c90-fordecl-1.c
+++ b/gcc/testsuite/gcc.dg/c90-fordecl-1.c
@@ -9,5 +9,6 @@ foo (void)
int j = 0;
for (int i = 1; i <= 10; i++) /* { dg-bogus "warning" "warning in place of error" } */
j += i;
- /* { dg-error "parse|decl" "declaration in for loop" { target *-*-* } 10 } */
+ /* { dg-error "'for' loop initial declarations are only allowed in C99 mode" "declaration in for loop" { target *-*-* } 10 } */
+ /* { dg-message "note: use option -std=c99 or -std=gnu99 to compile your code" "note" { target *-*-* } 10 }} */
}
diff --git a/gcc/testsuite/gcc.dg/cleanup-1.c b/gcc/testsuite/gcc.dg/cleanup-1.c
index e5853c4baa8..dd571635baf 100644
--- a/gcc/testsuite/gcc.dg/cleanup-1.c
+++ b/gcc/testsuite/gcc.dg/cleanup-1.c
@@ -10,10 +10,10 @@ static void f2() { }
static void f3(void) { }
static void f4(void *x U) { }
static void f5(int *x U) { }
-static void f6(double *x U) { }
+static void f6(double *x U) { } /* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" } */
static void f7(const int *x U) { }
static void f8(const int *x U, int y U) { }
-static void f9(int x U) { }
+static void f9(int x U) { } /* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" } */
void test(void)
{
diff --git a/gcc/testsuite/gcc.dg/conv-2.c b/gcc/testsuite/gcc.dg/conv-2.c
index ac95584e3a6..388dee3d746 100644
--- a/gcc/testsuite/gcc.dg/conv-2.c
+++ b/gcc/testsuite/gcc.dg/conv-2.c
@@ -1,8 +1,8 @@
/* { dg-do compile } */
/* { dg-options "-Wpointer-sign" } */
-void f1(long *);
-void f2(unsigned long *);
+void f1(long *); /* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" } */
+void f2(unsigned long *); /* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" } */
int main()
{
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/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/dfp/composite-type.c b/gcc/testsuite/gcc.dg/dfp/composite-type.c
index 56991add7f3..b2e7632e62a 100644
--- a/gcc/testsuite/gcc.dg/dfp/composite-type.c
+++ b/gcc/testsuite/gcc.dg/dfp/composite-type.c
@@ -33,8 +33,16 @@ do \
} while(0)
DECIMAL_COMPOSITE_DECL(32); /* { dg-error "incompatible types in assignment" } */
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 35 } */
+
+
DECIMAL_COMPOSITE_DECL(64); /* { dg-error "incompatible types in assignment" } */
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 39 } */
+
+
DECIMAL_COMPOSITE_DECL(128); /* { dg-error "incompatible types in assignment" } */
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 43 } */
+
int main()
{
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 735a22f3a7e..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-useless" } */
+/* { 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 "useless" } } */
-/* { dg-final { cleanup-tree-dump "useless" } } */
+/* { 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/gomp/block-1.c b/gcc/testsuite/gcc.dg/gomp/block-1.c
index abc66e580fd..dd7fe7783a9 100644
--- a/gcc/testsuite/gcc.dg/gomp/block-1.c
+++ b/gcc/testsuite/gcc.dg/gomp/block-1.c
@@ -4,7 +4,7 @@ void foo()
{
bad1:
#pragma omp parallel
- goto bad1; // { dg-error "invalid exit" }
+ goto bad1; // { dg-error "invalid branch" }
goto bad2; // { dg-error "invalid entry" }
#pragma omp parallel
diff --git a/gcc/testsuite/gcc.dg/gomp/block-2.c b/gcc/testsuite/gcc.dg/gomp/block-2.c
index 810b2da07b4..4c56add570c 100644
--- a/gcc/testsuite/gcc.dg/gomp/block-2.c
+++ b/gcc/testsuite/gcc.dg/gomp/block-2.c
@@ -11,7 +11,7 @@ void foo()
bad1:
#pragma omp for
for (i = 0; i < 10; ++i)
- goto bad1; // { dg-error "invalid exit" }
+ goto bad1; // { dg-error "invalid branch" }
goto bad2; // { dg-error "invalid entry" }
#pragma omp for
diff --git a/gcc/testsuite/gcc.dg/gomp/block-3.c b/gcc/testsuite/gcc.dg/gomp/block-3.c
index 160047c394c..c72b04c35d0 100644
--- a/gcc/testsuite/gcc.dg/gomp/block-3.c
+++ b/gcc/testsuite/gcc.dg/gomp/block-3.c
@@ -9,7 +9,7 @@ void foo()
{
#pragma omp sections
{
- continue; // { dg-error "invalid exit" }
+ continue; // { dg-error "invalid branch" }
}
}
@@ -18,12 +18,12 @@ void foo()
#pragma omp section
{ bad1: ; }
#pragma omp section
- goto bad1; // { dg-error "invalid exit" }
+ goto bad1; // { dg-error "invalid branch" }
}
#pragma omp sections
{
- goto bad2; // { dg-error "invalid exit" }
+ goto bad2; // { dg-error "invalid branch" }
}
bad2:;
diff --git a/gcc/testsuite/gcc.dg/gomp/block-4.c b/gcc/testsuite/gcc.dg/gomp/block-4.c
index 815d36b2e39..61f490c0033 100644
--- a/gcc/testsuite/gcc.dg/gomp/block-4.c
+++ b/gcc/testsuite/gcc.dg/gomp/block-4.c
@@ -4,6 +4,6 @@ void foo()
{
#pragma omp critical
{
- return; // { dg-error "invalid exit" }
+ return; // { dg-error "invalid branch" }
}
}
diff --git a/gcc/testsuite/gcc.dg/gomp/block-5.c b/gcc/testsuite/gcc.dg/gomp/block-5.c
index 450106feeb1..741049fddea 100644
--- a/gcc/testsuite/gcc.dg/gomp/block-5.c
+++ b/gcc/testsuite/gcc.dg/gomp/block-5.c
@@ -4,12 +4,12 @@ void foo()
{
#pragma omp master
{
- goto bad1; // { dg-error "invalid exit" }
+ goto bad1; // { dg-error "invalid branch" }
}
#pragma omp master
{
bad1:
- return; // { dg-error "invalid exit" }
+ return; // { dg-error "invalid branch" }
}
}
diff --git a/gcc/testsuite/gcc.dg/gomp/block-6.c b/gcc/testsuite/gcc.dg/gomp/block-6.c
index fa4c5eab5f4..87e6392e5b3 100644
--- a/gcc/testsuite/gcc.dg/gomp/block-6.c
+++ b/gcc/testsuite/gcc.dg/gomp/block-6.c
@@ -4,6 +4,6 @@ void foo()
{
#pragma omp ordered
{
- return; // { dg-error "invalid exit" }
+ return; // { dg-error "invalid branch" }
}
}
diff --git a/gcc/testsuite/gcc.dg/gomp/block-7.c b/gcc/testsuite/gcc.dg/gomp/block-7.c
index 802b3b3a383..2bc1cdb5723 100644
--- a/gcc/testsuite/gcc.dg/gomp/block-7.c
+++ b/gcc/testsuite/gcc.dg/gomp/block-7.c
@@ -6,15 +6,15 @@ void foo()
for (i = 0; i < 10; ++i)
{
#pragma omp for
- for (j = ({ continue; 0; }); // { dg-error "invalid exit" }
- j < ({ continue; 10; }); // { dg-error "invalid exit" }
- j += ({ continue; 1; })) // { dg-error "invalid exit" }
+ for (j = ({ continue; 0; }); // { dg-error "invalid branch" }
+ j < ({ continue; 10; }); // { dg-error "invalid branch" }
+ j += ({ continue; 1; })) // { dg-error "invalid branch" }
continue;
#pragma omp for
- for (j = ({ break; 0; }); // { dg-error "invalid exit" }
- j < ({ break; 10; }); // { dg-error "invalid exit" }
- j += ({ break; 1; })) // { dg-error "invalid exit" }
+ for (j = ({ break; 0; }); // { dg-error "invalid branch" }
+ j < ({ break; 10; }); // { dg-error "invalid branch" }
+ j += ({ break; 1; })) // { dg-error "invalid branch" }
break; // { dg-error "break" }
}
}
diff --git a/gcc/testsuite/gcc.dg/gomp/block-8.c b/gcc/testsuite/gcc.dg/gomp/block-8.c
index 177acaa28c0..3c717d927be 100644
--- a/gcc/testsuite/gcc.dg/gomp/block-8.c
+++ b/gcc/testsuite/gcc.dg/gomp/block-8.c
@@ -7,5 +7,5 @@ int foo()
#pragma omp parallel for
for (i = 0; i < 10; ++i)
- return 0; // { dg-error "invalid exit" }
+ return 0; // { dg-error "invalid branch" }
}
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/ipa-1.c b/gcc/testsuite/gcc.dg/ipa/ipa-1.c
index 65fd7b8ba71..76ef9a643d6 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-1.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -fipa-cp -fdump-ipa-cp -fno-early-inlining" } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
#include <stdio.h>
@@ -23,7 +23,8 @@ int main ()
/* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp" } } */
-/* { dg-final { scan-ipa-dump-times "replacing param with const" 2 "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param b with const 7" "cp" } } */
/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-2.c b/gcc/testsuite/gcc.dg/ipa/ipa-2.c
index 281c457eb36..454927a2c19 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-2.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-2.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -fipa-cp -fdump-ipa-cp -fno-early-inlining" } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
#include <stdio.h>
@@ -21,5 +21,6 @@ int main ()
/* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp" } } */
-/* { dg-final { scan-ipa-dump-times "replacing param with const" 2 "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param c with const 3" "cp" } } */
/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-3.c b/gcc/testsuite/gcc.dg/ipa/ipa-3.c
index 9487aae7f3b..c476b925050 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-3.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-3.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -fipa-cp -fdump-ipa-cp -fno-early-inlining" } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
@@ -25,5 +25,7 @@ int main ()
/* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp" } } */
-/* { dg-final { scan-ipa-dump-times "replacing param with const" 3 "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param b with const 7" "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param c with const 3" "cp" } } */
/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-4.c b/gcc/testsuite/gcc.dg/ipa/ipa-4.c
index 55599a24048..9f716f13936 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-4.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-4.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -fipa-cp -fdump-ipa-cp" } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp" } */
/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
#include <stdio.h>
@@ -24,5 +24,5 @@ int main ()
/* { dg-final { scan-ipa-dump-times "versioned function" 1 "cp" } } */
-/* { dg-final { scan-ipa-dump-times "replacing param with const" 1 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "replacing param a with const 7" 1 "cp" } } */
/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-5.c b/gcc/testsuite/gcc.dg/ipa/ipa-5.c
index b5106d95343..9352e19ab65 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-5.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-5.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -fipa-cp -fdump-ipa-cp -fno-early-inlining" } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
/* Float & short constants. */
@@ -23,5 +23,6 @@ int main ()
/* { dg-final { scan-ipa-dump-times "versioned function" 2 "cp" } } */
-/* { dg-final { scan-ipa-dump-times "replacing param with const" 2 "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param c with const 3" "cp" } } */
+/* { dg-final { scan-ipa-dump "replacing param a with const 7" "cp" } } */
/* { dg-final { cleanup-ipa-dump "cp" } } */
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-7.c b/gcc/testsuite/gcc.dg/ipa/ipa-7.c
index 60fc9c0b06f..1c4a1709df6 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-7.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-7.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O3 -fipa-cp -fdump-ipa-cp -fno-early-inlining" } */
+/* { dg-options "-O3 -fipa-cp -fipa-cp-clone -fdump-ipa-cp -fno-early-inlining" } */
/* { dg-skip-if "PR 25442" { "*-*-*" } { "-fpic" "-fPIC" } { "" } } */
#include <stdio.h>
@@ -25,7 +25,7 @@ int main ()
/* { dg-final { scan-ipa-dump-times "versioned function" 1 "cp" } } */
-/* { dg-final { scan-ipa-dump-times "propagating const" 1 "cp" } } */
+/* { dg-final { scan-ipa-dump-times "replacing param a with const 7" 1 "cp" } } */
/* { dg-final { cleanup-ipa-dump "cp" } } */
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/20020213-1.c b/gcc/testsuite/gcc.dg/noncompile/20020213-1.c
index c1de5663ace..41480f0794d 100644
--- a/gcc/testsuite/gcc.dg/noncompile/20020213-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/20020213-1.c
@@ -25,7 +25,10 @@ int main ()
}
/* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } 15 } */
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 5 } */
/* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } 16 } */
/* { dg-warning "passing argument 2 of" "2nd incompatible" { target *-*-* } 16 } */
/* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } 18 } */
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 6 } */
/* { dg-warning "passing argument 1 of" "1st incompatible" { target *-*-* } 20 } */
+/* { dg-message "note: expected '\[^'\n\]*' but argument is of type '\[^'\n\]*'" "note: expected" { target *-*-* } 7 } */
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/pch/valid-3.c b/gcc/testsuite/gcc.dg/pch/valid-3.c
deleted file mode 100644
index c7884f993a0..00000000000
--- a/gcc/testsuite/gcc.dg/pch/valid-3.c
+++ /dev/null
@@ -1,6 +0,0 @@
-/* { dg-options "-I. -Winvalid-pch -fno-unit-at-a-time" } */
-
-#include "valid-3.h"/* { dg-warning "settings for -funit-at-a-time do not match" } */
-/* { dg-error "No such file" "no such file" { target *-*-* } 3 } */
-/* { dg-error "they were invalid" "invalid files" { target *-*-* } 3 } */
-int x;
diff --git a/gcc/testsuite/gcc.dg/pch/valid-3.hs b/gcc/testsuite/gcc.dg/pch/valid-3.hs
deleted file mode 100644
index 2a0af94c9f7..00000000000
--- a/gcc/testsuite/gcc.dg/pch/valid-3.hs
+++ /dev/null
@@ -1,3 +0,0 @@
-/* { dg-options "-I. -Winvalid-pch -funit-at-a-time" } */
-
-extern int x;
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/pr3074-1.c b/gcc/testsuite/gcc.dg/pr3074-1.c
index c2258d57bb1..4716b79da96 100644
--- a/gcc/testsuite/gcc.dg/pr3074-1.c
+++ b/gcc/testsuite/gcc.dg/pr3074-1.c
@@ -2,9 +2,8 @@
/* { dg-do compile } */
/* { dg-options "-Wall" } */
-void foo()
+void foo(int a)
{
- int a;
5 * (a == 1) | (a == 2); /* { dg-warning "no effect" "no effect" } */
}
diff --git a/gcc/testsuite/gcc.dg/pr32370.c b/gcc/testsuite/gcc.dg/pr32370.c
index 18afde21f0f..80a7c545d47 100644
--- a/gcc/testsuite/gcc.dg/pr32370.c
+++ b/gcc/testsuite/gcc.dg/pr32370.c
@@ -5,12 +5,14 @@
#if defined __i386__ || defined __x86_64__
# define C "=S"
+# define TYPE unsigned long
#elif defined __ia64__
# define C "=a"
+# define TYPE unsigned long long
#endif
unsigned int
-foo (unsigned long port)
+foo (TYPE port)
{
unsigned int v;
__asm__ __volatile__ ("" : C (v) : "Nd" (port)); /* { dg-error "while reloading\|has impossible" } */
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/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/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/stackalign/alloca-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/alloca-1.c
new file mode 100644
index 00000000000..1370f63c292
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/alloca-1.c
@@ -0,0 +1,44 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+void
+foo (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()
+{
+ foo (5);
+ 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/builtin-apply-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-1.c
new file mode 100644
index 00000000000..38b384e7cca
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-1.c
@@ -0,0 +1,9 @@
+/* PR 11184 */
+/* Origin: Dara Hazeghi <dhazeghi@yahoo.com> */
+
+void *
+objc_msg_sendv (char * arg_frame, void (*foo)())
+{
+ return __builtin_apply ( foo, arg_frame, 4);
+}
+
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
new file mode 100644
index 00000000000..a1ba20fce53
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-2.c
@@ -0,0 +1,30 @@
+/* PR target/12503 */
+/* Origin: <pierre.nguyen-tuong@asim.lip6.fr> */
+
+/* Verify that __builtin_apply behaves correctly on targets
+ with pre-pushed arguments (e.g. SPARC). */
+
+/* { dg-do run } */
+
+
+#define INTEGER_ARG 5
+
+extern void abort(void);
+
+void foo(char *name, double d, double e, double f, int g)
+{
+ if (g != INTEGER_ARG)
+ abort();
+}
+
+void bar(char *name, ...)
+{
+ __builtin_apply(foo, __builtin_apply_args(), 64);
+}
+
+int main(void)
+{
+ bar("eeee", 5.444567, 8.90765, 4.567789, INTEGER_ARG);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-3.c b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-3.c
new file mode 100644
index 00000000000..1335d09022a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-3.c
@@ -0,0 +1,31 @@
+/* PR middle-end/12210 */
+/* Origin: Ossadchy Yury A. <waspcoder@mail.ru> */
+
+/* This used to fail on i686 because the argument was not copied
+ to the right location by __builtin_apply after the direct call. */
+
+/* { dg-do run } */
+
+
+#define INTEGER_ARG 5
+
+extern void abort(void);
+
+void foo(int arg)
+{
+ if (arg != INTEGER_ARG)
+ abort();
+}
+
+void bar(int arg)
+{
+ foo(arg);
+ __builtin_apply(foo, __builtin_apply_args(), 16);
+}
+
+int main(void)
+{
+ bar(INTEGER_ARG);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-4.c b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-4.c
new file mode 100644
index 00000000000..28dc6106d07
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-apply-4.c
@@ -0,0 +1,29 @@
+/* PR tree-optimization/20076 */
+/* { dg-do run } */
+
+extern void abort (void);
+
+double
+foo (int arg)
+{
+ if (arg != 116)
+ abort();
+ return arg + 1;
+}
+
+inline double
+bar (int arg)
+{
+ foo (arg);
+ __builtin_return (__builtin_apply ((void (*) ()) foo,
+ __builtin_apply_args (), 16));
+}
+
+int
+main (int argc, char **argv)
+{
+ if (bar (116) != 117.0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c
new file mode 100644
index 00000000000..75c9acdf72a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c
@@ -0,0 +1,34 @@
+/* PR middle-end/11151 */
+/* Originator: Andrew Church <gcczilla@achurch.org> */
+/* { dg-do run } */
+
+/* This used to fail on SPARC because the (undefined) return
+ value of 'bar' was overwriting that of 'foo'. */
+
+extern void abort(void);
+
+int foo(int n)
+{
+ return n+1;
+}
+
+int bar(int n)
+{
+ __builtin_return(__builtin_apply((void (*)(void))foo, __builtin_apply_args(), 64));
+}
+
+char *g;
+
+int main(void)
+{
+ /* Allocate 64 bytes on the stack to make sure that __builtin_apply
+ can read at least 64 bytes above the return address. */
+ char dummy[64];
+
+ g = dummy;
+
+ if (bar(1) != 2)
+ abort();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/check.h b/gcc/testsuite/gcc.dg/torture/stackalign/check.h
new file mode 100644
index 00000000000..af198851274
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/check.h
@@ -0,0 +1,36 @@
+#include <stddef.h>
+#ifdef DEBUG
+#include <stdio.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" void abort (void);
+#else
+extern void abort (void);
+#endif
+
+int
+check_int (int *i, int align)
+{
+ *i = 20;
+ if ((((ptrdiff_t) i) & (align - 1)) != 0)
+ {
+#ifdef DEBUG
+ printf ("\nUnalign address (%d): %p!\n", align, i);
+#endif
+ abort ();
+ }
+ return *i;
+}
+
+void
+check (void *p, int align)
+{
+ if ((((ptrdiff_t) p) & (align - 1)) != 0)
+ {
+#ifdef DEBUG
+ printf ("\nUnalign address (%d): %p!\n", align, p);
+#endif
+ abort ();
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/comp-goto-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/comp-goto-1.c
new file mode 100644
index 00000000000..7558f01e2e8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/comp-goto-1.c
@@ -0,0 +1,41 @@
+/* { dg-do run } */
+
+#ifdef STACK_SIZE
+#define DEPTH ((STACK_SIZE) / 512 + 1)
+#else
+#define DEPTH 1000
+#endif
+
+extern void abort (void);
+extern void exit (int);
+
+#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+int
+x(a)
+{
+ __label__ xlab;
+ void y(a)
+ {
+ void *x = &&llab;
+ if (a==-1)
+ goto *x;
+ if (a==0)
+ goto xlab;
+ llab:
+ y (a-1);
+ }
+ y (a);
+ xlab:;
+ return a;
+}
+#endif
+
+int
+main ()
+{
+#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+ if (x (DEPTH) != DEPTH)
+ abort ();
+#endif
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/fastcall-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/fastcall-1.c
new file mode 100644
index 00000000000..d1cda10103b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/fastcall-1.c
@@ -0,0 +1,31 @@
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+__attribute__ ((fastcall))
+void
+foo (int j, int k, int m, int n, int o)
+{
+ aligned i;
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+
+ if (i != 20 || j != 1 || k != 2 || m != 3 || n != 4 || o != 5)
+ abort ();
+}
+
+int
+main()
+{
+ foo (1, 2, 3, 4, 5);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/global-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/global-1.c
new file mode 100644
index 00000000000..284daad0eaf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/global-1.c
@@ -0,0 +1,27 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+foo (void)
+{
+ aligned i;
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+}
+
+int
+main()
+{
+ foo ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/inline-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/inline-1.c
new file mode 100644
index 00000000000..11e71c60a4c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/inline-1.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+static void
+inline __attribute__((always_inline))
+foo (void)
+{
+ aligned i;
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+}
+
+int
+main()
+{
+ foo ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/inline-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/inline-2.c
new file mode 100644
index 00000000000..fd51b5f7110
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/inline-2.c
@@ -0,0 +1,45 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+static void
+inline __attribute__((always_inline))
+foo (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()
+{
+ foo (5);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/nested-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/nested-1.c
new file mode 100644
index 00000000000..4e2c8729af0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/nested-1.c
@@ -0,0 +1,44 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+foo (void)
+{
+ aligned j;
+
+ void bar ()
+ {
+ aligned i;
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+
+ if (check_int (&j, __alignof__(j)) != j)
+ abort ();
+
+ j = -20;
+ }
+ bar ();
+
+ if (j != -20)
+ abort ();
+
+ if (check_int (&j, __alignof__(j)) != j)
+ abort ();
+}
+
+int
+main()
+{
+ foo ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/nested-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/nested-2.c
new file mode 100644
index 00000000000..d54e3b92c9f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/nested-2.c
@@ -0,0 +1,45 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+foo (void)
+{
+ aligned j;
+
+ __attribute__ ((__noinline__))
+ void bar ()
+ {
+ aligned i;
+
+ if (check_int (&i, __alignof__(i)) != i)
+ abort ();
+
+ if (check_int (&j, __alignof__(j)) != j)
+ abort ();
+
+ j = -20;
+ }
+ bar ();
+
+ if (j != -20)
+ abort ();
+
+ if (check_int (&j, __alignof__(j)) != j)
+ abort ();
+}
+
+int
+main()
+{
+ foo ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/nested-3.c b/gcc/testsuite/gcc.dg/torture/stackalign/nested-3.c
new file mode 100644
index 00000000000..373299185a8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/nested-3.c
@@ -0,0 +1,62 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+copy (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+void
+foo (int size)
+{
+ aligned j;
+
+ __attribute__ ((__noinline__))
+ void bar (int size)
+ {
+ char *p = __builtin_alloca (size + 1);
+ aligned i;
+
+ copy (p, size);
+ if (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 ();
+
+ if (check_int (&j, __alignof__(j)) != j)
+ abort ();
+
+ j = -20;
+ }
+ bar (size);
+
+ if (j != -20)
+ abort ();
+
+ if (check_int (&j, __alignof__(j)) != j)
+ abort ();
+}
+
+int
+main()
+{
+ foo (5);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/nested-4.c b/gcc/testsuite/gcc.dg/torture/stackalign/nested-4.c
new file mode 100644
index 00000000000..60322fc62b6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/nested-4.c
@@ -0,0 +1,33 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int n;
+
+void
+g (void)
+{
+ __label__ lab;
+ void h (void)
+ {
+ aligned t;
+ if (check_int (&t, __alignof__(t)) != t)
+ abort ();
+ if (n+t == 0) goto lab;
+ }
+ h();
+lab:
+ return;
+}
+
+int main()
+{
+ g();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/nested-5.c b/gcc/testsuite/gcc.dg/torture/stackalign/nested-5.c
new file mode 100644
index 00000000000..95eba0482f6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/nested-5.c
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+
+extern void abort (void);
+extern void exit (int);
+
+#ifndef NO_TRAMPOLINES
+static void recursive (int n, void (*proc) (void))
+{
+ __label__ l1;
+
+ void do_goto (void)
+ {
+ goto l1;
+ }
+
+ if (n == 3)
+ recursive (n - 1, do_goto);
+ else if (n > 0)
+ recursive (n - 1, proc);
+ else
+ (*proc) ();
+ return;
+
+l1:
+ if (n == 3)
+ exit (0);
+ else
+ abort ();
+}
+
+int main ()
+{
+ recursive (10, abort);
+ abort ();
+}
+#else
+int main () { return 0; }
+#endif
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/nested-6.c b/gcc/testsuite/gcc.dg/torture/stackalign/nested-6.c
new file mode 100644
index 00000000000..d853825feb7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/nested-6.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+
+#ifndef NO_TRAMPOLINES
+
+typedef __SIZE_TYPE__ size_t;
+extern void abort (void);
+extern void exit (int);
+extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
+
+int main ()
+{
+ __label__ nonlocal;
+ int compare (const void *a, const void *b)
+ {
+ goto nonlocal;
+ }
+
+ char array[3];
+ qsort (array, 3, 1, compare);
+ abort ();
+
+ nonlocal:
+ exit (0);
+}
+
+#else
+int main() { return 0; }
+#endif
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-1.c
new file mode 100644
index 00000000000..263d4486cf7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-1.c
@@ -0,0 +1,55 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int global;
+
+static void foo(void) __attribute__((noinline));
+
+static void foo(void)
+{
+ global = 1;
+}
+
+static void bar(void)
+{
+ foo ();
+}
+
+int execute(int cmd)
+{
+ __label__ start;
+
+ void raise(void)
+ {
+ goto start;
+ }
+
+ int last = -1;
+
+ bar ();
+
+ last = 0;
+
+start:
+
+ if (last == 0)
+ while (1)
+ {
+ last = 1;
+ raise ();
+ }
+
+ if (last == 0)
+ return 0;
+ else
+ return cmd;
+}
+
+int main(void)
+{
+ if (execute (1) == 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-2.c
new file mode 100644
index 00000000000..5a64d541964
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-2.c
@@ -0,0 +1,56 @@
+/* { dg-do run } */
+
+extern void abort (void);
+
+int global;
+
+static void foo(void) __attribute__((noinline));
+
+static void foo(void)
+{
+ global = 1;
+}
+
+static void bar(void)
+{
+ foo ();
+ global = 0;
+}
+
+int execute(int cmd)
+{
+ __label__ start;
+
+ void raise(void)
+ {
+ goto start;
+ }
+
+ int last = -1;
+
+ bar ();
+
+ last = 0;
+
+start:
+
+ if (last == 0)
+ while (1)
+ {
+ last = 1;
+ raise ();
+ }
+
+ if (last == 0)
+ return 0;
+ else
+ return cmd;
+}
+
+int main(void)
+{
+ if (execute (1) == 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-3.c b/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-3.c
new file mode 100644
index 00000000000..3afc8cc6a31
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-3.c
@@ -0,0 +1,42 @@
+/* { dg-do run } */
+
+#ifndef NO_TRAMPOLINES
+extern void abort (void);
+
+int x(int a, int b)
+{
+ __label__ xlab;
+
+ void y(int b)
+ {
+ switch (b)
+ {
+ case 1: goto xlab;
+ case 2: goto xlab;
+ }
+ }
+
+ a = a + 2;
+ y (b);
+
+ xlab:
+ return a;
+}
+
+int main ()
+{
+ int i, j;
+
+ for (j = 1; j <= 2; ++j)
+ for (i = 1; i <= 2; ++i)
+ {
+ int a = x (j, i);
+ if (a != 2 + j)
+ abort ();
+ }
+
+ return 0;
+}
+#else
+int main() { return 0; }
+#endif
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-4.c b/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-4.c
new file mode 100644
index 00000000000..3673f1ac337
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-4.c
@@ -0,0 +1,38 @@
+/* { dg-do run } */
+
+extern void abort (void);
+extern void exit (int);
+
+#ifdef STACK_SIZE
+#define DEPTH ((STACK_SIZE) / 512 + 1)
+#else
+#define DEPTH 1000
+#endif
+
+#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+int
+
+x(a)
+{
+ __label__ xlab;
+ void y(a)
+ {
+ if (a==0)
+ goto xlab;
+ y (a-1);
+ }
+ y (a);
+ xlab:;
+ return a;
+}
+#endif
+
+int
+main ()
+{
+#if ! defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+ if (x (DEPTH) != DEPTH)
+ abort ();
+#endif
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-5.c b/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-5.c
new file mode 100644
index 00000000000..08ca95d765c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/non-local-goto-5.c
@@ -0,0 +1,11 @@
+/* { dg-do run } */
+
+#if !defined (NO_LABEL_VALUES) && !defined (NO_TRAMPOLINES)
+extern void abort (void);
+extern void exit (int);
+int s(i){if(i>0){__label__ l1;int f(int i){if(i==2)goto l1;return 0;}return f(i);l1:;}return 1;}
+int x(){return s(0)==1&&s(1)==0&&s(2)==1;}
+int main(){if(x()!=1)abort();exit(0);}
+#else
+int main(){ exit (0); }
+#endif
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-1.c
new file mode 100644
index 00000000000..1bff181c24b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-1.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+void
+f ()
+{
+ unsigned long tmp[4] __attribute__((aligned(64)));
+ check (&tmp, 64);
+}
+
+int
+main()
+{
+ f();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-2.c
new file mode 100644
index 00000000000..9a039eb2bf5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-2.c
@@ -0,0 +1,12 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+typedef __SIZE_TYPE__ size_t;
+#define ALIGNMENT 256
+int main(void)
+{
+ int a[ALIGNMENT/sizeof(int)] __attribute__((aligned(ALIGNMENT)));
+ check (&a, ALIGNMENT);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-3.c b/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-3.c
new file mode 100644
index 00000000000..1c1ddd1dd74
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/pr16660-3.c
@@ -0,0 +1,14 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+typedef __SIZE_TYPE__ size_t;
+#define ALIGNMENT 256
+int main(void)
+{
+ int a[ALIGNMENT/sizeof(int)] __attribute__((aligned(ALIGNMENT)));
+ check (&a, ALIGNMENT);
+ int b[ALIGNMENT/sizeof(int)] __attribute__((aligned(ALIGNMENT)));
+ check (&b, ALIGNMENT);
+ 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/regparm-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/regparm-1.c
new file mode 100644
index 00000000000..9dac024cc1b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/regparm-1.c
@@ -0,0 +1,60 @@
+/* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int test_nested (int i)
+{
+ aligned y;
+
+ int __attribute__ ((__noinline__, __regparm__(2))) foo (int j, int k, int l)
+ {
+ aligned x;
+
+ if (check_int (&x, __alignof__(x)) != x)
+ abort ();
+
+ if (x != 20)
+ abort ();
+
+ return i + j + k + l;
+ }
+
+ if (check_int (&y, __alignof__(y)) != y)
+ abort ();
+
+ if (y != 20)
+ abort ();
+
+ return foo(i, i+1, i+2) * i;
+}
+
+int __attribute__ ((__noinline__, __regparm__(3), __force_align_arg_pointer__))
+test_realigned (int j, int k, int l)
+{
+ aligned y;
+
+ if (check_int (&y, __alignof__(y)) != y)
+ abort ();
+
+ if (y != 20)
+ abort ();
+
+ return j + k + l;
+}
+
+int main ()
+{
+ if (test_nested(10) != 430)
+ abort ();
+
+ if (test_realigned(10, 11, 12) != 33)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/ret-struct-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/ret-struct-1.c
new file mode 100644
index 00000000000..163e54c5908
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/ret-struct-1.c
@@ -0,0 +1,34 @@
+/* { dg-do run } */
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+extern void abort();
+typedef struct my_struct
+{
+ char str[31];
+} stype ;
+
+stype g_s;
+
+stype __attribute__((noinline))
+foo (char arg1, char arg2, char arg3)
+{
+ stype __attribute__((aligned(ALIGNMENT))) s;
+ s.str[0] = arg1;
+ s.str[1] = arg2;
+ s.str[30] = arg3;
+ check(&s, ALIGNMENT);
+ return s;
+}
+
+int main()
+{
+ g_s = foo(1,2,3);
+
+ if (g_s.str[0] != 1 || g_s.str[1] != 2 || g_s.str[30] !=3)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-1.c
new file mode 100644
index 00000000000..6ab67e395fb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-1.c
@@ -0,0 +1,43 @@
+/* { dg-do run } */
+
+extern int strcmp(const char *, const char *);
+extern char *strcpy(char *, const char *);
+extern void abort(void);
+extern void exit(int);
+
+void *buf[20];
+
+void __attribute__((noinline))
+sub2 (void)
+{
+ __builtin_longjmp (buf, 1);
+}
+
+int
+main ()
+{
+ char *p = 0;
+
+ p = (char *) __builtin_alloca (20);
+
+ strcpy (p, "test");
+
+ if (__builtin_setjmp (buf))
+ {
+ if (strcmp (p, "test") != 0)
+ abort ();
+
+ exit (0);
+ }
+
+ {
+ int *q = (int *) __builtin_alloca (p[2] * sizeof (int));
+ int i;
+
+ for (i = 0; i < p[2]; i++)
+ q[i] = 0;
+
+ while (1)
+ sub2 ();
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-2.c
new file mode 100644
index 00000000000..c93ffa8673e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-2.c
@@ -0,0 +1,46 @@
+/* { dg-do run { target i?86-*-linux* x86_64-*-linux* } } */
+
+#include <setjmp.h>
+#include <signal.h>
+
+#ifndef NULL
+#define NULL ((void *)0)
+#endif
+static jmp_buf segv_jmpbuf;
+
+static void segv_handler(int seg)
+{
+ __builtin_longjmp(segv_jmpbuf, 1);
+}
+
+static int is_addressable(void *p, size_t size)
+{
+ volatile char * volatile cp = (volatile char *)p;
+ volatile int ret;
+ struct sigaction sa, origsa;
+ sigset_t mask;
+
+ sa.sa_handler = segv_handler;
+ sa.sa_flags = 0;
+ sigfillset(&sa.sa_mask);
+ sigaction(SIGSEGV, &sa, &origsa);
+ sigprocmask(SIG_SETMASK, NULL, &mask);
+
+ if (__builtin_setjmp(segv_jmpbuf) == 0) {
+ while(size--)
+ *cp++;
+ ret = 1;
+ } else
+ ret = 0;
+
+ sigaction(SIGSEGV, &origsa, NULL);
+ sigprocmask(SIG_SETMASK, &mask, NULL);
+
+ return ret;
+}
+
+int main(int argc, char **argv)
+{
+ is_addressable(0x0, 1);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-3.c b/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-3.c
new file mode 100644
index 00000000000..fee0d281ffa
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-3.c
@@ -0,0 +1,37 @@
+/* { dg-do run } */
+
+#include <setjmp.h>
+
+extern void abort (void);
+
+jmp_buf buf;
+
+void raise0(void)
+{
+ __builtin_longjmp (buf, 1);
+}
+
+int execute(int cmd)
+{
+ int last = 0;
+
+ if (__builtin_setjmp (buf) == 0)
+ while (1)
+ {
+ last = 1;
+ raise0 ();
+ }
+
+ if (last == 0)
+ return 0;
+ else
+ return cmd;
+}
+
+int main(void)
+{
+ if (execute (1) == 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-4.c b/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-4.c
new file mode 100644
index 00000000000..d1671223adb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/setjmp-4.c
@@ -0,0 +1,39 @@
+/* { dg-do run } */
+
+#include <setjmp.h>
+
+extern void abort (void);
+
+jmp_buf buf;
+
+void raise0(void)
+{
+ __builtin_longjmp (buf, 1);
+}
+
+int execute(int cmd)
+{
+ int last = 0;
+
+ __builtin_setjmp (buf);
+
+ if (last == 0)
+ while (1)
+ {
+ last = 1;
+ raise0 ();
+ }
+
+ if (last == 0)
+ return 0;
+ else
+ return cmd;
+}
+
+int main(void)
+{
+ if (execute (1) == 0)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/sibcall-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/sibcall-1.c
new file mode 100644
index 00000000000..8c174758fc1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/sibcall-1.c
@@ -0,0 +1,35 @@
+/* { dg-do run } */
+
+extern int ok (int);
+extern void exit ();
+static int gen_x86_64_shrd (int);
+static int
+gen_x86_64_shrd(int a __attribute__ ((__unused__)))
+{
+ return 0;
+}
+
+extern int gen_x86_shrd_1 (int);
+extern void ix86_split_ashr (int);
+
+void
+ix86_split_ashr (int mode)
+{
+ (mode != 0
+ ? ok
+ : gen_x86_64_shrd) (0);
+}
+
+volatile int one = 1;
+int
+main (void)
+{
+ ix86_split_ashr (one);
+ return 1;
+}
+
+int
+ok (int i)
+{
+ exit (i);
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp b/gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp
new file mode 100644
index 00000000000..3574e4dc891
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/stackalign.exp
@@ -0,0 +1,52 @@
+# Copyright (C) 2008
+# Free Software Foundation, Inc.
+
+# This program 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 of the License, or
+# (at your option) any later version.
+#
+# This program 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/>.
+
+# This harness is for tests that should be run at all optimisation levels.
+
+load_lib gcc-dg.exp
+
+# Only run on targets which support automatic stack alignment.
+if { ![check_effective_target_automatic_stack_alignment] } then {
+ return
+}
+
+set additional_flags ""
+if { [istarget i?86*-*-*] || [istarget x86_64-*-*] } then {
+ lappend additional_flags "-mstackrealign"
+ lappend additional_flags "-mpreferred-stack-boundary=5"
+}
+
+dg-init
+
+gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] $additional_flags
+if { [check_effective_target_fpic] } then {
+ set pic_additional_flags $additional_flags
+ lappend pic_additional_flags "-fpic"
+ gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] $pic_additional_flags
+}
+
+if { [istarget i?86*-*-*] || [istarget x86_64-*-*] } then {
+ lappend additional_flags "-mforce-drap"
+ gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] $additional_flags
+ if { [check_effective_target_fpic] } then {
+ set pic_additional_flags $additional_flags
+ lappend pic_additional_flags "-fpic"
+ gcc-dg-runtest [lsort [glob $srcdir/$subdir/*.c]] $pic_additional_flags
+ }
+}
+
+dg-finish
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/struct-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/struct-1.c
new file mode 100644
index 00000000000..79e3733484b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/struct-1.c
@@ -0,0 +1,28 @@
+/* { dg-do run } */
+
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+void
+foo (void)
+{
+ struct i
+ {
+ aligned i;
+ } i;
+
+ if (check_int (&i.i, __alignof__(i.i)) != i.i)
+ abort ();
+}
+
+int
+main()
+{
+ foo ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/vararg-1.c b/gcc/testsuite/gcc.dg/torture/stackalign/vararg-1.c
new file mode 100644
index 00000000000..62b236522ec
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/vararg-1.c
@@ -0,0 +1,59 @@
+/* { dg-do run } */
+
+#include <stdarg.h>
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+void
+foo (const char *fmt, ...)
+{
+ va_list arg;
+ char *p;
+ aligned i;
+ int size;
+ double x;
+
+ va_start (arg, fmt);
+ 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 ();
+ va_end (arg);
+}
+
+int
+main()
+{
+ foo ("foo", 5, 5.0);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/torture/stackalign/vararg-2.c b/gcc/testsuite/gcc.dg/torture/stackalign/vararg-2.c
new file mode 100644
index 00000000000..00b723b0dc4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/stackalign/vararg-2.c
@@ -0,0 +1,65 @@
+/* { dg-do run } */
+
+#include <stdarg.h>
+#include "check.h"
+
+#ifndef ALIGNMENT
+#define ALIGNMENT 64
+#endif
+
+typedef int aligned __attribute__((aligned(ALIGNMENT)));
+
+int global;
+
+void
+bar (char *p, int size)
+{
+ __builtin_strncpy (p, "good", size);
+}
+
+void
+test (va_list arg)
+{
+ char *p;
+ aligned i;
+ int size;
+ double x;
+
+ 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 ();
+}
+
+void
+foo (const char *fmt, ...)
+{
+ va_list arg;
+ va_start (arg, fmt);
+ test (arg);
+ va_end (arg);
+}
+int
+main()
+{
+ foo ("foo", 5, 5.0);
+ 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-1.c b/gcc/testsuite/gcc.dg/transparent-union-1.c
index a43e07953d3..2360912e3c5 100644
--- a/gcc/testsuite/gcc.dg/transparent-union-1.c
+++ b/gcc/testsuite/gcc.dg/transparent-union-1.c
@@ -81,3 +81,5 @@ main (void)
f13 (&l);
return 0;
}
+
+/* { dg-message "note: expected '\[^\n'\]*' but argument is of type '\[^\n'\]*'" "note: expected" { target *-*-* } 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/20030728-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c
index 3b1ace80f39..1ad2c63653c 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-optimized" } */
+/* { dg-options "-O2 -fdump-tree-final_cleanup" } */
union tree_node;
@@ -42,6 +42,6 @@ objects_must_conflict_p (t1, t2)
}
/* There should be two assignments of variables to the value zero. */
-/* { dg-final { scan-tree-dump-times " = 0" 2 "optimized"} } */
+/* { dg-final { scan-tree-dump-times " = 0" 2 "final_cleanup"} } */
-/* { dg-final { cleanup-tree-dump "optimized" } } */
+/* { dg-final { cleanup-tree-dump "final_cleanup" } } */
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-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/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 577e1795e74..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);
@@ -17,5 +17,5 @@ f (void)
link_error ();
}
-/* { dg-final { scan-tree-dump-times "Folded statement: if " 1 "ccp1"} } */
-/* { dg-final { cleanup-tree-dump "ccp\[1-2\]" } } */
+/* { dg-final { scan-tree-dump-times "Folded into: if " 1 "ccp1"} } */
+/* { 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/pr30375.c b/gcc/testsuite/gcc.dg/tree-ssa/pr30375.c
index 33c3f5c530c..50b3bfd565a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr30375.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr30375.c
@@ -22,5 +22,5 @@ void test_signed_msg_encoding(void)
f();
}
-/* { dg-final { scan-tree-dump-times "signInfo = {};" 1 "dse1" } } */
+/* { dg-final { scan-tree-dump-times "signInfo = {}" 1 "dse1" } } */
/* { dg-final { cleanup-tree-dump "dse*" } } */
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-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/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.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.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/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-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..6a01782bb3d 100644
--- a/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c
+++ b/gcc/testsuite/gcc.dg/vect/fast-math-pr35982.c
@@ -1,6 +1,7 @@
/* { dg-do compile } */
/* { dg-require-effective-target vect_float } */
/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_intfloat_cvt } */
struct mem
{
@@ -19,7 +20,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-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..1e87eef4344 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-11.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-11.c
@@ -106,8 +106,9 @@ 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_intfloat_cvt && vect_strided_wide } && vect_int_mult } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { target { { { ! vect_intfloat_cvt } && 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-18.c b/gcc/testsuite/gcc.dg/vect/slp-18.c
index b8e122c6cfa..91e1e114c1b 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-18.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-18.c
@@ -1,4 +1,5 @@
/* { dg-require-effective-target vect_int } */
+/* { dg-require-effective-target vect_intfloat_cvt } */
#include <stdarg.h>
#include <stdio.h>
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/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-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-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-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/winline-4.c b/gcc/testsuite/gcc.dg/winline-4.c
deleted file mode 100644
index 5ce0a02202d..00000000000
--- a/gcc/testsuite/gcc.dg/winline-4.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-Winline -O1 -fno-unit-at-a-time" } */
-
-inline int q(void); /* { dg-warning "body not available" } */
-inline int t(void)
-{
- return q(); /* { dg-warning "called from here" } */
-}
-int q(void)
-{
-}
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/20060512-1.c b/gcc/testsuite/gcc.target/i386/20060512-1.c
index 3defe648ba7..8109f94b75c 100644
--- a/gcc/testsuite/gcc.target/i386/20060512-1.c
+++ b/gcc/testsuite/gcc.target/i386/20060512-1.c
@@ -1,6 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-std=gnu99 -msse2" } */
+/* { dg-options "-std=gnu99 -msse2 -mpreferred-stack-boundary=4" } */
#include "sse2-check.h"
@@ -28,7 +28,7 @@ sse2_test (void)
int result;
asm ("pushl %esi"); /* Disalign runtime stack. */
result = self_aligning_function (g_1, g_2);
- asm ("popl %esi");
if (result != 42)
abort ();
+ asm ("popl %esi");
}
diff --git a/gcc/testsuite/gcc.target/i386/20060512-2.c b/gcc/testsuite/gcc.target/i386/20060512-2.c
index 0e446cf899e..fe1af563578 100644
--- a/gcc/testsuite/gcc.target/i386/20060512-2.c
+++ b/gcc/testsuite/gcc.target/i386/20060512-2.c
@@ -1,12 +1,12 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-std=gnu99" } */
+/* { dg-options "-std=gnu99 -mpreferred-stack-boundary=4" } */
int
outer_function (int x, int y)
{
int __attribute__ ((__noinline__, __force_align_arg_pointer__))
nested_function (int x, int y)
- { /* { dg-error "force_align_arg_pointer not supported for nested functions" } */
+ {
return (x + y);
}
return (3 + nested_function (x, y));
diff --git a/gcc/testsuite/gcc.target/i386/20060512-3.c b/gcc/testsuite/gcc.target/i386/20060512-3.c
index 5ffa8129e38..847f0eb6d35 100644
--- a/gcc/testsuite/gcc.target/i386/20060512-3.c
+++ b/gcc/testsuite/gcc.target/i386/20060512-3.c
@@ -1,6 +1,6 @@
/* { dg-do run } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-std=gnu99 -msse2 -mstackrealign" } */
+/* { dg-options "-std=gnu99 -msse2 -mstackrealign -mpreferred-stack-boundary=4" } */
#include "sse2-check.h"
@@ -28,7 +28,7 @@ sse2_test (void)
int result;
asm ("pushl %esi"); /* Disalign runtime stack. */
result = self_aligning_function (g_1, g_2);
- asm ("popl %esi");
if (result != 42)
abort ();
+ asm ("popl %esi");
}
diff --git a/gcc/testsuite/gcc.target/i386/20060512-4.c b/gcc/testsuite/gcc.target/i386/20060512-4.c
index f2dd26486b6..ee7b8a4ad88 100644
--- a/gcc/testsuite/gcc.target/i386/20060512-4.c
+++ b/gcc/testsuite/gcc.target/i386/20060512-4.c
@@ -1,12 +1,12 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-mstackrealign" } */
+/* { dg-options "-mstackrealign -mpreferred-stack-boundary=4" } */
int
outer_function (int x, int y)
{
int __attribute__ ((__noinline__))
nested_function (int x, int y)
- { /* { dg-warning "-mstackrealign ignored for nested functions" } */
+ {
return (x + y);
}
return (3 + nested_function (x, y));
diff --git a/gcc/testsuite/gcc.target/i386/aesdec.c b/gcc/testsuite/gcc.target/i386/aesdec.c
index 0cf0d855d22..affe3d19ccc 100644
--- a/gcc/testsuite/gcc.target/i386/aesdec.c
+++ b/gcc/testsuite/gcc.target/i386/aesdec.c
@@ -2,11 +2,19 @@
/* { dg-require-effective-target aes } */
/* { dg-options "-O2 -maes" } */
+#ifndef CHECK_H
+#define CHECK_H "aes-check.h"
+#endif
+
+#ifndef TEST
+#define TEST aes_test
+#endif
+
+#include CHECK_H
+
#include <wmmintrin.h>
#include <string.h>
-#include "aes-check.h"
-
extern void abort (void);
#define NUM 1024
@@ -35,7 +43,7 @@ init_data (__m128i *s1, __m128i *s2, __m128i *d)
}
static void
-aes_test (void)
+TEST (void)
{
int i;
diff --git a/gcc/testsuite/gcc.target/i386/aesdeclast.c b/gcc/testsuite/gcc.target/i386/aesdeclast.c
index 3bf360ec624..417264a134f 100644
--- a/gcc/testsuite/gcc.target/i386/aesdeclast.c
+++ b/gcc/testsuite/gcc.target/i386/aesdeclast.c
@@ -2,11 +2,19 @@
/* { dg-require-effective-target aes } */
/* { dg-options "-O2 -maes" } */
+#ifndef CHECK_H
+#define CHECK_H "aes-check.h"
+#endif
+
+#ifndef TEST
+#define TEST aes_test
+#endif
+
+#include CHECK_H
+
#include <wmmintrin.h>
#include <string.h>
-#include "aes-check.h"
-
extern void abort (void);
#define NUM 1024
@@ -37,7 +45,7 @@ init_data (__m128i *s1, __m128i *s2, __m128i *d)
}
static void
-aes_test (void)
+TEST (void)
{
int i;
diff --git a/gcc/testsuite/gcc.target/i386/aesenc.c b/gcc/testsuite/gcc.target/i386/aesenc.c
index f94a5bcccb1..d2a8b603188 100644
--- a/gcc/testsuite/gcc.target/i386/aesenc.c
+++ b/gcc/testsuite/gcc.target/i386/aesenc.c
@@ -2,11 +2,19 @@
/* { dg-require-effective-target aes } */
/* { dg-options "-O2 -maes" } */
+#ifndef CHECK_H
+#define CHECK_H "aes-check.h"
+#endif
+
+#ifndef TEST
+#define TEST aes_test
+#endif
+
+#include CHECK_H
+
#include <wmmintrin.h>
#include <string.h>
-#include "aes-check.h"
-
extern void abort (void);
#define NUM 1024
@@ -36,7 +44,7 @@ init_data (__m128i *s1, __m128i *s2, __m128i *d)
}
static void
-aes_test (void)
+TEST (void)
{
int i;
diff --git a/gcc/testsuite/gcc.target/i386/aesenclast.c b/gcc/testsuite/gcc.target/i386/aesenclast.c
index 0786316bc57..fd72597e9a4 100644
--- a/gcc/testsuite/gcc.target/i386/aesenclast.c
+++ b/gcc/testsuite/gcc.target/i386/aesenclast.c
@@ -2,11 +2,19 @@
/* { dg-require-effective-target aes } */
/* { dg-options "-O2 -maes" } */
+#ifndef CHECK_H
+#define CHECK_H "aes-check.h"
+#endif
+
+#ifndef TEST
+#define TEST aes_test
+#endif
+
+#include CHECK_H
+
#include <wmmintrin.h>
#include <string.h>
-#include "aes-check.h"
-
extern void abort (void);
#define NUM 1024
@@ -36,7 +44,7 @@ init_data (__m128i *s1, __m128i *s2, __m128i *d)
}
static void
-aes_test (void)
+TEST (void)
{
int i;
diff --git a/gcc/testsuite/gcc.target/i386/aesimc.c b/gcc/testsuite/gcc.target/i386/aesimc.c
index ea56fe870dc..676f919f597 100644
--- a/gcc/testsuite/gcc.target/i386/aesimc.c
+++ b/gcc/testsuite/gcc.target/i386/aesimc.c
@@ -2,11 +2,19 @@
/* { dg-require-effective-target aes } */
/* { dg-options "-O2 -maes" } */
+#ifndef CHECK_H
+#define CHECK_H "aes-check.h"
+#endif
+
+#ifndef TEST
+#define TEST aes_test
+#endif
+
+#include CHECK_H
+
#include <wmmintrin.h>
#include <string.h>
-#include "aes-check.h"
-
extern void abort (void);
#define NUM 1024
@@ -34,7 +42,7 @@ init_data (__m128i *s1, __m128i *d)
}
static void
-aes_test (void)
+TEST (void)
{
int i;
diff --git a/gcc/testsuite/gcc.target/i386/aeskeygenassist.c b/gcc/testsuite/gcc.target/i386/aeskeygenassist.c
index 2fc8ad7efb0..f033bd6a032 100644
--- a/gcc/testsuite/gcc.target/i386/aeskeygenassist.c
+++ b/gcc/testsuite/gcc.target/i386/aeskeygenassist.c
@@ -2,11 +2,19 @@
/* { dg-require-effective-target aes } */
/* { dg-options "-O2 -maes" } */
+#ifndef CHECK_H
+#define CHECK_H "aes-check.h"
+#endif
+
+#ifndef TEST
+#define TEST aes_test
+#endif
+
+#include CHECK_H
+
#include <wmmintrin.h>
#include <string.h>
-#include "aes-check.h"
-
extern void abort (void);
#define NUM 1024
@@ -34,7 +42,7 @@ init_data (__m128i *s1, __m128i *d)
}
static void
-aes_test (void)
+TEST (void)
{
int i;
diff --git a/gcc/testsuite/gcc.target/i386/cold-1.c b/gcc/testsuite/gcc.target/i386/cold-1.c
deleted file mode 100644
index bcdc471eb58..00000000000
--- a/gcc/testsuite/gcc.target/i386/cold-1.c
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Test whether using attribute((cold)) really turns on -Os. Do this test
- by checking whether strcpy calls the library function rather than doing
- the move inline. */
-/* { dg-do compile } */
-/* { dg-options "-O3 -march=k8" } */
-/* { dg-final { scan-assembler "(jmp|call)\t(.*)strcpy" } } */
-
-void cold (char *) __attribute__((__cold__));
-
-void cold (char *a)
-{
- __builtin_strcpy (a, "testing 1.2.3 testing 1.2.3");
-}
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-1.c b/gcc/testsuite/gcc.target/i386/funcspec-1.c
index 1ee43a0bbb8..1416c75f357 100644
--- a/gcc/testsuite/gcc.target/i386/funcspec-1.c
+++ b/gcc/testsuite/gcc.target/i386/funcspec-1.c
@@ -15,7 +15,7 @@ static float a[SIZE] __attribute__((__aligned__(16)));
static float b[SIZE] __attribute__((__aligned__(16)));
static float c[SIZE] __attribute__((__aligned__(16)));
-void sse_addnums (void) __attribute__ ((__option__ ("sse2")));
+void sse_addnums (void) __attribute__ ((__target__ ("sse2")));
void
sse_addnums (void)
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-2.c b/gcc/testsuite/gcc.target/i386/funcspec-2.c
index eb6f48bae1f..e3628e30285 100644
--- a/gcc/testsuite/gcc.target/i386/funcspec-2.c
+++ b/gcc/testsuite/gcc.target/i386/funcspec-2.c
@@ -5,7 +5,7 @@
extern void exit (int);
-#define SSE5_ATTR __attribute__((__option__("sse5,fused-madd")))
+#define SSE5_ATTR __attribute__((__target__("sse5,fused-madd")))
extern float flt_mul_add (float a, float b, float c) SSE5_ATTR;
extern float flt_mul_sub (float a, float b, float c) SSE5_ATTR;
extern float flt_neg_mul_add (float a, float b, float c) SSE5_ATTR;
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-3.c b/gcc/testsuite/gcc.target/i386/funcspec-3.c
index 80ec23da09f..62748beeeff 100644
--- a/gcc/testsuite/gcc.target/i386/funcspec-3.c
+++ b/gcc/testsuite/gcc.target/i386/funcspec-3.c
@@ -7,8 +7,8 @@
extern void exit (int);
extern void abort (void);
-#define SSE4A_ATTR __attribute__((__option__("arch=amdfam10")))
-#define SSE42_ATTR __attribute__((__option__("sse4.2")))
+#define SSE4A_ATTR __attribute__((__target__("arch=amdfam10")))
+#define SSE42_ATTR __attribute__((__target__("sse4.2")))
static int sse4a_pop_i (int a) SSE4A_ATTR;
static long sse42_pop_l (long a) SSE42_ATTR;
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-4.c b/gcc/testsuite/gcc.target/i386/funcspec-4.c
index 71251c314bb..98f545a1ce8 100644
--- a/gcc/testsuite/gcc.target/i386/funcspec-4.c
+++ b/gcc/testsuite/gcc.target/i386/funcspec-4.c
@@ -2,13 +2,13 @@
/* { dg-do compile } */
/* no sse500 switch */
-extern void error1 (void) __attribute__((__option__("sse500"))); /* { dg-error "unknown" } */
+extern void error1 (void) __attribute__((__target__("sse500"))); /* { dg-error "unknown" } */
/* Multiple arch switches */
-extern void error2 (void) __attribute__((__option__("arch=core2,arch=k8"))); /* { dg-error "already specified" } */
+extern void error2 (void) __attribute__((__target__("arch=core2,arch=k8"))); /* { dg-error "already specified" } */
/* Unknown tune target */
-extern void error3 (void) __attribute__((__option__("tune=foobar"))); /* { dg-error "bad value" } */
+extern void error3 (void) __attribute__((__target__("tune=foobar"))); /* { dg-error "bad value" } */
/* option on a variable */
-extern int error4 __attribute__((__option__("sse2"))); /* { dg-warning "ignored" } */
+extern int error4 __attribute__((__target__("sse2"))); /* { dg-warning "ignored" } */
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-5.c b/gcc/testsuite/gcc.target/i386/funcspec-5.c
index d4204bb1411..378dca5f51c 100644
--- a/gcc/testsuite/gcc.target/i386/funcspec-5.c
+++ b/gcc/testsuite/gcc.target/i386/funcspec-5.c
@@ -3,123 +3,123 @@
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
-extern void test_abm (void) __attribute__((__option__("abm")));
-extern void test_aes (void) __attribute__((__option__("aes")));
-extern void test_fused_madd (void) __attribute__((__option__("fused-madd")));
-extern void test_mmx (void) __attribute__((__option__("mmx")));
-extern void test_pclmul (void) __attribute__((__option__("pclmul")));
-extern void test_popcnt (void) __attribute__((__option__("popcnt")));
-extern void test_recip (void) __attribute__((__option__("recip")));
-extern void test_sse (void) __attribute__((__option__("sse")));
-extern void test_sse2 (void) __attribute__((__option__("sse2")));
-extern void test_sse3 (void) __attribute__((__option__("sse3")));
-extern void test_sse4 (void) __attribute__((__option__("sse4")));
-extern void test_sse4_1 (void) __attribute__((__option__("sse4.1")));
-extern void test_sse4_2 (void) __attribute__((__option__("sse4.2")));
-extern void test_sse4a (void) __attribute__((__option__("sse4a")));
-extern void test_sse5 (void) __attribute__((__option__("sse5")));
-extern void test_ssse3 (void) __attribute__((__option__("ssse3")));
+extern void test_abm (void) __attribute__((__target__("abm")));
+extern void test_aes (void) __attribute__((__target__("aes")));
+extern void test_fused_madd (void) __attribute__((__target__("fused-madd")));
+extern void test_mmx (void) __attribute__((__target__("mmx")));
+extern void test_pclmul (void) __attribute__((__target__("pclmul")));
+extern void test_popcnt (void) __attribute__((__target__("popcnt")));
+extern void test_recip (void) __attribute__((__target__("recip")));
+extern void test_sse (void) __attribute__((__target__("sse")));
+extern void test_sse2 (void) __attribute__((__target__("sse2")));
+extern void test_sse3 (void) __attribute__((__target__("sse3")));
+extern void test_sse4 (void) __attribute__((__target__("sse4")));
+extern void test_sse4_1 (void) __attribute__((__target__("sse4.1")));
+extern void test_sse4_2 (void) __attribute__((__target__("sse4.2")));
+extern void test_sse4a (void) __attribute__((__target__("sse4a")));
+extern void test_sse5 (void) __attribute__((__target__("sse5")));
+extern void test_ssse3 (void) __attribute__((__target__("ssse3")));
-extern void test_no_abm (void) __attribute__((__option__("no-abm")));
-extern void test_no_aes (void) __attribute__((__option__("no-aes")));
-extern void test_no_fused_madd (void) __attribute__((__option__("no-fused-madd")));
-extern void test_no_mmx (void) __attribute__((__option__("no-mmx")));
-extern void test_no_pclmul (void) __attribute__((__option__("no-pclmul")));
-extern void test_no_popcnt (void) __attribute__((__option__("no-popcnt")));
-extern void test_no_recip (void) __attribute__((__option__("no-recip")));
-extern void test_no_sse (void) __attribute__((__option__("no-sse")));
-extern void test_no_sse2 (void) __attribute__((__option__("no-sse2")));
-extern void test_no_sse3 (void) __attribute__((__option__("no-sse3")));
-extern void test_no_sse4 (void) __attribute__((__option__("no-sse4")));
-extern void test_no_sse4_1 (void) __attribute__((__option__("no-sse4.1")));
-extern void test_no_sse4_2 (void) __attribute__((__option__("no-sse4.2")));
-extern void test_no_sse4a (void) __attribute__((__option__("no-sse4a")));
-extern void test_no_sse5 (void) __attribute__((__option__("no-sse5")));
-extern void test_no_ssse3 (void) __attribute__((__option__("no-ssse3")));
+extern void test_no_abm (void) __attribute__((__target__("no-abm")));
+extern void test_no_aes (void) __attribute__((__target__("no-aes")));
+extern void test_no_fused_madd (void) __attribute__((__target__("no-fused-madd")));
+extern void test_no_mmx (void) __attribute__((__target__("no-mmx")));
+extern void test_no_pclmul (void) __attribute__((__target__("no-pclmul")));
+extern void test_no_popcnt (void) __attribute__((__target__("no-popcnt")));
+extern void test_no_recip (void) __attribute__((__target__("no-recip")));
+extern void test_no_sse (void) __attribute__((__target__("no-sse")));
+extern void test_no_sse2 (void) __attribute__((__target__("no-sse2")));
+extern void test_no_sse3 (void) __attribute__((__target__("no-sse3")));
+extern void test_no_sse4 (void) __attribute__((__target__("no-sse4")));
+extern void test_no_sse4_1 (void) __attribute__((__target__("no-sse4.1")));
+extern void test_no_sse4_2 (void) __attribute__((__target__("no-sse4.2")));
+extern void test_no_sse4a (void) __attribute__((__target__("no-sse4a")));
+extern void test_no_sse5 (void) __attribute__((__target__("no-sse5")));
+extern void test_no_ssse3 (void) __attribute__((__target__("no-ssse3")));
-extern void test_arch_i386 (void) __attribute__((__option__("arch=i386")));
-extern void test_arch_i486 (void) __attribute__((__option__("arch=i486")));
-extern void test_arch_i586 (void) __attribute__((__option__("arch=i586")));
-extern void test_arch_pentium (void) __attribute__((__option__("arch=pentium")));
-extern void test_arch_pentium_mmx (void) __attribute__((__option__("arch=pentium-mmx")));
-extern void test_arch_winchip_c6 (void) __attribute__((__option__("arch=winchip-c6")));
-extern void test_arch_winchip2 (void) __attribute__((__option__("arch=winchip2")));
-extern void test_arch_c3 (void) __attribute__((__option__("arch=c3")));
-extern void test_arch_c3_2 (void) __attribute__((__option__("arch=c3-2")));
-extern void test_arch_i686 (void) __attribute__((__option__("arch=i686")));
-extern void test_arch_pentiumpro (void) __attribute__((__option__("arch=pentiumpro")));
-extern void test_arch_pentium2 (void) __attribute__((__option__("arch=pentium2")));
-extern void test_arch_pentium3 (void) __attribute__((__option__("arch=pentium3")));
-extern void test_arch_pentium3m (void) __attribute__((__option__("arch=pentium3m")));
-extern void test_arch_pentium_m (void) __attribute__((__option__("arch=pentium-m")));
-extern void test_arch_pentium4 (void) __attribute__((__option__("arch=pentium4")));
-extern void test_arch_pentium4m (void) __attribute__((__option__("arch=pentium4m")));
-extern void test_arch_prescott (void) __attribute__((__option__("arch=prescott")));
-extern void test_arch_nocona (void) __attribute__((__option__("arch=nocona")));
-extern void test_arch_core2 (void) __attribute__((__option__("arch=core2")));
-extern void test_arch_geode (void) __attribute__((__option__("arch=geode")));
-extern void test_arch_k6 (void) __attribute__((__option__("arch=k6")));
-extern void test_arch_k6_2 (void) __attribute__((__option__("arch=k6-2")));
-extern void test_arch_k6_3 (void) __attribute__((__option__("arch=k6-3")));
-extern void test_arch_athlon (void) __attribute__((__option__("arch=athlon")));
-extern void test_arch_athlon_tbird (void) __attribute__((__option__("arch=athlon-tbird")));
-extern void test_arch_athlon_4 (void) __attribute__((__option__("arch=athlon-4")));
-extern void test_arch_athlon_xp (void) __attribute__((__option__("arch=athlon-xp")));
-extern void test_arch_athlon_mp (void) __attribute__((__option__("arch=athlon-mp")));
-extern void test_arch_k8 (void) __attribute__((__option__("arch=k8")));
-extern void test_arch_k8_sse3 (void) __attribute__((__option__("arch=k8-sse3")));
-extern void test_arch_opteron (void) __attribute__((__option__("arch=opteron")));
-extern void test_arch_opteron_sse3 (void) __attribute__((__option__("arch=opteron-sse3")));
-extern void test_arch_athlon64 (void) __attribute__((__option__("arch=athlon64")));
-extern void test_arch_athlon64_sse3 (void) __attribute__((__option__("arch=athlon64-sse3")));
-extern void test_arch_athlon_fx (void) __attribute__((__option__("arch=athlon-fx")));
-extern void test_arch_amdfam10 (void) __attribute__((__option__("arch=amdfam10")));
-extern void test_arch_barcelona (void) __attribute__((__option__("arch=barcelona")));
-extern void test_arch_foo (void) __attribute__((__option__("arch=foo"))); /* { dg-error "bad value" } */
+extern void test_arch_i386 (void) __attribute__((__target__("arch=i386")));
+extern void test_arch_i486 (void) __attribute__((__target__("arch=i486")));
+extern void test_arch_i586 (void) __attribute__((__target__("arch=i586")));
+extern void test_arch_pentium (void) __attribute__((__target__("arch=pentium")));
+extern void test_arch_pentium_mmx (void) __attribute__((__target__("arch=pentium-mmx")));
+extern void test_arch_winchip_c6 (void) __attribute__((__target__("arch=winchip-c6")));
+extern void test_arch_winchip2 (void) __attribute__((__target__("arch=winchip2")));
+extern void test_arch_c3 (void) __attribute__((__target__("arch=c3")));
+extern void test_arch_c3_2 (void) __attribute__((__target__("arch=c3-2")));
+extern void test_arch_i686 (void) __attribute__((__target__("arch=i686")));
+extern void test_arch_pentiumpro (void) __attribute__((__target__("arch=pentiumpro")));
+extern void test_arch_pentium2 (void) __attribute__((__target__("arch=pentium2")));
+extern void test_arch_pentium3 (void) __attribute__((__target__("arch=pentium3")));
+extern void test_arch_pentium3m (void) __attribute__((__target__("arch=pentium3m")));
+extern void test_arch_pentium_m (void) __attribute__((__target__("arch=pentium-m")));
+extern void test_arch_pentium4 (void) __attribute__((__target__("arch=pentium4")));
+extern void test_arch_pentium4m (void) __attribute__((__target__("arch=pentium4m")));
+extern void test_arch_prescott (void) __attribute__((__target__("arch=prescott")));
+extern void test_arch_nocona (void) __attribute__((__target__("arch=nocona")));
+extern void test_arch_core2 (void) __attribute__((__target__("arch=core2")));
+extern void test_arch_geode (void) __attribute__((__target__("arch=geode")));
+extern void test_arch_k6 (void) __attribute__((__target__("arch=k6")));
+extern void test_arch_k6_2 (void) __attribute__((__target__("arch=k6-2")));
+extern void test_arch_k6_3 (void) __attribute__((__target__("arch=k6-3")));
+extern void test_arch_athlon (void) __attribute__((__target__("arch=athlon")));
+extern void test_arch_athlon_tbird (void) __attribute__((__target__("arch=athlon-tbird")));
+extern void test_arch_athlon_4 (void) __attribute__((__target__("arch=athlon-4")));
+extern void test_arch_athlon_xp (void) __attribute__((__target__("arch=athlon-xp")));
+extern void test_arch_athlon_mp (void) __attribute__((__target__("arch=athlon-mp")));
+extern void test_arch_k8 (void) __attribute__((__target__("arch=k8")));
+extern void test_arch_k8_sse3 (void) __attribute__((__target__("arch=k8-sse3")));
+extern void test_arch_opteron (void) __attribute__((__target__("arch=opteron")));
+extern void test_arch_opteron_sse3 (void) __attribute__((__target__("arch=opteron-sse3")));
+extern void test_arch_athlon64 (void) __attribute__((__target__("arch=athlon64")));
+extern void test_arch_athlon64_sse3 (void) __attribute__((__target__("arch=athlon64-sse3")));
+extern void test_arch_athlon_fx (void) __attribute__((__target__("arch=athlon-fx")));
+extern void test_arch_amdfam10 (void) __attribute__((__target__("arch=amdfam10")));
+extern void test_arch_barcelona (void) __attribute__((__target__("arch=barcelona")));
+extern void test_arch_foo (void) __attribute__((__target__("arch=foo"))); /* { dg-error "bad value" } */
-extern void test_tune_i386 (void) __attribute__((__option__("tune=i386")));
-extern void test_tune_i486 (void) __attribute__((__option__("tune=i486")));
-extern void test_tune_i586 (void) __attribute__((__option__("tune=i586")));
-extern void test_tune_pentium (void) __attribute__((__option__("tune=pentium")));
-extern void test_tune_pentium_mmx (void) __attribute__((__option__("tune=pentium-mmx")));
-extern void test_tune_winchip_c6 (void) __attribute__((__option__("tune=winchip-c6")));
-extern void test_tune_winchip2 (void) __attribute__((__option__("tune=winchip2")));
-extern void test_tune_c3 (void) __attribute__((__option__("tune=c3")));
-extern void test_tune_c3_2 (void) __attribute__((__option__("tune=c3-2")));
-extern void test_tune_i686 (void) __attribute__((__option__("tune=i686")));
-extern void test_tune_pentiumpro (void) __attribute__((__option__("tune=pentiumpro")));
-extern void test_tune_pentium2 (void) __attribute__((__option__("tune=pentium2")));
-extern void test_tune_pentium3 (void) __attribute__((__option__("tune=pentium3")));
-extern void test_tune_pentium3m (void) __attribute__((__option__("tune=pentium3m")));
-extern void test_tune_pentium_m (void) __attribute__((__option__("tune=pentium-m")));
-extern void test_tune_pentium4 (void) __attribute__((__option__("tune=pentium4")));
-extern void test_tune_pentium4m (void) __attribute__((__option__("tune=pentium4m")));
-extern void test_tune_prescott (void) __attribute__((__option__("tune=prescott")));
-extern void test_tune_nocona (void) __attribute__((__option__("tune=nocona")));
-extern void test_tune_core2 (void) __attribute__((__option__("tune=core2")));
-extern void test_tune_geode (void) __attribute__((__option__("tune=geode")));
-extern void test_tune_k6 (void) __attribute__((__option__("tune=k6")));
-extern void test_tune_k6_2 (void) __attribute__((__option__("tune=k6-2")));
-extern void test_tune_k6_3 (void) __attribute__((__option__("tune=k6-3")));
-extern void test_tune_athlon (void) __attribute__((__option__("tune=athlon")));
-extern void test_tune_athlon_tbird (void) __attribute__((__option__("tune=athlon-tbird")));
-extern void test_tune_athlon_4 (void) __attribute__((__option__("tune=athlon-4")));
-extern void test_tune_athlon_xp (void) __attribute__((__option__("tune=athlon-xp")));
-extern void test_tune_athlon_mp (void) __attribute__((__option__("tune=athlon-mp")));
-extern void test_tune_k8 (void) __attribute__((__option__("tune=k8")));
-extern void test_tune_k8_sse3 (void) __attribute__((__option__("tune=k8-sse3")));
-extern void test_tune_opteron (void) __attribute__((__option__("tune=opteron")));
-extern void test_tune_opteron_sse3 (void) __attribute__((__option__("tune=opteron-sse3")));
-extern void test_tune_athlon64 (void) __attribute__((__option__("tune=athlon64")));
-extern void test_tune_athlon64_sse3 (void) __attribute__((__option__("tune=athlon64-sse3")));
-extern void test_tune_athlon_fx (void) __attribute__((__option__("tune=athlon-fx")));
-extern void test_tune_amdfam10 (void) __attribute__((__option__("tune=amdfam10")));
-extern void test_tune_barcelona (void) __attribute__((__option__("tune=barcelona")));
-extern void test_tune_generic (void) __attribute__((__option__("tune=generic")));
-extern void test_tune_foo (void) __attribute__((__option__("tune=foo"))); /* { dg-error "bad value" } */
+extern void test_tune_i386 (void) __attribute__((__target__("tune=i386")));
+extern void test_tune_i486 (void) __attribute__((__target__("tune=i486")));
+extern void test_tune_i586 (void) __attribute__((__target__("tune=i586")));
+extern void test_tune_pentium (void) __attribute__((__target__("tune=pentium")));
+extern void test_tune_pentium_mmx (void) __attribute__((__target__("tune=pentium-mmx")));
+extern void test_tune_winchip_c6 (void) __attribute__((__target__("tune=winchip-c6")));
+extern void test_tune_winchip2 (void) __attribute__((__target__("tune=winchip2")));
+extern void test_tune_c3 (void) __attribute__((__target__("tune=c3")));
+extern void test_tune_c3_2 (void) __attribute__((__target__("tune=c3-2")));
+extern void test_tune_i686 (void) __attribute__((__target__("tune=i686")));
+extern void test_tune_pentiumpro (void) __attribute__((__target__("tune=pentiumpro")));
+extern void test_tune_pentium2 (void) __attribute__((__target__("tune=pentium2")));
+extern void test_tune_pentium3 (void) __attribute__((__target__("tune=pentium3")));
+extern void test_tune_pentium3m (void) __attribute__((__target__("tune=pentium3m")));
+extern void test_tune_pentium_m (void) __attribute__((__target__("tune=pentium-m")));
+extern void test_tune_pentium4 (void) __attribute__((__target__("tune=pentium4")));
+extern void test_tune_pentium4m (void) __attribute__((__target__("tune=pentium4m")));
+extern void test_tune_prescott (void) __attribute__((__target__("tune=prescott")));
+extern void test_tune_nocona (void) __attribute__((__target__("tune=nocona")));
+extern void test_tune_core2 (void) __attribute__((__target__("tune=core2")));
+extern void test_tune_geode (void) __attribute__((__target__("tune=geode")));
+extern void test_tune_k6 (void) __attribute__((__target__("tune=k6")));
+extern void test_tune_k6_2 (void) __attribute__((__target__("tune=k6-2")));
+extern void test_tune_k6_3 (void) __attribute__((__target__("tune=k6-3")));
+extern void test_tune_athlon (void) __attribute__((__target__("tune=athlon")));
+extern void test_tune_athlon_tbird (void) __attribute__((__target__("tune=athlon-tbird")));
+extern void test_tune_athlon_4 (void) __attribute__((__target__("tune=athlon-4")));
+extern void test_tune_athlon_xp (void) __attribute__((__target__("tune=athlon-xp")));
+extern void test_tune_athlon_mp (void) __attribute__((__target__("tune=athlon-mp")));
+extern void test_tune_k8 (void) __attribute__((__target__("tune=k8")));
+extern void test_tune_k8_sse3 (void) __attribute__((__target__("tune=k8-sse3")));
+extern void test_tune_opteron (void) __attribute__((__target__("tune=opteron")));
+extern void test_tune_opteron_sse3 (void) __attribute__((__target__("tune=opteron-sse3")));
+extern void test_tune_athlon64 (void) __attribute__((__target__("tune=athlon64")));
+extern void test_tune_athlon64_sse3 (void) __attribute__((__target__("tune=athlon64-sse3")));
+extern void test_tune_athlon_fx (void) __attribute__((__target__("tune=athlon-fx")));
+extern void test_tune_amdfam10 (void) __attribute__((__target__("tune=amdfam10")));
+extern void test_tune_barcelona (void) __attribute__((__target__("tune=barcelona")));
+extern void test_tune_generic (void) __attribute__((__target__("tune=generic")));
+extern void test_tune_foo (void) __attribute__((__target__("tune=foo"))); /* { dg-error "bad value" } */
-extern void test_fpmath_sse (void) __attribute__((__option__("sse2,fpmath=sse")));
-extern void test_fpmath_387 (void) __attribute__((__option__("sse2,fpmath=387")));
-extern void test_fpmath_sse_387 (void) __attribute__((__option__("sse2,fpmath=sse+387")));
-extern void test_fpmath_387_sse (void) __attribute__((__option__("sse2,fpmath=387+sse")));
-extern void test_fpmath_both (void) __attribute__((__option__("sse2,fpmath=both")));
+extern void test_fpmath_sse (void) __attribute__((__target__("sse2,fpmath=sse")));
+extern void test_fpmath_387 (void) __attribute__((__target__("sse2,fpmath=387")));
+extern void test_fpmath_sse_387 (void) __attribute__((__target__("sse2,fpmath=sse+387")));
+extern void test_fpmath_387_sse (void) __attribute__((__target__("sse2,fpmath=387+sse")));
+extern void test_fpmath_both (void) __attribute__((__target__("sse2,fpmath=both")));
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-6.c b/gcc/testsuite/gcc.target/i386/funcspec-6.c
index 0c915975894..6b526c2dcc3 100644
--- a/gcc/testsuite/gcc.target/i386/funcspec-6.c
+++ b/gcc/testsuite/gcc.target/i386/funcspec-6.c
@@ -3,69 +3,69 @@
/* { dg-do compile } */
/* { dg-require-effective-target lp64 } */
-extern void test_abm (void) __attribute__((__option__("abm")));
-extern void test_aes (void) __attribute__((__option__("aes")));
-extern void test_fused_madd (void) __attribute__((__option__("fused-madd")));
-extern void test_mmx (void) __attribute__((__option__("mmx")));
-extern void test_pclmul (void) __attribute__((__option__("pclmul")));
-extern void test_popcnt (void) __attribute__((__option__("popcnt")));
-extern void test_recip (void) __attribute__((__option__("recip")));
-extern void test_sse (void) __attribute__((__option__("sse")));
-extern void test_sse2 (void) __attribute__((__option__("sse2")));
-extern void test_sse3 (void) __attribute__((__option__("sse3")));
-extern void test_sse4 (void) __attribute__((__option__("sse4")));
-extern void test_sse4_1 (void) __attribute__((__option__("sse4.1")));
-extern void test_sse4_2 (void) __attribute__((__option__("sse4.2")));
-extern void test_sse4a (void) __attribute__((__option__("sse4a")));
-extern void test_sse5 (void) __attribute__((__option__("sse5")));
-extern void test_ssse3 (void) __attribute__((__option__("ssse3")));
+extern void test_abm (void) __attribute__((__target__("abm")));
+extern void test_aes (void) __attribute__((__target__("aes")));
+extern void test_fused_madd (void) __attribute__((__target__("fused-madd")));
+extern void test_mmx (void) __attribute__((__target__("mmx")));
+extern void test_pclmul (void) __attribute__((__target__("pclmul")));
+extern void test_popcnt (void) __attribute__((__target__("popcnt")));
+extern void test_recip (void) __attribute__((__target__("recip")));
+extern void test_sse (void) __attribute__((__target__("sse")));
+extern void test_sse2 (void) __attribute__((__target__("sse2")));
+extern void test_sse3 (void) __attribute__((__target__("sse3")));
+extern void test_sse4 (void) __attribute__((__target__("sse4")));
+extern void test_sse4_1 (void) __attribute__((__target__("sse4.1")));
+extern void test_sse4_2 (void) __attribute__((__target__("sse4.2")));
+extern void test_sse4a (void) __attribute__((__target__("sse4a")));
+extern void test_sse5 (void) __attribute__((__target__("sse5")));
+extern void test_ssse3 (void) __attribute__((__target__("ssse3")));
-extern void test_no_abm (void) __attribute__((__option__("no-abm")));
-extern void test_no_aes (void) __attribute__((__option__("no-aes")));
-extern void test_no_fused_madd (void) __attribute__((__option__("no-fused-madd")));
-extern void test_no_mmx (void) __attribute__((__option__("no-mmx")));
-extern void test_no_pclmul (void) __attribute__((__option__("no-pclmul")));
-extern void test_no_popcnt (void) __attribute__((__option__("no-popcnt")));
-extern void test_no_recip (void) __attribute__((__option__("no-recip")));
-extern void test_no_sse (void) __attribute__((__option__("no-sse")));
-extern void test_no_sse2 (void) __attribute__((__option__("no-sse2")));
-extern void test_no_sse3 (void) __attribute__((__option__("no-sse3")));
-extern void test_no_sse4 (void) __attribute__((__option__("no-sse4")));
-extern void test_no_sse4_1 (void) __attribute__((__option__("no-sse4.1")));
-extern void test_no_sse4_2 (void) __attribute__((__option__("no-sse4.2")));
-extern void test_no_sse4a (void) __attribute__((__option__("no-sse4a")));
-extern void test_no_sse5 (void) __attribute__((__option__("no-sse5")));
-extern void test_no_ssse3 (void) __attribute__((__option__("no-ssse3")));
+extern void test_no_abm (void) __attribute__((__target__("no-abm")));
+extern void test_no_aes (void) __attribute__((__target__("no-aes")));
+extern void test_no_fused_madd (void) __attribute__((__target__("no-fused-madd")));
+extern void test_no_mmx (void) __attribute__((__target__("no-mmx")));
+extern void test_no_pclmul (void) __attribute__((__target__("no-pclmul")));
+extern void test_no_popcnt (void) __attribute__((__target__("no-popcnt")));
+extern void test_no_recip (void) __attribute__((__target__("no-recip")));
+extern void test_no_sse (void) __attribute__((__target__("no-sse")));
+extern void test_no_sse2 (void) __attribute__((__target__("no-sse2")));
+extern void test_no_sse3 (void) __attribute__((__target__("no-sse3")));
+extern void test_no_sse4 (void) __attribute__((__target__("no-sse4")));
+extern void test_no_sse4_1 (void) __attribute__((__target__("no-sse4.1")));
+extern void test_no_sse4_2 (void) __attribute__((__target__("no-sse4.2")));
+extern void test_no_sse4a (void) __attribute__((__target__("no-sse4a")));
+extern void test_no_sse5 (void) __attribute__((__target__("no-sse5")));
+extern void test_no_ssse3 (void) __attribute__((__target__("no-ssse3")));
-extern void test_arch_nocona (void) __attribute__((__option__("arch=nocona")));
-extern void test_arch_core2 (void) __attribute__((__option__("arch=core2")));
-extern void test_arch_k8 (void) __attribute__((__option__("arch=k8")));
-extern void test_arch_k8_sse3 (void) __attribute__((__option__("arch=k8-sse3")));
-extern void test_arch_opteron (void) __attribute__((__option__("arch=opteron")));
-extern void test_arch_opteron_sse3 (void) __attribute__((__option__("arch=opteron-sse3")));
-extern void test_arch_athlon64 (void) __attribute__((__option__("arch=athlon64")));
-extern void test_arch_athlon64_sse3 (void) __attribute__((__option__("arch=athlon64-sse3")));
-extern void test_arch_athlon_fx (void) __attribute__((__option__("arch=athlon-fx")));
-extern void test_arch_amdfam10 (void) __attribute__((__option__("arch=amdfam10")));
-extern void test_arch_barcelona (void) __attribute__((__option__("arch=barcelona")));
-extern void test_arch_foo (void) __attribute__((__option__("arch=foo"))); /* { dg-error "bad value" } */
+extern void test_arch_nocona (void) __attribute__((__target__("arch=nocona")));
+extern void test_arch_core2 (void) __attribute__((__target__("arch=core2")));
+extern void test_arch_k8 (void) __attribute__((__target__("arch=k8")));
+extern void test_arch_k8_sse3 (void) __attribute__((__target__("arch=k8-sse3")));
+extern void test_arch_opteron (void) __attribute__((__target__("arch=opteron")));
+extern void test_arch_opteron_sse3 (void) __attribute__((__target__("arch=opteron-sse3")));
+extern void test_arch_athlon64 (void) __attribute__((__target__("arch=athlon64")));
+extern void test_arch_athlon64_sse3 (void) __attribute__((__target__("arch=athlon64-sse3")));
+extern void test_arch_athlon_fx (void) __attribute__((__target__("arch=athlon-fx")));
+extern void test_arch_amdfam10 (void) __attribute__((__target__("arch=amdfam10")));
+extern void test_arch_barcelona (void) __attribute__((__target__("arch=barcelona")));
+extern void test_arch_foo (void) __attribute__((__target__("arch=foo"))); /* { dg-error "bad value" } */
-extern void test_tune_nocona (void) __attribute__((__option__("tune=nocona")));
-extern void test_tune_core2 (void) __attribute__((__option__("tune=core2")));
-extern void test_tune_k8 (void) __attribute__((__option__("tune=k8")));
-extern void test_tune_k8_sse3 (void) __attribute__((__option__("tune=k8-sse3")));
-extern void test_tune_opteron (void) __attribute__((__option__("tune=opteron")));
-extern void test_tune_opteron_sse3 (void) __attribute__((__option__("tune=opteron-sse3")));
-extern void test_tune_athlon64 (void) __attribute__((__option__("tune=athlon64")));
-extern void test_tune_athlon64_sse3 (void) __attribute__((__option__("tune=athlon64-sse3")));
-extern void test_tune_athlon_fx (void) __attribute__((__option__("tune=athlon-fx")));
-extern void test_tune_amdfam10 (void) __attribute__((__option__("tune=amdfam10")));
-extern void test_tune_barcelona (void) __attribute__((__option__("tune=barcelona")));
-extern void test_tune_generic (void) __attribute__((__option__("tune=generic")));
-extern void test_tune_foo (void) __attribute__((__option__("tune=foo"))); /* { dg-error "bad value" } */
+extern void test_tune_nocona (void) __attribute__((__target__("tune=nocona")));
+extern void test_tune_core2 (void) __attribute__((__target__("tune=core2")));
+extern void test_tune_k8 (void) __attribute__((__target__("tune=k8")));
+extern void test_tune_k8_sse3 (void) __attribute__((__target__("tune=k8-sse3")));
+extern void test_tune_opteron (void) __attribute__((__target__("tune=opteron")));
+extern void test_tune_opteron_sse3 (void) __attribute__((__target__("tune=opteron-sse3")));
+extern void test_tune_athlon64 (void) __attribute__((__target__("tune=athlon64")));
+extern void test_tune_athlon64_sse3 (void) __attribute__((__target__("tune=athlon64-sse3")));
+extern void test_tune_athlon_fx (void) __attribute__((__target__("tune=athlon-fx")));
+extern void test_tune_amdfam10 (void) __attribute__((__target__("tune=amdfam10")));
+extern void test_tune_barcelona (void) __attribute__((__target__("tune=barcelona")));
+extern void test_tune_generic (void) __attribute__((__target__("tune=generic")));
+extern void test_tune_foo (void) __attribute__((__target__("tune=foo"))); /* { dg-error "bad value" } */
-extern void test_fpmath_sse (void) __attribute__((__option__("sse2,fpmath=sse")));
-extern void test_fpmath_387 (void) __attribute__((__option__("sse2,fpmath=387")));
-extern void test_fpmath_sse_387 (void) __attribute__((__option__("sse2,fpmath=sse+387")));
-extern void test_fpmath_387_sse (void) __attribute__((__option__("sse2,fpmath=387+sse")));
-extern void test_fpmath_both (void) __attribute__((__option__("sse2,fpmath=both")));
+extern void test_fpmath_sse (void) __attribute__((__target__("sse2,fpmath=sse")));
+extern void test_fpmath_387 (void) __attribute__((__target__("sse2,fpmath=387")));
+extern void test_fpmath_sse_387 (void) __attribute__((__target__("sse2,fpmath=sse+387")));
+extern void test_fpmath_387_sse (void) __attribute__((__target__("sse2,fpmath=387+sse")));
+extern void test_fpmath_both (void) __attribute__((__target__("sse2,fpmath=both")));
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-7.c b/gcc/testsuite/gcc.target/i386/funcspec-7.c
index a65ae251978..56b5490501a 100644
--- a/gcc/testsuite/gcc.target/i386/funcspec-7.c
+++ b/gcc/testsuite/gcc.target/i386/funcspec-7.c
@@ -3,7 +3,7 @@
/* { dg-do compile } */
/* { dg-options "-O2 -march=k8 -mno-recip -mfpmath=sse -ffast-math" } */
-float do_recip (float a) __attribute__((__option__("recip")));
+float do_recip (float a) __attribute__((__target__("recip")));
float do_normal (float a);
float do_recip (float a) { return 1.0f / __builtin_sqrtf (a); }
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-8.c b/gcc/testsuite/gcc.target/i386/funcspec-8.c
index 115f60866a2..2478c672d0c 100644
--- a/gcc/testsuite/gcc.target/i386/funcspec-8.c
+++ b/gcc/testsuite/gcc.target/i386/funcspec-8.c
@@ -12,7 +12,7 @@ typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
#error "-msse3 should not be set for this test"
#endif
-__m128d sse3_hsubpd (__m128d a, __m128d b) __attribute__((__option__("sse3")));
+__m128d sse3_hsubpd (__m128d a, __m128d b) __attribute__((__target__("sse3")));
__m128d generic_hsubpd (__m128d a, __m128d b);
__m128d
@@ -31,7 +31,7 @@ generic_hsubpd (__m128d a, __m128d b)
#error "-mssse3 should not be set for this test"
#endif
-__m128w ssse3_psignd128 (__m128w a, __m128w b) __attribute__((__option__("ssse3")));
+__m128w ssse3_psignd128 (__m128w a, __m128w b) __attribute__((__target__("ssse3")));
__m128w generic_psignd (__m128w ab, __m128w b);
__m128w
@@ -50,7 +50,7 @@ generic_psignd128 (__m128w a, __m128w b)
#error "-msse4.1 should not be set for this test"
#endif
-__m128d sse4_1_blendvpd (__m128d a, __m128d b, __m128d c) __attribute__((__option__("sse4.1")));
+__m128d sse4_1_blendvpd (__m128d a, __m128d b, __m128d c) __attribute__((__target__("sse4.1")));
__m128d generic_blendvpd (__m128d a, __m128d b, __m128d c);
__m128d
@@ -69,7 +69,7 @@ generic_blendvpd (__m128d a, __m128d b, __m128d c)
#error "-msse4.2 should not be set for this test"
#endif
-__m128i sse4_2_pcmpgtq (__m128i a, __m128i b) __attribute__((__option__("sse4.2")));
+__m128i sse4_2_pcmpgtq (__m128i a, __m128i b) __attribute__((__target__("sse4.2")));
__m128i generic_pcmpgtq (__m128i ab, __m128i b);
__m128i
@@ -88,7 +88,7 @@ generic_pcmpgtq (__m128i a, __m128i b)
#error "-msse4a should not be set for this test"
#endif
-__m128i sse4_2_insertq (__m128i a, __m128i b) __attribute__((__option__("sse4a")));
+__m128i sse4_2_insertq (__m128i a, __m128i b) __attribute__((__target__("sse4a")));
__m128i generic_insertq (__m128i ab, __m128i b);
__m128i
@@ -107,7 +107,7 @@ generic_insertq (__m128i a, __m128i b)
#error "-msse5 should not be set for this test"
#endif
-__m128d sse5_fmaddpd (__m128d a, __m128d b, __m128d c) __attribute__((__option__("sse5")));
+__m128d sse5_fmaddpd (__m128d a, __m128d b, __m128d c) __attribute__((__target__("sse5")));
__m128d generic_fmaddpd (__m128d a, __m128d b, __m128d c);
__m128d
@@ -126,7 +126,7 @@ generic_fmaddpd (__m128d a, __m128d b, __m128d c)
#error "-maes should not be set for this test"
#endif
-__m128i aes_aesimc128 (__m128i a) __attribute__((__option__("aes")));
+__m128i aes_aesimc128 (__m128i a) __attribute__((__target__("aes")));
__m128i generic_aesimc128 (__m128i a);
__m128i
@@ -145,7 +145,7 @@ generic_aesimc128 (__m128i a)
#error "-mpclmul should not be set for this test"
#endif
-__m128i pclmul_pclmulqdq128 (__m128i a, __m128i b) __attribute__((__option__("pclmul")));
+__m128i pclmul_pclmulqdq128 (__m128i a, __m128i b) __attribute__((__target__("pclmul")));
__m128i generic_pclmulqdq128 (__m128i a, __m128i b);
__m128i
diff --git a/gcc/testsuite/gcc.target/i386/funcspec-9.c b/gcc/testsuite/gcc.target/i386/funcspec-9.c
index e6d19013101..1a7fc1b5890 100644
--- a/gcc/testsuite/gcc.target/i386/funcspec-9.c
+++ b/gcc/testsuite/gcc.target/i386/funcspec-9.c
@@ -5,14 +5,14 @@
extern void exit (int);
#ifdef __SSE5__
-#warning "__SSE5__ should not be defined before #pragma GCC option."
+#warning "__SSE5__ should not be defined before #pragma GCC target."
#endif
-#pragma GCC option (push)
-#pragma GCC option ("sse5,fused-madd")
+#pragma GCC push_options
+#pragma GCC target ("sse5,fused-madd")
#ifndef __SSE5__
-#warning "__SSE5__ should have be defined after #pragma GCC option."
+#warning "__SSE5__ should have be defined after #pragma GCC target."
#endif
float
@@ -21,9 +21,9 @@ flt_mul_add (float a, float b, float c)
return (a * b) + c;
}
-#pragma GCC option (pop)
+#pragma GCC pop_options
#ifdef __SSE5__
-#warning "__SSE5__ should not be defined after #pragma GCC pop option."
+#warning "__SSE5__ should not be defined after #pragma GCC pop target."
#endif
double
diff --git a/gcc/testsuite/gcc.target/i386/hot-1.c b/gcc/testsuite/gcc.target/i386/hot-1.c
deleted file mode 100644
index 608f52fd6eb..00000000000
--- a/gcc/testsuite/gcc.target/i386/hot-1.c
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Test whether using attribute((hot)) really turns on -O3. Do this test
- by checking whether we vectorize a simple loop. */
-/* { dg-do compile } */
-/* { dg-options "-O1 -msse2 -mfpmath=sse -march=k8" } */
-/* { dg-final { scan-assembler "addps" } } */
-/* { dg-final { scan-assembler "subss" } } */
-
-#define SIZE 1024
-float a[SIZE] __attribute__((__aligned__(32)));
-float b[SIZE] __attribute__((__aligned__(32)));
-float c[SIZE] __attribute__((__aligned__(32)));
-
-/* This should vectorize. */
-void hot (void) __attribute__((__hot__));
-
-void
-hot (void)
-{
- int i;
-
- for (i = 0; i < SIZE; i++)
- a[i] = b[i] + c[i];
-}
-
-/* This should not vectorize. */
-void
-not_hot (void)
-{
- int i;
-
- for (i = 0; i < SIZE; i++)
- a[i] = b[i] - c[i];
-}
diff --git a/gcc/testsuite/gcc.target/i386/i386.exp b/gcc/testsuite/gcc.target/i386/i386.exp
index e28ce933c7f..612bec48e79 100644
--- a/gcc/testsuite/gcc.target/i386/i386.exp
+++ b/gcc/testsuite/gcc.target/i386/i386.exp
@@ -64,6 +64,19 @@ proc check_effective_target_aes { } {
} "-O2 -maes" ]
}
+# Return 1 if vaes instructions can be compiled.
+proc check_effective_target_vaes { } {
+ return [check_no_compiler_messages vaes object {
+ typedef long long __m128i __attribute__ ((__vector_size__ (16)));
+ typedef long long __v2di __attribute__ ((__vector_size__ (16)));
+
+ __m128i _mm_aesimc_si128 (__m128i __X)
+ {
+ return (__m128i) __builtin_ia32_aesimc128 ((__v2di)__X);
+ }
+ } "-O2 -maes -mavx" ]
+}
+
# Return 1 if pclmul instructions can be compiled.
proc check_effective_target_pclmul { } {
return [check_no_compiler_messages pclmul object {
diff --git a/gcc/testsuite/gcc.target/i386/m128-check.h b/gcc/testsuite/gcc.target/i386/m128-check.h
index a20f8215082..071381fd25c 100644
--- a/gcc/testsuite/gcc.target/i386/m128-check.h
+++ b/gcc/testsuite/gcc.target/i386/m128-check.h
@@ -1,4 +1,7 @@
#include <stdio.h>
+#include <xmmintrin.h>
+
+#ifdef __SSE2__
#include <emmintrin.h>
typedef union
@@ -10,12 +13,24 @@ typedef union
typedef union
{
__m128i x;
+ unsigned char a[16];
+} union128i_ub;
+
+typedef union
+{
+ __m128i x;
short a[8];
} union128i_w;
typedef union
{
__m128i x;
+ unsigned short a[8];
+} union128i_uw;
+
+typedef union
+{
+ __m128i x;
int a[4];
} union128i_d;
@@ -27,15 +42,16 @@ typedef union
typedef union
{
- __m128 x;
- float a[4];
-} union128;
-
-typedef union
-{
__m128d x;
double a[2];
} union128d;
+#endif
+
+typedef union
+{
+ __m128 x;
+ float a[4];
+} union128;
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(A) (sizeof (A) / sizeof ((A)[0]))
@@ -65,9 +81,82 @@ check_##UINON_TYPE (UINON_TYPE u, const VALUE_TYPE *v) \
return err; \
}
+#ifdef __SSE2__
CHECK_EXP (union128i_b, char, "%d")
+CHECK_EXP (union128i_ub, unsigned char, "%d")
CHECK_EXP (union128i_w, short, "%d")
+CHECK_EXP (union128i_uw, unsigned short, "%d")
CHECK_EXP (union128i_d, int, "0x%x")
CHECK_EXP (union128i_q, long long, "0x%llx")
-CHECK_EXP (union128, float, "%f")
CHECK_EXP (union128d, double, "%f")
+#endif
+
+CHECK_EXP (union128, float, "%f")
+
+#define ESP_FLOAT 0.000001
+#define ESP_DOUBLE 0.000001
+#define CHECK_ARRAY(ARRAY, TYPE, FMT) \
+static int \
+__attribute__((noinline, unused)) \
+checkV##ARRAY (const TYPE *v, const TYPE *e, int n) \
+{ \
+ int i; \
+ int err = 0; \
+ \
+ for (i = 0; i < n; i++) \
+ if (v[i] != e[i]) \
+ { \
+ err++; \
+ PRINTF ("%i: " FMT " != " FMT "\n", \
+ i, v[i], e[i]); \
+ } \
+ return err; \
+}
+
+CHECK_ARRAY(i, int, "0x%x")
+CHECK_ARRAY(l, long long, "0x%llx")
+
+#define CHECK_FP_ARRAY(ARRAY, TYPE, ESP, FMT) \
+static int \
+__attribute__((noinline, unused)) \
+checkV##ARRAY (const TYPE *v, const TYPE *e, int n) \
+{ \
+ int i; \
+ int err = 0; \
+ \
+ for (i = 0; i < n; i++) \
+ if (v[i] > (e[i] + (ESP)) || v[i] < (e[i] - (ESP))) \
+ if (e[i] != v[i]) \
+ { \
+ err++; \
+ PRINTF ("%i: " FMT " != " FMT "\n", \
+ i, v[i], e[i]); \
+ } \
+ return err; \
+}
+
+CHECK_FP_ARRAY (d, double, ESP_DOUBLE, "%f")
+CHECK_FP_ARRAY (f, float, ESP_FLOAT, "%f")
+
+union ieee754_float
+{
+ float d;
+ struct
+ {
+ unsigned long frac : 23;
+ unsigned exp : 8;
+ unsigned sign : 1;
+ } bits __attribute__((packed));
+};
+
+union ieee754_double
+{
+ double d;
+ struct
+ {
+ unsigned long frac1 : 32;
+ unsigned long frac0 : 20;
+ unsigned exp : 11;
+ unsigned sign : 1;
+ } bits __attribute__((packed));
+};
diff --git a/gcc/testsuite/gcc.target/i386/opt-2.c b/gcc/testsuite/gcc.target/i386/opt-2.c
index 8d6ba6fe925..d2791e071c3 100644
--- a/gcc/testsuite/gcc.target/i386/opt-2.c
+++ b/gcc/testsuite/gcc.target/i386/opt-2.c
@@ -12,7 +12,7 @@ float b[SIZE] __attribute__((__aligned__(32)));
float c[SIZE] __attribute__((__aligned__(32)));
/* This should vectorize. */
-#pragma GCC optimize push
+#pragma GCC push_options
#pragma GCC optimize (3, "unroll-all-loops", "-fprefetch-loop-arrays")
void
@@ -24,7 +24,7 @@ opt3 (void)
a[i] = b[i] + c[i];
}
-#pragma GCC optimize pop
+#pragma GCC pop_options
/* This should not vectorize. */
void
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/sse-22.c b/gcc/testsuite/gcc.target/i386/sse-22.c
index a9b10333157..f530e54ec30 100644
--- a/gcc/testsuite/gcc.target/i386/sse-22.c
+++ b/gcc/testsuite/gcc.target/i386/sse-22.c
@@ -37,7 +37,7 @@
#ifndef DIFFERENT_PRAGMAS
-#pragma GCC option ("mmx,3dnow,sse,sse2,sse3,ssse3,sse4.1,sse4.2,sse5,aes,pclmul")
+#pragma GCC target ("mmx,3dnow,sse,sse2,sse3,ssse3,sse4.1,sse4.2,sse5,aes,pclmul")
#endif
/* Following intrinsics require immediate arguments. They
@@ -45,19 +45,19 @@
/* mmintrin.h (MMX). */
#ifdef DIFFERENT_PRAGMAS
-#pragma GCC option ("mmx")
+#pragma GCC target ("mmx")
#endif
#include <mmintrin.h>
/* mm3dnow.h (3DNOW). */
#ifdef DIFFERENT_PRAGMAS
-#pragma GCC option ("3dnow")
+#pragma GCC target ("3dnow")
#endif
#include <mm3dnow.h>
/* xmmintrin.h (SSE). */
#ifdef DIFFERENT_PRAGMAS
-#pragma GCC option ("sse")
+#pragma GCC target ("sse")
#endif
#include <xmmintrin.h>
test_2 (_mm_shuffle_ps, __m128, __m128, __m128, 1)
@@ -71,7 +71,7 @@ test_1 (_mm_prefetch, void, void *, _MM_HINT_NTA)
/* emmintrin.h (SSE2). */
#ifdef DIFFERENT_PRAGMAS
-#pragma GCC option ("sse2")
+#pragma GCC target ("sse2")
#endif
#include <emmintrin.h>
test_2 (_mm_shuffle_pd, __m128d, __m128d, __m128d, 1)
@@ -85,13 +85,13 @@ test_1 (_mm_shuffle_epi32, __m128i, __m128i, 1)
/* pmmintrin.h (SSE3). */
#ifdef DIFFERENT_PRAGMAS
-#pragma GCC option ("sse3")
+#pragma GCC target ("sse3")
#endif
#include <pmmintrin.h>
/* tmmintrin.h (SSSE3). */
#ifdef DIFFERENT_PRAGMAS
-#pragma GCC option ("ssse3")
+#pragma GCC target ("ssse3")
#endif
#include <tmmintrin.h>
test_2 (_mm_alignr_epi8, __m128i, __m128i, __m128i, 1)
@@ -99,7 +99,7 @@ test_2 (_mm_alignr_pi8, __m64, __m64, __m64, 1)
/* ammintrin.h (SSE4A). */
#ifdef DIFFERENT_PRAGMAS
-#pragma GCC option ("sse4a")
+#pragma GCC target ("sse4a")
#endif
#include <ammintrin.h>
test_1x (_mm_extracti_si64, __m128i, __m128i, 1, 1)
@@ -110,7 +110,7 @@ test_2x (_mm_inserti_si64, __m128i, __m128i, __m128i, 1, 1)
/* Note, nmmintrin.h includes smmintrin.h, and smmintrin.h checks for the
#ifdef. So just set the option to SSE4.2. */
#ifdef DIFFERENT_PRAGMAS
-#pragma GCC option ("sse4.2")
+#pragma GCC target ("sse4.2")
#endif
#include <nmmintrin.h>
test_2 (_mm_blend_epi16, __m128i, __m128i, __m128i, 1)
@@ -148,7 +148,7 @@ test_4 (_mm_cmpestrz, int, __m128i, int, __m128i, int, 1)
/* bmmintrin.h (SSE5). */
#ifdef DIFFERENT_PRAGMAS
-#pragma GCC option ("sse5")
+#pragma GCC target ("sse5")
#endif
#include <bmmintrin.h>
test_1 (_mm_roti_epi8, __m128i, __m128i, 1)
@@ -158,7 +158,7 @@ test_1 (_mm_roti_epi64, __m128i, __m128i, 1)
/* wmmintrin.h (AES/PCLMUL). */
#ifdef DIFFERENT_PRAGMAS
-#pragma GCC option ("aes,pclmul")
+#pragma GCC target ("aes,pclmul")
#endif
#include <wmmintrin.h>
test_1 (_mm_aeskeygenassist_si128, __m128i, __m128i, 1)
diff --git a/gcc/testsuite/gcc.target/i386/sse-23.c b/gcc/testsuite/gcc.target/i386/sse-23.c
index 27b601452a5..4488568f450 100644
--- a/gcc/testsuite/gcc.target/i386/sse-23.c
+++ b/gcc/testsuite/gcc.target/i386/sse-23.c
@@ -101,7 +101,7 @@
#define __builtin_ia32_protqi(A, B) __builtin_ia32_protqi(A,1)
-#pragma GCC option ("3dnow,sse4,sse5,aes,pclmul")
+#pragma GCC target ("3dnow,sse4,sse5,aes,pclmul")
#include <wmmintrin.h>
#include <bmmintrin.h>
#include <smmintrin.h>
diff --git a/gcc/testsuite/gcc.target/i386/sse-check.h b/gcc/testsuite/gcc.target/i386/sse-check.h
index d485b8dfa03..79ea4815517 100644
--- a/gcc/testsuite/gcc.target/i386/sse-check.h
+++ b/gcc/testsuite/gcc.target/i386/sse-check.h
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
+#include "m128-check.h"
#include "cpuid.h"
diff --git a/gcc/testsuite/gcc.target/i386/sse3-addsubpd.c b/gcc/testsuite/gcc.target/i386/sse3-addsubpd.c
index de5b14be872..e82fa76c5a5 100644
--- a/gcc/testsuite/gcc.target/i386/sse3-addsubpd.c
+++ b/gcc/testsuite/gcc.target/i386/sse3-addsubpd.c
@@ -1,7 +1,15 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse3 -mfpmath=sse" } */
-#include "sse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse3_test
+#endif
+
+#include CHECK_H
#include <pmmintrin.h>
@@ -60,7 +68,7 @@ double vals[80] =
};
static void
-sse3_test (void)
+TEST (void)
{
int i;
int fail = 0;
@@ -87,6 +95,4 @@ sse3_test (void)
if (fail != 0)
abort ();
-
- exit (0);
}
diff --git a/gcc/testsuite/gcc.target/i386/sse3-addsubps.c b/gcc/testsuite/gcc.target/i386/sse3-addsubps.c
index 182fb5e0da7..091b58c8411 100644
--- a/gcc/testsuite/gcc.target/i386/sse3-addsubps.c
+++ b/gcc/testsuite/gcc.target/i386/sse3-addsubps.c
@@ -1,7 +1,15 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse3 -mfpmath=sse" } */
-#include "sse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse3_test
+#endif
+
+#include CHECK_H
#include <pmmintrin.h>
@@ -60,7 +68,7 @@ static float vals[80] =
};
static void
-sse3_test (void)
+TEST (void)
{
int i;
int fail = 0;
diff --git a/gcc/testsuite/gcc.target/i386/sse3-haddpd.c b/gcc/testsuite/gcc.target/i386/sse3-haddpd.c
index d44db5e2307..8750ddfe298 100644
--- a/gcc/testsuite/gcc.target/i386/sse3-haddpd.c
+++ b/gcc/testsuite/gcc.target/i386/sse3-haddpd.c
@@ -1,8 +1,15 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse3 -mfpmath=sse" } */
-#include "sse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse3-check.h"
+#endif
+#ifndef TEST
+#define TEST sse3_test
+#endif
+
+#include CHECK_H
#include <pmmintrin.h>
static void
@@ -60,7 +67,7 @@ static double vals[80] =
};
static void
-sse3_test (void)
+TEST (void)
{
int i;
int fail = 0;
diff --git a/gcc/testsuite/gcc.target/i386/sse3-haddps.c b/gcc/testsuite/gcc.target/i386/sse3-haddps.c
index 11660498240..dcb0a7c58c8 100644
--- a/gcc/testsuite/gcc.target/i386/sse3-haddps.c
+++ b/gcc/testsuite/gcc.target/i386/sse3-haddps.c
@@ -1,7 +1,15 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse3 -mfpmath=sse" } */
-#include "sse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse3_test
+#endif
+
+#include CHECK_H
#include <pmmintrin.h>
@@ -60,7 +68,7 @@ static float vals[80] =
};
static void
-sse3_test ()
+TEST ()
{
int i;
int fail = 0;
diff --git a/gcc/testsuite/gcc.target/i386/sse3-hsubpd.c b/gcc/testsuite/gcc.target/i386/sse3-hsubpd.c
index 90053a1d0f7..77018f5740f 100644
--- a/gcc/testsuite/gcc.target/i386/sse3-hsubpd.c
+++ b/gcc/testsuite/gcc.target/i386/sse3-hsubpd.c
@@ -1,8 +1,15 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse3 -mfpmath=sse" } */
-#include "sse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse3-check.h"
+#endif
+#ifndef TEST
+#define TEST sse3_test
+#endif
+
+#include CHECK_H
#include <pmmintrin.h>
static void
@@ -60,7 +67,7 @@ static double vals[80] =
};
static void
-sse3_test (void)
+TEST (void)
{
int i;
int fail = 0;
diff --git a/gcc/testsuite/gcc.target/i386/sse3-hsubps.c b/gcc/testsuite/gcc.target/i386/sse3-hsubps.c
index aa1375a61a7..326adfd045d 100644
--- a/gcc/testsuite/gcc.target/i386/sse3-hsubps.c
+++ b/gcc/testsuite/gcc.target/i386/sse3-hsubps.c
@@ -1,8 +1,15 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse3 -mfpmath=sse" } */
-#include "sse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse3-check.h"
+#endif
+#ifndef TEST
+#define TEST sse3_test
+#endif
+
+#include CHECK_H
#include <pmmintrin.h>
static void
@@ -62,7 +69,7 @@ static float vals[80] =
};
static void
-sse3_test (void)
+TEST (void)
{
int i;
int fail = 0;
diff --git a/gcc/testsuite/gcc.target/i386/sse3-lddqu.c b/gcc/testsuite/gcc.target/i386/sse3-lddqu.c
index d3dc094b36e..5df19a62af6 100644
--- a/gcc/testsuite/gcc.target/i386/sse3-lddqu.c
+++ b/gcc/testsuite/gcc.target/i386/sse3-lddqu.c
@@ -1,8 +1,15 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse3 -mfpmath=sse" } */
-#include "sse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse3-check.h"
+#endif
+#ifndef TEST
+#define TEST sse3_test
+#endif
+
+#include CHECK_H
#include <pmmintrin.h>
static void
@@ -45,7 +52,7 @@ static double vals[80] =
};
static void
-sse3_test (void)
+TEST (void)
{
int i;
int fail = 0;
diff --git a/gcc/testsuite/gcc.target/i386/sse3-movddup.c b/gcc/testsuite/gcc.target/i386/sse3-movddup.c
index 5464eb89a69..2eb33ad49c7 100644
--- a/gcc/testsuite/gcc.target/i386/sse3-movddup.c
+++ b/gcc/testsuite/gcc.target/i386/sse3-movddup.c
@@ -1,7 +1,15 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse3 -mfpmath=sse" } */
-#include "sse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse3_test
+#endif
+
+#include CHECK_H
#include <pmmintrin.h>
@@ -86,7 +94,7 @@ static double vals[80] =
};
static void
-sse3_test (void)
+TEST (void)
{
int i;
int fail = 0;
diff --git a/gcc/testsuite/gcc.target/i386/sse3-movshdup.c b/gcc/testsuite/gcc.target/i386/sse3-movshdup.c
index 63a881ddc9e..8f6706cf939 100644
--- a/gcc/testsuite/gcc.target/i386/sse3-movshdup.c
+++ b/gcc/testsuite/gcc.target/i386/sse3-movshdup.c
@@ -1,7 +1,15 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse3 -mfpmath=sse" } */
-#include "sse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse3_test
+#endif
+
+#include CHECK_H
#include <pmmintrin.h>
@@ -55,7 +63,7 @@ static float vals[80] =
};
static void
-sse3_test (void)
+TEST (void)
{
int i;
int fail = 0;
diff --git a/gcc/testsuite/gcc.target/i386/sse3-movsldup.c b/gcc/testsuite/gcc.target/i386/sse3-movsldup.c
index 66c64b3b154..9ae8454e0a5 100644
--- a/gcc/testsuite/gcc.target/i386/sse3-movsldup.c
+++ b/gcc/testsuite/gcc.target/i386/sse3-movsldup.c
@@ -1,7 +1,15 @@
/* { dg-do run } */
/* { dg-options "-O2 -msse3 -mfpmath=sse" } */
-#include "sse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse3_test
+#endif
+
+#include CHECK_H
#include <pmmintrin.h>
@@ -38,7 +46,6 @@ chk_ps (float *v1, float *v2)
static float p1[4] __attribute__ ((aligned(16)));
static float p2[4];
-static float p3[4];
static float ck[4];
static float vals[80] =
@@ -56,7 +63,7 @@ static float vals[80] =
};
static void
-sse3_test (void)
+TEST (void)
{
int i;
int fail = 0;
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-blendpd.c b/gcc/testsuite/gcc.target/i386/sse4_1-blendpd.c
index f938e2fffb6..aff188c631f 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-blendpd.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-blendpd.c
@@ -2,7 +2,15 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#include <string.h>
@@ -42,7 +50,7 @@ check_blendpd (__m128d *dst, double *src1, double *src2)
}
static void
-sse4_1_test (void)
+TEST (void)
{
__m128d x, y;
union
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-blendps.c b/gcc/testsuite/gcc.target/i386/sse4_1-blendps.c
index a8691a60957..b4d8e8ee166 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-blendps.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-blendps.c
@@ -2,7 +2,15 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#include <string.h>
@@ -41,7 +49,7 @@ check_blendps (__m128 *dst, float *src1, float *src2)
}
static void
-sse4_1_test (void)
+TEST (void)
{
__m128 x, y;
union
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-dppd-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-dppd-1.c
index 8adc4dd2993..b8e58d47aad 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-dppd-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-dppd-1.c
@@ -2,7 +2,15 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
@@ -22,7 +30,7 @@
#endif
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-dppd-2.c b/gcc/testsuite/gcc.target/i386/sse4_1-dppd-2.c
index 10fe37206f5..6dc328c0574 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-dppd-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-dppd-2.c
@@ -2,9 +2,18 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
+
#include <string.h>
#define lmskN 0x00
@@ -27,7 +36,7 @@
#endif
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-dpps-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-dpps-1.c
index 03fb2588709..77232567cdc 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-dpps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-dpps-1.c
@@ -2,7 +2,15 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
@@ -37,7 +45,7 @@
#endif
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-dpps-2.c b/gcc/testsuite/gcc.target/i386/sse4_1-dpps-2.c
index 0b8d4c1fb88..48483b6c824 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-dpps-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-dpps-2.c
@@ -2,9 +2,18 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
+
#include <string.h>
#define lmskN 0x00
@@ -42,7 +51,7 @@
#endif
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-extractps.c b/gcc/testsuite/gcc.target/i386/sse4_1-extractps.c
index 36294b8c6c6..d63296fe2f0 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-extractps.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-extractps.c
@@ -2,7 +2,15 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
@@ -14,7 +22,7 @@ int masks[4];
#define msk3 0x03
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-insertps-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-insertps-1.c
index d4aad1aa3e6..2f5741288c2 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-insertps-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-insertps-1.c
@@ -2,7 +2,15 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#include <string.h>
@@ -18,7 +26,7 @@
#define msk7 0x0F
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-insertps-2.c b/gcc/testsuite/gcc.target/i386/sse4_1-insertps-2.c
index 694aaf136c1..fbb96ca501f 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-insertps-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-insertps-2.c
@@ -2,12 +2,19 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
-#include <smmintrin.h>
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
+#include <smmintrin.h>
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-movntdqa.c b/gcc/testsuite/gcc.target/i386/sse4_1-movntdqa.c
index ae7a9e755ea..bc5cf23839c 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-movntdqa.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-movntdqa.c
@@ -2,7 +2,15 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#include <string.h>
@@ -23,7 +31,7 @@ init_movntdqa (int *src)
}
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-mpsadbw.c b/gcc/testsuite/gcc.target/i386/sse4_1-mpsadbw.c
index c47d95b8c9e..0fc24e86111 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-mpsadbw.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-mpsadbw.c
@@ -2,7 +2,15 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#include <string.h>
@@ -44,7 +52,7 @@ compute_mpsadbw (unsigned char *v1, unsigned char *v2, int mask)
}
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-packusdw.c b/gcc/testsuite/gcc.target/i386/sse4_1-packusdw.c
index 2b6307a788e..f9815779414 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-packusdw.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-packusdw.c
@@ -2,7 +2,15 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
@@ -23,7 +31,7 @@ int_to_ushort (int iVal)
}
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pblendvb.c b/gcc/testsuite/gcc.target/i386/sse4_1-pblendvb.c
index 1fefc27df2f..58e94471e91 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pblendvb.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pblendvb.c
@@ -2,7 +2,15 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#include <string.h>
@@ -41,7 +49,7 @@ check_pblendvb (__m128i *dst, unsigned char *src1,
}
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pblendw.c b/gcc/testsuite/gcc.target/i386/sse4_1-pblendw.c
index fa18ccdd981..5f5a253535b 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pblendw.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pblendw.c
@@ -2,7 +2,15 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#include <string.h>
@@ -41,7 +49,7 @@ check_pblendw (__m128i *dst, short *src1, short *src2)
}
static void
-sse4_1_test (void)
+TEST (void)
{
__m128i x, y;
union
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pcmpeqq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pcmpeqq.c
index a15356a2cba..8611b82482f 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pcmpeqq.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pcmpeqq.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 64
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pextrb.c b/gcc/testsuite/gcc.target/i386/sse4_1-pextrb.c
index 15d08fad809..bef4d2d167e 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pextrb.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pextrb.c
@@ -2,8 +2,15 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define msk0 0
@@ -24,7 +31,7 @@
#define msk15 15
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pextrd.c b/gcc/testsuite/gcc.target/i386/sse4_1-pextrd.c
index 751dca241cb..3091e5a054a 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pextrd.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pextrd.c
@@ -2,17 +2,25 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
+
#define msk0 0
#define msk1 1
#define msk2 2
#define msk3 3
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pextrq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pextrq.c
index c9ff97db382..b90f4e2f12b 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pextrq.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pextrq.c
@@ -3,7 +3,15 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
@@ -11,7 +19,8 @@
#define msk1 1
static void
-sse4_1_test (void)
+__attribute__((noinline))
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pextrw.c b/gcc/testsuite/gcc.target/i386/sse4_1-pextrw.c
index 19d783fe505..2a0f03c07dc 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pextrw.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pextrw.c
@@ -2,7 +2,15 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
@@ -16,7 +24,7 @@
#define msk7 7
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-phminposuw.c b/gcc/testsuite/gcc.target/i386/sse4_1-phminposuw.c
index 24fdf2af160..ab4683401b8 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-phminposuw.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-phminposuw.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 64
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pinsrb.c b/gcc/testsuite/gcc.target/i386/sse4_1-pinsrb.c
index dd5ee0355dd..18427360f5b 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pinsrb.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pinsrb.c
@@ -2,7 +2,15 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#include <string.h>
@@ -25,7 +33,7 @@
#define mskF 0x0F
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pinsrd.c b/gcc/testsuite/gcc.target/i386/sse4_1-pinsrd.c
index e8168815ab3..7a5d5fbc914 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pinsrd.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pinsrd.c
@@ -2,7 +2,15 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#include <string.h>
@@ -13,7 +21,7 @@
#define msk3 0x03
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pinsrq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pinsrq.c
index beeaf839d95..1640439e598 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pinsrq.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pinsrq.c
@@ -3,7 +3,15 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#include <string.h>
@@ -12,7 +20,8 @@
#define msk1 0x01
static void
-sse4_1_test (void)
+__attribute__((noinline))
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmaxsb.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmaxsb.c
index 5bd007e52c2..ab445eefd58 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pmaxsb.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmaxsb.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 1024
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmaxsd.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmaxsd.c
index 5e480b3b709..37c77aef515 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pmaxsd.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmaxsd.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 64
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmaxud.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmaxud.c
index 844f8dab519..693c078fedb 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pmaxud.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmaxud.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 64
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmaxuw.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmaxuw.c
index 99248c1f579..7b5cfcd8fc0 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pmaxuw.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmaxuw.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 64
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pminsb.c b/gcc/testsuite/gcc.target/i386/sse4_1-pminsb.c
index 55192ded5a6..6f32d8b8312 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pminsb.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pminsb.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 1024
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pminsd.c b/gcc/testsuite/gcc.target/i386/sse4_1-pminsd.c
index c3aeb08244b..a3de148a043 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pminsd.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pminsd.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 64
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pminud.c b/gcc/testsuite/gcc.target/i386/sse4_1-pminud.c
index 64d69d28823..9daffc07062 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pminud.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pminud.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 64
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pminuw.c b/gcc/testsuite/gcc.target/i386/sse4_1-pminuw.c
index afe2f887f82..6ed5d9e2e60 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pminuw.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pminuw.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 64
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbd.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbd.c
index 7da95a7ccf7..00ce3ef77f2 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbd.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbd.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 128
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbq.c
index 9a1b3e138ca..0df6a61c70b 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbq.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbq.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 128
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbw.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbw.c
index df908998af3..36accff4cdc 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbw.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxbw.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 128
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxdq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxdq.c
index 96d06cd2099..e46ba1961f9 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxdq.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxdq.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 128
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxwd.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxwd.c
index 7266320154c..61d9d3c2ea9 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxwd.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxwd.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 128
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxwq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxwq.c
index d7e1ded2c20..160d6467da9 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxwq.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovsxwq.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 128
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbd.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbd.c
index e5aa7ee3884..6ebd6cf4e4d 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbd.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbd.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 128
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbq.c
index 173ebd41a07..8b2f18a22d9 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbq.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbq.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 128
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbw.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbw.c
index 890e5baab39..8e1452bf70b 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbw.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxbw.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 128
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxdq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxdq.c
index d24f76690d1..cb2a4383eb8 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxdq.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxdq.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 128
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxwd.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxwd.c
index ed2c0e81cef..b525f4c6ae6 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxwd.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxwd.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 128
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxwq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxwq.c
index 5a5608cb8a2..98f552aac45 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxwq.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmovzxwq.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 128
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmuldq.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmuldq.c
index 597219b6a68..dda1ba3c19e 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pmuldq.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmuldq.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 64
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-pmulld.c b/gcc/testsuite/gcc.target/i386/sse4_1-pmulld.c
index d77d4539c14..9fb77d0ac7e 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-pmulld.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-pmulld.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
#define NUM 64
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-ptest-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-ptest-1.c
index ec752b7247e..8b57a21114d 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-ptest-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-ptest-1.c
@@ -2,7 +2,15 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
@@ -53,7 +61,7 @@ make_ptestc (__m128i m, __m128i v)
}
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-ptest-2.c b/gcc/testsuite/gcc.target/i386/sse4_1-ptest-2.c
index 5343dd24238..2e6df9538e6 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-ptest-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-ptest-2.c
@@ -2,7 +2,15 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
@@ -32,7 +40,7 @@ make_ptestnzc (__m128i m, __m128i v)
}
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-ptest-3.c b/gcc/testsuite/gcc.target/i386/sse4_1-ptest-3.c
index 1300d7b121f..bf2df320e1a 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-ptest-3.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-ptest-3.c
@@ -2,12 +2,20 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
+
+#include CHECK_H
#include <smmintrin.h>
static void
-sse4_1_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-1.c
index 17da21fbf4b..37f20285f54 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-1.c
@@ -2,17 +2,37 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
-#define VEC_T __m128d
-#define FP_T double
-#define ASM_SUFFIX "l"
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
-#define ROUND_INTRIN(x, mode) _mm_ceil_pd(x)
-#define ROUND_MODE _MM_FROUND_CEIL
-#define CHECK_ROUND_MODE 0x02
+#include CHECK_H
-#define LOOP_INCREMENT 2
-#define CHECK_LOOP_INCREMENT 1
+#include <smmintrin.h>
-#include "sse4_1-round.h"
+#define iRoundMode 0x2
+
+static void
+TEST (void)
+{
+ union128d u, s;
+ double e[2] = {0.0};
+ int i;
+
+ s.x = _mm_set_pd (1.1234, -2.3478);
+ u.x = _mm_round_pd (s.x, iRoundMode);
+
+ for (i = 0; i < 2; i++)
+ {
+ __m128d tmp = _mm_load_sd (&s.a[i]);
+ tmp = _mm_round_sd (tmp, tmp, iRoundMode);
+ _mm_store_sd (&e[i], tmp);
+ }
+
+ if (check_union128d (u, e))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-2.c b/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-2.c
index 1ad9814ebee..7f0475f75ce 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-2.c
@@ -2,17 +2,35 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
-#define VEC_T __m128d
-#define FP_T double
-#define ASM_SUFFIX "l"
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
-#define ROUND_INTRIN _mm_round_pd
-#define ROUND_MODE _MM_FROUND_NINT
-#define CHECK_ROUND_MODE 0x00
+#include CHECK_H
-#define LOOP_INCREMENT 2
-#define CHECK_LOOP_INCREMENT 1
+#include <smmintrin.h>
-#include "sse4_1-round.h"
+static void
+TEST (void)
+{
+ union128d u, s;
+ double e[2] = {0.0};
+ int i;
+
+ s.x = _mm_set_pd (1.1234, -2.3478);
+ u.x = _mm_floor_pd (s.x);
+
+ for (i = 0; i < 2; i++)
+ {
+ __m128d tmp = _mm_load_sd (&s.a[i]);
+ tmp = _mm_floor_sd (tmp, tmp);
+ _mm_store_sd (&e[i], tmp);
+ }
+
+ if (check_union128d (u, e))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-3.c b/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-3.c
index 39505788943..4a1f81026f0 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-3.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_1-roundpd-3.c
@@ -2,17 +2,35 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.1" } */
-#include "sse4_1-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_1-check.h"
+#endif
-#define VEC_T __m128d
-#define FP_T double
-#define ASM_SUFFIX "l"
+#ifndef TEST
+#define TEST sse4_1_test
+#endif
-#define ROUND_INTRIN(x, mode) _mm_floor_pd(x)
-#define ROUND_MODE _MM_FROUND_FLOOR
-#define CHECK_ROUND_MODE 0x01
+#include CHECK_H
-#define LOOP_INCREMENT 2
-#define CHECK_LOOP_INCREMENT 1
+#include <smmintrin.h>
-#include "sse4_1-round.h"
+static void
+TEST (void)
+{
+ union128d u, s;
+ double e[2] = {0.0};
+ int i;
+
+ s.x = _mm_set_pd (1.1234, -2.3478);
+ u.x = _mm_ceil_pd (s.x);
+
+ for (i = 0; i < 2; i++)
+ {
+ __m128d tmp = _mm_load_sd (&s.a[i]);
+ tmp = _mm_ceil_sd (tmp, tmp);
+ _mm_store_sd (&e[i], tmp);
+ }
+
+ if (check_union128d (u, e))
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestri-1.c b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestri-1.c
index c84ddd3f449..5b7f3ad7747 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestri-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestri-1.c
@@ -2,7 +2,16 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.2" } */
-#include "sse4_2-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_2-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_2_test
+#endif
+
+#include CHECK_H
+
#include "sse4_2-pcmpstr.h"
#define NUM 1024
@@ -20,7 +29,7 @@
static void
-sse4_2_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestri-2.c b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestri-2.c
index bc35eb7a323..800084ff67c 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestri-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestri-2.c
@@ -2,7 +2,16 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.2" } */
-#include "sse4_2-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_2-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_2_test
+#endif
+
+#include CHECK_H
+
#include "sse4_2-pcmpstr.h"
#define NUM 1024
@@ -20,7 +29,7 @@
static void
-sse4_2_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestrm-1.c b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestrm-1.c
index 1c75a9b2e4d..f02bb7e6941 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestrm-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestrm-1.c
@@ -2,7 +2,16 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.2" } */
-#include "sse4_2-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_2-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_2_test
+#endif
+
+#include CHECK_H
+
#include "sse4_2-pcmpstr.h"
#define NUM 1024
@@ -20,7 +29,7 @@
static void
-sse4_2_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestrm-2.c b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestrm-2.c
index baf377c3aad..845471f0bab 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestrm-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpestrm-2.c
@@ -2,7 +2,16 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.2" } */
-#include "sse4_2-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_2-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_2_test
+#endif
+
+#include CHECK_H
+
#include "sse4_2-pcmpstr.h"
#define NUM 1024
@@ -19,7 +28,7 @@
| _SIDD_MASKED_NEGATIVE_POLARITY | _SIDD_UNIT_MASK)
static void
-sse4_2_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpgtq.c b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpgtq.c
index c782d85cd31..e2ef66f2a17 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpgtq.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpgtq.c
@@ -2,14 +2,22 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.2" } */
-#include "sse4_2-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_2-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_2_test
+#endif
+
+#include CHECK_H
#include <nmmintrin.h>
#define NUM 64
static void
-sse4_2_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistri-1.c b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistri-1.c
index 9dbeb30b01c..b74df024d61 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistri-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistri-1.c
@@ -2,7 +2,16 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.2" } */
-#include "sse4_2-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_2-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_2_test
+#endif
+
+#include CHECK_H
+
#include "sse4_2-pcmpstr.h"
#define NUM 1024
@@ -20,7 +29,7 @@
static void
-sse4_2_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistri-2.c b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistri-2.c
index 6bad02e9d07..5aea655edc2 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistri-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistri-2.c
@@ -2,7 +2,16 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.2" } */
-#include "sse4_2-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_2-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_2_test
+#endif
+
+#include CHECK_H
+
#include "sse4_2-pcmpstr.h"
#define NUM 1024
@@ -20,7 +29,7 @@
static void
-sse4_2_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistrm-1.c b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistrm-1.c
index 3975728c09d..b8ec890cbd4 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistrm-1.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistrm-1.c
@@ -2,7 +2,16 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.2" } */
-#include "sse4_2-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_2-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_2_test
+#endif
+
+#include CHECK_H
+
#include "sse4_2-pcmpstr.h"
#define NUM 1024
@@ -20,7 +29,7 @@
static void
-sse4_2_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistrm-2.c b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistrm-2.c
index 6d3a23a75db..c6896ee6182 100644
--- a/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistrm-2.c
+++ b/gcc/testsuite/gcc.target/i386/sse4_2-pcmpistrm-2.c
@@ -2,7 +2,16 @@
/* { dg-require-effective-target sse4 } */
/* { dg-options "-O2 -msse4.2" } */
-#include "sse4_2-check.h"
+#ifndef CHECK_H
+#define CHECK_H "sse4_2-check.h"
+#endif
+
+#ifndef TEST
+#define TEST sse4_2_test
+#endif
+
+#include CHECK_H
+
#include "sse4_2-pcmpstr.h"
#define NUM 1024
@@ -19,7 +28,7 @@
| _SIDD_POSITIVE_POLARITY | _SIDD_UNIT_MASK)
static void
-sse4_2_test (void)
+TEST (void)
{
union
{
diff --git a/gcc/testsuite/gcc.target/i386/ssse3-pabsb.c b/gcc/testsuite/gcc.target/i386/ssse3-pabsb.c
index 1a2445d4f29..7caa1b6c3a6 100644
--- a/gcc/testsuite/gcc.target/i386/ssse3-pabsb.c
+++ b/gcc/testsuite/gcc.target/i386/ssse3-pabsb.c
@@ -2,11 +2,20 @@
/* { dg-require-effective-target ssse3 } */
/* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */
-#include "ssse3-check.h"
-#include "ssse3-vals.h"
+#ifndef CHECK_H
+#define CHECK_H "ssse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST ssse3_test
+#endif
+#include CHECK_H
+
+#include "ssse3-vals.h"
#include <tmmintrin.h>
+#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_pabsb (int *i1, int *r)
@@ -15,6 +24,7 @@ ssse3_test_pabsb (int *i1, int *r)
*(__m64 *) r = _mm_abs_pi8 (t1);
_mm_empty ();
}
+#endif
/* Test the 128-bit form */
static void
@@ -41,7 +51,7 @@ compute_correct_result (int *i1, int *r)
}
static void
-ssse3_test (void)
+TEST (void)
{
int i;
int r [4] __attribute__ ((aligned(16)));
@@ -53,10 +63,12 @@ ssse3_test (void)
/* Manually compute the result */
compute_correct_result(&vals[i + 0], ck);
+#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_pabsb (&vals[i + 0], &r[0]);
ssse3_test_pabsb (&vals[i + 2], &r[2]);
fail += chk_128 (ck, r);
+#endif
/* Run the 128-bit tests */
ssse3_test_pabsb128 (&vals[i + 0], r);
diff --git a/gcc/testsuite/gcc.target/i386/ssse3-pabsd.c b/gcc/testsuite/gcc.target/i386/ssse3-pabsd.c
index 22eb512ed35..3a73cf01170 100644
--- a/gcc/testsuite/gcc.target/i386/ssse3-pabsd.c
+++ b/gcc/testsuite/gcc.target/i386/ssse3-pabsd.c
@@ -2,11 +2,21 @@
/* { dg-require-effective-target ssse3 } */
/* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */
-#include "ssse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "ssse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST ssse3_test
+#endif
+
+#include CHECK_H
+
#include "ssse3-vals.h"
#include <tmmintrin.h>
+#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_pabsd (int *i1, int *r)
@@ -15,6 +25,7 @@ ssse3_test_pabsd (int *i1, int *r)
*(__m64 *) r = _mm_abs_pi32 (t1);
_mm_empty ();
}
+#endif
/* Test the 128-bit form */
static void
@@ -39,7 +50,7 @@ compute_correct_result (int *i1, int *r)
}
static void
-ssse3_test (void)
+TEST (void)
{
int i;
int r [4] __attribute__ ((aligned(16)));
@@ -51,10 +62,12 @@ ssse3_test (void)
/* Manually compute the result */
compute_correct_result(&vals[i + 0], ck);
+#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_pabsd (&vals[i + 0], &r[0]);
ssse3_test_pabsd (&vals[i + 2], &r[2]);
fail += chk_128 (ck, r);
+#endif
/* Run the 128-bit tests */
ssse3_test_pabsd128 (&vals[i + 0], r);
diff --git a/gcc/testsuite/gcc.target/i386/ssse3-pabsw.c b/gcc/testsuite/gcc.target/i386/ssse3-pabsw.c
index aba4f050315..67e4721b8e6 100644
--- a/gcc/testsuite/gcc.target/i386/ssse3-pabsw.c
+++ b/gcc/testsuite/gcc.target/i386/ssse3-pabsw.c
@@ -2,11 +2,21 @@
/* { dg-require-effective-target ssse3 } */
/* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */
-#include "ssse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "ssse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST ssse3_test
+#endif
+
+#include CHECK_H
+
#include "ssse3-vals.h"
#include <tmmintrin.h>
+#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_pabsw (int *i1, int *r)
@@ -15,6 +25,7 @@ ssse3_test_pabsw (int *i1, int *r)
*(__m64 *) r = _mm_abs_pi16 (t1);
_mm_empty ();
}
+#endif
/* Test the 128-bit form */
static void
@@ -41,7 +52,7 @@ compute_correct_result (int *i1, int *r)
}
static void
-ssse3_test (void)
+TEST (void)
{
int i;
int r [4] __attribute__ ((aligned(16)));
@@ -53,10 +64,12 @@ ssse3_test (void)
/* Manually compute the result */
compute_correct_result (&vals[i + 0], ck);
+#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_pabsw (&vals[i + 0], &r[0]);
ssse3_test_pabsw (&vals[i + 2], &r[2]);
fail += chk_128 (ck, r);
+#endif
/* Run the 128-bit tests */
ssse3_test_pabsw128 (&vals[i + 0], r);
diff --git a/gcc/testsuite/gcc.target/i386/ssse3-palignr.c b/gcc/testsuite/gcc.target/i386/ssse3-palignr.c
index 386cddb2ee6..dbee9bee4aa 100644
--- a/gcc/testsuite/gcc.target/i386/ssse3-palignr.c
+++ b/gcc/testsuite/gcc.target/i386/ssse3-palignr.c
@@ -2,12 +2,22 @@
/* { dg-require-effective-target ssse3 } */
/* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */
-#include "ssse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "ssse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST ssse3_test
+#endif
+
+#include CHECK_H
+
#include "ssse3-vals.h"
#include <tmmintrin.h>
#include <string.h>
+#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_palignr (int *i1, int *i2, unsigned int imm, int *r)
@@ -72,6 +82,7 @@ ssse3_test_palignr (int *i1, int *i2, unsigned int imm, int *r)
_mm_empty();
}
+#endif
/* Test the 128-bit form */
static void
@@ -203,6 +214,7 @@ compute_correct_result_128 (int *i1, int *i2, unsigned int imm, int *r)
bout[i] = buf[imm + i];
}
+#ifndef __AVX__
static void
compute_correct_result_64 (int *i1, int *i2, unsigned int imm, int *r)
{
@@ -230,9 +242,10 @@ compute_correct_result_64 (int *i1, int *i2, unsigned int imm, int *r)
else
bout[i + 8] = buf[imm + i];
}
+#endif
static void
-ssse3_test (void)
+TEST (void)
{
int i;
int r [4] __attribute__ ((aligned(16)));
@@ -243,6 +256,7 @@ ssse3_test (void)
for (i = 0; i < 256; i += 8)
for (imm = 0; imm < 100; imm++)
{
+#ifndef __AVX__
/* Manually compute the result */
compute_correct_result_64 (&vals[i + 0], &vals[i + 4], imm, ck);
@@ -250,6 +264,7 @@ ssse3_test (void)
ssse3_test_palignr (&vals[i + 0], &vals[i + 4], imm, &r[0]);
ssse3_test_palignr (&vals[i + 2], &vals[i + 6], imm, &r[2]);
fail += chk_128 (ck, r);
+#endif
/* Recompute the results for 128-bits */
compute_correct_result_128 (&vals[i + 0], &vals[i + 4], imm, ck);
diff --git a/gcc/testsuite/gcc.target/i386/ssse3-phaddd.c b/gcc/testsuite/gcc.target/i386/ssse3-phaddd.c
index 675d233360c..bef78168659 100644
--- a/gcc/testsuite/gcc.target/i386/ssse3-phaddd.c
+++ b/gcc/testsuite/gcc.target/i386/ssse3-phaddd.c
@@ -2,11 +2,21 @@
/* { dg-require-effective-target ssse3 } */
/* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */
-#include "ssse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "ssse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST ssse3_test
+#endif
+
+#include CHECK_H
+
#include "ssse3-vals.h"
#include <tmmintrin.h>
+#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_phaddd (int *i1, int *i2, int *r)
@@ -16,6 +26,7 @@ ssse3_test_phaddd (int *i1, int *i2, int *r)
*(__m64 *) r = _mm_hadd_pi32 (t1, t2);
_mm_empty();
}
+#endif
/* Test the 128-bit form */
static void
@@ -40,7 +51,7 @@ compute_correct_result(int *i1, int *i2, int *r)
}
static void
-ssse3_test (void)
+TEST (void)
{
int i;
int r [4] __attribute__ ((aligned(16)));
@@ -53,10 +64,12 @@ ssse3_test (void)
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
+#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_phaddd (&vals[i + 0], &vals[i + 2], &r[0]);
ssse3_test_phaddd (&vals[i + 4], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
+#endif
/* Run the 128-bit tests */
ssse3_test_phaddd128 (&vals[i + 0], &vals[i + 4], r);
diff --git a/gcc/testsuite/gcc.target/i386/ssse3-phaddsw.c b/gcc/testsuite/gcc.target/i386/ssse3-phaddsw.c
index 563dcdb6af1..ff31fe5a5fe 100644
--- a/gcc/testsuite/gcc.target/i386/ssse3-phaddsw.c
+++ b/gcc/testsuite/gcc.target/i386/ssse3-phaddsw.c
@@ -2,11 +2,21 @@
/* { dg-require-effective-target ssse3 } */
/* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */
-#include "ssse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "ssse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST ssse3_test
+#endif
+
+#include CHECK_H
+
#include "ssse3-vals.h"
#include <tmmintrin.h>
+#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_phaddsw (int *i1, int *i2, int *r)
@@ -16,6 +26,7 @@ ssse3_test_phaddsw (int *i1, int *i2, int *r)
*(__m64 *) r = _mm_hadds_pi16 (t1, t2);
_mm_empty ();
}
+#endif
/* Test the 128-bit form */
static void
@@ -55,7 +66,7 @@ compute_correct_result (int *i1, int *i2, int *r)
}
static void
-ssse3_test (void)
+TEST (void)
{
int i;
int r [4] __attribute__ ((aligned(16)));
@@ -67,10 +78,12 @@ ssse3_test (void)
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
+#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_phaddsw (&vals[i + 0], &vals[i + 2], &r[0]);
ssse3_test_phaddsw (&vals[i + 4], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
+#endif
/* Run the 128-bit tests */
ssse3_test_phaddsw128 (&vals[i + 0], &vals[i + 4], r);
diff --git a/gcc/testsuite/gcc.target/i386/ssse3-phaddw.c b/gcc/testsuite/gcc.target/i386/ssse3-phaddw.c
index 008a0db2d38..05c0afd4f69 100644
--- a/gcc/testsuite/gcc.target/i386/ssse3-phaddw.c
+++ b/gcc/testsuite/gcc.target/i386/ssse3-phaddw.c
@@ -2,11 +2,21 @@
/* { dg-require-effective-target ssse3 } */
/* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */
-#include "ssse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "ssse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST ssse3_test
+#endif
+
+#include CHECK_H
+
#include "ssse3-vals.h"
#include <tmmintrin.h>
+#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_phaddw (int *i1, int *i2, int *r)
@@ -16,6 +26,7 @@ ssse3_test_phaddw (int *i1, int *i2, int *r)
*(__m64 *) r = _mm_hadd_pi16 (t1, t2);
_mm_empty ();
}
+#endif
/* Test the 128-bit form */
static void
@@ -44,7 +55,7 @@ compute_correct_result(int *i1, int *i2, int *r)
}
static void
-ssse3_test (void)
+TEST (void)
{
int i;
int r [4] __attribute__ ((aligned(16)));
@@ -56,10 +67,12 @@ ssse3_test (void)
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
+#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_phaddw (&vals[i + 0], &vals[i + 2], &r[0]);
ssse3_test_phaddw (&vals[i + 4], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
+#endif
/* Run the 128-bit tests */
ssse3_test_phaddw128 (&vals[i + 0], &vals[i + 4], r);
diff --git a/gcc/testsuite/gcc.target/i386/ssse3-phsubd.c b/gcc/testsuite/gcc.target/i386/ssse3-phsubd.c
index 19a1dc1da07..5884e5c12fe 100644
--- a/gcc/testsuite/gcc.target/i386/ssse3-phsubd.c
+++ b/gcc/testsuite/gcc.target/i386/ssse3-phsubd.c
@@ -2,11 +2,21 @@
/* { dg-require-effective-target ssse3 } */
/* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */
-#include "ssse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "ssse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST ssse3_test
+#endif
+
+#include CHECK_H
+
#include "ssse3-vals.h"
#include <tmmintrin.h>
+#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_phsubd (int *i1, int *i2, int *r)
@@ -16,6 +26,7 @@ ssse3_test_phsubd (int *i1, int *i2, int *r)
*(__m64 *) r = _mm_hsub_pi32(t1, t2);
_mm_empty ();
}
+#endif
/* Test the 128-bit form */
static void
@@ -40,7 +51,7 @@ compute_correct_result (int *i1, int *i2, int *r)
}
static void
-ssse3_test (void)
+TEST (void)
{
int i;
int r [4] __attribute__ ((aligned(16)));
@@ -52,10 +63,12 @@ ssse3_test (void)
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
+#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_phsubd (&vals[i + 0], &vals[i + 2], &r[0]);
ssse3_test_phsubd (&vals[i + 4], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
+#endif
/* Run the 128-bit tests */
ssse3_test_phsubd128 (&vals[i + 0], &vals[i + 4], r);
diff --git a/gcc/testsuite/gcc.target/i386/ssse3-phsubsw.c b/gcc/testsuite/gcc.target/i386/ssse3-phsubsw.c
index 506844f7b10..371c8d112d1 100644
--- a/gcc/testsuite/gcc.target/i386/ssse3-phsubsw.c
+++ b/gcc/testsuite/gcc.target/i386/ssse3-phsubsw.c
@@ -2,11 +2,21 @@
/* { dg-require-effective-target ssse3 } */
/* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */
-#include "ssse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "ssse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST ssse3_test
+#endif
+
+#include CHECK_H
+
#include "ssse3-vals.h"
#include <tmmintrin.h>
+#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_phsubsw (int *i1, int *i2, int *r)
@@ -18,6 +28,7 @@ ssse3_test_phsubsw (int *i1, int *i2, int *r)
_mm_empty ();
}
+#endif
/* Test the 128-bit form */
static void
@@ -58,7 +69,7 @@ compute_correct_result (int *i1, int *i2, int *r)
}
static void
-ssse3_test (void)
+TEST (void)
{
int i;
int r [4] __attribute__ ((aligned(16)));
@@ -70,10 +81,12 @@ ssse3_test (void)
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
+#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_phsubsw (&vals[i + 0], &vals[i + 2], &r[0]);
ssse3_test_phsubsw (&vals[i + 4], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
+#endif
/* Run the 128-bit tests */
ssse3_test_phsubsw128 (&vals[i + 0], &vals[i + 4], r);
diff --git a/gcc/testsuite/gcc.target/i386/ssse3-phsubw.c b/gcc/testsuite/gcc.target/i386/ssse3-phsubw.c
index 7fd67faa20e..f3dbf9c9896 100644
--- a/gcc/testsuite/gcc.target/i386/ssse3-phsubw.c
+++ b/gcc/testsuite/gcc.target/i386/ssse3-phsubw.c
@@ -2,11 +2,20 @@
/* { dg-require-effective-target ssse3 } */
/* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */
-#include "ssse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "ssse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST ssse3_test
+#endif
+
+#include CHECK_H
#include "ssse3-vals.h"
#include <tmmintrin.h>
+#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_phsubw (int *i1, int *i2, int *r)
@@ -16,6 +25,7 @@ ssse3_test_phsubw (int *i1, int *i2, int *r)
*(__m64 *) r = _mm_hsub_pi16 (t1, t2);
_mm_empty ();
}
+#endif
/* Test the 128-bit form */
static void
@@ -44,7 +54,7 @@ compute_correct_result (int *i1, int *i2, int *r)
}
static void
-ssse3_test (void)
+TEST (void)
{
int i;
int r [4] __attribute__ ((aligned(16)));
@@ -56,10 +66,12 @@ ssse3_test (void)
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
+#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_phsubw (&vals[i + 0], &vals[i + 2], &r[0]);
ssse3_test_phsubw (&vals[i + 4], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
+#endif
/* Run the 128-bit tests */
ssse3_test_phsubw128 (&vals[i + 0], &vals[i + 4], r);
diff --git a/gcc/testsuite/gcc.target/i386/ssse3-pmaddubsw.c b/gcc/testsuite/gcc.target/i386/ssse3-pmaddubsw.c
index 3a2a27c0f3a..00bfc844f42 100644
--- a/gcc/testsuite/gcc.target/i386/ssse3-pmaddubsw.c
+++ b/gcc/testsuite/gcc.target/i386/ssse3-pmaddubsw.c
@@ -2,11 +2,21 @@
/* { dg-require-effective-target ssse3 } */
/* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */
-#include "ssse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "ssse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST ssse3_test
+#endif
+
+#include CHECK_H
+
#include "ssse3-vals.h"
#include <tmmintrin.h>
+#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_pmaddubsw (int *i1, int *i2, int *r)
@@ -16,6 +26,7 @@ ssse3_test_pmaddubsw (int *i1, int *i2, int *r)
*(__m64 *) r = _mm_maddubs_pi16 (t1, t2);
_mm_empty ();
}
+#endif
/* Test the 128-bit form */
static void
@@ -58,7 +69,7 @@ compute_correct_result (int *i1, int *i2, int *r)
}
static void
-ssse3_test (void)
+TEST (void)
{
int i;
int r [4] __attribute__ ((aligned(16)));
@@ -70,10 +81,12 @@ ssse3_test (void)
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
+#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_pmaddubsw (&vals[i + 0], &vals[i + 4], &r[0]);
ssse3_test_pmaddubsw (&vals[i + 2], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
+#endif
/* Run the 128-bit tests */
ssse3_test_pmaddubsw128 (&vals[i + 0], &vals[i + 4], r);
diff --git a/gcc/testsuite/gcc.target/i386/ssse3-pmulhrsw.c b/gcc/testsuite/gcc.target/i386/ssse3-pmulhrsw.c
index 193c4fc9aca..24570b3bd63 100644
--- a/gcc/testsuite/gcc.target/i386/ssse3-pmulhrsw.c
+++ b/gcc/testsuite/gcc.target/i386/ssse3-pmulhrsw.c
@@ -2,11 +2,21 @@
/* { dg-require-effective-target ssse3 } */
/* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */
-#include "ssse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "ssse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST ssse3_test
+#endif
+
+#include CHECK_H
+
#include "ssse3-vals.h"
#include <tmmintrin.h>
+#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_pmulhrsw (int *i1, int *i2, int *r)
@@ -16,6 +26,7 @@ ssse3_test_pmulhrsw (int *i1, int *i2, int *r)
*(__m64 *) r = _mm_mulhrs_pi16 (t1, t2);
_mm_empty ();
}
+#endif
/* Test the 128-bit form */
static void
@@ -45,7 +56,7 @@ compute_correct_result (int *i1, int *i2, int *r)
}
static void
-ssse3_test (void)
+TEST (void)
{
int i;
int r [4] __attribute__ ((aligned(16)));
@@ -57,10 +68,12 @@ ssse3_test (void)
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
+#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_pmulhrsw (&vals[i + 0], &vals[i + 4], &r[0]);
ssse3_test_pmulhrsw (&vals[i + 2], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
+#endif
/* Run the 128-bit tests */
ssse3_test_pmulhrsw128 (&vals[i + 0], &vals[i + 4], r);
diff --git a/gcc/testsuite/gcc.target/i386/ssse3-pshufb.c b/gcc/testsuite/gcc.target/i386/ssse3-pshufb.c
index 0a24d9e87f9..b995456b61c 100644
--- a/gcc/testsuite/gcc.target/i386/ssse3-pshufb.c
+++ b/gcc/testsuite/gcc.target/i386/ssse3-pshufb.c
@@ -2,11 +2,21 @@
/* { dg-require-effective-target ssse3 } */
/* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */
-#include "ssse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "ssse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST ssse3_test
+#endif
+
+#include CHECK_H
+
#include "ssse3-vals.h"
#include <tmmintrin.h>
+#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_pshufb (int *i1, int *i2, int *r)
@@ -16,6 +26,7 @@ ssse3_test_pshufb (int *i1, int *i2, int *r)
*(__m64 *)r = _mm_shuffle_pi8 (t1, t2);
_mm_empty ();
}
+#endif
/* Test the 128-bit form */
static void
@@ -27,6 +38,7 @@ ssse3_test_pshufb128 (int *i1, int *i2, int *r)
*(__m128i *)r = _mm_shuffle_epi8 (t1, t2);
}
+#ifndef __AVX__
/* Routine to manually compute the results */
static void
compute_correct_result_64 (int *i1, int *i2, int *r)
@@ -48,6 +60,7 @@ compute_correct_result_64 (int *i1, int *i2, int *r)
bout[i] = b1[8 + (select & 0x7)];
}
}
+#endif
static void
compute_correct_result_128 (int *i1, int *i2, int *r)
@@ -69,7 +82,7 @@ compute_correct_result_128 (int *i1, int *i2, int *r)
}
static void
-ssse3_test (void)
+TEST (void)
{
int i;
int r [4] __attribute__ ((aligned(16)));
@@ -78,6 +91,7 @@ ssse3_test (void)
for (i = 0; i < 256; i += 8)
{
+#ifndef __AVX__
/* Manually compute the result */
compute_correct_result_64 (&vals[i + 0], &vals[i + 4], ck);
@@ -85,6 +99,7 @@ ssse3_test (void)
ssse3_test_pshufb (&vals[i + 0], &vals[i + 4], &r[0]);
ssse3_test_pshufb (&vals[i + 2], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
+#endif
/* Recompute the result for 128-bits */
compute_correct_result_128 (&vals[i + 0], &vals[i + 4], ck);
diff --git a/gcc/testsuite/gcc.target/i386/ssse3-psignb.c b/gcc/testsuite/gcc.target/i386/ssse3-psignb.c
index ba7617bf869..7462929aa20 100644
--- a/gcc/testsuite/gcc.target/i386/ssse3-psignb.c
+++ b/gcc/testsuite/gcc.target/i386/ssse3-psignb.c
@@ -2,11 +2,20 @@
/* { dg-require-effective-target ssse3 } */
/* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */
-#include "ssse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "ssse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST ssse3_test
+#endif
+
+#include CHECK_H
#include "ssse3-vals.h"
#include <tmmintrin.h>
+#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_psignb (int *i1, int *i2, int *r)
@@ -16,6 +25,7 @@ ssse3_test_psignb (int *i1, int *i2, int *r)
*(__m64 *) r = _mm_sign_pi8 (t1, t2);
_mm_empty ();
}
+#endif
/* Test the 128-bit form */
static void
@@ -46,7 +56,7 @@ compute_correct_result (int *i1, int *i2, int *r)
}
static void
-ssse3_test (void)
+TEST (void)
{
int i;
int r [4] __attribute__ ((aligned(16)));
@@ -58,10 +68,12 @@ ssse3_test (void)
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
+#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_psignb (&vals[i + 0], &vals[i + 4], &r[0]);
ssse3_test_psignb (&vals[i + 2], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
+#endif
/* Run the 128-bit tests */
ssse3_test_psignb128 (&vals[i + 0], &vals[i + 4], r);
diff --git a/gcc/testsuite/gcc.target/i386/ssse3-psignd.c b/gcc/testsuite/gcc.target/i386/ssse3-psignd.c
index 8b1ab4d880a..eca0489f8d3 100644
--- a/gcc/testsuite/gcc.target/i386/ssse3-psignd.c
+++ b/gcc/testsuite/gcc.target/i386/ssse3-psignd.c
@@ -2,11 +2,20 @@
/* { dg-require-effective-target ssse3 } */
/* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */
-#include "ssse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "ssse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST ssse3_test
+#endif
+
+#include CHECK_H
#include "ssse3-vals.h"
#include <tmmintrin.h>
+#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_psignd (int *i1, int *i2, int *r)
@@ -16,6 +25,7 @@ ssse3_test_psignd (int *i1, int *i2, int *r)
*(__m64 *) r = _mm_sign_pi32 (t1, t2);
_mm_empty ();
}
+#endif
/* Test the 128-bit form */
static void
@@ -43,7 +53,7 @@ compute_correct_result (int *i1, int *i2, int *r)
}
static void
-ssse3_test (void)
+TEST (void)
{
int i;
int r [4] __attribute__ ((aligned(16)));
@@ -55,10 +65,12 @@ ssse3_test (void)
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
+#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_psignd (&vals[i + 0], &vals[i + 4], &r[0]);
ssse3_test_psignd (&vals[i + 2], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
+#endif
/* Run the 128-bit tests */
ssse3_test_psignd128 (&vals[i + 0], &vals[i + 4], r);
diff --git a/gcc/testsuite/gcc.target/i386/ssse3-psignw.c b/gcc/testsuite/gcc.target/i386/ssse3-psignw.c
index 04e9ed27cfa..00a506fd894 100644
--- a/gcc/testsuite/gcc.target/i386/ssse3-psignw.c
+++ b/gcc/testsuite/gcc.target/i386/ssse3-psignw.c
@@ -2,11 +2,20 @@
/* { dg-require-effective-target ssse3 } */
/* { dg-options "-O2 -fno-strict-aliasing -mssse3" } */
-#include "ssse3-check.h"
+#ifndef CHECK_H
+#define CHECK_H "ssse3-check.h"
+#endif
+
+#ifndef TEST
+#define TEST ssse3_test
+#endif
+
+#include CHECK_H
#include "ssse3-vals.h"
#include <tmmintrin.h>
+#ifndef __AVX__
/* Test the 64-bit form */
static void
ssse3_test_psignw (int *i1, int *i2, int *r)
@@ -16,6 +25,7 @@ ssse3_test_psignw (int *i1, int *i2, int *r)
*(__m64 *) r = _mm_sign_pi16 (t1, t2);
_mm_empty ();
}
+#endif
/* Test the 128-bit form */
static void
@@ -46,7 +56,7 @@ compute_correct_result (int *i1, int *i2, int *r)
}
static void
-ssse3_test (void)
+TEST (void)
{
int i;
int r [4] __attribute__ ((aligned(16)));
@@ -58,10 +68,12 @@ ssse3_test (void)
/* Manually compute the result */
compute_correct_result (&vals[i + 0], &vals[i + 4], ck);
+#ifndef __AVX__
/* Run the 64-bit tests */
ssse3_test_psignw (&vals[i + 0], &vals[i + 4], &r[0]);
ssse3_test_psignw (&vals[i + 2], &vals[i + 6], &r[2]);
fail += chk_128 (ck, r);
+#endif
/* Run the 128-bit tests */
ssse3_test_psignw128 (&vals[i + 0], &vals[i + 4], r);
diff --git a/gcc/testsuite/gcc.target/i386/stackalign/asm-1.c b/gcc/testsuite/gcc.target/i386/stackalign/asm-1.c
new file mode 100644
index 00000000000..e4d4f20bb18
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/stackalign/asm-1.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-mpreferred-stack-boundary=2" } */
+
+/* This case is to detect a compile time regression introduced in stack
+ branch development. */
+f(){asm("%0"::"r"(1.5F));}g(){asm("%0"::"r"(1.5));}
diff --git a/gcc/testsuite/gcc.target/i386/stackalign/return-1.c b/gcc/testsuite/gcc.target/i386/stackalign/return-1.c
new file mode 100644
index 00000000000..c5b32e5c421
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/stackalign/return-1.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-mpreferred-stack-boundary=2" } */
+
+/* This compile only test is to detect an assertion failure in stack branch
+ development. */
+
+double
+foo (void)
+{
+}
diff --git a/gcc/testsuite/gcc.target/i386/stackalign/return-2.c b/gcc/testsuite/gcc.target/i386/stackalign/return-2.c
new file mode 100644
index 00000000000..113e71b80da
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/stackalign/return-2.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-mpreferred-stack-boundary=2" } */
+
+/* This compile only test is to detect an assertion failure in stack branch
+ development. */
+void baz (void);
+
+double foo (void)
+{
+ baz ();
+ return;
+}
+
+double bar (void)
+{
+ baz ();
+}
diff --git a/gcc/testsuite/gcc.target/i386/stackalign/return-3.c b/gcc/testsuite/gcc.target/i386/stackalign/return-3.c
new file mode 100644
index 00000000000..8a682b8fca6
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/stackalign/return-3.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { 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
+ development. */
+_Decimal128 test (void)
+{
+ return 1234123412341234.123412341234dl;
+}
diff --git a/gcc/testsuite/gcc.target/i386/stackalign/return-4.c b/gcc/testsuite/gcc.target/i386/stackalign/return-4.c
new file mode 100644
index 00000000000..c66c369c8fc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/stackalign/return-4.c
@@ -0,0 +1,10 @@
+/* { dg-do compile } */
+/* { dg-options "-mpreferred-stack-boundary=4" } */
+/* { dg-final { scan-assembler-not "andl\[^\\n\]*-64,\[^\\n\]*sp" } } */
+
+/* This compile only test is to detect an assertion failure in stack branch
+ development. */
+typedef int aligned __attribute__((aligned(64)));
+
+aligned
+foo (void) { }
diff --git a/gcc/testsuite/gcc.target/i386/stackalign/return-5.c b/gcc/testsuite/gcc.target/i386/stackalign/return-5.c
new file mode 100644
index 00000000000..84531ddfe29
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/stackalign/return-5.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-mpreferred-stack-boundary=4" } */
+/* { dg-final { scan-assembler-not "andl\[^\\n\]*-64,\[^\\n\]*sp" } } */
+
+/* This compile only test is to detect an assertion failure in stack branch
+ development. */
+struct bar
+{
+ int x;
+} __attribute__((aligned(64)));
+
+
+struct bar
+foo (void) { }
diff --git a/gcc/testsuite/gcc.target/i386/stackalign/return-6.c b/gcc/testsuite/gcc.target/i386/stackalign/return-6.c
new file mode 100644
index 00000000000..ceadbad1acf
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/stackalign/return-6.c
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-mpreferred-stack-boundary=4" } */
+/* { dg-final { scan-assembler-not "andl\[^\\n\]*-64,\[^\\n\]*sp" } } */
+
+/* This compile only test is to detect an assertion failure in stack branch
+ development. */
+struct bar
+{
+ int x __attribute__((aligned(64)));
+};
+
+
+struct bar
+foo (void) { }
diff --git a/gcc/testsuite/gcc.target/i386/stackalign/stackalign.exp b/gcc/testsuite/gcc.target/i386/stackalign/stackalign.exp
new file mode 100644
index 00000000000..463ba612e0f
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/stackalign/stackalign.exp
@@ -0,0 +1,47 @@
+# Copyright (C) 2008
+# Free Software Foundation, Inc.
+
+# This program 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 of the License, or
+# (at your option) any later version.
+#
+# This program 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/>.
+
+# Exit immediately if this isn't a x86 target.
+if { ![istarget i?86*-*-*] && ![istarget x86_64-*-*] } then {
+ return
+}
+
+load_lib gcc-dg.exp
+
+# Only run on targets which support automatic stack alignment.
+if { ![check_effective_target_automatic_stack_alignment] } then {
+ return
+}
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS "-w"
+}
+
+# Initialize `dg'.
+dg-init
+
+set additional_flags "-mstackrealign"
+
+dg-runtest [lsort [glob $srcdir/$subdir/*.c]] $additional_flags $DEFAULT_CFLAGS
+
+set additional_flags "-mno-stackrealign"
+
+dg-runtest [lsort [glob $srcdir/$subdir/*.c]] $additional_flags $DEFAULT_CFLAGS
+
+dg-finish
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/powerpc/altivec-macros.c b/gcc/testsuite/gcc.target/powerpc/altivec-macros.c
index d95a68dd966..8ea8df241db 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 "location of the previous" "prev __vector defn" { target *-*-* } 24 } */
+/* { dg-message "location of the previous" "prev __pixel defn" { target *-*-* } 27 } */
+/* { dg-message "location of the previous" "prev __bool defn" { target *-*-* } 30 } */
+/* { dg-message "location of the previous" "prev vector defn" { target *-*-* } 33 } */
+/* { dg-message "location of the previous" "prev pixel defn" { target *-*-* } 36 } */
+/* { dg-message "location of the previous" "prev bool defn" { target *-*-* } 39 } */
diff --git a/gcc/testsuite/gcc.target/powerpc/altivec-types-1.c b/gcc/testsuite/gcc.target/powerpc/altivec-types-1.c
index 56bf4b9a7ed..d293042d64f 100644
--- a/gcc/testsuite/gcc.target/powerpc/altivec-types-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/altivec-types-1.c
@@ -86,3 +86,6 @@ __vector __bool float vbf; /* { dg-error "" "" } */
__vector __bool double vbd; /* { dg-error "" "" } */
__vector __bool short float blf; /* { dg-error "" "" } */
__vector __bool short double vlbd; /* { dg-error "" "" } */
+
+/* { dg-message "note: previous" "prev vsf" { target *-*-* } 79 } */
+/* { dg-message "note: previous" "prev vsd" { target *-*-* } 82 } */
diff --git a/gcc/testsuite/gcc.target/powerpc/darwin-save-world-1.c b/gcc/testsuite/gcc.target/powerpc/darwin-save-world-1.c
index 452060e9f61..c45a90f0f5c 100644
--- a/gcc/testsuite/gcc.target/powerpc/darwin-save-world-1.c
+++ b/gcc/testsuite/gcc.target/powerpc/darwin-save-world-1.c
@@ -1,5 +1,6 @@
/* { dg-do run { target powerpc*-*-* } } */
/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-skip-if "need to be able to execute AltiVec" { ! { powerpc_altivec_ok && vmx_hw } } } */
/* { dg-options "-maltivec" } */
/* With altivec turned on, Darwin wants to save the world but we did not mark lr as being saved any more
diff --git a/gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c b/gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c
index bfdf7426600..3d9afb25aa7 100644
--- a/gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c
+++ b/gcc/testsuite/gcc.target/powerpc/ppu-intrinsics.c
@@ -1,5 +1,5 @@
/* { dg-do link { target { *-*-linux* && powerpc_fprs } } } */
-/* { dg-options "-W -Wall -mcpu=cell" } */
+/* { dg-options "-W -Wall -Wno-uninitialized -mcpu=cell" } */
/* Test some PPU intrinsics from <ppu_intrinsics.h>. */
#include <ppu_intrinsics.h>
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/gcc.target/x86_64/abi/abi-x86_64.exp b/gcc/testsuite/gcc.target/x86_64/abi/abi-x86_64.exp
index 4f9fd46441f..61dc3e4586b 100644
--- a/gcc/testsuite/gcc.target/x86_64/abi/abi-x86_64.exp
+++ b/gcc/testsuite/gcc.target/x86_64/abi/abi-x86_64.exp
@@ -39,7 +39,7 @@ foreach src [lsort [find $srcdir/$subdir test_*.c]] {
$additional_flags
} else {
c-torture-execute [list $src \
- $srcdir/$subdir/asm-support.s] \
+ $srcdir/$subdir/asm-support.S] \
$additional_flags
}
}
diff --git a/gcc/testsuite/gcc.target/x86_64/abi/asm-support.s b/gcc/testsuite/gcc.target/x86_64/abi/asm-support.s
deleted file mode 100644
index 00a08c020fd..00000000000
--- a/gcc/testsuite/gcc.target/x86_64/abi/asm-support.s
+++ /dev/null
@@ -1,80 +0,0 @@
- .file "snapshot.S"
- .text
- .p2align 4,,15
-.globl snapshot
- .type snapshot, @function
-snapshot:
-.LFB3:
- movq %rax, rax(%rip)
- movq %rbx, rbx(%rip)
- movq %rcx, rcx(%rip)
- movq %rdx, rdx(%rip)
- movq %rdi, rdi(%rip)
- movq %rsi, rsi(%rip)
- movq %rbp, rbp(%rip)
- movq %rsp, rsp(%rip)
- movq %r8, r8(%rip)
- movq %r9, r9(%rip)
- movq %r10, r10(%rip)
- movq %r11, r11(%rip)
- movq %r12, r12(%rip)
- movq %r13, r13(%rip)
- movq %r14, r14(%rip)
- movq %r15, r15(%rip)
- movdqu %xmm0, xmm_regs+0(%rip)
- movdqu %xmm1, xmm_regs+16(%rip)
- movdqu %xmm2, xmm_regs+16*2(%rip)
- movdqu %xmm3, xmm_regs+16*3(%rip)
- movdqu %xmm4, xmm_regs+16*4(%rip)
- movdqu %xmm5, xmm_regs+16*5(%rip)
- movdqu %xmm6, xmm_regs+16*6(%rip)
- movdqu %xmm7, xmm_regs+16*7(%rip)
- movdqu %xmm8, xmm_regs+16*8(%rip)
- movdqu %xmm9, xmm_regs+16*9(%rip)
- movdqu %xmm10, xmm_regs+16*10(%rip)
- movdqu %xmm11, xmm_regs+16*11(%rip)
- movdqu %xmm12, xmm_regs+16*12(%rip)
- movdqu %xmm13, xmm_regs+16*13(%rip)
- movdqu %xmm14, xmm_regs+16*14(%rip)
- movdqu %xmm15, xmm_regs+16*15(%rip)
- jmp *callthis(%rip)
-.LFE3:
- .size snapshot, .-snapshot
-
- .p2align 4,,15
-.globl snapshot_ret
- .type snapshot_ret, @function
-snapshot_ret:
- movq %rdi, rdi(%rip)
- call *callthis(%rip)
- movq %rax, rax(%rip)
- movq %rdx, rdx(%rip)
- movdqu %xmm0, xmm_regs+0(%rip)
- movdqu %xmm1, xmm_regs+16(%rip)
- fstpt x87_regs(%rip)
- fstpt x87_regs+16(%rip)
- fldt x87_regs+16(%rip)
- fldt x87_regs(%rip)
- ret
- .size snapshot_ret, .-snapshot_ret
-
- .comm callthis,8,8
- .comm rax,8,8
- .comm rbx,8,8
- .comm rcx,8,8
- .comm rdx,8,8
- .comm rsi,8,8
- .comm rdi,8,8
- .comm rsp,8,8
- .comm rbp,8,8
- .comm r8,8,8
- .comm r9,8,8
- .comm r10,8,8
- .comm r11,8,8
- .comm r12,8,8
- .comm r13,8,8
- .comm r14,8,8
- .comm r15,8,8
- .comm xmm_regs,256,32
- .comm x87_regs,128,32
- .comm volatile_var,8,8
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/c_sizeof_2.f90 b/gcc/testsuite/gfortran.dg/c_sizeof_2.f90
index f6c3077f83d..6e32cb34687 100644
--- a/gcc/testsuite/gfortran.dg/c_sizeof_2.f90
+++ b/gcc/testsuite/gfortran.dg/c_sizeof_2.f90
@@ -2,8 +2,7 @@
! { dg-options "-std=f2003 -Wall" }
! Support F2008's c_sizeof()
!
-integer(4) :: i, j(10)
-i = c_sizeof(i) ! { dg-error "not included in the selected standard" }
-i = c_sizeof(j) ! { dg-error "not included in the selected standard" }
+integer(4) :: i
+i = c_sizeof(i) ! { dg-warning "Fortran 2008" }
end
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/debug/pr35154-dwarf2.f b/gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f
index 0203d134a62..d5003a3fc36 100644
--- a/gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f
+++ b/gcc/testsuite/gfortran.dg/debug/pr35154-dwarf2.f
@@ -27,11 +27,11 @@ C { dg-options "-dA" }
C { dg-final { scan-assembler "(DIE.*DW_TAG_common_block)" } }
C { dg-final { scan-assembler "DW_AT_name: \"__BLNK__\"" } }
-C { dg-final { scan-assembler "(DIE.*DW_TAG_member)" } }
+C { dg-final { scan-assembler "(DIE.*DW_TAG_variable)" } }
C { dg-final { scan-assembler "\"i.*\".*DW_AT_name" } }
C { dg-final { scan-assembler "\"j.*\".*DW_AT_name" } }
C { dg-final { scan-assembler "(DIE.*DW_TAG_common_block)" } }
C { dg-final { scan-assembler "DW_AT_name: \"label\"" } }
-C { dg-final { scan-assembler "(DIE.*DW_TAG_member)" } }
+C { dg-final { scan-assembler "(DIE.*DW_TAG_variable)" } }
C { dg-final { scan-assembler "\"l.*\".*DW_AT_name" } }
C { dg-final { scan-assembler "\"m.*\".*DW_AT_name" } }
diff --git a/gcc/testsuite/gfortran.dg/finalize_5.f03 b/gcc/testsuite/gfortran.dg/finalize_5.f03
index 9f5dc1784d0..1df2d8cf285 100644
--- a/gcc/testsuite/gfortran.dg/finalize_5.f03
+++ b/gcc/testsuite/gfortran.dg/finalize_5.f03
@@ -9,7 +9,7 @@ MODULE final_type
TYPE :: mytype
INTEGER, ALLOCATABLE :: fooarr(:)
REAL :: foobar
- FINAL :: finalize_matrix ! { dg-error "must be inside CONTAINS" }
+ FINAL :: finalize_matrix ! { dg-error "must be inside a derived type" }
CONTAINS
FINAL :: ! { dg-error "Empty FINAL" }
FINAL ! { dg-error "Empty FINAL" }
diff --git a/gcc/testsuite/gfortran.dg/fmt_g0_2.f08 b/gcc/testsuite/gfortran.dg/fmt_g0_2.f08
index c19e3f2dca4..3567561802b 100644
--- a/gcc/testsuite/gfortran.dg/fmt_g0_2.f08
+++ b/gcc/testsuite/gfortran.dg/fmt_g0_2.f08
@@ -1,5 +1,5 @@
! { dg-do run }
-! { dg-options "-std=f95 -pedantic" }
+! { dg-options "-std=f95 -pedantic -fall-intrinsics" }
! { dg-shouldfail "Zero width in format descriptor" }
! PR36420 Fortran 2008: g0 edit descriptor
! Test case provided by Jerry DeLisle <jvdelisle@gcc.gnu.org>
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/gamma_2.f90 b/gcc/testsuite/gfortran.dg/gamma_2.f90
index 6e8cefa6858..5b0e922cb92 100644
--- a/gcc/testsuite/gfortran.dg/gamma_2.f90
+++ b/gcc/testsuite/gfortran.dg/gamma_2.f90
@@ -8,11 +8,11 @@
! PR fortran/32980
!
subroutine foo()
-intrinsic :: gamma
-intrinsic :: dgamma
-intrinsic :: lgamma
-intrinsic :: algama
-intrinsic :: dlgama
+intrinsic :: gamma ! { dg-error "Fortran 2008" }
+intrinsic :: dgamma ! { dg-error "extension" }
+intrinsic :: lgamma ! { dg-error "extension" }
+intrinsic :: algama ! { dg-error "extension" }
+intrinsic :: dlgama ! { dg-error "extension" }
integer, parameter :: sp = kind(1.0)
integer, parameter :: dp = kind(1.0d0)
@@ -20,13 +20,13 @@ integer, parameter :: dp = kind(1.0d0)
real(sp) :: rsp = 1.0_sp
real(dp) :: rdp = 1.0_dp
-rsp = gamma(rsp) ! FIXME "is not included in the selected standard"
-rdp = gamma(rdp) ! FIXME "is not included in the selected standard"
-rdp = dgamma(rdp) ! { dg-error "is not included in the selected standard" }
+rsp = gamma(rsp)
+rdp = gamma(rdp)
+rdp = dgamma(rdp)
-rsp = lgamma(rsp) ! { dg-error "is not included in the selected standard" }
-rdp = lgamma(rdp) ! { dg-error "is not included in the selected standard" }
-rsp = algama(rsp) ! { dg-error "is not included in the selected standard" }
-rdp = dlgama(rdp) ! { dg-error "is not included in the selected standard" }
+rsp = lgamma(rsp)
+rdp = lgamma(rdp)
+rsp = algama(rsp)
+rdp = dlgama(rdp)
end subroutine foo
end
diff --git a/gcc/testsuite/gfortran.dg/gomp/block-1.f90 b/gcc/testsuite/gfortran.dg/gomp/block-1.f90
index f03602ab2f4..04c39a40a02 100644
--- a/gcc/testsuite/gfortran.dg/gomp/block-1.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/block-1.f90
@@ -2,7 +2,7 @@
!$omp parallel
!$omp critical
- goto 10 ! { dg-error "invalid exit" }
+ goto 10 ! { dg-error "invalid (exit|branch)" }
!$omp end critical
10 x = 1
!$omp end parallel
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/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/private_type_6.f90 b/gcc/testsuite/gfortran.dg/private_type_6.f90
index d3cc809dfef..5e13ed53477 100644
--- a/gcc/testsuite/gfortran.dg/private_type_6.f90
+++ b/gcc/testsuite/gfortran.dg/private_type_6.f90
@@ -19,7 +19,7 @@ program foo_test
TYPE(footype) :: foo
TYPE(bartype) :: foo2
foo = footype(1) ! { dg-error "All components of 'footype' are PRIVATE" }
- foo2 = bartype(1,2) ! { dg-error "'dummy2' is PRIVATE" }
+ foo2 = bartype(1,2) ! { dg-error "is a PRIVATE component" }
foo2%dummy2 = 5 ! { dg-error "is a PRIVATE component" }
end program foo_test
! { dg-final { cleanup-modules "foomod" } }
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/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/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/selected_char_kind_3.f90 b/gcc/testsuite/gfortran.dg/selected_char_kind_3.f90
index 5cc7b112496..a7b7ae7d895 100644
--- a/gcc/testsuite/gfortran.dg/selected_char_kind_3.f90
+++ b/gcc/testsuite/gfortran.dg/selected_char_kind_3.f90
@@ -1,10 +1,10 @@
! { dg-do compile }
-! { dg-options "-std=f95 -pedantic -Wall" }
+! { dg-options "-std=f95 -pedantic -Wall -Wno-intrinsics-std" }
!
! Check that SELECTED_CHAR_KIND is rejected with -std=f95
!
implicit none
- character(kind=selected_char_kind("ascii")) :: s ! { dg-error "is not included in the selected standard" }
+ character(kind=selected_char_kind("ascii")) :: s ! { dg-error "must be an intrinsic or a specification function" }
s = "" ! { dg-error "has no IMPLICIT type" }
print *, s
end
diff --git a/gcc/testsuite/gfortran.dg/structure_constructor_7.f03 b/gcc/testsuite/gfortran.dg/structure_constructor_7.f03
index 3ba79ea373b..5388e8805eb 100644
--- a/gcc/testsuite/gfortran.dg/structure_constructor_7.f03
+++ b/gcc/testsuite/gfortran.dg/structure_constructor_7.f03
@@ -13,6 +13,6 @@ PROGRAM test
TYPE(basics_t) :: basics
basics = basics_t (42, 1.5, 1000) ! { dg-error "Too many components" }
- basics = basics_t (42, xxx = 1000) ! { dg-error "Component 'xxx'" }
+ basics = basics_t (42, xxx = 1000) ! { dg-error "is not a member" }
END PROGRAM test
diff --git a/gcc/testsuite/gfortran.dg/structure_constructor_8.f03 b/gcc/testsuite/gfortran.dg/structure_constructor_8.f03
index 4b0bce779db..520b52853d5 100644
--- a/gcc/testsuite/gfortran.dg/structure_constructor_8.f03
+++ b/gcc/testsuite/gfortran.dg/structure_constructor_8.f03
@@ -47,8 +47,8 @@ PROGRAM test
struct2 = allpriv_t ()
! These should fail
- struct1 = haspriv_t (1, 2) ! { dg-error "'b' is PRIVATE" }
- struct1 = haspriv_t (b = 2, a = 1) ! { dg-error "'b' is PRIVATE" }
+ struct1 = haspriv_t (1, 2) ! { dg-error "is a PRIVATE component" }
+ struct1 = haspriv_t (b = 2, a = 1) ! { dg-error "is a PRIVATE component" }
! This should fail as all components are private
struct2 = allpriv_t (5) ! { dg-error "of 'allpriv_t' are PRIVATE" }
diff --git a/gcc/testsuite/gfortran.dg/warn_std_1.f90 b/gcc/testsuite/gfortran.dg/warn_std_1.f90
index 4d709a12cdf..b0e4b5d4148 100644
--- a/gcc/testsuite/gfortran.dg/warn_std_1.f90
+++ b/gcc/testsuite/gfortran.dg/warn_std_1.f90
@@ -1,5 +1,5 @@
! { dg-do compile }
-! { dg-options "-Wnonstd-intrinsics -std=gnu" }
+! { dg-options "-std=gnu" }
!
! PR fortran/32778 - pedantic warning: intrinsics that
! are GNU extensions not part of -std=gnu
diff --git a/gcc/testsuite/gfortran.dg/warn_std_2.f90 b/gcc/testsuite/gfortran.dg/warn_std_2.f90
index 0a8c509d5c6..325fc8cb6e1 100644
--- a/gcc/testsuite/gfortran.dg/warn_std_2.f90
+++ b/gcc/testsuite/gfortran.dg/warn_std_2.f90
@@ -1,5 +1,5 @@
! { dg-do compile }
-! { dg-options "-Wnonstd-intrinsics -std=f95" }
+! { dg-options "-std=f95 -Wintrinsics-std" }
!
! PR fortran/32778 - pedantic warning: intrinsics that
! are GNU extensions not part of -std=gnu
@@ -11,15 +11,15 @@ CHARACTER(len=255) :: tmp
REAL(8) :: x
! GNU extension, check overload of F77 standard intrinsic
-x = ZABS(CMPLX(0.0, 1.0, 8)) ! { dg-error "is not included in the selected standard" }
+x = ZABS(CMPLX(0.0, 1.0, 8)) ! { dg-warning "extension" }
! GNU extension
-CALL flush() ! { dg-error "is not included in the selected standard" }
+CALL flush() ! { dg-warning "extension" }
! F95
tmp = ADJUSTL(" gfortran ")
! F2003
-CALL GET_COMMAND (tmp) ! { dg-error "is not included in the selected standard" }
+CALL GET_COMMAND (tmp) ! { dg-warning "Fortran 2003" }
END
diff --git a/gcc/testsuite/gfortran.dg/warn_std_3.f90 b/gcc/testsuite/gfortran.dg/warn_std_3.f90
index 0d0a0f149bd..89fe257389b 100644
--- a/gcc/testsuite/gfortran.dg/warn_std_3.f90
+++ b/gcc/testsuite/gfortran.dg/warn_std_3.f90
@@ -1,5 +1,5 @@
! { dg-do compile }
-! { dg-options "-Wnonstd-intrinsics -std=f2003" }
+! { dg-options "-std=f2003 -Wintrinsics-std" }
!
! PR fortran/32778 - pedantic warning: intrinsics that
! are GNU extensions not part of -std=gnu
@@ -11,10 +11,10 @@ CHARACTER(len=255) :: tmp
REAL(8) :: x
! GNU extension, check overload of F77 standard intrinsic
-x = ZABS(CMPLX(0.0, 1.0, 8)) ! { dg-error "is not included in the selected standard" }
+x = ZABS(CMPLX(0.0, 1.0, 8)) ! { dg-warning "extension" }
! GNU extension
-CALL flush() ! { dg-error "is not included in the selected standard" }
+CALL flush() ! { dg-warning "extension" }
! F95
tmp = ADJUSTL(" gfortran ")
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 66231c669b0..c9512b257b6 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
}
@@ -1249,6 +1259,17 @@ proc check_effective_target_arm_neon_ok { } {
}
}
+# Return 1 is this is an ARM target where -mthumb causes Thumb-1 to be
+# used.
+
+proc check_effective_target_arm_thumb1_ok { } {
+ return [check_no_compiler_messages arm_thumb1_ok assembly {
+ #if !defined(__arm__) || !defined(__thumb__) || defined(__thumb2__)
+ #error FOO
+ #endif
+ } "-mthumb"]
+}
+
# Return 1 if the target supports executing NEON instructions, 0
# otherwise. Cache the result.
@@ -1505,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.
#
@@ -1565,6 +1608,28 @@ proc check_effective_target_vect_no_bitwise { } {
return $et_vect_no_bitwise_saved
}
+# Return 1 if the target plus current options supports vector permutation,
+# 0 otherwise.
+#
+# This won't change for different subtargets so cache the result.
+
+proc check_effective_target_vect_perm { } {
+ global et_vect_perm
+
+ if [info exists et_vect_perm_saved] {
+ verbose "check_effective_target_vect_perm: using cached result" 2
+ } else {
+ set et_vect_perm_saved 0
+ if { [istarget powerpc*-*-*]
+ || [istarget spu-*-*] } {
+ set et_vect_perm_saved 1
+ }
+ }
+ verbose "check_effective_target_vect_perm: returning $et_vect_perm_saved" 2
+ return $et_vect_perm_saved
+}
+
+
# Return 1 if the target plus current options supports a vector
# widening summation of *short* args into *int* result, 0 otherwise.
# A target can also support this widening summation if it can support
@@ -1787,7 +1852,8 @@ proc check_effective_target_vect_pack_trunc { } {
set et_vect_pack_trunc_saved 0
if { ([istarget powerpc*-*-*] && ![istarget powerpc-*-linux*paired*])
|| [istarget i?86-*-*]
- || [istarget x86_64-*-*] } {
+ || [istarget x86_64-*-*]
+ || [istarget spu-*-*] } {
set et_vect_pack_trunc_saved 1
}
}
@@ -1830,10 +1896,6 @@ proc check_effective_target_unaligned_stack { } {
verbose "check_effective_target_unaligned_stack: using cached result" 2
} else {
set et_unaligned_stack_saved 0
- if { ( [istarget i?86-*-*] || [istarget x86_64-*-*] )
- && (! [istarget *-*-darwin*] ) } {
- set et_unaligned_stack_saved 1
- }
}
verbose "check_effective_target_unaligned_stack: returning $et_unaligned_stack_saved" 2
return $et_unaligned_stack_saved
@@ -2062,7 +2124,8 @@ proc check_effective_target_vect_extract_even_odd { } {
verbose "check_effective_target_vect_extract_even_odd: using cached result" 2
} else {
set et_vect_extract_even_odd_saved 0
- if { [istarget powerpc*-*-*] } {
+ if { [istarget powerpc*-*-*]
+ || [istarget spu-*-*] } {
set et_vect_extract_even_odd_saved 1
}
}
@@ -2071,6 +2134,28 @@ 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-*-*]
+ || [istarget spu-*-*] } {
+ 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 { } {
@@ -2082,7 +2167,8 @@ proc check_effective_target_vect_interleave { } {
set et_vect_interleave_saved 0
if { [istarget powerpc*-*-*]
|| [istarget i?86-*-*]
- || [istarget x86_64-*-*] } {
+ || [istarget x86_64-*-*]
+ || [istarget spu-*-*] } {
set et_vect_interleave_saved 1
}
}
@@ -2109,6 +2195,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 { } {
@@ -2455,3 +2560,25 @@ proc check_effective_target_4byte_wchar_t { } {
int dummy[sizeof (__WCHAR_TYPE__) >= 4 ? 1 : -1];
}]
}
+
+# Return 1 if the target supports automatic stack alignment.
+
+proc check_effective_target_automatic_stack_alignment { } {
+ if { [istarget i?86*-*-*]
+ || [istarget x86_64-*-*] } then {
+ return 1
+ } else {
+ return 0
+ }
+}
+
+# Return 1 if avx instructions can be compiled.
+
+proc check_effective_target_avx { } {
+ return [check_no_compiler_messages avx object {
+ void _mm256_zeroall (void)
+ {
+ __builtin_ia32_vzeroall ();
+ }
+ } "-O2 -mavx" ]
+}
diff --git a/gcc/timevar.def b/gcc/timevar.def
index a2693fcc199..94fa087754e 100644
--- a/gcc/timevar.def
+++ b/gcc/timevar.def
@@ -179,6 +179,8 @@ DEFTIMEVAR (TV_SMS , "sms modulo scheduling")
DEFTIMEVAR (TV_SCHED , "scheduling")
DEFTIMEVAR (TV_LOCAL_ALLOC , "local alloc")
DEFTIMEVAR (TV_GLOBAL_ALLOC , "global alloc")
+DEFTIMEVAR (TV_IRA , "integrated RA")
+DEFTIMEVAR (TV_RELOAD , "reload")
DEFTIMEVAR (TV_RELOAD_CSE_REGS , "reload CSE regs")
DEFTIMEVAR (TV_SEQABSTR , "sequence abstraction")
DEFTIMEVAR (TV_GCSE_AFTER_RELOAD , "load CSE after reload")
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 827b8f55b89..7ace61c2b23 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -66,6 +66,7 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic.h"
#include "params.h"
#include "reload.h"
+#include "ira.h"
#include "dwarf2asm.h"
#include "integrate.h"
#include "real.h"
@@ -82,6 +83,7 @@ along with GCC; see the file COPYING3. If not see
#include "alloc-pool.h"
#include "tree-mudflap.h"
#include "tree-pass.h"
+#include "gimple.h"
#if defined (DWARF2_UNWIND_INFO) || defined (DWARF2_DEBUGGING_INFO)
#include "dwarf2out.h"
@@ -244,11 +246,6 @@ int flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN;
int flag_complex_method = 1;
-/* Nonzero means that we don't want inlining by virtue of -fno-inline,
- not just because the tree inliner turned us off. */
-
-int flag_really_no_inline = 2;
-
/* Nonzero means we should be saving declaration info into a .X file. */
int flag_gen_aux_info = 0;
@@ -274,6 +271,14 @@ int flag_next_runtime = 0;
enum tls_model flag_tls_default = TLS_MODEL_GLOBAL_DYNAMIC;
+/* Set the default algorithm for the integrated register allocator. */
+
+enum ira_algorithm flag_ira_algorithm = IRA_ALGORITHM_MIXED;
+
+/* Set the default value for -fira-verbose. */
+
+unsigned int flag_ira_verbose = 5;
+
/* Nonzero means change certain warnings into errors.
Usually these are warnings about failure to conform to some standard. */
@@ -310,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. */
@@ -825,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 ("%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. */
@@ -1351,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
@@ -1648,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)
@@ -1702,9 +1723,6 @@ process_options (void)
if (flag_asynchronous_unwind_tables)
flag_unwind_tables = 1;
- if (!flag_unit_at_a_time)
- flag_section_anchors = 0;
-
if (flag_value_profile_transformations)
flag_profile_values = 1;
@@ -2000,6 +2018,7 @@ backend_init (void)
save_register_info ();
/* Initialize the target-specific back end pieces. */
+ ira_init_once ();
backend_init_target ();
}
@@ -2020,9 +2039,10 @@ lang_dependent_init_target (void)
/* Do the target-specific parts of expr initialization. */
init_expr_target ();
- /* Although the actions of init_set_costs are language-independent,
- it uses optabs, so we cannot call it from backend_init. */
+ /* Although the actions of these functions are language-independent,
+ they use optabs, so we cannot call them from backend_init. */
init_set_costs ();
+ ira_init ();
expand_dummy_function_end ();
}
@@ -2087,6 +2107,7 @@ dump_memory_report (bool final)
ggc_print_statistics ();
stringpool_statistics ();
dump_tree_statistics ();
+ dump_gimple_statistics ();
dump_rtx_statistics ();
dump_varray_statistics ();
dump_alloc_pool_statistics ();
@@ -2122,6 +2143,8 @@ finalize (void)
statistics_fini ();
finish_optimization_passes ();
+ ira_finish_once ();
+
if (mem_report)
dump_memory_report (true);
diff --git a/gcc/toplev.h b/gcc/toplev.h
index a2d64cd9d69..5555bf1e093 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -56,18 +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 pedwarn (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
-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);
@@ -138,6 +139,11 @@ extern int flag_unroll_all_loops;
extern int flag_unswitch_loops;
extern int flag_cprop_registers;
extern int time_report;
+extern int flag_ira;
+extern int flag_ira_coalesce;
+extern int flag_ira_move_spills;
+extern int flag_ira_share_save_slots;
+extern int flag_ira_share_spill_slots;
/* Things to do with target switches. */
extern void print_version (FILE *, const char *);
diff --git a/gcc/tracer.c b/gcc/tracer.c
index 98f66cea949..9bf2c57ded3 100644
--- a/gcc/tracer.c
+++ b/gcc/tracer.c
@@ -92,7 +92,7 @@ ignore_bb_p (const_basic_block bb)
{
if (bb->index < NUM_FIXED_BLOCKS)
return true;
- if (!maybe_hot_bb_p (bb))
+ if (optimize_bb_for_size_p (bb))
return true;
return false;
}
@@ -102,13 +102,13 @@ ignore_bb_p (const_basic_block bb)
static int
count_insns (basic_block bb)
{
- block_stmt_iterator bsi;
- tree stmt;
+ gimple_stmt_iterator gsi;
+ gimple stmt;
int n = 0;
- 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);
+ stmt = gsi_stmt (gsi);
n += estimate_num_insns (stmt, &eni_size_weights);
}
return n;
diff --git a/gcc/tree-affine.c b/gcc/tree-affine.c
index 59ac3d786b4..0d329d06efd 100644
--- a/gcc/tree-affine.c
+++ b/gcc/tree-affine.c
@@ -30,7 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-dump.h"
#include "pointer-set.h"
#include "tree-affine.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "flags.h"
/* Extends CST as appropriate for the affine combinations COMB. */
@@ -567,11 +567,13 @@ struct name_expansion
results. */
void
-aff_combination_expand (aff_tree *comb, struct pointer_map_t **cache)
+aff_combination_expand (aff_tree *comb ATTRIBUTE_UNUSED,
+ struct pointer_map_t **cache ATTRIBUTE_UNUSED)
{
unsigned i;
aff_tree to_add, current, curre;
- tree e, def, rhs;
+ tree e, rhs;
+ gimple def;
double_int scale;
void **slot;
struct name_expansion *exp;
@@ -580,6 +582,8 @@ aff_combination_expand (aff_tree *comb, struct pointer_map_t **cache)
for (i = 0; i < comb->n; i++)
{
tree type, name;
+ enum tree_code code;
+
e = comb->elts[i].val;
type = TREE_TYPE (e);
name = e;
@@ -591,19 +595,19 @@ aff_combination_expand (aff_tree *comb, struct pointer_map_t **cache)
if (TREE_CODE (name) != SSA_NAME)
continue;
def = SSA_NAME_DEF_STMT (name);
- if (TREE_CODE (def) != GIMPLE_MODIFY_STMT
- || GIMPLE_STMT_OPERAND (def, 0) != name)
+ if (!is_gimple_assign (def) || gimple_assign_lhs (def) != name)
continue;
- rhs = GIMPLE_STMT_OPERAND (def, 1);
- if (TREE_CODE (rhs) != SSA_NAME
- && !EXPR_P (rhs)
- && !is_gimple_min_invariant (rhs))
+ code = gimple_assign_rhs_code (def);
+ if (code != SSA_NAME
+ && !IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code))
+ && (get_gimple_rhs_class (code) != GIMPLE_SINGLE_RHS
+ || !is_gimple_min_invariant (gimple_assign_rhs1 (def))))
continue;
/* We do not know whether the reference retains its value at the
place where the expansion is used. */
- if (REFERENCE_CLASS_P (rhs))
+ if (TREE_CODE_CLASS (code) == tcc_reference)
continue;
if (!*cache)
@@ -616,29 +620,27 @@ aff_combination_expand (aff_tree *comb, struct pointer_map_t **cache)
exp = XNEW (struct name_expansion);
exp->in_progress = 1;
*slot = exp;
- if (e != name)
+ /* In principle this is a generally valid folding, but
+ it is not unconditionally an optimization, so do it
+ here and not in fold_unary. */
+ /* Convert (T1)(X *+- CST) into (T1)X *+- (T1)CST if T1 is wider
+ than the type of X and overflow for the type of X is
+ undefined. */
+ if (e != name
+ && INTEGRAL_TYPE_P (type)
+ && INTEGRAL_TYPE_P (TREE_TYPE (name))
+ && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (name))
+ && TYPE_PRECISION (type) > TYPE_PRECISION (TREE_TYPE (name))
+ && (code == PLUS_EXPR || code == MINUS_EXPR || code == MULT_EXPR)
+ && TREE_CODE (gimple_assign_rhs2 (def)) == INTEGER_CST)
+ rhs = fold_build2 (code, type,
+ fold_convert (type, gimple_assign_rhs1 (def)),
+ fold_convert (type, gimple_assign_rhs2 (def)));
+ else
{
- /* In principle this is a generally valid folding, but
- it is not unconditionally an optimization, so do it
- here and not in fold_unary. */
- /* Convert (T1)(X *+- CST) into (T1)X *+- (T1)CST if T1 is wider
- than the type of X and overflow for the type of X is
- undefined. */
- if (INTEGRAL_TYPE_P (type)
- && INTEGRAL_TYPE_P (TREE_TYPE (rhs))
- && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (rhs))
- && TYPE_PRECISION (type) > TYPE_PRECISION (TREE_TYPE (rhs))
- && (TREE_CODE (rhs) == PLUS_EXPR
- || TREE_CODE (rhs) == MINUS_EXPR
- || TREE_CODE (rhs) == MULT_EXPR)
- && TREE_CODE (TREE_OPERAND (rhs, 1)) == INTEGER_CST)
- {
- rhs = fold_build2 (TREE_CODE (rhs), type,
- fold_convert (type, TREE_OPERAND (rhs, 0)),
- fold_convert (type, TREE_OPERAND (rhs, 1)));
- }
- else
- rhs = fold_convert (type, rhs);
+ rhs = gimple_assign_rhs_to_tree (def);
+ if (e != name)
+ rhs = fold_convert (type, rhs);
}
tree_to_aff_combination_expand (rhs, comb->type, &current, cache);
exp->expansion = current;
diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c
index 8f7041bbf09..f59f083d5c9 100644
--- a/gcc/tree-call-cdce.c
+++ b/gcc/tree-call-cdce.c
@@ -35,7 +35,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "diagnostic.h"
#include "tree-flow.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-dump.h"
#include "tree-pass.h"
#include "timevar.h"
@@ -99,7 +99,7 @@ typedef struct input_domain
bool is_ub_inclusive;
} inp_domain;
-static VEC (tree, heap) *cond_dead_built_in_calls;
+static VEC (gimple, heap) *cond_dead_built_in_calls;
/* A helper function to construct and return an input
domain object. LB is the lower bound, HAS_LB is
@@ -174,16 +174,16 @@ check_target_format (tree arg)
#define MAX_BASE_INT_BIT_SIZE 32
static bool
-check_pow (tree pow_call)
+check_pow (gimple pow_call)
{
tree base, expn;
enum tree_code bc, ec;
- if (call_expr_nargs (pow_call) != 2)
+ if (gimple_call_num_args (pow_call) != 2)
return false;
- base = CALL_EXPR_ARG (pow_call, 0);
- expn = CALL_EXPR_ARG (pow_call, 1);
+ base = gimple_call_arg (pow_call, 0);
+ expn = gimple_call_arg (pow_call, 1);
if (!check_target_format (expn))
return false;
@@ -212,20 +212,19 @@ check_pow (tree pow_call)
}
else if (bc == SSA_NAME)
{
- tree base_def, base_val, base_val0, base_var, type;
+ tree base_val0, base_var, type;
+ gimple base_def;
int bit_sz;
/* Only handles cases where base value is converted
from integer values. */
base_def = SSA_NAME_DEF_STMT (base);
- if (TREE_CODE (base_def) != GIMPLE_MODIFY_STMT)
+ if (gimple_code (base_def) != GIMPLE_ASSIGN)
return false;
- base_val = GIMPLE_STMT_OPERAND (base_def, 1);
-
- if (TREE_CODE (base_val) != FLOAT_EXPR)
+ if (gimple_assign_rhs_code (base_def) != FLOAT_EXPR)
return false;
- base_val0 = TREE_OPERAND (base_val, 0);
+ base_val0 = gimple_assign_rhs1 (base_def);
base_var = SSA_NAME_VAR (base_val0);
if (!DECL_P (base_var))
@@ -253,11 +252,11 @@ check_pow (tree pow_call)
Returns true if the function call is a candidate. */
static bool
-check_builtin_call (tree bcall)
+check_builtin_call (gimple bcall)
{
tree arg;
- arg = CALL_EXPR_ARG (bcall, 0);
+ arg = gimple_call_arg (bcall, 0);
return check_target_format (arg);
}
@@ -266,18 +265,18 @@ check_builtin_call (tree bcall)
is a candidate. */
static bool
-is_call_dce_candidate (tree call)
+is_call_dce_candidate (gimple call)
{
tree fn;
enum built_in_function fnc;
- if (!flag_tree_builtin_call_dce)
+ /* Only potentially dead calls are considered. */
+ if (gimple_call_lhs (call))
return false;
- gcc_assert (call && TREE_CODE (call) == CALL_EXPR);
-
- fn = get_callee_fndecl (call);
- if (!fn || !DECL_BUILT_IN (fn)
+ fn = gimple_call_fndecl (call);
+ if (!fn
+ || !DECL_BUILT_IN (fn)
|| (DECL_BUILT_IN_CLASS (fn) != BUILT_IN_NORMAL))
return false;
@@ -331,38 +330,35 @@ static void
gen_one_condition (tree arg, int lbub,
enum tree_code tcode,
const char *temp_name1,
- const char *temp_name2,
- VEC (tree, heap) *conds,
+ const char *temp_name2,
+ VEC (gimple, heap) *conds,
unsigned *nconds)
{
tree lbub_real_cst, lbub_cst, float_type;
tree temp, tempn, tempc, tempcn;
- tree stmt1, stmt2, stmt3;
+ gimple stmt1, stmt2, stmt3;
float_type = TREE_TYPE (arg);
lbub_cst = build_int_cst (integer_type_node, lbub);
lbub_real_cst = build_real_from_int_cst (float_type, lbub_cst);
temp = create_tmp_var (float_type, temp_name1);
- stmt1 = build_gimple_modify_stmt (temp, arg);
+ stmt1 = gimple_build_assign (temp, arg);
tempn = make_ssa_name (temp, stmt1);
- GIMPLE_STMT_OPERAND (stmt1, 0) = tempn;
+ gimple_assign_set_lhs (stmt1, tempn);
tempc = create_tmp_var (boolean_type_node, temp_name2);
- stmt2 = build_gimple_modify_stmt (tempc,
- fold_build2 (tcode,
- boolean_type_node,
- tempn, lbub_real_cst));
+ stmt2 = gimple_build_assign (tempc,
+ fold_build2 (tcode,
+ boolean_type_node,
+ tempn, lbub_real_cst));
tempcn = make_ssa_name (tempc, stmt2);
- GIMPLE_STMT_OPERAND (stmt2, 0) = tempcn;
-
- /* fold_built3 not used for gimple statement here,
- as it will hit assertion. */
- stmt3 = build3 (COND_EXPR, void_type_node,
- tempcn, NULL_TREE, NULL_TREE);
- VEC_quick_push (tree, conds, stmt1);
- VEC_quick_push (tree, conds, stmt2);
- VEC_quick_push (tree, conds, stmt3);
+ gimple_assign_set_lhs (stmt2, tempcn);
+
+ stmt3 = gimple_build_cond_from_tree (tempcn, NULL_TREE, NULL_TREE);
+ VEC_quick_push (gimple, conds, stmt1);
+ VEC_quick_push (gimple, conds, stmt2);
+ VEC_quick_push (gimple, conds, stmt3);
(*nconds)++;
}
@@ -377,7 +373,7 @@ gen_one_condition (tree arg, int lbub,
static void
gen_conditions_for_domain (tree arg, inp_domain domain,
- VEC (tree, heap) *conds,
+ VEC (gimple, heap) *conds,
unsigned *nconds)
{
if (domain.has_lb)
@@ -391,7 +387,7 @@ gen_conditions_for_domain (tree arg, inp_domain domain,
{
/* Now push a separator. */
if (domain.has_lb)
- VEC_quick_push (tree, conds, NULL);
+ VEC_quick_push (gimple, conds, NULL);
gen_one_condition (arg, domain.ub,
(domain.is_ub_inclusive
@@ -420,7 +416,7 @@ gen_conditions_for_domain (tree arg, inp_domain domain,
static void
gen_conditions_for_pow_cst_base (tree base, tree expn,
- VEC (tree, heap) *conds,
+ VEC (gimple, heap) *conds,
unsigned *nconds)
{
inp_domain exp_domain;
@@ -456,20 +452,21 @@ gen_conditions_for_pow_cst_base (tree base, tree expn,
static void
gen_conditions_for_pow_int_base (tree base, tree expn,
- VEC (tree, heap) *conds,
+ VEC (gimple, heap) *conds,
unsigned *nconds)
{
- tree base_def, base_nm, base_val, base_val0;
+ gimple base_def;
+ tree base_nm, base_val0;
tree base_var, int_type;
tree temp, tempn;
- tree cst0, stmt1, stmt2;
+ tree cst0;
+ gimple stmt1, stmt2;
int bit_sz, max_exp;
inp_domain exp_domain;
base_def = SSA_NAME_DEF_STMT (base);
- base_nm = GIMPLE_STMT_OPERAND (base_def, 0);
- base_val = GIMPLE_STMT_OPERAND (base_def, 1);
- base_val0 = TREE_OPERAND (base_val, 0);
+ base_nm = gimple_assign_lhs (base_def);
+ base_val0 = gimple_assign_rhs1 (base_def);
base_var = SSA_NAME_VAR (base_val0);
int_type = TREE_TYPE (base_var);
bit_sz = TYPE_PRECISION (int_type);
@@ -514,19 +511,17 @@ gen_conditions_for_pow_int_base (tree base, tree expn,
type is integer. */
/* Push a separator. */
- VEC_quick_push (tree, conds, NULL);
+ VEC_quick_push (gimple, conds, NULL);
temp = create_tmp_var (int_type, "DCE_COND1");
cst0 = build_int_cst (int_type, 0);
- stmt1 = build_gimple_modify_stmt (temp, base_val0);
+ stmt1 = gimple_build_assign (temp, base_val0);
tempn = make_ssa_name (temp, stmt1);
- GIMPLE_STMT_OPERAND (stmt1, 0) = tempn;
- stmt2 = build3 (COND_EXPR, void_type_node,
- fold_build2 (LE_EXPR, boolean_type_node, tempn, cst0),
- NULL_TREE, NULL_TREE);
+ gimple_assign_set_lhs (stmt1, tempn);
+ stmt2 = gimple_build_cond (LE_EXPR, tempn, cst0, NULL_TREE, NULL_TREE);
- VEC_quick_push (tree, conds, stmt1);
- VEC_quick_push (tree, conds, stmt2);
+ VEC_quick_push (gimple, conds, stmt1);
+ VEC_quick_push (gimple, conds, stmt2);
(*nconds)++;
}
@@ -548,7 +543,7 @@ gen_conditions_for_pow_int_base (tree base, tree expn,
and *NCONDS is the number of logical conditions. */
static void
-gen_conditions_for_pow (tree pow_call, VEC (tree, heap) *conds,
+gen_conditions_for_pow (gimple pow_call, VEC (gimple, heap) *conds,
unsigned *nconds)
{
tree base, expn;
@@ -560,18 +555,16 @@ gen_conditions_for_pow (tree pow_call, VEC (tree, heap) *conds,
*nconds = 0;
- base = CALL_EXPR_ARG (pow_call, 0);
- expn = CALL_EXPR_ARG (pow_call, 1);
+ base = gimple_call_arg (pow_call, 0);
+ expn = gimple_call_arg (pow_call, 1);
bc = TREE_CODE (base);
ec = TREE_CODE (expn);
if (bc == REAL_CST)
- gen_conditions_for_pow_cst_base (base, expn,
- conds, nconds);
+ gen_conditions_for_pow_cst_base (base, expn, conds, nconds);
else if (bc == SSA_NAME)
- gen_conditions_for_pow_int_base (base, expn,
- conds, nconds);
+ gen_conditions_for_pow_int_base (base, expn, conds, nconds);
else
gcc_unreachable ();
}
@@ -689,22 +682,19 @@ get_no_error_domain (enum built_in_function fnc)
condition are separated by NULL tree in the vector. */
static void
-gen_shrink_wrap_conditions (tree bi_call, VEC (tree, heap) *conds,
+gen_shrink_wrap_conditions (gimple bi_call, VEC (gimple, heap) *conds,
unsigned int *nconds)
{
- tree call, fn;
+ gimple call;
+ tree fn;
enum built_in_function fnc;
gcc_assert (nconds && conds);
- gcc_assert (VEC_length (tree, conds) == 0);
- gcc_assert (TREE_CODE (bi_call) == GIMPLE_MODIFY_STMT
- || TREE_CODE (bi_call) == CALL_EXPR);
+ gcc_assert (VEC_length (gimple, conds) == 0);
+ gcc_assert (is_gimple_call (bi_call));
call = bi_call;
- if (TREE_CODE (call) == GIMPLE_MODIFY_STMT)
- call = get_call_expr_in (bi_call);
-
- fn = get_callee_fndecl (call);
+ fn = gimple_call_fndecl (call);
gcc_assert (fn && DECL_BUILT_IN (fn));
fnc = DECL_FUNCTION_CODE (fn);
*nconds = 0;
@@ -716,7 +706,7 @@ gen_shrink_wrap_conditions (tree bi_call, VEC (tree, heap) *conds,
tree arg;
inp_domain domain = get_no_error_domain (fnc);
*nconds = 0;
- arg = CALL_EXPR_ARG (bi_call, 0);
+ arg = gimple_call_arg (bi_call, 0);
gen_conditions_for_domain (arg, domain, conds, nconds);
}
@@ -733,21 +723,21 @@ gen_shrink_wrap_conditions (tree bi_call, VEC (tree, heap) *conds,
transformation actually happens. */
static bool
-shrink_wrap_one_built_in_call (tree bi_call)
+shrink_wrap_one_built_in_call (gimple bi_call)
{
- block_stmt_iterator bi_call_bsi;
+ gimple_stmt_iterator bi_call_bsi;
basic_block bi_call_bb, join_tgt_bb, guard_bb, guard_bb0;
edge join_tgt_in_edge_from_call, join_tgt_in_edge_fall_thru;
edge bi_call_in_edge0, guard_bb_in_edge;
- VEC (tree, heap) *conds;
+ VEC (gimple, heap) *conds;
unsigned tn_cond_stmts, nconds;
unsigned ci;
- tree cond_expr = NULL;
- tree cond_expr_start;
+ gimple cond_expr = NULL;
+ gimple cond_expr_start;
tree bi_call_label_decl;
- tree bi_call_label;
+ gimple bi_call_label;
- conds = VEC_alloc (tree, heap, 12);
+ conds = VEC_alloc (gimple, heap, 12);
gen_shrink_wrap_conditions (bi_call, conds, &nconds);
/* This can happen if the condition generator decides
@@ -757,40 +747,40 @@ shrink_wrap_one_built_in_call (tree bi_call)
if (nconds == 0)
return false;
- bi_call_bb = bb_for_stmt (bi_call);
+ bi_call_bb = gimple_bb (bi_call);
/* Now find the join target bb -- split
bi_call_bb if needed. */
- bi_call_bsi = bsi_for_stmt (bi_call);
+ bi_call_bsi = gsi_for_stmt (bi_call);
join_tgt_in_edge_from_call = split_block (bi_call_bb, bi_call);
- bi_call_bsi = bsi_for_stmt (bi_call);
+ bi_call_bsi = gsi_for_stmt (bi_call);
join_tgt_bb = join_tgt_in_edge_from_call->dest;
/* Now it is time to insert the first conditional expression
into bi_call_bb and split this bb so that bi_call is
shrink-wrapped. */
- tn_cond_stmts = VEC_length (tree, conds);
+ tn_cond_stmts = VEC_length (gimple, conds);
cond_expr = NULL;
- cond_expr_start = VEC_index (tree, conds, 0);
+ cond_expr_start = VEC_index (gimple, conds, 0);
for (ci = 0; ci < tn_cond_stmts; ci++)
{
- tree c = VEC_index (tree, conds, ci);
+ gimple c = VEC_index (gimple, conds, ci);
gcc_assert (c || ci != 0);
if (!c)
break;
- bsi_insert_before (&bi_call_bsi, c, BSI_SAME_STMT);
+ gsi_insert_before (&bi_call_bsi, c, GSI_SAME_STMT);
cond_expr = c;
}
nconds--;
ci++;
- gcc_assert (cond_expr && TREE_CODE (cond_expr) == COND_EXPR);
+ gcc_assert (cond_expr && gimple_code (cond_expr) == GIMPLE_COND);
/* Now the label. */
bi_call_label_decl = create_artificial_label ();
- bi_call_label = build1 (LABEL_EXPR, void_type_node, bi_call_label_decl);
- bsi_insert_before (&bi_call_bsi, bi_call_label, BSI_SAME_STMT);
+ bi_call_label = gimple_build_label (bi_call_label_decl);
+ gsi_insert_before (&bi_call_bsi, bi_call_label, GSI_SAME_STMT);
bi_call_in_edge0 = split_block (bi_call_bb, cond_expr);
bi_call_in_edge0->flags &= ~EDGE_FALLTHRU;
@@ -810,21 +800,21 @@ shrink_wrap_one_built_in_call (tree bi_call)
{
unsigned ci0;
edge bi_call_in_edge;
- block_stmt_iterator guard_bsi = bsi_for_stmt (cond_expr_start);
+ gimple_stmt_iterator guard_bsi = gsi_for_stmt (cond_expr_start);
ci0 = ci;
- cond_expr_start = VEC_index (tree, conds, ci0);
+ cond_expr_start = VEC_index (gimple, conds, ci0);
for (; ci < tn_cond_stmts; ci++)
{
- tree c = VEC_index (tree, conds, ci);
+ gimple c = VEC_index (gimple, conds, ci);
gcc_assert (c || ci != ci0);
if (!c)
break;
- bsi_insert_before (&guard_bsi, c, BSI_SAME_STMT);
+ gsi_insert_before (&guard_bsi, c, GSI_SAME_STMT);
cond_expr = c;
}
nconds--;
ci++;
- gcc_assert (cond_expr && TREE_CODE (cond_expr) == COND_EXPR);
+ gcc_assert (cond_expr && gimple_code (cond_expr) == GIMPLE_COND);
guard_bb_in_edge = split_block (guard_bb, cond_expr);
guard_bb_in_edge->flags &= ~EDGE_FALLTHRU;
guard_bb_in_edge->flags |= EDGE_FALSE_VALUE;
@@ -836,11 +826,11 @@ shrink_wrap_one_built_in_call (tree bi_call)
REG_BR_PROB_BASE - bi_call_in_edge->probability;
}
- VEC_free (tree, heap, conds);
+ VEC_free (gimple, heap, conds);
if (dump_file && (dump_flags & TDF_DETAILS))
{
location_t loc;
- loc = EXPR_LOCATION (bi_call);
+ loc = gimple_location (bi_call);
fprintf (dump_file,
"%s:%d: note: function call is shrink-wrapped"
" into error conditions.\n",
@@ -859,13 +849,13 @@ shrink_wrap_conditional_dead_built_in_calls (void)
bool changed = false;
unsigned i = 0;
- unsigned n = VEC_length (tree, cond_dead_built_in_calls);
+ unsigned n = VEC_length (gimple, cond_dead_built_in_calls);
if (n == 0)
return false;
for (; i < n ; i++)
{
- tree bi_call = VEC_index (tree, cond_dead_built_in_calls, i);
+ gimple bi_call = VEC_index (gimple, cond_dead_built_in_calls, i);
changed |= shrink_wrap_one_built_in_call (bi_call);
}
@@ -878,34 +868,33 @@ static unsigned int
tree_call_cdce (void)
{
basic_block bb;
- block_stmt_iterator i;
+ gimple_stmt_iterator i;
bool something_changed = false;
- cond_dead_built_in_calls = VEC_alloc (tree, heap, 64);
+ cond_dead_built_in_calls = VEC_alloc (gimple, heap, 64);
FOR_EACH_BB (bb)
{
/* Collect dead call candidates. */
- for (i = bsi_start (bb); ! bsi_end_p (i); bsi_next (&i))
+ for (i = gsi_start_bb (bb); !gsi_end_p (i); gsi_next (&i))
{
- tree stmt = bsi_stmt (i);
- if (TREE_CODE (stmt) == CALL_EXPR
+ gimple stmt = gsi_stmt (i);
+ if (is_gimple_call (stmt)
&& is_call_dce_candidate (stmt))
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Found conditional dead call: ");
- print_generic_stmt (dump_file, stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
fprintf (dump_file, "\n");
}
- VEC_quick_push (tree, cond_dead_built_in_calls, stmt);
+ VEC_quick_push (gimple, cond_dead_built_in_calls, stmt);
}
}
}
- something_changed =
- shrink_wrap_conditional_dead_built_in_calls ();
+ something_changed = shrink_wrap_conditional_dead_built_in_calls ();
- VEC_free (tree, heap, cond_dead_built_in_calls);
+ VEC_free (gimple, heap, cond_dead_built_in_calls);
if (something_changed)
{
@@ -924,7 +913,7 @@ gate_call_cdce (void)
/* The limit constants used in the implementation
assume IEEE floating point format. Other formats
can be supported in the future if needed. */
- return flag_tree_builtin_call_dce != 0;
+ return flag_tree_builtin_call_dce != 0 && optimize_function_for_speed_p (cfun);
}
struct gimple_opt_pass pass_call_cdce =
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 5b747e84f66..39a04e94a5f 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -59,7 +59,7 @@ static const int initial_cfg_capacity = 20;
/* This hash table allows us to efficiently lookup all CASE_LABEL_EXPRs
which use a particular edge. The CASE_LABEL_EXPRs are chained together
via their TREE_CHAIN field, which we clear after we're done with the
- hash table to prevent problems with duplication of SWITCH_EXPRs.
+ hash table to prevent problems with duplication of GIMPLE_SWITCHes.
Access to this list of CASE_LABEL_EXPRs allows us to efficiently
update the case vector in response to edge redirections.
@@ -83,35 +83,32 @@ static struct cfg_stats_d cfg_stats;
static bool found_computed_goto;
/* Basic blocks and flowgraphs. */
-static basic_block create_bb (void *, void *, basic_block);
-static void make_blocks (tree);
+static void make_blocks (gimple_seq);
static void factor_computed_gotos (void);
/* Edges. */
static void make_edges (void);
static void make_cond_expr_edges (basic_block);
-static void make_switch_expr_edges (basic_block);
+static void make_gimple_switch_edges (basic_block);
static void make_goto_expr_edges (basic_block);
-static edge tree_redirect_edge_and_branch (edge, basic_block);
-static edge tree_try_redirect_by_replacing_jump (edge, basic_block);
+static edge gimple_redirect_edge_and_branch (edge, basic_block);
+static edge gimple_try_redirect_by_replacing_jump (edge, basic_block);
static unsigned int split_critical_edges (void);
/* Various helpers. */
-static inline bool stmt_starts_bb_p (const_tree, const_tree);
-static int tree_verify_flow_info (void);
-static void tree_make_forwarder_block (edge);
-static void tree_cfg2vcg (FILE *);
-static inline void change_bb_for_stmt (tree t, basic_block bb);
-static bool computed_goto_p (const_tree);
+static inline bool stmt_starts_bb_p (gimple, gimple);
+static int gimple_verify_flow_info (void);
+static void gimple_make_forwarder_block (edge);
+static void gimple_cfg2vcg (FILE *);
/* Flowgraph optimization and cleanup. */
-static void tree_merge_blocks (basic_block, basic_block);
-static bool tree_can_merge_blocks_p (basic_block, basic_block);
+static void gimple_merge_blocks (basic_block, basic_block);
+static bool gimple_can_merge_blocks_p (basic_block, basic_block);
static void remove_bb (basic_block);
static edge find_taken_edge_computed_goto (basic_block, tree);
static edge find_taken_edge_cond_expr (basic_block, tree);
static edge find_taken_edge_switch_expr (basic_block, tree);
-static tree find_case_label_for_value (tree, tree);
+static tree find_case_label_for_value (gimple, tree);
void
init_empty_tree_cfg_for_function (struct function *fn)
@@ -155,21 +152,21 @@ init_empty_tree_cfg (void)
Create basic blocks
---------------------------------------------------------------------------*/
-/* Entry point to the CFG builder for trees. TP points to the list of
+/* Entry point to the CFG builder for trees. SEQ is the sequence of
statements to be added to the flowgraph. */
static void
-build_tree_cfg (tree *tp)
+build_gimple_cfg (gimple_seq seq)
{
- /* Register specific tree functions. */
- tree_register_cfg_hooks ();
+ /* Register specific gimple functions. */
+ gimple_register_cfg_hooks ();
memset ((void *) &cfg_stats, 0, sizeof (cfg_stats));
init_empty_tree_cfg ();
found_computed_goto = 0;
- make_blocks (*tp);
+ make_blocks (seq);
/* Computed gotos are hell to deal with, especially if there are
lots of them with a large number of destinations. So we factor
@@ -207,7 +204,7 @@ build_tree_cfg (tree *tp)
FILE *vcg_file = dump_begin (TDI_vcg, &local_dump_flags);
if (vcg_file)
{
- tree_cfg2vcg (vcg_file);
+ gimple_cfg2vcg (vcg_file);
dump_end (TDI_vcg, vcg_file);
}
}
@@ -215,16 +212,12 @@ build_tree_cfg (tree *tp)
#ifdef ENABLE_CHECKING
verify_stmts ();
#endif
-
- /* Dump a textual representation of the flowgraph. */
- if (dump_file)
- dump_tree_cfg (dump_file, dump_flags);
}
static unsigned int
execute_build_cfg (void)
{
- build_tree_cfg (&DECL_SAVED_TREE (current_function_decl));
+ build_gimple_cfg (gimple_body (current_function_decl));
return 0;
}
@@ -239,14 +232,26 @@ struct gimple_opt_pass pass_build_cfg =
NULL, /* next */
0, /* static_pass_number */
TV_TREE_CFG, /* tv_id */
- PROP_gimple_leh, /* properties_required */
+ PROP_gimple_leh, /* properties_required */
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 */
}
};
+
+/* Return true if T is a computed goto. */
+
+static bool
+computed_goto_p (gimple t)
+{
+ return (gimple_code (t) == GIMPLE_GOTO
+ && TREE_CODE (gimple_goto_dest (t)) != LABEL_DECL);
+}
+
+
/* Search the CFG for any computed gotos. If found, factor them to a
common computed goto site. Also record the location of that site so
that we can un-factor the gotos after we have converted back to
@@ -258,8 +263,8 @@ factor_computed_gotos (void)
basic_block bb;
tree factored_label_decl = NULL;
tree var = NULL;
- tree factored_computed_goto_label = NULL;
- tree factored_computed_goto = NULL;
+ gimple factored_computed_goto_label = NULL;
+ gimple factored_computed_goto = NULL;
/* We know there are one or more computed gotos in this function.
Examine the last statement in each basic block to see if the block
@@ -267,12 +272,13 @@ factor_computed_gotos (void)
FOR_EACH_BB (bb)
{
- block_stmt_iterator bsi = bsi_last (bb);
- tree last;
+ gimple_stmt_iterator gsi = gsi_last_bb (bb);
+ gimple last;
- if (bsi_end_p (bsi))
+ if (gsi_end_p (gsi))
continue;
- last = bsi_stmt (bsi);
+
+ last = gsi_stmt (gsi);
/* Ignore the computed goto we create when we factor the original
computed gotos. */
@@ -282,15 +288,15 @@ factor_computed_gotos (void)
/* If the last statement is a computed goto, factor it. */
if (computed_goto_p (last))
{
- tree assignment;
+ gimple assignment;
/* The first time we find a computed goto we need to create
the factored goto block and the variable each original
computed goto will use for their goto destination. */
- if (! factored_computed_goto)
+ if (!factored_computed_goto)
{
basic_block new_bb = create_empty_bb (bb);
- block_stmt_iterator new_bsi = bsi_start (new_bb);
+ gimple_stmt_iterator new_gsi = gsi_start_bb (new_bb);
/* Create the destination of the factored goto. Each original
computed goto will put its desired destination into this
@@ -302,60 +308,58 @@ factor_computed_gotos (void)
factored computed goto. */
factored_label_decl = create_artificial_label ();
factored_computed_goto_label
- = build1 (LABEL_EXPR, void_type_node, factored_label_decl);
- bsi_insert_after (&new_bsi, factored_computed_goto_label,
- BSI_NEW_STMT);
+ = gimple_build_label (factored_label_decl);
+ gsi_insert_after (&new_gsi, factored_computed_goto_label,
+ GSI_NEW_STMT);
/* Build our new computed goto. */
- factored_computed_goto = build1 (GOTO_EXPR, void_type_node, var);
- bsi_insert_after (&new_bsi, factored_computed_goto,
- BSI_NEW_STMT);
+ factored_computed_goto = gimple_build_goto (var);
+ gsi_insert_after (&new_gsi, factored_computed_goto, GSI_NEW_STMT);
}
/* Copy the original computed goto's destination into VAR. */
- assignment = build_gimple_modify_stmt (var,
- GOTO_DESTINATION (last));
- bsi_insert_before (&bsi, assignment, BSI_SAME_STMT);
+ assignment = gimple_build_assign (var, gimple_goto_dest (last));
+ gsi_insert_before (&gsi, assignment, GSI_SAME_STMT);
/* And re-vector the computed goto to the new destination. */
- GOTO_DESTINATION (last) = factored_label_decl;
+ gimple_goto_set_dest (last, factored_label_decl);
}
}
}
-/* Build a flowgraph for the statement_list STMT_LIST. */
+/* Build a flowgraph for the sequence of stmts SEQ. */
static void
-make_blocks (tree stmt_list)
+make_blocks (gimple_seq seq)
{
- tree_stmt_iterator i = tsi_start (stmt_list);
- tree stmt = NULL;
+ gimple_stmt_iterator i = gsi_start (seq);
+ gimple stmt = NULL;
bool start_new_block = true;
- bool first_stmt_of_list = true;
+ bool first_stmt_of_seq = true;
basic_block bb = ENTRY_BLOCK_PTR;
- while (!tsi_end_p (i))
+ while (!gsi_end_p (i))
{
- tree prev_stmt;
+ gimple prev_stmt;
prev_stmt = stmt;
- stmt = tsi_stmt (i);
+ stmt = gsi_stmt (i);
/* If the statement starts a new basic block or if we have determined
in a previous pass that we need to create a new block for STMT, do
so now. */
if (start_new_block || stmt_starts_bb_p (stmt, prev_stmt))
{
- if (!first_stmt_of_list)
- stmt_list = tsi_split_statement_list_before (&i);
- bb = create_basic_block (stmt_list, NULL, bb);
+ if (!first_stmt_of_seq)
+ seq = gsi_split_seq_before (&i);
+ bb = create_basic_block (seq, NULL, bb);
start_new_block = false;
}
/* Now add STMT to BB and create the subgraphs for special statement
codes. */
- set_bb_for_stmt (stmt, bb);
+ gimple_set_bb (stmt, bb);
if (computed_goto_p (stmt))
found_computed_goto = true;
@@ -365,8 +369,8 @@ make_blocks (tree stmt_list)
if (stmt_ends_bb_p (stmt))
start_new_block = true;
- tsi_next (&i);
- first_stmt_of_list = false;
+ gsi_next (&i);
+ first_stmt_of_seq = false;
}
}
@@ -387,8 +391,8 @@ create_bb (void *h, void *e, basic_block after)
bb->index = last_basic_block;
bb->flags = BB_NEW;
- bb->il.tree = GGC_CNEW (struct tree_bb_info);
- set_bb_stmt_list (bb, h ? (tree) h : alloc_stmt_list ());
+ bb->il.gimple = GGC_CNEW (struct gimple_bb_info);
+ set_bb_seq (bb, h ? (gimple_seq) h : gimple_seq_alloc ());
/* Add the new block to the linked list of blocks. */
link_block (bb, after);
@@ -423,25 +427,31 @@ fold_cond_expr_cond (void)
FOR_EACH_BB (bb)
{
- tree stmt = last_stmt (bb);
+ gimple stmt = last_stmt (bb);
- if (stmt
- && TREE_CODE (stmt) == COND_EXPR)
+ if (stmt && gimple_code (stmt) == GIMPLE_COND)
{
tree cond;
bool zerop, onep;
fold_defer_overflow_warnings ();
- cond = fold (COND_EXPR_COND (stmt));
- zerop = integer_zerop (cond);
- onep = integer_onep (cond);
+ cond = fold_binary (gimple_cond_code (stmt), boolean_type_node,
+ gimple_cond_lhs (stmt), gimple_cond_rhs (stmt));
+ if (cond)
+ {
+ zerop = integer_zerop (cond);
+ onep = integer_onep (cond);
+ }
+ else
+ zerop = onep = false;
+
fold_undefer_overflow_warnings (zerop || onep,
stmt,
WARN_STRICT_OVERFLOW_CONDITIONAL);
if (zerop)
- COND_EXPR_COND (stmt) = boolean_false_node;
+ gimple_cond_make_false (stmt);
else if (onep)
- COND_EXPR_COND (stmt) = boolean_true_node;
+ gimple_cond_make_true (stmt);
}
}
}
@@ -461,40 +471,40 @@ make_edges (void)
/* Traverse the basic block array placing edges. */
FOR_EACH_BB (bb)
{
- tree last = last_stmt (bb);
+ gimple last = last_stmt (bb);
bool fallthru;
if (last)
{
- enum tree_code code = TREE_CODE (last);
+ enum gimple_code code = gimple_code (last);
switch (code)
{
- case GOTO_EXPR:
+ case GIMPLE_GOTO:
make_goto_expr_edges (bb);
fallthru = false;
break;
- case RETURN_EXPR:
+ case GIMPLE_RETURN:
make_edge (bb, EXIT_BLOCK_PTR, 0);
fallthru = false;
break;
- case COND_EXPR:
+ case GIMPLE_COND:
make_cond_expr_edges (bb);
fallthru = false;
break;
- case SWITCH_EXPR:
- make_switch_expr_edges (bb);
+ case GIMPLE_SWITCH:
+ make_gimple_switch_edges (bb);
fallthru = false;
break;
- case RESX_EXPR:
+ case GIMPLE_RESX:
make_eh_edges (last);
fallthru = false;
break;
- case CALL_EXPR:
+ case GIMPLE_CALL:
/* If this function receives a nonlocal goto, then we need to
make edges from this call site to all the nonlocal goto
handlers. */
- if (tree_can_make_abnormal_goto (last))
+ if (stmt_can_make_abnormal_goto (last))
make_abnormal_goto_edges (bb, true);
/* If this statement has reachable exception handlers, then
@@ -502,83 +512,78 @@ make_edges (void)
make_eh_edges (last);
/* Some calls are known not to return. */
- fallthru = !(call_expr_flags (last) & ECF_NORETURN);
+ fallthru = !(gimple_call_flags (last) & ECF_NORETURN);
break;
- case MODIFY_EXPR:
- gcc_unreachable ();
-
- case GIMPLE_MODIFY_STMT:
+ case GIMPLE_ASSIGN:
+ /* A GIMPLE_ASSIGN may throw internally and thus be considered
+ control-altering. */
if (is_ctrl_altering_stmt (last))
{
- /* A GIMPLE_MODIFY_STMT may have a CALL_EXPR on its RHS and
- the CALL_EXPR may have an abnormal edge. Search the RHS
- for this case and create any required edges. */
- if (tree_can_make_abnormal_goto (last))
- make_abnormal_goto_edges (bb, true);
-
make_eh_edges (last);
}
fallthru = true;
break;
- case OMP_PARALLEL:
- case OMP_TASK:
- case OMP_FOR:
- case OMP_SINGLE:
- case OMP_MASTER:
- case OMP_ORDERED:
- case OMP_CRITICAL:
- case OMP_SECTION:
+ case GIMPLE_OMP_PARALLEL:
+ case GIMPLE_OMP_TASK:
+ case GIMPLE_OMP_FOR:
+ case GIMPLE_OMP_SINGLE:
+ case GIMPLE_OMP_MASTER:
+ case GIMPLE_OMP_ORDERED:
+ case GIMPLE_OMP_CRITICAL:
+ case GIMPLE_OMP_SECTION:
cur_region = new_omp_region (bb, code, cur_region);
fallthru = true;
break;
- case OMP_SECTIONS:
+ case GIMPLE_OMP_SECTIONS:
cur_region = new_omp_region (bb, code, cur_region);
fallthru = true;
break;
- case OMP_SECTIONS_SWITCH:
+ case GIMPLE_OMP_SECTIONS_SWITCH:
fallthru = false;
break;
- case OMP_ATOMIC_LOAD:
- case OMP_ATOMIC_STORE:
+ case GIMPLE_OMP_ATOMIC_LOAD:
+ case GIMPLE_OMP_ATOMIC_STORE:
fallthru = true;
break;
- case OMP_RETURN:
- /* In the case of an OMP_SECTION, the edge will go somewhere
- other than the next block. This will be created later. */
+ case GIMPLE_OMP_RETURN:
+ /* In the case of a GIMPLE_OMP_SECTION, the edge will go
+ somewhere other than the next block. This will be
+ created later. */
cur_region->exit = bb;
- fallthru = cur_region->type != OMP_SECTION;
+ fallthru = cur_region->type != GIMPLE_OMP_SECTION;
cur_region = cur_region->outer;
break;
- case OMP_CONTINUE:
+ case GIMPLE_OMP_CONTINUE:
cur_region->cont = bb;
switch (cur_region->type)
{
- case OMP_FOR:
- /* Mark all OMP_FOR and OMP_CONTINUE succs edges as abnormal
- to prevent splitting them. */
+ case GIMPLE_OMP_FOR:
+ /* Mark all GIMPLE_OMP_FOR and GIMPLE_OMP_CONTINUE
+ succs edges as abnormal to prevent splitting
+ them. */
single_succ_edge (cur_region->entry)->flags |= EDGE_ABNORMAL;
/* Make the loopback edge. */
make_edge (bb, single_succ (cur_region->entry),
EDGE_ABNORMAL);
- /* Create an edge from OMP_FOR to exit, which corresponds to
- the case that the body of the loop is not executed at
- all. */
+ /* Create an edge from GIMPLE_OMP_FOR to exit, which
+ corresponds to the case that the body of the loop
+ is not executed at all. */
make_edge (cur_region->entry, bb->next_bb, EDGE_ABNORMAL);
make_edge (bb, bb->next_bb, EDGE_FALLTHRU | EDGE_ABNORMAL);
fallthru = false;
break;
- case OMP_SECTIONS:
+ case GIMPLE_OMP_SECTIONS:
/* Wire up the edges into and out of the nested sections. */
{
basic_block switch_bb = single_succ (cur_region->entry);
@@ -586,13 +591,13 @@ make_edges (void)
struct omp_region *i;
for (i = cur_region->inner; i ; i = i->next)
{
- gcc_assert (i->type == OMP_SECTION);
+ gcc_assert (i->type == GIMPLE_OMP_SECTION);
make_edge (switch_bb, i->entry, 0);
make_edge (i->exit, bb, EDGE_FALLTHRU);
}
/* Make the loopback edge to the block with
- OMP_SECTIONS_SWITCH. */
+ GIMPLE_OMP_SECTIONS_SWITCH. */
make_edge (bb, switch_bb, 0);
/* Make the edge from the switch to exit. */
@@ -626,35 +631,37 @@ make_edges (void)
}
-/* Create the edges for a COND_EXPR starting at block BB.
- At this point, both clauses must contain only simple gotos. */
+/* Create the edges for a GIMPLE_COND starting at block BB. */
static void
make_cond_expr_edges (basic_block bb)
{
- tree entry = last_stmt (bb);
+ gimple entry = last_stmt (bb);
+ gimple then_stmt, else_stmt;
basic_block then_bb, else_bb;
tree then_label, else_label;
edge e;
gcc_assert (entry);
- gcc_assert (TREE_CODE (entry) == COND_EXPR);
+ gcc_assert (gimple_code (entry) == GIMPLE_COND);
/* Entry basic blocks for each component. */
- then_label = GOTO_DESTINATION (COND_EXPR_THEN (entry));
- else_label = GOTO_DESTINATION (COND_EXPR_ELSE (entry));
+ then_label = gimple_cond_true_label (entry);
+ else_label = gimple_cond_false_label (entry);
then_bb = label_to_block (then_label);
else_bb = label_to_block (else_label);
+ then_stmt = first_stmt (then_bb);
+ else_stmt = first_stmt (else_bb);
e = make_edge (bb, then_bb, EDGE_TRUE_VALUE);
- e->goto_locus = EXPR_LOCATION (COND_EXPR_THEN (entry));
+ e->goto_locus = gimple_location (then_stmt);
e = make_edge (bb, else_bb, EDGE_FALSE_VALUE);
if (e)
- e->goto_locus = EXPR_LOCATION (COND_EXPR_ELSE (entry));
+ e->goto_locus = gimple_location (else_stmt);
- /* We do not need the gotos anymore. */
- COND_EXPR_THEN (entry) = NULL_TREE;
- COND_EXPR_ELSE (entry) = NULL_TREE;
+ /* We do not need the labels anymore. */
+ gimple_cond_set_true_label (entry, NULL_TREE);
+ gimple_cond_set_false_label (entry, NULL_TREE);
}
@@ -714,11 +721,10 @@ end_recording_case_labels (void)
Otherwise return NULL. */
static tree
-get_cases_for_edge (edge e, tree t)
+get_cases_for_edge (edge e, gimple t)
{
void **slot;
size_t i, n;
- tree vec;
/* If we are not recording cases, then we do not have CASE_LABEL_EXPR
chains available. Return NULL so the caller can detect this case. */
@@ -733,11 +739,10 @@ get_cases_for_edge (edge e, tree t)
time we have been queried for information about E & T. Add all the
elements from T to the hash table then perform the query again. */
- vec = SWITCH_LABELS (t);
- n = TREE_VEC_LENGTH (vec);
+ n = gimple_switch_num_labels (t);
for (i = 0; i < n; i++)
{
- tree elt = TREE_VEC_ELT (vec, i);
+ tree elt = gimple_switch_label (t, i);
tree lab = CASE_LABEL (elt);
basic_block label_bb = label_to_block (lab);
edge this_edge = find_edge (e->src, label_bb);
@@ -752,23 +757,19 @@ get_cases_for_edge (edge e, tree t)
return (tree) *pointer_map_contains (edge_to_cases, e);
}
-/* Create the edges for a SWITCH_EXPR starting at block BB.
- At this point, the switch body has been lowered and the
- SWITCH_LABELS filled in, so this is in effect a multi-way branch. */
+/* Create the edges for a GIMPLE_SWITCH starting at block BB. */
static void
-make_switch_expr_edges (basic_block bb)
+make_gimple_switch_edges (basic_block bb)
{
- tree entry = last_stmt (bb);
+ gimple entry = last_stmt (bb);
size_t i, n;
- tree vec;
- vec = SWITCH_LABELS (entry);
- n = TREE_VEC_LENGTH (vec);
+ n = gimple_switch_num_labels (entry);
for (i = 0; i < n; ++i)
{
- tree lab = CASE_LABEL (TREE_VEC_ELT (vec, i));
+ tree lab = CASE_LABEL (gimple_switch_label (entry, i));
basic_block label_bb = label_to_block (lab);
make_edge (bb, label_bb, 0);
}
@@ -787,12 +788,11 @@ label_to_block_fn (struct function *ifun, tree dest)
and undefined variable warnings quite right. */
if ((errorcount || sorrycount) && uid < 0)
{
- block_stmt_iterator bsi =
- bsi_start (BASIC_BLOCK (NUM_FIXED_BLOCKS));
- tree stmt;
+ gimple_stmt_iterator gsi = gsi_start_bb (BASIC_BLOCK (NUM_FIXED_BLOCKS));
+ gimple stmt;
- stmt = build1 (LABEL_EXPR, void_type_node, dest);
- bsi_insert_before (&bsi, stmt, BSI_NEW_STMT);
+ stmt = gimple_build_label (dest);
+ gsi_insert_before (&gsi, stmt, GSI_NEW_STMT);
uid = LABEL_DECL_UID (dest);
}
if (VEC_length (basic_block, ifun->cfg->x_label_to_block_map)
@@ -808,17 +808,18 @@ void
make_abnormal_goto_edges (basic_block bb, bool for_call)
{
basic_block target_bb;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
FOR_EACH_BB (target_bb)
- for (bsi = bsi_start (target_bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (gsi = gsi_start_bb (target_bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree target = bsi_stmt (bsi);
+ gimple label_stmt = gsi_stmt (gsi);
+ tree target;
- if (TREE_CODE (target) != LABEL_EXPR)
+ if (gimple_code (label_stmt) != GIMPLE_LABEL)
break;
- target = LABEL_EXPR_LABEL (target);
+ target = gimple_label_label (label_stmt);
/* Make an edge to every label block that has been marked as a
potential target for a computed goto or a non-local goto. */
@@ -836,16 +837,16 @@ make_abnormal_goto_edges (basic_block bb, bool for_call)
static void
make_goto_expr_edges (basic_block bb)
{
- block_stmt_iterator last = bsi_last (bb);
- tree goto_t = bsi_stmt (last);
+ gimple_stmt_iterator last = gsi_last_bb (bb);
+ gimple goto_t = gsi_stmt (last);
/* A simple GOTO creates normal edges. */
if (simple_goto_p (goto_t))
{
- tree dest = GOTO_DESTINATION (goto_t);
+ tree dest = gimple_goto_dest (goto_t);
edge e = make_edge (bb, label_to_block (dest), EDGE_FALLTHRU);
- e->goto_locus = EXPR_LOCATION (goto_t);
- bsi_remove (&last, true);
+ e->goto_locus = gimple_location (goto_t);
+ gsi_remove (&last, true);
return;
}
@@ -898,7 +899,9 @@ update_eh_label (struct eh_region *region)
}
}
+
/* Given LABEL return the first label in the same basic block. */
+
static tree
main_block_label (tree label)
{
@@ -931,16 +934,17 @@ cleanup_dead_labels (void)
label if there is one, or otherwise just the first label we see. */
FOR_EACH_BB (bb)
{
- block_stmt_iterator i;
+ gimple_stmt_iterator i;
- for (i = bsi_start (bb); !bsi_end_p (i); bsi_next (&i))
+ for (i = gsi_start_bb (bb); !gsi_end_p (i); gsi_next (&i))
{
- tree label, stmt = bsi_stmt (i);
+ tree label;
+ gimple stmt = gsi_stmt (i);
- if (TREE_CODE (stmt) != LABEL_EXPR)
+ if (gimple_code (stmt) != GIMPLE_LABEL)
break;
- label = LABEL_EXPR_LABEL (stmt);
+ label = gimple_label_label (stmt);
/* If we have not yet seen a label for the current block,
remember this one and see if there are more labels. */
@@ -966,52 +970,45 @@ cleanup_dead_labels (void)
First do so for each block ending in a control statement. */
FOR_EACH_BB (bb)
{
- tree stmt = last_stmt (bb);
+ gimple stmt = last_stmt (bb);
if (!stmt)
continue;
- switch (TREE_CODE (stmt))
+ switch (gimple_code (stmt))
{
- case COND_EXPR:
+ case GIMPLE_COND:
{
- tree true_branch, false_branch;
-
- true_branch = COND_EXPR_THEN (stmt);
- false_branch = COND_EXPR_ELSE (stmt);
-
- if (true_branch)
- GOTO_DESTINATION (true_branch)
- = main_block_label (GOTO_DESTINATION (true_branch));
- if (false_branch)
- GOTO_DESTINATION (false_branch)
- = main_block_label (GOTO_DESTINATION (false_branch));
+ tree true_label = gimple_cond_true_label (stmt);
+ tree false_label = gimple_cond_false_label (stmt);
+ if (true_label)
+ gimple_cond_set_true_label (stmt, main_block_label (true_label));
+ if (false_label)
+ gimple_cond_set_false_label (stmt, main_block_label (false_label));
break;
}
- case SWITCH_EXPR:
+ case GIMPLE_SWITCH:
{
- size_t i;
- tree vec = SWITCH_LABELS (stmt);
- size_t n = TREE_VEC_LENGTH (vec);
+ size_t i, n = gimple_switch_num_labels (stmt);
/* Replace all destination labels. */
for (i = 0; i < n; ++i)
{
- tree elt = TREE_VEC_ELT (vec, i);
- tree label = main_block_label (CASE_LABEL (elt));
- CASE_LABEL (elt) = label;
+ tree case_label = gimple_switch_label (stmt, i);
+ tree label = main_block_label (CASE_LABEL (case_label));
+ CASE_LABEL (case_label) = label;
}
break;
}
- /* We have to handle GOTO_EXPRs until they're removed, and we don't
+ /* We have to handle gotos until they're removed, and we don't
remove them until after we've created the CFG edges. */
- case GOTO_EXPR:
- if (! computed_goto_p (stmt))
+ case GIMPLE_GOTO:
+ if (!computed_goto_p (stmt))
{
- GOTO_DESTINATION (stmt)
- = main_block_label (GOTO_DESTINATION (stmt));
+ tree new_dest = main_block_label (gimple_goto_dest (stmt));
+ gimple_goto_set_dest (stmt, new_dest);
break;
}
@@ -1027,7 +1024,7 @@ cleanup_dead_labels (void)
address taken are preserved. */
FOR_EACH_BB (bb)
{
- block_stmt_iterator i;
+ gimple_stmt_iterator i;
tree label_for_this_bb = label_for_bb[bb->index].label;
if (!label_for_this_bb)
@@ -1037,22 +1034,23 @@ cleanup_dead_labels (void)
if (!label_for_bb[bb->index].used)
label_for_this_bb = NULL;
- for (i = bsi_start (bb); !bsi_end_p (i); )
+ for (i = gsi_start_bb (bb); !gsi_end_p (i); )
{
- tree label, stmt = bsi_stmt (i);
+ tree label;
+ gimple stmt = gsi_stmt (i);
- if (TREE_CODE (stmt) != LABEL_EXPR)
+ if (gimple_code (stmt) != GIMPLE_LABEL)
break;
- label = LABEL_EXPR_LABEL (stmt);
+ label = gimple_label_label (stmt);
if (label == label_for_this_bb
- || ! DECL_ARTIFICIAL (label)
+ || !DECL_ARTIFICIAL (label)
|| DECL_NONLOCAL (label)
|| FORCED_LABEL (label))
- bsi_next (&i);
+ gsi_next (&i);
else
- bsi_remove (&i, true);
+ gsi_remove (&i, true);
}
}
@@ -1071,32 +1069,37 @@ group_case_labels (void)
FOR_EACH_BB (bb)
{
- tree stmt = last_stmt (bb);
- if (stmt && TREE_CODE (stmt) == SWITCH_EXPR)
+ gimple stmt = last_stmt (bb);
+ if (stmt && gimple_code (stmt) == GIMPLE_SWITCH)
{
- tree labels = SWITCH_LABELS (stmt);
- int old_size = TREE_VEC_LENGTH (labels);
+ int old_size = gimple_switch_num_labels (stmt);
int i, j, new_size = old_size;
tree default_case = NULL_TREE;
tree default_label = NULL_TREE;
+ bool has_default;
- /* The default label is always the last case in a switch
+ /* The default label is always the first case in a switch
statement after gimplification if it was not optimized
- away. */
- if (!CASE_LOW (TREE_VEC_ELT (labels, old_size - 1))
- && !CASE_HIGH (TREE_VEC_ELT (labels, old_size - 1)))
+ away */
+ if (!CASE_LOW (gimple_switch_default_label (stmt))
+ && !CASE_HIGH (gimple_switch_default_label (stmt)))
{
- default_case = TREE_VEC_ELT (labels, old_size - 1);
+ default_case = gimple_switch_default_label (stmt);
default_label = CASE_LABEL (default_case);
- old_size--;
+ has_default = true;
}
+ else
+ has_default = false;
/* Look for possible opportunities to merge cases. */
- i = 0;
+ if (has_default)
+ i = 1;
+ else
+ i = 0;
while (i < old_size)
{
tree base_case, base_label, base_high;
- base_case = TREE_VEC_ELT (labels, i);
+ base_case = gimple_switch_label (stmt, i);
gcc_assert (base_case);
base_label = CASE_LABEL (base_case);
@@ -1105,21 +1108,23 @@ group_case_labels (void)
default case. */
if (base_label == default_label)
{
- TREE_VEC_ELT (labels, i) = NULL_TREE;
+ gimple_switch_set_label (stmt, i, NULL_TREE);
i++;
new_size--;
continue;
}
- base_high = CASE_HIGH (base_case) ?
- CASE_HIGH (base_case) : CASE_LOW (base_case);
+ base_high = CASE_HIGH (base_case)
+ ? CASE_HIGH (base_case)
+ : CASE_LOW (base_case);
i++;
+
/* Try to merge case labels. Break out when we reach the end
of the label vector or when we cannot merge the next case
label with the current one. */
while (i < old_size)
{
- tree merge_case = TREE_VEC_ELT (labels, i);
+ tree merge_case = gimple_switch_label (stmt, i);
tree merge_label = CASE_LABEL (merge_case);
tree t = int_const_binop (PLUS_EXPR, base_high,
integer_one_node, 1);
@@ -1132,7 +1137,7 @@ group_case_labels (void)
base_high = CASE_HIGH (merge_case) ?
CASE_HIGH (merge_case) : CASE_LOW (merge_case);
CASE_HIGH (base_case) = base_high;
- TREE_VEC_ELT (labels, i) = NULL_TREE;
+ gimple_switch_set_label (stmt, i, NULL_TREE);
new_size--;
i++;
}
@@ -1145,11 +1150,14 @@ group_case_labels (void)
length of the vector. */
for (i = 0, j = 0; i < new_size; i++)
{
- while (! TREE_VEC_ELT (labels, j))
+ while (! gimple_switch_label (stmt, j))
j++;
- TREE_VEC_ELT (labels, i) = TREE_VEC_ELT (labels, j++);
+ gimple_switch_set_label (stmt, i,
+ gimple_switch_label (stmt, j++));
}
- TREE_VEC_LENGTH (labels) = new_size;
+
+ gcc_assert (new_size <= old_size);
+ gimple_switch_set_num_labels (stmt, new_size);
}
}
}
@@ -1157,11 +1165,11 @@ group_case_labels (void)
/* Checks whether we can merge block B into block A. */
static bool
-tree_can_merge_blocks_p (basic_block a, basic_block b)
+gimple_can_merge_blocks_p (basic_block a, basic_block b)
{
- const_tree stmt;
- block_stmt_iterator bsi;
- tree phi;
+ gimple stmt;
+ gimple_stmt_iterator gsi;
+ gimple_seq phis;
if (!single_succ_p (a))
return false;
@@ -1180,40 +1188,46 @@ tree_can_merge_blocks_p (basic_block a, basic_block b)
/* If A ends by a statement causing exceptions or something similar, we
cannot merge the blocks. */
- /* This CONST_CAST is okay because last_stmt doesn't modify its
- argument and the return value is assign to a const_tree. */
- stmt = last_stmt (CONST_CAST_BB (a));
+ stmt = last_stmt (a);
if (stmt && stmt_ends_bb_p (stmt))
return false;
/* Do not allow a block with only a non-local label to be merged. */
- if (stmt && TREE_CODE (stmt) == LABEL_EXPR
- && DECL_NONLOCAL (LABEL_EXPR_LABEL (stmt)))
+ if (stmt
+ && gimple_code (stmt) == GIMPLE_LABEL
+ && DECL_NONLOCAL (gimple_label_label (stmt)))
return false;
/* It must be possible to eliminate all phi nodes in B. If ssa form
is not up-to-date, we cannot eliminate any phis; however, if only
some symbols as whole are marked for renaming, this is not a problem,
as phi nodes for those symbols are irrelevant in updating anyway. */
- phi = phi_nodes (b);
- if (phi)
+ phis = phi_nodes (b);
+ if (!gimple_seq_empty_p (phis))
{
+ gimple_stmt_iterator i;
+
if (name_mappings_registered_p ())
return false;
- for (; phi; phi = PHI_CHAIN (phi))
- if (!is_gimple_reg (PHI_RESULT (phi))
- && !may_propagate_copy (PHI_RESULT (phi), PHI_ARG_DEF (phi, 0)))
- return false;
+ for (i = gsi_start (phis); !gsi_end_p (i); gsi_next (&i))
+ {
+ gimple phi = gsi_stmt (i);
+
+ if (!is_gimple_reg (gimple_phi_result (phi))
+ && !may_propagate_copy (gimple_phi_result (phi),
+ gimple_phi_arg_def (phi, 0)))
+ return false;
+ }
}
/* Do not remove user labels. */
- for (bsi = bsi_start (b); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (gsi = gsi_start_bb (b); !gsi_end_p (gsi); gsi_next (&gsi))
{
- stmt = bsi_stmt (bsi);
- if (TREE_CODE (stmt) != LABEL_EXPR)
+ stmt = gsi_stmt (gsi);
+ if (gimple_code (stmt) != GIMPLE_LABEL)
break;
- if (!DECL_ARTIFICIAL (LABEL_EXPR_LABEL (stmt)))
+ if (!DECL_ARTIFICIAL (gimple_label_label (stmt)))
return false;
}
@@ -1232,21 +1246,21 @@ replace_uses_by (tree name, tree val)
{
imm_use_iterator imm_iter;
use_operand_p use;
- tree stmt;
+ gimple stmt;
edge e;
FOR_EACH_IMM_USE_STMT (stmt, imm_iter, name)
{
- if (TREE_CODE (stmt) != PHI_NODE)
+ if (gimple_code (stmt) != GIMPLE_PHI)
push_stmt_changes (&stmt);
FOR_EACH_IMM_USE_ON_STMT (use, imm_iter)
{
replace_exp (use, val);
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
{
- e = PHI_ARG_EDGE (stmt, PHI_ARG_INDEX_FROM_USE (use));
+ e = gimple_phi_arg_edge (stmt, PHI_ARG_INDEX_FROM_USE (use));
if (e->flags & EDGE_ABNORMAL)
{
/* This can only occur for virtual operands, since
@@ -1258,18 +1272,24 @@ replace_uses_by (tree name, tree val)
}
}
- if (TREE_CODE (stmt) != PHI_NODE)
+ if (gimple_code (stmt) != GIMPLE_PHI)
{
- tree rhs;
+ size_t i;
fold_stmt_inplace (stmt);
if (cfgcleanup_altered_bbs)
- bitmap_set_bit (cfgcleanup_altered_bbs, bb_for_stmt (stmt)->index);
+ bitmap_set_bit (cfgcleanup_altered_bbs, gimple_bb (stmt)->index);
/* FIXME. This should go in pop_stmt_changes. */
- rhs = get_rhs (stmt);
- if (TREE_CODE (rhs) == ADDR_EXPR)
- recompute_tree_invariant_for_addr_expr (rhs);
+ for (i = 0; i < gimple_num_ops (stmt); i++)
+ {
+ tree op = gimple_op (stmt, i);
+ /* Operands may be empty here. For example, the labels
+ of a GIMPLE_COND are nulled out following the creation
+ of the corresponding CFG edges. */
+ if (op && TREE_CODE (op) == ADDR_EXPR)
+ recompute_tree_invariant_for_addr_expr (op);
+ }
maybe_clean_or_replace_eh_stmt (stmt, stmt);
@@ -1295,23 +1315,24 @@ replace_uses_by (tree name, tree val)
/* Merge block B into block A. */
static void
-tree_merge_blocks (basic_block a, basic_block b)
+gimple_merge_blocks (basic_block a, basic_block b)
{
- block_stmt_iterator bsi;
- tree_stmt_iterator last;
- tree phi;
+ gimple_stmt_iterator last, gsi, psi;
+ gimple_seq phis = phi_nodes (b);
if (dump_file)
fprintf (dump_file, "Merging blocks %d and %d\n", a->index, b->index);
/* Remove all single-valued PHI nodes from block B of the form
V_i = PHI <V_j> by propagating V_j to all the uses of V_i. */
- bsi = bsi_last (a);
- for (phi = phi_nodes (b); phi; phi = phi_nodes (b))
+ gsi = gsi_last_bb (a);
+ for (psi = gsi_start (phis); !gsi_end_p (psi); )
{
- tree def = PHI_RESULT (phi), use = PHI_ARG_DEF (phi, 0);
- tree copy;
- bool may_replace_uses = may_propagate_copy (def, use);
+ gimple phi = gsi_stmt (psi);
+ tree def = gimple_phi_result (phi), use = gimple_phi_arg_def (phi, 0);
+ gimple copy;
+ bool may_replace_uses = !is_gimple_reg (def)
+ || may_propagate_copy (def, use);
/* In case we maintain loop closed ssa form, do not propagate arguments
of loop exit phi nodes. */
@@ -1330,10 +1351,9 @@ tree_merge_blocks (basic_block a, basic_block b)
with ordering of phi nodes. This is because A is the single
predecessor of B, therefore results of the phi nodes cannot
appear as arguments of the phi nodes. */
- copy = build_gimple_modify_stmt (def, use);
- bsi_insert_after (&bsi, copy, BSI_NEW_STMT);
- SSA_NAME_DEF_STMT (def) = copy;
- remove_phi_node (phi, NULL, false);
+ copy = gimple_build_assign (def, use);
+ gsi_insert_after (&gsi, copy, GSI_NEW_STMT);
+ remove_phi_node (&psi, false);
}
else
{
@@ -1344,7 +1364,7 @@ tree_merge_blocks (basic_block a, basic_block b)
{
imm_use_iterator iter;
use_operand_p use_p;
- tree stmt;
+ gimple stmt;
FOR_EACH_IMM_USE_STMT (stmt, iter, def)
FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
@@ -1352,7 +1372,8 @@ tree_merge_blocks (basic_block a, basic_block b)
}
else
replace_uses_by (def, use);
- remove_phi_node (phi, NULL, true);
+
+ remove_phi_node (&psi, true);
}
}
@@ -1362,37 +1383,38 @@ tree_merge_blocks (basic_block a, basic_block b)
gcc_assert (single_succ_edge (a)->flags & EDGE_FALLTHRU);
gcc_assert (!last_stmt (a) || !stmt_ends_bb_p (last_stmt (a)));
- /* Remove labels from B and set bb_for_stmt to A for other statements. */
- for (bsi = bsi_start (b); !bsi_end_p (bsi);)
+ /* Remove labels from B and set gimple_bb to A for other statements. */
+ for (gsi = gsi_start_bb (b); !gsi_end_p (gsi);)
{
- if (TREE_CODE (bsi_stmt (bsi)) == LABEL_EXPR)
+ if (gimple_code (gsi_stmt (gsi)) == GIMPLE_LABEL)
{
- tree label = bsi_stmt (bsi);
+ gimple label = gsi_stmt (gsi);
+
+ gsi_remove (&gsi, false);
- bsi_remove (&bsi, false);
/* Now that we can thread computed gotos, we might have
a situation where we have a forced label in block B
However, the label at the start of block B might still be
used in other ways (think about the runtime checking for
Fortran assigned gotos). So we can not just delete the
label. Instead we move the label to the start of block A. */
- if (FORCED_LABEL (LABEL_EXPR_LABEL (label)))
+ if (FORCED_LABEL (gimple_label_label (label)))
{
- block_stmt_iterator dest_bsi = bsi_start (a);
- bsi_insert_before (&dest_bsi, label, BSI_NEW_STMT);
+ gimple_stmt_iterator dest_gsi = gsi_start_bb (a);
+ gsi_insert_before (&dest_gsi, label, GSI_NEW_STMT);
}
}
else
{
- change_bb_for_stmt (bsi_stmt (bsi), a);
- bsi_next (&bsi);
+ gimple_set_bb (gsi_stmt (gsi), a);
+ gsi_next (&gsi);
}
}
- /* Merge the chains. */
- last = tsi_last (bb_stmt_list (a));
- tsi_link_after (&last, bb_stmt_list (b), TSI_NEW_STMT);
- set_bb_stmt_list (b, NULL_TREE);
+ /* Merge the sequences. */
+ last = gsi_last_bb (a);
+ gsi_insert_seq_after (&last, bb_seq (b), GSI_NEW_STMT);
+ set_bb_seq (b, NULL);
if (cfgcleanup_altered_bbs)
bitmap_set_bit (cfgcleanup_altered_bbs, a->index);
@@ -1432,6 +1454,8 @@ single_noncomplex_succ (basic_block bb)
* Some unnecessary BIND_EXPRs are removed
+ * GOTO_EXPRs immediately preceding destination are removed.
+
Clearly more work could be done. The trick is doing the analysis
and removal fast enough to be a net improvement in compile times.
@@ -1441,208 +1465,172 @@ single_noncomplex_succ (basic_block bb)
struct rus_data
{
- tree *last_goto;
bool repeat;
bool may_throw;
bool may_branch;
bool has_label;
+ bool last_was_goto;
+ gimple_stmt_iterator last_goto_gsi;
};
-static void remove_useless_stmts_1 (tree *, struct rus_data *);
+
+static void remove_useless_stmts_1 (gimple_stmt_iterator *gsi, struct rus_data *);
+
+/* Given a statement sequence, find the first executable statement with
+ location information, and warn that it is unreachable. When searching,
+ descend into containers in execution order. */
static bool
-remove_useless_stmts_warn_notreached (tree stmt)
+remove_useless_stmts_warn_notreached (gimple_seq stmts)
{
- if (EXPR_HAS_LOCATION (stmt))
- {
- location_t loc = EXPR_LOCATION (stmt);
- if (LOCATION_LINE (loc) > 0)
- {
- warning (OPT_Wunreachable_code, "%Hwill never be executed", &loc);
- return true;
- }
- }
+ gimple_stmt_iterator gsi;
- switch (TREE_CODE (stmt))
+ for (gsi = gsi_start (stmts); !gsi_end_p (gsi); gsi_next (&gsi))
{
- case STATEMENT_LIST:
- {
- tree_stmt_iterator i;
- for (i = tsi_start (stmt); !tsi_end_p (i); tsi_next (&i))
- if (remove_useless_stmts_warn_notreached (tsi_stmt (i)))
- return true;
- }
- break;
+ gimple stmt = gsi_stmt (gsi);
- case COND_EXPR:
- if (remove_useless_stmts_warn_notreached (COND_EXPR_COND (stmt)))
- return true;
- if (remove_useless_stmts_warn_notreached (COND_EXPR_THEN (stmt)))
- return true;
- if (remove_useless_stmts_warn_notreached (COND_EXPR_ELSE (stmt)))
- return true;
- break;
+ if (gimple_has_location (stmt))
+ {
+ location_t loc = gimple_location (stmt);
+ if (LOCATION_LINE (loc) > 0)
+ {
+ warning (OPT_Wunreachable_code, "%Hwill never be executed", &loc);
+ return true;
+ }
+ }
- case TRY_FINALLY_EXPR:
- case TRY_CATCH_EXPR:
- if (remove_useless_stmts_warn_notreached (TREE_OPERAND (stmt, 0)))
- return true;
- if (remove_useless_stmts_warn_notreached (TREE_OPERAND (stmt, 1)))
- return true;
- break;
+ switch (gimple_code (stmt))
+ {
+ /* Unfortunately, we need the CFG now to detect unreachable
+ branches in a conditional, so conditionals are not handled here. */
- case CATCH_EXPR:
- return remove_useless_stmts_warn_notreached (CATCH_BODY (stmt));
- case EH_FILTER_EXPR:
- return remove_useless_stmts_warn_notreached (EH_FILTER_FAILURE (stmt));
- case BIND_EXPR:
- return remove_useless_stmts_warn_notreached (BIND_EXPR_BLOCK (stmt));
+ case GIMPLE_TRY:
+ if (remove_useless_stmts_warn_notreached (gimple_try_eval (stmt)))
+ return true;
+ if (remove_useless_stmts_warn_notreached (gimple_try_cleanup (stmt)))
+ return true;
+ break;
- default:
- /* Not a live container. */
- break;
+ case GIMPLE_CATCH:
+ return remove_useless_stmts_warn_notreached (gimple_catch_handler (stmt));
+
+ case GIMPLE_EH_FILTER:
+ return remove_useless_stmts_warn_notreached (gimple_eh_filter_failure (stmt));
+
+ case GIMPLE_BIND:
+ return remove_useless_stmts_warn_notreached (gimple_bind_body (stmt));
+
+ default:
+ break;
+ }
}
return false;
}
+/* Helper for remove_useless_stmts_1. Handle GIMPLE_COND statements. */
+
static void
-remove_useless_stmts_cond (tree *stmt_p, struct rus_data *data)
+remove_useless_stmts_cond (gimple_stmt_iterator *gsi, struct rus_data *data)
{
- tree then_clause, else_clause, cond;
- bool save_has_label, then_has_label, else_has_label;
-
- save_has_label = data->has_label;
- data->has_label = false;
- data->last_goto = NULL;
-
- remove_useless_stmts_1 (&COND_EXPR_THEN (*stmt_p), data);
-
- then_has_label = data->has_label;
- data->has_label = false;
- data->last_goto = NULL;
-
- remove_useless_stmts_1 (&COND_EXPR_ELSE (*stmt_p), data);
+ gimple stmt = gsi_stmt (*gsi);
- else_has_label = data->has_label;
- data->has_label = save_has_label | then_has_label | else_has_label;
+ /* The folded result must still be a conditional statement. */
+ fold_stmt_inplace (stmt);
- then_clause = COND_EXPR_THEN (*stmt_p);
- else_clause = COND_EXPR_ELSE (*stmt_p);
- cond = fold (COND_EXPR_COND (*stmt_p));
+ data->may_branch = true;
- /* If neither arm does anything at all, we can remove the whole IF. */
- if (!TREE_SIDE_EFFECTS (then_clause) && !TREE_SIDE_EFFECTS (else_clause))
+ /* Replace trivial conditionals with gotos. */
+ if (gimple_cond_true_p (stmt))
{
- *stmt_p = build_empty_stmt ();
- data->repeat = true;
- }
+ /* Goto THEN label. */
+ tree then_label = gimple_cond_true_label (stmt);
- /* If there are no reachable statements in an arm, then we can
- zap the entire conditional. */
- else if (integer_nonzerop (cond) && !else_has_label)
- {
- if (warn_notreached)
- remove_useless_stmts_warn_notreached (else_clause);
- *stmt_p = then_clause;
+ gsi_replace (gsi, gimple_build_goto (then_label), false);
+ data->last_goto_gsi = *gsi;
+ data->last_was_goto = true;
data->repeat = true;
}
- else if (integer_zerop (cond) && !then_has_label)
+ else if (gimple_cond_false_p (stmt))
{
- if (warn_notreached)
- remove_useless_stmts_warn_notreached (then_clause);
- *stmt_p = else_clause;
+ /* Goto ELSE label. */
+ tree else_label = gimple_cond_false_label (stmt);
+
+ gsi_replace (gsi, gimple_build_goto (else_label), false);
+ data->last_goto_gsi = *gsi;
+ data->last_was_goto = true;
data->repeat = true;
}
-
- /* Check a couple of simple things on then/else with single stmts. */
else
{
- tree then_stmt = expr_only (then_clause);
- tree else_stmt = expr_only (else_clause);
+ tree then_label = gimple_cond_true_label (stmt);
+ tree else_label = gimple_cond_false_label (stmt);
- /* Notice branches to a common destination. */
- if (then_stmt && else_stmt
- && TREE_CODE (then_stmt) == GOTO_EXPR
- && TREE_CODE (else_stmt) == GOTO_EXPR
- && (GOTO_DESTINATION (then_stmt) == GOTO_DESTINATION (else_stmt)))
- {
- *stmt_p = then_stmt;
+ if (then_label == else_label)
+ {
+ /* Goto common destination. */
+ gsi_replace (gsi, gimple_build_goto (then_label), false);
+ data->last_goto_gsi = *gsi;
+ data->last_was_goto = true;
data->repeat = true;
}
-
- /* If the THEN/ELSE clause merely assigns a value to a variable or
- parameter which is already known to contain that value, then
- remove the useless THEN/ELSE clause. */
- else if (TREE_CODE (cond) == VAR_DECL || TREE_CODE (cond) == PARM_DECL)
- {
- if (else_stmt
- && TREE_CODE (else_stmt) == GIMPLE_MODIFY_STMT
- && GIMPLE_STMT_OPERAND (else_stmt, 0) == cond
- && integer_zerop (GIMPLE_STMT_OPERAND (else_stmt, 1)))
- COND_EXPR_ELSE (*stmt_p) = alloc_stmt_list ();
- }
- else if ((TREE_CODE (cond) == EQ_EXPR || TREE_CODE (cond) == NE_EXPR)
- && (TREE_CODE (TREE_OPERAND (cond, 0)) == VAR_DECL
- || TREE_CODE (TREE_OPERAND (cond, 0)) == PARM_DECL)
- && TREE_CONSTANT (TREE_OPERAND (cond, 1)))
- {
- tree stmt = (TREE_CODE (cond) == EQ_EXPR
- ? then_stmt : else_stmt);
- tree *location = (TREE_CODE (cond) == EQ_EXPR
- ? &COND_EXPR_THEN (*stmt_p)
- : &COND_EXPR_ELSE (*stmt_p));
-
- if (stmt
- && TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && GIMPLE_STMT_OPERAND (stmt, 0) == TREE_OPERAND (cond, 0)
- && GIMPLE_STMT_OPERAND (stmt, 1) == TREE_OPERAND (cond, 1))
- *location = alloc_stmt_list ();
- }
}
- /* Protect GOTOs in the arm of COND_EXPRs from being removed. They
- would be re-introduced during lowering. */
- data->last_goto = NULL;
+ gsi_next (gsi);
+
+ data->last_was_goto = false;
}
+/* Helper for remove_useless_stmts_1.
+ Handle the try-finally case for GIMPLE_TRY statements. */
static void
-remove_useless_stmts_tf (tree *stmt_p, struct rus_data *data)
+remove_useless_stmts_tf (gimple_stmt_iterator *gsi, struct rus_data *data)
{
bool save_may_branch, save_may_throw;
bool this_may_branch, this_may_throw;
+ gimple_seq eval_seq, cleanup_seq;
+ gimple_stmt_iterator eval_gsi, cleanup_gsi;
+
+ gimple stmt = gsi_stmt (*gsi);
+
/* Collect may_branch and may_throw information for the body only. */
save_may_branch = data->may_branch;
save_may_throw = data->may_throw;
data->may_branch = false;
data->may_throw = false;
- data->last_goto = NULL;
+ data->last_was_goto = false;
- remove_useless_stmts_1 (&TREE_OPERAND (*stmt_p, 0), data);
+ eval_seq = gimple_try_eval (stmt);
+ eval_gsi = gsi_start (eval_seq);
+ remove_useless_stmts_1 (&eval_gsi, data);
this_may_branch = data->may_branch;
this_may_throw = data->may_throw;
data->may_branch |= save_may_branch;
data->may_throw |= save_may_throw;
- data->last_goto = NULL;
+ data->last_was_goto = false;
- remove_useless_stmts_1 (&TREE_OPERAND (*stmt_p, 1), data);
+ cleanup_seq = gimple_try_cleanup (stmt);
+ cleanup_gsi = gsi_start (cleanup_seq);
+ remove_useless_stmts_1 (&cleanup_gsi, data);
/* If the body is empty, then we can emit the FINALLY block without
the enclosing TRY_FINALLY_EXPR. */
- if (!TREE_SIDE_EFFECTS (TREE_OPERAND (*stmt_p, 0)))
+ if (gimple_seq_empty_p (eval_seq))
{
- *stmt_p = TREE_OPERAND (*stmt_p, 1);
+ gsi_insert_seq_before (gsi, cleanup_seq, GSI_SAME_STMT);
+ gsi_remove (gsi, false);
data->repeat = true;
}
/* If the handler is empty, then we can emit the TRY block without
the enclosing TRY_FINALLY_EXPR. */
- else if (!TREE_SIDE_EFFECTS (TREE_OPERAND (*stmt_p, 1)))
+ else if (gimple_seq_empty_p (cleanup_seq))
{
- *stmt_p = TREE_OPERAND (*stmt_p, 0);
+ gsi_insert_seq_before (gsi, eval_seq, GSI_SAME_STMT);
+ gsi_remove (gsi, false);
data->repeat = true;
}
@@ -1650,37 +1638,51 @@ remove_useless_stmts_tf (tree *stmt_p, struct rus_data *data)
string the TRY and FINALLY blocks together. */
else if (!this_may_branch && !this_may_throw)
{
- tree stmt = *stmt_p;
- *stmt_p = TREE_OPERAND (stmt, 0);
- append_to_statement_list (TREE_OPERAND (stmt, 1), stmt_p);
+ gsi_insert_seq_before (gsi, eval_seq, GSI_SAME_STMT);
+ gsi_insert_seq_before (gsi, cleanup_seq, GSI_SAME_STMT);
+ gsi_remove (gsi, false);
data->repeat = true;
}
+ else
+ gsi_next (gsi);
}
+/* Helper for remove_useless_stmts_1.
+ Handle the try-catch case for GIMPLE_TRY statements. */
static void
-remove_useless_stmts_tc (tree *stmt_p, struct rus_data *data)
+remove_useless_stmts_tc (gimple_stmt_iterator *gsi, struct rus_data *data)
{
bool save_may_throw, this_may_throw;
- tree_stmt_iterator i;
- tree stmt;
+
+ gimple_seq eval_seq, cleanup_seq, handler_seq, failure_seq;
+ gimple_stmt_iterator eval_gsi, cleanup_gsi, handler_gsi, failure_gsi;
+
+ gimple stmt = gsi_stmt (*gsi);
/* Collect may_throw information for the body only. */
save_may_throw = data->may_throw;
data->may_throw = false;
- data->last_goto = NULL;
+ data->last_was_goto = false;
- remove_useless_stmts_1 (&TREE_OPERAND (*stmt_p, 0), data);
+ eval_seq = gimple_try_eval (stmt);
+ eval_gsi = gsi_start (eval_seq);
+ remove_useless_stmts_1 (&eval_gsi, data);
this_may_throw = data->may_throw;
data->may_throw = save_may_throw;
+ cleanup_seq = gimple_try_cleanup (stmt);
+
/* If the body cannot throw, then we can drop the entire TRY_CATCH_EXPR. */
if (!this_may_throw)
{
if (warn_notreached)
- remove_useless_stmts_warn_notreached (TREE_OPERAND (*stmt_p, 1));
- *stmt_p = TREE_OPERAND (*stmt_p, 0);
+ {
+ remove_useless_stmts_warn_notreached (cleanup_seq);
+ }
+ gsi_insert_seq_before (gsi, eval_seq, GSI_SAME_STMT);
+ gsi_remove (gsi, false);
data->repeat = true;
return;
}
@@ -1689,142 +1691,164 @@ remove_useless_stmts_tc (tree *stmt_p, struct rus_data *data)
no exceptions propagate past this point. */
this_may_throw = true;
- i = tsi_start (TREE_OPERAND (*stmt_p, 1));
- stmt = tsi_stmt (i);
- data->last_goto = NULL;
+ cleanup_gsi = gsi_start (cleanup_seq);
+ stmt = gsi_stmt (cleanup_gsi);
+ data->last_was_goto = false;
- switch (TREE_CODE (stmt))
+ switch (gimple_code (stmt))
{
- case CATCH_EXPR:
- for (; !tsi_end_p (i); tsi_next (&i))
- {
- stmt = tsi_stmt (i);
+ case GIMPLE_CATCH:
+ /* If the first element is a catch, they all must be. */
+ while (!gsi_end_p (cleanup_gsi))
+ {
+ stmt = gsi_stmt (cleanup_gsi);
/* If we catch all exceptions, then the body does not
propagate exceptions past this point. */
- if (CATCH_TYPES (stmt) == NULL)
+ if (gimple_catch_types (stmt) == NULL)
this_may_throw = false;
- data->last_goto = NULL;
- remove_useless_stmts_1 (&CATCH_BODY (stmt), data);
+ data->last_was_goto = false;
+ handler_seq = gimple_catch_handler (stmt);
+ handler_gsi = gsi_start (handler_seq);
+ remove_useless_stmts_1 (&handler_gsi, data);
+ gsi_next (&cleanup_gsi);
}
+ gsi_next (gsi);
break;
- case EH_FILTER_EXPR:
- if (EH_FILTER_MUST_NOT_THROW (stmt))
+ case GIMPLE_EH_FILTER:
+ /* If the first element is an eh_filter, it should stand alone. */
+ if (gimple_eh_filter_must_not_throw (stmt))
this_may_throw = false;
- else if (EH_FILTER_TYPES (stmt) == NULL)
+ else if (gimple_eh_filter_types (stmt) == NULL)
this_may_throw = false;
- remove_useless_stmts_1 (&EH_FILTER_FAILURE (stmt), data);
+ failure_seq = gimple_eh_filter_failure (stmt);
+ failure_gsi = gsi_start (failure_seq);
+ remove_useless_stmts_1 (&failure_gsi, data);
+ gsi_next (gsi);
break;
default:
- /* Otherwise this is a cleanup. */
- remove_useless_stmts_1 (&TREE_OPERAND (*stmt_p, 1), data);
+ /* Otherwise this is a list of cleanup statements. */
+ remove_useless_stmts_1 (&cleanup_gsi, data);
/* If the cleanup is empty, then we can emit the TRY block without
the enclosing TRY_CATCH_EXPR. */
- if (!TREE_SIDE_EFFECTS (TREE_OPERAND (*stmt_p, 1)))
+ if (gimple_seq_empty_p (cleanup_seq))
{
- *stmt_p = TREE_OPERAND (*stmt_p, 0);
+ gsi_insert_seq_before (gsi, eval_seq, GSI_SAME_STMT);
+ gsi_remove(gsi, false);
data->repeat = true;
}
+ else
+ gsi_next (gsi);
break;
}
+
data->may_throw |= this_may_throw;
}
+/* Helper for remove_useless_stmts_1. Handle GIMPLE_BIND statements. */
static void
-remove_useless_stmts_bind (tree *stmt_p, struct rus_data *data)
+remove_useless_stmts_bind (gimple_stmt_iterator *gsi, struct rus_data *data ATTRIBUTE_UNUSED)
{
tree block;
+ gimple_seq body_seq, fn_body_seq;
+ gimple_stmt_iterator body_gsi;
+
+ gimple stmt = gsi_stmt (*gsi);
/* First remove anything underneath the BIND_EXPR. */
- remove_useless_stmts_1 (&BIND_EXPR_BODY (*stmt_p), data);
+
+ body_seq = gimple_bind_body (stmt);
+ body_gsi = gsi_start (body_seq);
+ remove_useless_stmts_1 (&body_gsi, data);
- /* If the BIND_EXPR has no variables, then we can pull everything
- up one level and remove the BIND_EXPR, unless this is the toplevel
- BIND_EXPR for the current function or an inlined function.
+ /* If the GIMPLE_BIND has no variables, then we can pull everything
+ up one level and remove the GIMPLE_BIND, unless this is the toplevel
+ GIMPLE_BIND for the current function or an inlined function.
When this situation occurs we will want to apply this
optimization again. */
- block = BIND_EXPR_BLOCK (*stmt_p);
- if (BIND_EXPR_VARS (*stmt_p) == NULL_TREE
- && *stmt_p != DECL_SAVED_TREE (current_function_decl)
+ block = gimple_bind_block (stmt);
+ fn_body_seq = gimple_body (current_function_decl);
+ if (gimple_bind_vars (stmt) == NULL_TREE
+ && (gimple_seq_empty_p (fn_body_seq)
+ || stmt != gimple_seq_first_stmt (fn_body_seq))
&& (! block
|| ! BLOCK_ABSTRACT_ORIGIN (block)
|| (TREE_CODE (BLOCK_ABSTRACT_ORIGIN (block))
!= FUNCTION_DECL)))
{
- *stmt_p = BIND_EXPR_BODY (*stmt_p);
+ gsi_insert_seq_before (gsi, body_seq, GSI_SAME_STMT);
+ gsi_remove (gsi, false);
data->repeat = true;
}
+ else
+ gsi_next (gsi);
}
+/* Helper for remove_useless_stmts_1. Handle GIMPLE_GOTO statements. */
static void
-remove_useless_stmts_goto (tree *stmt_p, struct rus_data *data)
+remove_useless_stmts_goto (gimple_stmt_iterator *gsi, struct rus_data *data)
{
- tree dest = GOTO_DESTINATION (*stmt_p);
+ gimple stmt = gsi_stmt (*gsi);
+
+ tree dest = gimple_goto_dest (stmt);
data->may_branch = true;
- data->last_goto = NULL;
+ data->last_was_goto = false;
- /* Record the last goto expr, so that we can delete it if unnecessary. */
+ /* Record iterator for last goto expr, so that we can delete it if unnecessary. */
if (TREE_CODE (dest) == LABEL_DECL)
- data->last_goto = stmt_p;
+ {
+ data->last_goto_gsi = *gsi;
+ data->last_was_goto = true;
+ }
+
+ gsi_next(gsi);
}
+/* Helper for remove_useless_stmts_1. Handle GIMPLE_LABEL statements. */
static void
-remove_useless_stmts_label (tree *stmt_p, struct rus_data *data)
+remove_useless_stmts_label (gimple_stmt_iterator *gsi, struct rus_data *data)
{
- tree label = LABEL_EXPR_LABEL (*stmt_p);
+ gimple stmt = gsi_stmt (*gsi);
+
+ tree label = gimple_label_label (stmt);
data->has_label = true;
/* We do want to jump across non-local label receiver code. */
if (DECL_NONLOCAL (label))
- data->last_goto = NULL;
+ data->last_was_goto = false;
- else if (data->last_goto && GOTO_DESTINATION (*data->last_goto) == label)
+ else if (data->last_was_goto
+ && gimple_goto_dest (gsi_stmt (data->last_goto_gsi)) == label)
{
- *data->last_goto = build_empty_stmt ();
+ /* Replace the preceding GIMPLE_GOTO statement with
+ a GIMPLE_NOP, which will be subsequently removed.
+ In this way, we avoid invalidating other iterators
+ active on the statement sequence. */
+ gsi_replace(&data->last_goto_gsi, gimple_build_nop(), false);
+ data->last_was_goto = false;
data->repeat = true;
}
/* ??? Add something here to delete unused labels. */
-}
-
-/* If the function is "const" or "pure", then clear TREE_SIDE_EFFECTS on its
- decl. This allows us to eliminate redundant or useless
- calls to "const" functions.
-
- Gimplifier already does the same operation, but we may notice functions
- being const and pure once their calls has been gimplified, so we need
- to update the flag. */
-
-static void
-update_call_expr_flags (tree call)
-{
- tree decl = get_callee_fndecl (call);
- int flags;
- if (!decl)
- return;
- flags = call_expr_flags (call);
- if (flags & (ECF_CONST | ECF_PURE) && !(flags & ECF_LOOPING_CONST_OR_PURE))
- TREE_SIDE_EFFECTS (call) = 0;
- if (TREE_NOTHROW (decl))
- TREE_NOTHROW (call) = 1;
+ gsi_next (gsi);
}
/* T is CALL_EXPR. Set current_function_calls_* flags. */
void
-notice_special_calls (tree t)
+notice_special_calls (gimple call)
{
- int flags = call_expr_flags (t);
+ int flags = gimple_call_flags (call);
if (flags & ECF_MAY_BE_ALLOCA)
cfun->calls_alloca = true;
@@ -1843,133 +1867,144 @@ clear_special_calls (void)
cfun->calls_setjmp = false;
}
+/* Remove useless statements from a statement sequence, and perform
+ some preliminary simplifications. */
static void
-remove_useless_stmts_1 (tree *tp, struct rus_data *data)
+remove_useless_stmts_1 (gimple_stmt_iterator *gsi, struct rus_data *data)
{
- tree t = *tp, op;
-
- switch (TREE_CODE (t))
+ while (!gsi_end_p (*gsi))
{
- case COND_EXPR:
- remove_useless_stmts_cond (tp, data);
- break;
-
- case TRY_FINALLY_EXPR:
- remove_useless_stmts_tf (tp, data);
- break;
-
- case TRY_CATCH_EXPR:
- remove_useless_stmts_tc (tp, data);
- break;
-
- case BIND_EXPR:
- remove_useless_stmts_bind (tp, data);
- break;
-
- case GOTO_EXPR:
- remove_useless_stmts_goto (tp, data);
- break;
-
- case LABEL_EXPR:
- remove_useless_stmts_label (tp, data);
- break;
-
- case RETURN_EXPR:
- fold_stmt (tp);
- data->last_goto = NULL;
- data->may_branch = true;
- break;
-
- case CALL_EXPR:
- fold_stmt (tp);
- data->last_goto = NULL;
- notice_special_calls (t);
- update_call_expr_flags (t);
- if (tree_could_throw_p (t))
- data->may_throw = true;
- break;
-
- case MODIFY_EXPR:
- gcc_unreachable ();
+ gimple stmt = gsi_stmt (*gsi);
- case GIMPLE_MODIFY_STMT:
- data->last_goto = NULL;
- fold_stmt (tp);
- op = get_call_expr_in (t);
- if (op)
- {
- update_call_expr_flags (op);
- notice_special_calls (op);
- }
- if (tree_could_throw_p (t))
- data->may_throw = true;
- break;
-
- case STATEMENT_LIST:
- {
- tree_stmt_iterator i = tsi_start (t);
- while (!tsi_end_p (i))
- {
- t = tsi_stmt (i);
- if (IS_EMPTY_STMT (t))
- {
- tsi_delink (&i);
- continue;
- }
-
- remove_useless_stmts_1 (tsi_stmt_ptr (i), data);
-
- t = tsi_stmt (i);
- if (TREE_CODE (t) == STATEMENT_LIST)
- {
- tsi_link_before (&i, t, TSI_SAME_STMT);
- tsi_delink (&i);
- }
- else
- tsi_next (&i);
- }
- }
- break;
- case ASM_EXPR:
- fold_stmt (tp);
- data->last_goto = NULL;
- break;
-
- case OMP_PARALLEL:
- case OMP_TASK:
- /* Make sure the outermost BIND_EXPR in OMP_BODY isn't removed
- as useless. */
- remove_useless_stmts_1 (&BIND_EXPR_BODY (OMP_TASKREG_BODY (*tp)), data);
- data->last_goto = NULL;
- break;
-
- case OMP_SECTIONS:
- case OMP_SINGLE:
- case OMP_SECTION:
- case OMP_MASTER:
- case OMP_ORDERED:
- case OMP_CRITICAL:
- remove_useless_stmts_1 (&OMP_BODY (*tp), data);
- data->last_goto = NULL;
- break;
-
- case OMP_FOR:
- remove_useless_stmts_1 (&OMP_FOR_BODY (*tp), data);
- data->last_goto = NULL;
- if (OMP_FOR_PRE_BODY (*tp))
- {
- remove_useless_stmts_1 (&OMP_FOR_PRE_BODY (*tp), data);
- data->last_goto = NULL;
- }
- break;
-
- default:
- data->last_goto = NULL;
- break;
+ switch (gimple_code (stmt))
+ {
+ case GIMPLE_COND:
+ remove_useless_stmts_cond (gsi, data);
+ break;
+
+ case GIMPLE_GOTO:
+ remove_useless_stmts_goto (gsi, data);
+ break;
+
+ case GIMPLE_LABEL:
+ remove_useless_stmts_label (gsi, data);
+ break;
+
+ case GIMPLE_ASSIGN:
+ fold_stmt (gsi);
+ stmt = gsi_stmt (*gsi);
+ data->last_was_goto = false;
+ if (stmt_could_throw_p (stmt))
+ data->may_throw = true;
+ gsi_next (gsi);
+ break;
+
+ case GIMPLE_ASM:
+ fold_stmt (gsi);
+ data->last_was_goto = false;
+ gsi_next (gsi);
+ break;
+
+ case GIMPLE_CALL:
+ fold_stmt (gsi);
+ stmt = gsi_stmt (*gsi);
+ data->last_was_goto = false;
+ if (is_gimple_call (stmt))
+ notice_special_calls (stmt);
+
+ /* We used to call update_gimple_call_flags here,
+ which copied side-effects and nothrows status
+ from the function decl to the call. In the new
+ tuplified GIMPLE, the accessors for this information
+ always consult the function decl, so this copying
+ is no longer necessary. */
+ if (stmt_could_throw_p (stmt))
+ data->may_throw = true;
+ gsi_next (gsi);
+ break;
+
+ case GIMPLE_RETURN:
+ fold_stmt (gsi);
+ data->last_was_goto = false;
+ data->may_branch = true;
+ gsi_next (gsi);
+ break;
+
+ case GIMPLE_BIND:
+ remove_useless_stmts_bind (gsi, data);
+ break;
+
+ case GIMPLE_TRY:
+ if (gimple_try_kind (stmt) == GIMPLE_TRY_CATCH)
+ remove_useless_stmts_tc (gsi, data);
+ else if (gimple_try_kind (stmt) == GIMPLE_TRY_FINALLY)
+ remove_useless_stmts_tf (gsi, data);
+ else
+ gcc_unreachable ();
+ break;
+
+ case GIMPLE_CATCH:
+ gcc_unreachable ();
+ break;
+
+ case GIMPLE_NOP:
+ gsi_remove (gsi, false);
+ break;
+
+ case GIMPLE_OMP_FOR:
+ {
+ gimple_seq pre_body_seq = gimple_omp_for_pre_body (stmt);
+ gimple_stmt_iterator pre_body_gsi = gsi_start (pre_body_seq);
+
+ remove_useless_stmts_1 (&pre_body_gsi, data);
+ data->last_was_goto = false;
+ }
+ /* FALLTHROUGH */
+ case GIMPLE_OMP_CRITICAL:
+ case GIMPLE_OMP_CONTINUE:
+ case GIMPLE_OMP_MASTER:
+ case GIMPLE_OMP_ORDERED:
+ case GIMPLE_OMP_SECTION:
+ case GIMPLE_OMP_SECTIONS:
+ case GIMPLE_OMP_SINGLE:
+ {
+ gimple_seq body_seq = gimple_omp_body (stmt);
+ gimple_stmt_iterator body_gsi = gsi_start (body_seq);
+
+ remove_useless_stmts_1 (&body_gsi, data);
+ data->last_was_goto = false;
+ gsi_next (gsi);
+ }
+ break;
+
+ case GIMPLE_OMP_PARALLEL:
+ case GIMPLE_OMP_TASK:
+ {
+ /* Make sure the outermost GIMPLE_BIND isn't removed
+ as useless. */
+ gimple_seq body_seq = gimple_omp_body (stmt);
+ gimple bind = gimple_seq_first_stmt (body_seq);
+ gimple_seq bind_seq = gimple_bind_body (bind);
+ gimple_stmt_iterator bind_gsi = gsi_start (bind_seq);
+
+ remove_useless_stmts_1 (&bind_gsi, data);
+ data->last_was_goto = false;
+ gsi_next (gsi);
+ }
+ break;
+
+ default:
+ data->last_was_goto = false;
+ gsi_next (gsi);
+ break;
+ }
}
}
+/* Walk the function tree, removing useless statements and performing
+ some preliminary simplifications. */
+
static unsigned int
remove_useless_stmts (void)
{
@@ -1979,8 +2014,11 @@ remove_useless_stmts (void)
do
{
+ gimple_stmt_iterator gsi;
+
+ gsi = gsi_start (gimple_body (current_function_decl));
memset (&data, 0, sizeof (data));
- remove_useless_stmts_1 (&DECL_SAVED_TREE (current_function_decl), &data);
+ remove_useless_stmts_1 (&gsi, &data);
}
while (data.repeat);
return 0;
@@ -2011,17 +2049,14 @@ struct gimple_opt_pass pass_remove_useless_stmts =
static void
remove_phi_nodes_and_edges_for_unreachable_block (basic_block bb)
{
- tree phi;
+ gimple_stmt_iterator gsi;
/* Since this block is no longer reachable, we can just delete all
of its PHI nodes. */
- phi = phi_nodes (bb);
- while (phi)
- {
- tree next = PHI_CHAIN (phi);
- remove_phi_node (phi, NULL_TREE, true);
- phi = next;
- }
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); )
+ remove_phi_node (&gsi, true);
+
+ set_phi_nodes (bb, NULL);
/* Remove edges to BB's successors. */
while (EDGE_COUNT (bb->succs) > 0)
@@ -2034,7 +2069,7 @@ remove_phi_nodes_and_edges_for_unreachable_block (basic_block bb)
static void
remove_bb (basic_block bb)
{
- block_stmt_iterator i;
+ gimple_stmt_iterator i;
source_location loc = UNKNOWN_LOCATION;
if (dump_file)
@@ -2059,31 +2094,31 @@ remove_bb (basic_block bb)
}
/* Remove all the instructions in the block. */
- if (bb_stmt_list (bb) != NULL_TREE)
+ if (bb_seq (bb) != NULL)
{
- for (i = bsi_start (bb); !bsi_end_p (i);)
+ for (i = gsi_start_bb (bb); !gsi_end_p (i);)
{
- tree stmt = bsi_stmt (i);
- if (TREE_CODE (stmt) == LABEL_EXPR
- && (FORCED_LABEL (LABEL_EXPR_LABEL (stmt))
- || DECL_NONLOCAL (LABEL_EXPR_LABEL (stmt))))
+ gimple stmt = gsi_stmt (i);
+ if (gimple_code (stmt) == GIMPLE_LABEL
+ && (FORCED_LABEL (gimple_label_label (stmt))
+ || DECL_NONLOCAL (gimple_label_label (stmt))))
{
basic_block new_bb;
- block_stmt_iterator new_bsi;
+ gimple_stmt_iterator new_gsi;
/* A non-reachable non-local label may still be referenced.
But it no longer needs to carry the extra semantics of
non-locality. */
- if (DECL_NONLOCAL (LABEL_EXPR_LABEL (stmt)))
+ if (DECL_NONLOCAL (gimple_label_label (stmt)))
{
- DECL_NONLOCAL (LABEL_EXPR_LABEL (stmt)) = 0;
- FORCED_LABEL (LABEL_EXPR_LABEL (stmt)) = 1;
+ DECL_NONLOCAL (gimple_label_label (stmt)) = 0;
+ FORCED_LABEL (gimple_label_label (stmt)) = 1;
}
new_bb = bb->prev_bb;
- new_bsi = bsi_start (new_bb);
- bsi_remove (&i, false);
- bsi_insert_before (&new_bsi, stmt, BSI_NEW_STMT);
+ new_gsi = gsi_start_bb (new_bb);
+ gsi_remove (&i, false);
+ gsi_insert_before (&new_gsi, stmt, GSI_NEW_STMT);
}
else
{
@@ -2094,18 +2129,17 @@ remove_bb (basic_block bb)
if (gimple_in_ssa_p (cfun))
release_defs (stmt);
- bsi_remove (&i, true);
+ gsi_remove (&i, true);
}
/* Don't warn for removed gotos. Gotos are often removed due to
jump threading, thus resulting in bogus warnings. Not great,
since this way we lose warnings for gotos in the original
program that are indeed unreachable. */
- if (TREE_CODE (stmt) != GOTO_EXPR && EXPR_HAS_LOCATION (stmt) && !loc)
- {
- if (EXPR_HAS_LOCATION (stmt))
- loc = EXPR_LOCATION (stmt);
- }
+ if (gimple_code (stmt) != GIMPLE_GOTO
+ && gimple_has_location (stmt)
+ && !loc)
+ loc = gimple_location (stmt);
}
}
@@ -2117,7 +2151,7 @@ remove_bb (basic_block bb)
warning (OPT_Wunreachable_code, "%Hwill never be executed", &loc);
remove_phi_nodes_and_edges_for_unreachable_block (bb);
- bb->il.tree = NULL;
+ bb->il.gimple = NULL;
}
@@ -2128,21 +2162,23 @@ remove_bb (basic_block bb)
edge
find_taken_edge (basic_block bb, tree val)
{
- tree stmt;
+ gimple stmt;
stmt = last_stmt (bb);
gcc_assert (stmt);
gcc_assert (is_ctrl_stmt (stmt));
- gcc_assert (val);
- if (! is_gimple_min_invariant (val))
+ if (val == NULL)
+ return NULL;
+
+ if (!is_gimple_min_invariant (val))
return NULL;
- if (TREE_CODE (stmt) == COND_EXPR)
+ if (gimple_code (stmt) == GIMPLE_COND)
return find_taken_edge_cond_expr (bb, val);
- if (TREE_CODE (stmt) == SWITCH_EXPR)
+ if (gimple_code (stmt) == GIMPLE_SWITCH)
return find_taken_edge_switch_expr (bb, val);
if (computed_goto_p (stmt))
@@ -2204,12 +2240,13 @@ find_taken_edge_cond_expr (basic_block bb, tree val)
static edge
find_taken_edge_switch_expr (basic_block bb, tree val)
{
- tree switch_expr, taken_case;
basic_block dest_bb;
edge e;
+ gimple switch_stmt;
+ tree taken_case;
- switch_expr = last_stmt (bb);
- taken_case = find_case_label_for_value (switch_expr, val);
+ switch_stmt = last_stmt (bb);
+ taken_case = find_case_label_for_value (switch_stmt, val);
dest_bb = label_to_block (CASE_LABEL (taken_case));
e = find_edge (bb, dest_bb);
@@ -2218,21 +2255,20 @@ find_taken_edge_switch_expr (basic_block bb, tree val)
}
-/* Return the CASE_LABEL_EXPR that SWITCH_EXPR will take for VAL.
+/* Return the CASE_LABEL_EXPR that SWITCH_STMT will take for VAL.
We can make optimal use here of the fact that the case labels are
sorted: We can do a binary search for a case matching VAL. */
static tree
-find_case_label_for_value (tree switch_expr, tree val)
+find_case_label_for_value (gimple switch_stmt, tree val)
{
- tree vec = SWITCH_LABELS (switch_expr);
- size_t low, high, n = TREE_VEC_LENGTH (vec);
- tree default_case = TREE_VEC_ELT (vec, n - 1);
+ size_t low, high, n = gimple_switch_num_labels (switch_stmt);
+ tree default_case = gimple_switch_default_label (switch_stmt);
- for (low = -1, high = n - 1; high - low > 1; )
+ for (low = 0, high = n; high - low > 1; )
{
size_t i = (high + low) / 2;
- tree t = TREE_VEC_ELT (vec, i);
+ tree t = gimple_switch_label (switch_stmt, i);
int cmp;
/* Cache the result of comparing CASE_LOW and val. */
@@ -2261,36 +2297,21 @@ find_case_label_for_value (tree switch_expr, tree val)
}
-
-
-/*---------------------------------------------------------------------------
- Debugging functions
----------------------------------------------------------------------------*/
-
-/* Dump tree-specific information of block BB to file OUTF. */
-
-void
-tree_dump_bb (basic_block bb, FILE *outf, int indent)
-{
- dump_generic_bb (outf, bb, indent, TDF_VOPS|TDF_MEMSYMS);
-}
-
-
/* Dump a basic block on stderr. */
void
-debug_tree_bb (basic_block bb)
+gimple_debug_bb (basic_block bb)
{
- dump_bb (bb, stderr, 0);
+ gimple_dump_bb (bb, stderr, 0, TDF_VOPS|TDF_MEMSYMS);
}
/* Dump basic block with index N on stderr. */
basic_block
-debug_tree_bb_n (int n)
+gimple_debug_bb_n (int n)
{
- debug_tree_bb (BASIC_BLOCK (n));
+ gimple_debug_bb (BASIC_BLOCK (n));
return BASIC_BLOCK (n);
}
@@ -2301,9 +2322,9 @@ debug_tree_bb_n (int n)
(see TDF_* in tree-pass.h). */
void
-debug_tree_cfg (int flags)
+gimple_debug_cfg (int flags)
{
- dump_tree_cfg (stderr, flags);
+ gimple_dump_cfg (stderr, flags);
}
@@ -2313,7 +2334,7 @@ debug_tree_cfg (int flags)
tree.h). */
void
-dump_tree_cfg (FILE *file, int flags)
+gimple_dump_cfg (FILE *file, int flags)
{
if (flags & TDF_DETAILS)
{
@@ -2401,7 +2422,7 @@ debug_cfg_stats (void)
/* Dump the flowgraph to a .vcg FILE. */
static void
-tree_cfg2vcg (FILE *file)
+gimple_cfg2vcg (FILE *file)
{
edge e;
edge_iterator ei;
@@ -2431,17 +2452,17 @@ tree_cfg2vcg (FILE *file)
FOR_EACH_BB (bb)
{
- enum tree_code head_code, end_code;
+ enum gimple_code head_code, end_code;
const char *head_name, *end_name;
int head_line = 0;
int end_line = 0;
- tree first = first_stmt (bb);
- tree last = last_stmt (bb);
+ gimple first = first_stmt (bb);
+ gimple last = last_stmt (bb);
if (first)
{
- head_code = TREE_CODE (first);
- head_name = tree_code_name[head_code];
+ head_code = gimple_code (first);
+ head_name = gimple_code_name[head_code];
head_line = get_lineno (first);
}
else
@@ -2449,8 +2470,8 @@ tree_cfg2vcg (FILE *file)
if (last)
{
- end_code = TREE_CODE (last);
- end_name = tree_code_name[end_code];
+ end_code = gimple_code (last);
+ end_name = gimple_code_name[end_code];
end_line = get_lineno (last);
}
else
@@ -2491,13 +2512,13 @@ tree_cfg2vcg (FILE *file)
/* Return true if T represents a stmt that always transfers control. */
bool
-is_ctrl_stmt (const_tree t)
+is_ctrl_stmt (gimple t)
{
- return (TREE_CODE (t) == COND_EXPR
- || TREE_CODE (t) == SWITCH_EXPR
- || TREE_CODE (t) == GOTO_EXPR
- || TREE_CODE (t) == RETURN_EXPR
- || TREE_CODE (t) == RESX_EXPR);
+ return gimple_code (t) == GIMPLE_COND
+ || gimple_code (t) == GIMPLE_SWITCH
+ || gimple_code (t) == GIMPLE_GOTO
+ || gimple_code (t) == GIMPLE_RETURN
+ || gimple_code (t) == GIMPLE_RESX;
}
@@ -2505,50 +2526,41 @@ is_ctrl_stmt (const_tree t)
(e.g., a call to a non-returning function). */
bool
-is_ctrl_altering_stmt (const_tree t)
+is_ctrl_altering_stmt (gimple t)
{
- const_tree call;
-
gcc_assert (t);
- call = get_call_expr_in (CONST_CAST_TREE (t));
- if (call)
+
+ if (is_gimple_call (t))
{
- /* A non-pure/const CALL_EXPR alters flow control if the current
+ int flags = gimple_call_flags (t);
+
+ /* A non-pure/const call alters flow control if the current
function has nonlocal labels. */
- if (TREE_SIDE_EFFECTS (call) && cfun->has_nonlocal_label)
+ if (!(flags & (ECF_CONST | ECF_PURE))
+ && cfun->has_nonlocal_label)
return true;
- /* A CALL_EXPR also alters control flow if it does not return. */
- if (call_expr_flags (call) & ECF_NORETURN)
+ /* A call also alters control flow if it does not return. */
+ if (gimple_call_flags (t) & ECF_NORETURN)
return true;
}
/* OpenMP directives alter control flow. */
- if (OMP_DIRECTIVE_P (t))
+ if (is_gimple_omp (t))
return true;
/* If a statement can throw, it alters control flow. */
- return tree_can_throw_internal (t);
-}
-
-
-/* Return true if T is a computed goto. */
-
-static bool
-computed_goto_p (const_tree t)
-{
- return (TREE_CODE (t) == GOTO_EXPR
- && TREE_CODE (GOTO_DESTINATION (t)) != LABEL_DECL);
+ return stmt_can_throw_internal (t);
}
/* Return true if T is a simple local goto. */
bool
-simple_goto_p (const_tree t)
+simple_goto_p (gimple t)
{
- return (TREE_CODE (t) == GOTO_EXPR
- && TREE_CODE (GOTO_DESTINATION (t)) == LABEL_DECL);
+ return (gimple_code (t) == GIMPLE_GOTO
+ && TREE_CODE (gimple_goto_dest (t)) == LABEL_DECL);
}
@@ -2556,46 +2568,42 @@ simple_goto_p (const_tree t)
Transfers of control flow associated with EH are excluded. */
bool
-tree_can_make_abnormal_goto (const_tree t)
+stmt_can_make_abnormal_goto (gimple t)
{
if (computed_goto_p (t))
return true;
- if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
- t = GIMPLE_STMT_OPERAND (t, 1);
- if (TREE_CODE (t) == WITH_SIZE_EXPR)
- t = TREE_OPERAND (t, 0);
- if (TREE_CODE (t) == CALL_EXPR)
- return TREE_SIDE_EFFECTS (t) && cfun->has_nonlocal_label;
+ if (is_gimple_call (t))
+ return gimple_has_side_effects (t) && cfun->has_nonlocal_label;
return false;
}
-/* Return true if T should start a new basic block. PREV_T is the
- statement preceding T. It is used when T is a label or a case label.
- Labels should only start a new basic block if their previous statement
- wasn't a label. Otherwise, sequence of labels would generate
- unnecessary basic blocks that only contain a single label. */
+/* Return true if STMT should start a new basic block. PREV_STMT is
+ the statement preceding STMT. It is used when STMT is a label or a
+ case label. Labels should only start a new basic block if their
+ previous statement wasn't a label. Otherwise, sequence of labels
+ would generate unnecessary basic blocks that only contain a single
+ label. */
static inline bool
-stmt_starts_bb_p (const_tree t, const_tree prev_t)
+stmt_starts_bb_p (gimple stmt, gimple prev_stmt)
{
- if (t == NULL_TREE)
+ if (stmt == NULL)
return false;
- /* LABEL_EXPRs start a new basic block only if the preceding
- statement wasn't a label of the same type. This prevents the
- creation of consecutive blocks that have nothing but a single
- label. */
- if (TREE_CODE (t) == LABEL_EXPR)
+ /* Labels start a new basic block only if the preceding statement
+ wasn't a label of the same type. This prevents the creation of
+ consecutive blocks that have nothing but a single label. */
+ if (gimple_code (stmt) == GIMPLE_LABEL)
{
/* Nonlocal and computed GOTO targets always start a new block. */
- if (DECL_NONLOCAL (LABEL_EXPR_LABEL (t))
- || FORCED_LABEL (LABEL_EXPR_LABEL (t)))
+ if (DECL_NONLOCAL (gimple_label_label (stmt))
+ || FORCED_LABEL (gimple_label_label (stmt)))
return true;
- if (prev_t && TREE_CODE (prev_t) == LABEL_EXPR)
+ if (prev_stmt && gimple_code (prev_stmt) == GIMPLE_LABEL)
{
- if (DECL_NONLOCAL (LABEL_EXPR_LABEL (prev_t)))
+ if (DECL_NONLOCAL (gimple_label_label (prev_stmt)))
return true;
cfg_stats.num_merged_labels++;
@@ -2612,502 +2620,97 @@ stmt_starts_bb_p (const_tree t, const_tree prev_t)
/* Return true if T should end a basic block. */
bool
-stmt_ends_bb_p (const_tree t)
+stmt_ends_bb_p (gimple t)
{
return is_ctrl_stmt (t) || is_ctrl_altering_stmt (t);
}
-/* Remove block annotations and other datastructures. */
+/* Remove block annotations and other data structures. */
void
delete_tree_cfg_annotations (void)
{
- basic_block bb;
- block_stmt_iterator bsi;
-
- /* Remove annotations from every tree in the function. */
- FOR_EACH_BB (bb)
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- {
- tree stmt = bsi_stmt (bsi);
- ggc_free (stmt->base.ann);
- stmt->base.ann = NULL;
- }
label_to_block_map = NULL;
}
/* Return the first statement in basic block BB. */
-tree
+gimple
first_stmt (basic_block bb)
{
- block_stmt_iterator i = bsi_start (bb);
- return !bsi_end_p (i) ? bsi_stmt (i) : NULL_TREE;
+ gimple_stmt_iterator i = gsi_start_bb (bb);
+ return !gsi_end_p (i) ? gsi_stmt (i) : NULL;
}
/* Return the last statement in basic block BB. */
-tree
+gimple
last_stmt (basic_block bb)
{
- block_stmt_iterator b = bsi_last (bb);
- return !bsi_end_p (b) ? bsi_stmt (b) : NULL_TREE;
+ gimple_stmt_iterator b = gsi_last_bb (bb);
+ return !gsi_end_p (b) ? gsi_stmt (b) : NULL;
}
/* Return the last statement of an otherwise empty block. Return NULL
if the block is totally empty, or if it contains more than one
statement. */
-tree
+gimple
last_and_only_stmt (basic_block bb)
{
- block_stmt_iterator i = bsi_last (bb);
- tree last, prev;
+ gimple_stmt_iterator i = gsi_last_bb (bb);
+ gimple last, prev;
- if (bsi_end_p (i))
- return NULL_TREE;
+ if (gsi_end_p (i))
+ return NULL;
- last = bsi_stmt (i);
- bsi_prev (&i);
- if (bsi_end_p (i))
+ last = gsi_stmt (i);
+ gsi_prev (&i);
+ if (gsi_end_p (i))
return last;
/* Empty statements should no longer appear in the instruction stream.
Everything that might have appeared before should be deleted by
- remove_useless_stmts, and the optimizers should just bsi_remove
+ remove_useless_stmts, and the optimizers should just gsi_remove
instead of smashing with build_empty_stmt.
Thus the only thing that should appear here in a block containing
one executable statement is a label. */
- prev = bsi_stmt (i);
- if (TREE_CODE (prev) == LABEL_EXPR)
+ prev = gsi_stmt (i);
+ if (gimple_code (prev) == GIMPLE_LABEL)
return last;
else
- return NULL_TREE;
-}
-
-
-/* Mark BB as the basic block holding statement T. */
-
-void
-set_bb_for_stmt (tree t, basic_block bb)
-{
- if (TREE_CODE (t) == PHI_NODE)
- PHI_BB (t) = bb;
- else if (TREE_CODE (t) == STATEMENT_LIST)
- {
- tree_stmt_iterator i;
- for (i = tsi_start (t); !tsi_end_p (i); tsi_next (&i))
- set_bb_for_stmt (tsi_stmt (i), bb);
- }
- else
- {
- stmt_ann_t ann = get_stmt_ann (t);
- ann->bb = bb;
-
- /* If the statement is a label, add the label to block-to-labels map
- so that we can speed up edge creation for GOTO_EXPRs. */
- if (TREE_CODE (t) == LABEL_EXPR)
- {
- int uid;
-
- t = LABEL_EXPR_LABEL (t);
- uid = LABEL_DECL_UID (t);
- if (uid == -1)
- {
- unsigned old_len = VEC_length (basic_block, label_to_block_map);
- LABEL_DECL_UID (t) = uid = cfun->cfg->last_label_uid++;
- if (old_len <= (unsigned) uid)
- {
- unsigned new_len = 3 * uid / 2;
-
- VEC_safe_grow_cleared (basic_block, gc, label_to_block_map,
- new_len);
- }
- }
- else
- /* We're moving an existing label. Make sure that we've
- removed it from the old block. */
- gcc_assert (!bb
- || !VEC_index (basic_block, label_to_block_map, uid));
- VEC_replace (basic_block, label_to_block_map, uid, bb);
- }
- }
-}
-
-/* Faster version of set_bb_for_stmt that assume that statement is being moved
- from one basic block to another.
- For BB splitting we can run into quadratic case, so performance is quite
- important and knowing that the tables are big enough, change_bb_for_stmt
- can inline as leaf function. */
-static inline void
-change_bb_for_stmt (tree t, basic_block bb)
-{
- get_stmt_ann (t)->bb = bb;
- if (TREE_CODE (t) == LABEL_EXPR)
- VEC_replace (basic_block, label_to_block_map,
- LABEL_DECL_UID (LABEL_EXPR_LABEL (t)), bb);
-}
-
-/* Finds iterator for STMT. */
-
-extern block_stmt_iterator
-bsi_for_stmt (tree stmt)
-{
- block_stmt_iterator bsi;
-
- for (bsi = bsi_start (bb_for_stmt (stmt)); !bsi_end_p (bsi); bsi_next (&bsi))
- if (bsi_stmt (bsi) == stmt)
- return bsi;
-
- gcc_unreachable ();
-}
-
-/* Mark statement T as modified, and update it. */
-static inline void
-update_modified_stmts (tree t)
-{
- if (!ssa_operands_active ())
- return;
- if (TREE_CODE (t) == STATEMENT_LIST)
- {
- tree_stmt_iterator i;
- tree stmt;
- for (i = tsi_start (t); !tsi_end_p (i); tsi_next (&i))
- {
- stmt = tsi_stmt (i);
- update_stmt_if_modified (stmt);
- }
- }
- else
- update_stmt_if_modified (t);
-}
-
-/* Insert statement (or statement list) T before the statement
- pointed-to by iterator I. M specifies how to update iterator I
- after insertion (see enum bsi_iterator_update). */
-
-void
-bsi_insert_before (block_stmt_iterator *i, tree t, enum bsi_iterator_update m)
-{
- set_bb_for_stmt (t, i->bb);
- update_modified_stmts (t);
- tsi_link_before (&i->tsi, t, m);
-}
-
-
-/* Insert statement (or statement list) T after the statement
- pointed-to by iterator I. M specifies how to update iterator I
- after insertion (see enum bsi_iterator_update). */
-
-void
-bsi_insert_after (block_stmt_iterator *i, tree t, enum bsi_iterator_update m)
-{
- set_bb_for_stmt (t, i->bb);
- update_modified_stmts (t);
- tsi_link_after (&i->tsi, t, m);
-}
-
-
-/* Remove the statement pointed to by iterator I. The iterator is updated
- to the next statement.
-
- When REMOVE_EH_INFO is true we remove the statement pointed to by
- iterator I from the EH tables. Otherwise we do not modify the EH
- tables.
-
- Generally, REMOVE_EH_INFO should be true when the statement is going to
- be removed from the IL and not reinserted elsewhere. */
-
-void
-bsi_remove (block_stmt_iterator *i, bool remove_eh_info)
-{
- tree t = bsi_stmt (*i);
- set_bb_for_stmt (t, NULL);
- delink_stmt_imm_use (t);
- tsi_delink (&i->tsi);
- mark_stmt_modified (t);
- if (remove_eh_info)
- {
- remove_stmt_from_eh_region (t);
- gimple_remove_stmt_histograms (cfun, t);
- }
-}
-
-
-/* Move the statement at FROM so it comes right after the statement at TO. */
-
-void
-bsi_move_after (block_stmt_iterator *from, block_stmt_iterator *to)
-{
- tree stmt = bsi_stmt (*from);
- bsi_remove (from, false);
- /* We must have BSI_NEW_STMT here, as bsi_move_after is sometimes used to
- move statements to an empty block. */
- bsi_insert_after (to, stmt, BSI_NEW_STMT);
-}
-
-
-/* Move the statement at FROM so it comes right before the statement at TO. */
-
-void
-bsi_move_before (block_stmt_iterator *from, block_stmt_iterator *to)
-{
- tree stmt = bsi_stmt (*from);
- bsi_remove (from, false);
- /* For consistency with bsi_move_after, it might be better to have
- BSI_NEW_STMT here; however, that breaks several places that expect
- that TO does not change. */
- bsi_insert_before (to, stmt, BSI_SAME_STMT);
-}
-
-
-/* Move the statement at FROM to the end of basic block BB. */
-
-void
-bsi_move_to_bb_end (block_stmt_iterator *from, basic_block bb)
-{
- block_stmt_iterator last = bsi_last (bb);
-
- /* Have to check bsi_end_p because it could be an empty block. */
- if (!bsi_end_p (last) && is_ctrl_stmt (bsi_stmt (last)))
- bsi_move_before (from, &last);
- else
- bsi_move_after (from, &last);
-}
-
-
-/* Replace the contents of the statement pointed to by iterator BSI
- with STMT. If UPDATE_EH_INFO is true, the exception handling
- information of the original statement is moved to the new statement. */
-
-void
-bsi_replace (const block_stmt_iterator *bsi, tree stmt, bool update_eh_info)
-{
- int eh_region;
- tree orig_stmt = bsi_stmt (*bsi);
-
- if (stmt == orig_stmt)
- return;
- SET_EXPR_LOCUS (stmt, EXPR_LOCUS (orig_stmt));
- set_bb_for_stmt (stmt, bsi->bb);
-
- /* Preserve EH region information from the original statement, if
- requested by the caller. */
- if (update_eh_info)
- {
- eh_region = lookup_stmt_eh_region (orig_stmt);
- if (eh_region >= 0)
- {
- remove_stmt_from_eh_region (orig_stmt);
- add_stmt_to_eh_region (stmt, eh_region);
- }
- }
-
- gimple_duplicate_stmt_histograms (cfun, stmt, cfun, orig_stmt);
- gimple_remove_stmt_histograms (cfun, orig_stmt);
- delink_stmt_imm_use (orig_stmt);
- *bsi_stmt_ptr (*bsi) = stmt;
- mark_stmt_modified (stmt);
- update_modified_stmts (stmt);
-}
-
-
-/* Insert the statement pointed-to by BSI into edge E. Every attempt
- is made to place the statement in an existing basic block, but
- sometimes that isn't possible. When it isn't possible, the edge is
- split and the statement is added to the new block.
-
- In all cases, the returned *BSI points to the correct location. The
- return value is true if insertion should be done after the location,
- or false if it should be done before the location. If new basic block
- has to be created, it is stored in *NEW_BB. */
-
-static bool
-tree_find_edge_insert_loc (edge e, block_stmt_iterator *bsi,
- basic_block *new_bb)
-{
- basic_block dest, src;
- tree tmp;
-
- dest = e->dest;
- restart:
-
- /* If the destination has one predecessor which has no PHI nodes,
- insert there. Except for the exit block.
-
- The requirement for no PHI nodes could be relaxed. Basically we
- would have to examine the PHIs to prove that none of them used
- the value set by the statement we want to insert on E. That
- hardly seems worth the effort. */
- if (single_pred_p (dest)
- && ! phi_nodes (dest)
- && dest != EXIT_BLOCK_PTR)
- {
- *bsi = bsi_start (dest);
- if (bsi_end_p (*bsi))
- return true;
-
- /* Make sure we insert after any leading labels. */
- tmp = bsi_stmt (*bsi);
- while (TREE_CODE (tmp) == LABEL_EXPR)
- {
- bsi_next (bsi);
- if (bsi_end_p (*bsi))
- break;
- tmp = bsi_stmt (*bsi);
- }
-
- if (bsi_end_p (*bsi))
- {
- *bsi = bsi_last (dest);
- return true;
- }
- else
- return false;
- }
-
- /* If the source has one successor, the edge is not abnormal and
- the last statement does not end a basic block, insert there.
- Except for the entry block. */
- src = e->src;
- if ((e->flags & EDGE_ABNORMAL) == 0
- && single_succ_p (src)
- && src != ENTRY_BLOCK_PTR)
- {
- *bsi = bsi_last (src);
- if (bsi_end_p (*bsi))
- return true;
-
- tmp = bsi_stmt (*bsi);
- if (!stmt_ends_bb_p (tmp))
- return true;
-
- /* Insert code just before returning the value. We may need to decompose
- the return in the case it contains non-trivial operand. */
- if (TREE_CODE (tmp) == RETURN_EXPR)
- {
- tree op = TREE_OPERAND (tmp, 0);
- if (op && !is_gimple_val (op))
- {
- gcc_assert (TREE_CODE (op) == GIMPLE_MODIFY_STMT);
- bsi_insert_before (bsi, op, BSI_NEW_STMT);
- TREE_OPERAND (tmp, 0) = GIMPLE_STMT_OPERAND (op, 0);
- }
- bsi_prev (bsi);
- return true;
- }
- }
-
- /* Otherwise, create a new basic block, and split this edge. */
- dest = split_edge (e);
- if (new_bb)
- *new_bb = dest;
- e = single_pred_edge (dest);
- goto restart;
-}
-
-
-/* This routine will commit all pending edge insertions, creating any new
- basic blocks which are necessary. */
-
-void
-bsi_commit_edge_inserts (void)
-{
- basic_block bb;
- edge e;
- edge_iterator ei;
-
- bsi_commit_one_edge_insert (single_succ_edge (ENTRY_BLOCK_PTR), NULL);
-
- FOR_EACH_BB (bb)
- FOR_EACH_EDGE (e, ei, bb->succs)
- bsi_commit_one_edge_insert (e, NULL);
-}
-
-
-/* Commit insertions pending at edge E. If a new block is created, set NEW_BB
- to this block, otherwise set it to NULL. */
-
-void
-bsi_commit_one_edge_insert (edge e, basic_block *new_bb)
-{
- if (new_bb)
- *new_bb = NULL;
- if (PENDING_STMT (e))
- {
- block_stmt_iterator bsi;
- tree stmt = PENDING_STMT (e);
-
- PENDING_STMT (e) = NULL_TREE;
-
- if (tree_find_edge_insert_loc (e, &bsi, new_bb))
- bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
- else
- bsi_insert_before (&bsi, stmt, BSI_NEW_STMT);
- }
-}
-
-
-/* Add STMT to the pending list of edge E. No actual insertion is
- made until a call to bsi_commit_edge_inserts () is made. */
-
-void
-bsi_insert_on_edge (edge e, tree stmt)
-{
- append_to_statement_list (stmt, &PENDING_STMT (e));
-}
-
-/* Similar to bsi_insert_on_edge+bsi_commit_edge_inserts. If a new
- block has to be created, it is returned. */
-
-basic_block
-bsi_insert_on_edge_immediate (edge e, tree stmt)
-{
- block_stmt_iterator bsi;
- basic_block new_bb = NULL;
-
- gcc_assert (!PENDING_STMT (e));
-
- if (tree_find_edge_insert_loc (e, &bsi, &new_bb))
- bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
- else
- bsi_insert_before (&bsi, stmt, BSI_NEW_STMT);
-
- return new_bb;
+ return NULL;
}
-/*---------------------------------------------------------------------------
- Tree specific functions for CFG manipulation
----------------------------------------------------------------------------*/
-
/* Reinstall those PHI arguments queued in OLD_EDGE to NEW_EDGE. */
static void
reinstall_phi_args (edge new_edge, edge old_edge)
{
- tree phi;
edge_var_map_vector v;
edge_var_map *vm;
int i;
-
+ gimple_stmt_iterator phis;
+
v = redirect_edge_var_map_vector (old_edge);
if (!v)
return;
-
- for (i = 0, phi = phi_nodes (new_edge->dest);
- VEC_iterate (edge_var_map, v, i, vm) && phi;
- i++, phi = PHI_CHAIN (phi))
+
+ for (i = 0, phis = gsi_start_phis (new_edge->dest);
+ VEC_iterate (edge_var_map, v, i, vm) && !gsi_end_p (phis);
+ i++, gsi_next (&phis))
{
+ gimple phi = gsi_stmt (phis);
tree result = redirect_edge_var_map_result (vm);
tree arg = redirect_edge_var_map_def (vm);
-
- gcc_assert (result == PHI_RESULT (phi));
-
+
+ gcc_assert (result == gimple_phi_result (phi));
+
add_phi_arg (phi, arg, new_edge);
}
-
+
redirect_edge_var_map_clear (old_edge);
}
@@ -3131,7 +2734,7 @@ split_edge_bb_loc (edge edge_in)
Abort on abnormal edges. */
static basic_block
-tree_split_edge (edge edge_in)
+gimple_split_edge (edge edge_in)
{
basic_block new_bb, after_bb, dest;
edge new_edge, e;
@@ -3194,10 +2797,7 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
break;
case MODIFY_EXPR:
- gcc_unreachable ();
-
- case GIMPLE_MODIFY_STMT:
- x = GIMPLE_STMT_OPERAND (t, 0);
+ x = TREE_OPERAND (t, 0);
if (TREE_CODE (x) == BIT_FIELD_REF
&& is_gimple_reg (TREE_OPERAND (x, 0)))
{
@@ -3420,74 +3020,12 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
#undef CHECK_OP
}
-/* Verifies if EXPR is a valid GIMPLE unary expression. Returns true
- if there is an error, otherwise false. */
-
-static bool
-verify_gimple_unary_expr (const_tree expr)
-{
- tree op = TREE_OPERAND (expr, 0);
- tree type = TREE_TYPE (expr);
-
- if (!is_gimple_val (op))
- {
- error ("invalid operand in unary expression");
- return true;
- }
-
- /* For general unary expressions we have the operations type
- as the effective type the operation is carried out on. So all
- we need to require is that the operand is trivially convertible
- to that type. */
- if (!useless_type_conversion_p (type, TREE_TYPE (op)))
- {
- error ("type mismatch in unary expression");
- debug_generic_expr (type);
- debug_generic_expr (TREE_TYPE (op));
- return true;
- }
-
- return false;
-}
-
-/* Verifies if EXPR is a valid GIMPLE binary expression. Returns true
- if there is an error, otherwise false. */
-
-static bool
-verify_gimple_binary_expr (const_tree expr)
-{
- tree op0 = TREE_OPERAND (expr, 0);
- tree op1 = TREE_OPERAND (expr, 1);
- tree type = TREE_TYPE (expr);
-
- if (!is_gimple_val (op0) || !is_gimple_val (op1))
- {
- error ("invalid operands in binary expression");
- return true;
- }
-
- /* For general binary expressions we have the operations type
- as the effective type the operation is carried out on. So all
- we need to require is that both operands are trivially convertible
- to that type. */
- if (!useless_type_conversion_p (type, TREE_TYPE (op0))
- || !useless_type_conversion_p (type, TREE_TYPE (op1)))
- {
- error ("type mismatch in binary expression");
- debug_generic_stmt (type);
- debug_generic_stmt (TREE_TYPE (op0));
- debug_generic_stmt (TREE_TYPE (op1));
- return true;
- }
-
- return false;
-}
/* Verify if EXPR is either a GIMPLE ID or a GIMPLE indirect reference.
Returns true if there is an error, otherwise false. */
static bool
-verify_gimple_min_lval (tree expr)
+verify_types_in_gimple_min_lval (tree expr)
{
tree op;
@@ -3525,7 +3063,7 @@ verify_gimple_min_lval (tree expr)
if there is an error, otherwise false. */
static bool
-verify_gimple_reference (tree expr)
+verify_types_in_gimple_reference (tree expr)
{
while (handled_component_p (expr))
{
@@ -3594,7 +3132,7 @@ verify_gimple_reference (tree expr)
expr = op;
}
- return verify_gimple_min_lval (expr);
+ return verify_types_in_gimple_min_lval (expr);
}
/* Returns true if there is one pointer type in TYPE_POINTER_TO (SRC_OBJ)
@@ -3627,59 +3165,123 @@ valid_fixed_convert_types_p (tree type1, tree type2)
|| FIXED_POINT_TYPE_P (type2)));
}
-/* Verify the GIMPLE expression EXPR. Returns true if there is an
- error, otherwise false. */
+/* Verify that OP is a valid GIMPLE operand. Return true if there is
+ an error, false otherwise. */
static bool
-verify_gimple_expr (tree expr)
+verify_types_in_gimple_op (tree op)
{
- tree type = TREE_TYPE (expr);
+ if (!is_gimple_val (op) && !is_gimple_lvalue (op))
+ {
+ error ("Invalid GIMPLE operand");
+ debug_generic_expr (op);
+ return true;
+ }
- if (is_gimple_val (expr))
- return false;
+ return false;
+}
+
+
+/* Verify the contents of a GIMPLE_CALL STMT. Returns true when there
+ is a problem, otherwise false. */
+
+static bool
+verify_types_in_gimple_call (gimple stmt)
+{
+ bool failed = false;
+ unsigned int i;
+ tree fn;
+
+ if (gimple_call_lhs (stmt))
+ failed |= verify_types_in_gimple_op (gimple_call_lhs (stmt));
+
+ fn = gimple_call_fn (stmt);
+ if (TREE_CODE (fn) != OBJ_TYPE_REF
+ && verify_types_in_gimple_op (fn))
+ failed = true;
+
+ if (gimple_call_chain (stmt))
+ failed |= verify_types_in_gimple_op (gimple_call_chain (stmt));
+
+ for (i = 0; i < gimple_call_num_args (stmt); i++)
+ failed |= verify_types_in_gimple_op (gimple_call_arg (stmt,i));
+
+ return failed;
+}
+
+
+/* Verify the contents of a GIMPLE_COND STMT. Returns true when there
+ is a problem, otherwise false. */
+
+static bool
+verify_types_in_gimple_cond (gimple stmt)
+{
+ bool failed = false;
+
+ failed |= verify_types_in_gimple_op (gimple_cond_lhs (stmt));
+ failed |= verify_types_in_gimple_op (gimple_cond_rhs (stmt));
+ failed |= verify_types_in_gimple_op (gimple_cond_true_label (stmt));
+ failed |= verify_types_in_gimple_op (gimple_cond_false_label (stmt));
+
+ return failed;
+}
+
+
+/* Verify the contents of a GIMPLE_ASSIGN STMT. Returns true when there
+ is a problem, otherwise false.
+
+ Verify that the types of the LHS and the RHS operands are
+ compatible. This verification largely depends on what kind of
+ operation is done on the RHS of the assignment. It is not always
+ the case that all the types of the operands must match (e.g., 'a =
+ (unsigned long) b' or 'ptr = ptr + 1'). */
+
+static bool
+verify_types_in_gimple_assign (gimple stmt)
+{
+ enum tree_code rhs_code = gimple_assign_rhs_code (stmt);
+ tree lhs = gimple_assign_lhs (stmt);
+ tree rhs1 = gimple_assign_rhs1 (stmt);
+ tree rhs2 = (gimple_num_ops (stmt) == 3) ? gimple_assign_rhs2 (stmt) : NULL;
+ tree lhs_type = TREE_TYPE (lhs);
+ tree rhs1_type = TREE_TYPE (rhs1);
+ tree rhs2_type = (rhs2) ? TREE_TYPE (rhs2) : NULL;
/* Special codes we cannot handle via their class. */
- switch (TREE_CODE (expr))
+ switch (rhs_code)
{
CASE_CONVERT:
{
- tree op = TREE_OPERAND (expr, 0);
- if (!is_gimple_val (op))
+ if (!is_gimple_val (rhs1))
{
error ("invalid operand in conversion");
return true;
}
- /* Allow conversions between integral types and between
- pointer types. */
- if ((INTEGRAL_TYPE_P (type) && INTEGRAL_TYPE_P (TREE_TYPE (op)))
- || (POINTER_TYPE_P (type) && POINTER_TYPE_P (TREE_TYPE (op))))
- return false;
-
/* Allow conversions between integral types and pointers only if
there is no sign or zero extension involved. */
- if (((POINTER_TYPE_P (type) && INTEGRAL_TYPE_P (TREE_TYPE (op)))
- || (POINTER_TYPE_P (TREE_TYPE (op)) && INTEGRAL_TYPE_P (type)))
- && (TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (op))
+ if (((POINTER_TYPE_P (lhs_type) && INTEGRAL_TYPE_P (rhs1_type))
+ || (POINTER_TYPE_P (rhs1_type) && INTEGRAL_TYPE_P (lhs_type)))
+ && (TYPE_PRECISION (lhs_type) == TYPE_PRECISION (rhs1_type)
/* For targets were the precision of sizetype doesn't
match that of pointers we need the following. */
- || type == sizetype || TREE_TYPE (op) == sizetype))
+ || lhs_type == sizetype || rhs1_type == sizetype))
return false;
/* Allow conversion from integer to offset type and vice versa. */
- if ((TREE_CODE (type) == OFFSET_TYPE
- && TREE_CODE (TREE_TYPE (op)) == INTEGER_TYPE)
- || (TREE_CODE (type) == INTEGER_TYPE
- && TREE_CODE (TREE_TYPE (op)) == OFFSET_TYPE))
+ if ((TREE_CODE (lhs_type) == OFFSET_TYPE
+ && TREE_CODE (rhs1_type) == INTEGER_TYPE)
+ || (TREE_CODE (lhs_type) == INTEGER_TYPE
+ && TREE_CODE (rhs1_type) == OFFSET_TYPE))
return false;
/* Otherwise assert we are converting between types of the
same kind. */
- if (TREE_CODE (type) != TREE_CODE (TREE_TYPE (op)))
+ if (INTEGRAL_TYPE_P (lhs_type) != INTEGRAL_TYPE_P (rhs1_type))
{
error ("invalid types in nop conversion");
- debug_generic_expr (type);
- debug_generic_expr (TREE_TYPE (op));
+ debug_generic_expr (lhs_type);
+ debug_generic_expr (rhs1_type);
return true;
}
@@ -3688,19 +3290,18 @@ verify_gimple_expr (tree expr)
case FIXED_CONVERT_EXPR:
{
- tree op = TREE_OPERAND (expr, 0);
- if (!is_gimple_val (op))
+ if (!is_gimple_val (rhs1))
{
error ("invalid operand in conversion");
return true;
}
- if (!valid_fixed_convert_types_p (type, TREE_TYPE (op))
- && !valid_fixed_convert_types_p (TREE_TYPE (op), type))
+ if (!valid_fixed_convert_types_p (lhs_type, rhs1_type)
+ && !valid_fixed_convert_types_p (rhs1_type, lhs_type))
{
error ("invalid types in fixed-point conversion");
- debug_generic_expr (type);
- debug_generic_expr (TREE_TYPE (op));
+ debug_generic_expr (lhs_type);
+ debug_generic_expr (rhs1_type);
return true;
}
@@ -3709,79 +3310,70 @@ verify_gimple_expr (tree expr)
case FLOAT_EXPR:
{
- tree op = TREE_OPERAND (expr, 0);
- if (!is_gimple_val (op))
+ if (!is_gimple_val (rhs1))
{
error ("invalid operand in int to float conversion");
return true;
}
- if (!INTEGRAL_TYPE_P (TREE_TYPE (op))
- || !SCALAR_FLOAT_TYPE_P (type))
+
+ if (!INTEGRAL_TYPE_P (rhs1_type) || !SCALAR_FLOAT_TYPE_P (lhs_type))
{
error ("invalid types in conversion to floating point");
- debug_generic_expr (type);
- debug_generic_expr (TREE_TYPE (op));
+ debug_generic_expr (lhs_type);
+ debug_generic_expr (rhs1_type);
return true;
}
+
return false;
}
case FIX_TRUNC_EXPR:
{
- tree op = TREE_OPERAND (expr, 0);
- if (!is_gimple_val (op))
+ if (!is_gimple_val (rhs1))
{
error ("invalid operand in float to int conversion");
return true;
}
- if (!INTEGRAL_TYPE_P (type)
- || !SCALAR_FLOAT_TYPE_P (TREE_TYPE (op)))
+
+ if (!INTEGRAL_TYPE_P (lhs_type) || !SCALAR_FLOAT_TYPE_P (rhs1_type))
{
error ("invalid types in conversion to integer");
- debug_generic_expr (type);
- debug_generic_expr (TREE_TYPE (op));
+ debug_generic_expr (lhs_type);
+ debug_generic_expr (rhs1_type);
return true;
}
+
return false;
}
case COMPLEX_EXPR:
{
- tree op0 = TREE_OPERAND (expr, 0);
- tree op1 = TREE_OPERAND (expr, 1);
- if (!is_gimple_val (op0) || !is_gimple_val (op1))
+ if (!is_gimple_val (rhs1) || !is_gimple_val (rhs2))
{
error ("invalid operands in complex expression");
return true;
}
- if (!TREE_CODE (type) == COMPLEX_TYPE
- || !(TREE_CODE (TREE_TYPE (op0)) == INTEGER_TYPE
- || SCALAR_FLOAT_TYPE_P (TREE_TYPE (op0)))
- || !(TREE_CODE (TREE_TYPE (op1)) == INTEGER_TYPE
- || SCALAR_FLOAT_TYPE_P (TREE_TYPE (op1)))
- || !useless_type_conversion_p (TREE_TYPE (type),
- TREE_TYPE (op0))
- || !useless_type_conversion_p (TREE_TYPE (type),
- TREE_TYPE (op1)))
+
+ if (!TREE_CODE (lhs_type) == COMPLEX_TYPE
+ || !(TREE_CODE (rhs1_type) == INTEGER_TYPE
+ || SCALAR_FLOAT_TYPE_P (rhs1_type))
+ || !(TREE_CODE (rhs2_type) == INTEGER_TYPE
+ || SCALAR_FLOAT_TYPE_P (rhs2_type)))
{
error ("type mismatch in complex expression");
- debug_generic_stmt (TREE_TYPE (expr));
- debug_generic_stmt (TREE_TYPE (op0));
- debug_generic_stmt (TREE_TYPE (op1));
+ debug_generic_expr (lhs_type);
+ debug_generic_expr (rhs1_type);
+ debug_generic_expr (rhs2_type);
return true;
}
+
return false;
}
case CONSTRUCTOR:
{
- /* This is used like COMPLEX_EXPR but for vectors. */
- if (TREE_CODE (type) != VECTOR_TYPE)
- {
- error ("constructor not allowed for non-vector types");
- debug_generic_stmt (type);
- return true;
- }
+ /* In this context we know that we are on the RHS of an
+ assignment, so CONSTRUCTOR operands are OK. */
/* FIXME: verify constructor arguments. */
return false;
}
@@ -3791,113 +3383,83 @@ verify_gimple_expr (tree expr)
case LROTATE_EXPR:
case RROTATE_EXPR:
{
- tree op0 = TREE_OPERAND (expr, 0);
- tree op1 = TREE_OPERAND (expr, 1);
- if (!is_gimple_val (op0) || !is_gimple_val (op1))
+ if (!is_gimple_val (rhs1) || !is_gimple_val (rhs2))
{
error ("invalid operands in shift expression");
return true;
}
- if (!TREE_CODE (TREE_TYPE (op1)) == INTEGER_TYPE
- || !useless_type_conversion_p (type, TREE_TYPE (op0)))
+
+ if (!TREE_CODE (rhs1_type) == INTEGER_TYPE
+ || !useless_type_conversion_p (lhs_type, rhs1_type))
{
error ("type mismatch in shift expression");
- debug_generic_stmt (TREE_TYPE (expr));
- debug_generic_stmt (TREE_TYPE (op0));
- debug_generic_stmt (TREE_TYPE (op1));
+ debug_generic_expr (lhs_type);
+ debug_generic_expr (rhs1_type);
+ debug_generic_expr (rhs2_type);
return true;
}
+
return false;
}
case PLUS_EXPR:
case MINUS_EXPR:
{
- tree op0 = TREE_OPERAND (expr, 0);
- tree op1 = TREE_OPERAND (expr, 1);
- if (POINTER_TYPE_P (type)
- || POINTER_TYPE_P (TREE_TYPE (op0))
- || POINTER_TYPE_P (TREE_TYPE (op1)))
+ if (POINTER_TYPE_P (lhs_type)
+ || POINTER_TYPE_P (rhs1_type)
+ || POINTER_TYPE_P (rhs2_type))
{
error ("invalid (pointer) operands to plus/minus");
return true;
}
+
/* Continue with generic binary expression handling. */
break;
}
case POINTER_PLUS_EXPR:
{
- tree op0 = TREE_OPERAND (expr, 0);
- tree op1 = TREE_OPERAND (expr, 1);
- if (!is_gimple_val (op0) || !is_gimple_val (op1))
+ if (!is_gimple_val (rhs1) || !is_gimple_val (rhs2))
{
error ("invalid operands in pointer plus expression");
return true;
}
- if (!POINTER_TYPE_P (TREE_TYPE (op0))
- || !useless_type_conversion_p (type, TREE_TYPE (op0))
- || !useless_type_conversion_p (sizetype, TREE_TYPE (op1)))
+ if (!POINTER_TYPE_P (rhs1_type)
+ || !useless_type_conversion_p (lhs_type, rhs1_type)
+ || !useless_type_conversion_p (sizetype, rhs2_type))
{
error ("type mismatch in pointer plus expression");
- debug_generic_stmt (type);
- debug_generic_stmt (TREE_TYPE (op0));
- debug_generic_stmt (TREE_TYPE (op1));
+ debug_generic_stmt (lhs_type);
+ debug_generic_stmt (rhs1_type);
+ debug_generic_stmt (rhs2_type);
return true;
}
- return false;
- }
- case COND_EXPR:
- {
- tree op0 = TREE_OPERAND (expr, 0);
- tree op1 = TREE_OPERAND (expr, 1);
- tree op2 = TREE_OPERAND (expr, 2);
- if ((!is_gimple_val (op1)
- && TREE_CODE (TREE_TYPE (op1)) != VOID_TYPE)
- || (!is_gimple_val (op2)
- && TREE_CODE (TREE_TYPE (op2)) != VOID_TYPE))
- {
- error ("invalid operands in conditional expression");
- return true;
- }
- if (!INTEGRAL_TYPE_P (TREE_TYPE (op0))
- || (TREE_CODE (TREE_TYPE (op1)) != VOID_TYPE
- && !useless_type_conversion_p (type, TREE_TYPE (op1)))
- || (TREE_CODE (TREE_TYPE (op2)) != VOID_TYPE
- && !useless_type_conversion_p (type, TREE_TYPE (op2))))
- {
- error ("type mismatch in conditional expression");
- debug_generic_stmt (type);
- debug_generic_stmt (TREE_TYPE (op0));
- debug_generic_stmt (TREE_TYPE (op1));
- debug_generic_stmt (TREE_TYPE (op2));
- return true;
- }
- return verify_gimple_expr (op0);
- }
+ return false;
+ }
case ADDR_EXPR:
{
- tree op = TREE_OPERAND (expr, 0);
+ tree op = TREE_OPERAND (rhs1, 0);
if (!is_gimple_addressable (op))
{
error ("invalid operand in unary expression");
return true;
}
- if (!one_pointer_to_useless_type_conversion_p (type, TREE_TYPE (op))
+
+ if (!one_pointer_to_useless_type_conversion_p (lhs_type, TREE_TYPE (op))
/* FIXME: a longstanding wart, &a == &a[0]. */
&& (TREE_CODE (TREE_TYPE (op)) != ARRAY_TYPE
- || !one_pointer_to_useless_type_conversion_p (type,
+ || !one_pointer_to_useless_type_conversion_p (lhs_type,
TREE_TYPE (TREE_TYPE (op)))))
{
error ("type mismatch in address expression");
- debug_generic_stmt (TREE_TYPE (expr));
+ debug_generic_stmt (lhs_type);
debug_generic_stmt (TYPE_POINTER_TO (TREE_TYPE (op)));
return true;
}
- return verify_gimple_reference (op);
+ return verify_types_in_gimple_reference (TREE_OPERAND (rhs1, 0));
}
case TRUTH_ANDIF_EXPR:
@@ -3908,24 +3470,21 @@ verify_gimple_expr (tree expr)
case TRUTH_OR_EXPR:
case TRUTH_XOR_EXPR:
{
- tree op0 = TREE_OPERAND (expr, 0);
- tree op1 = TREE_OPERAND (expr, 1);
-
- if (!is_gimple_val (op0) || !is_gimple_val (op1))
+ if (!is_gimple_val (rhs1) || !is_gimple_val (rhs2))
{
error ("invalid operands in truth expression");
return true;
}
/* We allow any kind of integral typed argument and result. */
- if (!INTEGRAL_TYPE_P (TREE_TYPE (op0))
- || !INTEGRAL_TYPE_P (TREE_TYPE (op1))
- || !INTEGRAL_TYPE_P (type))
+ if (!INTEGRAL_TYPE_P (rhs1_type)
+ || !INTEGRAL_TYPE_P (rhs2_type)
+ || !INTEGRAL_TYPE_P (lhs_type))
{
error ("type mismatch in binary truth expression");
- debug_generic_stmt (type);
- debug_generic_stmt (TREE_TYPE (op0));
- debug_generic_stmt (TREE_TYPE (op1));
+ debug_generic_expr (lhs_type);
+ debug_generic_expr (rhs1_type);
+ debug_generic_expr (rhs2_type);
return true;
}
@@ -3934,9 +3493,7 @@ verify_gimple_expr (tree expr)
case TRUTH_NOT_EXPR:
{
- tree op = TREE_OPERAND (expr, 0);
-
- if (!is_gimple_val (op))
+ if (!is_gimple_val (rhs1))
{
error ("invalid operand in unary not");
return true;
@@ -3944,33 +3501,37 @@ verify_gimple_expr (tree expr)
/* For TRUTH_NOT_EXPR we can have any kind of integral
typed arguments and results. */
- if (!INTEGRAL_TYPE_P (TREE_TYPE (op))
- || !INTEGRAL_TYPE_P (type))
+ if (!INTEGRAL_TYPE_P (rhs1_type)
+ || !INTEGRAL_TYPE_P (lhs_type))
{
error ("type mismatch in not expression");
- debug_generic_expr (TREE_TYPE (expr));
- debug_generic_expr (TREE_TYPE (op));
+ debug_generic_expr (lhs_type);
+ debug_generic_expr (rhs1_type);
return true;
}
return false;
}
+ /* After gimplification we should not have any of these. */
+ case ASM_EXPR:
+ case BIND_EXPR:
case CALL_EXPR:
- /* FIXME. The C frontend passes unpromoted arguments in case it
- didn't see a function declaration before the call. */
+ case COND_EXPR:
+ case TREE_LIST:
+ case COMPOUND_EXPR:
+ case MODIFY_EXPR:
+ case INIT_EXPR:
+ case GOTO_EXPR:
+ case LABEL_EXPR:
+ case RETURN_EXPR:
+ case TRY_FINALLY_EXPR:
+ case TRY_CATCH_EXPR:
+ case EH_FILTER_EXPR:
+ case STATEMENT_LIST:
{
- tree decl = CALL_EXPR_FN (expr);
-
- if (TREE_CODE (decl) == FUNCTION_DECL
- && DECL_LOOPING_CONST_OR_PURE_P (decl)
- && (!DECL_PURE_P (decl))
- && (!TREE_READONLY (decl)))
- {
- error ("invalid pure const state for function");
- return true;
- }
- return false;
+ error ("tree node that should already be gimple.");
+ return true;
}
case OBJ_TYPE_REF:
@@ -3981,26 +3542,39 @@ verify_gimple_expr (tree expr)
}
/* Generic handling via classes. */
- switch (TREE_CODE_CLASS (TREE_CODE (expr)))
+ switch (TREE_CODE_CLASS (rhs_code))
{
+ case tcc_exceptional: /* for SSA_NAME */
case tcc_unary:
- return verify_gimple_unary_expr (expr);
-
- case tcc_binary:
- return verify_gimple_binary_expr (expr);
+ 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;
+ }
+ break;
case tcc_reference:
- return verify_gimple_reference (expr);
+ /* 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:
{
- tree op0 = TREE_OPERAND (expr, 0);
- tree op1 = TREE_OPERAND (expr, 1);
- if (!is_gimple_val (op0) || !is_gimple_val (op1))
+ if (!is_gimple_val (rhs1) || !is_gimple_val (rhs2))
{
error ("invalid operands in comparison expression");
return true;
}
+
/* For comparisons we do not have the operations type as the
effective type the comparison is carried out in. Instead
we require that either the first operand is trivially
@@ -4008,186 +3582,196 @@ verify_gimple_expr (tree expr)
The resulting type of a comparison may be any integral type.
Because we special-case pointers to void we allow
comparisons of pointers with the same mode as well. */
- if ((!useless_type_conversion_p (TREE_TYPE (op0), TREE_TYPE (op1))
- && !useless_type_conversion_p (TREE_TYPE (op1), TREE_TYPE (op0))
- && (!POINTER_TYPE_P (TREE_TYPE (op0))
- || !POINTER_TYPE_P (TREE_TYPE (op1))
- || TYPE_MODE (TREE_TYPE (op0)) != TYPE_MODE (TREE_TYPE (op1))))
- || !INTEGRAL_TYPE_P (type))
+ if ((!useless_type_conversion_p (rhs1_type, rhs2_type)
+ && !useless_type_conversion_p (rhs2_type, rhs1_type)
+ && (!POINTER_TYPE_P (rhs1_type)
+ || !POINTER_TYPE_P (rhs2_type)
+ || TYPE_MODE (rhs1_type) != TYPE_MODE (rhs2_type)))
+ || !INTEGRAL_TYPE_P (lhs_type))
{
error ("type mismatch in comparison expression");
- debug_generic_stmt (TREE_TYPE (expr));
- debug_generic_stmt (TREE_TYPE (op0));
- debug_generic_stmt (TREE_TYPE (op1));
+ debug_generic_expr (lhs_type);
+ debug_generic_expr (rhs1_type);
+ debug_generic_expr (rhs2_type);
return true;
}
break;
}
- default:
- gcc_unreachable ();
+ default:;
}
return false;
}
-/* Verify the GIMPLE assignment statement STMT. Returns true if there
- is an error, otherwise false. */
+
+/* Verify the contents of a GIMPLE_RETURN STMT. Returns true when there
+ is a problem, otherwise false. */
static bool
-verify_gimple_modify_stmt (const_tree stmt)
+verify_types_in_gimple_return (gimple stmt)
{
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ tree op = gimple_return_retval (stmt);
- gcc_assert (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT);
+ if (op == NULL)
+ return false;
+
+ return verify_types_in_gimple_op (op);
+}
- if (!useless_type_conversion_p (TREE_TYPE (lhs),
- TREE_TYPE (rhs)))
+
+/* Verify the contents of a GIMPLE_SWITCH STMT. Returns true when there
+ is a problem, otherwise false. */
+
+static bool
+verify_types_in_gimple_switch (gimple stmt)
+{
+ if (!is_gimple_val (gimple_switch_index (stmt)))
{
- error ("non-trivial conversion at assignment");
- debug_generic_expr (TREE_TYPE (lhs));
- debug_generic_expr (TREE_TYPE (rhs));
+ error ("invalid operand to switch statement");
+ debug_generic_expr (gimple_switch_index (stmt));
return true;
}
- /* Loads/stores from/to a variable are ok. */
- if ((is_gimple_val (lhs)
- && is_gimple_variable (rhs))
- || (is_gimple_val (rhs)
- && is_gimple_variable (lhs)))
- return false;
+ return false;
+}
- /* Aggregate copies are ok. */
- if (!is_gimple_reg_type (TREE_TYPE (lhs))
- && !is_gimple_reg_type (TREE_TYPE (rhs)))
- return false;
- /* We might get 'loads' from a parameter which is not a gimple value. */
- if (TREE_CODE (rhs) == PARM_DECL)
- return verify_gimple_expr (lhs);
+/* Verify the contents of a GIMPLE_PHI. Returns true if there is a problem,
+ and false otherwise. */
- if (!is_gimple_variable (lhs)
- && verify_gimple_expr (lhs))
- return true;
+static bool
+verify_types_in_gimple_phi (gimple stmt)
+{
+ size_t i;
- if (!is_gimple_variable (rhs)
- && verify_gimple_expr (rhs))
+ if (verify_types_in_gimple_op (gimple_phi_result (stmt)))
return true;
+ for (i = 0; i < gimple_phi_num_args (stmt); i++)
+ if (verify_types_in_gimple_op (gimple_phi_arg_def (stmt, i)))
+ return true;
+
return false;
}
+
/* Verify the GIMPLE statement STMT. Returns true if there is an
error, otherwise false. */
static bool
-verify_gimple_stmt (tree stmt)
+verify_types_in_gimple_stmt (gimple stmt)
{
- if (!is_gimple_stmt (stmt))
- {
- error ("is not a valid GIMPLE statement");
- return true;
- }
-
- if (OMP_DIRECTIVE_P (stmt))
+ if (is_gimple_omp (stmt))
{
/* OpenMP directives are validated by the FE and never operated
- on by the optimizers. Furthermore, OMP_FOR may contain
+ on by the optimizers. Furthermore, GIMPLE_OMP_FOR may contain
non-gimple expressions when the main index variable has had
its address taken. This does not affect the loop itself
- because the header of an OMP_FOR is merely used to determine
+ because the header of an GIMPLE_OMP_FOR is merely used to determine
how to setup the parallel iteration. */
return false;
}
- switch (TREE_CODE (stmt))
+ switch (gimple_code (stmt))
{
- case GIMPLE_MODIFY_STMT:
- return verify_gimple_modify_stmt (stmt);
+ case GIMPLE_ASSIGN:
+ return verify_types_in_gimple_assign (stmt);
- case GOTO_EXPR:
- case LABEL_EXPR:
- return false;
+ case GIMPLE_LABEL:
+ return TREE_CODE (gimple_label_label (stmt)) != LABEL_DECL;
- case SWITCH_EXPR:
- if (!is_gimple_val (TREE_OPERAND (stmt, 0)))
- {
- error ("invalid operand to switch statement");
- debug_generic_expr (TREE_OPERAND (stmt, 0));
- }
- return false;
+ case GIMPLE_CALL:
+ return verify_types_in_gimple_call (stmt);
- case RETURN_EXPR:
- {
- tree op = TREE_OPERAND (stmt, 0);
+ case GIMPLE_COND:
+ return verify_types_in_gimple_cond (stmt);
- if (TREE_CODE (TREE_TYPE (stmt)) != VOID_TYPE)
- {
- error ("type error in return expression");
- return true;
- }
+ case GIMPLE_GOTO:
+ return verify_types_in_gimple_op (gimple_goto_dest (stmt));
- if (op == NULL_TREE
- || TREE_CODE (op) == RESULT_DECL)
- return false;
+ case GIMPLE_NOP:
+ case GIMPLE_PREDICT:
+ return false;
- return verify_gimple_modify_stmt (op);
- }
+ case GIMPLE_SWITCH:
+ return verify_types_in_gimple_switch (stmt);
- case CALL_EXPR:
- case COND_EXPR:
- return verify_gimple_expr (stmt);
+ case GIMPLE_RETURN:
+ return verify_types_in_gimple_return (stmt);
- case NOP_EXPR:
- case CHANGE_DYNAMIC_TYPE_EXPR:
- case ASM_EXPR:
- case PREDICT_EXPR:
+ case GIMPLE_ASM:
return false;
+ case GIMPLE_CHANGE_DYNAMIC_TYPE:
+ return verify_types_in_gimple_op (gimple_cdt_location (stmt));
+
+ case GIMPLE_PHI:
+ return verify_types_in_gimple_phi (stmt);
+
default:
gcc_unreachable ();
}
}
-/* Verify the GIMPLE statements inside the statement list STMTS.
- Returns true if there were any errors. */
+/* Verify the GIMPLE statements inside the sequence STMTS. */
static bool
-verify_gimple_2 (tree stmts)
+verify_types_in_gimple_seq_2 (gimple_seq stmts)
{
- tree_stmt_iterator tsi;
+ gimple_stmt_iterator ittr;
bool err = false;
- for (tsi = tsi_start (stmts); !tsi_end_p (tsi); tsi_next (&tsi))
+ for (ittr = gsi_start (stmts); !gsi_end_p (ittr); gsi_next (&ittr))
{
- tree stmt = tsi_stmt (tsi);
-
- switch (TREE_CODE (stmt))
- {
- case BIND_EXPR:
- err |= verify_gimple_2 (BIND_EXPR_BODY (stmt));
- break;
-
- case TRY_CATCH_EXPR:
- case TRY_FINALLY_EXPR:
- err |= verify_gimple_2 (TREE_OPERAND (stmt, 0));
- err |= verify_gimple_2 (TREE_OPERAND (stmt, 1));
- break;
+ gimple stmt = gsi_stmt (ittr);
- case CATCH_EXPR:
- err |= verify_gimple_2 (CATCH_BODY (stmt));
- break;
-
- case EH_FILTER_EXPR:
- err |= verify_gimple_2 (EH_FILTER_FAILURE (stmt));
- break;
+ switch (gimple_code (stmt))
+ {
+ case GIMPLE_BIND:
+ err |= verify_types_in_gimple_seq_2 (gimple_bind_body (stmt));
+ break;
+
+ case GIMPLE_TRY:
+ err |= verify_types_in_gimple_seq_2 (gimple_try_eval (stmt));
+ err |= verify_types_in_gimple_seq_2 (gimple_try_cleanup (stmt));
+ break;
+
+ case GIMPLE_EH_FILTER:
+ err |= verify_types_in_gimple_seq_2
+ (gimple_eh_filter_failure (stmt));
+ break;
+
+ case GIMPLE_CATCH:
+ err |= verify_types_in_gimple_seq_2 (gimple_catch_handler (stmt));
+ break;
+
+ case GIMPLE_OMP_CRITICAL:
+ case GIMPLE_OMP_CONTINUE:
+ case GIMPLE_OMP_MASTER:
+ case GIMPLE_OMP_ORDERED:
+ case GIMPLE_OMP_SECTION:
+ case GIMPLE_OMP_FOR:
+ case GIMPLE_OMP_PARALLEL:
+ case GIMPLE_OMP_TASK:
+ case GIMPLE_OMP_SECTIONS:
+ case GIMPLE_OMP_SINGLE:
+ case GIMPLE_OMP_ATOMIC_STORE:
+ case GIMPLE_OMP_ATOMIC_LOAD:
+ break;
+
+ /* Tuples that do not have trees. */
+ case GIMPLE_NOP:
+ case GIMPLE_RESX:
+ case GIMPLE_OMP_RETURN:
+ case GIMPLE_PREDICT:
+ break;
default:
{
- bool err2 = verify_gimple_stmt (stmt);
+ bool err2 = verify_types_in_gimple_stmt (stmt);
if (err2)
- debug_generic_expr (stmt);
+ debug_gimple_stmt (stmt);
err |= err2;
}
}
@@ -4200,54 +3784,66 @@ verify_gimple_2 (tree stmts)
/* Verify the GIMPLE statements inside the statement list STMTS. */
void
-verify_gimple_1 (tree stmts)
+verify_types_in_gimple_seq (gimple_seq stmts)
{
- if (verify_gimple_2 (stmts))
+ if (verify_types_in_gimple_seq_2 (stmts))
internal_error ("verify_gimple failed");
}
-/* Verify the GIMPLE statements inside the current function. */
-
-void
-verify_gimple (void)
-{
- verify_gimple_1 (BIND_EXPR_BODY (DECL_SAVED_TREE (cfun->decl)));
-}
/* Verify STMT, return true if STMT is not in GIMPLE form.
TODO: Implement type checking. */
static bool
-verify_stmt (tree stmt, bool last_in_block)
+verify_stmt (gimple_stmt_iterator *gsi)
{
tree addr;
+ struct walk_stmt_info wi;
+ bool last_in_block = gsi_one_before_end_p (*gsi);
+ gimple stmt = gsi_stmt (*gsi);
- if (OMP_DIRECTIVE_P (stmt))
+ if (is_gimple_omp (stmt))
{
/* OpenMP directives are validated by the FE and never operated
- on by the optimizers. Furthermore, OMP_FOR may contain
+ on by the optimizers. Furthermore, GIMPLE_OMP_FOR may contain
non-gimple expressions when the main index variable has had
its address taken. This does not affect the loop itself
- because the header of an OMP_FOR is merely used to determine
+ because the header of an GIMPLE_OMP_FOR is merely used to determine
how to setup the parallel iteration. */
return false;
}
- if (!is_gimple_stmt (stmt))
+ /* FIXME. The C frontend passes unpromoted arguments in case it
+ didn't see a function declaration before the call. */
+ if (is_gimple_call (stmt))
{
- error ("is not a valid GIMPLE statement");
- goto fail;
+ tree decl;
+
+ if (!is_gimple_call_addr (gimple_call_fn (stmt)))
+ {
+ error ("invalid function in call statement");
+ return true;
+ }
+
+ 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)))
+ {
+ error ("invalid pure const state for function");
+ return true;
+ }
}
- addr = walk_tree (&stmt, verify_expr, NULL, NULL);
+ memset (&wi, 0, sizeof (wi));
+ addr = walk_gimple_op (gsi_stmt (*gsi), verify_expr, &wi);
if (addr)
{
- debug_generic_stmt (addr);
- if (addr != stmt)
- {
- inform ("in statement");
- debug_generic_stmt (stmt);
- }
+ debug_generic_expr (addr);
+ inform (input_location, "in statement");
+ debug_gimple_stmt (stmt);
return true;
}
@@ -4258,12 +3854,12 @@ verify_stmt (tree stmt, bool last_in_block)
to match. */
if (lookup_stmt_eh_region (stmt) >= 0)
{
- if (!tree_could_throw_p (stmt))
+ if (!stmt_could_throw_p (stmt))
{
error ("statement marked for throw, but doesn%'t");
goto fail;
}
- if (!last_in_block && tree_can_throw_internal (stmt))
+ if (!last_in_block && stmt_can_throw_internal (stmt))
{
error ("statement marked for throw in middle of block");
goto fail;
@@ -4273,7 +3869,7 @@ verify_stmt (tree stmt, bool last_in_block)
return false;
fail:
- debug_generic_stmt (stmt);
+ debug_gimple_stmt (stmt);
return true;
}
@@ -4307,12 +3903,13 @@ tree_node_can_be_shared (tree t)
}
-/* Called via walk_trees. Verify tree sharing. */
+/* Called via walk_gimple_stmt. Verify tree sharing. */
static tree
-verify_node_sharing (tree * tp, int *walk_subtrees, void *data)
+verify_node_sharing (tree *tp, int *walk_subtrees, void *data)
{
- struct pointer_set_t *visited = (struct pointer_set_t *) data;
+ struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
+ struct pointer_set_t *visited = (struct pointer_set_t *) wi->info;
if (tree_node_can_be_shared (*tp))
{
@@ -4327,35 +3924,6 @@ verify_node_sharing (tree * tp, int *walk_subtrees, void *data)
}
-/* Helper function for verify_gimple_tuples. */
-
-static tree
-verify_gimple_tuples_1 (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
- void *data ATTRIBUTE_UNUSED)
-{
- switch (TREE_CODE (*tp))
- {
- case MODIFY_EXPR:
- error ("unexpected non-tuple");
- debug_tree (*tp);
- gcc_unreachable ();
- return NULL_TREE;
-
- default:
- return NULL_TREE;
- }
-}
-
-/* Verify that there are no trees that should have been converted to
- gimple tuples. Return true if T contains a node that should have
- been converted to a gimple tuple, but hasn't. */
-
-static bool
-verify_gimple_tuples (tree t)
-{
- return walk_tree (&t, verify_gimple_tuples_1, NULL, NULL) != NULL;
-}
-
static bool eh_error_found;
static int
verify_eh_throw_stmt_node (void **slot, void *data)
@@ -4366,52 +3934,56 @@ verify_eh_throw_stmt_node (void **slot, void *data)
if (!pointer_set_contains (visited, node->stmt))
{
error ("Dead STMT in EH table");
- debug_generic_stmt (node->stmt);
+ debug_gimple_stmt (node->stmt);
eh_error_found = true;
}
return 0;
}
-/* Verify the GIMPLE statement chain. */
+
+/* Verify the GIMPLE statements in every basic block. */
void
verify_stmts (void)
{
basic_block bb;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
bool err = false;
struct pointer_set_t *visited, *visited_stmts;
tree addr;
+ struct walk_stmt_info wi;
timevar_push (TV_TREE_STMT_VERIFY);
visited = pointer_set_create ();
visited_stmts = pointer_set_create ();
+ memset (&wi, 0, sizeof (wi));
+ wi.info = (void *) visited;
+
FOR_EACH_BB (bb)
{
- tree phi;
- int i;
+ gimple phi;
+ size_t i;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- int phi_num_args = PHI_NUM_ARGS (phi);
-
+ phi = gsi_stmt (gsi);
pointer_set_insert (visited_stmts, phi);
- if (bb_for_stmt (phi) != bb)
+ if (gimple_bb (phi) != bb)
{
- error ("bb_for_stmt (phi) is set to a wrong basic block");
+ error ("gimple_bb (phi) is set to a wrong basic block");
err |= true;
}
- for (i = 0; i < phi_num_args; i++)
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
{
- tree t = PHI_ARG_DEF (phi, i);
+ tree t = gimple_phi_arg_def (phi, i);
tree addr;
if (!t)
{
error ("missing PHI def");
- debug_generic_stmt (phi);
+ debug_gimple_stmt (phi);
err |= true;
continue;
}
@@ -4421,9 +3993,9 @@ verify_stmts (void)
&& TREE_CODE (t) != FUNCTION_DECL
&& !is_gimple_min_invariant (t))
{
- error ("PHI def is not a GIMPLE value");
- debug_generic_stmt (phi);
- debug_generic_stmt (t);
+ error ("PHI argument is not a GIMPLE value");
+ debug_gimple_stmt (phi);
+ debug_generic_expr (t);
err |= true;
}
@@ -4431,38 +4003,59 @@ verify_stmts (void)
if (addr)
{
error ("incorrect sharing of tree nodes");
- debug_generic_stmt (phi);
- debug_generic_stmt (addr);
+ debug_gimple_stmt (phi);
+ debug_generic_expr (addr);
err |= true;
}
}
}
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); )
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); )
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
+
+ if (gimple_code (stmt) == GIMPLE_WITH_CLEANUP_EXPR
+ || gimple_code (stmt) == GIMPLE_BIND)
+ {
+ error ("invalid GIMPLE statement");
+ debug_gimple_stmt (stmt);
+ err |= true;
+ }
pointer_set_insert (visited_stmts, stmt);
- err |= verify_gimple_tuples (stmt);
- if (bb_for_stmt (stmt) != bb)
+ if (gimple_bb (stmt) != bb)
{
- error ("bb_for_stmt (stmt) is set to a wrong basic block");
+ error ("gimple_bb (stmt) is set to a wrong basic block");
err |= true;
}
- bsi_next (&bsi);
- err |= verify_stmt (stmt, bsi_end_p (bsi));
- addr = walk_tree (&stmt, verify_node_sharing, visited, NULL);
+ if (gimple_code (stmt) == GIMPLE_LABEL)
+ {
+ tree decl = gimple_label_label (stmt);
+ int uid = LABEL_DECL_UID (decl);
+
+ if (uid == -1
+ || VEC_index (basic_block, label_to_block_map, uid) != bb)
+ {
+ error ("incorrect entry in label_to_block_map.\n");
+ err |= true;
+ }
+ }
+
+ err |= verify_stmt (&gsi);
+ addr = walk_gimple_op (gsi_stmt (gsi), verify_node_sharing, &wi);
if (addr)
{
error ("incorrect sharing of tree nodes");
- debug_generic_stmt (stmt);
- debug_generic_stmt (addr);
+ debug_gimple_stmt (stmt);
+ debug_generic_expr (addr);
err |= true;
}
+ gsi_next (&gsi);
}
}
+
eh_error_found = false;
if (get_eh_throw_stmt_table (cfun))
htab_traverse (get_eh_throw_stmt_table (cfun),
@@ -4482,22 +4075,22 @@ verify_stmts (void)
/* Verifies that the flow information is OK. */
static int
-tree_verify_flow_info (void)
+gimple_verify_flow_info (void)
{
int err = 0;
basic_block bb;
- block_stmt_iterator bsi;
- tree stmt;
+ gimple_stmt_iterator gsi;
+ gimple stmt;
edge e;
edge_iterator ei;
- if (ENTRY_BLOCK_PTR->il.tree)
+ if (ENTRY_BLOCK_PTR->il.gimple)
{
error ("ENTRY_BLOCK has IL associated with it");
err = 1;
}
- if (EXIT_BLOCK_PTR->il.tree)
+ if (EXIT_BLOCK_PTR->il.gimple)
{
error ("EXIT_BLOCK has IL associated with it");
err = 1;
@@ -4514,41 +4107,42 @@ tree_verify_flow_info (void)
{
bool found_ctrl_stmt = false;
- stmt = NULL_TREE;
+ stmt = NULL;
/* Skip labels on the start of basic block. */
- 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))
{
- tree prev_stmt = stmt;
+ tree label;
+ gimple prev_stmt = stmt;
- stmt = bsi_stmt (bsi);
+ stmt = gsi_stmt (gsi);
- if (TREE_CODE (stmt) != LABEL_EXPR)
+ if (gimple_code (stmt) != GIMPLE_LABEL)
break;
- if (prev_stmt && DECL_NONLOCAL (LABEL_EXPR_LABEL (stmt)))
+ label = gimple_label_label (stmt);
+ if (prev_stmt && DECL_NONLOCAL (label))
{
error ("nonlocal label ");
- print_generic_expr (stderr, LABEL_EXPR_LABEL (stmt), 0);
+ print_generic_expr (stderr, label, 0);
fprintf (stderr, " is not first in a sequence of labels in bb %d",
bb->index);
err = 1;
}
- if (label_to_block (LABEL_EXPR_LABEL (stmt)) != bb)
+ if (label_to_block (label) != bb)
{
error ("label ");
- print_generic_expr (stderr, LABEL_EXPR_LABEL (stmt), 0);
+ print_generic_expr (stderr, label, 0);
fprintf (stderr, " to block does not match in bb %d",
bb->index);
err = 1;
}
- if (decl_function_context (LABEL_EXPR_LABEL (stmt))
- != current_function_decl)
+ if (decl_function_context (label) != current_function_decl)
{
error ("label ");
- print_generic_expr (stderr, LABEL_EXPR_LABEL (stmt), 0);
+ print_generic_expr (stderr, label, 0);
fprintf (stderr, " has incorrect context in bb %d",
bb->index);
err = 1;
@@ -4556,9 +4150,9 @@ tree_verify_flow_info (void)
}
/* Verify that body of basic block BB is free of control flow. */
- for (; !bsi_end_p (bsi); bsi_next (&bsi))
+ for (; !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
if (found_ctrl_stmt)
{
@@ -4570,20 +4164,20 @@ tree_verify_flow_info (void)
if (stmt_ends_bb_p (stmt))
found_ctrl_stmt = true;
- if (TREE_CODE (stmt) == LABEL_EXPR)
+ if (gimple_code (stmt) == GIMPLE_LABEL)
{
error ("label ");
- print_generic_expr (stderr, LABEL_EXPR_LABEL (stmt), 0);
+ print_generic_expr (stderr, gimple_label_label (stmt), 0);
fprintf (stderr, " in the middle of basic block %d", bb->index);
err = 1;
}
}
- bsi = bsi_last (bb);
- if (bsi_end_p (bsi))
+ gsi = gsi_last_bb (bb);
+ if (gsi_end_p (gsi))
continue;
- stmt = bsi_stmt (bsi);
+ stmt = gsi_stmt (gsi);
err |= verify_eh_edges (stmt);
@@ -4598,37 +4192,30 @@ tree_verify_flow_info (void)
}
}
- if (TREE_CODE (stmt) != COND_EXPR)
+ if (gimple_code (stmt) != GIMPLE_COND)
{
/* Verify that there are no edges with EDGE_TRUE/FALSE_FLAG set
after anything else but if statement. */
FOR_EACH_EDGE (e, ei, bb->succs)
if (e->flags & (EDGE_TRUE_VALUE | EDGE_FALSE_VALUE))
{
- error ("true/false edge after a non-COND_EXPR in bb %d",
+ error ("true/false edge after a non-GIMPLE_COND in bb %d",
bb->index);
err = 1;
}
}
- switch (TREE_CODE (stmt))
+ switch (gimple_code (stmt))
{
- case COND_EXPR:
+ case GIMPLE_COND:
{
edge true_edge;
edge false_edge;
- if (COND_EXPR_THEN (stmt) != NULL_TREE
- || COND_EXPR_ELSE (stmt) != NULL_TREE)
- {
- error ("COND_EXPR with code in branches at the end of bb %d",
- bb->index);
- err = 1;
- }
-
extract_true_false_edges_from_block (bb, &true_edge, &false_edge);
- if (!true_edge || !false_edge
+ if (!true_edge
+ || !false_edge
|| !(true_edge->flags & EDGE_TRUE_VALUE)
|| !(false_edge->flags & EDGE_FALSE_VALUE)
|| (true_edge->flags & (EDGE_FALLTHRU | EDGE_ABNORMAL))
@@ -4642,7 +4229,7 @@ tree_verify_flow_info (void)
}
break;
- case GOTO_EXPR:
+ case GIMPLE_GOTO:
if (simple_goto_p (stmt))
{
error ("explicit goto at end of bb %d", bb->index);
@@ -4664,7 +4251,7 @@ tree_verify_flow_info (void)
}
break;
- case RETURN_EXPR:
+ case GIMPLE_RETURN:
if (!single_succ_p (bb)
|| (single_succ_edge (bb)->flags
& (EDGE_FALLTHRU | EDGE_ABNORMAL
@@ -4681,41 +4268,37 @@ tree_verify_flow_info (void)
}
break;
- case SWITCH_EXPR:
+ case GIMPLE_SWITCH:
{
tree prev;
edge e;
size_t i, n;
- tree vec;
- vec = SWITCH_LABELS (stmt);
- n = TREE_VEC_LENGTH (vec);
+ n = gimple_switch_num_labels (stmt);
/* Mark all the destination basic blocks. */
for (i = 0; i < n; ++i)
{
- tree lab = CASE_LABEL (TREE_VEC_ELT (vec, i));
+ tree lab = CASE_LABEL (gimple_switch_label (stmt, i));
basic_block label_bb = label_to_block (lab);
-
gcc_assert (!label_bb->aux || label_bb->aux == (void *)1);
label_bb->aux = (void *)1;
}
/* Verify that the case labels are sorted. */
- prev = TREE_VEC_ELT (vec, 0);
+ prev = gimple_switch_label (stmt, 0);
for (i = 1; i < n; ++i)
{
- tree c = TREE_VEC_ELT (vec, i);
- if (! CASE_LOW (c))
+ tree c = gimple_switch_label (stmt, i);
+ if (!CASE_LOW (c))
{
- if (i != n - 1)
- {
- error ("found default case not at end of case vector");
- err = 1;
- }
+ error ("found default case not at the start of "
+ "case vector");
+ err = 1;
continue;
}
- if (! tree_int_cst_lt (CASE_LOW (prev), CASE_LOW (c)))
+ if (CASE_LOW (prev)
+ && !tree_int_cst_lt (CASE_LOW (prev), CASE_LOW (c)))
{
error ("case labels not sorted: ");
print_generic_expr (stderr, prev, 0);
@@ -4738,6 +4321,7 @@ tree_verify_flow_info (void)
bb->index, e->dest->index);
err = 1;
}
+
e->dest->aux = (void *)2;
if ((e->flags & (EDGE_FALLTHRU | EDGE_ABNORMAL
| EDGE_TRUE_VALUE | EDGE_FALSE_VALUE)))
@@ -4751,13 +4335,12 @@ tree_verify_flow_info (void)
/* Check that we have all of them. */
for (i = 0; i < n; ++i)
{
- tree lab = CASE_LABEL (TREE_VEC_ELT (vec, i));
+ tree lab = CASE_LABEL (gimple_switch_label (stmt, i));
basic_block label_bb = label_to_block (lab);
if (label_bb->aux != (void *)2)
{
- error ("missing edge %i->%i",
- bb->index, label_bb->index);
+ error ("missing edge %i->%i", bb->index, label_bb->index);
err = 1;
}
}
@@ -4781,12 +4364,13 @@ tree_verify_flow_info (void)
by edge FALLTHRU. */
static void
-tree_make_forwarder_block (edge fallthru)
+gimple_make_forwarder_block (edge fallthru)
{
edge e;
edge_iterator ei;
basic_block dummy, bb;
- tree phi, new_phi, var;
+ tree var;
+ gimple_stmt_iterator gsi;
dummy = fallthru->src;
bb = fallthru->dest;
@@ -4796,18 +4380,18 @@ tree_make_forwarder_block (edge fallthru)
/* If we redirected a branch we must create new PHI nodes at the
start of BB. */
- for (phi = phi_nodes (dummy); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (dummy); !gsi_end_p (gsi); gsi_next (&gsi))
{
- var = PHI_RESULT (phi);
+ gimple phi, new_phi;
+
+ phi = gsi_stmt (gsi);
+ var = gimple_phi_result (phi);
new_phi = create_phi_node (var, bb);
SSA_NAME_DEF_STMT (var) = new_phi;
- SET_PHI_RESULT (phi, make_ssa_name (SSA_NAME_VAR (var), phi));
- add_phi_arg (new_phi, PHI_RESULT (phi), fallthru);
+ gimple_phi_set_result (phi, make_ssa_name (SSA_NAME_VAR (var), phi));
+ add_phi_arg (new_phi, gimple_phi_result (phi), fallthru);
}
- /* Ensure that the PHI node chain is in the same order. */
- set_phi_nodes (bb, phi_reverse (phi_nodes (bb)));
-
/* Add the arguments we have stored on edges. */
FOR_EACH_EDGE (e, ei, bb->preds)
{
@@ -4823,29 +4407,30 @@ tree_make_forwarder_block (edge fallthru)
Create one if it doesn't exist. */
tree
-tree_block_label (basic_block bb)
+gimple_block_label (basic_block bb)
{
- block_stmt_iterator i, s = bsi_start (bb);
+ gimple_stmt_iterator i, s = gsi_start_bb (bb);
bool first = true;
- tree label, stmt;
+ tree label;
+ gimple stmt;
- for (i = s; !bsi_end_p (i); first = false, bsi_next (&i))
+ for (i = s; !gsi_end_p (i); first = false, gsi_next (&i))
{
- stmt = bsi_stmt (i);
- if (TREE_CODE (stmt) != LABEL_EXPR)
+ stmt = gsi_stmt (i);
+ if (gimple_code (stmt) != GIMPLE_LABEL)
break;
- label = LABEL_EXPR_LABEL (stmt);
+ label = gimple_label_label (stmt);
if (!DECL_NONLOCAL (label))
{
if (!first)
- bsi_move_before (&i, &s);
+ gsi_move_before (&i, &s);
return label;
}
}
label = create_artificial_label ();
- stmt = build1 (LABEL_EXPR, void_type_node, label);
- bsi_insert_before (&s, stmt, BSI_NEW_STMT);
+ stmt = gimple_build_label (label);
+ gsi_insert_before (&s, stmt, GSI_NEW_STMT);
return label;
}
@@ -4857,11 +4442,11 @@ tree_block_label (basic_block bb)
redirect_edge_and_branch. */
static edge
-tree_try_redirect_by_replacing_jump (edge e, basic_block target)
+gimple_try_redirect_by_replacing_jump (edge e, basic_block target)
{
basic_block src = e->src;
- block_stmt_iterator b;
- tree stmt;
+ gimple_stmt_iterator i;
+ gimple stmt;
/* We can replace or remove a complex jump only when we have exactly
two edges. */
@@ -4871,15 +4456,15 @@ tree_try_redirect_by_replacing_jump (edge e, basic_block target)
|| EDGE_SUCC (src, EDGE_SUCC (src, 0) == e)->dest != target)
return NULL;
- b = bsi_last (src);
- if (bsi_end_p (b))
+ i = gsi_last_bb (src);
+ if (gsi_end_p (i))
return NULL;
- stmt = bsi_stmt (b);
- if (TREE_CODE (stmt) == COND_EXPR
- || TREE_CODE (stmt) == SWITCH_EXPR)
+ stmt = gsi_stmt (i);
+
+ if (gimple_code (stmt) == GIMPLE_COND || gimple_code (stmt) == GIMPLE_SWITCH)
{
- bsi_remove (&b, true);
+ gsi_remove (&i, true);
e = ssa_redirect_edge (e, target);
e->flags = EDGE_FALLTHRU;
return e;
@@ -4893,41 +4478,41 @@ tree_try_redirect_by_replacing_jump (edge e, basic_block target)
edge representing the redirected branch. */
static edge
-tree_redirect_edge_and_branch (edge e, basic_block dest)
+gimple_redirect_edge_and_branch (edge e, basic_block dest)
{
basic_block bb = e->src;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
edge ret;
- tree stmt;
+ gimple stmt;
if (e->flags & EDGE_ABNORMAL)
return NULL;
if (e->src != ENTRY_BLOCK_PTR
- && (ret = tree_try_redirect_by_replacing_jump (e, dest)))
+ && (ret = gimple_try_redirect_by_replacing_jump (e, dest)))
return ret;
if (e->dest == dest)
return NULL;
- bsi = bsi_last (bb);
- stmt = bsi_end_p (bsi) ? NULL : bsi_stmt (bsi);
+ gsi = gsi_last_bb (bb);
+ stmt = gsi_end_p (gsi) ? NULL : gsi_stmt (gsi);
- switch (stmt ? TREE_CODE (stmt) : ERROR_MARK)
+ switch (stmt ? gimple_code (stmt) : ERROR_MARK)
{
- case COND_EXPR:
+ case GIMPLE_COND:
/* For COND_EXPR, we only need to redirect the edge. */
break;
- case GOTO_EXPR:
+ case GIMPLE_GOTO:
/* No non-abnormal edges should lead from a non-simple goto, and
simple ones should be represented implicitly. */
gcc_unreachable ();
- case SWITCH_EXPR:
+ case GIMPLE_SWITCH:
{
+ tree label = gimple_block_label (dest);
tree cases = get_cases_for_edge (e, stmt);
- tree label = tree_block_label (dest);
/* If we have a list of cases associated with E, then use it
as it's a lot faster than walking the entire case vector. */
@@ -4956,13 +4541,11 @@ tree_redirect_edge_and_branch (edge e, basic_block dest)
}
else
{
- tree vec = SWITCH_LABELS (stmt);
- size_t i, n = TREE_VEC_LENGTH (vec);
+ size_t i, n = gimple_switch_num_labels (stmt);
for (i = 0; i < n; i++)
{
- tree elt = TREE_VEC_ELT (vec, i);
-
+ tree elt = gimple_switch_label (stmt, i);
if (label_to_block (CASE_LABEL (elt)) == e->dest)
CASE_LABEL (elt) = label;
}
@@ -4971,15 +4554,15 @@ tree_redirect_edge_and_branch (edge e, basic_block dest)
break;
}
- case RETURN_EXPR:
- bsi_remove (&bsi, true);
+ case GIMPLE_RETURN:
+ gsi_remove (&gsi, true);
e->flags |= EDGE_FALLTHRU;
break;
- case OMP_RETURN:
- case OMP_CONTINUE:
- case OMP_SECTIONS_SWITCH:
- case OMP_FOR:
+ case GIMPLE_OMP_RETURN:
+ case GIMPLE_OMP_CONTINUE:
+ case GIMPLE_OMP_SECTIONS_SWITCH:
+ case GIMPLE_OMP_FOR:
/* The edges from OMP constructs can be simply redirected. */
break;
@@ -5002,7 +4585,7 @@ tree_redirect_edge_and_branch (edge e, basic_block dest)
it to the destination of the other edge from E->src. */
static bool
-tree_can_remove_branch_p (const_edge e)
+gimple_can_remove_branch_p (const_edge e)
{
if (e->flags & EDGE_ABNORMAL)
return false;
@@ -5013,9 +4596,9 @@ tree_can_remove_branch_p (const_edge e)
/* Simple wrapper, as we can always redirect fallthru edges. */
static basic_block
-tree_redirect_edge_and_branch_force (edge e, basic_block dest)
+gimple_redirect_edge_and_branch_force (edge e, basic_block dest)
{
- e = tree_redirect_edge_and_branch (e, dest);
+ e = gimple_redirect_edge_and_branch (e, dest);
gcc_assert (e);
return NULL;
@@ -5026,11 +4609,12 @@ tree_redirect_edge_and_branch_force (edge e, basic_block dest)
labels). If STMT is NULL, BB is split just after the labels. */
static basic_block
-tree_split_block (basic_block bb, void *stmt)
+gimple_split_block (basic_block bb, void *stmt)
{
- block_stmt_iterator bsi;
- tree_stmt_iterator tsi_tgt;
- tree act, list;
+ gimple_stmt_iterator gsi;
+ gimple_stmt_iterator gsi_tgt;
+ gimple act;
+ gimple_seq list;
basic_block new_bb;
edge e;
edge_iterator ei;
@@ -5043,14 +4627,14 @@ tree_split_block (basic_block bb, void *stmt)
FOR_EACH_EDGE (e, ei, new_bb->succs)
e->src = new_bb;
- if (stmt && TREE_CODE ((tree) stmt) == LABEL_EXPR)
+ if (stmt && gimple_code ((gimple) stmt) == GIMPLE_LABEL)
stmt = NULL;
- /* Move everything from BSI to the new basic block. */
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ /* Move everything from GSI to the new basic block. */
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- act = bsi_stmt (bsi);
- if (TREE_CODE (act) == LABEL_EXPR)
+ act = gsi_stmt (gsi);
+ if (gimple_code (act) == GIMPLE_LABEL)
continue;
if (!stmt)
@@ -5058,23 +4642,23 @@ tree_split_block (basic_block bb, void *stmt)
if (stmt == act)
{
- bsi_next (&bsi);
+ gsi_next (&gsi);
break;
}
}
- if (bsi_end_p (bsi))
+ if (gsi_end_p (gsi))
return new_bb;
/* Split the statement list - avoid re-creating new containers as this
brings ugly quadratic memory consumption in the inliner.
(We are still quadratic since we need to update stmt BB pointers,
sadly.) */
- list = tsi_split_statement_list_before (&bsi.tsi);
- set_bb_stmt_list (new_bb, list);
- for (tsi_tgt = tsi_start (list);
- !tsi_end_p (tsi_tgt); tsi_next (&tsi_tgt))
- change_bb_for_stmt (tsi_stmt (tsi_tgt), new_bb);
+ list = gsi_split_seq_before (&gsi);
+ set_bb_seq (new_bb, list);
+ for (gsi_tgt = gsi_start (list);
+ !gsi_end_p (gsi_tgt); gsi_next (&gsi_tgt))
+ gimple_set_bb (gsi_stmt (gsi_tgt), new_bb);
return new_bb;
}
@@ -5083,7 +4667,7 @@ tree_split_block (basic_block bb, void *stmt)
/* Moves basic block BB after block AFTER. */
static bool
-tree_move_block_after (basic_block bb, basic_block after)
+gimple_move_block_after (basic_block bb, basic_block after)
{
if (bb->prev_bb == after)
return true;
@@ -5098,52 +4682,49 @@ tree_move_block_after (basic_block bb, basic_block after)
/* Return true if basic_block can be duplicated. */
static bool
-tree_can_duplicate_bb_p (const_basic_block bb ATTRIBUTE_UNUSED)
+gimple_can_duplicate_bb_p (const_basic_block bb ATTRIBUTE_UNUSED)
{
return true;
}
-
/* Create a duplicate of the basic block BB. NOTE: This does not
preserve SSA form. */
static basic_block
-tree_duplicate_bb (basic_block bb)
+gimple_duplicate_bb (basic_block bb)
{
basic_block new_bb;
- block_stmt_iterator bsi, bsi_tgt;
- tree phi;
+ gimple_stmt_iterator gsi, gsi_tgt;
+ gimple_seq phis = phi_nodes (bb);
+ gimple phi, stmt, copy;
new_bb = create_empty_bb (EXIT_BLOCK_PTR->prev_bb);
/* Copy the PHI nodes. We ignore PHI node arguments here because
the incoming edges have not been setup yet. */
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start (phis); !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree copy = create_phi_node (PHI_RESULT (phi), new_bb);
- create_new_def_for (PHI_RESULT (copy), copy, PHI_RESULT_PTR (copy));
+ phi = gsi_stmt (gsi);
+ copy = create_phi_node (gimple_phi_result (phi), new_bb);
+ create_new_def_for (gimple_phi_result (copy), copy,
+ gimple_phi_result_ptr (copy));
}
- /* Keep the chain of PHI nodes in the same order so that they can be
- updated by ssa_redirect_edge. */
- set_phi_nodes (new_bb, phi_reverse (phi_nodes (new_bb)));
-
- bsi_tgt = bsi_start (new_bb);
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ gsi_tgt = gsi_start_bb (new_bb);
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
def_operand_p def_p;
ssa_op_iter op_iter;
- tree stmt, copy;
int region;
- stmt = bsi_stmt (bsi);
- if (TREE_CODE (stmt) == LABEL_EXPR)
+ stmt = gsi_stmt (gsi);
+ if (gimple_code (stmt) == GIMPLE_LABEL)
continue;
/* Create a new copy of STMT and duplicate STMT's virtual
operands. */
- copy = unshare_expr (stmt);
- bsi_insert_after (&bsi_tgt, copy, BSI_NEW_STMT);
+ copy = gimple_copy (stmt);
+ gsi_insert_after (&gsi_tgt, copy, GSI_NEW_STMT);
copy_virtual_operands (copy, stmt);
region = lookup_stmt_eh_region (stmt);
if (region >= 0)
@@ -5167,9 +4748,11 @@ add_phi_args_after_copy_edge (edge e_copy)
basic_block bb, bb_copy = e_copy->src, dest;
edge e;
edge_iterator ei;
- tree phi, phi_copy, phi_next, def;
+ gimple phi, phi_copy;
+ tree def;
+ gimple_stmt_iterator psi, psi_copy;
- if (!phi_nodes (e_copy->dest))
+ if (gimple_seq_empty_p (phi_nodes (e_copy->dest)))
return;
bb = bb_copy->flags & BB_DUPLICATED ? get_bb_original (bb_copy) : bb_copy;
@@ -5195,11 +4778,13 @@ add_phi_args_after_copy_edge (edge e_copy)
gcc_assert (e != NULL);
}
- for (phi = phi_nodes (e->dest), phi_copy = phi_nodes (e_copy->dest);
- phi;
- phi = phi_next, phi_copy = PHI_CHAIN (phi_copy))
+ for (psi = gsi_start_phis (e->dest),
+ psi_copy = gsi_start_phis (e_copy->dest);
+ !gsi_end_p (psi);
+ gsi_next (&psi), gsi_next (&psi_copy))
{
- phi_next = PHI_CHAIN (phi);
+ phi = gsi_stmt (psi);
+ phi_copy = gsi_stmt (psi_copy);
def = PHI_ARG_DEF_FROM_EDGE (phi, e);
add_phi_arg (phi_copy, def, e_copy);
}
@@ -5213,8 +4798,8 @@ add_phi_args_after_copy_edge (edge e_copy)
void
add_phi_args_after_copy_bb (basic_block bb_copy)
{
- edge_iterator ei;
edge e_copy;
+ edge_iterator ei;
FOR_EACH_EDGE (e_copy, ei, bb_copy->succs)
{
@@ -5256,7 +4841,7 @@ add_phi_args_after_copy (basic_block *region_copy, unsigned n_region,
true otherwise. */
bool
-tree_duplicate_sese_region (edge entry, edge exit,
+gimple_duplicate_sese_region (edge entry, edge exit,
basic_block *region, unsigned n_region,
basic_block *region_copy)
{
@@ -5422,9 +5007,9 @@ tree_duplicate_sese_region (edge entry, edge exit,
*/
bool
-tree_duplicate_sese_tail (edge entry, edge exit,
- basic_block *region, unsigned n_region,
- basic_block *region_copy)
+gimple_duplicate_sese_tail (edge entry ATTRIBUTE_UNUSED, edge exit ATTRIBUTE_UNUSED,
+ basic_block *region ATTRIBUTE_UNUSED, unsigned n_region ATTRIBUTE_UNUSED,
+ basic_block *region_copy ATTRIBUTE_UNUSED)
{
unsigned i;
bool free_region_copy = false;
@@ -5435,8 +5020,8 @@ tree_duplicate_sese_tail (edge entry, edge exit,
int total_freq = 0, exit_freq = 0;
gcov_type total_count = 0, exit_count = 0;
edge exits[2], nexits[2], e;
- block_stmt_iterator bsi;
- tree cond;
+ gimple_stmt_iterator gsi;
+ gimple cond_stmt;
edge sorig, snew;
gcc_assert (EDGE_COUNT (exit->src->succs) == 2);
@@ -5525,10 +5110,13 @@ tree_duplicate_sese_tail (edge entry, edge exit,
switch_bb = split_edge (entry);
set_immediate_dominator (CDI_DOMINATORS, nentry_bb, switch_bb);
- bsi = bsi_last (switch_bb);
- cond = last_stmt (exit->src);
- gcc_assert (TREE_CODE (cond) == COND_EXPR);
- bsi_insert_after (&bsi, unshare_expr (cond), BSI_NEW_STMT);
+ gsi = gsi_last_bb (switch_bb);
+ cond_stmt = last_stmt (exit->src);
+ gcc_assert (gimple_code (cond_stmt) == GIMPLE_COND);
+ cond_stmt = gimple_copy (cond_stmt);
+ gimple_cond_set_lhs (cond_stmt, unshare_expr (gimple_cond_lhs (cond_stmt)));
+ gimple_cond_set_rhs (cond_stmt, unshare_expr (gimple_cond_rhs (cond_stmt)));
+ gsi_insert_after (&gsi, cond_stmt, GSI_NEW_STMT);
sorig = single_succ_edge (switch_bb);
sorig->flags = exits[1]->flags;
@@ -5543,9 +5131,9 @@ tree_duplicate_sese_tail (edge entry, edge exit,
/* Get rid of now superfluous conditions and associated edges (and phi node
arguments). */
e = redirect_edge_and_branch (exits[0], exits[1]->dest);
- PENDING_STMT (e) = NULL_TREE;
+ PENDING_STMT (e) = NULL;
e = redirect_edge_and_branch (nexits[1], nexits[0]->dest);
- PENDING_STMT (e) = NULL_TREE;
+ PENDING_STMT (e) = NULL;
/* Anything that is outside of the region, but was dominated by something
inside needs to update dominance info. */
@@ -5562,11 +5150,6 @@ tree_duplicate_sese_tail (edge entry, edge exit,
return true;
}
-/*
-DEF_VEC_P(basic_block);
-DEF_VEC_ALLOC_P(basic_block,heap);
-*/
-
/* Add all the blocks dominated by ENTRY to the array BBS_P. Stop
adding blocks when the dominator traversal reaches EXIT. This
function silently assumes that ENTRY strictly dominates EXIT. */
@@ -5627,6 +5210,7 @@ replace_by_duplicate_decl (tree *tp, struct pointer_map_t *vars_map,
*tp = new_t;
}
+
/* Creates an ssa name in TO_CONTEXT equivalent to NAME.
VARS_MAP maps old ssa names and var_decls to the new ones. */
@@ -5679,44 +5263,16 @@ struct move_stmt_d
DECL_CONTEXT of every local variable referenced in *TP. */
static tree
-move_stmt_r (tree *tp, int *walk_subtrees, void *data)
+move_stmt_op (tree *tp, int *walk_subtrees, void *data)
{
- struct move_stmt_d *p = (struct move_stmt_d *) data;
+ struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
+ struct move_stmt_d *p = (struct move_stmt_d *) wi->info;
tree t = *tp;
- if (EXPR_P (t) || GIMPLE_STMT_P (t))
- {
- tree block = TREE_BLOCK (t);
- if (p->orig_block == NULL_TREE
- || block == p->orig_block
- || block == NULL_TREE)
- TREE_BLOCK (t) = p->new_block;
-#ifdef ENABLE_CHECKING
- else if (block != p->new_block)
- {
- while (block && block != p->orig_block)
- block = BLOCK_SUPERCONTEXT (block);
- gcc_assert (block);
- }
-#endif
- }
-
- if (OMP_DIRECTIVE_P (t)
- && TREE_CODE (t) != OMP_RETURN
- && TREE_CODE (t) != OMP_CONTINUE)
- {
- /* Do not remap variables inside OMP directives. Variables
- referenced in clauses and directive header belong to the
- parent function and should not be moved into the child
- function. */
- bool save_remap_decls_p = p->remap_decls_p;
- p->remap_decls_p = false;
- *walk_subtrees = 0;
-
- walk_tree (&OMP_BODY (t), move_stmt_r, p, NULL);
+ if (EXPR_P (t))
+ /* We should never have TREE_BLOCK set on non-statements. */
+ gcc_assert (!TREE_BLOCK (t));
- p->remap_decls_p = save_remap_decls_p;
- }
else if (DECL_P (t) || TREE_CODE (t) == SSA_NAME)
{
if (TREE_CODE (t) == SSA_NAME)
@@ -5764,20 +5320,67 @@ move_stmt_r (tree *tp, int *walk_subtrees, void *data)
return NULL_TREE;
}
+/* Like move_stmt_op, but for gimple statements.
+
+ Helper for move_block_to_fn. Set GIMPLE_BLOCK in every expression
+ contained in the current statement in *GSI_P and change the
+ DECL_CONTEXT of every local variable referenced in the current
+ statement. */
+
+static tree
+move_stmt_r (gimple_stmt_iterator *gsi_p, bool *handled_ops_p,
+ struct walk_stmt_info *wi)
+{
+ struct move_stmt_d *p = (struct move_stmt_d *) wi->info;
+ gimple stmt = gsi_stmt (*gsi_p);
+ tree block = gimple_block (stmt);
+
+ if (p->orig_block == NULL_TREE
+ || block == p->orig_block
+ || block == NULL_TREE)
+ gimple_set_block (stmt, p->new_block);
+#ifdef ENABLE_CHECKING
+ else if (block != p->new_block)
+ {
+ while (block && block != p->orig_block)
+ block = BLOCK_SUPERCONTEXT (block);
+ gcc_assert (block);
+ }
+#endif
+
+ if (is_gimple_omp (stmt)
+ && gimple_code (stmt) != GIMPLE_OMP_RETURN
+ && gimple_code (stmt) != GIMPLE_OMP_CONTINUE)
+ {
+ /* Do not remap variables inside OMP directives. Variables
+ referenced in clauses and directive header belong to the
+ parent function and should not be moved into the child
+ function. */
+ bool save_remap_decls_p = p->remap_decls_p;
+ p->remap_decls_p = false;
+ *handled_ops_p = true;
+
+ walk_gimple_seq (gimple_omp_body (stmt), move_stmt_r, move_stmt_op, wi);
+
+ p->remap_decls_p = save_remap_decls_p;
+ }
+
+ return NULL_TREE;
+}
+
/* Marks virtual operands of all statements in basic blocks BBS for
renaming. */
void
mark_virtual_ops_in_bb (basic_block bb)
{
- tree phi;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- mark_virtual_ops_for_renaming (phi);
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ mark_virtual_ops_for_renaming (gsi_stmt (gsi));
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- mark_virtual_ops_for_renaming (bsi_stmt (bsi));
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ mark_virtual_ops_for_renaming (gsi_stmt (gsi));
}
/* Marks virtual operands of all statements in basic blocks BBS for
@@ -5811,9 +5414,8 @@ move_block_to_fn (struct function *dest_cfun, basic_block bb,
struct control_flow_graph *cfg;
edge_iterator ei;
edge e;
- block_stmt_iterator si;
+ gimple_stmt_iterator si;
unsigned old_len, new_len;
- tree phi, next_phi;
/* Remove BB from dominance structures. */
delete_from_dominance_info (CDI_DOMINATORS, bb);
@@ -5853,18 +5455,18 @@ move_block_to_fn (struct function *dest_cfun, basic_block bb,
bb->index, bb);
/* Remap the variables in phi nodes. */
- for (phi = phi_nodes (bb); phi; phi = next_phi)
+ for (si = gsi_start_phis (bb); !gsi_end_p (si); )
{
+ gimple phi = gsi_stmt (si);
use_operand_p use;
tree op = PHI_RESULT (phi);
ssa_op_iter oi;
- next_phi = PHI_CHAIN (phi);
if (!is_gimple_reg (op))
{
/* Remove the phi nodes for virtual operands (alias analysis will be
run for the new function, anyway). */
- remove_phi_node (phi, NULL, true);
+ remove_phi_node (&si, true);
continue;
}
@@ -5876,18 +5478,23 @@ move_block_to_fn (struct function *dest_cfun, basic_block bb,
if (TREE_CODE (op) == SSA_NAME)
SET_USE (use, replace_ssa_name (op, d->vars_map, dest_cfun->decl));
}
+
+ gsi_next (&si);
}
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
- tree stmt = bsi_stmt (si);
+ gimple stmt = gsi_stmt (si);
int region;
+ struct walk_stmt_info wi;
- walk_tree (&stmt, move_stmt_r, d, NULL);
+ memset (&wi, 0, sizeof (wi));
+ wi.info = d;
+ walk_gimple_stmt (&si, move_stmt_r, move_stmt_op, &wi);
- if (TREE_CODE (stmt) == LABEL_EXPR)
+ if (gimple_code (stmt) == GIMPLE_LABEL)
{
- tree label = LABEL_EXPR_LABEL (stmt);
+ tree label = gimple_label_label (stmt);
int uid = LABEL_DECL_UID (label);
gcc_assert (uid > -1);
@@ -5908,11 +5515,8 @@ move_block_to_fn (struct function *dest_cfun, basic_block bb,
if (uid >= dest_cfun->cfg->last_label_uid)
dest_cfun->cfg->last_label_uid = uid + 1;
}
- else if (TREE_CODE (stmt) == RESX_EXPR && eh_offset != 0)
- TREE_OPERAND (stmt, 0) =
- build_int_cst (NULL_TREE,
- TREE_INT_CST_LOW (TREE_OPERAND (stmt, 0))
- + eh_offset);
+ else if (gimple_code (stmt) == GIMPLE_RESX && eh_offset != 0)
+ gimple_resx_set_region (stmt, gimple_resx_region (stmt) + eh_offset);
region = lookup_stmt_eh_region (stmt);
if (region >= 0)
@@ -5939,15 +5543,15 @@ static int
find_outermost_region_in_block (struct function *src_cfun,
basic_block bb, int region)
{
- block_stmt_iterator si;
+ gimple_stmt_iterator si;
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
- tree stmt = bsi_stmt (si);
+ gimple stmt = gsi_stmt (si);
int stmt_region;
- if (TREE_CODE (stmt) == RESX_EXPR)
- stmt_region = TREE_INT_CST_LOW (TREE_OPERAND (stmt, 0));
+ if (gimple_code (stmt) == GIMPLE_RESX)
+ stmt_region = gimple_resx_region (stmt);
else
stmt_region = lookup_stmt_eh_region_fn (src_cfun, stmt);
if (stmt_region > 0)
@@ -6242,7 +5846,8 @@ move_sese_region_to_fn (struct function *dest_cfun, basic_block entry_bb,
}
-/* Dump FUNCTION_DECL FN to file FILE using FLAGS (see TDF_* in tree.h) */
+/* Dump FUNCTION_DECL FN to file FILE using FLAGS (see TDF_* in tree-pass.h)
+ */
void
dump_function_to_file (tree fn, FILE *file, int flags)
@@ -6276,7 +5881,7 @@ dump_function_to_file (tree fn, FILE *file, int flags)
if (dsf && (flags & TDF_DETAILS))
dump_eh_tree (file, dsf);
- if (flags & TDF_RAW)
+ if (flags & TDF_RAW && !gimple_body (fn))
{
dump_node (fn, TDF_SLIM | flags, file);
return;
@@ -6307,7 +5912,7 @@ dump_function_to_file (tree fn, FILE *file, int flags)
if (cfun && cfun->decl == fn && cfun->cfg && basic_block_info)
{
- /* Make a CFG based dump. */
+ /* If the CFG has been built, emit a CFG-based dump. */
check_bb_profile (ENTRY_BLOCK_PTR, file);
if (!ignore_topmost_bind)
fprintf (file, "{\n");
@@ -6316,11 +5921,34 @@ dump_function_to_file (tree fn, FILE *file, int flags)
fprintf (file, "\n");
FOR_EACH_BB (bb)
- dump_generic_bb (file, bb, 2, flags);
+ gimple_dump_bb (bb, file, 2, flags);
fprintf (file, "}\n");
check_bb_profile (EXIT_BLOCK_PTR, file);
}
+ else if (DECL_SAVED_TREE (fn) == NULL)
+ {
+ /* The function is now in GIMPLE form but the CFG has not been
+ built yet. Emit the single sequence of GIMPLE statements
+ that make up its body. */
+ gimple_seq body = gimple_body (fn);
+
+ if (gimple_seq_first_stmt (body)
+ && gimple_seq_first_stmt (body) == gimple_seq_last_stmt (body)
+ && gimple_code (gimple_seq_first_stmt (body)) == GIMPLE_BIND)
+ print_gimple_seq (file, body, 0, flags);
+ else
+ {
+ if (!ignore_topmost_bind)
+ fprintf (file, "{\n");
+
+ if (any_var)
+ fprintf (file, "\n");
+
+ print_gimple_seq (file, body, 2, flags);
+ fprintf (file, "}\n");
+ }
+ }
else
{
int indent;
@@ -6417,7 +6045,7 @@ print_loops_bb (FILE *file, basic_block bb, int indent, int verbosity)
if (verbosity >= 3)
{
fprintf (file, "%s {\n", s_indent);
- tree_dump_bb (bb, file, indent + 4);
+ gimple_dump_bb (bb, file, indent + 4, TDF_VOPS|TDF_MEMSYMS);
fprintf (file, "%s }\n", s_indent);
}
}
@@ -6531,10 +6159,10 @@ debug_loop_num (unsigned num, int verbosity)
otherwise. */
static bool
-tree_block_ends_with_call_p (basic_block bb)
+gimple_block_ends_with_call_p (basic_block bb)
{
- block_stmt_iterator bsi = bsi_last (bb);
- return get_call_expr_in (bsi_stmt (bsi)) != NULL;
+ gimple_stmt_iterator gsi = gsi_last_bb (bb);
+ return is_gimple_call (gsi_stmt (gsi));
}
@@ -6542,23 +6170,21 @@ tree_block_ends_with_call_p (basic_block bb)
otherwise. */
static bool
-tree_block_ends_with_condjump_p (const_basic_block bb)
+gimple_block_ends_with_condjump_p (const_basic_block bb)
{
- /* This CONST_CAST is okay because last_stmt doesn't modify its
- argument and the return value is not modified. */
- const_tree stmt = last_stmt (CONST_CAST_BB(bb));
- return (stmt && TREE_CODE (stmt) == COND_EXPR);
+ gimple stmt = last_stmt (CONST_CAST_BB (bb));
+ return (stmt && gimple_code (stmt) == GIMPLE_COND);
}
/* Return true if we need to add fake edge to exit at statement T.
- Helper function for tree_flow_call_edges_add. */
+ Helper function for gimple_flow_call_edges_add. */
static bool
-need_fake_edge_p (tree t)
+need_fake_edge_p (gimple t)
{
- tree call, fndecl = NULL_TREE;
- int call_flags;
+ tree fndecl = NULL_TREE;
+ int call_flags = 0;
/* NORETURN and LONGJMP calls already have an edge to exit.
CONST and PURE calls do not need one.
@@ -6567,24 +6193,26 @@ need_fake_edge_p (tree t)
figured out from the RTL in mark_constant_function, and
the counter incrementation code from -fprofile-arcs
leads to different results from -fbranch-probabilities. */
- call = get_call_expr_in (t);
- if (call)
+ if (is_gimple_call (t))
{
- fndecl = get_callee_fndecl (call);
- call_flags = call_expr_flags (call);
+ fndecl = gimple_call_fndecl (t);
+ call_flags = gimple_call_flags (t);
}
- if (call && fndecl && DECL_BUILT_IN (fndecl)
+ if (is_gimple_call (t)
+ && fndecl
+ && DECL_BUILT_IN (fndecl)
&& (call_flags & ECF_NOTHROW)
&& !(call_flags & ECF_NORETURN)
&& !(call_flags & ECF_RETURNS_TWICE))
return false;
- if (call && !(call_flags & ECF_NORETURN))
+ if (is_gimple_call (t)
+ && !(call_flags & ECF_NORETURN))
return true;
- if (TREE_CODE (t) == ASM_EXPR
- && (ASM_VOLATILE_P (t) || ASM_INPUT_P (t)))
+ if (gimple_code (t) == ASM_EXPR
+ && (gimple_asm_volatile_p (t) || gimple_asm_input_p (t)))
return true;
return false;
@@ -6600,7 +6228,7 @@ need_fake_edge_p (tree t)
not imply that all subsequent instructions must be executed. */
static int
-tree_flow_call_edges_add (sbitmap blocks)
+gimple_flow_call_edges_add (sbitmap blocks)
{
int i;
int blocks_split = 0;
@@ -6630,10 +6258,11 @@ tree_flow_call_edges_add (sbitmap blocks)
if (check_last_block)
{
basic_block bb = EXIT_BLOCK_PTR->prev_bb;
- block_stmt_iterator bsi = bsi_last (bb);
- tree t = NULL_TREE;
- if (!bsi_end_p (bsi))
- t = bsi_stmt (bsi);
+ gimple_stmt_iterator gsi = gsi_last_bb (bb);
+ gimple t = NULL;
+
+ if (!gsi_end_p (gsi))
+ t = gsi_stmt (gsi);
if (t && need_fake_edge_p (t))
{
@@ -6642,8 +6271,8 @@ tree_flow_call_edges_add (sbitmap blocks)
e = find_edge (bb, EXIT_BLOCK_PTR);
if (e)
{
- bsi_insert_on_edge (e, build_empty_stmt ());
- bsi_commit_edge_inserts ();
+ gsi_insert_on_edge (e, gimple_build_nop ());
+ gsi_commit_edge_inserts ();
}
}
}
@@ -6654,8 +6283,8 @@ tree_flow_call_edges_add (sbitmap blocks)
for (i = 0; i < last_bb; i++)
{
basic_block bb = BASIC_BLOCK (i);
- block_stmt_iterator bsi;
- tree stmt, last_stmt;
+ gimple_stmt_iterator gsi;
+ gimple stmt, last_stmt;
if (!bb)
continue;
@@ -6663,16 +6292,17 @@ tree_flow_call_edges_add (sbitmap blocks)
if (blocks && !TEST_BIT (blocks, i))
continue;
- bsi = bsi_last (bb);
- if (!bsi_end_p (bsi))
+ gsi = gsi_last_bb (bb);
+ if (!gsi_end_p (gsi))
{
- last_stmt = bsi_stmt (bsi);
+ last_stmt = gsi_stmt (gsi);
do
{
- stmt = bsi_stmt (bsi);
+ stmt = gsi_stmt (gsi);
if (need_fake_edge_p (stmt))
{
edge e;
+
/* The handling above of the final block before the
epilogue should be enough to verify that there is
no edge to the exit block in CFG already.
@@ -6696,9 +6326,9 @@ tree_flow_call_edges_add (sbitmap blocks)
}
make_edge (bb, EXIT_BLOCK_PTR, EDGE_FAKE);
}
- bsi_prev (&bsi);
+ gsi_prev (&gsi);
}
- while (!bsi_end_p (bsi));
+ while (!gsi_end_p (gsi));
}
}
@@ -6711,17 +6341,17 @@ tree_flow_call_edges_add (sbitmap blocks)
/* Purge dead abnormal call edges from basic block BB. */
bool
-tree_purge_dead_abnormal_call_edges (basic_block bb)
+gimple_purge_dead_abnormal_call_edges (basic_block bb)
{
- bool changed = tree_purge_dead_eh_edges (bb);
+ bool changed = gimple_purge_dead_eh_edges (bb);
if (cfun->has_nonlocal_label)
{
- tree stmt = last_stmt (bb);
+ gimple stmt = last_stmt (bb);
edge_iterator ei;
edge e;
- if (!(stmt && tree_can_make_abnormal_goto (stmt)))
+ if (!(stmt && stmt_can_make_abnormal_goto (stmt)))
for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); )
{
if (e->flags & EDGE_ABNORMAL)
@@ -6733,7 +6363,7 @@ tree_purge_dead_abnormal_call_edges (basic_block bb)
ei_next (&ei);
}
- /* See tree_purge_dead_eh_edges below. */
+ /* See gimple_purge_dead_eh_edges below. */
if (changed)
free_dominance_info (CDI_DOMINATORS);
}
@@ -6880,14 +6510,14 @@ remove_edge_and_dominated_blocks (edge e)
/* Purge dead EH edges from basic block BB. */
bool
-tree_purge_dead_eh_edges (basic_block bb)
+gimple_purge_dead_eh_edges (basic_block bb)
{
bool changed = false;
edge e;
edge_iterator ei;
- tree stmt = last_stmt (bb);
+ gimple stmt = last_stmt (bb);
- if (stmt && tree_can_throw_internal (stmt))
+ if (stmt && stmt_can_throw_internal (stmt))
return false;
for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); )
@@ -6905,7 +6535,7 @@ tree_purge_dead_eh_edges (basic_block bb)
}
bool
-tree_purge_all_dead_eh_edges (const_bitmap blocks)
+gimple_purge_all_dead_eh_edges (const_bitmap blocks)
{
bool changed = false;
unsigned i;
@@ -6913,7 +6543,7 @@ tree_purge_all_dead_eh_edges (const_bitmap blocks)
EXECUTE_IF_SET_IN_BITMAP (blocks, 0, i, bi)
{
- changed |= tree_purge_dead_eh_edges (BASIC_BLOCK (i));
+ changed |= gimple_purge_dead_eh_edges (BASIC_BLOCK (i));
}
return changed;
@@ -6923,7 +6553,7 @@ tree_purge_all_dead_eh_edges (const_bitmap blocks)
redirected. */
static void
-tree_execute_on_growing_pred (edge e)
+gimple_execute_on_growing_pred (edge e)
{
basic_block bb = e->dest;
@@ -6935,7 +6565,7 @@ tree_execute_on_growing_pred (edge e)
the edge vector E->dest->preds. */
static void
-tree_execute_on_shrinking_pred (edge e)
+gimple_execute_on_shrinking_pred (edge e)
{
if (phi_nodes (e->dest))
remove_phi_args (e);
@@ -6951,14 +6581,15 @@ tree_execute_on_shrinking_pred (edge e)
on the edge by split_edge(). Later, additional edge 'e' was created to
connect 'new_head' and 'first'. Now this routine adds phi args on this
additional edge 'e' that new_head to second edge received as part of edge
- splitting.
-*/
+ splitting. */
static void
-tree_lv_adjust_loop_header_phi (basic_block first, basic_block second,
- basic_block new_head, edge e)
+gimple_lv_adjust_loop_header_phi (basic_block first, basic_block second,
+ basic_block new_head, edge e)
{
- tree phi1, phi2;
+ gimple phi1, phi2;
+ gimple_stmt_iterator psi1, psi2;
+ tree def;
edge e2 = find_edge (new_head, second);
/* Because NEW_HEAD has been created by splitting SECOND's incoming
@@ -6968,35 +6599,41 @@ tree_lv_adjust_loop_header_phi (basic_block first, basic_block second,
/* Browse all 'second' basic block phi nodes and add phi args to
edge 'e' for 'first' head. PHI args are always in correct order. */
- for (phi2 = phi_nodes (second), phi1 = phi_nodes (first);
- phi2 && phi1;
- phi2 = PHI_CHAIN (phi2), phi1 = PHI_CHAIN (phi1))
+ for (psi2 = gsi_start_phis (second),
+ psi1 = gsi_start_phis (first);
+ !gsi_end_p (psi2) && !gsi_end_p (psi1);
+ gsi_next (&psi2), gsi_next (&psi1))
{
- tree def = PHI_ARG_DEF (phi2, e2->dest_idx);
+ phi1 = gsi_stmt (psi1);
+ phi2 = gsi_stmt (psi2);
+ def = PHI_ARG_DEF (phi2, e2->dest_idx);
add_phi_arg (phi1, def, e);
}
}
+
/* Adds a if else statement to COND_BB with condition COND_EXPR.
SECOND_HEAD is the destination of the THEN and FIRST_HEAD is
the destination of the ELSE part. */
+
static void
-tree_lv_add_condition_to_bb (basic_block first_head ATTRIBUTE_UNUSED,
- basic_block second_head ATTRIBUTE_UNUSED,
- basic_block cond_bb, void *cond_e)
+gimple_lv_add_condition_to_bb (basic_block first_head ATTRIBUTE_UNUSED,
+ basic_block second_head ATTRIBUTE_UNUSED,
+ basic_block cond_bb, void *cond_e)
{
- block_stmt_iterator bsi;
- tree new_cond_expr = NULL_TREE;
+ gimple_stmt_iterator gsi;
+ gimple new_cond_expr;
tree cond_expr = (tree) cond_e;
edge e0;
/* Build new conditional expr */
- new_cond_expr = build3 (COND_EXPR, void_type_node, cond_expr,
- NULL_TREE, NULL_TREE);
+ new_cond_expr = gimple_build_cond_from_tree (cond_expr,
+ NULL_TREE, NULL_TREE);
/* Add new cond in cond_bb. */
- bsi = bsi_start (cond_bb);
- bsi_insert_after (&bsi, new_cond_expr, BSI_NEW_STMT);
+ gsi = gsi_last_bb (cond_bb);
+ gsi_insert_after (&gsi, new_cond_expr, GSI_NEW_STMT);
+
/* Adjust edges appropriately to connect new head with first head
as well as second head. */
e0 = single_succ_edge (cond_bb);
@@ -7004,34 +6641,34 @@ tree_lv_add_condition_to_bb (basic_block first_head ATTRIBUTE_UNUSED,
e0->flags |= EDGE_FALSE_VALUE;
}
-struct cfg_hooks tree_cfg_hooks = {
- "tree",
- tree_verify_flow_info,
- tree_dump_bb, /* dump_bb */
+struct cfg_hooks gimple_cfg_hooks = {
+ "gimple",
+ gimple_verify_flow_info,
+ gimple_dump_bb, /* dump_bb */
create_bb, /* create_basic_block */
- tree_redirect_edge_and_branch,/* redirect_edge_and_branch */
- tree_redirect_edge_and_branch_force,/* redirect_edge_and_branch_force */
- tree_can_remove_branch_p, /* can_remove_branch_p */
+ gimple_redirect_edge_and_branch, /* redirect_edge_and_branch */
+ gimple_redirect_edge_and_branch_force, /* redirect_edge_and_branch_force */
+ gimple_can_remove_branch_p, /* can_remove_branch_p */
remove_bb, /* delete_basic_block */
- tree_split_block, /* split_block */
- tree_move_block_after, /* move_block_after */
- tree_can_merge_blocks_p, /* can_merge_blocks_p */
- tree_merge_blocks, /* merge_blocks */
- tree_predict_edge, /* predict_edge */
- tree_predicted_by_p, /* predicted_by_p */
- tree_can_duplicate_bb_p, /* can_duplicate_block_p */
- tree_duplicate_bb, /* duplicate_block */
- tree_split_edge, /* split_edge */
- tree_make_forwarder_block, /* make_forward_block */
+ gimple_split_block, /* split_block */
+ gimple_move_block_after, /* move_block_after */
+ gimple_can_merge_blocks_p, /* can_merge_blocks_p */
+ gimple_merge_blocks, /* merge_blocks */
+ gimple_predict_edge, /* predict_edge */
+ gimple_predicted_by_p, /* predicted_by_p */
+ gimple_can_duplicate_bb_p, /* can_duplicate_block_p */
+ gimple_duplicate_bb, /* duplicate_block */
+ gimple_split_edge, /* split_edge */
+ gimple_make_forwarder_block, /* make_forward_block */
NULL, /* tidy_fallthru_edge */
- tree_block_ends_with_call_p, /* block_ends_with_call_p */
- tree_block_ends_with_condjump_p, /* block_ends_with_condjump_p */
- tree_flow_call_edges_add, /* flow_call_edges_add */
- tree_execute_on_growing_pred, /* execute_on_growing_pred */
- tree_execute_on_shrinking_pred, /* execute_on_shrinking_pred */
- tree_duplicate_loop_to_header_edge, /* duplicate loop for trees */
- tree_lv_add_condition_to_bb, /* lv_add_condition_to_bb */
- tree_lv_adjust_loop_header_phi, /* lv_adjust_loop_header_phi*/
+ gimple_block_ends_with_call_p,/* block_ends_with_call_p */
+ gimple_block_ends_with_condjump_p, /* block_ends_with_condjump_p */
+ gimple_flow_call_edges_add, /* flow_call_edges_add */
+ gimple_execute_on_growing_pred, /* execute_on_growing_pred */
+ gimple_execute_on_shrinking_pred, /* execute_on_shrinking_pred */
+ gimple_duplicate_loop_to_header_edge, /* duplicate loop for trees */
+ gimple_lv_add_condition_to_bb, /* lv_add_condition_to_bb */
+ gimple_lv_adjust_loop_header_phi, /* lv_adjust_loop_header_phi*/
extract_true_false_edges_from_block, /* extract_cond_bb_edges */
flush_pending_stmts /* flush_pending_stmts */
};
@@ -7081,39 +6718,12 @@ struct gimple_opt_pass pass_split_crit_edges =
}
};
-
-/* Return EXP if it is a valid GIMPLE rvalue, else gimplify it into
- a temporary, make sure and register it to be renamed if necessary,
- and finally return the temporary. Put the statements to compute
- EXP before the current statement in BSI. */
-
-tree
-gimplify_val (block_stmt_iterator *bsi, tree type, tree exp)
-{
- tree t, new_stmt, orig_stmt;
-
- if (is_gimple_val (exp))
- return exp;
-
- t = make_rename_temp (type, NULL);
- new_stmt = build_gimple_modify_stmt (t, exp);
-
- orig_stmt = bsi_stmt (*bsi);
- SET_EXPR_LOCUS (new_stmt, EXPR_LOCUS (orig_stmt));
- TREE_BLOCK (new_stmt) = TREE_BLOCK (orig_stmt);
-
- bsi_insert_before (bsi, new_stmt, BSI_SAME_STMT);
- if (gimple_in_ssa_p (cfun))
- mark_symbols_for_renaming (new_stmt);
-
- return t;
-}
-/* Build a ternary operation and gimplify it. Emit code before BSI.
+/* Build a ternary operation and gimplify it. Emit code before GSI.
Return the gimple_val holding the result. */
tree
-gimplify_build3 (block_stmt_iterator *bsi, enum tree_code code,
+gimplify_build3 (gimple_stmt_iterator *gsi, enum tree_code code,
tree type, tree a, tree b, tree c)
{
tree ret;
@@ -7121,14 +6731,15 @@ gimplify_build3 (block_stmt_iterator *bsi, enum tree_code code,
ret = fold_build3 (code, type, a, b, c);
STRIP_NOPS (ret);
- return gimplify_val (bsi, type, ret);
+ return force_gimple_operand_gsi (gsi, ret, true, NULL, true,
+ GSI_SAME_STMT);
}
-/* Build a binary operation and gimplify it. Emit code before BSI.
+/* Build a binary operation and gimplify it. Emit code before GSI.
Return the gimple_val holding the result. */
tree
-gimplify_build2 (block_stmt_iterator *bsi, enum tree_code code,
+gimplify_build2 (gimple_stmt_iterator *gsi, enum tree_code code,
tree type, tree a, tree b)
{
tree ret;
@@ -7136,14 +6747,15 @@ gimplify_build2 (block_stmt_iterator *bsi, enum tree_code code,
ret = fold_build2 (code, type, a, b);
STRIP_NOPS (ret);
- return gimplify_val (bsi, type, ret);
+ return force_gimple_operand_gsi (gsi, ret, true, NULL, true,
+ GSI_SAME_STMT);
}
-/* Build a unary operation and gimplify it. Emit code before BSI.
+/* Build a unary operation and gimplify it. Emit code before GSI.
Return the gimple_val holding the result. */
tree
-gimplify_build1 (block_stmt_iterator *bsi, enum tree_code code, tree type,
+gimplify_build1 (gimple_stmt_iterator *gsi, enum tree_code code, tree type,
tree a)
{
tree ret;
@@ -7151,7 +6763,8 @@ gimplify_build1 (block_stmt_iterator *bsi, enum tree_code code, tree type,
ret = fold_build1 (code, type, a);
STRIP_NOPS (ret);
- return gimplify_val (bsi, type, ret);
+ return force_gimple_operand_gsi (gsi, ret, true, NULL, true,
+ GSI_SAME_STMT);
}
@@ -7162,7 +6775,7 @@ static unsigned int
execute_warn_function_return (void)
{
source_location location;
- tree last;
+ gimple last;
edge e;
edge_iterator ei;
@@ -7174,8 +6787,8 @@ execute_warn_function_return (void)
FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds)
{
last = last_stmt (e->src);
- if (TREE_CODE (last) == RETURN_EXPR
- && (location = EXPR_LOCATION (last)) != UNKNOWN_LOCATION)
+ if (gimple_code (last) == GIMPLE_RETURN
+ && (location = gimple_location (last)) != UNKNOWN_LOCATION)
break;
}
if (location == UNKNOWN_LOCATION)
@@ -7192,12 +6805,12 @@ execute_warn_function_return (void)
{
FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds)
{
- tree last = last_stmt (e->src);
- if (TREE_CODE (last) == RETURN_EXPR
- && TREE_OPERAND (last, 0) == NULL
- && !TREE_NO_WARNING (last))
+ gimple last = last_stmt (e->src);
+ if (gimple_code (last) == GIMPLE_RETURN
+ && gimple_return_retval (last) == NULL
+ && !gimple_no_warning_p (last))
{
- location = EXPR_LOCATION (last);
+ location = gimple_location (last);
if (location == UNKNOWN_LOCATION)
location = cfun->function_end_locus;
warning_at (location, OPT_Wreturn_type, "control reaches end of non-void function");
diff --git a/gcc/tree-cfgcleanup.c b/gcc/tree-cfgcleanup.c
index 8970a9b96eb..433900c3a14 100644
--- a/gcc/tree-cfgcleanup.c
+++ b/gcc/tree-cfgcleanup.c
@@ -73,15 +73,17 @@ remove_fallthru_edge (VEC(edge,gc) *ev)
return false;
}
+
/* Disconnect an unreachable block in the control expression starting
at block BB. */
static bool
-cleanup_control_expr_graph (basic_block bb, block_stmt_iterator bsi)
+cleanup_control_expr_graph (basic_block bb, gimple_stmt_iterator gsi)
{
edge taken_edge;
bool retval = false;
- tree expr = bsi_stmt (bsi), val;
+ gimple stmt = gsi_stmt (gsi);
+ tree val;
if (!single_succ_p (bb))
{
@@ -90,26 +92,7 @@ cleanup_control_expr_graph (basic_block bb, block_stmt_iterator bsi)
bool warned;
fold_defer_overflow_warnings ();
-
- switch (TREE_CODE (expr))
- {
- case COND_EXPR:
- val = fold (COND_EXPR_COND (expr));
- break;
-
- case SWITCH_EXPR:
- val = fold (SWITCH_COND (expr));
- if (TREE_CODE (val) != INTEGER_CST)
- {
- fold_undefer_and_ignore_overflow_warnings ();
- return false;
- }
- break;
-
- default:
- gcc_unreachable ();
- }
-
+ val = gimple_fold (stmt);
taken_edge = find_taken_edge (bb, val);
if (!taken_edge)
{
@@ -126,7 +109,7 @@ cleanup_control_expr_graph (basic_block bb, block_stmt_iterator bsi)
if (!warned)
{
fold_undefer_overflow_warnings
- (true, expr, WARN_STRICT_OVERFLOW_CONDITIONAL);
+ (true, stmt, WARN_STRICT_OVERFLOW_CONDITIONAL);
warned = true;
}
@@ -147,7 +130,7 @@ cleanup_control_expr_graph (basic_block bb, block_stmt_iterator bsi)
taken_edge = single_succ_edge (bb);
bitmap_set_bit (cfgcleanup_altered_bbs, bb->index);
- bsi_remove (&bsi, true);
+ gsi_remove (&gsi, true);
taken_edge->flags = EDGE_FALLTHRU;
return retval;
@@ -159,30 +142,30 @@ cleanup_control_expr_graph (basic_block bb, block_stmt_iterator bsi)
static bool
cleanup_control_flow_bb (basic_block bb)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
bool retval = false;
- tree stmt;
+ gimple stmt;
/* If the last statement of the block could throw and now cannot,
we need to prune cfg. */
- retval |= tree_purge_dead_eh_edges (bb);
+ retval |= gimple_purge_dead_eh_edges (bb);
- bsi = bsi_last (bb);
- if (bsi_end_p (bsi))
+ gsi = gsi_last_bb (bb);
+ if (gsi_end_p (gsi))
return retval;
- stmt = bsi_stmt (bsi);
+ stmt = gsi_stmt (gsi);
- if (TREE_CODE (stmt) == COND_EXPR
- || TREE_CODE (stmt) == SWITCH_EXPR)
- retval |= cleanup_control_expr_graph (bb, bsi);
- /* If we had a computed goto which has a compile-time determinable
- destination, then we can eliminate the goto. */
- else if (TREE_CODE (stmt) == GOTO_EXPR
- && TREE_CODE (GOTO_DESTINATION (stmt)) == ADDR_EXPR
- && (TREE_CODE (TREE_OPERAND (GOTO_DESTINATION (stmt), 0))
+ if (gimple_code (stmt) == GIMPLE_COND
+ || gimple_code (stmt) == GIMPLE_SWITCH)
+ retval |= cleanup_control_expr_graph (bb, gsi);
+ else if (gimple_code (stmt) == GIMPLE_GOTO
+ && TREE_CODE (gimple_goto_dest (stmt)) == ADDR_EXPR
+ && (TREE_CODE (TREE_OPERAND (gimple_goto_dest (stmt), 0))
== LABEL_DECL))
{
+ /* If we had a computed goto which has a compile-time determinable
+ destination, then we can eliminate the goto. */
edge e;
tree label;
edge_iterator ei;
@@ -191,7 +174,7 @@ cleanup_control_flow_bb (basic_block bb)
/* First look at all the outgoing edges. Delete any outgoing
edges which do not go to the right block. For the one
edge which goes to the right block, fix up its flags. */
- label = TREE_OPERAND (GOTO_DESTINATION (stmt), 0);
+ label = TREE_OPERAND (gimple_goto_dest (stmt), 0);
target_block = label_to_block (label);
for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); )
{
@@ -213,13 +196,15 @@ cleanup_control_flow_bb (basic_block bb)
/* Remove the GOTO_EXPR as it is not needed. The CFG has all the
relevant information we need. */
- bsi_remove (&bsi, true);
+ gsi_remove (&gsi, true);
retval = true;
}
/* Check for indirect calls that have been turned into
noreturn calls. */
- else if (noreturn_call_p (stmt) && remove_fallthru_edge (bb->succs))
+ else if (is_gimple_call (stmt)
+ && gimple_call_noreturn_p (stmt)
+ && remove_fallthru_edge (bb->succs))
retval = true;
return retval;
@@ -235,7 +220,7 @@ cleanup_control_flow_bb (basic_block bb)
static bool
tree_forwarder_block_p (basic_block bb, bool phi_wanted)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
edge_iterator ei;
edge e, succ;
basic_block dest;
@@ -244,7 +229,7 @@ tree_forwarder_block_p (basic_block bb, bool phi_wanted)
if (single_succ_p (bb) != 1
/* If PHI_WANTED is false, BB must not have any PHI nodes.
Otherwise, BB must have PHI nodes. */
- || (phi_nodes (bb) != NULL_TREE) != phi_wanted
+ || gimple_seq_empty_p (phi_nodes (bb)) == phi_wanted
/* BB may not be a predecessor of EXIT_BLOCK_PTR. */
|| single_succ (bb) == EXIT_BLOCK_PTR
/* Nor should this be an infinite loop. */
@@ -259,14 +244,14 @@ tree_forwarder_block_p (basic_block bb, bool phi_wanted)
/* Now walk through the statements backward. We can ignore labels,
anything else means this is not a forwarder block. */
- for (bsi = bsi_last (bb); !bsi_end_p (bsi); bsi_prev (&bsi))
+ for (gsi = gsi_last_bb (bb); !gsi_end_p (gsi); gsi_prev (&gsi))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
- switch (TREE_CODE (stmt))
+ switch (gimple_code (stmt))
{
- case LABEL_EXPR:
- if (DECL_NONLOCAL (LABEL_EXPR_LABEL (stmt)))
+ case GIMPLE_LABEL:
+ if (DECL_NONLOCAL (gimple_label_label (stmt)))
return false;
break;
@@ -333,12 +318,13 @@ phi_alternatives_equal (basic_block dest, edge e1, edge e2)
{
int n1 = e1->dest_idx;
int n2 = e2->dest_idx;
- tree phi;
+ gimple_stmt_iterator gsi;
- for (phi = phi_nodes (dest); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (dest); !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree val1 = PHI_ARG_DEF (phi, n1);
- tree val2 = PHI_ARG_DEF (phi, n2);
+ gimple phi = gsi_stmt (gsi);
+ tree val1 = gimple_phi_arg_def (phi, n1);
+ tree val2 = gimple_phi_arg_def (phi, n2);
gcc_assert (val1 != NULL_TREE);
gcc_assert (val2 != NULL_TREE);
@@ -357,10 +343,9 @@ remove_forwarder_block (basic_block bb)
{
edge succ = single_succ_edge (bb), e, s;
basic_block dest = succ->dest;
- tree label;
- tree phi;
+ gimple label;
edge_iterator ei;
- block_stmt_iterator bsi, bsi_to;
+ gimple_stmt_iterator gsi, gsi_to;
bool seen_abnormal_edge = false;
/* We check for infinite loops already in tree_forwarder_block_p.
@@ -373,8 +358,8 @@ remove_forwarder_block (basic_block bb)
it. */
label = first_stmt (dest);
if (label
- && TREE_CODE (label) == LABEL_EXPR
- && DECL_NONLOCAL (LABEL_EXPR_LABEL (label)))
+ && gimple_code (label) == GIMPLE_LABEL
+ && DECL_NONLOCAL (gimple_label_label (label)))
return false;
/* If there is an abnormal edge to basic block BB, but not into
@@ -393,14 +378,14 @@ remove_forwarder_block (basic_block bb)
seen_abnormal_edge = true;
if (has_abnormal_incoming_edge_p (dest)
- || phi_nodes (dest) != NULL_TREE)
+ || !gimple_seq_empty_p (phi_nodes (dest)))
return false;
}
/* If there are phi nodes in DEST, and some of the blocks that are
predecessors of BB are also predecessors of DEST, check that the
phi node arguments match. */
- if (phi_nodes (dest))
+ if (!gimple_seq_empty_p (phi_nodes (dest)))
{
FOR_EACH_EDGE (e, ei, bb->preds)
{
@@ -431,8 +416,13 @@ remove_forwarder_block (basic_block bb)
{
/* Create arguments for the phi nodes, since the edge was not
here before. */
- for (phi = phi_nodes (dest); phi; phi = PHI_CHAIN (phi))
- add_phi_arg (phi, PHI_ARG_DEF (phi, succ->dest_idx), s);
+ for (gsi = gsi_start_phis (dest);
+ !gsi_end_p (gsi);
+ gsi_next (&gsi))
+ {
+ gimple phi = gsi_stmt (gsi);
+ add_phi_arg (phi, gimple_phi_arg_def (phi, succ->dest_idx), s);
+ }
}
}
@@ -440,14 +430,13 @@ remove_forwarder_block (basic_block bb)
{
/* Move the labels to the new block, so that the redirection of
the abnormal edges works. */
-
- bsi_to = bsi_start (dest);
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); )
+ gsi_to = gsi_start_bb (dest);
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); )
{
- label = bsi_stmt (bsi);
- gcc_assert (TREE_CODE (label) == LABEL_EXPR);
- bsi_remove (&bsi, false);
- bsi_insert_before (&bsi_to, label, BSI_CONTINUE_LINKING);
+ label = gsi_stmt (gsi);
+ gcc_assert (gimple_code (label) == GIMPLE_LABEL);
+ gsi_remove (&gsi, false);
+ gsi_insert_before (&gsi_to, label, GSI_CONTINUE_LINKING);
}
}
@@ -485,18 +474,18 @@ static bool
split_bbs_on_noreturn_calls (void)
{
bool changed = false;
- tree stmt;
+ gimple stmt;
basic_block bb;
/* Detect cases where a mid-block call is now known not to return. */
if (cfun->gimple_df)
- while (VEC_length (tree, MODIFIED_NORETURN_CALLS (cfun)))
+ while (VEC_length (gimple, MODIFIED_NORETURN_CALLS (cfun)))
{
- stmt = VEC_pop (tree, MODIFIED_NORETURN_CALLS (cfun));
- bb = bb_for_stmt (stmt);
+ stmt = VEC_pop (gimple, MODIFIED_NORETURN_CALLS (cfun));
+ bb = gimple_bb (stmt);
if (bb == NULL
|| last_stmt (bb) == stmt
- || !noreturn_call_p (stmt))
+ || !gimple_call_noreturn_p (stmt))
continue;
changed = true;
@@ -507,23 +496,23 @@ split_bbs_on_noreturn_calls (void)
return changed;
}
-/* If OMP_RETURN in basic block BB is unreachable, remove it. */
+/* If GIMPLE_OMP_RETURN in basic block BB is unreachable, remove it. */
static bool
cleanup_omp_return (basic_block bb)
{
- tree stmt = last_stmt (bb);
+ gimple stmt = last_stmt (bb);
basic_block control_bb;
- if (stmt == NULL_TREE
- || TREE_CODE (stmt) != OMP_RETURN
+ if (stmt == NULL
+ || gimple_code (stmt) != GIMPLE_OMP_RETURN
|| !single_pred_p (bb))
return false;
control_bb = single_pred (bb);
stmt = last_stmt (control_bb);
- if (TREE_CODE (stmt) != OMP_SECTIONS_SWITCH)
+ if (gimple_code (stmt) != GIMPLE_OMP_SECTIONS_SWITCH)
return false;
/* The block with the control statement normally has two entry edges -- one
@@ -553,7 +542,6 @@ cleanup_tree_cfg_bb (basic_block bb)
/* Forwarder blocks can carry line number information which is
useful when debugging, so we only clean them up when
optimizing. */
-
if (optimize > 0
&& tree_forwarder_block_p (bb, false)
&& remove_forwarder_block (bb))
@@ -716,7 +704,7 @@ remove_forwarder_block_with_phi (basic_block bb)
{
edge succ = single_succ_edge (bb);
basic_block dest = succ->dest;
- tree label;
+ gimple label;
basic_block dombb, domdest, dom;
/* We check for infinite loops already in tree_forwarder_block_p.
@@ -729,15 +717,15 @@ remove_forwarder_block_with_phi (basic_block bb)
merge it. */
label = first_stmt (dest);
if (label
- && TREE_CODE (label) == LABEL_EXPR
- && DECL_NONLOCAL (LABEL_EXPR_LABEL (label)))
+ && gimple_code (label) == GIMPLE_LABEL
+ && DECL_NONLOCAL (gimple_label_label (label)))
return;
/* Redirect each incoming edge to BB to DEST. */
while (EDGE_COUNT (bb->preds) > 0)
{
edge e = EDGE_PRED (bb, 0), s;
- tree phi;
+ gimple_stmt_iterator gsi;
s = find_edge (e->src, dest);
if (s)
@@ -765,9 +753,12 @@ remove_forwarder_block_with_phi (basic_block bb)
/* Add to the PHI nodes at DEST each PHI argument removed at the
destination of E. */
- for (phi = phi_nodes (dest); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (dest);
+ !gsi_end_p (gsi);
+ gsi_next (&gsi))
{
- tree def = PHI_ARG_DEF (phi, succ->dest_idx);
+ gimple phi = gsi_stmt (gsi);
+ tree def = gimple_phi_arg_def (phi, succ->dest_idx);
if (TREE_CODE (def) == SSA_NAME)
{
@@ -879,7 +870,7 @@ merge_phi_nodes (void)
}
else
{
- tree phi;
+ gimple_stmt_iterator gsi;
unsigned int dest_idx = single_succ_edge (bb)->dest_idx;
/* BB dominates DEST. There may be many users of the PHI
@@ -887,11 +878,13 @@ merge_phi_nodes (void)
can handle. If the result of every PHI in BB is used
only by a PHI in DEST, then we can trivially merge the
PHI nodes from BB into DEST. */
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
+ gsi_next (&gsi))
{
- tree result = PHI_RESULT (phi);
+ gimple phi = gsi_stmt (gsi);
+ tree result = gimple_phi_result (phi);
use_operand_p imm_use;
- tree use_stmt;
+ gimple use_stmt;
/* If the PHI's result is never used, then we can just
ignore it. */
@@ -900,15 +893,15 @@ merge_phi_nodes (void)
/* Get the single use of the result of this PHI node. */
if (!single_imm_use (result, &imm_use, &use_stmt)
- || TREE_CODE (use_stmt) != PHI_NODE
- || bb_for_stmt (use_stmt) != dest
- || PHI_ARG_DEF (use_stmt, dest_idx) != result)
+ || gimple_code (use_stmt) != GIMPLE_PHI
+ || gimple_bb (use_stmt) != dest
+ || gimple_phi_arg_def (use_stmt, dest_idx) != result)
break;
}
/* If the loop above iterated through all the PHI nodes
in BB, then we can merge the PHIs from BB into DEST. */
- if (!phi)
+ if (gsi_end_p (gsi))
*current++ = bb;
}
}
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index 295fb7920c9..da359529e4c 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -343,9 +343,9 @@ chrec_fold_plus (tree type,
return chrec_fold_automatically_generated_operands (op0, op1);
if (integer_zerop (op0))
- return chrec_convert (type, op1, NULL_TREE);
+ return chrec_convert (type, op1, NULL);
if (integer_zerop (op1))
- return chrec_convert (type, op0, NULL_TREE);
+ return chrec_convert (type, op0, NULL);
if (POINTER_TYPE_P (type))
code = POINTER_PLUS_EXPR;
@@ -577,10 +577,9 @@ chrec_apply (unsigned var,
if (evolution_function_is_affine_p (chrec))
{
/* "{a, +, b} (x)" -> "a + b*x". */
- x = chrec_convert_rhs (type, x, NULL_TREE);
+ 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)
@@ -1115,7 +1114,7 @@ avoid_arithmetics_in_type_p (const_tree type)
return false;
}
-static tree chrec_convert_1 (tree, tree, tree, bool);
+static tree chrec_convert_1 (tree, tree, gimple, bool);
/* Converts BASE and STEP of affine scev to TYPE. LOOP is the loop whose iv
the scev corresponds to. AT_STMT is the statement at that the scev is
@@ -1127,7 +1126,7 @@ static tree chrec_convert_1 (tree, tree, tree, bool);
bool
convert_affine_scev (struct loop *loop, tree type,
- tree *base, tree *step, tree at_stmt,
+ tree *base, tree *step, gimple at_stmt,
bool use_overflow_semantics)
{
tree ct = TREE_TYPE (*step);
@@ -1228,7 +1227,7 @@ convert_affine_scev (struct loop *loop, tree type,
/* Convert CHREC for the right hand side of a CREC.
The increment for a pointer type is always sizetype. */
tree
-chrec_convert_rhs (tree type, tree chrec, tree at_stmt)
+chrec_convert_rhs (tree type, tree chrec, gimple at_stmt)
{
if (POINTER_TYPE_P (type))
type = sizetype;
@@ -1260,7 +1259,7 @@ chrec_convert_rhs (tree type, tree chrec, tree at_stmt)
*/
tree
-chrec_convert (tree type, tree chrec, tree at_stmt)
+chrec_convert (tree type, tree chrec, gimple at_stmt)
{
return chrec_convert_1 (type, chrec, at_stmt, true);
}
@@ -1278,7 +1277,7 @@ chrec_convert (tree type, tree chrec, tree at_stmt)
tests, but also to enforce that the result follows them. */
static tree
-chrec_convert_1 (tree type, tree chrec, tree at_stmt,
+chrec_convert_1 (tree type, tree chrec, gimple at_stmt,
bool use_overflow_semantics)
{
tree ct, res;
@@ -1352,10 +1351,10 @@ chrec_convert_aggressive (tree type, tree chrec)
right = CHREC_RIGHT (chrec);
lc = chrec_convert_aggressive (type, left);
if (!lc)
- lc = chrec_convert (type, left, NULL_TREE);
+ lc = chrec_convert (type, left, NULL);
rc = chrec_convert_aggressive (rtype, right);
if (!rc)
- rc = chrec_convert (rtype, right, NULL_TREE);
+ rc = chrec_convert (rtype, right, NULL);
return build_polynomial_chrec (CHREC_VARIABLE (chrec), lc, rc);
}
diff --git a/gcc/tree-chrec.h b/gcc/tree-chrec.h
index 7f240c6c739..9000fb7dab4 100644
--- a/gcc/tree-chrec.h
+++ b/gcc/tree-chrec.h
@@ -57,8 +57,8 @@ tree_is_chrec (const_tree expr)
extern tree chrec_fold_plus (tree, tree, tree);
extern tree chrec_fold_minus (tree, tree, tree);
extern tree chrec_fold_multiply (tree, tree, tree);
-extern tree chrec_convert (tree, tree, tree);
-extern tree chrec_convert_rhs (tree, tree, tree);
+extern tree chrec_convert (tree, tree, gimple);
+extern tree chrec_convert_rhs (tree, tree, gimple);
extern tree chrec_convert_aggressive (tree, tree);
/* Operations. */
diff --git a/gcc/tree-complex.c b/gcc/tree-complex.c
index 0fc1cc5f305..bbf4c494218 100644
--- a/gcc/tree-complex.c
+++ b/gcc/tree-complex.c
@@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "real.h"
#include "flags.h"
#include "tree-flow.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-iterator.h"
#include "tree-pass.h"
#include "tree-ssa-propagate.h"
@@ -104,16 +104,37 @@ some_nonzerop (tree t)
return !zerop;
}
-/* Compute a lattice value from T. It may be a gimple_val, or, as a
- special exception, a COMPLEX_EXPR. */
+
+/* Compute a lattice value from the components of a complex type REAL
+ and IMAG. */
static complex_lattice_t
-find_lattice_value (tree t)
+find_lattice_value_parts (tree real, tree imag)
{
- tree real, imag;
int r, i;
complex_lattice_t ret;
+ r = some_nonzerop (real);
+ i = some_nonzerop (imag);
+ ret = r * ONLY_REAL + i * ONLY_IMAG;
+
+ /* ??? On occasion we could do better than mapping 0+0i to real, but we
+ certainly don't want to leave it UNINITIALIZED, which eventually gets
+ mapped to VARYING. */
+ if (ret == UNINITIALIZED)
+ ret = ONLY_REAL;
+
+ return ret;
+}
+
+
+/* Compute a lattice value from gimple_val T. */
+
+static complex_lattice_t
+find_lattice_value (tree t)
+{
+ tree real, imag;
+
switch (TREE_CODE (t))
{
case SSA_NAME:
@@ -125,26 +146,11 @@ find_lattice_value (tree t)
imag = TREE_IMAGPART (t);
break;
- case COMPLEX_EXPR:
- real = TREE_OPERAND (t, 0);
- imag = TREE_OPERAND (t, 1);
- break;
-
default:
gcc_unreachable ();
}
- r = some_nonzerop (real);
- i = some_nonzerop (imag);
- ret = r*ONLY_REAL + i*ONLY_IMAG;
-
- /* ??? On occasion we could do better than mapping 0+0i to real, but we
- certainly don't want to leave it UNINITIALIZED, which eventually gets
- mapped to VARYING. */
- if (ret == UNINITIALIZED)
- ret = ONLY_REAL;
-
- return ret;
+ return find_lattice_value_parts (real, imag);
}
/* Determine if LHS is something for which we're interested in seeing
@@ -171,66 +177,72 @@ init_parameter_lattice_values (void)
SSA_NAME_VERSION (ssa_name), VARYING);
}
-/* Initialize DONT_SIMULATE_AGAIN for each stmt and phi. Return false if
- we found no statements we want to simulate, and thus there's nothing for
- the entire pass to do. */
+/* Initialize simulation state for each statement. Return false if we
+ found no statements we want to simulate, and thus there's nothing
+ for the entire pass to do. */
static bool
init_dont_simulate_again (void)
{
basic_block bb;
- block_stmt_iterator bsi;
- tree phi;
+ gimple_stmt_iterator gsi;
+ gimple phi;
bool saw_a_complex_op = false;
FOR_EACH_BB (bb)
{
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- DONT_SIMULATE_AGAIN (phi) = !is_complex_reg (PHI_RESULT (phi));
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ phi = gsi_stmt (gsi);
+ prop_set_simulate_again (phi,
+ is_complex_reg (gimple_phi_result (phi)));
+ }
- 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))
{
- tree orig_stmt, stmt, rhs = NULL;
- bool dsa;
+ gimple stmt;
+ tree op0, op1;
+ bool sim_again_p;
- orig_stmt = stmt = bsi_stmt (bsi);
+ stmt = gsi_stmt (gsi);
+ op0 = op1 = NULL_TREE;
/* Most control-altering statements must be initially
simulated, else we won't cover the entire cfg. */
- dsa = !stmt_ends_bb_p (stmt);
+ sim_again_p = stmt_ends_bb_p (stmt);
- switch (TREE_CODE (stmt))
+ switch (gimple_code (stmt))
{
- case RETURN_EXPR:
- /* We don't care what the lattice value of <retval> is,
- since it's never used as an input to another computation. */
- dsa = true;
- stmt = TREE_OPERAND (stmt, 0);
- if (!stmt || TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
- break;
- /* FALLTHRU */
+ case GIMPLE_CALL:
+ if (gimple_call_lhs (stmt))
+ sim_again_p = is_complex_reg (gimple_call_lhs (stmt));
+ break;
- case GIMPLE_MODIFY_STMT:
- dsa = !is_complex_reg (GIMPLE_STMT_OPERAND (stmt, 0));
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ case GIMPLE_ASSIGN:
+ sim_again_p = is_complex_reg (gimple_assign_lhs (stmt));
+ if (gimple_assign_rhs_code (stmt) == REALPART_EXPR
+ || gimple_assign_rhs_code (stmt) == IMAGPART_EXPR)
+ op0 = TREE_OPERAND (gimple_assign_rhs1 (stmt), 0);
+ else
+ op0 = gimple_assign_rhs1 (stmt);
+ if (gimple_num_ops (stmt) > 2)
+ op1 = gimple_assign_rhs2 (stmt);
break;
- case COND_EXPR:
- rhs = TREE_OPERAND (stmt, 0);
+ case GIMPLE_COND:
+ op0 = gimple_cond_lhs (stmt);
+ op1 = gimple_cond_rhs (stmt);
break;
default:
break;
}
- if (rhs)
- switch (TREE_CODE (rhs))
+ if (op0 || op1)
+ switch (gimple_expr_code (stmt))
{
case EQ_EXPR:
case NE_EXPR:
- rhs = TREE_OPERAND (rhs, 0);
- /* FALLTHRU */
-
case PLUS_EXPR:
case MINUS_EXPR:
case MULT_EXPR:
@@ -239,20 +251,25 @@ init_dont_simulate_again (void)
case FLOOR_DIV_EXPR:
case ROUND_DIV_EXPR:
case RDIV_EXPR:
+ if (TREE_CODE (TREE_TYPE (op0)) == COMPLEX_TYPE
+ || TREE_CODE (TREE_TYPE (op1)) == COMPLEX_TYPE)
+ saw_a_complex_op = true;
+ break;
+
case NEGATE_EXPR:
case CONJ_EXPR:
- if (TREE_CODE (TREE_TYPE (rhs)) == COMPLEX_TYPE)
+ if (TREE_CODE (TREE_TYPE (op0)) == COMPLEX_TYPE)
saw_a_complex_op = true;
break;
case REALPART_EXPR:
case IMAGPART_EXPR:
/* The total store transformation performed during
- gimplification creates such uninitialized loads
- and we need to lower the statement to be able
- to fix things up. */
- if (TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME
- && ssa_undefined_value_p (TREE_OPERAND (rhs, 0)))
+ gimplification creates such uninitialized loads
+ and we need to lower the statement to be able
+ to fix things up. */
+ if (TREE_CODE (op0) == SSA_NAME
+ && ssa_undefined_value_p (op0))
saw_a_complex_op = true;
break;
@@ -260,7 +277,7 @@ init_dont_simulate_again (void)
break;
}
- DONT_SIMULATE_AGAIN (orig_stmt) = dsa;
+ prop_set_simulate_again (stmt, sim_again_p);
}
}
@@ -271,19 +288,18 @@ init_dont_simulate_again (void)
/* Evaluate statement STMT against the complex lattice defined above. */
static enum ssa_prop_result
-complex_visit_stmt (tree stmt, edge *taken_edge_p ATTRIBUTE_UNUSED,
+complex_visit_stmt (gimple stmt, edge *taken_edge_p ATTRIBUTE_UNUSED,
tree *result_p)
{
complex_lattice_t new_l, old_l, op1_l, op2_l;
unsigned int ver;
- tree lhs, rhs;
+ tree lhs;
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ lhs = gimple_get_lhs (stmt);
+ /* Skip anything but GIMPLE_ASSIGN and GIMPLE_CALL with a lhs. */
+ if (!lhs)
return SSA_PROP_VARYING;
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
-
/* These conditions should be satisfied due to the initial filter
set up in init_dont_simulate_again. */
gcc_assert (TREE_CODE (lhs) == SSA_NAME);
@@ -293,18 +309,22 @@ complex_visit_stmt (tree stmt, edge *taken_edge_p ATTRIBUTE_UNUSED,
ver = SSA_NAME_VERSION (lhs);
old_l = VEC_index (complex_lattice_t, complex_lattice_values, ver);
- switch (TREE_CODE (rhs))
+ switch (gimple_expr_code (stmt))
{
case SSA_NAME:
- case COMPLEX_EXPR:
case COMPLEX_CST:
- new_l = find_lattice_value (rhs);
+ new_l = find_lattice_value (gimple_assign_rhs1 (stmt));
+ break;
+
+ case COMPLEX_EXPR:
+ new_l = find_lattice_value_parts (gimple_assign_rhs1 (stmt),
+ gimple_assign_rhs2 (stmt));
break;
case PLUS_EXPR:
case MINUS_EXPR:
- op1_l = find_lattice_value (TREE_OPERAND (rhs, 0));
- op2_l = find_lattice_value (TREE_OPERAND (rhs, 1));
+ op1_l = find_lattice_value (gimple_assign_rhs1 (stmt));
+ op2_l = find_lattice_value (gimple_assign_rhs2 (stmt));
/* We've set up the lattice values such that IOR neatly
models addition. */
@@ -317,8 +337,8 @@ complex_visit_stmt (tree stmt, edge *taken_edge_p ATTRIBUTE_UNUSED,
case CEIL_DIV_EXPR:
case FLOOR_DIV_EXPR:
case ROUND_DIV_EXPR:
- op1_l = find_lattice_value (TREE_OPERAND (rhs, 0));
- op2_l = find_lattice_value (TREE_OPERAND (rhs, 1));
+ op1_l = find_lattice_value (gimple_assign_rhs1 (stmt));
+ op2_l = find_lattice_value (gimple_assign_rhs2 (stmt));
/* Obviously, if either varies, so does the result. */
if (op1_l == VARYING || op2_l == VARYING)
@@ -344,7 +364,7 @@ complex_visit_stmt (tree stmt, edge *taken_edge_p ATTRIBUTE_UNUSED,
case NEGATE_EXPR:
case CONJ_EXPR:
- new_l = find_lattice_value (TREE_OPERAND (rhs, 0));
+ new_l = find_lattice_value (gimple_assign_rhs1 (stmt));
break;
default:
@@ -363,14 +383,14 @@ complex_visit_stmt (tree stmt, edge *taken_edge_p ATTRIBUTE_UNUSED,
/* Evaluate a PHI node against the complex lattice defined above. */
static enum ssa_prop_result
-complex_visit_phi (tree phi)
+complex_visit_phi (gimple phi)
{
complex_lattice_t new_l, old_l;
unsigned int ver;
tree lhs;
int i;
- lhs = PHI_RESULT (phi);
+ lhs = gimple_phi_result (phi);
/* This condition should be satisfied due to the initial filter
set up in init_dont_simulate_again. */
@@ -378,8 +398,8 @@ complex_visit_phi (tree phi)
/* We've set up the lattice values such that IOR neatly models PHI meet. */
new_l = UNINITIALIZED;
- for (i = PHI_NUM_ARGS (phi) - 1; i >= 0; --i)
- new_l |= find_lattice_value (PHI_ARG_DEF (phi, i));
+ for (i = gimple_phi_num_args (phi) - 1; i >= 0; --i)
+ new_l |= find_lattice_value (gimple_phi_arg_def (phi, i));
ver = SSA_NAME_VERSION (lhs);
old_l = VEC_index (complex_lattice_t, complex_lattice_values, ver);
@@ -475,7 +495,7 @@ get_component_ssa_name (tree ssa_name, bool imag_p)
SSA_NAME_OCCURS_IN_ABNORMAL_PHI (ret)
= SSA_NAME_OCCURS_IN_ABNORMAL_PHI (ssa_name);
if (TREE_CODE (SSA_NAME_VAR (ssa_name)) == VAR_DECL
- && IS_EMPTY_STMT (SSA_NAME_DEF_STMT (ssa_name)))
+ && gimple_nop_p (SSA_NAME_DEF_STMT (ssa_name)))
{
SSA_NAME_DEF_STMT (ret) = SSA_NAME_DEF_STMT (ssa_name);
set_default_def (SSA_NAME_VAR (ret), ret);
@@ -487,15 +507,17 @@ get_component_ssa_name (tree ssa_name, bool imag_p)
return ret;
}
-/* Set a value for a complex component of SSA_NAME, return a STMT_LIST of
- stuff that needs doing. */
+/* Set a value for a complex component of SSA_NAME, return a
+ gimple_seq of stuff that needs doing. */
-static tree
+static gimple_seq
set_component_ssa_name (tree ssa_name, bool imag_p, tree value)
{
complex_lattice_t lattice = find_lattice_value (ssa_name);
size_t ssa_name_index;
- tree comp, list, last;
+ tree comp;
+ gimple last;
+ gimple_seq list;
/* We know the value must be zero, else there's a bug in our lattice
analysis. But the value may well be a variable known to contain
@@ -542,22 +564,21 @@ set_component_ssa_name (tree ssa_name, bool imag_p, tree value)
comp = get_component_ssa_name (ssa_name, imag_p);
/* Do all the work to assign VALUE to COMP. */
+ list = NULL;
value = force_gimple_operand (value, &list, false, NULL);
- last = build_gimple_modify_stmt (comp, value);
- append_to_statement_list (last, &list);
-
- gcc_assert (SSA_NAME_DEF_STMT (comp) == NULL);
- SSA_NAME_DEF_STMT (comp) = last;
+ last = gimple_build_assign (comp, value);
+ gimple_seq_add_stmt (&list, last);
+ gcc_assert (SSA_NAME_DEF_STMT (comp) == last);
return list;
}
/* Extract the real or imaginary part of a complex variable or constant.
Make sure that it's a proper gimple_val and gimplify it if not.
- Emit any new code before BSI. */
+ Emit any new code before gsi. */
static tree
-extract_component (block_stmt_iterator *bsi, tree t, bool imagpart_p,
+extract_component (gimple_stmt_iterator *gsi, tree t, bool imagpart_p,
bool gimple_p)
{
switch (TREE_CODE (t))
@@ -566,7 +587,7 @@ extract_component (block_stmt_iterator *bsi, tree t, bool imagpart_p,
return imagpart_p ? TREE_IMAGPART (t) : TREE_REALPART (t);
case COMPLEX_EXPR:
- return TREE_OPERAND (t, imagpart_p);
+ gcc_unreachable ();
case VAR_DECL:
case RESULT_DECL:
@@ -581,7 +602,8 @@ extract_component (block_stmt_iterator *bsi, tree t, bool imagpart_p,
inner_type, unshare_expr (t));
if (gimple_p)
- t = gimplify_val (bsi, inner_type, t);
+ t = force_gimple_operand_gsi (gsi, t, true, NULL, true,
+ GSI_SAME_STMT);
return t;
}
@@ -597,53 +619,53 @@ extract_component (block_stmt_iterator *bsi, tree t, bool imagpart_p,
/* Update the complex components of the ssa name on the lhs of STMT. */
static void
-update_complex_components (block_stmt_iterator *bsi, tree stmt, tree r, tree i)
+update_complex_components (gimple_stmt_iterator *gsi, gimple stmt, tree r,
+ tree i)
{
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- tree list;
+ tree lhs;
+ gimple_seq list;
+
+ lhs = gimple_get_lhs (stmt);
list = set_component_ssa_name (lhs, false, r);
if (list)
- bsi_insert_after (bsi, list, BSI_CONTINUE_LINKING);
+ gsi_insert_seq_after (gsi, list, GSI_CONTINUE_LINKING);
list = set_component_ssa_name (lhs, true, i);
if (list)
- bsi_insert_after (bsi, list, BSI_CONTINUE_LINKING);
+ gsi_insert_seq_after (gsi, list, GSI_CONTINUE_LINKING);
}
static void
update_complex_components_on_edge (edge e, tree lhs, tree r, tree i)
{
- tree list;
+ gimple_seq list;
list = set_component_ssa_name (lhs, false, r);
if (list)
- bsi_insert_on_edge (e, list);
+ gsi_insert_seq_on_edge (e, list);
list = set_component_ssa_name (lhs, true, i);
if (list)
- bsi_insert_on_edge (e, list);
+ gsi_insert_seq_on_edge (e, list);
}
+
/* Update an assignment to a complex variable in place. */
static void
-update_complex_assignment (block_stmt_iterator *bsi, tree r, tree i)
+update_complex_assignment (gimple_stmt_iterator *gsi, tree r, tree i)
{
- tree stmt, mod;
- tree type;
-
- mod = stmt = bsi_stmt (*bsi);
- if (TREE_CODE (stmt) == RETURN_EXPR)
- mod = TREE_OPERAND (mod, 0);
- else if (gimple_in_ssa_p (cfun))
- update_complex_components (bsi, stmt, r, i);
-
- type = TREE_TYPE (GIMPLE_STMT_OPERAND (mod, 1));
- GIMPLE_STMT_OPERAND (mod, 1) = build2 (COMPLEX_EXPR, type, r, i);
- update_stmt (stmt);
+ gimple_stmt_iterator orig_si = *gsi;
+
+ if (gimple_in_ssa_p (cfun))
+ update_complex_components (gsi, gsi_stmt (*gsi), r, i);
+
+ gimple_assign_set_rhs_with_ops (&orig_si, COMPLEX_EXPR, r, i);
+ update_stmt (gsi_stmt (orig_si));
}
+
/* Generate code at the entry point of the function to initialize the
component variables for a complex parameter. */
@@ -678,49 +700,54 @@ update_parameter_components (void)
static void
update_phi_components (basic_block bb)
{
- tree phi;
+ gimple_stmt_iterator gsi;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- if (is_complex_reg (PHI_RESULT (phi)))
- {
- tree lr, li, pr = NULL, pi = NULL;
- unsigned int i, n;
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple phi = gsi_stmt (gsi);
- lr = get_component_ssa_name (PHI_RESULT (phi), false);
- if (TREE_CODE (lr) == SSA_NAME)
- {
- pr = create_phi_node (lr, bb);
- SSA_NAME_DEF_STMT (lr) = pr;
- }
+ if (is_complex_reg (gimple_phi_result (phi)))
+ {
+ tree lr, li;
+ gimple pr = NULL, pi = NULL;
+ unsigned int i, n;
- li = get_component_ssa_name (PHI_RESULT (phi), true);
- if (TREE_CODE (li) == SSA_NAME)
- {
- pi = create_phi_node (li, bb);
- SSA_NAME_DEF_STMT (li) = pi;
- }
-
- for (i = 0, n = PHI_NUM_ARGS (phi); i < n; ++i)
- {
- tree comp, arg = PHI_ARG_DEF (phi, i);
- if (pr)
- {
- comp = extract_component (NULL, arg, false, false);
- SET_PHI_ARG_DEF (pr, i, comp);
- }
- if (pi)
- {
- comp = extract_component (NULL, arg, true, false);
- SET_PHI_ARG_DEF (pi, i, comp);
- }
- }
- }
+ lr = get_component_ssa_name (gimple_phi_result (phi), false);
+ if (TREE_CODE (lr) == SSA_NAME)
+ {
+ pr = create_phi_node (lr, bb);
+ SSA_NAME_DEF_STMT (lr) = pr;
+ }
+
+ li = get_component_ssa_name (gimple_phi_result (phi), true);
+ if (TREE_CODE (li) == SSA_NAME)
+ {
+ pi = create_phi_node (li, bb);
+ SSA_NAME_DEF_STMT (li) = pi;
+ }
+
+ for (i = 0, n = gimple_phi_num_args (phi); i < n; ++i)
+ {
+ tree comp, arg = gimple_phi_arg_def (phi, i);
+ if (pr)
+ {
+ comp = extract_component (NULL, arg, false, false);
+ SET_PHI_ARG_DEF (pr, i, comp);
+ }
+ if (pi)
+ {
+ comp = extract_component (NULL, arg, true, false);
+ SET_PHI_ARG_DEF (pi, i, comp);
+ }
+ }
+ }
+ }
}
/* Mark each virtual op in STMT for ssa update. */
static void
-update_all_vops (tree stmt)
+update_all_vops (gimple stmt)
{
ssa_op_iter iter;
tree sym;
@@ -733,18 +760,35 @@ update_all_vops (tree stmt)
}
}
+
/* Expand a complex move to scalars. */
static void
-expand_complex_move (block_stmt_iterator *bsi, tree stmt, tree type,
- tree lhs, tree rhs)
+expand_complex_move (gimple_stmt_iterator *gsi, tree type)
{
tree inner_type = TREE_TYPE (type);
- tree r, i;
+ tree r, i, lhs, rhs;
+ gimple stmt = gsi_stmt (*gsi);
+
+ if (is_gimple_assign (stmt))
+ {
+ lhs = gimple_assign_lhs (stmt);
+ if (gimple_num_ops (stmt) == 2)
+ rhs = gimple_assign_rhs1 (stmt);
+ else
+ rhs = NULL_TREE;
+ }
+ else if (is_gimple_call (stmt))
+ {
+ lhs = gimple_call_lhs (stmt);
+ rhs = NULL_TREE;
+ }
+ else
+ gcc_unreachable ();
if (TREE_CODE (lhs) == SSA_NAME)
{
- if (is_ctrl_altering_stmt (bsi_stmt (*bsi)))
+ if (is_ctrl_altering_stmt (stmt))
{
edge_iterator ei;
edge e;
@@ -752,7 +796,7 @@ expand_complex_move (block_stmt_iterator *bsi, tree stmt, tree type,
/* The value is not assigned on the exception edges, so we need not
concern ourselves there. We do need to update on the fallthru
edge. Find it. */
- FOR_EACH_EDGE (e, ei, bsi->bb->succs)
+ FOR_EACH_EDGE (e, ei, gsi_bb (*gsi)->succs)
if (e->flags & EDGE_FALLTHRU)
goto found_fallthru;
gcc_unreachable ();
@@ -762,47 +806,57 @@ expand_complex_move (block_stmt_iterator *bsi, tree stmt, tree type,
i = build1 (IMAGPART_EXPR, inner_type, lhs);
update_complex_components_on_edge (e, lhs, r, i);
}
- else if (TREE_CODE (rhs) == CALL_EXPR || TREE_SIDE_EFFECTS (rhs)
- || TREE_CODE (rhs) == PAREN_EXPR)
+ else if (is_gimple_call (stmt)
+ || gimple_has_side_effects (stmt)
+ || gimple_assign_rhs_code (stmt) == PAREN_EXPR)
{
r = build1 (REALPART_EXPR, inner_type, lhs);
i = build1 (IMAGPART_EXPR, inner_type, lhs);
- update_complex_components (bsi, stmt, r, i);
+ update_complex_components (gsi, stmt, r, i);
}
else
{
- update_all_vops (bsi_stmt (*bsi));
- r = extract_component (bsi, rhs, 0, true);
- i = extract_component (bsi, rhs, 1, true);
- update_complex_assignment (bsi, r, i);
+ update_all_vops (stmt);
+ if (gimple_assign_rhs_code (stmt) != COMPLEX_EXPR)
+ {
+ r = extract_component (gsi, rhs, 0, true);
+ i = extract_component (gsi, rhs, 1, true);
+ }
+ else
+ {
+ r = gimple_assign_rhs1 (stmt);
+ i = gimple_assign_rhs2 (stmt);
+ }
+ update_complex_assignment (gsi, r, i);
}
}
- else if (TREE_CODE (rhs) == SSA_NAME && !TREE_SIDE_EFFECTS (lhs))
+ else if (rhs && TREE_CODE (rhs) == SSA_NAME && !TREE_SIDE_EFFECTS (lhs))
{
tree x;
+ gimple t;
- r = extract_component (bsi, rhs, 0, false);
- i = extract_component (bsi, rhs, 1, false);
+ r = extract_component (gsi, rhs, 0, false);
+ i = extract_component (gsi, rhs, 1, false);
x = build1 (REALPART_EXPR, inner_type, unshare_expr (lhs));
- x = build_gimple_modify_stmt (x, r);
- bsi_insert_before (bsi, x, BSI_SAME_STMT);
+ t = gimple_build_assign (x, r);
+ gsi_insert_before (gsi, t, GSI_SAME_STMT);
- if (stmt == bsi_stmt (*bsi))
+ if (stmt == gsi_stmt (*gsi))
{
x = build1 (IMAGPART_EXPR, inner_type, unshare_expr (lhs));
- GIMPLE_STMT_OPERAND (stmt, 0) = x;
- GIMPLE_STMT_OPERAND (stmt, 1) = i;
+ gimple_assign_set_lhs (stmt, x);
+ gimple_assign_set_rhs1 (stmt, i);
}
else
{
x = build1 (IMAGPART_EXPR, inner_type, unshare_expr (lhs));
- x = build_gimple_modify_stmt (x, i);
- bsi_insert_before (bsi, x, BSI_SAME_STMT);
+ t = gimple_build_assign (x, i);
+ gsi_insert_before (gsi, t, GSI_SAME_STMT);
- stmt = bsi_stmt (*bsi);
- gcc_assert (TREE_CODE (stmt) == RETURN_EXPR);
- GIMPLE_STMT_OPERAND (stmt, 0) = lhs;
+ stmt = gsi_stmt (*gsi);
+ gcc_assert (gimple_code (stmt) == GIMPLE_RETURN);
+ gimple_return_set_retval (stmt, lhs);
}
update_all_vops (stmt);
@@ -816,7 +870,7 @@ expand_complex_move (block_stmt_iterator *bsi, tree stmt, tree type,
*/
static void
-expand_complex_addition (block_stmt_iterator *bsi, tree inner_type,
+expand_complex_addition (gimple_stmt_iterator *gsi, tree inner_type,
tree ar, tree ai, tree br, tree bi,
enum tree_code code,
complex_lattice_t al, complex_lattice_t bl)
@@ -826,21 +880,21 @@ expand_complex_addition (block_stmt_iterator *bsi, tree inner_type,
switch (PAIR (al, bl))
{
case PAIR (ONLY_REAL, ONLY_REAL):
- rr = gimplify_build2 (bsi, code, inner_type, ar, br);
+ rr = gimplify_build2 (gsi, code, inner_type, ar, br);
ri = ai;
break;
case PAIR (ONLY_REAL, ONLY_IMAG):
rr = ar;
if (code == MINUS_EXPR)
- ri = gimplify_build2 (bsi, MINUS_EXPR, inner_type, ai, bi);
+ ri = gimplify_build2 (gsi, MINUS_EXPR, inner_type, ai, bi);
else
ri = bi;
break;
case PAIR (ONLY_IMAG, ONLY_REAL):
if (code == MINUS_EXPR)
- rr = gimplify_build2 (bsi, MINUS_EXPR, inner_type, ar, br);
+ rr = gimplify_build2 (gsi, MINUS_EXPR, inner_type, ar, br);
else
rr = br;
ri = ai;
@@ -848,23 +902,23 @@ expand_complex_addition (block_stmt_iterator *bsi, tree inner_type,
case PAIR (ONLY_IMAG, ONLY_IMAG):
rr = ar;
- ri = gimplify_build2 (bsi, code, inner_type, ai, bi);
+ ri = gimplify_build2 (gsi, code, inner_type, ai, bi);
break;
case PAIR (VARYING, ONLY_REAL):
- rr = gimplify_build2 (bsi, code, inner_type, ar, br);
+ rr = gimplify_build2 (gsi, code, inner_type, ar, br);
ri = ai;
break;
case PAIR (VARYING, ONLY_IMAG):
rr = ar;
- ri = gimplify_build2 (bsi, code, inner_type, ai, bi);
+ ri = gimplify_build2 (gsi, code, inner_type, ai, bi);
break;
case PAIR (ONLY_REAL, VARYING):
if (code == MINUS_EXPR)
goto general;
- rr = gimplify_build2 (bsi, code, inner_type, ar, br);
+ rr = gimplify_build2 (gsi, code, inner_type, ar, br);
ri = bi;
break;
@@ -872,38 +926,41 @@ expand_complex_addition (block_stmt_iterator *bsi, tree inner_type,
if (code == MINUS_EXPR)
goto general;
rr = br;
- ri = gimplify_build2 (bsi, code, inner_type, ai, bi);
+ ri = gimplify_build2 (gsi, code, inner_type, ai, bi);
break;
case PAIR (VARYING, VARYING):
general:
- rr = gimplify_build2 (bsi, code, inner_type, ar, br);
- ri = gimplify_build2 (bsi, code, inner_type, ai, bi);
+ rr = gimplify_build2 (gsi, code, inner_type, ar, br);
+ ri = gimplify_build2 (gsi, code, inner_type, ai, bi);
break;
default:
gcc_unreachable ();
}
- update_complex_assignment (bsi, rr, ri);
+ update_complex_assignment (gsi, rr, ri);
}
/* Expand a complex multiplication or division to a libcall to the c99
compliant routines. */
static void
-expand_complex_libcall (block_stmt_iterator *bsi, tree ar, tree ai,
+expand_complex_libcall (gimple_stmt_iterator *gsi, tree ar, tree ai,
tree br, tree bi, enum tree_code code)
{
enum machine_mode mode;
enum built_in_function bcode;
- tree fn, stmt, type;
+ tree fn, type, lhs;
+ gimple stmt;
- stmt = bsi_stmt (*bsi);
- type = TREE_TYPE (GIMPLE_STMT_OPERAND (stmt, 1));
+ stmt = gsi_stmt (*gsi);
+ lhs = gimple_assign_lhs (stmt);
+ type = TREE_TYPE (lhs);
mode = TYPE_MODE (type);
gcc_assert (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT);
+
if (code == MULT_EXPR)
bcode = BUILT_IN_COMPLEX_MUL_MIN + mode - MIN_MODE_COMPLEX_FLOAT;
else if (code == RDIV_EXPR)
@@ -912,16 +969,18 @@ expand_complex_libcall (block_stmt_iterator *bsi, tree ar, tree ai,
gcc_unreachable ();
fn = built_in_decls[bcode];
- GIMPLE_STMT_OPERAND (stmt, 1) = build_call_expr (fn, 4, ar, ai, br, bi);
+ stmt = gimple_build_call (fn, 4, ar, ai, br, bi);
+ gimple_call_set_lhs (stmt, lhs);
update_stmt (stmt);
+ gsi_replace (gsi, stmt, true);
if (gimple_in_ssa_p (cfun))
{
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
type = TREE_TYPE (type);
- update_complex_components (bsi, stmt,
+ update_complex_components (gsi, stmt,
build1 (REALPART_EXPR, type, lhs),
build1 (IMAGPART_EXPR, type, lhs));
+ SSA_NAME_DEF_STMT (lhs) = stmt;
}
}
@@ -930,7 +989,7 @@ expand_complex_libcall (block_stmt_iterator *bsi, tree ar, tree ai,
*/
static void
-expand_complex_multiplication (block_stmt_iterator *bsi, tree inner_type,
+expand_complex_multiplication (gimple_stmt_iterator *gsi, tree inner_type,
tree ar, tree ai, tree br, tree bi,
complex_lattice_t al, complex_lattice_t bl)
{
@@ -947,7 +1006,7 @@ expand_complex_multiplication (block_stmt_iterator *bsi, tree inner_type,
switch (PAIR (al, bl))
{
case PAIR (ONLY_REAL, ONLY_REAL):
- rr = gimplify_build2 (bsi, MULT_EXPR, inner_type, ar, br);
+ rr = gimplify_build2 (gsi, MULT_EXPR, inner_type, ar, br);
ri = ai;
break;
@@ -957,49 +1016,49 @@ expand_complex_multiplication (block_stmt_iterator *bsi, tree inner_type,
&& REAL_VALUES_IDENTICAL (TREE_REAL_CST (ai), dconst1))
ri = br;
else
- ri = gimplify_build2 (bsi, MULT_EXPR, inner_type, ai, br);
+ ri = gimplify_build2 (gsi, MULT_EXPR, inner_type, ai, br);
break;
case PAIR (ONLY_IMAG, ONLY_IMAG):
- rr = gimplify_build2 (bsi, MULT_EXPR, inner_type, ai, bi);
- rr = gimplify_build1 (bsi, NEGATE_EXPR, inner_type, rr);
+ rr = gimplify_build2 (gsi, MULT_EXPR, inner_type, ai, bi);
+ rr = gimplify_build1 (gsi, NEGATE_EXPR, inner_type, rr);
ri = ar;
break;
case PAIR (VARYING, ONLY_REAL):
- rr = gimplify_build2 (bsi, MULT_EXPR, inner_type, ar, br);
- ri = gimplify_build2 (bsi, MULT_EXPR, inner_type, ai, br);
+ rr = gimplify_build2 (gsi, MULT_EXPR, inner_type, ar, br);
+ ri = gimplify_build2 (gsi, MULT_EXPR, inner_type, ai, br);
break;
case PAIR (VARYING, ONLY_IMAG):
- rr = gimplify_build2 (bsi, MULT_EXPR, inner_type, ai, bi);
- rr = gimplify_build1 (bsi, NEGATE_EXPR, inner_type, rr);
- ri = gimplify_build2 (bsi, MULT_EXPR, inner_type, ar, bi);
+ rr = gimplify_build2 (gsi, MULT_EXPR, inner_type, ai, bi);
+ rr = gimplify_build1 (gsi, NEGATE_EXPR, inner_type, rr);
+ ri = gimplify_build2 (gsi, MULT_EXPR, inner_type, ar, bi);
break;
case PAIR (VARYING, VARYING):
if (flag_complex_method == 2 && SCALAR_FLOAT_TYPE_P (inner_type))
{
- expand_complex_libcall (bsi, ar, ai, br, bi, MULT_EXPR);
+ expand_complex_libcall (gsi, ar, ai, br, bi, MULT_EXPR);
return;
}
else
{
tree t1, t2, t3, t4;
- t1 = gimplify_build2 (bsi, MULT_EXPR, inner_type, ar, br);
- t2 = gimplify_build2 (bsi, MULT_EXPR, inner_type, ai, bi);
- t3 = gimplify_build2 (bsi, MULT_EXPR, inner_type, ar, bi);
+ t1 = gimplify_build2 (gsi, MULT_EXPR, inner_type, ar, br);
+ t2 = gimplify_build2 (gsi, MULT_EXPR, inner_type, ai, bi);
+ t3 = gimplify_build2 (gsi, MULT_EXPR, inner_type, ar, bi);
/* Avoid expanding redundant multiplication for the common
case of squaring a complex number. */
if (ar == br && ai == bi)
t4 = t3;
else
- t4 = gimplify_build2 (bsi, MULT_EXPR, inner_type, ai, br);
+ t4 = gimplify_build2 (gsi, MULT_EXPR, inner_type, ai, br);
- rr = gimplify_build2 (bsi, MINUS_EXPR, inner_type, t1, t2);
- ri = gimplify_build2 (bsi, PLUS_EXPR, inner_type, t3, t4);
+ rr = gimplify_build2 (gsi, MINUS_EXPR, inner_type, t1, t2);
+ ri = gimplify_build2 (gsi, PLUS_EXPR, inner_type, t3, t4);
}
break;
@@ -1007,7 +1066,7 @@ expand_complex_multiplication (block_stmt_iterator *bsi, tree inner_type,
gcc_unreachable ();
}
- update_complex_assignment (bsi, rr, ri);
+ update_complex_assignment (gsi, rr, ri);
}
/* Expand complex division to scalars, straightforward algorithm.
@@ -1016,43 +1075,44 @@ expand_complex_multiplication (block_stmt_iterator *bsi, tree inner_type,
*/
static void
-expand_complex_div_straight (block_stmt_iterator *bsi, tree inner_type,
+expand_complex_div_straight (gimple_stmt_iterator *gsi, tree inner_type,
tree ar, tree ai, tree br, tree bi,
enum tree_code code)
{
tree rr, ri, div, t1, t2, t3;
- t1 = gimplify_build2 (bsi, MULT_EXPR, inner_type, br, br);
- t2 = gimplify_build2 (bsi, MULT_EXPR, inner_type, bi, bi);
- div = gimplify_build2 (bsi, PLUS_EXPR, inner_type, t1, t2);
+ t1 = gimplify_build2 (gsi, MULT_EXPR, inner_type, br, br);
+ t2 = gimplify_build2 (gsi, MULT_EXPR, inner_type, bi, bi);
+ div = gimplify_build2 (gsi, PLUS_EXPR, inner_type, t1, t2);
- t1 = gimplify_build2 (bsi, MULT_EXPR, inner_type, ar, br);
- t2 = gimplify_build2 (bsi, MULT_EXPR, inner_type, ai, bi);
- t3 = gimplify_build2 (bsi, PLUS_EXPR, inner_type, t1, t2);
- rr = gimplify_build2 (bsi, code, inner_type, t3, div);
+ t1 = gimplify_build2 (gsi, MULT_EXPR, inner_type, ar, br);
+ t2 = gimplify_build2 (gsi, MULT_EXPR, inner_type, ai, bi);
+ t3 = gimplify_build2 (gsi, PLUS_EXPR, inner_type, t1, t2);
+ rr = gimplify_build2 (gsi, code, inner_type, t3, div);
- t1 = gimplify_build2 (bsi, MULT_EXPR, inner_type, ai, br);
- t2 = gimplify_build2 (bsi, MULT_EXPR, inner_type, ar, bi);
- t3 = gimplify_build2 (bsi, MINUS_EXPR, inner_type, t1, t2);
- ri = gimplify_build2 (bsi, code, inner_type, t3, div);
+ t1 = gimplify_build2 (gsi, MULT_EXPR, inner_type, ai, br);
+ t2 = gimplify_build2 (gsi, MULT_EXPR, inner_type, ar, bi);
+ t3 = gimplify_build2 (gsi, MINUS_EXPR, inner_type, t1, t2);
+ ri = gimplify_build2 (gsi, code, inner_type, t3, div);
- update_complex_assignment (bsi, rr, ri);
+ update_complex_assignment (gsi, rr, ri);
}
/* Expand complex division to scalars, modified algorithm to minimize
overflow with wide input ranges. */
static void
-expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type,
+expand_complex_div_wide (gimple_stmt_iterator *gsi, tree inner_type,
tree ar, tree ai, tree br, tree bi,
enum tree_code code)
{
tree rr, ri, ratio, div, t1, t2, tr, ti, compare;
basic_block bb_cond, bb_true, bb_false, bb_join;
+ gimple stmt;
/* Examine |br| < |bi|, and branch. */
- t1 = gimplify_build1 (bsi, ABS_EXPR, inner_type, br);
- t2 = gimplify_build1 (bsi, ABS_EXPR, inner_type, bi);
+ t1 = gimplify_build1 (gsi, ABS_EXPR, inner_type, br);
+ t2 = gimplify_build1 (gsi, ABS_EXPR, inner_type, bi);
compare = fold_build2 (LT_EXPR, boolean_type_node, t1, t2);
STRIP_NOPS (compare);
@@ -1061,20 +1121,25 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type,
if (!TREE_CONSTANT (compare))
{
edge e;
+ gimple stmt;
tree cond, tmp;
tmp = create_tmp_var (boolean_type_node, NULL);
- cond = build_gimple_modify_stmt (tmp, compare);
+ stmt = gimple_build_assign (tmp, compare);
if (gimple_in_ssa_p (cfun))
- tmp = make_ssa_name (tmp, cond);
- GIMPLE_STMT_OPERAND (cond, 0) = tmp;
- bsi_insert_before (bsi, cond, BSI_SAME_STMT);
+ {
+ tmp = make_ssa_name (tmp, stmt);
+ gimple_assign_set_lhs (stmt, tmp);
+ }
+
+ gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
- cond = build3 (COND_EXPR, void_type_node, tmp, NULL_TREE, NULL_TREE);
- bsi_insert_before (bsi, cond, BSI_SAME_STMT);
+ cond = fold_build2 (EQ_EXPR, boolean_type_node, tmp, boolean_true_node);
+ stmt = gimple_build_cond_from_tree (cond, NULL_TREE, NULL_TREE);
+ gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
/* Split the original block, and create the TRUE and FALSE blocks. */
- e = split_block (bsi->bb, cond);
+ e = split_block (gsi_bb (*gsi), stmt);
bb_cond = e->src;
bb_join = e->dest;
bb_true = create_empty_bb (bb_cond);
@@ -1110,31 +1175,31 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type,
{
if (bb_true)
{
- *bsi = bsi_last (bb_true);
- bsi_insert_after (bsi, build_empty_stmt (), BSI_NEW_STMT);
+ *gsi = gsi_last_bb (bb_true);
+ gsi_insert_after (gsi, gimple_build_nop (), GSI_NEW_STMT);
}
- ratio = gimplify_build2 (bsi, code, inner_type, br, bi);
+ ratio = gimplify_build2 (gsi, code, inner_type, br, bi);
- t1 = gimplify_build2 (bsi, MULT_EXPR, inner_type, br, ratio);
- div = gimplify_build2 (bsi, PLUS_EXPR, inner_type, t1, bi);
+ t1 = gimplify_build2 (gsi, MULT_EXPR, inner_type, br, ratio);
+ div = gimplify_build2 (gsi, PLUS_EXPR, inner_type, t1, bi);
- t1 = gimplify_build2 (bsi, MULT_EXPR, inner_type, ar, ratio);
- tr = gimplify_build2 (bsi, PLUS_EXPR, inner_type, t1, ai);
+ t1 = gimplify_build2 (gsi, MULT_EXPR, inner_type, ar, ratio);
+ tr = gimplify_build2 (gsi, PLUS_EXPR, inner_type, t1, ai);
- t1 = gimplify_build2 (bsi, MULT_EXPR, inner_type, ai, ratio);
- ti = gimplify_build2 (bsi, MINUS_EXPR, inner_type, t1, ar);
+ t1 = gimplify_build2 (gsi, MULT_EXPR, inner_type, ai, ratio);
+ ti = gimplify_build2 (gsi, MINUS_EXPR, inner_type, t1, ar);
- tr = gimplify_build2 (bsi, code, inner_type, tr, div);
- ti = gimplify_build2 (bsi, code, inner_type, ti, div);
+ tr = gimplify_build2 (gsi, code, inner_type, tr, div);
+ ti = gimplify_build2 (gsi, code, inner_type, ti, div);
if (bb_true)
{
- t1 = build_gimple_modify_stmt (rr, tr);
- bsi_insert_before (bsi, t1, BSI_SAME_STMT);
- t1 = build_gimple_modify_stmt (ri, ti);
- bsi_insert_before (bsi, t1, BSI_SAME_STMT);
- bsi_remove (bsi, true);
+ stmt = gimple_build_assign (rr, tr);
+ gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
+ stmt = gimple_build_assign (ri, ti);
+ gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
+ gsi_remove (gsi, true);
}
}
@@ -1149,46 +1214,46 @@ expand_complex_div_wide (block_stmt_iterator *bsi, tree inner_type,
{
if (bb_false)
{
- *bsi = bsi_last (bb_false);
- bsi_insert_after (bsi, build_empty_stmt (), BSI_NEW_STMT);
+ *gsi = gsi_last_bb (bb_false);
+ gsi_insert_after (gsi, gimple_build_nop (), GSI_NEW_STMT);
}
- ratio = gimplify_build2 (bsi, code, inner_type, bi, br);
+ ratio = gimplify_build2 (gsi, code, inner_type, bi, br);
- t1 = gimplify_build2 (bsi, MULT_EXPR, inner_type, bi, ratio);
- div = gimplify_build2 (bsi, PLUS_EXPR, inner_type, t1, br);
+ t1 = gimplify_build2 (gsi, MULT_EXPR, inner_type, bi, ratio);
+ div = gimplify_build2 (gsi, PLUS_EXPR, inner_type, t1, br);
- t1 = gimplify_build2 (bsi, MULT_EXPR, inner_type, ai, ratio);
- tr = gimplify_build2 (bsi, PLUS_EXPR, inner_type, t1, ar);
+ t1 = gimplify_build2 (gsi, MULT_EXPR, inner_type, ai, ratio);
+ tr = gimplify_build2 (gsi, PLUS_EXPR, inner_type, t1, ar);
- t1 = gimplify_build2 (bsi, MULT_EXPR, inner_type, ar, ratio);
- ti = gimplify_build2 (bsi, MINUS_EXPR, inner_type, ai, t1);
+ t1 = gimplify_build2 (gsi, MULT_EXPR, inner_type, ar, ratio);
+ ti = gimplify_build2 (gsi, MINUS_EXPR, inner_type, ai, t1);
- tr = gimplify_build2 (bsi, code, inner_type, tr, div);
- ti = gimplify_build2 (bsi, code, inner_type, ti, div);
+ tr = gimplify_build2 (gsi, code, inner_type, tr, div);
+ ti = gimplify_build2 (gsi, code, inner_type, ti, div);
if (bb_false)
{
- t1 = build_gimple_modify_stmt (rr, tr);
- bsi_insert_before (bsi, t1, BSI_SAME_STMT);
- t1 = build_gimple_modify_stmt (ri, ti);
- bsi_insert_before (bsi, t1, BSI_SAME_STMT);
- bsi_remove (bsi, true);
+ stmt = gimple_build_assign (rr, tr);
+ gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
+ stmt = gimple_build_assign (ri, ti);
+ gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
+ gsi_remove (gsi, true);
}
}
if (bb_join)
- *bsi = bsi_start (bb_join);
+ *gsi = gsi_start_bb (bb_join);
else
rr = tr, ri = ti;
- update_complex_assignment (bsi, rr, ri);
+ update_complex_assignment (gsi, rr, ri);
}
/* Expand complex division to scalars. */
static void
-expand_complex_division (block_stmt_iterator *bsi, tree inner_type,
+expand_complex_division (gimple_stmt_iterator *gsi, tree inner_type,
tree ar, tree ai, tree br, tree bi,
enum tree_code code,
complex_lattice_t al, complex_lattice_t bl)
@@ -1198,35 +1263,35 @@ expand_complex_division (block_stmt_iterator *bsi, tree inner_type,
switch (PAIR (al, bl))
{
case PAIR (ONLY_REAL, ONLY_REAL):
- rr = gimplify_build2 (bsi, code, inner_type, ar, br);
+ rr = gimplify_build2 (gsi, code, inner_type, ar, br);
ri = ai;
break;
case PAIR (ONLY_REAL, ONLY_IMAG):
rr = ai;
- ri = gimplify_build2 (bsi, code, inner_type, ar, bi);
- ri = gimplify_build1 (bsi, NEGATE_EXPR, inner_type, ri);
+ ri = gimplify_build2 (gsi, code, inner_type, ar, bi);
+ ri = gimplify_build1 (gsi, NEGATE_EXPR, inner_type, ri);
break;
case PAIR (ONLY_IMAG, ONLY_REAL):
rr = ar;
- ri = gimplify_build2 (bsi, code, inner_type, ai, br);
+ ri = gimplify_build2 (gsi, code, inner_type, ai, br);
break;
case PAIR (ONLY_IMAG, ONLY_IMAG):
- rr = gimplify_build2 (bsi, code, inner_type, ai, bi);
+ rr = gimplify_build2 (gsi, code, inner_type, ai, bi);
ri = ar;
break;
case PAIR (VARYING, ONLY_REAL):
- rr = gimplify_build2 (bsi, code, inner_type, ar, br);
- ri = gimplify_build2 (bsi, code, inner_type, ai, br);
+ rr = gimplify_build2 (gsi, code, inner_type, ar, br);
+ ri = gimplify_build2 (gsi, code, inner_type, ai, br);
break;
case PAIR (VARYING, ONLY_IMAG):
- rr = gimplify_build2 (bsi, code, inner_type, ai, bi);
- ri = gimplify_build2 (bsi, code, inner_type, ar, bi);
- ri = gimplify_build1 (bsi, NEGATE_EXPR, inner_type, ri);
+ rr = gimplify_build2 (gsi, code, inner_type, ai, bi);
+ ri = gimplify_build2 (gsi, code, inner_type, ar, bi);
+ ri = gimplify_build1 (gsi, NEGATE_EXPR, inner_type, ri);
case PAIR (ONLY_REAL, VARYING):
case PAIR (ONLY_IMAG, VARYING):
@@ -1235,20 +1300,20 @@ expand_complex_division (block_stmt_iterator *bsi, tree inner_type,
{
case 0:
/* straightforward implementation of complex divide acceptable. */
- expand_complex_div_straight (bsi, inner_type, ar, ai, br, bi, code);
+ expand_complex_div_straight (gsi, inner_type, ar, ai, br, bi, code);
break;
case 2:
if (SCALAR_FLOAT_TYPE_P (inner_type))
{
- expand_complex_libcall (bsi, ar, ai, br, bi, code);
+ expand_complex_libcall (gsi, ar, ai, br, bi, code);
break;
}
/* FALLTHRU */
case 1:
/* wide ranges of inputs must work for complex divide. */
- expand_complex_div_wide (bsi, inner_type, ar, ai, br, bi, code);
+ expand_complex_div_wide (gsi, inner_type, ar, ai, br, bi, code);
break;
default:
@@ -1260,7 +1325,7 @@ expand_complex_division (block_stmt_iterator *bsi, tree inner_type,
gcc_unreachable ();
}
- update_complex_assignment (bsi, rr, ri);
+ update_complex_assignment (gsi, rr, ri);
}
/* Expand complex negation to scalars:
@@ -1268,15 +1333,15 @@ expand_complex_division (block_stmt_iterator *bsi, tree inner_type,
*/
static void
-expand_complex_negation (block_stmt_iterator *bsi, tree inner_type,
+expand_complex_negation (gimple_stmt_iterator *gsi, tree inner_type,
tree ar, tree ai)
{
tree rr, ri;
- rr = gimplify_build1 (bsi, NEGATE_EXPR, inner_type, ar);
- ri = gimplify_build1 (bsi, NEGATE_EXPR, inner_type, ai);
+ rr = gimplify_build1 (gsi, NEGATE_EXPR, inner_type, ar);
+ ri = gimplify_build1 (gsi, NEGATE_EXPR, inner_type, ai);
- update_complex_assignment (bsi, rr, ri);
+ update_complex_assignment (gsi, rr, ri);
}
/* Expand complex conjugate to scalars:
@@ -1284,44 +1349,52 @@ expand_complex_negation (block_stmt_iterator *bsi, tree inner_type,
*/
static void
-expand_complex_conjugate (block_stmt_iterator *bsi, tree inner_type,
+expand_complex_conjugate (gimple_stmt_iterator *gsi, tree inner_type,
tree ar, tree ai)
{
tree ri;
- ri = gimplify_build1 (bsi, NEGATE_EXPR, inner_type, ai);
+ ri = gimplify_build1 (gsi, NEGATE_EXPR, inner_type, ai);
- update_complex_assignment (bsi, ar, ri);
+ update_complex_assignment (gsi, ar, ri);
}
/* Expand complex comparison (EQ or NE only). */
static void
-expand_complex_comparison (block_stmt_iterator *bsi, tree ar, tree ai,
+expand_complex_comparison (gimple_stmt_iterator *gsi, tree ar, tree ai,
tree br, tree bi, enum tree_code code)
{
- tree cr, ci, cc, stmt, expr, type;
+ tree cr, ci, cc, type;
+ gimple stmt;
- cr = gimplify_build2 (bsi, code, boolean_type_node, ar, br);
- ci = gimplify_build2 (bsi, code, boolean_type_node, ai, bi);
- cc = gimplify_build2 (bsi,
+ cr = gimplify_build2 (gsi, code, boolean_type_node, ar, br);
+ ci = gimplify_build2 (gsi, code, boolean_type_node, ai, bi);
+ cc = gimplify_build2 (gsi,
(code == EQ_EXPR ? TRUTH_AND_EXPR : TRUTH_OR_EXPR),
boolean_type_node, cr, ci);
- stmt = expr = bsi_stmt (*bsi);
+ stmt = gsi_stmt (*gsi);
- switch (TREE_CODE (stmt))
+ switch (gimple_code (stmt))
{
- case RETURN_EXPR:
- expr = TREE_OPERAND (stmt, 0);
- /* FALLTHRU */
- case GIMPLE_MODIFY_STMT:
- type = TREE_TYPE (GIMPLE_STMT_OPERAND (expr, 1));
- GIMPLE_STMT_OPERAND (expr, 1) = fold_convert (type, cc);
+ case GIMPLE_RETURN:
+ type = TREE_TYPE (gimple_return_retval (stmt));
+ gimple_return_set_retval (stmt, fold_convert (type, cc));
break;
- case COND_EXPR:
- TREE_OPERAND (stmt, 0) = cc;
+
+ case GIMPLE_ASSIGN:
+ type = TREE_TYPE (gimple_assign_lhs (stmt));
+ gimple_assign_set_rhs_from_tree (gsi, fold_convert (type, cc));
+ stmt = gsi_stmt (*gsi);
break;
+
+ case GIMPLE_COND:
+ gimple_cond_set_code (stmt, EQ_EXPR);
+ gimple_cond_set_lhs (stmt, cc);
+ gimple_cond_set_rhs (stmt, boolean_true_node);
+ break;
+
default:
gcc_unreachable ();
}
@@ -1329,41 +1402,24 @@ expand_complex_comparison (block_stmt_iterator *bsi, tree ar, tree ai,
update_stmt (stmt);
}
+
/* Process one statement. If we identify a complex operation, expand it. */
static void
-expand_complex_operations_1 (block_stmt_iterator *bsi)
+expand_complex_operations_1 (gimple_stmt_iterator *gsi)
{
- tree stmt = bsi_stmt (*bsi);
- tree rhs, type, inner_type;
+ gimple stmt = gsi_stmt (*gsi);
+ tree type, inner_type, lhs;
tree ac, ar, ai, bc, br, bi;
complex_lattice_t al, bl;
enum tree_code code;
- switch (TREE_CODE (stmt))
- {
- case RETURN_EXPR:
- stmt = TREE_OPERAND (stmt, 0);
- if (!stmt)
- return;
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
- return;
- /* FALLTHRU */
-
- case GIMPLE_MODIFY_STMT:
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- break;
+ lhs = gimple_get_lhs (stmt);
+ if (!lhs && gimple_code (stmt) != GIMPLE_COND)
+ return;
- case COND_EXPR:
- rhs = TREE_OPERAND (stmt, 0);
- break;
-
- default:
- return;
- }
-
- type = TREE_TYPE (rhs);
- code = TREE_CODE (rhs);
+ type = TREE_TYPE (gimple_op (stmt, 0));
+ code = gimple_expr_code (stmt);
/* Initial filter for operations we handle. */
switch (code)
@@ -1385,32 +1441,36 @@ expand_complex_operations_1 (block_stmt_iterator *bsi)
case EQ_EXPR:
case NE_EXPR:
- inner_type = TREE_TYPE (TREE_OPERAND (rhs, 1));
+ /* Note, both GIMPLE_ASSIGN and GIMPLE_COND may have an EQ_EXPR
+ subocde, so we need to access the operands using gimple_op. */
+ inner_type = TREE_TYPE (gimple_op (stmt, 1));
if (TREE_CODE (inner_type) != COMPLEX_TYPE)
return;
break;
default:
{
- tree lhs, rhs;
+ tree rhs;
- /* COND_EXPR may also fallthru here, but we do not need to do anything
- with it. */
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ /* GIMPLE_COND may also fallthru here, but we do not need to
+ do anything with it. */
+ if (gimple_code (stmt) == GIMPLE_COND)
return;
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
-
if (TREE_CODE (type) == COMPLEX_TYPE)
- expand_complex_move (bsi, stmt, type, lhs, rhs);
- else if ((TREE_CODE (rhs) == REALPART_EXPR
- || TREE_CODE (rhs) == IMAGPART_EXPR)
- && TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME)
+ expand_complex_move (gsi, type);
+ else if (is_gimple_assign (stmt)
+ && (gimple_assign_rhs_code (stmt) == REALPART_EXPR
+ || gimple_assign_rhs_code (stmt) == IMAGPART_EXPR)
+ && TREE_CODE (lhs) == SSA_NAME)
{
- GENERIC_TREE_OPERAND (stmt, 1)
- = extract_component (bsi, TREE_OPERAND (rhs, 0),
- TREE_CODE (rhs) == IMAGPART_EXPR, false);
+ rhs = gimple_assign_rhs1 (stmt);
+ rhs = extract_component (gsi, TREE_OPERAND (rhs, 0),
+ gimple_assign_rhs_code (stmt)
+ == IMAGPART_EXPR,
+ false);
+ gimple_assign_set_rhs_from_tree (gsi, rhs);
+ stmt = gsi_stmt (*gsi);
update_stmt (stmt);
}
}
@@ -1419,23 +1479,30 @@ expand_complex_operations_1 (block_stmt_iterator *bsi)
/* Extract the components of the two complex values. Make sure and
handle the common case of the same value used twice specially. */
- ac = TREE_OPERAND (rhs, 0);
- ar = extract_component (bsi, ac, 0, true);
- ai = extract_component (bsi, ac, 1, true);
-
- if (TREE_CODE_CLASS (code) == tcc_unary)
- bc = br = bi = NULL;
+ if (is_gimple_assign (stmt))
+ {
+ ac = gimple_assign_rhs1 (stmt);
+ bc = (gimple_num_ops (stmt) > 2) ? gimple_assign_rhs2 (stmt) : NULL;
+ }
+ /* GIMPLE_CALL can not get here. */
else
{
- bc = TREE_OPERAND (rhs, 1);
- if (ac == bc)
- br = ar, bi = ai;
- else
- {
- br = extract_component (bsi, bc, 0, true);
- bi = extract_component (bsi, bc, 1, true);
- }
+ ac = gimple_cond_lhs (stmt);
+ bc = gimple_cond_rhs (stmt);
+ }
+
+ ar = extract_component (gsi, ac, false, true);
+ ai = extract_component (gsi, ac, true, true);
+
+ if (ac == bc)
+ br = ar, bi = ai;
+ else if (bc)
+ {
+ br = extract_component (gsi, bc, 0, true);
+ bi = extract_component (gsi, bc, 1, true);
}
+ else
+ br = bi = NULL_TREE;
if (gimple_in_ssa_p (cfun))
{
@@ -1461,11 +1528,11 @@ expand_complex_operations_1 (block_stmt_iterator *bsi)
{
case PLUS_EXPR:
case MINUS_EXPR:
- expand_complex_addition (bsi, inner_type, ar, ai, br, bi, code, al, bl);
+ expand_complex_addition (gsi, inner_type, ar, ai, br, bi, code, al, bl);
break;
case MULT_EXPR:
- expand_complex_multiplication (bsi, inner_type, ar, ai, br, bi, al, bl);
+ expand_complex_multiplication (gsi, inner_type, ar, ai, br, bi, al, bl);
break;
case TRUNC_DIV_EXPR:
@@ -1473,20 +1540,20 @@ expand_complex_operations_1 (block_stmt_iterator *bsi)
case FLOOR_DIV_EXPR:
case ROUND_DIV_EXPR:
case RDIV_EXPR:
- expand_complex_division (bsi, inner_type, ar, ai, br, bi, code, al, bl);
+ expand_complex_division (gsi, inner_type, ar, ai, br, bi, code, al, bl);
break;
case NEGATE_EXPR:
- expand_complex_negation (bsi, inner_type, ar, ai);
+ expand_complex_negation (gsi, inner_type, ar, ai);
break;
case CONJ_EXPR:
- expand_complex_conjugate (bsi, inner_type, ar, ai);
+ expand_complex_conjugate (gsi, inner_type, ar, ai);
break;
case EQ_EXPR:
case NE_EXPR:
- expand_complex_comparison (bsi, ar, ai, br, bi, code);
+ expand_complex_comparison (gsi, ar, ai, br, bi, code);
break;
default:
@@ -1501,7 +1568,7 @@ static unsigned int
tree_lower_complex (void)
{
int old_last_basic_block;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
basic_block bb;
if (!init_dont_simulate_again ())
@@ -1529,12 +1596,13 @@ tree_lower_complex (void)
{
if (bb->index >= old_last_basic_block)
continue;
+
update_phi_components (bb);
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- expand_complex_operations_1 (&bsi);
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ expand_complex_operations_1 (&gsi);
}
- bsi_commit_edge_inserts ();
+ gsi_commit_edge_inserts ();
htab_delete (complex_variable_components);
VEC_free (tree, heap, complex_ssa_name_components);
@@ -1571,15 +1639,16 @@ static unsigned int
tree_lower_complex_O0 (void)
{
int old_last_basic_block = last_basic_block;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
basic_block bb;
FOR_EACH_BB (bb)
{
if (bb->index >= old_last_basic_block)
continue;
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- expand_complex_operations_1 (&bsi);
+
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ expand_complex_operations_1 (&gsi);
}
return 0;
}
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index c024b74e09c..85d0977bce9 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -186,7 +186,7 @@ dump_data_reference (FILE *outf,
unsigned int i;
fprintf (outf, "(Data Ref: \n stmt: ");
- print_generic_stmt (outf, DR_STMT (dr), 0);
+ print_gimple_stmt (outf, DR_STMT (dr), 0, 0);
fprintf (outf, " ref: ");
print_generic_stmt (outf, DR_REF (dr), 0);
fprintf (outf, " base_object: ");
@@ -500,68 +500,65 @@ dump_ddrs (FILE *file, VEC (ddr_p, heap) *ddrs)
fprintf (file, "\n\n");
}
-/* Expresses EXP as VAR + OFF, where off is a constant. The type of OFF
- will be ssizetype. */
+/* Helper function for split_constant_offset. Expresses OP0 CODE OP1
+ (the type of the result is TYPE) as VAR + OFF, where OFF is a nonzero
+ constant of type ssizetype, and returns true. If we cannot do this
+ with OFF nonzero, OFF and VAR are set to NULL_TREE instead and false
+ is returned. */
-void
-split_constant_offset (tree exp, tree *var, tree *off)
+static bool
+split_constant_offset_1 (tree type, tree op0, enum tree_code code, tree op1,
+ tree *var, tree *off)
{
- tree type = TREE_TYPE (exp), otype;
tree var0, var1;
tree off0, off1;
- enum tree_code code;
+ enum tree_code ocode = code;
- *var = exp;
- STRIP_NOPS (exp);
- otype = TREE_TYPE (exp);
- code = TREE_CODE (exp);
+ *var = NULL_TREE;
+ *off = NULL_TREE;
switch (code)
{
case INTEGER_CST:
*var = build_int_cst (type, 0);
- *off = fold_convert (ssizetype, exp);
- return;
+ *off = fold_convert (ssizetype, op0);
+ return true;
case POINTER_PLUS_EXPR:
- code = PLUS_EXPR;
+ ocode = PLUS_EXPR;
/* FALLTHROUGH */
case PLUS_EXPR:
case MINUS_EXPR:
- split_constant_offset (TREE_OPERAND (exp, 0), &var0, &off0);
- split_constant_offset (TREE_OPERAND (exp, 1), &var1, &off1);
- *var = fold_convert (type, fold_build2 (TREE_CODE (exp), otype,
- var0, var1));
- *off = size_binop (code, off0, off1);
- return;
+ split_constant_offset (op0, &var0, &off0);
+ split_constant_offset (op1, &var1, &off1);
+ *var = fold_build2 (code, type, var0, var1);
+ *off = size_binop (ocode, off0, off1);
+ return true;
case MULT_EXPR:
- off1 = TREE_OPERAND (exp, 1);
- if (TREE_CODE (off1) != INTEGER_CST)
- break;
+ if (TREE_CODE (op1) != INTEGER_CST)
+ return false;
- split_constant_offset (TREE_OPERAND (exp, 0), &var0, &off0);
- *var = fold_convert (type, fold_build2 (MULT_EXPR, otype,
- var0, off1));
- *off = size_binop (MULT_EXPR, off0, fold_convert (ssizetype, off1));
- return;
+ split_constant_offset (op0, &var0, &off0);
+ *var = fold_build2 (MULT_EXPR, type, var0, op1);
+ *off = size_binop (MULT_EXPR, off0, fold_convert (ssizetype, op1));
+ return true;
case ADDR_EXPR:
{
- tree op, base, poffset;
+ tree base, poffset;
HOST_WIDE_INT pbitsize, pbitpos;
enum machine_mode pmode;
int punsignedp, pvolatilep;
- op = TREE_OPERAND (exp, 0);
- if (!handled_component_p (op))
- break;
+ if (!handled_component_p (op0))
+ return false;
- base = get_inner_reference (op, &pbitsize, &pbitpos, &poffset,
+ base = get_inner_reference (op0, &pbitsize, &pbitpos, &poffset,
&pmode, &punsignedp, &pvolatilep, false);
if (pbitpos % BITS_PER_UNIT != 0)
- break;
+ return false;
base = build_fold_addr_expr (base);
off0 = ssize_int (pbitpos / BITS_PER_UNIT);
@@ -584,8 +581,7 @@ split_constant_offset (tree exp, tree *var, tree *off)
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
@@ -595,40 +591,57 @@ split_constant_offset (tree exp, tree *var, tree *off)
while (POINTER_TYPE_P (type))
type = TREE_TYPE (type);
if (int_size_in_bytes (type) < 0)
- break;
+ return false;
*var = var0;
*off = off0;
- return;
+ return true;
}
case SSA_NAME:
{
- tree def_stmt = SSA_NAME_DEF_STMT (exp);
- if (TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT)
- {
- tree def_stmt_rhs = GIMPLE_STMT_OPERAND (def_stmt, 1);
+ gimple def_stmt = SSA_NAME_DEF_STMT (op0);
+ enum tree_code subcode;
- if (!TREE_SIDE_EFFECTS (def_stmt_rhs)
- && EXPR_P (def_stmt_rhs)
- && !REFERENCE_CLASS_P (def_stmt_rhs)
- && !get_call_expr_in (def_stmt_rhs))
- {
- split_constant_offset (def_stmt_rhs, &var0, &off0);
- var0 = fold_convert (type, var0);
- *var = var0;
- *off = off0;
- return;
- }
- }
- break;
+ if (gimple_code (def_stmt) != GIMPLE_ASSIGN)
+ return false;
+
+ var0 = gimple_assign_rhs1 (def_stmt);
+ subcode = gimple_assign_rhs_code (def_stmt);
+ var1 = gimple_assign_rhs2 (def_stmt);
+
+ return split_constant_offset_1 (type, var0, subcode, var1, var, off);
}
default:
- break;
+ return false;
}
+}
+
+/* Expresses EXP as VAR + OFF, where off is a constant. The type of OFF
+ will be ssizetype. */
+
+void
+split_constant_offset (tree exp, tree *var, tree *off)
+{
+ tree type = TREE_TYPE (exp), otype, op0, op1, e, o;
+ enum tree_code code;
+ *var = exp;
*off = ssize_int (0);
+ STRIP_NOPS (exp);
+
+ if (automatically_generated_chrec_p (exp))
+ return;
+
+ otype = TREE_TYPE (exp);
+ code = TREE_CODE (exp);
+ extract_ops_from_tree (exp, &code, &op0, &op1);
+ if (split_constant_offset_1 (otype, op0, code, op1, &e, &o))
+ {
+ *var = fold_convert (type, e);
+ *off = o;
+ }
}
/* Returns the address ADDR of an object in a canonical shape (without nop
@@ -658,7 +671,7 @@ canonicalize_base_object_address (tree addr)
void
dr_analyze_innermost (struct data_reference *dr)
{
- tree stmt = DR_STMT (dr);
+ gimple stmt = DR_STMT (dr);
struct loop *loop = loop_containing_stmt (stmt);
tree ref = DR_REF (dr);
HOST_WIDE_INT pbitsize, pbitpos;
@@ -729,7 +742,7 @@ dr_analyze_innermost (struct data_reference *dr)
static void
dr_analyze_indices (struct data_reference *dr, struct loop *nest)
{
- tree stmt = DR_STMT (dr);
+ gimple stmt = DR_STMT (dr);
struct loop *loop = loop_containing_stmt (stmt);
VEC (tree, heap) *access_fns = NULL;
tree ref = unshare_expr (DR_REF (dr)), aref = ref, op;
@@ -773,7 +786,7 @@ dr_analyze_indices (struct data_reference *dr, struct loop *nest)
static void
dr_analyze_alias (struct data_reference *dr)
{
- tree stmt = DR_STMT (dr);
+ gimple stmt = DR_STMT (dr);
tree ref = DR_REF (dr);
tree base = get_base_address (ref), addr, smt = NULL_TREE;
ssa_op_iter it;
@@ -834,7 +847,7 @@ free_data_ref (data_reference_p dr)
loop nest in that the reference should be analyzed. */
struct data_reference *
-create_data_ref (struct loop *nest, tree memref, tree stmt, bool is_read)
+create_data_ref (struct loop *nest, tree memref, gimple stmt, bool is_read)
{
struct data_reference *dr;
@@ -1537,8 +1550,8 @@ analyze_ziv_subscript (tree chrec_a,
fprintf (dump_file, "(analyze_ziv_subscript \n");
type = signed_type_for_types (TREE_TYPE (chrec_a), TREE_TYPE (chrec_b));
- chrec_a = chrec_convert (type, chrec_a, NULL_TREE);
- chrec_b = chrec_convert (type, chrec_b, NULL_TREE);
+ chrec_a = chrec_convert (type, chrec_a, NULL);
+ chrec_b = chrec_convert (type, chrec_b, NULL);
difference = chrec_fold_minus (type, chrec_a, chrec_b);
switch (TREE_CODE (difference))
@@ -1668,8 +1681,8 @@ analyze_siv_subscript_cst_affine (tree chrec_a,
tree type, difference, tmp;
type = signed_type_for_types (TREE_TYPE (chrec_a), TREE_TYPE (chrec_b));
- chrec_a = chrec_convert (type, chrec_a, NULL_TREE);
- chrec_b = chrec_convert (type, chrec_b, NULL_TREE);
+ chrec_a = chrec_convert (type, chrec_a, NULL);
+ chrec_b = chrec_convert (type, chrec_b, NULL);
difference = chrec_fold_minus (type, initial_condition (chrec_b), chrec_a);
if (!chrec_is_positive (initial_condition (difference), &value0))
@@ -1875,7 +1888,7 @@ initialize_matrix_A (lambda_matrix A, tree chrec, unsigned index, int mult)
case NOP_EXPR:
{
tree op = initialize_matrix_A (A, TREE_OPERAND (chrec, 0), index, mult);
- return chrec_convert (chrec_type (chrec), op, NULL_TREE);
+ return chrec_convert (chrec_type (chrec), op, NULL);
}
case INTEGER_CST:
@@ -2365,7 +2378,7 @@ can_use_analyze_subscript_affine_affine (tree *chrec_a, tree *chrec_b)
type = chrec_type (*chrec_a);
left_a = CHREC_LEFT (*chrec_a);
- left_b = chrec_convert (type, CHREC_LEFT (*chrec_b), NULL_TREE);
+ left_b = chrec_convert (type, CHREC_LEFT (*chrec_b), NULL);
diff = chrec_fold_minus (type, left_a, left_b);
if (!evolution_function_is_constant_p (diff))
@@ -2376,7 +2389,7 @@ can_use_analyze_subscript_affine_affine (tree *chrec_a, tree *chrec_b)
*chrec_a = build_polynomial_chrec (CHREC_VARIABLE (*chrec_a),
diff, CHREC_RIGHT (*chrec_a));
- right_b = chrec_convert (type, CHREC_RIGHT (*chrec_b), NULL_TREE);
+ right_b = chrec_convert (type, CHREC_RIGHT (*chrec_b), NULL);
*chrec_b = build_polynomial_chrec (CHREC_VARIABLE (*chrec_b),
build_int_cst (type, 0),
right_b);
@@ -2523,8 +2536,8 @@ analyze_miv_subscript (tree chrec_a,
fprintf (dump_file, "(analyze_miv_subscript \n");
type = signed_type_for_types (TREE_TYPE (chrec_a), TREE_TYPE (chrec_b));
- chrec_a = chrec_convert (type, chrec_a, NULL_TREE);
- chrec_b = chrec_convert (type, chrec_b, NULL_TREE);
+ chrec_a = chrec_convert (type, chrec_a, NULL);
+ chrec_b = chrec_convert (type, chrec_b, NULL);
difference = chrec_fold_minus (type, chrec_a, chrec_b);
if (eq_evolutions_p (chrec_a, chrec_b))
@@ -3474,8 +3487,8 @@ omega_setup_subscript (tree access_fun_a, tree access_fun_b,
int eq;
tree type = signed_type_for_types (TREE_TYPE (access_fun_a),
TREE_TYPE (access_fun_b));
- tree fun_a = chrec_convert (type, access_fun_a, NULL_TREE);
- tree fun_b = chrec_convert (type, access_fun_b, NULL_TREE);
+ tree fun_a = chrec_convert (type, access_fun_a, NULL);
+ tree fun_b = chrec_convert (type, access_fun_b, NULL);
tree difference = chrec_fold_minus (type, fun_a, fun_b);
/* When the fun_a - fun_b is not constant, the dependence is not
@@ -3835,9 +3848,9 @@ compute_affine_dependence (struct data_dependence_relation *ddr,
{
fprintf (dump_file, "(compute_affine_dependence\n");
fprintf (dump_file, " (stmt_a = \n");
- print_generic_expr (dump_file, DR_STMT (dra), 0);
+ print_gimple_stmt (dump_file, DR_STMT (dra), 0, 0);
fprintf (dump_file, ")\n (stmt_b = \n");
- print_generic_expr (dump_file, DR_STMT (drb), 0);
+ print_gimple_stmt (dump_file, DR_STMT (drb), 0, 0);
fprintf (dump_file, ")\n");
}
@@ -3988,32 +4001,32 @@ compute_all_dependences (VEC (data_reference_p, heap) *datarefs,
true if STMT clobbers memory, false otherwise. */
bool
-get_references_in_stmt (tree stmt, VEC (data_ref_loc, heap) **references)
+get_references_in_stmt (gimple stmt, VEC (data_ref_loc, heap) **references)
{
bool clobbers_memory = false;
data_ref_loc *ref;
- tree *op0, *op1, call;
+ tree *op0, *op1;
+ enum gimple_code stmt_code = gimple_code (stmt);
*references = NULL;
/* ASM_EXPR and CALL_EXPR may embed arbitrary side effects.
Calls have side-effects, except those to const or pure
functions. */
- call = get_call_expr_in (stmt);
- if ((call
- && !(call_expr_flags (call) & (ECF_CONST | ECF_PURE)))
- || (TREE_CODE (stmt) == ASM_EXPR
- && ASM_VOLATILE_P (stmt)))
+ if ((stmt_code == GIMPLE_CALL
+ && !(gimple_call_flags (stmt) & (ECF_CONST | ECF_PURE)))
+ || (stmt_code == GIMPLE_ASM
+ && gimple_asm_volatile_p (stmt)))
clobbers_memory = true;
if (ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS))
return clobbers_memory;
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ if (stmt_code == GIMPLE_ASSIGN)
{
tree base;
- op0 = &GIMPLE_STMT_OPERAND (stmt, 0);
- op1 = &GIMPLE_STMT_OPERAND (stmt, 1);
+ op0 = gimple_assign_lhs_ptr (stmt);
+ op1 = gimple_assign_rhs1_ptr (stmt);
if (DECL_P (*op1)
|| (REFERENCE_CLASS_P (*op1)
@@ -4033,14 +4046,13 @@ get_references_in_stmt (tree stmt, VEC (data_ref_loc, heap) **references)
ref->is_read = false;
}
}
-
- if (call)
+ else if (stmt_code == GIMPLE_CALL)
{
- unsigned i, n = call_expr_nargs (call);
+ unsigned i, n = gimple_call_num_args (stmt);
for (i = 0; i < n; i++)
{
- op0 = &CALL_EXPR_ARG (call, i);
+ op0 = gimple_call_arg_ptr (stmt, i);
if (DECL_P (*op0)
|| (REFERENCE_CLASS_P (*op0) && get_base_address (*op0)))
@@ -4060,7 +4072,7 @@ get_references_in_stmt (tree stmt, VEC (data_ref_loc, heap) **references)
loop of the loop nest in that the references should be analyzed. */
static bool
-find_data_references_in_stmt (struct loop *nest, tree stmt,
+find_data_references_in_stmt (struct loop *nest, gimple stmt,
VEC (data_reference_p, heap) **datarefs)
{
unsigned i;
@@ -4110,7 +4122,7 @@ find_data_references_in_loop (struct loop *loop,
{
basic_block bb, *bbs;
unsigned int i;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
bbs = get_loop_body_in_dom_order (loop);
@@ -4118,9 +4130,9 @@ find_data_references_in_loop (struct loop *loop,
{
bb = bbs[i];
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (bsi);
if (!find_data_references_in_stmt (loop, stmt, datarefs))
{
@@ -4443,7 +4455,7 @@ dump_rdg_vertex (FILE *file, struct graph *rdg, int i)
fprintf (file, " %d", e->dest);
fprintf (file, ") \n");
- print_generic_stmt (file, RDGV_STMT (v), TDF_VOPS|TDF_MEMSYMS);
+ print_gimple_stmt (file, RDGV_STMT (v), 0, TDF_VOPS|TDF_MEMSYMS);
fprintf (file, ")\n");
}
@@ -4579,14 +4591,14 @@ dot_rdg (struct graph *rdg)
struct rdg_vertex_info GTY(())
{
- tree stmt;
+ gimple stmt;
int index;
};
/* Returns the index of STMT in RDG. */
int
-rdg_vertex_for_stmt (struct graph *rdg, tree stmt)
+rdg_vertex_for_stmt (struct graph *rdg, gimple stmt)
{
struct rdg_vertex_info rvi, *slot;
@@ -4690,12 +4702,12 @@ create_rdg_edges (struct graph *rdg, VEC (ddr_p, heap) *ddrs)
/* Build the vertices of the reduced dependence graph RDG. */
static void
-create_rdg_vertices (struct graph *rdg, VEC (tree, heap) *stmts)
+create_rdg_vertices (struct graph *rdg, VEC (gimple, heap) *stmts)
{
int i, j;
- tree stmt;
+ gimple stmt;
- for (i = 0; VEC_iterate (tree, stmts, i, stmt); i++)
+ for (i = 0; VEC_iterate (gimple, stmts, i, stmt); i++)
{
VEC (data_ref_loc, heap) *references;
data_ref_loc *ref;
@@ -4717,7 +4729,7 @@ create_rdg_vertices (struct graph *rdg, VEC (tree, heap) *stmts)
RDG_MEM_WRITE_STMT (rdg, i) = false;
RDG_MEM_READS_STMT (rdg, i) = false;
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
continue;
get_references_in_stmt (stmt, &references);
@@ -4738,23 +4750,26 @@ create_rdg_vertices (struct graph *rdg, VEC (tree, heap) *stmts)
identifying statements. */
static void
-stmts_from_loop (struct loop *loop, VEC (tree, heap) **stmts)
+stmts_from_loop (struct loop *loop, VEC (gimple, heap) **stmts)
{
unsigned int i;
basic_block *bbs = get_loop_body_in_dom_order (loop);
for (i = 0; i < loop->num_nodes; i++)
{
- tree phi, stmt;
basic_block bb = bbs[i];
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
+ gimple stmt;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- VEC_safe_push (tree, heap, *stmts, phi);
+ for (bsi = gsi_start_phis (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ VEC_safe_push (gimple, heap, *stmts, gsi_stmt (bsi));
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- if (TREE_CODE (stmt = bsi_stmt (bsi)) != LABEL_EXPR)
- VEC_safe_push (tree, heap, *stmts, stmt);
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ {
+ stmt = gsi_stmt (bsi);
+ if (gimple_code (stmt) != GIMPLE_LABEL)
+ VEC_safe_push (gimple, heap, *stmts, stmt);
+ }
}
free (bbs);
@@ -4782,7 +4797,7 @@ hash_stmt_vertex_info (const void *elt)
{
const struct rdg_vertex_info *const rvi =
(const struct rdg_vertex_info *) elt;
- const_tree stmt = rvi->stmt;
+ gimple stmt = rvi->stmt;
return htab_hash_pointer (stmt);
}
@@ -4817,7 +4832,7 @@ build_rdg (struct loop *loop)
struct graph *rdg = NULL;
VEC (ddr_p, heap) *dependence_relations;
VEC (data_reference_p, heap) *datarefs;
- VEC (tree, heap) *stmts = VEC_alloc (tree, heap, nb_data_refs);
+ VEC (gimple, heap) *stmts = VEC_alloc (gimple, heap, nb_data_refs);
dependence_relations = VEC_alloc (ddr_p, heap, nb_data_refs * nb_data_refs) ;
datarefs = VEC_alloc (data_reference_p, heap, nb_data_refs);
@@ -4830,7 +4845,7 @@ build_rdg (struct loop *loop)
goto end_rdg;
stmts_from_loop (loop, &stmts);
- rdg = new_graph (VEC_length (tree, stmts));
+ rdg = new_graph (VEC_length (gimple, stmts));
rdg->indices = htab_create (nb_data_refs, hash_stmt_vertex_info,
eq_stmt_vertex_info, hash_stmt_vertex_del);
@@ -4840,7 +4855,7 @@ build_rdg (struct loop *loop)
end_rdg:
free_dependence_relations (dependence_relations);
free_data_refs (datarefs);
- VEC_free (tree, heap, stmts);
+ VEC_free (gimple, heap, stmts);
return rdg;
}
@@ -4863,7 +4878,7 @@ free_rdg (struct graph *rdg)
store to memory. */
void
-stores_from_loop (struct loop *loop, VEC (tree, heap) **stmts)
+stores_from_loop (struct loop *loop, VEC (gimple, heap) **stmts)
{
unsigned int i;
basic_block *bbs = get_loop_body_in_dom_order (loop);
@@ -4871,11 +4886,11 @@ stores_from_loop (struct loop *loop, VEC (tree, heap) **stmts)
for (i = 0; i < loop->num_nodes; i++)
{
basic_block bb = bbs[i];
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- if (!ZERO_SSA_OPERANDS (bsi_stmt (bsi), SSA_OP_VDEF))
- VEC_safe_push (tree, heap, *stmts, bsi_stmt (bsi));
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ if (!ZERO_SSA_OPERANDS (gsi_stmt (bsi), SSA_OP_VDEF))
+ VEC_safe_push (gimple, heap, *stmts, gsi_stmt (bsi));
}
free (bbs);
@@ -4885,7 +4900,7 @@ stores_from_loop (struct loop *loop, VEC (tree, heap) **stmts)
address or NULL_TREE if the base is not determined. */
static inline tree
-ref_base_address (tree stmt, data_ref_loc *ref)
+ref_base_address (gimple stmt, data_ref_loc *ref)
{
tree base = NULL_TREE;
tree base_address;
@@ -4921,7 +4936,7 @@ ref_base_address (tree stmt, data_ref_loc *ref)
bool
rdg_defs_used_in_other_loops_p (struct graph *rdg, int v)
{
- tree stmt = RDG_STMT (rdg, v);
+ gimple stmt = RDG_STMT (rdg, v);
struct loop *loop = loop_containing_stmt (stmt);
use_operand_p imm_use_p;
imm_use_iterator iterator;
@@ -4949,7 +4964,7 @@ rdg_defs_used_in_other_loops_p (struct graph *rdg, int v)
ref_base_address is the same. */
bool
-have_similar_memory_accesses (tree s1, tree s2)
+have_similar_memory_accesses (gimple s1, gimple s2)
{
bool res = false;
unsigned i, j;
@@ -4983,8 +4998,8 @@ have_similar_memory_accesses (tree s1, tree s2)
static int
have_similar_memory_accesses_1 (const void *s1, const void *s2)
{
- return have_similar_memory_accesses (CONST_CAST_TREE ((const_tree)s1),
- CONST_CAST_TREE ((const_tree)s2));
+ return have_similar_memory_accesses (CONST_CAST_GIMPLE ((const_gimple) s1),
+ CONST_CAST_GIMPLE ((const_gimple) s2));
}
/* Helper function for the hashtab. */
@@ -4992,7 +5007,7 @@ have_similar_memory_accesses_1 (const void *s1, const void *s2)
static hashval_t
ref_base_address_1 (const void *s)
{
- tree stmt = CONST_CAST_TREE((const_tree)s);
+ gimple stmt = CONST_CAST_GIMPLE ((const_gimple) s);
unsigned i;
VEC (data_ref_loc, heap) *refs;
data_ref_loc *ref;
@@ -5014,21 +5029,21 @@ ref_base_address_1 (const void *s)
/* Try to remove duplicated write data references from STMTS. */
void
-remove_similar_memory_refs (VEC (tree, heap) **stmts)
+remove_similar_memory_refs (VEC (gimple, heap) **stmts)
{
unsigned i;
- tree stmt;
- htab_t seen = htab_create (VEC_length (tree, *stmts), ref_base_address_1,
+ gimple stmt;
+ htab_t seen = htab_create (VEC_length (gimple, *stmts), ref_base_address_1,
have_similar_memory_accesses_1, NULL);
- for (i = 0; VEC_iterate (tree, *stmts, i, stmt); )
+ for (i = 0; VEC_iterate (gimple, *stmts, i, stmt); )
{
void **slot;
slot = htab_find_slot (seen, stmt, INSERT);
if (*slot)
- VEC_ordered_remove (tree, *stmts, i);
+ VEC_ordered_remove (gimple, *stmts, i);
else
{
*slot = (void *) stmt;
diff --git a/gcc/tree-data-ref.h b/gcc/tree-data-ref.h
index c1672eb3d53..639a32bf82b 100644
--- a/gcc/tree-data-ref.h
+++ b/gcc/tree-data-ref.h
@@ -156,7 +156,7 @@ int access_matrix_get_index_for_parameter (tree, struct access_matrix *);
struct data_reference
{
/* A pointer to the statement that contains this DR. */
- tree stmt;
+ gimple stmt;
/* A pointer to the memory reference. */
tree ref;
@@ -368,7 +368,7 @@ typedef struct data_ref_loc_d
DEF_VEC_O (data_ref_loc);
DEF_VEC_ALLOC_O (data_ref_loc, heap);
-bool get_references_in_stmt (tree, VEC (data_ref_loc, heap) **);
+bool get_references_in_stmt (gimple, VEC (data_ref_loc, heap) **);
void dr_analyze_innermost (struct data_reference *);
extern bool compute_data_dependences_for_loop (struct loop *, bool,
VEC (data_reference_p, heap) **,
@@ -392,7 +392,7 @@ extern void free_dependence_relation (struct data_dependence_relation *);
extern void free_dependence_relations (VEC (ddr_p, heap) *);
extern void free_data_ref (data_reference_p);
extern void free_data_refs (VEC (data_reference_p, heap) *);
-struct data_reference *create_data_ref (struct loop *, tree, tree, bool);
+struct data_reference *create_data_ref (struct loop *, tree, gimple, bool);
bool find_loop_nest (struct loop *, VEC (loop_p, heap) **);
void compute_all_dependences (VEC (data_reference_p, heap) *,
VEC (ddr_p, heap) **, VEC (loop_p, heap) *, bool);
@@ -462,7 +462,7 @@ ddr_dependence_level (ddr_p ddr)
typedef struct rdg_vertex
{
/* The statement represented by this vertex. */
- tree stmt;
+ gimple stmt;
/* True when the statement contains a write to memory. */
bool has_mem_write;
@@ -485,7 +485,7 @@ void debug_rdg_component (struct graph *, int);
void dump_rdg (FILE *, struct graph *);
void debug_rdg (struct graph *);
void dot_rdg (struct graph *);
-int rdg_vertex_for_stmt (struct graph *, tree);
+int rdg_vertex_for_stmt (struct graph *, gimple);
/* Data dependence type. */
@@ -538,10 +538,10 @@ index_in_loop_nest (int var, VEC (loop_p, heap) *loop_nest)
return var_index;
}
-void stores_from_loop (struct loop *, VEC (tree, heap) **);
-void remove_similar_memory_refs (VEC (tree, heap) **);
+void stores_from_loop (struct loop *, VEC (gimple, heap) **);
+void remove_similar_memory_refs (VEC (gimple, heap) **);
bool rdg_defs_used_in_other_loops_p (struct graph *, int);
-bool have_similar_memory_accesses (tree, tree);
+bool have_similar_memory_accesses (gimple, gimple);
/* Determines whether RDG vertices V1 and V2 access to similar memory
locations, in which case they have to be in the same partition. */
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c
index 285af39b3ca..df0be2df134 100644
--- a/gcc/tree-dfa.c
+++ b/gcc/tree-dfa.c
@@ -39,7 +39,7 @@ along with GCC; see the file COPYING3. If not see
#include "function.h"
#include "diagnostic.h"
#include "tree-dump.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-flow.h"
#include "tree-inline.h"
#include "tree-pass.h"
@@ -52,13 +52,12 @@ along with GCC; see the file COPYING3. If not see
/* Counters used to display DFA and SSA statistics. */
struct dfa_stats_d
{
- long num_stmt_anns;
long num_var_anns;
long num_defs;
long num_uses;
long num_phis;
long num_phi_args;
- int max_num_phi_args;
+ size_t max_num_phi_args;
long num_vdefs;
long num_vuses;
};
@@ -66,7 +65,6 @@ struct dfa_stats_d
/* Local functions. */
static void collect_dfa_stats (struct dfa_stats_d *);
-static tree collect_dfa_stats_r (tree *, int *, void *);
static tree find_vars_r (tree *, int *, void *);
@@ -85,27 +83,28 @@ static unsigned int
find_referenced_vars (void)
{
basic_block bb;
- block_stmt_iterator si;
- tree phi;
+ gimple_stmt_iterator si;
FOR_EACH_BB (bb)
{
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
- tree *stmt_p = bsi_stmt_ptr (si);
- walk_tree (stmt_p, find_vars_r, NULL, NULL);
+ size_t i;
+ gimple stmt = gsi_stmt (si);
+ for (i = 0; i < gimple_num_ops (stmt); i++)
+ walk_tree (gimple_op_ptr (stmt, i), find_vars_r, NULL, NULL);
}
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
{
- int len = PHI_NUM_ARGS (phi);
- int i;
+ gimple phi = gsi_stmt (si);
+ size_t i, len = gimple_phi_num_args (phi);
- walk_tree (&phi, find_vars_r, NULL, NULL);
+ walk_tree (gimple_phi_result_ptr (phi), find_vars_r, NULL, NULL);
for (i = 0; i < len; i++)
{
- tree arg = PHI_ARG_DEF (phi, i);
+ tree arg = gimple_phi_arg_def (phi, i);
walk_tree (&arg, find_vars_r, NULL, NULL);
}
}
@@ -176,29 +175,6 @@ create_function_ann (tree t)
return ann;
}
-/* Create a new annotation for a statement node T. */
-
-stmt_ann_t
-create_stmt_ann (tree t)
-{
- stmt_ann_t ann;
-
- gcc_assert (is_gimple_stmt (t));
- gcc_assert (!t->base.ann || t->base.ann->common.type == STMT_ANN);
-
- ann = GGC_CNEW (struct stmt_ann_d);
-
- ann->common.type = STMT_ANN;
-
- /* Since we just created the annotation, mark the statement modified. */
- ann->modified = true;
-
- ann->uid = inc_gimple_stmt_max_uid (cfun);
- t->base.ann = (tree_ann_t) ann;
-
- return ann;
-}
-
/* Renumber all of the gimple stmt uids. */
void
@@ -209,17 +185,11 @@ renumber_gimple_stmt_uids (void)
set_gimple_stmt_max_uid (cfun, 0);
FOR_ALL_BB (bb)
{
- block_stmt_iterator bsi;
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ gimple_stmt_iterator bsi;
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
{
- tree stmt = bsi_stmt (bsi);
- /* If the stmt has an annotation, then overwrite it, if not,
- the process of getting it will set the number
- properly. */
- if (has_stmt_ann (stmt))
- set_gimple_stmt_uid (stmt, inc_gimple_stmt_max_uid (cfun));
- else
- get_stmt_ann (stmt);
+ gimple stmt = gsi_stmt (bsi);
+ gimple_set_uid (stmt, inc_gimple_stmt_max_uid (cfun));
}
}
}
@@ -237,6 +207,7 @@ create_tree_common_ann (tree t)
ann = GGC_CNEW (struct tree_ann_common_d);
ann->type = TREE_ANN_COMMON;
+ ann->rn = -1;
t->base.ann = (tree_ann_t) ann;
return ann;
@@ -448,11 +419,6 @@ dump_dfa_stats (FILE *file)
fprintf (file, fmt_str_1, "Referenced variables", (unsigned long)num_referenced_vars,
SCALE (size), LABEL (size));
- size = dfa_stats.num_stmt_anns * sizeof (struct stmt_ann_d);
- total += size;
- fprintf (file, fmt_str_1, "Statements annotated", dfa_stats.num_stmt_anns,
- SCALE (size), LABEL (size));
-
size = dfa_stats.num_var_anns * sizeof (struct var_ann_d);
total += size;
fprintf (file, fmt_str_1, "Variables annotated", dfa_stats.num_var_anns,
@@ -478,7 +444,7 @@ dump_dfa_stats (FILE *file)
fprintf (file, fmt_str_1, "VDEF operands", dfa_stats.num_vdefs,
SCALE (size), LABEL (size));
- size = dfa_stats.num_phis * sizeof (struct tree_phi_node);
+ size = dfa_stats.num_phis * sizeof (struct gimple_statement_phi);
total += size;
fprintf (file, fmt_str_1, "PHI nodes", dfa_stats.num_phis,
SCALE (size), LABEL (size));
@@ -495,9 +461,9 @@ dump_dfa_stats (FILE *file)
fprintf (file, "\n");
if (dfa_stats.num_phis)
- fprintf (file, "Average number of arguments per PHI node: %.1f (max: %d)\n",
+ fprintf (file, "Average number of arguments per PHI node: %.1f (max: %ld)\n",
(float) dfa_stats.num_phi_args / (float) dfa_stats.num_phis,
- dfa_stats.max_num_phi_args);
+ (long) dfa_stats.max_num_phi_args);
fprintf (file, "\n");
}
@@ -516,75 +482,44 @@ debug_dfa_stats (void)
DFA_STATS_P. */
static void
-collect_dfa_stats (struct dfa_stats_d *dfa_stats_p)
+collect_dfa_stats (struct dfa_stats_d *dfa_stats_p ATTRIBUTE_UNUSED)
{
- struct pointer_set_t *pset;
basic_block bb;
- block_stmt_iterator i;
+ referenced_var_iterator vi;
+ tree var;
gcc_assert (dfa_stats_p);
memset ((void *)dfa_stats_p, 0, sizeof (struct dfa_stats_d));
- /* Walk all the trees in the function counting references. Start at
- basic block NUM_FIXED_BLOCKS, but don't stop at block boundaries. */
- pset = pointer_set_create ();
-
- for (i = bsi_start (BASIC_BLOCK (NUM_FIXED_BLOCKS));
- !bsi_end_p (i); bsi_next (&i))
- walk_tree (bsi_stmt_ptr (i), collect_dfa_stats_r, (void *) dfa_stats_p,
- pset);
-
- pointer_set_destroy (pset);
+ /* Count all the variable annotations. */
+ FOR_EACH_REFERENCED_VAR (var, vi)
+ if (var_ann (var))
+ dfa_stats_p->num_var_anns++;
+ /* Walk all the statements in the function counting references. */
FOR_EACH_BB (bb)
{
- tree phi;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ gimple_stmt_iterator si;
+
+ for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
{
+ gimple phi = gsi_stmt (si);
dfa_stats_p->num_phis++;
- dfa_stats_p->num_phi_args += PHI_NUM_ARGS (phi);
- if (PHI_NUM_ARGS (phi) > dfa_stats_p->max_num_phi_args)
- dfa_stats_p->max_num_phi_args = PHI_NUM_ARGS (phi);
+ dfa_stats_p->num_phi_args += gimple_phi_num_args (phi);
+ if (gimple_phi_num_args (phi) > dfa_stats_p->max_num_phi_args)
+ dfa_stats_p->max_num_phi_args = gimple_phi_num_args (phi);
}
- }
-}
-
-/* Callback for walk_tree to collect DFA statistics for a tree and its
- children. */
-
-static tree
-collect_dfa_stats_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
- void *data)
-{
- tree t = *tp;
- struct dfa_stats_d *dfa_stats_p = (struct dfa_stats_d *)data;
-
- if (t->base.ann)
- {
- switch (ann_type (t->base.ann))
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
- case STMT_ANN:
- {
- dfa_stats_p->num_stmt_anns++;
- dfa_stats_p->num_defs += NUM_SSA_OPERANDS (t, SSA_OP_DEF);
- dfa_stats_p->num_uses += NUM_SSA_OPERANDS (t, SSA_OP_USE);
- dfa_stats_p->num_vdefs += NUM_SSA_OPERANDS (t, SSA_OP_VDEF);
- dfa_stats_p->num_vuses += NUM_SSA_OPERANDS (t, SSA_OP_VUSE);
- break;
- }
-
- case VAR_ANN:
- dfa_stats_p->num_var_anns++;
- break;
-
- default:
- break;
+ gimple stmt = gsi_stmt (si);
+ dfa_stats_p->num_defs += NUM_SSA_OPERANDS (stmt, SSA_OP_DEF);
+ dfa_stats_p->num_uses += NUM_SSA_OPERANDS (stmt, SSA_OP_USE);
+ dfa_stats_p->num_vdefs += NUM_SSA_OPERANDS (stmt, SSA_OP_VDEF);
+ dfa_stats_p->num_vuses += NUM_SSA_OPERANDS (stmt, SSA_OP_VUSE);
}
}
-
- return NULL;
}
@@ -800,7 +735,7 @@ get_virtual_var (tree var)
combination push_stmt_changes/pop_stmt_changes. */
void
-mark_symbols_for_renaming (tree stmt)
+mark_symbols_for_renaming (gimple stmt)
{
tree op;
ssa_op_iter iter;
@@ -814,8 +749,9 @@ mark_symbols_for_renaming (tree stmt)
}
-/* Find all variables within the gimplified statement that were not previously
- visible to the function and add them to the referenced variables list. */
+/* Find all variables within the gimplified statement that were not
+ previously visible to the function and add them to the referenced
+ variables list. */
static tree
find_new_referenced_vars_1 (tree *tp, int *walk_subtrees,
@@ -835,10 +771,13 @@ find_new_referenced_vars_1 (tree *tp, int *walk_subtrees,
return NULL;
}
+
+/* Find any new referenced variables in STMT. */
+
void
-find_new_referenced_vars (tree *stmt_p)
+find_new_referenced_vars (gimple stmt)
{
- walk_tree (stmt_p, find_new_referenced_vars_1, NULL, NULL);
+ walk_gimple_op (stmt, find_new_referenced_vars_1, NULL);
}
@@ -1013,7 +952,7 @@ get_ref_base_and_extent (tree exp, HOST_WIDE_INT *poffset,
SSA_NAME_OCCURS_IN_ABNORMAL_PHI set, otherwise false. */
bool
-stmt_references_abnormal_ssa_name (tree stmt)
+stmt_references_abnormal_ssa_name (gimple stmt)
{
ssa_op_iter oi;
use_operand_p use_p;
@@ -1163,25 +1102,25 @@ refs_may_alias_p (tree ref1, tree ref2)
a PHI node as well. Note that if all VUSEs are default definitions
this function will return an empty statement. */
-tree
-get_single_def_stmt (tree stmt)
+gimple
+get_single_def_stmt (gimple stmt)
{
- tree def_stmt = NULL_TREE;
+ gimple def_stmt = NULL;
tree use;
ssa_op_iter iter;
FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_VIRTUAL_USES)
{
- tree tmp = SSA_NAME_DEF_STMT (use);
+ gimple tmp = SSA_NAME_DEF_STMT (use);
/* ??? This is too simplistic for multiple virtual operands
reaching different PHI nodes of the same basic blocks or for
reaching all default definitions. */
if (def_stmt
&& def_stmt != tmp
- && !(IS_EMPTY_STMT (def_stmt)
- && IS_EMPTY_STMT (tmp)))
- return NULL_TREE;
+ && !(gimple_nop_p (def_stmt)
+ && gimple_nop_p (tmp)))
+ return NULL;
def_stmt = tmp;
}
@@ -1195,25 +1134,25 @@ get_single_def_stmt (tree stmt)
from a non-backedge. Returns NULL_TREE if such statement within
the above conditions cannot be found. */
-tree
-get_single_def_stmt_from_phi (tree ref, tree phi)
+gimple
+get_single_def_stmt_from_phi (tree ref, gimple phi)
{
tree def_arg = NULL_TREE;
- int i;
+ unsigned i;
/* Find the single PHI argument that is not flowing in from a
back edge and verify that the loop-carried definitions do
not alias the reference we look for. */
- for (i = 0; i < PHI_NUM_ARGS (phi); ++i)
+ for (i = 0; i < gimple_phi_num_args (phi); ++i)
{
tree arg = PHI_ARG_DEF (phi, i);
- tree def_stmt;
+ gimple def_stmt;
- if (!(PHI_ARG_EDGE (phi, i)->flags & EDGE_DFS_BACK))
+ if (!(gimple_phi_arg_edge (phi, i)->flags & EDGE_DFS_BACK))
{
/* Multiple non-back edges? Do not try to handle this. */
if (def_arg)
- return NULL_TREE;
+ return NULL;
def_arg = arg;
continue;
}
@@ -1223,14 +1162,14 @@ get_single_def_stmt_from_phi (tree ref, tree phi)
def_stmt = SSA_NAME_DEF_STMT (arg);
do
{
- if (TREE_CODE (def_stmt) != GIMPLE_MODIFY_STMT
- || refs_may_alias_p (ref, GIMPLE_STMT_OPERAND (def_stmt, 0)))
- return NULL_TREE;
+ if (!is_gimple_assign (def_stmt)
+ || refs_may_alias_p (ref, gimple_assign_lhs (def_stmt)))
+ return NULL;
/* ??? This will only work, reaching the PHI node again if
there is a single virtual operand on def_stmt. */
def_stmt = get_single_def_stmt (def_stmt);
if (!def_stmt)
- return NULL_TREE;
+ return NULL;
}
while (def_stmt != phi);
}
@@ -1243,8 +1182,8 @@ get_single_def_stmt_from_phi (tree ref, tree phi)
Take into account only definitions that alias REF if following
back-edges when looking through a loop PHI node. */
-tree
-get_single_def_stmt_with_phi (tree ref, tree stmt)
+gimple
+get_single_def_stmt_with_phi (tree ref, gimple stmt)
{
switch (NUM_SSA_OPERANDS (stmt, SSA_OP_VIRTUAL_USES))
{
@@ -1253,11 +1192,11 @@ get_single_def_stmt_with_phi (tree ref, tree stmt)
case 1:
{
- tree def_stmt = SSA_NAME_DEF_STMT (SINGLE_SSA_TREE_OPERAND
+ gimple def_stmt = SSA_NAME_DEF_STMT (SINGLE_SSA_TREE_OPERAND
(stmt, SSA_OP_VIRTUAL_USES));
/* We can handle lookups over PHI nodes only for a single
virtual operand. */
- if (TREE_CODE (def_stmt) == PHI_NODE)
+ if (gimple_code (def_stmt) == GIMPLE_PHI)
return get_single_def_stmt_from_phi (ref, def_stmt);
return def_stmt;
}
diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c
index 7cc0285ff48..ffac189f449 100644
--- a/gcc/tree-dump.c
+++ b/gcc/tree-dump.c
@@ -598,11 +598,6 @@ dequeue_and_dump (dump_info_p di)
dump_child ("op 1", TREE_OPERAND (t, 1));
break;
- case GIMPLE_MODIFY_STMT:
- dump_child ("op 0", GIMPLE_STMT_OPERAND (t, 0));
- dump_child ("op 1", GIMPLE_STMT_OPERAND (t, 1));
- break;
-
case COMPONENT_REF:
dump_child ("op 0", TREE_OPERAND (t, 0));
dump_child ("op 1", TREE_OPERAND (t, 1));
@@ -825,7 +820,8 @@ static const struct dump_option_value_info dump_options[] =
{"memsyms", TDF_MEMSYMS},
{"verbose", TDF_VERBOSE},
{"all", ~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_TREE | TDF_RTL | TDF_IPA
- | TDF_STMTADDR | TDF_GRAPH | TDF_DIAGNOSTIC | TDF_VERBOSE)},
+ | TDF_STMTADDR | TDF_GRAPH | TDF_DIAGNOSTIC | TDF_VERBOSE
+ | TDF_RHS_ONLY)},
{NULL, 0}
};
@@ -836,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;
@@ -849,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 965acce7490..5fe8f24ed27 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -37,9 +37,12 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "ggc.h"
#include "toplev.h"
-#include "pointer-set.h"
+#include "gimple.h"
+
+/* In some instances a tree and a gimple need to be stored in a same table,
+ i.e. in hash tables. This is a structure to do this. */
+typedef union {tree *tp; tree t; gimple g;} treemple;
-
/* Nonzero if we are using EH to handle cleanups. */
static int using_eh_for_cleanups_p = 0;
@@ -48,7 +51,7 @@ using_eh_for_cleanups (void)
{
using_eh_for_cleanups_p = 1;
}
-
+
/* Misc functions used in this file. */
/* Compare and hash for any structure which begins with a canonical
@@ -70,7 +73,7 @@ struct_ptr_hash (const void *a)
return (size_t)*x >> 4;
}
-
+
/* Remember and lookup EH region data for arbitrary statements.
Really this means any statement that could_throw_p. We could
stuff this information into the stmt_ann data structure, but:
@@ -84,7 +87,7 @@ struct_ptr_hash (const void *a)
of space by only allocating memory for those that can throw. */
static void
-record_stmt_eh_region (struct eh_region *region, tree t)
+record_stmt_eh_region (struct eh_region *region, gimple t)
{
if (!region)
return;
@@ -92,14 +95,17 @@ record_stmt_eh_region (struct eh_region *region, tree t)
add_stmt_to_eh_region (t, get_eh_region_number (region));
}
+
+/* Add statement T in function IFUN to EH region NUM. */
+
void
-add_stmt_to_eh_region_fn (struct function *ifun, tree t, int num)
+add_stmt_to_eh_region_fn (struct function *ifun, gimple t, int num)
{
struct throw_stmt_node *n;
void **slot;
gcc_assert (num >= 0);
- gcc_assert (TREE_CODE (t) != RESX_EXPR);
+ gcc_assert (gimple_code (t) != GIMPLE_RESX);
n = GGC_NEW (struct throw_stmt_node);
n->stmt = t;
@@ -115,14 +121,21 @@ add_stmt_to_eh_region_fn (struct function *ifun, tree t, int num)
*slot = n;
}
+
+/* Add statement T in the current function (cfun) to EH region number
+ NUM. */
+
void
-add_stmt_to_eh_region (tree t, int num)
+add_stmt_to_eh_region (gimple t, int num)
{
add_stmt_to_eh_region_fn (cfun, t, num);
}
+
+/* Remove statement T in function IFUN from the EH region holding it. */
+
bool
-remove_stmt_from_eh_region_fn (struct function *ifun, tree t)
+remove_stmt_from_eh_region_fn (struct function *ifun, gimple t)
{
struct throw_stmt_node dummy;
void **slot;
@@ -142,54 +155,98 @@ remove_stmt_from_eh_region_fn (struct function *ifun, tree t)
return false;
}
+
+/* Remove statement T in the current function (cfun) from the EH
+ region holding it. */
+
bool
-remove_stmt_from_eh_region (tree t)
+remove_stmt_from_eh_region (gimple t)
{
return remove_stmt_from_eh_region_fn (cfun, t);
}
+/* Determine if statement T is inside an EH region in function IFUN.
+ Return the EH region number if found, return -2 if IFUN does not
+ have an EH table and -1 if T could not be found in IFUN's EH region
+ table. */
+
int
-lookup_stmt_eh_region_fn (struct function *ifun, const_tree t)
+lookup_stmt_eh_region_fn (struct function *ifun, gimple t)
{
struct throw_stmt_node *p, n;
if (!get_eh_throw_stmt_table (ifun))
return -2;
- /* The CONST_CAST is okay because we don't modify n.stmt throughout
- its scope, or the scope of p. */
- n.stmt = CONST_CAST_TREE (t);
- p = (struct throw_stmt_node *) htab_find (get_eh_throw_stmt_table (ifun),
- &n);
-
+ n.stmt = t;
+ p = (struct throw_stmt_node *) htab_find (get_eh_throw_stmt_table (ifun), &n);
return (p ? p->region_nr : -1);
}
+
+/* Determine if statement T is inside an EH region in the current
+ function (cfun). Return the EH region number if found, return -2
+ if cfun does not have an EH table and -1 if T could not be found in
+ cfun's EH region table. */
+
int
-lookup_stmt_eh_region (const_tree t)
+lookup_stmt_eh_region (gimple t)
{
/* We can get called from initialized data when -fnon-call-exceptions
is on; prevent crash. */
if (!cfun)
return -1;
+
return lookup_stmt_eh_region_fn (cfun, t);
}
-
-/* First pass of EH node decomposition. Build up a tree of TRY_FINALLY_EXPR
+
+/* Determine if expression T is inside an EH region in the current
+ function (cfun). Return the EH region number if found, return -2
+ if IFUN does not have an EH table and -1 if T could not be found in
+ IFUN's EH region table. */
+
+int
+lookup_expr_eh_region (tree t)
+{
+ /* We can get called from initialized data when -fnon-call-exceptions
+ is on; prevent crash. */
+ if (!cfun)
+ return -1;
+
+ if (!get_eh_throw_stmt_table (cfun))
+ return -2;
+
+ if (t && EXPR_P (t))
+ {
+ tree_ann_common_t ann = tree_common_ann (t);
+ if (ann)
+ return (int) ann->rn;
+ }
+
+ return -1;
+}
+
+
+/* First pass of EH node decomposition. Build up a tree of GIMPLE_TRY_FINALLY
nodes and LABEL_DECL nodes. We will use this during the second phase to
determine if a goto leaves the body of a TRY_FINALLY_EXPR node. */
struct finally_tree_node
{
- tree child, parent;
+ /* When storing a GIMPLE_TRY, we have to record a gimple. However
+ when deciding whether a GOTO to a certain LABEL_DECL (which is a
+ tree) leaves the TRY block, its necessary to record a tree in
+ this field. Thus a treemple is used. */
+ treemple child;
+ gimple parent;
};
/* Note that this table is *not* marked GTY. It is short-lived. */
static htab_t finally_tree;
static void
-record_in_finally_tree (tree child, tree parent)
+record_in_finally_tree (treemple child, gimple parent)
{
struct finally_tree_node *n;
void **slot;
@@ -204,40 +261,53 @@ record_in_finally_tree (tree child, tree parent)
}
static void
-collect_finally_tree (tree t, tree region)
+collect_finally_tree (gimple stmt, gimple region);
+
+/* Go through the gimple sequence. Works with collect_finally_tree to
+ record all GIMPLE_LABEL and GIMPLE_TRY statements. */
+
+static void
+collect_finally_tree_1 (gimple_seq seq, gimple region)
{
- tailrecurse:
- switch (TREE_CODE (t))
- {
- case LABEL_EXPR:
- record_in_finally_tree (LABEL_EXPR_LABEL (t), region);
- break;
+ gimple_stmt_iterator gsi;
- case TRY_FINALLY_EXPR:
- record_in_finally_tree (t, region);
- collect_finally_tree (TREE_OPERAND (t, 0), t);
- t = TREE_OPERAND (t, 1);
- goto tailrecurse;
+ for (gsi = gsi_start (seq); !gsi_end_p (gsi); gsi_next (&gsi))
+ collect_finally_tree (gsi_stmt (gsi), region);
+}
- case TRY_CATCH_EXPR:
- collect_finally_tree (TREE_OPERAND (t, 0), region);
- t = TREE_OPERAND (t, 1);
- goto tailrecurse;
+static void
+collect_finally_tree (gimple stmt, gimple region)
+{
+ treemple temp;
+
+ switch (gimple_code (stmt))
+ {
+ case GIMPLE_LABEL:
+ temp.t = gimple_label_label (stmt);
+ record_in_finally_tree (temp, region);
+ break;
- case CATCH_EXPR:
- t = CATCH_BODY (t);
- goto tailrecurse;
+ case GIMPLE_TRY:
+ if (gimple_try_kind (stmt) == GIMPLE_TRY_FINALLY)
+ {
+ temp.g = stmt;
+ record_in_finally_tree (temp, region);
+ collect_finally_tree_1 (gimple_try_eval (stmt), stmt);
+ collect_finally_tree_1 (gimple_try_cleanup (stmt), region);
+ }
+ else if (gimple_try_kind (stmt) == GIMPLE_TRY_CATCH)
+ {
+ collect_finally_tree_1 (gimple_try_eval (stmt), region);
+ collect_finally_tree_1 (gimple_try_cleanup (stmt), region);
+ }
+ break;
- case EH_FILTER_EXPR:
- t = EH_FILTER_FAILURE (t);
- goto tailrecurse;
+ case GIMPLE_CATCH:
+ collect_finally_tree_1 (gimple_catch_handler (stmt), region);
+ break;
- case STATEMENT_LIST:
- {
- tree_stmt_iterator i;
- for (i = tsi_start (t); !tsi_end_p (i); tsi_next (&i))
- collect_finally_tree (tsi_stmt (i), region);
- }
+ case GIMPLE_EH_FILTER:
+ collect_finally_tree_1 (gimple_eh_filter_failure (stmt), region);
break;
default:
@@ -247,11 +317,12 @@ collect_finally_tree (tree t, tree region)
}
}
+
/* Use the finally tree to determine if a jump from START to TARGET
would leave the try_finally node that START lives in. */
static bool
-outside_finally_tree (tree start, tree target)
+outside_finally_tree (treemple start, gimple target)
{
struct finally_tree_node n, *p;
@@ -261,15 +332,15 @@ outside_finally_tree (tree start, tree target)
p = (struct finally_tree_node *) htab_find (finally_tree, &n);
if (!p)
return true;
- start = p->parent;
+ start.g = p->parent;
}
- while (start != target);
+ while (start.g != target);
return false;
}
-
-/* Second pass of EH node decomposition. Actually transform the TRY_FINALLY
- and TRY_CATCH nodes into a set of gotos, magic labels, and eh regions.
+
+/* Second pass of EH node decomposition. Actually transform the GIMPLE_TRY
+ nodes into a set of gotos, magic labels, and eh regions.
The eh region creation is straight-forward, but frobbing all the gotos
and such into shape isn't. */
@@ -291,12 +362,15 @@ struct leh_state
struct leh_tf_state
{
- /* Pointer to the TRY_FINALLY node under discussion. The try_finally_expr
- is the original TRY_FINALLY_EXPR. We need to retain this so that
- outside_finally_tree can reliably reference the tree used in the
- collect_finally_tree data structures. */
- tree try_finally_expr;
- tree *top_p;
+ /* Pointer to the GIMPLE_TRY_FINALLY node under discussion. The
+ try_finally_expr is the original GIMPLE_TRY_FINALLY. We need to retain
+ this so that outside_finally_tree can reliably reference the tree used
+ in the collect_finally_tree data structures. */
+ gimple try_finally_expr;
+ gimple top_p;
+ /* While lowering a top_p usually it is expanded into multiple statements,
+ thus we need the following field to store them. */
+ gimple_seq top_p_seq;
/* The state outside this try_finally node. */
struct leh_state *outer;
@@ -304,13 +378,22 @@ struct leh_tf_state
/* The exception region created for it. */
struct eh_region *region;
- /* The GOTO_QUEUE is is an array of GOTO_EXPR and RETURN_EXPR statements
- that are seen to escape this TRY_FINALLY_EXPR node. */
+ /* The GOTO_QUEUE is is an array of GIMPLE_GOTO and GIMPLE_RETURN statements
+ that are seen to escape this GIMPLE_TRY_FINALLY node.
+ The idea is to record a gimple statement for everything except for
+ the conditionals, which get their labels recorded. Since labels are of
+ type 'tree', we need this node to store both gimple and tree objects.
+ REPL_STMT is the sequence used to replace the goto/return statement.
+ CONT_STMT is used to store the statement that allows the return/goto to
+ jump to the original destination. */
struct goto_queue_node {
- tree stmt;
- tree repl_stmt;
- tree cont_stmt;
+ treemple stmt;
+ gimple_seq repl_stmt;
+ gimple cont_stmt;
int index;
+ /* this is used when index >= 0 to indicate that stmt is a label(as
+ opposed to a goto stmt) */
+ int is_label;
} *goto_queue;
size_t goto_queue_size;
size_t goto_queue_active;
@@ -334,7 +417,7 @@ struct leh_tf_state
Cleared if the fallthru is converted to a goto. */
bool may_fallthru;
- /* True if any entry in goto_queue is a RETURN_EXPR. */
+ /* True if any entry in goto_queue is a GIMPLE_RETURN. */
bool may_return;
/* True if the finally block can receive an exception edge.
@@ -342,16 +425,17 @@ struct leh_tf_state
bool may_throw;
};
-static void lower_eh_filter (struct leh_state *, tree *);
-static void lower_eh_constructs_1 (struct leh_state *, tree *);
+static gimple_seq lower_eh_filter (struct leh_state *, gimple);
/* Search for STMT in the goto queue. Return the replacement,
or null if the statement isn't in the queue. */
#define LARGE_GOTO_QUEUE 20
-static tree
-find_goto_replacement (struct leh_tf_state *tf, tree stmt)
+static void lower_eh_constructs_1 (struct leh_state *state, gimple_seq seq);
+
+static gimple_seq
+find_goto_replacement (struct leh_tf_state *tf, treemple stmt)
{
unsigned int i;
void **slot;
@@ -359,7 +443,7 @@ find_goto_replacement (struct leh_tf_state *tf, tree stmt)
if (tf->goto_queue_active < LARGE_GOTO_QUEUE)
{
for (i = 0; i < tf->goto_queue_active; i++)
- if (tf->goto_queue[i].stmt == stmt)
+ if ( tf->goto_queue[i].stmt.g == stmt.g)
return tf->goto_queue[i].repl_stmt;
return NULL;
}
@@ -372,13 +456,14 @@ find_goto_replacement (struct leh_tf_state *tf, tree stmt)
tf->goto_queue_map = pointer_map_create ();
for (i = 0; i < tf->goto_queue_active; i++)
{
- slot = pointer_map_insert (tf->goto_queue_map, tf->goto_queue[i].stmt);
+ slot = pointer_map_insert (tf->goto_queue_map,
+ tf->goto_queue[i].stmt.g);
gcc_assert (*slot == NULL);
- *slot = (void *) &tf->goto_queue[i];
+ *slot = &tf->goto_queue[i];
}
}
- slot = pointer_map_contains (tf->goto_queue_map, stmt);
+ slot = pointer_map_contains (tf->goto_queue_map, stmt.g);
if (slot != NULL)
return (((struct goto_queue_node *) *slot)->repl_stmt);
@@ -386,91 +471,98 @@ find_goto_replacement (struct leh_tf_state *tf, tree stmt)
}
/* A subroutine of replace_goto_queue_1. Handles the sub-clauses of a
- lowered COND_EXPR. If, by chance, the replacement is a simple goto,
+ lowered GIMPLE_COND. If, by chance, the replacement is a simple goto,
then we can just splat it in, otherwise we add the new stmts immediately
- after the COND_EXPR and redirect. */
+ after the GIMPLE_COND and redirect. */
static void
replace_goto_queue_cond_clause (tree *tp, struct leh_tf_state *tf,
- tree_stmt_iterator *tsi)
+ gimple_stmt_iterator *gsi)
{
- tree new, one, label;
+ tree label;
+ gimple_seq new_seq;
+ treemple temp;
- new = find_goto_replacement (tf, *tp);
- if (!new)
+ temp.tp = tp;
+ new_seq = find_goto_replacement (tf, temp);
+ if (!new_seq)
return;
- one = expr_only (new);
- if (one && TREE_CODE (one) == GOTO_EXPR)
+ if (gimple_seq_singleton_p (new_seq)
+ && gimple_code (gimple_seq_first_stmt (new_seq)) == GIMPLE_GOTO)
{
- *tp = one;
+ *tp = gimple_goto_dest (gimple_seq_first_stmt (new_seq));
return;
}
- label = build1 (LABEL_EXPR, void_type_node, NULL_TREE);
- *tp = build_and_jump (&LABEL_EXPR_LABEL (label));
+ label = create_artificial_label ();
+ /* Set the new label for the GIMPLE_COND */
+ *tp = label;
- tsi_link_after (tsi, label, TSI_CONTINUE_LINKING);
- tsi_link_after (tsi, new, TSI_CONTINUE_LINKING);
+ gsi_insert_after (gsi, gimple_build_label (label), 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
point to the next statement. */
-static void replace_goto_queue_stmt_list (tree, struct leh_tf_state *);
+static void replace_goto_queue_stmt_list (gimple_seq, struct leh_tf_state *);
static void
-replace_goto_queue_1 (tree t, struct leh_tf_state *tf, tree_stmt_iterator *tsi)
+replace_goto_queue_1 (gimple stmt, struct leh_tf_state *tf,
+ gimple_stmt_iterator *gsi)
{
- switch (TREE_CODE (t))
+ gimple_seq seq;
+ treemple temp;
+ temp.g = NULL;
+
+ switch (gimple_code (stmt))
{
- case GOTO_EXPR:
- case RETURN_EXPR:
- t = find_goto_replacement (tf, t);
- if (t)
+ case GIMPLE_GOTO:
+ case GIMPLE_RETURN:
+ temp.g = stmt;
+ seq = find_goto_replacement (tf, temp);
+ if (seq)
{
- tsi_link_before (tsi, t, TSI_SAME_STMT);
- tsi_delink (tsi);
+ gsi_insert_seq_before (gsi, gimple_seq_copy (seq), GSI_SAME_STMT);
+ gsi_remove (gsi, false);
return;
}
break;
- case COND_EXPR:
- replace_goto_queue_cond_clause (&COND_EXPR_THEN (t), tf, tsi);
- replace_goto_queue_cond_clause (&COND_EXPR_ELSE (t), tf, tsi);
+ case GIMPLE_COND:
+ replace_goto_queue_cond_clause (gimple_op_ptr (stmt, 2), tf, gsi);
+ replace_goto_queue_cond_clause (gimple_op_ptr (stmt, 3), tf, gsi);
break;
- case TRY_FINALLY_EXPR:
- case TRY_CATCH_EXPR:
- replace_goto_queue_stmt_list (TREE_OPERAND (t, 0), tf);
- replace_goto_queue_stmt_list (TREE_OPERAND (t, 1), tf);
+ case GIMPLE_TRY:
+ replace_goto_queue_stmt_list (gimple_try_eval (stmt), tf);
+ replace_goto_queue_stmt_list (gimple_try_cleanup (stmt), tf);
break;
- case CATCH_EXPR:
- replace_goto_queue_stmt_list (CATCH_BODY (t), tf);
+ case GIMPLE_CATCH:
+ replace_goto_queue_stmt_list (gimple_catch_handler (stmt), tf);
break;
- case EH_FILTER_EXPR:
- replace_goto_queue_stmt_list (EH_FILTER_FAILURE (t), tf);
+ case GIMPLE_EH_FILTER:
+ replace_goto_queue_stmt_list (gimple_eh_filter_failure (stmt), tf);
break;
- case STATEMENT_LIST:
- gcc_unreachable ();
-
default:
/* These won't have gotos in them. */
break;
}
- tsi_next (tsi);
+ gsi_next (gsi);
}
-/* A subroutine of replace_goto_queue. Handles STATEMENT_LISTs. */
+/* A subroutine of replace_goto_queue. Handles GIMPLE_SEQ. */
static void
-replace_goto_queue_stmt_list (tree t, struct leh_tf_state *tf)
+replace_goto_queue_stmt_list (gimple_seq seq, struct leh_tf_state *tf)
{
- tree_stmt_iterator i = tsi_start (t);
- while (!tsi_end_p (i))
- replace_goto_queue_1 (tsi_stmt (i), tf, &i);
+ gimple_stmt_iterator gsi = gsi_start (seq);
+
+ while (!gsi_end_p (gsi))
+ replace_goto_queue_1 (gsi_stmt (gsi), tf, &gsi);
}
/* Replace all goto queue members. */
@@ -480,66 +572,21 @@ replace_goto_queue (struct leh_tf_state *tf)
{
if (tf->goto_queue_active == 0)
return;
- replace_goto_queue_stmt_list (*tf->top_p, tf);
+ replace_goto_queue_stmt_list (tf->top_p_seq, tf);
}
-/* For any GOTO_EXPR or RETURN_EXPR, decide whether it leaves a try_finally
- node, and if so record that fact in the goto queue associated with that
- try_finally node. */
+/* Add a new record to the goto queue contained in TF. NEW_STMT is the
+ data to be added, IS_LABEL indicates whether NEW_STMT is a label or
+ a gimple return. */
static void
-maybe_record_in_goto_queue (struct leh_state *state, tree stmt)
+record_in_goto_queue (struct leh_tf_state *tf,
+ treemple new_stmt,
+ int index,
+ bool is_label)
{
- struct leh_tf_state *tf = state->tf;
- struct goto_queue_node *q;
size_t active, size;
- int index;
-
- if (!tf)
- return;
-
- switch (TREE_CODE (stmt))
- {
- case GOTO_EXPR:
- {
- tree lab = GOTO_DESTINATION (stmt);
-
- /* Computed and non-local gotos do not get processed. Given
- their nature we can neither tell whether we've escaped the
- finally block nor redirect them if we knew. */
- if (TREE_CODE (lab) != LABEL_DECL)
- return;
-
- /* No need to record gotos that don't leave the try block. */
- if (! outside_finally_tree (lab, tf->try_finally_expr))
- return;
-
- if (! tf->dest_array)
- {
- tf->dest_array = VEC_alloc (tree, heap, 10);
- VEC_quick_push (tree, tf->dest_array, lab);
- index = 0;
- }
- else
- {
- int n = VEC_length (tree, tf->dest_array);
- for (index = 0; index < n; ++index)
- if (VEC_index (tree, tf->dest_array, index) == lab)
- break;
- if (index == n)
- VEC_safe_push (tree, heap, tf->dest_array, lab);
- }
- }
- break;
-
- case RETURN_EXPR:
- tf->may_return = true;
- index = -1;
- break;
-
- default:
- gcc_unreachable ();
- }
+ struct goto_queue_node *q;
gcc_assert (!tf->goto_queue_map);
@@ -557,32 +604,118 @@ maybe_record_in_goto_queue (struct leh_state *state, tree stmt)
tf->goto_queue_active = active + 1;
memset (q, 0, sizeof (*q));
- q->stmt = stmt;
+ q->stmt = new_stmt;
q->index = index;
+ q->is_label = is_label;
+}
+
+/* Record the LABEL label in the goto queue contained in TF.
+ TF is not null. */
+
+static void
+record_in_goto_queue_label (struct leh_tf_state *tf, treemple stmt, tree label)
+{
+ int index;
+ treemple temp, new_stmt;
+
+ if (!label)
+ return;
+
+ /* Computed and non-local gotos do not get processed. Given
+ their nature we can neither tell whether we've escaped the
+ finally block nor redirect them if we knew. */
+ if (TREE_CODE (label) != LABEL_DECL)
+ return;
+
+ /* No need to record gotos that don't leave the try block. */
+ temp.t = label;
+ if (!outside_finally_tree (temp, tf->try_finally_expr))
+ return;
+
+ if (! tf->dest_array)
+ {
+ tf->dest_array = VEC_alloc (tree, heap, 10);
+ VEC_quick_push (tree, tf->dest_array, label);
+ index = 0;
+ }
+ else
+ {
+ int n = VEC_length (tree, tf->dest_array);
+ for (index = 0; index < n; ++index)
+ if (VEC_index (tree, tf->dest_array, index) == label)
+ break;
+ if (index == n)
+ VEC_safe_push (tree, heap, tf->dest_array, label);
+ }
+
+ /* In the case of a GOTO we want to record the destination label,
+ since with a GIMPLE_COND we have an easy access to the then/else
+ labels. */
+ new_stmt = stmt;
+ record_in_goto_queue (tf, new_stmt, index, true);
+
+}
+
+/* For any GIMPLE_GOTO or GIMPLE_RETURN, decide whether it leaves a try_finally
+ node, and if so record that fact in the goto queue associated with that
+ try_finally node. */
+
+static void
+maybe_record_in_goto_queue (struct leh_state *state, gimple stmt)
+{
+ struct leh_tf_state *tf = state->tf;
+ treemple new_stmt;
+
+ if (!tf)
+ return;
+
+ switch (gimple_code (stmt))
+ {
+ case GIMPLE_COND:
+ new_stmt.tp = gimple_op_ptr (stmt, 2);
+ record_in_goto_queue_label (tf, new_stmt, gimple_cond_true_label (stmt));
+ new_stmt.tp = gimple_op_ptr (stmt, 3);
+ record_in_goto_queue_label (tf, new_stmt, gimple_cond_false_label (stmt));
+ break;
+ case GIMPLE_GOTO:
+ new_stmt.g = stmt;
+ record_in_goto_queue_label (tf, new_stmt, gimple_goto_dest (stmt));
+ break;
+
+ case GIMPLE_RETURN:
+ tf->may_return = true;
+ new_stmt.g = stmt;
+ record_in_goto_queue (tf, new_stmt, -1, false);
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
}
+
#ifdef ENABLE_CHECKING
-/* We do not process SWITCH_EXPRs for now. As long as the original source
+/* We do not process GIMPLE_SWITCHes for now. As long as the original source
was in fact structured, and we've not yet done jump threading, then none
- of the labels will leave outer TRY_FINALLY_EXPRs. Verify this. */
+ of the labels will leave outer GIMPLE_TRY_FINALLY nodes. Verify this. */
static void
-verify_norecord_switch_expr (struct leh_state *state, tree switch_expr)
+verify_norecord_switch_expr (struct leh_state *state, gimple switch_expr)
{
struct leh_tf_state *tf = state->tf;
size_t i, n;
- tree vec;
if (!tf)
return;
- vec = SWITCH_LABELS (switch_expr);
- n = TREE_VEC_LENGTH (vec);
+ n = gimple_switch_num_labels (switch_expr);
for (i = 0; i < n; ++i)
{
- tree lab = CASE_LABEL (TREE_VEC_ELT (vec, i));
- gcc_assert (!outside_finally_tree (lab, tf->try_finally_expr));
+ treemple temp;
+ tree lab = CASE_LABEL (gimple_switch_label (switch_expr, i));
+ temp.t = lab;
+ gcc_assert (!outside_finally_tree (temp, tf->try_finally_expr));
}
}
#else
@@ -595,14 +728,24 @@ verify_norecord_switch_expr (struct leh_state *state, tree switch_expr)
variable to be used in manipulating the value returned from the function. */
static void
-do_return_redirection (struct goto_queue_node *q, tree finlab, tree mod,
+do_return_redirection (struct goto_queue_node *q, tree finlab, gimple_seq mod,
tree *return_value_p)
{
- tree ret_expr = TREE_OPERAND (q->stmt, 0);
- tree x;
+ tree ret_expr;
+ gimple x;
+
+ /* In the case of a return, the queue node must be a gimple statement. */
+ gcc_assert (!q->is_label);
+
+ ret_expr = gimple_return_retval (q->stmt.g);
if (ret_expr)
{
+ if (!*return_value_p)
+ *return_value_p = ret_expr;
+ else
+ gcc_assert (*return_value_p == ret_expr);
+ q->cont_stmt = q->stmt.g;
/* The nasty part about redirecting the return value is that the
return value itself is to be computed before the FINALLY block
is executed. e.g.
@@ -625,78 +768,50 @@ do_return_redirection (struct goto_queue_node *q, tree finlab, tree mod,
depends, I guess, but it does make generation of the switch in
lower_try_finally_switch easier. */
- switch (TREE_CODE (ret_expr))
+ if (TREE_CODE (ret_expr) == RESULT_DECL)
{
- case RESULT_DECL:
if (!*return_value_p)
*return_value_p = ret_expr;
else
gcc_assert (*return_value_p == ret_expr);
- q->cont_stmt = q->stmt;
- break;
-
- case GIMPLE_MODIFY_STMT:
- {
- tree result = GIMPLE_STMT_OPERAND (ret_expr, 0);
- tree new, old = GIMPLE_STMT_OPERAND (ret_expr, 1);
-
- if (!*return_value_p)
- {
- if (aggregate_value_p (TREE_TYPE (result),
- TREE_TYPE (current_function_decl)))
- /* If this function returns in memory, copy the argument
- into the return slot now. Otherwise, we might need to
- worry about magic return semantics, so we need to use a
- temporary to hold the value until we're actually ready
- to return. */
- new = result;
- else
- new = create_tmp_var (TREE_TYPE (old), "rettmp");
- *return_value_p = new;
- }
- else
- new = *return_value_p;
-
- x = build_gimple_modify_stmt (new, old);
- append_to_statement_list (x, &q->repl_stmt);
-
- if (new == result)
- x = result;
- else
- x = build_gimple_modify_stmt (result, new);
- q->cont_stmt = build1 (RETURN_EXPR, void_type_node, x);
- }
-
- default:
- gcc_unreachable ();
+ q->cont_stmt = q->stmt.g;
}
+ else
+ gcc_unreachable ();
}
else
- {
/* If we don't return a value, all return statements are the same. */
- q->cont_stmt = q->stmt;
- }
+ q->cont_stmt = q->stmt.g;
+
+ if (!q->repl_stmt)
+ q->repl_stmt = gimple_seq_alloc ();
if (mod)
- append_to_statement_list (mod, &q->repl_stmt);
+ gimple_seq_add_seq (&q->repl_stmt, mod);
- x = build1 (GOTO_EXPR, void_type_node, finlab);
- append_to_statement_list (x, &q->repl_stmt);
+ x = gimple_build_goto (finlab);
+ gimple_seq_add_stmt (&q->repl_stmt, x);
}
-/* Similar, but easier, for GOTO_EXPR. */
+/* Similar, but easier, for GIMPLE_GOTO. */
static void
-do_goto_redirection (struct goto_queue_node *q, tree finlab, tree mod)
+do_goto_redirection (struct goto_queue_node *q, tree finlab, gimple_seq mod,
+ struct leh_tf_state *tf)
{
- tree x;
+ gimple x;
+
+ gcc_assert (q->is_label);
+ if (!q->repl_stmt)
+ q->repl_stmt = gimple_seq_alloc ();
+
+ q->cont_stmt = gimple_build_goto (VEC_index (tree, tf->dest_array,q->index));
- q->cont_stmt = q->stmt;
if (mod)
- append_to_statement_list (mod, &q->repl_stmt);
+ gimple_seq_add_seq (&q->repl_stmt, mod);
- x = build1 (GOTO_EXPR, void_type_node, finlab);
- append_to_statement_list (x, &q->repl_stmt);
+ x = gimple_build_goto (finlab);
+ gimple_seq_add_stmt (&q->repl_stmt, x);
}
/* We want to transform
@@ -704,56 +819,59 @@ do_goto_redirection (struct goto_queue_node *q, tree finlab, tree mod)
to
body; goto over; lab: stuff; over:
- T is a TRY_FINALLY or TRY_CATCH node. LAB is the label that
+ TP is a GIMPLE_TRY node. LAB is the label that
should be placed before the second operand, or NULL. OVER is
an existing label that should be put at the exit, or NULL. */
-static void
-frob_into_branch_around (tree *tp, tree lab, tree over)
+static gimple_seq
+frob_into_branch_around (gimple tp, tree lab, tree over)
{
- tree x, op1;
+ gimple x;
+ gimple_seq cleanup, result;
- op1 = TREE_OPERAND (*tp, 1);
- *tp = TREE_OPERAND (*tp, 0);
+ cleanup = gimple_try_cleanup (tp);
+ result = gimple_try_eval (tp);
- if (block_may_fallthru (*tp))
+ if (gimple_seq_may_fallthru (result))
{
if (!over)
over = create_artificial_label ();
- x = build1 (GOTO_EXPR, void_type_node, over);
- append_to_statement_list (x, tp);
+ x = gimple_build_goto (over);
+ gimple_seq_add_stmt (&result, x);
}
if (lab)
{
- x = build1 (LABEL_EXPR, void_type_node, lab);
- append_to_statement_list (x, tp);
+ x = gimple_build_label (lab);
+ gimple_seq_add_stmt (&result, x);
}
- append_to_statement_list (op1, tp);
+ gimple_seq_add_seq (&result, cleanup);
if (over)
{
- x = build1 (LABEL_EXPR, void_type_node, over);
- append_to_statement_list (x, tp);
+ x = gimple_build_label (over);
+ gimple_seq_add_stmt (&result, x);
}
+ return result;
}
/* A subroutine of lower_try_finally. Duplicate the tree rooted at T.
Make sure to record all new labels found. */
-static tree
-lower_try_finally_dup_block (tree t, struct leh_state *outer_state)
+static gimple_seq
+lower_try_finally_dup_block (gimple_seq seq, struct leh_state *outer_state)
{
- tree region = NULL;
+ gimple region = NULL;
+ gimple_seq new_seq;
- t = unsave_expr_now (t);
+ new_seq = copy_gimple_seq_and_replace_locals (seq);
if (outer_state->tf)
region = outer_state->tf->try_finally_expr;
- collect_finally_tree (t, region);
+ collect_finally_tree_1 (new_seq, region);
- return t;
+ return new_seq;
}
/* A subroutine of lower_try_finally. Create a fallthru label for
@@ -764,12 +882,17 @@ static tree
lower_try_finally_fallthru_label (struct leh_tf_state *tf)
{
tree label = tf->fallthru_label;
+ treemple temp;
+
if (!label)
{
label = create_artificial_label ();
tf->fallthru_label = label;
if (tf->outer->tf)
- record_in_finally_tree (label, tf->outer->tf->try_finally_expr);
+ {
+ temp.t = label;
+ record_in_finally_tree (temp, tf->outer->tf->try_finally_expr);
+ }
}
return label;
}
@@ -799,9 +922,11 @@ honor_protect_cleanup_actions (struct leh_state *outer_state,
struct leh_state *this_state,
struct leh_tf_state *tf)
{
- tree protect_cleanup_actions, finally, x;
- tree_stmt_iterator i;
+ gimple protect_cleanup_actions;
+ gimple_stmt_iterator gsi;
bool finally_may_fallthru;
+ gimple_seq finally;
+ gimple x;
/* First check for nothing to do. */
if (lang_protect_cleanup_actions)
@@ -809,7 +934,7 @@ honor_protect_cleanup_actions (struct leh_state *outer_state,
else
protect_cleanup_actions = NULL;
- finally = TREE_OPERAND (*tf->top_p, 1);
+ finally = gimple_try_cleanup (tf->top_p);
/* If the EH case of the finally block can fall through, this may be a
structure of the form
@@ -832,7 +957,7 @@ honor_protect_cleanup_actions (struct leh_state *outer_state,
be used (via fallthru from the finally) we handle the eh case here,
whether or not protect_cleanup_actions is active. */
- finally_may_fallthru = block_may_fallthru (finally);
+ finally_may_fallthru = gimple_seq_may_fallthru (finally);
if (!finally_may_fallthru && !protect_cleanup_actions)
return;
@@ -848,14 +973,15 @@ honor_protect_cleanup_actions (struct leh_state *outer_state,
cp/decl.c). Since it's logically at an outer level, we should call
terminate before we get to it, so strip it away before adding the
MUST_NOT_THROW filter. */
- i = tsi_start (finally);
- x = tsi_stmt (i);
+ gsi = gsi_start (finally);
+ x = gsi_stmt (gsi);
if (protect_cleanup_actions
- && TREE_CODE (x) == TRY_CATCH_EXPR
- && TRY_CATCH_IS_CLEANUP (x))
+ && gimple_code (x) == GIMPLE_TRY
+ && gimple_try_kind (x) == GIMPLE_TRY_CATCH
+ && gimple_try_catch_is_cleanup (x))
{
- tsi_link_before (&i, TREE_OPERAND (x, 0), TSI_SAME_STMT);
- tsi_delink (&i);
+ gsi_insert_seq_before (&gsi, gimple_try_eval (x), GSI_SAME_STMT);
+ gsi_remove (&gsi, false);
}
/* Resume execution after the exception. Adding this now lets
@@ -864,55 +990,61 @@ honor_protect_cleanup_actions (struct leh_state *outer_state,
if (finally_may_fallthru)
{
tree save_eptr, save_filt;
+ tree tmp;
save_eptr = create_tmp_var (ptr_type_node, "save_eptr");
save_filt = create_tmp_var (integer_type_node, "save_filt");
- i = tsi_start (finally);
- x = build0 (EXC_PTR_EXPR, ptr_type_node);
- x = build_gimple_modify_stmt (save_eptr, x);
- tsi_link_before (&i, x, TSI_CONTINUE_LINKING);
+ gsi = gsi_start (finally);
+ tmp = build0 (EXC_PTR_EXPR, ptr_type_node);
+ x = gimple_build_assign (save_eptr, tmp);
+ gsi_insert_before (&gsi, x, GSI_CONTINUE_LINKING);
- x = build0 (FILTER_EXPR, integer_type_node);
- x = build_gimple_modify_stmt (save_filt, x);
- tsi_link_before (&i, x, TSI_CONTINUE_LINKING);
+ tmp = build0 (FILTER_EXPR, integer_type_node);
+ x = gimple_build_assign (save_filt, tmp);
+ gsi_insert_before (&gsi, x, GSI_CONTINUE_LINKING);
- i = tsi_last (finally);
- x = build0 (EXC_PTR_EXPR, ptr_type_node);
- x = build_gimple_modify_stmt (x, save_eptr);
- tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
+ gsi = gsi_last (finally);
+ tmp = build0 (EXC_PTR_EXPR, ptr_type_node);
+ x = gimple_build_assign (tmp, save_eptr);
+ gsi_insert_after (&gsi, x, GSI_CONTINUE_LINKING);
- x = build0 (FILTER_EXPR, integer_type_node);
- x = build_gimple_modify_stmt (x, save_filt);
- tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
+ tmp = build0 (FILTER_EXPR, integer_type_node);
+ x = gimple_build_assign (tmp, save_filt);
+ gsi_insert_after (&gsi, x, GSI_CONTINUE_LINKING);
- x = build_resx (get_eh_region_number (tf->region));
- tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
+ x = gimple_build_resx (get_eh_region_number (tf->region));
+ gsi_insert_after (&gsi, x, GSI_CONTINUE_LINKING);
}
/* Wrap the block with protect_cleanup_actions as the action. */
if (protect_cleanup_actions)
{
- x = build2 (EH_FILTER_EXPR, void_type_node, NULL, NULL);
- append_to_statement_list (protect_cleanup_actions, &EH_FILTER_FAILURE (x));
- EH_FILTER_MUST_NOT_THROW (x) = 1;
- finally = build2 (TRY_CATCH_EXPR, void_type_node, finally, x);
- lower_eh_filter (outer_state, &finally);
+ gimple_seq seq = NULL, failure = NULL;
+
+ gimple_seq_add_stmt (&failure, protect_cleanup_actions);
+ x = gimple_build_eh_filter (NULL, failure);
+ gimple_eh_filter_set_must_not_throw (x, 1);
+
+ gimple_seq_add_stmt (&seq, x);
+ x = gimple_build_try (finally, seq, GIMPLE_TRY_CATCH);
+ finally = lower_eh_filter (outer_state, x);
}
else
- lower_eh_constructs_1 (outer_state, &finally);
+ lower_eh_constructs_1 (outer_state, finally);
/* Hook this up to the end of the existing try block. If we
previously fell through the end, we'll have to branch around.
This means adding a new goto, and adding it to the queue. */
- i = tsi_last (TREE_OPERAND (*tf->top_p, 0));
+ gsi = gsi_last (gimple_try_eval (tf->top_p));
if (tf->may_fallthru)
{
- x = lower_try_finally_fallthru_label (tf);
- x = build1 (GOTO_EXPR, void_type_node, x);
- tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
+ tree tmp;
+ tmp = lower_try_finally_fallthru_label (tf);
+ x = gimple_build_goto (tmp);
+ gsi_insert_after (&gsi, x, GSI_CONTINUE_LINKING);
if (this_state)
maybe_record_in_goto_queue (this_state, x);
@@ -920,9 +1052,9 @@ honor_protect_cleanup_actions (struct leh_state *outer_state,
tf->may_fallthru = false;
}
- x = build1 (LABEL_EXPR, void_type_node, tf->eh_label);
- tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
- tsi_link_after (&i, finally, TSI_CONTINUE_LINKING);
+ x = gimple_build_label (tf->eh_label);
+ gsi_insert_after (&gsi, x, GSI_CONTINUE_LINKING);
+ gsi_insert_seq_after (&gsi, finally, GSI_CONTINUE_LINKING);
/* Having now been handled, EH isn't to be considered with
the rest of the outgoing edges. */
@@ -935,9 +1067,12 @@ honor_protect_cleanup_actions (struct leh_state *outer_state,
try_finally node for this special case. */
static void
-lower_try_finally_nofallthru (struct leh_state *state, struct leh_tf_state *tf)
+lower_try_finally_nofallthru (struct leh_state *state,
+ struct leh_tf_state *tf)
{
- tree x, finally, lab, return_val;
+ tree lab, return_val;
+ gimple x;
+ gimple_seq finally;
struct goto_queue_node *q, *qe;
if (tf->may_throw)
@@ -945,11 +1080,12 @@ lower_try_finally_nofallthru (struct leh_state *state, struct leh_tf_state *tf)
else
lab = create_artificial_label ();
- finally = TREE_OPERAND (*tf->top_p, 1);
- *tf->top_p = TREE_OPERAND (*tf->top_p, 0);
+ /* We expect that tf->top_p is a GIMPLE_TRY. */
+ finally = gimple_try_cleanup (tf->top_p);
+ tf->top_p_seq = gimple_try_eval (tf->top_p);
- x = build1 (LABEL_EXPR, void_type_node, lab);
- append_to_statement_list (x, tf->top_p);
+ x = gimple_build_label (lab);
+ gimple_seq_add_stmt (&tf->top_p_seq, x);
return_val = NULL;
q = tf->goto_queue;
@@ -958,12 +1094,12 @@ lower_try_finally_nofallthru (struct leh_state *state, struct leh_tf_state *tf)
if (q->index < 0)
do_return_redirection (q, lab, NULL, &return_val);
else
- do_goto_redirection (q, lab, NULL);
+ do_goto_redirection (q, lab, NULL, tf);
replace_goto_queue (tf);
- lower_eh_constructs_1 (state, &finally);
- append_to_statement_list (finally, tf->top_p);
+ lower_eh_constructs_1 (state, finally);
+ gimple_seq_add_seq (&tf->top_p_seq, finally);
}
/* A subroutine of lower_try_finally. We have determined that there is
@@ -974,26 +1110,28 @@ static void
lower_try_finally_onedest (struct leh_state *state, struct leh_tf_state *tf)
{
struct goto_queue_node *q, *qe;
- tree x, finally, finally_label;
+ gimple x;
+ gimple_seq finally;
+ tree finally_label;
- finally = TREE_OPERAND (*tf->top_p, 1);
- *tf->top_p = TREE_OPERAND (*tf->top_p, 0);
+ finally = gimple_try_cleanup (tf->top_p);
+ tf->top_p_seq = gimple_try_eval (tf->top_p);
- lower_eh_constructs_1 (state, &finally);
+ lower_eh_constructs_1 (state, finally);
if (tf->may_throw)
{
/* Only reachable via the exception edge. Add the given label to
the head of the FINALLY block. Append a RESX at the end. */
- x = build1 (LABEL_EXPR, void_type_node, tf->eh_label);
- append_to_statement_list (x, tf->top_p);
+ x = gimple_build_label (tf->eh_label);
+ gimple_seq_add_stmt (&tf->top_p_seq, x);
- append_to_statement_list (finally, tf->top_p);
+ gimple_seq_add_seq (&tf->top_p_seq, finally);
- x = build_resx (get_eh_region_number (tf->region));
+ x = gimple_build_resx (get_eh_region_number (tf->region));
- append_to_statement_list (x, tf->top_p);
+ gimple_seq_add_stmt (&tf->top_p_seq, x);
return;
}
@@ -1002,15 +1140,15 @@ lower_try_finally_onedest (struct leh_state *state, struct leh_tf_state *tf)
{
/* Only reachable via the fallthru edge. Do nothing but let
the two blocks run together; we'll fall out the bottom. */
- append_to_statement_list (finally, tf->top_p);
+ gimple_seq_add_seq (&tf->top_p_seq, finally);
return;
}
finally_label = create_artificial_label ();
- x = build1 (LABEL_EXPR, void_type_node, finally_label);
- append_to_statement_list (x, tf->top_p);
+ x = gimple_build_label (finally_label);
+ gimple_seq_add_stmt (&tf->top_p_seq, x);
- append_to_statement_list (finally, tf->top_p);
+ gimple_seq_add_seq (&tf->top_p_seq, finally);
q = tf->goto_queue;
qe = q + tf->goto_queue_active;
@@ -1027,7 +1165,7 @@ lower_try_finally_onedest (struct leh_state *state, struct leh_tf_state *tf)
{
/* Reachable by goto expressions only. Redirect them. */
for (; q < qe; ++q)
- do_goto_redirection (q, finally_label, NULL);
+ do_goto_redirection (q, finally_label, NULL, tf);
replace_goto_queue (tf);
if (VEC_index (tree, tf->dest_array, 0) == tf->fallthru_label)
@@ -1040,11 +1178,11 @@ lower_try_finally_onedest (struct leh_state *state, struct leh_tf_state *tf)
}
}
- /* Reset the locus of the goto since we're moving
- goto to a different block which might be on a different line. */
- SET_EXPR_LOCUS (tf->goto_queue[0].cont_stmt, NULL);
- append_to_statement_list (tf->goto_queue[0].cont_stmt, tf->top_p);
- maybe_record_in_goto_queue (state, tf->goto_queue[0].cont_stmt);
+ /* Place the original return/goto to the original destination
+ immediately after the finally block. */
+ x = tf->goto_queue[0].cont_stmt;
+ gimple_seq_add_stmt (&tf->top_p_seq, x);
+ maybe_record_in_goto_queue (state, x);
}
/* A subroutine of lower_try_finally. There are multiple edges incoming
@@ -1054,36 +1192,38 @@ lower_try_finally_onedest (struct leh_state *state, struct leh_tf_state *tf)
static void
lower_try_finally_copy (struct leh_state *state, struct leh_tf_state *tf)
{
- tree finally, new_stmt;
- tree x;
+ gimple_seq finally;
+ gimple_seq new_stmt;
+ gimple_seq seq;
+ gimple x;
+ tree tmp;
- finally = TREE_OPERAND (*tf->top_p, 1);
- *tf->top_p = TREE_OPERAND (*tf->top_p, 0);
-
- new_stmt = NULL_TREE;
+ finally = gimple_try_cleanup (tf->top_p);
+ tf->top_p_seq = gimple_try_eval (tf->top_p);
+ new_stmt = NULL;
if (tf->may_fallthru)
{
- x = lower_try_finally_dup_block (finally, state);
- lower_eh_constructs_1 (state, &x);
- append_to_statement_list (x, &new_stmt);
+ seq = lower_try_finally_dup_block (finally, state);
+ lower_eh_constructs_1 (state, seq);
+ gimple_seq_add_seq (&new_stmt, seq);
- x = lower_try_finally_fallthru_label (tf);
- x = build1 (GOTO_EXPR, void_type_node, x);
- append_to_statement_list (x, &new_stmt);
+ tmp = lower_try_finally_fallthru_label (tf);
+ x = gimple_build_goto (tmp);
+ gimple_seq_add_stmt (&new_stmt, x);
}
if (tf->may_throw)
{
- x = build1 (LABEL_EXPR, void_type_node, tf->eh_label);
- append_to_statement_list (x, &new_stmt);
+ x = gimple_build_label (tf->eh_label);
+ gimple_seq_add_stmt (&new_stmt, x);
- x = lower_try_finally_dup_block (finally, state);
- lower_eh_constructs_1 (state, &x);
- append_to_statement_list (x, &new_stmt);
+ seq = lower_try_finally_dup_block (finally, state);
+ lower_eh_constructs_1 (state, seq);
+ gimple_seq_add_seq (&new_stmt, seq);
- x = build_resx (get_eh_region_number (tf->region));
- append_to_statement_list (x, &new_stmt);
+ x = gimple_build_resx (get_eh_region_number (tf->region));
+ gimple_seq_add_stmt (&new_stmt, x);
}
if (tf->goto_queue)
@@ -1123,16 +1263,16 @@ lower_try_finally_copy (struct leh_state *state, struct leh_tf_state *tf)
if (index == return_index)
do_return_redirection (q, lab, NULL, &return_val);
else
- do_goto_redirection (q, lab, NULL);
+ do_goto_redirection (q, lab, NULL, tf);
- x = build1 (LABEL_EXPR, void_type_node, lab);
- append_to_statement_list (x, &new_stmt);
+ x = gimple_build_label (lab);
+ gimple_seq_add_stmt (&new_stmt, x);
- x = lower_try_finally_dup_block (finally, state);
- lower_eh_constructs_1 (state, &x);
- append_to_statement_list (x, &new_stmt);
+ seq = lower_try_finally_dup_block (finally, state);
+ lower_eh_constructs_1 (state, seq);
+ gimple_seq_add_seq (&new_stmt, seq);
- append_to_statement_list (q->cont_stmt, &new_stmt);
+ gimple_seq_add_stmt (&new_stmt, q->cont_stmt);
maybe_record_in_goto_queue (state, q->cont_stmt);
}
@@ -1150,7 +1290,7 @@ lower_try_finally_copy (struct leh_state *state, struct leh_tf_state *tf)
if (index == return_index)
do_return_redirection (q, lab, NULL, &return_val);
else
- do_goto_redirection (q, lab, NULL);
+ do_goto_redirection (q, lab, NULL, tf);
}
replace_goto_queue (tf);
@@ -1159,7 +1299,7 @@ lower_try_finally_copy (struct leh_state *state, struct leh_tf_state *tf)
/* Need to link new stmts after running replace_goto_queue due
to not wanting to process the same goto stmts twice. */
- append_to_statement_list (new_stmt, tf->top_p);
+ gimple_seq_add_seq (&tf->top_p_seq, new_stmt);
}
/* A subroutine of lower_try_finally. There are multiple edges incoming
@@ -1172,18 +1312,26 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
{
struct goto_queue_node *q, *qe;
tree return_val = NULL;
- tree finally, finally_tmp, finally_label;
+ tree finally_tmp, finally_label;
int return_index, eh_index, fallthru_index;
int nlabels, ndests, j, last_case_index;
- tree case_label_vec, switch_stmt, last_case, switch_body;
- tree x;
+ tree last_case;
+ VEC (tree,heap) *case_label_vec;
+ gimple_seq switch_body;
+ gimple x;
+ tree tmp;
+ gimple switch_stmt;
+ gimple_seq finally;
+ struct pointer_map_t *cont_map = NULL;
+
+ switch_body = gimple_seq_alloc ();
/* Mash the TRY block to the head of the chain. */
- finally = TREE_OPERAND (*tf->top_p, 1);
- *tf->top_p = TREE_OPERAND (*tf->top_p, 0);
+ finally = gimple_try_cleanup (tf->top_p);
+ tf->top_p_seq = gimple_try_eval (tf->top_p);
/* Lower the finally block itself. */
- lower_eh_constructs_1 (state, &finally);
+ lower_eh_constructs_1 (state, finally);
/* Prepare for switch statement generation. */
nlabels = VEC_length (tree, tf->dest_array);
@@ -1195,10 +1343,10 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
finally_tmp = create_tmp_var (integer_type_node, "finally_tmp");
finally_label = create_artificial_label ();
- case_label_vec = make_tree_vec (ndests);
- switch_stmt = build3 (SWITCH_EXPR, integer_type_node, finally_tmp,
- NULL_TREE, case_label_vec);
- switch_body = NULL;
+ /* We use VEC_quick_push on case_label_vec throughout this function,
+ since we know the size in advance and allocate precisely as muce
+ space as needed. */
+ case_label_vec = VEC_alloc (tree, heap, ndests);
last_case = NULL;
last_case_index = 0;
@@ -1208,117 +1356,137 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
if (tf->may_fallthru)
{
- x = build_gimple_modify_stmt (finally_tmp,
- build_int_cst (integer_type_node,
- fallthru_index));
- append_to_statement_list (x, tf->top_p);
+ x = gimple_build_assign (finally_tmp, build_int_cst (integer_type_node,
+ fallthru_index));
+ gimple_seq_add_stmt (&tf->top_p_seq, x);
if (tf->may_throw)
{
- x = build1 (GOTO_EXPR, void_type_node, finally_label);
- append_to_statement_list (x, tf->top_p);
+ x = gimple_build_goto (finally_label);
+ gimple_seq_add_stmt (&tf->top_p_seq, x);
}
last_case = build3 (CASE_LABEL_EXPR, void_type_node,
build_int_cst (NULL_TREE, fallthru_index), NULL,
create_artificial_label ());
- TREE_VEC_ELT (case_label_vec, last_case_index) = last_case;
+ VEC_quick_push (tree, case_label_vec, last_case);
last_case_index++;
- x = build1 (LABEL_EXPR, void_type_node, CASE_LABEL (last_case));
- append_to_statement_list (x, &switch_body);
+ x = gimple_build_label (CASE_LABEL (last_case));
+ gimple_seq_add_stmt (&switch_body, x);
- x = lower_try_finally_fallthru_label (tf);
- x = build1 (GOTO_EXPR, void_type_node, x);
- append_to_statement_list (x, &switch_body);
+ tmp = lower_try_finally_fallthru_label (tf);
+ x = gimple_build_goto (tmp);
+ gimple_seq_add_stmt (&switch_body, x);
}
if (tf->may_throw)
{
- x = build1 (LABEL_EXPR, void_type_node, tf->eh_label);
- append_to_statement_list (x, tf->top_p);
+ x = gimple_build_label (tf->eh_label);
+ gimple_seq_add_stmt (&tf->top_p_seq, x);
- x = build_gimple_modify_stmt (finally_tmp,
- build_int_cst (integer_type_node,
- eh_index));
- append_to_statement_list (x, tf->top_p);
+ x = gimple_build_assign (finally_tmp, build_int_cst (integer_type_node,
+ eh_index));
+ gimple_seq_add_stmt (&tf->top_p_seq, x);
last_case = build3 (CASE_LABEL_EXPR, void_type_node,
build_int_cst (NULL_TREE, eh_index), NULL,
create_artificial_label ());
- TREE_VEC_ELT (case_label_vec, last_case_index) = last_case;
+ VEC_quick_push (tree, case_label_vec, last_case);
last_case_index++;
- x = build1 (LABEL_EXPR, void_type_node, CASE_LABEL (last_case));
- append_to_statement_list (x, &switch_body);
- x = build_resx (get_eh_region_number (tf->region));
- append_to_statement_list (x, &switch_body);
+ x = gimple_build_label (CASE_LABEL (last_case));
+ gimple_seq_add_stmt (&switch_body, x);
+ x = gimple_build_resx (get_eh_region_number (tf->region));
+ gimple_seq_add_stmt (&switch_body, x);
}
- x = build1 (LABEL_EXPR, void_type_node, finally_label);
- append_to_statement_list (x, tf->top_p);
+ x = gimple_build_label (finally_label);
+ gimple_seq_add_stmt (&tf->top_p_seq, x);
- append_to_statement_list (finally, tf->top_p);
+ gimple_seq_add_seq (&tf->top_p_seq, finally);
/* Redirect each incoming goto edge. */
q = tf->goto_queue;
qe = q + tf->goto_queue_active;
j = last_case_index + tf->may_return;
+ /* Prepare the assignments to finally_tmp that are executed upon the
+ entrance through a particular edge. */
for (; q < qe; ++q)
{
- tree mod;
- int switch_id, case_index;
+ gimple_seq mod;
+ int switch_id;
+ unsigned int case_index;
+
+ mod = gimple_seq_alloc ();
if (q->index < 0)
{
- mod = build_gimple_modify_stmt (finally_tmp,
- build_int_cst (integer_type_node,
- return_index));
+ x = gimple_build_assign (finally_tmp,
+ build_int_cst (integer_type_node,
+ return_index));
+ gimple_seq_add_stmt (&mod, x);
do_return_redirection (q, finally_label, mod, &return_val);
switch_id = return_index;
}
else
{
- mod = build_gimple_modify_stmt (finally_tmp,
- build_int_cst (integer_type_node,
- q->index));
- do_goto_redirection (q, finally_label, mod);
+ x = gimple_build_assign (finally_tmp,
+ build_int_cst (integer_type_node, q->index));
+ gimple_seq_add_stmt (&mod, x);
+ do_goto_redirection (q, finally_label, mod, tf);
switch_id = q->index;
}
case_index = j + q->index;
- if (!TREE_VEC_ELT (case_label_vec, case_index))
- TREE_VEC_ELT (case_label_vec, case_index)
- = build3 (CASE_LABEL_EXPR, void_type_node,
- build_int_cst (NULL_TREE, switch_id), NULL,
- /* We store the cont_stmt in the
- CASE_LABEL, so that we can recover it
- in the loop below. We don't create
- the new label while walking the
- goto_queue because pointers don't
- offer a stable order. */
- q->cont_stmt);
+ if (VEC_length (tree, case_label_vec) <= case_index
+ || !VEC_index (tree, case_label_vec, case_index))
+ {
+ tree case_lab;
+ void **slot;
+ case_lab = build3 (CASE_LABEL_EXPR, void_type_node,
+ build_int_cst (NULL_TREE, switch_id), NULL,
+ NULL);
+ /* We store the cont_stmt in the pointer map, so that we can recover
+ it in the loop below. We don't create the new label while
+ walking the goto_queue because pointers don't offer a stable
+ order. */
+ if (!cont_map)
+ cont_map = pointer_map_create ();
+ slot = pointer_map_insert (cont_map, case_lab);
+ *slot = q->cont_stmt;
+ VEC_quick_push (tree, case_label_vec, case_lab);
+ }
}
for (j = last_case_index; j < last_case_index + nlabels; j++)
{
tree label;
- tree cont_stmt;
+ gimple cont_stmt;
+ void **slot;
- last_case = TREE_VEC_ELT (case_label_vec, j);
+ last_case = VEC_index (tree, case_label_vec, j);
gcc_assert (last_case);
+ gcc_assert (cont_map);
- cont_stmt = CASE_LABEL (last_case);
+ slot = pointer_map_contains (cont_map, last_case);
+ /* As the comment above suggests, CASE_LABEL (last_case) was just a
+ placeholder, it does not store an actual label, yet. */
+ gcc_assert (slot);
+ cont_stmt = *(gimple *) slot;
label = create_artificial_label ();
CASE_LABEL (last_case) = label;
- x = build1 (LABEL_EXPR, void_type_node, label);
- append_to_statement_list (x, &switch_body);
- append_to_statement_list (cont_stmt, &switch_body);
+ x = gimple_build_label (label);
+ gimple_seq_add_stmt (&switch_body, x);
+ gimple_seq_add_stmt (&switch_body, cont_stmt);
maybe_record_in_goto_queue (state, cont_stmt);
}
+ if (cont_map)
+ pointer_map_destroy (cont_map);
+
replace_goto_queue (tf);
/* Make sure that the last case is the default label, as one is required.
@@ -1326,10 +1494,15 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
CASE_LOW (last_case) = NULL;
sort_case_labels (case_label_vec);
- /* Need to link switch_stmt after running replace_goto_queue due
- to not wanting to process the same goto stmts twice. */
- append_to_statement_list (switch_stmt, tf->top_p);
- append_to_statement_list (switch_body, tf->top_p);
+ /* Build the switch statement, setting last_case to be the default
+ label. */
+ switch_stmt = gimple_build_switch_vec (finally_tmp, last_case,
+ case_label_vec);
+
+ /* Need to link SWITCH_STMT after running replace_goto_queue
+ due to not wanting to process the same goto stmts twice. */
+ gimple_seq_add_stmt (&tf->top_p_seq, switch_stmt);
+ gimple_seq_add_seq (&tf->top_p_seq, switch_body);
}
/* Decide whether or not we are going to duplicate the finally block.
@@ -1347,7 +1520,7 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
the estimate of the size of the switch machinery we'd have to add. */
static bool
-decide_copy_try_finally (int ndests, tree finally)
+decide_copy_try_finally (int ndests, gimple_seq finally)
{
int f_estimate, sw_estimate;
@@ -1355,14 +1528,14 @@ decide_copy_try_finally (int ndests, tree finally)
return false;
/* Finally estimate N times, plus N gotos. */
- f_estimate = estimate_num_insns (finally, &eni_size_weights);
+ f_estimate = count_insns_seq (finally, &eni_size_weights);
f_estimate = (f_estimate + 1) * ndests;
/* Switch statement (cost 10), N variable assignments, N gotos. */
sw_estimate = 10 + 2 * ndests;
/* Optimize for size clearly wants our best guess. */
- if (optimize_size)
+ if (optimize_function_for_size_p (cfun))
return f_estimate < sw_estimate;
/* ??? These numbers are completely made up so far. */
@@ -1372,13 +1545,14 @@ decide_copy_try_finally (int ndests, tree finally)
return f_estimate < 40 || f_estimate * 2 < sw_estimate * 3;
}
-/* A subroutine of lower_eh_constructs_1. Lower a TRY_FINALLY_EXPR nodes
+
+/* A subroutine of lower_eh_constructs_1. Lower a GIMPLE_TRY_FINALLY nodes
to a sequence of labels and blocks, plus the exception region trees
that record all the magic. This is complicated by the need to
arrange for the FINALLY block to be executed on all exits. */
-static void
-lower_try_finally (struct leh_state *state, tree *tp)
+static gimple_seq
+lower_try_finally (struct leh_state *state, gimple tp)
{
struct leh_tf_state this_tf;
struct leh_state this_state;
@@ -1387,7 +1561,7 @@ lower_try_finally (struct leh_state *state, tree *tp)
/* Process the try block. */
memset (&this_tf, 0, sizeof (this_tf));
- this_tf.try_finally_expr = *tp;
+ this_tf.try_finally_expr = tp;
this_tf.top_p = tp;
this_tf.outer = state;
if (using_eh_for_cleanups_p)
@@ -1400,10 +1574,10 @@ lower_try_finally (struct leh_state *state, tree *tp)
this_state.prev_try = state->prev_try;
this_state.tf = &this_tf;
- lower_eh_constructs_1 (&this_state, &TREE_OPERAND (*tp, 0));
+ lower_eh_constructs_1 (&this_state, gimple_try_eval(tp));
/* Determine if the try block is escaped through the bottom. */
- this_tf.may_fallthru = block_may_fallthru (TREE_OPERAND (*tp, 0));
+ this_tf.may_fallthru = gimple_seq_may_fallthru (gimple_try_eval (tp));
/* Determine if any exceptions are possible within the try block. */
if (using_eh_for_cleanups_p)
@@ -1426,19 +1600,20 @@ lower_try_finally (struct leh_state *state, tree *tp)
/* If the FINALLY block is not reachable, dike it out. */
if (ndests == 0)
- *tp = TREE_OPERAND (*tp, 0);
-
+ {
+ gimple_seq_add_seq (&this_tf.top_p_seq, gimple_try_eval (tp));
+ gimple_try_set_cleanup (tp, NULL);
+ }
/* If the finally block doesn't fall through, then any destination
we might try to impose there isn't reached either. There may be
some minor amount of cleanup and redirection still needed. */
- else if (!block_may_fallthru (TREE_OPERAND (*tp, 1)))
+ else if (!gimple_seq_may_fallthru (gimple_try_cleanup (tp)))
lower_try_finally_nofallthru (state, &this_tf);
/* We can easily special-case redirection to a single destination. */
else if (ndests == 1)
lower_try_finally_onedest (state, &this_tf);
-
- else if (decide_copy_try_finally (ndests, TREE_OPERAND (*tp, 1)))
+ else if (decide_copy_try_finally (ndests, gimple_try_cleanup (tp)))
lower_try_finally_copy (state, &this_tf);
else
lower_try_finally_switch (state, &this_tf);
@@ -1447,8 +1622,9 @@ lower_try_finally (struct leh_state *state, tree *tp)
block, do so. */
if (this_tf.fallthru_label)
{
- tree x = build1 (LABEL_EXPR, void_type_node, this_tf.fallthru_label);
- append_to_statement_list (x, tp);
+ /* This must be reached only if ndests == 0. */
+ gimple x = gimple_build_label (this_tf.fallthru_label);
+ gimple_seq_add_stmt (&this_tf.top_p_seq, x);
}
VEC_free (tree, heap, this_tf.dest_array);
@@ -1456,18 +1632,20 @@ lower_try_finally (struct leh_state *state, tree *tp)
free (this_tf.goto_queue);
if (this_tf.goto_queue_map)
pointer_map_destroy (this_tf.goto_queue_map);
+
+ return this_tf.top_p_seq;
}
-/* A subroutine of lower_eh_constructs_1. Lower a TRY_CATCH_EXPR with a
- list of CATCH_EXPR nodes to a sequence of labels and blocks, plus the
- exception region trees that record all the magic. */
+/* A subroutine of lower_eh_constructs_1. Lower a GIMPLE_TRY_CATCH with a
+ list of GIMPLE_CATCH to a sequence of labels and blocks, plus the
+ exception region trees that records all the magic. */
-static void
-lower_catch (struct leh_state *state, tree *tp)
+static gimple_seq
+lower_catch (struct leh_state *state, gimple tp)
{
struct eh_region *try_region;
struct leh_state this_state;
- tree_stmt_iterator i;
+ gimple_stmt_iterator gsi;
tree out_label;
try_region = gen_eh_region_try (state->cur_region);
@@ -1475,118 +1653,121 @@ lower_catch (struct leh_state *state, tree *tp)
this_state.prev_try = try_region;
this_state.tf = state->tf;
- lower_eh_constructs_1 (&this_state, &TREE_OPERAND (*tp, 0));
+ lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
if (!get_eh_region_may_contain_throw (try_region))
{
- *tp = TREE_OPERAND (*tp, 0);
- return;
+ return gimple_try_eval (tp);
}
out_label = NULL;
- for (i = tsi_start (TREE_OPERAND (*tp, 1)); !tsi_end_p (i); )
+ for (gsi = gsi_start (gimple_try_cleanup (tp)); !gsi_end_p (gsi); )
{
struct eh_region *catch_region;
- tree catch, x, eh_label;
+ tree eh_label;
+ gimple x, gcatch;
- catch = tsi_stmt (i);
- catch_region = gen_eh_region_catch (try_region, CATCH_TYPES (catch));
+ gcatch = gsi_stmt (gsi);
+ catch_region = gen_eh_region_catch (try_region,
+ gimple_catch_types (gcatch));
this_state.cur_region = catch_region;
this_state.prev_try = state->prev_try;
- lower_eh_constructs_1 (&this_state, &CATCH_BODY (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);
- x = build1 (LABEL_EXPR, void_type_node, eh_label);
- tsi_link_before (&i, x, TSI_SAME_STMT);
+ x = gimple_build_label (eh_label);
+ gsi_insert_before (&gsi, x, GSI_SAME_STMT);
- if (block_may_fallthru (CATCH_BODY (catch)))
+ if (gimple_seq_may_fallthru (gimple_catch_handler (gcatch)))
{
if (!out_label)
out_label = create_artificial_label ();
- x = build1 (GOTO_EXPR, void_type_node, out_label);
- append_to_statement_list (x, &CATCH_BODY (catch));
+ x = gimple_build_goto (out_label);
+ gimple_seq_add_stmt (gimple_catch_handler_ptr (gcatch), x);
}
- tsi_link_before (&i, CATCH_BODY (catch), TSI_SAME_STMT);
- tsi_delink (&i);
+ gsi_insert_seq_before (&gsi, gimple_catch_handler (gcatch),
+ GSI_SAME_STMT);
+ gsi_remove (&gsi, false);
}
- frob_into_branch_around (tp, NULL, out_label);
+ return frob_into_branch_around (tp, NULL, out_label);
}
-/* A subroutine of lower_eh_constructs_1. Lower a TRY_CATCH_EXPR with a
- EH_FILTER_EXPR to a sequence of labels and blocks, plus the exception
+/* A subroutine of lower_eh_constructs_1. Lower a GIMPLE_TRY with a
+ GIMPLE_EH_FILTER to a sequence of labels and blocks, plus the exception
region trees that record all the magic. */
-static void
-lower_eh_filter (struct leh_state *state, tree *tp)
+static gimple_seq
+lower_eh_filter (struct leh_state *state, gimple tp)
{
struct leh_state this_state;
struct eh_region *this_region;
- tree inner = expr_first (TREE_OPERAND (*tp, 1));
+ gimple inner;
tree eh_label;
- if (EH_FILTER_MUST_NOT_THROW (inner))
+ inner = gimple_seq_first_stmt (gimple_try_cleanup (tp));
+
+ if (gimple_eh_filter_must_not_throw (inner))
this_region = gen_eh_region_must_not_throw (state->cur_region);
else
this_region = gen_eh_region_allowed (state->cur_region,
- EH_FILTER_TYPES (inner));
+ gimple_eh_filter_types (inner));
this_state = *state;
this_state.cur_region = this_region;
/* For must not throw regions any cleanup regions inside it
can't reach outer catch regions. */
- if (EH_FILTER_MUST_NOT_THROW (inner))
+ if (gimple_eh_filter_must_not_throw (inner))
this_state.prev_try = NULL;
- lower_eh_constructs_1 (&this_state, &TREE_OPERAND (*tp, 0));
+ lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
if (!get_eh_region_may_contain_throw (this_region))
{
- *tp = TREE_OPERAND (*tp, 0);
- return;
+ return gimple_try_eval (tp);
}
- lower_eh_constructs_1 (state, &EH_FILTER_FAILURE (inner));
- TREE_OPERAND (*tp, 1) = EH_FILTER_FAILURE (inner);
+ lower_eh_constructs_1 (state, gimple_eh_filter_failure (inner));
+ gimple_try_set_cleanup (tp, gimple_eh_filter_failure (inner));
eh_label = create_artificial_label ();
set_eh_region_tree_label (this_region, eh_label);
- frob_into_branch_around (tp, eh_label, NULL);
+ return frob_into_branch_around (tp, eh_label, NULL);
}
/* Implement a cleanup expression. This is similar to try-finally,
except that we only execute the cleanup block for exception edges. */
-static void
-lower_cleanup (struct leh_state *state, tree *tp)
+static gimple_seq
+lower_cleanup (struct leh_state *state, gimple tp)
{
struct leh_state this_state;
struct eh_region *this_region;
struct leh_tf_state fake_tf;
+ gimple_seq result;
/* If not using eh, then exception-only cleanups are no-ops. */
if (!flag_exceptions)
{
- *tp = TREE_OPERAND (*tp, 0);
- lower_eh_constructs_1 (state, tp);
- return;
+ result = gimple_try_eval (tp);
+ lower_eh_constructs_1 (state, result);
+ return result;
}
this_region = gen_eh_region_cleanup (state->cur_region, state->prev_try);
this_state = *state;
this_state.cur_region = this_region;
- lower_eh_constructs_1 (&this_state, &TREE_OPERAND (*tp, 0));
+ lower_eh_constructs_1 (&this_state, gimple_try_eval (tp));
if (!get_eh_region_may_contain_throw (this_region))
{
- *tp = TREE_OPERAND (*tp, 0);
- return;
+ return gimple_try_eval (tp);
}
/* Build enough of a try-finally state so that we can reuse
@@ -1595,7 +1776,7 @@ lower_cleanup (struct leh_state *state, tree *tp)
fake_tf.top_p = tp;
fake_tf.outer = state;
fake_tf.region = this_region;
- fake_tf.may_fallthru = block_may_fallthru (TREE_OPERAND (*tp, 0));
+ fake_tf.may_fallthru = gimple_seq_may_fallthru (gimple_try_eval (tp));
fake_tf.may_throw = true;
fake_tf.eh_label = create_artificial_label ();
@@ -1607,118 +1788,119 @@ lower_cleanup (struct leh_state *state, tree *tp)
{
/* In this case honor_protect_cleanup_actions had nothing to do,
and we should process this normally. */
- lower_eh_constructs_1 (state, &TREE_OPERAND (*tp, 1));
- frob_into_branch_around (tp, fake_tf.eh_label, fake_tf.fallthru_label);
+ lower_eh_constructs_1 (state, gimple_try_cleanup (tp));
+ result = frob_into_branch_around (tp, fake_tf.eh_label,
+ fake_tf.fallthru_label);
}
else
{
/* In this case honor_protect_cleanup_actions did nearly all of
the work. All we have left is to append the fallthru_label. */
- *tp = TREE_OPERAND (*tp, 0);
+ result = gimple_try_eval (tp);
if (fake_tf.fallthru_label)
{
- tree x = build1 (LABEL_EXPR, void_type_node, fake_tf.fallthru_label);
- append_to_statement_list (x, tp);
+ gimple x = gimple_build_label (fake_tf.fallthru_label);
+ gimple_seq_add_stmt (&result, x);
}
}
+ return result;
}
-/* Main loop for lowering eh constructs. */
+
+
+/* Main loop for lowering eh constructs. Also moves gsi to the next
+ statement. */
static void
-lower_eh_constructs_1 (struct leh_state *state, tree *tp)
+lower_eh_constructs_2 (struct leh_state *state, gimple_stmt_iterator *gsi)
{
- tree_stmt_iterator i;
- tree t = *tp;
+ gimple_seq replace;
+ gimple x;
+ gimple stmt = gsi_stmt (*gsi);
- switch (TREE_CODE (t))
+ switch (gimple_code (stmt))
{
- case COND_EXPR:
- lower_eh_constructs_1 (state, &COND_EXPR_THEN (t));
- lower_eh_constructs_1 (state, &COND_EXPR_ELSE (t));
- break;
-
- case CALL_EXPR:
- /* Look for things that can throw exceptions, and record them. */
- if (state->cur_region && tree_could_throw_p (t))
- {
- record_stmt_eh_region (state->cur_region, t);
- note_eh_region_may_contain_throw (state->cur_region);
- }
- break;
-
- case GIMPLE_MODIFY_STMT:
+ case GIMPLE_CALL:
+ case GIMPLE_ASSIGN:
/* Look for things that can throw exceptions, and record them. */
- if (state->cur_region && tree_could_throw_p (t))
+ if (state->cur_region && stmt_could_throw_p (stmt))
{
- record_stmt_eh_region (state->cur_region, t);
+ record_stmt_eh_region (state->cur_region, stmt);
note_eh_region_may_contain_throw (state->cur_region);
}
break;
- case GOTO_EXPR:
- case RETURN_EXPR:
- maybe_record_in_goto_queue (state, t);
- break;
- case SWITCH_EXPR:
- verify_norecord_switch_expr (state, t);
+ case GIMPLE_COND:
+ case GIMPLE_GOTO:
+ case GIMPLE_RETURN:
+ maybe_record_in_goto_queue (state, stmt);
break;
- case TRY_FINALLY_EXPR:
- lower_try_finally (state, tp);
+ case GIMPLE_SWITCH:
+ verify_norecord_switch_expr (state, stmt);
break;
- case TRY_CATCH_EXPR:
- i = tsi_start (TREE_OPERAND (t, 1));
- switch (TREE_CODE (tsi_stmt (i)))
- {
- case CATCH_EXPR:
- lower_catch (state, tp);
- break;
- case EH_FILTER_EXPR:
- lower_eh_filter (state, tp);
- break;
- default:
- lower_cleanup (state, tp);
- break;
- }
- break;
-
- case STATEMENT_LIST:
- for (i = tsi_start (t); !tsi_end_p (i); )
+ case GIMPLE_TRY:
+ if (gimple_try_kind (stmt) == GIMPLE_TRY_FINALLY)
+ replace = lower_try_finally (state, stmt);
+ else
{
- lower_eh_constructs_1 (state, tsi_stmt_ptr (i));
- t = tsi_stmt (i);
- if (TREE_CODE (t) == STATEMENT_LIST)
+ x = gimple_seq_first_stmt (gimple_try_cleanup (stmt));
+ switch (gimple_code (x))
{
- tsi_link_before (&i, t, TSI_SAME_STMT);
- tsi_delink (&i);
+ case GIMPLE_CATCH:
+ replace = lower_catch (state, stmt);
+ break;
+ case GIMPLE_EH_FILTER:
+ replace = lower_eh_filter (state, stmt);
+ break;
+ default:
+ replace = lower_cleanup (state, stmt);
+ break;
}
- else
- tsi_next (&i);
}
- break;
+
+ /* Remove the old stmt and insert the transformed sequence
+ instead. */
+ gsi_insert_seq_before (gsi, replace, GSI_SAME_STMT);
+ gsi_remove (gsi, true);
+
+ /* Return since we don't want gsi_next () */
+ return;
default:
/* A type, a decl, or some kind of statement that we're not
interested in. Don't walk them. */
break;
}
+
+ gsi_next (gsi);
+}
+
+/* A helper to unwrap a gimple_seq and feed stmts to lower_eh_constructs_2. */
+
+static void
+lower_eh_constructs_1 (struct leh_state *state, gimple_seq seq)
+{
+ gimple_stmt_iterator gsi;
+ for (gsi = gsi_start (seq); !gsi_end_p (gsi);)
+ lower_eh_constructs_2 (state, &gsi);
}
static unsigned int
lower_eh_constructs (void)
{
struct leh_state null_state;
- tree *tp = &DECL_SAVED_TREE (current_function_decl);
+
+ gimple_seq bodyp = gimple_body (current_function_decl);
finally_tree = htab_create (31, struct_ptr_hash, struct_ptr_eq, free);
- collect_finally_tree (*tp, NULL);
+ collect_finally_tree_1 (bodyp, NULL);
memset (&null_state, 0, sizeof (null_state));
- lower_eh_constructs_1 (&null_state, tp);
+ lower_eh_constructs_1 (&null_state, bodyp);
htab_delete (finally_tree);
@@ -1751,27 +1933,28 @@ struct gimple_opt_pass pass_lower_eh =
static void
make_eh_edge (struct eh_region *region, void *data)
{
- tree stmt, lab;
+ gimple stmt;
+ tree lab;
basic_block src, dst;
- stmt = (tree) data;
+ stmt = (gimple) data;
lab = get_eh_region_tree_label (region);
- src = bb_for_stmt (stmt);
+ src = gimple_bb (stmt);
dst = label_to_block (lab);
make_edge (src, dst, EDGE_ABNORMAL | EDGE_EH);
}
void
-make_eh_edges (tree stmt)
+make_eh_edges (gimple stmt)
{
int region_nr;
bool is_resx;
- if (TREE_CODE (stmt) == RESX_EXPR)
+ if (gimple_code (stmt) == GIMPLE_RESX)
{
- region_nr = TREE_INT_CST_LOW (TREE_OPERAND (stmt, 0));
+ region_nr = gimple_resx_region (stmt);
is_resx = true;
}
else
@@ -1789,17 +1972,19 @@ static bool mark_eh_edge_found_error;
/* Mark edge make_eh_edge would create for given region by setting it aux
field, output error if something goes wrong. */
+
static void
mark_eh_edge (struct eh_region *region, void *data)
{
- tree stmt, lab;
+ gimple stmt;
+ tree lab;
basic_block src, dst;
edge e;
- stmt = (tree) data;
+ stmt = (gimple) data;
lab = get_eh_region_tree_label (region);
- src = bb_for_stmt (stmt);
+ src = gimple_bb (stmt);
dst = label_to_block (lab);
e = find_edge (src, dst);
@@ -1823,23 +2008,24 @@ mark_eh_edge (struct eh_region *region, void *data)
e->aux = (void *)1;
}
-/* Verify that BB containing stmt as last stmt has precisely the edges
- make_eh_edges would create. */
+/* Verify that BB containing STMT as the last statement, has precisely the
+ edges that make_eh_edges would create. */
+
bool
-verify_eh_edges (tree stmt)
+verify_eh_edges (gimple stmt)
{
int region_nr;
bool is_resx;
- basic_block bb = bb_for_stmt (stmt);
+ basic_block bb = gimple_bb (stmt);
edge_iterator ei;
edge e;
FOR_EACH_EDGE (e, ei, bb->succs)
gcc_assert (!e->aux);
mark_eh_edge_found_error = false;
- if (TREE_CODE (stmt) == RESX_EXPR)
+ if (gimple_code (stmt) == GIMPLE_RESX)
{
- region_nr = TREE_INT_CST_LOW (TREE_OPERAND (stmt, 0));
+ region_nr = gimple_resx_region (stmt);
is_resx = true;
}
else
@@ -1855,7 +2041,7 @@ verify_eh_edges (tree stmt)
}
return false;
}
- if (!tree_could_throw_p (stmt))
+ if (!stmt_could_throw_p (stmt))
{
error ("BB %i last statement has incorrectly set region", bb->index);
return true;
@@ -1874,42 +2060,151 @@ verify_eh_edges (tree stmt)
}
e->aux = NULL;
}
+
return mark_eh_edge_found_error;
}
-/* Return true if the expr can trap, as in dereferencing an invalid pointer
+/* Helper function for operation_could_trap_p and stmt_could_throw_p. */
+
+static bool
+operation_could_trap_helper_p (enum tree_code op,
+ bool fp_operation,
+ bool honor_trapv,
+ bool honor_nans,
+ bool honor_snans,
+ tree divisor,
+ bool *handled)
+{
+ *handled = true;
+ switch (op)
+ {
+ case TRUNC_DIV_EXPR:
+ case CEIL_DIV_EXPR:
+ case FLOOR_DIV_EXPR:
+ case ROUND_DIV_EXPR:
+ case EXACT_DIV_EXPR:
+ case CEIL_MOD_EXPR:
+ case FLOOR_MOD_EXPR:
+ case ROUND_MOD_EXPR:
+ case TRUNC_MOD_EXPR:
+ case RDIV_EXPR:
+ if (honor_snans || honor_trapv)
+ return true;
+ if (fp_operation)
+ return flag_trapping_math;
+ if (!TREE_CONSTANT (divisor) || integer_zerop (divisor))
+ return true;
+ return false;
+
+ case LT_EXPR:
+ case LE_EXPR:
+ case GT_EXPR:
+ case GE_EXPR:
+ case LTGT_EXPR:
+ /* Some floating point comparisons may trap. */
+ return honor_nans;
+
+ case EQ_EXPR:
+ case NE_EXPR:
+ case UNORDERED_EXPR:
+ case ORDERED_EXPR:
+ case UNLT_EXPR:
+ case UNLE_EXPR:
+ case UNGT_EXPR:
+ case UNGE_EXPR:
+ case UNEQ_EXPR:
+ return honor_snans;
+
+ case CONVERT_EXPR:
+ case FIX_TRUNC_EXPR:
+ /* Conversion of floating point might trap. */
+ return honor_nans;
+
+ case NEGATE_EXPR:
+ case ABS_EXPR:
+ case CONJ_EXPR:
+ /* These operations don't trap with floating point. */
+ if (honor_trapv)
+ return true;
+ return false;
+
+ case PLUS_EXPR:
+ case MINUS_EXPR:
+ case MULT_EXPR:
+ /* Any floating arithmetic may trap. */
+ if (fp_operation && flag_trapping_math)
+ return true;
+ if (honor_trapv)
+ return true;
+ return false;
+
+ default:
+ /* Any floating arithmetic may trap. */
+ if (fp_operation && flag_trapping_math)
+ return true;
+
+ *handled = false;
+ return false;
+ }
+}
+
+/* Return true if operation OP may trap. FP_OPERATION is true if OP is applied
+ on floating-point values. HONOR_TRAPV is true if OP is applied on integer
+ type operands that may trap. If OP is a division operator, DIVISOR contains
+ the value of the divisor. */
+
+bool
+operation_could_trap_p (enum tree_code op, bool fp_operation, bool honor_trapv,
+ tree divisor)
+{
+ bool honor_nans = (fp_operation && flag_trapping_math
+ && !flag_finite_math_only);
+ bool honor_snans = fp_operation && flag_signaling_nans != 0;
+ bool handled;
+
+ if (TREE_CODE_CLASS (op) != tcc_comparison
+ && TREE_CODE_CLASS (op) != tcc_unary
+ && TREE_CODE_CLASS (op) != tcc_binary)
+ return false;
+
+ return operation_could_trap_helper_p (op, fp_operation, honor_trapv,
+ honor_nans, honor_snans, divisor,
+ &handled);
+}
+
+/* Return true if EXPR can trap, as in dereferencing an invalid pointer
location or floating point arithmetic. C.f. the rtl version, may_trap_p.
This routine expects only GIMPLE lhs or rhs input. */
bool
tree_could_trap_p (tree expr)
{
- enum tree_code code = TREE_CODE (expr);
- bool honor_nans = false;
- bool honor_snans = false;
+ enum tree_code code;
bool fp_operation = false;
bool honor_trapv = false;
- tree t, base;
+ tree t, base, div = NULL_TREE;
- if (TREE_CODE_CLASS (code) == tcc_comparison
- || TREE_CODE_CLASS (code) == tcc_unary
- || TREE_CODE_CLASS (code) == tcc_binary)
+ if (!expr)
+ return false;
+
+ code = TREE_CODE (expr);
+ t = TREE_TYPE (expr);
+
+ if (t)
{
- t = TREE_TYPE (expr);
if (COMPARISON_CLASS_P (expr))
fp_operation = FLOAT_TYPE_P (TREE_TYPE (TREE_OPERAND (expr, 0)));
else
fp_operation = FLOAT_TYPE_P (t);
- if (fp_operation)
- {
- honor_nans = flag_trapping_math && !flag_finite_math_only;
- honor_snans = flag_signaling_nans != 0;
- }
- else if (INTEGRAL_TYPE_P (t) && TYPE_OVERFLOW_TRAPS (t))
- honor_trapv = true;
+ honor_trapv = INTEGRAL_TYPE_P (t) && TYPE_OVERFLOW_TRAPS (t);
}
+ if (TREE_CODE_CLASS (code) == tcc_binary)
+ div = TREE_OPERAND (expr, 1);
+ if (operation_could_trap_p (code, fp_operation, honor_trapv, div))
+ return true;
+
restart:
switch (code)
{
@@ -1958,93 +2253,126 @@ tree_could_trap_p (tree expr)
case ASM_EXPR:
return TREE_THIS_VOLATILE (expr);
- case TRUNC_DIV_EXPR:
- case CEIL_DIV_EXPR:
- case FLOOR_DIV_EXPR:
- case ROUND_DIV_EXPR:
- case EXACT_DIV_EXPR:
- case CEIL_MOD_EXPR:
- case FLOOR_MOD_EXPR:
- case ROUND_MOD_EXPR:
- case TRUNC_MOD_EXPR:
- case RDIV_EXPR:
- if (honor_snans || honor_trapv)
+
+ case CALL_EXPR:
+ t = get_callee_fndecl (expr);
+ /* Assume that calls to weak functions may trap. */
+ if (!t || !DECL_P (t) || DECL_WEAK (t))
return true;
- if (fp_operation)
- return flag_trapping_math;
- t = TREE_OPERAND (expr, 1);
- if (!TREE_CONSTANT (t) || integer_zerop (t))
- return true;
return false;
- case LT_EXPR:
- case LE_EXPR:
- case GT_EXPR:
- case GE_EXPR:
- case LTGT_EXPR:
- /* Some floating point comparisons may trap. */
- return honor_nans;
+ default:
+ return false;
+ }
+}
- case EQ_EXPR:
- case NE_EXPR:
- case UNORDERED_EXPR:
- case ORDERED_EXPR:
- case UNLT_EXPR:
- case UNLE_EXPR:
- case UNGT_EXPR:
- case UNGE_EXPR:
- case UNEQ_EXPR:
- return honor_snans;
- case CONVERT_EXPR:
- case FIX_TRUNC_EXPR:
- /* Conversion of floating point might trap. */
- return honor_nans;
+/* Helper for stmt_could_throw_p. Return true if STMT (assumed to be a
+ an assignment or a conditional) may throw. */
- case NEGATE_EXPR:
- case ABS_EXPR:
- case CONJ_EXPR:
- /* These operations don't trap with floating point. */
- if (honor_trapv)
- return true;
- return false;
+static bool
+stmt_could_throw_1_p (gimple stmt)
+{
+ enum tree_code code = gimple_expr_code (stmt);
+ bool honor_nans = false;
+ bool honor_snans = false;
+ bool fp_operation = false;
+ bool honor_trapv = false;
+ tree t;
+ size_t i;
+ bool handled, ret;
- case PLUS_EXPR:
- case MINUS_EXPR:
- case MULT_EXPR:
- /* Any floating arithmetic may trap. */
- if (fp_operation && flag_trapping_math)
- return true;
- if (honor_trapv)
- return true;
- return false;
+ if (TREE_CODE_CLASS (code) == tcc_comparison
+ || TREE_CODE_CLASS (code) == tcc_unary
+ || TREE_CODE_CLASS (code) == tcc_binary)
+ {
+ t = gimple_expr_type (stmt);
+ fp_operation = FLOAT_TYPE_P (t);
+ if (fp_operation)
+ {
+ honor_nans = flag_trapping_math && !flag_finite_math_only;
+ honor_snans = flag_signaling_nans != 0;
+ }
+ else if (INTEGRAL_TYPE_P (t) && TYPE_OVERFLOW_TRAPS (t))
+ honor_trapv = true;
+ }
+
+ /* Check if the main expression may trap. */
+ t = is_gimple_assign (stmt) ? gimple_assign_rhs2 (stmt) : NULL;
+ ret = operation_could_trap_helper_p (code, fp_operation, honor_trapv,
+ honor_nans, honor_snans, t,
+ &handled);
+ if (handled)
+ return ret;
+
+ /* If the expression does not trap, see if any of the individual operands may
+ trap. */
+ for (i = 0; i < gimple_num_ops (stmt); i++)
+ if (tree_could_trap_p (gimple_op (stmt, i)))
+ return true;
+
+ return false;
+}
+
+
+/* Return true if statement STMT could throw an exception. */
+
+bool
+stmt_could_throw_p (gimple stmt)
+{
+ enum gimple_code code;
+
+ if (!flag_exceptions)
+ return false;
+
+ /* The only statements that can throw an exception are assignments,
+ conditionals, calls and asms. */
+ code = gimple_code (stmt);
+ if (code != GIMPLE_ASSIGN
+ && code != GIMPLE_COND
+ && code != GIMPLE_CALL
+ && code != GIMPLE_ASM)
+ return false;
+
+ /* If exceptions can only be thrown by function calls and STMT is not a
+ GIMPLE_CALL, the statement cannot throw. */
+ if (!flag_non_call_exceptions && code != GIMPLE_CALL)
+ return false;
+
+ if (code == GIMPLE_ASSIGN || code == GIMPLE_COND)
+ return stmt_could_throw_1_p (stmt);
+ else if (is_gimple_call (stmt))
+ {
+ tree t = gimple_call_fndecl (stmt);
- case CALL_EXPR:
- t = get_callee_fndecl (expr);
/* Assume that calls to weak functions may trap. */
if (!t || !DECL_P (t) || DECL_WEAK (t))
return true;
- return false;
- default:
- /* Any floating arithmetic may trap. */
- if (fp_operation && flag_trapping_math)
- return true;
- return false;
+ return (gimple_call_flags (stmt) & ECF_NOTHROW) == 0;
}
+ else if (gimple_code (stmt) == GIMPLE_ASM)
+ return (gimple_asm_volatile_p (stmt));
+ else
+ gcc_unreachable ();
+
+ return false;
}
+
+/* Return true if expression T could throw an exception. */
+
bool
tree_could_throw_p (tree t)
{
if (!flag_exceptions)
return false;
- if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
+ if (TREE_CODE (t) == MODIFY_EXPR)
{
if (flag_non_call_exceptions
- && tree_could_trap_p (GIMPLE_STMT_OPERAND (t, 0)))
+ && tree_could_trap_p (TREE_OPERAND (t, 0)))
return true;
- t = GIMPLE_STMT_OPERAND (t, 1);
+ t = TREE_OPERAND (t, 1);
}
if (TREE_CODE (t) == WITH_SIZE_EXPR)
@@ -2056,36 +2384,30 @@ tree_could_throw_p (tree t)
return false;
}
+
+/* Return true if STMT can throw an exception that is caught within
+ the current function (CFUN). */
+
bool
-tree_can_throw_internal (const_tree stmt)
+stmt_can_throw_internal (gimple stmt)
{
int region_nr;
bool is_resx = false;
- if (TREE_CODE (stmt) == RESX_EXPR)
- region_nr = TREE_INT_CST_LOW (TREE_OPERAND (stmt, 0)), is_resx = true;
+ if (gimple_code (stmt) == GIMPLE_RESX)
+ {
+ region_nr = gimple_resx_region (stmt);
+ is_resx = true;
+ }
else
region_nr = lookup_stmt_eh_region (stmt);
+
if (region_nr < 0)
return false;
+
return can_throw_internal_1 (region_nr, is_resx);
}
-bool
-tree_can_throw_external (tree stmt)
-{
- int region_nr;
- bool is_resx = false;
-
- if (TREE_CODE (stmt) == RESX_EXPR)
- region_nr = TREE_INT_CST_LOW (TREE_OPERAND (stmt, 0)), is_resx = true;
- else
- region_nr = lookup_stmt_eh_region (stmt);
- if (region_nr < 0)
- return tree_could_throw_p (stmt);
- else
- return can_throw_external_1 (region_nr, is_resx);
-}
/* Given a statement OLD_STMT and a new statement NEW_STMT that has replaced
OLD_STMT in the function, remove OLD_STMT from the EH table and put NEW_STMT
@@ -2093,13 +2415,13 @@ tree_can_throw_external (tree stmt)
done that my require an EH edge purge. */
bool
-maybe_clean_or_replace_eh_stmt (tree old_stmt, tree new_stmt)
+maybe_clean_or_replace_eh_stmt (gimple old_stmt, gimple new_stmt)
{
int region_nr = lookup_stmt_eh_region (old_stmt);
if (region_nr >= 0)
{
- bool new_stmt_could_throw = tree_could_throw_p (new_stmt);
+ bool new_stmt_could_throw = stmt_could_throw_p (new_stmt);
if (new_stmt == old_stmt && new_stmt_could_throw)
return false;
@@ -2117,38 +2439,42 @@ maybe_clean_or_replace_eh_stmt (tree old_stmt, tree new_stmt)
return false;
}
-/* Returns TRUE if oneh and twoh are exception handlers (op 1 of
- TRY_CATCH_EXPR or TRY_FINALLY_EXPR that are similar enough to be
- considered the same. Currently this only handles handlers consisting of
- a single call, as that's the important case for C++: a destructor call
- for a particular object showing up in multiple handlers. */
+/* Returns TRUE if oneh and twoh are exception handlers (gimple_try_cleanup of
+ GIMPLE_TRY) that are similar enough to be considered the same. Currently
+ this only handles handlers consisting of a single call, as that's the
+ important case for C++: a destructor call for a particular object showing
+ up in multiple handlers. */
static bool
-same_handler_p (tree oneh, tree twoh)
+same_handler_p (gimple_seq oneh, gimple_seq twoh)
{
- tree_stmt_iterator i;
- tree ones, twos;
- int ai;
+ gimple_stmt_iterator gsi;
+ gimple ones, twos;
+ unsigned int ai;
- i = tsi_start (oneh);
- if (!tsi_one_before_end_p (i))
+ gsi = gsi_start (oneh);
+ if (!gsi_one_before_end_p (gsi))
return false;
- ones = tsi_stmt (i);
+ ones = gsi_stmt (gsi);
- i = tsi_start (twoh);
- if (!tsi_one_before_end_p (i))
+ gsi = gsi_start (twoh);
+ if (!gsi_one_before_end_p (gsi))
return false;
- twos = tsi_stmt (i);
-
- if (TREE_CODE (ones) != CALL_EXPR
- || TREE_CODE (twos) != CALL_EXPR
- || !operand_equal_p (CALL_EXPR_FN (ones), CALL_EXPR_FN (twos), 0)
- || call_expr_nargs (ones) != call_expr_nargs (twos))
+ twos = gsi_stmt (gsi);
+
+ if (!is_gimple_call (ones)
+ || !is_gimple_call (twos)
+ || gimple_call_lhs (ones)
+ || gimple_call_lhs (twos)
+ || gimple_call_chain (ones)
+ || gimple_call_chain (twos)
+ || !operand_equal_p (gimple_call_fn (ones), gimple_call_fn (twos), 0)
+ || gimple_call_num_args (ones) != gimple_call_num_args (twos))
return false;
- for (ai = 0; ai < call_expr_nargs (ones); ++ai)
- if (!operand_equal_p (CALL_EXPR_ARG (ones, ai),
- CALL_EXPR_ARG (twos, ai), 0))
+ for (ai = 0; ai < gimple_call_num_args (ones); ++ai)
+ if (!operand_equal_p (gimple_call_arg (ones, ai),
+ gimple_call_arg (twos, ai), 0))
return false;
return true;
@@ -2165,27 +2491,29 @@ same_handler_p (tree oneh, tree twoh)
temporary used in the initializer for A. */
static void
-optimize_double_finally (tree one, tree two)
+optimize_double_finally (gimple one, gimple two)
{
- tree oneh;
- tree_stmt_iterator i;
+ gimple oneh;
+ gimple_stmt_iterator gsi;
- i = tsi_start (TREE_OPERAND (one, 1));
- if (!tsi_one_before_end_p (i))
+ gsi = gsi_start (gimple_try_cleanup (one));
+ if (!gsi_one_before_end_p (gsi))
return;
- oneh = tsi_stmt (i);
- if (TREE_CODE (oneh) != TRY_CATCH_EXPR)
+ oneh = gsi_stmt (gsi);
+ if (gimple_code (oneh) != GIMPLE_TRY
+ || gimple_try_kind (oneh) != GIMPLE_TRY_CATCH)
return;
- if (same_handler_p (TREE_OPERAND (oneh, 1), TREE_OPERAND (two, 1)))
+ if (same_handler_p (gimple_try_cleanup (oneh), gimple_try_cleanup (two)))
{
- tree b = TREE_OPERAND (oneh, 0);
- TREE_OPERAND (one, 1) = b;
- TREE_SET_CODE (one, TRY_CATCH_EXPR);
+ gimple_seq seq = gimple_try_eval (oneh);
- i = tsi_start (TREE_OPERAND (two, 0));
- tsi_link_before (&i, unsave_expr_now (b), TSI_SAME_STMT);
+ gimple_try_set_cleanup (one, seq);
+ gimple_try_set_kind (one, GIMPLE_TRY_CATCH);
+ seq = copy_gimple_seq_and_replace_locals (seq);
+ gimple_seq_add_seq (&seq, gimple_try_eval (two));
+ gimple_try_set_eval (two, seq);
}
}
@@ -2193,60 +2521,55 @@ optimize_double_finally (tree one, tree two)
flow has been lowered but EH structures haven't. */
static void
-refactor_eh_r (tree t)
+refactor_eh_r (gimple_seq seq)
{
- tailrecurse:
- switch (TREE_CODE (t))
- {
- case TRY_FINALLY_EXPR:
- case TRY_CATCH_EXPR:
- refactor_eh_r (TREE_OPERAND (t, 0));
- t = TREE_OPERAND (t, 1);
- goto tailrecurse;
+ gimple_stmt_iterator gsi;
+ gimple one, two;
- case CATCH_EXPR:
- t = CATCH_BODY (t);
- goto tailrecurse;
-
- case EH_FILTER_EXPR:
- t = EH_FILTER_FAILURE (t);
- goto tailrecurse;
-
- case STATEMENT_LIST:
- {
- tree_stmt_iterator i;
- tree one = NULL_TREE, two = NULL_TREE;
- /* Try to refactor double try/finally. */
- for (i = tsi_start (t); !tsi_end_p (i); tsi_next (&i))
- {
- one = two;
- two = tsi_stmt (i);
- if (one && two
- && TREE_CODE (one) == TRY_FINALLY_EXPR
- && TREE_CODE (two) == TRY_FINALLY_EXPR)
- optimize_double_finally (one, two);
- if (one)
- refactor_eh_r (one);
- }
- if (two)
+ one = NULL;
+ two = NULL;
+ gsi = gsi_start (seq);
+ while (1)
+ {
+ one = two;
+ if (gsi_end_p (gsi))
+ two = NULL;
+ else
+ two = gsi_stmt (gsi);
+ if (one
+ && two
+ && gimple_code (one) == GIMPLE_TRY
+ && gimple_code (two) == GIMPLE_TRY
+ && gimple_try_kind (one) == GIMPLE_TRY_FINALLY
+ && gimple_try_kind (two) == GIMPLE_TRY_FINALLY)
+ optimize_double_finally (one, two);
+ if (one)
+ switch (gimple_code (one))
{
- t = two;
- goto tailrecurse;
+ case GIMPLE_TRY:
+ refactor_eh_r (gimple_try_eval (one));
+ refactor_eh_r (gimple_try_cleanup (one));
+ break;
+ case GIMPLE_CATCH:
+ refactor_eh_r (gimple_catch_handler (one));
+ break;
+ case GIMPLE_EH_FILTER:
+ refactor_eh_r (gimple_eh_filter_failure (one));
+ break;
+ default:
+ break;
}
- }
- break;
-
- default:
- /* A type, a decl, or some kind of statement that we're not
- interested in. Don't walk them. */
- break;
+ if (two)
+ gsi_next (&gsi);
+ else
+ break;
}
}
static unsigned
refactor_eh (void)
{
- refactor_eh_r (DECL_SAVED_TREE (current_function_decl));
+ refactor_eh_r (gimple_body (current_function_decl));
return 0;
}
diff --git a/gcc/tree-flow-inline.h b/gcc/tree-flow-inline.h
index 1eb284047e3..eefc983190e 100644
--- a/gcc/tree-flow-inline.h
+++ b/gcc/tree-flow-inline.h
@@ -235,52 +235,6 @@ get_function_ann (tree var)
return (ann) ? ann : create_function_ann (var);
}
-/* Return true if T has a statement annotation attached to it. */
-
-static inline bool
-has_stmt_ann (tree t)
-{
-#ifdef ENABLE_CHECKING
- gcc_assert (is_gimple_stmt (t));
-#endif
- return t->base.ann && t->base.ann->common.type == STMT_ANN;
-}
-
-/* Return the statement annotation for T, which must be a statement
- node. Return NULL if the statement annotation doesn't exist. */
-static inline stmt_ann_t
-stmt_ann (tree t)
-{
-#ifdef ENABLE_CHECKING
- gcc_assert (is_gimple_stmt (t));
-#endif
- gcc_assert (!t->base.ann || t->base.ann->common.type == STMT_ANN);
- return (stmt_ann_t) t->base.ann;
-}
-
-/* Return the statement annotation for T, which must be a statement
- node. Create the statement annotation if it doesn't exist. */
-static inline stmt_ann_t
-get_stmt_ann (tree stmt)
-{
- stmt_ann_t ann = stmt_ann (stmt);
- return (ann) ? ann : create_stmt_ann (stmt);
-}
-
-/* Set the uid of all non phi function statements. */
-static inline void
-set_gimple_stmt_uid (tree stmt, unsigned int uid)
-{
- get_stmt_ann (stmt)->uid = uid;
-}
-
-/* Get the uid of all non phi function statements. */
-static inline unsigned int
-gimple_stmt_uid (tree stmt)
-{
- return get_stmt_ann (stmt)->uid;
-}
-
/* Get the number of the next statement uid to be allocated. */
static inline unsigned int
gimple_stmt_max_uid (struct function *fn)
@@ -309,19 +263,6 @@ ann_type (tree_ann_t ann)
return ann->common.type;
}
-/* Return the basic block for statement T. */
-static inline basic_block
-bb_for_stmt (tree t)
-{
- stmt_ann_t ann;
-
- if (TREE_CODE (t) == PHI_NODE)
- return PHI_BB (t);
-
- ann = stmt_ann (t);
- return ann ? ann->bb : NULL;
-}
-
/* Return the may_aliases bitmap for variable VAR, or NULL if it has
no may aliases. */
static inline bitmap
@@ -333,71 +274,18 @@ may_aliases (const_tree var)
/* Return the line number for EXPR, or return -1 if we have no line
number information for it. */
static inline int
-get_lineno (const_tree expr)
+get_lineno (const_gimple stmt)
{
- if (expr == NULL_TREE)
- return -1;
-
- if (TREE_CODE (expr) == COMPOUND_EXPR)
- expr = TREE_OPERAND (expr, 0);
+ location_t loc;
- if (! EXPR_HAS_LOCATION (expr))
+ if (!stmt)
return -1;
- return EXPR_LINENO (expr);
-}
-
-/* Return true if T is a noreturn call. */
-static inline bool
-noreturn_call_p (tree t)
-{
- tree call = get_call_expr_in (t);
- return call != 0 && (call_expr_flags (call) & ECF_NORETURN) != 0;
-}
-
-/* Mark statement T as modified. */
-static inline void
-mark_stmt_modified (tree t)
-{
- stmt_ann_t ann;
- if (TREE_CODE (t) == PHI_NODE)
- return;
-
- ann = stmt_ann (t);
- if (ann == NULL)
- ann = create_stmt_ann (t);
- else if (noreturn_call_p (t) && cfun->gimple_df)
- VEC_safe_push (tree, gc, MODIFIED_NORETURN_CALLS (cfun), t);
- ann->modified = 1;
-}
-
-/* Mark statement T as modified, and update it. */
-static inline void
-update_stmt (tree t)
-{
- if (TREE_CODE (t) == PHI_NODE)
- return;
- mark_stmt_modified (t);
- update_stmt_operands (t);
-}
-
-static inline void
-update_stmt_if_modified (tree t)
-{
- if (stmt_modified_p (t))
- update_stmt_operands (t);
-}
-
-/* Return true if T is marked as modified, false otherwise. */
-static inline bool
-stmt_modified_p (tree t)
-{
- stmt_ann_t ann = stmt_ann (t);
+ loc = gimple_location (stmt);
+ if (loc != UNKNOWN_LOCATION)
+ return -1;
- /* Note that if the statement doesn't yet have an annotation, we consider it
- modified. This will force the next call to update_stmt_operands to scan
- the statement. */
- return ann ? ann->modified : true;
+ return LOCATION_LINE (loc);
}
/* Delink an immediate_uses node from its chain. */
@@ -457,13 +345,13 @@ set_ssa_use_from_ptr (use_operand_p use, tree val)
/* Link ssa_imm_use node LINKNODE into the chain for DEF, with use occurring
in STMT. */
static inline void
-link_imm_use_stmt (ssa_use_operand_t *linknode, tree def, tree stmt)
+link_imm_use_stmt (ssa_use_operand_t *linknode, tree def, gimple stmt)
{
if (stmt)
link_imm_use (linknode, def);
else
link_imm_use (linknode, NULL);
- linknode->stmt = stmt;
+ linknode->loc.stmt = stmt;
}
/* Relink a new node in place of an old node in the list. */
@@ -486,13 +374,14 @@ relink_imm_use (ssa_use_operand_t *node, ssa_use_operand_t *old)
/* Relink ssa_imm_use node LINKNODE into the chain for OLD, with use occurring
in STMT. */
static inline void
-relink_imm_use_stmt (ssa_use_operand_t *linknode, ssa_use_operand_t *old, tree stmt)
+relink_imm_use_stmt (ssa_use_operand_t *linknode, ssa_use_operand_t *old,
+ gimple stmt)
{
if (stmt)
relink_imm_use (linknode, old);
else
link_imm_use (linknode, NULL);
- linknode->stmt = stmt;
+ linknode->loc.stmt = stmt;
}
@@ -562,17 +451,17 @@ has_single_use (const_tree var)
/* If VAR has only a single immediate use, return true, and set USE_P and STMT
to the use pointer and stmt of occurrence. */
static inline bool
-single_imm_use (const_tree var, use_operand_p *use_p, tree *stmt)
+single_imm_use (const_tree var, use_operand_p *use_p, gimple *stmt)
{
const ssa_use_operand_t *const ptr = &(SSA_NAME_IMM_USE_NODE (var));
if (ptr != ptr->next && ptr == ptr->next->next)
{
*use_p = ptr->next;
- *stmt = ptr->next->stmt;
+ *stmt = ptr->next->loc.stmt;
return true;
}
*use_p = NULL_USE_OPERAND_P;
- *stmt = NULL_TREE;
+ *stmt = NULL;
return false;
}
@@ -590,75 +479,76 @@ num_imm_uses (const_tree var)
return num;
}
-/* Return the tree pointer to by USE. */
+/* Return the tree pointed-to by USE. */
static inline tree
get_use_from_ptr (use_operand_p use)
{
return *(use->use);
}
-/* Return the tree pointer to by DEF. */
+/* Return the tree pointed-to by DEF. */
static inline tree
get_def_from_ptr (def_operand_p def)
{
return *def;
}
-/* Return a def_operand_p pointer for the result of PHI. */
-static inline def_operand_p
-get_phi_result_ptr (tree phi)
+/* Return a use_operand_p pointer for argument I of PHI node GS. */
+
+static inline use_operand_p
+gimple_phi_arg_imm_use_ptr (gimple gs, int i)
{
- return &(PHI_RESULT_TREE (phi));
+ return &gimple_phi_arg (gs, i)->imm_use;
}
-/* Return a use_operand_p pointer for argument I of phinode PHI. */
-static inline use_operand_p
-get_phi_arg_def_ptr (tree phi, int i)
+/* Return the tree operand for argument I of PHI node GS. */
+
+static inline tree
+gimple_phi_arg_def (gimple gs, size_t index)
{
- return &(PHI_ARG_IMM_USE_NODE (phi,i));
+ struct phi_arg_d *pd = gimple_phi_arg (gs, index);
+ return get_use_from_ptr (&pd->imm_use);
}
+/* Return a pointer to the tree operand for argument I of PHI node GS. */
-/* Return the bitmap of addresses taken by STMT, or NULL if it takes
- no addresses. */
-static inline bitmap
-addresses_taken (tree stmt)
+static inline tree *
+gimple_phi_arg_def_ptr (gimple gs, size_t index)
+{
+ return &gimple_phi_arg (gs, index)->def;
+}
+
+/* Return the edge associated with argument I of phi node GS. */
+
+static inline edge
+gimple_phi_arg_edge (gimple gs, size_t i)
{
- stmt_ann_t ann = stmt_ann (stmt);
- return ann ? ann->addresses_taken : NULL;
+ return EDGE_PRED (gimple_bb (gs), i);
}
/* Return the PHI nodes for basic block BB, or NULL if there are no
PHI nodes. */
-static inline tree
+static inline gimple_seq
phi_nodes (const_basic_block bb)
{
gcc_assert (!(bb->flags & BB_RTL));
- if (!bb->il.tree)
+ if (!bb->il.gimple)
return NULL;
- return bb->il.tree->phi_nodes;
+ return bb->il.gimple->phi_nodes;
}
-/* Return pointer to the list of PHI nodes for basic block BB. */
-
-static inline tree *
-phi_nodes_ptr (basic_block bb)
-{
- gcc_assert (!(bb->flags & BB_RTL));
- return &bb->il.tree->phi_nodes;
-}
-
-/* Set list of phi nodes of a basic block BB to L. */
+/* Set PHI nodes of a basic block BB to SEQ. */
static inline void
-set_phi_nodes (basic_block bb, tree l)
+set_phi_nodes (basic_block bb, gimple_seq seq)
{
- tree phi;
+ gimple_stmt_iterator i;
gcc_assert (!(bb->flags & BB_RTL));
- bb->il.tree->phi_nodes = l;
- for (phi = l; phi; phi = PHI_CHAIN (phi))
- set_bb_for_stmt (phi, bb);
+ bb->il.gimple->phi_nodes = seq;
+ if (seq)
+ for (i = gsi_start (seq); !gsi_end_p (i); gsi_next (&i))
+ gimple_set_bb (gsi_stmt (i), bb);
}
/* Return the phi argument which contains the specified use. */
@@ -667,18 +557,18 @@ static inline int
phi_arg_index_from_use (use_operand_p use)
{
struct phi_arg_d *element, *root;
- int index;
- tree phi;
+ size_t index;
+ gimple phi;
/* Since the use is the first thing in a PHI argument element, we can
calculate its index based on casting it to an argument, and performing
pointer arithmetic. */
phi = USE_STMT (use);
- gcc_assert (TREE_CODE (phi) == PHI_NODE);
+ gcc_assert (gimple_code (phi) == GIMPLE_PHI);
element = (struct phi_arg_d *)use;
- root = &(PHI_ARG_ELT (phi, 0));
+ root = gimple_phi_arg (phi, 0);
index = element - root;
#ifdef ENABLE_CHECKING
@@ -686,7 +576,7 @@ phi_arg_index_from_use (use_operand_p use)
then imm_use is likely not the first element in phi_arg_d. */
gcc_assert (
(((char *)element - (char *)root) % sizeof (struct phi_arg_d)) == 0);
- gcc_assert (index >= 0 && index < PHI_ARG_CAPACITY (phi));
+ gcc_assert (index < gimple_phi_capacity (phi));
#endif
return index;
@@ -728,121 +618,13 @@ phi_ssa_name_p (const_tree t)
return false;
}
-/* ----------------------------------------------------------------------- */
-
-/* Returns the list of statements in BB. */
-
-static inline tree
-bb_stmt_list (const_basic_block bb)
-{
- gcc_assert (!(bb->flags & BB_RTL));
- return bb->il.tree->stmt_list;
-}
-
-/* Sets the list of statements in BB to LIST. */
-
-static inline void
-set_bb_stmt_list (basic_block bb, tree list)
-{
- gcc_assert (!(bb->flags & BB_RTL));
- bb->il.tree->stmt_list = list;
-}
-
-/* Return a block_stmt_iterator that points to beginning of basic
- block BB. */
-static inline block_stmt_iterator
-bsi_start (basic_block bb)
-{
- block_stmt_iterator bsi;
- if (bb->index < NUM_FIXED_BLOCKS)
- {
- bsi.tsi.ptr = NULL;
- bsi.tsi.container = NULL;
- }
- else
- bsi.tsi = tsi_start (bb_stmt_list (bb));
- bsi.bb = bb;
- return bsi;
-}
-
-/* Return a block statement iterator that points to the first non-label
- statement in block BB. */
-
-static inline block_stmt_iterator
-bsi_after_labels (basic_block bb)
-{
- block_stmt_iterator bsi = bsi_start (bb);
-
- while (!bsi_end_p (bsi) && TREE_CODE (bsi_stmt (bsi)) == LABEL_EXPR)
- bsi_next (&bsi);
-
- return bsi;
-}
-
-/* Return a block statement iterator that points to the end of basic
- block BB. */
-static inline block_stmt_iterator
-bsi_last (basic_block bb)
-{
- block_stmt_iterator bsi;
-
- if (bb->index < NUM_FIXED_BLOCKS)
- {
- bsi.tsi.ptr = NULL;
- bsi.tsi.container = NULL;
- }
- else
- bsi.tsi = tsi_last (bb_stmt_list (bb));
- bsi.bb = bb;
- return bsi;
-}
-
-/* Return true if block statement iterator I has reached the end of
- the basic block. */
-static inline bool
-bsi_end_p (block_stmt_iterator i)
-{
- return tsi_end_p (i.tsi);
-}
-
-/* Modify block statement iterator I so that it is at the next
- statement in the basic block. */
-static inline void
-bsi_next (block_stmt_iterator *i)
-{
- tsi_next (&i->tsi);
-}
-
-/* Modify block statement iterator I so that it is at the previous
- statement in the basic block. */
-static inline void
-bsi_prev (block_stmt_iterator *i)
-{
- tsi_prev (&i->tsi);
-}
-
-/* Return the statement that block statement iterator I is currently
- at. */
-static inline tree
-bsi_stmt (block_stmt_iterator i)
-{
- return tsi_stmt (i.tsi);
-}
-
-/* Return a pointer to the statement that block statement iterator I
- is currently at. */
-static inline tree *
-bsi_stmt_ptr (block_stmt_iterator i)
-{
- return tsi_stmt_ptr (i.tsi);
-}
/* Returns the loop of the statement STMT. */
static inline struct loop *
-loop_containing_stmt (tree stmt)
+loop_containing_stmt (gimple stmt)
{
- basic_block bb = bb_for_stmt (stmt);
+ basic_block bb = gimple_bb (stmt);
if (!bb)
return NULL;
@@ -1083,7 +865,7 @@ clear_and_done_ssa_iter (ssa_op_iter *ptr)
ptr->iter_type = ssa_op_iter_none;
ptr->phi_i = 0;
ptr->num_phi = 0;
- ptr->phi_stmt = NULL_TREE;
+ ptr->phi_stmt = NULL;
ptr->done = true;
ptr->vuse_index = 0;
ptr->mayuse_index = 0;
@@ -1091,22 +873,18 @@ clear_and_done_ssa_iter (ssa_op_iter *ptr)
/* Initialize the iterator PTR to the virtual defs in STMT. */
static inline void
-op_iter_init (ssa_op_iter *ptr, tree stmt, int flags)
+op_iter_init (ssa_op_iter *ptr, gimple stmt, int flags)
{
-#ifdef ENABLE_CHECKING
- gcc_assert (stmt_ann (stmt));
-#endif
-
- ptr->defs = (flags & SSA_OP_DEF) ? DEF_OPS (stmt) : NULL;
- ptr->uses = (flags & SSA_OP_USE) ? USE_OPS (stmt) : NULL;
- ptr->vuses = (flags & SSA_OP_VUSE) ? VUSE_OPS (stmt) : NULL;
- ptr->vdefs = (flags & SSA_OP_VDEF) ? VDEF_OPS (stmt) : NULL;
- ptr->mayuses = (flags & SSA_OP_VMAYUSE) ? VDEF_OPS (stmt) : NULL;
+ ptr->defs = (flags & SSA_OP_DEF) ? gimple_def_ops (stmt) : NULL;
+ ptr->uses = (flags & SSA_OP_USE) ? gimple_use_ops (stmt) : NULL;
+ ptr->vuses = (flags & SSA_OP_VUSE) ? gimple_vuse_ops (stmt) : NULL;
+ ptr->vdefs = (flags & SSA_OP_VDEF) ? gimple_vdef_ops (stmt) : NULL;
+ ptr->mayuses = (flags & SSA_OP_VMAYUSE) ? gimple_vdef_ops (stmt) : NULL;
ptr->done = false;
ptr->phi_i = 0;
ptr->num_phi = 0;
- ptr->phi_stmt = NULL_TREE;
+ ptr->phi_stmt = NULL;
ptr->vuse_index = 0;
ptr->mayuse_index = 0;
}
@@ -1114,7 +892,7 @@ op_iter_init (ssa_op_iter *ptr, tree stmt, int flags)
/* Initialize iterator PTR to the use operands in STMT based on FLAGS. Return
the first use. */
static inline use_operand_p
-op_iter_init_use (ssa_op_iter *ptr, tree stmt, int flags)
+op_iter_init_use (ssa_op_iter *ptr, gimple stmt, int flags)
{
gcc_assert ((flags & SSA_OP_ALL_DEFS) == 0);
op_iter_init (ptr, stmt, flags);
@@ -1125,7 +903,7 @@ op_iter_init_use (ssa_op_iter *ptr, tree stmt, int flags)
/* Initialize iterator PTR to the def operands in STMT based on FLAGS. Return
the first def. */
static inline def_operand_p
-op_iter_init_def (ssa_op_iter *ptr, tree stmt, int flags)
+op_iter_init_def (ssa_op_iter *ptr, gimple stmt, int flags)
{
gcc_assert ((flags & SSA_OP_ALL_USES) == 0);
op_iter_init (ptr, stmt, flags);
@@ -1136,7 +914,7 @@ op_iter_init_def (ssa_op_iter *ptr, tree stmt, int flags)
/* Initialize iterator PTR to the operands in STMT based on FLAGS. Return
the first operand as a tree. */
static inline tree
-op_iter_init_tree (ssa_op_iter *ptr, tree stmt, int flags)
+op_iter_init_tree (ssa_op_iter *ptr, gimple stmt, int flags)
{
op_iter_init (ptr, stmt, flags);
ptr->iter_type = ssa_op_iter_tree;
@@ -1185,10 +963,10 @@ op_iter_next_mustdef (use_operand_p *use, def_operand_p *def,
/* Initialize iterator PTR to the operands in STMT. Return the first operands
in USE and DEF. */
static inline void
-op_iter_init_vdef (ssa_op_iter *ptr, tree stmt, vuse_vec_p *use,
+op_iter_init_vdef (ssa_op_iter *ptr, gimple stmt, vuse_vec_p *use,
def_operand_p *def)
{
- gcc_assert (TREE_CODE (stmt) != PHI_NODE);
+ gcc_assert (gimple_code (stmt) != GIMPLE_PHI);
op_iter_init (ptr, stmt, SSA_OP_VMAYUSE);
ptr->iter_type = ssa_op_iter_vdef;
@@ -1199,7 +977,7 @@ op_iter_init_vdef (ssa_op_iter *ptr, tree stmt, vuse_vec_p *use,
/* If there is a single operand in STMT matching FLAGS, return it. Otherwise
return NULL. */
static inline tree
-single_ssa_tree_operand (tree stmt, int flags)
+single_ssa_tree_operand (gimple stmt, int flags)
{
tree var;
ssa_op_iter iter;
@@ -1217,7 +995,7 @@ single_ssa_tree_operand (tree stmt, int flags)
/* If there is a single operand in STMT matching FLAGS, return it. Otherwise
return NULL. */
static inline use_operand_p
-single_ssa_use_operand (tree stmt, int flags)
+single_ssa_use_operand (gimple stmt, int flags)
{
use_operand_p var;
ssa_op_iter iter;
@@ -1236,7 +1014,7 @@ single_ssa_use_operand (tree stmt, int flags)
/* If there is a single operand in STMT matching FLAGS, return it. Otherwise
return NULL. */
static inline def_operand_p
-single_ssa_def_operand (tree stmt, int flags)
+single_ssa_def_operand (gimple stmt, int flags)
{
def_operand_p var;
ssa_op_iter iter;
@@ -1254,7 +1032,7 @@ single_ssa_def_operand (tree stmt, int flags)
/* Return true if there are zero operands in STMT matching the type
given in FLAGS. */
static inline bool
-zero_ssa_operands (tree stmt, int flags)
+zero_ssa_operands (gimple stmt, int flags)
{
ssa_op_iter iter;
@@ -1265,7 +1043,7 @@ zero_ssa_operands (tree stmt, int flags)
/* Return the number of operands matching FLAGS in STMT. */
static inline int
-num_ssa_operands (tree stmt, int flags)
+num_ssa_operands (gimple stmt, int flags)
{
ssa_op_iter iter;
tree t;
@@ -1279,7 +1057,7 @@ num_ssa_operands (tree stmt, int flags)
/* Delink all immediate_use information for STMT. */
static inline void
-delink_stmt_imm_use (tree stmt)
+delink_stmt_imm_use (gimple stmt)
{
ssa_op_iter iter;
use_operand_p use_p;
@@ -1293,7 +1071,7 @@ delink_stmt_imm_use (tree stmt)
/* This routine will compare all the operands matching FLAGS in STMT1 to those
in STMT2. TRUE is returned if they are the same. STMTs can be NULL. */
static inline bool
-compare_ssa_operands_equal (tree stmt1, tree stmt2, int flags)
+compare_ssa_operands_equal (gimple stmt1, gimple stmt2, int flags)
{
ssa_op_iter iter1, iter2;
tree op1 = NULL_TREE;
@@ -1303,8 +1081,8 @@ compare_ssa_operands_equal (tree stmt1, tree stmt2, int flags)
if (stmt1 == stmt2)
return true;
- look1 = stmt1 && stmt_ann (stmt1);
- look2 = stmt2 && stmt_ann (stmt2);
+ look1 = stmt1 != NULL;
+ look2 = stmt2 != NULL;
if (look1)
{
@@ -1339,7 +1117,7 @@ compare_ssa_operands_equal (tree stmt1, tree stmt2, int flags)
/* If there is a single DEF in the PHI node which matches FLAG, return it.
Otherwise return NULL_DEF_OPERAND_P. */
static inline tree
-single_phi_def (tree stmt, int flags)
+single_phi_def (gimple stmt, int flags)
{
tree def = PHI_RESULT (stmt);
if ((flags & SSA_OP_DEF) && is_gimple_reg (def))
@@ -1352,9 +1130,9 @@ single_phi_def (tree stmt, int flags)
/* Initialize the iterator PTR for uses matching FLAGS in PHI. FLAGS should
be either SSA_OP_USES or SSA_OP_VIRTUAL_USES. */
static inline use_operand_p
-op_iter_init_phiuse (ssa_op_iter *ptr, tree phi, int flags)
+op_iter_init_phiuse (ssa_op_iter *ptr, gimple phi, int flags)
{
- tree phi_def = PHI_RESULT (phi);
+ tree phi_def = gimple_phi_result (phi);
int comp;
clear_and_done_ssa_iter (ptr);
@@ -1372,7 +1150,7 @@ op_iter_init_phiuse (ssa_op_iter *ptr, tree phi, int flags)
}
ptr->phi_stmt = phi;
- ptr->num_phi = PHI_NUM_ARGS (phi);
+ ptr->num_phi = gimple_phi_num_args (phi);
ptr->iter_type = ssa_op_iter_use;
return op_iter_next_use (ptr);
}
@@ -1381,7 +1159,7 @@ op_iter_init_phiuse (ssa_op_iter *ptr, tree phi, int flags)
/* Start an iterator for a PHI definition. */
static inline def_operand_p
-op_iter_init_phidef (ssa_op_iter *ptr, tree phi, int flags)
+op_iter_init_phidef (ssa_op_iter *ptr, gimple phi, int flags)
{
tree phi_def = PHI_RESULT (phi);
int comp;
@@ -1461,7 +1239,7 @@ link_use_stmts_after (use_operand_p head, imm_use_iterator *imm)
{
use_operand_p use_p;
use_operand_p last_p = head;
- tree head_stmt = USE_STMT (head);
+ gimple head_stmt = USE_STMT (head);
tree use = USE_FROM_PTR (head);
ssa_op_iter op_iter;
int flag;
@@ -1469,7 +1247,7 @@ link_use_stmts_after (use_operand_p head, imm_use_iterator *imm)
/* Only look at virtual or real uses, depending on the type of HEAD. */
flag = (is_gimple_reg (use) ? SSA_OP_USE : SSA_OP_VIRTUAL_USES);
- if (TREE_CODE (head_stmt) == PHI_NODE)
+ if (gimple_code (head_stmt) == GIMPLE_PHI)
{
FOR_EACH_PHI_ARG (use_p, head_stmt, op_iter, flag)
if (USE_FROM_PTR (use_p) == use)
@@ -1488,7 +1266,7 @@ link_use_stmts_after (use_operand_p head, imm_use_iterator *imm)
}
/* Initialize IMM to traverse over uses of VAR. Return the first statement. */
-static inline tree
+static inline gimple
first_imm_use_stmt (imm_use_iterator *imm, tree var)
{
gcc_assert (TREE_CODE (var) == SSA_NAME);
@@ -1502,11 +1280,11 @@ first_imm_use_stmt (imm_use_iterator *imm, tree var)
stmt and use, which indicates a marker node. */
imm->iter_node.prev = NULL_USE_OPERAND_P;
imm->iter_node.next = NULL_USE_OPERAND_P;
- imm->iter_node.stmt = NULL_TREE;
+ imm->iter_node.loc.stmt = NULL;
imm->iter_node.use = NULL_USE_OPERAND_P;
if (end_imm_use_stmt_p (imm))
- return NULL_TREE;
+ return NULL;
link_use_stmts_after (imm->imm_use, imm);
@@ -1515,7 +1293,7 @@ first_imm_use_stmt (imm_use_iterator *imm, tree var)
/* Bump IMM to the next stmt which has a use of var. */
-static inline tree
+static inline gimple
next_imm_use_stmt (imm_use_iterator *imm)
{
imm->imm_use = imm->iter_node.next;
@@ -1523,7 +1301,7 @@ next_imm_use_stmt (imm_use_iterator *imm)
{
if (imm->iter_node.prev != NULL)
delink_imm_use (&imm->iter_node);
- return NULL_TREE;
+ return NULL;
}
link_use_stmts_after (imm->imm_use, imm);
@@ -1694,7 +1472,7 @@ redirect_edge_var_map_result (edge_var_map *v)
in function cfun. */
static inline tree
-make_ssa_name (tree var, tree stmt)
+make_ssa_name (tree var, gimple stmt)
{
return make_ssa_name_fn (cfun, var, stmt);
}
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index a441893e004..1e94037f737 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -26,7 +26,7 @@ along with GCC; see the file COPYING3. If not see
#include "hard-reg-set.h"
#include "basic-block.h"
#include "hashtab.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-ssa-operands.h"
#include "cgraph.h"
#include "ipa-reference.h"
@@ -141,12 +141,12 @@ struct gimple_df GTY(())
/* Array of all variables referenced in the function. */
htab_t GTY((param_is (union tree_node))) referenced_vars;
- /* A list of all the noreturn calls passed to modify_stmt.
+ /* A vector of all the noreturn calls passed to modify_stmt.
cleanup_control_flow uses it to detect cases where a mid-block
indirect call has been turned into a noreturn call. When this
happens, all the instructions after the call are no longer
reachable and must be deleted as dead. */
- VEC(tree,gc) *modified_noreturn_calls;
+ VEC(gimple,gc) *modified_noreturn_calls;
/* Array of all SSA_NAMEs used in the function. */
VEC(tree,gc) *ssa_names;
@@ -268,19 +268,27 @@ struct ptr_info_def GTY(())
/*---------------------------------------------------------------------------
Tree annotations stored in tree_base.ann
---------------------------------------------------------------------------*/
-enum tree_ann_type { TREE_ANN_COMMON, VAR_ANN, FUNCTION_ANN, STMT_ANN };
+enum tree_ann_type { TREE_ANN_COMMON, VAR_ANN, FUNCTION_ANN };
struct tree_ann_common_d GTY(())
{
/* Annotation type. */
enum tree_ann_type type;
- /* Auxiliary info specific to a pass. At all times, this
- should either point to valid data or be NULL. */
+ /* Record EH region number into a statement tree created during RTL
+ expansion (see gimple_to_tree). */
+ int rn;
+
+ /* Auxiliary info specific to a pass. At all times, this
+ should either point to valid data or be NULL. */
PTR GTY ((skip (""))) aux;
/* The value handle for this expression. Used by GVN-PRE. */
tree GTY((skip)) value_handle;
+
+ /* Pointer to original GIMPLE statement. Used during RTL expansion
+ (see gimple_to_tree). */
+ gimple stmt;
};
/* It is advantageous to avoid things like life analysis for variables which
@@ -417,6 +425,42 @@ struct function_ann_d GTY(())
ipa_reference_vars_info_t GTY ((skip)) reference_vars_info;
};
+
+/* Immediate use lists are used to directly access all uses for an SSA
+ name and get pointers to the statement for each use.
+
+ The structure ssa_use_operand_d consists of PREV and NEXT pointers
+ to maintain the list. A USE pointer, which points to address where
+ the use is located and a LOC pointer which can point to the
+ statement where the use is located, or, in the case of the root
+ node, it points to the SSA name itself.
+
+ The list is anchored by an occurrence of ssa_operand_d *in* the
+ ssa_name node itself (named 'imm_uses'). This node is uniquely
+ identified by having a NULL USE pointer. and the LOC pointer
+ pointing back to the ssa_name node itself. This node forms the
+ base for a circular list, and initially this is the only node in
+ the list.
+
+ Fast iteration allows each use to be examined, but does not allow
+ any modifications to the uses or stmts.
+
+ Normal iteration allows insertion, deletion, and modification. the
+ iterator manages this by inserting a marker node into the list
+ immediately before the node currently being examined in the list.
+ this marker node is uniquely identified by having null stmt *and* a
+ null use pointer.
+
+ When iterating to the next use, the iteration routines check to see
+ if the node after the marker has changed. if it has, then the node
+ following the marker is now the next one to be visited. if not, the
+ marker node is moved past that node in the list (visualize it as
+ bumping the marker node through the list). this continues until
+ the marker node is moved to the original anchor position. the
+ marker node is then removed from the list.
+
+ If iteration is halted early, the marker node must be removed from
+ the list before continuing. */
typedef struct immediate_use_iterator_d
{
/* This is the current use the iterator is processing. */
@@ -476,50 +520,16 @@ typedef struct immediate_use_iterator_d
-struct stmt_ann_d GTY(())
-{
- struct tree_ann_common_d common;
-
- /* Basic block that contains this statement. */
- basic_block bb;
-
- /* Operand cache for stmt. */
- struct stmt_operands_d GTY ((skip (""))) operands;
-
- /* Set of variables that have had their address taken in the statement. */
- bitmap addresses_taken;
-
- /* Unique identifier for this statement. These ID's are to be
- created by each pass on an as-needed basis in any order
- convenient for the pass which needs statement UIDs. This field
- should only be accessed thru set_gimple_stmt_uid and
- gimple_stmt_uid functions. */
- unsigned int uid;
-
- /* Nonzero if the statement references memory (at least one of its
- expressions contains a non-register operand). */
- unsigned references_memory : 1;
-
- /* Nonzero if the statement has been modified (meaning that the operands
- need to be scanned again). */
- unsigned modified : 1;
-
- /* Nonzero if the statement makes references to volatile storage. */
- unsigned has_volatile_ops : 1;
-};
-
union tree_ann_d GTY((desc ("ann_type ((tree_ann_t)&%h)")))
{
struct tree_ann_common_d GTY((tag ("TREE_ANN_COMMON"))) common;
struct var_ann_d GTY((tag ("VAR_ANN"))) vdecl;
struct function_ann_d GTY((tag ("FUNCTION_ANN"))) fdecl;
- struct stmt_ann_d GTY((tag ("STMT_ANN"))) stmt;
};
typedef union tree_ann_d *tree_ann_t;
typedef struct var_ann_d *var_ann_t;
typedef struct function_ann_d *function_ann_t;
-typedef struct stmt_ann_d *stmt_ann_t;
typedef struct tree_ann_common_d *tree_ann_common_t;
static inline tree_ann_common_t tree_common_ann (const_tree);
@@ -528,18 +538,10 @@ static inline var_ann_t var_ann (const_tree);
static inline var_ann_t get_var_ann (tree);
static inline function_ann_t function_ann (const_tree);
static inline function_ann_t get_function_ann (tree);
-static inline stmt_ann_t stmt_ann (tree);
-static inline bool has_stmt_ann (tree);
-static inline stmt_ann_t get_stmt_ann (tree);
static inline enum tree_ann_type ann_type (tree_ann_t);
-static inline basic_block bb_for_stmt (tree);
-extern void set_bb_for_stmt (tree, basic_block);
-static inline bool noreturn_call_p (tree);
-static inline void update_stmt (tree);
-static inline bool stmt_modified_p (tree);
+static inline void update_stmt (gimple);
static inline bitmap may_aliases (const_tree);
-static inline int get_lineno (const_tree);
-static inline bitmap addresses_taken (tree);
+static inline int get_lineno (const_gimple);
/*---------------------------------------------------------------------------
Structure representing predictions in tree level.
@@ -553,8 +555,8 @@ struct edge_prediction GTY((chain_next ("%h.ep_next")))
};
/* Accessors for basic block annotations. */
-static inline tree phi_nodes (const_basic_block);
-static inline void set_phi_nodes (basic_block, tree);
+static inline gimple_seq phi_nodes (const_basic_block);
+static inline void set_phi_nodes (basic_block, gimple_seq);
/*---------------------------------------------------------------------------
Global declarations
@@ -627,48 +629,6 @@ extern bool referenced_var_check_and_insert (tree);
#define PERCENT(x,y) ((float)(x) * 100.0 / (float)(y))
/*---------------------------------------------------------------------------
- Block iterators
----------------------------------------------------------------------------*/
-
-typedef struct {
- tree_stmt_iterator tsi;
- basic_block bb;
-} block_stmt_iterator;
-
-static inline block_stmt_iterator bsi_start (basic_block);
-static inline block_stmt_iterator bsi_last (basic_block);
-static inline block_stmt_iterator bsi_after_labels (basic_block);
-block_stmt_iterator bsi_for_stmt (tree);
-static inline bool bsi_end_p (block_stmt_iterator);
-static inline void bsi_next (block_stmt_iterator *);
-static inline void bsi_prev (block_stmt_iterator *);
-static inline tree bsi_stmt (block_stmt_iterator);
-static inline tree * bsi_stmt_ptr (block_stmt_iterator);
-
-extern void bsi_remove (block_stmt_iterator *, bool);
-extern void bsi_move_before (block_stmt_iterator *, block_stmt_iterator *);
-extern void bsi_move_after (block_stmt_iterator *, block_stmt_iterator *);
-extern void bsi_move_to_bb_end (block_stmt_iterator *, basic_block);
-
-enum bsi_iterator_update
-{
- /* Note that these are intentionally in the same order as TSI_FOO. They
- mean exactly the same as their TSI_* counterparts. */
- BSI_NEW_STMT,
- BSI_SAME_STMT,
- BSI_CHAIN_START,
- BSI_CHAIN_END,
- BSI_CONTINUE_LINKING
-};
-
-extern void bsi_insert_before (block_stmt_iterator *, tree,
- enum bsi_iterator_update);
-extern void bsi_insert_after (block_stmt_iterator *, tree,
- enum bsi_iterator_update);
-
-extern void bsi_replace (const block_stmt_iterator *, tree, bool);
-
-/*---------------------------------------------------------------------------
OpenMP Region Tree
---------------------------------------------------------------------------*/
@@ -702,7 +662,7 @@ struct omp_region
tree ws_args;
/* The code for the omp directive of this region. */
- enum tree_code type;
+ enum gimple_code type;
/* Schedule kind, only used for OMP_FOR type regions. */
enum omp_clause_schedule_kind sched_kind;
@@ -712,7 +672,7 @@ struct omp_region
};
extern struct omp_region *root_omp_region;
-extern struct omp_region *new_omp_region (basic_block, enum tree_code,
+extern struct omp_region *new_omp_region (basic_block, enum gimple_code,
struct omp_region *);
extern void free_omp_regions (void);
void omp_expand_local (basic_block);
@@ -725,20 +685,20 @@ tree copy_var_decl (tree, tree, tree);
/* In tree-cfg.c */
/* Location to track pending stmt for edge insertion. */
-#define PENDING_STMT(e) ((e)->insns.t)
+#define PENDING_STMT(e) ((e)->insns.g)
extern void delete_tree_cfg_annotations (void);
-extern bool stmt_ends_bb_p (const_tree);
-extern bool is_ctrl_stmt (const_tree);
-extern bool is_ctrl_altering_stmt (const_tree);
-extern bool simple_goto_p (const_tree);
-extern bool tree_can_make_abnormal_goto (const_tree);
+extern bool stmt_ends_bb_p (gimple);
+extern bool is_ctrl_stmt (gimple);
+extern bool is_ctrl_altering_stmt (gimple);
+extern bool simple_goto_p (gimple);
+extern bool stmt_can_make_abnormal_goto (gimple);
extern basic_block single_noncomplex_succ (basic_block bb);
-extern void tree_dump_bb (basic_block, FILE *, int);
-extern void debug_tree_bb (basic_block);
-extern basic_block debug_tree_bb_n (int);
-extern void dump_tree_cfg (FILE *, int);
-extern void debug_tree_cfg (int);
+extern void gimple_dump_bb (basic_block, FILE *, int, int);
+extern void gimple_debug_bb (basic_block);
+extern basic_block gimple_debug_bb_n (int);
+extern void gimple_dump_cfg (FILE *, int);
+extern void gimple_debug_cfg (int);
extern void dump_cfg_stats (FILE *);
extern void dot_cfg (void);
extern void debug_cfg_stats (void);
@@ -749,40 +709,35 @@ extern void print_loops (FILE *, int);
extern void print_loops_bb (FILE *, basic_block, int, int);
extern void cleanup_dead_labels (void);
extern void group_case_labels (void);
-extern tree first_stmt (basic_block);
-extern tree last_stmt (basic_block);
-extern tree last_and_only_stmt (basic_block);
+extern gimple first_stmt (basic_block);
+extern gimple last_stmt (basic_block);
+extern gimple last_and_only_stmt (basic_block);
extern edge find_taken_edge (basic_block, tree);
extern basic_block label_to_block_fn (struct function *, tree);
#define label_to_block(t) (label_to_block_fn (cfun, t))
-extern void bsi_insert_on_edge (edge, tree);
-extern basic_block bsi_insert_on_edge_immediate (edge, tree);
-extern void bsi_commit_one_edge_insert (edge, basic_block *);
-extern void bsi_commit_edge_inserts (void);
-extern void notice_special_calls (tree);
+extern void notice_special_calls (gimple);
extern void clear_special_calls (void);
extern void verify_stmts (void);
extern void verify_gimple (void);
-extern void verify_gimple_1 (tree);
-extern tree tree_block_label (basic_block);
+extern void verify_types_in_gimple_seq (gimple_seq);
+extern tree gimple_block_label (basic_block);
extern void extract_true_false_edges_from_block (basic_block, edge *, edge *);
-extern bool tree_duplicate_sese_region (edge, edge, basic_block *, unsigned,
+extern bool gimple_duplicate_sese_region (edge, edge, basic_block *, unsigned,
basic_block *);
-extern bool tree_duplicate_sese_tail (edge, edge, basic_block *, unsigned,
+extern bool gimple_duplicate_sese_tail (edge, edge, basic_block *, unsigned,
basic_block *);
extern void gather_blocks_in_sese_region (basic_block entry, basic_block exit,
VEC(basic_block,heap) **bbs_p);
extern void add_phi_args_after_copy_bb (basic_block);
extern void add_phi_args_after_copy (basic_block *, unsigned, edge);
-extern bool tree_purge_dead_abnormal_call_edges (basic_block);
-extern bool tree_purge_dead_eh_edges (basic_block);
-extern bool tree_purge_all_dead_eh_edges (const_bitmap);
-extern tree gimplify_val (block_stmt_iterator *, tree, tree);
-extern tree gimplify_build1 (block_stmt_iterator *, enum tree_code,
+extern bool gimple_purge_dead_abnormal_call_edges (basic_block);
+extern bool gimple_purge_dead_eh_edges (basic_block);
+extern bool gimple_purge_all_dead_eh_edges (const_bitmap);
+extern tree gimplify_build1 (gimple_stmt_iterator *, enum tree_code,
tree, tree);
-extern tree gimplify_build2 (block_stmt_iterator *, enum tree_code,
+extern tree gimplify_build2 (gimple_stmt_iterator *, enum tree_code,
tree, tree, tree);
-extern tree gimplify_build3 (block_stmt_iterator *, enum tree_code,
+extern tree gimplify_build3 (gimple_stmt_iterator *, enum tree_code,
tree, tree, tree, tree);
extern void init_empty_tree_cfg (void);
extern void init_empty_tree_cfg_for_function (struct function *);
@@ -807,7 +762,6 @@ extern const char *op_symbol_code (enum tree_code);
/* In tree-dfa.c */
extern var_ann_t create_var_ann (tree);
extern function_ann_t create_function_ann (tree);
-extern stmt_ann_t create_stmt_ann (tree);
extern void renumber_gimple_stmt_uids (void);
extern tree_ann_common_t create_tree_common_ann (tree);
extern void dump_dfa_stats (FILE *);
@@ -819,27 +773,26 @@ extern void debug_variable (tree);
extern tree get_virtual_var (tree);
extern void add_referenced_var (tree);
extern void remove_referenced_var (tree);
-extern void mark_symbols_for_renaming (tree);
-extern void find_new_referenced_vars (tree *);
+extern void mark_symbols_for_renaming (gimple);
+extern void find_new_referenced_vars (gimple);
extern tree make_rename_temp (tree, const char *);
extern void set_default_def (tree, tree);
extern tree gimple_default_def (struct function *, tree);
-extern bool stmt_references_abnormal_ssa_name (tree);
+extern bool stmt_references_abnormal_ssa_name (gimple);
extern bool refs_may_alias_p (tree, tree);
-extern tree get_single_def_stmt (tree);
-extern tree get_single_def_stmt_from_phi (tree, tree);
-extern tree get_single_def_stmt_with_phi (tree, tree);
+extern gimple get_single_def_stmt (gimple);
+extern gimple get_single_def_stmt_from_phi (tree, gimple);
+extern gimple get_single_def_stmt_with_phi (tree, gimple);
/* In tree-phinodes.c */
extern void reserve_phi_args_for_new_edge (basic_block);
-extern tree create_phi_node (tree, basic_block);
-extern void add_phi_arg (tree, tree, edge);
+extern gimple create_phi_node (tree, basic_block);
+extern void add_phi_arg (gimple, tree, edge);
extern void remove_phi_args (edge);
-extern void remove_phi_node (tree, tree, bool);
-extern tree phi_reverse (tree);
+extern void remove_phi_node (gimple_stmt_iterator *, bool);
extern void init_phinodes (void);
extern void fini_phinodes (void);
-extern void release_phi_node (tree);
+extern void release_phi_node (gimple);
#ifdef GATHER_STATISTICS
extern void phinodes_print_statistics (void);
#endif
@@ -848,6 +801,8 @@ extern void phinodes_print_statistics (void);
extern void record_vars_into (tree, tree);
extern void record_vars (tree);
extern bool block_may_fallthru (const_tree);
+extern bool gimple_seq_may_fallthru (gimple_seq);
+extern bool gimple_stmt_may_fallthru (gimple);
/* In tree-ssa-alias.c */
extern unsigned int compute_may_aliases (void);
@@ -864,7 +819,7 @@ extern bool may_alias_p (tree, alias_set_type, tree, alias_set_type, bool);
extern struct ptr_info_def *get_ptr_info (tree);
extern bool may_point_to_global_var (tree);
extern void new_type_alias (tree, tree, tree);
-extern void count_uses_and_derefs (tree, tree, unsigned *, unsigned *,
+extern void count_uses_and_derefs (tree, gimple, unsigned *, unsigned *,
unsigned *);
static inline bool ref_contains_array_ref (const_tree);
static inline bool array_ref_contains_indirect_ref (const_tree);
@@ -881,7 +836,7 @@ extern void debug_all_mem_sym_stats (void);
/* Call-back function for walk_use_def_chains(). At each reaching
definition, a function with this prototype is called. */
-typedef bool (*walk_use_def_chains_fn) (tree, tree, void *);
+typedef bool (*walk_use_def_chains_fn) (tree, gimple, void *);
/* In tree-ssa-alias-warnings.c */
extern void strict_aliasing_warning_backend (void);
@@ -912,13 +867,9 @@ extern void redirect_edge_var_map_destroy (void);
extern edge ssa_redirect_edge (edge, basic_block);
extern void flush_pending_stmts (edge);
-extern bool tree_ssa_useless_type_conversion (tree);
-extern bool useless_type_conversion_p (tree, tree);
-extern bool types_compatible_p (tree, tree);
extern void verify_ssa (bool);
extern void delete_tree_ssa (void);
extern void walk_use_def_chains (tree, walk_use_def_chains_fn, void *, bool);
-extern bool stmt_references_memory_p (tree);
extern bool ssa_undefined_value_p (tree);
@@ -926,14 +877,13 @@ extern bool ssa_undefined_value_p (tree);
void update_ssa (unsigned);
void delete_update_ssa (void);
void register_new_name_mapping (tree, tree);
-tree create_new_def_for (tree, tree, def_operand_p);
+tree create_new_def_for (tree, gimple, def_operand_p);
bool need_ssa_update_p (void);
bool name_mappings_registered_p (void);
bool name_registered_for_update_p (tree);
bitmap ssa_names_to_replace (void);
void release_ssa_name_after_update_ssa (tree);
void compute_global_livein (bitmap, bitmap);
-tree duplicate_ssa_name (tree, tree);
void mark_sym_for_renaming (tree);
void mark_set_for_renaming (bitmap);
tree get_current_def (tree);
@@ -942,11 +892,11 @@ void set_current_def (tree, tree);
/* In tree-ssanames.c */
extern void init_ssanames (struct function *, int);
extern void fini_ssanames (void);
-extern tree make_ssa_name_fn (struct function *, tree, tree);
-extern tree duplicate_ssa_name (tree, tree);
+extern tree make_ssa_name_fn (struct function *, tree, gimple);
+extern tree duplicate_ssa_name (tree, gimple);
extern void duplicate_ssa_name_ptr_info (tree, struct ptr_info_def *);
extern void release_ssa_name (tree);
-extern void release_defs (tree);
+extern void release_defs (gimple);
extern void replace_ssa_name_symbol (tree, tree);
#ifdef GATHER_STATISTICS
@@ -954,14 +904,14 @@ extern void ssanames_print_statistics (void);
#endif
/* In tree-ssa-ccp.c */
-bool fold_stmt (tree *);
-bool fold_stmt_inplace (tree);
+bool fold_stmt (gimple_stmt_iterator *);
+bool fold_stmt_inplace (gimple);
tree get_symbol_constant_value (tree);
tree fold_const_aggregate_ref (tree);
/* In tree-vrp.c */
-tree vrp_evaluate_conditional (enum tree_code, tree, tree, tree);
-void simplify_stmt_using_ranges (tree);
+tree vrp_evaluate_conditional (enum tree_code, tree, tree, gimple);
+void simplify_stmt_using_ranges (gimple);
/* In tree-ssa-dom.c */
extern void dump_dominator_optimization_stats (FILE *);
@@ -972,8 +922,10 @@ int loop_depth_of_name (tree);
extern void merge_alias_info (tree, tree);
extern void propagate_value (use_operand_p, tree);
extern void propagate_tree_value (tree *, tree);
+extern void propagate_tree_value_into_stmt (gimple_stmt_iterator *, tree);
extern void replace_exp (use_operand_p, tree);
extern bool may_propagate_copy (tree, tree);
+extern bool may_propagate_copy_into_stmt (gimple, tree);
extern bool may_propagate_copy_into_asm (tree);
/* Affine iv. */
@@ -1046,8 +998,8 @@ tree find_loop_niter (struct loop *, edge *);
tree loop_niter_by_eval (struct loop *, edge);
tree find_loop_niter_by_eval (struct loop *, edge *);
void estimate_numbers_of_iterations (void);
-bool scev_probably_wraps_p (tree, tree, tree, struct loop *, bool);
-bool convert_affine_scev (struct loop *, tree, tree *, tree *, tree, bool);
+bool scev_probably_wraps_p (tree, tree, gimple, struct loop *, bool);
+bool convert_affine_scev (struct loop *, tree, tree *, tree *, gimple, bool);
bool nowrap_type_p (tree);
enum ev_direction {EV_DIR_GROWS, EV_DIR_DECREASES, EV_DIR_UNKNOWN};
@@ -1058,14 +1010,14 @@ void free_numbers_of_iterations_estimates_loop (struct loop *);
void rewrite_into_loop_closed_ssa (bitmap, unsigned);
void verify_loop_closed_ssa (void);
bool for_each_index (tree *, bool (*) (tree, tree *, void *), void *);
-void create_iv (tree, tree, tree, struct loop *, block_stmt_iterator *, bool,
+void create_iv (tree, tree, tree, struct loop *, gimple_stmt_iterator *, bool,
tree *, tree *);
basic_block split_loop_exit_edge (edge);
-void standard_iv_increment_position (struct loop *, block_stmt_iterator *,
+void standard_iv_increment_position (struct loop *, gimple_stmt_iterator *,
bool *);
basic_block ip_end_pos (struct loop *);
basic_block ip_normal_pos (struct loop *);
-bool tree_duplicate_loop_to_header_edge (struct loop *, edge,
+bool gimple_duplicate_loop_to_header_edge (struct loop *, edge,
unsigned int, sbitmap,
edge, VEC (edge, heap) **,
int);
@@ -1085,13 +1037,13 @@ void tree_transform_and_unroll_loop (struct loop *, unsigned,
edge, struct tree_niter_desc *,
transform_callback, void *);
bool contains_abnormal_ssa_name_p (tree);
-bool stmt_dominates_stmt_p (tree, tree);
-void mark_virtual_ops_for_renaming (tree);
+bool stmt_dominates_stmt_p (gimple, gimple);
+void mark_virtual_ops_for_renaming (gimple);
/* In tree-ssa-threadedge.c */
extern bool potentially_threadable_block (basic_block);
-extern void thread_across_edge (tree, edge, bool,
- VEC(tree, heap) **, tree (*) (tree, tree));
+extern void thread_across_edge (gimple, edge, bool,
+ VEC(tree, heap) **, tree (*) (gimple, gimple));
/* In tree-ssa-loop-im.c */
/* The possibilities of statement movement. */
@@ -1103,7 +1055,7 @@ enum move_pos
become executed -- memory accesses, ... */
MOVE_POSSIBLE /* Unlimited movement. */
};
-extern enum move_pos movement_possibility (tree);
+extern enum move_pos movement_possibility (gimple);
char *get_lsm_tmp_name (tree, unsigned);
/* In tree-flow-inline.h */
@@ -1113,15 +1065,22 @@ static inline void set_is_used (tree);
static inline bool unmodifiable_var_p (const_tree);
/* In tree-eh.c */
-extern void make_eh_edges (tree);
+extern void make_eh_edges (gimple);
extern bool tree_could_trap_p (tree);
+extern bool operation_could_trap_p (enum tree_code, bool, bool, tree);
+extern bool stmt_could_throw_p (gimple);
extern bool tree_could_throw_p (tree);
-extern bool tree_can_throw_internal (const_tree);
-extern bool tree_can_throw_external (tree);
-extern int lookup_stmt_eh_region (const_tree);
-extern void add_stmt_to_eh_region (tree, int);
-extern bool remove_stmt_from_eh_region (tree);
-extern bool maybe_clean_or_replace_eh_stmt (tree, tree);
+extern bool stmt_can_throw_internal (gimple);
+extern void add_stmt_to_eh_region (gimple, int);
+extern bool remove_stmt_from_eh_region (gimple);
+extern bool maybe_clean_or_replace_eh_stmt (gimple, gimple);
+extern void add_stmt_to_eh_region_fn (struct function *, gimple, int);
+extern bool remove_stmt_from_eh_region_fn (struct function *, gimple);
+extern int lookup_stmt_eh_region_fn (struct function *, gimple);
+extern int lookup_expr_eh_region (tree);
+extern int lookup_stmt_eh_region (gimple);
+extern bool verify_eh_edges (gimple);
+
/* In tree-ssa-pre.c */
struct pre_expr_d;
@@ -1137,21 +1096,21 @@ bool expressions_equal_p (tree, tree);
void sort_vuses (VEC (tree, gc) *);
void sort_vuses_heap (VEC (tree, heap) *);
tree vn_lookup_or_add (tree);
-tree vn_lookup_or_add_with_stmt (tree, tree);
+tree vn_lookup_or_add_with_stmt (tree, gimple);
tree vn_lookup_or_add_with_vuses (tree, VEC (tree, gc) *);
void vn_add (tree, tree);
void vn_add_with_vuses (tree, tree, VEC (tree, gc) *);
-tree vn_lookup_with_stmt (tree, tree);
+tree vn_lookup_with_stmt (tree, gimple);
tree vn_lookup (tree);
tree vn_lookup_with_vuses (tree, VEC (tree, gc) *);
/* In tree-ssa-sink.c */
-bool is_hidden_global_store (tree);
+bool is_hidden_global_store (gimple);
/* In tree-sra.c */
-void insert_edge_copies (tree, basic_block);
-void sra_insert_before (block_stmt_iterator *, tree);
-void sra_insert_after (block_stmt_iterator *, tree);
+void insert_edge_copies_seq (gimple_seq, basic_block);
+void sra_insert_before (gimple_stmt_iterator *, gimple_seq);
+void sra_insert_after (gimple_stmt_iterator *, gimple_seq);
void sra_init_cache (void);
bool sra_type_can_be_decomposed_p (tree);
@@ -1163,6 +1122,7 @@ extern void tree_check_data_deps (void);
/* In tree-ssa-loop-ivopts.c */
bool expr_invariant_in_loop_p (struct loop *, tree);
+bool stmt_invariant_in_loop_p (struct loop *, gimple);
bool multiplier_allowed_in_address_p (HOST_WIDE_INT, enum machine_mode);
unsigned multiply_by_cost (HOST_WIDE_INT, enum machine_mode);
@@ -1171,9 +1131,9 @@ extern bool thread_through_all_blocks (bool);
extern void register_jump_thread (edge, edge);
/* In gimplify.c */
-tree force_gimple_operand (tree, tree *, bool, tree);
-tree force_gimple_operand_bsi (block_stmt_iterator *, tree, bool, tree,
- bool, enum bsi_iterator_update);
+tree force_gimple_operand (tree, gimple_seq *, bool, tree);
+tree force_gimple_operand_gsi (gimple_stmt_iterator *, tree, bool, tree,
+ bool, enum gsi_iterator_update);
tree gimple_fold_indirect_ref (tree);
/* In tree-ssa-structalias.c */
@@ -1194,7 +1154,7 @@ struct mem_address
};
struct affine_tree_combination;
-tree create_mem_ref (block_stmt_iterator *, tree,
+tree create_mem_ref (gimple_stmt_iterator *, tree,
struct affine_tree_combination *);
rtx addr_for_mem_ref (struct mem_address *, bool);
void get_address_description (tree, struct mem_address *);
@@ -1206,7 +1166,7 @@ unsigned int execute_fixup_cfg (void);
#include "tree-flow-inline.h"
-void swap_tree_operands (tree, tree *, tree *);
+void swap_tree_operands (gimple, tree *, tree *);
int least_common_multiple (int, int);
diff --git a/gcc/tree-gimple.c b/gcc/tree-gimple.c
deleted file mode 100644
index 8b05f93d505..00000000000
--- a/gcc/tree-gimple.c
+++ /dev/null
@@ -1,653 +0,0 @@
-/* Functions to analyze and validate GIMPLE trees.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
- Free Software Foundation, Inc.
- Contributed by Diego Novillo <dnovillo@redhat.com>
- Rewritten by Jason Merrill <jason@redhat.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/>. */
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "ggc.h"
-#include "tm.h"
-#include "tree.h"
-#include "tree-gimple.h"
-#include "tree-flow.h"
-#include "output.h"
-#include "rtl.h"
-#include "expr.h"
-#include "bitmap.h"
-
-/* For the definitive definition of GIMPLE, see doc/tree-ssa.texi. */
-
-/* Validation of GIMPLE expressions. */
-
-/* Return true if T is a GIMPLE RHS for an assignment to a temporary. */
-
-bool
-is_gimple_formal_tmp_rhs (tree t)
-{
- enum tree_code code = TREE_CODE (t);
-
- switch (TREE_CODE_CLASS (code))
- {
- case tcc_unary:
- case tcc_binary:
- case tcc_comparison:
- return true;
-
- default:
- break;
- }
-
- switch (code)
- {
- case TRUTH_NOT_EXPR:
- case TRUTH_AND_EXPR:
- case TRUTH_OR_EXPR:
- case TRUTH_XOR_EXPR:
- case COND_EXPR:
- case ADDR_EXPR:
- case CALL_EXPR:
- case CONSTRUCTOR:
- case COMPLEX_EXPR:
- case INTEGER_CST:
- case REAL_CST:
- case FIXED_CST:
- case STRING_CST:
- case COMPLEX_CST:
- case VECTOR_CST:
- case OBJ_TYPE_REF:
- case ASSERT_EXPR:
- return true;
-
- default:
- break;
- }
-
- return is_gimple_lvalue (t) || is_gimple_val (t);
-}
-
-/* Returns true iff T is a valid RHS for an assignment to a renamed
- user -- or front-end generated artificial -- variable. */
-
-bool
-is_gimple_reg_rhs (tree t)
-{
- /* If the RHS of the GIMPLE_MODIFY_STMT may throw or make a nonlocal goto
- and the LHS is a user variable, then we need to introduce a formal
- temporary. This way the optimizers can determine that the user
- variable is only modified if evaluation of the RHS does not throw.
-
- Don't force a temp of a non-renamable type; the copy could be
- arbitrarily expensive. Instead we will generate a VDEF for
- the assignment. */
-
- if (is_gimple_reg_type (TREE_TYPE (t))
- && ((TREE_CODE (t) == CALL_EXPR && TREE_SIDE_EFFECTS (t))
- || tree_could_throw_p (t)))
- return false;
-
- return is_gimple_formal_tmp_rhs (t);
-}
-
-/* Returns true iff T is a valid RHS for an assignment to an un-renamed
- LHS, or for a call argument. */
-
-bool
-is_gimple_mem_rhs (tree t)
-{
- /* If we're dealing with a renamable type, either source or dest must be
- a renamed variable. */
- if (is_gimple_reg_type (TREE_TYPE (t)))
- return is_gimple_val (t);
- else
- return is_gimple_formal_tmp_rhs (t);
-}
-
-/* Returns the appropriate RHS predicate for this LHS. */
-
-gimple_predicate
-rhs_predicate_for (tree lhs)
-{
- if (is_gimple_formal_tmp_var (lhs))
- return is_gimple_formal_tmp_rhs;
- else if (is_gimple_reg (lhs))
- return is_gimple_reg_rhs;
- else
- return is_gimple_mem_rhs;
-}
-
-/* Return true if T is a valid LHS for a GIMPLE assignment expression. */
-
-bool
-is_gimple_lvalue (tree t)
-{
- return (is_gimple_addressable (t)
- || TREE_CODE (t) == WITH_SIZE_EXPR
- /* These are complex lvalues, but don't have addresses, so they
- go here. */
- || TREE_CODE (t) == BIT_FIELD_REF);
-}
-
-/* Return true if T is a GIMPLE condition. */
-
-bool
-is_gimple_condexpr (tree t)
-{
- return (is_gimple_val (t) || (COMPARISON_CLASS_P (t)
- && !tree_could_trap_p (t)
- && is_gimple_val (TREE_OPERAND (t, 0))
- && is_gimple_val (TREE_OPERAND (t, 1))));
-}
-
-/* Return true if T is something whose address can be taken. */
-
-bool
-is_gimple_addressable (tree t)
-{
- return (is_gimple_id (t) || handled_component_p (t)
- || INDIRECT_REF_P (t));
-}
-
-/* Return true if T is a valid gimple constant. */
-
-bool
-is_gimple_constant (const_tree t)
-{
- switch (TREE_CODE (t))
- {
- case INTEGER_CST:
- case REAL_CST:
- case FIXED_CST:
- case STRING_CST:
- case COMPLEX_CST:
- case VECTOR_CST:
- return true;
-
- /* Vector constant constructors are gimple invariant. */
- case CONSTRUCTOR:
- if (TREE_TYPE (t) && TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE)
- return TREE_CONSTANT (t);
- else
- return false;
-
- default:
- return false;
- }
-}
-
-/* Return true if T is a gimple address. */
-
-bool
-is_gimple_address (const_tree t)
-{
- tree op;
-
- if (TREE_CODE (t) != ADDR_EXPR)
- return false;
-
- op = TREE_OPERAND (t, 0);
- while (handled_component_p (op))
- {
- if ((TREE_CODE (op) == ARRAY_REF
- || TREE_CODE (op) == ARRAY_RANGE_REF)
- && !is_gimple_val (TREE_OPERAND (op, 1)))
- return false;
-
- op = TREE_OPERAND (op, 0);
- }
-
- if (CONSTANT_CLASS_P (op) || INDIRECT_REF_P (op))
- return true;
-
- switch (TREE_CODE (op))
- {
- case PARM_DECL:
- case RESULT_DECL:
- case LABEL_DECL:
- case FUNCTION_DECL:
- case VAR_DECL:
- case CONST_DECL:
- return true;
-
- default:
- return false;
- }
-}
-
-/* Return true if T is a gimple invariant address. */
-
-bool
-is_gimple_invariant_address (const_tree t)
-{
- tree op;
-
- if (TREE_CODE (t) != ADDR_EXPR)
- return false;
-
- op = TREE_OPERAND (t, 0);
- while (handled_component_p (op))
- {
- switch (TREE_CODE (op))
- {
- case ARRAY_REF:
- case ARRAY_RANGE_REF:
- if (!is_gimple_constant (TREE_OPERAND (op, 1))
- || TREE_OPERAND (op, 2) != NULL_TREE
- || TREE_OPERAND (op, 3) != NULL_TREE)
- return false;
- break;
-
- case COMPONENT_REF:
- if (TREE_OPERAND (op, 2) != NULL_TREE)
- return false;
- break;
-
- default:;
- }
- op = TREE_OPERAND (op, 0);
- }
-
- return CONSTANT_CLASS_P (op) || decl_address_invariant_p (op);
-}
-
-/* Return true if T is a GIMPLE minimal invariant. It's a restricted
- form of function invariant. */
-
-bool
-is_gimple_min_invariant (const_tree t)
-{
- if (TREE_CODE (t) == ADDR_EXPR)
- return is_gimple_invariant_address (t);
-
- return is_gimple_constant (t);
-}
-
-/* Return true if T looks like a valid GIMPLE statement. */
-
-bool
-is_gimple_stmt (tree t)
-{
- const enum tree_code code = TREE_CODE (t);
-
- switch (code)
- {
- case NOP_EXPR:
- /* The only valid NOP_EXPR is the empty statement. */
- return IS_EMPTY_STMT (t);
-
- case BIND_EXPR:
- case COND_EXPR:
- /* These are only valid if they're void. */
- return TREE_TYPE (t) == NULL || VOID_TYPE_P (TREE_TYPE (t));
-
- case SWITCH_EXPR:
- case GOTO_EXPR:
- case RETURN_EXPR:
- case LABEL_EXPR:
- case CASE_LABEL_EXPR:
- case TRY_CATCH_EXPR:
- case TRY_FINALLY_EXPR:
- case EH_FILTER_EXPR:
- case CATCH_EXPR:
- case CHANGE_DYNAMIC_TYPE_EXPR:
- case ASM_EXPR:
- case RESX_EXPR:
- case PHI_NODE:
- case STATEMENT_LIST:
- case OMP_PARALLEL:
- case OMP_FOR:
- case OMP_SECTIONS:
- case OMP_SECTIONS_SWITCH:
- case OMP_SECTION:
- case OMP_SINGLE:
- case OMP_MASTER:
- case OMP_ORDERED:
- case OMP_CRITICAL:
- case OMP_RETURN:
- case OMP_CONTINUE:
- case OMP_TASK:
- case OMP_ATOMIC_LOAD:
- case OMP_ATOMIC_STORE:
- /* These are always void. */
- return true;
-
- case CALL_EXPR:
- case GIMPLE_MODIFY_STMT:
- case PREDICT_EXPR:
- /* These are valid regardless of their type. */
- return true;
-
- default:
- return false;
- }
-}
-
-/* Return true if T is a variable. */
-
-bool
-is_gimple_variable (tree t)
-{
- return (TREE_CODE (t) == VAR_DECL
- || TREE_CODE (t) == PARM_DECL
- || TREE_CODE (t) == RESULT_DECL
- || TREE_CODE (t) == SSA_NAME);
-}
-
-/* Return true if T is a GIMPLE identifier (something with an address). */
-
-bool
-is_gimple_id (tree t)
-{
- return (is_gimple_variable (t)
- || TREE_CODE (t) == FUNCTION_DECL
- || TREE_CODE (t) == LABEL_DECL
- || TREE_CODE (t) == CONST_DECL
- /* Allow string constants, since they are addressable. */
- || TREE_CODE (t) == STRING_CST);
-}
-
-/* Return true if TYPE is a suitable type for a scalar register variable. */
-
-bool
-is_gimple_reg_type (tree type)
-{
- /* In addition to aggregate types, we also exclude complex types if not
- optimizing because they can be subject to partial stores in GNU C by
- means of the __real__ and __imag__ operators and we cannot promote
- them to total stores (see gimplify_modify_expr_complex_part). */
- return !(AGGREGATE_TYPE_P (type)
- || (TREE_CODE (type) == COMPLEX_TYPE && !optimize));
-
-}
-
-/* Return true if T is a non-aggregate register variable. */
-
-bool
-is_gimple_reg (tree t)
-{
- if (TREE_CODE (t) == SSA_NAME)
- t = SSA_NAME_VAR (t);
-
- if (MTAG_P (t))
- return false;
-
- if (!is_gimple_variable (t))
- return false;
-
- if (!is_gimple_reg_type (TREE_TYPE (t)))
- return false;
-
- /* A volatile decl is not acceptable because we can't reuse it as
- needed. We need to copy it into a temp first. */
- if (TREE_THIS_VOLATILE (t))
- return false;
-
- /* We define "registers" as things that can be renamed as needed,
- which with our infrastructure does not apply to memory. */
- if (needs_to_live_in_memory (t))
- return false;
-
- /* Hard register variables are an interesting case. For those that
- are call-clobbered, we don't know where all the calls are, since
- we don't (want to) take into account which operations will turn
- into libcalls at the rtl level. For those that are call-saved,
- we don't currently model the fact that calls may in fact change
- global hard registers, nor do we examine ASM_CLOBBERS at the tree
- level, and so miss variable changes that might imply. All around,
- it seems safest to not do too much optimization with these at the
- tree level at all. We'll have to rely on the rtl optimizers to
- clean this up, as there we've got all the appropriate bits exposed. */
- if (TREE_CODE (t) == VAR_DECL && DECL_HARD_REGISTER (t))
- return false;
-
- /* Complex and vector values must have been put into SSA-like form.
- That is, no assignments to the individual components. */
- if (TREE_CODE (TREE_TYPE (t)) == COMPLEX_TYPE
- || TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE)
- return DECL_GIMPLE_REG_P (t);
-
- return true;
-}
-
-
-/* Returns true if T is a GIMPLE formal temporary variable. */
-
-bool
-is_gimple_formal_tmp_var (tree t)
-{
- if (TREE_CODE (t) == SSA_NAME)
- return true;
-
- return TREE_CODE (t) == VAR_DECL && DECL_GIMPLE_FORMAL_TEMP_P (t);
-}
-
-/* Returns true if T is a GIMPLE formal temporary register variable. */
-
-bool
-is_gimple_formal_tmp_reg (tree t)
-{
- /* The intent of this is to get hold of a value that won't change.
- An SSA_NAME qualifies no matter if its of a user variable or not. */
- if (TREE_CODE (t) == SSA_NAME)
- return true;
-
- /* We don't know the lifetime characteristics of user variables. */
- if (!is_gimple_formal_tmp_var (t))
- return false;
-
- /* Finally, it must be capable of being placed in a register. */
- return is_gimple_reg (t);
-}
-
-/* Return true if T is a GIMPLE variable whose address is not needed. */
-
-bool
-is_gimple_non_addressable (tree t)
-{
- if (TREE_CODE (t) == SSA_NAME)
- t = SSA_NAME_VAR (t);
-
- return (is_gimple_variable (t) && ! needs_to_live_in_memory (t));
-}
-
-/* Return true if T is a GIMPLE rvalue, i.e. an identifier or a constant. */
-
-bool
-is_gimple_val (tree t)
-{
- /* Make loads from volatiles and memory vars explicit. */
- if (is_gimple_variable (t)
- && is_gimple_reg_type (TREE_TYPE (t))
- && !is_gimple_reg (t))
- return false;
-
- /* FIXME make these decls. That can happen only when we expose the
- entire landing-pad construct at the tree level. */
- if (TREE_CODE (t) == EXC_PTR_EXPR || TREE_CODE (t) == FILTER_EXPR)
- return true;
-
- return (is_gimple_variable (t) || is_gimple_min_invariant (t));
-}
-
-/* Similarly, but accept hard registers as inputs to asm statements. */
-
-bool
-is_gimple_asm_val (tree t)
-{
- if (TREE_CODE (t) == VAR_DECL && DECL_HARD_REGISTER (t))
- return true;
-
- return is_gimple_val (t);
-}
-
-/* Return true if T is a GIMPLE minimal lvalue. */
-
-bool
-is_gimple_min_lval (tree t)
-{
- return (is_gimple_id (t)
- || TREE_CODE (t) == INDIRECT_REF);
-}
-
-/* Return true if T is a typecast operation. */
-
-bool
-is_gimple_cast (tree t)
-{
- return (CONVERT_EXPR_P (t)
- || TREE_CODE (t) == FIX_TRUNC_EXPR);
-}
-
-/* Return true if T is a valid function operand of a CALL_EXPR. */
-
-bool
-is_gimple_call_addr (tree t)
-{
- return (TREE_CODE (t) == OBJ_TYPE_REF
- || is_gimple_val (t));
-}
-
-/* If T makes a function call, return the corresponding CALL_EXPR operand.
- Otherwise, return NULL_TREE. */
-
-tree
-get_call_expr_in (tree t)
-{
- /* FIXME tuples: delete the assertion below when conversion complete. */
- gcc_assert (TREE_CODE (t) != MODIFY_EXPR);
- if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
- t = GIMPLE_STMT_OPERAND (t, 1);
- if (TREE_CODE (t) == WITH_SIZE_EXPR)
- t = TREE_OPERAND (t, 0);
- if (TREE_CODE (t) == CALL_EXPR)
- return t;
- return NULL_TREE;
-}
-
-/* Given a memory reference expression T, return its base address.
- The base address of a memory reference expression is the main
- object being referenced. For instance, the base address for
- 'array[i].fld[j]' is 'array'. You can think of this as stripping
- away the offset part from a memory address.
-
- This function calls handled_component_p to strip away all the inner
- parts of the memory reference until it reaches the base object. */
-
-tree
-get_base_address (tree t)
-{
- while (handled_component_p (t))
- t = TREE_OPERAND (t, 0);
-
- if (SSA_VAR_P (t)
- || TREE_CODE (t) == STRING_CST
- || TREE_CODE (t) == CONSTRUCTOR
- || INDIRECT_REF_P (t))
- return t;
- else
- return NULL_TREE;
-}
-
-void
-recalculate_side_effects (tree t)
-{
- enum tree_code code = TREE_CODE (t);
- int len = TREE_OPERAND_LENGTH (t);
- int i;
-
- switch (TREE_CODE_CLASS (code))
- {
- case tcc_expression:
- switch (code)
- {
- case INIT_EXPR:
- case GIMPLE_MODIFY_STMT:
- case VA_ARG_EXPR:
- case PREDECREMENT_EXPR:
- case PREINCREMENT_EXPR:
- case POSTDECREMENT_EXPR:
- case POSTINCREMENT_EXPR:
- /* All of these have side-effects, no matter what their
- operands are. */
- return;
-
- default:
- break;
- }
- /* Fall through. */
-
- case tcc_comparison: /* a comparison expression */
- case tcc_unary: /* a unary arithmetic expression */
- case tcc_binary: /* a binary arithmetic expression */
- case tcc_reference: /* a reference */
- case tcc_vl_exp: /* a function call */
- TREE_SIDE_EFFECTS (t) = TREE_THIS_VOLATILE (t);
- for (i = 0; i < len; ++i)
- {
- tree op = TREE_OPERAND (t, i);
- if (op && TREE_SIDE_EFFECTS (op))
- TREE_SIDE_EFFECTS (t) = 1;
- }
- break;
-
- default:
- /* Can never be used with non-expressions. */
- gcc_unreachable ();
- }
-}
-
-/* Canonicalize a tree T for use in a COND_EXPR as conditional. Returns
- a canonicalized tree that is valid for a COND_EXPR or NULL_TREE, if
- we failed to create one. */
-
-tree
-canonicalize_cond_expr_cond (tree t)
-{
- /* For (bool)x use x != 0. */
- if (TREE_CODE (t) == NOP_EXPR
- && TREE_TYPE (t) == boolean_type_node)
- {
- tree top0 = TREE_OPERAND (t, 0);
- t = build2 (NE_EXPR, TREE_TYPE (t),
- top0, build_int_cst (TREE_TYPE (top0), 0));
- }
- /* For !x use x == 0. */
- else if (TREE_CODE (t) == TRUTH_NOT_EXPR)
- {
- tree top0 = TREE_OPERAND (t, 0);
- t = build2 (EQ_EXPR, TREE_TYPE (t),
- top0, build_int_cst (TREE_TYPE (top0), 0));
- }
- /* For cmp ? 1 : 0 use cmp. */
- else if (TREE_CODE (t) == COND_EXPR
- && COMPARISON_CLASS_P (TREE_OPERAND (t, 0))
- && integer_onep (TREE_OPERAND (t, 1))
- && integer_zerop (TREE_OPERAND (t, 2)))
- {
- tree top0 = TREE_OPERAND (t, 0);
- t = build2 (TREE_CODE (top0), TREE_TYPE (t),
- TREE_OPERAND (top0, 0), TREE_OPERAND (top0, 1));
- }
-
- if (is_gimple_condexpr (t))
- return t;
-
- return NULL_TREE;
-}
diff --git a/gcc/tree-gimple.h b/gcc/tree-gimple.h
deleted file mode 100644
index 3691cbc5631..00000000000
--- a/gcc/tree-gimple.h
+++ /dev/null
@@ -1,235 +0,0 @@
-/* Functions to analyze and validate GIMPLE trees.
- Copyright (C) 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
- Contributed by Diego Novillo <dnovillo@redhat.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 _TREE_SIMPLE_H
-#define _TREE_SIMPLE_H 1
-
-
-#include "tree-iterator.h"
-
-extern tree create_tmp_var_raw (tree, const char *);
-extern tree create_tmp_var_name (const char *);
-extern tree create_tmp_var (tree, const char *);
-extern tree get_initialized_tmp_var (tree, tree *, tree *);
-extern tree get_formal_tmp_var (tree, tree *);
-
-extern void declare_vars (tree, tree, bool);
-
-extern void annotate_all_with_locus (tree *, location_t);
-
-/* Validation of GIMPLE expressions. Note that these predicates only check
- the basic form of the expression, they don't recurse to make sure that
- underlying nodes are also of the right form. */
-
-typedef bool (*gimple_predicate)(tree);
-
-/* Returns true iff T is a valid GIMPLE statement. */
-extern bool is_gimple_stmt (tree);
-
-/* Returns true iff TYPE is a valid type for a scalar register variable. */
-extern bool is_gimple_reg_type (tree);
-/* Returns true iff T is a scalar register variable. */
-extern bool is_gimple_reg (tree);
-/* Returns true if T is a GIMPLE temporary variable, false otherwise. */
-extern bool is_gimple_formal_tmp_var (tree);
-/* Returns true if T is a GIMPLE temporary register variable. */
-extern bool is_gimple_formal_tmp_reg (tree);
-/* Returns true iff T is any sort of variable. */
-extern bool is_gimple_variable (tree);
-/* Returns true iff T is any sort of symbol. */
-extern bool is_gimple_id (tree);
-/* Returns true iff T is a variable or an INDIRECT_REF (of a variable). */
-extern bool is_gimple_min_lval (tree);
-/* Returns true iff T is something whose address can be taken. */
-extern bool is_gimple_addressable (tree);
-/* Returns true iff T is any valid GIMPLE lvalue. */
-extern bool is_gimple_lvalue (tree);
-
-/* Returns true iff T is a GIMPLE address. */
-bool is_gimple_address (const_tree);
-/* Returns true iff T is a GIMPLE invariant address. */
-bool is_gimple_invariant_address (const_tree);
-/* Returns true iff T is a valid GIMPLE constant. */
-bool is_gimple_constant (const_tree);
-/* Returns true iff T is a GIMPLE restricted function invariant. */
-extern bool is_gimple_min_invariant (const_tree);
-/* Returns true iff T is a GIMPLE rvalue. */
-extern bool is_gimple_val (tree);
-/* Returns true iff T is a GIMPLE asm statement input. */
-extern bool is_gimple_asm_val (tree);
-/* Returns true iff T is a valid rhs for a MODIFY_EXPR where the LHS is a
- GIMPLE temporary, a renamed user variable, or something else,
- respectively. */
-extern bool is_gimple_formal_tmp_rhs (tree);
-extern bool is_gimple_reg_rhs (tree);
-extern bool is_gimple_mem_rhs (tree);
-/* Returns the appropriate one of the above three predicates for the LHS
- T. */
-extern gimple_predicate rhs_predicate_for (tree);
-
-/* Returns true iff T is a valid if-statement condition. */
-extern bool is_gimple_condexpr (tree);
-
-/* Returns true iff T is a type conversion. */
-extern bool is_gimple_cast (tree);
-/* Returns true iff T is a variable that does not need to live in memory. */
-extern bool is_gimple_non_addressable (tree t);
-
-/* Returns true iff T is a valid call address expression. */
-extern bool is_gimple_call_addr (tree);
-/* If T makes a function call, returns the CALL_EXPR operand. */
-extern tree get_call_expr_in (tree t);
-/* Returns true iff T contains a CALL_EXPR not suitable for inlining. */
-#define CALL_STMT_CANNOT_INLINE_P(T) \
- CALL_CANNOT_INLINE_P (get_call_expr_in (T))
-
-extern void recalculate_side_effects (tree);
-
-/* FIXME we should deduce this from the predicate. */
-typedef enum fallback_t {
- fb_none = 0,
- fb_rvalue = 1,
- fb_lvalue = 2,
- fb_mayfail = 4,
- fb_either= fb_rvalue | fb_lvalue
-} fallback_t;
-
-enum gimplify_status {
- GS_ERROR = -2, /* Something Bad Seen. */
- GS_UNHANDLED = -1, /* A langhook result for "I dunno". */
- GS_OK = 0, /* We did something, maybe more to do. */
- GS_ALL_DONE = 1 /* The expression is fully gimplified. */
-};
-
-struct gimplify_ctx
-{
- struct gimplify_ctx *prev_context;
-
- tree current_bind_expr;
- tree temps;
- tree conditional_cleanups;
- tree exit_label;
- tree return_temp;
-
- VEC(tree,heap) *case_labels;
- /* The formal temporary table. Should this be persistent? */
- htab_t temp_htab;
-
- int conditions;
- bool save_stack;
- bool into_ssa;
- bool allow_rhs_cond_expr;
-};
-
-extern enum gimplify_status gimplify_expr (tree *, tree *, tree *,
- bool (*) (tree), fallback_t);
-extern void gimplify_type_sizes (tree, tree *);
-extern void gimplify_one_sizepos (tree *, tree *);
-extern void gimplify_stmt (tree *);
-extern void gimplify_to_stmt_list (tree *);
-extern void gimplify_body (tree *, tree, bool);
-extern void push_gimplify_context (struct gimplify_ctx *);
-extern void pop_gimplify_context (tree);
-extern void gimplify_and_add (tree, tree *);
-
-/* Miscellaneous helpers. */
-extern void gimple_add_tmp_var (tree);
-extern tree gimple_current_bind_expr (void);
-extern tree voidify_wrapper_expr (tree, tree);
-extern tree gimple_build_eh_filter (tree, tree, tree);
-extern tree build_and_jump (tree *);
-extern tree alloc_stmt_list (void);
-extern void free_stmt_list (tree);
-extern tree force_labels_r (tree *, int *, void *);
-extern enum gimplify_status gimplify_va_arg_expr (tree *, tree *, tree *);
-struct gimplify_omp_ctx;
-extern void omp_firstprivatize_variable (struct gimplify_omp_ctx *, tree);
-extern tree gimple_boolify (tree);
-extern tree canonicalize_cond_expr_cond (tree);
-
-/* In omp-low.c. */
-extern void diagnose_omp_structured_block_errors (tree);
-extern tree omp_reduction_init (tree, tree);
-
-/* In tree-nested.c. */
-extern void lower_nested_functions (tree);
-extern void insert_field_into_struct (tree, tree);
-
-/* Convenience routines to walk all statements of a gimple function.
- The difference between these walkers and the generic walk_tree is
- that walk_stmt provides context information to the callback
- routine to know whether it is currently on the LHS or RHS of an
- assignment (IS_LHS) or contexts where only GIMPLE values are
- allowed (VAL_ONLY).
-
- This is useful in walkers that need to re-write sub-expressions
- inside statements while making sure the result is still in GIMPLE
- form.
-
- Note that this is useful exclusively before the code is converted
- into SSA form. Once the program is in SSA form, the standard
- operand interface should be used to analyze/modify statements. */
-
-struct walk_stmt_info
-{
- /* For each statement, we invoke CALLBACK via walk_tree. The passed
- data is a walk_stmt_info structure. */
- walk_tree_fn callback;
-
- /* Points to the current statement being walked. */
- tree_stmt_iterator tsi;
-
- /* Additional data that CALLBACK may want to carry through the
- recursion. */
- void *info;
-
- /* Indicates whether the *TP being examined may be replaced
- with something that matches is_gimple_val (if true) or something
- slightly more complicated (if false). "Something" technically
- means the common subset of is_gimple_lvalue and is_gimple_rhs,
- but we never try to form anything more complicated than that, so
- we don't bother checking.
-
- Also note that CALLBACK should update this flag while walking the
- sub-expressions of a statement. For instance, when walking the
- statement 'foo (&var)', the flag VAL_ONLY will initially be set
- to true, however, when walking &var, the operand of that
- ADDR_EXPR does not need to be a GIMPLE value. */
- bool val_only;
-
- /* True if we are currently walking the LHS of an assignment. */
- bool is_lhs;
-
- /* Optional. Set to true by CALLBACK if it made any changes. */
- bool changed;
-
- /* True if we're interested in seeing BIND_EXPRs. */
- bool want_bind_expr;
-
- /* True if we're interested in seeing RETURN_EXPRs. */
- bool want_return_expr;
-
- /* True if we're interested in location information. */
- bool want_locations;
-};
-
-void walk_stmts (struct walk_stmt_info *, tree *);
-
-#endif /* _TREE_SIMPLE_H */
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 78b29a4a64b..d21bb9d49d1 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -100,31 +100,33 @@ along with GCC; see the file COPYING3. If not see
#include "tree-pass.h"
#include "target.h"
+
/* local function prototypes */
static unsigned int main_tree_if_conversion (void);
-static tree tree_if_convert_stmt (struct loop *loop, tree, tree,
- block_stmt_iterator *);
-static void tree_if_convert_cond_expr (struct loop *, tree, tree,
- block_stmt_iterator *);
-static bool if_convertible_phi_p (struct loop *, basic_block, tree);
-static bool if_convertible_gimple_modify_stmt_p (struct loop *, basic_block,
- tree);
-static bool if_convertible_stmt_p (struct loop *, basic_block, tree);
+static tree tree_if_convert_stmt (struct loop *loop, gimple, tree,
+ gimple_stmt_iterator *);
+static void tree_if_convert_cond_stmt (struct loop *, gimple, tree,
+ gimple_stmt_iterator *);
+static bool if_convertible_phi_p (struct loop *, basic_block, gimple);
+static bool if_convertible_gimple_assign_stmt_p (struct loop *, basic_block,
+ gimple);
+static bool if_convertible_stmt_p (struct loop *, basic_block, gimple);
static bool if_convertible_bb_p (struct loop *, basic_block, basic_block);
static bool if_convertible_loop_p (struct loop *, bool);
static void add_to_predicate_list (basic_block, tree);
static tree add_to_dst_predicate_list (struct loop * loop, edge,
tree, tree,
- block_stmt_iterator *);
+ gimple_stmt_iterator *);
static void clean_predicate_lists (struct loop *loop);
static basic_block find_phi_replacement_condition (struct loop *loop,
basic_block, tree *,
- block_stmt_iterator *);
-static void replace_phi_with_cond_gimple_modify_stmt (tree, tree, basic_block,
- block_stmt_iterator *);
+ gimple_stmt_iterator *);
+static void replace_phi_with_cond_gimple_assign_stmt (gimple, tree,
+ basic_block,
+ gimple_stmt_iterator *);
static void process_phi_nodes (struct loop *);
static void combine_blocks (struct loop *);
-static tree ifc_temp_var (tree, tree);
+static gimple ifc_temp_var (tree, tree);
static bool pred_blocks_visited_p (basic_block, bitmap *);
static basic_block * get_loop_body_in_if_conv_order (const struct loop *loop);
static bool bb_with_exit_edge_p (struct loop *, basic_block);
@@ -143,7 +145,7 @@ static bool
tree_if_conversion (struct loop *loop, bool for_vectorizer)
{
basic_block bb;
- block_stmt_iterator itr;
+ gimple_stmt_iterator itr;
unsigned int i;
ifc_bbs = NULL;
@@ -176,12 +178,12 @@ tree_if_conversion (struct loop *loop, bool for_vectorizer)
/* Process all statements in this basic block.
Remove conditional expression, if any, and annotate
destination basic block(s) appropriately. */
- for (itr = bsi_start (bb); !bsi_end_p (itr); /* empty */)
+ for (itr = gsi_start_bb (bb); !gsi_end_p (itr); /* empty */)
{
- tree t = bsi_stmt (itr);
+ gimple t = gsi_stmt (itr);
cond = tree_if_convert_stmt (loop, t, cond, &itr);
- if (!bsi_end_p (itr))
- bsi_next (&itr);
+ if (!gsi_end_p (itr))
+ gsi_next (&itr);
}
/* If current bb has only one successor, then consider it as an
@@ -214,41 +216,41 @@ tree_if_conversion (struct loop *loop, bool for_vectorizer)
}
/* if-convert stmt T which is part of LOOP.
- If T is a GIMPLE_MODIFY_STMT than it is converted into conditional modify
+ If T is a GIMPLE_ASSIGN then it is converted into conditional modify
expression using COND. For conditional expressions, add condition in the
destination basic block's predicate list and remove conditional
expression itself. BSI is the iterator used to traverse statements of
loop. It is used here when it is required to delete current statement. */
static tree
-tree_if_convert_stmt (struct loop * loop, tree t, tree cond,
- block_stmt_iterator *bsi)
+tree_if_convert_stmt (struct loop * loop, gimple t, tree cond,
+ gimple_stmt_iterator *gsi)
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "------if-convert stmt\n");
- print_generic_stmt (dump_file, t, TDF_SLIM);
+ print_gimple_stmt (dump_file, t, 0, TDF_SLIM);
print_generic_stmt (dump_file, cond, TDF_SLIM);
}
- switch (TREE_CODE (t))
+ switch (gimple_code (t))
{
/* Labels are harmless here. */
- case LABEL_EXPR:
+ case GIMPLE_LABEL:
break;
- case GIMPLE_MODIFY_STMT:
- /* This GIMPLE_MODIFY_STMT is killing previous value of LHS. Appropriate
+ case GIMPLE_ASSIGN:
+ /* This GIMPLE_ASSIGN is killing previous value of LHS. Appropriate
value will be selected by PHI node based on condition. It is possible
that before this transformation, PHI nodes was selecting default
value and now it will use this new value. This is OK because it does
not change validity the program. */
break;
- case COND_EXPR:
+ case GIMPLE_COND:
/* Update destination blocks' predicate list and remove this
condition expression. */
- tree_if_convert_cond_expr (loop, t, cond, bsi);
+ tree_if_convert_cond_stmt (loop, t, cond, gsi);
cond = NULL_TREE;
break;
@@ -258,41 +260,41 @@ tree_if_convert_stmt (struct loop * loop, tree t, tree cond,
return cond;
}
-/* STMT is COND_EXPR. Update two destination's predicate list.
+/* STMT is a GIMPLE_COND. Update two destination's predicate list.
Remove COND_EXPR, if it is not the loop exit condition. Otherwise
- update loop exit condition appropriately. BSI is the iterator
+ update loop exit condition appropriately. GSI is the iterator
used to traverse statement list. STMT is part of loop LOOP. */
static void
-tree_if_convert_cond_expr (struct loop *loop, tree stmt, tree cond,
- block_stmt_iterator *bsi)
+tree_if_convert_cond_stmt (struct loop *loop, gimple stmt, tree cond,
+ gimple_stmt_iterator *gsi)
{
tree c, c2;
edge true_edge, false_edge;
- gcc_assert (TREE_CODE (stmt) == COND_EXPR);
+ gcc_assert (gimple_code (stmt) == GIMPLE_COND);
- c = COND_EXPR_COND (stmt);
+ c = fold_build2 (gimple_cond_code (stmt), boolean_type_node,
+ gimple_cond_lhs (stmt), gimple_cond_rhs (stmt));
- extract_true_false_edges_from_block (bb_for_stmt (stmt),
+ extract_true_false_edges_from_block (gimple_bb (stmt),
&true_edge, &false_edge);
/* Add new condition into destination's predicate list. */
- /* If 'c' is true then TRUE_EDGE is taken. */
- add_to_dst_predicate_list (loop, true_edge, cond,
- unshare_expr (c), bsi);
+ /* If C is true then TRUE_EDGE is taken. */
+ add_to_dst_predicate_list (loop, true_edge, cond, c, gsi);
/* If 'c' is false then FALSE_EDGE is taken. */
c2 = invert_truthvalue (unshare_expr (c));
- add_to_dst_predicate_list (loop, false_edge, cond, c2, bsi);
+ add_to_dst_predicate_list (loop, false_edge, cond, c2, gsi);
/* Now this conditional statement is redundant. Remove it.
But, do not remove exit condition! Update exit condition
using new condition. */
- if (!bb_with_exit_edge_p (loop, bb_for_stmt (stmt)))
+ if (!bb_with_exit_edge_p (loop, gimple_bb (stmt)))
{
- bsi_remove (bsi, true);
+ gsi_remove (gsi, true);
cond = NULL_TREE;
}
return;
@@ -306,22 +308,22 @@ tree_if_convert_cond_expr (struct loop *loop, tree stmt, tree cond,
- Virtual PHI on BB other than header. */
static bool
-if_convertible_phi_p (struct loop *loop, basic_block bb, tree phi)
+if_convertible_phi_p (struct loop *loop, basic_block bb, gimple phi)
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "-------------------------\n");
- print_generic_stmt (dump_file, phi, TDF_SLIM);
+ print_gimple_stmt (dump_file, phi, 0, TDF_SLIM);
}
- if (bb != loop->header && PHI_NUM_ARGS (phi) != 2)
+ if (bb != loop->header && gimple_phi_num_args (phi) != 2)
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "More than two phi node args.\n");
return false;
}
- if (!is_gimple_reg (SSA_NAME_VAR (PHI_RESULT (phi))))
+ if (!is_gimple_reg (SSA_NAME_VAR (gimple_phi_result (phi))))
{
imm_use_iterator imm_iter;
use_operand_p use_p;
@@ -332,9 +334,9 @@ if_convertible_phi_p (struct loop *loop, basic_block bb, tree phi)
fprintf (dump_file, "Virtual phi not on loop header.\n");
return false;
}
- FOR_EACH_IMM_USE_FAST (use_p, imm_iter, PHI_RESULT (phi))
+ FOR_EACH_IMM_USE_FAST (use_p, imm_iter, gimple_phi_result (phi))
{
- if (TREE_CODE (USE_STMT (use_p)) == PHI_NODE)
+ if (gimple_code (USE_STMT (use_p)) == GIMPLE_PHI)
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "Difficult to handle this virtual phi.\n");
@@ -346,37 +348,36 @@ if_convertible_phi_p (struct loop *loop, basic_block bb, tree phi)
return true;
}
-/* Return true, if M_EXPR is if-convertible.
- GIMPLE_MODIFY_STMT is not if-convertible if,
+/* Return true, if STMT is if-convertible.
+ GIMPLE_ASSIGN statement is not if-convertible if,
- It is not movable.
- It could trap.
- LHS is not var decl.
- GIMPLE_MODIFY_STMT is part of block BB, which is inside loop LOOP.
-*/
+ GIMPLE_ASSIGN is part of block BB, which is inside loop LOOP. */
static bool
-if_convertible_gimple_modify_stmt_p (struct loop *loop, basic_block bb,
- tree m_expr)
+if_convertible_gimple_assign_stmt_p (struct loop *loop, basic_block bb,
+ gimple stmt)
{
- tree lhs, rhs;
+ tree lhs;
- if (TREE_CODE (m_expr) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_assign (stmt))
return false;
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "-------------------------\n");
- print_generic_stmt (dump_file, m_expr, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
}
- lhs = GIMPLE_STMT_OPERAND (m_expr, 0);
- rhs = GIMPLE_STMT_OPERAND (m_expr, 1);
+ lhs = gimple_assign_lhs (stmt);
/* Some of these constrains might be too conservative. */
- if (stmt_ends_bb_p (m_expr) || stmt_ann (m_expr)->has_volatile_ops
+ if (stmt_ends_bb_p (stmt)
+ || gimple_has_volatile_ops (stmt)
|| (TREE_CODE (lhs) == SSA_NAME
&& SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
- || TREE_SIDE_EFFECTS (rhs))
+ || gimple_has_side_effects (stmt))
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "stmt not suitable for ifcvt\n");
@@ -385,57 +386,49 @@ if_convertible_gimple_modify_stmt_p (struct loop *loop, basic_block bb,
/* See if it needs speculative loading or not. */
if (bb != loop->header
- && tree_could_trap_p (GIMPLE_STMT_OPERAND (m_expr, 1)))
+ && gimple_assign_rhs_could_trap_p (stmt))
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "tree could trap...\n");
return false;
}
- if (TREE_CODE (GIMPLE_STMT_OPERAND (m_expr, 1)) == CALL_EXPR)
- {
- if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "CALL_EXPR \n");
- return false;
- }
-
- if (TREE_CODE (GIMPLE_STMT_OPERAND (m_expr, 0)) != SSA_NAME
+ if (TREE_CODE (lhs) != SSA_NAME
&& bb != loop->header
&& !bb_with_exit_edge_p (loop, bb))
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "LHS is not var\n");
- print_generic_stmt (dump_file, m_expr, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
}
return false;
}
-
return true;
}
/* Return true, iff STMT is if-convertible.
Statement is if-convertible if,
- - It is if-convertible GIMPLE_MODIFY_STMT
- - IT is LABEL_EXPR or COND_EXPR.
+ - It is if-convertible GIMPLE_ASSGIN
+ - It is GIMPLE_LABEL or GIMPLE_COND.
STMT is inside block BB, which is inside loop LOOP. */
static bool
-if_convertible_stmt_p (struct loop *loop, basic_block bb, tree stmt)
+if_convertible_stmt_p (struct loop *loop, basic_block bb, gimple stmt)
{
- switch (TREE_CODE (stmt))
+ switch (gimple_code (stmt))
{
- case LABEL_EXPR:
+ case GIMPLE_LABEL:
break;
- case GIMPLE_MODIFY_STMT:
+ case GIMPLE_ASSIGN:
- if (!if_convertible_gimple_modify_stmt_p (loop, bb, stmt))
+ if (!if_convertible_gimple_assign_stmt_p (loop, bb, stmt))
return false;
break;
- case COND_EXPR:
+ case GIMPLE_COND:
break;
default:
@@ -443,7 +436,7 @@ if_convertible_stmt_p (struct loop *loop, basic_block bb, tree stmt)
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "don't know what to do\n");
- print_generic_stmt (dump_file, stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
}
return false;
break;
@@ -521,9 +514,8 @@ if_convertible_bb_p (struct loop *loop, basic_block bb, basic_block exit_bb)
static bool
if_convertible_loop_p (struct loop *loop, bool for_vectorizer ATTRIBUTE_UNUSED)
{
- tree phi;
basic_block bb;
- block_stmt_iterator itr;
+ gimple_stmt_iterator itr;
unsigned int i;
edge e;
edge_iterator ei;
@@ -584,22 +576,22 @@ if_convertible_loop_p (struct loop *loop, bool for_vectorizer ATTRIBUTE_UNUSED)
return false;
/* Check statements. */
- for (itr = bsi_start (bb); !bsi_end_p (itr); bsi_next (&itr))
- if (!if_convertible_stmt_p (loop, bb, bsi_stmt (itr)))
+ for (itr = gsi_start_bb (bb); !gsi_end_p (itr); gsi_next (&itr))
+ if (!if_convertible_stmt_p (loop, bb, gsi_stmt (itr)))
return false;
/* ??? Check data dependency for vectorizer. */
/* What about phi nodes ? */
- phi = phi_nodes (bb);
+ itr = gsi_start_phis (bb);
/* Clear aux field of incoming edges to a bb with a phi node. */
- if (phi)
+ if (!gsi_end_p (itr))
FOR_EACH_EDGE (e, ei, bb->preds)
e->aux = NULL;
/* Check statements. */
- for (; phi; phi = PHI_CHAIN (phi))
- if (!if_convertible_phi_p (loop, bb, phi))
+ for (; !gsi_end_p (itr); gsi_next (&itr))
+ if (!if_convertible_phi_p (loop, bb, gsi_stmt (itr)))
return false;
if (bb_with_exit_edge_p (loop, bb))
@@ -637,7 +629,7 @@ add_to_predicate_list (basic_block bb, tree new_cond)
static tree
add_to_dst_predicate_list (struct loop * loop, edge e,
tree prev_cond, tree cond,
- block_stmt_iterator *bsi)
+ gimple_stmt_iterator *gsi)
{
tree new_cond = NULL_TREE;
@@ -649,13 +641,13 @@ add_to_dst_predicate_list (struct loop * loop, edge e,
else
{
tree tmp;
- tree tmp_stmt = NULL_TREE;
+ gimple tmp_stmt = NULL;
- prev_cond = force_gimple_operand_bsi (bsi, unshare_expr (prev_cond),
- true, NULL, true, BSI_SAME_STMT);
+ prev_cond = force_gimple_operand_gsi (gsi, unshare_expr (prev_cond),
+ true, NULL, true, GSI_SAME_STMT);
- cond = force_gimple_operand_bsi (bsi, unshare_expr (cond),
- true, NULL, true, BSI_SAME_STMT);
+ cond = force_gimple_operand_gsi (gsi, unshare_expr (cond),
+ true, NULL, true, GSI_SAME_STMT);
/* Add the condition to aux field of the edge. In case edge
destination is a PHI node, this condition will be ANDed with
@@ -666,8 +658,8 @@ add_to_dst_predicate_list (struct loop * loop, edge e,
tmp = build2 (TRUTH_AND_EXPR, boolean_type_node,
unshare_expr (prev_cond), cond);
tmp_stmt = ifc_temp_var (boolean_type_node, tmp);
- bsi_insert_before (bsi, tmp_stmt, BSI_SAME_STMT);
- new_cond = GIMPLE_STMT_OPERAND (tmp_stmt, 0);
+ gsi_insert_before (gsi, tmp_stmt, GSI_SAME_STMT);
+ new_cond = gimple_assign_lhs (tmp_stmt);
}
add_to_predicate_list (e->dest, new_cond);
return new_cond;
@@ -703,7 +695,7 @@ clean_predicate_lists (struct loop *loop)
static basic_block
find_phi_replacement_condition (struct loop *loop,
basic_block bb, tree *cond,
- block_stmt_iterator *bsi)
+ gimple_stmt_iterator *gsi)
{
edge first_edge, second_edge;
tree tmp_cond;
@@ -788,16 +780,16 @@ find_phi_replacement_condition (struct loop *loop,
condition in vector compare operation. Using gimple value allows
compiler to emit vector compare and select RTL without exposing
compare's result. */
- *cond = force_gimple_operand_bsi (bsi, unshare_expr (*cond),
+ *cond = force_gimple_operand_gsi (gsi, unshare_expr (*cond),
false, NULL_TREE,
- true, BSI_SAME_STMT);
+ true, GSI_SAME_STMT);
if (!is_gimple_reg (*cond) && !is_gimple_condexpr (*cond))
{
- tree new_stmt;
+ gimple new_stmt;
new_stmt = ifc_temp_var (TREE_TYPE (*cond), unshare_expr (*cond));
- bsi_insert_before (bsi, new_stmt, BSI_SAME_STMT);
- *cond = GIMPLE_STMT_OPERAND (new_stmt, 0);
+ gsi_insert_before (gsi, new_stmt, GSI_SAME_STMT);
+ *cond = gimple_assign_lhs (new_stmt);
}
gcc_assert (*cond);
@@ -817,33 +809,33 @@ find_phi_replacement_condition (struct loop *loop,
*/
static void
-replace_phi_with_cond_gimple_modify_stmt (tree phi, tree cond,
+replace_phi_with_cond_gimple_assign_stmt (gimple phi, tree cond,
basic_block true_bb,
- block_stmt_iterator *bsi)
+ gimple_stmt_iterator *gsi)
{
- tree new_stmt;
+ gimple new_stmt;
basic_block bb;
tree rhs;
tree arg_0, arg_1;
- gcc_assert (TREE_CODE (phi) == PHI_NODE);
+ gcc_assert (gimple_code (phi) == GIMPLE_PHI);
/* If this is not filtered earlier, then now it is too late. */
- gcc_assert (PHI_NUM_ARGS (phi) == 2);
+ gcc_assert (gimple_phi_num_args (phi) == 2);
/* Find basic block and initialize iterator. */
- bb = bb_for_stmt (phi);
+ bb = gimple_bb (phi);
/* Use condition that is not TRUTH_NOT_EXPR in conditional modify expr. */
if (EDGE_PRED (bb, 1)->src == true_bb)
{
- arg_0 = PHI_ARG_DEF (phi, 1);
- arg_1 = PHI_ARG_DEF (phi, 0);
+ arg_0 = gimple_phi_arg_def (phi, 1);
+ arg_1 = gimple_phi_arg_def (phi, 0);
}
else
{
- arg_0 = PHI_ARG_DEF (phi, 0);
- arg_1 = PHI_ARG_DEF (phi, 1);
+ arg_0 = gimple_phi_arg_def (phi, 0);
+ arg_1 = gimple_phi_arg_def (phi, 1);
}
/* Build new RHS using selected condition and arguments. */
@@ -851,20 +843,20 @@ replace_phi_with_cond_gimple_modify_stmt (tree phi, tree cond,
unshare_expr (cond), unshare_expr (arg_0),
unshare_expr (arg_1));
- /* Create new MODIFY expression using RHS. */
- new_stmt = build_gimple_modify_stmt (unshare_expr (PHI_RESULT (phi)), rhs);
+ /* Create new GIMPLE_ASSIGN statement using RHS. */
+ new_stmt = gimple_build_assign (unshare_expr (PHI_RESULT (phi)), rhs);
/* Make new statement definition of the original phi result. */
- SSA_NAME_DEF_STMT (PHI_RESULT (phi)) = new_stmt;
+ SSA_NAME_DEF_STMT (gimple_phi_result (phi)) = new_stmt;
/* Insert using iterator. */
- bsi_insert_before (bsi, new_stmt, BSI_SAME_STMT);
+ gsi_insert_before (gsi, new_stmt, GSI_SAME_STMT);
update_stmt (new_stmt);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "new phi replacement stmt\n");
- print_generic_stmt (dump_file, new_stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, new_stmt, 0, TDF_SLIM);
}
}
@@ -881,30 +873,31 @@ process_phi_nodes (struct loop *loop)
/* Replace phi nodes with cond. modify expr. */
for (i = 1; i < orig_loop_num_nodes; i++)
{
- tree phi, cond = NULL_TREE;
- block_stmt_iterator bsi;
+ gimple phi;
+ tree cond = NULL_TREE;
+ gimple_stmt_iterator gsi, phi_gsi;
basic_block true_bb = NULL;
bb = ifc_bbs[i];
if (bb == loop->header)
continue;
- phi = phi_nodes (bb);
- bsi = bsi_after_labels (bb);
+ phi_gsi = gsi_start_phis (bb);
+ gsi = gsi_after_labels (bb);
/* BB has two predecessors. Using predecessor's aux field, set
appropriate condition for the PHI node replacement. */
- if (phi)
- true_bb = find_phi_replacement_condition (loop, bb, &cond, &bsi);
+ if (!gsi_end_p (phi_gsi))
+ true_bb = find_phi_replacement_condition (loop, bb, &cond, &gsi);
- while (phi)
+ while (!gsi_end_p (phi_gsi))
{
- tree next = PHI_CHAIN (phi);
- replace_phi_with_cond_gimple_modify_stmt (phi, cond, true_bb, &bsi);
+ phi = gsi_stmt (phi_gsi);
+ replace_phi_with_cond_gimple_assign_stmt (phi, cond, true_bb, &gsi);
release_phi_node (phi);
- phi = next;
+ gsi_next (&phi_gsi);
}
- set_phi_nodes (bb, NULL_TREE);
+ set_phi_nodes (bb, NULL);
}
return;
}
@@ -978,8 +971,8 @@ combine_blocks (struct loop *loop)
merge_target_bb = loop->header;
for (i = 1; i < orig_loop_num_nodes; i++)
{
- block_stmt_iterator bsi;
- tree_stmt_iterator last;
+ gimple_stmt_iterator gsi;
+ gimple_stmt_iterator last;
bb = ifc_bbs[i];
@@ -987,21 +980,21 @@ combine_blocks (struct loop *loop)
continue;
/* Remove labels and make stmts member of loop->header. */
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); )
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); )
{
- if (TREE_CODE (bsi_stmt (bsi)) == LABEL_EXPR)
- bsi_remove (&bsi, true);
+ if (gimple_code (gsi_stmt (gsi)) == GIMPLE_LABEL)
+ gsi_remove (&gsi, true);
else
{
- set_bb_for_stmt (bsi_stmt (bsi), merge_target_bb);
- bsi_next (&bsi);
+ gimple_set_bb (gsi_stmt (gsi), merge_target_bb);
+ gsi_next (&gsi);
}
}
/* Update stmt list. */
- last = tsi_last (bb_stmt_list (merge_target_bb));
- tsi_link_after (&last, bb_stmt_list (bb), TSI_NEW_STMT);
- set_bb_stmt_list (bb, alloc_stmt_list());
+ last = gsi_last_bb (merge_target_bb);
+ gsi_insert_seq_after (&last, bb_seq (bb), GSI_NEW_STMT);
+ set_bb_seq (bb, NULL);
delete_basic_block (bb);
}
@@ -1015,30 +1008,29 @@ combine_blocks (struct loop *loop)
merge_blocks (loop->header, exit_bb);
}
-/* Make new temp variable of type TYPE. Add GIMPLE_MODIFY_STMT to assign EXP
+/* Make a new temp variable of type TYPE. Add GIMPLE_ASSIGN to assign EXP
to the new variable. */
-static tree
+static gimple
ifc_temp_var (tree type, tree exp)
{
const char *name = "_ifc_";
- tree var, stmt, new_name;
-
- if (is_gimple_reg (exp))
- return exp;
+ tree var, new_name;
+ gimple stmt;
/* Create new temporary variable. */
var = create_tmp_var (type, name);
add_referenced_var (var);
/* Build new statement to assign EXP to new variable. */
- stmt = build_gimple_modify_stmt (var, exp);
+ stmt = gimple_build_assign (var, exp);
/* Get SSA name for the new variable and set make new statement
its definition statement. */
new_name = make_ssa_name (var, stmt);
- GIMPLE_STMT_OPERAND (stmt, 0) = new_name;
+ gimple_assign_set_lhs (stmt, new_name);
SSA_NAME_DEF_STMT (new_name) = stmt;
+ update_stmt (stmt);
return stmt;
}
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 9d827ff9261..e38ef3a8d4e 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -56,13 +56,13 @@ along with GCC; see the file COPYING3. If not see
/* I'm not real happy about this, but we need to handle gimple and
non-gimple trees. */
-#include "tree-gimple.h"
+#include "gimple.h"
/* Inlining, Cloning, Versioning, Parallelization
Inlining: a function body is duplicated, but the PARM_DECLs are
remapped into VAR_DECLs, and non-void RETURN_EXPRs become
- GIMPLE_MODIFY_STMTs that store to a dedicated returned-value variable.
+ MODIFY_EXPRs that store to a dedicated returned-value variable.
The duplicated eh_region info of the copy will later be appended
to the info for the caller; the eh_region info in copied throwing
statements and RESX_EXPRs is adjusted accordingly.
@@ -88,14 +88,7 @@ along with GCC; see the file COPYING3. If not see
updated to point into the new body. (Note that the original
callgraph node and edge list will not be altered.)
- See the CALL_EXPR handling case in copy_body_r (). */
-
-/* 0 if we should not perform inlining.
- 1 if we should expand functions calls inline at the tree level.
- 2 if we should consider *all* functions to be inline
- candidates. */
-
-int flag_inline_trees = 0;
+ See the CALL_EXPR handling case in copy_tree_body_r (). */
/* To Do:
@@ -140,6 +133,7 @@ static void add_lexical_block (tree current_block, tree new_block);
static tree copy_decl_to_var (tree, copy_body_data *);
static tree copy_result_decl_to_var (tree, copy_body_data *);
static tree copy_decl_maybe_to_var (tree, copy_body_data *);
+static gimple remap_gimple_stmt (gimple, copy_body_data *);
/* Insert a tree->tree mapping for ID. Despite the name suggests
that the trees should be variables, it is used for more than that. */
@@ -160,70 +154,72 @@ 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.
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));
- if (IS_EMPTY_STMT (SSA_NAME_DEF_STMT (name)))
+ 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
extend the lifetime (variable might get reused). This cause
ICE in the case we end up extending lifetime of SSA name across
abnormal edge, but also increase register pressure.
- We simply initialize all uninitialized vars by 0 except for case
- we are inlining to very first BB. We can avoid this for all
- BBs that are not withing strongly connected regions of the CFG,
- but this is bit expensive to test.
- */
- if (id->entry_bb && is_gimple_reg (SSA_NAME_VAR (name))
+ We simply initialize all uninitialized vars by 0 except
+ for case we are inlining to very first BB. We can avoid
+ this for all BBs that are not inside strongly connected
+ regions of the CFG, but this is expensive to test. */
+ if (id->entry_bb
+ && is_gimple_reg (SSA_NAME_VAR (name))
&& TREE_CODE (SSA_NAME_VAR (name)) != PARM_DECL
&& (id->entry_bb != EDGE_SUCC (ENTRY_BLOCK_PTR, 0)->dest
|| EDGE_COUNT (id->entry_bb->preds) != 1))
{
- block_stmt_iterator bsi = bsi_last (id->entry_bb);
- tree init_stmt
- = build_gimple_modify_stmt (new,
- fold_convert (TREE_TYPE (new),
+ gimple_stmt_iterator gsi = gsi_last_bb (id->entry_bb);
+ gimple init_stmt;
+
+ init_stmt = gimple_build_assign (new_tree,
+ fold_convert (TREE_TYPE (new_tree),
integer_zero_node));
- bsi_insert_after (&bsi, init_stmt, BSI_NEW_STMT);
- SSA_NAME_DEF_STMT (new) = init_stmt;
- SSA_NAME_IS_DEFAULT_DEF (new) = 0;
+ gsi_insert_after (&gsi, init_stmt, GSI_NEW_STMT);
+ SSA_NAME_IS_DEFAULT_DEF (new_tree) = 0;
}
else
{
- SSA_NAME_DEF_STMT (new) = build_empty_stmt ();
- if (gimple_default_def (id->src_cfun, SSA_NAME_VAR (name)) == name)
- set_default_def (SSA_NAME_VAR (new), new);
+ 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_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. */
@@ -262,15 +258,15 @@ remap_decl (tree decl, copy_body_data *id)
DECL_ORIGINAL_TYPE (t) = remap_type (DECL_ORIGINAL_TYPE (t), id);
/* Remap sizes as necessary. */
- walk_tree (&DECL_SIZE (t), copy_body_r, id, NULL);
- walk_tree (&DECL_SIZE_UNIT (t), copy_body_r, id, NULL);
+ walk_tree (&DECL_SIZE (t), copy_tree_body_r, id, NULL);
+ walk_tree (&DECL_SIZE_UNIT (t), copy_tree_body_r, id, NULL);
/* If fields, do likewise for offset and qualifier. */
if (TREE_CODE (t) == FIELD_DECL)
{
- walk_tree (&DECL_FIELD_OFFSET (t), copy_body_r, id, NULL);
+ walk_tree (&DECL_FIELD_OFFSET (t), copy_tree_body_r, id, NULL);
if (TREE_CODE (DECL_CONTEXT (t)) == QUAL_UNION_TYPE)
- walk_tree (&DECL_QUALIFIER (t), copy_body_r, id, NULL);
+ walk_tree (&DECL_QUALIFIER (t), copy_tree_body_r, id, NULL);
}
if (cfun && gimple_in_ssa_p (cfun)
@@ -285,7 +281,7 @@ remap_decl (tree decl, copy_body_data *id)
/* Watch out RESULT_DECLs whose SSA names map directly
to them. */
if (TREE_CODE (map) == SSA_NAME
- && IS_EMPTY_STMT (SSA_NAME_DEF_STMT (map)))
+ && gimple_nop_p (SSA_NAME_DEF_STMT (map)))
set_default_def (t, map);
}
add_referenced_var (t);
@@ -299,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. */
@@ -331,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_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_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_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:
@@ -380,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;
@@ -397,10 +393,10 @@ remap_type_1 (tree type, copy_body_data *id)
gcc_unreachable ();
}
- walk_tree (&TYPE_SIZE (new), copy_body_r, id, NULL);
- walk_tree (&TYPE_SIZE_UNIT (new), copy_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
@@ -442,9 +438,10 @@ remap_decls (tree decls, copy_body_data *id)
{
tree new_var;
- /* We can not chain the local static declarations into the local_decls
- as we can't duplicate them or break one decl rule. Go ahead and link
- them into local_decls. */
+ /* We cannot chain the local static declarations into the local_decls
+ as we can't duplicate them or break one decl rule. Go ahead
+ and link them into local_decls. */
+
if (!auto_var_in_fn_p (old_var, id->src_fn)
&& !DECL_EXTERNAL (old_var))
{
@@ -456,7 +453,7 @@ remap_decls (tree decls, copy_body_data *id)
/* Remap the variable. */
new_var = remap_decl (old_var, id);
- /* If we didn't remap this variable, so we can't mess with its
+ /* If we didn't remap this variable, we can't mess with its
TREE_CHAIN. If we remapped this variable to the return slot, it's
already declared somewhere else, so don't declare it here. */
if (!new_var || new_var == id->retvar)
@@ -507,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);
@@ -552,11 +549,234 @@ copy_bind_expr (tree *tp, int *walk_subtrees, copy_body_data *id)
BIND_EXPR_VARS (*tp) = remap_decls (BIND_EXPR_VARS (*tp), id);
}
-/* Called from copy_body_id via walk_tree. DATA is really an
+
+/* Create a new gimple_seq by remapping all the statements in BODY
+ using the inlining information in ID. */
+
+gimple_seq
+remap_gimple_seq (gimple_seq body, copy_body_data *id)
+{
+ gimple_stmt_iterator si;
+ gimple_seq new_body = NULL;
+
+ for (si = gsi_start (body); !gsi_end_p (si); gsi_next (&si))
+ {
+ gimple new_stmt = remap_gimple_stmt (gsi_stmt (si), id);
+ gimple_seq_add_stmt (&new_body, new_stmt);
+ }
+
+ return new_body;
+}
+
+
+/* Copy a GIMPLE_BIND statement STMT, remapping all the symbols in its
+ block using the mapping information in ID. */
+
+static gimple
+copy_gimple_bind (gimple stmt, copy_body_data *id)
+{
+ gimple new_bind;
+ tree new_block, new_vars;
+ gimple_seq body, new_body;
+
+ /* Copy the statement. Note that we purposely don't use copy_stmt
+ here because we need to remap statements as we copy. */
+ body = gimple_bind_body (stmt);
+ new_body = remap_gimple_seq (body, id);
+
+ new_block = gimple_bind_block (stmt);
+ if (new_block)
+ remap_block (&new_block, id);
+
+ /* This will remap a lot of the same decls again, but this should be
+ harmless. */
+ new_vars = gimple_bind_vars (stmt);
+ if (new_vars)
+ new_vars = remap_decls (new_vars, id);
+
+ new_bind = gimple_build_bind (new_vars, new_body, new_block);
+
+ return new_bind;
+}
+
+
+/* Remap the GIMPLE operand pointed to by *TP. DATA is really a
+ 'struct walk_stmt_info *'. DATA->INFO is a 'copy_body_data *'.
+ WALK_SUBTREES is used to indicate walk_gimple_op whether to keep
+ recursing into the children nodes of *TP. */
+
+static tree
+remap_gimple_op_r (tree *tp, int *walk_subtrees, void *data)
+{
+ struct walk_stmt_info *wi_p = (struct walk_stmt_info *) data;
+ copy_body_data *id = (copy_body_data *) wi_p->info;
+ tree fn = id->src_fn;
+
+ if (TREE_CODE (*tp) == SSA_NAME)
+ {
+ *tp = remap_ssa_name (*tp, id);
+ *walk_subtrees = 0;
+ return NULL;
+ }
+ else if (auto_var_in_fn_p (*tp, fn))
+ {
+ /* Local variables and labels need to be replaced by equivalent
+ variables. We don't want to copy static variables; there's
+ only one of those, no matter how many times we inline the
+ containing function. Similarly for globals from an outer
+ function. */
+ tree new_decl;
+
+ /* Remap the declaration. */
+ new_decl = remap_decl (*tp, id);
+ gcc_assert (new_decl);
+ /* Replace this variable with the copy. */
+ STRIP_TYPE_NOPS (new_decl);
+ *tp = new_decl;
+ *walk_subtrees = 0;
+ }
+ else if (TREE_CODE (*tp) == STATEMENT_LIST)
+ gcc_unreachable ();
+ else if (TREE_CODE (*tp) == SAVE_EXPR)
+ gcc_unreachable ();
+ else if (TREE_CODE (*tp) == LABEL_DECL
+ && (!DECL_CONTEXT (*tp)
+ || decl_function_context (*tp) == id->src_fn))
+ /* These may need to be remapped for EH handling. */
+ *tp = remap_decl (*tp, id);
+ else if (TYPE_P (*tp))
+ /* Types may need remapping as well. */
+ *tp = remap_type (*tp, id);
+ else if (CONSTANT_CLASS_P (*tp))
+ {
+ /* If this is a constant, we have to copy the node iff the type
+ will be remapped. copy_tree_r will not copy a constant. */
+ tree new_type = remap_type (TREE_TYPE (*tp), id);
+
+ if (new_type == TREE_TYPE (*tp))
+ *walk_subtrees = 0;
+
+ else if (TREE_CODE (*tp) == INTEGER_CST)
+ *tp = build_int_cst_wide (new_type, TREE_INT_CST_LOW (*tp),
+ TREE_INT_CST_HIGH (*tp));
+ else
+ {
+ *tp = copy_node (*tp);
+ TREE_TYPE (*tp) = new_type;
+ }
+ }
+ else
+ {
+ /* Otherwise, just copy the node. Note that copy_tree_r already
+ knows not to copy VAR_DECLs, etc., so this is safe. */
+ if (TREE_CODE (*tp) == INDIRECT_REF)
+ {
+ /* Get rid of *& from inline substitutions that can happen when a
+ pointer argument is an ADDR_EXPR. */
+ tree decl = TREE_OPERAND (*tp, 0);
+ tree *n;
+
+ n = (tree *) pointer_map_contains (id->decl_map, decl);
+ if (n)
+ {
+ 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
+ which lie about their types pointed to. In this case
+ build_fold_indirect_ref wouldn't strip the
+ INDIRECT_REF, but we absolutely rely on that. As
+ fold_indirect_ref does other useful transformations,
+ try that first, though. */
+ type = TREE_TYPE (TREE_TYPE (*n));
+ new_tree = unshare_expr (*n);
+ old = *tp;
+ *tp = gimple_fold_indirect_ref (new_tree);
+ if (!*tp)
+ {
+ if (TREE_CODE (new_tree) == ADDR_EXPR)
+ {
+ *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_tree, 0);
+ }
+ else
+ {
+ *tp = build1 (INDIRECT_REF, type, new_tree);
+ TREE_THIS_VOLATILE (*tp) = TREE_THIS_VOLATILE (old);
+ }
+ }
+ *walk_subtrees = 0;
+ return NULL;
+ }
+ }
+
+ /* Here is the "usual case". Copy this tree node, and then
+ tweak some special cases. */
+ copy_tree_r (tp, walk_subtrees, NULL);
+
+ /* Global variables we haven't seen yet need to go into referenced
+ vars. If not referenced from types only. */
+ if (gimple_in_ssa_p (cfun)
+ && TREE_CODE (*tp) == VAR_DECL
+ && id->remapping_type_depth == 0)
+ add_referenced_var (*tp);
+
+ /* We should never have TREE_BLOCK set on non-statements. */
+ if (EXPR_P (*tp))
+ gcc_assert (!TREE_BLOCK (*tp));
+
+ if (TREE_CODE (*tp) != OMP_CLAUSE)
+ TREE_TYPE (*tp) = remap_type (TREE_TYPE (*tp), id);
+
+ if (TREE_CODE (*tp) == TARGET_EXPR && TREE_OPERAND (*tp, 3))
+ {
+ /* The copied TARGET_EXPR has never been expanded, even if the
+ original node was expanded already. */
+ TREE_OPERAND (*tp, 1) = TREE_OPERAND (*tp, 3);
+ TREE_OPERAND (*tp, 3) = NULL_TREE;
+ }
+ else if (TREE_CODE (*tp) == ADDR_EXPR)
+ {
+ /* Variable substitution need not be simple. In particular,
+ the INDIRECT_REF substitution above. Make sure that
+ TREE_CONSTANT and friends are up-to-date. But make sure
+ to not improperly set TREE_BLOCK on some sub-expressions. */
+ int invariant = is_gimple_min_invariant (*tp);
+ tree block = id->block;
+ id->block = NULL_TREE;
+ walk_tree (&TREE_OPERAND (*tp, 0), copy_tree_body_r, id, NULL);
+ id->block = block;
+
+ /* Handle the case where we substituted an INDIRECT_REF
+ into the operand of the ADDR_EXPR. */
+ if (TREE_CODE (TREE_OPERAND (*tp, 0)) == INDIRECT_REF)
+ *tp = TREE_OPERAND (TREE_OPERAND (*tp, 0), 0);
+ else
+ recompute_tree_invariant_for_addr_expr (*tp);
+
+ /* If this used to be invariant, but is not any longer,
+ then regimplification is probably needed. */
+ if (invariant && !is_gimple_min_invariant (*tp))
+ id->regimplify = true;
+
+ *walk_subtrees = 0;
+ }
+ }
+
+ /* Keep iterating. */
+ return NULL_TREE;
+}
+
+
+/* Called from copy_body_id via walk_tree. DATA is really a
`copy_body_data *'. */
tree
-copy_body_r (tree *tp, int *walk_subtrees, void *data)
+copy_tree_body_r (tree *tp, int *walk_subtrees, void *data)
{
copy_body_data *id = (copy_body_data *) data;
tree fn = id->src_fn;
@@ -569,7 +789,7 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
duplicated and/or tweaked. */
/* When requested, RETURN_EXPRs should be transformed to just the
- contained GIMPLE_MODIFY_STMT. The branch semantics of the return will
+ contained MODIFY_EXPR. The branch semantics of the return will
be handled elsewhere by manipulating the CFG rather than a statement. */
if (TREE_CODE (*tp) == RETURN_EXPR && id->transform_return_to_modify)
{
@@ -580,10 +800,10 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
If the "assignment" is just the result decl, the result
decl has already been set (e.g. a recent "foo (&result_decl,
...)"); just toss the entire RETURN_EXPR. */
- if (assignment && TREE_CODE (assignment) == GIMPLE_MODIFY_STMT)
+ if (assignment && TREE_CODE (assignment) == MODIFY_EXPR)
{
/* Replace the RETURN_EXPR with (a copy of) the
- GIMPLE_MODIFY_STMT hanging underneath. */
+ MODIFY_EXPR hanging underneath. */
*tp = copy_node (assignment);
}
else /* Else the RETURN_EXPR returns no value. */
@@ -656,14 +876,14 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
/* Here we handle trees that are not completely rewritten.
First we detect some inlining-induced bogosities for
discarding. */
- if (TREE_CODE (*tp) == GIMPLE_MODIFY_STMT
- && GIMPLE_STMT_OPERAND (*tp, 0) == GIMPLE_STMT_OPERAND (*tp, 1)
- && (auto_var_in_fn_p (GIMPLE_STMT_OPERAND (*tp, 0), fn)))
+ if (TREE_CODE (*tp) == MODIFY_EXPR
+ && TREE_OPERAND (*tp, 0) == TREE_OPERAND (*tp, 1)
+ && (auto_var_in_fn_p (TREE_OPERAND (*tp, 0), fn)))
{
/* Some assignments VAR = VAR; don't generate any rtl code
and thus don't count as variable modification. Avoid
keeping bogosities like 0 = 0. */
- tree decl = GIMPLE_STMT_OPERAND (*tp, 0), value;
+ tree decl = TREE_OPERAND (*tp, 0), value;
tree *n;
n = (tree *) pointer_map_contains (id->decl_map, decl);
@@ -674,7 +894,7 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
if (TREE_CONSTANT (value) || TREE_READONLY (value))
{
*tp = build_empty_stmt ();
- return copy_body_r (tp, walk_subtrees, data);
+ return copy_tree_body_r (tp, walk_subtrees, data);
}
}
}
@@ -688,7 +908,7 @@ copy_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
@@ -697,23 +917,23 @@ copy_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);
}
@@ -729,14 +949,15 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
/* Global variables we haven't seen yet needs to go into referenced
vars. If not referenced from types only. */
- if (gimple_in_ssa_p (cfun) && TREE_CODE (*tp) == VAR_DECL
+ if (gimple_in_ssa_p (cfun)
+ && TREE_CODE (*tp) == VAR_DECL
&& id->remapping_type_depth == 0)
add_referenced_var (*tp);
/* If EXPR has block defined, map it to newly constructed block.
When inlining we want EXPRs without block appear in the block
of function call. */
- if (EXPR_P (*tp) || GIMPLE_STMT_P (*tp))
+ if (EXPR_P (*tp))
{
new_block = id->block;
if (TREE_BLOCK (*tp))
@@ -752,11 +973,11 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
if (TREE_CODE (*tp) == RESX_EXPR && id->eh_region_offset)
TREE_OPERAND (*tp, 0) =
- build_int_cst
- (NULL_TREE,
- id->eh_region_offset + TREE_INT_CST_LOW (TREE_OPERAND (*tp, 0)));
+ build_int_cst (NULL_TREE,
+ id->eh_region_offset
+ + TREE_INT_CST_LOW (TREE_OPERAND (*tp, 0)));
- if (!GIMPLE_TUPLE_P (*tp) && TREE_CODE (*tp) != OMP_CLAUSE)
+ if (TREE_CODE (*tp) != OMP_CLAUSE)
TREE_TYPE (*tp) = remap_type (TREE_TYPE (*tp), id);
/* The copied TARGET_EXPR has never been expanded, even if the
@@ -773,17 +994,20 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
else if (TREE_CODE (*tp) == ADDR_EXPR)
{
int invariant = is_gimple_min_invariant (*tp);
- walk_tree (&TREE_OPERAND (*tp, 0), copy_body_r, id, NULL);
+ walk_tree (&TREE_OPERAND (*tp, 0), copy_tree_body_r, id, NULL);
+
/* Handle the case where we substituted an INDIRECT_REF
into the operand of the ADDR_EXPR. */
if (TREE_CODE (TREE_OPERAND (*tp, 0)) == INDIRECT_REF)
*tp = TREE_OPERAND (TREE_OPERAND (*tp, 0), 0);
else
recompute_tree_invariant_for_addr_expr (*tp);
+
/* If this used to be invariant, but is not any longer,
then regimplification is probably needed. */
if (invariant && !is_gimple_min_invariant (*tp))
id->regimplify = true;
+
*walk_subtrees = 0;
}
}
@@ -792,6 +1016,209 @@ copy_body_r (tree *tp, int *walk_subtrees, void *data)
return NULL_TREE;
}
+
+/* Helper for copy_bb. Remap statement STMT using the inlining
+ information in ID. Return the new statement copy. */
+
+static gimple
+remap_gimple_stmt (gimple stmt, copy_body_data *id)
+{
+ gimple copy = NULL;
+ struct walk_stmt_info wi;
+ tree new_block;
+
+ /* Begin by recognizing trees that we'll completely rewrite for the
+ inlining context. Our output for these trees is completely
+ different from out input (e.g. RETURN_EXPR is deleted, and morphs
+ into an edge). Further down, we'll handle trees that get
+ duplicated and/or tweaked. */
+
+ /* When requested, GIMPLE_RETURNs should be transformed to just the
+ contained GIMPLE_ASSIGN. The branch semantics of the return will
+ be handled elsewhere by manipulating the CFG rather than the
+ statement. */
+ if (gimple_code (stmt) == GIMPLE_RETURN && id->transform_return_to_modify)
+ {
+ tree retval = gimple_return_retval (stmt);
+
+ /* If we're returning something, just turn that into an
+ assignment into the equivalent of the original RESULT_DECL.
+ If RETVAL is just the result decl, the result decl has
+ already been set (e.g. a recent "foo (&result_decl, ...)");
+ just toss the entire GIMPLE_RETURN. */
+ if (retval && TREE_CODE (retval) != RESULT_DECL)
+ copy = gimple_build_assign (id->retvar, retval);
+ else
+ return gimple_build_nop ();
+ }
+ else if (gimple_has_substatements (stmt))
+ {
+ gimple_seq s1, s2;
+
+ /* When cloning bodies from the C++ front end, we will be handed bodies
+ in High GIMPLE form. Handle here all the High GIMPLE statements that
+ have embedded statements. */
+ switch (gimple_code (stmt))
+ {
+ case GIMPLE_BIND:
+ copy = copy_gimple_bind (stmt, id);
+ break;
+
+ case GIMPLE_CATCH:
+ s1 = remap_gimple_seq (gimple_catch_handler (stmt), id);
+ copy = gimple_build_catch (gimple_catch_types (stmt), s1);
+ break;
+
+ case GIMPLE_EH_FILTER:
+ s1 = remap_gimple_seq (gimple_eh_filter_failure (stmt), id);
+ copy = gimple_build_eh_filter (gimple_eh_filter_types (stmt), s1);
+ break;
+
+ case GIMPLE_TRY:
+ s1 = remap_gimple_seq (gimple_try_eval (stmt), id);
+ s2 = remap_gimple_seq (gimple_try_cleanup (stmt), id);
+ copy = gimple_build_try (s1, s2, gimple_try_kind (stmt));
+ break;
+
+ case GIMPLE_WITH_CLEANUP_EXPR:
+ s1 = remap_gimple_seq (gimple_wce_cleanup (stmt), id);
+ copy = gimple_build_wce (s1);
+ break;
+
+ case GIMPLE_OMP_PARALLEL:
+ s1 = remap_gimple_seq (gimple_omp_body (stmt), id);
+ copy = gimple_build_omp_parallel
+ (s1,
+ gimple_omp_parallel_clauses (stmt),
+ gimple_omp_parallel_child_fn (stmt),
+ gimple_omp_parallel_data_arg (stmt));
+ break;
+
+ case GIMPLE_OMP_TASK:
+ s1 = remap_gimple_seq (gimple_omp_body (stmt), id);
+ copy = gimple_build_omp_task
+ (s1,
+ gimple_omp_task_clauses (stmt),
+ gimple_omp_task_child_fn (stmt),
+ gimple_omp_task_data_arg (stmt),
+ gimple_omp_task_copy_fn (stmt),
+ gimple_omp_task_arg_size (stmt),
+ gimple_omp_task_arg_align (stmt));
+ break;
+
+ case GIMPLE_OMP_FOR:
+ s1 = remap_gimple_seq (gimple_omp_body (stmt), id);
+ s2 = remap_gimple_seq (gimple_omp_for_pre_body (stmt), id);
+ copy = gimple_build_omp_for (s1, gimple_omp_for_clauses (stmt),
+ gimple_omp_for_collapse (stmt), s2);
+ {
+ size_t i;
+ for (i = 0; i < gimple_omp_for_collapse (stmt); i++)
+ {
+ gimple_omp_for_set_index (copy, i,
+ gimple_omp_for_index (stmt, i));
+ gimple_omp_for_set_initial (copy, i,
+ gimple_omp_for_initial (stmt, i));
+ gimple_omp_for_set_final (copy, i,
+ gimple_omp_for_final (stmt, i));
+ gimple_omp_for_set_incr (copy, i,
+ gimple_omp_for_incr (stmt, i));
+ gimple_omp_for_set_cond (copy, i,
+ gimple_omp_for_cond (stmt, i));
+ }
+ }
+ break;
+
+ case GIMPLE_OMP_MASTER:
+ s1 = remap_gimple_seq (gimple_omp_body (stmt), id);
+ copy = gimple_build_omp_master (s1);
+ break;
+
+ case GIMPLE_OMP_ORDERED:
+ s1 = remap_gimple_seq (gimple_omp_body (stmt), id);
+ copy = gimple_build_omp_ordered (s1);
+ break;
+
+ case GIMPLE_OMP_SECTION:
+ s1 = remap_gimple_seq (gimple_omp_body (stmt), id);
+ copy = gimple_build_omp_section (s1);
+ break;
+
+ case GIMPLE_OMP_SECTIONS:
+ s1 = remap_gimple_seq (gimple_omp_body (stmt), id);
+ copy = gimple_build_omp_sections
+ (s1, gimple_omp_sections_clauses (stmt));
+ break;
+
+ case GIMPLE_OMP_SINGLE:
+ s1 = remap_gimple_seq (gimple_omp_body (stmt), id);
+ copy = gimple_build_omp_single
+ (s1, gimple_omp_single_clauses (stmt));
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+ }
+ else
+ {
+ if (gimple_assign_copy_p (stmt)
+ && gimple_assign_lhs (stmt) == gimple_assign_rhs1 (stmt)
+ && auto_var_in_fn_p (gimple_assign_lhs (stmt), id->src_fn))
+ {
+ /* Here we handle statements that are not completely rewritten.
+ First we detect some inlining-induced bogosities for
+ discarding. */
+
+ /* Some assignments VAR = VAR; don't generate any rtl code
+ and thus don't count as variable modification. Avoid
+ keeping bogosities like 0 = 0. */
+ tree decl = gimple_assign_lhs (stmt), value;
+ tree *n;
+
+ n = (tree *) pointer_map_contains (id->decl_map, decl);
+ if (n)
+ {
+ value = *n;
+ STRIP_TYPE_NOPS (value);
+ if (TREE_CONSTANT (value) || TREE_READONLY (value))
+ return gimple_build_nop ();
+ }
+ }
+
+ /* Create a new deep copy of the statement. */
+ copy = gimple_copy (stmt);
+ }
+
+ /* If STMT has a block defined, map it to the newly constructed
+ block. When inlining we want statements without a block to
+ appear in the block of the function call. */
+ new_block = id->block;
+ if (gimple_block (copy))
+ {
+ tree *n;
+ n = (tree *) pointer_map_contains (id->decl_map, gimple_block (copy));
+ gcc_assert (n);
+ new_block = *n;
+ }
+
+ gimple_set_block (copy, new_block);
+
+ /* Remap all the operands in COPY. */
+ memset (&wi, 0, sizeof (wi));
+ wi.info = id;
+ walk_gimple_op (copy, remap_gimple_op_r, &wi);
+
+ /* We have to handle EH region remapping of GIMPLE_RESX specially because
+ the region number is not an operand. */
+ if (gimple_code (stmt) == GIMPLE_RESX && id->eh_region_offset)
+ {
+ gimple_resx_set_region (copy, gimple_resx_region (stmt) + id->eh_region_offset);
+ }
+ return copy;
+}
+
+
/* Copy basic block, scale profile accordingly. Edges will be taken care of
later */
@@ -799,8 +1226,9 @@ static basic_block
copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
gcov_type count_scale)
{
- block_stmt_iterator bsi, copy_bsi;
+ gimple_stmt_iterator gsi, copy_gsi;
basic_block copy_basic_block;
+ tree decl;
/* create_basic_block() will append every new block to
basic_block_info automatically. */
@@ -808,237 +1236,226 @@ copy_bb (copy_body_data *id, basic_block bb, int frequency_scale,
(basic_block) bb->prev_bb->aux);
copy_basic_block->count = bb->count * count_scale / REG_BR_PROB_BASE;
- /* We are going to rebuild frequencies from scratch. These values have just
- small importance to drive canonicalize_loop_headers. */
+ /* We are going to rebuild frequencies from scratch. These values
+ have just small importance to drive canonicalize_loop_headers. */
copy_basic_block->frequency = ((gcov_type)bb->frequency
- * frequency_scale / REG_BR_PROB_BASE);
+ * frequency_scale / REG_BR_PROB_BASE);
+
if (copy_basic_block->frequency > BB_FREQ_MAX)
copy_basic_block->frequency = BB_FREQ_MAX;
- copy_bsi = bsi_start (copy_basic_block);
- for (bsi = bsi_start (bb);
- !bsi_end_p (bsi); bsi_next (&bsi))
+ copy_gsi = gsi_start_bb (copy_basic_block);
+
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree stmt = bsi_stmt (bsi);
- tree orig_stmt = stmt;
+ gimple stmt = gsi_stmt (gsi);
+ gimple orig_stmt = stmt;
id->regimplify = false;
- walk_tree (&stmt, copy_body_r, id, NULL);
+ stmt = remap_gimple_stmt (stmt, id);
+ if (gimple_nop_p (stmt))
+ continue;
- /* RETURN_EXPR might be removed,
- this is signalled by making stmt pointer NULL. */
- if (stmt)
- {
- tree call, decl;
+ gimple_duplicate_stmt_histograms (cfun, stmt, id->src_cfun, orig_stmt);
- gimple_duplicate_stmt_histograms (cfun, stmt, id->src_cfun, orig_stmt);
+ /* 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)))
+ {
+ tree new_rhs;
+ new_rhs = force_gimple_operand_gsi (&copy_gsi,
+ gimple_assign_rhs1 (stmt),
+ true, NULL, true, GSI_SAME_STMT);
+ gimple_assign_set_rhs1 (stmt, new_rhs);
+ }
+ else if (id->regimplify)
+ gimple_regimplify_operands (stmt, &copy_gsi);
- /* With return slot optimization we can end up with
- non-gimple (foo *)&this->m, fix that here. */
- if ((TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == NOP_EXPR
- && !is_gimple_val (TREE_OPERAND (GIMPLE_STMT_OPERAND (stmt, 1), 0)))
- || id->regimplify)
- gimplify_stmt (&stmt);
+ gsi_insert_after (&copy_gsi, stmt, GSI_NEW_STMT);
- bsi_insert_after (&copy_bsi, stmt, BSI_NEW_STMT);
+ /* Process the new statement. The call to gimple_regimplify_operands
+ possibly turned the statement into multiple statements, we
+ need to process all of them. */
+ while (!gsi_end_p (copy_gsi))
+ {
+ if (is_gimple_call (stmt)
+ && gimple_call_va_arg_pack_p (stmt)
+ && id->gimple_call)
+ {
+ /* __builtin_va_arg_pack () should be replaced by
+ all arguments corresponding to ... in the caller. */
+ tree p;
+ gimple new_call;
+ VEC(tree, heap) *argarray;
+ size_t nargs = gimple_call_num_args (id->gimple_call);
+ size_t n;
+
+ for (p = DECL_ARGUMENTS (id->src_fn); p; p = TREE_CHAIN (p))
+ nargs--;
+
+ /* Create the new array of arguments. */
+ n = nargs + gimple_call_num_args (stmt);
+ argarray = VEC_alloc (tree, heap, n);
+ VEC_safe_grow (tree, heap, argarray, n);
+
+ /* Copy all the arguments before '...' */
+ memcpy (VEC_address (tree, argarray),
+ gimple_call_arg_ptr (stmt, 0),
+ gimple_call_num_args (stmt) * sizeof (tree));
+
+ /* Append the arguments passed in '...' */
+ memcpy (VEC_address(tree, argarray) + gimple_call_num_args (stmt),
+ gimple_call_arg_ptr (id->gimple_call, 0)
+ + (gimple_call_num_args (id->gimple_call) - nargs),
+ nargs * sizeof (tree));
+
+ new_call = gimple_build_call_vec (gimple_call_fn (stmt),
+ argarray);
+
+ VEC_free (tree, heap, argarray);
+
+ /* Copy all GIMPLE_CALL flags, location and block, except
+ GF_CALL_VA_ARG_PACK. */
+ gimple_call_copy_flags (new_call, stmt);
+ gimple_call_set_va_arg_pack (new_call, false);
+ gimple_set_location (new_call, gimple_location (stmt));
+ gimple_set_block (new_call, gimple_block (stmt));
+ gimple_call_set_lhs (new_call, gimple_call_lhs (stmt));
+
+ gsi_replace (&copy_gsi, new_call, false);
+ stmt = new_call;
+ }
+ else if (is_gimple_call (stmt)
+ && id->gimple_call
+ && (decl = gimple_call_fndecl (stmt))
+ && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
+ && DECL_FUNCTION_CODE (decl) == BUILT_IN_VA_ARG_PACK_LEN)
+ {
+ /* __builtin_va_arg_pack_len () should be replaced by
+ the number of anonymous arguments. */
+ size_t nargs = gimple_call_num_args (id->gimple_call);
+ tree count, p;
+ gimple new_stmt;
+
+ for (p = DECL_ARGUMENTS (id->src_fn); p; p = TREE_CHAIN (p))
+ nargs--;
+
+ count = build_int_cst (integer_type_node, nargs);
+ new_stmt = gimple_build_assign (gimple_call_lhs (stmt), count);
+ gsi_replace (&copy_gsi, new_stmt, false);
+ stmt = new_stmt;
+ }
- /* Process new statement. gimplify_stmt possibly turned statement
- into multiple statements, we need to process all of them. */
- while (!bsi_end_p (copy_bsi))
+ /* Statements produced by inlining can be unfolded, especially
+ when we constant propagated some operands. We can't fold
+ them right now for two reasons:
+ 1) folding require SSA_NAME_DEF_STMTs to be correct
+ 2) we can't change function calls to builtins.
+ So we just mark statement for later folding. We mark
+ all new statements, instead just statements that has changed
+ by some nontrivial substitution so even statements made
+ foldable indirectly are updated. If this turns out to be
+ expensive, copy_body can be told to watch for nontrivial
+ changes. */
+ if (id->statements_to_fold)
+ pointer_set_insert (id->statements_to_fold, stmt);
+
+ /* We're duplicating a CALL_EXPR. Find any corresponding
+ callgraph edges and update or duplicate them. */
+ if (is_gimple_call (stmt))
{
- tree *stmtp = bsi_stmt_ptr (copy_bsi);
- tree stmt = *stmtp;
- call = get_call_expr_in (stmt);
+ struct cgraph_node *node;
+ struct cgraph_edge *edge;
- if (call && CALL_EXPR_VA_ARG_PACK (call) && id->call_expr)
+ switch (id->transform_call_graph_edges)
{
- /* __builtin_va_arg_pack () should be replaced by
- all arguments corresponding to ... in the caller. */
- tree p, *argarray, new_call, *call_ptr;
- int nargs = call_expr_nargs (id->call_expr);
-
- for (p = DECL_ARGUMENTS (id->src_fn); p; p = TREE_CHAIN (p))
- nargs--;
-
- argarray = (tree *) alloca ((nargs + call_expr_nargs (call))
- * sizeof (tree));
-
- memcpy (argarray, CALL_EXPR_ARGP (call),
- call_expr_nargs (call) * sizeof (*argarray));
- memcpy (argarray + call_expr_nargs (call),
- CALL_EXPR_ARGP (id->call_expr)
- + (call_expr_nargs (id->call_expr) - nargs),
- nargs * sizeof (*argarray));
-
- new_call = build_call_array (TREE_TYPE (call),
- CALL_EXPR_FN (call),
- nargs + call_expr_nargs (call),
- argarray);
- /* Copy all CALL_EXPR flags, locus and block, except
- CALL_EXPR_VA_ARG_PACK flag. */
- CALL_EXPR_STATIC_CHAIN (new_call)
- = CALL_EXPR_STATIC_CHAIN (call);
- CALL_EXPR_TAILCALL (new_call) = CALL_EXPR_TAILCALL (call);
- CALL_EXPR_RETURN_SLOT_OPT (new_call)
- = CALL_EXPR_RETURN_SLOT_OPT (call);
- CALL_FROM_THUNK_P (new_call) = CALL_FROM_THUNK_P (call);
- CALL_CANNOT_INLINE_P (new_call)
- = CALL_CANNOT_INLINE_P (call);
- TREE_NOTHROW (new_call) = TREE_NOTHROW (call);
- SET_EXPR_LOCUS (new_call, EXPR_LOCUS (call));
- TREE_BLOCK (new_call) = TREE_BLOCK (call);
-
- call_ptr = stmtp;
- if (TREE_CODE (*call_ptr) == GIMPLE_MODIFY_STMT)
- call_ptr = &GIMPLE_STMT_OPERAND (*call_ptr, 1);
- if (TREE_CODE (*call_ptr) == WITH_SIZE_EXPR)
- call_ptr = &TREE_OPERAND (*call_ptr, 0);
- gcc_assert (*call_ptr == call);
- if (call_ptr == stmtp)
- {
- bsi_replace (&copy_bsi, new_call, true);
- stmtp = bsi_stmt_ptr (copy_bsi);
- stmt = *stmtp;
- }
- else
- {
- *call_ptr = new_call;
- stmt = *stmtp;
- update_stmt (stmt);
- }
- }
- else if (call
- && id->call_expr
- && (decl = get_callee_fndecl (call))
- && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
- && DECL_FUNCTION_CODE (decl)
- == BUILT_IN_VA_ARG_PACK_LEN)
- {
- /* __builtin_va_arg_pack_len () should be replaced by
- the number of anonymous arguments. */
- int nargs = call_expr_nargs (id->call_expr);
- tree count, *call_ptr, p;
-
- for (p = DECL_ARGUMENTS (id->src_fn); p; p = TREE_CHAIN (p))
- nargs--;
-
- count = build_int_cst (integer_type_node, nargs);
- call_ptr = stmtp;
- if (TREE_CODE (*call_ptr) == GIMPLE_MODIFY_STMT)
- call_ptr = &GIMPLE_STMT_OPERAND (*call_ptr, 1);
- if (TREE_CODE (*call_ptr) == WITH_SIZE_EXPR)
- call_ptr = &TREE_OPERAND (*call_ptr, 0);
- gcc_assert (*call_ptr == call && call_ptr != stmtp);
- *call_ptr = count;
- stmt = *stmtp;
- update_stmt (stmt);
- call = NULL_TREE;
+ case CB_CGE_DUPLICATE:
+ edge = cgraph_edge (id->src_node, orig_stmt);
+ if (edge)
+ cgraph_clone_edge (edge, id->dst_node, stmt,
+ REG_BR_PROB_BASE, 1,
+ edge->frequency, true);
+ break;
+
+ case CB_CGE_MOVE_CLONES:
+ for (node = id->dst_node->next_clone;
+ node;
+ node = node->next_clone)
+ {
+ edge = cgraph_edge (node, orig_stmt);
+ if (edge)
+ cgraph_set_call_stmt (edge, stmt);
+ }
+ /* FALLTHRU */
+
+ case CB_CGE_MOVE:
+ edge = cgraph_edge (id->dst_node, orig_stmt);
+ if (edge)
+ cgraph_set_call_stmt (edge, stmt);
+ break;
+
+ default:
+ gcc_unreachable ();
}
+ }
- /* Statements produced by inlining can be unfolded, especially
- when we constant propagated some operands. We can't fold
- them right now for two reasons:
- 1) folding require SSA_NAME_DEF_STMTs to be correct
- 2) we can't change function calls to builtins.
- So we just mark statement for later folding. We mark
- all new statements, instead just statements that has changed
- by some nontrivial substitution so even statements made
- foldable indirectly are updated. If this turns out to be
- expensive, copy_body can be told to watch for nontrivial
- changes. */
- if (id->statements_to_fold)
- pointer_set_insert (id->statements_to_fold, stmt);
- /* We're duplicating a CALL_EXPR. Find any corresponding
- callgraph edges and update or duplicate them. */
- if (call && (decl = get_callee_fndecl (call)))
- {
- struct cgraph_node *node;
- struct cgraph_edge *edge;
-
- switch (id->transform_call_graph_edges)
- {
- case CB_CGE_DUPLICATE:
- edge = cgraph_edge (id->src_node, orig_stmt);
- if (edge)
- cgraph_clone_edge (edge, id->dst_node, stmt,
- REG_BR_PROB_BASE, 1, edge->frequency, true);
- break;
-
- case CB_CGE_MOVE_CLONES:
- for (node = id->dst_node->next_clone;
- node;
- node = node->next_clone)
- {
- edge = cgraph_edge (node, orig_stmt);
- gcc_assert (edge);
- cgraph_set_call_stmt (edge, stmt);
- }
- /* FALLTHRU */
-
- case CB_CGE_MOVE:
- edge = cgraph_edge (id->dst_node, orig_stmt);
- if (edge)
- cgraph_set_call_stmt (edge, stmt);
- break;
-
- default:
- gcc_unreachable ();
- }
- }
- /* If you think we can abort here, you are wrong.
- There is no region 0 in tree land. */
- gcc_assert (lookup_stmt_eh_region_fn (id->src_cfun, orig_stmt)
- != 0);
-
- if (tree_could_throw_p (stmt)
- /* When we are cloning for inlining, we are supposed to
- construct a clone that calls precisely the same functions
- as original. However IPA optimizers might've proved
- earlier some function calls as non-trapping that might
- render some basic blocks dead that might become
- unreachable.
-
- We can't update SSA with unreachable blocks in CFG and thus
- we prevent the scenario by preserving even the "dead" eh
- edges until the point they are later removed by
- fixup_cfg pass. */
- || (id->transform_call_graph_edges == CB_CGE_MOVE_CLONES
- && lookup_stmt_eh_region_fn (id->src_cfun, orig_stmt) > 0))
- {
- int region = lookup_stmt_eh_region_fn (id->src_cfun, orig_stmt);
- /* Add an entry for the copied tree in the EH hashtable.
- When cloning or versioning, use the hashtable in
- cfun, and just copy the EH number. When inlining, use the
- hashtable in the caller, and adjust the region number. */
- if (region > 0)
- add_stmt_to_eh_region (stmt, region + id->eh_region_offset);
-
- /* If this tree doesn't have a region associated with it,
- and there is a "current region,"
- then associate this tree with the current region
- and add edges associated with this region. */
- if ((lookup_stmt_eh_region_fn (id->src_cfun,
- orig_stmt) <= 0
- && id->eh_region > 0)
- && tree_could_throw_p (stmt))
- add_stmt_to_eh_region (stmt, id->eh_region);
- }
- if (gimple_in_ssa_p (cfun))
- {
- ssa_op_iter i;
- tree def;
+ /* If you think we can abort here, you are wrong.
+ There is no region 0 in gimple. */
+ gcc_assert (lookup_stmt_eh_region_fn (id->src_cfun, orig_stmt) != 0);
+
+ if (stmt_could_throw_p (stmt)
+ /* When we are cloning for inlining, we are supposed to
+ construct a clone that calls precisely the same functions
+ as original. However IPA optimizers might've proved
+ earlier some function calls as non-trapping that might
+ render some basic blocks dead that might become
+ unreachable.
+
+ We can't update SSA with unreachable blocks in CFG and thus
+ we prevent the scenario by preserving even the "dead" eh
+ edges until the point they are later removed by
+ fixup_cfg pass. */
+ || (id->transform_call_graph_edges == CB_CGE_MOVE_CLONES
+ && lookup_stmt_eh_region_fn (id->src_cfun, orig_stmt) > 0))
+ {
+ int region = lookup_stmt_eh_region_fn (id->src_cfun, orig_stmt);
+
+ /* Add an entry for the copied tree in the EH hashtable.
+ When cloning or versioning, use the hashtable in
+ cfun, and just copy the EH number. When inlining, use the
+ hashtable in the caller, and adjust the region number. */
+ if (region > 0)
+ add_stmt_to_eh_region (stmt, region + id->eh_region_offset);
+
+ /* If this tree doesn't have a region associated with it,
+ and there is a "current region,"
+ then associate this tree with the current region
+ and add edges associated with this region. */
+ if (lookup_stmt_eh_region_fn (id->src_cfun, orig_stmt) <= 0
+ && id->eh_region > 0
+ && stmt_could_throw_p (stmt))
+ add_stmt_to_eh_region (stmt, id->eh_region);
+ }
- find_new_referenced_vars (bsi_stmt_ptr (copy_bsi));
- FOR_EACH_SSA_TREE_OPERAND (def, stmt, i, SSA_OP_DEF)
- if (TREE_CODE (def) == SSA_NAME)
- SSA_NAME_DEF_STMT (def) = stmt;
- }
- bsi_next (&copy_bsi);
+ if (gimple_in_ssa_p (cfun))
+ {
+ ssa_op_iter i;
+ tree def;
+
+ find_new_referenced_vars (gsi_stmt (copy_gsi));
+ FOR_EACH_SSA_TREE_OPERAND (def, stmt, i, SSA_OP_DEF)
+ if (TREE_CODE (def) == SSA_NAME)
+ SSA_NAME_DEF_STMT (def) = stmt;
}
- copy_bsi = bsi_last (copy_basic_block);
+
+ gsi_next (&copy_gsi);
}
+
+ copy_gsi = gsi_last_bb (copy_basic_block);
}
+
return copy_basic_block;
}
@@ -1071,27 +1488,31 @@ update_ssa_across_abnormal_edges (basic_block bb, basic_block ret_bb,
if (!e->dest->aux
|| ((basic_block)e->dest->aux)->index == ENTRY_BLOCK)
{
- tree phi;
+ gimple phi;
+ gimple_stmt_iterator si;
gcc_assert (e->flags & EDGE_ABNORMAL);
+
if (!nonlocal_goto)
gcc_assert (e->flags & EDGE_EH);
+
if (!can_throw)
gcc_assert (!(e->flags & EDGE_EH));
- for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
+
+ for (si = gsi_start_phis (e->dest); !gsi_end_p (si); gsi_next (&si))
{
edge re;
+ phi = gsi_stmt (si);
+
/* There shouldn't be any PHI nodes in the ENTRY_BLOCK. */
gcc_assert (!e->dest->aux);
- gcc_assert (SSA_NAME_OCCURS_IN_ABNORMAL_PHI
- (PHI_RESULT (phi)));
+ gcc_assert (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (PHI_RESULT (phi)));
if (!is_gimple_reg (PHI_RESULT (phi)))
{
- mark_sym_for_renaming
- (SSA_NAME_VAR (PHI_RESULT (phi)));
+ mark_sym_for_renaming (SSA_NAME_VAR (PHI_RESULT (phi)));
continue;
}
@@ -1106,16 +1527,18 @@ update_ssa_across_abnormal_edges (basic_block bb, basic_block ret_bb,
}
}
+
/* Copy edges from BB into its copy constructed earlier, scale profile
accordingly. Edges will be taken care of later. Assume aux
pointers to point to the copies of each BB. */
+
static void
copy_edges_for_bb (basic_block bb, gcov_type count_scale, basic_block ret_bb)
{
basic_block new_bb = (basic_block) bb->aux;
edge_iterator ei;
edge old_edge;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator si;
int flags;
/* Use the indices from the original blocks to create edges for the
@@ -1123,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;
@@ -1131,25 +1554,26 @@ 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)
return;
- for (bsi = bsi_start (new_bb); !bsi_end_p (bsi);)
+ for (si = gsi_start_bb (new_bb); !gsi_end_p (si);)
{
- tree copy_stmt;
+ gimple copy_stmt;
bool can_throw, nonlocal_goto;
- copy_stmt = bsi_stmt (bsi);
+ copy_stmt = gsi_stmt (si);
update_stmt (copy_stmt);
if (gimple_in_ssa_p (cfun))
mark_symbols_for_renaming (copy_stmt);
+
/* Do this before the possible split_block. */
- bsi_next (&bsi);
+ gsi_next (&si);
/* If this tree could throw an exception, there are two
cases where we need to add abnormal edge(s): the
@@ -1162,13 +1586,12 @@ copy_edges_for_bb (basic_block bb, gcov_type count_scale, basic_block ret_bb)
propagation can change an INDIRECT_REF which throws
into a COMPONENT_REF which doesn't. If the copy
can throw, the original could also throw. */
-
- can_throw = tree_can_throw_internal (copy_stmt);
- nonlocal_goto = tree_can_make_abnormal_goto (copy_stmt);
+ can_throw = stmt_can_throw_internal (copy_stmt);
+ nonlocal_goto = stmt_can_make_abnormal_goto (copy_stmt);
if (can_throw || nonlocal_goto)
{
- if (!bsi_end_p (bsi))
+ if (!gsi_end_p (si))
/* Note that bb's predecessor edges aren't necessarily
right at this point; split_block doesn't care. */
{
@@ -1176,7 +1599,7 @@ copy_edges_for_bb (basic_block bb, gcov_type count_scale, basic_block ret_bb)
new_bb = e->dest;
new_bb->aux = e->src->aux;
- bsi = bsi_start (new_bb);
+ si = gsi_start_bb (new_bb);
}
}
@@ -1184,11 +1607,11 @@ copy_edges_for_bb (basic_block bb, gcov_type count_scale, basic_block ret_bb)
make_eh_edges (copy_stmt);
if (nonlocal_goto)
- make_abnormal_goto_edges (bb_for_stmt (copy_stmt), true);
+ make_abnormal_goto_edges (gimple_bb (copy_stmt), true);
if ((can_throw || nonlocal_goto)
&& gimple_in_ssa_p (cfun))
- update_ssa_across_abnormal_edges (bb_for_stmt (copy_stmt), ret_bb,
+ update_ssa_across_abnormal_edges (gimple_bb (copy_stmt), ret_bb,
can_throw, nonlocal_goto);
}
}
@@ -1203,27 +1626,33 @@ copy_phis_for_bb (basic_block bb, copy_body_data *id)
{
basic_block const new_bb = (basic_block) bb->aux;
edge_iterator ei;
- tree phi;
+ gimple phi;
+ gimple_stmt_iterator si;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (si = gsi_start (phi_nodes (bb)); !gsi_end_p (si); gsi_next (&si))
{
- tree res = PHI_RESULT (phi);
- tree new_res = res;
- tree new_phi;
+ tree res, new_res;
+ gimple new_phi;
edge new_edge;
+ phi = gsi_stmt (si);
+ res = PHI_RESULT (phi);
+ new_res = res;
if (is_gimple_reg (res))
{
- walk_tree (&new_res, copy_body_r, id, NULL);
+ walk_tree (&new_res, copy_tree_body_r, id, NULL);
SSA_NAME_DEF_STMT (new_res)
= new_phi = create_phi_node (new_res, new_bb);
FOR_EACH_EDGE (new_edge, ei, new_bb->preds)
{
- edge const old_edge = find_edge ((basic_block) new_edge->src->aux, bb);
+ edge const old_edge
+ = find_edge ((basic_block) new_edge->src->aux, bb);
tree arg = PHI_ARG_DEF_FROM_EDGE (phi, old_edge);
tree new_arg = arg;
-
- walk_tree (&new_arg, copy_body_r, id, NULL);
+ tree block = id->block;
+ id->block = NULL_TREE;
+ walk_tree (&new_arg, copy_tree_body_r, id, NULL);
+ id->block = block;
gcc_assert (new_arg);
/* With return slot optimization we can end up with
non-gimple (foo *)&this->m, fix that here. */
@@ -1231,10 +1660,9 @@ copy_phis_for_bb (basic_block bb, copy_body_data *id)
&& TREE_CODE (new_arg) != FUNCTION_DECL
&& !is_gimple_val (new_arg))
{
- tree stmts = NULL_TREE;
- new_arg = force_gimple_operand (new_arg, &stmts,
- true, NULL);
- bsi_insert_on_edge_immediate (new_edge, stmts);
+ gimple_seq stmts = NULL;
+ new_arg = force_gimple_operand (new_arg, &stmts, true, NULL);
+ gsi_insert_seq_on_edge_immediate (new_edge, stmts);
}
add_phi_arg (new_phi, new_arg, new_edge);
}
@@ -1242,7 +1670,9 @@ copy_phis_for_bb (basic_block bb, copy_body_data *id)
}
}
+
/* Wrapper for remap_decl so it can be used as a callback. */
+
static tree
remap_decl_1 (tree decl, void *data)
{
@@ -1275,7 +1705,7 @@ initialize_cfun (tree new_fndecl, tree callee_fndecl, gcov_type count,
frequency_scale = count_scale;
/* Register specific tree functions. */
- tree_register_cfg_hooks ();
+ gimple_register_cfg_hooks ();
*new_cfun = *DECL_STRUCT_FUNCTION (callee_fndecl);
new_cfun->funcdef_no = get_next_funcdef_no ();
VALUE_HISTOGRAMS (new_cfun) = NULL;
@@ -1340,7 +1770,7 @@ copy_cfg_body (copy_body_data * id, gcov_type count, int frequency,
frequency_scale = count_scale;
/* Register specific tree functions. */
- tree_register_cfg_hooks ();
+ gimple_register_cfg_hooks ();
/* Must have a CFG here at this point. */
gcc_assert (ENTRY_BLOCK_PTR_FOR_FUNCTION
@@ -1348,7 +1778,6 @@ copy_cfg_body (copy_body_data * id, gcov_type count, int frequency,
cfun_to_copy = id->src_cfun = DECL_STRUCT_FUNCTION (callee_fndecl);
-
ENTRY_BLOCK_PTR_FOR_FUNCTION (cfun_to_copy)->aux = entry_block_map;
EXIT_BLOCK_PTR_FOR_FUNCTION (cfun_to_copy)->aux = exit_block_map;
entry_block_map->aux = ENTRY_BLOCK_PTR_FOR_FUNCTION (cfun_to_copy);
@@ -1361,26 +1790,31 @@ copy_cfg_body (copy_body_data * id, gcov_type count, int frequency,
= duplicate_eh_regions (cfun_to_copy, remap_decl_1, id,
0, id->eh_region);
}
+
/* 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;
+
/* Now that we've duplicated the blocks, duplicate their edges. */
FOR_ALL_BB_FN (bb, cfun_to_copy)
copy_edges_for_bb (bb, count_scale, exit_block_map);
+
if (gimple_in_ssa_p (cfun))
FOR_ALL_BB_FN (bb, cfun_to_copy)
copy_phis_for_bb (bb, id);
+
FOR_ALL_BB_FN (bb, cfun_to_copy)
{
((basic_block)bb->aux)->aux = NULL;
bb->aux = NULL;
}
+
/* Zero out AUX fields of newly created block during EH edge
insertion. */
for (; last < last_basic_block; last++)
@@ -1391,21 +1825,6 @@ copy_cfg_body (copy_body_data * id, gcov_type count, int frequency,
return new_fndecl;
}
-/* Make a copy of the body of FN so that it can be inserted inline in
- another function. */
-
-tree
-copy_generic_body (copy_body_data *id)
-{
- tree body;
- tree fndecl = id->src_fn;
-
- body = DECL_SAVED_TREE (fndecl);
- walk_tree (&body, copy_body_r, id, NULL);
-
- return body;
-}
-
static tree
copy_body (copy_body_data *id, gcov_type count, int frequency,
basic_block entry_block_map, basic_block exit_block_map)
@@ -1437,10 +1856,52 @@ self_inlining_addr_expr (tree value, tree fn)
}
static void
+insert_init_stmt (basic_block bb, gimple init_stmt)
+{
+ gimple_stmt_iterator si = gsi_last_bb (bb);
+ gimple_stmt_iterator i;
+ gimple_seq seq = gimple_seq_alloc ();
+ struct gimplify_ctx gctx;
+
+ push_gimplify_context (&gctx);
+
+ i = gsi_start (seq);
+ gimple_regimplify_operands (init_stmt, &i);
+
+ if (init_stmt
+ && !gimple_seq_empty_p (seq))
+ {
+ /* The replacement can expose previously unreferenced
+ variables. */
+ if (gimple_in_ssa_p (cfun))
+ for (i = gsi_start (seq); !gsi_end_p (i); gsi_next (&i))
+ find_new_referenced_vars (gsi_stmt (i));
+
+ /* Insert the gimplified sequence needed for INIT_STMT
+ after SI. INIT_STMT will be inserted after SEQ. */
+ gsi_insert_seq_after (&si, seq, GSI_NEW_STMT);
+ }
+
+ pop_gimplify_context (NULL);
+
+ /* If VAR represents a zero-sized variable, it's possible that the
+ assignment statement may result in no gimple statements. */
+ if (init_stmt)
+ gsi_insert_after (&si, init_stmt, GSI_NEW_STMT);
+
+ if (gimple_in_ssa_p (cfun))
+ for (;!gsi_end_p (si); gsi_next (&si))
+ mark_symbols_for_renaming (gsi_stmt (si));
+}
+
+/* Initialize parameter P with VALUE. If needed, produce init statement
+ at the end of BB. When BB is NULL, we return init statement to be
+ output later. */
+static gimple
setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn,
basic_block bb, tree *vars)
{
- tree init_stmt;
+ gimple init_stmt = NULL;
tree var;
tree rhs = value;
tree def = (gimple_in_ssa_p (cfun)
@@ -1483,7 +1944,7 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn,
&& ! self_inlining_addr_expr (value, fn))
{
insert_decl_map (id, p, value);
- return;
+ return NULL;
}
}
@@ -1541,7 +2002,7 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn,
&& !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (def))
{
insert_decl_map (id, def, rhs);
- return;
+ return NULL;
}
/* If the value of argument is never used, don't care about initializing
@@ -1549,94 +2010,63 @@ setup_one_parameter (copy_body_data *id, tree p, tree value, tree fn,
if (gimple_in_ssa_p (cfun) && !def && is_gimple_reg (p))
{
gcc_assert (!value || !TREE_SIDE_EFFECTS (value));
- return;
+ return NULL;
}
/* Initialize this VAR_DECL from the equivalent argument. Convert
the argument to the proper type in case it was promoted. */
if (value)
{
- block_stmt_iterator bsi = bsi_last (bb);
-
if (rhs == error_mark_node)
{
insert_decl_map (id, p, var);
- return;
+ return NULL;
}
STRIP_USELESS_TYPE_CONVERSION (rhs);
- /* We want to use GIMPLE_MODIFY_STMT, not INIT_EXPR here so that we
+ /* We want to use MODIFY_EXPR, not INIT_EXPR here so that we
keep our trees in gimple form. */
if (def && gimple_in_ssa_p (cfun) && is_gimple_reg (p))
{
def = remap_ssa_name (def, id);
- init_stmt = build_gimple_modify_stmt (def, rhs);
- SSA_NAME_DEF_STMT (def) = init_stmt;
+ init_stmt = gimple_build_assign (def, rhs);
SSA_NAME_IS_DEFAULT_DEF (def) = 0;
set_default_def (var, NULL);
}
else
- init_stmt = build_gimple_modify_stmt (var, rhs);
-
- /* If we did not create a gimple value and we did not create a gimple
- cast of a gimple value, then we will need to gimplify INIT_STMTS
- at the end. Note that is_gimple_cast only checks the outer
- tree code, not its operand. Thus the explicit check that its
- operand is a gimple value. */
- if ((!is_gimple_val (rhs)
- && (!is_gimple_cast (rhs)
- || !is_gimple_val (TREE_OPERAND (rhs, 0))))
- || !is_gimple_reg (var))
- {
- tree_stmt_iterator i;
- struct gimplify_ctx gctx;
+ init_stmt = gimple_build_assign (var, rhs);
- push_gimplify_context (&gctx);
- gimplify_stmt (&init_stmt);
- if (gimple_in_ssa_p (cfun)
- && init_stmt && TREE_CODE (init_stmt) == STATEMENT_LIST)
- {
- /* The replacement can expose previously unreferenced
- variables. */
- for (i = tsi_start (init_stmt); !tsi_end_p (i); tsi_next (&i))
- find_new_referenced_vars (tsi_stmt_ptr (i));
- }
- pop_gimplify_context (NULL);
- }
-
- /* If VAR represents a zero-sized variable, it's possible that the
- assignment statement may result in no gimple statements. */
- if (init_stmt)
- bsi_insert_after (&bsi, init_stmt, BSI_NEW_STMT);
- if (gimple_in_ssa_p (cfun))
- for (;!bsi_end_p (bsi); bsi_next (&bsi))
- mark_symbols_for_renaming (bsi_stmt (bsi));
+ if (bb && init_stmt)
+ insert_init_stmt (bb, init_stmt);
}
+ return init_stmt;
}
/* Generate code to initialize the parameters of the function at the
- top of the stack in ID from the CALL_EXPR EXP. */
+ top of the stack in ID from the GIMPLE_CALL STMT. */
static void
-initialize_inlined_parameters (copy_body_data *id, tree exp,
+initialize_inlined_parameters (copy_body_data *id, gimple stmt,
tree fn, basic_block bb)
{
tree parms;
- tree a;
+ size_t i;
tree p;
tree vars = NULL_TREE;
- call_expr_arg_iterator iter;
- tree static_chain = CALL_EXPR_STATIC_CHAIN (exp);
+ tree static_chain = gimple_call_chain (stmt);
/* Figure out what the parameters are. */
parms = DECL_ARGUMENTS (fn);
/* Loop through the parameter declarations, replacing each with an
equivalent VAR_DECL, appropriately initialized. */
- for (p = parms, a = first_call_expr_arg (exp, &iter); p;
- a = next_call_expr_arg (&iter), p = TREE_CHAIN (p))
- setup_one_parameter (id, p, a, fn, bb, &vars);
+ for (p = parms, i = 0; p; p = TREE_CHAIN (p), i++)
+ {
+ tree val;
+ val = i < gimple_call_num_args (stmt) ? gimple_call_arg (stmt, i) : NULL;
+ setup_one_parameter (id, p, val, fn, bb, &vars);
+ }
/* Initialize the static chain. */
p = DECL_STRUCT_FUNCTION (fn)->static_chain_decl;
@@ -1652,6 +2082,7 @@ initialize_inlined_parameters (copy_body_data *id, tree exp,
declare_inline_vars (id->block, vars);
}
+
/* Declare a return variable to replace the RESULT_DECL for the
function we are calling. An appropriate DECL_STMT is returned.
The USE_STMT is filled to contain a use of the declaration to
@@ -1659,7 +2090,7 @@ initialize_inlined_parameters (copy_body_data *id, tree exp,
RETURN_SLOT, if non-null is place where to store the result. It
is set only for CALL_EXPR_RETURN_SLOT_OPT. MODIFY_DEST, if non-null,
- was the LHS of the GIMPLE_MODIFY_STMT to which this call is the RHS.
+ was the LHS of the MODIFY_EXPR to which this call is the RHS.
The return value is a (possibly null) value that is the result of the
function as seen by the callee. *USE_P is a (possibly null) value that
@@ -1839,37 +2270,89 @@ declare_return_variable (copy_body_data *id, tree return_slot, tree modify_dest,
bool
tree_inlinable_function_p (tree fn)
{
- return inlinable_function_p (fn);
+ bool ret = inlinable_function_p (fn);
+
+ if (getenv ("TUPLES_INLINE"))
+ fprintf (stderr, "Function %s is %sinlinable\n", get_name (fn),
+ ret ? "" : "not ");
+
+ return ret;
}
static const char *inline_forbidden_reason;
+/* A callback for walk_gimple_seq to handle tree operands. Returns
+ NULL_TREE if a function can be inlined, otherwise sets the reason
+ why not and returns a tree representing the offending operand. */
+
static tree
-inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
- void *fnp)
+inline_forbidden_p_op (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
+ void *fnp ATTRIBUTE_UNUSED)
{
tree node = *nodep;
- tree fn = (tree) fnp;
tree t;
- switch (TREE_CODE (node))
+ if (TREE_CODE (node) == RECORD_TYPE || TREE_CODE (node) == UNION_TYPE)
+ {
+ /* We cannot inline a function of the form
+
+ void F (int i) { struct S { int ar[i]; } s; }
+
+ Attempting to do so produces a catch-22.
+ If walk_tree examines the TYPE_FIELDS chain of RECORD_TYPE/
+ UNION_TYPE nodes, then it goes into infinite recursion on a
+ structure containing a pointer to its own type. If it doesn't,
+ then the type node for S doesn't get adjusted properly when
+ F is inlined.
+
+ ??? This is likely no longer true, but it's too late in the 4.0
+ cycle to try to find out. This should be checked for 4.1. */
+ for (t = TYPE_FIELDS (node); t; t = TREE_CHAIN (t))
+ if (variably_modified_type_p (TREE_TYPE (t), NULL))
+ {
+ inline_forbidden_reason
+ = G_("function %q+F can never be inlined "
+ "because it uses variable sized variables");
+ return node;
+ }
+ }
+
+ return NULL_TREE;
+}
+
+
+/* A callback for walk_gimple_seq to handle statements. Returns
+ non-NULL iff a function can not be inlined. Also sets the reason
+ why. */
+
+static tree
+inline_forbidden_p_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
+ struct walk_stmt_info *wip)
+{
+ tree fn = (tree) wip->info;
+ tree t;
+ gimple stmt = gsi_stmt (*gsi);
+
+ switch (gimple_code (stmt))
{
- case CALL_EXPR:
+ case GIMPLE_CALL:
/* Refuse to inline alloca call unless user explicitly forced so as
this may change program's memory overhead drastically when the
function using alloca is called in loop. In GCC present in
SPEC2000 inlining into schedule_block cause it to require 2GB of
RAM instead of 256MB. */
- if (alloca_call_p (node)
+ if (gimple_alloca_call_p (stmt)
&& !lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)))
{
inline_forbidden_reason
= G_("function %q+F can never be inlined because it uses "
"alloca (override using the always_inline attribute)");
- return node;
+ *handled_ops_p = true;
+ return fn;
}
- t = get_callee_fndecl (node);
- if (! t)
+
+ t = gimple_call_fndecl (stmt);
+ if (t == NULL_TREE)
break;
/* We cannot inline functions that call setjmp. */
@@ -1877,7 +2360,8 @@ inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
{
inline_forbidden_reason
= G_("function %q+F can never be inlined because it uses setjmp");
- return node;
+ *handled_ops_p = true;
+ return t;
}
if (DECL_BUILT_IN_CLASS (t) == BUILT_IN_NORMAL)
@@ -1891,7 +2375,8 @@ inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
inline_forbidden_reason
= G_("function %q+F can never be inlined because it "
"uses variable argument lists");
- return node;
+ *handled_ops_p = true;
+ return t;
case BUILT_IN_LONGJMP:
/* We can't inline functions that call __builtin_longjmp at
@@ -1902,14 +2387,16 @@ inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
inline_forbidden_reason
= G_("function %q+F can never be inlined because "
"it uses setjmp-longjmp exception handling");
- return node;
+ *handled_ops_p = true;
+ return t;
case BUILT_IN_NONLOCAL_GOTO:
/* Similarly. */
inline_forbidden_reason
= G_("function %q+F can never be inlined because "
"it uses non-local goto");
- return node;
+ *handled_ops_p = true;
+ return t;
case BUILT_IN_RETURN:
case BUILT_IN_APPLY_ARGS:
@@ -1920,15 +2407,16 @@ inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
inline_forbidden_reason
= G_("function %q+F can never be inlined because "
"it uses __builtin_return or __builtin_apply_args");
- return node;
+ *handled_ops_p = true;
+ return t;
default:
break;
}
break;
- case GOTO_EXPR:
- t = TREE_OPERAND (node, 0);
+ case GIMPLE_GOTO:
+ t = gimple_goto_dest (stmt);
/* We will not inline a function which uses computed goto. The
addresses of its local labels, which may be tucked into
@@ -1939,12 +2427,13 @@ inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
inline_forbidden_reason
= G_("function %q+F can never be inlined "
"because it contains a computed goto");
- return node;
+ *handled_ops_p = true;
+ return t;
}
break;
- case LABEL_EXPR:
- t = TREE_OPERAND (node, 0);
+ case GIMPLE_LABEL:
+ t = gimple_label_label (stmt);
if (DECL_NONLOCAL (t))
{
/* We cannot inline a function that receives a non-local goto
@@ -1953,41 +2442,20 @@ inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
inline_forbidden_reason
= G_("function %q+F can never be inlined "
"because it receives a non-local goto");
- return node;
+ *handled_ops_p = true;
+ return t;
}
break;
- case RECORD_TYPE:
- case UNION_TYPE:
- /* We cannot inline a function of the form
-
- void F (int i) { struct S { int ar[i]; } s; }
-
- Attempting to do so produces a catch-22.
- If walk_tree examines the TYPE_FIELDS chain of RECORD_TYPE/
- UNION_TYPE nodes, then it goes into infinite recursion on a
- structure containing a pointer to its own type. If it doesn't,
- then the type node for S doesn't get adjusted properly when
- F is inlined.
-
- ??? This is likely no longer true, but it's too late in the 4.0
- cycle to try to find out. This should be checked for 4.1. */
- for (t = TYPE_FIELDS (node); t; t = TREE_CHAIN (t))
- if (variably_modified_type_p (TREE_TYPE (t), NULL))
- {
- inline_forbidden_reason
- = G_("function %q+F can never be inlined "
- "because it uses variable sized variables");
- return node;
- }
-
default:
break;
}
+ *handled_ops_p = false;
return NULL_TREE;
}
+
static tree
inline_forbidden_p_2 (tree *nodep, int *walk_subtrees,
void *fnp)
@@ -2009,25 +2477,35 @@ inline_forbidden_p_2 (tree *nodep, int *walk_subtrees,
return NULL_TREE;
}
-/* Return subexpression representing possible alloca call, if any. */
-static tree
+/* Return true if FNDECL is a function that cannot be inlined into
+ another one. */
+
+static bool
inline_forbidden_p (tree fndecl)
{
location_t saved_loc = input_location;
- block_stmt_iterator bsi;
- basic_block bb;
- tree ret = NULL_TREE;
struct function *fun = DECL_STRUCT_FUNCTION (fndecl);
tree step;
+ struct walk_stmt_info wi;
+ struct pointer_set_t *visited_nodes;
+ basic_block bb;
+ bool forbidden_p = false;
+
+ visited_nodes = pointer_set_create ();
+ memset (&wi, 0, sizeof (wi));
+ wi.info = (void *) fndecl;
+ wi.pset = visited_nodes;
FOR_EACH_BB_FN (bb, fun)
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- {
- ret = walk_tree_without_duplicates (bsi_stmt_ptr (bsi),
- inline_forbidden_p_1, fndecl);
- if (ret)
- goto egress;
- }
+ {
+ gimple ret;
+ gimple_seq seq = bb_seq (bb);
+ ret = walk_gimple_seq (seq, inline_forbidden_p_stmt,
+ inline_forbidden_p_op, &wi);
+ forbidden_p = (ret != NULL);
+ if (forbidden_p)
+ goto egress;
+ }
for (step = fun->local_decls; step; step = TREE_CHAIN (step))
{
@@ -2036,15 +2514,20 @@ inline_forbidden_p (tree fndecl)
&& TREE_STATIC (decl)
&& !DECL_EXTERNAL (decl)
&& DECL_INITIAL (decl))
- ret = walk_tree_without_duplicates (&DECL_INITIAL (decl),
- inline_forbidden_p_2, fndecl);
- if (ret)
- goto egress;
+ {
+ tree ret;
+ ret = walk_tree_without_duplicates (&DECL_INITIAL (decl),
+ inline_forbidden_p_2, fndecl);
+ forbidden_p = (ret != NULL);
+ if (forbidden_p)
+ goto egress;
+ }
}
egress:
+ pointer_set_destroy (visited_nodes);
input_location = saved_loc;
- return ret;
+ return forbidden_p;
}
/* Returns nonzero if FN is a function that does not have any
@@ -2064,13 +2547,12 @@ inlinable_function_p (tree fn)
/* We only warn for functions declared `inline' by the user. */
do_warning = (warn_inline
- && DECL_INLINE (fn)
&& DECL_DECLARED_INLINE_P (fn)
&& !DECL_IN_SYSTEM_HEADER (fn));
always_inline = lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn));
- if (flag_really_no_inline
+ if (flag_no_inline
&& always_inline == NULL)
{
if (do_warning)
@@ -2096,27 +2578,9 @@ inlinable_function_p (tree fn)
/* If we don't have the function body available, we can't inline it.
However, this should not be recorded since we also get here for
forward declared inline functions. Therefore, return at once. */
- if (!DECL_SAVED_TREE (fn))
+ if (!gimple_body (fn))
return false;
- /* If we're not inlining at all, then we cannot inline this function. */
- else if (!flag_inline_trees)
- inlinable = false;
-
- /* Only try to inline functions if DECL_INLINE is set. This should be
- true for all functions declared `inline', and for all other functions
- as well with -finline-functions.
-
- Don't think of disregarding DECL_INLINE when flag_inline_trees == 2;
- it's the front-end that must set DECL_INLINE in this case, because
- dwarf2out loses if a function that does not have DECL_INLINE set is
- inlined anyway. That is why we have both DECL_INLINE and
- DECL_DECLARED_INLINE_P. */
- /* FIXME: When flag_inline_trees dies, the check for flag_unit_at_a_time
- here should be redundant. */
- else if (!DECL_INLINE (fn) && !flag_unit_at_a_time)
- inlinable = false;
-
else if (inline_forbidden_p (fn))
{
/* See if we should warn about uninlinable functions. Previously,
@@ -2157,151 +2621,20 @@ estimate_move_cost (tree type)
return ((size + MOVE_MAX_PIECES - 1) / MOVE_MAX_PIECES);
}
-/* Arguments for estimate_num_insns_1. */
-
-struct eni_data
-{
- /* Used to return the number of insns. */
- int count;
-
- /* Weights of various constructs. */
- eni_weights *weights;
-};
-
-/* Used by estimate_num_insns. Estimate number of instructions seen
- by given statement. */
+/* Returns cost of operation CODE, according to WEIGHTS */
-static tree
-estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
+static int
+estimate_operator_cost (enum tree_code code, eni_weights *weights)
{
- struct eni_data *const d = (struct eni_data *) data;
- tree x = *tp;
- unsigned cost;
-
- if (IS_TYPE_OR_DECL_P (x))
+ switch (code)
{
- *walk_subtrees = 0;
- return NULL;
- }
- /* Assume that constants and references counts nothing. These should
- be majorized by amount of operations among them we count later
- and are common target of CSE and similar optimizations. */
- else if (CONSTANT_CLASS_P (x) || REFERENCE_CLASS_P (x))
- return NULL;
-
- switch (TREE_CODE (x))
- {
- /* Containers have no cost. */
- case TREE_LIST:
- case TREE_VEC:
- case BLOCK:
- case COMPONENT_REF:
- case BIT_FIELD_REF:
- case INDIRECT_REF:
- case ALIGN_INDIRECT_REF:
- case MISALIGNED_INDIRECT_REF:
- case ARRAY_REF:
- case ARRAY_RANGE_REF:
- case OBJ_TYPE_REF:
- case EXC_PTR_EXPR: /* ??? */
- case FILTER_EXPR: /* ??? */
- case COMPOUND_EXPR:
- case BIND_EXPR:
- case WITH_CLEANUP_EXPR:
- case PAREN_EXPR:
+ /* These are "free" conversions, or their presumed cost
+ is folded into other operations. */
+ case RANGE_EXPR:
CASE_CONVERT:
- case VIEW_CONVERT_EXPR:
- case SAVE_EXPR:
- case ADDR_EXPR:
case COMPLEX_EXPR:
- case RANGE_EXPR:
- case CASE_LABEL_EXPR:
- case SSA_NAME:
- case CATCH_EXPR:
- case EH_FILTER_EXPR:
- case STATEMENT_LIST:
- case ERROR_MARK:
- case FDESC_EXPR:
- case VA_ARG_EXPR:
- case TRY_CATCH_EXPR:
- case TRY_FINALLY_EXPR:
- case LABEL_EXPR:
- case GOTO_EXPR:
- case RETURN_EXPR:
- case EXIT_EXPR:
- case LOOP_EXPR:
- case PHI_NODE:
- case WITH_SIZE_EXPR:
- case OMP_CLAUSE:
- case OMP_RETURN:
- case OMP_CONTINUE:
- case OMP_SECTIONS_SWITCH:
- case OMP_ATOMIC_STORE:
- break;
-
- /* We don't account constants for now. Assume that the cost is amortized
- by operations that do use them. We may re-consider this decision once
- we are able to optimize the tree before estimating its size and break
- out static initializers. */
- case IDENTIFIER_NODE:
- case INTEGER_CST:
- case REAL_CST:
- case FIXED_CST:
- case COMPLEX_CST:
- case VECTOR_CST:
- case STRING_CST:
- case PREDICT_EXPR:
- *walk_subtrees = 0;
- return NULL;
-
- /* CHANGE_DYNAMIC_TYPE_EXPR explicitly expands to nothing. */
- case CHANGE_DYNAMIC_TYPE_EXPR:
- *walk_subtrees = 0;
- return NULL;
-
- /* Try to estimate the cost of assignments. We have three cases to
- deal with:
- 1) Simple assignments to registers;
- 2) Stores to things that must live in memory. This includes
- "normal" stores to scalars, but also assignments of large
- structures, or constructors of big arrays;
- 3) TARGET_EXPRs.
-
- Let us look at the first two cases, assuming we have "a = b + C":
- <GIMPLE_MODIFY_STMT <var_decl "a">
- <plus_expr <var_decl "b"> <constant C>>
- If "a" is a GIMPLE register, the assignment to it is free on almost
- any target, because "a" usually ends up in a real register. Hence
- the only cost of this expression comes from the PLUS_EXPR, and we
- can ignore the GIMPLE_MODIFY_STMT.
- If "a" is not a GIMPLE register, the assignment to "a" will most
- likely be a real store, so the cost of the GIMPLE_MODIFY_STMT is the cost
- of moving something into "a", which we compute using the function
- estimate_move_cost.
-
- The third case deals with TARGET_EXPRs, for which the semantics are
- that a temporary is assigned, unless the TARGET_EXPR itself is being
- assigned to something else. In the latter case we do not need the
- temporary. E.g. in:
- <GIMPLE_MODIFY_STMT <var_decl "a"> <target_expr>>, the
- GIMPLE_MODIFY_STMT is free. */
- case INIT_EXPR:
- case GIMPLE_MODIFY_STMT:
- /* Is the right and side a TARGET_EXPR? */
- if (TREE_CODE (GENERIC_TREE_OPERAND (x, 1)) == TARGET_EXPR)
- break;
- /* ... fall through ... */
-
- case TARGET_EXPR:
- x = GENERIC_TREE_OPERAND (x, 0);
- /* Is this an assignments to a register? */
- if (is_gimple_reg (x))
- break;
- /* Otherwise it's a store, so fall through to compute the move cost. */
-
- case CONSTRUCTOR:
- d->count += estimate_move_cost (TREE_TYPE (x));
- break;
+ case PAREN_EXPR:
+ return 0;
/* Assign cost of 1 to usual operations.
??? We may consider mapping RTL costs to this. */
@@ -2364,15 +2697,15 @@ estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
case POSTDECREMENT_EXPR:
case POSTINCREMENT_EXPR:
- case ASM_EXPR:
-
case REALIGN_LOAD_EXPR:
case REDUC_MAX_EXPR:
case REDUC_MIN_EXPR:
case REDUC_PLUS_EXPR:
case WIDEN_SUM_EXPR:
- case DOT_PROD_EXPR:
+ case WIDEN_MULT_EXPR:
+ case DOT_PROD_EXPR:
+
case VEC_WIDEN_MULT_HI_EXPR:
case VEC_WIDEN_MULT_LO_EXPR:
case VEC_UNPACK_HI_EXPR:
@@ -2382,26 +2715,12 @@ estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
case VEC_PACK_TRUNC_EXPR:
case VEC_PACK_SAT_EXPR:
case VEC_PACK_FIX_TRUNC_EXPR:
-
- case WIDEN_MULT_EXPR:
-
case VEC_EXTRACT_EVEN_EXPR:
case VEC_EXTRACT_ODD_EXPR:
case VEC_INTERLEAVE_HIGH_EXPR:
case VEC_INTERLEAVE_LOW_EXPR:
- case RESX_EXPR:
- d->count += 1;
- break;
-
- case SWITCH_EXPR:
- /* Take into account cost of the switch + guess 2 conditional jumps for
- each case label.
-
- TODO: once the switch expansion logic is sufficiently separated, we can
- do better job on estimating cost of the switch. */
- d->count += TREE_VEC_LENGTH (SWITCH_LABELS (x)) * 2;
- break;
+ return 1;
/* Few special cases of expensive operations. This is useful
to avoid inlining on functions having too many of these. */
@@ -2415,34 +2734,115 @@ estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
case FLOOR_MOD_EXPR:
case ROUND_MOD_EXPR:
case RDIV_EXPR:
- d->count += d->weights->div_mod_cost;
+ return weights->div_mod_cost;
+
+ default:
+ /* We expect a copy assignment with no operator. */
+ gcc_assert (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS);
+ return 0;
+ }
+}
+
+
+/* Estimate number of instructions that will be created by expanding
+ the statements in the statement sequence STMTS.
+ WEIGHTS contains weights attributed to various constructs. */
+
+static
+int estimate_num_insns_seq (gimple_seq stmts, eni_weights *weights)
+{
+ int cost;
+ gimple_stmt_iterator gsi;
+
+ cost = 0;
+ for (gsi = gsi_start (stmts); !gsi_end_p (gsi); gsi_next (&gsi))
+ cost += estimate_num_insns (gsi_stmt (gsi), weights);
+
+ return cost;
+}
+
+
+/* Estimate number of instructions that will be created by expanding STMT.
+ WEIGHTS contains weights attributed to various constructs. */
+
+int
+estimate_num_insns (gimple stmt, eni_weights *weights)
+{
+ unsigned cost, i;
+ enum gimple_code code = gimple_code (stmt);
+ tree lhs;
+
+ switch (code)
+ {
+ case GIMPLE_ASSIGN:
+ /* Try to estimate the cost of assignments. We have three cases to
+ deal with:
+ 1) Simple assignments to registers;
+ 2) Stores to things that must live in memory. This includes
+ "normal" stores to scalars, but also assignments of large
+ structures, or constructors of big arrays;
+
+ Let us look at the first two cases, assuming we have "a = b + C":
+ <GIMPLE_ASSIGN <var_decl "a">
+ <plus_expr <var_decl "b"> <constant C>>
+ If "a" is a GIMPLE register, the assignment to it is free on almost
+ any target, because "a" usually ends up in a real register. Hence
+ the only cost of this expression comes from the PLUS_EXPR, and we
+ can ignore the GIMPLE_ASSIGN.
+ If "a" is not a GIMPLE register, the assignment to "a" will most
+ likely be a real store, so the cost of the GIMPLE_ASSIGN is the cost
+ of moving something into "a", which we compute using the function
+ estimate_move_cost. */
+ lhs = gimple_assign_lhs (stmt);
+ if (is_gimple_reg (lhs))
+ cost = 0;
+ else
+ cost = estimate_move_cost (TREE_TYPE (lhs));
+
+ cost += estimate_operator_cost (gimple_assign_rhs_code (stmt), weights);
break;
- case CALL_EXPR:
+
+ case GIMPLE_COND:
+ cost = 1 + estimate_operator_cost (gimple_cond_code (stmt), weights);
+ break;
+
+ case GIMPLE_SWITCH:
+ /* Take into account cost of the switch + guess 2 conditional jumps for
+ each case label.
+
+ TODO: once the switch expansion logic is sufficiently separated, we can
+ do better job on estimating cost of the switch. */
+ cost = gimple_switch_num_labels (stmt) * 2;
+ break;
+
+ case GIMPLE_CALL:
{
- tree decl = get_callee_fndecl (x);
- tree addr = CALL_EXPR_FN (x);
+ tree decl = gimple_call_fndecl (stmt);
+ tree addr = gimple_call_fn (stmt);
tree funtype = TREE_TYPE (addr);
- gcc_assert (POINTER_TYPE_P (funtype));
- funtype = TREE_TYPE (funtype);
+ if (POINTER_TYPE_P (funtype))
+ funtype = TREE_TYPE (funtype);
if (decl && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_MD)
- cost = d->weights->target_builtin_call_cost;
+ cost = weights->target_builtin_call_cost;
else
- cost = d->weights->call_cost;
+ cost = weights->call_cost;
if (decl && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
switch (DECL_FUNCTION_CODE (decl))
{
case BUILT_IN_CONSTANT_P:
- *walk_subtrees = 0;
- return NULL_TREE;
+ return 0;
case BUILT_IN_EXPECT:
- return NULL_TREE;
+ cost = 0;
+ break;
+
/* Prefetch instruction is not expensive. */
case BUILT_IN_PREFETCH:
- cost = 1;
+ cost = weights->target_builtin_call_cost;
break;
+
default:
break;
}
@@ -2450,96 +2850,117 @@ estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
if (decl)
funtype = TREE_TYPE (decl);
- /* Our cost must be kept in sync with cgraph_estimate_size_after_inlining
- that does use function declaration to figure out the arguments.
-
- When we deal with function with no body nor prototype, base estimates on
- actual parameters of the call expression. Otherwise use either the actual
- arguments types or function declaration for more precise answer. */
+ /* Our cost must be kept in sync with
+ cgraph_estimate_size_after_inlining that does use function
+ declaration to figure out the arguments. */
if (decl && DECL_ARGUMENTS (decl))
{
tree arg;
for (arg = DECL_ARGUMENTS (decl); arg; arg = TREE_CHAIN (arg))
- d->count += estimate_move_cost (TREE_TYPE (arg));
+ cost += estimate_move_cost (TREE_TYPE (arg));
}
else if (funtype && prototype_p (funtype))
{
tree t;
for (t = TYPE_ARG_TYPES (funtype); t; t = TREE_CHAIN (t))
- d->count += estimate_move_cost (TREE_VALUE (t));
+ cost += estimate_move_cost (TREE_VALUE (t));
}
else
{
- tree a;
- call_expr_arg_iterator iter;
- FOR_EACH_CALL_EXPR_ARG (a, iter, x)
- d->count += estimate_move_cost (TREE_TYPE (a));
+ for (i = 0; i < gimple_call_num_args (stmt); i++)
+ {
+ tree arg = gimple_call_arg (stmt, i);
+ cost += estimate_move_cost (TREE_TYPE (arg));
+ }
}
- d->count += cost;
break;
}
- case OMP_PARALLEL:
- case OMP_TASK:
- case OMP_FOR:
- case OMP_SECTIONS:
- case OMP_SINGLE:
- case OMP_SECTION:
- case OMP_MASTER:
- case OMP_ORDERED:
- case OMP_CRITICAL:
- case OMP_ATOMIC:
- case OMP_ATOMIC_LOAD:
- /* OpenMP directives are generally very expensive. */
- d->count += d->weights->omp_cost;
- break;
+ case GIMPLE_GOTO:
+ case GIMPLE_LABEL:
+ case GIMPLE_NOP:
+ case GIMPLE_PHI:
+ case GIMPLE_RETURN:
+ case GIMPLE_CHANGE_DYNAMIC_TYPE:
+ case GIMPLE_PREDICT:
+ return 0;
+
+ case GIMPLE_ASM:
+ case GIMPLE_RESX:
+ return 1;
+
+ case GIMPLE_BIND:
+ return estimate_num_insns_seq (gimple_bind_body (stmt), weights);
+
+ case GIMPLE_EH_FILTER:
+ return estimate_num_insns_seq (gimple_eh_filter_failure (stmt), weights);
+
+ case GIMPLE_CATCH:
+ return estimate_num_insns_seq (gimple_catch_handler (stmt), weights);
+
+ case GIMPLE_TRY:
+ return (estimate_num_insns_seq (gimple_try_eval (stmt), weights)
+ + estimate_num_insns_seq (gimple_try_cleanup (stmt), weights));
+
+ /* OpenMP directives are generally very expensive. */
+
+ case GIMPLE_OMP_RETURN:
+ case GIMPLE_OMP_SECTIONS_SWITCH:
+ case GIMPLE_OMP_ATOMIC_STORE:
+ case GIMPLE_OMP_CONTINUE:
+ /* ...except these, which are cheap. */
+ return 0;
+
+ case GIMPLE_OMP_ATOMIC_LOAD:
+ return weights->omp_cost;
+
+ case GIMPLE_OMP_FOR:
+ return (weights->omp_cost
+ + estimate_num_insns_seq (gimple_omp_body (stmt), weights)
+ + estimate_num_insns_seq (gimple_omp_for_pre_body (stmt), weights));
+
+ case GIMPLE_OMP_PARALLEL:
+ case GIMPLE_OMP_TASK:
+ case GIMPLE_OMP_CRITICAL:
+ case GIMPLE_OMP_MASTER:
+ case GIMPLE_OMP_ORDERED:
+ case GIMPLE_OMP_SECTION:
+ case GIMPLE_OMP_SECTIONS:
+ case GIMPLE_OMP_SINGLE:
+ return (weights->omp_cost
+ + estimate_num_insns_seq (gimple_omp_body (stmt), weights));
default:
gcc_unreachable ();
}
- return NULL;
+
+ return cost;
}
-/* Estimate number of instructions that will be created by expanding EXPR.
- WEIGHTS contains weights attributed to various constructs. */
+/* Estimate number of instructions that will be created by expanding
+ function FNDECL. WEIGHTS contains weights attributed to various
+ constructs. */
int
-estimate_num_insns (tree expr, eni_weights *weights)
+estimate_num_insns_fn (tree fndecl, eni_weights *weights)
{
- struct pointer_set_t *visited_nodes;
+ struct function *my_function = DECL_STRUCT_FUNCTION (fndecl);
+ gimple_stmt_iterator bsi;
basic_block bb;
- block_stmt_iterator bsi;
- struct function *my_function;
- struct eni_data data;
-
- data.count = 0;
- data.weights = weights;
+ int n = 0;
- /* If we're given an entire function, walk the CFG. */
- if (TREE_CODE (expr) == FUNCTION_DECL)
+ gcc_assert (my_function && my_function->cfg);
+ FOR_EACH_BB_FN (bb, my_function)
{
- my_function = DECL_STRUCT_FUNCTION (expr);
- gcc_assert (my_function && my_function->cfg);
- visited_nodes = pointer_set_create ();
- FOR_EACH_BB_FN (bb, my_function)
- {
- for (bsi = bsi_start (bb);
- !bsi_end_p (bsi);
- bsi_next (&bsi))
- {
- walk_tree (bsi_stmt_ptr (bsi), estimate_num_insns_1,
- &data, visited_nodes);
- }
- }
- pointer_set_destroy (visited_nodes);
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ n += estimate_num_insns (gsi_stmt (bsi), weights);
}
- else
- walk_tree_without_duplicates (&expr, estimate_num_insns_1, &data);
- return data.count;
+ return n;
}
+
/* Initializes weights used by estimate_num_insns. */
void
@@ -2565,7 +2986,22 @@ init_inline_once (void)
eni_time_weights.omp_cost = 40;
}
+/* Estimate the number of instructions in a gimple_seq. */
+
+int
+count_insns_seq (gimple_seq seq, eni_weights *weights)
+{
+ gimple_stmt_iterator gsi;
+ int n = 0;
+ for (gsi = gsi_start (seq); !gsi_end_p (gsi); gsi_next (&gsi))
+ n += estimate_num_insns (gsi_stmt (gsi), weights);
+
+ return n;
+}
+
+
/* Install new lexical TREE_BLOCK underneath 'current_block'. */
+
static void
add_lexical_block (tree current_block, tree new_block)
{
@@ -2580,13 +3016,25 @@ add_lexical_block (tree current_block, tree new_block)
BLOCK_SUPERCONTEXT (new_block) = current_block;
}
-/* If *TP is a CALL_EXPR, replace it with its inline expansion. */
+/* Fetch callee declaration from the call graph edge going from NODE and
+ associated with STMR call statement. Return NULL_TREE if not found. */
+static tree
+get_indirect_callee_fndecl (struct cgraph_node *node, gimple stmt)
+{
+ struct cgraph_edge *cs;
+
+ cs = cgraph_edge (node, stmt);
+ if (cs)
+ return cs->callee->decl;
+
+ return NULL_TREE;
+}
+
+/* If STMT is a GIMPLE_CALL, replace it with its inline expansion. */
static bool
-expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
+expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id)
{
- copy_body_data *id;
- tree t;
tree retvar, use_retvar;
tree fn;
struct pointer_map_t *st;
@@ -2597,45 +3045,45 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
const char *reason;
basic_block return_block;
edge e;
- block_stmt_iterator bsi, stmt_bsi;
+ gimple_stmt_iterator gsi, stmt_gsi;
bool successfully_inlined = FALSE;
bool purge_dead_abnormal_edges;
tree t_step;
tree var;
- /* See what we've got. */
- id = (copy_body_data *) data;
- t = *tp;
-
/* Set input_location here so we get the right instantiation context
if we call instantiate_decl from inlinable_function_p. */
saved_location = input_location;
- if (EXPR_HAS_LOCATION (t))
- input_location = EXPR_LOCATION (t);
+ if (gimple_has_location (stmt))
+ input_location = gimple_location (stmt);
/* From here on, we're only interested in CALL_EXPRs. */
- if (TREE_CODE (t) != CALL_EXPR)
+ if (gimple_code (stmt) != GIMPLE_CALL)
goto egress;
/* First, see if we can figure out what function is being called.
If we cannot, then there is no hope of inlining the function. */
- fn = get_callee_fndecl (t);
+ fn = gimple_call_fndecl (stmt);
if (!fn)
- goto egress;
+ {
+ fn = get_indirect_callee_fndecl (id->dst_node, stmt);
+ if (!fn)
+ goto egress;
+ }
/* Turn forward declarations into real ones. */
fn = cgraph_node (fn)->decl;
- /* If fn is a declaration of a function in a nested scope that was
+ /* If FN is a declaration of a function in a nested scope that was
globally declared inline, we don't set its DECL_INITIAL.
However, we can't blindly follow DECL_ABSTRACT_ORIGIN because the
C++ front-end uses it for cdtors to refer to their internal
declarations, that are not real functions. Fortunately those
don't have trees to be saved, so we can tell by checking their
- DECL_SAVED_TREE. */
- if (! DECL_INITIAL (fn)
+ gimple_body. */
+ if (!DECL_INITIAL (fn)
&& DECL_ABSTRACT_ORIGIN (fn)
- && DECL_SAVED_TREE (DECL_ABSTRACT_ORIGIN (fn)))
+ && gimple_body (DECL_ABSTRACT_ORIGIN (fn)))
fn = DECL_ABSTRACT_ORIGIN (fn);
/* Objective C and fortran still calls tree_rest_of_compilation directly.
@@ -2655,7 +3103,7 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
where previous inlining turned indirect call into direct call by
constant propagating arguments. In all other cases we hit a bug
(incorrect node sharing is most common reason for missing edges. */
- gcc_assert (dest->needed || !flag_unit_at_a_time);
+ gcc_assert (dest->needed);
cgraph_create_edge (id->dst_node, dest, stmt,
bb->count, CGRAPH_FREQ_BASE,
bb->loop_depth)->inline_failed
@@ -2672,9 +3120,15 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
inlining. */
if (!cgraph_inline_p (cg_edge, &reason))
{
+ /* If this call was originally indirect, we do not want to emit any
+ inlining related warnings or sorry messages because there are no
+ guarantees regarding those. */
+ if (cg_edge->indirect_call)
+ goto egress;
+
if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn))
/* Avoid warnings during early inline pass. */
- && (!flag_unit_at_a_time || cgraph_global_info_ready))
+ && cgraph_global_info_ready)
{
sorry ("inlining failed in call to %q+F: %s", fn, reason);
sorry ("called from here");
@@ -2684,7 +3138,7 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
&& strlen (reason)
&& !lookup_attribute ("noinline", DECL_ATTRIBUTES (fn))
/* Avoid warnings during early inline pass. */
- && (!flag_unit_at_a_time || cgraph_global_info_ready))
+ && cgraph_global_info_ready)
{
warning (OPT_Winline, "inlining failed in call to %q+F: %s",
fn, reason);
@@ -2702,7 +3156,7 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
/* We will be inlining this callee. */
id->eh_region = lookup_stmt_eh_region (stmt);
- /* Split the block holding the CALL_EXPR. */
+ /* Split the block holding the GIMPLE_CALL. */
e = split_block (bb, stmt);
bb = e->src;
return_block = e->dest;
@@ -2711,26 +3165,26 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
/* split_block splits after the statement; work around this by
moving the call into the second block manually. Not pretty,
but seems easier than doing the CFG manipulation by hand
- when the CALL_EXPR is in the last statement of BB. */
- stmt_bsi = bsi_last (bb);
- bsi_remove (&stmt_bsi, false);
+ when the GIMPLE_CALL is in the last statement of BB. */
+ stmt_gsi = gsi_last_bb (bb);
+ gsi_remove (&stmt_gsi, false);
- /* If the CALL_EXPR was in the last statement of BB, it may have
+ /* If the GIMPLE_CALL was in the last statement of BB, it may have
been the source of abnormal edges. In this case, schedule
the removal of dead abnormal edges. */
- bsi = bsi_start (return_block);
- if (bsi_end_p (bsi))
+ gsi = gsi_start_bb (return_block);
+ if (gsi_end_p (gsi))
{
- bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
+ gsi_insert_after (&gsi, stmt, GSI_NEW_STMT);
purge_dead_abnormal_edges = true;
}
else
{
- bsi_insert_before (&bsi, stmt, BSI_NEW_STMT);
+ gsi_insert_before (&gsi, stmt, GSI_NEW_STMT);
purge_dead_abnormal_edges = false;
}
- stmt_bsi = bsi_start (return_block);
+ stmt_gsi = gsi_start_bb (return_block);
/* Build a block containing code to initialize the arguments, the
actual inline expansion of the body, and a label for the return
@@ -2739,7 +3193,7 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
id->block = make_node (BLOCK);
BLOCK_ABSTRACT_ORIGIN (id->block) = fn;
BLOCK_SOURCE_LOCATION (id->block) = input_location;
- add_lexical_block (TREE_BLOCK (stmt), id->block);
+ add_lexical_block (gimple_block (stmt), id->block);
/* Local declarations will be replaced by their equivalents in this
map. */
@@ -2750,27 +3204,33 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
id->src_fn = fn;
id->src_node = cg_edge->callee;
id->src_cfun = DECL_STRUCT_FUNCTION (fn);
- id->call_expr = t;
+ id->gimple_call = stmt;
gcc_assert (!id->src_cfun->after_inlining);
id->entry_bb = bb;
- initialize_inlined_parameters (id, t, fn, bb);
+ if (lookup_attribute ("cold", DECL_ATTRIBUTES (fn)))
+ {
+ gimple_stmt_iterator si = gsi_last_bb (bb);
+ gsi_insert_after (&si, gimple_build_predict (PRED_COLD_FUNCTION,
+ NOT_TAKEN),
+ GSI_NEW_STMT);
+ }
+ initialize_inlined_parameters (id, stmt, fn, bb);
if (DECL_INITIAL (fn))
add_lexical_block (id->block, remap_blocks (DECL_INITIAL (fn), id));
/* Return statements in the function body will be replaced by jumps
to the RET_LABEL. */
-
gcc_assert (DECL_INITIAL (fn));
gcc_assert (TREE_CODE (DECL_INITIAL (fn)) == BLOCK);
- /* Find the lhs to which the result of this call is assigned. */
+ /* Find the LHS to which the result of this call is assigned. */
return_slot = NULL;
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ if (gimple_call_lhs (stmt))
{
- modify_dest = GIMPLE_STMT_OPERAND (stmt, 0);
+ modify_dest = gimple_call_lhs (stmt);
/* The function which we are inlining might not return a value,
in which case we should issue a warning that the function
@@ -2780,7 +3240,8 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
uninitialized variable. */
if (DECL_P (modify_dest))
TREE_NO_WARNING (modify_dest) = 1;
- if (CALL_EXPR_RETURN_SLOT_OPT (t))
+
+ if (gimple_call_return_slot_opt_p (stmt))
{
return_slot = modify_dest;
modify_dest = NULL;
@@ -2801,8 +3262,7 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
}
/* Declare the return variable for the function. */
- retvar = declare_return_variable (id, return_slot,
- modify_dest, &use_retvar);
+ retvar = declare_return_variable (id, return_slot, modify_dest, &use_retvar);
if (DECL_IS_OPERATOR_NEW (fn))
{
@@ -2836,56 +3296,64 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
id->decl_map = st;
/* If the inlined function returns a result that we care about,
- clobber the CALL_EXPR with a reference to the return variable. */
- if (use_retvar && (TREE_CODE (bsi_stmt (stmt_bsi)) != CALL_EXPR))
+ substitute the GIMPLE_CALL with an assignment of the return
+ variable to the LHS of the call. That is, if STMT was
+ 'a = foo (...)', substitute the call with 'a = USE_RETVAR'. */
+ if (use_retvar && gimple_call_lhs (stmt))
{
- *tp = use_retvar;
+ gimple old_stmt = stmt;
+ stmt = gimple_build_assign (gimple_call_lhs (stmt), use_retvar);
+ gsi_replace (&stmt_gsi, stmt, false);
if (gimple_in_ssa_p (cfun))
{
update_stmt (stmt);
mark_symbols_for_renaming (stmt);
}
- maybe_clean_or_replace_eh_stmt (stmt, stmt);
+ maybe_clean_or_replace_eh_stmt (old_stmt, stmt);
}
else
- /* We're modifying a TSI owned by gimple_expand_calls_inline();
- tsi_delink() will leave the iterator in a sane state. */
{
- /* Handle case of inlining function that miss return statement so
- return value becomes undefined. */
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == SSA_NAME)
+ /* Handle the case of inlining a function with no return
+ statement, which causes the return value to become undefined. */
+ if (gimple_call_lhs (stmt)
+ && TREE_CODE (gimple_call_lhs (stmt)) == SSA_NAME)
{
- tree name = GIMPLE_STMT_OPERAND (stmt, 0);
- tree var = SSA_NAME_VAR (GIMPLE_STMT_OPERAND (stmt, 0));
+ tree name = gimple_call_lhs (stmt);
+ tree var = SSA_NAME_VAR (name);
tree def = gimple_default_def (cfun, var);
- /* If the variable is used undefined, make this name undefined via
- move. */
if (def)
{
- GIMPLE_STMT_OPERAND (stmt, 1) = def;
+ /* If the variable is used undefined, make this name
+ undefined via a move. */
+ stmt = gimple_build_assign (gimple_call_lhs (stmt), def);
+ gsi_replace (&stmt_gsi, stmt, true);
update_stmt (stmt);
}
- /* Otherwise make this variable undefined. */
else
{
- bsi_remove (&stmt_bsi, true);
+ /* Otherwise make this variable undefined. */
+ gsi_remove (&stmt_gsi, true);
set_default_def (var, name);
- SSA_NAME_DEF_STMT (name) = build_empty_stmt ();
+ SSA_NAME_DEF_STMT (name) = gimple_build_nop ();
}
}
else
- bsi_remove (&stmt_bsi, true);
+ gsi_remove (&stmt_gsi, true);
}
if (purge_dead_abnormal_edges)
- tree_purge_dead_abnormal_call_edges (return_block);
+ gimple_purge_dead_abnormal_call_edges (return_block);
/* If the value of the new expression is ignored, that's OK. We
don't warn about this for CALL_EXPRs, so we shouldn't warn about
the equivalent inlined version either. */
- TREE_USED (*tp) = 1;
+ if (is_gimple_assign (stmt))
+ {
+ gcc_assert (gimple_assign_single_p (stmt)
+ || CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt)));
+ TREE_USED (gimple_assign_rhs1 (stmt)) = 1;
+ }
/* Output the inlining info for this abstract function, since it has been
inlined. If we don't do this now, we can lose the information about the
@@ -2906,58 +3374,58 @@ expand_call_inline (basic_block bb, tree stmt, tree *tp, void *data)
/* Expand call statements reachable from STMT_P.
We can only have CALL_EXPRs as the "toplevel" tree code or nested
- in a GIMPLE_MODIFY_STMT. See tree-gimple.c:get_call_expr_in(). We can
+ in a MODIFY_EXPR. See tree-gimple.c:get_call_expr_in(). We can
unfortunately not use that function here because we need a pointer
to the CALL_EXPR, not the tree itself. */
static bool
gimple_expand_calls_inline (basic_block bb, copy_body_data *id)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
- /* Register specific tree functions. */
- tree_register_cfg_hooks ();
- 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))
{
- tree *expr_p = bsi_stmt_ptr (bsi);
- tree stmt = *expr_p;
+ gimple stmt = gsi_stmt (gsi);
- if (TREE_CODE (*expr_p) == GIMPLE_MODIFY_STMT)
- expr_p = &GIMPLE_STMT_OPERAND (*expr_p, 1);
- if (TREE_CODE (*expr_p) == WITH_SIZE_EXPR)
- expr_p = &TREE_OPERAND (*expr_p, 0);
- if (TREE_CODE (*expr_p) == CALL_EXPR)
- if (expand_call_inline (bb, stmt, expr_p, id))
- return true;
+ if (is_gimple_call (stmt)
+ && expand_call_inline (bb, stmt, id))
+ return true;
}
+
return false;
}
+
/* Walk all basic blocks created after FIRST and try to fold every statement
in the STATEMENTS pointer set. */
+
static void
fold_marked_statements (int first, struct pointer_set_t *statements)
{
- for (;first < n_basic_blocks;first++)
+ for (; first < n_basic_blocks; first++)
if (BASIC_BLOCK (first))
{
- block_stmt_iterator bsi;
- for (bsi = bsi_start (BASIC_BLOCK (first));
- !bsi_end_p (bsi); bsi_next (&bsi))
- if (pointer_set_contains (statements, bsi_stmt (bsi)))
+ gimple_stmt_iterator gsi;
+
+ for (gsi = gsi_start_bb (BASIC_BLOCK (first));
+ !gsi_end_p (gsi);
+ gsi_next (&gsi))
+ if (pointer_set_contains (statements, gsi_stmt (gsi)))
{
- tree old_stmt = bsi_stmt (bsi);
- tree old_call = get_call_expr_in (old_stmt);
+ gimple old_stmt = gsi_stmt (gsi);
- if (fold_stmt (bsi_stmt_ptr (bsi)))
+ if (fold_stmt (&gsi))
{
- update_stmt (bsi_stmt (bsi));
- if (old_call)
- cgraph_update_edges_for_call_stmt (old_stmt, old_call,
- bsi_stmt (bsi));
- if (maybe_clean_or_replace_eh_stmt (old_stmt,
- bsi_stmt (bsi)))
- tree_purge_dead_eh_edges (BASIC_BLOCK (first));
+ /* Re-read the statement from GSI as fold_stmt() may
+ have changed it. */
+ gimple new_stmt = gsi_stmt (gsi);
+ update_stmt (new_stmt);
+
+ if (is_gimple_call (old_stmt))
+ cgraph_update_edges_for_call_stmt (old_stmt, new_stmt);
+
+ if (maybe_clean_or_replace_eh_stmt (old_stmt, new_stmt))
+ gimple_purge_dead_eh_edges (BASIC_BLOCK (first));
}
}
}
@@ -3021,6 +3489,9 @@ optimize_inline_calls (tree fn)
free_dominance_info (CDI_DOMINATORS);
free_dominance_info (CDI_POST_DOMINATORS);
+ /* Register specific gimple functions. */
+ gimple_register_cfg_hooks ();
+
/* Reach the trees by walking over the CFG, and note the
enclosing basic-blocks in the call edges. */
/* We walk the blocks going forward, because inlined function bodies
@@ -3058,11 +3529,13 @@ optimize_inline_calls (tree fn)
cgraph_node_remove_callees (id.dst_node);
fold_cond_expr_cond ();
+
/* It would be nice to check SSA/CFG/statement consistency here, but it is
not possible yet - the IPA passes might make various functions to not
throw and they don't care to proactively update local EH info. This is
done later in fixup_cfg pass that also execute the verification. */
- return (TODO_update_ssa | TODO_cleanup_cfg
+ return (TODO_update_ssa
+ | TODO_cleanup_cfg
| (gimple_in_ssa_p (cfun) ? TODO_remove_unused_locals : 0)
| (profile_status != PROFILE_ABSENT ? TODO_rebuild_frequencies : 0));
}
@@ -3077,7 +3550,6 @@ copy_tree_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
/* We make copies of most nodes. */
if (IS_EXPR_CODE_CLASS (cl)
- || IS_GIMPLE_STMT_CODE_CLASS (cl)
|| code == TREE_LIST
|| code == TREE_VEC
|| code == TYPE_DECL
@@ -3085,19 +3557,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;
- if (!GIMPLE_TUPLE_P (*tp))
- chain = TREE_CHAIN (*tp);
+ 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. */
@@ -3115,17 +3586,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;
@@ -3248,7 +3719,7 @@ unsave_r (tree *tp, int *walk_subtrees, void *data)
}
else if (TREE_CODE (*tp) == STATEMENT_LIST)
- copy_statement_list (tp);
+ gcc_unreachable ();
else if (TREE_CODE (*tp) == BIND_EXPR)
copy_bind_expr (tp, walk_subtrees, id);
else if (TREE_CODE (*tp) == SAVE_EXPR)
@@ -3301,6 +3772,162 @@ unsave_expr_now (tree expr)
return expr;
}
+/* Called via walk_gimple_seq. If *GSIP points to a GIMPLE_LABEL for a local
+ label, copies the declaration and enters it in the splay_tree in DATA (which
+ is really a 'copy_body_data *'. */
+
+static tree
+mark_local_labels_stmt (gimple_stmt_iterator *gsip,
+ bool *handled_ops_p ATTRIBUTE_UNUSED,
+ struct walk_stmt_info *wi)
+{
+ copy_body_data *id = (copy_body_data *) wi->info;
+ gimple stmt = gsi_stmt (*gsip);
+
+ if (gimple_code (stmt) == GIMPLE_LABEL)
+ {
+ tree decl = gimple_label_label (stmt);
+
+ /* Copy the decl and remember the copy. */
+ insert_decl_map (id, decl, id->copy_decl (decl, id));
+ }
+
+ return NULL_TREE;
+}
+
+
+/* Called via walk_gimple_seq by copy_gimple_seq_and_replace_local.
+ Using the splay_tree pointed to by ST (which is really a `splay_tree'),
+ remaps all local declarations to appropriate replacements in gimple
+ operands. */
+
+static tree
+replace_locals_op (tree *tp, int *walk_subtrees, void *data)
+{
+ struct walk_stmt_info *wi = (struct walk_stmt_info*) data;
+ copy_body_data *id = (copy_body_data *) wi->info;
+ struct pointer_map_t *st = id->decl_map;
+ tree *n;
+ tree expr = *tp;
+
+ /* Only a local declaration (variable or label). */
+ if ((TREE_CODE (expr) == VAR_DECL
+ && !TREE_STATIC (expr))
+ || TREE_CODE (expr) == LABEL_DECL)
+ {
+ /* Lookup the declaration. */
+ n = (tree *) pointer_map_contains (st, expr);
+
+ /* If it's there, remap it. */
+ if (n)
+ *tp = *n;
+ *walk_subtrees = 0;
+ }
+ else if (TREE_CODE (expr) == STATEMENT_LIST
+ || TREE_CODE (expr) == BIND_EXPR
+ || TREE_CODE (expr) == SAVE_EXPR)
+ gcc_unreachable ();
+ else if (TREE_CODE (expr) == TARGET_EXPR)
+ {
+ /* Don't mess with a TARGET_EXPR that hasn't been expanded.
+ It's OK for this to happen if it was part of a subtree that
+ isn't immediately expanded, such as operand 2 of another
+ TARGET_EXPR. */
+ if (!TREE_OPERAND (expr, 1))
+ {
+ TREE_OPERAND (expr, 1) = TREE_OPERAND (expr, 3);
+ TREE_OPERAND (expr, 3) = NULL_TREE;
+ }
+ }
+
+ /* Keep iterating. */
+ return NULL_TREE;
+}
+
+
+/* Called via walk_gimple_seq by copy_gimple_seq_and_replace_local.
+ Using the splay_tree pointed to by ST (which is really a `splay_tree'),
+ remaps all local declarations to appropriate replacements in gimple
+ statements. */
+
+static tree
+replace_locals_stmt (gimple_stmt_iterator *gsip,
+ bool *handled_ops_p ATTRIBUTE_UNUSED,
+ struct walk_stmt_info *wi)
+{
+ copy_body_data *id = (copy_body_data *) wi->info;
+ gimple stmt = gsi_stmt (*gsip);
+
+ if (gimple_code (stmt) == GIMPLE_BIND)
+ {
+ tree block = gimple_bind_block (stmt);
+
+ if (block)
+ {
+ remap_block (&block, id);
+ gimple_bind_set_block (stmt, block);
+ }
+
+ /* This will remap a lot of the same decls again, but this should be
+ harmless. */
+ if (gimple_bind_vars (stmt))
+ gimple_bind_set_vars (stmt, remap_decls (gimple_bind_vars (stmt), id));
+ }
+
+ /* Keep iterating. */
+ return NULL_TREE;
+}
+
+
+/* Copies everything in SEQ and replaces variables and labels local to
+ current_function_decl. */
+
+gimple_seq
+copy_gimple_seq_and_replace_locals (gimple_seq seq)
+{
+ copy_body_data id;
+ struct walk_stmt_info wi;
+ struct pointer_set_t *visited;
+ gimple_seq copy;
+
+ /* There's nothing to do for NULL_TREE. */
+ if (seq == NULL)
+ return seq;
+
+ /* Set up ID. */
+ memset (&id, 0, sizeof (id));
+ id.src_fn = current_function_decl;
+ id.dst_fn = current_function_decl;
+ id.decl_map = pointer_map_create ();
+
+ id.copy_decl = copy_decl_no_change;
+ id.transform_call_graph_edges = CB_CGE_DUPLICATE;
+ id.transform_new_cfg = false;
+ id.transform_return_to_modify = false;
+ id.transform_lang_insert_block = NULL;
+
+ /* Walk the tree once to find local labels. */
+ memset (&wi, 0, sizeof (wi));
+ visited = pointer_set_create ();
+ wi.info = &id;
+ wi.pset = visited;
+ walk_gimple_seq (seq, mark_local_labels_stmt, NULL, &wi);
+ pointer_set_destroy (visited);
+
+ copy = gimple_seq_copy (seq);
+
+ /* Walk the copy, remapping decls. */
+ memset (&wi, 0, sizeof (wi));
+ wi.info = &id;
+ walk_gimple_seq (copy, replace_locals_stmt, replace_locals_op, &wi);
+
+ /* Clean up. */
+ pointer_map_destroy (id.decl_map);
+
+ return copy;
+}
+
+
/* Allow someone to determine if SEARCH is a child of TOP from gdb. */
static tree
@@ -3337,7 +3964,6 @@ declare_inline_vars (tree block, tree vars)
BLOCK_VARS (block) = chainon (BLOCK_VARS (block), vars);
}
-
/* Copy NODE (which must be a DECL). The DECL originally was in the FROM_FN,
but now it will be in the TO_FN. PARM_TO_VAR means enable PARM_DECL to
VAR_DECL translation. */
@@ -3430,7 +4056,6 @@ copy_result_decl_to_var (tree decl, copy_body_data *id)
return copy_decl_for_dup_finish (id, decl, copy);
}
-
tree
copy_decl_no_change (tree decl, copy_body_data *id)
{
@@ -3464,19 +4089,37 @@ copy_decl_maybe_to_var (tree decl, copy_body_data *id)
/* Return a copy of the function's argument tree. */
static tree
-copy_arguments_for_versioning (tree orig_parm, copy_body_data * id)
+copy_arguments_for_versioning (tree orig_parm, copy_body_data * id,
+ bitmap args_to_skip, tree *vars)
{
- tree *arg_copy, *parg;
+ tree arg, *parg;
+ tree new_parm = NULL;
+ int i = 0;
- 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;
- }
- return orig_parm;
+ parg = &new_parm;
+
+ for (arg = orig_parm; arg; arg = TREE_CHAIN (arg), i++)
+ if (!args_to_skip || !bitmap_bit_p (args_to_skip, i))
+ {
+ tree new_tree = remap_decl (arg, id);
+ lang_hooks.dup_lang_specific_decl (new_tree);
+ *parg = new_tree;
+ parg = &TREE_CHAIN (new_tree);
+ }
+ else
+ {
+ /* Make an equivalent VAR_DECL. If the argument was used
+ as temporary variable later in function, the uses will be
+ replaced by local variable. */
+ tree var = copy_decl_to_var (arg, id);
+ get_var_ann (var);
+ add_referenced_var (var);
+ insert_decl_map (id, arg, var);
+ /* Declare this new variable. */
+ TREE_CHAIN (var) = *vars;
+ *vars = var;
+ }
+ return new_parm;
}
/* Return a copy of the function's static chain. */
@@ -3488,10 +4131,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;
}
@@ -3521,7 +4164,7 @@ tree_versionable_function_p (tree fndecl)
of edges of clones of the function will be updated. */
void
tree_function_versioning (tree old_decl, tree new_decl, varray_type tree_map,
- bool update_clones)
+ bool update_clones, bitmap args_to_skip)
{
struct cgraph_node *old_version_node;
struct cgraph_node *new_version_node;
@@ -3530,8 +4173,11 @@ tree_function_versioning (tree old_decl, tree new_decl, varray_type tree_map,
unsigned i;
struct ipa_replace_map *replace_info;
basic_block old_entry_block;
+ VEC (gimple, heap) *init_stmts = VEC_alloc (gimple, heap, 10);
+
tree t_step;
tree old_current_function_decl = current_function_decl;
+ tree vars = NULL_TREE;
gcc_assert (TREE_CODE (old_decl) == FUNCTION_DECL
&& TREE_CODE (new_decl) == FUNCTION_DECL);
@@ -3586,23 +4232,49 @@ tree_function_versioning (tree old_decl, tree new_decl, varray_type tree_map,
/* Copy the function's arguments. */
if (DECL_ARGUMENTS (old_decl) != NULL_TREE)
DECL_ARGUMENTS (new_decl) =
- copy_arguments_for_versioning (DECL_ARGUMENTS (old_decl), &id);
+ copy_arguments_for_versioning (DECL_ARGUMENTS (old_decl), &id,
+ args_to_skip, &vars);
+
+ DECL_INITIAL (new_decl) = remap_blocks (DECL_INITIAL (id.src_fn), &id);
+
+ /* Renumber the lexical scoping (non-code) blocks consecutively. */
+ number_blocks (id.dst_fn);
/* If there's a tree_map, prepare for substitution. */
if (tree_map)
for (i = 0; i < VARRAY_ACTIVE_SIZE (tree_map); i++)
{
- replace_info = (struct ipa_replace_map *) VARRAY_GENERIC_PTR (tree_map, i);
+ gimple init;
+ replace_info
+ = (struct ipa_replace_map *) VARRAY_GENERIC_PTR (tree_map, i);
if (replace_info->replace_p)
- insert_decl_map (&id, replace_info->old_tree,
- replace_info->new_tree);
+ {
+ tree op = replace_info->new_tree;
+
+ STRIP_NOPS (op);
+
+ if (TREE_CODE (op) == VIEW_CONVERT_EXPR)
+ op = TREE_OPERAND (op, 0);
+
+ if (TREE_CODE (op) == ADDR_EXPR)
+ {
+ op = TREE_OPERAND (op, 0);
+ while (handled_component_p (op))
+ op = TREE_OPERAND (op, 0);
+ if (TREE_CODE (op) == VAR_DECL)
+ add_referenced_var (op);
+ }
+ gcc_assert (TREE_CODE (replace_info->old_tree) == PARM_DECL);
+ init = setup_one_parameter (&id, replace_info->old_tree,
+ replace_info->new_tree, id.src_fn,
+ NULL,
+ &vars);
+ if (init)
+ VEC_safe_push (gimple, heap, init_stmts, init);
+ }
}
- DECL_INITIAL (new_decl) = remap_blocks (DECL_INITIAL (id.src_fn), &id);
-
- /* Renumber the lexical scoping (non-code) blocks consecutively. */
- number_blocks (id.dst_fn);
-
+ declare_inline_vars (DECL_INITIAL (new_decl), vars);
if (DECL_STRUCT_FUNCTION (old_decl)->local_decls != NULL_TREE)
/* Add local vars. */
for (t_step = DECL_STRUCT_FUNCTION (old_decl)->local_decls;
@@ -3630,6 +4302,13 @@ tree_function_versioning (tree old_decl, tree new_decl, varray_type tree_map,
/* Renumber the lexical scoping (non-code) blocks consecutively. */
number_blocks (new_decl);
+ if (VEC_length (gimple, init_stmts))
+ {
+ basic_block bb = split_edge (single_succ_edge (ENTRY_BLOCK_PTR));
+ while (VEC_length (gimple, init_stmts))
+ insert_init_stmt (bb, VEC_pop (gimple, init_stmts));
+ }
+
/* Clean up. */
pointer_map_destroy (id.decl_map);
if (!update_clones)
@@ -3654,6 +4333,7 @@ tree_function_versioning (tree old_decl, tree new_decl, varray_type tree_map,
}
free_dominance_info (CDI_DOMINATORS);
free_dominance_info (CDI_POST_DOMINATORS);
+ VEC_free (gimple, heap, init_stmts);
pop_cfun ();
current_function_decl = old_current_function_decl;
gcc_assert (!current_function_decl
@@ -3689,6 +4369,11 @@ build_duplicate_type (tree type)
bool
tree_can_inline_p (tree caller, tree callee)
{
+#if 0
+ /* This causes a regression in SPEC in that it prevents a cold function from
+ inlining a hot function. Perhaps this should only apply to functions
+ that the user declares hot/cold/optimize explicitly. */
+
/* Don't inline a function with a higher optimization level than the
caller, or with different space constraints (hot/cold functions). */
tree caller_tree = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (caller);
@@ -3710,6 +4395,7 @@ tree_can_inline_p (tree caller, tree callee)
|| (caller_opt->optimize_size != callee_opt->optimize_size))
return false;
}
+#endif
/* Allow the backend to decide if inlining is ok. */
return targetm.target_option.can_inline_p (caller, callee);
diff --git a/gcc/tree-inline.h b/gcc/tree-inline.h
index d858b91290f..5fb4f638c1d 100644
--- a/gcc/tree-inline.h
+++ b/gcc/tree-inline.h
@@ -32,13 +32,17 @@ typedef struct copy_body_data
/* FUNCTION_DECL for function being inlined, or in general the
source function providing the original trees. */
tree src_fn;
+
/* FUNCTION_DECL for function being inlined into, or in general
the destination function receiving the new trees. */
tree dst_fn;
+
/* Callgraph node of the source function. */
struct cgraph_node *src_node;
+
/* Callgraph node of the destination function. */
struct cgraph_node *dst_node;
+
/* struct function for function being inlined. Usually this is the same
as DECL_STRUCT_FUNCTION (src_fn), but can be different if saved_cfg
and saved_eh are in use. */
@@ -46,6 +50,7 @@ typedef struct copy_body_data
/* The VAR_DECL for the return value. */
tree retvar;
+
/* The map from local declarations in the inlined function to
equivalents in the function into which it is being inlined. */
struct pointer_map_t *decl_map;
@@ -56,12 +61,13 @@ typedef struct copy_body_data
/* Current BLOCK. */
tree block;
- /* CALL_EXPR if va arg parameter packs should be expanded or NULL
+ /* GIMPLE_CALL if va arg parameter packs should be expanded or NULL
is not. */
- tree call_expr;
+ gimple gimple_call;
/* Exception region the inlined call lie in. */
int eh_region;
+
/* Take region number in the function being copied, add this value and
get eh region number of the duplicate in the function we inline into. */
int eh_region_offset;
@@ -137,31 +143,27 @@ extern eni_weights eni_time_weights;
/* Function prototypes. */
-extern tree copy_body_r (tree *, int *, void *);
+extern tree copy_tree_body_r (tree *, int *, void *);
extern void insert_decl_map (copy_body_data *, tree, tree);
unsigned int optimize_inline_calls (tree);
bool tree_inlinable_function_p (tree);
tree copy_tree_r (tree *, int *, void *);
-tree copy_generic_body (copy_body_data *id);
tree copy_decl_no_change (tree decl, copy_body_data *id);
void save_body (tree, tree *, tree *);
int estimate_move_cost (tree type);
-int estimate_num_insns (tree expr, eni_weights *);
+int estimate_num_insns (gimple, eni_weights *);
+int estimate_num_insns_fn (tree, eni_weights *);
+int count_insns_seq (gimple_seq, eni_weights *);
bool tree_versionable_function_p (tree);
-void tree_function_versioning (tree, tree, varray_type, bool);
+void tree_function_versioning (tree, tree, varray_type, bool, bitmap);
bool tree_can_inline_p (tree, tree);
+extern gimple_seq remap_gimple_seq (gimple_seq, copy_body_data *);
extern tree remap_decl (tree decl, copy_body_data *id);
extern tree remap_type (tree type, copy_body_data *id);
+extern gimple_seq copy_gimple_seq_and_replace_locals (gimple_seq seq);
extern HOST_WIDE_INT estimated_stack_frame_size (void);
-/* 0 if we should not perform inlining.
- 1 if we should expand functions calls inline at the tree level.
- 2 if we should consider *all* functions to be inline
- candidates. */
-
-extern int flag_inline_trees;
-
#endif /* GCC_TREE_INLINE_H */
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index c9e99efa9d1..f0c55905060 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -36,7 +36,7 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic.h"
#include "bitmap.h"
#include "tree-flow.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-inline.h"
#include "varray.h"
#include "timevar.h"
@@ -49,6 +49,7 @@ along with GCC; see the file COPYING3. If not see
#include "params.h"
#include "vecprim.h"
+
/* This file builds the SSA form for a function as described in:
R. Cytron, J. Ferrante, B. Rosen, M. Wegman, and K. Zadeck. Efficiently
Computing Static Single Assignment Form and the Control Dependence
@@ -102,6 +103,7 @@ static htab_t def_blocks;
associated with the current block. */
static VEC(tree,heap) *block_defs_stack;
+
/* Set of existing SSA names being replaced by update_ssa. */
static sbitmap old_ssa_names;
@@ -110,6 +112,7 @@ static sbitmap old_ssa_names;
the operations done on them are presence tests. */
static sbitmap new_ssa_names;
+
/* Symbols whose SSA form needs to be updated or created for the first
time. */
static bitmap syms_to_rename;
@@ -129,11 +132,11 @@ static bitmap names_to_release;
/* For each block, the PHI nodes that need to be rewritten are stored into
these vectors. */
-typedef VEC(tree, heap) *tree_vec;
-DEF_VEC_P (tree_vec);
-DEF_VEC_ALLOC_P (tree_vec, heap);
+typedef VEC(gimple, heap) *gimple_vec;
+DEF_VEC_P (gimple_vec);
+DEF_VEC_ALLOC_P (gimple_vec, heap);
-static VEC(tree_vec, heap) *phis_to_rewrite;
+static VEC(gimple_vec, heap) *phis_to_rewrite;
/* The bitmap of non-NULL elements of PHIS_TO_REWRITE. */
static bitmap blocks_with_phis_to_rewrite;
@@ -152,6 +155,7 @@ struct repl_map_d
bitmap set;
};
+
/* NEW -> OLD_SET replacement table. If we are replacing several
existing SSA names O_1, O_2, ..., O_j with a new name N_i,
then REPL_TBL[N_i] = { O_1, O_2, ..., O_j }. */
@@ -239,19 +243,6 @@ enum rewrite_mode {
};
-/* Use TREE_VISITED to keep track of which statements we want to
- rename. When renaming a subset of the variables, not all
- statements will be processed. This is decided in mark_def_sites. */
-#define REWRITE_THIS_STMT(T) TREE_VISITED (T)
-
-/* Use the unsigned flag to keep track of which statements we want to
- visit when marking new definition sites. This is slightly
- different than REWRITE_THIS_STMT: it's used by update_ssa to
- distinguish statements that need to have both uses and defs
- processed from those that only need to have their defs processed.
- Statements that define new SSA names only need to have their defs
- registered, but they don't need to have their uses renamed. */
-#define REGISTER_DEFS_IN_THIS_STMT(T) (T)->base.unsigned_flag
/* Prototypes for debugging functions. */
@@ -271,6 +262,50 @@ extern void debug_defs_stack (int);
extern void dump_currdefs (FILE *);
extern void debug_currdefs (void);
+/* Return true if STMT needs to be rewritten. When renaming a subset
+ of the variables, not all statements will be processed. This is
+ decided in mark_def_sites. */
+
+static inline bool
+rewrite_uses_p (gimple stmt)
+{
+ return gimple_visited_p (stmt);
+}
+
+
+/* Set the rewrite marker on STMT to the value given by REWRITE_P. */
+
+static inline void
+set_rewrite_uses (gimple stmt, bool rewrite_p)
+{
+ gimple_set_visited (stmt, rewrite_p);
+}
+
+
+/* Return true if the DEFs created by statement STMT should be
+ registered when marking new definition sites. This is slightly
+ different than rewrite_uses_p: it's used by update_ssa to
+ distinguish statements that need to have both uses and defs
+ processed from those that only need to have their defs processed.
+ Statements that define new SSA names only need to have their defs
+ registered, but they don't need to have their uses renamed. */
+
+static inline bool
+register_defs_p (gimple stmt)
+{
+ return gimple_plf (stmt, GF_PLF_1) != 0;
+}
+
+
+/* If REGISTER_DEFS_P is true, mark STMT to have its DEFs registered. */
+
+static inline void
+set_register_defs (gimple stmt, bool register_defs_p)
+{
+ gimple_set_plf (stmt, GF_PLF_1, register_defs_p);
+}
+
+
/* Get the information associated with NAME. */
static inline ssa_name_info_p
@@ -371,7 +406,7 @@ set_current_def (tree var, tree def)
for LIVEIN). */
void
-compute_global_livein (bitmap livein, bitmap def_blocks)
+compute_global_livein (bitmap livein ATTRIBUTE_UNUSED, bitmap def_blocks ATTRIBUTE_UNUSED)
{
basic_block bb, *worklist, *tos;
unsigned i;
@@ -419,24 +454,26 @@ compute_global_livein (bitmap livein, bitmap def_blocks)
static void
initialize_flags_in_bb (basic_block bb)
{
- tree phi, stmt;
- block_stmt_iterator bsi;
+ gimple stmt;
+ gimple_stmt_iterator gsi;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- REWRITE_THIS_STMT (phi) = 0;
- REGISTER_DEFS_IN_THIS_STMT (phi) = 0;
+ gimple phi = gsi_stmt (gsi);
+ set_rewrite_uses (phi, false);
+ set_register_defs (phi, false);
}
- 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);
+ stmt = gsi_stmt (gsi);
+
/* We are going to use the operand cache API, such as
SET_USE, SET_DEF, and FOR_EACH_IMM_USE_FAST. The operand
cache for each statement should be up-to-date. */
- gcc_assert (!stmt_modified_p (stmt));
- REWRITE_THIS_STMT (stmt) = 0;
- REGISTER_DEFS_IN_THIS_STMT (stmt) = 0;
+ gcc_assert (!gimple_modified_p (stmt));
+ set_rewrite_uses (stmt, false);
+ set_register_defs (stmt, false);
}
}
@@ -601,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. */
@@ -620,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;
}
@@ -644,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;
@@ -675,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));
}
@@ -689,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. */
@@ -724,23 +761,26 @@ add_new_name_mapping (tree new, tree old)
static void
mark_def_sites (struct dom_walk_data *walk_data, basic_block bb,
- block_stmt_iterator bsi)
+ gimple_stmt_iterator gsi)
{
struct mark_def_sites_global_data *gd;
bitmap kills;
- tree stmt, def;
+ tree def;
+ gimple stmt;
use_operand_p use_p;
ssa_op_iter iter;
- stmt = bsi_stmt (bsi);
- update_stmt_if_modified (stmt);
+ /* Since this is the first time that we rewrite the program into SSA
+ form, force an operand scan on every statement. */
+ stmt = gsi_stmt (gsi);
+ update_stmt (stmt);
gd = (struct mark_def_sites_global_data *) walk_data->global_data;
kills = gd->kills;
gcc_assert (blocks_to_update == NULL);
- REGISTER_DEFS_IN_THIS_STMT (stmt) = 0;
- REWRITE_THIS_STMT (stmt) = 0;
+ set_register_defs (stmt, false);
+ set_rewrite_uses (stmt, false);
/* If a variable is used before being set, then the variable is live
across a block boundary, so mark it live-on-entry to BB. */
@@ -750,7 +790,7 @@ mark_def_sites (struct dom_walk_data *walk_data, basic_block bb,
gcc_assert (DECL_P (sym));
if (!bitmap_bit_p (kills, DECL_UID (sym)))
set_livein_block (sym, bb);
- REWRITE_THIS_STMT (stmt) = 1;
+ set_rewrite_uses (stmt, true);
}
/* Now process the defs. Mark BB as the definition block and add
@@ -760,12 +800,12 @@ mark_def_sites (struct dom_walk_data *walk_data, basic_block bb,
gcc_assert (DECL_P (def));
set_def_block (def, bb, false);
bitmap_set_bit (kills, DECL_UID (def));
- REGISTER_DEFS_IN_THIS_STMT (stmt) = 1;
+ set_register_defs (stmt, true);
}
/* If we found the statement interesting then also mark the block BB
as interesting. */
- if (REWRITE_THIS_STMT (stmt) || REGISTER_DEFS_IN_THIS_STMT (stmt))
+ if (rewrite_uses_p (stmt) || register_defs_p (stmt))
SET_BIT (gd->interesting_blocks, bb->index);
}
@@ -1007,7 +1047,7 @@ get_default_def_for (tree sym)
if (ddef == NULL_TREE)
{
- ddef = make_ssa_name (sym, build_empty_stmt ());
+ ddef = make_ssa_name (sym, gimple_build_nop ());
set_default_def (sym, ddef);
}
@@ -1018,30 +1058,30 @@ get_default_def_for (tree sym)
/* Marks phi node PHI in basic block BB for rewrite. */
static void
-mark_phi_for_rewrite (basic_block bb, tree phi)
+mark_phi_for_rewrite (basic_block bb, gimple phi)
{
- tree_vec phis;
+ gimple_vec phis;
unsigned i, idx = bb->index;
- if (REWRITE_THIS_STMT (phi))
+ if (rewrite_uses_p (phi))
return;
- REWRITE_THIS_STMT (phi) = 1;
+ set_rewrite_uses (phi, true);
if (!blocks_with_phis_to_rewrite)
return;
bitmap_set_bit (blocks_with_phis_to_rewrite, idx);
- VEC_reserve (tree_vec, heap, phis_to_rewrite, last_basic_block + 1);
- for (i = VEC_length (tree_vec, phis_to_rewrite); i <= idx; i++)
- VEC_quick_push (tree_vec, phis_to_rewrite, NULL);
+ VEC_reserve (gimple_vec, heap, phis_to_rewrite, last_basic_block + 1);
+ for (i = VEC_length (gimple_vec, phis_to_rewrite); i <= idx; i++)
+ VEC_quick_push (gimple_vec, phis_to_rewrite, NULL);
- phis = VEC_index (tree_vec, phis_to_rewrite, idx);
+ phis = VEC_index (gimple_vec, phis_to_rewrite, idx);
if (!phis)
- phis = VEC_alloc (tree, heap, 10);
+ phis = VEC_alloc (gimple, heap, 10);
- VEC_safe_push (tree, heap, phis, phi);
- VEC_replace (tree_vec, phis_to_rewrite, idx, phis);
+ VEC_safe_push (gimple, heap, phis, phi);
+ VEC_replace (gimple_vec, phis_to_rewrite, idx, phis);
}
@@ -1060,7 +1100,7 @@ insert_phi_nodes_for (tree var, bitmap phi_insertion_points, bool update_p)
{
unsigned bb_index;
edge e;
- tree phi;
+ gimple phi;
basic_block bb;
bitmap_iterator bi;
struct def_blocks_d *def_map;
@@ -1082,7 +1122,7 @@ insert_phi_nodes_for (tree var, bitmap phi_insertion_points, bool update_p)
if (update_p)
mark_block_for_update (bb);
- phi = NULL_TREE;
+ phi = NULL;
if (TREE_CODE (var) == SSA_NAME)
{
@@ -1097,7 +1137,7 @@ insert_phi_nodes_for (tree var, bitmap phi_insertion_points, bool update_p)
phi = create_phi_node (var, bb);
new_lhs = duplicate_ssa_name (var, phi);
- SET_PHI_RESULT (phi, new_lhs);
+ gimple_phi_set_result (phi, new_lhs);
add_new_name_mapping (new_lhs, var);
/* Add VAR to every argument slot of PHI. We need VAR in
@@ -1116,7 +1156,7 @@ insert_phi_nodes_for (tree var, bitmap phi_insertion_points, bool update_p)
}
/* Mark this PHI node as interesting for update_ssa. */
- REGISTER_DEFS_IN_THIS_STMT (phi) = 1;
+ set_register_defs (phi, true);
mark_phi_for_rewrite (bb, phi);
}
}
@@ -1231,7 +1271,8 @@ static void
rewrite_initialize_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
basic_block bb)
{
- tree phi;
+ gimple phi;
+ gimple_stmt_iterator gsi;
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "\n\nRenaming block #%d\n\n", bb->index);
@@ -1242,9 +1283,12 @@ rewrite_initialize_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
/* Step 1. Register new definitions for every PHI node in the block.
Conceptually, all the PHI nodes are executed in parallel and each PHI
node introduces a new version for the associated variable. */
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree result = PHI_RESULT (phi);
+ tree result;
+
+ phi = gsi_stmt (gsi);
+ result = gimple_phi_result (phi);
gcc_assert (is_gimple_reg (result));
register_new_def (result, SSA_NAME_VAR (result));
}
@@ -1283,30 +1327,30 @@ get_reaching_def (tree var)
static void
rewrite_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
- basic_block bb ATTRIBUTE_UNUSED, block_stmt_iterator si)
+ basic_block bb ATTRIBUTE_UNUSED, gimple_stmt_iterator si)
{
- tree stmt;
+ gimple stmt;
use_operand_p use_p;
def_operand_p def_p;
ssa_op_iter iter;
- stmt = bsi_stmt (si);
+ stmt = gsi_stmt (si);
/* If mark_def_sites decided that we don't need to rewrite this
statement, ignore it. */
gcc_assert (blocks_to_update == NULL);
- if (!REWRITE_THIS_STMT (stmt) && !REGISTER_DEFS_IN_THIS_STMT (stmt))
+ if (!rewrite_uses_p (stmt) && !register_defs_p (stmt))
return;
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Renaming statement ");
- print_generic_stmt (dump_file, stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
fprintf (dump_file, "\n");
}
/* Step 1. Rewrite USES in the statement. */
- if (REWRITE_THIS_STMT (stmt))
+ if (rewrite_uses_p (stmt))
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE)
{
tree var = USE_FROM_PTR (use_p);
@@ -1315,7 +1359,7 @@ rewrite_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
}
/* Step 2. Register the statement's DEF operands. */
- if (REGISTER_DEFS_IN_THIS_STMT (stmt))
+ if (register_defs_p (stmt))
FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, iter, SSA_OP_DEF)
{
tree var = DEF_FROM_PTR (def_p);
@@ -1340,12 +1384,15 @@ rewrite_add_phi_arguments (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
FOR_EACH_EDGE (e, ei, bb->succs)
{
- tree phi;
+ gimple phi;
+ gimple_stmt_iterator gsi;
- for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (e->dest); !gsi_end_p (gsi);
+ gsi_next (&gsi))
{
tree currdef;
- currdef = get_reaching_def (SSA_NAME_VAR (PHI_RESULT (phi)));
+ phi = gsi_stmt (gsi);
+ currdef = get_reaching_def (SSA_NAME_VAR (gimple_phi_result (phi)));
add_phi_arg (phi, currdef, e);
}
}
@@ -1721,8 +1768,8 @@ rewrite_update_init_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
{
edge e;
edge_iterator ei;
- tree phi;
bool is_abnormal_phi;
+ gimple_stmt_iterator gsi;
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "\n\nRegistering new PHI nodes in block #%d\n\n",
@@ -1749,14 +1796,15 @@ rewrite_update_init_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
register it as a new definition for its corresponding name. Also
register definitions for names whose underlying symbols are
marked for renaming. */
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
tree lhs, lhs_sym;
+ gimple phi = gsi_stmt (gsi);
- if (!REGISTER_DEFS_IN_THIS_STMT (phi))
+ if (!register_defs_p (phi))
continue;
- lhs = PHI_RESULT (phi);
+ lhs = gimple_phi_result (phi);
lhs_sym = SSA_NAME_VAR (lhs);
if (symbol_marked_for_renaming (lhs_sym))
@@ -1834,7 +1882,7 @@ maybe_replace_use (use_operand_p use_p)
DEF_P. */
static inline void
-maybe_register_def (def_operand_p def_p, tree stmt)
+maybe_register_def (def_operand_p def_p, gimple stmt)
{
tree def = DEF_FROM_PTR (def_p);
tree sym = DECL_P (def) ? def : SSA_NAME_VAR (def);
@@ -1876,33 +1924,31 @@ maybe_register_def (def_operand_p def_p, tree stmt)
static void
rewrite_update_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
basic_block bb ATTRIBUTE_UNUSED,
- block_stmt_iterator si)
+ gimple_stmt_iterator si)
{
- stmt_ann_t ann;
- tree stmt;
+ gimple stmt;
use_operand_p use_p;
def_operand_p def_p;
ssa_op_iter iter;
- stmt = bsi_stmt (si);
- ann = stmt_ann (stmt);
+ stmt = gsi_stmt (si);
gcc_assert (bitmap_bit_p (blocks_to_update, bb->index));
/* Only update marked statements. */
- if (!REWRITE_THIS_STMT (stmt) && !REGISTER_DEFS_IN_THIS_STMT (stmt))
+ if (!rewrite_uses_p (stmt) && !register_defs_p (stmt))
return;
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Updating SSA information for statement ");
- print_generic_stmt (dump_file, stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
fprintf (dump_file, "\n");
}
/* Rewrite USES included in OLD_SSA_NAMES and USES whose underlying
symbol is marked for renaming. */
- if (REWRITE_THIS_STMT (stmt))
+ if (rewrite_uses_p (stmt))
{
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE)
maybe_replace_use (use_p);
@@ -1915,7 +1961,7 @@ rewrite_update_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
/* Register definitions of names in NEW_SSA_NAMES and OLD_SSA_NAMES.
Also register definitions for names whose underlying symbol is
marked for renaming. */
- if (REGISTER_DEFS_IN_THIS_STMT (stmt))
+ if (register_defs_p (stmt))
{
FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, iter, SSA_OP_DEF)
maybe_register_def (def_p, stmt);
@@ -1942,19 +1988,19 @@ rewrite_update_phi_arguments (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
FOR_EACH_EDGE (e, ei, bb->succs)
{
- tree phi;
- tree_vec phis;
+ gimple phi;
+ gimple_vec phis;
if (!bitmap_bit_p (blocks_with_phis_to_rewrite, e->dest->index))
continue;
- phis = VEC_index (tree_vec, phis_to_rewrite, e->dest->index);
- for (i = 0; VEC_iterate (tree, phis, i, phi); i++)
+ phis = VEC_index (gimple_vec, phis_to_rewrite, e->dest->index);
+ for (i = 0; VEC_iterate (gimple, phis, i, phi); i++)
{
tree arg, lhs_sym;
use_operand_p arg_p;
- gcc_assert (REWRITE_THIS_STMT (phi));
+ gcc_assert (rewrite_uses_p (phi));
arg_p = PHI_ARG_DEF_PTR_FROM_EDGE (phi, e);
arg = USE_FROM_PTR (arg_p);
@@ -1962,7 +2008,7 @@ rewrite_update_phi_arguments (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
if (arg && !DECL_P (arg) && TREE_CODE (arg) != SSA_NAME)
continue;
- lhs_sym = SSA_NAME_VAR (PHI_RESULT (phi));
+ lhs_sym = SSA_NAME_VAR (gimple_phi_result (phi));
if (arg == NULL_TREE)
{
@@ -2168,7 +2214,6 @@ fini_ssa_renamer (void)
cfun->gimple_df->in_ssa_p = true;
}
-
/* Main entry point into the SSA builder. The renaming process
proceeds in four main phases:
@@ -2264,14 +2309,14 @@ struct gimple_opt_pass pass_build_ssa =
renamer. BLOCKS is the set of blocks that need updating. */
static void
-mark_def_interesting (tree var, tree stmt, basic_block bb, bool insert_phi_p)
+mark_def_interesting (tree var, gimple stmt, basic_block bb, bool insert_phi_p)
{
gcc_assert (bitmap_bit_p (blocks_to_update, bb->index));
- REGISTER_DEFS_IN_THIS_STMT (stmt) = 1;
+ set_register_defs (stmt, true);
if (insert_phi_p)
{
- bool is_phi_p = TREE_CODE (stmt) == PHI_NODE;
+ bool is_phi_p = gimple_code (stmt) == GIMPLE_PHI;
set_def_block (var, bb, is_phi_p);
@@ -2295,17 +2340,17 @@ mark_def_interesting (tree var, tree stmt, basic_block bb, bool insert_phi_p)
nodes. */
static inline void
-mark_use_interesting (tree var, tree stmt, basic_block bb, bool insert_phi_p)
+mark_use_interesting (tree var, gimple stmt, basic_block bb, bool insert_phi_p)
{
- basic_block def_bb = bb_for_stmt (stmt);
+ basic_block def_bb = gimple_bb (stmt);
mark_block_for_update (def_bb);
mark_block_for_update (bb);
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
mark_phi_for_rewrite (def_bb, stmt);
else
- REWRITE_THIS_STMT (stmt) = 1;
+ set_rewrite_uses (stmt, true);
/* If VAR has not been defined in BB, then it is live-on-entry
to BB. Note that we cannot just use the block holding VAR's
@@ -2340,8 +2385,7 @@ static void
prepare_block_for_update (basic_block bb, bool insert_phi_p)
{
basic_block son;
- block_stmt_iterator si;
- tree phi;
+ gimple_stmt_iterator si;
edge e;
edge_iterator ei;
@@ -2349,14 +2393,16 @@ prepare_block_for_update (basic_block bb, bool insert_phi_p)
/* Process PHI nodes marking interesting those that define or use
the symbols that we are interested in. */
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
{
- tree lhs_sym, lhs = PHI_RESULT (phi);
+ gimple phi = gsi_stmt (si);
+ tree lhs_sym, lhs = gimple_phi_result (phi);
lhs_sym = DECL_P (lhs) ? lhs : SSA_NAME_VAR (lhs);
if (!symbol_marked_for_renaming (lhs_sym))
continue;
+
mark_def_interesting (lhs_sym, phi, bb, insert_phi_p);
/* Mark the uses in phi nodes as interesting. It would be more correct
@@ -2367,20 +2413,18 @@ prepare_block_for_update (basic_block bb, bool insert_phi_p)
block that also contains its definition, and thus insert a few more
phi nodes for it. */
FOR_EACH_EDGE (e, ei, bb->preds)
- {
- mark_use_interesting (lhs_sym, phi, e->src, insert_phi_p);
- }
+ mark_use_interesting (lhs_sym, phi, e->src, insert_phi_p);
}
/* Process the statements. */
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
- tree stmt;
+ gimple stmt;
ssa_op_iter i;
use_operand_p use_p;
def_operand_p def_p;
- stmt = bsi_stmt (si);
+ stmt = gsi_stmt (si);
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, i, SSA_OP_ALL_USES)
{
@@ -2419,13 +2463,13 @@ prepare_use_sites_for (tree name, bool insert_phi_p)
FOR_EACH_IMM_USE_FAST (use_p, iter, name)
{
- tree stmt = USE_STMT (use_p);
- basic_block bb = bb_for_stmt (stmt);
+ gimple stmt = USE_STMT (use_p);
+ basic_block bb = gimple_bb (stmt);
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
{
int ix = PHI_ARG_INDEX_FROM_USE (use_p);
- edge e = PHI_ARG_EDGE (stmt, ix);
+ edge e = gimple_phi_arg_edge (stmt, ix);
mark_use_interesting (name, stmt, e->src, insert_phi_p);
}
else
@@ -2445,14 +2489,14 @@ prepare_use_sites_for (tree name, bool insert_phi_p)
static void
prepare_def_site_for (tree name, bool insert_phi_p)
{
- tree stmt;
+ gimple stmt;
basic_block bb;
gcc_assert (names_to_release == NULL
|| !bitmap_bit_p (names_to_release, SSA_NAME_VERSION (name)));
stmt = SSA_NAME_DEF_STMT (name);
- bb = bb_for_stmt (stmt);
+ bb = gimple_bb (stmt);
if (bb)
{
gcc_assert (bb->index < last_basic_block);
@@ -2659,10 +2703,10 @@ delete_update_ssa (void)
if (blocks_with_phis_to_rewrite)
EXECUTE_IF_SET_IN_BITMAP (blocks_with_phis_to_rewrite, 0, i, bi)
{
- tree_vec phis = VEC_index (tree_vec, phis_to_rewrite, i);
+ gimple_vec phis = VEC_index (gimple_vec, phis_to_rewrite, i);
- VEC_free (tree, heap, phis);
- VEC_replace (tree_vec, phis_to_rewrite, i, NULL);
+ VEC_free (gimple, heap, phis);
+ VEC_replace (gimple_vec, phis_to_rewrite, i, NULL);
}
BITMAP_FREE (blocks_with_phis_to_rewrite);
@@ -2676,17 +2720,17 @@ delete_update_ssa (void)
update_ssa's tables. */
tree
-create_new_def_for (tree old_name, tree stmt, def_operand_p def)
+create_new_def_for (tree old_name, gimple stmt, def_operand_p def)
{
tree new_name = duplicate_ssa_name (old_name, stmt);
SET_DEF (def, new_name);
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
{
edge e;
edge_iterator ei;
- basic_block bb = bb_for_stmt (stmt);
+ basic_block bb = gimple_bb (stmt);
/* If needed, mark NEW_NAME as occurring in an abnormal PHI node. */
FOR_EACH_EDGE (e, ei, bb->preds)
@@ -2713,12 +2757,12 @@ create_new_def_for (tree old_name, tree stmt, def_operand_p def)
update_ssa. */
void
-register_new_name_mapping (tree new, tree old)
+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);
}
@@ -2779,7 +2823,7 @@ name_mappings_registered_p (void)
/* Return true if name N has been registered in the replacement table. */
bool
-name_registered_for_update_p (tree n)
+name_registered_for_update_p (tree n ATTRIBUTE_UNUSED)
{
if (!need_ssa_update_p ())
return false;
@@ -3079,7 +3123,7 @@ update_ssa (unsigned update_flags)
blocks_with_phis_to_rewrite = BITMAP_ALLOC (NULL);
if (!phis_to_rewrite)
- phis_to_rewrite = VEC_alloc (tree_vec, heap, last_basic_block);
+ phis_to_rewrite = VEC_alloc (gimple_vec, heap, last_basic_block);
blocks_to_update = BITMAP_ALLOC (NULL);
/* Ensure that the dominance information is up-to-date. */
diff --git a/gcc/tree-iterator.c b/gcc/tree-iterator.c
index 9816f249e1b..d8c151a9f54 100644
--- a/gcc/tree-iterator.c
+++ b/gcc/tree-iterator.c
@@ -22,7 +22,7 @@ along with GCC; see the file COPYING3. If not see
#include "system.h"
#include "coretypes.h"
#include "tree.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-iterator.h"
#include "ggc.h"
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index d15ab80377f..d86391e2af3 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -84,22 +84,25 @@ static void
update_phis_for_loop_copy (struct loop *orig_loop, struct loop *new_loop)
{
tree new_ssa_name;
- tree phi_new, phi_orig;
+ gimple_stmt_iterator si_new, si_orig;
edge orig_loop_latch = loop_latch_edge (orig_loop);
edge orig_entry_e = loop_preheader_edge (orig_loop);
edge new_loop_entry_e = loop_preheader_edge (new_loop);
/* Scan the phis in the headers of the old and new loops
(they are organized in exactly the same order). */
-
- for (phi_new = phi_nodes (new_loop->header),
- phi_orig = phi_nodes (orig_loop->header);
- phi_new && phi_orig;
- phi_new = PHI_CHAIN (phi_new), phi_orig = PHI_CHAIN (phi_orig))
+ for (si_new = gsi_start_phis (new_loop->header),
+ si_orig = gsi_start_phis (orig_loop->header);
+ !gsi_end_p (si_new) && !gsi_end_p (si_orig);
+ gsi_next (&si_new), gsi_next (&si_orig))
{
+ tree def;
+ gimple phi_new = gsi_stmt (si_new);
+ gimple phi_orig = gsi_stmt (si_orig);
+
/* Add the first phi argument for the phi in NEW_LOOP (the one
associated with the entry of NEW_LOOP) */
- tree def = PHI_ARG_DEF_FROM_EDGE (phi_orig, orig_entry_e);
+ def = PHI_ARG_DEF_FROM_EDGE (phi_orig, orig_entry_e);
add_phi_arg (phi_new, def, new_loop_entry_e);
/* Add the second phi argument for the phi in NEW_LOOP (the one
@@ -171,7 +174,7 @@ static bool
generate_loops_for_partition (struct loop *loop, bitmap partition, bool copy_p)
{
unsigned i, x;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
basic_block *bbs;
if (copy_p)
@@ -192,27 +195,19 @@ generate_loops_for_partition (struct loop *loop, bitmap partition, bool copy_p)
for (x = 0, i = 0; i < loop->num_nodes; i++)
{
basic_block bb = bbs[i];
- tree phi, prev = NULL_TREE, next;
- for (phi = phi_nodes (bb); phi;)
+ for (bsi = gsi_start_phis (bb); !gsi_end_p (bsi);)
if (!bitmap_bit_p (partition, x++))
- {
- next = PHI_CHAIN (phi);
- remove_phi_node (phi, prev, true);
- phi = next;
- }
+ remove_phi_node (&bsi, true);
else
- {
- prev = phi;
- phi = PHI_CHAIN (phi);
- }
+ gsi_next (&bsi);
- for (bsi = bsi_start (bb); !bsi_end_p (bsi);)
- if (TREE_CODE (bsi_stmt (bsi)) != LABEL_EXPR
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi);)
+ if (gimple_code (gsi_stmt (bsi)) != GIMPLE_LABEL
&& !bitmap_bit_p (partition, x++))
- bsi_remove (&bsi, false);
+ gsi_remove (&bsi, false);
else
- bsi_next (&bsi);
+ gsi_next (&bsi);
mark_virtual_ops_in_bb (bb);
}
@@ -224,22 +219,22 @@ generate_loops_for_partition (struct loop *loop, bitmap partition, bool copy_p)
/* Generate a call to memset. Return true when the operation succeeded. */
static bool
-generate_memset_zero (tree stmt, tree op0, tree nb_iter,
- block_stmt_iterator bsi)
+generate_memset_zero (gimple stmt, tree op0, tree nb_iter,
+ gimple_stmt_iterator bsi)
{
- tree s, t, stmts, nb_bytes, addr_base;
+ tree t, nb_bytes, addr_base;
bool res = false;
- tree stmt_list = NULL_TREE;
- tree args [3];
- tree fn_call, mem, fndecl, fntype, fn;
- tree_stmt_iterator i;
+ gimple_seq stmts = NULL, stmt_list = NULL;
+ gimple fn_call;
+ tree mem, fndecl, fntype, fn;
+ gimple_stmt_iterator i;
ssa_op_iter iter;
struct data_reference *dr = XCNEW (struct data_reference);
nb_bytes = fold_build2 (MULT_EXPR, TREE_TYPE (nb_iter),
nb_iter, TYPE_SIZE_UNIT (TREE_TYPE (op0)));
nb_bytes = force_gimple_operand (nb_bytes, &stmts, true, NULL);
- append_to_statement_list_force (stmts, &stmt_list);
+ gimple_seq_add_seq (&stmt_list, stmts);
DR_STMT (dr) = stmt;
DR_REF (dr) = op0;
@@ -261,7 +256,7 @@ generate_memset_zero (tree stmt, tree op0, tree nb_iter,
addr_base = size_binop (PLUS_EXPR, DR_OFFSET (dr), DR_INIT (dr));
addr_base = fold_build2 (MINUS_EXPR, sizetype, addr_base, nb_bytes);
addr_base = force_gimple_operand (addr_base, &stmts, true, NULL);
- append_to_statement_list_force (stmts, &stmt_list);
+ gimple_seq_add_seq (&stmt_list, stmts);
addr_base = fold_build2 (POINTER_PLUS_EXPR,
TREE_TYPE (DR_BASE_ADDRESS (dr)),
@@ -271,23 +266,18 @@ generate_memset_zero (tree stmt, tree op0, tree nb_iter,
goto end;
mem = force_gimple_operand (addr_base, &stmts, true, NULL);
- append_to_statement_list_force (stmts, &stmt_list);
-
+ gimple_seq_add_seq (&stmt_list, stmts);
fndecl = implicit_built_in_decls [BUILT_IN_MEMSET];
fntype = TREE_TYPE (fndecl);
fn = build1 (ADDR_EXPR, build_pointer_type (fntype), fndecl);
- args[0] = mem;
- args[1] = integer_zero_node;
- args[2] = nb_bytes;
-
- fn_call = build_call_array (fntype, fn, 3, args);
- append_to_statement_list_force (fn_call, &stmt_list);
+ fn_call = gimple_build_call (fn, 3, mem, integer_zero_node, nb_bytes);
+ gimple_seq_add_stmt (&stmt_list, fn_call);
- for (i = tsi_start (stmt_list); !tsi_end_p (i); tsi_next (&i))
+ for (i = gsi_start (stmt_list); !gsi_end_p (i); gsi_next (&i))
{
- s = tsi_stmt (i);
+ gimple s = gsi_stmt (i);
update_stmt_if_modified (s);
FOR_EACH_SSA_TREE_OPERAND (t, s, iter, SSA_OP_VIRTUAL_DEFS)
@@ -303,6 +293,7 @@ generate_memset_zero (tree stmt, tree op0, tree nb_iter,
{
if (TREE_CODE (t) == SSA_NAME)
{
+ gimple s;
imm_use_iterator imm_iter;
FOR_EACH_IMM_USE_STMT (s, imm_iter, t)
@@ -313,7 +304,7 @@ generate_memset_zero (tree stmt, tree op0, tree nb_iter,
mark_sym_for_renaming (t);
}
- bsi_insert_after (&bsi, stmt_list, BSI_CONTINUE_LINKING);
+ gsi_insert_seq_after (&bsi, stmt_list, GSI_CONTINUE_LINKING);
res = true;
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -334,9 +325,9 @@ generate_builtin (struct loop *loop, bitmap partition, bool copy_p)
bool res = false;
unsigned i, x = 0;
basic_block *bbs;
- tree write = NULL_TREE;
+ gimple write = NULL;
tree op0, op1;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
tree nb_iter = number_of_exit_cond_executions (loop);
if (!nb_iter || nb_iter == chrec_dont_know)
@@ -347,18 +338,17 @@ generate_builtin (struct loop *loop, bitmap partition, bool copy_p)
for (i = 0; i < loop->num_nodes; i++)
{
basic_block bb = bbs[i];
- tree phi;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (bsi = gsi_start_phis (bb); !gsi_end_p (bsi); gsi_next (&bsi))
x++;
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (bsi);
if (bitmap_bit_p (partition, x++)
- && TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && !is_gimple_reg (GIMPLE_STMT_OPERAND (stmt, 0)))
+ && is_gimple_assign (stmt)
+ && !is_gimple_reg (gimple_assign_lhs (stmt)))
{
/* Don't generate the builtins when there are more than
one memory write. */
@@ -373,17 +363,18 @@ generate_builtin (struct loop *loop, bitmap partition, bool copy_p)
if (!write)
goto end;
- op0 = GIMPLE_STMT_OPERAND (write, 0);
- op1 = GIMPLE_STMT_OPERAND (write, 1);
+ op0 = gimple_assign_lhs (write);
+ op1 = gimple_assign_rhs1 (write);
if (!(TREE_CODE (op0) == ARRAY_REF
|| TREE_CODE (op0) == INDIRECT_REF))
goto end;
/* The new statements will be placed before LOOP. */
- bsi = bsi_last (loop_preheader_edge (loop)->src);
+ bsi = gsi_last_bb (loop_preheader_edge (loop)->src);
- if (integer_zerop (op1) || real_zerop (op1))
+ if (gimple_assign_rhs_code (write) == INTEGER_CST
+ && (integer_zerop (op1) || real_zerop (op1)))
res = generate_memset_zero (write, op0, nb_iter, bsi);
/* If this is the last partition for which we generate code, we have
@@ -557,7 +548,7 @@ rdg_flag_uses (struct graph *rdg, int u, bitmap partition, bitmap loops,
ssa_op_iter iter;
use_operand_p use_p;
struct vertex *x = &(rdg->vertices[u]);
- tree stmt = RDGV_STMT (x);
+ gimple stmt = RDGV_STMT (x);
struct graph_edge *anti_dep = has_anti_dependence (x);
/* Keep in the same partition the destination of an antidependence,
@@ -572,7 +563,7 @@ rdg_flag_uses (struct graph *rdg, int u, bitmap partition, bitmap loops,
processed, part_has_writes);
}
- if (TREE_CODE (stmt) != PHI_NODE)
+ if (gimple_code (stmt) != GIMPLE_PHI)
{
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_VIRTUAL_USES)
{
@@ -580,7 +571,7 @@ rdg_flag_uses (struct graph *rdg, int u, bitmap partition, bitmap loops,
if (TREE_CODE (use) == SSA_NAME)
{
- tree def_stmt = SSA_NAME_DEF_STMT (use);
+ gimple def_stmt = SSA_NAME_DEF_STMT (use);
int v = rdg_vertex_for_stmt (rdg, def_stmt);
if (v >= 0
@@ -591,10 +582,9 @@ rdg_flag_uses (struct graph *rdg, int u, bitmap partition, bitmap loops,
}
}
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && has_upstream_mem_writes (u))
+ if (is_gimple_assign (stmt) && has_upstream_mem_writes (u))
{
- tree op0 = GIMPLE_STMT_OPERAND (stmt, 0);
+ tree op0 = gimple_assign_lhs (stmt);
/* Scalar channels don't have enough space for transmitting data
between tasks, unless we add more storage by privatizing. */
@@ -667,7 +657,7 @@ rdg_flag_vertex_and_dependent (struct graph *rdg, int v, bitmap partition,
blocks of LOOP. */
static void
-collect_condition_stmts (struct loop *loop, VEC (tree, heap) **conds)
+collect_condition_stmts (struct loop *loop, VEC (gimple, heap) **conds)
{
unsigned i;
edge e;
@@ -675,10 +665,10 @@ collect_condition_stmts (struct loop *loop, VEC (tree, heap) **conds)
for (i = 0; VEC_iterate (edge, exits, i, e); i++)
{
- tree cond = last_stmt (e->src);
+ gimple cond = last_stmt (e->src);
if (cond)
- VEC_safe_push (tree, heap, *conds, cond);
+ VEC_safe_push (gimple, heap, *conds, cond);
}
VEC_free (edge, heap, exits);
@@ -694,14 +684,14 @@ rdg_flag_loop_exits (struct graph *rdg, bitmap loops, bitmap partition,
{
unsigned i;
bitmap_iterator bi;
- VEC (tree, heap) *conds = VEC_alloc (tree, heap, 3);
+ VEC (gimple, heap) *conds = VEC_alloc (gimple, heap, 3);
EXECUTE_IF_SET_IN_BITMAP (loops, 0, i, bi)
collect_condition_stmts (get_loop (i), &conds);
- while (!VEC_empty (tree, conds))
+ while (!VEC_empty (gimple, conds))
{
- tree cond = VEC_pop (tree, conds);
+ gimple cond = VEC_pop (gimple, conds);
int v = rdg_vertex_for_stmt (rdg, cond);
bitmap new_loops = BITMAP_ALLOC (NULL);
@@ -1050,11 +1040,11 @@ ldist_gen (struct loop *loop, struct graph *rdg,
Returns the number of distributed loops. */
static int
-distribute_loop (struct loop *loop, VEC (tree, heap) *stmts)
+distribute_loop (struct loop *loop, VEC (gimple, heap) *stmts)
{
bool res = false;
struct graph *rdg;
- tree s;
+ gimple s;
unsigned i;
VEC (int, heap) *vertices;
@@ -1085,7 +1075,7 @@ distribute_loop (struct loop *loop, VEC (tree, heap) *stmts)
if (dump_file && (dump_flags & TDF_DETAILS))
dump_rdg (dump_file, rdg);
- for (i = 0; VEC_iterate (tree, stmts, i, s); i++)
+ for (i = 0; VEC_iterate (gimple, stmts, i, s); i++)
{
int v = rdg_vertex_for_stmt (rdg, s);
@@ -1117,7 +1107,7 @@ tree_loop_distribution (void)
FOR_EACH_LOOP (li, loop, 0)
{
- VEC (tree, heap) *work_list = VEC_alloc (tree, heap, 3);
+ VEC (gimple, heap) *work_list = VEC_alloc (gimple, heap, 3);
/* With the following working list, we're asking distribute_loop
to separate the stores of the loop: when dependences allow,
@@ -1143,7 +1133,7 @@ tree_loop_distribution (void)
verify_loop_structure ();
- VEC_free (tree, heap, work_list);
+ VEC_free (gimple, heap, work_list);
}
return 0;
diff --git a/gcc/tree-loop-linear.c b/gcc/tree-loop-linear.c
index f58bd11b7fb..66d25ec1beb 100644
--- a/gcc/tree-loop-linear.c
+++ b/gcc/tree-loop-linear.c
@@ -89,13 +89,13 @@ along with GCC; see the file COPYING3. If not see
*/
static void
-gather_interchange_stats (VEC (ddr_p, heap) *dependence_relations,
- VEC (data_reference_p, heap) *datarefs,
- struct loop *loop,
- struct loop *first_loop,
- unsigned int *dependence_steps,
- unsigned int *nb_deps_not_carried_by_loop,
- double_int *access_strides)
+gather_interchange_stats (VEC (ddr_p, heap) *dependence_relations ATTRIBUTE_UNUSED,
+ VEC (data_reference_p, heap) *datarefs ATTRIBUTE_UNUSED,
+ struct loop *loop ATTRIBUTE_UNUSED,
+ struct loop *first_loop ATTRIBUTE_UNUSED,
+ unsigned int *dependence_steps ATTRIBUTE_UNUSED,
+ unsigned int *nb_deps_not_carried_by_loop ATTRIBUTE_UNUSED,
+ double_int *access_strides ATTRIBUTE_UNUSED)
{
unsigned int i, j;
struct data_dependence_relation *ddr;
@@ -135,7 +135,7 @@ gather_interchange_stats (VEC (ddr_p, heap) *dependence_relations,
{
unsigned int it;
tree ref = DR_REF (dr);
- tree stmt = DR_STMT (dr);
+ gimple stmt = DR_STMT (dr);
struct loop *stmt_loop = loop_containing_stmt (stmt);
struct loop *inner_loop = first_loop->inner;
@@ -319,9 +319,9 @@ linear_transform_loops (void)
VEC(tree,heap) *oldivs = NULL;
VEC(tree,heap) *invariants = NULL;
VEC(tree,heap) *lambda_parameters = NULL;
- VEC(tree,heap) *remove_ivs = VEC_alloc (tree, heap, 3);
+ VEC(gimple,heap) *remove_ivs = VEC_alloc (gimple, heap, 3);
struct loop *loop_nest;
- tree oldiv_stmt;
+ gimple oldiv_stmt;
unsigned i;
FOR_EACH_LOOP (li, loop_nest, 0)
@@ -412,12 +412,12 @@ linear_transform_loops (void)
free_data_refs (datarefs);
}
- for (i = 0; VEC_iterate (tree, remove_ivs, i, oldiv_stmt); i++)
+ for (i = 0; VEC_iterate (gimple, remove_ivs, i, oldiv_stmt); i++)
remove_iv (oldiv_stmt);
VEC_free (tree, heap, oldivs);
VEC_free (tree, heap, invariants);
- VEC_free (tree, heap, remove_ivs);
+ VEC_free (gimple, heap, remove_ivs);
scev_reset ();
if (modified)
diff --git a/gcc/tree-mudflap.c b/gcc/tree-mudflap.c
index 46650b37dd4..3f77b2cb1f6 100644
--- a/gcc/tree-mudflap.c
+++ b/gcc/tree-mudflap.c
@@ -33,7 +33,8 @@ along with GCC; see the file COPYING3. If not see
#include "flags.h"
#include "function.h"
#include "tree-inline.h"
-#include "tree-gimple.h"
+#include "gimple.h"
+#include "tree-iterator.h"
#include "tree-flow.h"
#include "tree-mudflap.h"
#include "tree-dump.h"
@@ -45,6 +46,7 @@ along with GCC; see the file COPYING3. If not see
#include "ggc.h"
#include "cgraph.h"
#include "toplev.h"
+#include "gimple.h"
/* Internal function decls */
@@ -64,9 +66,10 @@ static void mf_xform_derefs (void);
static unsigned int execute_mudflap_function_ops (void);
/* Addressable variables instrumentation. */
-static void mf_xform_decls (tree, tree);
-static tree mx_xfn_xform_decls (tree *, int *, void *);
-static void mx_register_decls (tree, tree *);
+static void mf_xform_decls (gimple_seq, tree);
+static tree mx_xfn_xform_decls (gimple_stmt_iterator *, bool *,
+ struct walk_stmt_info *);
+static gimple_seq mx_register_decls (tree, gimple_seq, location_t);
static unsigned int execute_mudflap_function_decls (void);
@@ -451,8 +454,8 @@ execute_mudflap_function_ops (void)
static void
mf_decl_cache_locals (void)
{
- tree t, shift_init_stmts, mask_init_stmts;
- tree_stmt_iterator tsi;
+ gimple g;
+ gimple_seq seq = gimple_seq_alloc ();
/* Build the cache vars. */
mf_cache_shift_decl_l
@@ -465,28 +468,17 @@ mf_decl_cache_locals (void)
/* Build initialization nodes for the cache vars. We just load the
globals into the cache variables. */
- t = build_gimple_modify_stmt (mf_cache_shift_decl_l, mf_cache_shift_decl);
- SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (current_function_decl));
- gimplify_to_stmt_list (&t);
- shift_init_stmts = t;
-
- t = build_gimple_modify_stmt (mf_cache_mask_decl_l, mf_cache_mask_decl);
- SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (current_function_decl));
- gimplify_to_stmt_list (&t);
- mask_init_stmts = t;
-
- /* Anticipating multiple entry points, we insert the cache vars
- initializers in each successor of the ENTRY_BLOCK_PTR. */
- for (tsi = tsi_start (shift_init_stmts);
- ! tsi_end_p (tsi);
- tsi_next (&tsi))
- insert_edge_copies (tsi_stmt (tsi), ENTRY_BLOCK_PTR);
-
- for (tsi = tsi_start (mask_init_stmts);
- ! tsi_end_p (tsi);
- tsi_next (&tsi))
- insert_edge_copies (tsi_stmt (tsi), ENTRY_BLOCK_PTR);
- bsi_commit_edge_inserts ();
+ g = gimple_build_assign (mf_cache_shift_decl_l, mf_cache_shift_decl);
+ gimple_set_location (g, DECL_SOURCE_LOCATION (current_function_decl));
+ gimple_seq_add_stmt (&seq, g);
+
+ g = gimple_build_assign (mf_cache_mask_decl_l, mf_cache_mask_decl);
+ gimple_set_location (g, DECL_SOURCE_LOCATION (current_function_decl));
+ gimple_seq_add_stmt (&seq, g);
+
+ insert_edge_copies_seq (seq, ENTRY_BLOCK_PTR);
+
+ gsi_commit_edge_inserts ();
}
@@ -500,27 +492,28 @@ mf_decl_clear_locals (void)
static void
mf_build_check_statement_for (tree base, tree limit,
- block_stmt_iterator *instr_bsi,
- location_t *locus, tree dirflag)
+ gimple_stmt_iterator *instr_gsi,
+ location_t location, tree dirflag)
{
- tree_stmt_iterator head, tsi;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
basic_block cond_bb, then_bb, join_bb;
edge e;
tree cond, t, u, v;
tree mf_base;
tree mf_elem;
tree mf_limit;
+ gimple g;
+ gimple_seq seq;
/* We first need to split the current basic block, and start altering
the CFG. This allows us to insert the statements we're about to
construct into the right basic blocks. */
- cond_bb = bb_for_stmt (bsi_stmt (*instr_bsi));
- bsi = *instr_bsi;
- bsi_prev (&bsi);
- if (! bsi_end_p (bsi))
- e = split_block (cond_bb, bsi_stmt (bsi));
+ cond_bb = gimple_bb (gsi_stmt (*instr_gsi));
+ gsi = *instr_gsi;
+ gsi_prev (&gsi);
+ if (! gsi_end_p (gsi))
+ e = split_block (cond_bb, gsi_stmt (gsi));
else
e = split_block_after_labels (cond_bb);
cond_bb = e->src;
@@ -558,21 +551,19 @@ mf_build_check_statement_for (tree base, tree limit,
mf_limit = create_tmp_var (mf_uintptr_type, "__mf_limit");
/* Build: __mf_base = (uintptr_t) <base address expression>. */
- t = build_gimple_modify_stmt (mf_base,
- fold_convert (mf_uintptr_type,
- unshare_expr (base)));
- SET_EXPR_LOCUS (t, locus);
- gimplify_to_stmt_list (&t);
- head = tsi_start (t);
- tsi = tsi_last (t);
+ seq = gimple_seq_alloc ();
+ t = fold_convert (mf_uintptr_type, unshare_expr (base));
+ gimplify_expr (&t, &seq, &seq, is_gimple_reg_rhs, fb_rvalue);
+ g = gimple_build_assign (mf_base, t);
+ gimple_set_location (g, location);
+ gimple_seq_add_stmt (&seq, g);
/* Build: __mf_limit = (uintptr_t) <limit address expression>. */
- t = build_gimple_modify_stmt (mf_limit,
- fold_convert (mf_uintptr_type,
- unshare_expr (limit)));
- SET_EXPR_LOCUS (t, locus);
- gimplify_to_stmt_list (&t);
- tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
+ t = fold_convert (mf_uintptr_type, unshare_expr (limit));
+ gimplify_expr (&t, &seq, &seq, is_gimple_reg_rhs, fb_rvalue);
+ g = gimple_build_assign (mf_limit, t);
+ gimple_set_location (g, location);
+ gimple_seq_add_stmt (&seq, g);
/* Build: __mf_elem = &__mf_lookup_cache [(__mf_base >> __mf_shift)
& __mf_mask]. */
@@ -586,10 +577,10 @@ mf_build_check_statement_for (tree base, tree limit,
TREE_TYPE (TREE_TYPE (mf_cache_array_decl)),
mf_cache_array_decl, t, NULL_TREE, NULL_TREE);
t = build1 (ADDR_EXPR, mf_cache_structptr_type, t);
- t = build_gimple_modify_stmt (mf_elem, t);
- SET_EXPR_LOCUS (t, locus);
- gimplify_to_stmt_list (&t);
- tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
+ gimplify_expr (&t, &seq, &seq, is_gimple_reg_rhs, fb_rvalue);
+ g = gimple_build_assign (mf_elem, t);
+ gimple_set_location (g, location);
+ gimple_seq_add_stmt (&seq, g);
/* Quick validity check.
@@ -631,16 +622,18 @@ mf_build_check_statement_for (tree base, tree limit,
result of the evaluation of 't' in a temporary variable which we
can use as the condition for the conditional jump. */
t = build2 (TRUTH_OR_EXPR, boolean_type_node, t, u);
+ gimplify_expr (&t, &seq, &seq, is_gimple_reg_rhs, fb_rvalue);
cond = create_tmp_var (boolean_type_node, "__mf_unlikely_cond");
- t = build_gimple_modify_stmt (cond, t);
- gimplify_to_stmt_list (&t);
- tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
+ g = gimple_build_assign (cond, t);
+ gimple_set_location (g, location);
+ gimple_seq_add_stmt (&seq, g);
/* Build the conditional jump. 'cond' is just a temporary so we can
simply build a void COND_EXPR. We do need labels in both arms though. */
- t = build3 (COND_EXPR, void_type_node, cond, NULL_TREE, NULL_TREE);
- SET_EXPR_LOCUS (t, locus);
- tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
+ g = gimple_build_cond (NE_EXPR, cond, integer_zero_node, NULL_TREE,
+ NULL_TREE);
+ gimple_set_location (g, location);
+ gimple_seq_add_stmt (&seq, g);
/* At this point, after so much hard work, we have only constructed
the conditional jump,
@@ -653,9 +646,8 @@ mf_build_check_statement_for (tree base, tree limit,
We can insert this now in the current basic block, i.e. the one that
the statement we're instrumenting was originally in. */
- bsi = bsi_last (cond_bb);
- for (tsi = head; ! tsi_end_p (tsi); tsi_next (&tsi))
- bsi_insert_after (&bsi, tsi_stmt (tsi), BSI_CONTINUE_LINKING);
+ gsi = gsi_last_bb (cond_bb);
+ gsi_insert_seq_after (&gsi, seq, GSI_CONTINUE_LINKING);
/* Now build up the body of the cache-miss handling:
@@ -664,33 +656,31 @@ mf_build_check_statement_for (tree base, tree limit,
This is the body of the conditional. */
- u = mf_file_function_line_tree (locus == NULL ? UNKNOWN_LOCATION : *locus);
+ seq = gimple_seq_alloc ();
+ /* u is a string, so it is already a gimple value. */
+ u = mf_file_function_line_tree (location);
/* NB: we pass the overall [base..limit] range to mf_check. */
v = fold_build2 (PLUS_EXPR, integer_type_node,
fold_build2 (MINUS_EXPR, mf_uintptr_type, mf_limit, mf_base),
integer_one_node);
- t = build_call_expr (mf_check_fndecl, 4, mf_base, v, dirflag, u);
- gimplify_to_stmt_list (&t);
- head = tsi_start (t);
- tsi = tsi_last (t);
+ gimplify_expr (&v, &seq, &seq, is_gimple_mem_rhs, fb_rvalue);
+ g = gimple_build_call (mf_check_fndecl, 4, mf_base, v, dirflag, u);
+ gimple_seq_add_stmt (&seq, g);
if (! flag_mudflap_threads)
{
- t = build_gimple_modify_stmt (mf_cache_shift_decl_l,
- mf_cache_shift_decl);
- tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
+ g = gimple_build_assign (mf_cache_shift_decl_l, mf_cache_shift_decl);
+ gimple_seq_add_stmt (&seq, g);
- t = build_gimple_modify_stmt (mf_cache_mask_decl_l,
- mf_cache_mask_decl);
- tsi_link_after (&tsi, t, TSI_CONTINUE_LINKING);
+ g = gimple_build_assign (mf_cache_mask_decl_l, mf_cache_mask_decl);
+ gimple_seq_add_stmt (&seq, g);
}
/* Insert the check code in the THEN block. */
- bsi = bsi_start (then_bb);
- for (tsi = head; ! tsi_end_p (tsi); tsi_next (&tsi))
- bsi_insert_after (&bsi, tsi_stmt (tsi), BSI_CONTINUE_LINKING);
+ gsi = gsi_start_bb (then_bb);
+ gsi_insert_seq_after (&gsi, seq, GSI_CONTINUE_LINKING);
- *instr_bsi = bsi_start (join_bb);
+ *instr_gsi = gsi_start_bb (join_bb);
}
@@ -717,8 +707,8 @@ mf_decl_eligible_p (tree decl)
static void
-mf_xform_derefs_1 (block_stmt_iterator *iter, tree *tp,
- location_t *locus, tree dirflag)
+mf_xform_derefs_1 (gimple_stmt_iterator *iter, tree *tp,
+ location_t location, tree dirflag)
{
tree type, base, limit, addr, size, t;
@@ -898,44 +888,45 @@ mf_xform_derefs_1 (block_stmt_iterator *iter, tree *tp,
return;
}
- mf_build_check_statement_for (base, limit, iter, locus, dirflag);
+ mf_build_check_statement_for (base, limit, iter, location, dirflag);
}
static void
mf_xform_derefs (void)
{
basic_block bb, next;
- block_stmt_iterator i;
+ gimple_stmt_iterator i;
int saved_last_basic_block = last_basic_block;
+ enum gimple_rhs_class grhs_class;
bb = ENTRY_BLOCK_PTR ->next_bb;
do
{
next = bb->next_bb;
- for (i = bsi_start (bb); !bsi_end_p (i); bsi_next (&i))
+ for (i = gsi_start_bb (bb); !gsi_end_p (i); gsi_next (&i))
{
- tree s = bsi_stmt (i);
+ gimple s = gsi_stmt (i);
/* Only a few GIMPLE statements can reference memory. */
- switch (TREE_CODE (s))
+ switch (gimple_code (s))
{
- case GIMPLE_MODIFY_STMT:
- mf_xform_derefs_1 (&i, &GIMPLE_STMT_OPERAND (s, 0),
- EXPR_LOCUS (s), integer_one_node);
- mf_xform_derefs_1 (&i, &GIMPLE_STMT_OPERAND (s, 1),
- EXPR_LOCUS (s), integer_zero_node);
+ case GIMPLE_ASSIGN:
+ mf_xform_derefs_1 (&i, gimple_assign_lhs_ptr (s),
+ gimple_location (s), integer_one_node);
+ mf_xform_derefs_1 (&i, gimple_assign_rhs1_ptr (s),
+ gimple_location (s), integer_zero_node);
+ 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;
- case RETURN_EXPR:
- if (TREE_OPERAND (s, 0) != NULL_TREE)
+ case GIMPLE_RETURN:
+ if (gimple_return_retval (s) != NULL_TREE)
{
- if (TREE_CODE (TREE_OPERAND (s, 0)) == GIMPLE_MODIFY_STMT)
- mf_xform_derefs_1 (&i, &GIMPLE_STMT_OPERAND
- (TREE_OPERAND (s, 0), 1),
- EXPR_LOCUS (s), integer_zero_node);
- else
- mf_xform_derefs_1 (&i, &TREE_OPERAND (s, 0), EXPR_LOCUS (s),
- integer_zero_node);
+ mf_xform_derefs_1 (&i, gimple_return_retval_ptr (s),
+ gimple_location (s),
+ integer_zero_node);
}
break;
@@ -970,7 +961,7 @@ execute_mudflap_function_decls (void)
push_gimplify_context (&gctx);
- mf_xform_decls (DECL_SAVED_TREE (current_function_decl),
+ mf_xform_decls (gimple_body (current_function_decl),
DECL_ARGUMENTS (current_function_decl));
pop_gimplify_context (NULL);
@@ -988,12 +979,13 @@ struct mf_xform_decls_data
/* Synthesize a CALL_EXPR and a TRY_FINALLY_EXPR, for this chain of
_DECLs if appropriate. Arrange to call the __mf_register function
- now, and the __mf_unregister function later for each. */
-static void
-mx_register_decls (tree decl, tree *stmt_list)
+ now, and the __mf_unregister function later for each. Return the
+ gimple sequence after synthesis. */
+gimple_seq
+mx_register_decls (tree decl, gimple_seq seq, location_t location)
{
- tree finally_stmts = NULL_TREE;
- tree_stmt_iterator initially_stmts = tsi_start (*stmt_list);
+ gimple_seq finally_stmts = NULL;
+ gimple_stmt_iterator initially_stmts = gsi_start (seq);
while (decl != NULL_TREE)
{
@@ -1005,46 +997,46 @@ mx_register_decls (tree decl, tree *stmt_list)
&& ! TREE_STATIC (decl))
{
tree size = NULL_TREE, variable_name;
- tree unregister_fncall, unregister_fncall_param;
- tree register_fncall, register_fncall_param;
+ gimple unregister_fncall, register_fncall;
+ tree unregister_fncall_param, register_fncall_param;
+ /* Variable-sized objects should have sizes already been
+ gimplified when we got here. */
size = convert (size_type_node, TYPE_SIZE_UNIT (TREE_TYPE (decl)));
-
+ gcc_assert (is_gimple_val (size));
+
unregister_fncall_param =
- convert (ptr_type_node,
- mf_mark (build1 (ADDR_EXPR,
- build_pointer_type (TREE_TYPE (decl)),
- decl)));
+ mf_mark (build1 (ADDR_EXPR,
+ build_pointer_type (TREE_TYPE (decl)),
+ decl));
/* __mf_unregister (&VARIABLE, sizeof (VARIABLE), __MF_TYPE_STACK) */
- unregister_fncall = build_call_expr (mf_unregister_fndecl, 3,
- unregister_fncall_param,
- size,
- build_int_cst (NULL_TREE, 3));
+ unregister_fncall = gimple_build_call (mf_unregister_fndecl, 3,
+ unregister_fncall_param,
+ size,
+ build_int_cst (NULL_TREE, 3));
variable_name = mf_varname_tree (decl);
register_fncall_param =
- convert (ptr_type_node,
- mf_mark (build1 (ADDR_EXPR,
- build_pointer_type (TREE_TYPE (decl)),
- decl)));
+ mf_mark (build1 (ADDR_EXPR,
+ build_pointer_type (TREE_TYPE (decl)),
+ decl));
/* __mf_register (&VARIABLE, sizeof (VARIABLE), __MF_TYPE_STACK,
"name") */
- register_fncall = build_call_expr (mf_register_fndecl, 4,
- register_fncall_param,
- size,
- build_int_cst (NULL_TREE, 3),
- variable_name);
-
+ register_fncall = gimple_build_call (mf_register_fndecl, 4,
+ register_fncall_param,
+ size,
+ build_int_cst (NULL_TREE, 3),
+ variable_name);
+
/* Accumulate the two calls. */
- /* ??? Set EXPR_LOCATION. */
- gimplify_stmt (&register_fncall);
- gimplify_stmt (&unregister_fncall);
+ gimple_set_location (register_fncall, location);
+ gimple_set_location (unregister_fncall, location);
/* Add the __mf_register call at the current appending point. */
- if (tsi_end_p (initially_stmts))
+ if (gsi_end_p (initially_stmts))
{
if (!DECL_ARTIFICIAL (decl))
warning (OPT_Wmudflap,
@@ -1053,11 +1045,11 @@ mx_register_decls (tree decl, tree *stmt_list)
}
else
{
- tsi_link_before (&initially_stmts, register_fncall,
- TSI_SAME_STMT);
+ gsi_insert_before (&initially_stmts, register_fncall,
+ GSI_SAME_STMT);
/* Accumulate the FINALLY piece. */
- append_to_statement_list (unregister_fncall, &finally_stmts);
+ gimple_seq_add_stmt (&finally_stmts, unregister_fncall);
}
mf_mark (decl);
}
@@ -1066,39 +1058,46 @@ mx_register_decls (tree decl, tree *stmt_list)
}
/* Actually, (initially_stmts!=NULL) <=> (finally_stmts!=NULL) */
- if (finally_stmts != NULL_TREE)
+ if (finally_stmts != NULL)
{
- tree t = build2 (TRY_FINALLY_EXPR, void_type_node,
- *stmt_list, finally_stmts);
- *stmt_list = NULL;
- append_to_statement_list (t, stmt_list);
+ gimple stmt = gimple_build_try (seq, finally_stmts, GIMPLE_TRY_FINALLY);
+ gimple_seq new_seq = gimple_seq_alloc ();
+
+ gimple_seq_add_stmt (&new_seq, stmt);
+ return new_seq;
}
+ else
+ return seq;
}
/* Process every variable mentioned in BIND_EXPRs. */
static tree
-mx_xfn_xform_decls (tree *t, int *continue_p, void *data)
+mx_xfn_xform_decls (gimple_stmt_iterator *gsi,
+ bool *handled_operands_p ATTRIBUTE_UNUSED,
+ struct walk_stmt_info *wi)
{
- struct mf_xform_decls_data* d = (struct mf_xform_decls_data*) data;
-
- if (*t == NULL_TREE || *t == error_mark_node)
- {
- *continue_p = 0;
- return NULL_TREE;
- }
+ struct mf_xform_decls_data *d = (struct mf_xform_decls_data *) wi->info;
+ gimple stmt = gsi_stmt (*gsi);
- *continue_p = 1;
-
- switch (TREE_CODE (*t))
+ switch (gimple_code (stmt))
{
- case BIND_EXPR:
+ case GIMPLE_BIND:
{
/* Process function parameters now (but only once). */
- mx_register_decls (d->param_decls, &BIND_EXPR_BODY (*t));
- d->param_decls = NULL_TREE;
+ if (d->param_decls)
+ {
+ gimple_bind_set_body (stmt,
+ mx_register_decls (d->param_decls,
+ gimple_bind_body (stmt),
+ gimple_location (stmt)));
+ d->param_decls = NULL_TREE;
+ }
- mx_register_decls (BIND_EXPR_VARS (*t), &BIND_EXPR_BODY (*t));
+ gimple_bind_set_body (stmt,
+ mx_register_decls (gimple_bind_vars (stmt),
+ gimple_bind_body (stmt),
+ gimple_location (stmt)));
}
break;
@@ -1118,11 +1117,18 @@ mx_xfn_xform_decls (tree *t, int *continue_p, void *data)
*/
static void
-mf_xform_decls (tree fnbody, tree fnparams)
+mf_xform_decls (gimple_seq fnbody, tree fnparams)
{
struct mf_xform_decls_data d;
+ struct walk_stmt_info wi;
+ struct pointer_set_t *pset = pointer_set_create ();
+
d.param_decls = fnparams;
- walk_tree_without_duplicates (&fnbody, mx_xfn_xform_decls, &d);
+ memset (&wi, 0, sizeof (wi));
+ wi.info = (void*) &d;
+ wi.pset = pset;
+ walk_gimple_seq (fnbody, mx_xfn_xform_decls, NULL, &wi);
+ pointer_set_destroy (pset);
}
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index 225605071cc..cfa1dd4b1ee 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -1,4 +1,4 @@
-/* Nested function decomposition for trees.
+/* Nested function decomposition for GIMPLE.
Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
@@ -15,7 +15,7 @@
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/>. */
+ <http://www.gnu.org/licenses/>. */
#include "config.h"
#include "system.h"
@@ -27,7 +27,7 @@
#include "function.h"
#include "tree-dump.h"
#include "tree-inline.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-iterator.h"
#include "tree-flow.h"
#include "cgraph.h"
@@ -355,46 +355,69 @@ get_chain_field (struct nesting_info *info)
return field;
}
+/* Initialize a new temporary with the GIMPLE_CALL STMT. */
+
+static tree
+init_tmp_var_with_call (struct nesting_info *info, gimple_stmt_iterator *gsi,
+ gimple call)
+{
+ tree t;
+
+ 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)));
+ gsi_insert_before (gsi, call, GSI_SAME_STMT);
+
+ return t;
+}
+
+
/* Copy EXP into a temporary. Allocate the temporary in the context of
- INFO and insert the initialization statement before TSI. */
+ INFO and insert the initialization statement before GSI. */
static tree
-init_tmp_var (struct nesting_info *info, tree exp, tree_stmt_iterator *tsi)
+init_tmp_var (struct nesting_info *info, tree exp, gimple_stmt_iterator *gsi)
{
- tree t, stmt;
+ tree t;
+ gimple stmt;
t = create_tmp_var_for (info, TREE_TYPE (exp), NULL);
- stmt = build_gimple_modify_stmt (t, exp);
- SET_EXPR_LOCUS (stmt, EXPR_LOCUS (tsi_stmt (*tsi)));
- tsi_link_before (tsi, stmt, TSI_SAME_STMT);
+ stmt = gimple_build_assign (t, exp);
+ if (! gsi_end_p (*gsi))
+ gimple_set_location (stmt, gimple_location (gsi_stmt (*gsi)));
+ gsi_insert_before_without_update (gsi, stmt, GSI_SAME_STMT);
return t;
}
+
/* Similarly, but only do so to force EXP to satisfy is_gimple_val. */
static tree
-tsi_gimplify_val (struct nesting_info *info, tree exp, tree_stmt_iterator *tsi)
+gsi_gimplify_val (struct nesting_info *info, tree exp,
+ gimple_stmt_iterator *gsi)
{
if (is_gimple_val (exp))
return exp;
else
- return init_tmp_var (info, exp, tsi);
+ return init_tmp_var (info, exp, gsi);
}
/* Similarly, but copy from the temporary and insert the statement
after the iterator. */
static tree
-save_tmp_var (struct nesting_info *info, tree exp,
- tree_stmt_iterator *tsi)
+save_tmp_var (struct nesting_info *info, tree exp, gimple_stmt_iterator *gsi)
{
- tree t, stmt;
+ tree t;
+ gimple stmt;
t = create_tmp_var_for (info, TREE_TYPE (exp), NULL);
- stmt = build_gimple_modify_stmt (exp, t);
- SET_EXPR_LOCUS (stmt, EXPR_LOCUS (tsi_stmt (*tsi)));
- tsi_link_after (tsi, stmt, TSI_SAME_STMT);
+ stmt = gimple_build_assign (exp, t);
+ if (! gsi_end_p (*gsi))
+ gimple_set_location (stmt, gimple_location (gsi_stmt (*gsi)));
+ gsi_insert_after_without_update (gsi, stmt, GSI_SAME_STMT);
return t;
}
@@ -512,236 +535,102 @@ get_nl_goto_field (struct nesting_info *info)
return field;
}
-
-/* Helper function for walk_stmts. Walk output operands of an ASM_EXPR. */
-
-static void
-walk_asm_expr (struct walk_stmt_info *wi, tree stmt)
-{
- int noutputs = list_length (ASM_OUTPUTS (stmt));
- const char **oconstraints
- = (const char **) alloca ((noutputs) * sizeof (const char *));
- int i;
- tree link;
- const char *constraint;
- bool allows_mem, allows_reg, is_inout;
-
- wi->is_lhs = true;
- for (i=0, link = ASM_OUTPUTS (stmt); link; ++i, link = TREE_CHAIN (link))
- {
- constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
- oconstraints[i] = constraint;
- parse_output_constraint (&constraint, i, 0, 0, &allows_mem,
- &allows_reg, &is_inout);
-
- wi->val_only = (allows_reg || !allows_mem);
- walk_tree (&TREE_VALUE (link), wi->callback, wi, NULL);
- }
-
- for (link = ASM_INPUTS (stmt); link; link = TREE_CHAIN (link))
- {
- constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
- parse_input_constraint (&constraint, 0, 0, noutputs, 0,
- oconstraints, &allows_mem, &allows_reg);
-
- wi->val_only = (allows_reg || !allows_mem);
- /* Although input "m" is not really a LHS, we need a lvalue. */
- wi->is_lhs = !wi->val_only;
- walk_tree (&TREE_VALUE (link), wi->callback, wi, NULL);
- }
-
- wi->is_lhs = false;
- wi->val_only = true;
-}
-
-/* Iterate over all sub-statements of *TP calling walk_tree with
- WI->CALLBACK for every sub-expression in each statement found. */
-
-void
-walk_stmts (struct walk_stmt_info *wi, tree *tp)
-{
- tree t = *tp;
- int walk_subtrees;
-
- if (!t)
- return;
- if (wi->want_locations && EXPR_HAS_LOCATION (t))
- input_location = EXPR_LOCATION (t);
-
- switch (TREE_CODE (t))
- {
- case STATEMENT_LIST:
- {
- tree_stmt_iterator i;
- for (i = tsi_start (t); !tsi_end_p (i); tsi_next (&i))
- {
- wi->tsi = i;
- walk_stmts (wi, tsi_stmt_ptr (i));
- }
- }
- break;
-
- case COND_EXPR:
- walk_tree (&COND_EXPR_COND (t), wi->callback, wi, NULL);
- walk_stmts (wi, &COND_EXPR_THEN (t));
- walk_stmts (wi, &COND_EXPR_ELSE (t));
- break;
- case CATCH_EXPR:
- walk_stmts (wi, &CATCH_BODY (t));
- break;
- case EH_FILTER_EXPR:
- walk_stmts (wi, &EH_FILTER_FAILURE (t));
- break;
- case TRY_CATCH_EXPR:
- case TRY_FINALLY_EXPR:
- walk_stmts (wi, &TREE_OPERAND (t, 0));
- walk_stmts (wi, &TREE_OPERAND (t, 1));
- break;
-
- case BIND_EXPR:
- if (wi->want_bind_expr)
- {
- walk_subtrees = 1;
- wi->callback (tp, &walk_subtrees, wi);
- if (!walk_subtrees)
- break;
- }
- walk_stmts (wi, &BIND_EXPR_BODY (t));
- break;
-
- case RETURN_EXPR:
- if (wi->want_return_expr)
- {
- walk_subtrees = 1;
- wi->callback (tp, &walk_subtrees, wi);
- if (!walk_subtrees)
- break;
- }
- walk_stmts (wi, &TREE_OPERAND (t, 0));
- break;
-
- case GIMPLE_MODIFY_STMT:
- /* A formal temporary lhs may use a COMPONENT_REF rhs. */
- wi->val_only = !is_gimple_formal_tmp_var (GIMPLE_STMT_OPERAND (t, 0));
- walk_tree (&GIMPLE_STMT_OPERAND (t, 1), wi->callback, wi, NULL);
-
- /* If the rhs is appropriate for a memory, we may use a
- COMPONENT_REF on the lhs. */
- wi->val_only = !is_gimple_mem_rhs (GIMPLE_STMT_OPERAND (t, 1));
- wi->is_lhs = true;
- walk_tree (&GIMPLE_STMT_OPERAND (t, 0), wi->callback, wi, NULL);
-
- wi->val_only = true;
- wi->is_lhs = false;
- break;
-
- case ASM_EXPR:
- walk_asm_expr (wi, *tp);
- break;
-
- default:
- wi->val_only = true;
- walk_tree (tp, wi->callback, wi, NULL);
- break;
- }
-}
-
-/* Invoke CALLBACK on all statements of *STMT_P. */
+/* Invoke CALLBACK on all statements of GIMPLE sequence SEQ. */
static void
-walk_body (walk_tree_fn callback, struct nesting_info *info, tree *stmt_p)
+walk_body (walk_stmt_fn callback_stmt, walk_tree_fn callback_op,
+ struct nesting_info *info, gimple_seq seq)
{
struct walk_stmt_info wi;
memset (&wi, 0, sizeof (wi));
- wi.callback = callback;
wi.info = info;
wi.val_only = true;
-
- walk_stmts (&wi, stmt_p);
+ walk_gimple_seq (seq, callback_stmt, callback_op, &wi);
}
-/* Invoke CALLBACK on all statements of INFO->CONTEXT. */
+
+/* Invoke CALLBACK_STMT/CALLBACK_OP on all statements of INFO->CONTEXT. */
static inline void
-walk_function (walk_tree_fn callback, struct nesting_info *info)
+walk_function (walk_stmt_fn callback_stmt, walk_tree_fn callback_op,
+ struct nesting_info *info)
{
- walk_body (callback, info, &DECL_SAVED_TREE (info->context));
+ walk_body (callback_stmt, callback_op, info, gimple_body (info->context));
}
-/* Invoke CALLBACK on OMP_FOR init, cond, incr and pre-body. */
+/* Invoke CALLBACK on a GIMPLE_OMP_FOR's init, cond, incr and pre-body. */
static void
-walk_omp_for (walk_tree_fn callback, struct nesting_info *info, tree for_stmt)
+walk_gimple_omp_for (gimple for_stmt,
+ walk_stmt_fn callback_stmt, walk_tree_fn callback_op,
+ struct nesting_info *info)
{
struct walk_stmt_info wi;
- tree t, list = NULL, empty;
- int i;
+ gimple_seq seq;
+ tree t;
+ size_t i;
- walk_body (callback, info, &OMP_FOR_PRE_BODY (for_stmt));
+ walk_body (callback_stmt, callback_op, info, gimple_omp_for_pre_body (for_stmt));
- empty = build_empty_stmt ();
- append_to_statement_list_force (empty, &list);
+ seq = gimple_seq_alloc ();
memset (&wi, 0, sizeof (wi));
- wi.callback = callback;
wi.info = info;
- wi.tsi = tsi_last (list);
+ wi.gsi = gsi_last (seq);
- for (i = 0; i < TREE_VEC_LENGTH (OMP_FOR_INIT (for_stmt)); i++)
+ for (i = 0; i < gimple_omp_for_collapse (for_stmt); i++)
{
- t = TREE_VEC_ELT (OMP_FOR_INIT (for_stmt), i);
- gcc_assert (TREE_CODE (t) == GIMPLE_MODIFY_STMT);
- SET_EXPR_LOCUS (empty, EXPR_LOCUS (t));
wi.val_only = false;
- walk_tree (&GIMPLE_STMT_OPERAND (t, 0), callback, &wi, NULL);
+ walk_tree (gimple_omp_for_index_ptr (for_stmt, i), callback_op,
+ &wi, NULL);
wi.val_only = true;
wi.is_lhs = false;
- walk_tree (&GIMPLE_STMT_OPERAND (t, 1), callback, &wi, NULL);
+ walk_tree (gimple_omp_for_initial_ptr (for_stmt, i), callback_op,
+ &wi, NULL);
- t = TREE_VEC_ELT (OMP_FOR_COND (for_stmt), i);
- gcc_assert (COMPARISON_CLASS_P (t));
- SET_EXPR_LOCUS (empty, EXPR_LOCUS (t));
- wi.val_only = false;
- walk_tree (&TREE_OPERAND (t, 0), callback, &wi, NULL);
wi.val_only = true;
wi.is_lhs = false;
- walk_tree (&TREE_OPERAND (t, 1), callback, &wi, NULL);
+ walk_tree (gimple_omp_for_final_ptr (for_stmt, i), callback_op,
+ &wi, NULL);
- t = TREE_VEC_ELT (OMP_FOR_INCR (for_stmt), i);
- gcc_assert (TREE_CODE (t) == GIMPLE_MODIFY_STMT);
- SET_EXPR_LOCUS (empty, EXPR_LOCUS (t));
- wi.val_only = false;
- walk_tree (&GIMPLE_STMT_OPERAND (t, 0), callback, &wi, NULL);
- t = GIMPLE_STMT_OPERAND (t, 1);
+ t = gimple_omp_for_incr (for_stmt, i);
gcc_assert (BINARY_CLASS_P (t));
wi.val_only = false;
- walk_tree (&TREE_OPERAND (t, 0), callback, &wi, NULL);
+ walk_tree (&TREE_OPERAND (t, 0), callback_op, &wi, NULL);
wi.val_only = true;
wi.is_lhs = false;
- walk_tree (&TREE_OPERAND (t, 1), callback, &wi, NULL);
+ walk_tree (&TREE_OPERAND (t, 1), callback_op, &wi, NULL);
}
- /* Remove empty statement added above from the end of statement list. */
- tsi_delink (&wi.tsi);
- append_to_statement_list (list, &OMP_FOR_PRE_BODY (for_stmt));
+ if (gimple_seq_empty_p (seq))
+ gimple_seq_free (seq);
+ else
+ {
+ gimple_seq pre_body = gimple_omp_for_pre_body (for_stmt);
+ annotate_all_with_location (seq, gimple_location (for_stmt));
+ gimple_seq_add_seq (&pre_body, seq);
+ gimple_omp_for_set_pre_body (for_stmt, pre_body);
+ }
}
/* Similarly for ROOT and all functions nested underneath, depth first. */
static void
-walk_all_functions (walk_tree_fn callback, struct nesting_info *root)
+walk_all_functions (walk_stmt_fn callback_stmt, walk_tree_fn callback_op,
+ struct nesting_info *root)
{
do
{
if (root->inner)
- walk_all_functions (callback, root->inner);
- walk_function (callback, root);
+ walk_all_functions (callback_stmt, callback_op, root->inner);
+ walk_function (callback_stmt, callback_op, root);
root = root->next;
}
while (root);
}
-
+
+
/* We have to check for a fairly pathological case. The operands of function
nested function are to be interpreted in the context of the enclosing
function. So if any are variably-sized, they will get remapped when the
@@ -817,7 +706,7 @@ create_nesting_tree (struct cgraph_node *cgn)
static tree
get_static_chain (struct nesting_info *info, tree target_context,
- tree_stmt_iterator *tsi)
+ gimple_stmt_iterator *gsi)
{
struct nesting_info *i;
tree x;
@@ -836,20 +725,21 @@ get_static_chain (struct nesting_info *info, tree target_context,
x = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (x)), x);
x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE);
- x = init_tmp_var (info, x, tsi);
+ x = init_tmp_var (info, x, gsi);
}
}
return x;
}
+
/* Return an expression referencing FIELD from TARGET_CONTEXT's non-local
frame as seen from INFO->CONTEXT. Insert any necessary computations
- before TSI. */
+ before GSI. */
static tree
get_frame_field (struct nesting_info *info, tree target_context,
- tree field, tree_stmt_iterator *tsi)
+ tree field, gimple_stmt_iterator *gsi)
{
struct nesting_info *i;
tree x;
@@ -870,7 +760,7 @@ get_frame_field (struct nesting_info *info, tree target_context,
x = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (x)), x);
x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE);
- x = init_tmp_var (info, x, tsi);
+ x = init_tmp_var (info, x, gsi);
}
x = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (x)), x);
@@ -880,7 +770,8 @@ get_frame_field (struct nesting_info *info, tree target_context,
return x;
}
-/* A subroutine of convert_nonlocal_reference. Create a local variable
+
+/* A subroutine of convert_nonlocal_reference_op. Create a local variable
in the nested function with DECL_VALUE_EXPR set to reference the true
variable in the parent function. This is used both for debug info
and in OpenMP lowering. */
@@ -947,7 +838,8 @@ get_nonlocal_debug_decl (struct nesting_info *info, tree decl)
return new_decl;
}
-/* Called via walk_function+walk_tree, rewrite all references to VAR
+
+/* Callback for walk_gimple_stmt, rewrite all references to VAR
and PARM_DECLs that belong to outer functions.
The rewrite will involve some number of structure accesses back up
@@ -955,16 +847,12 @@ get_nonlocal_debug_decl (struct nesting_info *info, tree decl)
be CHAIN->FOO. For two levels it'll be CHAIN->__chain->FOO. Further
indirections apply to decls for which use_pointer_in_frame is true. */
-static bool convert_nonlocal_omp_clauses (tree *, struct walk_stmt_info *);
-
static tree
-convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
+convert_nonlocal_reference_op (tree *tp, int *walk_subtrees, void *data)
{
struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
struct nesting_info *const info = (struct nesting_info *) wi->info;
tree t = *tp;
- tree save_local_var_chain;
- bitmap save_suppress;
*walk_subtrees = 0;
switch (TREE_CODE (t))
@@ -989,10 +877,10 @@ convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
for (i = info->outer; i->context != target_context; i = i->outer)
continue;
x = lookup_field_for_decl (i, t, INSERT);
- x = get_frame_field (info, target_context, x, &wi->tsi);
+ x = get_frame_field (info, target_context, x, &wi->gsi);
if (use_pointer_in_frame (t))
{
- x = init_tmp_var (info, x, &wi->tsi);
+ x = init_tmp_var (info, x, &wi->gsi);
x = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (x)), x);
}
}
@@ -1000,25 +888,15 @@ convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
if (wi->val_only)
{
if (wi->is_lhs)
- x = save_tmp_var (info, x, &wi->tsi);
+ x = save_tmp_var (info, x, &wi->gsi);
else
- x = init_tmp_var (info, x, &wi->tsi);
+ x = init_tmp_var (info, x, &wi->gsi);
}
*tp = x;
}
break;
- case GOTO_EXPR:
- /* Don't walk non-local gotos for now. */
- if (TREE_CODE (GOTO_DESTINATION (t)) != LABEL_DECL)
- {
- *walk_subtrees = 1;
- wi->val_only = true;
- wi->is_lhs = false;
- }
- break;
-
case LABEL_DECL:
/* We're taking the address of a label from a parent function, but
this is not itself a non-local goto. Mark the label such that it
@@ -1035,7 +913,7 @@ convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
wi->val_only = false;
wi->is_lhs = false;
wi->changed = false;
- walk_tree (&TREE_OPERAND (t, 0), convert_nonlocal_reference, wi, NULL);
+ walk_tree (&TREE_OPERAND (t, 0), convert_nonlocal_reference_op, wi, 0);
wi->val_only = true;
if (wi->changed)
@@ -1053,8 +931,8 @@ convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
where we only accept variables (and min_invariant, presumably),
then compute the address into a temporary. */
if (save_val_only)
- *tp = tsi_gimplify_val ((struct nesting_info *) wi->info,
- t, &wi->tsi);
+ *tp = gsi_gimplify_val ((struct nesting_info *) wi->info,
+ t, &wi->gsi);
}
}
break;
@@ -1073,28 +951,28 @@ convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
for (; handled_component_p (t); tp = &TREE_OPERAND (t, 0), t = *tp)
{
if (TREE_CODE (t) == COMPONENT_REF)
- walk_tree (&TREE_OPERAND (t, 2), convert_nonlocal_reference, wi,
+ walk_tree (&TREE_OPERAND (t, 2), convert_nonlocal_reference_op, wi,
NULL);
else if (TREE_CODE (t) == ARRAY_REF
|| TREE_CODE (t) == ARRAY_RANGE_REF)
{
- walk_tree (&TREE_OPERAND (t, 1), convert_nonlocal_reference, wi,
- NULL);
- walk_tree (&TREE_OPERAND (t, 2), convert_nonlocal_reference, wi,
- NULL);
- walk_tree (&TREE_OPERAND (t, 3), convert_nonlocal_reference, wi,
- NULL);
+ walk_tree (&TREE_OPERAND (t, 1), convert_nonlocal_reference_op,
+ wi, NULL);
+ walk_tree (&TREE_OPERAND (t, 2), convert_nonlocal_reference_op,
+ wi, NULL);
+ walk_tree (&TREE_OPERAND (t, 3), convert_nonlocal_reference_op,
+ wi, NULL);
}
else if (TREE_CODE (t) == BIT_FIELD_REF)
{
- walk_tree (&TREE_OPERAND (t, 1), convert_nonlocal_reference, wi,
- NULL);
- walk_tree (&TREE_OPERAND (t, 2), convert_nonlocal_reference, wi,
- NULL);
+ walk_tree (&TREE_OPERAND (t, 1), convert_nonlocal_reference_op,
+ wi, NULL);
+ walk_tree (&TREE_OPERAND (t, 2), convert_nonlocal_reference_op,
+ wi, NULL);
}
}
wi->val_only = false;
- walk_tree (tp, convert_nonlocal_reference, wi, NULL);
+ walk_tree (tp, convert_nonlocal_reference_op, wi, NULL);
break;
case VIEW_CONVERT_EXPR:
@@ -1104,52 +982,6 @@ convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
*walk_subtrees = 1;
break;
- case OMP_PARALLEL:
- case OMP_TASK:
- save_suppress = info->suppress_expansion;
- if (convert_nonlocal_omp_clauses (&OMP_TASKREG_CLAUSES (t), wi))
- {
- tree c, decl;
- decl = get_chain_decl (info);
- c = build_omp_clause (OMP_CLAUSE_FIRSTPRIVATE);
- OMP_CLAUSE_DECL (c) = decl;
- OMP_CLAUSE_CHAIN (c) = OMP_TASKREG_CLAUSES (t);
- OMP_TASKREG_CLAUSES (t) = c;
- }
-
- save_local_var_chain = info->new_local_var_chain;
- info->new_local_var_chain = NULL;
-
- walk_body (convert_nonlocal_reference, info, &OMP_TASKREG_BODY (t));
-
- if (info->new_local_var_chain)
- declare_vars (info->new_local_var_chain, OMP_TASKREG_BODY (t), false);
- info->new_local_var_chain = save_local_var_chain;
- info->suppress_expansion = save_suppress;
- break;
-
- case OMP_FOR:
- save_suppress = info->suppress_expansion;
- convert_nonlocal_omp_clauses (&OMP_FOR_CLAUSES (t), wi);
- walk_omp_for (convert_nonlocal_reference, info, t);
- walk_body (convert_nonlocal_reference, info, &OMP_FOR_BODY (t));
- info->suppress_expansion = save_suppress;
- break;
-
- case OMP_SECTIONS:
- case OMP_SINGLE:
- save_suppress = info->suppress_expansion;
- convert_nonlocal_omp_clauses (&OMP_CLAUSES (t), wi);
- walk_body (convert_nonlocal_reference, info, &OMP_BODY (t));
- info->suppress_expansion = save_suppress;
- break;
-
- case OMP_SECTION:
- case OMP_MASTER:
- case OMP_ORDERED:
- walk_body (convert_nonlocal_reference, info, &OMP_BODY (t));
- break;
-
default:
if (!IS_TYPE_OR_DECL_P (t))
{
@@ -1163,6 +995,12 @@ convert_nonlocal_reference (tree *tp, int *walk_subtrees, void *data)
return NULL_TREE;
}
+static tree convert_nonlocal_reference_stmt (gimple_stmt_iterator *, bool *,
+ struct walk_stmt_info *);
+
+/* Helper for convert_nonlocal_references, rewrite all references to VAR
+ and PARM_DECLs that belong to outer functions. */
+
static bool
convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
{
@@ -1185,7 +1023,7 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
goto do_decl_clause;
case OMP_CLAUSE_LASTPRIVATE:
- if (OMP_CLAUSE_LASTPRIVATE_STMT (clause))
+ if (OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (clause))
need_stmts = true;
goto do_decl_clause;
@@ -1214,8 +1052,8 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
case OMP_CLAUSE_NUM_THREADS:
wi->val_only = true;
wi->is_lhs = false;
- convert_nonlocal_reference (&OMP_CLAUSE_OPERAND (clause, 0), &dummy,
- wi);
+ convert_nonlocal_reference_op (&OMP_CLAUSE_OPERAND (clause, 0),
+ &dummy, wi);
break;
case OMP_CLAUSE_NOWAIT:
@@ -1244,18 +1082,21 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
= DECL_CONTEXT (OMP_CLAUSE_REDUCTION_PLACEHOLDER (clause));
DECL_CONTEXT (OMP_CLAUSE_REDUCTION_PLACEHOLDER (clause))
= info->context;
- walk_body (convert_nonlocal_reference, info,
- &OMP_CLAUSE_REDUCTION_INIT (clause));
- walk_body (convert_nonlocal_reference, info,
- &OMP_CLAUSE_REDUCTION_MERGE (clause));
+ walk_body (convert_nonlocal_reference_stmt,
+ convert_nonlocal_reference_op, info,
+ OMP_CLAUSE_REDUCTION_GIMPLE_INIT (clause));
+ walk_body (convert_nonlocal_reference_stmt,
+ convert_nonlocal_reference_op, info,
+ OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (clause));
DECL_CONTEXT (OMP_CLAUSE_REDUCTION_PLACEHOLDER (clause))
= old_context;
}
break;
case OMP_CLAUSE_LASTPRIVATE:
- walk_body (convert_nonlocal_reference, info,
- &OMP_CLAUSE_LASTPRIVATE_STMT (clause));
+ walk_body (convert_nonlocal_reference_stmt,
+ convert_nonlocal_reference_op, info,
+ OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (clause));
break;
default:
@@ -1265,6 +1106,110 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
return need_chain;
}
+
+/* Callback for walk_gimple_stmt. Rewrite all references to VAR and
+ PARM_DECLs that belong to outer functions. This handles statements
+ that are not handled via the standard recursion done in
+ walk_gimple_stmt. STMT is the statement to examine, DATA is as in
+ convert_nonlocal_reference_op. Set *HANDLED_OPS_P to true if all the
+ operands of STMT have been handled by this function. */
+
+static tree
+convert_nonlocal_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
+ struct walk_stmt_info *wi)
+{
+ struct nesting_info *info = (struct nesting_info *) wi->info;
+ tree save_local_var_chain;
+ bitmap save_suppress;
+ gimple stmt = gsi_stmt (*gsi);
+
+ switch (gimple_code (stmt))
+ {
+ case GIMPLE_GOTO:
+ /* Don't walk non-local gotos for now. */
+ if (TREE_CODE (gimple_goto_dest (stmt)) != LABEL_DECL)
+ {
+ wi->val_only = true;
+ wi->is_lhs = false;
+ *handled_ops_p = true;
+ return NULL_TREE;
+ }
+ break;
+
+ case GIMPLE_OMP_PARALLEL:
+ case GIMPLE_OMP_TASK:
+ save_suppress = info->suppress_expansion;
+ if (convert_nonlocal_omp_clauses (gimple_omp_taskreg_clauses_ptr (stmt),
+ wi))
+ {
+ tree c, decl;
+ decl = get_chain_decl (info);
+ c = build_omp_clause (OMP_CLAUSE_FIRSTPRIVATE);
+ OMP_CLAUSE_DECL (c) = decl;
+ OMP_CLAUSE_CHAIN (c) = gimple_omp_taskreg_clauses (stmt);
+ gimple_omp_taskreg_set_clauses (stmt, c);
+ }
+
+ save_local_var_chain = info->new_local_var_chain;
+ info->new_local_var_chain = NULL;
+
+ walk_body (convert_nonlocal_reference_stmt, convert_nonlocal_reference_op,
+ info, gimple_omp_body (stmt));
+
+ if (info->new_local_var_chain)
+ declare_vars (info->new_local_var_chain,
+ gimple_seq_first_stmt (gimple_omp_body (stmt)),
+ false);
+ info->new_local_var_chain = save_local_var_chain;
+ info->suppress_expansion = save_suppress;
+ break;
+
+ case GIMPLE_OMP_FOR:
+ save_suppress = info->suppress_expansion;
+ convert_nonlocal_omp_clauses (gimple_omp_for_clauses_ptr (stmt), wi);
+ walk_gimple_omp_for (stmt, convert_nonlocal_reference_stmt,
+ convert_nonlocal_reference_op, info);
+ walk_body (convert_nonlocal_reference_stmt,
+ convert_nonlocal_reference_op, info, gimple_omp_body (stmt));
+ info->suppress_expansion = save_suppress;
+ break;
+
+ case GIMPLE_OMP_SECTIONS:
+ save_suppress = info->suppress_expansion;
+ convert_nonlocal_omp_clauses (gimple_omp_sections_clauses_ptr (stmt), wi);
+ walk_body (convert_nonlocal_reference_stmt, convert_nonlocal_reference_op,
+ info, gimple_omp_body (stmt));
+ info->suppress_expansion = save_suppress;
+ break;
+
+ case GIMPLE_OMP_SINGLE:
+ save_suppress = info->suppress_expansion;
+ convert_nonlocal_omp_clauses (gimple_omp_single_clauses_ptr (stmt), wi);
+ walk_body (convert_nonlocal_reference_stmt, convert_nonlocal_reference_op,
+ info, gimple_omp_body (stmt));
+ info->suppress_expansion = save_suppress;
+ break;
+
+ case GIMPLE_OMP_SECTION:
+ case GIMPLE_OMP_MASTER:
+ case GIMPLE_OMP_ORDERED:
+ walk_body (convert_nonlocal_reference_stmt, convert_nonlocal_reference_op,
+ info, gimple_omp_body (stmt));
+ break;
+
+ default:
+ /* For every other statement that we are not interested in
+ handling here, let the walker traverse the operands. */
+ *handled_ops_p = false;
+ return NULL_TREE;
+ }
+
+ /* We have handled all of STMT operands, no need to traverse the operands. */
+ *handled_ops_p = true;
+ return NULL_TREE;
+}
+
+
/* A subroutine of convert_local_reference. Create a local variable
in the parent function with DECL_VALUE_EXPR set to reference the
field in FRAME. This is used both for debug info and in OpenMP
@@ -1309,21 +1254,20 @@ get_local_debug_decl (struct nesting_info *info, tree decl, tree field)
return new_decl;
}
-/* Called via walk_function+walk_tree, rewrite all references to VAR
+
+/* Called via walk_function+walk_gimple_stmt, rewrite all references to VAR
and PARM_DECLs that were referenced by inner nested functions.
The rewrite will be a structure reference to the local frame variable. */
static bool convert_local_omp_clauses (tree *, struct walk_stmt_info *);
static tree
-convert_local_reference (tree *tp, int *walk_subtrees, void *data)
+convert_local_reference_op (tree *tp, int *walk_subtrees, void *data)
{
struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
struct nesting_info *const info = (struct nesting_info *) wi->info;
tree t = *tp, field, x;
bool save_val_only;
- tree save_local_var_chain;
- bitmap save_suppress;
*walk_subtrees = 0;
switch (TREE_CODE (t))
@@ -1351,14 +1295,14 @@ convert_local_reference (tree *tp, int *walk_subtrees, void *data)
x = get_local_debug_decl (info, t, field);
if (!bitmap_bit_p (info->suppress_expansion, DECL_UID (t)))
- x = get_frame_field (info, info->context, field, &wi->tsi);
+ x = get_frame_field (info, info->context, field, &wi->gsi);
if (wi->val_only)
{
if (wi->is_lhs)
- x = save_tmp_var (info, x, &wi->tsi);
+ x = save_tmp_var (info, x, &wi->gsi);
else
- x = init_tmp_var (info, x, &wi->tsi);
+ x = init_tmp_var (info, x, &wi->gsi);
}
*tp = x;
@@ -1370,7 +1314,7 @@ convert_local_reference (tree *tp, int *walk_subtrees, void *data)
wi->val_only = false;
wi->is_lhs = false;
wi->changed = false;
- walk_tree (&TREE_OPERAND (t, 0), convert_local_reference, wi, NULL);
+ walk_tree (&TREE_OPERAND (t, 0), convert_local_reference_op, wi, NULL);
wi->val_only = save_val_only;
/* If we converted anything ... */
@@ -1389,7 +1333,8 @@ convert_local_reference (tree *tp, int *walk_subtrees, void *data)
/* If we are in a context where we only accept values, then
compute the address into a temporary. */
if (save_val_only)
- *tp = tsi_gimplify_val ((struct nesting_info *)wi->info, t, &wi->tsi);
+ *tp = gsi_gimplify_val ((struct nesting_info *) wi->info,
+ t, &wi->gsi);
}
break;
@@ -1408,28 +1353,28 @@ convert_local_reference (tree *tp, int *walk_subtrees, void *data)
for (; handled_component_p (t); tp = &TREE_OPERAND (t, 0), t = *tp)
{
if (TREE_CODE (t) == COMPONENT_REF)
- walk_tree (&TREE_OPERAND (t, 2), convert_local_reference, wi,
+ walk_tree (&TREE_OPERAND (t, 2), convert_local_reference_op, wi,
NULL);
else if (TREE_CODE (t) == ARRAY_REF
|| TREE_CODE (t) == ARRAY_RANGE_REF)
{
- walk_tree (&TREE_OPERAND (t, 1), convert_local_reference, wi,
+ walk_tree (&TREE_OPERAND (t, 1), convert_local_reference_op, wi,
NULL);
- walk_tree (&TREE_OPERAND (t, 2), convert_local_reference, wi,
+ walk_tree (&TREE_OPERAND (t, 2), convert_local_reference_op, wi,
NULL);
- walk_tree (&TREE_OPERAND (t, 3), convert_local_reference, wi,
+ walk_tree (&TREE_OPERAND (t, 3), convert_local_reference_op, wi,
NULL);
}
else if (TREE_CODE (t) == BIT_FIELD_REF)
{
- walk_tree (&TREE_OPERAND (t, 1), convert_local_reference, wi,
+ walk_tree (&TREE_OPERAND (t, 1), convert_local_reference_op, wi,
NULL);
- walk_tree (&TREE_OPERAND (t, 2), convert_local_reference, wi,
+ walk_tree (&TREE_OPERAND (t, 2), convert_local_reference_op, wi,
NULL);
}
}
wi->val_only = false;
- walk_tree (tp, convert_local_reference, wi, NULL);
+ walk_tree (tp, convert_local_reference_op, wi, NULL);
wi->val_only = save_val_only;
break;
@@ -1440,52 +1385,6 @@ convert_local_reference (tree *tp, int *walk_subtrees, void *data)
*walk_subtrees = 1;
break;
- case OMP_PARALLEL:
- case OMP_TASK:
- save_suppress = info->suppress_expansion;
- if (convert_local_omp_clauses (&OMP_TASKREG_CLAUSES (t), wi))
- {
- tree c;
- (void) get_frame_type (info);
- c = build_omp_clause (OMP_CLAUSE_SHARED);
- OMP_CLAUSE_DECL (c) = info->frame_decl;
- OMP_CLAUSE_CHAIN (c) = OMP_TASKREG_CLAUSES (t);
- OMP_TASKREG_CLAUSES (t) = c;
- }
-
- save_local_var_chain = info->new_local_var_chain;
- info->new_local_var_chain = NULL;
-
- walk_body (convert_local_reference, info, &OMP_TASKREG_BODY (t));
-
- if (info->new_local_var_chain)
- declare_vars (info->new_local_var_chain, OMP_TASKREG_BODY (t), false);
- info->new_local_var_chain = save_local_var_chain;
- info->suppress_expansion = save_suppress;
- break;
-
- case OMP_FOR:
- save_suppress = info->suppress_expansion;
- convert_local_omp_clauses (&OMP_FOR_CLAUSES (t), wi);
- walk_omp_for (convert_local_reference, info, t);
- walk_body (convert_local_reference, info, &OMP_FOR_BODY (t));
- info->suppress_expansion = save_suppress;
- break;
-
- case OMP_SECTIONS:
- case OMP_SINGLE:
- save_suppress = info->suppress_expansion;
- convert_local_omp_clauses (&OMP_CLAUSES (t), wi);
- walk_body (convert_local_reference, info, &OMP_BODY (t));
- info->suppress_expansion = save_suppress;
- break;
-
- case OMP_SECTION:
- case OMP_MASTER:
- case OMP_ORDERED:
- walk_body (convert_local_reference, info, &OMP_BODY (t));
- break;
-
default:
if (!IS_TYPE_OR_DECL_P (t))
{
@@ -1499,6 +1398,12 @@ convert_local_reference (tree *tp, int *walk_subtrees, void *data)
return NULL_TREE;
}
+static tree convert_local_reference_stmt (gimple_stmt_iterator *, bool *,
+ struct walk_stmt_info *);
+
+/* Helper for convert_local_reference. Convert all the references in
+ the chain of clauses at *PCLAUSES. WI is as in convert_local_reference. */
+
static bool
convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
{
@@ -1521,7 +1426,7 @@ convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
goto do_decl_clause;
case OMP_CLAUSE_LASTPRIVATE:
- if (OMP_CLAUSE_LASTPRIVATE_STMT (clause))
+ if (OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (clause))
need_stmts = true;
goto do_decl_clause;
@@ -1556,7 +1461,8 @@ convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
case OMP_CLAUSE_NUM_THREADS:
wi->val_only = true;
wi->is_lhs = false;
- convert_local_reference (&OMP_CLAUSE_OPERAND (clause, 0), &dummy, wi);
+ convert_local_reference_op (&OMP_CLAUSE_OPERAND (clause, 0), &dummy,
+ wi);
break;
case OMP_CLAUSE_NOWAIT:
@@ -1585,18 +1491,21 @@ convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
= DECL_CONTEXT (OMP_CLAUSE_REDUCTION_PLACEHOLDER (clause));
DECL_CONTEXT (OMP_CLAUSE_REDUCTION_PLACEHOLDER (clause))
= info->context;
- walk_body (convert_local_reference, info,
- &OMP_CLAUSE_REDUCTION_INIT (clause));
- walk_body (convert_local_reference, info,
- &OMP_CLAUSE_REDUCTION_MERGE (clause));
+ walk_body (convert_local_reference_stmt,
+ convert_local_reference_op, info,
+ OMP_CLAUSE_REDUCTION_GIMPLE_INIT (clause));
+ walk_body (convert_local_reference_stmt,
+ convert_local_reference_op, info,
+ OMP_CLAUSE_REDUCTION_GIMPLE_MERGE (clause));
DECL_CONTEXT (OMP_CLAUSE_REDUCTION_PLACEHOLDER (clause))
= old_context;
}
break;
case OMP_CLAUSE_LASTPRIVATE:
- walk_body (convert_local_reference, info,
- &OMP_CLAUSE_LASTPRIVATE_STMT (clause));
+ walk_body (convert_local_reference_stmt,
+ convert_local_reference_op, info,
+ OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ (clause));
break;
default:
@@ -1606,27 +1515,128 @@ convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
return need_frame;
}
-/* Called via walk_function+walk_tree, rewrite all GOTO_EXPRs that
- reference labels from outer functions. The rewrite will be a
+
+/* Called via walk_function+walk_gimple_stmt, rewrite all references to VAR
+ and PARM_DECLs that were referenced by inner nested functions.
+ The rewrite will be a structure reference to the local frame variable. */
+
+static tree
+convert_local_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
+ struct walk_stmt_info *wi)
+{
+ struct nesting_info *info = (struct nesting_info *) wi->info;
+ tree save_local_var_chain;
+ bitmap save_suppress;
+ gimple stmt = gsi_stmt (*gsi);
+
+ switch (gimple_code (stmt))
+ {
+ case GIMPLE_OMP_PARALLEL:
+ case GIMPLE_OMP_TASK:
+ save_suppress = info->suppress_expansion;
+ if (convert_local_omp_clauses (gimple_omp_taskreg_clauses_ptr (stmt),
+ wi))
+ {
+ tree c;
+ (void) get_frame_type (info);
+ c = build_omp_clause (OMP_CLAUSE_SHARED);
+ OMP_CLAUSE_DECL (c) = info->frame_decl;
+ OMP_CLAUSE_CHAIN (c) = gimple_omp_taskreg_clauses (stmt);
+ gimple_omp_taskreg_set_clauses (stmt, c);
+ }
+
+ save_local_var_chain = info->new_local_var_chain;
+ info->new_local_var_chain = NULL;
+
+ walk_body (convert_local_reference_stmt, convert_local_reference_op, info,
+ gimple_omp_body (stmt));
+
+ if (info->new_local_var_chain)
+ declare_vars (info->new_local_var_chain,
+ gimple_seq_first_stmt (gimple_omp_body (stmt)), false);
+ info->new_local_var_chain = save_local_var_chain;
+ info->suppress_expansion = save_suppress;
+ break;
+
+ case GIMPLE_OMP_FOR:
+ save_suppress = info->suppress_expansion;
+ convert_local_omp_clauses (gimple_omp_for_clauses_ptr (stmt), wi);
+ walk_gimple_omp_for (stmt, convert_local_reference_stmt,
+ convert_local_reference_op, info);
+ walk_body (convert_local_reference_stmt, convert_local_reference_op,
+ info, gimple_omp_body (stmt));
+ info->suppress_expansion = save_suppress;
+ break;
+
+ case GIMPLE_OMP_SECTIONS:
+ save_suppress = info->suppress_expansion;
+ convert_local_omp_clauses (gimple_omp_sections_clauses_ptr (stmt), wi);
+ walk_body (convert_local_reference_stmt, convert_local_reference_op,
+ info, gimple_omp_body (stmt));
+ info->suppress_expansion = save_suppress;
+ break;
+
+ case GIMPLE_OMP_SINGLE:
+ save_suppress = info->suppress_expansion;
+ convert_local_omp_clauses (gimple_omp_single_clauses_ptr (stmt), wi);
+ walk_body (convert_local_reference_stmt, convert_local_reference_op,
+ info, gimple_omp_body (stmt));
+ info->suppress_expansion = save_suppress;
+ break;
+
+ case GIMPLE_OMP_SECTION:
+ case GIMPLE_OMP_MASTER:
+ case GIMPLE_OMP_ORDERED:
+ walk_body (convert_local_reference_stmt, convert_local_reference_op,
+ info, gimple_omp_body (stmt));
+ break;
+
+ default:
+ /* For every other statement that we are not interested in
+ handling here, let the walker traverse the operands. */
+ *handled_ops_p = false;
+ return NULL_TREE;
+ }
+
+ /* Indicate that we have handled all the operands ourselves. */
+ *handled_ops_p = true;
+ return NULL_TREE;
+}
+
+
+/* Called via walk_function+walk_gimple_stmt, rewrite all GIMPLE_GOTOs
+ that reference labels from outer functions. The rewrite will be a
call to __builtin_nonlocal_goto. */
static tree
-convert_nl_goto_reference (tree *tp, int *walk_subtrees, void *data)
+convert_nl_goto_reference (gimple_stmt_iterator *gsi, bool *handled_ops_p,
+ struct walk_stmt_info *wi)
{
- struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
struct nesting_info *const info = (struct nesting_info *) wi->info, *i;
- tree t = *tp, label, new_label, target_context, x, field;
+ tree label, new_label, target_context, x, field;
void **slot;
+ gimple call;
+ gimple stmt = gsi_stmt (*gsi);
- *walk_subtrees = 0;
- if (TREE_CODE (t) != GOTO_EXPR)
- return NULL_TREE;
- label = GOTO_DESTINATION (t);
+ if (gimple_code (stmt) != GIMPLE_GOTO)
+ {
+ *handled_ops_p = false;
+ return NULL_TREE;
+ }
+
+ label = gimple_goto_dest (stmt);
if (TREE_CODE (label) != LABEL_DECL)
- return NULL_TREE;
+ {
+ *handled_ops_p = false;
+ return NULL_TREE;
+ }
+
target_context = decl_function_context (label);
if (target_context == info->context)
- return NULL_TREE;
+ {
+ *handled_ops_p = false;
+ return NULL_TREE;
+ }
for (i = info->outer; target_context != i->context; i = i->outer)
continue;
@@ -1650,69 +1660,80 @@ convert_nl_goto_reference (tree *tp, int *walk_subtrees, void *data)
/* Build: __builtin_nl_goto(new_label, &chain->nl_goto_field). */
field = get_nl_goto_field (i);
- x = get_frame_field (info, target_context, field, &wi->tsi);
+ x = get_frame_field (info, target_context, field, &wi->gsi);
x = build_addr (x, target_context);
- x = tsi_gimplify_val (info, x, &wi->tsi);
- x = build_call_expr (implicit_built_in_decls[BUILT_IN_NONLOCAL_GOTO], 2,
- build_addr (new_label, target_context), x);
-
- SET_EXPR_LOCUS (x, EXPR_LOCUS (tsi_stmt (wi->tsi)));
- *tsi_stmt_ptr (wi->tsi) = x;
+ x = gsi_gimplify_val (info, x, &wi->gsi);
+ call = gimple_build_call (implicit_built_in_decls[BUILT_IN_NONLOCAL_GOTO], 2,
+ build_addr (new_label, target_context), x);
+ gsi_replace (&wi->gsi, call, false);
+ /* We have handled all of STMT's operands, no need to keep going. */
+ *handled_ops_p = true;
return NULL_TREE;
}
-/* Called via walk_function+walk_tree, rewrite all LABEL_EXPRs that
+
+/* Called via walk_function+walk_tree, rewrite all GIMPLE_LABELs whose labels
are referenced via nonlocal goto from a nested function. The rewrite
will involve installing a newly generated DECL_NONLOCAL label, and
- (potentially) a branch around the rtl gunk that is assumed to be
+ (potentially) a branch around the rtl gunk that is assumed to be
attached to such a label. */
static tree
-convert_nl_goto_receiver (tree *tp, int *walk_subtrees, void *data)
+convert_nl_goto_receiver (gimple_stmt_iterator *gsi, bool *handled_ops_p,
+ struct walk_stmt_info *wi)
{
- struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
struct nesting_info *const info = (struct nesting_info *) wi->info;
- tree t = *tp, label, new_label, x;
- tree_stmt_iterator tmp_tsi;
+ tree label, new_label;
+ gimple_stmt_iterator tmp_gsi;
void **slot;
+ gimple stmt = gsi_stmt (*gsi);
- *walk_subtrees = 0;
- if (TREE_CODE (t) != LABEL_EXPR)
- return NULL_TREE;
- label = LABEL_EXPR_LABEL (t);
+ if (gimple_code (stmt) != GIMPLE_LABEL)
+ {
+ *handled_ops_p = false;
+ return NULL_TREE;
+ }
+
+ label = gimple_label_label (stmt);
slot = pointer_map_contains (info->var_map, label);
if (!slot)
- return NULL_TREE;
+ {
+ *handled_ops_p = false;
+ return NULL_TREE;
+ }
/* If there's any possibility that the previous statement falls through,
then we must branch around the new non-local label. */
- tmp_tsi = wi->tsi;
- tsi_prev (&tmp_tsi);
- if (tsi_end_p (tmp_tsi) || block_may_fallthru (tsi_stmt (tmp_tsi)))
+ tmp_gsi = wi->gsi;
+ gsi_prev (&tmp_gsi);
+ if (gsi_end_p (tmp_gsi) || gimple_stmt_may_fallthru (gsi_stmt (tmp_gsi)))
{
- x = build1 (GOTO_EXPR, void_type_node, label);
- tsi_link_before (&wi->tsi, x, TSI_SAME_STMT);
+ gimple stmt = gimple_build_goto (label);
+ gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
}
new_label = (tree) *slot;
- x = build1 (LABEL_EXPR, void_type_node, new_label);
- tsi_link_before (&wi->tsi, x, TSI_SAME_STMT);
+ stmt = gimple_build_label (new_label);
+ gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
+ *handled_ops_p = true;
return NULL_TREE;
}
-/* Called via walk_function+walk_tree, rewrite all references to addresses
+
+/* Called via walk_function+walk_stmt, rewrite all references to addresses
of nested functions that require the use of trampolines. The rewrite
will involve a reference a trampoline generated for the occasion. */
static tree
-convert_tramp_reference (tree *tp, int *walk_subtrees, void *data)
+convert_tramp_reference_op (tree *tp, int *walk_subtrees, void *data)
{
struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
struct nesting_info *const info = (struct nesting_info *) wi->info, *i;
- tree t = *tp, decl, target_context, x;
+ tree t = *tp, decl, target_context, x, builtin;
+ gimple call;
*walk_subtrees = 0;
switch (TREE_CODE (t))
@@ -1749,85 +1770,103 @@ convert_tramp_reference (tree *tp, int *walk_subtrees, void *data)
x = lookup_tramp_for_decl (i, decl, INSERT);
/* Compute the address of the field holding the trampoline. */
- x = get_frame_field (info, target_context, x, &wi->tsi);
+ x = get_frame_field (info, target_context, x, &wi->gsi);
x = build_addr (x, target_context);
- x = tsi_gimplify_val (info, x, &wi->tsi);
+ x = gsi_gimplify_val (info, x, &wi->gsi);
/* Do machine-specific ugliness. Normally this will involve
computing extra alignment, but it can really be anything. */
- x = build_call_expr (implicit_built_in_decls[BUILT_IN_ADJUST_TRAMPOLINE],
- 1, x);
- x = init_tmp_var (info, x, &wi->tsi);
+ builtin = implicit_built_in_decls[BUILT_IN_ADJUST_TRAMPOLINE];
+ call = gimple_build_call (builtin, 1, x);
+ x = init_tmp_var_with_call (info, &wi->gsi, call);
/* Cast back to the proper function type. */
x = build1 (NOP_EXPR, TREE_TYPE (t), x);
- x = init_tmp_var (info, x, &wi->tsi);
+ x = init_tmp_var (info, x, &wi->gsi);
*tp = x;
break;
- case CALL_EXPR:
- /* Only walk call arguments, lest we generate trampolines for
- direct calls. */
+ default:
+ if (!IS_TYPE_OR_DECL_P (t))
+ *walk_subtrees = 1;
+ break;
+ }
+
+ return NULL_TREE;
+}
+
+
+/* Called via walk_function+walk_gimple_stmt, rewrite all references
+ to addresses of nested functions that require the use of
+ trampolines. The rewrite will involve a reference a trampoline
+ generated for the occasion. */
+
+static tree
+convert_tramp_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p,
+ struct walk_stmt_info *wi)
+{
+ gimple stmt = gsi_stmt (*gsi);
+
+ switch (gimple_code (stmt))
+ {
+ case GIMPLE_CALL:
{
- int nargs = call_expr_nargs (t);
- int i;
+ /* Only walk call arguments, lest we generate trampolines for
+ direct calls. */
+ unsigned long i, nargs = gimple_call_num_args (stmt);
for (i = 0; i < nargs; i++)
- walk_tree (&CALL_EXPR_ARG (t, i), convert_tramp_reference, wi, NULL);
+ walk_tree (gimple_call_arg_ptr (stmt, i), convert_tramp_reference_op,
+ wi, NULL);
+
+ *handled_ops_p = true;
+ return NULL_TREE;
}
- break;
default:
- if (!IS_TYPE_OR_DECL_P (t))
- *walk_subtrees = 1;
break;
}
+ *handled_ops_p = false;
return NULL_TREE;
}
-/* Called via walk_function+walk_tree, rewrite all CALL_EXPRs that
- reference nested functions to make sure that the static chain is
- set up properly for the call. */
+
+
+/* Called via walk_function+walk_gimple_stmt, rewrite all GIMPLE_CALLs
+ that reference nested functions to make sure that the static chain
+ is set up properly for the call. */
static tree
-convert_call_expr (tree *tp, int *walk_subtrees, void *data)
+convert_gimple_call (gimple_stmt_iterator *gsi, bool *handled_ops_p,
+ struct walk_stmt_info *wi)
{
- struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
struct nesting_info *const info = (struct nesting_info *) wi->info;
- tree t = *tp, decl, target_context;
+ tree decl, target_context;
char save_static_chain_added;
int i;
+ gimple stmt = gsi_stmt (*gsi);
- *walk_subtrees = 0;
- switch (TREE_CODE (t))
+ switch (gimple_code (stmt))
{
- case CALL_EXPR:
- decl = get_callee_fndecl (t);
+ case GIMPLE_CALL:
+ decl = gimple_call_fndecl (stmt);
if (!decl)
break;
target_context = decl_function_context (decl);
if (target_context && !DECL_NO_STATIC_CHAIN (decl))
{
- CALL_EXPR_STATIC_CHAIN (t)
- = get_static_chain (info, target_context, &wi->tsi);
- info->static_chain_added
- |= (1 << (info->context != target_context));
+ gimple_call_set_chain (stmt, get_static_chain (info, target_context,
+ &wi->gsi));
+ info->static_chain_added |= (1 << (info->context != target_context));
}
break;
- case RETURN_EXPR:
- case GIMPLE_MODIFY_STMT:
- case WITH_SIZE_EXPR:
- /* Only return modify and with_size_expr may contain calls. */
- *walk_subtrees = 1;
- break;
-
- case OMP_PARALLEL:
- case OMP_TASK:
+ case GIMPLE_OMP_PARALLEL:
+ case GIMPLE_OMP_TASK:
save_static_chain_added = info->static_chain_added;
info->static_chain_added = 0;
- walk_body (convert_call_expr, info, &OMP_TASKREG_BODY (t));
+ walk_body (convert_gimple_call, NULL, info, gimple_omp_body (stmt));
for (i = 0; i < 2; i++)
{
tree c, decl;
@@ -1835,7 +1874,9 @@ convert_call_expr (tree *tp, int *walk_subtrees, void *data)
continue;
decl = i ? get_chain_decl (info) : info->frame_decl;
/* Don't add CHAIN.* or FRAME.* twice. */
- for (c = OMP_TASKREG_CLAUSES (t); c; c = OMP_CLAUSE_CHAIN (c))
+ for (c = gimple_omp_taskreg_clauses (stmt);
+ c;
+ c = OMP_CLAUSE_CHAIN (c))
if ((OMP_CLAUSE_CODE (c) == OMP_CLAUSE_FIRSTPRIVATE
|| OMP_CLAUSE_CODE (c) == OMP_CLAUSE_SHARED)
&& OMP_CLAUSE_DECL (c) == decl)
@@ -1845,32 +1886,37 @@ convert_call_expr (tree *tp, int *walk_subtrees, void *data)
c = build_omp_clause (i ? OMP_CLAUSE_FIRSTPRIVATE
: OMP_CLAUSE_SHARED);
OMP_CLAUSE_DECL (c) = decl;
- OMP_CLAUSE_CHAIN (c) = OMP_TASKREG_CLAUSES (t);
- OMP_TASKREG_CLAUSES (t) = c;
+ OMP_CLAUSE_CHAIN (c) = gimple_omp_taskreg_clauses (stmt);
+ gimple_omp_taskreg_set_clauses (stmt, c);
}
}
info->static_chain_added |= save_static_chain_added;
break;
- case OMP_FOR:
- walk_body (convert_call_expr, info, &OMP_FOR_PRE_BODY (t));
+ case GIMPLE_OMP_FOR:
+ walk_body (convert_gimple_call, NULL, info,
+ gimple_omp_for_pre_body (stmt));
/* FALLTHRU */
- case OMP_SECTIONS:
- case OMP_SECTION:
- case OMP_SINGLE:
- case OMP_MASTER:
- case OMP_ORDERED:
- case OMP_CRITICAL:
- walk_body (convert_call_expr, info, &OMP_BODY (t));
+ case GIMPLE_OMP_SECTIONS:
+ case GIMPLE_OMP_SECTION:
+ case GIMPLE_OMP_SINGLE:
+ case GIMPLE_OMP_MASTER:
+ case GIMPLE_OMP_ORDERED:
+ case GIMPLE_OMP_CRITICAL:
+ walk_body (convert_gimple_call, NULL, info, gimple_omp_body (stmt));
break;
default:
- break;
+ /* Keep looking for other operands. */
+ *handled_ops_p = false;
+ return NULL_TREE;
}
+ *handled_ops_p = true;
return NULL_TREE;
}
+
/* Walk the nesting tree starting with ROOT, depth first. Convert all
trampolines and call expressions. On the way back up, determine if
a nested function actually uses its static chain; if not, remember that. */
@@ -1883,8 +1929,9 @@ convert_all_function_calls (struct nesting_info *root)
if (root->inner)
convert_all_function_calls (root->inner);
- walk_function (convert_tramp_reference, root);
- walk_function (convert_call_expr, root);
+ walk_function (convert_tramp_reference_stmt, convert_tramp_reference_op,
+ root);
+ walk_function (convert_gimple_call, NULL, root);
/* If the function does not use a static chain, then remember that. */
if (root->outer && !root->chain_decl && !root->chain_field)
@@ -1905,10 +1952,13 @@ convert_all_function_calls (struct nesting_info *root)
static void
finalize_nesting_tree_1 (struct nesting_info *root)
{
- tree stmt_list = NULL;
+ gimple_seq stmt_list;
+ gimple stmt;
tree context = root->context;
struct function *sf;
+ stmt_list = NULL;
+
/* If we created a non-local frame type or decl, we need to lay them
out at this time. */
if (root->frame_type)
@@ -1943,8 +1993,8 @@ finalize_nesting_tree_1 (struct nesting_info *root)
y = build3 (COMPONENT_REF, TREE_TYPE (field),
root->frame_decl, field, NULL_TREE);
- x = build_gimple_modify_stmt (y, x);
- append_to_statement_list (x, &stmt_list);
+ stmt = gimple_build_assign (y, x);
+ gimple_seq_add_stmt (&stmt_list, stmt);
}
}
@@ -1954,8 +2004,8 @@ finalize_nesting_tree_1 (struct nesting_info *root)
{
tree x = build3 (COMPONENT_REF, TREE_TYPE (root->chain_field),
root->frame_decl, root->chain_field, NULL_TREE);
- x = build_gimple_modify_stmt (x, get_chain_decl (root));
- append_to_statement_list (x, &stmt_list);
+ stmt = gimple_build_assign (x, get_chain_decl (root));
+ gimple_seq_add_stmt (&stmt_list, stmt);
}
/* If trampolines were created, then we need to initialize them. */
@@ -1982,19 +2032,19 @@ finalize_nesting_tree_1 (struct nesting_info *root)
arg1 = build_addr (x, context);
x = implicit_built_in_decls[BUILT_IN_INIT_TRAMPOLINE];
- x = build_call_expr (x, 3, arg1, arg2, arg3);
- append_to_statement_list (x, &stmt_list);
+ stmt = gimple_build_call (x, 3, arg1, arg2, arg3);
+ gimple_seq_add_stmt (&stmt_list, stmt);
}
}
/* If we created initialization statements, insert them. */
if (stmt_list)
{
- annotate_all_with_locus (&stmt_list,
- DECL_SOURCE_LOCATION (context));
- append_to_statement_list (BIND_EXPR_BODY (DECL_SAVED_TREE (context)),
- &stmt_list);
- BIND_EXPR_BODY (DECL_SAVED_TREE (context)) = stmt_list;
+ gimple bind;
+ annotate_all_with_location (stmt_list, DECL_SOURCE_LOCATION (context));
+ bind = gimple_seq_first_stmt (gimple_body (context));
+ gimple_seq_add_seq (&stmt_list, gimple_bind_body (bind));
+ gimple_bind_set_body (bind, stmt_list);
}
/* If a chain_decl was created, then it needs to be registered with
@@ -2014,10 +2064,12 @@ finalize_nesting_tree_1 (struct nesting_info *root)
/* Make sure all new local variables get inserted into the
proper BIND_EXPR. */
if (root->new_local_var_chain)
- declare_vars (root->new_local_var_chain, DECL_SAVED_TREE (root->context),
+ declare_vars (root->new_local_var_chain,
+ gimple_seq_first_stmt (gimple_body (root->context)),
false);
if (root->debug_var_chain)
- declare_vars (root->debug_var_chain, DECL_SAVED_TREE (root->context),
+ declare_vars (root->debug_var_chain,
+ gimple_seq_first_stmt (gimple_body (root->context)),
true);
/* Dump the translated tree function. */
@@ -2101,10 +2153,14 @@ lower_nested_functions (tree fndecl)
bitmap_obstack_initialize (&nesting_info_bitmap_obstack);
root = create_nesting_tree (cgn);
- walk_all_functions (convert_nonlocal_reference, root);
- walk_all_functions (convert_local_reference, root);
- walk_all_functions (convert_nl_goto_reference, root);
- walk_all_functions (convert_nl_goto_receiver, root);
+ walk_all_functions (convert_nonlocal_reference_stmt,
+ convert_nonlocal_reference_op,
+ root);
+ walk_all_functions (convert_local_reference_stmt,
+ convert_local_reference_op,
+ root);
+ walk_all_functions (convert_nl_goto_reference, NULL, root);
+ walk_all_functions (convert_nl_goto_receiver, NULL, root);
convert_all_function_calls (root);
finalize_nesting_tree (root);
unnest_nesting_tree (root);
diff --git a/gcc/tree-nomudflap.c b/gcc/tree-nomudflap.c
index 8d1ae7519b3..8e618a100f4 100644
--- a/gcc/tree-nomudflap.c
+++ b/gcc/tree-nomudflap.c
@@ -27,7 +27,7 @@ along with GCC; see the file COPYING3. If not see
#include "tree-inline.h"
#include "c-tree.h"
#include "c-common.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "diagnostic.h"
#include "hashtab.h"
#include "output.h"
diff --git a/gcc/tree-nrv.c b/gcc/tree-nrv.c
index f277be91d0c..40e7508f613 100644
--- a/gcc/tree-nrv.c
+++ b/gcc/tree-nrv.c
@@ -74,7 +74,8 @@ static tree finalize_nrv_r (tree *, int *, void *);
static tree
finalize_nrv_r (tree *tp, int *walk_subtrees, void *data)
{
- struct nrv_data *dp = (struct nrv_data *)data;
+ struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
+ struct nrv_data *dp = (struct nrv_data *) wi->info;
/* No need to walk into types. */
if (TYPE_P (*tp))
@@ -107,7 +108,7 @@ tree_nrv (void)
tree result_type = TREE_TYPE (result);
tree found = NULL;
basic_block bb;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
struct nrv_data data;
/* If this function does not return an aggregate type in memory, then
@@ -123,24 +124,29 @@ tree_nrv (void)
/* Look through each block for assignments to the RESULT_DECL. */
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))
{
- tree stmt = bsi_stmt (bsi);
- tree ret_expr;
+ gimple stmt = gsi_stmt (gsi);
+ tree ret_val;
- if (TREE_CODE (stmt) == RETURN_EXPR)
+ if (gimple_code (stmt) == GIMPLE_RETURN)
{
/* In a function with an aggregate return value, the
gimplifier has changed all non-empty RETURN_EXPRs to
return the RESULT_DECL. */
- ret_expr = TREE_OPERAND (stmt, 0);
- if (ret_expr)
- gcc_assert (ret_expr == result);
+ ret_val = gimple_return_retval (stmt);
+ if (ret_val)
+ gcc_assert (ret_val == result);
}
- else if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && GIMPLE_STMT_OPERAND (stmt, 0) == result)
+ else if (is_gimple_assign (stmt)
+ && gimple_assign_lhs (stmt) == result)
{
- ret_expr = GIMPLE_STMT_OPERAND (stmt, 1);
+ tree rhs;
+
+ if (!gimple_assign_copy_p (stmt))
+ return 0;
+
+ rhs = gimple_assign_rhs1 (stmt);
/* Now verify that this return statement uses the same value
as any previously encountered return statement. */
@@ -149,11 +155,11 @@ tree_nrv (void)
/* If we found a return statement using a different variable
than previous return statements, then we can not perform
NRV optimizations. */
- if (found != ret_expr)
+ if (found != rhs)
return 0;
}
else
- found = ret_expr;
+ found = rhs;
/* The returned value must be a local automatic variable of the
same type and alignment as the function's result. */
@@ -167,9 +173,9 @@ tree_nrv (void)
TREE_TYPE (found)))
return 0;
}
- else if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ else if (is_gimple_assign (stmt))
{
- tree addr = get_base_address (GIMPLE_STMT_OPERAND (stmt, 0));
+ tree addr = get_base_address (gimple_assign_lhs (stmt));
/* If there's any MODIFY of component of RESULT,
then bail out. */
if (addr && addr == result)
@@ -205,18 +211,21 @@ tree_nrv (void)
data.result = result;
FOR_EACH_BB (bb)
{
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); )
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); )
{
- tree *tp = bsi_stmt_ptr (bsi);
+ gimple stmt = gsi_stmt (gsi);
/* If this is a copy from VAR to RESULT, remove it. */
- if (TREE_CODE (*tp) == GIMPLE_MODIFY_STMT
- && GIMPLE_STMT_OPERAND (*tp, 0) == result
- && GIMPLE_STMT_OPERAND (*tp, 1) == found)
- bsi_remove (&bsi, true);
+ if (gimple_assign_copy_p (stmt)
+ && gimple_assign_lhs (stmt) == result
+ && gimple_assign_rhs1 (stmt) == found)
+ gsi_remove (&gsi, true);
else
{
- walk_tree (tp, finalize_nrv_r, &data, 0);
- bsi_next (&bsi);
+ struct walk_stmt_info wi;
+ memset (&wi, 0, sizeof (wi));
+ wi.info = &data;
+ walk_gimple_op (stmt, finalize_nrv_r, &wi);
+ gsi_next (&gsi);
}
}
}
@@ -277,7 +286,7 @@ dest_safe_for_nrv_p (tree dest)
return true;
}
-/* Walk through the function looking for GIMPLE_MODIFY_STMTs with calls that
+/* Walk through the function looking for GIMPLE_ASSIGNs with calls that
return in memory on the RHS. For each of these, determine whether it is
safe to pass the address of the LHS as the return slot, and mark the
call appropriately if so.
@@ -296,21 +305,24 @@ execute_return_slot_opt (void)
FOR_EACH_BB (bb)
{
- block_stmt_iterator i;
- for (i = bsi_start (bb); !bsi_end_p (i); bsi_next (&i))
+ gimple_stmt_iterator gsi;
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree stmt = bsi_stmt (i);
- tree call;
-
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && (call = GIMPLE_STMT_OPERAND (stmt, 1),
- TREE_CODE (call) == CALL_EXPR)
- && !CALL_EXPR_RETURN_SLOT_OPT (call)
- && aggregate_value_p (call, call))
- /* Check if the location being assigned to is
- call-clobbered. */
- CALL_EXPR_RETURN_SLOT_OPT (call) =
- dest_safe_for_nrv_p (GIMPLE_STMT_OPERAND (stmt, 0)) ? 1 : 0;
+ gimple stmt = gsi_stmt (gsi);
+ bool slot_opt_p;
+
+ if (is_gimple_call (stmt)
+ && gimple_call_lhs (stmt)
+ && !gimple_call_return_slot_opt_p (stmt)
+ && aggregate_value_p (TREE_TYPE (gimple_call_lhs (stmt)),
+ gimple_call_fndecl (stmt))
+ )
+ {
+ /* Check if the location being assigned to is
+ call-clobbered. */
+ slot_opt_p = dest_safe_for_nrv_p (gimple_call_lhs (stmt));
+ gimple_call_set_return_slot_opt (stmt, slot_opt_p);
+ }
}
}
return 0;
diff --git a/gcc/tree-object-size.c b/gcc/tree-object-size.c
index c1b3b5f1264..22c495154d4 100644
--- a/gcc/tree-object-size.c
+++ b/gcc/tree-object-size.c
@@ -43,13 +43,13 @@ static unsigned HOST_WIDE_INT unknown[4] = { -1, -1, 0, 0 };
static tree compute_object_offset (const_tree, const_tree);
static unsigned HOST_WIDE_INT addr_object_size (const_tree, int);
-static unsigned HOST_WIDE_INT alloc_object_size (const_tree, int);
-static tree pass_through_call (const_tree);
+static unsigned HOST_WIDE_INT alloc_object_size (const_gimple, int);
+static tree pass_through_call (const_gimple);
static void collect_object_sizes_for (struct object_size_info *, tree);
static void expr_object_size (struct object_size_info *, tree, tree);
static bool merge_object_sizes (struct object_size_info *, tree, tree,
unsigned HOST_WIDE_INT);
-static bool plus_expr_object_size (struct object_size_info *, tree, tree);
+static bool plus_stmt_object_size (struct object_size_info *, tree, gimple);
static bool cond_expr_object_size (struct object_size_info *, tree, tree);
static unsigned int compute_object_sizes (void);
static void init_offset_limit (void);
@@ -219,21 +219,21 @@ addr_object_size (const_tree ptr, int object_size_type)
}
-/* Compute __builtin_object_size for CALL, which is a CALL_EXPR.
+/* Compute __builtin_object_size for CALL, which is a GIMPLE_CALL.
Handles various allocation calls. OBJECT_SIZE_TYPE is the second
argument from __builtin_object_size. If unknown, return
unknown[object_size_type]. */
static unsigned HOST_WIDE_INT
-alloc_object_size (const_tree call, int object_size_type)
+alloc_object_size (const_gimple call, int object_size_type)
{
tree callee, bytes = NULL_TREE;
tree alloc_size;
int arg1 = -1, arg2 = -1;
- gcc_assert (TREE_CODE (call) == CALL_EXPR);
+ gcc_assert (is_gimple_call (call));
- callee = get_callee_fndecl (call);
+ callee = gimple_call_fndecl (call);
if (!callee)
return unknown[object_size_type];
@@ -244,7 +244,7 @@ alloc_object_size (const_tree call, int object_size_type)
arg1 = TREE_INT_CST_LOW (TREE_VALUE (p))-1;
if (TREE_CHAIN (p))
- arg2 = TREE_INT_CST_LOW (TREE_VALUE (TREE_CHAIN (p)))-1;
+ arg2 = TREE_INT_CST_LOW (TREE_VALUE (TREE_CHAIN (p)))-1;
}
if (DECL_BUILT_IN_CLASS (callee) == BUILT_IN_NORMAL)
@@ -260,19 +260,19 @@ alloc_object_size (const_tree call, int object_size_type)
break;
}
- if (arg1 < 0 || arg1 >= call_expr_nargs (call)
- || TREE_CODE (CALL_EXPR_ARG (call, arg1)) != INTEGER_CST
+ if (arg1 < 0 || arg1 >= (int)gimple_call_num_args (call)
+ || TREE_CODE (gimple_call_arg (call, arg1)) != INTEGER_CST
|| (arg2 >= 0
- && (arg2 >= call_expr_nargs (call)
- || TREE_CODE (CALL_EXPR_ARG (call, arg2)) != INTEGER_CST)))
+ && (arg2 >= (int)gimple_call_num_args (call)
+ || TREE_CODE (gimple_call_arg (call, arg2)) != INTEGER_CST)))
return unknown[object_size_type];
if (arg2 >= 0)
bytes = size_binop (MULT_EXPR,
- fold_convert (sizetype, CALL_EXPR_ARG (call, arg1)),
- fold_convert (sizetype, CALL_EXPR_ARG (call, arg2)));
+ fold_convert (sizetype, gimple_call_arg (call, arg1)),
+ fold_convert (sizetype, gimple_call_arg (call, arg2)));
else if (arg1 >= 0)
- bytes = fold_convert (sizetype, CALL_EXPR_ARG (call, arg1));
+ bytes = fold_convert (sizetype, gimple_call_arg (call, arg1));
if (bytes && host_integerp (bytes, 1))
return tree_low_cst (bytes, 1);
@@ -282,13 +282,13 @@ alloc_object_size (const_tree call, int object_size_type)
/* If object size is propagated from one of function's arguments directly
- to its return value, return that argument for CALL_EXPR CALL.
+ to its return value, return that argument for GIMPLE_CALL statement CALL.
Otherwise return NULL. */
static tree
-pass_through_call (const_tree call)
+pass_through_call (const_gimple call)
{
- tree callee = get_callee_fndecl (call);
+ tree callee = gimple_call_fndecl (call);
if (callee
&& DECL_BUILT_IN_CLASS (callee) == BUILT_IN_NORMAL)
@@ -308,8 +308,8 @@ pass_through_call (const_tree call)
case BUILT_IN_STRNCPY_CHK:
case BUILT_IN_STRCAT_CHK:
case BUILT_IN_STRNCAT_CHK:
- if (call_expr_nargs (call) >= 1)
- return CALL_EXPR_ARG (call, 0);
+ if (gimple_call_num_args (call) >= 1)
+ return gimple_call_arg (call, 0);
break;
default:
break;
@@ -332,16 +332,8 @@ compute_builtin_object_size (tree ptr, int object_size_type)
if (TREE_CODE (ptr) == ADDR_EXPR)
return addr_object_size (ptr, object_size_type);
- else if (TREE_CODE (ptr) == CALL_EXPR)
- {
- tree arg = pass_through_call (ptr);
- if (arg)
- return compute_builtin_object_size (arg, object_size_type);
- else
- return alloc_object_size (ptr, object_size_type);
- }
- else if (TREE_CODE (ptr) == SSA_NAME
+ if (TREE_CODE (ptr) == SSA_NAME
&& POINTER_TYPE_P (TREE_TYPE (ptr))
&& object_sizes[object_size_type] != NULL)
{
@@ -463,9 +455,7 @@ compute_builtin_object_size (tree ptr, int object_size_type)
return unknown[object_size_type];
}
-
-/* Compute object_sizes for PTR, defined to VALUE, which is not
- a SSA_NAME. */
+/* Compute object_sizes for PTR, defined to VALUE, which is not an SSA_NAME. */
static void
expr_object_size (struct object_size_info *osi, tree ptr, tree value)
@@ -487,8 +477,6 @@ expr_object_size (struct object_size_info *osi, tree ptr, tree value)
if (TREE_CODE (value) == ADDR_EXPR)
bytes = addr_object_size (value, object_size_type);
- else if (TREE_CODE (value) == CALL_EXPR)
- bytes = alloc_object_size (value, object_size_type);
else
bytes = unknown[object_size_type];
@@ -505,6 +493,64 @@ expr_object_size (struct object_size_info *osi, tree ptr, tree value)
}
+/* Compute object_sizes for PTR, defined to the result of a call. */
+
+static void
+call_object_size (struct object_size_info *osi, tree ptr, gimple call)
+{
+ int object_size_type = osi->object_size_type;
+ unsigned int varno = SSA_NAME_VERSION (ptr);
+ unsigned HOST_WIDE_INT bytes;
+
+ gcc_assert (is_gimple_call (call));
+
+ gcc_assert (object_sizes[object_size_type][varno]
+ != unknown[object_size_type]);
+ gcc_assert (osi->pass == 0);
+
+ bytes = alloc_object_size (call, object_size_type);
+
+ if ((object_size_type & 2) == 0)
+ {
+ if (object_sizes[object_size_type][varno] < bytes)
+ object_sizes[object_size_type][varno] = bytes;
+ }
+ else
+ {
+ if (object_sizes[object_size_type][varno] > bytes)
+ object_sizes[object_size_type][varno] = bytes;
+ }
+}
+
+
+/* Compute object_sizes for PTR, defined to an unknown value. */
+
+static void
+unknown_object_size (struct object_size_info *osi, tree ptr)
+{
+ int object_size_type = osi->object_size_type;
+ unsigned int varno = SSA_NAME_VERSION (ptr);
+ unsigned HOST_WIDE_INT bytes;
+
+ gcc_assert (object_sizes[object_size_type][varno]
+ != unknown[object_size_type]);
+ gcc_assert (osi->pass == 0);
+
+ bytes = unknown[object_size_type];
+
+ if ((object_size_type & 2) == 0)
+ {
+ if (object_sizes[object_size_type][varno] < bytes)
+ object_sizes[object_size_type][varno] = bytes;
+ }
+ else
+ {
+ if (object_sizes[object_size_type][varno] > bytes)
+ object_sizes[object_size_type][varno] = bytes;
+ }
+}
+
+
/* Merge object sizes of ORIG + OFFSET into DEST. Return true if
the object size might need reexamination later. */
@@ -552,20 +598,22 @@ merge_object_sizes (struct object_size_info *osi, tree dest, tree orig,
}
-/* Compute object_sizes for PTR, defined to VALUE, which is
- a POINTER_PLUS_EXPR. Return true if the object size might need reexamination
- later. */
+/* Compute object_sizes for VAR, defined to the result of an assignment
+ with operator POINTER_PLUS_EXPR. Return true if the object size might
+ need reexamination later. */
static bool
-plus_expr_object_size (struct object_size_info *osi, tree var, tree value)
+plus_stmt_object_size (struct object_size_info *osi, tree var, gimple stmt)
{
- tree op0 = TREE_OPERAND (value, 0);
- tree op1 = TREE_OPERAND (value, 1);
int object_size_type = osi->object_size_type;
unsigned int varno = SSA_NAME_VERSION (var);
unsigned HOST_WIDE_INT bytes;
+ tree op0, op1;
+
+ gcc_assert (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR);
- gcc_assert (TREE_CODE (value) == POINTER_PLUS_EXPR);
+ op0 = gimple_assign_rhs1 (stmt);
+ op1 = gimple_assign_rhs2 (stmt);
if (object_sizes[object_size_type][varno] == unknown[object_size_type])
return false;
@@ -583,6 +631,7 @@ plus_expr_object_size (struct object_size_info *osi, tree var, tree value)
{
unsigned HOST_WIDE_INT off = tree_low_cst (op1, 1);
+ /* op0 will be ADDR_EXPR here. */
bytes = compute_builtin_object_size (op0, object_size_type);
if (bytes == unknown[object_size_type])
;
@@ -611,7 +660,7 @@ plus_expr_object_size (struct object_size_info *osi, tree var, tree value)
}
-/* Compute object_sizes for PTR, defined to VALUE, which is
+/* Compute object_sizes for VAR, defined to VALUE, which is
a COND_EXPR. Return true if the object size might need reexamination
later. */
@@ -644,12 +693,11 @@ cond_expr_object_size (struct object_size_info *osi, tree var, tree value)
return reexamine;
}
-
/* Compute object sizes for VAR.
For ADDR_EXPR an object size is the number of remaining bytes
to the end of the object (where what is considered an object depends on
OSI->object_size_type).
- For allocation CALL_EXPR like malloc or calloc object size is the size
+ For allocation GIMPLE_CALL like malloc or calloc object size is the size
of the allocation.
For POINTER_PLUS_EXPR where second operand is a constant integer,
object size is object size of the first operand minus the constant.
@@ -660,7 +708,7 @@ cond_expr_object_size (struct object_size_info *osi, tree var, tree value)
unknown[object_size_type] for all objects bigger than half of the address
space, and constants less than half of the address space are considered
addition, while bigger constants subtraction.
- For a memcpy like CALL_EXPR that always returns one of its arguments, the
+ For a memcpy like GIMPLE_CALL that always returns one of its arguments, the
object size is object size of that argument.
Otherwise, object size is the maximum of object sizes of variables
that it might be set to. */
@@ -670,7 +718,7 @@ collect_object_sizes_for (struct object_size_info *osi, tree var)
{
int object_size_type = osi->object_size_type;
unsigned int varno = SSA_NAME_VERSION (var);
- tree stmt;
+ gimple stmt;
bool reexamine;
if (bitmap_bit_p (computed[object_size_type], varno))
@@ -709,51 +757,57 @@ collect_object_sizes_for (struct object_size_info *osi, tree var)
stmt = SSA_NAME_DEF_STMT (var);
reexamine = false;
- switch (TREE_CODE (stmt))
+ switch (gimple_code (stmt))
{
- case RETURN_EXPR:
- gcc_assert (TREE_CODE (TREE_OPERAND (stmt, 0)) == GIMPLE_MODIFY_STMT);
- stmt = TREE_OPERAND (stmt, 0);
- /* FALLTHRU */
-
- case GIMPLE_MODIFY_STMT:
+ case GIMPLE_ASSIGN:
{
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1), arg;
- STRIP_NOPS (rhs);
-
- if (TREE_CODE (rhs) == CALL_EXPR)
- {
- arg = pass_through_call (rhs);
- if (arg)
- rhs = arg;
- }
-
- if (TREE_CODE (rhs) == SSA_NAME
- && POINTER_TYPE_P (TREE_TYPE (rhs)))
- reexamine = merge_object_sizes (osi, var, rhs, 0);
-
- else if (TREE_CODE (rhs) == POINTER_PLUS_EXPR)
- reexamine = plus_expr_object_size (osi, var, rhs);
-
- else if (TREE_CODE (rhs) == COND_EXPR)
- reexamine = cond_expr_object_size (osi, var, rhs);
+ if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR)
+ reexamine = plus_stmt_object_size (osi, var, stmt);
+ else if (gimple_assign_single_p (stmt)
+ || gimple_assign_unary_nop_p (stmt))
+ {
+ tree rhs = gimple_assign_rhs1 (stmt);
+
+ if (TREE_CODE (rhs) == SSA_NAME
+ && POINTER_TYPE_P (TREE_TYPE (rhs)))
+ reexamine = merge_object_sizes (osi, var, rhs, 0);
+ else if (TREE_CODE (rhs) == COND_EXPR)
+ reexamine = cond_expr_object_size (osi, var, rhs);
+ else
+ expr_object_size (osi, var, rhs);
+ }
+ else
+ unknown_object_size (osi, var);
+ break;
+ }
- else
- expr_object_size (osi, var, rhs);
+ case GIMPLE_CALL:
+ {
+ tree arg = pass_through_call (stmt);
+ if (arg)
+ {
+ if (TREE_CODE (arg) == SSA_NAME
+ && POINTER_TYPE_P (TREE_TYPE (arg)))
+ reexamine = merge_object_sizes (osi, var, arg, 0);
+ else if (TREE_CODE (arg) == COND_EXPR)
+ reexamine = cond_expr_object_size (osi, var, arg);
+ else
+ expr_object_size (osi, var, arg);
+ }
+ else
+ call_object_size (osi, var, stmt);
break;
}
- case ASM_EXPR:
+ case GIMPLE_ASM:
/* Pointers defined by __asm__ statements can point anywhere. */
object_sizes[object_size_type][varno] = unknown[object_size_type];
break;
- case NOP_EXPR:
+ case GIMPLE_NOP:
{
tree decl = SSA_NAME_VAR (var);
- gcc_assert (IS_EMPTY_STMT (stmt));
-
if (TREE_CODE (decl) != PARM_DECL && DECL_INITIAL (decl))
expr_object_size (osi, var, DECL_INITIAL (decl));
else
@@ -761,13 +815,13 @@ collect_object_sizes_for (struct object_size_info *osi, tree var)
}
break;
- case PHI_NODE:
+ case GIMPLE_PHI:
{
- int i;
+ unsigned i;
- for (i = 0; i < PHI_NUM_ARGS (stmt); i++)
+ for (i = 0; i < gimple_phi_num_args (stmt); i++)
{
- tree rhs = PHI_ARG_DEF (stmt, i);
+ tree rhs = gimple_phi_arg (stmt, i)->def;
if (object_sizes[object_size_type][varno]
== unknown[object_size_type])
@@ -780,6 +834,7 @@ collect_object_sizes_for (struct object_size_info *osi, tree var)
}
break;
}
+
default:
gcc_unreachable ();
}
@@ -810,7 +865,7 @@ static void
check_for_plus_in_loops_1 (struct object_size_info *osi, tree var,
unsigned int depth)
{
- tree stmt = SSA_NAME_DEF_STMT (var);
+ gimple stmt = SSA_NAME_DEF_STMT (var);
unsigned int varno = SSA_NAME_VERSION (var);
if (osi->depths[varno])
@@ -838,57 +893,61 @@ check_for_plus_in_loops_1 (struct object_size_info *osi, tree var,
osi->depths[varno] = depth;
*osi->tos++ = varno;
- switch (TREE_CODE (stmt))
+ switch (gimple_code (stmt))
{
- case RETURN_EXPR:
- gcc_assert (TREE_CODE (TREE_OPERAND (stmt, 0)) == GIMPLE_MODIFY_STMT);
- stmt = TREE_OPERAND (stmt, 0);
- /* FALLTHRU */
- case GIMPLE_MODIFY_STMT:
+ case GIMPLE_ASSIGN:
{
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1), arg;
- STRIP_NOPS (rhs);
-
- if (TREE_CODE (rhs) == CALL_EXPR)
- {
- arg = pass_through_call (rhs);
- if (arg)
- rhs = arg;
- }
-
- if (TREE_CODE (rhs) == SSA_NAME)
- check_for_plus_in_loops_1 (osi, rhs, depth);
- else if (TREE_CODE (rhs) == POINTER_PLUS_EXPR)
- {
- tree op0 = TREE_OPERAND (rhs, 0);
- tree op1 = TREE_OPERAND (rhs, 1);
- tree cst, basevar;
-
- basevar = op0;
- cst = op1;
- gcc_assert (TREE_CODE (cst) == INTEGER_CST);
+ if ((gimple_assign_single_p (stmt)
+ || gimple_assign_unary_nop_p (stmt))
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME)
+ {
+ tree rhs = gimple_assign_rhs1 (stmt);
+
+ check_for_plus_in_loops_1 (osi, rhs, depth);
+ }
+ else if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR)
+ {
+ tree basevar = gimple_assign_rhs1 (stmt);
+ tree cst = gimple_assign_rhs2 (stmt);
+
+ gcc_assert (TREE_CODE (cst) == INTEGER_CST);
+
+ check_for_plus_in_loops_1 (osi, basevar,
+ depth + !integer_zerop (cst));
+ }
+ else
+ gcc_unreachable ();
+ break;
+ }
- check_for_plus_in_loops_1 (osi, basevar,
- depth + !integer_zerop (cst));
- }
- else
- gcc_unreachable ();
- break;
+ case GIMPLE_CALL:
+ {
+ tree arg = pass_through_call (stmt);
+ if (arg)
+ {
+ if (TREE_CODE (arg) == SSA_NAME)
+ check_for_plus_in_loops_1 (osi, arg, depth);
+ else
+ gcc_unreachable ();
+ }
+ break;
}
- case PHI_NODE:
+
+ case GIMPLE_PHI:
{
- int i;
+ unsigned i;
- for (i = 0; i < PHI_NUM_ARGS (stmt); i++)
+ for (i = 0; i < gimple_phi_num_args (stmt); i++)
{
- tree rhs = PHI_ARG_DEF (stmt, i);
+ tree rhs = gimple_phi_arg (stmt, i)->def;
if (TREE_CODE (rhs) == SSA_NAME)
check_for_plus_in_loops_1 (osi, rhs, depth);
}
break;
}
+
default:
gcc_unreachable ();
}
@@ -905,50 +964,29 @@ check_for_plus_in_loops_1 (struct object_size_info *osi, tree var,
static void
check_for_plus_in_loops (struct object_size_info *osi, tree var)
{
- tree stmt = SSA_NAME_DEF_STMT (var);
+ gimple stmt = SSA_NAME_DEF_STMT (var);
- switch (TREE_CODE (stmt))
- {
- case RETURN_EXPR:
- gcc_assert (TREE_CODE (TREE_OPERAND (stmt, 0)) == GIMPLE_MODIFY_STMT);
- stmt = TREE_OPERAND (stmt, 0);
- /* FALLTHRU */
-
- case GIMPLE_MODIFY_STMT:
- {
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1), arg;
- STRIP_NOPS (rhs);
-
- if (TREE_CODE (rhs) == CALL_EXPR)
- {
- arg = pass_through_call (rhs);
- if (arg)
- rhs = arg;
- }
+ /* NOTE: In the pre-tuples code, we handled a CALL_EXPR here,
+ and looked for a POINTER_PLUS_EXPR in the pass-through
+ argument, if any. In GIMPLE, however, such an expression
+ is not a valid call operand. */
- if (TREE_CODE (rhs) == POINTER_PLUS_EXPR)
- {
- tree op0 = TREE_OPERAND (rhs, 0);
- tree op1 = TREE_OPERAND (rhs, 1);
- tree cst, basevar;
-
- basevar = op0;
- cst = op1;
- gcc_assert (TREE_CODE (cst) == INTEGER_CST);
-
- if (integer_zerop (cst))
- break;
-
- osi->depths[SSA_NAME_VERSION (basevar)] = 1;
- *osi->tos++ = SSA_NAME_VERSION (basevar);
- check_for_plus_in_loops_1 (osi, var, 2);
- osi->depths[SSA_NAME_VERSION (basevar)] = 0;
- osi->tos--;
- }
- break;
- }
- default:
- break;
+ if (is_gimple_assign (stmt)
+ && gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR)
+ {
+ tree basevar = gimple_assign_rhs1 (stmt);
+ tree cst = gimple_assign_rhs2 (stmt);
+
+ gcc_assert (TREE_CODE (cst) == INTEGER_CST);
+
+ if (integer_zerop (cst))
+ return;
+
+ osi->depths[SSA_NAME_VERSION (basevar)] = 1;
+ *osi->tos++ = SSA_NAME_VERSION (basevar);
+ check_for_plus_in_loops_1 (osi, var, 2);
+ osi->depths[SSA_NAME_VERSION (basevar)] = 0;
+ osi->tos--;
}
}
@@ -997,30 +1035,29 @@ compute_object_sizes (void)
basic_block bb;
FOR_EACH_BB (bb)
{
- block_stmt_iterator i;
- for (i = bsi_start (bb); !bsi_end_p (i); bsi_next (&i))
+ gimple_stmt_iterator i;
+ for (i = gsi_start_bb (bb); !gsi_end_p (i); gsi_next (&i))
{
- tree *stmtp = bsi_stmt_ptr (i);
- tree call = get_rhs (*stmtp);
tree callee, result;
+ gimple call = gsi_stmt (i);
- if (!call || TREE_CODE (call) != CALL_EXPR)
+ if (gimple_code (call) != GIMPLE_CALL)
continue;
- callee = get_callee_fndecl (call);
+ callee = gimple_call_fndecl (call);
if (!callee
|| DECL_BUILT_IN_CLASS (callee) != BUILT_IN_NORMAL
|| DECL_FUNCTION_CODE (callee) != BUILT_IN_OBJECT_SIZE)
continue;
init_object_sizes ();
- result = fold_call_expr (call, false);
+ result = fold_call_stmt (call, false);
if (!result)
{
- if (call_expr_nargs (call) == 2
- && POINTER_TYPE_P (TREE_TYPE (CALL_EXPR_ARG (call, 0))))
+ if (gimple_call_num_args (call) == 2
+ && POINTER_TYPE_P (TREE_TYPE (gimple_call_arg (call, 0))))
{
- tree ost = CALL_EXPR_ARG (call, 1);
+ tree ost = gimple_call_arg (call, 1);
if (host_integerp (ost, 1))
{
@@ -1042,17 +1079,19 @@ compute_object_sizes (void)
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Simplified\n ");
- print_generic_stmt (dump_file, *stmtp, dump_flags);
+ print_gimple_stmt (dump_file, call, 0, dump_flags);
}
- if (!set_rhs (stmtp, result))
+ if (!update_call_from_tree (&i, result))
gcc_unreachable ();
- update_stmt (*stmtp);
+
+ /* NOTE: In the pre-tuples code, we called update_stmt here. This is
+ now handled by gsi_replace, called from update_call_from_tree. */
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "to\n ");
- print_generic_stmt (dump_file, *stmtp, dump_flags);
+ print_gimple_stmt (dump_file, call, 0, dump_flags);
fprintf (dump_file, "\n");
}
}
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index 8a0fe0c8ce3..ba3d0fcc9e0 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -115,7 +115,7 @@ execute_early_local_optimizations (void)
cgraph state so newly inserted functions are also early optimized.
However we execute early local optimizations for lately inserted
functions, in that case don't reset cgraph state back to IPA_SSA. */
- if (flag_unit_at_a_time && cgraph_state < CGRAPH_STATE_IPA_SSA)
+ if (cgraph_state < CGRAPH_STATE_IPA_SSA)
cgraph_state = CGRAPH_STATE_IPA_SSA;
return 0;
}
@@ -289,7 +289,7 @@ unsigned int
execute_fixup_cfg (void)
{
basic_block bb;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
int todo = gimple_in_ssa_p (cfun) ? TODO_verify_ssa : 0;
cfun->after_inlining = true;
@@ -297,35 +297,36 @@ execute_fixup_cfg (void)
if (cfun->eh)
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))
{
- tree stmt = bsi_stmt (bsi);
- tree call = get_call_expr_in (stmt);
- tree decl = call ? get_callee_fndecl (call) : NULL;
-
- if (decl && call_expr_flags (call) & (ECF_CONST | ECF_PURE
- | ECF_LOOPING_CONST_OR_PURE)
- && TREE_SIDE_EFFECTS (call))
+ gimple stmt = gsi_stmt (gsi);
+ tree decl = is_gimple_call (stmt)
+ ? gimple_call_fndecl (stmt)
+ : NULL;
+
+ if (decl
+ && gimple_call_flags (stmt) & (ECF_CONST
+ | ECF_PURE
+ | ECF_LOOPING_CONST_OR_PURE))
{
if (gimple_in_ssa_p (cfun))
{
todo |= TODO_update_ssa | TODO_cleanup_cfg;
update_stmt (stmt);
}
- TREE_SIDE_EFFECTS (call) = 0;
}
- if (decl && TREE_NOTHROW (decl))
- TREE_NOTHROW (call) = 1;
- if (!tree_could_throw_p (stmt) && lookup_stmt_eh_region (stmt))
+
+ if (!stmt_could_throw_p (stmt) && lookup_stmt_eh_region (stmt))
remove_stmt_from_eh_region (stmt);
}
- if (tree_purge_dead_eh_edges (bb))
+
+ if (gimple_purge_dead_eh_edges (bb))
todo |= TODO_cleanup_cfg;
}
/* Dump a textual representation of the flowgraph. */
if (dump_file)
- dump_tree_cfg (dump_file, dump_flags);
+ gimple_dump_cfg (dump_file, dump_flags);
return todo;
}
@@ -367,7 +368,7 @@ tree_lowering_passes (tree fn)
current_function_decl = fn;
push_cfun (DECL_STRUCT_FUNCTION (fn));
- tree_register_cfg_hooks ();
+ gimple_register_cfg_hooks ();
bitmap_obstack_initialize (NULL);
execute_pass_list (all_lowering_passes);
if (optimize && cgraph_global_info_ready)
@@ -391,7 +392,7 @@ tree_rest_of_compilation (tree fndecl)
timevar_push (TV_EXPAND);
- gcc_assert (!flag_unit_at_a_time || cgraph_global_info_ready);
+ gcc_assert (cgraph_global_info_ready);
node = cgraph_node (fndecl);
@@ -410,7 +411,7 @@ tree_rest_of_compilation (tree fndecl)
not safe to try to expand expressions involving them. */
cfun->dont_save_pending_sizes_p = 1;
- tree_register_cfg_hooks ();
+ gimple_register_cfg_hooks ();
bitmap_obstack_initialize (&reg_obstack); /* FIXME, only at RTL generation*/
/* Perform all tree transforms and optimizations. */
@@ -421,7 +422,6 @@ tree_rest_of_compilation (tree fndecl)
/* Release the default bitmap obstack. */
bitmap_obstack_release (NULL);
- DECL_SAVED_TREE (fndecl) = NULL;
set_cfun (NULL);
/* If requested, warn about function definitions where the function will
@@ -448,20 +448,17 @@ tree_rest_of_compilation (tree fndecl)
}
}
- if (!flag_inline_trees)
+ gimple_set_body (fndecl, NULL);
+ if (DECL_STRUCT_FUNCTION (fndecl) == 0
+ && !cgraph_node (fndecl)->origin)
{
- DECL_SAVED_TREE (fndecl) = NULL;
- if (DECL_STRUCT_FUNCTION (fndecl) == 0
- && !cgraph_node (fndecl)->origin)
- {
- /* Stop pointing to the local nodes about to be freed.
- But DECL_INITIAL must remain nonzero so we know this
- was an actual function definition.
- For a nested function, this is done in c_pop_function_context.
- If rest_of_compilation set this to 0, leave it 0. */
- if (DECL_INITIAL (fndecl) != 0)
- DECL_INITIAL (fndecl) = error_mark_node;
- }
+ /* Stop pointing to the local nodes about to be freed.
+ But DECL_INITIAL must remain nonzero so we know this
+ was an actual function definition.
+ For a nested function, this is done in c_pop_function_context.
+ If rest_of_compilation set this to 0, leave it 0. */
+ if (DECL_INITIAL (fndecl) != 0)
+ DECL_INITIAL (fndecl) = error_mark_node;
}
input_location = saved_loc;
diff --git a/gcc/tree-outof-ssa.c b/gcc/tree-outof-ssa.c
index 21f362b9059..58aed883007 100644
--- a/gcc/tree-outof-ssa.c
+++ b/gcc/tree-outof-ssa.c
@@ -141,9 +141,9 @@ create_temp (tree t)
static void
insert_copy_on_edge (edge e, tree dest, tree src)
{
- tree copy;
+ gimple copy;
- copy = build_gimple_modify_stmt (dest, src);
+ copy = gimple_build_assign (dest, src);
set_is_used (dest);
if (TREE_CODE (src) == ADDR_EXPR)
@@ -157,11 +157,11 @@ insert_copy_on_edge (edge e, tree dest, tree src)
"Inserting a copy on edge BB%d->BB%d :",
e->src->index,
e->dest->index);
- print_generic_expr (dump_file, copy, dump_flags);
+ print_gimple_stmt (dump_file, copy, 0, dump_flags);
fprintf (dump_file, "\n");
}
- bsi_insert_on_edge (e, copy);
+ gsi_insert_on_edge (e, copy);
}
@@ -315,15 +315,17 @@ eliminate_name (elim_graph g, tree T)
static void
eliminate_build (elim_graph g, basic_block B)
{
- tree phi;
tree T0, Ti;
int p0, pi;
+ gimple_stmt_iterator gsi;
clear_elim_graph (g);
- for (phi = phi_nodes (B); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (B); !gsi_end_p (gsi); gsi_next (&gsi))
{
- T0 = var_to_partition_to_var (g->map, PHI_RESULT (phi));
+ gimple phi = gsi_stmt (gsi);
+
+ T0 = var_to_partition_to_var (g->map, gimple_phi_result (phi));
/* Ignore results which are not in partitions. */
if (T0 == NULL_TREE)
@@ -551,7 +553,7 @@ assign_vars (var_map map)
If the stmt is changed, return true. */
static inline bool
-replace_use_variable (var_map map, use_operand_p p, tree *expr)
+replace_use_variable (var_map map, use_operand_p p, gimple *expr)
{
tree new_var;
tree var = USE_FROM_PTR (p);
@@ -562,11 +564,7 @@ replace_use_variable (var_map map, use_operand_p p, tree *expr)
int version = SSA_NAME_VERSION (var);
if (expr[version])
{
- tree new_expr = GIMPLE_STMT_OPERAND (expr[version], 1);
- SET_USE (p, new_expr);
-
- /* Clear the stmt's RHS, or GC might bite us. */
- GIMPLE_STMT_OPERAND (expr[version], 1) = NULL_TREE;
+ SET_USE (p, gimple_assign_rhs_to_tree (expr[version]));
return true;
}
}
@@ -614,20 +612,20 @@ static void
eliminate_virtual_phis (void)
{
basic_block bb;
- tree phi, next;
+ gimple_stmt_iterator gsi;
FOR_EACH_BB (bb)
{
- for (phi = phi_nodes (bb); phi; phi = next)
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); )
{
- next = PHI_CHAIN (phi);
- if (!is_gimple_reg (SSA_NAME_VAR (PHI_RESULT (phi))))
+ gimple phi = gsi_stmt (gsi);
+ if (!is_gimple_reg (SSA_NAME_VAR (gimple_phi_result (phi))))
{
#ifdef ENABLE_CHECKING
- int i;
+ size_t i;
/* There should be no arguments of this PHI which are in
the partition list, or we get incorrect results. */
- for (i = 0; i < PHI_NUM_ARGS (phi); i++)
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
{
tree arg = PHI_ARG_DEF (phi, i);
if (TREE_CODE (arg) == SSA_NAME
@@ -636,13 +634,15 @@ eliminate_virtual_phis (void)
fprintf (stderr, "Argument of PHI is not virtual (");
print_generic_expr (stderr, arg, TDF_SLIM);
fprintf (stderr, "), but the result is :");
- print_generic_stmt (stderr, phi, TDF_SLIM);
+ print_gimple_stmt (stderr, phi, 0, TDF_SLIM);
internal_error ("SSA corruption");
}
}
#endif
- remove_phi_node (phi, NULL_TREE, true);
+ remove_phi_node (&gsi, true);
}
+ else
+ gsi_next (&gsi);
}
}
}
@@ -655,13 +655,13 @@ eliminate_virtual_phis (void)
variable. */
static void
-rewrite_trees (var_map map, tree *values)
+rewrite_trees (var_map map, gimple *values)
{
elim_graph g;
basic_block bb;
- block_stmt_iterator si;
+ gimple_stmt_iterator gsi;
edge e;
- tree phi;
+ gimple_seq phi;
bool changed;
#ifdef ENABLE_CHECKING
@@ -670,14 +670,14 @@ rewrite_trees (var_map map, tree *values)
create incorrect code. */
FOR_EACH_BB (bb)
{
- tree phi;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree T0 = var_to_partition_to_var (map, PHI_RESULT (phi));
+ gimple phi = gsi_stmt (gsi);
+ tree T0 = var_to_partition_to_var (map, gimple_phi_result (phi));
if (T0 == NULL_TREE)
{
- int i;
- for (i = 0; i < PHI_NUM_ARGS (phi); i++)
+ size_t i;
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
{
tree arg = PHI_ARG_DEF (phi, i);
@@ -687,7 +687,7 @@ rewrite_trees (var_map map, tree *values)
fprintf (stderr, "Argument of PHI is in a partition :(");
print_generic_expr (stderr, arg, TDF_SLIM);
fprintf (stderr, "), but the result is not :");
- print_generic_stmt (stderr, phi, TDF_SLIM);
+ print_gimple_stmt (stderr, phi, 0, TDF_SLIM);
internal_error ("SSA corruption");
}
}
@@ -701,21 +701,18 @@ rewrite_trees (var_map map, tree *values)
g->map = map;
FOR_EACH_BB (bb)
{
- for (si = bsi_start (bb); !bsi_end_p (si); )
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); )
{
- tree stmt = bsi_stmt (si);
+ gimple stmt = gsi_stmt (gsi);
use_operand_p use_p, copy_use_p;
def_operand_p def_p;
bool remove = false, is_copy = false;
int num_uses = 0;
- stmt_ann_t ann;
ssa_op_iter iter;
- ann = stmt_ann (stmt);
changed = false;
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == SSA_NAME))
+ if (gimple_assign_copy_p (stmt))
is_copy = true;
copy_use_p = NULL_USE_OPERAND_P;
@@ -759,13 +756,13 @@ rewrite_trees (var_map map, tree *values)
/* Remove any stmts marked for removal. */
if (remove)
- bsi_remove (&si, true);
+ gsi_remove (&gsi, true);
else
{
if (changed)
if (maybe_clean_or_replace_eh_stmt (stmt, stmt))
- tree_purge_dead_eh_edges (bb);
- bsi_next (&si);
+ gimple_purge_dead_eh_edges (bb);
+ gsi_next (&gsi);
}
}
@@ -784,7 +781,7 @@ rewrite_trees (var_map map, tree *values)
/* These are the local work structures used to determine the best place to
insert the copies that were placed on edges by the SSA->normal pass.. */
static VEC(edge,heap) *edge_leader;
-static VEC(tree,heap) *stmt_list;
+static VEC(gimple_seq,heap) *stmt_list;
static bitmap leader_has_match = NULL;
static edge leader_match = NULL;
@@ -803,22 +800,19 @@ same_stmt_list_p (edge e)
/* Return TRUE if S1 and S2 are equivalent copies. */
static inline bool
-identical_copies_p (const_tree s1, const_tree s2)
+identical_copies_p (const_gimple s1, const_gimple s2)
{
#ifdef ENABLE_CHECKING
- gcc_assert (TREE_CODE (s1) == GIMPLE_MODIFY_STMT);
- gcc_assert (TREE_CODE (s2) == GIMPLE_MODIFY_STMT);
- gcc_assert (DECL_P (GIMPLE_STMT_OPERAND (s1, 0)));
- gcc_assert (DECL_P (GIMPLE_STMT_OPERAND (s2, 0)));
+ gcc_assert (is_gimple_assign (s1));
+ gcc_assert (is_gimple_assign (s2));
+ gcc_assert (DECL_P (gimple_assign_lhs (s1)));
+ gcc_assert (DECL_P (gimple_assign_lhs (s2)));
#endif
- if (GIMPLE_STMT_OPERAND (s1, 0) != GIMPLE_STMT_OPERAND (s2, 0))
+ if (gimple_assign_lhs (s1) != gimple_assign_lhs (s2))
return false;
- s1 = GIMPLE_STMT_OPERAND (s1, 1);
- s2 = GIMPLE_STMT_OPERAND (s2, 1);
-
- if (s1 != s2)
+ if (gimple_assign_rhs1 (s1) != gimple_assign_rhs1 (s2))
return false;
return true;
@@ -831,22 +825,19 @@ identical_copies_p (const_tree s1, const_tree s2)
static inline bool
identical_stmt_lists_p (const_edge e1, const_edge e2)
{
- tree t1 = PENDING_STMT (e1);
- tree t2 = PENDING_STMT (e2);
- tree_stmt_iterator tsi1, tsi2;
+ gimple_seq t1 = PENDING_STMT (e1);
+ gimple_seq t2 = PENDING_STMT (e2);
+ gimple_stmt_iterator gsi1, gsi2;
- gcc_assert (TREE_CODE (t1) == STATEMENT_LIST);
- gcc_assert (TREE_CODE (t2) == STATEMENT_LIST);
-
- for (tsi1 = tsi_start (t1), tsi2 = tsi_start (t2);
- !tsi_end_p (tsi1) && !tsi_end_p (tsi2);
- tsi_next (&tsi1), tsi_next (&tsi2))
+ for (gsi1 = gsi_start (t1), gsi2 = gsi_start (t2);
+ !gsi_end_p (gsi1) && !gsi_end_p (gsi2);
+ gsi_next (&gsi1), gsi_next (&gsi2))
{
- if (!identical_copies_p (tsi_stmt (tsi1), tsi_stmt (tsi2)))
+ if (!identical_copies_p (gsi_stmt (gsi1), gsi_stmt (gsi2)))
break;
}
- if (!tsi_end_p (tsi1) || ! tsi_end_p (tsi2))
+ if (!gsi_end_p (gsi1) || !gsi_end_p (gsi2))
return false;
return true;
@@ -859,7 +850,7 @@ static void
init_analyze_edges_for_bb (void)
{
edge_leader = VEC_alloc (edge, heap, 25);
- stmt_list = VEC_alloc (tree, heap, 25);
+ stmt_list = VEC_alloc (gimple_seq, heap, 25);
leader_has_match = BITMAP_ALLOC (NULL);
}
@@ -870,7 +861,7 @@ static void
fini_analyze_edges_for_bb (void)
{
VEC_free (edge, heap, edge_leader);
- VEC_free (tree, heap, stmt_list);
+ VEC_free (gimple_seq, heap, stmt_list);
BITMAP_FREE (leader_has_match);
}
@@ -902,13 +893,14 @@ contains_tree_r (tree * tp, int *walk_subtrees, void *data)
static bool
process_single_block_loop_latch (edge single_edge)
{
- tree stmts;
+ gimple_seq stmts;
basic_block b_exit, b_pheader, b_loop = single_edge->src;
edge_iterator ei;
edge e;
- block_stmt_iterator bsi, bsi_exit;
- tree_stmt_iterator tsi;
- tree expr, stmt;
+ gimple_stmt_iterator gsi, gsi_exit;
+ gimple_stmt_iterator tsi;
+ tree expr;
+ gimple stmt;
unsigned int count = 0;
if (single_edge == NULL || (single_edge->dest != single_edge->src)
@@ -941,29 +933,31 @@ process_single_block_loop_latch (edge single_edge)
if (b_exit == b_pheader || b_exit == b_loop || b_pheader == b_loop)
return false;
- bsi_exit = bsi_after_labels (b_exit);
+ gsi_exit = gsi_after_labels (b_exit);
/* Get the last stmt in the loop body. */
- bsi = bsi_last (single_edge->src);
- stmt = bsi_stmt (bsi);
+ gsi = gsi_last_bb (single_edge->src);
+ stmt = gsi_stmt (gsi);
- if (TREE_CODE (stmt) != COND_EXPR)
+ if (gimple_code (stmt) != GIMPLE_COND)
return false;
- expr = COND_EXPR_COND (stmt);
+
+ expr = build2 (gimple_cond_code (stmt), boolean_type_node,
+ gimple_cond_lhs (stmt), gimple_cond_rhs (stmt));
/* Iterate over the insns on the latch and count them. */
- for (tsi = tsi_start (stmts); !tsi_end_p (tsi); tsi_next (&tsi))
+ for (tsi = gsi_start (stmts); !gsi_end_p (tsi); gsi_next (&tsi))
{
- tree stmt1 = tsi_stmt (tsi);
+ gimple stmt1 = gsi_stmt (tsi);
tree var;
count++;
/* Check that the condition does not contain any new definition
created in the latch as the stmts from the latch intended
to precede it. */
- if (TREE_CODE (stmt1) != GIMPLE_MODIFY_STMT)
+ if (gimple_code (stmt1) != GIMPLE_ASSIGN)
return false;
- var = GIMPLE_STMT_OPERAND (stmt1, 0);
+ var = gimple_assign_lhs (stmt1);
if (TREE_THIS_VOLATILE (var)
|| TYPE_VOLATILE (TREE_TYPE (var))
|| walk_tree (&expr, contains_tree_r, var, NULL))
@@ -999,25 +993,26 @@ process_single_block_loop_latch (edge single_edge)
var = tmp_var;
...
*/
- for (tsi = tsi_start (stmts); !tsi_end_p (tsi); tsi_next (&tsi))
+ for (tsi = gsi_start (stmts); !gsi_end_p (tsi); gsi_next (&tsi))
{
- tree stmt1 = tsi_stmt (tsi);
- tree var, tmp_var, copy;
+ gimple stmt1 = gsi_stmt (tsi);
+ tree var, tmp_var;
+ gimple copy;
/* Create a new variable to load back the value of var in case
we exit the loop. */
- var = GIMPLE_STMT_OPERAND (stmt1, 0);
+ var = gimple_assign_lhs (stmt1);
tmp_var = create_temp (var);
- copy = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (tmp_var), tmp_var, var);
+ copy = gimple_build_assign (tmp_var, var);
set_is_used (tmp_var);
- bsi_insert_before (&bsi, copy, BSI_SAME_STMT);
- copy = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (tmp_var), var, tmp_var);
- bsi_insert_before (&bsi_exit, copy, BSI_SAME_STMT);
+ gsi_insert_before (&gsi, copy, GSI_SAME_STMT);
+ copy = gimple_build_assign (var, tmp_var);
+ gsi_insert_before (&gsi_exit, copy, GSI_SAME_STMT);
}
PENDING_STMT (single_edge) = 0;
/* Insert the new stmts to the loop body. */
- bsi_insert_before (&bsi, stmts, BSI_NEW_STMT);
+ gsi_insert_seq_before (&gsi, stmts, GSI_NEW_STMT);
if (dump_file)
fprintf (dump_file,
@@ -1038,8 +1033,8 @@ analyze_edges_for_bb (basic_block bb)
int count;
unsigned int x;
bool have_opportunity;
- block_stmt_iterator bsi;
- tree stmt;
+ gimple_stmt_iterator gsi;
+ gimple stmt;
edge single_edge = NULL;
bool is_label;
edge leader;
@@ -1061,7 +1056,7 @@ analyze_edges_for_bb (basic_block bb)
{
FOR_EACH_EDGE (e, ei, bb->preds)
if (PENDING_STMT (e))
- bsi_commit_one_edge_insert (e, NULL);
+ gsi_commit_one_edge_insert (e, NULL);
return;
}
@@ -1074,18 +1069,19 @@ analyze_edges_for_bb (basic_block bb)
gcc_assert (!(e->flags & EDGE_ABNORMAL));
if (e->flags & EDGE_FALLTHRU)
{
- bsi = bsi_start (e->src);
- if (!bsi_end_p (bsi))
+ gsi = gsi_start_bb (e->src);
+ if (!gsi_end_p (gsi))
{
- stmt = bsi_stmt (bsi);
- bsi_next (&bsi);
- gcc_assert (stmt != NULL_TREE);
- is_label = (TREE_CODE (stmt) == LABEL_EXPR);
+ stmt = gsi_stmt (gsi);
+ gsi_next (&gsi);
+ gcc_assert (stmt != NULL);
+ is_label = (gimple_code (stmt) == GIMPLE_LABEL);
/* Punt if it has non-label stmts, or isn't local. */
- if (!is_label || DECL_NONLOCAL (TREE_OPERAND (stmt, 0))
- || !bsi_end_p (bsi))
+ if (!is_label
+ || DECL_NONLOCAL (gimple_label_label (stmt))
+ || !gsi_end_p (gsi))
{
- bsi_commit_one_edge_insert (e, NULL);
+ gsi_commit_one_edge_insert (e, NULL);
continue;
}
}
@@ -1103,7 +1099,7 @@ analyze_edges_for_bb (basic_block bb)
/* Add stmts to the edge unless processed specially as a
single-block loop latch edge. */
if (!process_single_block_loop_latch (single_edge))
- bsi_commit_one_edge_insert (single_edge, NULL);
+ gsi_commit_one_edge_insert (single_edge, NULL);
}
return;
}
@@ -1111,7 +1107,7 @@ analyze_edges_for_bb (basic_block bb)
/* Ensure that we have empty worklists. */
#ifdef ENABLE_CHECKING
gcc_assert (VEC_length (edge, edge_leader) == 0);
- gcc_assert (VEC_length (tree, stmt_list) == 0);
+ gcc_assert (VEC_length (gimple_seq, stmt_list) == 0);
gcc_assert (bitmap_empty_p (leader_has_match));
#endif
@@ -1144,7 +1140,7 @@ analyze_edges_for_bb (basic_block bb)
if (!found)
{
VEC_safe_push (edge, heap, edge_leader, e);
- VEC_safe_push (tree, heap, stmt_list, PENDING_STMT (e));
+ VEC_safe_push (gimple_seq, heap, stmt_list, PENDING_STMT (e));
}
}
}
@@ -1153,9 +1149,9 @@ analyze_edges_for_bb (basic_block bb)
if (!have_opportunity)
{
for (x = 0; VEC_iterate (edge, edge_leader, x, leader); x++)
- bsi_commit_one_edge_insert (leader, NULL);
+ gsi_commit_one_edge_insert (leader, NULL);
VEC_truncate (edge, edge_leader, 0);
- VEC_truncate (tree, stmt_list, 0);
+ VEC_truncate (gimple_seq, stmt_list, 0);
bitmap_clear (leader_has_match);
return;
}
@@ -1170,8 +1166,8 @@ analyze_edges_for_bb (basic_block bb)
if (bitmap_bit_p (leader_has_match, x))
{
edge new_edge;
- block_stmt_iterator bsi;
- tree curr_stmt_list;
+ gimple_stmt_iterator gsi;
+ gimple_seq curr_stmt_list;
leader_match = leader;
@@ -1181,7 +1177,7 @@ analyze_edges_for_bb (basic_block bb)
and use the saved stmt list. */
PENDING_STMT (leader) = NULL;
leader->aux = leader;
- curr_stmt_list = VEC_index (tree, stmt_list, x);
+ curr_stmt_list = VEC_index (gimple_seq, stmt_list, x);
new_edge = make_forwarder_block (leader->dest, same_stmt_list_p,
NULL);
@@ -1191,7 +1187,7 @@ analyze_edges_for_bb (basic_block bb)
fprintf (dump_file, "Splitting BB %d for Common stmt list. ",
leader->dest->index);
fprintf (dump_file, "Original block is now BB%d.\n", bb->index);
- print_generic_stmt (dump_file, curr_stmt_list, TDF_VOPS);
+ print_gimple_seq (dump_file, curr_stmt_list, 0, TDF_VOPS);
}
FOR_EACH_EDGE (e, ei, new_edge->src->preds)
@@ -1202,22 +1198,22 @@ analyze_edges_for_bb (basic_block bb)
e->src->index, e->dest->index);
}
- bsi = bsi_last (leader->dest);
- bsi_insert_after (&bsi, curr_stmt_list, BSI_NEW_STMT);
+ gsi = gsi_last_bb (leader->dest);
+ gsi_insert_seq_after (&gsi, curr_stmt_list, GSI_NEW_STMT);
leader_match = NULL;
/* We should never get a new block now. */
}
else
{
- PENDING_STMT (leader) = VEC_index (tree, stmt_list, x);
- bsi_commit_one_edge_insert (leader, NULL);
+ PENDING_STMT (leader) = VEC_index (gimple_seq, stmt_list, x);
+ gsi_commit_one_edge_insert (leader, NULL);
}
/* Clear the working data structures. */
VEC_truncate (edge, edge_leader, 0);
- VEC_truncate (tree, stmt_list, 0);
+ VEC_truncate (gimple_seq, stmt_list, 0);
bitmap_clear (leader_has_match);
}
@@ -1297,9 +1293,9 @@ static void
remove_ssa_form (bool perform_ter)
{
basic_block bb;
- tree phi, next;
- tree *values = NULL;
+ gimple *values = NULL;
var_map map;
+ gimple_stmt_iterator gsi;
map = coalesce_ssa_name ();
@@ -1336,13 +1332,8 @@ remove_ssa_form (bool perform_ter)
/* Remove PHI nodes which have been translated back to real variables. */
FOR_EACH_BB (bb)
- {
- for (phi = phi_nodes (bb); phi; phi = next)
- {
- next = PHI_CHAIN (phi);
- remove_phi_node (phi, NULL_TREE, true);
- }
- }
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi);)
+ remove_phi_node (&gsi, true);
/* If any copies were inserted on edges, analyze and insert them now. */
perform_edge_inserts ();
@@ -1364,25 +1355,25 @@ static void
insert_backedge_copies (void)
{
basic_block bb;
+ gimple_stmt_iterator gsi;
FOR_EACH_BB (bb)
{
- tree phi;
-
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree result = PHI_RESULT (phi);
+ gimple phi = gsi_stmt (gsi);
+ tree result = gimple_phi_result (phi);
tree result_var;
- int i;
+ size_t i;
if (!is_gimple_reg (result))
continue;
result_var = SSA_NAME_VAR (result);
- for (i = 0; i < PHI_NUM_ARGS (phi); i++)
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
{
- tree arg = PHI_ARG_DEF (phi, i);
- edge e = PHI_ARG_EDGE (phi, i);
+ tree arg = gimple_phi_arg_def (phi, i);
+ edge e = gimple_phi_arg_edge (phi, i);
/* If the argument is not an SSA_NAME, then we will need a
constant initialization. If the argument is an SSA_NAME with
@@ -1392,12 +1383,13 @@ insert_backedge_copies (void)
&& (TREE_CODE (arg) != SSA_NAME
|| SSA_NAME_VAR (arg) != result_var))
{
- tree stmt, name, last = NULL;
- block_stmt_iterator bsi;
+ tree name;
+ gimple stmt, last = NULL;
+ gimple_stmt_iterator gsi2;
- bsi = bsi_last (PHI_ARG_EDGE (phi, i)->src);
- if (!bsi_end_p (bsi))
- last = bsi_stmt (bsi);
+ gsi2 = gsi_last_bb (gimple_phi_arg_edge (phi, i)->src);
+ if (!gsi_end_p (gsi2))
+ last = gsi_stmt (gsi2);
/* In theory the only way we ought to get back to the
start of a loop should be with a COND_EXPR or GOTO_EXPR.
@@ -1418,17 +1410,17 @@ insert_backedge_copies (void)
/* Create a new instance of the underlying variable of the
PHI result. */
- stmt = build_gimple_modify_stmt (NULL_TREE,
- PHI_ARG_DEF (phi, i));
+ stmt = gimple_build_assign (result_var,
+ gimple_phi_arg_def (phi, i));
name = make_ssa_name (result_var, stmt);
- GIMPLE_STMT_OPERAND (stmt, 0) = name;
+ gimple_assign_set_lhs (stmt, name);
/* Insert the new statement into the block and update
the PHI node. */
if (last && stmt_ends_bb_p (last))
- bsi_insert_before (&bsi, stmt, BSI_NEW_STMT);
+ gsi_insert_before (&gsi2, stmt, GSI_NEW_STMT);
else
- bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
+ gsi_insert_after (&gsi2, stmt, GSI_NEW_STMT);
SET_PHI_ARG_DEF (phi, i, name);
}
}
@@ -1454,12 +1446,12 @@ rewrite_out_of_ssa (void)
eliminate_virtual_phis ();
if (dump_file && (dump_flags & TDF_DETAILS))
- dump_tree_cfg (dump_file, dump_flags & ~TDF_DETAILS);
+ gimple_dump_cfg (dump_file, dump_flags & ~TDF_DETAILS);
remove_ssa_form (flag_tree_ter && !flag_mudflap);
if (dump_file && (dump_flags & TDF_DETAILS))
- dump_tree_cfg (dump_file, dump_flags & ~TDF_DETAILS);
+ gimple_dump_cfg (dump_file, dump_flags & ~TDF_DETAILS);
cfun->gimple_df->in_ssa_p = false;
return 0;
diff --git a/gcc/tree-parloops.c b/gcc/tree-parloops.c
index be0fd9cbac4..0373205c9f3 100644
--- a/gcc/tree-parloops.c
+++ b/gcc/tree-parloops.c
@@ -41,14 +41,14 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
The implementation is straightforward -- for each loop we test whether its
iterations are independent, and if it is the case (and some additional
conditions regarding profitability and correctness are satisfied), we
- add OMP_PARALLEL and OMP_FOR codes and let omp expansion machinery do
- its job.
+ add GIMPLE_OMP_PARALLEL and GIMPLE_OMP_FOR codes and let omp expansion
+ machinery do its job.
The most of the complexity is in bringing the code into shape expected
by the omp expanders:
- -- for OMP_FOR, ensuring that the loop has only one induction variable
- and that the exit test is at the start of the loop body
- -- for OMP_PARALLEL, replacing the references to local addressable
+ -- for GIMPLE_OMP_FOR, ensuring that the loop has only one induction
+ variable and that the exit test is at the start of the loop body
+ -- for GIMPLE_OMP_PARALLEL, replacing the references to local addressable
variables by accesses through pointers, and breaking up ssa chains
by storing the values incoming to the parallelized loop to a structure
passed to the new function as an argument (something similar is done
@@ -122,11 +122,11 @@ parloop
sum.27_11 = D.1827_8 + sum.27_29;
- OMP_CONTINUE
+ GIMPLE_OMP_CONTINUE
# Adding this reduction phi is done at create_phi_for_local_result() #
# sum.27_56 = PHI <sum.27_11, 0>
- OMP_RETURN
+ GIMPLE_OMP_RETURN
# Creating the atomic operation is done at
create_call_for_reduction_1() #
@@ -136,7 +136,7 @@ parloop
D.1840_60 = sum.27_56 + D.1839_59;
#pragma omp atomic_store (D.1840_60);
- OMP_RETURN
+ GIMPLE_OMP_RETURN
# collecting the result after the join of the threads is done at
create_loads_for_reductions().
@@ -166,15 +166,15 @@ parloop
reduction in the current loop. */
struct reduction_info
{
- tree reduc_stmt; /* reduction statement. */
- tree reduc_phi; /* The phi node defining the reduction. */
- enum tree_code reduction_code; /* code for the reduction operation. */
- tree keep_res; /* The PHI_RESULT of this phi is the resulting value
+ gimple reduc_stmt; /* reduction statement. */
+ gimple reduc_phi; /* The phi node defining the reduction. */
+ enum tree_code reduction_code;/* code for the reduction operation. */
+ gimple keep_res; /* The PHI_RESULT of this phi is the resulting value
of the reduction variable when existing the loop. */
tree initial_value; /* The initial value of the reduction var before entering the loop. */
tree field; /* the name of the field in the parloop data structure intended for reduction. */
tree init; /* reduction initialization value. */
- tree new_phi; /* (helper field) Newly created phi node whose result
+ gimple new_phi; /* (helper field) Newly created phi node whose result
will be passed to the atomic operation. Represents
the local result each thread computed for the reduction
operation. */
@@ -200,7 +200,7 @@ reduction_info_hash (const void *aa)
}
static struct reduction_info *
-reduction_phi (htab_t reduction_list, tree phi)
+reduction_phi (htab_t reduction_list, gimple phi)
{
struct reduction_info tmpred, *red;
@@ -249,14 +249,15 @@ name_to_copy_elt_hash (const void *aa)
reductions are found, they are inserted to the REDUCTION_LIST. */
static bool
-loop_parallel_p (struct loop *loop, htab_t reduction_list, struct tree_niter_desc *niter)
+loop_parallel_p (struct loop *loop, htab_t reduction_list,
+ struct tree_niter_desc *niter)
{
edge exit = single_dom_exit (loop);
VEC (ddr_p, heap) * dependence_relations;
- VEC (data_reference_p, heap) * datarefs;
+ VEC (data_reference_p, heap) *datarefs;
lambda_trans_matrix trans;
bool ret = false;
- tree phi;
+ gimple_stmt_iterator gsi;
loop_vec_info simple_loop_info;
/* Only consider innermost loops with just one exit. The innermost-loop
@@ -279,9 +280,10 @@ loop_parallel_p (struct loop *loop, htab_t reduction_list, struct tree_niter_des
simple_loop_info = vect_analyze_loop_form (loop);
- for (phi = phi_nodes (loop->header); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (loop->header); !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree reduc_stmt = NULL, operation;
+ gimple phi = gsi_stmt (gsi);
+ gimple reduc_stmt = NULL;
/* ??? TODO: Change this into a generic function that
recognizes reductions. */
@@ -302,7 +304,7 @@ loop_parallel_p (struct loop *loop, htab_t reduction_list, struct tree_niter_des
{
fprintf (dump_file,
"Detected reduction. reduction stmt is: \n");
- print_generic_stmt (dump_file, reduc_stmt, 0);
+ print_gimple_stmt (dump_file, reduc_stmt, 0, 0);
fprintf (dump_file, "\n");
}
@@ -310,8 +312,7 @@ loop_parallel_p (struct loop *loop, htab_t reduction_list, struct tree_niter_des
new_reduction->reduc_stmt = reduc_stmt;
new_reduction->reduc_phi = phi;
- operation = GIMPLE_STMT_OPERAND (reduc_stmt, 1);
- new_reduction->reduction_code = TREE_CODE (operation);
+ new_reduction->reduction_code = gimple_assign_rhs_code (reduc_stmt);
slot = htab_find_slot (reduction_list, new_reduction, INSERT);
*slot = new_reduction;
}
@@ -320,13 +321,13 @@ loop_parallel_p (struct loop *loop, htab_t reduction_list, struct tree_niter_des
/* Get rid of the information created by the vectorizer functions. */
destroy_loop_vec_info (simple_loop_info, true);
- for (phi = phi_nodes (exit->dest); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (exit->dest); !gsi_end_p (gsi); gsi_next (&gsi))
{
+ gimple phi = gsi_stmt (gsi);
struct reduction_info *red;
imm_use_iterator imm_iter;
use_operand_p use_p;
- tree reduc_phi;
-
+ gimple reduc_phi;
tree val = PHI_ARG_DEF_FROM_EDGE (phi, exit);
if (is_gimple_reg (val))
@@ -334,7 +335,7 @@ loop_parallel_p (struct loop *loop, htab_t reduction_list, struct tree_niter_des
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "phi is ");
- print_generic_expr (dump_file, phi, 0);
+ print_gimple_stmt (dump_file, phi, 0, 0);
fprintf (dump_file, "arg of phi to exit: value ");
print_generic_expr (dump_file, val, 0);
fprintf (dump_file, " used outside loop\n");
@@ -351,7 +352,7 @@ loop_parallel_p (struct loop *loop, htab_t reduction_list, struct tree_niter_des
reduc_phi = NULL;
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, val)
{
- if (flow_bb_inside_loop_p (loop, bb_for_stmt (USE_STMT (use_p))))
+ if (flow_bb_inside_loop_p (loop, gimple_bb (USE_STMT (use_p))))
{
reduc_phi = USE_STMT (use_p);
break;
@@ -368,9 +369,9 @@ loop_parallel_p (struct loop *loop, htab_t reduction_list, struct tree_niter_des
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "reduction phi is ");
- print_generic_expr (dump_file, red->reduc_phi, 0);
+ print_gimple_stmt (dump_file, red->reduc_phi, 0, 0);
fprintf (dump_file, "reduction stmt is ");
- print_generic_expr (dump_file, red->reduc_stmt, 0);
+ print_gimple_stmt (dump_file, red->reduc_stmt, 0, 0);
}
}
@@ -378,8 +379,9 @@ loop_parallel_p (struct loop *loop, htab_t reduction_list, struct tree_niter_des
/* The iterations of the loop may communicate only through bivs whose
iteration space can be distributed efficiently. */
- for (phi = phi_nodes (loop->header); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (loop->header); !gsi_end_p (gsi); gsi_next (&gsi))
{
+ gimple phi = gsi_stmt (gsi);
tree def = PHI_RESULT (phi);
affine_iv iv;
@@ -465,7 +467,9 @@ take_address_of (tree obj, tree type, edge entry, htab_t decl_address)
int uid;
void **dslot;
struct int_tree_map ielt, *nielt;
- tree *var_p, name, bvar, stmt, addr;
+ tree *var_p, name, bvar, addr;
+ gimple stmt;
+ gimple_seq stmts;
/* Since the address of OBJ is invariant, the trees may be shared.
Avoid rewriting unrelated parts of the code. */
@@ -483,10 +487,10 @@ take_address_of (tree obj, tree type, edge entry, htab_t decl_address)
addr = build_addr (*var_p, current_function_decl);
bvar = create_tmp_var (TREE_TYPE (addr), get_name (*var_p));
add_referenced_var (bvar);
- stmt = build_gimple_modify_stmt (bvar, addr);
+ stmt = gimple_build_assign (bvar, addr);
name = make_ssa_name (bvar, stmt);
- GIMPLE_STMT_OPERAND (stmt, 0) = name;
- bsi_insert_on_edge_immediate (entry, stmt);
+ gimple_assign_set_lhs (stmt, name);
+ gsi_insert_on_edge_immediate (entry, stmt);
nielt = XNEW (struct int_tree_map);
nielt->uid = uid;
@@ -500,17 +504,17 @@ take_address_of (tree obj, tree type, edge entry, htab_t decl_address)
{
*var_p = build1 (INDIRECT_REF, TREE_TYPE (*var_p), name);
name = force_gimple_operand (build_addr (obj, current_function_decl),
- &stmt, true, NULL_TREE);
- if (stmt)
- bsi_insert_on_edge_immediate (entry, stmt);
+ &stmts, true, NULL_TREE);
+ if (!gimple_seq_empty_p (stmts))
+ gsi_insert_seq_on_edge_immediate (entry, stmts);
}
if (TREE_TYPE (name) != type)
{
- name = force_gimple_operand (fold_convert (type, name), &stmt, true,
+ name = force_gimple_operand (fold_convert (type, name), &stmts, true,
NULL_TREE);
- if (stmt)
- bsi_insert_on_edge_immediate (entry, stmt);
+ if (!gimple_seq_empty_p (stmts))
+ gsi_insert_seq_on_edge_immediate (entry, stmts);
}
return name;
@@ -543,8 +547,7 @@ initialize_reductions (void **slot, void *data)
c = build_omp_clause (OMP_CLAUSE_REDUCTION);
OMP_CLAUSE_REDUCTION_CODE (c) = reduc->reduction_code;
- OMP_CLAUSE_DECL (c) =
- SSA_NAME_VAR (GIMPLE_STMT_OPERAND (reduc->reduc_stmt, 0));
+ OMP_CLAUSE_DECL (c) = SSA_NAME_VAR (gimple_assign_lhs (reduc->reduc_stmt));
init = omp_reduction_init (c, TREE_TYPE (bvar));
reduc->init = init;
@@ -569,6 +572,7 @@ initialize_reductions (void **slot, void *data)
struct elv_data
{
+ struct walk_stmt_info info;
edge entry;
htab_t decl_address;
bool changed;
@@ -632,7 +636,7 @@ eliminate_local_variables_1 (tree *tp, int *walk_subtrees, void *data)
return NULL_TREE;
}
- if (!EXPR_P (t) && !GIMPLE_STMT_P (t))
+ if (!EXPR_P (t))
*walk_subtrees = 0;
return NULL_TREE;
@@ -644,16 +648,17 @@ eliminate_local_variables_1 (tree *tp, int *walk_subtrees, void *data)
already. */
static void
-eliminate_local_variables_stmt (edge entry, tree stmt,
+eliminate_local_variables_stmt (edge entry, gimple stmt,
htab_t decl_address)
{
struct elv_data dta;
+ memset (&dta.info, '\0', sizeof (dta.info));
dta.entry = entry;
dta.decl_address = decl_address;
dta.changed = false;
- walk_tree (&stmt, eliminate_local_variables_1, &dta, NULL);
+ walk_gimple_op (stmt, eliminate_local_variables_1, &dta.info);
if (dta.changed)
update_stmt (stmt);
@@ -676,7 +681,7 @@ eliminate_local_variables (edge entry, edge exit)
basic_block bb;
VEC (basic_block, heap) *body = VEC_alloc (basic_block, heap, 3);
unsigned i;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
htab_t decl_address = htab_create (10, int_tree_map_hash, int_tree_map_eq,
free);
basic_block entry_bb = entry->src;
@@ -686,8 +691,8 @@ eliminate_local_variables (edge entry, edge exit)
for (i = 0; VEC_iterate (basic_block, body, i, bb); i++)
if (bb != entry_bb && bb != exit_bb)
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- eliminate_local_variables_stmt (entry, bsi_stmt (bsi),
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ eliminate_local_variables_stmt (entry, gsi_stmt (gsi),
decl_address);
htab_delete (decl_address);
@@ -703,14 +708,13 @@ expr_invariant_in_region_p (edge entry, edge exit, tree expr)
basic_block entry_bb = entry->src;
basic_block exit_bb = exit->dest;
basic_block def_bb;
- unsigned i, len;
if (is_gimple_min_invariant (expr))
return true;
if (TREE_CODE (expr) == SSA_NAME)
{
- def_bb = bb_for_stmt (SSA_NAME_DEF_STMT (expr));
+ def_bb = gimple_bb (SSA_NAME_DEF_STMT (expr));
if (def_bb
&& dominated_by_p (CDI_DOMINATORS, def_bb, entry_bb)
&& !dominated_by_p (CDI_DOMINATORS, def_bb, exit_bb))
@@ -719,15 +723,7 @@ expr_invariant_in_region_p (edge entry, edge exit, tree expr)
return true;
}
- if (!EXPR_P (expr) && !GIMPLE_STMT_P (expr))
- return false;
-
- len = TREE_OPERAND_LENGTH (expr);
- for (i = 0; i < len; i++)
- if (!expr_invariant_in_region_p (entry, exit, TREE_OPERAND (expr, i)))
- return false;
-
- return true;
+ return false;
}
/* If COPY_NAME_P is true, creates and returns a duplicate of NAME.
@@ -788,7 +784,7 @@ separate_decls_in_region_name (tree name,
if (copy_name_p)
{
- copy = duplicate_ssa_name (name, NULL_TREE);
+ copy = duplicate_ssa_name (name, NULL);
nelt = XNEW (struct name_to_copy_elt);
nelt->version = idx;
nelt->new_name = copy;
@@ -813,7 +809,7 @@ separate_decls_in_region_name (tree name,
replacement decls are stored in DECL_COPIES. */
static void
-separate_decls_in_region_stmt (edge entry, edge exit, tree stmt,
+separate_decls_in_region_stmt (edge entry, edge exit, gimple stmt,
htab_t name_copies, htab_t decl_copies)
{
use_operand_p use;
@@ -855,7 +851,7 @@ add_field_for_reduction (void **slot, void *data)
struct reduction_info *const red = (struct reduction_info *) *slot;
tree const type = (tree) data;
- tree var = SSA_NAME_VAR (GIMPLE_STMT_OPERAND (red->reduc_stmt, 0));
+ tree var = SSA_NAME_VAR (gimple_assign_lhs (red->reduc_stmt));
tree field = build_decl (FIELD_DECL, DECL_NAME (var), TREE_TYPE (var));
insert_field_into_struct (type, field);
@@ -896,13 +892,13 @@ create_phi_for_local_result (void **slot, void *data)
struct reduction_info *const reduc = (struct reduction_info *) *slot;
const struct loop *const loop = (const struct loop *) data;
edge e;
- tree new_phi;
+ gimple new_phi;
basic_block store_bb;
tree local_res;
/* STORE_BB is the block where the phi
should be stored. It is the destination of the loop exit.
- (Find the fallthru edge from OMP_CONTINUE). */
+ (Find the fallthru edge from GIMPLE_OMP_CONTINUE). */
store_bb = FALLTHRU_EDGE (loop->latch)->dest;
/* STORE_BB has two predecessors. One coming from the loop
@@ -914,11 +910,13 @@ create_phi_for_local_result (void **slot, void *data)
e = EDGE_PRED (store_bb, 1);
else
e = EDGE_PRED (store_bb, 0);
- local_res = make_ssa_name (SSA_NAME_VAR (GIMPLE_STMT_OPERAND (reduc->reduc_stmt, 0)), NULL_TREE);
+ local_res
+ = make_ssa_name (SSA_NAME_VAR (gimple_assign_lhs (reduc->reduc_stmt)),
+ NULL);
new_phi = create_phi_node (local_res, store_bb);
SSA_NAME_DEF_STMT (local_res) = new_phi;
add_phi_arg (new_phi, reduc->init, e);
- add_phi_arg (new_phi, GIMPLE_STMT_OPERAND (reduc->reduc_stmt, 0),
+ add_phi_arg (new_phi, gimple_assign_lhs (reduc->reduc_stmt),
FALLTHRU_EDGE (loop->latch));
reduc->new_phi = new_phi;
@@ -944,7 +942,7 @@ create_call_for_reduction_1 (void **slot, void *data)
{
struct reduction_info *const reduc = (struct reduction_info *) *slot;
struct clsn_data *const clsn_data = (struct clsn_data *) data;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
tree type = TREE_TYPE (PHI_RESULT (reduc->reduc_phi));
tree struct_type = TREE_TYPE (TREE_TYPE (clsn_data->load));
tree load_struct;
@@ -952,7 +950,8 @@ create_call_for_reduction_1 (void **slot, void *data)
basic_block new_bb;
edge e;
tree t, addr, addr_type, ref, x;
- tree tmp_load, load, name;
+ tree tmp_load, name;
+ gimple load;
load_struct = fold_build1 (INDIRECT_REF, struct_type, clsn_data->load);
t = build3 (COMPONENT_REF, type, load_struct, reduc->field, NULL_TREE);
@@ -969,27 +968,23 @@ create_call_for_reduction_1 (void **slot, void *data)
tmp_load = create_tmp_var (TREE_TYPE (TREE_TYPE (addr)), NULL);
add_referenced_var (tmp_load);
tmp_load = make_ssa_name (tmp_load, NULL);
- load = build2 (OMP_ATOMIC_LOAD, void_type_node, tmp_load, addr);
+ load = gimple_build_omp_atomic_load (tmp_load, addr);
SSA_NAME_DEF_STMT (tmp_load) = load;
- bsi = bsi_start (new_bb);
- bsi_insert_after (&bsi, load, BSI_NEW_STMT);
+ gsi = gsi_start_bb (new_bb);
+ gsi_insert_after (&gsi, load, GSI_NEW_STMT);
e = split_block (new_bb, load);
new_bb = e->dest;
- bsi = bsi_start (new_bb);
+ gsi = gsi_start_bb (new_bb);
ref = tmp_load;
- x =
- fold_build2 (reduc->reduction_code,
- TREE_TYPE (PHI_RESULT (reduc->new_phi)), ref,
- PHI_RESULT (reduc->new_phi));
-
- name =
- force_gimple_operand_bsi (&bsi, x, true, NULL_TREE, true,
- BSI_CONTINUE_LINKING);
+ x = fold_build2 (reduc->reduction_code,
+ TREE_TYPE (PHI_RESULT (reduc->new_phi)), ref,
+ PHI_RESULT (reduc->new_phi));
- x = build1 (OMP_ATOMIC_STORE, void_type_node, name);
+ name = force_gimple_operand_gsi (&gsi, x, true, NULL_TREE, true,
+ GSI_CONTINUE_LINKING);
- bsi_insert_after (&bsi, x, BSI_NEW_STMT);
+ gsi_insert_after (&gsi, gimple_build_omp_atomic_store (name), GSI_NEW_STMT);
return 1;
}
@@ -1002,7 +997,7 @@ create_call_for_reduction (struct loop *loop, htab_t reduction_list,
struct clsn_data *ld_st_data)
{
htab_traverse (reduction_list, create_phi_for_local_result, loop);
- /* Find the fallthru edge from OMP_CONTINUE. */
+ /* Find the fallthru edge from GIMPLE_OMP_CONTINUE. */
ld_st_data->load_bb = FALLTHRU_EDGE (loop->latch)->dest;
htab_traverse (reduction_list, create_call_for_reduction_1, ld_st_data);
}
@@ -1015,30 +1010,34 @@ create_loads_for_reductions (void **slot, void *data)
{
struct reduction_info *const red = (struct reduction_info *) *slot;
struct clsn_data *const clsn_data = (struct clsn_data *) data;
- tree stmt;
- block_stmt_iterator bsi;
- tree type = TREE_TYPE (GIMPLE_STMT_OPERAND (red->reduc_stmt, 0));
+ gimple stmt;
+ gimple_stmt_iterator gsi;
+ tree type = TREE_TYPE (gimple_assign_lhs (red->reduc_stmt));
tree struct_type = TREE_TYPE (TREE_TYPE (clsn_data->load));
tree load_struct;
tree name;
tree x;
- bsi = bsi_after_labels (clsn_data->load_bb);
+ gsi = gsi_after_labels (clsn_data->load_bb);
load_struct = fold_build1 (INDIRECT_REF, struct_type, clsn_data->load);
load_struct = build3 (COMPONENT_REF, type, load_struct, red->field,
NULL_TREE);
x = load_struct;
name = PHI_RESULT (red->keep_res);
- stmt = build_gimple_modify_stmt (name, x);
- GIMPLE_STMT_OPERAND (stmt, 0) = name;
+ stmt = gimple_build_assign (name, x);
SSA_NAME_DEF_STMT (name) = stmt;
- bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
+ gsi_insert_after (&gsi, stmt, GSI_NEW_STMT);
- remove_phi_node (red->keep_res, NULL_TREE, false);
-
- return 1;
+ for (gsi = gsi_start_phis (gimple_bb (red->keep_res));
+ !gsi_end_p (gsi); gsi_next (&gsi))
+ if (gsi_stmt (gsi) == red->keep_res)
+ {
+ remove_phi_node (&gsi, false);
+ return 1;
+ }
+ gcc_unreachable ();
}
/* Load the reduction result that was stored in LD_ST_DATA.
@@ -1048,18 +1047,16 @@ static void
create_final_loads_for_reduction (htab_t reduction_list,
struct clsn_data *ld_st_data)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
tree t;
+ gimple stmt;
- bsi = bsi_after_labels (ld_st_data->load_bb);
+ gsi = gsi_after_labels (ld_st_data->load_bb);
t = build_fold_addr_expr (ld_st_data->store);
- t =
- build_gimple_modify_stmt (ld_st_data->load,
- build_fold_addr_expr (ld_st_data->store));
+ stmt = gimple_build_assign (ld_st_data->load, t);
- bsi_insert_before (&bsi, t, BSI_NEW_STMT);
- SSA_NAME_DEF_STMT (ld_st_data->load) = t;
- GIMPLE_STMT_OPERAND (t, 0) = ld_st_data->load;
+ gsi_insert_before (&gsi, stmt, GSI_NEW_STMT);
+ SSA_NAME_DEF_STMT (ld_st_data->load) = stmt;
htab_traverse (reduction_list, create_loads_for_reductions, ld_st_data);
@@ -1076,18 +1073,16 @@ create_stores_for_reduction (void **slot, void *data)
{
struct reduction_info *const red = (struct reduction_info *) *slot;
struct clsn_data *const clsn_data = (struct clsn_data *) data;
- tree stmt;
- block_stmt_iterator bsi;
- tree type = TREE_TYPE (GIMPLE_STMT_OPERAND (red->reduc_stmt, 0));
-
- bsi = bsi_last (clsn_data->store_bb);
- stmt =
- build_gimple_modify_stmt (build3
- (COMPONENT_REF, type, clsn_data->store,
- red->field, NULL_TREE),
- red->initial_value);
+ tree t;
+ gimple stmt;
+ gimple_stmt_iterator gsi;
+ tree type = TREE_TYPE (gimple_assign_lhs (red->reduc_stmt));
+
+ gsi = gsi_last_bb (clsn_data->store_bb);
+ t = build3 (COMPONENT_REF, type, clsn_data->store, red->field, NULL_TREE);
+ stmt = gimple_build_assign (t, red->initial_value);
mark_virtual_ops_for_renaming (stmt);
- bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
+ gsi_insert_after (&gsi, stmt, GSI_NEW_STMT);
return 1;
}
@@ -1101,28 +1096,25 @@ create_loads_and_stores_for_name (void **slot, void *data)
{
struct name_to_copy_elt *const elt = (struct name_to_copy_elt *) *slot;
struct clsn_data *const clsn_data = (struct clsn_data *) data;
- tree stmt;
- block_stmt_iterator bsi;
+ tree t;
+ gimple stmt;
+ gimple_stmt_iterator gsi;
tree type = TREE_TYPE (elt->new_name);
tree struct_type = TREE_TYPE (TREE_TYPE (clsn_data->load));
tree load_struct;
- bsi = bsi_last (clsn_data->store_bb);
- stmt =
- build_gimple_modify_stmt (build3
- (COMPONENT_REF, type, clsn_data->store,
- elt->field, NULL_TREE),
- ssa_name (elt->version));
+ gsi = gsi_last_bb (clsn_data->store_bb);
+ t = build3 (COMPONENT_REF, type, clsn_data->store, elt->field, NULL_TREE);
+ stmt = gimple_build_assign (t, ssa_name (elt->version));
mark_virtual_ops_for_renaming (stmt);
- bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
+ gsi_insert_after (&gsi, stmt, GSI_NEW_STMT);
- bsi = bsi_last (clsn_data->load_bb);
+ gsi = gsi_last_bb (clsn_data->load_bb);
load_struct = fold_build1 (INDIRECT_REF, struct_type, clsn_data->load);
- stmt = build_gimple_modify_stmt (elt->new_name,
- build3 (COMPONENT_REF, type, load_struct,
- elt->field, NULL_TREE));
+ t = build3 (COMPONENT_REF, type, load_struct, elt->field, NULL_TREE);
+ stmt = gimple_build_assign (elt->new_name, t);
SSA_NAME_DEF_STMT (elt->new_name) = stmt;
- bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
+ gsi_insert_after (&gsi, stmt, GSI_NEW_STMT);
return 1;
}
@@ -1174,27 +1166,27 @@ separate_decls_in_region (edge entry, edge exit, htab_t reduction_list,
htab_t decl_copies = htab_create (10, int_tree_map_hash, int_tree_map_eq,
free);
unsigned i;
- tree phi, type, type_name, nvar;
- block_stmt_iterator bsi;
+ tree type, type_name, nvar;
+ gimple_stmt_iterator gsi;
struct clsn_data clsn_data;
VEC (basic_block, heap) *body = VEC_alloc (basic_block, heap, 3);
basic_block bb;
basic_block entry_bb = bb1;
basic_block exit_bb = exit->dest;
- entry = single_succ_edge(entry_bb);
+ entry = single_succ_edge (entry_bb);
gather_blocks_in_sese_region (entry_bb, exit_bb, &body);
for (i = 0; VEC_iterate (basic_block, body, i, bb); i++)
{
if (bb != entry_bb && bb != exit_bb)
{
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- separate_decls_in_region_stmt (entry, exit, phi, name_copies,
- decl_copies);
-
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- separate_decls_in_region_stmt (entry, exit, bsi_stmt (bsi),
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ separate_decls_in_region_stmt (entry, exit, gsi_stmt (gsi),
+ name_copies, decl_copies);
+
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ separate_decls_in_region_stmt (entry, exit, gsi_stmt (gsi),
name_copies, decl_copies);
}
}
@@ -1230,7 +1222,7 @@ separate_decls_in_region (edge entry, edge exit, htab_t reduction_list,
add_referenced_var (*arg_struct);
nvar = create_tmp_var (build_pointer_type (type), ".paral_data_load");
add_referenced_var (nvar);
- *new_arg_struct = make_ssa_name (nvar, NULL_TREE);
+ *new_arg_struct = make_ssa_name (nvar, NULL);
ld_st_data->store = *arg_struct;
ld_st_data->load = *new_arg_struct;
@@ -1246,7 +1238,7 @@ separate_decls_in_region (edge entry, edge exit, htab_t reduction_list,
{
htab_traverse (reduction_list, create_stores_for_reduction,
ld_st_data);
- clsn_data.load = make_ssa_name (nvar, NULL_TREE);
+ clsn_data.load = make_ssa_name (nvar, NULL);
clsn_data.load_bb = exit->dest;
clsn_data.store = ld_st_data->store;
create_final_loads_for_reduction (reduction_list, &clsn_data);
@@ -1338,15 +1330,18 @@ static void
canonicalize_loop_ivs (struct loop *loop, htab_t reduction_list, tree nit)
{
unsigned precision = TYPE_PRECISION (TREE_TYPE (nit));
- tree phi, prev, res, type, var_before, val, atype, mtype, t, next;
- block_stmt_iterator bsi;
+ tree res, type, var_before, val, atype, mtype;
+ gimple_stmt_iterator gsi, psi;
+ gimple phi, stmt;
bool ok;
affine_iv iv;
edge exit = single_dom_exit (loop);
struct reduction_info *red;
- for (phi = phi_nodes (loop->header); phi; phi = PHI_CHAIN (phi))
+ for (psi = gsi_start_phis (loop->header);
+ !gsi_end_p (psi); gsi_next (&psi))
{
+ phi = gsi_stmt (psi);
res = PHI_RESULT (phi);
if (is_gimple_reg (res) && TYPE_PRECISION (TREE_TYPE (res)) > precision)
@@ -1355,20 +1350,19 @@ canonicalize_loop_ivs (struct loop *loop, htab_t reduction_list, tree nit)
type = lang_hooks.types.type_for_size (precision, 1);
- bsi = bsi_last (loop->latch);
+ gsi = gsi_last_bb (loop->latch);
create_iv (build_int_cst_type (type, 0), build_int_cst (type, 1), NULL_TREE,
- loop, &bsi, true, &var_before, NULL);
+ loop, &gsi, true, &var_before, NULL);
- bsi = bsi_after_labels (loop->header);
- prev = NULL;
- for (phi = phi_nodes (loop->header); phi; phi = next)
+ gsi = gsi_after_labels (loop->header);
+ for (psi = gsi_start_phis (loop->header); !gsi_end_p (psi); )
{
- next = PHI_CHAIN (phi);
+ phi = gsi_stmt (psi);
res = PHI_RESULT (phi);
if (!is_gimple_reg (res) || res == var_before)
{
- prev = phi;
+ gsi_next (&psi);
continue;
}
@@ -1377,12 +1371,12 @@ canonicalize_loop_ivs (struct loop *loop, htab_t reduction_list, tree nit)
/* We preserve the reduction phi nodes. */
if (!ok && red)
{
- prev = phi;
+ gsi_next (&psi);
continue;
}
else
gcc_assert (ok);
- remove_phi_node (phi, prev, false);
+ remove_phi_node (&psi, false);
atype = TREE_TYPE (res);
mtype = POINTER_TYPE_P (atype) ? sizetype : atype;
@@ -1391,14 +1385,14 @@ canonicalize_loop_ivs (struct loop *loop, htab_t reduction_list, tree nit)
val = fold_build2 (POINTER_TYPE_P (atype)
? POINTER_PLUS_EXPR : PLUS_EXPR,
atype, unshare_expr (iv.base), val);
- val = force_gimple_operand_bsi (&bsi, val, false, NULL_TREE, true,
- BSI_SAME_STMT);
- t = build_gimple_modify_stmt (res, val);
- bsi_insert_before (&bsi, t, BSI_SAME_STMT);
- SSA_NAME_DEF_STMT (res) = t;
+ val = force_gimple_operand_gsi (&gsi, val, false, NULL_TREE, true,
+ GSI_SAME_STMT);
+ stmt = gimple_build_assign (res, val);
+ gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
+ SSA_NAME_DEF_STMT (res) = stmt;
}
- t = last_stmt (exit->src);
+ stmt = last_stmt (exit->src);
/* Make the loop exit if the control condition is not satisfied. */
if (exit->flags & EDGE_TRUE_VALUE)
{
@@ -1408,7 +1402,9 @@ canonicalize_loop_ivs (struct loop *loop, htab_t reduction_list, tree nit)
te->flags = EDGE_FALSE_VALUE;
fe->flags = EDGE_TRUE_VALUE;
}
- COND_EXPR_COND (t) = build2 (LT_EXPR, boolean_type_node, var_before, nit);
+ gimple_cond_set_code (stmt, LT_EXPR);
+ gimple_cond_set_lhs (stmt, var_before);
+ gimple_cond_set_rhs (stmt, nit);
}
/* Moves the exit condition of LOOP to the beginning of its header, and
@@ -1430,22 +1426,23 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit
unsigned n;
bool ok;
edge exit = single_dom_exit (loop), hpred;
- tree phi, nphi, cond, control, control_name, res, t, cond_stmt;
- block_stmt_iterator bsi;
+ tree control, control_name, res, t;
+ gimple phi, nphi, cond_stmt, stmt;
+ gimple_stmt_iterator gsi;
split_block_after_labels (loop->header);
orig_header = single_succ (loop->header);
hpred = single_succ_edge (loop->header);
cond_stmt = last_stmt (exit->src);
- cond = COND_EXPR_COND (cond_stmt);
- control = TREE_OPERAND (cond, 0);
- gcc_assert (TREE_OPERAND (cond, 1) == nit);
+ control = gimple_cond_lhs (cond_stmt);
+ gcc_assert (gimple_cond_rhs (cond_stmt) == nit);
/* Make sure that we have phi nodes on exit for all loop header phis
(create_parallel_loop requires that). */
- for (phi = phi_nodes (loop->header); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (loop->header); !gsi_end_p (gsi); gsi_next (&gsi))
{
+ phi = gsi_stmt (gsi);
res = PHI_RESULT (phi);
t = make_ssa_name (SSA_NAME_VAR (res), phi);
SET_PHI_RESULT (phi, t);
@@ -1456,7 +1453,7 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit
if (res == control)
{
- TREE_OPERAND (cond, 0) = t;
+ gimple_cond_set_lhs (cond_stmt, t);
update_stmt (cond_stmt);
control = t;
}
@@ -1466,22 +1463,26 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit
for (n = 0; bbs[n] != exit->src; n++)
continue;
nbbs = XNEWVEC (basic_block, n);
- ok = tree_duplicate_sese_tail (single_succ_edge (loop->header), exit,
- bbs + 1, n, nbbs);
+ ok = gimple_duplicate_sese_tail (single_succ_edge (loop->header), exit,
+ bbs + 1, n, nbbs);
gcc_assert (ok);
free (bbs);
ex_bb = nbbs[0];
free (nbbs);
/* Other than reductions, the only gimple reg that should be copied
- out of the loop is the control variable. */
+ out of the loop is the control variable. */
control_name = NULL_TREE;
- for (phi = phi_nodes (ex_bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (ex_bb); !gsi_end_p (gsi); )
{
+ phi = gsi_stmt (gsi);
res = PHI_RESULT (phi);
if (!is_gimple_reg (res))
- continue;
+ {
+ gsi_next (&gsi);
+ continue;
+ }
/* Check if it is a part of reduction. If it is,
keep the phi at the reduction's keep_res field. The
@@ -1498,93 +1499,95 @@ transform_to_exit_first_loop (struct loop *loop, htab_t reduction_list, tree nit
red = reduction_phi (reduction_list, SSA_NAME_DEF_STMT (val));
if (red)
- red->keep_res = phi;
+ {
+ red->keep_res = phi;
+ gsi_next (&gsi);
+ continue;
+ }
}
- else
- gcc_assert (control_name == NULL_TREE
- && SSA_NAME_VAR (res) == SSA_NAME_VAR (control));
+ gcc_assert (control_name == NULL_TREE
+ && SSA_NAME_VAR (res) == SSA_NAME_VAR (control));
control_name = res;
+ remove_phi_node (&gsi, false);
}
gcc_assert (control_name != NULL_TREE);
- phi = SSA_NAME_DEF_STMT (control_name);
- remove_phi_node (phi, NULL_TREE, false);
/* Initialize the control variable to NIT. */
- bsi = bsi_after_labels (ex_bb);
- nit = force_gimple_operand_bsi (&bsi,
+ gsi = gsi_after_labels (ex_bb);
+ nit = force_gimple_operand_gsi (&gsi,
fold_convert (TREE_TYPE (control_name), nit),
- false, NULL_TREE, false, BSI_SAME_STMT);
- t = build_gimple_modify_stmt (control_name, nit);
- bsi_insert_before (&bsi, t, BSI_NEW_STMT);
- SSA_NAME_DEF_STMT (control_name) = t;
+ false, NULL_TREE, false, GSI_SAME_STMT);
+ stmt = gimple_build_assign (control_name, nit);
+ gsi_insert_before (&gsi, stmt, GSI_NEW_STMT);
+ SSA_NAME_DEF_STMT (control_name) = stmt;
}
/* Create the parallel constructs for LOOP as described in gen_parallel_loop.
- LOOP_FN and DATA are the arguments of OMP_PARALLEL.
+ LOOP_FN and DATA are the arguments of GIMPLE_OMP_PARALLEL.
NEW_DATA is the variable that should be initialized from the argument
of LOOP_FN. N_THREADS is the requested number of threads. Returns the
- basic block containing OMP_PARALLEL tree. */
+ basic block containing GIMPLE_OMP_PARALLEL tree. */
static basic_block
create_parallel_loop (struct loop *loop, tree loop_fn, tree data,
tree new_data, unsigned n_threads)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
basic_block bb, paral_bb, for_bb, ex_bb;
- tree t, param, res, for_stmt;
- tree cvar, cvar_init, initvar, cvar_next, cvar_base, cond, phi, type;
+ tree t, param, res;
+ gimple stmt, for_stmt, phi, cond_stmt;
+ tree cvar, cvar_init, initvar, cvar_next, cvar_base, type;
edge exit, nexit, guard, end, e;
- /* Prepare the OMP_PARALLEL statement. */
+ /* Prepare the GIMPLE_OMP_PARALLEL statement. */
bb = loop_preheader_edge (loop)->src;
paral_bb = single_pred (bb);
- bsi = bsi_last (paral_bb);
+ gsi = gsi_last_bb (paral_bb);
t = build_omp_clause (OMP_CLAUSE_NUM_THREADS);
OMP_CLAUSE_NUM_THREADS_EXPR (t)
= build_int_cst (integer_type_node, n_threads);
- t = build4 (OMP_PARALLEL, void_type_node, NULL_TREE, t, loop_fn, data);
+ stmt = gimple_build_omp_parallel (NULL, t, loop_fn, data);
- bsi_insert_after (&bsi, t, BSI_NEW_STMT);
+ gsi_insert_after (&gsi, stmt, GSI_NEW_STMT);
/* Initialize NEW_DATA. */
if (data)
{
- bsi = bsi_after_labels (bb);
-
- param = make_ssa_name (DECL_ARGUMENTS (loop_fn), NULL_TREE);
- t = build_gimple_modify_stmt (param, build_fold_addr_expr (data));
- bsi_insert_before (&bsi, t, BSI_SAME_STMT);
- SSA_NAME_DEF_STMT (param) = t;
-
- t = build_gimple_modify_stmt (new_data,
- fold_convert (TREE_TYPE (new_data),
- param));
- bsi_insert_before (&bsi, t, BSI_SAME_STMT);
- SSA_NAME_DEF_STMT (new_data) = t;
+ gsi = gsi_after_labels (bb);
+
+ param = make_ssa_name (DECL_ARGUMENTS (loop_fn), NULL);
+ stmt = gimple_build_assign (param, build_fold_addr_expr (data));
+ gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
+ SSA_NAME_DEF_STMT (param) = stmt;
+
+ stmt = gimple_build_assign (new_data,
+ fold_convert (TREE_TYPE (new_data), param));
+ gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
+ SSA_NAME_DEF_STMT (new_data) = stmt;
}
- /* Emit OMP_RETURN for OMP_PARALLEL. */
+ /* Emit GIMPLE_OMP_RETURN for GIMPLE_OMP_PARALLEL. */
bb = split_loop_exit_edge (single_dom_exit (loop));
- bsi = bsi_last (bb);
- bsi_insert_after (&bsi, make_node (OMP_RETURN), BSI_NEW_STMT);
+ gsi = gsi_last_bb (bb);
+ gsi_insert_after (&gsi, gimple_build_omp_return (false), GSI_NEW_STMT);
- /* Extract data for OMP_FOR. */
+ /* Extract data for GIMPLE_OMP_FOR. */
gcc_assert (loop->header == single_dom_exit (loop)->src);
- cond = COND_EXPR_COND (last_stmt (loop->header));
+ cond_stmt = last_stmt (loop->header);
- cvar = TREE_OPERAND (cond, 0);
+ cvar = gimple_cond_lhs (cond_stmt);
cvar_base = SSA_NAME_VAR (cvar);
phi = SSA_NAME_DEF_STMT (cvar);
cvar_init = PHI_ARG_DEF_FROM_EDGE (phi, loop_preheader_edge (loop));
- initvar = make_ssa_name (cvar_base, NULL_TREE);
+ initvar = make_ssa_name (cvar_base, NULL);
SET_USE (PHI_ARG_DEF_PTR_FROM_EDGE (phi, loop_preheader_edge (loop)),
initvar);
cvar_next = PHI_ARG_DEF_FROM_EDGE (phi, loop_latch_edge (loop));
- bsi = bsi_last (loop->latch);
- gcc_assert (bsi_stmt (bsi) == SSA_NAME_DEF_STMT (cvar_next));
- bsi_remove (&bsi, true);
+ gsi = gsi_last_bb (loop->latch);
+ gcc_assert (gsi_stmt (gsi) == SSA_NAME_DEF_STMT (cvar_next));
+ gsi_remove (&gsi, true);
/* Prepare cfg. */
for_bb = split_edge (loop_preheader_edge (loop));
@@ -1595,56 +1598,48 @@ create_parallel_loop (struct loop *loop, tree loop_fn, tree data,
guard = make_edge (for_bb, ex_bb, 0);
single_succ_edge (loop->latch)->flags = 0;
end = make_edge (loop->latch, ex_bb, EDGE_FALLTHRU);
- for (phi = phi_nodes (ex_bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (ex_bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
+ phi = gsi_stmt (gsi);
res = PHI_RESULT (phi);
- gcc_assert (!is_gimple_reg (phi));
- t = SSA_NAME_DEF_STMT (PHI_ARG_DEF_FROM_EDGE (phi, exit));
- add_phi_arg (phi, PHI_ARG_DEF_FROM_EDGE (t, loop_preheader_edge (loop)),
+ stmt = SSA_NAME_DEF_STMT (PHI_ARG_DEF_FROM_EDGE (phi, exit));
+ add_phi_arg (phi,
+ PHI_ARG_DEF_FROM_EDGE (stmt, loop_preheader_edge (loop)),
guard);
- add_phi_arg (phi, PHI_ARG_DEF_FROM_EDGE (t, loop_latch_edge (loop)),
+ add_phi_arg (phi, PHI_ARG_DEF_FROM_EDGE (stmt, loop_latch_edge (loop)),
end);
}
e = redirect_edge_and_branch (exit, nexit->dest);
PENDING_STMT (e) = NULL;
- /* Emit OMP_FOR. */
- TREE_OPERAND (cond, 0) = cvar_base;
+ /* Emit GIMPLE_OMP_FOR. */
+ gimple_cond_set_lhs (cond_stmt, cvar_base);
type = TREE_TYPE (cvar);
t = build_omp_clause (OMP_CLAUSE_SCHEDULE);
OMP_CLAUSE_SCHEDULE_KIND (t) = OMP_CLAUSE_SCHEDULE_STATIC;
- for_stmt = make_node (OMP_FOR);
- TREE_TYPE (for_stmt) = void_type_node;
- OMP_FOR_CLAUSES (for_stmt) = t;
- OMP_FOR_INIT (for_stmt) = make_tree_vec (1);
- TREE_VEC_ELT (OMP_FOR_INIT (for_stmt), 0)
- = build_gimple_modify_stmt (initvar, cvar_init);
- OMP_FOR_COND (for_stmt) = make_tree_vec (1);
- TREE_VEC_ELT (OMP_FOR_COND (for_stmt), 0) = cond;
- OMP_FOR_INCR (for_stmt) = make_tree_vec (2);
- TREE_VEC_ELT (OMP_FOR_INCR (for_stmt), 0)
- = build_gimple_modify_stmt (cvar_base,
- build2 (PLUS_EXPR, type, cvar_base,
- build_int_cst (type, 1)));
- OMP_FOR_BODY (for_stmt) = NULL_TREE;
- OMP_FOR_PRE_BODY (for_stmt) = NULL_TREE;
-
- bsi = bsi_last (for_bb);
- bsi_insert_after (&bsi, for_stmt, BSI_NEW_STMT);
+ for_stmt = gimple_build_omp_for (NULL, t, 1, NULL);
+ gimple_omp_for_set_index (for_stmt, 0, initvar);
+ gimple_omp_for_set_initial (for_stmt, 0, cvar_init);
+ gimple_omp_for_set_final (for_stmt, 0, gimple_cond_rhs (cond_stmt));
+ gimple_omp_for_set_cond (for_stmt, 0, gimple_cond_code (cond_stmt));
+ gimple_omp_for_set_incr (for_stmt, 0, build2 (PLUS_EXPR, type,
+ cvar_base,
+ build_int_cst (type, 1)));
+
+ gsi = gsi_last_bb (for_bb);
+ gsi_insert_after (&gsi, for_stmt, GSI_NEW_STMT);
SSA_NAME_DEF_STMT (initvar) = for_stmt;
- /* Emit OMP_CONTINUE. */
- bsi = bsi_last (loop->latch);
- t = build2 (OMP_CONTINUE, void_type_node, cvar_next, cvar);
- bsi_insert_after (&bsi, t, BSI_NEW_STMT);
- SSA_NAME_DEF_STMT (cvar_next) = t;
+ /* Emit GIMPLE_OMP_CONTINUE. */
+ gsi = gsi_last_bb (loop->latch);
+ stmt = gimple_build_omp_continue (cvar_next, cvar);
+ gsi_insert_after (&gsi, stmt, GSI_NEW_STMT);
+ SSA_NAME_DEF_STMT (cvar_next) = stmt;
- /* Emit OMP_RETURN for OMP_FOR. */
- bsi = bsi_last (ex_bb);
- t = make_node (OMP_RETURN);
- OMP_RETURN_NOWAIT (t) = 1;
- bsi_insert_after (&bsi, t, BSI_NEW_STMT);
+ /* Emit GIMPLE_OMP_RETURN for GIMPLE_OMP_FOR. */
+ gsi = gsi_last_bb (ex_bb);
+ gsi_insert_after (&gsi, gimple_build_omp_return (true), GSI_NEW_STMT);
return paral_bb;
}
@@ -1660,7 +1655,8 @@ gen_parallel_loop (struct loop *loop, htab_t reduction_list,
struct loop *nloop;
loop_iterator li;
tree many_iterations_cond, type, nit;
- tree stmts, arg_struct, new_arg_struct;
+ tree arg_struct, new_arg_struct;
+ gimple_seq stmts;
basic_block parallel_head;
edge entry, exit;
struct clsn_data clsn_data;
@@ -1690,14 +1686,14 @@ gen_parallel_loop (struct loop *loop, htab_t reduction_list,
BODY1;
store all local loop-invariant variables used in body of the loop to DATA.
- OMP_PARALLEL (OMP_CLAUSE_NUM_THREADS (N_THREADS), LOOPFN, DATA);
+ GIMPLE_OMP_PARALLEL (OMP_CLAUSE_NUM_THREADS (N_THREADS), LOOPFN, DATA);
load the variables from DATA.
- OMP_FOR (IV = INIT; COND; IV += STEP) (OMP_CLAUSE_SCHEDULE (static))
+ GIMPLE_OMP_FOR (IV = INIT; COND; IV += STEP) (OMP_CLAUSE_SCHEDULE (static))
BODY2;
BODY1;
- OMP_CONTINUE;
- OMP_RETURN -- OMP_FOR
- OMP_RETURN -- OMP_PARALLEL
+ GIMPLE_OMP_CONTINUE;
+ GIMPLE_OMP_RETURN -- GIMPLE_OMP_FOR
+ GIMPLE_OMP_RETURN -- GIMPLE_OMP_PARALLEL
goto end;
original:
@@ -1723,7 +1719,7 @@ gen_parallel_loop (struct loop *loop, htab_t reduction_list,
nit = force_gimple_operand (unshare_expr (niter->niter), &stmts, true,
NULL_TREE);
if (stmts)
- bsi_insert_on_edge_immediate (loop_preheader_edge (loop), stmts);
+ gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
many_iterations_cond =
fold_build2 (GE_EXPR, boolean_type_node,
@@ -1735,14 +1731,14 @@ gen_parallel_loop (struct loop *loop, htab_t reduction_list,
many_iterations_cond
= force_gimple_operand (many_iterations_cond, &stmts, false, NULL_TREE);
if (stmts)
- bsi_insert_on_edge_immediate (loop_preheader_edge (loop), stmts);
+ gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
if (!is_gimple_condexpr (many_iterations_cond))
{
many_iterations_cond
= force_gimple_operand (many_iterations_cond, &stmts,
true, NULL_TREE);
if (stmts)
- bsi_insert_on_edge_immediate (loop_preheader_edge (loop), stmts);
+ gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
}
initialize_original_copy_tables ();
@@ -1803,16 +1799,16 @@ gen_parallel_loop (struct loop *loop, htab_t reduction_list,
/* Returns true when LOOP contains vector phi nodes. */
static bool
-loop_has_vector_phi_nodes (struct loop *loop)
+loop_has_vector_phi_nodes (struct loop *loop ATTRIBUTE_UNUSED)
{
unsigned i;
basic_block *bbs = get_loop_body_in_dom_order (loop);
+ gimple_stmt_iterator gsi;
bool res = true;
- tree phi;
for (i = 0; i < loop->num_nodes; i++)
- for (phi = phi_nodes (bbs[i]); phi; phi = PHI_CHAIN (phi))
- if (TREE_CODE (TREE_TYPE (PHI_RESULT (phi))) == VECTOR_TYPE)
+ for (gsi = gsi_start_phis (bbs[i]); !gsi_end_p (gsi); gsi_next (&gsi))
+ if (TREE_CODE (TREE_TYPE (PHI_RESULT (gsi_stmt (gsi)))) == VECTOR_TYPE)
goto end;
res = false;
@@ -1841,12 +1837,13 @@ parallelize_loops (void)
reduction_list = htab_create (10, reduction_info_hash,
reduction_info_eq, free);
+ init_stmt_vec_info_vec ();
FOR_EACH_LOOP (li, loop, 0)
{
htab_empty (reduction_list);
if (/* Do not bother with loops in cold areas. */
- !maybe_hot_bb_p (loop->header)
+ optimize_loop_nest_for_size_p (loop)
/* Or loops that roll too little. */
|| expected_loop_iterations (loop) <= n_threads
/* And of course, the loop must be parallelizable. */
@@ -1865,6 +1862,7 @@ parallelize_loops (void)
verify_loop_closed_ssa ();
}
+ free_stmt_vec_info_vec ();
htab_delete (reduction_list);
return changed;
}
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index c695863e553..a3c9b26813f 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -72,7 +72,9 @@ enum tree_dump_index
#define TDF_DIAGNOSTIC (1 << 15) /* A dump to be put in a diagnostic
message. */
#define TDF_VERBOSE (1 << 16) /* A dump that uses the full tree
- dumper to print stmts. */
+ dumper to print stmts. */
+#define TDF_RHS_ONLY (1 << 17) /* a flag to only print the RHS of
+ a gimple stmt. */
extern char *get_dump_file_name (enum tree_dump_index);
extern int dump_enabled_p (enum tree_dump_index);
@@ -102,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
@@ -343,6 +346,7 @@ extern struct gimple_opt_pass pass_merge_phi;
extern struct gimple_opt_pass pass_split_crit_edges;
extern struct gimple_opt_pass pass_pre;
extern struct gimple_opt_pass pass_profile;
+extern struct gimple_opt_pass pass_strip_predict_hints;
extern struct gimple_opt_pass pass_lower_complex_O0;
extern struct gimple_opt_pass pass_lower_complex;
extern struct gimple_opt_pass pass_lower_vector;
@@ -376,7 +380,6 @@ extern struct gimple_opt_pass pass_fre;
extern struct gimple_opt_pass pass_linear_transform;
extern struct gimple_opt_pass pass_check_data_deps;
extern struct gimple_opt_pass pass_copy_prop;
-extern struct gimple_opt_pass pass_store_ccp;
extern struct gimple_opt_pass pass_vrp;
extern struct gimple_opt_pass pass_uncprop;
extern struct gimple_opt_pass pass_return_slot;
@@ -387,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;
@@ -466,6 +469,7 @@ extern struct rtl_opt_pass pass_sms;
extern struct rtl_opt_pass pass_sched;
extern struct rtl_opt_pass pass_local_alloc;
extern struct rtl_opt_pass pass_global_alloc;
+extern struct rtl_opt_pass pass_ira;
extern struct rtl_opt_pass pass_postreload;
extern struct rtl_opt_pass pass_clean_state;
extern struct rtl_opt_pass pass_branch_prob;
@@ -504,7 +508,6 @@ extern struct rtl_opt_pass pass_final;
extern struct rtl_opt_pass pass_rtl_seqabstr;
extern struct gimple_opt_pass pass_release_ssa_names;
extern struct gimple_opt_pass pass_early_inline;
-extern struct gimple_opt_pass pass_O0_always_inline;
extern struct gimple_opt_pass pass_inline_parameters;
extern struct gimple_opt_pass pass_all_early_optimizations;
extern struct gimple_opt_pass pass_update_address_taken;
diff --git a/gcc/tree-phinodes.c b/gcc/tree-phinodes.c
index 9d20b0e64c9..511e84bf9b9 100644
--- a/gcc/tree-phinodes.c
+++ b/gcc/tree-phinodes.c
@@ -28,6 +28,7 @@ along with GCC; see the file COPYING3. If not see
#include "basic-block.h"
#include "tree-flow.h"
#include "toplev.h"
+#include "gimple.h"
/* Rewriting a function into SSA form can create a huge number of PHIs
many of which may be thrown away shortly after their creation if jumps
@@ -76,11 +77,10 @@ along with GCC; see the file COPYING3. If not see
the -2 on all the calculations below. */
#define NUM_BUCKETS 10
-static GTY ((deletable (""))) tree free_phinodes[NUM_BUCKETS - 2];
+static GTY ((deletable (""))) VEC(gimple,gc) *free_phinodes[NUM_BUCKETS - 2];
static unsigned long free_phinode_count;
static int ideal_phi_node_len (int);
-static void resize_phi_node (tree *, int);
#ifdef GATHER_STATISTICS
unsigned int phi_nodes_reused;
@@ -126,13 +126,13 @@ phinodes_print_statistics (void)
happens to contain a PHI node with LEN arguments or more, return
that one. */
-static inline tree
-allocate_phi_node (int len)
+static inline gimple
+allocate_phi_node (size_t len)
{
- tree phi;
- int bucket = NUM_BUCKETS - 2;
- int size = (sizeof (struct tree_phi_node)
- + (len - 1) * sizeof (struct phi_arg_d));
+ gimple phi;
+ size_t bucket = NUM_BUCKETS - 2;
+ size_t size = sizeof (struct gimple_statement_phi)
+ + (len - 1) * sizeof (struct phi_arg_d);
if (free_phinode_count)
for (bucket = len - 2; bucket < NUM_BUCKETS - 2; bucket++)
@@ -141,22 +141,27 @@ allocate_phi_node (int len)
/* If our free list has an element, then use it. */
if (bucket < NUM_BUCKETS - 2
- && PHI_ARG_CAPACITY (free_phinodes[bucket]) >= len)
+ && gimple_phi_capacity (VEC_index (gimple, free_phinodes[bucket], 0))
+ >= len)
{
free_phinode_count--;
- phi = free_phinodes[bucket];
- free_phinodes[bucket] = PHI_CHAIN (free_phinodes[bucket]);
+ phi = VEC_pop (gimple, free_phinodes[bucket]);
+ if (VEC_empty (gimple, free_phinodes[bucket]))
+ VEC_free (gimple, gc, free_phinodes[bucket]);
#ifdef GATHER_STATISTICS
phi_nodes_reused++;
#endif
}
else
{
- phi = (tree) ggc_alloc (size);
+ phi = (gimple) ggc_alloc (size);
#ifdef GATHER_STATISTICS
phi_nodes_created++;
- tree_node_counts[(int) phi_kind]++;
- tree_node_sizes[(int) phi_kind] += size;
+ {
+ enum gimple_alloc_kind kind = gimple_alloc_kind (GIMPLE_PHI);
+ gimple_alloc_counts[(int) kind]++;
+ gimple_alloc_sizes[(int) kind] += size;
+ }
#endif
}
@@ -184,7 +189,8 @@ ideal_phi_node_len (int len)
len = 2;
/* Compute the number of bytes of the original request. */
- size = sizeof (struct tree_phi_node) + (len - 1) * sizeof (struct phi_arg_d);
+ size = sizeof (struct gimple_statement_phi)
+ + (len - 1) * sizeof (struct phi_arg_d);
/* Round it up to the next power of two. */
log2 = ceil_log2 (size);
@@ -199,10 +205,10 @@ ideal_phi_node_len (int len)
/* Return a PHI node with LEN argument slots for variable VAR. */
-static tree
+static gimple
make_phi_node (tree var, int len)
{
- tree phi;
+ gimple phi;
int capacity, i;
capacity = ideal_phi_node_len (len);
@@ -212,24 +218,25 @@ make_phi_node (tree var, int len)
/* We need to clear the entire PHI node, including the argument
portion, because we represent a "missing PHI argument" by placing
NULL_TREE in PHI_ARG_DEF. */
- memset (phi, 0, (sizeof (struct tree_phi_node) - sizeof (struct phi_arg_d)
+ memset (phi, 0, (sizeof (struct gimple_statement_phi)
+ - sizeof (struct phi_arg_d)
+ sizeof (struct phi_arg_d) * len));
- TREE_SET_CODE (phi, PHI_NODE);
- PHI_NUM_ARGS (phi) = len;
- PHI_ARG_CAPACITY (phi) = capacity;
+ phi->gsbase.code = GIMPLE_PHI;
+ phi->gimple_phi.nargs = len;
+ phi->gimple_phi.capacity = capacity;
if (TREE_CODE (var) == SSA_NAME)
- SET_PHI_RESULT (phi, var);
+ gimple_phi_set_result (phi, var);
else
- SET_PHI_RESULT (phi, make_ssa_name (var, phi));
+ gimple_phi_set_result (phi, make_ssa_name (var, phi));
for (i = 0; i < capacity; i++)
{
use_operand_p imm;
- imm = &(PHI_ARG_IMM_USE_NODE (phi, i));
- imm->use = &(PHI_ARG_DEF_TREE (phi, i));
+ imm = gimple_phi_arg_imm_use_ptr (phi, i);
+ imm->use = gimple_phi_arg_def_ptr (phi, i);
imm->prev = NULL;
imm->next = NULL;
- imm->stmt = phi;
+ imm->loc.stmt = phi;
}
return phi;
@@ -238,66 +245,66 @@ make_phi_node (tree var, int len)
/* We no longer need PHI, release it so that it may be reused. */
void
-release_phi_node (tree phi)
+release_phi_node (gimple phi)
{
- int bucket;
- int len = PHI_ARG_CAPACITY (phi);
- int x;
+ size_t bucket;
+ size_t len = gimple_phi_capacity (phi);
+ size_t x;
- for (x = 0; x < PHI_NUM_ARGS (phi); x++)
+ for (x = 0; x < gimple_phi_num_args (phi); x++)
{
use_operand_p imm;
- imm = &(PHI_ARG_IMM_USE_NODE (phi, x));
+ imm = gimple_phi_arg_imm_use_ptr (phi, x);
delink_imm_use (imm);
}
bucket = len > NUM_BUCKETS - 1 ? NUM_BUCKETS - 1 : len;
bucket -= 2;
- PHI_CHAIN (phi) = free_phinodes[bucket];
- free_phinodes[bucket] = phi;
+ VEC_safe_push (gimple, gc, free_phinodes[bucket], phi);
free_phinode_count++;
}
+
/* Resize an existing PHI node. The only way is up. Return the
possibly relocated phi. */
static void
-resize_phi_node (tree *phi, int len)
+resize_phi_node (gimple *phi, size_t len)
{
- int old_size, i;
- tree new_phi;
+ size_t old_size, i;
+ gimple new_phi;
- gcc_assert (len > PHI_ARG_CAPACITY (*phi));
+ gcc_assert (len > gimple_phi_capacity (*phi));
/* The garbage collector will not look at the PHI node beyond the
first PHI_NUM_ARGS elements. Therefore, all we have to copy is a
portion of the PHI node currently in use. */
- old_size = (sizeof (struct tree_phi_node)
- + (PHI_NUM_ARGS (*phi) - 1) * sizeof (struct phi_arg_d));
+ old_size = sizeof (struct gimple_statement_phi)
+ + (gimple_phi_num_args (*phi) - 1) * sizeof (struct phi_arg_d);
new_phi = allocate_phi_node (len);
memcpy (new_phi, *phi, old_size);
- for (i = 0; i < PHI_NUM_ARGS (new_phi); i++)
+ for (i = 0; i < gimple_phi_num_args (new_phi); i++)
{
use_operand_p imm, old_imm;
- imm = &(PHI_ARG_IMM_USE_NODE (new_phi, i));
- old_imm = &(PHI_ARG_IMM_USE_NODE (*phi, i));
- imm->use = &(PHI_ARG_DEF_TREE (new_phi, i));
+ imm = gimple_phi_arg_imm_use_ptr (new_phi, i);
+ old_imm = gimple_phi_arg_imm_use_ptr (*phi, i);
+ imm->use = gimple_phi_arg_def_ptr (new_phi, i);
relink_imm_use_stmt (imm, old_imm, new_phi);
}
- PHI_ARG_CAPACITY (new_phi) = len;
+ new_phi->gimple_phi.capacity = len;
- for (i = PHI_NUM_ARGS (new_phi); i < len; i++)
+ for (i = gimple_phi_num_args (new_phi); i < len; i++)
{
use_operand_p imm;
- imm = &(PHI_ARG_IMM_USE_NODE (new_phi, i));
- imm->use = &(PHI_ARG_DEF_TREE (new_phi, i));
+ imm = gimple_phi_arg_imm_use_ptr (new_phi, i);
+ imm->use = gimple_phi_arg_def_ptr (new_phi, i);
imm->prev = NULL;
imm->next = NULL;
- imm->stmt = new_phi;
+ imm->loc.stmt = new_phi;
}
*phi = new_phi;
@@ -308,22 +315,22 @@ resize_phi_node (tree *phi, int len)
void
reserve_phi_args_for_new_edge (basic_block bb)
{
- tree *loc;
- int len = EDGE_COUNT (bb->preds);
- int cap = ideal_phi_node_len (len + 4);
+ size_t len = EDGE_COUNT (bb->preds);
+ size_t cap = ideal_phi_node_len (len + 4);
+ gimple_stmt_iterator gsi;
- for (loc = phi_nodes_ptr (bb);
- *loc;
- loc = &PHI_CHAIN (*loc))
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- if (len > PHI_ARG_CAPACITY (*loc))
+ gimple *loc = gsi_stmt_ptr (&gsi);
+
+ if (len > gimple_phi_capacity (*loc))
{
- tree old_phi = *loc;
+ gimple old_phi = *loc;
resize_phi_node (loc, cap);
- /* The result of the phi is defined by this phi node. */
- SSA_NAME_DEF_STMT (PHI_RESULT (*loc)) = *loc;
+ /* The result of the PHI is defined by this PHI node. */
+ SSA_NAME_DEF_STMT (gimple_phi_result (*loc)) = *loc;
release_phi_node (old_phi);
}
@@ -337,26 +344,28 @@ reserve_phi_args_for_new_edge (basic_block bb)
batch. */
SET_PHI_ARG_DEF (*loc, len - 1, NULL_TREE);
- PHI_NUM_ARGS (*loc)++;
+ (*loc)->gimple_phi.nargs++;
}
}
/* Create a new PHI node for variable VAR at basic block BB. */
-tree
+gimple
create_phi_node (tree var, basic_block bb)
{
- tree phi;
-
- phi = make_phi_node (var, EDGE_COUNT (bb->preds));
+ gimple_stmt_iterator gsi;
+ gimple phi = make_phi_node (var, EDGE_COUNT (bb->preds));
/* Add the new PHI node to the list of PHI nodes for block BB. */
- PHI_CHAIN (phi) = phi_nodes (bb);
- set_phi_nodes (bb, phi);
+ if (phi_nodes (bb) == NULL)
+ set_phi_nodes (bb, gimple_seq_alloc ());
+
+ gsi = gsi_last (phi_nodes (bb));
+ gsi_insert_after (&gsi, phi, GSI_NEW_STMT);
/* Associate BB to the PHI node. */
- set_bb_for_stmt (phi, bb);
+ gimple_set_bb (phi, bb);
return phi;
}
@@ -369,19 +378,19 @@ create_phi_node (tree var, basic_block bb)
PHI points to the reallocated phi node when we return. */
void
-add_phi_arg (tree phi, tree def, edge e)
+add_phi_arg (gimple phi, tree def, edge e)
{
basic_block bb = e->dest;
- gcc_assert (bb == bb_for_stmt (phi));
+ gcc_assert (bb == gimple_bb (phi));
/* We resize PHI nodes upon edge creation. We should always have
enough room at this point. */
- gcc_assert (PHI_NUM_ARGS (phi) <= PHI_ARG_CAPACITY (phi));
+ gcc_assert (gimple_phi_num_args (phi) <= gimple_phi_capacity (phi));
/* We resize PHI nodes upon edge creation. We should always have
enough room at this point. */
- gcc_assert (e->dest_idx < (unsigned int) PHI_NUM_ARGS (phi));
+ gcc_assert (e->dest_idx < gimple_phi_num_args (phi));
/* Copy propagation needs to know what object occur in abnormal
PHI nodes. This is a convenient place to record such information. */
@@ -401,22 +410,22 @@ add_phi_arg (tree phi, tree def, edge e)
is consistent with how we remove an edge from the edge vector. */
static void
-remove_phi_arg_num (tree phi, int i)
+remove_phi_arg_num (gimple phi, int i)
{
- int num_elem = PHI_NUM_ARGS (phi);
+ int num_elem = gimple_phi_num_args (phi);
gcc_assert (i < num_elem);
/* Delink the item which is being removed. */
- delink_imm_use (&(PHI_ARG_IMM_USE_NODE (phi, i)));
+ delink_imm_use (gimple_phi_arg_imm_use_ptr (phi, i));
/* If it is not the last element, move the last element
to the element we want to delete, resetting all the links. */
if (i != num_elem - 1)
{
use_operand_p old_p, new_p;
- old_p = &PHI_ARG_IMM_USE_NODE (phi, num_elem - 1);
- new_p = &PHI_ARG_IMM_USE_NODE (phi, i);
+ old_p = gimple_phi_arg_imm_use_ptr (phi, num_elem - 1);
+ new_p = gimple_phi_arg_imm_use_ptr (phi, i);
/* Set use on new node, and link into last element's place. */
*(new_p->use) = *(old_p->use);
relink_imm_use (new_p, old_p);
@@ -425,7 +434,7 @@ remove_phi_arg_num (tree phi, int i)
/* Shrink the vector and return. Note that we do not have to clear
PHI_ARG_DEF because the garbage collector will not look at those
elements beyond the first PHI_NUM_ARGS elements of the array. */
- PHI_NUM_ARGS (phi)--;
+ phi->gimple_phi.nargs--;
}
@@ -434,60 +443,29 @@ remove_phi_arg_num (tree phi, int i)
void
remove_phi_args (edge e)
{
- tree phi;
+ gimple_stmt_iterator gsi;
- for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
- remove_phi_arg_num (phi, e->dest_idx);
+ for (gsi = gsi_start_phis (e->dest); !gsi_end_p (gsi); gsi_next (&gsi))
+ remove_phi_arg_num (gsi_stmt (gsi), e->dest_idx);
}
-/* Remove PHI node PHI from basic block BB. If PREV is non-NULL, it is
- used as the node immediately before PHI in the linked list. If
- RELEASE_LHS_P is true, the LHS of this PHI node is released into
- the free pool of SSA names. */
+/* Remove the PHI node pointed-to by iterator GSI from basic block BB. After
+ removal, iterator GSI is updated to point to the next PHI node in the
+ sequence. If RELEASE_LHS_P is true, the LHS of this PHI node is released
+ into the free pool of SSA names. */
void
-remove_phi_node (tree phi, tree prev, bool release_lhs_p)
+remove_phi_node (gimple_stmt_iterator *gsi, bool release_lhs_p)
{
- tree *loc;
-
- if (prev)
- {
- loc = &PHI_CHAIN (prev);
- }
- else
- {
- for (loc = phi_nodes_ptr (bb_for_stmt (phi));
- *loc != phi;
- loc = &PHI_CHAIN (*loc))
- ;
- }
-
- /* Remove PHI from the chain. */
- *loc = PHI_CHAIN (phi);
+ gimple phi = gsi_stmt (*gsi);
+ gsi_remove (gsi, false);
/* If we are deleting the PHI node, then we should release the
SSA_NAME node so that it can be reused. */
release_phi_node (phi);
if (release_lhs_p)
- release_ssa_name (PHI_RESULT (phi));
-}
-
-
-/* Reverse the order of PHI nodes in the chain PHI.
- Return the new head of the chain (old last PHI node). */
-
-tree
-phi_reverse (tree phi)
-{
- tree prev = NULL_TREE, next;
- for (; phi; phi = next)
- {
- next = PHI_CHAIN (phi);
- PHI_CHAIN (phi) = prev;
- prev = phi;
- }
- return prev;
+ release_ssa_name (gimple_phi_result (phi));
}
#include "gt-tree-phinodes.h"
diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c
index 32d7fbe00ca..85cfbd66d89 100644
--- a/gcc/tree-predcom.c
+++ b/gcc/tree-predcom.c
@@ -207,7 +207,8 @@ along with GCC; see the file COPYING3. If not see
#define MAX_DISTANCE (target_avail_regs < 16 ? 4 : 8)
-/* Data references. */
+/* Data references (or phi nodes that carry data reference values across
+ loop iterations). */
typedef struct dref
{
@@ -215,7 +216,12 @@ typedef struct dref
struct data_reference *ref;
/* The statement in that the reference appears. */
- tree stmt;
+ gimple stmt;
+
+ /* In case that STMT is a phi node, this field is set to the SSA name
+ defined by it in replace_phis_by_defined_names (in order to avoid
+ pointing to phi node that got reallocated in the meantime). */
+ tree name_defined_by_phi;
/* Distance of the reference from the root of the chain (in number of
iterations of the loop). */
@@ -261,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;
@@ -349,12 +355,12 @@ dump_dref (FILE *file, dref ref)
}
else
{
- if (TREE_CODE (ref->stmt) == PHI_NODE)
+ if (gimple_code (ref->stmt) == GIMPLE_PHI)
fprintf (file, " looparound ref\n");
else
fprintf (file, " combination ref\n");
fprintf (file, " in statement ");
- print_generic_expr (file, ref->stmt, TDF_SLIM);
+ print_gimple_stmt (file, ref->stmt, 0, TDF_SLIM);
fprintf (file, "\n");
fprintf (file, " distance %u\n", ref->distance);
}
@@ -403,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");
@@ -777,7 +783,7 @@ split_data_refs_to_components (struct loop *loop,
dataref->always_accessed
= dominated_by_p (CDI_DOMINATORS, last_always_executed,
- bb_for_stmt (dataref->stmt));
+ gimple_bb (dataref->stmt));
dataref->pos = VEC_length (dref, comp->refs);
VEC_quick_push (dref, comp->refs, dataref);
}
@@ -813,7 +819,7 @@ suitable_component_p (struct loop *loop, struct component *comp)
for (i = 0; VEC_iterate (dref, comp->refs, i, a); i++)
{
- ba = bb_for_stmt (a->stmt);
+ ba = gimple_bb (a->stmt);
if (!just_once_each_iteration_p (loop, ba))
return false;
@@ -989,12 +995,12 @@ name_for_ref (dref ref)
{
tree name;
- if (TREE_CODE (ref->stmt) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_assign (ref->stmt))
{
if (!ref->ref || DR_IS_READ (ref->ref))
- name = GIMPLE_STMT_OPERAND (ref->stmt, 0);
+ name = gimple_assign_lhs (ref->stmt);
else
- name = GIMPLE_STMT_OPERAND (ref->stmt, 1);
+ name = gimple_assign_rhs1 (ref->stmt);
}
else
name = PHI_RESULT (ref->stmt);
@@ -1052,44 +1058,49 @@ valid_initializer_p (struct data_reference *ref,
iteration), returns the phi node. Otherwise, NULL_TREE is returned. ROOT
is the root of the current chain. */
-static tree
+static gimple
find_looparound_phi (struct loop *loop, dref ref, dref root)
{
- tree name, phi, init, init_stmt, init_ref;
+ tree name, init, init_ref;
+ gimple phi = NULL, init_stmt;
edge latch = loop_latch_edge (loop);
struct data_reference init_dr;
+ gimple_stmt_iterator psi;
- if (TREE_CODE (ref->stmt) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_assign (ref->stmt))
{
if (DR_IS_READ (ref->ref))
- name = GIMPLE_STMT_OPERAND (ref->stmt, 0);
+ name = gimple_assign_lhs (ref->stmt);
else
- name = GIMPLE_STMT_OPERAND (ref->stmt, 1);
+ name = gimple_assign_rhs1 (ref->stmt);
}
else
name = PHI_RESULT (ref->stmt);
if (!name)
- return NULL_TREE;
+ return NULL;
- for (phi = phi_nodes (loop->header); phi; phi = PHI_CHAIN (phi))
- if (PHI_ARG_DEF_FROM_EDGE (phi, latch) == name)
- break;
+ for (psi = gsi_start_phis (loop->header); !gsi_end_p (psi); gsi_next (&psi))
+ {
+ phi = gsi_stmt (psi);
+ if (PHI_ARG_DEF_FROM_EDGE (phi, latch) == name)
+ break;
+ }
- if (!phi)
- return NULL_TREE;
+ if (gsi_end_p (psi))
+ return NULL;
init = PHI_ARG_DEF_FROM_EDGE (phi, loop_preheader_edge (loop));
if (TREE_CODE (init) != SSA_NAME)
- return NULL_TREE;
+ return NULL;
init_stmt = SSA_NAME_DEF_STMT (init);
- if (TREE_CODE (init_stmt) != GIMPLE_MODIFY_STMT)
- return NULL_TREE;
- gcc_assert (GIMPLE_STMT_OPERAND (init_stmt, 0) == init);
+ if (gimple_code (init_stmt) != GIMPLE_ASSIGN)
+ return NULL;
+ gcc_assert (gimple_assign_lhs (init_stmt) == init);
- init_ref = GIMPLE_STMT_OPERAND (init_stmt, 1);
+ init_ref = gimple_assign_rhs1 (init_stmt);
if (!REFERENCE_CLASS_P (init_ref)
&& !DECL_P (init_ref))
- return NULL_TREE;
+ return NULL;
/* Analyze the behavior of INIT_REF with respect to LOOP (innermost
loop enclosing PHI). */
@@ -1099,7 +1110,7 @@ find_looparound_phi (struct loop *loop, dref ref, dref root)
dr_analyze_innermost (&init_dr);
if (!valid_initializer_p (&init_dr, ref->distance + 1, root->ref))
- return NULL_TREE;
+ return NULL;
return phi;
}
@@ -1107,7 +1118,7 @@ find_looparound_phi (struct loop *loop, dref ref, dref root)
/* Adds a reference for the looparound copy of REF in PHI to CHAIN. */
static void
-insert_looparound_copy (chain_p chain, dref ref, tree phi)
+insert_looparound_copy (chain_p chain, dref ref, gimple phi)
{
dref nw = XCNEW (struct dref), aref;
unsigned i;
@@ -1138,7 +1149,7 @@ add_looparound_copies (struct loop *loop, chain_p chain)
{
unsigned i;
dref ref, root = get_chain_root (chain);
- tree phi;
+ gimple phi;
for (i = 0; VEC_iterate (dref, chain->refs, i, ref); i++)
{
@@ -1213,74 +1224,90 @@ 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 (tree stmt, tree new, bool set, bool in_lhs)
+replace_ref_with (gimple stmt, tree new_tree, bool set, bool in_lhs)
{
- tree val, new_stmt;
- block_stmt_iterator bsi;
+ tree val;
+ gimple new_stmt;
+ gimple_stmt_iterator bsi, psi;
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
{
gcc_assert (!in_lhs && !set);
val = PHI_RESULT (stmt);
- bsi = bsi_after_labels (bb_for_stmt (stmt));
- remove_phi_node (stmt, NULL_TREE, false);
+ bsi = gsi_after_labels (gimple_bb (stmt));
+ psi = gsi_for_stmt (stmt);
+ remove_phi_node (&psi, false);
- /* Turn the phi node into GIMPLE_MODIFY_STMT. */
- new_stmt = build_gimple_modify_stmt (val, new);
- SSA_NAME_DEF_STMT (val) = new_stmt;
- bsi_insert_before (&bsi, new_stmt, BSI_NEW_STMT);
+ /* Turn the phi node into GIMPLE_ASSIGN. */
+ new_stmt = gimple_build_assign (val, new_tree);
+ gsi_insert_before (&bsi, new_stmt, GSI_NEW_STMT);
return;
}
/* Since the reference is of gimple_reg type, it should only
appear as lhs or rhs of modify statement. */
- gcc_assert (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT);
+ gcc_assert (is_gimple_assign (stmt));
+
+ 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_STMT_OPERAND (stmt, 1) = new;
+ gimple_assign_set_rhs_from_tree (&bsi, new_tree);
+ stmt = gsi_stmt (bsi);
update_stmt (stmt);
return;
}
- bsi = bsi_for_stmt (stmt);
if (in_lhs)
{
- val = GIMPLE_STMT_OPERAND (stmt, 1);
-
- /* OLD = VAL
+ /* We have statement
+
+ OLD = VAL
- is transformed to
+ If OLD is a memory reference, then VAL is gimple_val, and we transform
+ this to
OLD = VAL
NEW = VAL
- (since the reference is of gimple_reg type, VAL is either gimple
- invariant or ssa name). */
+ Otherwise, we are replacing a combination chain,
+ VAL is the expression that performs the combination, and OLD is an
+ SSA name. In this case, we transform the assignment to
+
+ OLD = VAL
+ NEW = OLD
+
+ */
+
+ val = gimple_assign_lhs (stmt);
+ if (TREE_CODE (val) != SSA_NAME)
+ {
+ gcc_assert (gimple_assign_copy_p (stmt));
+ val = gimple_assign_rhs1 (stmt);
+ }
}
else
{
- val = GIMPLE_STMT_OPERAND (stmt, 0);
-
/* VAL = OLD
is transformed to
VAL = OLD
NEW = VAL */
+
+ val = gimple_assign_lhs (stmt);
}
- new_stmt = build_gimple_modify_stmt (new, unshare_expr (val));
- bsi_insert_after (&bsi, new_stmt, BSI_NEW_STMT);
- SSA_NAME_DEF_STMT (new) = new_stmt;
+ new_stmt = gimple_build_assign (new_tree, unshare_expr (val));
+ gsi_insert_after (&bsi, new_stmt, GSI_NEW_STMT);
}
/* Returns the reference to the address of REF in the ITER-th iteration of
@@ -1379,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);
@@ -1388,12 +1415,12 @@ get_init_expr (chain_p chain, unsigned index)
/* Marks all virtual operands of statement STMT for renaming. */
void
-mark_virtual_ops_for_renaming (tree stmt)
+mark_virtual_ops_for_renaming (gimple stmt)
{
ssa_op_iter iter;
tree var;
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
{
var = PHI_RESULT (stmt);
if (is_gimple_reg (var))
@@ -1418,12 +1445,12 @@ mark_virtual_ops_for_renaming (tree stmt)
/* Calls mark_virtual_ops_for_renaming for all members of LIST. */
static void
-mark_virtual_ops_for_renaming_list (tree list)
+mark_virtual_ops_for_renaming_list (gimple_seq list)
{
- tree_stmt_iterator tsi;
+ gimple_stmt_iterator gsi;
- for (tsi = tsi_start (list); !tsi_end_p (tsi); tsi_next (&tsi))
- mark_virtual_ops_for_renaming (tsi_stmt (tsi));
+ for (gsi = gsi_start (list); !gsi_end_p (gsi); gsi_next (&gsi))
+ mark_virtual_ops_for_renaming (gsi_stmt (gsi));
}
/* Returns a new temporary variable used for the I-th variable carrying
@@ -1457,8 +1484,9 @@ initialize_root_vars (struct loop *loop, chain_p chain, bitmap tmp_vars)
unsigned n = chain->length;
dref root = get_chain_root (chain);
bool reuse_first = !chain->has_max_use_after;
- tree ref, init, var, next, stmts;
- tree phi;
+ tree ref, init, var, next;
+ gimple phi;
+ gimple_seq stmts;
edge entry = loop_preheader_edge (loop), latch = loop_latch_edge (loop);
/* If N == 0, then all the references are within the single iteration. And
@@ -1468,7 +1496,7 @@ initialize_root_vars (struct loop *loop, chain_p chain, bitmap tmp_vars)
chain->vars = VEC_alloc (tree, heap, n + 1);
if (chain->type == CT_COMBINATION)
- ref = GIMPLE_STMT_OPERAND (root->stmt, 0);
+ ref = gimple_assign_lhs (root->stmt);
else
ref = DR_REF (root->ref);
@@ -1481,7 +1509,7 @@ initialize_root_vars (struct loop *loop, chain_p chain, bitmap tmp_vars)
VEC_quick_push (tree, chain->vars, VEC_index (tree, chain->vars, 0));
for (i = 0; VEC_iterate (tree, chain->vars, i, var); i++)
- VEC_replace (tree, chain->vars, i, make_ssa_name (var, NULL_TREE));
+ VEC_replace (tree, chain->vars, i, make_ssa_name (var, NULL));
for (i = 0; i < n; i++)
{
@@ -1493,7 +1521,7 @@ initialize_root_vars (struct loop *loop, chain_p chain, bitmap tmp_vars)
if (stmts)
{
mark_virtual_ops_for_renaming_list (stmts);
- bsi_insert_on_edge_immediate (entry, stmts);
+ gsi_insert_seq_on_edge_immediate (entry, stmts);
}
phi = create_phi_node (var, loop->header);
@@ -1533,8 +1561,9 @@ initialize_root_vars_lm (struct loop *loop, dref root, bool written,
bitmap tmp_vars)
{
unsigned i;
- tree ref = DR_REF (root->ref), init, var, next, stmts;
- tree phi;
+ tree ref = DR_REF (root->ref), init, var, next;
+ gimple_seq stmts;
+ gimple phi;
edge entry = loop_preheader_edge (loop), latch = loop_latch_edge (loop);
/* Find the initializer for the variable, and check that it cannot
@@ -1548,7 +1577,7 @@ initialize_root_vars_lm (struct loop *loop, dref root, bool written,
VEC_quick_push (tree, *vars, VEC_index (tree, *vars, 0));
for (i = 0; VEC_iterate (tree, *vars, i, var); i++)
- VEC_replace (tree, *vars, i, make_ssa_name (var, NULL_TREE));
+ VEC_replace (tree, *vars, i, make_ssa_name (var, NULL));
var = VEC_index (tree, *vars, 0);
@@ -1556,7 +1585,7 @@ initialize_root_vars_lm (struct loop *loop, dref root, bool written,
if (stmts)
{
mark_virtual_ops_for_renaming_list (stmts);
- bsi_insert_on_edge_immediate (entry, stmts);
+ gsi_insert_seq_on_edge_immediate (entry, stmts);
}
if (written)
@@ -1569,10 +1598,9 @@ initialize_root_vars_lm (struct loop *loop, dref root, bool written,
}
else
{
- init = build_gimple_modify_stmt (var, init);
- SSA_NAME_DEF_STMT (var) = init;
- mark_virtual_ops_for_renaming (init);
- bsi_insert_on_edge_immediate (entry, init);
+ gimple init_stmt = gimple_build_assign (var, init);
+ mark_virtual_ops_for_renaming (init_stmt);
+ gsi_insert_on_edge_immediate (entry, init_stmt);
}
}
@@ -1613,7 +1641,7 @@ execute_load_motion (struct loop *loop, chain_p chain, bitmap tmp_vars)
if (n_writes)
{
var = VEC_index (tree, vars, 0);
- var = make_ssa_name (SSA_NAME_VAR (var), NULL_TREE);
+ var = make_ssa_name (SSA_NAME_VAR (var), NULL);
VEC_replace (tree, vars, 0, var);
}
else
@@ -1629,20 +1657,20 @@ execute_load_motion (struct loop *loop, chain_p chain, bitmap tmp_vars)
/* Returns the single statement in that NAME is used, excepting
the looparound phi nodes contained in one of the chains. If there is no
- such statement, or more statements, NULL_TREE is returned. */
+ such statement, or more statements, NULL is returned. */
-static tree
+static gimple
single_nonlooparound_use (tree name)
{
use_operand_p use;
imm_use_iterator it;
- tree stmt, ret = NULL_TREE;
+ gimple stmt, ret = NULL;
FOR_EACH_IMM_USE_FAST (use, it, name)
{
stmt = USE_STMT (use);
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
{
/* Ignore uses in looparound phi nodes. Uses in other phi nodes
could not be processed anyway, so just fail for them. */
@@ -1650,10 +1678,10 @@ single_nonlooparound_use (tree name)
SSA_NAME_VERSION (PHI_RESULT (stmt))))
continue;
- return NULL_TREE;
+ return NULL;
}
- else if (ret != NULL_TREE)
- return NULL_TREE;
+ else if (ret != NULL)
+ return NULL;
else
ret = stmt;
}
@@ -1665,19 +1693,22 @@ single_nonlooparound_use (tree name)
used. */
static void
-remove_stmt (tree stmt)
+remove_stmt (gimple stmt)
{
- tree next, name;
+ tree name;
+ gimple next;
+ gimple_stmt_iterator psi;
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
{
name = PHI_RESULT (stmt);
next = single_nonlooparound_use (name);
- remove_phi_node (stmt, NULL_TREE, true);
+ psi = gsi_for_stmt (stmt);
+ remove_phi_node (&psi, true);
if (!next
- || TREE_CODE (next) != GIMPLE_MODIFY_STMT
- || GIMPLE_STMT_OPERAND (next, 1) != name)
+ || !gimple_assign_ssa_name_copy_p (next)
+ || gimple_assign_rhs1 (next) != name)
return;
stmt = next;
@@ -1685,21 +1716,22 @@ remove_stmt (tree stmt)
while (1)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
- bsi = bsi_for_stmt (stmt);
+ bsi = gsi_for_stmt (stmt);
- name = GIMPLE_STMT_OPERAND (stmt, 0);
+ name = gimple_assign_lhs (stmt);
gcc_assert (TREE_CODE (name) == SSA_NAME);
next = single_nonlooparound_use (name);
mark_virtual_ops_for_renaming (stmt);
- bsi_remove (&bsi, true);
+ gsi_remove (&bsi, true);
+ release_defs (stmt);
if (!next
- || TREE_CODE (next) != GIMPLE_MODIFY_STMT
- || GIMPLE_STMT_OPERAND (next, 1) != name)
+ || !gimple_assign_ssa_name_copy_p (next)
+ || gimple_assign_rhs1 (next) != name)
return;
stmt = next;
@@ -1794,7 +1826,7 @@ execute_pred_commoning (struct loop *loop, VEC (chain_p, heap) *chains,
}
/* For each reference in CHAINS, if its defining statement is
- ssa name, set it to phi node that defines it. */
+ phi node, record the ssa name that is defined by it. */
static void
replace_phis_by_defined_names (VEC (chain_p, heap) *chains)
@@ -1806,14 +1838,16 @@ replace_phis_by_defined_names (VEC (chain_p, heap) *chains)
for (i = 0; VEC_iterate (chain_p, chains, i, chain); i++)
for (j = 0; VEC_iterate (dref, chain->refs, j, a); j++)
{
- gcc_assert (TREE_CODE (a->stmt) != SSA_NAME);
- if (TREE_CODE (a->stmt) == PHI_NODE)
- a->stmt = PHI_RESULT (a->stmt);
+ if (gimple_code (a->stmt) == GIMPLE_PHI)
+ {
+ a->name_defined_by_phi = PHI_RESULT (a->stmt);
+ a->stmt = NULL;
+ }
}
}
-/* For each reference in CHAINS, if its defining statement is
- phi node, set it to the ssa name that is defined by it. */
+/* For each reference in CHAINS, if name_defined_by_phi is not
+ NULL, use it to set the stmt field. */
static void
replace_names_by_phis (VEC (chain_p, heap) *chains)
@@ -1824,10 +1858,11 @@ replace_names_by_phis (VEC (chain_p, heap) *chains)
for (i = 0; VEC_iterate (chain_p, chains, i, chain); i++)
for (j = 0; VEC_iterate (dref, chain->refs, j, a); j++)
- if (TREE_CODE (a->stmt) == SSA_NAME)
+ if (a->stmt == NULL)
{
- a->stmt = SSA_NAME_DEF_STMT (a->stmt);
- gcc_assert (TREE_CODE (a->stmt) == PHI_NODE);
+ a->stmt = SSA_NAME_DEF_STMT (a->name_defined_by_phi);
+ gcc_assert (gimple_code (a->stmt) == GIMPLE_PHI);
+ a->name_defined_by_phi = NULL_TREE;
}
}
@@ -1896,7 +1931,7 @@ should_unroll_loop_p (struct loop *loop, unsigned factor,
static void
base_names_in_chain_on (struct loop *loop, tree name, tree var)
{
- tree stmt, phi;
+ gimple stmt, phi;
imm_use_iterator iter;
edge e;
@@ -1907,8 +1942,8 @@ base_names_in_chain_on (struct loop *loop, tree name, tree var)
phi = NULL;
FOR_EACH_IMM_USE_STMT (stmt, iter, name)
{
- if (TREE_CODE (stmt) == PHI_NODE
- && flow_bb_inside_loop_p (loop, bb_for_stmt (stmt)))
+ if (gimple_code (stmt) == GIMPLE_PHI
+ && flow_bb_inside_loop_p (loop, gimple_bb (stmt)))
{
phi = stmt;
BREAK_FROM_IMM_USE_STMT (iter);
@@ -1917,10 +1952,10 @@ base_names_in_chain_on (struct loop *loop, tree name, tree var)
if (!phi)
return;
- if (bb_for_stmt (phi) == loop->header)
+ if (gimple_bb (phi) == loop->header)
e = loop_latch_edge (loop);
else
- e = single_pred_edge (bb_for_stmt (stmt));
+ e = single_pred_edge (gimple_bb (stmt));
name = PHI_RESULT (phi);
SSA_NAME_VAR (name) = var;
@@ -1936,11 +1971,14 @@ static void
eliminate_temp_copies (struct loop *loop, bitmap tmp_vars)
{
edge e;
- tree phi, name, use, var, stmt;
+ gimple phi, stmt;
+ tree name, use, var;
+ gimple_stmt_iterator psi;
e = loop_latch_edge (loop);
- for (phi = phi_nodes (loop->header); phi; phi = PHI_CHAIN (phi))
+ for (psi = gsi_start_phis (loop->header); !gsi_end_p (psi); gsi_next (&psi))
{
+ phi = gsi_stmt (psi);
name = PHI_RESULT (phi);
var = SSA_NAME_VAR (name);
if (!bitmap_bit_p (tmp_vars, DECL_UID (var)))
@@ -1950,15 +1988,15 @@ eliminate_temp_copies (struct loop *loop, bitmap tmp_vars)
/* Base all the ssa names in the ud and du chain of NAME on VAR. */
stmt = SSA_NAME_DEF_STMT (use);
- while (TREE_CODE (stmt) == PHI_NODE
+ while (gimple_code (stmt) == GIMPLE_PHI
/* In case we could not unroll the loop enough to eliminate
all copies, we may reach the loop header before the defining
statement (in that case, some register copies will be present
in loop latch in the final code, corresponding to the newly
created looparound phi nodes). */
- && bb_for_stmt (stmt) != loop->header)
+ && gimple_bb (stmt) != loop->header)
{
- gcc_assert (single_pred_p (bb_for_stmt (stmt)));
+ gcc_assert (single_pred_p (gimple_bb (stmt)));
use = PHI_ARG_DEF (stmt, 0);
stmt = SSA_NAME_DEF_STMT (use);
}
@@ -1980,38 +2018,40 @@ chain_can_be_combined_p (chain_p chain)
statements, NAME is replaced with the actual name used in the returned
statement. */
-static tree
+static gimple
find_use_stmt (tree *name)
{
- tree stmt, rhs, lhs;
+ gimple stmt;
+ tree rhs, lhs;
/* Skip over assignments. */
while (1)
{
stmt = single_nonlooparound_use (*name);
if (!stmt)
- return NULL_TREE;
+ return NULL;
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
- return NULL_TREE;
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
+ return NULL;
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
+ lhs = gimple_assign_lhs (stmt);
if (TREE_CODE (lhs) != SSA_NAME)
- return NULL_TREE;
+ return NULL;
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- if (rhs != *name)
- break;
+ if (gimple_assign_copy_p (stmt))
+ {
+ rhs = gimple_assign_rhs1 (stmt);
+ if (rhs != *name)
+ return NULL;
- *name = lhs;
+ *name = lhs;
+ }
+ else if (get_gimple_rhs_class (gimple_assign_rhs_code (stmt))
+ == GIMPLE_BINARY_RHS)
+ return stmt;
+ else
+ return NULL;
}
-
- if (!EXPR_P (rhs)
- || REFERENCE_CLASS_P (rhs)
- || TREE_CODE_LENGTH (TREE_CODE (rhs)) != 2)
- return NULL_TREE;
-
- return stmt;
}
/* Returns true if we may perform reassociation for operation CODE in TYPE. */
@@ -2031,27 +2071,26 @@ may_reassociate_p (tree type, enum tree_code code)
tree of the same operations and returns its root. Distance to the root
is stored in DISTANCE. */
-static tree
-find_associative_operation_root (tree stmt, unsigned *distance)
+static gimple
+find_associative_operation_root (gimple stmt, unsigned *distance)
{
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1), lhs, next;
- enum tree_code code = TREE_CODE (rhs);
+ tree lhs;
+ gimple next;
+ enum tree_code code = gimple_assign_rhs_code (stmt);
+ tree type = TREE_TYPE (gimple_assign_lhs (stmt));
unsigned dist = 0;
- if (!may_reassociate_p (TREE_TYPE (rhs), code))
- return NULL_TREE;
+ if (!may_reassociate_p (type, code))
+ return NULL;
while (1)
{
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
+ lhs = gimple_assign_lhs (stmt);
gcc_assert (TREE_CODE (lhs) == SSA_NAME);
next = find_use_stmt (&lhs);
- if (!next)
- break;
-
- rhs = GIMPLE_STMT_OPERAND (next, 1);
- if (TREE_CODE (rhs) != code)
+ if (!next
+ || gimple_assign_rhs_code (next) != code)
break;
stmt = next;
@@ -2069,30 +2108,30 @@ find_associative_operation_root (tree stmt, unsigned *distance)
tree formed by this operation instead of the statement that uses NAME1 or
NAME2. */
-static tree
+static gimple
find_common_use_stmt (tree *name1, tree *name2)
{
- tree stmt1, stmt2;
+ gimple stmt1, stmt2;
stmt1 = find_use_stmt (name1);
if (!stmt1)
- return NULL_TREE;
+ return NULL;
stmt2 = find_use_stmt (name2);
if (!stmt2)
- return NULL_TREE;
+ return NULL;
if (stmt1 == stmt2)
return stmt1;
stmt1 = find_associative_operation_root (stmt1, NULL);
if (!stmt1)
- return NULL_TREE;
+ return NULL;
stmt2 = find_associative_operation_root (stmt2, NULL);
if (!stmt2)
- return NULL_TREE;
+ return NULL;
- return (stmt1 == stmt2 ? stmt1 : NULL_TREE);
+ return (stmt1 == stmt2 ? stmt1 : NULL);
}
/* Checks whether R1 and R2 are combined together using CODE, with the result
@@ -2106,7 +2145,8 @@ combinable_refs_p (dref r1, dref r2,
enum tree_code acode;
bool aswap;
tree atype;
- tree name1, name2, stmt, rhs;
+ tree name1, name2;
+ gimple stmt;
name1 = name_for_ref (r1);
name2 = name_for_ref (r2);
@@ -2117,11 +2157,10 @@ combinable_refs_p (dref r1, dref r2,
if (!stmt)
return false;
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- acode = TREE_CODE (rhs);
+ acode = gimple_assign_rhs_code (stmt);
aswap = (!commutative_tree_code (acode)
- && TREE_OPERAND (rhs, 0) != name1);
- atype = TREE_TYPE (rhs);
+ && gimple_assign_rhs1 (stmt) != name1);
+ atype = TREE_TYPE (gimple_assign_lhs (stmt));
if (*code == ERROR_MARK)
{
@@ -2140,43 +2179,49 @@ combinable_refs_p (dref r1, dref r2,
an assignment of the remaining operand. */
static void
-remove_name_from_operation (tree stmt, tree op)
+remove_name_from_operation (gimple stmt, tree op)
{
- tree *rhs;
+ tree other_op;
+ gimple_stmt_iterator si;
- gcc_assert (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT);
+ gcc_assert (is_gimple_assign (stmt));
- rhs = &GIMPLE_STMT_OPERAND (stmt, 1);
- if (TREE_OPERAND (*rhs, 0) == op)
- *rhs = TREE_OPERAND (*rhs, 1);
- else if (TREE_OPERAND (*rhs, 1) == op)
- *rhs = TREE_OPERAND (*rhs, 0);
+ if (gimple_assign_rhs1 (stmt) == op)
+ other_op = gimple_assign_rhs2 (stmt);
else
- gcc_unreachable ();
+ other_op = gimple_assign_rhs1 (stmt);
+
+ si = gsi_for_stmt (stmt);
+ gimple_assign_set_rhs_from_tree (&si, other_op);
+
+ /* We should not have reallocated STMT. */
+ gcc_assert (gsi_stmt (si) == stmt);
+
update_stmt (stmt);
}
/* Reassociates the expression in that NAME1 and NAME2 are used so that they
are combined in a single statement, and returns this statement. */
-static tree
+static gimple
reassociate_to_the_same_stmt (tree name1, tree name2)
{
- tree stmt1, stmt2, root1, root2, r1, r2, s1, s2;
- tree new_stmt, tmp_stmt, new_name, tmp_name, var;
+ gimple stmt1, stmt2, root1, root2, s1, s2;
+ gimple new_stmt, tmp_stmt;
+ tree new_name, tmp_name, var, r1, r2;
unsigned dist1, dist2;
enum tree_code code;
tree type = TREE_TYPE (name1);
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
stmt1 = find_use_stmt (&name1);
stmt2 = find_use_stmt (&name2);
root1 = find_associative_operation_root (stmt1, &dist1);
root2 = find_associative_operation_root (stmt2, &dist2);
- code = TREE_CODE (GIMPLE_STMT_OPERAND (stmt1, 1));
+ code = gimple_assign_rhs_code (stmt1);
gcc_assert (root1 && root2 && root1 == root2
- && code == TREE_CODE (GIMPLE_STMT_OPERAND (stmt2, 1)));
+ && code == gimple_assign_rhs_code (stmt2));
/* Find the root of the nearest expression in that both NAME1 and NAME2
are used. */
@@ -2188,22 +2233,22 @@ reassociate_to_the_same_stmt (tree name1, tree name2)
while (dist1 > dist2)
{
s1 = find_use_stmt (&r1);
- r1 = GIMPLE_STMT_OPERAND (s1, 0);
+ r1 = gimple_assign_lhs (s1);
dist1--;
}
while (dist2 > dist1)
{
s2 = find_use_stmt (&r2);
- r2 = GIMPLE_STMT_OPERAND (s2, 0);
+ r2 = gimple_assign_lhs (s2);
dist2--;
}
while (s1 != s2)
{
s1 = find_use_stmt (&r1);
- r1 = GIMPLE_STMT_OPERAND (s1, 0);
+ r1 = gimple_assign_lhs (s1);
s2 = find_use_stmt (&r2);
- r2 = GIMPLE_STMT_OPERAND (s2, 0);
+ r2 = gimple_assign_lhs (s2);
}
/* Remove NAME1 and NAME2 from the statements in that they are used
@@ -2215,24 +2260,28 @@ reassociate_to_the_same_stmt (tree name1, tree name2)
combine it with the rhs of S1. */
var = create_tmp_var (type, "predreastmp");
add_referenced_var (var);
- new_name = make_ssa_name (var, NULL_TREE);
- new_stmt = build_gimple_modify_stmt (new_name,
- fold_build2 (code, type, name1, name2));
- SSA_NAME_DEF_STMT (new_name) = new_stmt;
+ new_name = make_ssa_name (var, NULL);
+ new_stmt = gimple_build_assign_with_ops (code, new_name, name1, name2);
var = create_tmp_var (type, "predreastmp");
add_referenced_var (var);
- tmp_name = make_ssa_name (var, NULL_TREE);
- tmp_stmt = build_gimple_modify_stmt (tmp_name,
- GIMPLE_STMT_OPERAND (s1, 1));
- SSA_NAME_DEF_STMT (tmp_name) = tmp_stmt;
-
- GIMPLE_STMT_OPERAND (s1, 1) = fold_build2 (code, type, new_name, tmp_name);
+ tmp_name = make_ssa_name (var, NULL);
+
+ /* Rhs of S1 may now be either a binary expression with operation
+ CODE, or gimple_val (in case that stmt1 == s1 or stmt2 == s1,
+ so that name1 or name2 was removed from it). */
+ tmp_stmt = gimple_build_assign_with_ops (gimple_assign_rhs_code (s1),
+ tmp_name,
+ gimple_assign_rhs1 (s1),
+ gimple_assign_rhs2 (s1));
+
+ bsi = gsi_for_stmt (s1);
+ gimple_assign_set_rhs_with_ops (&bsi, code, new_name, tmp_name);
+ s1 = gsi_stmt (bsi);
update_stmt (s1);
- bsi = bsi_for_stmt (s1);
- bsi_insert_before (&bsi, new_stmt, BSI_SAME_STMT);
- bsi_insert_before (&bsi, tmp_stmt, BSI_SAME_STMT);
+ gsi_insert_before (&bsi, new_stmt, GSI_SAME_STMT);
+ gsi_insert_before (&bsi, tmp_stmt, GSI_SAME_STMT);
return new_stmt;
}
@@ -2242,10 +2291,10 @@ reassociate_to_the_same_stmt (tree name1, tree name2)
associative and commutative operation in the same expression, reassociate
the expression so that they are used in the same statement. */
-static tree
+static gimple
stmt_combining_refs (dref r1, dref r2)
{
- tree stmt1, stmt2;
+ gimple stmt1, stmt2;
tree name1 = name_for_ref (r1);
tree name2 = name_for_ref (r2);
@@ -2268,7 +2317,7 @@ combine_chains (chain_p ch1, chain_p ch2)
bool swap = false;
chain_p new_chain;
unsigned i;
- tree root_stmt;
+ gimple root_stmt;
tree rslt_type = NULL_TREE;
if (ch1 == ch2)
@@ -2298,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;
@@ -2399,7 +2448,8 @@ prepare_initializers_chain (struct loop *loop, chain_p chain)
{
unsigned i, n = (chain->type == CT_INVARIANT) ? 1 : chain->length;
struct data_reference *dr = get_chain_root (chain)->ref;
- tree init, stmts;
+ tree init;
+ gimple_seq stmts;
dref laref;
edge entry = loop_preheader_edge (loop);
@@ -2413,7 +2463,7 @@ prepare_initializers_chain (struct loop *loop, chain_p chain)
instead of creating our own. */
for (i = 0; VEC_iterate (dref, chain->refs, i, laref); i++)
{
- if (TREE_CODE (laref->stmt) != PHI_NODE)
+ if (gimple_code (laref->stmt) != GIMPLE_PHI)
continue;
gcc_assert (laref->distance > 0);
@@ -2437,7 +2487,7 @@ prepare_initializers_chain (struct loop *loop, chain_p chain)
if (stmts)
{
mark_virtual_ops_for_renaming_list (stmts);
- bsi_insert_on_edge_immediate (entry, stmts);
+ gsi_insert_seq_on_edge_immediate (entry, stmts);
}
set_alias_info (init, dr);
@@ -2600,9 +2650,10 @@ tree_predictive_commoning (void)
initialize_original_copy_tables ();
FOR_EACH_LOOP (li, loop, LI_ONLY_INNERMOST)
- {
- unrolled |= tree_predictive_commoning_loop (loop);
- }
+ if (optimize_loop_for_speed_p (loop))
+ {
+ unrolled |= tree_predictive_commoning_loop (loop);
+ }
if (unrolled)
{
diff --git a/gcc/tree-pretty-print.c b/gcc/tree-pretty-print.c
index fce766cc61e..5708eedf3b2 100644
--- a/gcc/tree-pretty-print.c
+++ b/gcc/tree-pretty-print.c
@@ -44,11 +44,8 @@ static void pretty_print_string (pretty_printer *, const char*);
static void print_call_name (pretty_printer *, const_tree);
static void newline_and_indent (pretty_printer *, int);
static void maybe_init_pretty_print (FILE *);
-static void print_declaration (pretty_printer *, tree, int, int);
static void print_struct_decl (pretty_printer *, const_tree, int, int);
static void do_niy (pretty_printer *, const_tree);
-static void dump_vops (pretty_printer *, tree, int, int);
-static void dump_generic_bb_buff (pretty_printer *, basic_block, int, int);
#define INDENT(SPACE) do { \
int i; for (i = 0; i<SPACE; i++) pp_space (buffer); } while (0)
@@ -409,7 +406,7 @@ dump_omp_clause (pretty_printer *buffer, tree clause, int spc, int flags)
/* Dump the list of OpenMP clauses. BUFFER, SPC and FLAGS are as in
dump_generic_node. */
-static void
+void
dump_omp_clauses (pretty_printer *buffer, tree clause, int spc, int flags)
{
if (clause == NULL)
@@ -427,33 +424,6 @@ dump_omp_clauses (pretty_printer *buffer, tree clause, int spc, int flags)
}
-/* Dump the set of decls SYMS. BUFFER, SPC and FLAGS are as in
- dump_generic_node. */
-
-static void
-dump_symbols (pretty_printer *buffer, bitmap syms, int flags)
-{
- unsigned i;
- bitmap_iterator bi;
-
- if (syms == NULL)
- pp_string (buffer, "NIL");
- else
- {
- pp_string (buffer, " { ");
-
- EXECUTE_IF_SET_IN_BITMAP (syms, 0, i, bi)
- {
- tree sym = referenced_var_lookup (i);
- dump_generic_node (buffer, sym, 0, flags, false);
- pp_string (buffer, " ");
- }
-
- pp_string (buffer, "}");
- }
-}
-
-
/* Dump the node NODE on the pretty_printer BUFFER, SPC spaces of
indent. FLAGS specifies details to show in the dump (see TDF_* in
tree-pass.h). If IS_STMT is true, the object printed is considered
@@ -471,18 +441,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
if (node == NULL_TREE)
return spc;
- is_expr = EXPR_P (node) || GIMPLE_STMT_P (node);
-
- /* We use has_stmt_ann because CALL_EXPR can be both an expression
- and a statement, and we have no guarantee that it will have a
- stmt_ann when it is used as an RHS expression. stmt_ann will assert
- if you call it on something with a non-stmt annotation attached. */
- if (TREE_CODE (node) != ERROR_MARK
- && is_gimple_stmt (node)
- && (flags & (TDF_VOPS|TDF_MEMSYMS))
- && has_stmt_ann (node)
- && TREE_CODE (node) != PHI_NODE)
- dump_vops (buffer, node, spc, flags);
+ is_expr = EXPR_P (node);
if (is_stmt && (flags & TDF_STMTADDR))
pp_printf (buffer, "<&%p> ", (void *)node);
@@ -560,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 ");
@@ -569,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))
{
@@ -1095,24 +1054,16 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
break;
case MODIFY_EXPR:
- case GIMPLE_MODIFY_STMT:
case INIT_EXPR:
- dump_generic_node (buffer, GENERIC_TREE_OPERAND (node, 0), spc, flags,
+ dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags,
false);
pp_space (buffer);
pp_character (buffer, '=');
- if (TREE_CODE (node) == GIMPLE_MODIFY_STMT
+ if (TREE_CODE (node) == MODIFY_EXPR
&& MOVE_NONTEMPORAL (node))
pp_string (buffer, "{nt}");
- if (TREE_CODE (node) == GIMPLE_MODIFY_STMT)
- {
- stmt_ann_t ann;
- if ((ann = stmt_ann (node))
- && ann->has_volatile_ops)
- pp_string (buffer, "{v}");
- }
pp_space (buffer);
- dump_generic_node (buffer, GENERIC_TREE_OPERAND (node, 1), spc, flags,
+ dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags,
false);
break;
@@ -1622,9 +1573,8 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
if (op0)
{
pp_space (buffer);
- if (TREE_CODE (op0) == MODIFY_EXPR
- || TREE_CODE (op0) == GIMPLE_MODIFY_STMT)
- dump_generic_node (buffer, GENERIC_TREE_OPERAND (op0, 1),
+ if (TREE_CODE (op0) == MODIFY_EXPR)
+ dump_generic_node (buffer, TREE_OPERAND (op0, 1),
spc, flags, false);
else
dump_generic_node (buffer, op0, spc, flags, false);
@@ -1730,7 +1680,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
dump_generic_node (buffer, CASE_LOW (node), spc, flags, false);
}
else
- pp_string (buffer, "default ");
+ pp_string (buffer, "default");
pp_character (buffer, ':');
break;
@@ -1745,28 +1695,6 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
pp_character (buffer, ')');
break;
- case PHI_NODE:
- {
- int i;
-
- dump_generic_node (buffer, PHI_RESULT (node), spc, flags, false);
- pp_string (buffer, " = PHI <");
- for (i = 0; i < PHI_NUM_ARGS (node); i++)
- {
- dump_generic_node (buffer, PHI_ARG_DEF (node, i), spc, flags, false);
- pp_string (buffer, "(");
- pp_decimal_int (buffer, PHI_ARG_EDGE (node, i)->src->index);
- pp_string (buffer, ")");
- if (i < PHI_NUM_ARGS (node) - 1)
- pp_string (buffer, ", ");
- }
- pp_string (buffer, ">");
-
- if (stmt_references_memory_p (node) && (flags & TDF_MEMSYMS))
- dump_symbols (buffer, STORED_SYMS (node), flags);
- }
- break;
-
case SSA_NAME:
dump_generic_node (buffer, SSA_NAME_VAR (node), spc, flags, false);
pp_string (buffer, "_");
@@ -1844,21 +1772,6 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
case OMP_PARALLEL:
pp_string (buffer, "#pragma omp parallel");
dump_omp_clauses (buffer, OMP_PARALLEL_CLAUSES (node), spc, flags);
- if (OMP_PARALLEL_FN (node))
- {
- pp_string (buffer, " [child fn: ");
- dump_generic_node (buffer, OMP_PARALLEL_FN (node), spc, flags, false);
-
- pp_string (buffer, " (");
-
- if (OMP_PARALLEL_DATA_ARG (node))
- dump_generic_node (buffer, OMP_PARALLEL_DATA_ARG (node), spc, flags,
- false);
- else
- pp_string (buffer, "???");
-
- pp_string (buffer, ")]");
- }
dump_omp_body:
if (!(flags & TDF_SLIM) && OMP_BODY (node))
@@ -1876,28 +1789,6 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
case OMP_TASK:
pp_string (buffer, "#pragma omp task");
dump_omp_clauses (buffer, OMP_TASK_CLAUSES (node), spc, flags);
- if (OMP_TASK_FN (node))
- {
- pp_string (buffer, " [child fn: ");
- dump_generic_node (buffer, OMP_TASK_FN (node), spc, flags, false);
-
- pp_string (buffer, " (");
-
- if (OMP_TASK_DATA_ARG (node))
- dump_generic_node (buffer, OMP_TASK_DATA_ARG (node), spc, flags,
- false);
- else
- pp_string (buffer, "???");
-
- pp_character (buffer, ')');
- if (OMP_TASK_COPYFN (node))
- {
- pp_string (buffer, ", copy fn: ");
- dump_generic_node (buffer, OMP_TASK_COPYFN (node), spc,
- flags, false);
- }
- pp_character (buffer, ']');
- }
goto dump_omp_body;
case OMP_FOR:
@@ -1956,21 +1847,9 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
case OMP_SECTIONS:
pp_string (buffer, "#pragma omp sections");
- if (OMP_SECTIONS_CONTROL (node))
- {
- pp_string (buffer, " <");
- dump_generic_node (buffer, OMP_SECTIONS_CONTROL (node), spc,
- flags, false);
- pp_string (buffer, ">");
- }
dump_omp_clauses (buffer, OMP_SECTIONS_CLAUSES (node), spc, flags);
goto dump_omp_body;
- case OMP_SECTIONS_SWITCH:
- pp_string (buffer, "OMP_SECTIONS_SWITCH");
- is_expr = false;
- break;
-
case OMP_SECTION:
pp_string (buffer, "#pragma omp section");
goto dump_omp_body;
@@ -2005,44 +1884,11 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false);
break;
- case OMP_ATOMIC_LOAD:
- pp_string (buffer, "#pragma omp atomic_load");
- newline_and_indent (buffer, spc + 2);
- dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
- pp_space (buffer);
- pp_character (buffer, '=');
- pp_space (buffer);
- pp_character (buffer, '*');
- dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false);
- break;
-
- case OMP_ATOMIC_STORE:
- pp_string (buffer, "#pragma omp atomic_store (");
- dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
- pp_character (buffer, ')');
- break;
-
case OMP_SINGLE:
pp_string (buffer, "#pragma omp single");
dump_omp_clauses (buffer, OMP_SINGLE_CLAUSES (node), spc, flags);
goto dump_omp_body;
- case OMP_RETURN:
- pp_string (buffer, "OMP_RETURN");
- if (OMP_RETURN_NOWAIT (node))
- pp_string (buffer, " [nowait]");
- is_expr = false;
- break;
-
- case OMP_CONTINUE:
- pp_string (buffer, "OMP_CONTINUE <");
- dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
- pp_string (buffer, " <- ");
- dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false);
- pp_string (buffer, ">");
- is_expr = false;
- break;
-
case OMP_CLAUSE:
dump_omp_clause (buffer, node, spc, flags);
is_expr = false;
@@ -2237,7 +2083,7 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
/* Print the declaration of a variable. */
-static void
+void
print_declaration (pretty_printer *buffer, tree t, int spc, int flags)
{
INDENT (spc);
@@ -2415,7 +2261,6 @@ op_prio (const_tree op)
return 1;
case MODIFY_EXPR:
- case GIMPLE_MODIFY_STMT:
case INIT_EXPR:
return 2;
@@ -2549,7 +2394,6 @@ op_symbol_code (enum tree_code code)
switch (code)
{
case MODIFY_EXPR:
- case GIMPLE_MODIFY_STMT:
return "=";
case TRUTH_OR_EXPR:
@@ -2890,342 +2734,3 @@ newline_and_indent (pretty_printer *buffer, int spc)
pp_newline (buffer);
INDENT (spc);
}
-
-
-static void
-dump_vops (pretty_printer *buffer, tree stmt, int spc, int flags)
-{
- struct voptype_d *vdefs;
- struct voptype_d *vuses;
- int i, n;
-
- if (!ssa_operands_active () || !stmt_references_memory_p (stmt))
- return;
-
- /* Even if the statement doesn't have virtual operators yet, it may
- contain symbol information (this happens before aliases have been
- computed). */
- if ((flags & TDF_MEMSYMS)
- && VUSE_OPS (stmt) == NULL
- && VDEF_OPS (stmt) == NULL)
- {
- if (LOADED_SYMS (stmt))
- {
- pp_string (buffer, "# LOADS: ");
- dump_symbols (buffer, LOADED_SYMS (stmt), flags);
- newline_and_indent (buffer, spc);
- }
-
- if (STORED_SYMS (stmt))
- {
- pp_string (buffer, "# STORES: ");
- dump_symbols (buffer, STORED_SYMS (stmt), flags);
- newline_and_indent (buffer, spc);
- }
-
- return;
- }
-
- vuses = VUSE_OPS (stmt);
- while (vuses)
- {
- pp_string (buffer, "# VUSE <");
-
- n = VUSE_NUM (vuses);
- for (i = 0; i < n; i++)
- {
- dump_generic_node (buffer, VUSE_OP (vuses, i), spc + 2, flags, false);
- if (i < n - 1)
- pp_string (buffer, ", ");
- }
-
- pp_string (buffer, ">");
-
- if (flags & TDF_MEMSYMS)
- dump_symbols (buffer, LOADED_SYMS (stmt), flags);
-
- newline_and_indent (buffer, spc);
- vuses = vuses->next;
- }
-
- vdefs = VDEF_OPS (stmt);
- while (vdefs)
- {
- pp_string (buffer, "# ");
- dump_generic_node (buffer, VDEF_RESULT (vdefs), spc + 2, flags, false);
- pp_string (buffer, " = VDEF <");
-
- n = VDEF_NUM (vdefs);
- for (i = 0; i < n; i++)
- {
- dump_generic_node (buffer, VDEF_OP (vdefs, i), spc + 2, flags, 0);
- if (i < n - 1)
- pp_string (buffer, ", ");
- }
-
- pp_string (buffer, ">");
-
- if ((flags & TDF_MEMSYMS) && vdefs->next == NULL)
- dump_symbols (buffer, STORED_SYMS (stmt), flags);
-
- newline_and_indent (buffer, spc);
- vdefs = vdefs->next;
- }
-}
-
-
-/* Dumps basic block BB to FILE with details described by FLAGS and
- indented by INDENT spaces. */
-
-void
-dump_generic_bb (FILE *file, basic_block bb, int indent, int flags)
-{
- maybe_init_pretty_print (file);
- dump_generic_bb_buff (&buffer, bb, indent, flags);
- pp_flush (&buffer);
-}
-
-/* Dumps header of basic block BB to buffer BUFFER indented by INDENT
- spaces and details described by flags. */
-
-static void
-dump_bb_header (pretty_printer *buffer, basic_block bb, int indent, int flags)
-{
- edge e;
- tree stmt;
- edge_iterator ei;
-
- if (flags & TDF_BLOCKS)
- {
- INDENT (indent);
- pp_string (buffer, "# BLOCK ");
- pp_decimal_int (buffer, bb->index);
- if (bb->frequency)
- {
- pp_string (buffer, " freq:");
- pp_decimal_int (buffer, bb->frequency);
- }
- if (bb->count)
- {
- pp_string (buffer, " count:");
- pp_widest_integer (buffer, bb->count);
- }
-
- if (flags & TDF_LINENO)
- {
- block_stmt_iterator bsi;
-
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- if (get_lineno (bsi_stmt (bsi)) != -1)
- {
- pp_string (buffer, ", starting at line ");
- pp_decimal_int (buffer, get_lineno (bsi_stmt (bsi)));
- break;
- }
- }
- newline_and_indent (buffer, indent);
-
- pp_string (buffer, "# PRED:");
- pp_write_text_to_stream (buffer);
- FOR_EACH_EDGE (e, ei, bb->preds)
- if (flags & TDF_SLIM)
- {
- pp_string (buffer, " ");
- if (e->src == ENTRY_BLOCK_PTR)
- pp_string (buffer, "ENTRY");
- else
- pp_decimal_int (buffer, e->src->index);
- }
- else
- dump_edge_info (buffer->buffer->stream, e, 0);
- pp_newline (buffer);
- }
- else
- {
- stmt = first_stmt (bb);
- if (!stmt || TREE_CODE (stmt) != LABEL_EXPR)
- {
- INDENT (indent - 2);
- pp_string (buffer, "<bb ");
- pp_decimal_int (buffer, bb->index);
- pp_string (buffer, ">:");
- pp_newline (buffer);
- }
- }
- pp_write_text_to_stream (buffer);
- check_bb_profile (bb, buffer->buffer->stream);
-}
-
-/* Dumps end of basic block BB to buffer BUFFER indented by INDENT
- spaces. */
-
-static void
-dump_bb_end (pretty_printer *buffer, basic_block bb, int indent, int flags)
-{
- edge e;
- edge_iterator ei;
-
- INDENT (indent);
- pp_string (buffer, "# SUCC:");
- pp_write_text_to_stream (buffer);
- FOR_EACH_EDGE (e, ei, bb->succs)
- if (flags & TDF_SLIM)
- {
- pp_string (buffer, " ");
- if (e->dest == EXIT_BLOCK_PTR)
- pp_string (buffer, "EXIT");
- else
- pp_decimal_int (buffer, e->dest->index);
- }
- else
- dump_edge_info (buffer->buffer->stream, e, 1);
- pp_newline (buffer);
-}
-
-/* Dump PHI nodes of basic block BB to BUFFER with details described
- by FLAGS and indented by INDENT spaces. */
-
-static void
-dump_phi_nodes (pretty_printer *buffer, basic_block bb, int indent, int flags)
-{
- tree phi = phi_nodes (bb);
- if (!phi)
- return;
-
- for (; phi; phi = PHI_CHAIN (phi))
- {
- if (is_gimple_reg (PHI_RESULT (phi)) || (flags & TDF_VOPS))
- {
- INDENT (indent);
- pp_string (buffer, "# ");
- dump_generic_node (buffer, phi, indent, flags, false);
- pp_newline (buffer);
- if (flags & TDF_VERBOSE)
- print_node (buffer->buffer->stream, "", phi, indent);
- }
- }
-}
-
-
-/* Dump jump to basic block BB that is represented implicitly in the cfg
- to BUFFER. */
-
-static void
-pp_cfg_jump (pretty_printer *buffer, basic_block bb)
-{
- tree stmt;
-
- stmt = first_stmt (bb);
-
- pp_string (buffer, "goto <bb ");
- pp_decimal_int (buffer, bb->index);
- pp_string (buffer, ">");
- if (stmt && TREE_CODE (stmt) == LABEL_EXPR)
- {
- pp_string (buffer, " (");
- dump_generic_node (buffer, LABEL_EXPR_LABEL (stmt), 0, 0, false);
- pp_string (buffer, ")");
- }
- pp_semicolon (buffer);
-}
-
-/* Dump edges represented implicitly in basic block BB to BUFFER, indented
- by INDENT spaces, with details given by FLAGS. */
-
-static void
-dump_implicit_edges (pretty_printer *buffer, basic_block bb, int indent,
- int flags)
-{
- edge e;
- edge_iterator ei;
- tree stmt;
-
- stmt = last_stmt (bb);
- if (stmt && TREE_CODE (stmt) == COND_EXPR)
- {
- edge true_edge, false_edge;
-
- /* When we are emitting the code or changing CFG, it is possible that
- the edges are not yet created. When we are using debug_bb in such
- a situation, we do not want it to crash. */
- if (EDGE_COUNT (bb->succs) != 2)
- return;
- extract_true_false_edges_from_block (bb, &true_edge, &false_edge);
-
- INDENT (indent + 2);
- pp_cfg_jump (buffer, true_edge->dest);
- newline_and_indent (buffer, indent);
- pp_string (buffer, "else");
- newline_and_indent (buffer, indent + 2);
- pp_cfg_jump (buffer, false_edge->dest);
- pp_newline (buffer);
- return;
- }
-
- /* If there is a fallthru edge, we may need to add an artificial goto to the
- dump. */
- FOR_EACH_EDGE (e, ei, bb->succs)
- if (e->flags & EDGE_FALLTHRU)
- break;
- if (e && e->dest != bb->next_bb)
- {
- INDENT (indent);
-
- if ((flags & TDF_LINENO) && e->goto_locus != UNKNOWN_LOCATION)
- {
- expanded_location goto_xloc;
- goto_xloc = expand_location (e->goto_locus);
- pp_character (buffer, '[');
- if (goto_xloc.file)
- {
- pp_string (buffer, goto_xloc.file);
- pp_string (buffer, " : ");
- }
- pp_decimal_int (buffer, goto_xloc.line);
- pp_string (buffer, "] ");
- }
-
- pp_cfg_jump (buffer, e->dest);
- pp_newline (buffer);
- }
-}
-
-/* Dumps basic block BB to buffer BUFFER with details described by FLAGS and
- indented by INDENT spaces. */
-
-static void
-dump_generic_bb_buff (pretty_printer *buffer, basic_block bb,
- int indent, int flags)
-{
- block_stmt_iterator bsi;
- tree stmt;
- int label_indent = indent - 2;
-
- if (label_indent < 0)
- label_indent = 0;
-
- dump_bb_header (buffer, bb, indent, flags);
-
- dump_phi_nodes (buffer, bb, indent, flags);
-
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- {
- int curr_indent;
-
- stmt = bsi_stmt (bsi);
-
- curr_indent = TREE_CODE (stmt) == LABEL_EXPR ? label_indent : indent;
-
- INDENT (curr_indent);
- dump_generic_node (buffer, stmt, curr_indent, flags, true);
- pp_newline (buffer);
- dump_histograms_for_stmt (cfun, buffer->buffer->stream, stmt);
- if (flags & TDF_VERBOSE)
- print_node (buffer->buffer->stream, "", stmt, curr_indent);
- }
-
- dump_implicit_edges (buffer, bb, indent, flags);
-
- if (flags & TDF_BLOCKS)
- dump_bb_end (buffer, bb, indent, flags);
-}
diff --git a/gcc/tree-profile.c b/gcc/tree-profile.c
index 9aac154b436..20ded1b9f75 100644
--- a/gcc/tree-profile.c
+++ b/gcc/tree-profile.c
@@ -164,12 +164,13 @@ tree_init_edge_profiler (void)
/* Output instructions as GIMPLE trees to increment the edge
execution count, and insert them on E. We rely on
- bsi_insert_on_edge to preserve the order. */
+ gsi_insert_on_edge to preserve the order. */
static void
tree_gen_edge_profiler (int edgeno, edge e)
{
- tree ref, one, stmt1, stmt2, stmt3;
+ tree ref, one;
+ gimple stmt1, stmt2, stmt3;
/* We share one temporary variable declaration per function. This
gets re-set in tree_profiling. */
@@ -177,26 +178,24 @@ tree_gen_edge_profiler (int edgeno, edge e)
gcov_type_tmp_var = create_tmp_var (gcov_type_node, "PROF_edge_counter");
ref = tree_coverage_counter_ref (GCOV_COUNTER_ARCS, edgeno);
one = build_int_cst (gcov_type_node, 1);
- stmt1 = build_gimple_modify_stmt (gcov_type_tmp_var, ref);
- stmt2 = build_gimple_modify_stmt (gcov_type_tmp_var,
- build2 (PLUS_EXPR, gcov_type_node,
- gcov_type_tmp_var, one));
- stmt3 = build_gimple_modify_stmt (unshare_expr (ref), gcov_type_tmp_var);
- bsi_insert_on_edge (e, stmt1);
- bsi_insert_on_edge (e, stmt2);
- bsi_insert_on_edge (e, stmt3);
+ stmt1 = gimple_build_assign (gcov_type_tmp_var, ref);
+ stmt2 = gimple_build_assign_with_ops (PLUS_EXPR, gcov_type_tmp_var,
+ gcov_type_tmp_var, one);
+ stmt3 = gimple_build_assign (unshare_expr (ref), gcov_type_tmp_var);
+ gsi_insert_on_edge (e, stmt1);
+ gsi_insert_on_edge (e, stmt2);
+ gsi_insert_on_edge (e, stmt3);
}
-/* Emits code to get VALUE to instrument at BSI, and returns the
+/* Emits code to get VALUE to instrument at GSI, and returns the
variable containing the value. */
static tree
-prepare_instrumented_value (block_stmt_iterator *bsi,
- histogram_value value)
+prepare_instrumented_value (gimple_stmt_iterator *gsi, histogram_value value)
{
tree val = value->hvalue.value;
- return force_gimple_operand_bsi (bsi, fold_convert (gcov_type_node, val),
- true, NULL_TREE, true, BSI_SAME_STMT);
+ return force_gimple_operand_gsi (gsi, fold_convert (gcov_type_node, val),
+ true, NULL_TREE, true, GSI_SAME_STMT);
}
/* Output instructions as GIMPLE trees to increment the interval histogram
@@ -206,20 +205,23 @@ prepare_instrumented_value (block_stmt_iterator *bsi,
static void
tree_gen_interval_profiler (histogram_value value, unsigned tag, unsigned base)
{
- tree stmt = value->hvalue.stmt;
- block_stmt_iterator bsi = bsi_for_stmt (stmt);
+ gimple stmt = value->hvalue.stmt;
+ gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
tree ref = tree_coverage_counter_ref (tag, base), ref_ptr;
- tree call, val;
- tree start = build_int_cst_type (integer_type_node, value->hdata.intvl.int_start);
- tree steps = build_int_cst_type (unsigned_type_node, value->hdata.intvl.steps);
+ gimple call;
+ tree val;
+ tree start = build_int_cst_type (integer_type_node,
+ value->hdata.intvl.int_start);
+ tree steps = build_int_cst_type (unsigned_type_node,
+ value->hdata.intvl.steps);
- ref_ptr = force_gimple_operand_bsi (&bsi,
+ ref_ptr = force_gimple_operand_gsi (&gsi,
build_addr (ref, current_function_decl),
- true, NULL_TREE, true, BSI_SAME_STMT);
- val = prepare_instrumented_value (&bsi, value);
- call = build_call_expr (tree_interval_profiler_fn, 4,
- ref_ptr, val, start, steps);
- bsi_insert_before (&bsi, call, BSI_SAME_STMT);
+ true, NULL_TREE, true, GSI_SAME_STMT);
+ val = prepare_instrumented_value (&gsi, value);
+ call = gimple_build_call (tree_interval_profiler_fn, 4,
+ ref_ptr, val, start, steps);
+ gsi_insert_before (&gsi, call, GSI_SAME_STMT);
}
/* Output instructions as GIMPLE trees to increment the power of two histogram
@@ -229,16 +231,17 @@ tree_gen_interval_profiler (histogram_value value, unsigned tag, unsigned base)
static void
tree_gen_pow2_profiler (histogram_value value, unsigned tag, unsigned base)
{
- tree stmt = value->hvalue.stmt;
- block_stmt_iterator bsi = bsi_for_stmt (stmt);
+ gimple stmt = value->hvalue.stmt;
+ gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
tree ref_ptr = tree_coverage_counter_addr (tag, base);
- tree call, val;
+ gimple call;
+ tree val;
- ref_ptr = force_gimple_operand_bsi (&bsi, ref_ptr,
- true, NULL_TREE, true, BSI_SAME_STMT);
- val = prepare_instrumented_value (&bsi, value);
- call = build_call_expr (tree_pow2_profiler_fn, 2, ref_ptr, val);
- bsi_insert_before (&bsi, call, BSI_SAME_STMT);
+ ref_ptr = force_gimple_operand_gsi (&gsi, ref_ptr,
+ true, NULL_TREE, true, GSI_SAME_STMT);
+ val = prepare_instrumented_value (&gsi, value);
+ call = gimple_build_call (tree_pow2_profiler_fn, 2, ref_ptr, val);
+ gsi_insert_before (&gsi, call, GSI_SAME_STMT);
}
/* Output instructions as GIMPLE trees for code to find the most common value.
@@ -248,16 +251,17 @@ tree_gen_pow2_profiler (histogram_value value, unsigned tag, unsigned base)
static void
tree_gen_one_value_profiler (histogram_value value, unsigned tag, unsigned base)
{
- tree stmt = value->hvalue.stmt;
- block_stmt_iterator bsi = bsi_for_stmt (stmt);
+ gimple stmt = value->hvalue.stmt;
+ gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
tree ref_ptr = tree_coverage_counter_addr (tag, base);
- tree call, val;
+ gimple call;
+ tree val;
- ref_ptr = force_gimple_operand_bsi (&bsi, ref_ptr,
- true, NULL_TREE, true, BSI_SAME_STMT);
- val = prepare_instrumented_value (&bsi, value);
- call = build_call_expr (tree_one_value_profiler_fn, 2, ref_ptr, val);
- bsi_insert_before (&bsi, call, BSI_SAME_STMT);
+ ref_ptr = force_gimple_operand_gsi (&gsi, ref_ptr,
+ true, NULL_TREE, true, GSI_SAME_STMT);
+ val = prepare_instrumented_value (&gsi, value);
+ call = gimple_build_call (tree_one_value_profiler_fn, 2, ref_ptr, val);
+ gsi_insert_before (&gsi, call, GSI_SAME_STMT);
}
@@ -270,13 +274,14 @@ tree_gen_one_value_profiler (histogram_value value, unsigned tag, unsigned base)
static void
tree_gen_ic_profiler (histogram_value value, unsigned tag, unsigned base)
{
- tree tmp1, stmt1, stmt2, stmt3;
- tree stmt = value->hvalue.stmt;
- block_stmt_iterator bsi = bsi_for_stmt (stmt);
+ tree tmp1;
+ gimple stmt1, stmt2, stmt3;
+ gimple stmt = value->hvalue.stmt;
+ gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
tree ref_ptr = tree_coverage_counter_addr (tag, base);
- ref_ptr = force_gimple_operand_bsi (&bsi, ref_ptr,
- true, NULL_TREE, true, BSI_SAME_STMT);
+ ref_ptr = force_gimple_operand_gsi (&gsi, ref_ptr,
+ true, NULL_TREE, true, GSI_SAME_STMT);
/* Insert code:
@@ -285,13 +290,13 @@ tree_gen_ic_profiler (histogram_value value, unsigned tag, unsigned base)
*/
tmp1 = create_tmp_var (ptr_void, "PROF");
- stmt1 = build_gimple_modify_stmt (ic_gcov_type_ptr_var, ref_ptr);
- stmt2 = build_gimple_modify_stmt (tmp1, unshare_expr (value->hvalue.value));
- stmt3 = build_gimple_modify_stmt (ic_void_ptr_var, tmp1);
+ stmt1 = gimple_build_assign (ic_gcov_type_ptr_var, ref_ptr);
+ stmt2 = gimple_build_assign (tmp1, unshare_expr (value->hvalue.value));
+ stmt3 = gimple_build_assign (ic_void_ptr_var, tmp1);
- bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt2, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt3, BSI_SAME_STMT);
+ gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
+ gsi_insert_before (&gsi, stmt2, GSI_SAME_STMT);
+ gsi_insert_before (&gsi, stmt3, GSI_SAME_STMT);
}
@@ -304,18 +309,15 @@ static void
tree_gen_ic_func_profiler (void)
{
struct cgraph_node * c_node = cgraph_node (current_function_decl);
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
edge e;
basic_block bb;
edge_iterator ei;
- tree stmt1, stmt2;
+ gimple stmt1, stmt2;
tree tree_uid, cur_func;
- if (flag_unit_at_a_time)
- {
- if (!c_node->needed)
- return;
- }
+ if (!c_node->needed)
+ return;
tree_init_edge_profiler ();
@@ -324,30 +326,30 @@ tree_gen_ic_func_profiler (void)
tree void0;
bb = split_edge (e);
- bsi = bsi_start (bb);
+ gsi = gsi_start_bb (bb);
- cur_func = force_gimple_operand_bsi (&bsi,
+ cur_func = force_gimple_operand_gsi (&gsi,
build_addr (current_function_decl,
current_function_decl),
true, NULL_TREE,
- true, BSI_SAME_STMT);
+ true, GSI_SAME_STMT);
tree_uid = build_int_cst (gcov_type_node, c_node->pid);
- stmt1 = build_call_expr (tree_indirect_call_profiler_fn, 4,
- ic_gcov_type_ptr_var,
- tree_uid,
- cur_func,
- ic_void_ptr_var);
- bsi_insert_after (&bsi, stmt1, BSI_NEW_STMT);
+ stmt1 = gimple_build_call (tree_indirect_call_profiler_fn, 4,
+ ic_gcov_type_ptr_var,
+ tree_uid,
+ cur_func,
+ ic_void_ptr_var);
+ gsi_insert_after (&gsi, stmt1, GSI_NEW_STMT);
gcc_assert (EDGE_COUNT (bb->succs) == 1);
bb = split_edge (EDGE_I (bb->succs, 0));
- bsi = bsi_start (bb);
+ gsi = gsi_start_bb (bb);
/* Set __gcov_indirect_call_callee to 0,
so that calls from other modules won't get misattributed
to the last caller of the current callee. */
void0 = build_int_cst (build_pointer_type (void_type_node), 0);
- stmt2 = build_gimple_modify_stmt (ic_void_ptr_var, void0);
- bsi_insert_after (&bsi, stmt2, BSI_NEW_STMT);
+ stmt2 = gimple_build_assign (ic_void_ptr_var, void0);
+ gsi_insert_after (&gsi, stmt2, GSI_NEW_STMT);
}
}
@@ -357,9 +359,9 @@ tree_gen_ic_func_profiler (void)
section for counters, BASE is offset of the counter position. */
static void
-tree_gen_const_delta_profiler (histogram_value value ATTRIBUTE_UNUSED,
- unsigned tag ATTRIBUTE_UNUSED,
- unsigned base ATTRIBUTE_UNUSED)
+tree_gen_const_delta_profiler (histogram_value value ATTRIBUTE_UNUSED,
+ unsigned tag ATTRIBUTE_UNUSED,
+ unsigned base ATTRIBUTE_UNUSED)
{
/* FIXME implement this. */
#ifdef ENABLE_CHECKING
@@ -375,17 +377,18 @@ tree_gen_const_delta_profiler (histogram_value value ATTRIBUTE_UNUSED,
static void
tree_gen_average_profiler (histogram_value value, unsigned tag, unsigned base)
{
- tree stmt = value->hvalue.stmt;
- block_stmt_iterator bsi = bsi_for_stmt (stmt);
+ gimple stmt = value->hvalue.stmt;
+ gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
tree ref_ptr = tree_coverage_counter_addr (tag, base);
- tree call, val;
+ gimple call;
+ tree val;
- ref_ptr = force_gimple_operand_bsi (&bsi, ref_ptr,
+ ref_ptr = force_gimple_operand_gsi (&gsi, ref_ptr,
true, NULL_TREE,
- true, BSI_SAME_STMT);
- val = prepare_instrumented_value (&bsi, value);
- call = build_call_expr (tree_average_profiler_fn, 2, ref_ptr, val);
- bsi_insert_before (&bsi, call, BSI_SAME_STMT);
+ true, GSI_SAME_STMT);
+ val = prepare_instrumented_value (&gsi, value);
+ call = gimple_build_call (tree_average_profiler_fn, 2, ref_ptr, val);
+ gsi_insert_before (&gsi, call, GSI_SAME_STMT);
}
/* Output instructions as GIMPLE trees to increment the ior histogram
@@ -395,16 +398,17 @@ tree_gen_average_profiler (histogram_value value, unsigned tag, unsigned base)
static void
tree_gen_ior_profiler (histogram_value value, unsigned tag, unsigned base)
{
- tree stmt = value->hvalue.stmt;
- block_stmt_iterator bsi = bsi_for_stmt (stmt);
+ gimple stmt = value->hvalue.stmt;
+ gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
tree ref_ptr = tree_coverage_counter_addr (tag, base);
- tree call, val;
+ gimple call;
+ tree val;
- ref_ptr = force_gimple_operand_bsi (&bsi, ref_ptr,
- true, NULL_TREE, true, BSI_SAME_STMT);
- val = prepare_instrumented_value (&bsi, value);
- call = build_call_expr (tree_ior_profiler_fn, 2, ref_ptr, val);
- bsi_insert_before (&bsi, call, BSI_SAME_STMT);
+ ref_ptr = force_gimple_operand_gsi (&gsi, ref_ptr,
+ true, NULL_TREE, true, GSI_SAME_STMT);
+ val = prepare_instrumented_value (&gsi, value);
+ call = gimple_build_call (tree_ior_profiler_fn, 2, ref_ptr, val);
+ gsi_insert_before (&gsi, call, GSI_SAME_STMT);
}
/* Return 1 if tree-based profiling is in effect, else 0.
@@ -417,7 +421,7 @@ do_tree_profiling (void)
if (profile_arc_flag || flag_test_coverage || flag_branch_probabilities)
{
tree_register_profile_hooks ();
- tree_register_value_prof_hooks ();
+ gimple_register_value_prof_hooks ();
return true;
}
return false;
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c
index 57fe59b186e..67fcd08dda0 100644
--- a/gcc/tree-scalar-evolution.c
+++ b/gcc/tree-scalar-evolution.c
@@ -48,7 +48,7 @@ along with GCC; see the file COPYING3. If not see
Given a scalar variable to be analyzed, follow the SSA edge to
its definition:
- - When the definition is a GIMPLE_MODIFY_STMT: if the right hand side
+ - When the definition is a GIMPLE_ASSIGN: if the right hand side
(RHS) of the definition cannot be statically analyzed, the answer
of the analyzer is: "don't know".
Otherwise, for all the variables that are not yet analyzed in the
@@ -397,7 +397,7 @@ chrec_contains_symbols_defined_in_loop (const_tree chrec, unsigned loop_nb)
if (TREE_CODE (chrec) == SSA_NAME)
{
- tree def = SSA_NAME_DEF_STMT (chrec);
+ gimple def = SSA_NAME_DEF_STMT (chrec);
struct loop *def_loop = loop_containing_stmt (def);
struct loop *loop = get_loop (loop_nb);
@@ -421,13 +421,13 @@ chrec_contains_symbols_defined_in_loop (const_tree chrec, unsigned loop_nb)
/* Return true when PHI is a loop-phi-node. */
static bool
-loop_phi_node_p (tree phi)
+loop_phi_node_p (gimple phi)
{
/* The implementation of this function is based on the following
property: "all the loop-phi-nodes of a loop are contained in the
loop's header basic block". */
- return loop_containing_stmt (phi)->header == bb_for_stmt (phi);
+ return loop_containing_stmt (phi)->header == gimple_bb (phi);
}
/* Compute the scalar evolution for EVOLUTION_FN after crossing LOOP.
@@ -656,7 +656,7 @@ get_scalar_evolution (tree scalar)
static tree
add_to_evolution_1 (unsigned loop_nb, tree chrec_before, tree to_add,
- tree at_stmt)
+ gimple at_stmt)
{
tree type, left, right;
struct loop *loop = get_loop (loop_nb), *chloop;
@@ -853,7 +853,7 @@ add_to_evolution_1 (unsigned loop_nb, tree chrec_before, tree to_add,
static tree
add_to_evolution (unsigned loop_nb, tree chrec_before, enum tree_code code,
- tree to_add, tree at_stmt)
+ tree to_add, gimple at_stmt)
{
tree type = chrec_type (to_add);
tree res = NULL_TREE;
@@ -918,47 +918,14 @@ set_nb_iterations_in_loop (struct loop *loop,
scalar evolution analysis. For the moment, greedily select all the
loop nests we could analyze. */
-/* Return true when it is possible to analyze the condition expression
- EXPR. */
-
-static bool
-analyzable_condition (const_tree expr)
-{
- tree condition;
-
- if (TREE_CODE (expr) != COND_EXPR)
- return false;
-
- condition = TREE_OPERAND (expr, 0);
-
- switch (TREE_CODE (condition))
- {
- case SSA_NAME:
- return true;
-
- case LT_EXPR:
- case LE_EXPR:
- case GT_EXPR:
- case GE_EXPR:
- case EQ_EXPR:
- case NE_EXPR:
- return true;
-
- default:
- return false;
- }
-
- return false;
-}
-
/* For a loop with a single exit edge, return the COND_EXPR that
guards the exit edge. If the expression is too difficult to
analyze, then give up. */
-tree
+gimple
get_loop_exit_condition (const struct loop *loop)
{
- tree res = NULL_TREE;
+ gimple res = NULL;
edge exit_edge = single_exit (loop);
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -966,16 +933,16 @@ get_loop_exit_condition (const struct loop *loop)
if (exit_edge)
{
- tree expr;
+ gimple stmt;
- expr = last_stmt (exit_edge->src);
- if (analyzable_condition (expr))
- res = expr;
+ stmt = last_stmt (exit_edge->src);
+ if (gimple_code (stmt) == GIMPLE_COND)
+ res = stmt;
}
if (dump_file && (dump_flags & TDF_DETAILS))
{
- print_generic_expr (dump_file, res, 0);
+ print_gimple_stmt (dump_file, res, 0, 0);
fprintf (dump_file, ")\n");
}
@@ -986,7 +953,7 @@ get_loop_exit_condition (const struct loop *loop)
static void
get_exit_conditions_rec (struct loop *loop,
- VEC(tree,heap) **exit_conditions)
+ VEC(gimple,heap) **exit_conditions)
{
if (!loop)
return;
@@ -997,10 +964,10 @@ get_exit_conditions_rec (struct loop *loop,
if (single_exit (loop))
{
- tree loop_condition = get_loop_exit_condition (loop);
+ gimple loop_condition = get_loop_exit_condition (loop);
if (loop_condition)
- VEC_safe_push (tree, heap, *exit_conditions, loop_condition);
+ VEC_safe_push (gimple, heap, *exit_conditions, loop_condition);
}
}
@@ -1008,7 +975,7 @@ get_exit_conditions_rec (struct loop *loop,
initializes the EXIT_CONDITIONS array. */
static void
-select_loops_exit_conditions (VEC(tree,heap) **exit_conditions)
+select_loops_exit_conditions (VEC(gimple,heap) **exit_conditions)
{
struct loop *function_body = current_loops->tree_root;
@@ -1025,59 +992,23 @@ typedef enum t_bool {
} t_bool;
-static t_bool follow_ssa_edge (struct loop *loop, tree, tree, tree *, int);
+static t_bool follow_ssa_edge (struct loop *loop, gimple, gimple, tree *, int);
-/* Follow the ssa edge into the right hand side RHS of an assignment.
+/* Follow the ssa edge into the binary expression RHS0 CODE RHS1.
Return true if the strongly connected component has been found. */
static t_bool
-follow_ssa_edge_in_rhs (struct loop *loop, tree at_stmt, tree rhs,
- tree halting_phi, tree *evolution_of_loop, int limit)
+follow_ssa_edge_binary (struct loop *loop, gimple at_stmt,
+ tree type, tree rhs0, enum tree_code code, tree rhs1,
+ gimple halting_phi, tree *evolution_of_loop, int limit)
{
t_bool res = t_false;
- tree rhs0, rhs1;
- tree type_rhs = TREE_TYPE (rhs);
tree evol;
- enum tree_code code;
-
- /* The RHS is one of the following cases:
- - an SSA_NAME,
- - an INTEGER_CST,
- - a PLUS_EXPR,
- - a POINTER_PLUS_EXPR,
- - a MINUS_EXPR,
- - an ASSERT_EXPR,
- - other cases are not yet handled. */
- code = TREE_CODE (rhs);
+
switch (code)
{
- case NOP_EXPR:
- /* This assignment is under the form "a_1 = (cast) rhs. */
- res = follow_ssa_edge_in_rhs (loop, at_stmt, TREE_OPERAND (rhs, 0),
- halting_phi, evolution_of_loop, limit);
- *evolution_of_loop = chrec_convert (TREE_TYPE (rhs),
- *evolution_of_loop, at_stmt);
- break;
-
- case INTEGER_CST:
- /* This assignment is under the form "a_1 = 7". */
- res = t_false;
- break;
-
- case SSA_NAME:
- /* This assignment is under the form: "a_1 = b_2". */
- res = follow_ssa_edge
- (loop, SSA_NAME_DEF_STMT (rhs), halting_phi, evolution_of_loop, limit);
- break;
-
case POINTER_PLUS_EXPR:
case PLUS_EXPR:
- /* This case is under the form "rhs0 + rhs1". */
- rhs0 = TREE_OPERAND (rhs, 0);
- rhs1 = TREE_OPERAND (rhs, 1);
- STRIP_TYPE_NOPS (rhs0);
- STRIP_TYPE_NOPS (rhs1);
-
if (TREE_CODE (rhs0) == SSA_NAME)
{
if (TREE_CODE (rhs1) == SSA_NAME)
@@ -1092,13 +1023,12 @@ follow_ssa_edge_in_rhs (struct loop *loop, tree at_stmt, tree rhs,
evol = *evolution_of_loop;
res = follow_ssa_edge
- (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi,
- &evol, limit);
+ (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi, &evol, limit);
if (res == t_true)
*evolution_of_loop = add_to_evolution
(loop->num,
- chrec_convert (type_rhs, evol, at_stmt),
+ chrec_convert (type, evol, at_stmt),
code, rhs1, at_stmt);
else if (res == t_false)
@@ -1110,7 +1040,7 @@ follow_ssa_edge_in_rhs (struct loop *loop, tree at_stmt, tree rhs,
if (res == t_true)
*evolution_of_loop = add_to_evolution
(loop->num,
- chrec_convert (type_rhs, *evolution_of_loop, at_stmt),
+ chrec_convert (type, *evolution_of_loop, at_stmt),
code, rhs0, at_stmt);
else if (res == t_dont_know)
@@ -1130,7 +1060,7 @@ follow_ssa_edge_in_rhs (struct loop *loop, tree at_stmt, tree rhs,
evolution_of_loop, limit);
if (res == t_true)
*evolution_of_loop = add_to_evolution
- (loop->num, chrec_convert (type_rhs, *evolution_of_loop,
+ (loop->num, chrec_convert (type, *evolution_of_loop,
at_stmt),
code, rhs1, at_stmt);
@@ -1148,7 +1078,7 @@ follow_ssa_edge_in_rhs (struct loop *loop, tree at_stmt, tree rhs,
evolution_of_loop, limit);
if (res == t_true)
*evolution_of_loop = add_to_evolution
- (loop->num, chrec_convert (type_rhs, *evolution_of_loop,
+ (loop->num, chrec_convert (type, *evolution_of_loop,
at_stmt),
code, rhs0, at_stmt);
@@ -1161,16 +1091,10 @@ follow_ssa_edge_in_rhs (struct loop *loop, tree at_stmt, tree rhs,
"a = ... + ...". */
/* And there is nothing to do. */
res = t_false;
-
break;
case MINUS_EXPR:
/* This case is under the form "opnd0 = rhs0 - rhs1". */
- rhs0 = TREE_OPERAND (rhs, 0);
- rhs1 = TREE_OPERAND (rhs, 1);
- STRIP_TYPE_NOPS (rhs0);
- STRIP_TYPE_NOPS (rhs1);
-
if (TREE_CODE (rhs0) == SSA_NAME)
{
/* Match an assignment under the form:
@@ -1186,7 +1110,7 @@ follow_ssa_edge_in_rhs (struct loop *loop, tree at_stmt, tree rhs,
evolution_of_loop, limit);
if (res == t_true)
*evolution_of_loop = add_to_evolution
- (loop->num, chrec_convert (type_rhs, *evolution_of_loop, at_stmt),
+ (loop->num, chrec_convert (type, *evolution_of_loop, at_stmt),
MINUS_EXPR, rhs1, at_stmt);
else if (res == t_dont_know)
@@ -1197,14 +1121,72 @@ follow_ssa_edge_in_rhs (struct loop *loop, tree at_stmt, tree rhs,
"a = ... - ...". */
/* And there is nothing to do. */
res = t_false;
-
break;
+
+ default:
+ res = t_false;
+ }
+
+ return res;
+}
+/* Follow the ssa edge into the expression EXPR.
+ Return true if the strongly connected component has been found. */
+
+static t_bool
+follow_ssa_edge_expr (struct loop *loop, gimple at_stmt, tree expr,
+ gimple halting_phi, tree *evolution_of_loop, int limit)
+{
+ t_bool res = t_false;
+ tree rhs0, rhs1;
+ tree type = TREE_TYPE (expr);
+ enum tree_code code;
+
+ /* The EXPR is one of the following cases:
+ - an SSA_NAME,
+ - an INTEGER_CST,
+ - a PLUS_EXPR,
+ - a POINTER_PLUS_EXPR,
+ - a MINUS_EXPR,
+ - an ASSERT_EXPR,
+ - other cases are not yet handled. */
+ code = TREE_CODE (expr);
+ switch (code)
+ {
+ case NOP_EXPR:
+ /* This assignment is under the form "a_1 = (cast) rhs. */
+ res = follow_ssa_edge_expr (loop, at_stmt, TREE_OPERAND (expr, 0),
+ halting_phi, evolution_of_loop, limit);
+ *evolution_of_loop = chrec_convert (type, *evolution_of_loop, at_stmt);
+ break;
+
+ case INTEGER_CST:
+ /* This assignment is under the form "a_1 = 7". */
+ res = t_false;
+ break;
+
+ case SSA_NAME:
+ /* This assignment is under the form: "a_1 = b_2". */
+ res = follow_ssa_edge
+ (loop, SSA_NAME_DEF_STMT (expr), halting_phi, evolution_of_loop, limit);
+ break;
+
+ case POINTER_PLUS_EXPR:
+ case PLUS_EXPR:
+ case MINUS_EXPR:
+ /* This case is under the form "rhs0 +- rhs1". */
+ rhs0 = TREE_OPERAND (expr, 0);
+ rhs1 = TREE_OPERAND (expr, 1);
+ STRIP_TYPE_NOPS (rhs0);
+ STRIP_TYPE_NOPS (rhs1);
+ return follow_ssa_edge_binary (loop, at_stmt, type, rhs0, code, rhs1,
+ halting_phi, evolution_of_loop, limit);
+
case ASSERT_EXPR:
{
/* This assignment is of the form: "a_1 = ASSERT_EXPR <a_2, ...>"
It must be handled as a copy assignment of the form a_1 = a_2. */
- tree op0 = ASSERT_EXPR_VAR (rhs);
+ tree op0 = ASSERT_EXPR_VAR (expr);
if (TREE_CODE (op0) == SSA_NAME)
res = follow_ssa_edge (loop, SSA_NAME_DEF_STMT (op0),
halting_phi, evolution_of_loop, limit);
@@ -1222,12 +1204,37 @@ follow_ssa_edge_in_rhs (struct loop *loop, tree at_stmt, tree rhs,
return res;
}
+/* Follow the ssa edge into the right hand side of an assignment STMT.
+ Return true if the strongly connected component has been found. */
+
+static t_bool
+follow_ssa_edge_in_rhs (struct loop *loop, gimple stmt,
+ gimple halting_phi, tree *evolution_of_loop, int limit)
+{
+ tree type = TREE_TYPE (gimple_assign_lhs (stmt));
+ enum tree_code code = gimple_assign_rhs_code (stmt);
+
+ switch (get_gimple_rhs_class (code))
+ {
+ case GIMPLE_BINARY_RHS:
+ return follow_ssa_edge_binary (loop, stmt, type,
+ gimple_assign_rhs1 (stmt), code,
+ gimple_assign_rhs2 (stmt),
+ halting_phi, evolution_of_loop, limit);
+ case GIMPLE_SINGLE_RHS:
+ return follow_ssa_edge_expr (loop, stmt, gimple_assign_rhs1 (stmt),
+ halting_phi, evolution_of_loop, limit);
+ default:
+ return t_false;
+ }
+}
+
/* Checks whether the I-th argument of a PHI comes from a backedge. */
static bool
-backedge_phi_arg_p (const_tree phi, int i)
+backedge_phi_arg_p (gimple phi, int i)
{
- const_edge e = PHI_ARG_EDGE (phi, i);
+ const_edge e = gimple_phi_arg_edge (phi, i);
/* We would in fact like to test EDGE_DFS_BACK here, but we do not care
about updating it anywhere, and this should work as well most of the
@@ -1245,8 +1252,8 @@ backedge_phi_arg_p (const_tree phi, int i)
static inline t_bool
follow_ssa_edge_in_condition_phi_branch (int i,
struct loop *loop,
- tree condition_phi,
- tree halting_phi,
+ gimple condition_phi,
+ gimple halting_phi,
tree *evolution_of_branch,
tree init_cond, int limit)
{
@@ -1280,11 +1287,11 @@ follow_ssa_edge_in_condition_phi_branch (int i,
static t_bool
follow_ssa_edge_in_condition_phi (struct loop *loop,
- tree condition_phi,
- tree halting_phi,
+ gimple condition_phi,
+ gimple halting_phi,
tree *evolution_of_loop, int limit)
{
- int i;
+ int i, n;
tree init = *evolution_of_loop;
tree evolution_of_branch;
t_bool res = follow_ssa_edge_in_condition_phi_branch (0, loop, condition_phi,
@@ -1297,10 +1304,11 @@ follow_ssa_edge_in_condition_phi (struct loop *loop,
*evolution_of_loop = evolution_of_branch;
/* If the phi node is just a copy, do not increase the limit. */
- if (PHI_NUM_ARGS (condition_phi) > 1)
+ n = gimple_phi_num_args (condition_phi);
+ if (n > 1)
limit++;
- for (i = 1; i < PHI_NUM_ARGS (condition_phi); i++)
+ for (i = 1; i < n; i++)
{
/* Quickly give up when the evolution of one of the branches is
not known. */
@@ -1328,8 +1336,8 @@ follow_ssa_edge_in_condition_phi (struct loop *loop,
static t_bool
follow_ssa_edge_inner_loop_phi (struct loop *outer_loop,
- tree loop_phi_node,
- tree halting_phi,
+ gimple loop_phi_node,
+ gimple halting_phi,
tree *evolution_of_loop, int limit)
{
struct loop *loop = loop_containing_stmt (loop_phi_node);
@@ -1340,19 +1348,19 @@ follow_ssa_edge_inner_loop_phi (struct loop *outer_loop,
if (ev == PHI_RESULT (loop_phi_node))
{
t_bool res = t_false;
- int i;
+ int i, n = gimple_phi_num_args (loop_phi_node);
- for (i = 0; i < PHI_NUM_ARGS (loop_phi_node); i++)
+ for (i = 0; i < n; i++)
{
tree arg = PHI_ARG_DEF (loop_phi_node, i);
basic_block bb;
/* Follow the edges that exit the inner loop. */
- bb = PHI_ARG_EDGE (loop_phi_node, i)->src;
+ bb = gimple_phi_arg_edge (loop_phi_node, i)->src;
if (!flow_bb_inside_loop_p (loop, bb))
- res = follow_ssa_edge_in_rhs (outer_loop, loop_phi_node,
- arg, halting_phi,
- evolution_of_loop, limit);
+ res = follow_ssa_edge_expr (outer_loop, loop_phi_node,
+ arg, halting_phi,
+ evolution_of_loop, limit);
if (res == t_true)
break;
}
@@ -1366,20 +1374,20 @@ follow_ssa_edge_inner_loop_phi (struct loop *outer_loop,
/* Otherwise, compute the overall effect of the inner loop. */
ev = compute_overall_effect_of_inner_loop (loop, ev);
- return follow_ssa_edge_in_rhs (outer_loop, loop_phi_node, ev, halting_phi,
- evolution_of_loop, limit);
+ return follow_ssa_edge_expr (outer_loop, loop_phi_node, ev, halting_phi,
+ evolution_of_loop, limit);
}
/* Follow an SSA edge from a loop-phi-node to itself, constructing a
path that is analyzed on the return walk. */
static t_bool
-follow_ssa_edge (struct loop *loop, tree def, tree halting_phi,
+follow_ssa_edge (struct loop *loop, gimple def, gimple halting_phi,
tree *evolution_of_loop, int limit)
{
struct loop *def_loop;
- if (TREE_CODE (def) == NOP_EXPR)
+ if (gimple_nop_p (def))
return t_false;
/* Give up if the path is longer than the MAX that we allow. */
@@ -1388,9 +1396,9 @@ follow_ssa_edge (struct loop *loop, tree def, tree halting_phi,
def_loop = loop_containing_stmt (def);
- switch (TREE_CODE (def))
+ switch (gimple_code (def))
{
- case PHI_NODE:
+ case GIMPLE_PHI:
if (!loop_phi_node_p (def))
/* DEF is a condition-phi-node. Follow the branches, and
record their evolutions. Finally, merge the collected
@@ -1419,15 +1427,13 @@ follow_ssa_edge (struct loop *loop, tree def, tree halting_phi,
/* Outer loop. */
return t_false;
- case GIMPLE_MODIFY_STMT:
- return follow_ssa_edge_in_rhs (loop, def,
- GIMPLE_STMT_OPERAND (def, 1),
- halting_phi,
+ case GIMPLE_ASSIGN:
+ return follow_ssa_edge_in_rhs (loop, def, halting_phi,
evolution_of_loop, limit);
default:
/* At this level of abstraction, the program is just a set
- of GIMPLE_MODIFY_STMTs and PHI_NODEs. In principle there is no
+ of GIMPLE_ASSIGNs and PHI_NODEs. In principle there is no
other node to be handled. */
return t_false;
}
@@ -1439,10 +1445,10 @@ follow_ssa_edge (struct loop *loop, tree def, tree halting_phi,
function from LOOP_PHI_NODE to LOOP_PHI_NODE in the loop. */
static tree
-analyze_evolution_in_loop (tree loop_phi_node,
+analyze_evolution_in_loop (gimple loop_phi_node,
tree init_cond)
{
- int i;
+ int i, n = gimple_phi_num_args (loop_phi_node);
tree evolution_function = chrec_not_analyzed_yet;
struct loop *loop = loop_containing_stmt (loop_phi_node);
basic_block bb;
@@ -1451,18 +1457,19 @@ analyze_evolution_in_loop (tree loop_phi_node,
{
fprintf (dump_file, "(analyze_evolution_in_loop \n");
fprintf (dump_file, " (loop_phi_node = ");
- print_generic_expr (dump_file, loop_phi_node, 0);
+ print_gimple_stmt (dump_file, loop_phi_node, 0, 0);
fprintf (dump_file, ")\n");
}
- for (i = 0; i < PHI_NUM_ARGS (loop_phi_node); i++)
+ for (i = 0; i < n; i++)
{
tree arg = PHI_ARG_DEF (loop_phi_node, i);
- tree ssa_chain, ev_fn;
+ gimple ssa_chain;
+ tree ev_fn;
t_bool res;
/* Select the edges that enter the loop body. */
- bb = PHI_ARG_EDGE (loop_phi_node, i)->src;
+ bb = gimple_phi_arg_edge (loop_phi_node, i)->src;
if (!flow_bb_inside_loop_p (loop, bb))
continue;
@@ -1509,24 +1516,25 @@ analyze_evolution_in_loop (tree loop_phi_node,
loop, and leaves this task to the on-demand tree reconstructor. */
static tree
-analyze_initial_condition (tree loop_phi_node)
+analyze_initial_condition (gimple loop_phi_node)
{
- int i;
+ int i, n;
tree init_cond = chrec_not_analyzed_yet;
- struct loop *loop = bb_for_stmt (loop_phi_node)->loop_father;
+ struct loop *loop = loop_containing_stmt (loop_phi_node);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "(analyze_initial_condition \n");
fprintf (dump_file, " (loop_phi_node = \n");
- print_generic_expr (dump_file, loop_phi_node, 0);
+ print_gimple_stmt (dump_file, loop_phi_node, 0, 0);
fprintf (dump_file, ")\n");
}
- for (i = 0; i < PHI_NUM_ARGS (loop_phi_node); i++)
+ n = gimple_phi_num_args (loop_phi_node);
+ for (i = 0; i < n; i++)
{
tree branch = PHI_ARG_DEF (loop_phi_node, i);
- basic_block bb = PHI_ARG_EDGE (loop_phi_node, i)->src;
+ basic_block bb = gimple_phi_arg_edge (loop_phi_node, i)->src;
/* When the branch is oriented to the loop's body, it does
not contribute to the initial condition. */
@@ -1565,7 +1573,7 @@ analyze_initial_condition (tree loop_phi_node)
/* Analyze the scalar evolution for LOOP_PHI_NODE. */
static tree
-interpret_loop_phi (struct loop *loop, tree loop_phi_node)
+interpret_loop_phi (struct loop *loop, gimple loop_phi_node)
{
tree res;
struct loop *phi_loop = loop_containing_stmt (loop_phi_node);
@@ -1597,12 +1605,12 @@ interpret_loop_phi (struct loop *loop, tree loop_phi_node)
analyzed. */
static tree
-interpret_condition_phi (struct loop *loop, tree condition_phi)
+interpret_condition_phi (struct loop *loop, gimple condition_phi)
{
- int i;
+ int i, n = gimple_phi_num_args (condition_phi);
tree res = chrec_not_analyzed_yet;
- for (i = 0; i < PHI_NUM_ARGS (condition_phi); i++)
+ for (i = 0; i < n; i++)
{
tree branch_chrec;
@@ -1621,88 +1629,83 @@ interpret_condition_phi (struct loop *loop, tree condition_phi)
return res;
}
-/* Interpret the right hand side of a GIMPLE_MODIFY_STMT OPND1. If we didn't
+/* Interpret the operation RHS1 OP RHS2. If we didn't
analyze this node before, follow the definitions until ending
- either on an analyzed GIMPLE_MODIFY_STMT, or on a loop-phi-node. On the
+ either on an analyzed GIMPLE_ASSIGN, or on a loop-phi-node. On the
return path, this function propagates evolutions (ala constant copy
propagation). OPND1 is not a GIMPLE expression because we could
analyze the effect of an inner loop: see interpret_loop_phi. */
static tree
-interpret_rhs_modify_stmt (struct loop *loop, tree at_stmt,
- tree opnd1, tree type)
+interpret_rhs_expr (struct loop *loop, gimple at_stmt,
+ tree type, tree rhs1, enum tree_code code, tree rhs2)
{
- tree res, opnd10, opnd11, chrec10, chrec11;
+ tree res, chrec1, chrec2;
+
+ if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS)
+ {
+ if (is_gimple_min_invariant (rhs1))
+ return chrec_convert (type, rhs1, at_stmt);
+
+ if (code == SSA_NAME)
+ return chrec_convert (type, analyze_scalar_evolution (loop, rhs1),
+ at_stmt);
- if (is_gimple_min_invariant (opnd1))
- return chrec_convert (type, opnd1, at_stmt);
+ if (code == ASSERT_EXPR)
+ {
+ rhs1 = ASSERT_EXPR_VAR (rhs1);
+ return chrec_convert (type, analyze_scalar_evolution (loop, rhs1),
+ at_stmt);
+ }
+
+ return chrec_dont_know;
+ }
- switch (TREE_CODE (opnd1))
+ switch (code)
{
case POINTER_PLUS_EXPR:
- opnd10 = TREE_OPERAND (opnd1, 0);
- opnd11 = TREE_OPERAND (opnd1, 1);
- chrec10 = analyze_scalar_evolution (loop, opnd10);
- chrec11 = analyze_scalar_evolution (loop, opnd11);
- chrec10 = chrec_convert (type, chrec10, at_stmt);
- chrec11 = chrec_convert (sizetype, chrec11, at_stmt);
- res = chrec_fold_plus (type, chrec10, chrec11);
+ chrec1 = analyze_scalar_evolution (loop, rhs1);
+ chrec2 = analyze_scalar_evolution (loop, rhs2);
+ chrec1 = chrec_convert (type, chrec1, at_stmt);
+ chrec2 = chrec_convert (sizetype, chrec2, at_stmt);
+ res = chrec_fold_plus (type, chrec1, chrec2);
break;
case PLUS_EXPR:
- opnd10 = TREE_OPERAND (opnd1, 0);
- opnd11 = TREE_OPERAND (opnd1, 1);
- chrec10 = analyze_scalar_evolution (loop, opnd10);
- chrec11 = analyze_scalar_evolution (loop, opnd11);
- chrec10 = chrec_convert (type, chrec10, at_stmt);
- chrec11 = chrec_convert (type, chrec11, at_stmt);
- res = chrec_fold_plus (type, chrec10, chrec11);
+ chrec1 = analyze_scalar_evolution (loop, rhs1);
+ chrec2 = analyze_scalar_evolution (loop, rhs2);
+ chrec1 = chrec_convert (type, chrec1, at_stmt);
+ chrec2 = chrec_convert (type, chrec2, at_stmt);
+ res = chrec_fold_plus (type, chrec1, chrec2);
break;
case MINUS_EXPR:
- opnd10 = TREE_OPERAND (opnd1, 0);
- opnd11 = TREE_OPERAND (opnd1, 1);
- chrec10 = analyze_scalar_evolution (loop, opnd10);
- chrec11 = analyze_scalar_evolution (loop, opnd11);
- chrec10 = chrec_convert (type, chrec10, at_stmt);
- chrec11 = chrec_convert (type, chrec11, at_stmt);
- res = chrec_fold_minus (type, chrec10, chrec11);
+ chrec1 = analyze_scalar_evolution (loop, rhs1);
+ chrec2 = analyze_scalar_evolution (loop, rhs2);
+ chrec1 = chrec_convert (type, chrec1, at_stmt);
+ chrec2 = chrec_convert (type, chrec2, at_stmt);
+ res = chrec_fold_minus (type, chrec1, chrec2);
break;
case NEGATE_EXPR:
- opnd10 = TREE_OPERAND (opnd1, 0);
- chrec10 = analyze_scalar_evolution (loop, opnd10);
- chrec10 = chrec_convert (type, chrec10, at_stmt);
+ chrec1 = analyze_scalar_evolution (loop, rhs1);
+ chrec1 = chrec_convert (type, chrec1, at_stmt);
/* TYPE may be integer, real or complex, so use fold_convert. */
- res = chrec_fold_multiply (type, chrec10,
+ res = chrec_fold_multiply (type, chrec1,
fold_convert (type, integer_minus_one_node));
break;
case MULT_EXPR:
- opnd10 = TREE_OPERAND (opnd1, 0);
- opnd11 = TREE_OPERAND (opnd1, 1);
- chrec10 = analyze_scalar_evolution (loop, opnd10);
- chrec11 = analyze_scalar_evolution (loop, opnd11);
- chrec10 = chrec_convert (type, chrec10, at_stmt);
- chrec11 = chrec_convert (type, chrec11, at_stmt);
- res = chrec_fold_multiply (type, chrec10, chrec11);
- break;
-
- case SSA_NAME:
- res = chrec_convert (type, analyze_scalar_evolution (loop, opnd1),
- at_stmt);
- break;
-
- case ASSERT_EXPR:
- opnd10 = ASSERT_EXPR_VAR (opnd1);
- res = chrec_convert (type, analyze_scalar_evolution (loop, opnd10),
- at_stmt);
+ chrec1 = analyze_scalar_evolution (loop, rhs1);
+ chrec2 = analyze_scalar_evolution (loop, rhs2);
+ chrec1 = chrec_convert (type, chrec1, at_stmt);
+ chrec2 = chrec_convert (type, chrec2, at_stmt);
+ res = chrec_fold_multiply (type, chrec1, chrec2);
break;
CASE_CONVERT:
- opnd10 = TREE_OPERAND (opnd1, 0);
- chrec10 = analyze_scalar_evolution (loop, opnd10);
- res = chrec_convert (type, chrec10, at_stmt);
+ chrec1 = analyze_scalar_evolution (loop, rhs1);
+ res = chrec_convert (type, chrec1, at_stmt);
break;
default:
@@ -1713,6 +1716,39 @@ interpret_rhs_modify_stmt (struct loop *loop, tree at_stmt,
return res;
}
+/* Interpret the expression EXPR. */
+
+static tree
+interpret_expr (struct loop *loop, gimple at_stmt, tree expr)
+{
+ enum tree_code code;
+ tree type = TREE_TYPE (expr), op0, op1;
+
+ if (automatically_generated_chrec_p (expr))
+ return expr;
+
+ if (TREE_CODE (expr) == POLYNOMIAL_CHREC)
+ return chrec_dont_know;
+
+ extract_ops_from_tree (expr, &code, &op0, &op1);
+
+ return interpret_rhs_expr (loop, at_stmt, type,
+ op0, code, op1);
+}
+
+/* Interpret the rhs of the assignment STMT. */
+
+static tree
+interpret_gimple_assign (struct loop *loop, gimple stmt)
+{
+ tree type = TREE_TYPE (gimple_assign_lhs (stmt));
+ enum tree_code code = gimple_assign_rhs_code (stmt);
+
+ return interpret_rhs_expr (loop, stmt, type,
+ gimple_assign_rhs1 (stmt), code,
+ gimple_assign_rhs2 (stmt));
+}
+
/* This section contains all the entry points:
@@ -1744,7 +1780,8 @@ compute_scalar_evolution_in_loop (struct loop *wrto_loop,
static tree
analyze_scalar_evolution_1 (struct loop *loop, tree var, tree res)
{
- tree def, type = TREE_TYPE (var);
+ tree type = TREE_TYPE (var);
+ gimple def;
basic_block bb;
struct loop *def_loop;
@@ -1752,10 +1789,10 @@ analyze_scalar_evolution_1 (struct loop *loop, tree var, tree res)
return chrec_dont_know;
if (TREE_CODE (var) != SSA_NAME)
- return interpret_rhs_modify_stmt (loop, NULL_TREE, var, type);
+ return interpret_expr (loop, NULL, var);
def = SSA_NAME_DEF_STMT (var);
- bb = bb_for_stmt (def);
+ bb = gimple_bb (def);
def_loop = bb ? bb->loop_father : NULL;
if (bb == NULL
@@ -1783,14 +1820,13 @@ analyze_scalar_evolution_1 (struct loop *loop, tree var, tree res)
goto set_and_end;
}
- switch (TREE_CODE (def))
+ switch (gimple_code (def))
{
- case GIMPLE_MODIFY_STMT:
- res = interpret_rhs_modify_stmt (loop, def,
- GIMPLE_STMT_OPERAND (def, 1), type);
+ case GIMPLE_ASSIGN:
+ res = interpret_gimple_assign (loop, def);
break;
- case PHI_NODE:
+ case GIMPLE_PHI:
if (loop_phi_node_p (def))
res = interpret_loop_phi (loop, def);
else
@@ -1845,9 +1881,6 @@ analyze_scalar_evolution (struct loop *loop, tree var)
res = analyze_scalar_evolution_1 (loop, var, get_scalar_evolution (var));
- if (TREE_CODE (var) == SSA_NAME && res == chrec_dont_know)
- res = var;
-
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, ")\n");
@@ -1934,7 +1967,8 @@ loop_closed_phi_def (tree var)
{
struct loop *loop;
edge exit;
- tree phi;
+ gimple phi;
+ gimple_stmt_iterator psi;
if (var == NULL_TREE
|| TREE_CODE (var) != SSA_NAME)
@@ -1945,9 +1979,12 @@ loop_closed_phi_def (tree var)
if (!exit)
return NULL_TREE;
- for (phi = phi_nodes (exit->dest); phi; phi = PHI_CHAIN (phi))
- if (PHI_ARG_DEF_FROM_EDGE (phi, exit) == var)
- return PHI_RESULT (phi);
+ for (psi = gsi_start_phis (exit->dest); !gsi_end_p (psi); gsi_next (&psi))
+ {
+ phi = gsi_stmt (psi);
+ if (PHI_ARG_DEF_FROM_EDGE (phi, exit) == var)
+ return PHI_RESULT (phi);
+ }
return NULL_TREE;
}
@@ -1987,7 +2024,7 @@ instantiate_scev_1 (struct loop *instantiation_loop,
switch (TREE_CODE (chrec))
{
case SSA_NAME:
- def_bb = bb_for_stmt (SSA_NAME_DEF_STMT (chrec));
+ def_bb = gimple_bb (SSA_NAME_DEF_STMT (chrec));
/* A parameter (or loop invariant and we do not want to include
evolutions in outer loops), nothing to do. */
@@ -2073,7 +2110,7 @@ instantiate_scev_1 (struct loop *instantiation_loop,
if (CHREC_LEFT (chrec) != op0
|| CHREC_RIGHT (chrec) != op1)
{
- op1 = chrec_convert_rhs (chrec_type (op0), op1, NULL_TREE);
+ op1 = chrec_convert_rhs (chrec_type (op0), op1, NULL);
chrec = build_polynomial_chrec (CHREC_VARIABLE (chrec), op0, op1);
}
return chrec;
@@ -2095,8 +2132,8 @@ instantiate_scev_1 (struct loop *instantiation_loop,
if (TREE_OPERAND (chrec, 0) != op0
|| TREE_OPERAND (chrec, 1) != op1)
{
- op0 = chrec_convert (type, op0, NULL_TREE);
- op1 = chrec_convert_rhs (type, op1, NULL_TREE);
+ op0 = chrec_convert (type, op0, NULL);
+ op1 = chrec_convert_rhs (type, op1, NULL);
chrec = chrec_fold_plus (type, op0, op1);
}
return chrec;
@@ -2117,8 +2154,8 @@ instantiate_scev_1 (struct loop *instantiation_loop,
if (TREE_OPERAND (chrec, 0) != op0
|| TREE_OPERAND (chrec, 1) != op1)
{
- op0 = chrec_convert (type, op0, NULL_TREE);
- op1 = chrec_convert (type, op1, NULL_TREE);
+ op0 = chrec_convert (type, op0, NULL);
+ op1 = chrec_convert (type, op1, NULL);
chrec = chrec_fold_minus (type, op0, op1);
}
return chrec;
@@ -2139,8 +2176,8 @@ instantiate_scev_1 (struct loop *instantiation_loop,
if (TREE_OPERAND (chrec, 0) != op0
|| TREE_OPERAND (chrec, 1) != op1)
{
- op0 = chrec_convert (type, op0, NULL_TREE);
- op1 = chrec_convert (type, op1, NULL_TREE);
+ op0 = chrec_convert (type, op0, NULL);
+ op1 = chrec_convert (type, op1, NULL);
chrec = chrec_fold_multiply (type, op0, op1);
}
return chrec;
@@ -2168,7 +2205,7 @@ instantiate_scev_1 (struct loop *instantiation_loop,
if (fold_conversions)
return fold_convert (TREE_TYPE (chrec), op0);
- return chrec_convert (TREE_TYPE (chrec), op0, NULL_TREE);
+ return chrec_convert (TREE_TYPE (chrec), op0, NULL);
case SCEV_NOT_KNOWN:
return chrec_dont_know;
@@ -2388,14 +2425,14 @@ number_of_exit_cond_executions (struct loop *loop)
from the EXIT_CONDITIONS array. */
static void
-number_of_iterations_for_all_loops (VEC(tree,heap) **exit_conditions)
+number_of_iterations_for_all_loops (VEC(gimple,heap) **exit_conditions)
{
unsigned int i;
unsigned nb_chrec_dont_know_loops = 0;
unsigned nb_static_loops = 0;
- tree cond;
+ gimple cond;
- for (i = 0; VEC_iterate (tree, *exit_conditions, i, cond); i++)
+ for (i = 0; VEC_iterate (gimple, *exit_conditions, i, cond); i++)
{
tree res = number_of_latch_executions (loop_containing_stmt (cond));
if (chrec_contains_undetermined (res))
@@ -2540,33 +2577,37 @@ gather_chrec_stats (tree chrec, struct chrec_stats *stats)
index. This allows the parallelization of the loop. */
static void
-analyze_scalar_evolution_for_all_loop_phi_nodes (VEC(tree,heap) **exit_conditions)
+analyze_scalar_evolution_for_all_loop_phi_nodes (VEC(gimple,heap) **exit_conditions)
{
unsigned int i;
struct chrec_stats stats;
- tree cond;
+ gimple cond, phi;
+ gimple_stmt_iterator psi;
reset_chrecs_counters (&stats);
- for (i = 0; VEC_iterate (tree, *exit_conditions, i, cond); i++)
+ for (i = 0; VEC_iterate (gimple, *exit_conditions, i, cond); i++)
{
struct loop *loop;
basic_block bb;
- tree phi, chrec;
+ tree chrec;
loop = loop_containing_stmt (cond);
bb = loop->header;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- if (is_gimple_reg (PHI_RESULT (phi)))
- {
- chrec = instantiate_parameters
- (loop,
- analyze_scalar_evolution (loop, PHI_RESULT (phi)));
+ for (psi = gsi_start_phis (bb); !gsi_end_p (psi); gsi_next (&psi))
+ {
+ phi = gsi_stmt (psi);
+ if (is_gimple_reg (PHI_RESULT (phi)))
+ {
+ chrec = instantiate_parameters
+ (loop,
+ analyze_scalar_evolution (loop, PHI_RESULT (phi)));
- if (dump_file && (dump_flags & TDF_STATS))
- gather_chrec_stats (chrec, &stats);
- }
+ if (dump_file && (dump_flags & TDF_STATS))
+ gather_chrec_stats (chrec, &stats);
+ }
+ }
}
if (dump_file && (dump_flags & TDF_STATS))
@@ -2671,10 +2712,10 @@ scev_reset (void)
overflow (e.g. because it is computed in signed arithmetics). */
bool
-simple_iv (struct loop *loop, tree stmt, tree op, affine_iv *iv,
+simple_iv (struct loop *loop, gimple stmt, tree op, affine_iv *iv,
bool allow_nonconstant_step)
{
- basic_block bb = bb_for_stmt (stmt);
+ basic_block bb = gimple_bb (stmt);
tree type, ev;
bool folded_casts;
@@ -2730,16 +2771,16 @@ simple_iv (struct loop *loop, tree stmt, tree op, affine_iv *iv,
void
scev_analysis (void)
{
- VEC(tree,heap) *exit_conditions;
+ VEC(gimple,heap) *exit_conditions;
- exit_conditions = VEC_alloc (tree, heap, 37);
+ exit_conditions = VEC_alloc (gimple, heap, 37);
select_loops_exit_conditions (&exit_conditions);
if (dump_file && (dump_flags & TDF_STATS))
analyze_scalar_evolution_for_all_loop_phi_nodes (&exit_conditions);
number_of_iterations_for_all_loops (&exit_conditions);
- VEC_free (tree, heap, exit_conditions);
+ VEC_free (gimple, heap, exit_conditions);
}
/* Finalize the scalar evolution analysis. */
@@ -2765,11 +2806,13 @@ unsigned int
scev_const_prop (void)
{
basic_block bb;
- tree name, phi, next_phi, type, ev;
+ tree name, type, ev;
+ gimple phi, ass;
struct loop *loop, *ex_loop;
bitmap ssa_names_to_remove = NULL;
unsigned i;
loop_iterator li;
+ gimple_stmt_iterator psi;
if (number_of_loops () <= 1)
return 0;
@@ -2778,8 +2821,9 @@ scev_const_prop (void)
{
loop = bb->loop_father;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (psi = gsi_start_phis (bb); !gsi_end_p (psi); gsi_next (&psi))
{
+ phi = gsi_stmt (psi);
name = PHI_RESULT (phi);
if (!is_gimple_reg (name))
@@ -2815,11 +2859,13 @@ scev_const_prop (void)
EXECUTE_IF_SET_IN_BITMAP (ssa_names_to_remove, 0, i, bi)
{
+ gimple_stmt_iterator psi;
name = ssa_name (i);
phi = SSA_NAME_DEF_STMT (name);
- gcc_assert (TREE_CODE (phi) == PHI_NODE);
- remove_phi_node (phi, NULL, true);
+ gcc_assert (gimple_code (phi) == GIMPLE_PHI);
+ psi = gsi_for_stmt (phi);
+ remove_phi_node (&psi, true);
}
BITMAP_FREE (ssa_names_to_remove);
@@ -2830,8 +2876,8 @@ scev_const_prop (void)
FOR_EACH_LOOP (li, loop, LI_FROM_INNERMOST)
{
edge exit;
- tree def, rslt, ass, niter;
- block_stmt_iterator bsi;
+ tree def, rslt, niter;
+ gimple_stmt_iterator bsi;
/* If we do not know exact number of iterations of the loop, we cannot
replace the final value. */
@@ -2852,22 +2898,28 @@ scev_const_prop (void)
/* Ensure that it is possible to insert new statements somewhere. */
if (!single_pred_p (exit->dest))
split_loop_exit_edge (exit);
- bsi = bsi_after_labels (exit->dest);
+ bsi = gsi_after_labels (exit->dest);
ex_loop = superloop_at_depth (loop,
loop_depth (exit->dest->loop_father) + 1);
- for (phi = phi_nodes (exit->dest); phi; phi = next_phi)
+ for (psi = gsi_start_phis (exit->dest); !gsi_end_p (psi); )
{
- next_phi = PHI_CHAIN (phi);
+ phi = gsi_stmt (psi);
rslt = PHI_RESULT (phi);
def = PHI_ARG_DEF_FROM_EDGE (phi, exit);
if (!is_gimple_reg (def))
- continue;
+ {
+ gsi_next (&psi);
+ continue;
+ }
if (!POINTER_TYPE_P (TREE_TYPE (def))
&& !INTEGRAL_TYPE_P (TREE_TYPE (def)))
- continue;
+ {
+ gsi_next (&psi);
+ continue;
+ }
def = analyze_scalar_evolution_in_loop (ex_loop, loop, def, NULL);
def = compute_overall_effect_of_inner_loop (ex_loop, def);
@@ -2877,23 +2929,20 @@ scev_const_prop (void)
of some ssa names, which may cause problems if they appear
on abnormal edges. */
|| contains_abnormal_ssa_name_p (def))
- continue;
+ {
+ gsi_next (&psi);
+ continue;
+ }
/* Eliminate the PHI node and replace it by a computation outside
the loop. */
def = unshare_expr (def);
- remove_phi_node (phi, NULL_TREE, false);
-
- ass = build_gimple_modify_stmt (rslt, NULL_TREE);
- SSA_NAME_DEF_STMT (rslt) = ass;
- {
- block_stmt_iterator dest = bsi;
- bsi_insert_before (&dest, ass, BSI_NEW_STMT);
- def = force_gimple_operand_bsi (&dest, def, false, NULL_TREE,
- true, BSI_SAME_STMT);
- }
- GIMPLE_STMT_OPERAND (ass, 1) = def;
- update_stmt (ass);
+ remove_phi_node (&psi, false);
+
+ def = force_gimple_operand_gsi (&bsi, def, false, NULL_TREE,
+ true, GSI_SAME_STMT);
+ ass = gimple_build_assign (rslt, def);
+ gsi_insert_before (&bsi, ass, GSI_SAME_STMT);
}
}
return 0;
diff --git a/gcc/tree-scalar-evolution.h b/gcc/tree-scalar-evolution.h
index 472b194d307..5d6d711afa9 100644
--- a/gcc/tree-scalar-evolution.h
+++ b/gcc/tree-scalar-evolution.h
@@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see
extern tree number_of_latch_executions (struct loop *);
extern tree number_of_exit_cond_executions (struct loop *);
-extern tree get_loop_exit_condition (const struct loop *);
+extern gimple get_loop_exit_condition (const struct loop *);
extern void scev_initialize (void);
extern void scev_reset (void);
@@ -35,7 +35,7 @@ extern void gather_stats_on_scev_database (void);
extern void scev_analysis (void);
unsigned int scev_const_prop (void);
-extern bool simple_iv (struct loop *, tree, tree, affine_iv *, bool);
+extern bool simple_iv (struct loop *, gimple, tree, affine_iv *, bool);
/* Analyze all the parameters of the chrec that were left under a
symbolic form. LOOP is the loop in which symbolic names have to
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 21cf367b23a..abe0c9f530d 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
#include "tree-inline.h"
#include "tree-flow.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-dump.h"
#include "tree-pass.h"
#include "timevar.h"
@@ -208,8 +208,9 @@ extern void debug_sra_elt_name (struct sra_elt *);
/* Forward declarations. */
static tree generate_element_ref (struct sra_elt *);
-static tree sra_build_assignment (tree dst, tree src);
-static void mark_all_v_defs (tree list);
+static gimple_seq sra_build_assignment (tree dst, tree src);
+static void mark_all_v_defs_seq (gimple_seq);
+static void mark_all_v_defs_stmt (gimple);
/* Return true if DECL is an SRA candidate. */
@@ -719,7 +720,7 @@ maybe_lookup_element_for_expr (tree expr)
references, and categorize them. */
/* A set of callbacks for phases 2 and 4. They'll be invoked for the
- various kinds of references seen. In all cases, *BSI is an iterator
+ various kinds of references seen. In all cases, *GSI is an iterator
pointing to the statement being processed. */
struct sra_walk_fns
{
@@ -729,21 +730,21 @@ struct sra_walk_fns
is a left-hand-side reference. USE_ALL is true if we saw something we
couldn't quite identify and had to force the use of the entire object. */
void (*use) (struct sra_elt *elt, tree *expr_p,
- block_stmt_iterator *bsi, bool is_output, bool use_all);
+ gimple_stmt_iterator *gsi, bool is_output, bool use_all);
/* Invoked when we have a copy between two scalarizable references. */
void (*copy) (struct sra_elt *lhs_elt, struct sra_elt *rhs_elt,
- block_stmt_iterator *bsi);
+ gimple_stmt_iterator *gsi);
/* Invoked when ELT is initialized from a constant. VALUE may be NULL,
in which case it should be treated as an empty CONSTRUCTOR. */
- void (*init) (struct sra_elt *elt, tree value, block_stmt_iterator *bsi);
+ void (*init) (struct sra_elt *elt, tree value, gimple_stmt_iterator *gsi);
/* Invoked when we have a copy between one scalarizable reference ELT
and one non-scalarizable reference OTHER without side-effects.
IS_OUTPUT is true if ELT is on the left-hand side. */
void (*ldst) (struct sra_elt *elt, tree other,
- block_stmt_iterator *bsi, bool is_output);
+ gimple_stmt_iterator *gsi, bool is_output);
/* True during phase 2, false during phase 4. */
/* ??? This is a hack. */
@@ -777,7 +778,7 @@ sra_find_candidate_decl (tree *tp, int *walk_subtrees,
If we find one, invoke FNS->USE. */
static void
-sra_walk_expr (tree *expr_p, block_stmt_iterator *bsi, bool is_output,
+sra_walk_expr (tree *expr_p, gimple_stmt_iterator *gsi, bool is_output,
const struct sra_walk_fns *fns)
{
tree expr = *expr_p;
@@ -804,7 +805,7 @@ sra_walk_expr (tree *expr_p, block_stmt_iterator *bsi, bool is_output,
if (disable_scalarization)
elt->cannot_scalarize = true;
else
- fns->use (elt, expr_p, bsi, is_output, use_all_p);
+ fns->use (elt, expr_p, gsi, is_output, use_all_p);
}
return;
@@ -880,7 +881,7 @@ sra_walk_expr (tree *expr_p, block_stmt_iterator *bsi, bool is_output,
outer element, to which walk_tree will bring us next. */
goto use_all;
- case NOP_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;
@@ -916,60 +917,62 @@ sra_walk_expr (tree *expr_p, block_stmt_iterator *bsi, bool is_output,
}
}
-/* Walk a TREE_LIST of values looking for scalarizable aggregates.
+/* Walk the arguments of a GIMPLE_CALL looking for scalarizable aggregates.
If we find one, invoke FNS->USE. */
static void
-sra_walk_tree_list (tree list, block_stmt_iterator *bsi, bool is_output,
- const struct sra_walk_fns *fns)
-{
- tree op;
- for (op = list; op ; op = TREE_CHAIN (op))
- sra_walk_expr (&TREE_VALUE (op), bsi, is_output, fns);
-}
-
-/* Walk the arguments of a CALL_EXPR looking for scalarizable aggregates.
- If we find one, invoke FNS->USE. */
-
-static void
-sra_walk_call_expr (tree expr, block_stmt_iterator *bsi,
+sra_walk_gimple_call (gimple stmt, gimple_stmt_iterator *gsi,
const struct sra_walk_fns *fns)
{
int i;
- int nargs = call_expr_nargs (expr);
+ int nargs = gimple_call_num_args (stmt);
+
for (i = 0; i < nargs; i++)
- sra_walk_expr (&CALL_EXPR_ARG (expr, i), bsi, false, fns);
+ sra_walk_expr (gimple_call_arg_ptr (stmt, i), gsi, false, fns);
+
+ if (gimple_call_lhs (stmt))
+ sra_walk_expr (gimple_call_lhs_ptr (stmt), gsi, true, fns);
}
-/* Walk the inputs and outputs of an ASM_EXPR looking for scalarizable
+/* Walk the inputs and outputs of a GIMPLE_ASM looking for scalarizable
aggregates. If we find one, invoke FNS->USE. */
static void
-sra_walk_asm_expr (tree expr, block_stmt_iterator *bsi,
+sra_walk_gimple_asm (gimple stmt, gimple_stmt_iterator *gsi,
const struct sra_walk_fns *fns)
{
- sra_walk_tree_list (ASM_INPUTS (expr), bsi, false, fns);
- sra_walk_tree_list (ASM_OUTPUTS (expr), bsi, true, fns);
+ size_t i;
+ for (i = 0; i < gimple_asm_ninputs (stmt); i++)
+ sra_walk_expr (&TREE_VALUE (gimple_asm_input_op (stmt, i)), gsi, false, fns);
+ for (i = 0; i < gimple_asm_noutputs (stmt); i++)
+ sra_walk_expr (&TREE_VALUE (gimple_asm_output_op (stmt, i)), gsi, true, fns);
}
-/* Walk a GIMPLE_MODIFY_STMT and categorize the assignment appropriately. */
+/* Walk a GIMPLE_ASSIGN and categorize the assignment appropriately. */
static void
-sra_walk_gimple_modify_stmt (tree expr, block_stmt_iterator *bsi,
- const struct sra_walk_fns *fns)
+sra_walk_gimple_assign (gimple stmt, gimple_stmt_iterator *gsi,
+ const struct sra_walk_fns *fns)
{
- struct sra_elt *lhs_elt, *rhs_elt;
+ struct sra_elt *lhs_elt = NULL, *rhs_elt = NULL;
tree lhs, rhs;
- lhs = GIMPLE_STMT_OPERAND (expr, 0);
- rhs = GIMPLE_STMT_OPERAND (expr, 1);
+ /* If there is more than 1 element on the RHS, only walk the lhs. */
+ if (!gimple_assign_single_p (stmt))
+ {
+ sra_walk_expr (gimple_assign_lhs_ptr (stmt), gsi, true, fns);
+ return;
+ }
+
+ lhs = gimple_assign_lhs (stmt);
+ rhs = gimple_assign_rhs1 (stmt);
lhs_elt = maybe_lookup_element_for_expr (lhs);
rhs_elt = maybe_lookup_element_for_expr (rhs);
/* If both sides are scalarizable, this is a COPY operation. */
if (lhs_elt && rhs_elt)
{
- fns->copy (lhs_elt, rhs_elt, bsi);
+ fns->copy (lhs_elt, rhs_elt, gsi);
return;
}
@@ -977,9 +980,9 @@ sra_walk_gimple_modify_stmt (tree expr, block_stmt_iterator *bsi,
if (rhs_elt)
{
if (!rhs_elt->is_scalar && !TREE_SIDE_EFFECTS (lhs))
- fns->ldst (rhs_elt, lhs, bsi, false);
+ fns->ldst (rhs_elt, lhs, gsi, false);
else
- fns->use (rhs_elt, &GIMPLE_STMT_OPERAND (expr, 1), bsi, false, false);
+ fns->use (rhs_elt, gimple_assign_rhs1_ptr (stmt), gsi, false, false);
}
/* If it isn't scalarizable, there may be scalarizable variables within, so
@@ -988,13 +991,7 @@ sra_walk_gimple_modify_stmt (tree expr, block_stmt_iterator *bsi,
that the statements get inserted in the proper place, before any
copy-out operations. */
else
- {
- tree call = get_call_expr_in (rhs);
- if (call)
- sra_walk_call_expr (call, bsi, fns);
- else
- sra_walk_expr (&GIMPLE_STMT_OPERAND (expr, 1), bsi, false, fns);
- }
+ sra_walk_expr (gimple_assign_rhs1_ptr (stmt), gsi, false, fns);
/* Likewise, handle the LHS being scalarizable. We have cases similar
to those above, but also want to handle RHS being constant. */
@@ -1005,7 +1002,7 @@ sra_walk_gimple_modify_stmt (tree expr, block_stmt_iterator *bsi,
if (TREE_CODE (rhs) == COMPLEX_EXPR
|| TREE_CODE (rhs) == COMPLEX_CST
|| TREE_CODE (rhs) == CONSTRUCTOR)
- fns->init (lhs_elt, rhs, bsi);
+ fns->init (lhs_elt, rhs, gsi);
/* If this is an assignment from read-only memory, treat this as if
we'd been passed the constructor directly. Invoke INIT. */
@@ -1013,7 +1010,7 @@ sra_walk_gimple_modify_stmt (tree expr, block_stmt_iterator *bsi,
&& TREE_STATIC (rhs)
&& TREE_READONLY (rhs)
&& targetm.binds_local_p (rhs))
- fns->init (lhs_elt, DECL_INITIAL (rhs), bsi);
+ fns->init (lhs_elt, DECL_INITIAL (rhs), gsi);
/* If this is a copy from a non-scalarizable lvalue, invoke LDST.
The lvalue requirement prevents us from trying to directly scalarize
@@ -1021,19 +1018,19 @@ sra_walk_gimple_modify_stmt (tree expr, block_stmt_iterator *bsi,
the function multiple times, and other evil things. */
else if (!lhs_elt->is_scalar
&& !TREE_SIDE_EFFECTS (rhs) && is_gimple_addressable (rhs))
- fns->ldst (lhs_elt, rhs, bsi, true);
+ fns->ldst (lhs_elt, rhs, gsi, true);
/* Otherwise we're being used in some context that requires the
aggregate to be seen as a whole. Invoke USE. */
else
- fns->use (lhs_elt, &GIMPLE_STMT_OPERAND (expr, 0), bsi, true, false);
+ fns->use (lhs_elt, gimple_assign_lhs_ptr (stmt), gsi, true, false);
}
/* Similarly to above, LHS_ELT being null only means that the LHS as a
whole is not a scalarizable reference. There may be occurrences of
scalarizable variables within, which implies a USE. */
else
- sra_walk_expr (&GIMPLE_STMT_OPERAND (expr, 0), bsi, true, fns);
+ sra_walk_expr (gimple_assign_lhs_ptr (stmt), gsi, true, fns);
}
/* Entry point to the walk functions. Search the entire function,
@@ -1044,22 +1041,20 @@ static void
sra_walk_function (const struct sra_walk_fns *fns)
{
basic_block bb;
- block_stmt_iterator si, ni;
+ gimple_stmt_iterator si, ni;
/* ??? Phase 4 could derive some benefit to walking the function in
dominator tree order. */
FOR_EACH_BB (bb)
- for (si = bsi_start (bb); !bsi_end_p (si); si = ni)
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); si = ni)
{
- tree stmt, t;
- stmt_ann_t ann;
+ gimple stmt;
- stmt = bsi_stmt (si);
- ann = stmt_ann (stmt);
+ stmt = gsi_stmt (si);
ni = si;
- bsi_next (&ni);
+ gsi_next (&ni);
/* If the statement has no virtual operands, then it doesn't
make any structure references that we care about. */
@@ -1067,35 +1062,28 @@ sra_walk_function (const struct sra_walk_fns *fns)
&& ZERO_SSA_OPERANDS (stmt, (SSA_OP_VIRTUAL_DEFS | SSA_OP_VUSE)))
continue;
- switch (TREE_CODE (stmt))
+ switch (gimple_code (stmt))
{
- case RETURN_EXPR:
+ case GIMPLE_RETURN:
/* If we have "return <retval>" then the return value is
already exposed for our pleasure. Walk it as a USE to
force all the components back in place for the return.
-
- If we have an embedded assignment, then <retval> is of
- a type that gets returned in registers in this ABI, and
- we do not wish to extend their lifetimes. Treat this
- as a USE of the variable on the RHS of this assignment. */
-
- t = TREE_OPERAND (stmt, 0);
- if (t == NULL_TREE)
+ */
+ if (gimple_return_retval (stmt) == NULL_TREE)
;
- else if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
- sra_walk_expr (&GIMPLE_STMT_OPERAND (t, 1), &si, false, fns);
else
- sra_walk_expr (&TREE_OPERAND (stmt, 0), &si, false, fns);
+ sra_walk_expr (gimple_return_retval_ptr (stmt), &si, false,
+ fns);
break;
- case GIMPLE_MODIFY_STMT:
- sra_walk_gimple_modify_stmt (stmt, &si, fns);
+ case GIMPLE_ASSIGN:
+ sra_walk_gimple_assign (stmt, &si, fns);
break;
- case CALL_EXPR:
- sra_walk_call_expr (stmt, &si, fns);
+ case GIMPLE_CALL:
+ sra_walk_gimple_call (stmt, &si, fns);
break;
- case ASM_EXPR:
- sra_walk_asm_expr (stmt, &si, fns);
+ case GIMPLE_ASM:
+ sra_walk_gimple_asm (stmt, &si, fns);
break;
default:
@@ -1136,7 +1124,7 @@ find_candidates_for_sra (void)
static void
scan_use (struct sra_elt *elt, tree *expr_p ATTRIBUTE_UNUSED,
- block_stmt_iterator *bsi ATTRIBUTE_UNUSED,
+ gimple_stmt_iterator *gsi ATTRIBUTE_UNUSED,
bool is_output ATTRIBUTE_UNUSED, bool use_all ATTRIBUTE_UNUSED)
{
elt->n_uses += 1;
@@ -1144,7 +1132,7 @@ scan_use (struct sra_elt *elt, tree *expr_p ATTRIBUTE_UNUSED,
static void
scan_copy (struct sra_elt *lhs_elt, struct sra_elt *rhs_elt,
- block_stmt_iterator *bsi ATTRIBUTE_UNUSED)
+ gimple_stmt_iterator *gsi ATTRIBUTE_UNUSED)
{
lhs_elt->n_copies += 1;
rhs_elt->n_copies += 1;
@@ -1152,14 +1140,14 @@ scan_copy (struct sra_elt *lhs_elt, struct sra_elt *rhs_elt,
static void
scan_init (struct sra_elt *lhs_elt, tree rhs ATTRIBUTE_UNUSED,
- block_stmt_iterator *bsi ATTRIBUTE_UNUSED)
+ gimple_stmt_iterator *gsi ATTRIBUTE_UNUSED)
{
lhs_elt->n_copies += 1;
}
static void
scan_ldst (struct sra_elt *elt, tree other ATTRIBUTE_UNUSED,
- block_stmt_iterator *bsi ATTRIBUTE_UNUSED,
+ gimple_stmt_iterator *gsi ATTRIBUTE_UNUSED,
bool is_output ATTRIBUTE_UNUSED)
{
elt->n_copies += 1;
@@ -1350,10 +1338,12 @@ instantiate_element (struct sra_elt *elt)
|| (var != elt->replacement
&& TREE_CODE (elt->replacement) == BIT_FIELD_REF))
{
- tree init = sra_build_assignment (var, fold_convert (TREE_TYPE (var),
- integer_zero_node));
- insert_edge_copies (init, ENTRY_BLOCK_PTR);
- mark_all_v_defs (init);
+ gimple_seq init = sra_build_assignment (var,
+ fold_convert (TREE_TYPE (var),
+ integer_zero_node)
+ );
+ insert_edge_copies_seq (init, ENTRY_BLOCK_PTR);
+ mark_all_v_defs_seq (init);
}
if (dump_file)
@@ -2030,7 +2020,7 @@ decide_instantiations (void)
non-scalar. */
static void
-mark_all_v_defs_1 (tree stmt)
+mark_all_v_defs_stmt (gimple stmt)
{
tree sym;
ssa_op_iter iter;
@@ -2050,18 +2040,13 @@ mark_all_v_defs_1 (tree stmt)
LIST for renaming. */
static void
-mark_all_v_defs (tree list)
+mark_all_v_defs_seq (gimple_seq seq)
{
- if (TREE_CODE (list) != STATEMENT_LIST)
- mark_all_v_defs_1 (list);
- else
- {
- tree_stmt_iterator i;
- for (i = tsi_start (list); !tsi_end_p (i); tsi_next (&i))
- mark_all_v_defs_1 (tsi_stmt (i));
- }
-}
+ gimple_stmt_iterator gsi;
+ for (gsi = gsi_start (seq); !gsi_end_p (gsi); gsi_next (&gsi))
+ mark_all_v_defs_stmt (gsi_stmt (gsi));
+}
/* Mark every replacement under ELT with TREE_NO_WARNING. */
@@ -2155,9 +2140,11 @@ scalar_bitfield_p (tree bf)
/* Create an assignment statement from SRC to DST. */
-static tree
+static gimple_seq
sra_build_assignment (tree dst, tree src)
{
+ gimple stmt;
+ gimple_seq seq = NULL;
/* Turning BIT_FIELD_REFs into bit operations enables other passes
to do a much better job at optimizing the code.
From dst = BIT_FIELD_REF <var, sz, off> we produce
@@ -2172,7 +2159,6 @@ sra_build_assignment (tree dst, tree src)
{
tree var, shift, width;
tree utype, stype, stmp, utmp, dtmp;
- tree list, stmt;
bool unsignedp = (INTEGRAL_TYPE_P (TREE_TYPE (src))
? TYPE_UNSIGNED (TREE_TYPE (src)) : true);
@@ -2205,7 +2191,6 @@ sra_build_assignment (tree dst, tree src)
else if (!TYPE_UNSIGNED (utype))
utype = unsigned_type_for (utype);
- list = NULL;
stmp = make_rename_temp (stype, "SR");
/* Convert the base var of the BIT_FIELD_REF to the scalar type
@@ -2213,22 +2198,19 @@ sra_build_assignment (tree dst, tree src)
if (!useless_type_conversion_p (stype, TREE_TYPE (var)))
{
if (INTEGRAL_TYPE_P (TREE_TYPE (var)))
- stmt = build_gimple_modify_stmt (stmp,
- fold_convert (stype, var));
+ stmt = gimple_build_assign (stmp, fold_convert (stype, var));
else
- stmt = build_gimple_modify_stmt (stmp,
- fold_build1 (VIEW_CONVERT_EXPR,
- stype, var));
- append_to_statement_list (stmt, &list);
+ stmt = gimple_build_assign (stmp, fold_build1 (VIEW_CONVERT_EXPR,
+ stype, var));
+ gimple_seq_add_stmt (&seq, stmt);
var = stmp;
}
if (!integer_zerop (shift))
{
- stmt = build_gimple_modify_stmt (stmp,
- fold_build2 (RSHIFT_EXPR, stype,
- var, shift));
- append_to_statement_list (stmt, &list);
+ stmt = gimple_build_assign (stmp, fold_build2 (RSHIFT_EXPR, stype,
+ var, shift));
+ gimple_seq_add_stmt (&seq, stmt);
var = stmp;
}
@@ -2241,10 +2223,9 @@ sra_build_assignment (tree dst, tree src)
tree mask = int_const_binop (LSHIFT_EXPR, one, width, 0);
mask = int_const_binop (MINUS_EXPR, mask, one, 0);
- stmt = build_gimple_modify_stmt (stmp,
- fold_build2 (BIT_AND_EXPR, stype,
- var, mask));
- append_to_statement_list (stmt, &list);
+ stmt = gimple_build_assign (stmp, fold_build2 (BIT_AND_EXPR, stype,
+ var, mask));
+ gimple_seq_add_stmt (&seq, stmt);
var = stmp;
}
@@ -2254,8 +2235,8 @@ sra_build_assignment (tree dst, tree src)
{
utmp = make_rename_temp (utype, "SR");
- stmt = build_gimple_modify_stmt (utmp, fold_convert (utype, var));
- append_to_statement_list (stmt, &list);
+ stmt = gimple_build_assign (utmp, fold_convert (utype, var));
+ gimple_seq_add_stmt (&seq, stmt);
var = utmp;
}
@@ -2269,15 +2250,13 @@ sra_build_assignment (tree dst, tree src)
size_binop (MINUS_EXPR, width,
bitsize_int (1)), 0);
- stmt = build_gimple_modify_stmt (utmp,
- fold_build2 (BIT_XOR_EXPR, utype,
- var, signbit));
- append_to_statement_list (stmt, &list);
+ stmt = gimple_build_assign (utmp, fold_build2 (BIT_XOR_EXPR, utype,
+ var, signbit));
+ gimple_seq_add_stmt (&seq, stmt);
- stmt = build_gimple_modify_stmt (utmp,
- fold_build2 (MINUS_EXPR, utype,
- utmp, signbit));
- append_to_statement_list (stmt, &list);
+ stmt = gimple_build_assign (utmp, fold_build2 (MINUS_EXPR, utype,
+ utmp, signbit));
+ gimple_seq_add_stmt (&seq, stmt);
var = utmp;
}
@@ -2298,15 +2277,15 @@ sra_build_assignment (tree dst, tree src)
if (!is_gimple_reg (dst))
{
dtmp = make_rename_temp (TREE_TYPE (dst), "SR");
- stmt = build_gimple_modify_stmt (dtmp, var);
- append_to_statement_list (stmt, &list);
+ stmt = gimple_build_assign (dtmp, var);
+ gimple_seq_add_stmt (&seq, stmt);
var = dtmp;
}
}
- stmt = build_gimple_modify_stmt (dst, var);
- append_to_statement_list (stmt, &list);
+ stmt = gimple_build_assign (dst, var);
+ gimple_seq_add_stmt (&seq, stmt);
- return list;
+ return seq;
}
/* fold_build3 (BIT_FIELD_REF, ...) sometimes returns a cast. */
@@ -2329,7 +2308,9 @@ sra_build_assignment (tree dst, tree src)
&& !useless_type_conversion_p (TREE_TYPE (dst), TREE_TYPE (src)))
src = fold_convert (TREE_TYPE (dst), src);
- return build_gimple_modify_stmt (dst, src);
+ stmt = gimple_build_assign (dst, src);
+ gimple_seq_add_stmt (&seq, stmt);
+ return seq;
}
/* BIT_FIELD_REFs must not be shared. sra_build_elt_assignment()
@@ -2339,11 +2320,12 @@ sra_build_assignment (tree dst, tree src)
/* Emit an assignment from SRC to DST, but if DST is a scalarizable
BIT_FIELD_REF, turn it into bit operations. */
-static tree
+static gimple_seq
sra_build_bf_assignment (tree dst, tree src)
{
tree var, type, utype, tmp, tmp2, tmp3;
- tree list, stmt;
+ gimple_seq seq;
+ gimple stmt;
tree cst, cst2, mask;
tree minshift, maxshift;
@@ -2355,7 +2337,7 @@ sra_build_bf_assignment (tree dst, tree src)
if (!scalar_bitfield_p (dst))
return sra_build_assignment (REPLDUP (dst), src);
- list = NULL;
+ seq = NULL;
cst = fold_convert (bitsizetype, TREE_OPERAND (dst, 2));
cst2 = size_binop (PLUS_EXPR,
@@ -2404,11 +2386,11 @@ sra_build_bf_assignment (tree dst, tree src)
tmp2 = make_rename_temp (utype, "SR");
if (INTEGRAL_TYPE_P (TREE_TYPE (var)))
- stmt = build_gimple_modify_stmt (tmp2, fold_convert (utype, tmp));
+ stmt = gimple_build_assign (tmp2, fold_convert (utype, tmp));
else
- stmt = build_gimple_modify_stmt (tmp2, fold_build1 (VIEW_CONVERT_EXPR,
- utype, tmp));
- append_to_statement_list (stmt, &list);
+ stmt = gimple_build_assign (tmp2, fold_build1 (VIEW_CONVERT_EXPR,
+ utype, tmp));
+ gimple_seq_add_stmt (&seq, stmt);
}
else
tmp2 = var;
@@ -2416,10 +2398,9 @@ sra_build_bf_assignment (tree dst, tree src)
if (!integer_zerop (mask))
{
tmp = make_rename_temp (utype, "SR");
- stmt = build_gimple_modify_stmt (tmp,
- fold_build2 (BIT_AND_EXPR, utype,
+ stmt = gimple_build_assign (tmp, fold_build2 (BIT_AND_EXPR, utype,
tmp2, mask));
- append_to_statement_list (stmt, &list);
+ gimple_seq_add_stmt (&seq, stmt);
}
else
tmp = mask;
@@ -2428,28 +2409,31 @@ sra_build_bf_assignment (tree dst, tree src)
tmp2 = src;
else if (INTEGRAL_TYPE_P (TREE_TYPE (src)))
{
+ gimple_seq tmp_seq;
tmp2 = make_rename_temp (TREE_TYPE (src), "SR");
- stmt = sra_build_assignment (tmp2, src);
- append_to_statement_list (stmt, &list);
+ tmp_seq = sra_build_assignment (tmp2, src);
+ gimple_seq_add_seq (&seq, tmp_seq);
}
else
{
+ gimple_seq tmp_seq;
tmp2 = make_rename_temp
(lang_hooks.types.type_for_size
(TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (src))),
1), "SR");
- stmt = sra_build_assignment (tmp2, fold_build1 (VIEW_CONVERT_EXPR,
+ tmp_seq = sra_build_assignment (tmp2, fold_build1 (VIEW_CONVERT_EXPR,
TREE_TYPE (tmp2), src));
- append_to_statement_list (stmt, &list);
+ gimple_seq_add_seq (&seq, tmp_seq);
}
if (!TYPE_UNSIGNED (TREE_TYPE (tmp2)))
{
+ gimple_seq tmp_seq;
tree ut = unsigned_type_for (TREE_TYPE (tmp2));
tmp3 = make_rename_temp (ut, "SR");
tmp2 = fold_convert (ut, tmp2);
- stmt = sra_build_assignment (tmp3, tmp2);
- append_to_statement_list (stmt, &list);
+ tmp_seq = sra_build_assignment (tmp3, tmp2);
+ gimple_seq_add_seq (&seq, tmp_seq);
tmp2 = fold_build1 (BIT_NOT_EXPR, utype, mask);
tmp2 = int_const_binop (RSHIFT_EXPR, tmp2, minshift, true);
@@ -2459,8 +2443,8 @@ sra_build_bf_assignment (tree dst, tree src)
if (tmp3 != tmp2)
{
tmp3 = make_rename_temp (ut, "SR");
- stmt = sra_build_assignment (tmp3, tmp2);
- append_to_statement_list (stmt, &list);
+ tmp_seq = sra_build_assignment (tmp3, tmp2);
+ gimple_seq_add_seq (&seq, tmp_seq);
}
tmp2 = tmp3;
@@ -2468,20 +2452,20 @@ sra_build_bf_assignment (tree dst, tree src)
if (TYPE_MAIN_VARIANT (TREE_TYPE (tmp2)) != TYPE_MAIN_VARIANT (utype))
{
+ gimple_seq tmp_seq;
tmp3 = make_rename_temp (utype, "SR");
tmp2 = fold_convert (utype, tmp2);
- stmt = sra_build_assignment (tmp3, tmp2);
- append_to_statement_list (stmt, &list);
+ tmp_seq = sra_build_assignment (tmp3, tmp2);
+ gimple_seq_add_seq (&seq, tmp_seq);
tmp2 = tmp3;
}
if (!integer_zerop (minshift))
{
tmp3 = make_rename_temp (utype, "SR");
- stmt = build_gimple_modify_stmt (tmp3,
- fold_build2 (LSHIFT_EXPR, utype,
- tmp2, minshift));
- append_to_statement_list (stmt, &list);
+ stmt = gimple_build_assign (tmp3, fold_build2 (LSHIFT_EXPR, utype,
+ tmp2, minshift));
+ gimple_seq_add_stmt (&seq, stmt);
tmp2 = tmp3;
}
@@ -2489,35 +2473,34 @@ sra_build_bf_assignment (tree dst, tree src)
tmp3 = make_rename_temp (utype, "SR");
else
tmp3 = var;
- stmt = build_gimple_modify_stmt (tmp3,
- fold_build2 (BIT_IOR_EXPR, utype,
- tmp, tmp2));
- append_to_statement_list (stmt, &list);
+ stmt = gimple_build_assign (tmp3, fold_build2 (BIT_IOR_EXPR, utype,
+ tmp, tmp2));
+ gimple_seq_add_stmt (&seq, stmt);
if (tmp3 != var)
{
if (TREE_TYPE (var) == type)
- stmt = build_gimple_modify_stmt (var,
- fold_convert (type, tmp3));
+ stmt = gimple_build_assign (var, fold_convert (type, tmp3));
else
- stmt = build_gimple_modify_stmt (var,
- fold_build1 (VIEW_CONVERT_EXPR,
+ stmt = gimple_build_assign (var, fold_build1 (VIEW_CONVERT_EXPR,
TREE_TYPE (var), tmp3));
- append_to_statement_list (stmt, &list);
+ gimple_seq_add_stmt (&seq, stmt);
}
- return list;
+ return seq;
}
/* Expand an assignment of SRC to the scalarized representation of
ELT. If it is a field group, try to widen the assignment to cover
the full variable. */
-static tree
+static gimple_seq
sra_build_elt_assignment (struct sra_elt *elt, tree src)
{
tree dst = elt->replacement;
- tree var, tmp, cst, cst2, list, stmt;
+ tree var, tmp, cst, cst2;
+ gimple stmt;
+ gimple_seq seq;
if (TREE_CODE (dst) != BIT_FIELD_REF
|| !elt->in_bitfld_block)
@@ -2553,7 +2536,8 @@ sra_build_elt_assignment (struct sra_elt *elt, tree src)
if (TYPE_MAIN_VARIANT (TREE_TYPE (var))
!= TYPE_MAIN_VARIANT (TREE_TYPE (src)))
{
- list = NULL;
+ gimple_seq tmp_seq;
+ seq = NULL;
if (!INTEGRAL_TYPE_P (TREE_TYPE (src)))
src = fold_build1 (VIEW_CONVERT_EXPR,
@@ -2564,15 +2548,15 @@ sra_build_elt_assignment (struct sra_elt *elt, tree src)
gcc_assert (TYPE_UNSIGNED (TREE_TYPE (src)));
tmp = make_rename_temp (TREE_TYPE (src), "SR");
- stmt = build_gimple_modify_stmt (tmp, src);
- append_to_statement_list (stmt, &list);
+ stmt = gimple_build_assign (tmp, src);
+ gimple_seq_add_stmt (&seq, stmt);
- stmt = sra_build_assignment (var,
- fold_convert (TREE_TYPE (var),
- tmp));
- append_to_statement_list (stmt, &list);
+ tmp_seq = sra_build_assignment (var,
+ fold_convert (TREE_TYPE (var),
+ tmp));
+ gimple_seq_add_seq (&seq, tmp_seq);
- return list;
+ return seq;
}
src = fold_convert (TREE_TYPE (var), src);
@@ -2595,9 +2579,10 @@ sra_build_elt_assignment (struct sra_elt *elt, tree src)
static void
generate_copy_inout (struct sra_elt *elt, bool copy_out, tree expr,
- tree *list_p)
+ gimple_seq *seq_p)
{
struct sra_elt *c;
+ gimple_seq tmp_seq;
tree t;
if (!copy_out && TREE_CODE (expr) == SSA_NAME
@@ -2611,24 +2596,25 @@ generate_copy_inout (struct sra_elt *elt, bool copy_out, tree expr,
i = c->replacement;
t = build2 (COMPLEX_EXPR, elt->type, r, i);
- t = sra_build_bf_assignment (expr, t);
- SSA_NAME_DEF_STMT (expr) = t;
- append_to_statement_list (t, list_p);
+ tmp_seq = sra_build_bf_assignment (expr, t);
+ gcc_assert (gimple_seq_singleton_p (tmp_seq));
+ SSA_NAME_DEF_STMT (expr) = gimple_seq_first_stmt (tmp_seq);
+ gimple_seq_add_seq (seq_p, tmp_seq);
}
else if (elt->replacement)
{
if (copy_out)
- t = sra_build_elt_assignment (elt, expr);
+ tmp_seq = sra_build_elt_assignment (elt, expr);
else
- t = sra_build_bf_assignment (expr, REPLDUP (elt->replacement));
- append_to_statement_list (t, list_p);
+ tmp_seq = sra_build_bf_assignment (expr, REPLDUP (elt->replacement));
+ gimple_seq_add_seq (seq_p, tmp_seq);
}
else
{
FOR_EACH_ACTUAL_CHILD (c, elt)
{
t = generate_one_element_ref (c, unshare_expr (expr));
- generate_copy_inout (c, copy_out, t, list_p);
+ generate_copy_inout (c, copy_out, t, seq_p);
}
}
}
@@ -2638,7 +2624,7 @@ generate_copy_inout (struct sra_elt *elt, bool copy_out, tree expr,
correspondence of instantiated elements. */
static void
-generate_element_copy (struct sra_elt *dst, struct sra_elt *src, tree *list_p)
+generate_element_copy (struct sra_elt *dst, struct sra_elt *src, gimple_seq *seq_p)
{
struct sra_elt *dc, *sc;
@@ -2653,7 +2639,7 @@ generate_element_copy (struct sra_elt *dst, struct sra_elt *src, tree *list_p)
{
sc = lookup_element (src, dcs->element, NULL, NO_INSERT);
gcc_assert (sc);
- generate_element_copy (dcs, sc, list_p);
+ generate_element_copy (dcs, sc, seq_p);
}
continue;
@@ -2685,17 +2671,17 @@ generate_element_copy (struct sra_elt *dst, struct sra_elt *src, tree *list_p)
sc = lookup_element (src, f, NULL, NO_INSERT);
}
- generate_element_copy (dc, sc, list_p);
+ generate_element_copy (dc, sc, seq_p);
}
if (dst->replacement)
{
- tree t;
+ gimple_seq tmp_seq;
gcc_assert (src->replacement);
- t = sra_build_elt_assignment (dst, REPLDUP (src->replacement));
- append_to_statement_list (t, list_p);
+ tmp_seq = sra_build_elt_assignment (dst, REPLDUP (src->replacement));
+ gimple_seq_add_seq (seq_p, tmp_seq);
}
}
@@ -2705,7 +2691,7 @@ generate_element_copy (struct sra_elt *dst, struct sra_elt *src, tree *list_p)
with generate_element_init. */
static void
-generate_element_zero (struct sra_elt *elt, tree *list_p)
+generate_element_zero (struct sra_elt *elt, gimple_seq *seq_p)
{
struct sra_elt *c;
@@ -2717,17 +2703,18 @@ generate_element_zero (struct sra_elt *elt, tree *list_p)
if (!elt->in_bitfld_block)
FOR_EACH_ACTUAL_CHILD (c, elt)
- generate_element_zero (c, list_p);
+ generate_element_zero (c, seq_p);
if (elt->replacement)
{
tree t;
+ gimple_seq tmp_seq;
gcc_assert (elt->is_scalar);
t = fold_convert (elt->type, integer_zero_node);
- t = sra_build_elt_assignment (elt, t);
- append_to_statement_list (t, list_p);
+ tmp_seq = sra_build_elt_assignment (elt, t);
+ gimple_seq_add_seq (seq_p, tmp_seq);
}
}
@@ -2735,11 +2722,10 @@ generate_element_zero (struct sra_elt *elt, tree *list_p)
Add the result to *LIST_P. */
static void
-generate_one_element_init (struct sra_elt *elt, tree init, tree *list_p)
+generate_one_element_init (struct sra_elt *elt, tree init, gimple_seq *seq_p)
{
- /* The replacement can be almost arbitrarily complex. Gimplify. */
- tree stmt = sra_build_elt_assignment (elt, init);
- gimplify_and_add (stmt, list_p);
+ gimple_seq tmp_seq = sra_build_elt_assignment (elt, init);
+ gimple_seq_add_seq (seq_p, tmp_seq);
}
/* Generate a set of assignment statements in *LIST_P to set all instantiated
@@ -2749,7 +2735,7 @@ generate_one_element_init (struct sra_elt *elt, tree init, tree *list_p)
handle. */
static bool
-generate_element_init_1 (struct sra_elt *elt, tree init, tree *list_p)
+generate_element_init_1 (struct sra_elt *elt, tree init, gimple_seq *seq_p)
{
bool result = true;
enum tree_code init_code;
@@ -2767,7 +2753,7 @@ generate_element_init_1 (struct sra_elt *elt, tree init, tree *list_p)
{
if (elt->replacement)
{
- generate_one_element_init (elt, init, list_p);
+ generate_one_element_init (elt, init, seq_p);
elt->visited = true;
}
return result;
@@ -2785,13 +2771,19 @@ generate_element_init_1 (struct sra_elt *elt, tree init, tree *list_p)
else
t = (init_code == COMPLEX_EXPR
? TREE_OPERAND (init, 1) : TREE_IMAGPART (init));
- result &= generate_element_init_1 (sub, t, list_p);
+ result &= generate_element_init_1 (sub, t, seq_p);
}
break;
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);
@@ -2801,7 +2793,7 @@ generate_element_init_1 (struct sra_elt *elt, tree init, tree *list_p)
{
sub = lookup_element (elt, lower, NULL, NO_INSERT);
if (sub != NULL)
- result &= generate_element_init_1 (sub, value, list_p);
+ result &= generate_element_init_1 (sub, value, seq_p);
if (tree_int_cst_equal (lower, upper))
break;
lower = int_const_binop (PLUS_EXPR, lower,
@@ -2812,7 +2804,7 @@ generate_element_init_1 (struct sra_elt *elt, tree init, tree *list_p)
{
sub = lookup_element (elt, purpose, NULL, NO_INSERT);
if (sub != NULL)
- result &= generate_element_init_1 (sub, value, list_p);
+ result &= generate_element_init_1 (sub, value, seq_p);
}
}
break;
@@ -2829,96 +2821,86 @@ generate_element_init_1 (struct sra_elt *elt, tree init, tree *list_p)
gimplification. */
static bool
-generate_element_init (struct sra_elt *elt, tree init, tree *list_p)
+generate_element_init (struct sra_elt *elt, tree init, gimple_seq *seq_p)
{
bool ret;
struct gimplify_ctx gctx;
push_gimplify_context (&gctx);
- ret = generate_element_init_1 (elt, init, list_p);
+ ret = generate_element_init_1 (elt, init, seq_p);
pop_gimplify_context (NULL);
/* The replacement can expose previously unreferenced variables. */
- if (ret && *list_p)
+ if (ret && *seq_p)
{
- tree_stmt_iterator i;
+ gimple_stmt_iterator i;
- for (i = tsi_start (*list_p); !tsi_end_p (i); tsi_next (&i))
- find_new_referenced_vars (tsi_stmt_ptr (i));
+ for (i = gsi_start (*seq_p); !gsi_end_p (i); gsi_next (&i))
+ find_new_referenced_vars (gsi_stmt (i));
}
return ret;
}
-/* Insert STMT on all the outgoing edges out of BB. Note that if BB
- has more than one edge, STMT will be replicated for each edge. Also,
- abnormal edges will be ignored. */
+/* Insert a gimple_seq SEQ on all the outgoing edges out of BB. Note that
+ if BB has more than one edge, STMT will be replicated for each edge.
+ Also, abnormal edges will be ignored. */
void
-insert_edge_copies (tree stmt, basic_block bb)
+insert_edge_copies_seq (gimple_seq seq, basic_block bb)
{
edge e;
edge_iterator ei;
- bool first_copy;
+ unsigned n_copies = -1;
- first_copy = true;
FOR_EACH_EDGE (e, ei, bb->succs)
- {
- /* We don't need to insert copies on abnormal edges. The
- value of the scalar replacement is not guaranteed to
- be valid through an abnormal edge. */
- if (!(e->flags & EDGE_ABNORMAL))
- {
- if (first_copy)
- {
- bsi_insert_on_edge (e, stmt);
- first_copy = false;
- }
- else
- bsi_insert_on_edge (e, unsave_expr_now (stmt));
- }
- }
+ if (!(e->flags & EDGE_ABNORMAL))
+ n_copies++;
+
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ if (!(e->flags & EDGE_ABNORMAL))
+ gsi_insert_seq_on_edge (e, n_copies-- > 0 ? gimple_seq_copy (seq) : seq);
}
-/* Helper function to insert LIST before BSI, and set up line number info. */
+/* Helper function to insert LIST before GSI, and set up line number info. */
void
-sra_insert_before (block_stmt_iterator *bsi, tree list)
+sra_insert_before (gimple_stmt_iterator *gsi, gimple_seq seq)
{
- tree stmt = bsi_stmt (*bsi);
+ gimple stmt = gsi_stmt (*gsi);
- if (EXPR_HAS_LOCATION (stmt))
- annotate_all_with_locus (&list, EXPR_LOCATION (stmt));
- bsi_insert_before (bsi, list, BSI_SAME_STMT);
+ if (gimple_has_location (stmt))
+ annotate_all_with_location (seq, gimple_location (stmt));
+ gsi_insert_seq_before (gsi, seq, GSI_SAME_STMT);
}
-/* Similarly, but insert after BSI. Handles insertion onto edges as well. */
+/* Similarly, but insert after GSI. Handles insertion onto edges as well. */
void
-sra_insert_after (block_stmt_iterator *bsi, tree list)
+sra_insert_after (gimple_stmt_iterator *gsi, gimple_seq seq)
{
- tree stmt = bsi_stmt (*bsi);
+ gimple stmt = gsi_stmt (*gsi);
- if (EXPR_HAS_LOCATION (stmt))
- annotate_all_with_locus (&list, EXPR_LOCATION (stmt));
+ if (gimple_has_location (stmt))
+ annotate_all_with_location (seq, gimple_location (stmt));
if (stmt_ends_bb_p (stmt))
- insert_edge_copies (list, bsi->bb);
+ insert_edge_copies_seq (seq, gsi_bb (*gsi));
else
- bsi_insert_after (bsi, list, BSI_SAME_STMT);
+ gsi_insert_seq_after (gsi, seq, GSI_SAME_STMT);
}
-/* Similarly, but replace the statement at BSI. */
+/* Similarly, but replace the statement at GSI. */
static void
-sra_replace (block_stmt_iterator *bsi, tree list)
+sra_replace (gimple_stmt_iterator *gsi, gimple_seq seq)
{
- sra_insert_before (bsi, list);
- bsi_remove (bsi, false);
- if (bsi_end_p (*bsi))
- *bsi = bsi_last (bsi->bb);
+ sra_insert_before (gsi, seq);
+ gsi_remove (gsi, false);
+ if (gsi_end_p (*gsi))
+ *gsi = gsi_last (gsi_seq (*gsi));
else
- bsi_prev (bsi);
+ gsi_prev (gsi);
}
/* Data structure that bitfield_overlaps_p fills in with information
@@ -3032,7 +3014,7 @@ bitfield_overlaps_p (tree blen, tree bpos, struct sra_elt *fld,
static void
sra_explode_bitfield_assignment (tree var, tree vpos, bool to_var,
- tree *listp, tree blen, tree bpos,
+ gimple_seq *seq_p, tree blen, tree bpos,
struct sra_elt *elt)
{
struct sra_elt *fld;
@@ -3050,7 +3032,8 @@ sra_explode_bitfield_assignment (tree var, tree vpos, bool to_var,
if (fld->replacement)
{
- tree infld, invar, st, type;
+ tree infld, invar, type;
+ gimple_seq st;
infld = fld->replacement;
@@ -3089,7 +3072,7 @@ sra_explode_bitfield_assignment (tree var, tree vpos, bool to_var,
else
st = sra_build_bf_assignment (infld, invar);
- append_to_statement_list (st, listp);
+ gimple_seq_add_seq (seq_p, st);
}
else
{
@@ -3098,7 +3081,7 @@ sra_explode_bitfield_assignment (tree var, tree vpos, bool to_var,
if (flp.overlap_pos)
sub = size_binop (PLUS_EXPR, sub, flp.overlap_pos);
- sra_explode_bitfield_assignment (var, sub, to_var, listp,
+ sra_explode_bitfield_assignment (var, sub, to_var, seq_p,
flen, fpos, fld);
}
}
@@ -3111,7 +3094,8 @@ sra_explode_bitfield_assignment (tree var, tree vpos, bool to_var,
full variable back to the scalarized variables. */
static void
-sra_sync_for_bitfield_assignment (tree *listbeforep, tree *listafterp,
+sra_sync_for_bitfield_assignment (gimple_seq *seq_before_p,
+ gimple_seq *seq_after_p,
tree blen, tree bpos,
struct sra_elt *elt)
{
@@ -3124,18 +3108,18 @@ sra_sync_for_bitfield_assignment (tree *listbeforep, tree *listafterp,
if (fld->replacement || (!flp.overlap_len && !flp.overlap_pos))
{
generate_copy_inout (fld, false, generate_element_ref (fld),
- listbeforep);
+ seq_before_p);
mark_no_warning (fld);
- if (listafterp)
+ if (seq_after_p)
generate_copy_inout (fld, true, generate_element_ref (fld),
- listafterp);
+ seq_after_p);
}
else
{
tree flen = flp.overlap_len ? flp.overlap_len : flp.field_len;
tree fpos = flp.overlap_pos ? flp.overlap_pos : bitsize_int (0);
- sra_sync_for_bitfield_assignment (listbeforep, listafterp,
+ sra_sync_for_bitfield_assignment (seq_before_p, seq_after_p,
flen, fpos, fld);
}
}
@@ -3146,10 +3130,10 @@ sra_sync_for_bitfield_assignment (tree *listbeforep, tree *listafterp,
aggregate. IS_OUTPUT is true if ELT is being modified. */
static void
-scalarize_use (struct sra_elt *elt, tree *expr_p, block_stmt_iterator *bsi,
+scalarize_use (struct sra_elt *elt, tree *expr_p, gimple_stmt_iterator *gsi,
bool is_output, bool use_all)
{
- tree stmt = bsi_stmt (*bsi);
+ gimple stmt = gsi_stmt (*gsi);
tree bfexpr;
if (elt->replacement)
@@ -3161,52 +3145,43 @@ scalarize_use (struct sra_elt *elt, tree *expr_p, block_stmt_iterator *bsi,
if (is_output
&& TREE_CODE (elt->replacement) == BIT_FIELD_REF
&& is_gimple_reg (TREE_OPERAND (elt->replacement, 0))
- && TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && &GIMPLE_STMT_OPERAND (stmt, 0) == expr_p)
+ && is_gimple_assign (stmt)
+ && gimple_assign_lhs_ptr (stmt) == expr_p)
{
- tree newstmt = sra_build_elt_assignment
- (elt, GIMPLE_STMT_OPERAND (stmt, 1));
- if (TREE_CODE (newstmt) != STATEMENT_LIST)
- {
- tree list = NULL;
- append_to_statement_list (newstmt, &list);
- newstmt = list;
- }
- sra_replace (bsi, newstmt);
+ gimple_seq newseq;
+ /* RHS must be a single operand. */
+ gcc_assert (gimple_assign_single_p (stmt));
+ newseq = sra_build_elt_assignment (elt, gimple_assign_rhs1 (stmt));
+ sra_replace (gsi, newseq);
return;
}
else if (!is_output
&& TREE_CODE (elt->replacement) == BIT_FIELD_REF
- && TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && &GIMPLE_STMT_OPERAND (stmt, 1) == expr_p)
+ && is_gimple_assign (stmt)
+ && gimple_assign_rhs1_ptr (stmt) == expr_p)
{
tree tmp = make_rename_temp
- (TREE_TYPE (GIMPLE_STMT_OPERAND (stmt, 0)), "SR");
- tree newstmt = sra_build_assignment (tmp, REPLDUP (elt->replacement));
+ (TREE_TYPE (gimple_assign_lhs (stmt)), "SR");
+ gimple_seq newseq = sra_build_assignment (tmp, REPLDUP (elt->replacement));
- if (TREE_CODE (newstmt) != STATEMENT_LIST)
- {
- tree list = NULL;
- append_to_statement_list (newstmt, &list);
- newstmt = list;
- }
- sra_insert_before (bsi, newstmt);
+ sra_insert_before (gsi, newseq);
replacement = tmp;
}
if (is_output)
- mark_all_v_defs (stmt);
+ mark_all_v_defs_stmt (stmt);
*expr_p = REPLDUP (replacement);
update_stmt (stmt);
}
else if (use_all && is_output
- && TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
+ && is_gimple_assign (stmt)
&& TREE_CODE (bfexpr
- = GIMPLE_STMT_OPERAND (stmt, 0)) == BIT_FIELD_REF
+ = gimple_assign_lhs (stmt)) == BIT_FIELD_REF
&& &TREE_OPERAND (bfexpr, 0) == expr_p
&& INTEGRAL_TYPE_P (TREE_TYPE (bfexpr))
&& TREE_CODE (TREE_TYPE (*expr_p)) == RECORD_TYPE)
{
- tree listbefore = NULL, listafter = NULL;
+ gimple_seq seq_before = NULL;
+ gimple_seq seq_after = NULL;
tree blen = fold_convert (bitsizetype, TREE_OPERAND (bfexpr, 1));
tree bpos = fold_convert (bitsizetype, TREE_OPERAND (bfexpr, 2));
bool update = false;
@@ -3214,18 +3189,18 @@ scalarize_use (struct sra_elt *elt, tree *expr_p, block_stmt_iterator *bsi,
if (!elt->use_block_copy)
{
tree type = TREE_TYPE (bfexpr);
- tree var = make_rename_temp (type, "SR"), tmp, st, vpos;
+ tree var = make_rename_temp (type, "SR"), tmp, vpos;
+ gimple st;
- GIMPLE_STMT_OPERAND (stmt, 0) = var;
+ gimple_assign_set_lhs (stmt, var);
update = true;
if (!TYPE_UNSIGNED (type))
{
type = unsigned_type_for (type);
tmp = make_rename_temp (type, "SR");
- st = build_gimple_modify_stmt (tmp,
- fold_convert (type, var));
- append_to_statement_list (st, &listafter);
+ st = gimple_build_assign (tmp, fold_convert (type, var));
+ gimple_seq_add_stmt (&seq_after, st);
var = tmp;
}
@@ -3238,35 +3213,35 @@ scalarize_use (struct sra_elt *elt, tree *expr_p, block_stmt_iterator *bsi,
else
vpos = bitsize_int (0);
sra_explode_bitfield_assignment
- (var, vpos, false, &listafter, blen, bpos, elt);
+ (var, vpos, false, &seq_after, blen, bpos, elt);
}
else
sra_sync_for_bitfield_assignment
- (&listbefore, &listafter, blen, bpos, elt);
+ (&seq_before, &seq_after, blen, bpos, elt);
- if (listbefore)
+ if (seq_before)
{
- mark_all_v_defs (listbefore);
- sra_insert_before (bsi, listbefore);
+ mark_all_v_defs_seq (seq_before);
+ sra_insert_before (gsi, seq_before);
}
- if (listafter)
+ if (seq_after)
{
- mark_all_v_defs (listafter);
- sra_insert_after (bsi, listafter);
+ mark_all_v_defs_seq (seq_after);
+ sra_insert_after (gsi, seq_after);
}
if (update)
update_stmt (stmt);
}
else if (use_all && !is_output
- && TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
+ && is_gimple_assign (stmt)
&& TREE_CODE (bfexpr
- = GIMPLE_STMT_OPERAND (stmt, 1)) == BIT_FIELD_REF
- && &TREE_OPERAND (GIMPLE_STMT_OPERAND (stmt, 1), 0) == expr_p
+ = gimple_assign_rhs1 (stmt)) == BIT_FIELD_REF
+ && &TREE_OPERAND (gimple_assign_rhs1 (stmt), 0) == expr_p
&& INTEGRAL_TYPE_P (TREE_TYPE (bfexpr))
&& TREE_CODE (TREE_TYPE (*expr_p)) == RECORD_TYPE)
{
- tree list = NULL;
+ gimple_seq seq = NULL;
tree blen = fold_convert (bitsizetype, TREE_OPERAND (bfexpr, 1));
tree bpos = fold_convert (bitsizetype, TREE_OPERAND (bfexpr, 2));
bool update = false;
@@ -3281,9 +3256,9 @@ scalarize_use (struct sra_elt *elt, tree *expr_p, block_stmt_iterator *bsi,
var = make_rename_temp (type, "SR");
- append_to_statement_list (build_gimple_modify_stmt
- (var, build_int_cst_wide (type, 0, 0)),
- &list);
+ gimple_seq_add_stmt (&seq,
+ gimple_build_assign
+ (var, build_int_cst_wide (type, 0, 0)));
/* If VAR is wider than BLEN bits, it is padded at the
most-significant end. We want to set VPOS such that
@@ -3294,19 +3269,19 @@ scalarize_use (struct sra_elt *elt, tree *expr_p, block_stmt_iterator *bsi,
else
vpos = bitsize_int (0);
sra_explode_bitfield_assignment
- (var, vpos, true, &list, blen, bpos, elt);
+ (var, vpos, true, &seq, blen, bpos, elt);
- GIMPLE_STMT_OPERAND (stmt, 1) = var;
+ gimple_assign_set_rhs1 (stmt, var);
update = true;
}
else
sra_sync_for_bitfield_assignment
- (&list, NULL, blen, bpos, elt);
+ (&seq, NULL, blen, bpos, elt);
- if (list)
+ if (seq)
{
- mark_all_v_defs (list);
- sra_insert_before (bsi, list);
+ mark_all_v_defs_seq (seq);
+ sra_insert_before (gsi, seq);
}
if (update)
@@ -3314,7 +3289,7 @@ scalarize_use (struct sra_elt *elt, tree *expr_p, block_stmt_iterator *bsi,
}
else
{
- tree list = NULL;
+ gimple_seq seq = NULL;
/* Otherwise we need some copies. If ELT is being read, then we
want to store all (modified) sub-elements back into the
@@ -3330,15 +3305,15 @@ scalarize_use (struct sra_elt *elt, tree *expr_p, block_stmt_iterator *bsi,
This optimization would be most effective if sra_walk_function
processed the blocks in dominator order. */
- generate_copy_inout (elt, is_output, generate_element_ref (elt), &list);
- if (list == NULL)
+ generate_copy_inout (elt, is_output, generate_element_ref (elt), &seq);
+ if (seq == NULL)
return;
- mark_all_v_defs (list);
+ mark_all_v_defs_seq (seq);
if (is_output)
- sra_insert_after (bsi, list);
+ sra_insert_after (gsi, seq);
else
{
- sra_insert_before (bsi, list);
+ sra_insert_before (gsi, seq);
if (use_all)
mark_no_warning (elt);
}
@@ -3350,21 +3325,24 @@ scalarize_use (struct sra_elt *elt, tree *expr_p, block_stmt_iterator *bsi,
static void
scalarize_copy (struct sra_elt *lhs_elt, struct sra_elt *rhs_elt,
- block_stmt_iterator *bsi)
+ gimple_stmt_iterator *gsi)
{
- tree list, stmt;
+ gimple_seq seq;
+ gimple stmt;
if (lhs_elt->replacement && rhs_elt->replacement)
{
/* If we have two scalar operands, modify the existing statement. */
- stmt = bsi_stmt (*bsi);
+ stmt = gsi_stmt (*gsi);
/* See the commentary in sra_walk_function concerning
RETURN_EXPR, and why we should never see one here. */
- gcc_assert (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT);
+ gcc_assert (is_gimple_assign (stmt));
+ gcc_assert (gimple_assign_copy_p (stmt));
- GIMPLE_STMT_OPERAND (stmt, 0) = lhs_elt->replacement;
- GIMPLE_STMT_OPERAND (stmt, 1) = REPLDUP (rhs_elt->replacement);
+
+ gimple_assign_set_lhs (stmt, lhs_elt->replacement);
+ gimple_assign_set_rhs1 (stmt, REPLDUP (rhs_elt->replacement));
update_stmt (stmt);
}
else if (lhs_elt->use_block_copy || rhs_elt->use_block_copy)
@@ -3377,22 +3355,22 @@ scalarize_copy (struct sra_elt *lhs_elt, struct sra_elt *rhs_elt,
would at least allow those elements that are instantiated in
both structures to be optimized well. */
- list = NULL;
+ seq = NULL;
generate_copy_inout (rhs_elt, false,
- generate_element_ref (rhs_elt), &list);
- if (list)
+ generate_element_ref (rhs_elt), &seq);
+ if (seq)
{
- mark_all_v_defs (list);
- sra_insert_before (bsi, list);
+ mark_all_v_defs_seq (seq);
+ sra_insert_before (gsi, seq);
}
- list = NULL;
+ seq = NULL;
generate_copy_inout (lhs_elt, true,
- generate_element_ref (lhs_elt), &list);
- if (list)
+ generate_element_ref (lhs_elt), &seq);
+ if (seq)
{
- mark_all_v_defs (list);
- sra_insert_after (bsi, list);
+ mark_all_v_defs_seq (seq);
+ sra_insert_after (gsi, seq);
}
}
else
@@ -3401,14 +3379,14 @@ scalarize_copy (struct sra_elt *lhs_elt, struct sra_elt *rhs_elt,
case perform pair-wise element assignments and replace the
original block copy statement. */
- stmt = bsi_stmt (*bsi);
- mark_all_v_defs (stmt);
+ stmt = gsi_stmt (*gsi);
+ mark_all_v_defs_stmt (stmt);
- list = NULL;
- generate_element_copy (lhs_elt, rhs_elt, &list);
- gcc_assert (list);
- mark_all_v_defs (list);
- sra_replace (bsi, list);
+ seq = NULL;
+ generate_element_copy (lhs_elt, rhs_elt, &seq);
+ gcc_assert (seq);
+ mark_all_v_defs_seq (seq);
+ sra_replace (gsi, seq);
}
}
@@ -3418,24 +3396,19 @@ scalarize_copy (struct sra_elt *lhs_elt, struct sra_elt *rhs_elt,
CONSTRUCTOR. */
static void
-scalarize_init (struct sra_elt *lhs_elt, tree rhs, block_stmt_iterator *bsi)
+scalarize_init (struct sra_elt *lhs_elt, tree rhs, gimple_stmt_iterator *gsi)
{
bool result = true;
- tree list = NULL, init_list = NULL;
+ gimple_seq seq = NULL, init_seq = NULL;
/* Generate initialization statements for all members extant in the RHS. */
if (rhs)
{
/* Unshare the expression just in case this is from a decl's initial. */
rhs = unshare_expr (rhs);
- result = generate_element_init (lhs_elt, rhs, &init_list);
+ 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, &list);
- append_to_statement_list (init_list, &list);
-
if (!result)
{
/* If we failed to convert the entire initializer, then we must
@@ -3444,11 +3417,18 @@ scalarize_init (struct sra_elt *lhs_elt, tree rhs, block_stmt_iterator *bsi)
constants. The easiest way to do this is to generate a complete
copy-out, and then follow that with the constant assignments
that we were able to build. DCE will clean things up. */
- tree list0 = NULL;
+ gimple_seq seq0 = NULL;
generate_copy_inout (lhs_elt, true, generate_element_ref (lhs_elt),
- &list0);
- append_to_statement_list (list, &list0);
- list = list0;
+ &seq0);
+ 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)
@@ -3456,20 +3436,20 @@ scalarize_init (struct sra_elt *lhs_elt, tree rhs, block_stmt_iterator *bsi)
/* Since LHS is not fully instantiated, we must leave the structure
assignment in place. Treating this case differently from a USE
exposes constants to later optimizations. */
- if (list)
+ if (seq)
{
- mark_all_v_defs (list);
- sra_insert_after (bsi, list);
+ mark_all_v_defs_seq (seq);
+ sra_insert_after (gsi, seq);
}
}
else
{
/* The LHS is fully instantiated. The list of initializations
replaces the original structure assignment. */
- gcc_assert (list);
- mark_all_v_defs (bsi_stmt (*bsi));
- mark_all_v_defs (list);
- sra_replace (bsi, list);
+ gcc_assert (seq);
+ mark_all_v_defs_stmt (gsi_stmt (*gsi));
+ mark_all_v_defs_seq (seq);
+ sra_replace (gsi, seq);
}
}
@@ -3498,7 +3478,7 @@ mark_notrap (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
static void
scalarize_ldst (struct sra_elt *elt, tree other,
- block_stmt_iterator *bsi, bool is_output)
+ gimple_stmt_iterator *gsi, bool is_output)
{
/* Shouldn't have gotten called for a scalar. */
gcc_assert (!elt->replacement);
@@ -3507,7 +3487,7 @@ scalarize_ldst (struct sra_elt *elt, tree other,
{
/* Since ELT is not fully instantiated, we have to leave the
block copy in place. Treat this as a USE. */
- scalarize_use (elt, NULL, bsi, is_output, false);
+ scalarize_use (elt, NULL, gsi, is_output, false);
}
else
{
@@ -3515,19 +3495,21 @@ scalarize_ldst (struct sra_elt *elt, tree other,
case we can have each element stored/loaded directly to/from the
corresponding slot in OTHER. This avoids a block copy. */
- tree list = NULL, stmt = bsi_stmt (*bsi);
+ gimple_seq seq = NULL;
+ gimple stmt = gsi_stmt (*gsi);
- mark_all_v_defs (stmt);
- generate_copy_inout (elt, is_output, other, &list);
- gcc_assert (list);
- mark_all_v_defs (list);
+ mark_all_v_defs_stmt (stmt);
+ generate_copy_inout (elt, is_output, other, &seq);
+ gcc_assert (seq);
+ mark_all_v_defs_seq (seq);
/* Preserve EH semantics. */
if (stmt_ends_bb_p (stmt))
{
- tree_stmt_iterator tsi;
- tree first, blist = NULL;
- bool thr = tree_could_throw_p (stmt);
+ gimple_stmt_iterator si;
+ gimple first;
+ gimple_seq blist = NULL;
+ bool thr = stmt_could_throw_p (stmt);
/* If the last statement of this BB created an EH edge
before scalarization, we have to locate the first
@@ -3538,26 +3520,26 @@ scalarize_ldst (struct sra_elt *elt, tree other,
list will be added to normal outgoing edges of the same
BB. If they access any memory, it's the same memory, so
we can assume they won't throw. */
- tsi = tsi_start (list);
- for (first = tsi_stmt (tsi);
- thr && !tsi_end_p (tsi) && !tree_could_throw_p (first);
- first = tsi_stmt (tsi))
+ si = gsi_start (seq);
+ for (first = gsi_stmt (si);
+ thr && !gsi_end_p (si) && !stmt_could_throw_p (first);
+ first = gsi_stmt (si))
{
- tsi_delink (&tsi);
- append_to_statement_list (first, &blist);
+ gsi_remove (&si, false);
+ gimple_seq_add_stmt (&blist, first);
}
/* Extract the first remaining statement from LIST, this is
the EH statement if there is one. */
- tsi_delink (&tsi);
+ gsi_remove (&si, false);
if (blist)
- sra_insert_before (bsi, blist);
+ sra_insert_before (gsi, blist);
/* Replace the old statement with this new representative. */
- bsi_replace (bsi, first, true);
+ gsi_replace (gsi, first, true);
- if (!tsi_end_p (tsi))
+ if (!gsi_end_p (si))
{
/* If any reference would trap, then they all would. And more
to the point, the first would. Therefore none of the rest
@@ -3566,16 +3548,16 @@ scalarize_ldst (struct sra_elt *elt, tree other,
TREE_THIS_NOTRAP in all INDIRECT_REFs. */
do
{
- walk_tree (tsi_stmt_ptr (tsi), mark_notrap, NULL, NULL);
- tsi_next (&tsi);
+ walk_gimple_stmt (&si, NULL, mark_notrap, NULL);
+ gsi_next (&si);
}
- while (!tsi_end_p (tsi));
+ while (!gsi_end_p (si));
- insert_edge_copies (list, bsi->bb);
+ insert_edge_copies_seq (seq, gsi_bb (*gsi));
}
}
else
- sra_replace (bsi, list);
+ sra_replace (gsi, seq);
}
}
@@ -3584,7 +3566,7 @@ scalarize_ldst (struct sra_elt *elt, tree other,
static void
scalarize_parms (void)
{
- tree list = NULL;
+ gimple_seq seq = NULL;
unsigned i;
bitmap_iterator bi;
@@ -3592,13 +3574,13 @@ scalarize_parms (void)
{
tree var = referenced_var (i);
struct sra_elt *elt = lookup_element (NULL, var, NULL, NO_INSERT);
- generate_copy_inout (elt, true, var, &list);
+ generate_copy_inout (elt, true, var, &seq);
}
- if (list)
+ if (seq)
{
- insert_edge_copies (list, ENTRY_BLOCK_PTR);
- mark_all_v_defs (list);
+ insert_edge_copies_seq (seq, ENTRY_BLOCK_PTR);
+ mark_all_v_defs_seq (seq);
}
}
@@ -3613,7 +3595,7 @@ scalarize_function (void)
sra_walk_function (&fns);
scalarize_parms ();
- bsi_commit_edge_inserts ();
+ gsi_commit_edge_inserts ();
}
@@ -3663,13 +3645,14 @@ debug_sra_elt_name (struct sra_elt *elt)
void
sra_init_cache (void)
{
- if (sra_type_decomp_cache)
+ if (sra_type_decomp_cache)
return;
sra_type_decomp_cache = BITMAP_ALLOC (NULL);
sra_type_inst_cache = BITMAP_ALLOC (NULL);
}
+
/* Main entry point. */
static unsigned int
diff --git a/gcc/tree-ssa-address.c b/gcc/tree-ssa-address.c
index 55d43a5e362..198adb409e6 100644
--- a/gcc/tree-ssa-address.c
+++ b/gcc/tree-ssa-address.c
@@ -556,31 +556,31 @@ addr_to_parts (aff_tree *addr, struct mem_address *parts)
/* Force the PARTS to register. */
static void
-gimplify_mem_ref_parts (block_stmt_iterator *bsi, struct mem_address *parts)
+gimplify_mem_ref_parts (gimple_stmt_iterator *gsi, struct mem_address *parts)
{
if (parts->base)
- parts->base = force_gimple_operand_bsi (bsi, parts->base,
+ parts->base = force_gimple_operand_gsi (gsi, parts->base,
true, NULL_TREE,
- true, BSI_SAME_STMT);
+ true, GSI_SAME_STMT);
if (parts->index)
- parts->index = force_gimple_operand_bsi (bsi, parts->index,
+ parts->index = force_gimple_operand_gsi (gsi, parts->index,
true, NULL_TREE,
- true, BSI_SAME_STMT);
+ true, GSI_SAME_STMT);
}
/* Creates and returns a TARGET_MEM_REF for address ADDR. If necessary
- computations are emitted in front of BSI. TYPE is the mode
+ computations are emitted in front of GSI. TYPE is the mode
of created memory reference. */
tree
-create_mem_ref (block_stmt_iterator *bsi, tree type, aff_tree *addr)
+create_mem_ref (gimple_stmt_iterator *gsi, tree type, aff_tree *addr)
{
tree mem_ref, tmp;
tree atype;
struct mem_address parts;
addr_to_parts (addr, &parts);
- gimplify_mem_ref_parts (bsi, &parts);
+ gimplify_mem_ref_parts (gsi, &parts);
mem_ref = create_mem_ref_raw (type, &parts);
if (mem_ref)
return mem_ref;
@@ -591,10 +591,10 @@ create_mem_ref (block_stmt_iterator *bsi, tree type, aff_tree *addr)
{
/* Move the multiplication to index. */
gcc_assert (parts.index);
- parts.index = force_gimple_operand_bsi (bsi,
+ parts.index = force_gimple_operand_gsi (gsi,
fold_build2 (MULT_EXPR, sizetype,
parts.index, parts.step),
- true, NULL_TREE, true, BSI_SAME_STMT);
+ true, NULL_TREE, true, GSI_SAME_STMT);
parts.step = NULL_TREE;
mem_ref = create_mem_ref_raw (type, &parts);
@@ -616,11 +616,11 @@ create_mem_ref (block_stmt_iterator *bsi, tree type, aff_tree *addr)
if (parts.index)
{
atype = TREE_TYPE (tmp);
- parts.base = force_gimple_operand_bsi (bsi,
+ parts.base = force_gimple_operand_gsi (gsi,
fold_build2 (PLUS_EXPR, atype,
fold_convert (atype, parts.base),
tmp),
- true, NULL_TREE, true, BSI_SAME_STMT);
+ true, NULL_TREE, true, GSI_SAME_STMT);
}
else
{
@@ -643,11 +643,11 @@ create_mem_ref (block_stmt_iterator *bsi, tree type, aff_tree *addr)
if (parts.base)
{
atype = TREE_TYPE (parts.base);
- parts.base = force_gimple_operand_bsi (bsi,
+ parts.base = force_gimple_operand_gsi (gsi,
fold_build2 (POINTER_PLUS_EXPR, atype,
parts.base,
parts.index),
- true, NULL_TREE, true, BSI_SAME_STMT);
+ true, NULL_TREE, true, GSI_SAME_STMT);
}
else
parts.base = parts.index;
@@ -664,11 +664,11 @@ create_mem_ref (block_stmt_iterator *bsi, tree type, aff_tree *addr)
if (parts.base)
{
atype = TREE_TYPE (parts.base);
- parts.base = force_gimple_operand_bsi (bsi,
+ parts.base = force_gimple_operand_gsi (gsi,
fold_build2 (POINTER_PLUS_EXPR, atype,
parts.base,
fold_convert (sizetype, parts.offset)),
- true, NULL_TREE, true, BSI_SAME_STMT);
+ true, NULL_TREE, true, GSI_SAME_STMT);
}
else
parts.base = parts.offset;
diff --git a/gcc/tree-ssa-alias-warnings.c b/gcc/tree-ssa-alias-warnings.c
index be26cb37d49..5bae978187a 100644
--- a/gcc/tree-ssa-alias-warnings.c
+++ b/gcc/tree-ssa-alias-warnings.c
@@ -244,7 +244,7 @@ struct alias_match
{
tree rhs;
bool is_rhs_pointer;
- tree site;
+ gimple site;
};
@@ -252,15 +252,14 @@ struct alias_match
of STMT matches DATA. */
static bool
-find_alias_site_helper (tree var ATTRIBUTE_UNUSED, tree stmt, void *data)
+find_alias_site_helper (tree var ATTRIBUTE_UNUSED, gimple stmt, void *data)
{
struct alias_match *match = (struct alias_match *) data;
- tree rhs_pointer = get_rhs (stmt);
+ tree rhs_pointer = NULL_TREE;
tree to_match = NULL_TREE;
- while (CONVERT_EXPR_P (rhs_pointer)
- || TREE_CODE (rhs_pointer) == VIEW_CONVERT_EXPR)
- rhs_pointer = TREE_OPERAND (rhs_pointer, 0);
+ if (gimple_assign_cast_p (stmt))
+ rhs_pointer = gimple_assign_rhs1 (stmt);
if (!rhs_pointer)
/* Not a type conversion. */
@@ -287,7 +286,7 @@ find_alias_site_helper (tree var ATTRIBUTE_UNUSED, tree stmt, void *data)
For now, just implement the case where OBJECT1 is an SSA name defined
by a PHI statement. */
-static tree
+static gimple
find_alias_site (tree object1, bool is_ptr1 ATTRIBUTE_UNUSED,
tree object2, bool is_ptr2)
{
@@ -295,10 +294,10 @@ find_alias_site (tree object1, bool is_ptr1 ATTRIBUTE_UNUSED,
match.rhs = object2;
match.is_rhs_pointer = is_ptr2;
- match.site = NULL_TREE;
+ match.site = NULL;
if (TREE_CODE (object1) != SSA_NAME)
- return NULL_TREE;
+ return NULL;
walk_use_def_chains (object1, find_alias_site_helper, &match, false);
return match.site;
@@ -344,29 +343,55 @@ get_ssa_base (tree expr)
objs: <ptr, 2>
PTR shows up twice as an object, but is dereferenced only once.
- The elements of the hash tables are tree_map objects. */
+ The elements of the hash tables are gimple_map objects. */
struct reference_matches
{
htab_t ptrs;
htab_t objs;
};
+struct gimple_tree_map
+{
+ tree from;
+ gimple to;
+};
+
+/* Return true if the from tree in both gimple-tree maps are equal.
+ VA and VB are really instances of struct gimple_tree_map. */
+
+static int
+gimple_tree_map_eq (const void *va, const void *vb)
+{
+ const struct gimple_tree_map *const a = (const struct gimple_tree_map *) va;
+ const struct gimple_tree_map *const b = (const struct gimple_tree_map *) vb;
+ return (a->from == b->from);
+}
+
+/* Hash a from tree in a gimple_tree_map. ITEM is really an instance
+ of struct gimple_tree_map. */
+
+static unsigned int
+gimple_tree_map_hash (const void *item)
+{
+ return htab_hash_pointer (((const struct gimple_tree_map *)item)->from);
+}
-/* Return the match, if any. Otherwise, return NULL_TREE. It will
- return NULL_TREE even when a match was found, if the value associated
- to KEY is NULL_TREE. */
+/* Return the match, if any. Otherwise, return NULL. It will return
+ NULL even when a match was found, if the value associated to KEY is
+ NULL. */
-static inline tree
+static inline gimple
match (htab_t ref_map, tree key)
{
- struct tree_map *found;
+ struct gimple_tree_map *found;
void **slot = NULL;
slot = htab_find_slot (ref_map, &key, NO_INSERT);
if (!slot)
- return NULL_TREE;
+ return NULL;
+
+ found = (struct gimple_tree_map *) *slot;
- found = (struct tree_map *) *slot;
return found->to;
}
@@ -375,9 +400,11 @@ match (htab_t ref_map, tree key)
already exists and its value is NULL_TREE. Otherwise, do nothing. */
static inline void
-maybe_add_match (htab_t ref_map, struct tree_map *key)
+maybe_add_match (htab_t ref_map, struct gimple_tree_map *key)
{
- struct tree_map *found = (struct tree_map *) htab_find (ref_map, key);
+ struct gimple_tree_map *found;
+
+ found = (struct gimple_tree_map *) htab_find (ref_map, key);
if (found && !found->to)
found->to = key->to;
@@ -390,10 +417,12 @@ static void
add_key (htab_t ht, tree t, alloc_pool references_pool)
{
void **slot;
- struct tree_map *tp = (struct tree_map *) pool_alloc (references_pool);
+ struct gimple_tree_map *tp;
+
+ tp = (struct gimple_tree_map *) pool_alloc (references_pool);
- tp->base.from = t;
- tp->to = NULL_TREE;
+ tp->from = t;
+ tp->to = NULL;
slot = htab_find_slot (ht, &t, INSERT);
*slot = (void *) tp;
}
@@ -412,8 +441,9 @@ reference_table_alloc_pool (bool build)
if (ref_table_alloc_pool || !build)
return ref_table_alloc_pool;
- ref_table_alloc_pool =
- create_alloc_pool ("ref_table_alloc_pool", sizeof (struct tree_map), 20);
+ ref_table_alloc_pool = create_alloc_pool ("ref_table_alloc_pool",
+ sizeof (struct gimple_tree_map),
+ 20);
return ref_table_alloc_pool;
}
@@ -430,8 +460,10 @@ build_reference_table (void)
alloc_pool references_pool = reference_table_alloc_pool (true);
ref_table = XNEW (struct reference_matches);
- ref_table->objs = htab_create (10, tree_map_base_hash, tree_map_eq, NULL);
- ref_table->ptrs = htab_create (10, tree_map_base_hash, tree_map_eq, NULL);
+ ref_table->objs = htab_create (10, gimple_tree_map_hash, gimple_tree_map_eq,
+ NULL);
+ ref_table->ptrs = htab_create (10, gimple_tree_map_hash, gimple_tree_map_eq,
+ NULL);
for (i = 1; i < num_ssa_names; i++)
{
@@ -518,8 +550,9 @@ find_references_in_tree_helper (tree *tp,
int *walk_subtrees ATTRIBUTE_UNUSED,
void *data)
{
- struct tree_map match;
+ struct gimple_tree_map match;
static int parent_tree_code = ERROR_MARK;
+ struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
/* Do not report references just for the purpose of taking an address.
XXX: we rely on the fact that the tree walk is in preorder
@@ -528,16 +561,16 @@ find_references_in_tree_helper (tree *tp,
if (parent_tree_code == ADDR_EXPR)
goto finish;
- match.to = (tree) data;
+ match.to = (gimple) wi->info;
if (TREE_CODE (*tp) == INDIRECT_REF)
{
- match.base.from = TREE_OPERAND (*tp, 0);
+ match.from = TREE_OPERAND (*tp, 0);
maybe_add_match (reference_table (true)->ptrs, &match);
}
else
{
- match.base.from = *tp;
+ match.from = *tp;
maybe_add_match (reference_table (true)->objs, &match);
}
@@ -553,12 +586,16 @@ static void
find_references_in_function (void)
{
basic_block bb;
- block_stmt_iterator i;
+ gimple_stmt_iterator i;
FOR_EACH_BB (bb)
- for (i = bsi_start (bb); !bsi_end_p (i); bsi_next (&i))
- walk_tree (bsi_stmt_ptr (i), find_references_in_tree_helper,
- (void *) *bsi_stmt_ptr (i), NULL);
+ for (i = gsi_start_bb (bb); !gsi_end_p (i); gsi_next (&i))
+ {
+ struct walk_stmt_info wi;
+ memset (&wi, 0, sizeof (wi));
+ wi.info = (void *) gsi_stmt (i);
+ walk_gimple_op (gsi_stmt (i), find_references_in_tree_helper, &wi);
+ }
}
@@ -567,7 +604,7 @@ find_references_in_function (void)
XXX: only the first site is returned in the current
implementation. If there are no matching sites, return NULL_TREE. */
-static tree
+static gimple
reference_site (tree object, bool is_ptr)
{
if (is_ptr)
@@ -590,19 +627,19 @@ reference_site (tree object, bool is_ptr)
static void
maybe_find_missing_stmts (tree object1, bool is_ptr1,
tree object2, bool is_ptr2,
- tree *alias_site,
- tree *deref_site1,
- tree *deref_site2)
+ gimple *alias_site,
+ gimple *deref_site1,
+ gimple *deref_site2)
{
if (object1 && object2)
{
- if (!*alias_site || !EXPR_HAS_LOCATION (*alias_site))
+ if (!*alias_site || !gimple_has_location (*alias_site))
*alias_site = find_alias_site (object1, is_ptr1, object2, is_ptr2);
- if (!*deref_site1 || !EXPR_HAS_LOCATION (*deref_site1))
+ if (!*deref_site1 || !gimple_has_location (*deref_site1))
*deref_site1 = reference_site (object1, is_ptr1);
- if (!*deref_site2 || !EXPR_HAS_LOCATION (*deref_site2))
+ if (!*deref_site2 || !gimple_has_location (*deref_site2))
*deref_site2 = reference_site (object2, is_ptr2);
}
@@ -683,7 +720,6 @@ get_maybe_star_prefix (tree object, bool is_ptr)
&& TREE_CODE (TREE_TYPE (object)) == POINTER_TYPE) ? "*" : "";
}
-
/* Callback for contains_node_type_p.
Returns true if *T has tree code *(int*)DATA. */
@@ -710,18 +746,13 @@ contains_node_type_p (tree t, int type)
/* Return true if a warning was issued in the front end at STMT. */
static bool
-already_warned_in_frontend_p (tree stmt)
+already_warned_in_frontend_p (gimple stmt)
{
- tree rhs_pointer;
-
- if (stmt == NULL_TREE)
+ if (stmt == NULL)
return false;
- rhs_pointer = get_rhs (stmt);
-
- if ((CONVERT_EXPR_P (rhs_pointer)
- || TREE_CODE (rhs_pointer) == VIEW_CONVERT_EXPR)
- && TREE_NO_WARNING (rhs_pointer))
+ if (gimple_assign_cast_p (stmt)
+ && TREE_NO_WARNING (gimple_assign_rhs1 (stmt)))
return true;
else
return false;
@@ -749,13 +780,13 @@ is_method_pointer (tree type)
case, that is where a pointer was assigned to the address of an object. */
static bool
-strict_aliasing_warn (tree alias_site,
+strict_aliasing_warn (gimple alias_site,
tree object1, bool is_ptr1,
tree object2, bool is_ptr2,
bool filter_artificials)
{
- tree ref_site1 = NULL_TREE;
- tree ref_site2 = NULL_TREE;
+ gimple ref_site1 = NULL;
+ gimple ref_site2 = NULL;
const char *name1;
const char *name2;
location_t alias_loc;
@@ -773,18 +804,18 @@ strict_aliasing_warn (tree alias_site,
maybe_find_missing_stmts (object1, is_ptr1, object2, is_ptr2, &alias_site,
&ref_site1, &ref_site2);
- if (EXPR_HAS_LOCATION (alias_site))
- alias_loc = EXPR_LOCATION (alias_site);
+ if (gimple_has_location (alias_site))
+ alias_loc = gimple_location (alias_site);
else
return false;
- if (EXPR_HAS_LOCATION (ref_site1))
- ref1_loc = EXPR_LOCATION (ref_site1);
+ if (gimple_has_location (ref_site1))
+ ref1_loc = gimple_location (ref_site1);
else
ref1_loc = alias_loc;
- if (EXPR_HAS_LOCATION (ref_site2))
- ref2_loc = EXPR_LOCATION (ref_site2);
+ if (gimple_has_location (ref_site2))
+ ref2_loc = gimple_location (ref_site2);
else
ref2_loc = alias_loc;
@@ -858,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. */
@@ -900,7 +935,7 @@ skip_this_pointer (tree ptr ATTRIBUTE_UNUSED, struct ptr_info_def *pi)
/* Find aliasing to named objects for pointer PTR. */
static void
-dsa_named_for (tree ptr)
+dsa_named_for (tree ptr ATTRIBUTE_UNUSED)
{
struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr);
@@ -970,7 +1005,7 @@ processed_func_p (tree func)
void **slot = NULL;
if (!seen)
- seen = htab_create (10, tree_map_base_hash, tree_map_eq, NULL);
+ seen = htab_create (10, gimple_tree_map_hash, gimple_tree_map_eq, NULL);
slot = htab_find_slot (seen, &func, INSERT);
gcc_assert (slot);
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 3aa79feddd6..e1540f3b8f8 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -1,5 +1,5 @@
/* Alias analysis for trees.
- Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
Contributed by Diego Novillo <dnovillo@redhat.com>
This file is part of GCC.
@@ -35,7 +35,7 @@ along with GCC; see the file COPYING3. If not see
#include "function.h"
#include "diagnostic.h"
#include "tree-dump.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-flow.h"
#include "tree-inline.h"
#include "tree-pass.h"
@@ -752,7 +752,7 @@ static void
count_mem_refs (long *num_vuses_p, long *num_vdefs_p,
long *num_partitioned_p, long *num_unpartitioned_p)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
basic_block bb;
long num_vdefs, num_vuses, num_partitioned, num_unpartitioned;
referenced_var_iterator rvi;
@@ -762,10 +762,10 @@ count_mem_refs (long *num_vuses_p, long *num_vdefs_p,
if (num_vuses_p || num_vdefs_p)
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))
{
- tree stmt = bsi_stmt (bsi);
- if (stmt_references_memory_p (stmt))
+ gimple stmt = gsi_stmt (gsi);
+ if (gimple_references_memory_p (stmt))
{
num_vuses += NUM_SSA_OPERANDS (stmt, SSA_OP_VUSE);
num_vdefs += NUM_SSA_OPERANDS (stmt, SSA_OP_VDEF);
@@ -1006,7 +1006,7 @@ debug_mp_info (VEC(mem_sym_stats_t,heap) *mp_info)
recorded by this function, see compute_memory_partitions). */
void
-update_mem_sym_stats_from_stmt (tree var, tree stmt, long num_direct_reads,
+update_mem_sym_stats_from_stmt (tree var, gimple stmt, long num_direct_reads,
long num_direct_writes)
{
mem_sym_stats_t stats;
@@ -1016,11 +1016,11 @@ update_mem_sym_stats_from_stmt (tree var, tree stmt, long num_direct_reads,
stats = get_mem_sym_stats_for (var);
stats->num_direct_reads += num_direct_reads;
- stats->frequency_reads += ((long) bb_for_stmt (stmt)->frequency
+ stats->frequency_reads += ((long) gimple_bb (stmt)->frequency
* num_direct_reads);
stats->num_direct_writes += num_direct_writes;
- stats->frequency_writes += ((long) bb_for_stmt (stmt)->frequency
+ stats->frequency_writes += ((long) gimple_bb (stmt)->frequency
* num_direct_writes);
}
@@ -1629,7 +1629,6 @@ done:
timevar_pop (TV_MEMORY_PARTITIONING);
}
-
/* Compute may-alias information for every variable referenced in function
FNDECL.
@@ -1812,11 +1811,11 @@ compute_may_aliases (void)
/* Populate all virtual operands and newly promoted register operands. */
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
basic_block bb;
FOR_EACH_BB (bb)
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- update_stmt_if_modified (bsi_stmt (bsi));
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ update_stmt_if_modified (gsi_stmt (gsi));
}
/* Debugging dumps. */
@@ -1852,7 +1851,8 @@ compute_may_aliases (void)
struct count_ptr_d
{
tree ptr;
- unsigned count;
+ unsigned num_stores;
+ unsigned num_loads;
};
@@ -1862,7 +1862,8 @@ struct count_ptr_d
static tree
count_ptr_derefs (tree *tp, int *walk_subtrees, void *data)
{
- struct count_ptr_d *count_p = (struct count_ptr_d *) data;
+ struct walk_stmt_info *wi_p = (struct walk_stmt_info *) data;
+ struct count_ptr_d *count_p = (struct count_ptr_d *) wi_p->info;
/* Do not walk inside ADDR_EXPR nodes. In the expression &ptr->fld,
pointer 'ptr' is *not* dereferenced, it is simply used to compute
@@ -1874,7 +1875,12 @@ count_ptr_derefs (tree *tp, int *walk_subtrees, void *data)
}
if (INDIRECT_REF_P (*tp) && TREE_OPERAND (*tp, 0) == count_p->ptr)
- count_p->count++;
+ {
+ if (wi_p->is_lhs)
+ count_p->num_stores++;
+ else
+ count_p->num_loads++;
+ }
return NULL_TREE;
}
@@ -1887,7 +1893,7 @@ count_ptr_derefs (tree *tp, int *walk_subtrees, void *data)
stored in *NUM_STORES_P and *NUM_LOADS_P. */
void
-count_uses_and_derefs (tree ptr, tree stmt, unsigned *num_uses_p,
+count_uses_and_derefs (tree ptr, gimple stmt, unsigned *num_uses_p,
unsigned *num_loads_p, unsigned *num_stores_p)
{
ssa_op_iter i;
@@ -1909,59 +1915,24 @@ count_uses_and_derefs (tree ptr, tree stmt, unsigned *num_uses_p,
find all the indirect and direct uses of x_1 inside. The only
shortcut we can take is the fact that GIMPLE only allows
INDIRECT_REFs inside the expressions below. */
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- || (TREE_CODE (stmt) == RETURN_EXPR
- && TREE_CODE (TREE_OPERAND (stmt, 0)) == GIMPLE_MODIFY_STMT)
- || TREE_CODE (stmt) == ASM_EXPR
- || TREE_CODE (stmt) == CALL_EXPR)
+ if (is_gimple_assign (stmt)
+ || gimple_code (stmt) == GIMPLE_RETURN
+ || gimple_code (stmt) == GIMPLE_ASM
+ || is_gimple_call (stmt))
{
- tree lhs, rhs;
+ struct walk_stmt_info wi;
+ struct count_ptr_d count;
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
- {
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- }
- else if (TREE_CODE (stmt) == RETURN_EXPR)
- {
- tree e = TREE_OPERAND (stmt, 0);
- lhs = GIMPLE_STMT_OPERAND (e, 0);
- rhs = GIMPLE_STMT_OPERAND (e, 1);
- }
- else if (TREE_CODE (stmt) == ASM_EXPR)
- {
- lhs = ASM_OUTPUTS (stmt);
- rhs = ASM_INPUTS (stmt);
- }
- else
- {
- lhs = NULL_TREE;
- rhs = stmt;
- }
+ count.ptr = ptr;
+ count.num_stores = 0;
+ count.num_loads = 0;
- if (lhs
- && (TREE_CODE (lhs) == TREE_LIST
- || EXPR_P (lhs)
- || GIMPLE_STMT_P (lhs)))
- {
- struct count_ptr_d count;
- count.ptr = ptr;
- count.count = 0;
- walk_tree (&lhs, count_ptr_derefs, &count, NULL);
- *num_stores_p = count.count;
- }
+ memset (&wi, 0, sizeof (wi));
+ wi.info = &count;
+ walk_gimple_op (stmt, count_ptr_derefs, &wi);
- if (rhs
- && (TREE_CODE (rhs) == TREE_LIST
- || EXPR_P (rhs)
- || GIMPLE_STMT_P (rhs)))
- {
- struct count_ptr_d count;
- count.ptr = ptr;
- count.count = 0;
- walk_tree (&rhs, count_ptr_derefs, &count, NULL);
- *num_loads_p = count.count;
- }
+ *num_stores_p = count.num_stores;
+ *num_loads_p = count.num_loads;
}
gcc_assert (*num_uses_p >= *num_loads_p + *num_stores_p);
@@ -2503,7 +2474,7 @@ create_alias_map_for (tree var, struct alias_info *ai)
ADDRESSABLE_VARS. */
static void
-update_alias_info_1 (tree stmt, struct alias_info *ai)
+update_alias_info_1 (gimple stmt, struct alias_info *ai)
{
bitmap addr_taken;
use_operand_p use_p;
@@ -2525,7 +2496,7 @@ update_alias_info_1 (tree stmt, struct alias_info *ai)
mem_ref_stats->num_asm_sites++;
/* Mark all the variables whose address are taken by the statement. */
- addr_taken = addresses_taken (stmt);
+ addr_taken = gimple_addresses_taken (stmt);
if (addr_taken)
bitmap_ior_into (gimple_addressable_vars (cfun), addr_taken);
@@ -2547,7 +2518,7 @@ update_alias_info_1 (tree stmt, struct alias_info *ai)
{
bitmap addressable_vars = gimple_addressable_vars (cfun);
- gcc_assert (TREE_CODE (stmt) == PHI_NODE);
+ gcc_assert (gimple_code (stmt) == GIMPLE_PHI);
gcc_assert (addressable_vars);
/* PHI nodes don't have annotations for pinning the set
@@ -2587,7 +2558,7 @@ update_alias_info_1 (tree stmt, struct alias_info *ai)
/* If STMT is a PHI node, then it will not have pointer
dereferences and it will not be an escape point. */
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
continue;
/* Determine whether OP is a dereferenced pointer, and if STMT
@@ -2621,13 +2592,13 @@ update_alias_info_1 (tree stmt, struct alias_info *ai)
are not GIMPLE invariants), they can only appear on the RHS
of an assignment and their base address is always an
INDIRECT_REF expression. */
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == ADDR_EXPR
- && !is_gimple_val (GIMPLE_STMT_OPERAND (stmt, 1)))
+ if (is_gimple_assign (stmt)
+ && gimple_assign_rhs_code (stmt) == ADDR_EXPR
+ && !is_gimple_val (gimple_assign_rhs1 (stmt)))
{
/* If the RHS if of the form &PTR->FLD and PTR == OP, then
this represents a potential dereference of PTR. */
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ tree rhs = gimple_assign_rhs1 (stmt);
tree base = get_base_address (TREE_OPERAND (rhs, 0));
if (TREE_CODE (base) == INDIRECT_REF
&& TREE_OPERAND (base, 0) == op)
@@ -2673,7 +2644,7 @@ update_alias_info_1 (tree stmt, struct alias_info *ai)
/* If the statement makes a function call, assume
that pointer OP will be dereferenced in a store
operation inside the called function. */
- if (get_call_expr_in (stmt)
+ if (is_gimple_call (stmt)
|| stmt_escape_type == ESCAPE_STORED_IN_GLOBAL)
{
pointer_set_insert (ai->dereferenced_ptrs_store, var);
@@ -2682,12 +2653,12 @@ update_alias_info_1 (tree stmt, struct alias_info *ai)
}
}
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
return;
/* Mark stored variables in STMT as being written to and update the
memory reference stats for all memory symbols referenced by STMT. */
- if (stmt_references_memory_p (stmt))
+ if (gimple_references_memory_p (stmt))
{
unsigned i;
bitmap_iterator bi;
@@ -2716,8 +2687,8 @@ update_alias_info_1 (tree stmt, struct alias_info *ai)
dereferences (e.g., MEMORY_VAR = *PTR) or if a call site has
memory symbols in its argument list, but these cases do not
occur so frequently as to constitute a serious problem. */
- if (STORED_SYMS (stmt))
- EXECUTE_IF_SET_IN_BITMAP (STORED_SYMS (stmt), 0, i, bi)
+ if (gimple_stored_syms (stmt))
+ EXECUTE_IF_SET_IN_BITMAP (gimple_stored_syms (stmt), 0, i, bi)
{
tree sym = referenced_var (i);
pointer_set_insert (ai->written_vars, sym);
@@ -2729,11 +2700,11 @@ update_alias_info_1 (tree stmt, struct alias_info *ai)
}
if (!stmt_dereferences_ptr_p
- && LOADED_SYMS (stmt)
+ && gimple_loaded_syms (stmt)
&& stmt_escape_type != ESCAPE_TO_CALL
&& stmt_escape_type != ESCAPE_TO_PURE_CONST
&& stmt_escape_type != ESCAPE_TO_ASM)
- EXECUTE_IF_SET_IN_BITMAP (LOADED_SYMS (stmt), 0, i, bi)
+ EXECUTE_IF_SET_IN_BITMAP (gimple_loaded_syms (stmt), 0, i, bi)
update_mem_sym_stats_from_stmt (referenced_var (i), stmt, 1, 0);
}
}
@@ -2749,15 +2720,18 @@ update_alias_info (struct alias_info *ai)
FOR_EACH_BB (bb)
{
- block_stmt_iterator bsi;
- tree phi;
+ gimple_stmt_iterator gsi;
+ gimple phi;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- if (is_gimple_reg (PHI_RESULT (phi)))
- update_alias_info_1 (phi, ai);
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ phi = gsi_stmt (gsi);
+ if (is_gimple_reg (PHI_RESULT (phi)))
+ update_alias_info_1 (phi, ai);
+ }
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- update_alias_info_1 (bsi_stmt (bsi), ai);
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ update_alias_info_1 (gsi_stmt (gsi), ai);
}
}
@@ -3059,11 +3033,11 @@ may_alias_p (tree ptr, alias_set_type mem_alias_set,
/* The star count is -1 if the type at the end of the
pointer_to chain is not a record or union type. */
- if (!alias_set_only
- && ipa_type_escape_star_count_of_interesting_type (var_type) >= 0)
+ if (!alias_set_only &&
+ 0 /* FIXME tuples ipa_type_escape_star_count_of_interesting_type (var_type) >= 0*/)
{
int ptr_star_count = 0;
-
+
/* ipa_type_escape_star_count_of_interesting_type is a
little too restrictive for the pointer type, need to
allow pointers to primitive types as long as those
@@ -3185,21 +3159,20 @@ set_pt_anything (tree ptr)
if none. */
enum escape_type
-is_escape_site (tree stmt)
+is_escape_site (gimple stmt)
{
- tree call = get_call_expr_in (stmt);
- if (call != NULL_TREE)
+ if (is_gimple_call (stmt))
{
- if (!TREE_SIDE_EFFECTS (call))
+ if (gimple_call_flags (stmt) & (ECF_PURE | ECF_CONST))
return ESCAPE_TO_PURE_CONST;
return ESCAPE_TO_CALL;
}
- else if (TREE_CODE (stmt) == ASM_EXPR)
+ else if (gimple_code (stmt) == GIMPLE_ASM)
return ESCAPE_TO_ASM;
- else if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ else if (is_gimple_assign (stmt))
{
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
+ tree lhs = gimple_assign_lhs (stmt);
/* Get to the base of _REF nodes. */
if (TREE_CODE (lhs) != SSA_NAME)
@@ -3210,12 +3183,10 @@ is_escape_site (tree stmt)
if (lhs == NULL_TREE)
return ESCAPE_UNKNOWN;
- if (CONVERT_EXPR_P (GIMPLE_STMT_OPERAND (stmt, 1))
- || TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == VIEW_CONVERT_EXPR)
+ if (gimple_assign_cast_p (stmt))
{
- tree from
- = TREE_TYPE (TREE_OPERAND (GIMPLE_STMT_OPERAND (stmt, 1), 0));
- tree to = TREE_TYPE (GIMPLE_STMT_OPERAND (stmt, 1));
+ tree from = TREE_TYPE (gimple_assign_rhs1 (stmt));
+ tree to = TREE_TYPE (lhs);
/* If the RHS is a conversion between a pointer and an integer, the
pointer escapes since we can't track the integer. */
@@ -3245,7 +3216,7 @@ is_escape_site (tree stmt)
Applications (OOPSLA), pp. 1-19, 1999. */
return ESCAPE_STORED_IN_GLOBAL;
}
- else if (TREE_CODE (stmt) == RETURN_EXPR)
+ else if (gimple_code (stmt) == RETURN_EXPR)
return ESCAPE_TO_RETURN;
return NO_ESCAPE;
@@ -3539,7 +3510,6 @@ get_ptr_info (tree t)
return pi;
}
-
/* Dump points-to information for SSA_NAME PTR into FILE. */
void
@@ -3595,10 +3565,10 @@ debug_points_to_info_for (tree var)
it needs to traverse the whole CFG looking for pointer SSA_NAMEs. */
void
-dump_points_to_info (FILE *file)
+dump_points_to_info (FILE *file ATTRIBUTE_UNUSED)
{
basic_block bb;
- block_stmt_iterator si;
+ gimple_stmt_iterator si;
ssa_op_iter iter;
const char *fname =
lang_hooks.decl_printable_name (current_function_decl, 2);
@@ -3623,18 +3593,17 @@ dump_points_to_info (FILE *file)
/* Dump points-to information for every pointer defined in the program. */
FOR_EACH_BB (bb)
{
- tree phi;
-
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
{
+ gimple phi = gsi_stmt (si);
tree ptr = PHI_RESULT (phi);
if (POINTER_TYPE_P (TREE_TYPE (ptr)))
dump_points_to_info_for (file, ptr);
}
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
- tree stmt = bsi_stmt (si);
+ gimple stmt = gsi_stmt (si);
tree def;
FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_DEF)
if (TREE_CODE (def) == SSA_NAME
@@ -3689,7 +3658,6 @@ debug_may_aliases_for (tree var)
dump_may_aliases_for (stderr, var);
}
-
/* Return true if VAR may be aliased. */
bool
@@ -3714,17 +3682,7 @@ may_be_aliased (tree var)
if (!TREE_STATIC (var))
return false;
- /* If we're in unit-at-a-time mode, then we must have seen all
- occurrences of address-of operators, and so we can trust
- TREE_ADDRESSABLE. Otherwise we can only be sure the variable
- isn't addressable if it's local to the current function. */
- if (flag_unit_at_a_time)
- return false;
-
- if (decl_function_context (var) == current_function_decl)
- return false;
-
- return true;
+ return false;
}
/* The following is based on code in add_stmt_operand to ensure that the
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 4b6fe6a1b69..870a244ac6d 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -227,9 +227,6 @@ typedef enum
doing the store). */
static prop_value_t *const_val;
-/* True if we are also propagating constants in stores and loads. */
-static bool do_store_ccp;
-
/* Dump constant propagation value VAL to file OUTF prefixed by PREFIX. */
static void
@@ -268,6 +265,7 @@ debug_lattice_value (prop_value_t val)
}
+
/* If SYM is a constant variable with known value, return the value.
NULL_TREE is returned otherwise. */
@@ -320,10 +318,10 @@ static prop_value_t
get_default_value (tree var)
{
tree sym = SSA_NAME_VAR (var);
- prop_value_t val = { UNINITIALIZED, NULL_TREE, NULL_TREE };
+ prop_value_t val = { UNINITIALIZED, NULL_TREE };
tree cst_val;
- if (!do_store_ccp && !is_gimple_reg (var))
+ if (!is_gimple_reg (var))
{
/* Short circuit for regular CCP. We are not interested in any
non-register when DO_STORE_CCP is false. */
@@ -335,13 +333,12 @@ get_default_value (tree var)
initial value. */
val.lattice_val = CONSTANT;
val.value = cst_val;
- val.mem_ref = sym;
}
else
{
- tree stmt = SSA_NAME_DEF_STMT (var);
+ gimple stmt = SSA_NAME_DEF_STMT (var);
- if (IS_EMPTY_STMT (stmt))
+ if (gimple_nop_p (stmt))
{
/* Variables defined by an empty statement are those used
before being initialized. If VAR is a local variable, we
@@ -352,9 +349,13 @@ get_default_value (tree var)
else
val.lattice_val = VARYING;
}
- else if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- || TREE_CODE (stmt) == PHI_NODE)
- {
+ else if (is_gimple_assign (stmt)
+ /* Value-returning GIMPLE_CALL statements assign to
+ a variable, and are treated similarly to GIMPLE_ASSIGN. */
+ || (is_gimple_call (stmt)
+ && gimple_call_lhs (stmt) != NULL_TREE)
+ || gimple_code (stmt) == GIMPLE_PHI)
+ {
/* Any other variable defined by an assignment or a PHI node
is considered UNDEFINED. */
val.lattice_val = UNDEFINED;
@@ -396,7 +397,6 @@ set_value_varying (tree var)
val->lattice_val = VARYING;
val->value = NULL_TREE;
- val->mem_ref = NULL_TREE;
}
/* For float types, modify the value of VAL to make ccp work correctly
@@ -442,7 +442,6 @@ canonicalize_float_value (prop_value_t *val)
{
val->lattice_val = UNDEFINED;
val->value = NULL;
- val->mem_ref = NULL;
return;
}
}
@@ -464,8 +463,7 @@ set_lattice_value (tree var, prop_value_t new_val)
gcc_assert (old_val->lattice_val < new_val.lattice_val
|| (old_val->lattice_val == new_val.lattice_val
&& ((!old_val->value && !new_val.value)
- || operand_equal_p (old_val->value, new_val.value, 0))
- && old_val->mem_ref == new_val.mem_ref));
+ || operand_equal_p (old_val->value, new_val.value, 0))));
if (old_val->lattice_val != new_val.lattice_val)
{
@@ -497,43 +495,49 @@ set_lattice_value (tree var, prop_value_t new_val)
Else return VARYING. */
static ccp_lattice_t
-likely_value (tree stmt)
+likely_value (gimple stmt)
{
bool has_constant_operand, has_undefined_operand, all_undefined_operands;
- stmt_ann_t ann;
tree use;
ssa_op_iter iter;
- ann = stmt_ann (stmt);
+ enum tree_code code = gimple_code (stmt);
+
+ /* This function appears to be called only for assignments, calls,
+ conditionals, and switches, due to the logic in visit_stmt. */
+ gcc_assert (code == GIMPLE_ASSIGN
+ || code == GIMPLE_CALL
+ || code == GIMPLE_COND
+ || code == GIMPLE_SWITCH);
/* If the statement has volatile operands, it won't fold to a
constant value. */
- if (ann->has_volatile_ops)
+ if (gimple_has_volatile_ops (stmt))
return VARYING;
/* If we are not doing store-ccp, statements with loads
and/or stores will never fold into a constant. */
- if (!do_store_ccp
- && !ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS))
+ if (!ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS))
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 (gimple_assign_single_p (stmt)
+ && is_gimple_min_invariant (gimple_assign_rhs1 (stmt)))
+ return CONSTANT;
- /* A CALL_EXPR is assumed to be varying. NOTE: This may be overly
- conservative, in the presence of const and pure calls. */
- if (get_call_expr_in (stmt) != NULL_TREE)
- return VARYING;
-
- /* Anything other than assignments and conditional jumps are not
- interesting for CCP. */
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT
- && !(TREE_CODE (stmt) == RETURN_EXPR && get_rhs (stmt) != NULL_TREE)
- && TREE_CODE (stmt) != COND_EXPR
- && TREE_CODE (stmt) != SWITCH_EXPR)
- return VARYING;
+ if (code == GIMPLE_COND
+ && is_gimple_min_invariant (gimple_cond_lhs (stmt))
+ && is_gimple_min_invariant (gimple_cond_rhs (stmt)))
+ return CONSTANT;
- if (is_gimple_min_invariant (get_rhs (stmt)))
+ if (code == GIMPLE_SWITCH
+ && is_gimple_min_invariant (gimple_switch_index (stmt)))
return CONSTANT;
+ /* Arrive here for more complex cases. */
+
has_constant_operand = false;
has_undefined_operand = false;
all_undefined_operands = true;
@@ -553,13 +557,11 @@ likely_value (tree stmt)
/* If the operation combines operands like COMPLEX_EXPR make sure to
not mark the result UNDEFINED if only one part of the result is
undefined. */
- if (has_undefined_operand
- && all_undefined_operands)
+ if (has_undefined_operand && all_undefined_operands)
return UNDEFINED;
- else if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && has_undefined_operand)
+ else if (code == GIMPLE_ASSIGN && has_undefined_operand)
{
- switch (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)))
+ switch (gimple_assign_rhs_code (stmt))
{
/* Unary operators are handled with all_undefined_operands. */
case PLUS_EXPR:
@@ -595,34 +597,33 @@ likely_value (tree stmt)
/* Returns true if STMT cannot be constant. */
static bool
-surely_varying_stmt_p (tree stmt)
+surely_varying_stmt_p (gimple stmt)
{
/* If the statement has operands that we cannot handle, it cannot be
constant. */
- if (stmt_ann (stmt)->has_volatile_ops)
+ if (gimple_has_volatile_ops (stmt))
return true;
if (!ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS))
- {
- if (!do_store_ccp)
- return true;
+ return true;
- /* We can only handle simple loads and stores. */
- if (!stmt_makes_single_load (stmt)
- && !stmt_makes_single_store (stmt))
+ /* 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))
+ {
+ tree fndecl;
+ if (!gimple_call_lhs (stmt)
+ || ((fndecl = gimple_call_fndecl (stmt)) != NULL_TREE
+ && !DECL_BUILT_IN (fndecl)))
return true;
}
- /* If it contains a call, it is varying. */
- if (get_call_expr_in (stmt) != NULL_TREE)
- return true;
-
/* Anything other than assignments and conditional jumps are not
interesting for CCP. */
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT
- && !(TREE_CODE (stmt) == RETURN_EXPR && get_rhs (stmt) != NULL_TREE)
- && TREE_CODE (stmt) != COND_EXPR
- && TREE_CODE (stmt) != SWITCH_EXPR)
+ if (gimple_code (stmt) != GIMPLE_ASSIGN
+ && gimple_code (stmt) != GIMPLE_COND
+ && gimple_code (stmt) != GIMPLE_SWITCH
+ && gimple_code (stmt) != GIMPLE_CALL)
return true;
return false;
@@ -640,11 +641,11 @@ ccp_initialize (void)
/* Initialize simulation flags for PHI nodes and statements. */
FOR_EACH_BB (bb)
{
- block_stmt_iterator i;
+ gimple_stmt_iterator i;
- for (i = bsi_start (bb); !bsi_end_p (i); bsi_next (&i))
+ for (i = gsi_start_bb (bb); !gsi_end_p (i); gsi_next (&i))
{
- tree stmt = bsi_stmt (i);
+ gimple stmt = gsi_stmt (i);
bool is_varying = surely_varying_stmt_p (stmt);
if (is_varying)
@@ -660,24 +661,25 @@ ccp_initialize (void)
set_value_varying (def);
}
}
-
- DONT_SIMULATE_AGAIN (stmt) = is_varying;
+ prop_set_simulate_again (stmt, !is_varying);
}
}
- /* Now process PHI nodes. We never set DONT_SIMULATE_AGAIN on phi node,
- since we do not know which edges are executable yet, except for
- phi nodes for virtual operands when we do not do store ccp. */
+ /* Now process PHI nodes. We never clear the simulate_again flag on
+ phi nodes, since we do not know which edges are executable yet,
+ except for phi nodes for virtual operands when we do not do store ccp. */
FOR_EACH_BB (bb)
{
- tree phi;
+ gimple_stmt_iterator i;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- {
- if (!do_store_ccp && !is_gimple_reg (PHI_RESULT (phi)))
- DONT_SIMULATE_AGAIN (phi) = true;
+ for (i = gsi_start_phis (bb); !gsi_end_p (i); gsi_next (&i))
+ {
+ gimple phi = gsi_stmt (i);
+
+ if (!is_gimple_reg (gimple_phi_result (phi)))
+ prop_set_simulate_again (phi, false);
else
- DONT_SIMULATE_AGAIN (phi) = false;
+ prop_set_simulate_again (phi, true);
}
}
}
@@ -729,14 +731,10 @@ ccp_lattice_meet (prop_value_t *val1, prop_value_t *val2)
/* any M VARYING = VARYING. */
val1->lattice_val = VARYING;
val1->value = NULL_TREE;
- val1->mem_ref = NULL_TREE;
}
else if (val1->lattice_val == CONSTANT
&& val2->lattice_val == CONSTANT
- && simple_cst_equal (val1->value, val2->value) == 1
- && (!do_store_ccp
- || (val1->mem_ref && val2->mem_ref
- && operand_equal_p (val1->mem_ref, val2->mem_ref, 0))))
+ && simple_cst_equal (val1->value, val2->value) == 1)
{
/* Ci M Cj = Ci if (i == j)
Ci M Cj = VARYING if (i != j)
@@ -745,14 +743,12 @@ ccp_lattice_meet (prop_value_t *val1, prop_value_t *val2)
they come from the same memory reference. */
val1->lattice_val = CONSTANT;
val1->value = val1->value;
- val1->mem_ref = val1->mem_ref;
}
else
{
/* Any other combination is VARYING. */
val1->lattice_val = VARYING;
val1->value = NULL_TREE;
- val1->mem_ref = NULL_TREE;
}
}
@@ -763,18 +759,18 @@ ccp_lattice_meet (prop_value_t *val1, prop_value_t *val2)
of the PHI node that are incoming via executable edges. */
static enum ssa_prop_result
-ccp_visit_phi_node (tree phi)
+ccp_visit_phi_node (gimple phi)
{
- int i;
+ unsigned i;
prop_value_t *old_val, new_val;
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "\nVisiting PHI node: ");
- print_generic_expr (dump_file, phi, dump_flags);
+ print_gimple_stmt (dump_file, phi, 0, dump_flags);
}
- old_val = get_value (PHI_RESULT (phi));
+ old_val = get_value (gimple_phi_result (phi));
switch (old_val->lattice_val)
{
case VARYING:
@@ -787,18 +783,17 @@ ccp_visit_phi_node (tree phi)
case UNDEFINED:
new_val.lattice_val = UNDEFINED;
new_val.value = NULL_TREE;
- new_val.mem_ref = NULL_TREE;
break;
default:
gcc_unreachable ();
}
- for (i = 0; i < PHI_NUM_ARGS (phi); i++)
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
{
/* Compute the meet operator over all the PHI arguments flowing
through executable edges. */
- edge e = PHI_ARG_EDGE (phi, i);
+ edge e = gimple_phi_arg_edge (phi, i);
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -812,14 +807,13 @@ ccp_visit_phi_node (tree phi)
the existing value of the PHI node and the current PHI argument. */
if (e->flags & EDGE_EXECUTABLE)
{
- tree arg = PHI_ARG_DEF (phi, i);
+ tree arg = gimple_phi_arg (phi, i)->def;
prop_value_t arg_val;
if (is_gimple_min_invariant (arg))
{
arg_val.lattice_val = CONSTANT;
arg_val.value = arg;
- arg_val.mem_ref = NULL_TREE;
}
else
arg_val = *(get_value (arg));
@@ -846,7 +840,7 @@ ccp_visit_phi_node (tree phi)
}
/* Make the transition to the new value. */
- if (set_lattice_value (PHI_RESULT (phi), new_val))
+ if (set_lattice_value (gimple_phi_result (phi), new_val))
{
if (new_val.lattice_val == VARYING)
return SSA_PROP_VARYING;
@@ -865,179 +859,248 @@ ccp_visit_phi_node (tree phi)
operands are constants.
If simplification is possible, return the simplified RHS,
- otherwise return the original RHS. */
+ otherwise return the original RHS or NULL_TREE. */
static tree
-ccp_fold (tree stmt)
+ccp_fold (gimple stmt)
{
- tree rhs = get_rhs (stmt);
- enum tree_code code = TREE_CODE (rhs);
- enum tree_code_class kind = TREE_CODE_CLASS (code);
- tree retval = NULL_TREE;
-
- if (TREE_CODE (rhs) == SSA_NAME)
- {
- /* If the RHS is an SSA_NAME, return its known constant value,
- if any. */
- return get_value (rhs)->value;
- }
- else if (do_store_ccp && stmt_makes_single_load (stmt))
+ switch (gimple_code (stmt))
{
- /* If the RHS is a memory load, see if the VUSEs associated with
- it are a valid constant for that memory load. */
- prop_value_t *val = get_value_loaded_by (stmt, const_val);
- if (val && val->mem_ref)
- {
- if (operand_equal_p (val->mem_ref, rhs, 0))
- return val->value;
-
- /* If RHS is extracting REALPART_EXPR or IMAGPART_EXPR of a
- complex type with a known constant value, return it. */
- if ((TREE_CODE (rhs) == REALPART_EXPR
- || TREE_CODE (rhs) == IMAGPART_EXPR)
- && operand_equal_p (val->mem_ref, TREE_OPERAND (rhs, 0), 0))
- return fold_build1 (TREE_CODE (rhs), TREE_TYPE (rhs), val->value);
- }
- return NULL_TREE;
- }
+ case GIMPLE_ASSIGN:
+ {
+ enum tree_code subcode = gimple_assign_rhs_code (stmt);
+
+ switch (get_gimple_rhs_class (subcode))
+ {
+ case GIMPLE_SINGLE_RHS:
+ {
+ tree rhs = gimple_assign_rhs1 (stmt);
+ enum tree_code_class kind = TREE_CODE_CLASS (subcode);
+
+ if (TREE_CODE (rhs) == SSA_NAME)
+ {
+ /* If the RHS is an SSA_NAME, return its known constant value,
+ if any. */
+ return get_value (rhs)->value;
+ }
+ /* Handle propagating invariant addresses into address operations.
+ The folding we do here matches that in tree-ssa-forwprop.c. */
+ else if (TREE_CODE (rhs) == ADDR_EXPR)
+ {
+ tree *base;
+ base = &TREE_OPERAND (rhs, 0);
+ while (handled_component_p (*base))
+ base = &TREE_OPERAND (*base, 0);
+ if (TREE_CODE (*base) == INDIRECT_REF
+ && TREE_CODE (TREE_OPERAND (*base, 0)) == SSA_NAME)
+ {
+ prop_value_t *val = get_value (TREE_OPERAND (*base, 0));
+ if (val->lattice_val == CONSTANT
+ && TREE_CODE (val->value) == ADDR_EXPR
+ && useless_type_conversion_p
+ (TREE_TYPE (TREE_OPERAND (*base, 0)),
+ TREE_TYPE (val->value))
+ && useless_type_conversion_p
+ (TREE_TYPE (*base),
+ TREE_TYPE (TREE_OPERAND (val->value, 0))))
+ {
+ /* We need to return a new tree, not modify the IL
+ or share parts of it. So play some tricks to
+ avoid manually building it. */
+ tree ret, save = *base;
+ *base = TREE_OPERAND (val->value, 0);
+ ret = unshare_expr (rhs);
+ recompute_tree_invariant_for_addr_expr (ret);
+ *base = save;
+ return ret;
+ }
+ }
+ }
- /* Unary operators. Note that we know the single operand must
- be a constant. So this should almost always return a
- simplified RHS. */
- if (kind == tcc_unary)
- {
- /* Handle unary operators which can appear in GIMPLE form. */
- tree op0 = TREE_OPERAND (rhs, 0);
+ if (kind == tcc_reference)
+ {
+ 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;
+ }
+
+ case GIMPLE_UNARY_RHS:
+ {
+ /* Handle unary operators that can appear in GIMPLE form.
+ Note that we know the single operand must be a constant,
+ so this should almost always return a simplified RHS. */
+ tree lhs = gimple_assign_lhs (stmt);
+ tree op0 = gimple_assign_rhs1 (stmt);
+
+ /* Simplify the operand down to a constant. */
+ if (TREE_CODE (op0) == SSA_NAME)
+ {
+ prop_value_t *val = get_value (op0);
+ if (val->lattice_val == CONSTANT)
+ op0 = get_value (op0)->value;
+ }
+
+ /* Conversions are useless for CCP purposes if they are
+ value-preserving. Thus the restrictions that
+ useless_type_conversion_p places for pointer type conversions
+ do not apply here. Substitution later will only substitute to
+ allowed places. */
+ 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;
+ }
- /* Simplify the operand down to a constant. */
- if (TREE_CODE (op0) == SSA_NAME)
- {
- prop_value_t *val = get_value (op0);
- if (val->lattice_val == CONSTANT)
- op0 = get_value (op0)->value;
- }
+ return fold_unary (subcode, gimple_expr_type (stmt), op0);
+ }
+
+ case GIMPLE_BINARY_RHS:
+ {
+ /* Handle binary operators that can appear in GIMPLE form. */
+ tree op0 = gimple_assign_rhs1 (stmt);
+ tree op1 = gimple_assign_rhs2 (stmt);
+
+ /* Simplify the operands down to constants when appropriate. */
+ if (TREE_CODE (op0) == SSA_NAME)
+ {
+ prop_value_t *val = get_value (op0);
+ if (val->lattice_val == CONSTANT)
+ op0 = val->value;
+ }
+
+ if (TREE_CODE (op1) == SSA_NAME)
+ {
+ prop_value_t *val = get_value (op1);
+ if (val->lattice_val == CONSTANT)
+ 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;
+ }
- /* Conversions are useless for CCP purposes if they are
- value-preserving. Thus the restrictions that
- useless_type_conversion_p places for pointer type conversions do
- not apply here. Substitution later will only substitute to
- allowed places. */
- if ((code == NOP_EXPR || code == CONVERT_EXPR)
- && ((POINTER_TYPE_P (TREE_TYPE (rhs))
- && POINTER_TYPE_P (TREE_TYPE (op0)))
- || useless_type_conversion_p (TREE_TYPE (rhs), TREE_TYPE (op0))))
- return op0;
- return fold_unary (code, TREE_TYPE (rhs), op0);
- }
-
- /* Binary and comparison operators. We know one or both of the
- operands are constants. */
- else if (kind == tcc_binary
- || kind == tcc_comparison
- || code == TRUTH_AND_EXPR
- || code == TRUTH_OR_EXPR
- || code == TRUTH_XOR_EXPR)
- {
- /* Handle binary and comparison operators that can appear in
- GIMPLE form. */
- tree op0 = TREE_OPERAND (rhs, 0);
- tree op1 = TREE_OPERAND (rhs, 1);
-
- /* Simplify the operands down to constants when appropriate. */
- if (TREE_CODE (op0) == SSA_NAME)
- {
- prop_value_t *val = get_value (op0);
- if (val->lattice_val == CONSTANT)
- op0 = val->value;
- }
+ return fold_binary (subcode, gimple_expr_type (stmt), op0, op1);
+ }
- if (TREE_CODE (op1) == SSA_NAME)
- {
- prop_value_t *val = get_value (op1);
- if (val->lattice_val == CONSTANT)
- op1 = val->value;
- }
+ default:
+ gcc_unreachable ();
+ }
+ }
+ break;
- return fold_binary (code, TREE_TYPE (rhs), op0, op1);
- }
+ case GIMPLE_CALL:
+ {
+ tree fn = gimple_call_fn (stmt);
+ prop_value_t *val;
- else if (kind == tcc_declaration)
- return get_symbol_constant_value (rhs);
+ 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;
+ }
- else if (kind == tcc_reference)
- return fold_const_aggregate_ref (rhs);
+ case GIMPLE_COND:
+ {
+ /* Handle comparison operators that can appear in GIMPLE form. */
+ tree op0 = gimple_cond_lhs (stmt);
+ tree op1 = gimple_cond_rhs (stmt);
+ enum tree_code code = gimple_cond_code (stmt);
+
+ /* Simplify the operands down to constants when appropriate. */
+ if (TREE_CODE (op0) == SSA_NAME)
+ {
+ prop_value_t *val = get_value (op0);
+ if (val->lattice_val == CONSTANT)
+ op0 = val->value;
+ }
+
+ if (TREE_CODE (op1) == SSA_NAME)
+ {
+ prop_value_t *val = get_value (op1);
+ if (val->lattice_val == CONSTANT)
+ op1 = val->value;
+ }
+
+ return fold_binary (code, boolean_type_node, op0, op1);
+ }
- /* Handle propagating invariant addresses into address operations.
- The folding we do here matches that in tree-ssa-forwprop.c. */
- else if (code == ADDR_EXPR)
- {
- tree *base;
- base = &TREE_OPERAND (rhs, 0);
- while (handled_component_p (*base))
- base = &TREE_OPERAND (*base, 0);
- if (TREE_CODE (*base) == INDIRECT_REF
- && TREE_CODE (TREE_OPERAND (*base, 0)) == SSA_NAME)
- {
- prop_value_t *val = get_value (TREE_OPERAND (*base, 0));
- if (val->lattice_val == CONSTANT
- && TREE_CODE (val->value) == ADDR_EXPR
- && useless_type_conversion_p (TREE_TYPE (TREE_OPERAND (*base, 0)),
- TREE_TYPE (val->value))
- && useless_type_conversion_p (TREE_TYPE (*base),
- TREE_TYPE (TREE_OPERAND (val->value, 0))))
- {
- /* We need to return a new tree, not modify the IL or share
- parts of it. So play some tricks to avoid manually
- building it. */
- tree ret, save = *base;
- *base = TREE_OPERAND (val->value, 0);
- ret = unshare_expr (rhs);
- recompute_tree_invariant_for_addr_expr (ret);
- *base = save;
- return ret;
- }
- }
- }
+ case GIMPLE_SWITCH:
+ {
+ tree rhs = gimple_switch_index (stmt);
- /* We may be able to fold away calls to builtin functions if their
- arguments are constants. */
- else if (code == CALL_EXPR
- && TREE_CODE (CALL_EXPR_FN (rhs)) == ADDR_EXPR
- && TREE_CODE (TREE_OPERAND (CALL_EXPR_FN (rhs), 0)) == FUNCTION_DECL
- && DECL_BUILT_IN (TREE_OPERAND (CALL_EXPR_FN (rhs), 0)))
- {
- if (!ZERO_SSA_OPERANDS (stmt, SSA_OP_USE))
- {
- tree *orig, var;
- size_t i = 0;
- ssa_op_iter iter;
- use_operand_p var_p;
-
- /* Preserve the original values of every operand. */
- orig = XNEWVEC (tree, NUM_SSA_OPERANDS (stmt, SSA_OP_USE));
- FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_USE)
- orig[i++] = var;
-
- /* Substitute operands with their values and try to fold. */
- replace_uses_in (stmt, NULL, const_val);
- retval = fold_call_expr (rhs, false);
-
- /* Restore operands to their original form. */
- i = 0;
- FOR_EACH_SSA_USE_OPERAND (var_p, stmt, iter, SSA_OP_USE)
- SET_USE (var_p, orig[i++]);
- free (orig);
- }
- }
- else
- return rhs;
+ if (TREE_CODE (rhs) == SSA_NAME)
+ {
+ /* If the RHS is an SSA_NAME, return its known constant value,
+ if any. */
+ return get_value (rhs)->value;
+ }
- /* If we got a simplified form, see if we need to convert its type. */
- if (retval)
- return fold_convert (TREE_TYPE (rhs), retval);
+ return rhs;
+ }
- /* No simplification was possible. */
- return rhs;
+ default:
+ gcc_unreachable ();
+ }
}
@@ -1206,29 +1269,47 @@ fold_const_aggregate_ref (tree t)
return NULL_TREE;
}
-
-/* Evaluate statement STMT. */
+
+/* Evaluate statement STMT.
+ Valid only for assignments, calls, conditionals, and switches. */
static prop_value_t
-evaluate_stmt (tree stmt)
+evaluate_stmt (gimple stmt)
{
prop_value_t val;
tree simplified = NULL_TREE;
ccp_lattice_t likelyvalue = likely_value (stmt);
bool is_constant;
- val.mem_ref = NULL_TREE;
-
fold_defer_overflow_warnings ();
/* If the statement is likely to have a CONSTANT result, then try
to fold the statement to determine the constant value. */
+ /* FIXME. This is the only place that we call ccp_fold.
+ Since likely_value never returns CONSTANT for calls, we will
+ not attempt to fold them, including builtins that may profit. */
if (likelyvalue == CONSTANT)
simplified = ccp_fold (stmt);
/* If the statement is likely to have a VARYING result, then do not
bother folding the statement. */
else if (likelyvalue == VARYING)
- simplified = get_rhs (stmt);
+ {
+ enum tree_code code = gimple_code (stmt);
+ if (code == GIMPLE_ASSIGN)
+ {
+ enum tree_code subcode = gimple_assign_rhs_code (stmt);
+
+ /* Other cases cannot satisfy is_gimple_min_invariant
+ without folding. */
+ if (get_gimple_rhs_class (subcode) == GIMPLE_SINGLE_RHS)
+ simplified = gimple_assign_rhs1 (stmt);
+ }
+ else if (code == GIMPLE_SWITCH)
+ simplified = gimple_switch_index (stmt);
+ else
+ /* These cannot satisfy is_gimple_min_invariant without folding. */
+ gcc_assert (code == GIMPLE_CALL || code == GIMPLE_COND);
+ }
is_constant = simplified && is_gimple_min_invariant (simplified);
@@ -1275,45 +1356,40 @@ evaluate_stmt (tree stmt)
return val;
}
-
/* Visit the assignment statement STMT. Set the value of its LHS to the
value computed by the RHS and store LHS in *OUTPUT_P. If STMT
creates virtual definitions, set the value of each new name to that
- of the RHS (if we can derive a constant out of the RHS). */
+ of the RHS (if we can derive a constant out of the RHS).
+ Value-returning call statements also perform an assignment, and
+ are handled here. */
static enum ssa_prop_result
-visit_assignment (tree stmt, tree *output_p)
+visit_assignment (gimple stmt, tree *output_p)
{
prop_value_t val;
- tree lhs, rhs;
enum ssa_prop_result retval;
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ tree lhs = gimple_get_lhs (stmt);
- if (TREE_CODE (rhs) == SSA_NAME)
- {
- /* For a simple copy operation, we copy the lattice values. */
- prop_value_t *nval = get_value (rhs);
- val = *nval;
- }
- else if (do_store_ccp && stmt_makes_single_load (stmt))
+ gcc_assert (gimple_code (stmt) != GIMPLE_CALL
+ || gimple_call_lhs (stmt) != NULL_TREE);
+
+ if (gimple_assign_copy_p (stmt))
{
- /* Same as above, but the RHS is not a gimple register and yet
- has a known VUSE. If STMT is loading from the same memory
- location that created the SSA_NAMEs for the virtual operands,
- we can propagate the value on the RHS. */
- prop_value_t *nval = get_value_loaded_by (stmt, const_val);
+ tree rhs = gimple_assign_rhs1 (stmt);
- if (nval
- && nval->mem_ref
- && operand_equal_p (nval->mem_ref, rhs, 0))
- val = *nval;
+ if (TREE_CODE (rhs) == SSA_NAME)
+ {
+ /* For a simple copy operation, we copy the lattice values. */
+ prop_value_t *nval = get_value (rhs);
+ val = *nval;
+ }
else
- val = evaluate_stmt (stmt);
+ val = evaluate_stmt (stmt);
}
else
- /* Evaluate the statement. */
+ /* Evaluate the statement, which could be
+ either a GIMPLE_ASSIGN or a GIMPLE_CALL. */
val = evaluate_stmt (stmt);
retval = SSA_PROP_NOT_INTERESTING;
@@ -1332,46 +1408,6 @@ visit_assignment (tree stmt, tree *output_p)
retval = SSA_PROP_INTERESTING;
}
}
- else if (do_store_ccp && stmt_makes_single_store (stmt))
- {
- /* Otherwise, set the names in VDEF operands to the new
- constant value and mark the LHS as the memory reference
- associated with VAL. */
- ssa_op_iter i;
- tree vdef;
- bool changed;
-
- /* Mark VAL as stored in the LHS of this assignment. */
- if (val.lattice_val == CONSTANT)
- val.mem_ref = lhs;
-
- /* Set the value of every VDEF to VAL. */
- changed = false;
- FOR_EACH_SSA_TREE_OPERAND (vdef, stmt, i, SSA_OP_VIRTUAL_DEFS)
- {
- /* See PR 29801. We may have VDEFs for read-only variables
- (see the handling of unmodifiable variables in
- add_virtual_operand); do not attempt to change their value. */
- if (get_symbol_constant_value (SSA_NAME_VAR (vdef)) != NULL_TREE)
- continue;
-
- changed |= set_lattice_value (vdef, val);
- }
-
- /* Note that for propagation purposes, we are only interested in
- visiting statements that load the exact same memory reference
- stored here. Those statements will have the exact same list
- of virtual uses, so it is enough to set the output of this
- statement to be its first virtual definition. */
- *output_p = first_vdef (stmt);
- if (changed)
- {
- if (val.lattice_val == VARYING)
- retval = SSA_PROP_VARYING;
- else
- retval = SSA_PROP_INTERESTING;
- }
- }
return retval;
}
@@ -1382,12 +1418,12 @@ visit_assignment (tree stmt, tree *output_p)
SSA_PROP_VARYING. */
static enum ssa_prop_result
-visit_cond_stmt (tree stmt, edge *taken_edge_p)
+visit_cond_stmt (gimple stmt, edge *taken_edge_p)
{
prop_value_t val;
basic_block block;
- block = bb_for_stmt (stmt);
+ block = gimple_bb (stmt);
val = evaluate_stmt (stmt);
/* Find which edge out of the conditional block will be taken and add it
@@ -1412,7 +1448,7 @@ visit_cond_stmt (tree stmt, edge *taken_edge_p)
value, return SSA_PROP_VARYING. */
static enum ssa_prop_result
-ccp_visit_stmt (tree stmt, edge *taken_edge_p, tree *output_p)
+ccp_visit_stmt (gimple stmt, edge *taken_edge_p, tree *output_p)
{
tree def;
ssa_op_iter iter;
@@ -1420,21 +1456,33 @@ ccp_visit_stmt (tree stmt, edge *taken_edge_p, tree *output_p)
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "\nVisiting statement:\n");
- print_generic_stmt (dump_file, stmt, dump_flags);
+ print_gimple_stmt (dump_file, stmt, 0, dump_flags);
}
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
- {
- /* If the statement is an assignment that produces a single
- output value, evaluate its RHS to see if the lattice value of
- its output has changed. */
- return visit_assignment (stmt, output_p);
- }
- else if (TREE_CODE (stmt) == COND_EXPR || TREE_CODE (stmt) == SWITCH_EXPR)
+ switch (gimple_code (stmt))
{
- /* If STMT is a conditional branch, see if we can determine
- which branch will be taken. */
- return visit_cond_stmt (stmt, taken_edge_p);
+ case GIMPLE_ASSIGN:
+ /* If the statement is an assignment that produces a single
+ output value, evaluate its RHS to see if the lattice value of
+ its output has changed. */
+ return visit_assignment (stmt, output_p);
+
+ case GIMPLE_CALL:
+ /* A value-returning call also performs an assignment. */
+ if (gimple_call_lhs (stmt) != NULL_TREE)
+ return visit_assignment (stmt, output_p);
+ break;
+
+ case GIMPLE_COND:
+ case GIMPLE_SWITCH:
+ /* If STMT is a conditional branch, see if we can determine
+ which branch will be taken. */
+ /* FIXME. It appears that we should be able to optimize
+ computed GOTOs here as well. */
+ return visit_cond_stmt (stmt, taken_edge_p);
+
+ default:
+ break;
}
/* Any other kind of statement is not interesting for constant
@@ -1447,7 +1495,7 @@ ccp_visit_stmt (tree stmt, edge *taken_edge_p, tree *output_p)
Mark them VARYING. */
FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_ALL_DEFS)
{
- prop_value_t v = { VARYING, NULL_TREE, NULL_TREE };
+ prop_value_t v = { VARYING, NULL_TREE };
set_lattice_value (def, v);
}
@@ -1458,9 +1506,8 @@ ccp_visit_stmt (tree stmt, edge *taken_edge_p, tree *output_p)
/* Main entry point for SSA Conditional Constant Propagation. */
static unsigned int
-execute_ssa_ccp (bool store_ccp)
+do_ssa_ccp (void)
{
- do_store_ccp = store_ccp;
ccp_initialize ();
ssa_propagate (ccp_visit_stmt, ccp_visit_phi_node);
if (ccp_finalize ())
@@ -1470,13 +1517,6 @@ execute_ssa_ccp (bool store_ccp)
}
-static unsigned int
-do_ssa_ccp (void)
-{
- return execute_ssa_ccp (false);
-}
-
-
static bool
gate_ccp (void)
{
@@ -1505,43 +1545,6 @@ struct gimple_opt_pass pass_ccp =
};
-static unsigned int
-do_ssa_store_ccp (void)
-{
- /* If STORE-CCP is not enabled, we just run regular CCP. */
- return execute_ssa_ccp (flag_tree_store_ccp != 0);
-}
-
-static bool
-gate_store_ccp (void)
-{
- /* STORE-CCP is enabled only with -ftree-store-ccp, but when
- -fno-tree-store-ccp is specified, we should run regular CCP.
- That's why the pass is enabled with either flag. */
- return flag_tree_store_ccp != 0 || flag_tree_ccp != 0;
-}
-
-
-struct gimple_opt_pass pass_store_ccp =
-{
- {
- GIMPLE_PASS,
- "store_ccp", /* name */
- gate_store_ccp, /* gate */
- do_ssa_store_ccp, /* execute */
- NULL, /* sub */
- NULL, /* next */
- 0, /* static_pass_number */
- TV_TREE_STORE_CCP, /* tv_id */
- PROP_cfg | PROP_ssa | PROP_alias, /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_dump_func | TODO_verify_ssa
- | TODO_verify_stmts | TODO_ggc_collect/* todo_flags_finish */
- }
-};
-
/* A subroutine of fold_stmt_r. Attempts to fold *(A+O) to A[X].
BASE is an array type. OFFSET is a byte displacement. ORIG_TYPE
is the desired result type. */
@@ -1830,15 +1833,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)
@@ -1870,6 +1874,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. */
@@ -1922,7 +1983,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;
}
}
@@ -1965,30 +2030,24 @@ maybe_fold_stmt_indirect (tree expr, tree base, tree offset)
}
-/* A subroutine of fold_stmt_r. EXPR is a POINTER_PLUS_EXPR.
-
- A quaint feature extant in our address arithmetic is that there
+/* A quaint feature extant in our address arithmetic is that there
can be hidden type changes here. The type of the result need
not be the same as the type of the input pointer.
What we're after here is an expression of the form
(T *)(&array + const)
- where the cast doesn't actually exist, but is implicit in the
+ where array is OP0, const is OP1, RES_TYPE is T and
+ the cast doesn't actually exist, but is implicit in the
type of the POINTER_PLUS_EXPR. We'd like to turn this into
&array[x]
which may be able to propagate further. */
-static tree
-maybe_fold_stmt_addition (tree expr)
+tree
+maybe_fold_stmt_addition (tree res_type, tree op0, tree op1)
{
- tree op0 = TREE_OPERAND (expr, 0);
- tree op1 = TREE_OPERAND (expr, 1);
- tree ptr_type = TREE_TYPE (expr);
tree ptd_type;
tree t;
- gcc_assert (TREE_CODE (expr) == POINTER_PLUS_EXPR);
-
/* It had better be a constant. */
if (TREE_CODE (op1) != INTEGER_CST)
return NULL_TREE;
@@ -2039,7 +2098,7 @@ maybe_fold_stmt_addition (tree expr)
op0 = array_obj;
}
- ptd_type = TREE_TYPE (ptr_type);
+ ptd_type = TREE_TYPE (res_type);
/* If we want a pointer to void, reconstruct the reference from the
array element type. A pointer to that can be trivially converted
to void *. This happens as we fold (void *)(ptr p+ off). */
@@ -2053,7 +2112,7 @@ maybe_fold_stmt_addition (tree expr)
t = maybe_fold_offset_to_component_ref (TREE_TYPE (op0), op0, op1,
ptd_type, false);
if (t)
- t = build1 (ADDR_EXPR, ptr_type, t);
+ t = build1 (ADDR_EXPR, res_type, t);
return t;
}
@@ -2063,7 +2122,7 @@ maybe_fold_stmt_addition (tree expr)
struct fold_stmt_r_data
{
- tree stmt;
+ gimple stmt;
bool *changed_p;
bool *inside_addr_expr_p;
};
@@ -2074,12 +2133,17 @@ struct fold_stmt_r_data
static tree
fold_stmt_r (tree *expr_p, int *walk_subtrees, void *data)
{
- struct fold_stmt_r_data *fold_stmt_r_data = (struct fold_stmt_r_data *) data;
- bool *inside_addr_expr_p = fold_stmt_r_data->inside_addr_expr_p;
- bool *changed_p = fold_stmt_r_data->changed_p;
+ struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
+ struct fold_stmt_r_data *fold_stmt_r_data;
+ bool *inside_addr_expr_p;
+ bool *changed_p;
tree expr = *expr_p, t;
bool volatile_p = TREE_THIS_VOLATILE (expr);
+ fold_stmt_r_data = (struct fold_stmt_r_data *) wi->info;
+ inside_addr_expr_p = fold_stmt_r_data->inside_addr_expr_p;
+ changed_p = fold_stmt_r_data->changed_p;
+
/* ??? It'd be nice if walk_tree had a pre-order option. */
switch (TREE_CODE (expr))
{
@@ -2105,17 +2169,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.
@@ -2145,18 +2204,6 @@ fold_stmt_r (tree *expr_p, int *walk_subtrees, void *data)
recompute_tree_invariant_for_addr_expr (expr);
return NULL_TREE;
- case POINTER_PLUS_EXPR:
- t = walk_tree (&TREE_OPERAND (expr, 0), fold_stmt_r, data, NULL);
- if (t)
- return t;
- t = walk_tree (&TREE_OPERAND (expr, 1), fold_stmt_r, data, NULL);
- if (t)
- return t;
- *walk_subtrees = 0;
-
- t = maybe_fold_stmt_addition (expr);
- break;
-
case COMPONENT_REF:
t = walk_tree (&TREE_OPERAND (expr, 0), fold_stmt_r, data, NULL);
if (t)
@@ -2182,6 +2229,20 @@ fold_stmt_r (tree *expr_p, int *walk_subtrees, void *data)
t = maybe_fold_tmr (expr);
break;
+ case POINTER_PLUS_EXPR:
+ t = walk_tree (&TREE_OPERAND (expr, 0), fold_stmt_r, data, NULL);
+ if (t)
+ return t;
+ t = walk_tree (&TREE_OPERAND (expr, 1), fold_stmt_r, data, NULL);
+ if (t)
+ return t;
+ *walk_subtrees = 0;
+
+ t = maybe_fold_stmt_addition (TREE_TYPE (expr),
+ TREE_OPERAND (expr, 0),
+ TREE_OPERAND (expr, 1));
+ break;
+
case COND_EXPR:
if (COMPARISON_CLASS_P (TREE_OPERAND (expr, 0)))
{
@@ -2193,11 +2254,15 @@ fold_stmt_r (tree *expr_p, int *walk_subtrees, void *data)
tem = fold_binary (TREE_CODE (op0), TREE_TYPE (op0),
TREE_OPERAND (op0, 0),
TREE_OPERAND (op0, 1));
- set = tem && set_rhs (expr_p, tem);
+ /* This is actually a conditional expression, not a GIMPLE
+ conditional statement, however, the valid_gimple_rhs_p
+ test still applies. */
+ set = tem && is_gimple_condexpr (tem) && valid_gimple_rhs_p (tem);
fold_undefer_overflow_warnings (set, fold_stmt_r_data->stmt, 0);
if (set)
{
- t = *expr_p;
+ COND_EXPR_COND (expr) = tem;
+ t = expr;
break;
}
}
@@ -2209,8 +2274,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;
}
@@ -2218,7 +2286,6 @@ fold_stmt_r (tree *expr_p, int *walk_subtrees, void *data)
return NULL_TREE;
}
-
/* Return the string length, maximum string length or maximum value of
ARG in LENGTH.
If ARG is an SSA name variable, follow its use-def chains. If LENGTH
@@ -2231,7 +2298,8 @@ fold_stmt_r (tree *expr_p, int *walk_subtrees, void *data)
static bool
get_maxval_strlen (tree arg, tree *length, bitmap visited, int type)
{
- tree var, def_stmt, val;
+ tree var, val;
+ gimple def_stmt;
if (TREE_CODE (arg) != SSA_NAME)
{
@@ -2290,74 +2358,75 @@ get_maxval_strlen (tree arg, tree *length, bitmap visited, int type)
var = arg;
def_stmt = SSA_NAME_DEF_STMT (var);
- switch (TREE_CODE (def_stmt))
- {
- case GIMPLE_MODIFY_STMT:
- {
- tree rhs;
-
- /* The RHS of the statement defining VAR must either have a
- constant length or come from another SSA_NAME with a constant
- length. */
- rhs = GIMPLE_STMT_OPERAND (def_stmt, 1);
- STRIP_NOPS (rhs);
- return get_maxval_strlen (rhs, length, visited, type);
- }
-
- case PHI_NODE:
+ switch (gimple_code (def_stmt))
+ {
+ case GIMPLE_ASSIGN:
+ /* The RHS of the statement defining VAR must either have a
+ constant length or come from another SSA_NAME with a constant
+ length. */
+ if (gimple_assign_single_p (def_stmt)
+ || gimple_assign_unary_nop_p (def_stmt))
+ {
+ tree rhs = gimple_assign_rhs1 (def_stmt);
+ return get_maxval_strlen (rhs, length, visited, type);
+ }
+ return false;
+
+ case GIMPLE_PHI:
{
/* All the arguments of the PHI node must have the same constant
length. */
- int i;
-
- for (i = 0; i < PHI_NUM_ARGS (def_stmt); i++)
- {
- tree arg = PHI_ARG_DEF (def_stmt, i);
-
- /* If this PHI has itself as an argument, we cannot
- determine the string length of this argument. However,
- if we can find a constant string length for the other
- PHI args then we can still be sure that this is a
- constant string length. So be optimistic and just
- continue with the next argument. */
- if (arg == PHI_RESULT (def_stmt))
- continue;
-
- if (!get_maxval_strlen (arg, length, visited, type))
- return false;
- }
-
- return true;
- }
+ unsigned i;
+
+ for (i = 0; i < gimple_phi_num_args (def_stmt); i++)
+ {
+ tree arg = gimple_phi_arg (def_stmt, i)->def;
+
+ /* If this PHI has itself as an argument, we cannot
+ determine the string length of this argument. However,
+ if we can find a constant string length for the other
+ PHI args then we can still be sure that this is a
+ constant string length. So be optimistic and just
+ continue with the next argument. */
+ if (arg == gimple_phi_result (def_stmt))
+ continue;
+
+ if (!get_maxval_strlen (arg, length, visited, type))
+ return false;
+ }
+ }
+ return true;
default:
- break;
+ return false;
}
-
-
- return false;
}
-/* Fold builtin call FN in statement STMT. If it cannot be folded into a
- constant, return NULL_TREE. Otherwise, return its constant value. */
+/* Fold builtin call in statement STMT. Returns a simplified tree.
+ We may return a non-constant expression, including another call
+ to a different function and with different arguments, e.g.,
+ substituting memcpy for strcpy when the string length is known.
+ Note that some builtins expand into inline code that may not
+ be valid in GIMPLE. Callers must take care. */
static tree
-ccp_fold_builtin (tree stmt, tree fn)
+ccp_fold_builtin (gimple stmt)
{
tree result, val[3];
tree callee, a;
int arg_mask, i, type;
bitmap visited;
bool ignore;
- call_expr_arg_iterator iter;
int nargs;
- ignore = TREE_CODE (stmt) != GIMPLE_MODIFY_STMT;
+ gcc_assert (is_gimple_call (stmt));
+
+ ignore = (gimple_call_lhs (stmt) == NULL);
/* First try the generic builtin folder. If that succeeds, return the
result directly. */
- result = fold_call_expr (fn, ignore);
+ result = fold_call_stmt (stmt, ignore);
if (result)
{
if (ignore)
@@ -2366,13 +2435,13 @@ ccp_fold_builtin (tree stmt, tree fn)
}
/* Ignore MD builtins. */
- callee = get_callee_fndecl (fn);
+ callee = gimple_call_fndecl (stmt);
if (DECL_BUILT_IN_CLASS (callee) == BUILT_IN_MD)
return NULL_TREE;
/* If the builtin could not be folded, and it has no argument list,
we're done. */
- nargs = call_expr_nargs (fn);
+ nargs = gimple_call_num_args (stmt);
if (nargs == 0)
return NULL_TREE;
@@ -2416,16 +2485,15 @@ ccp_fold_builtin (tree stmt, tree fn)
visited = BITMAP_ALLOC (NULL);
memset (val, 0, sizeof (val));
- init_call_expr_arg_iterator (fn, &iter);
- for (i = 0; arg_mask; i++, arg_mask >>= 1)
+ for (i = 0; i < nargs; i++)
{
- a = next_call_expr_arg (&iter);
- if (arg_mask & 1)
- {
- bitmap_clear (visited);
- if (!get_maxval_strlen (a, &val[i], visited, type))
- val[i] = NULL_TREE;
- }
+ if ((arg_mask >> i) & 1)
+ {
+ a = gimple_call_arg (stmt, i);
+ bitmap_clear (visited);
+ if (!get_maxval_strlen (a, &val[i], visited, type))
+ val[i] = NULL_TREE;
+ }
}
BITMAP_FREE (visited);
@@ -2436,7 +2504,8 @@ ccp_fold_builtin (tree stmt, tree fn)
case BUILT_IN_STRLEN:
if (val[0])
{
- tree new_val = fold_convert (TREE_TYPE (fn), val[0]);
+ tree new_val =
+ fold_convert (TREE_TYPE (gimple_call_lhs (stmt)), val[0]);
/* If the result is not a valid gimple value, or not a cast
of a valid gimple value, then we can not use the result. */
@@ -2450,32 +2519,30 @@ ccp_fold_builtin (tree stmt, tree fn)
case BUILT_IN_STRCPY:
if (val[1] && is_gimple_val (val[1]) && nargs == 2)
result = fold_builtin_strcpy (callee,
- CALL_EXPR_ARG (fn, 0),
- CALL_EXPR_ARG (fn, 1),
+ gimple_call_arg (stmt, 0),
+ gimple_call_arg (stmt, 1),
val[1]);
break;
case BUILT_IN_STRNCPY:
if (val[1] && is_gimple_val (val[1]) && nargs == 3)
result = fold_builtin_strncpy (callee,
- CALL_EXPR_ARG (fn, 0),
- CALL_EXPR_ARG (fn, 1),
- CALL_EXPR_ARG (fn, 2),
+ gimple_call_arg (stmt, 0),
+ gimple_call_arg (stmt, 1),
+ gimple_call_arg (stmt, 2),
val[1]);
break;
case BUILT_IN_FPUTS:
- result = fold_builtin_fputs (CALL_EXPR_ARG (fn, 0),
- CALL_EXPR_ARG (fn, 1),
- TREE_CODE (stmt) != GIMPLE_MODIFY_STMT, 0,
- val[0]);
+ result = fold_builtin_fputs (gimple_call_arg (stmt, 0),
+ gimple_call_arg (stmt, 1),
+ ignore, false, val[0]);
break;
case BUILT_IN_FPUTS_UNLOCKED:
- result = fold_builtin_fputs (CALL_EXPR_ARG (fn, 0),
- CALL_EXPR_ARG (fn, 1),
- TREE_CODE (stmt) != GIMPLE_MODIFY_STMT, 1,
- val[0]);
+ result = fold_builtin_fputs (gimple_call_arg (stmt, 0),
+ gimple_call_arg (stmt, 1),
+ ignore, true, val[0]);
break;
case BUILT_IN_MEMCPY_CHK:
@@ -2484,10 +2551,10 @@ ccp_fold_builtin (tree stmt, tree fn)
case BUILT_IN_MEMSET_CHK:
if (val[2] && is_gimple_val (val[2]))
result = fold_builtin_memory_chk (callee,
- CALL_EXPR_ARG (fn, 0),
- CALL_EXPR_ARG (fn, 1),
- CALL_EXPR_ARG (fn, 2),
- CALL_EXPR_ARG (fn, 3),
+ gimple_call_arg (stmt, 0),
+ gimple_call_arg (stmt, 1),
+ gimple_call_arg (stmt, 2),
+ gimple_call_arg (stmt, 3),
val[2], ignore,
DECL_FUNCTION_CODE (callee));
break;
@@ -2496,27 +2563,27 @@ ccp_fold_builtin (tree stmt, tree fn)
case BUILT_IN_STPCPY_CHK:
if (val[1] && is_gimple_val (val[1]))
result = fold_builtin_stxcpy_chk (callee,
- CALL_EXPR_ARG (fn, 0),
- CALL_EXPR_ARG (fn, 1),
- CALL_EXPR_ARG (fn, 2),
+ gimple_call_arg (stmt, 0),
+ gimple_call_arg (stmt, 1),
+ gimple_call_arg (stmt, 2),
val[1], ignore,
DECL_FUNCTION_CODE (callee));
break;
case BUILT_IN_STRNCPY_CHK:
if (val[2] && is_gimple_val (val[2]))
- result = fold_builtin_strncpy_chk (CALL_EXPR_ARG (fn, 0),
- CALL_EXPR_ARG (fn, 1),
- CALL_EXPR_ARG (fn, 2),
- CALL_EXPR_ARG (fn, 3),
+ result = fold_builtin_strncpy_chk (gimple_call_arg (stmt, 0),
+ gimple_call_arg (stmt, 1),
+ gimple_call_arg (stmt, 2),
+ gimple_call_arg (stmt, 3),
val[2]);
break;
case BUILT_IN_SNPRINTF_CHK:
case BUILT_IN_VSNPRINTF_CHK:
if (val[1] && is_gimple_val (val[1]))
- result = fold_builtin_snprintf_chk (fn, val[1],
- DECL_FUNCTION_CODE (callee));
+ result = gimple_fold_builtin_snprintf_chk (stmt, val[1],
+ DECL_FUNCTION_CODE (callee));
break;
default:
@@ -2528,114 +2595,261 @@ ccp_fold_builtin (tree stmt, tree fn)
return result;
}
+/* Attempt to fold an assignment statement pointed-to by SI. Returns a
+ replacement rhs for the statement or NULL_TREE if no simplification
+ could be made. It is assumed that the operands have been previously
+ folded. */
+
+static tree
+fold_gimple_assign (gimple_stmt_iterator *si)
+{
+ gimple stmt = gsi_stmt (*si);
+ enum tree_code subcode = gimple_assign_rhs_code (stmt);
+
+ tree result = NULL;
+
+ switch (get_gimple_rhs_class (subcode))
+ {
+ case GIMPLE_SINGLE_RHS:
+ {
+ tree rhs = gimple_assign_rhs1 (stmt);
+
+ /* Try to fold a conditional expression. */
+ if (TREE_CODE (rhs) == COND_EXPR)
+ {
+ tree temp = fold (COND_EXPR_COND (rhs));
+ if (temp != COND_EXPR_COND (rhs))
+ result = fold_build3 (COND_EXPR, TREE_TYPE (rhs), temp,
+ COND_EXPR_THEN (rhs), COND_EXPR_ELSE (rhs));
+ }
+
+ /* If we couldn't fold the RHS, hand over to the generic
+ fold routines. */
+ if (result == NULL_TREE)
+ result = fold (rhs);
+
+ /* Strip away useless type conversions. Both the NON_LVALUE_EXPR
+ that may have been added by fold, and "useless" type
+ conversions that might now be apparent due to propagation. */
+ STRIP_USELESS_TYPE_CONVERSION (result);
+
+ if (result != rhs && valid_gimple_rhs_p (result))
+ return result;
+ else
+ /* It is possible that fold_stmt_r simplified the RHS.
+ Make sure that the subcode of this statement still
+ reflects the principal operator of the rhs operand. */
+ return rhs;
+ }
+ break;
+
+ case GIMPLE_UNARY_RHS:
+ result = fold_unary (subcode,
+ gimple_expr_type (stmt),
+ gimple_assign_rhs1 (stmt));
+
+ if (result)
+ {
+ STRIP_USELESS_TYPE_CONVERSION (result);
+ if (valid_gimple_rhs_p (result))
+ return result;
+ }
+ 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_address (gimple_assign_rhs1 (stmt),
+ integer_zero_node, type);
+ if (t)
+ return t;
+ }
+ break;
+
+ case GIMPLE_BINARY_RHS:
+ /* Try to fold pointer addition. */
+ if (gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR)
+ result = maybe_fold_stmt_addition (
+ TREE_TYPE (gimple_assign_lhs (stmt)),
+ gimple_assign_rhs1 (stmt),
+ gimple_assign_rhs2 (stmt));
+
+ if (!result)
+ result = fold_binary (subcode,
+ TREE_TYPE (gimple_assign_lhs (stmt)),
+ gimple_assign_rhs1 (stmt),
+ gimple_assign_rhs2 (stmt));
+
+ if (result)
+ {
+ STRIP_USELESS_TYPE_CONVERSION (result);
+ if (valid_gimple_rhs_p (result))
+ return result;
+ }
+ break;
+
+ case GIMPLE_INVALID_RHS:
+ gcc_unreachable ();
+ }
+
+ return NULL_TREE;
+}
+
+/* Attempt to fold a conditional statement. Return true if any changes were
+ made. We only attempt to fold the condition expression, and do not perform
+ any transformation that would require alteration of the cfg. It is
+ assumed that the operands have been previously folded. */
-/* Fold the statement pointed to by STMT_P. In some cases, this function may
+static bool
+fold_gimple_cond (gimple stmt)
+{
+ tree result = fold_binary (gimple_cond_code (stmt),
+ boolean_type_node,
+ gimple_cond_lhs (stmt),
+ gimple_cond_rhs (stmt));
+
+ if (result)
+ {
+ STRIP_USELESS_TYPE_CONVERSION (result);
+ if (is_gimple_condexpr (result) && valid_gimple_rhs_p (result))
+ {
+ gimple_cond_set_condition_from_tree (stmt, result);
+ return true;
+ }
+ }
+
+ return false;
+}
+
+
+/* Attempt to fold a call statement referenced by the statement iterator GSI.
+ The statement may be replaced by another statement, e.g., if the call
+ simplifies to a constant value. Return true if any changes were made.
+ It is assumed that the operands have been previously folded. */
+
+static bool
+fold_gimple_call (gimple_stmt_iterator *gsi)
+{
+ gimple stmt = gsi_stmt (*gsi);
+
+ tree callee = gimple_call_fndecl (stmt);
+
+ /* Check for builtins that CCP can handle using information not
+ available in the generic fold routines. */
+ if (callee && DECL_BUILT_IN (callee))
+ {
+ tree result = ccp_fold_builtin (stmt);
+
+ if (result)
+ return update_call_from_tree (gsi, result);
+ }
+ else
+ {
+ /* Check for resolvable OBJ_TYPE_REF. The only sorts we can resolve
+ here are when we've propagated the address of a decl into the
+ object slot. */
+ /* ??? Should perhaps do this in fold proper. However, doing it
+ there requires that we create a new CALL_EXPR, and that requires
+ copying EH region info to the new node. Easier to just do it
+ here where we can just smash the call operand. */
+ /* ??? Is there a good reason not to do this in fold_stmt_inplace? */
+ callee = gimple_call_fn (stmt);
+ if (TREE_CODE (callee) == OBJ_TYPE_REF
+ && lang_hooks.fold_obj_type_ref
+ && TREE_CODE (OBJ_TYPE_REF_OBJECT (callee)) == ADDR_EXPR
+ && DECL_P (TREE_OPERAND
+ (OBJ_TYPE_REF_OBJECT (callee), 0)))
+ {
+ tree t;
+
+ /* ??? Caution: Broken ADDR_EXPR semantics means that
+ looking at the type of the operand of the addr_expr
+ can yield an array type. See silly exception in
+ check_pointer_types_r. */
+ t = TREE_TYPE (TREE_TYPE (OBJ_TYPE_REF_OBJECT (callee)));
+ t = lang_hooks.fold_obj_type_ref (callee, t);
+ if (t)
+ {
+ gimple_call_set_fn (stmt, t);
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+/* Fold the statement pointed to by GSI. In some cases, this function may
replace the whole statement with a new one. Returns true iff folding
makes any changes. */
bool
-fold_stmt (tree *stmt_p)
+fold_stmt (gimple_stmt_iterator *gsi)
{
- tree rhs, result, stmt;
+ tree res;
struct fold_stmt_r_data fold_stmt_r_data;
+ struct walk_stmt_info wi;
+
bool changed = false;
bool inside_addr_expr = false;
- stmt = *stmt_p;
+ gimple stmt = gsi_stmt (*gsi);
fold_stmt_r_data.stmt = stmt;
fold_stmt_r_data.changed_p = &changed;
fold_stmt_r_data.inside_addr_expr_p = &inside_addr_expr;
- /* If we replaced constants and the statement makes pointer dereferences,
- then we may need to fold instances of *&VAR into VAR, etc. */
- if (walk_tree (stmt_p, fold_stmt_r, &fold_stmt_r_data, NULL))
- {
- *stmt_p = build_call_expr (implicit_built_in_decls[BUILT_IN_TRAP], 0);
- return true;
- }
+ memset (&wi, 0, sizeof (wi));
+ wi.info = &fold_stmt_r_data;
- rhs = get_rhs (stmt);
- if (!rhs)
- return changed;
- result = NULL_TREE;
+ /* Fold the individual operands.
+ For example, fold instances of *&VAR into VAR, etc. */
+ res = walk_gimple_op (stmt, fold_stmt_r, &wi);
+ gcc_assert (!res);
- if (TREE_CODE (rhs) == CALL_EXPR)
+ /* Fold the main computation performed by the statement. */
+ switch (gimple_code (stmt))
{
- tree callee;
-
- /* Check for builtins that CCP can handle using information not
- available in the generic fold routines. */
- callee = get_callee_fndecl (rhs);
- if (callee && DECL_BUILT_IN (callee))
- result = ccp_fold_builtin (stmt, rhs);
- else
- {
- /* Check for resolvable OBJ_TYPE_REF. The only sorts we can resolve
- here are when we've propagated the address of a decl into the
- object slot. */
- /* ??? Should perhaps do this in fold proper. However, doing it
- there requires that we create a new CALL_EXPR, and that requires
- copying EH region info to the new node. Easier to just do it
- here where we can just smash the call operand. Also
- CALL_EXPR_RETURN_SLOT_OPT needs to be handled correctly and
- copied, fold_call_expr does not have not information. */
- callee = CALL_EXPR_FN (rhs);
- if (TREE_CODE (callee) == OBJ_TYPE_REF
- && lang_hooks.fold_obj_type_ref
- && TREE_CODE (OBJ_TYPE_REF_OBJECT (callee)) == ADDR_EXPR
- && DECL_P (TREE_OPERAND
- (OBJ_TYPE_REF_OBJECT (callee), 0)))
- {
- tree t;
-
- /* ??? Caution: Broken ADDR_EXPR semantics means that
- looking at the type of the operand of the addr_expr
- can yield an array type. See silly exception in
- check_pointer_types_r. */
+ case GIMPLE_ASSIGN:
+ {
+ tree new_rhs = fold_gimple_assign (gsi);
+ if (new_rhs != NULL_TREE)
+ {
+ gimple_assign_set_rhs_from_tree (gsi, new_rhs);
+ changed = true;
+ }
+ stmt = gsi_stmt (*gsi);
+ break;
+ }
+ case GIMPLE_COND:
+ changed |= fold_gimple_cond (stmt);
+ break;
+ case GIMPLE_CALL:
+ /* The entire statement may be replaced in this case. */
+ changed |= fold_gimple_call (gsi);
+ break;
- t = TREE_TYPE (TREE_TYPE (OBJ_TYPE_REF_OBJECT (callee)));
- t = lang_hooks.fold_obj_type_ref (callee, t);
- if (t)
- {
- CALL_EXPR_FN (rhs) = t;
- changed = true;
- }
- }
- }
- }
- else if (TREE_CODE (rhs) == COND_EXPR)
- {
- tree temp = fold (COND_EXPR_COND (rhs));
- if (temp != COND_EXPR_COND (rhs))
- result = fold_build3 (COND_EXPR, TREE_TYPE (rhs), temp,
- COND_EXPR_THEN (rhs), COND_EXPR_ELSE (rhs));
+ default:
+ return changed;
+ break;
}
- /* If we couldn't fold the RHS, hand over to the generic fold routines. */
- if (result == NULL_TREE)
- result = fold (rhs);
-
- /* Strip away useless type conversions. Both the NON_LVALUE_EXPR that
- may have been added by fold, and "useless" type conversions that might
- now be apparent due to propagation. */
- STRIP_USELESS_TYPE_CONVERSION (result);
-
- if (result != rhs)
- changed |= set_rhs (stmt_p, result);
-
return changed;
}
/* Perform the minimal folding on statement STMT. Only operations like
*&x created by constant propagation are handled. The statement cannot
- be replaced with a new one. */
+ be replaced with a new one. Return true if the statement was
+ changed, false otherwise. */
bool
-fold_stmt_inplace (tree stmt)
+fold_stmt_inplace (gimple stmt)
{
- tree old_stmt = stmt, rhs, new_rhs;
+ tree res;
struct fold_stmt_r_data fold_stmt_r_data;
+ struct walk_stmt_info wi;
+ gimple_stmt_iterator si;
+
bool changed = false;
bool inside_addr_expr = false;
@@ -2643,24 +2857,50 @@ fold_stmt_inplace (tree stmt)
fold_stmt_r_data.changed_p = &changed;
fold_stmt_r_data.inside_addr_expr_p = &inside_addr_expr;
- walk_tree (&stmt, fold_stmt_r, &fold_stmt_r_data, NULL);
- gcc_assert (stmt == old_stmt);
+ memset (&wi, 0, sizeof (wi));
+ wi.info = &fold_stmt_r_data;
- rhs = get_rhs (stmt);
- if (!rhs || rhs == stmt)
- return changed;
+ /* Fold the individual operands.
+ For example, fold instances of *&VAR into VAR, etc.
- new_rhs = fold (rhs);
- STRIP_USELESS_TYPE_CONVERSION (new_rhs);
- if (new_rhs == rhs)
- return changed;
+ It appears that, at one time, maybe_fold_stmt_indirect
+ would cause the walk to return non-null in order to
+ signal that the entire statement should be replaced with
+ a call to _builtin_trap. This functionality is currently
+ disabled, as noted in a FIXME, and cannot be supported here. */
+ res = walk_gimple_op (stmt, fold_stmt_r, &wi);
+ gcc_assert (!res);
- changed |= set_rhs (&stmt, new_rhs);
- gcc_assert (stmt == old_stmt);
+ /* Fold the main computation performed by the statement. */
+ switch (gimple_code (stmt))
+ {
+ case GIMPLE_ASSIGN:
+ {
+ unsigned old_num_ops;
+ tree new_rhs;
+ old_num_ops = gimple_num_ops (stmt);
+ si = gsi_for_stmt (stmt);
+ new_rhs = fold_gimple_assign (&si);
+ if (new_rhs != NULL_TREE
+ && get_gimple_rhs_num_ops (TREE_CODE (new_rhs)) < old_num_ops)
+ {
+ gimple_assign_set_rhs_from_tree (&si, new_rhs);
+ changed = true;
+ }
+ gcc_assert (gsi_stmt (si) == stmt);
+ break;
+ }
+ case GIMPLE_COND:
+ changed |= fold_gimple_cond (stmt);
+ break;
+
+ default:
+ break;
+ }
return changed;
}
-
+
/* Try to optimize out __builtin_stack_restore. Optimize it out
if there is another __builtin_stack_restore in the same basic
block and no calls or ASM_EXPRs are in between, or if this block's
@@ -2668,28 +2908,30 @@ fold_stmt_inplace (tree stmt)
ASM_EXPRs after this __builtin_stack_restore. */
static tree
-optimize_stack_restore (basic_block bb, tree call, block_stmt_iterator i)
+optimize_stack_restore (gimple_stmt_iterator i)
{
- tree stack_save, stmt, callee;
+ tree callee, rhs;
+ gimple stmt, stack_save;
+ gimple_stmt_iterator stack_save_gsi;
+
+ basic_block bb = gsi_bb (i);
+ gimple call = gsi_stmt (i);
- if (TREE_CODE (call) != CALL_EXPR
- || call_expr_nargs (call) != 1
- || TREE_CODE (CALL_EXPR_ARG (call, 0)) != SSA_NAME
- || !POINTER_TYPE_P (TREE_TYPE (CALL_EXPR_ARG (call, 0))))
+ if (gimple_code (call) != GIMPLE_CALL
+ || gimple_call_num_args (call) != 1
+ || TREE_CODE (gimple_call_arg (call, 0)) != SSA_NAME
+ || !POINTER_TYPE_P (TREE_TYPE (gimple_call_arg (call, 0))))
return NULL_TREE;
- for (bsi_next (&i); !bsi_end_p (i); bsi_next (&i))
+ for (gsi_next (&i); !gsi_end_p (i); gsi_next (&i))
{
- tree call;
-
- stmt = bsi_stmt (i);
- if (TREE_CODE (stmt) == ASM_EXPR)
+ stmt = gsi_stmt (i);
+ if (gimple_code (stmt) == GIMPLE_ASM)
return NULL_TREE;
- call = get_call_expr_in (stmt);
- if (call == NULL)
+ if (gimple_code (stmt) != GIMPLE_CALL)
continue;
- callee = get_callee_fndecl (call);
+ callee = gimple_call_fndecl (stmt);
if (!callee || DECL_BUILT_IN_CLASS (callee) != BUILT_IN_NORMAL)
return NULL_TREE;
@@ -2697,55 +2939,54 @@ optimize_stack_restore (basic_block bb, tree call, block_stmt_iterator i)
break;
}
- if (bsi_end_p (i)
+ if (gsi_end_p (i)
&& (! single_succ_p (bb)
|| single_succ_edge (bb)->dest != EXIT_BLOCK_PTR))
return NULL_TREE;
- stack_save = SSA_NAME_DEF_STMT (CALL_EXPR_ARG (call, 0));
- if (TREE_CODE (stack_save) != GIMPLE_MODIFY_STMT
- || GIMPLE_STMT_OPERAND (stack_save, 0) != CALL_EXPR_ARG (call, 0)
- || TREE_CODE (GIMPLE_STMT_OPERAND (stack_save, 1)) != CALL_EXPR
- || tree_could_throw_p (stack_save)
- || !has_single_use (CALL_EXPR_ARG (call, 0)))
+ stack_save = SSA_NAME_DEF_STMT (gimple_call_arg (call, 0));
+ if (gimple_code (stack_save) != GIMPLE_CALL
+ || gimple_call_lhs (stack_save) != gimple_call_arg (call, 0)
+ || stmt_could_throw_p (stack_save)
+ || !has_single_use (gimple_call_arg (call, 0)))
return NULL_TREE;
- callee = get_callee_fndecl (GIMPLE_STMT_OPERAND (stack_save, 1));
+ callee = gimple_call_fndecl (stack_save);
if (!callee
|| DECL_BUILT_IN_CLASS (callee) != BUILT_IN_NORMAL
|| DECL_FUNCTION_CODE (callee) != BUILT_IN_STACK_SAVE
- || call_expr_nargs (GIMPLE_STMT_OPERAND (stack_save, 1)) != 0)
+ || gimple_call_num_args (stack_save) != 0)
return NULL_TREE;
- stmt = stack_save;
- push_stmt_changes (&stmt);
- if (!set_rhs (&stmt,
- build_int_cst (TREE_TYPE (CALL_EXPR_ARG (call, 0)), 0)))
+ stack_save_gsi = gsi_for_stmt (stack_save);
+ push_stmt_changes (gsi_stmt_ptr (&stack_save_gsi));
+ rhs = build_int_cst (TREE_TYPE (gimple_call_arg (call, 0)), 0);
+ if (!update_call_from_tree (&stack_save_gsi, rhs))
{
- discard_stmt_changes (&stmt);
+ discard_stmt_changes (gsi_stmt_ptr (&stack_save_gsi));
return NULL_TREE;
}
- gcc_assert (stmt == stack_save);
- pop_stmt_changes (&stmt);
+ pop_stmt_changes (gsi_stmt_ptr (&stack_save_gsi));
+ /* No effect, so the statement will be deleted. */
return integer_zero_node;
}
-
+
/* If va_list type is a simple pointer and nothing special is needed,
optimize __builtin_va_start (&ap, 0) into ap = __builtin_next_arg (0),
__builtin_va_end (&ap) out as NOP and __builtin_va_copy into a simple
pointer assignment. */
static tree
-optimize_stdarg_builtin (tree call)
+optimize_stdarg_builtin (gimple call)
{
tree callee, lhs, rhs, cfun_va_list;
bool va_list_simple_ptr;
- if (TREE_CODE (call) != CALL_EXPR)
+ if (gimple_code (call) != GIMPLE_CALL)
return NULL_TREE;
- callee = get_callee_fndecl (call);
+ callee = gimple_call_fndecl (call);
cfun_va_list = targetm.fn_abi_va_list (callee);
va_list_simple_ptr = POINTER_TYPE_P (cfun_va_list)
@@ -2757,21 +2998,21 @@ optimize_stdarg_builtin (tree call)
case BUILT_IN_VA_START:
if (!va_list_simple_ptr
|| targetm.expand_builtin_va_start != NULL
- || built_in_decls[BUILT_IN_NEXT_ARG] == NULL)
+ || built_in_decls[BUILT_IN_NEXT_ARG] == NULL)
return NULL_TREE;
- if (call_expr_nargs (call) != 2)
+ if (gimple_call_num_args (call) != 2)
return NULL_TREE;
- lhs = CALL_EXPR_ARG (call, 0);
+ lhs = gimple_call_arg (call, 0);
if (!POINTER_TYPE_P (TREE_TYPE (lhs))
|| TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (lhs)))
!= TYPE_MAIN_VARIANT (cfun_va_list))
return NULL_TREE;
-
+
lhs = build_fold_indirect_ref (lhs);
rhs = build_call_expr (built_in_decls[BUILT_IN_NEXT_ARG],
- 1, integer_zero_node);
+ 1, integer_zero_node);
rhs = fold_convert (TREE_TYPE (lhs), rhs);
return build2 (MODIFY_EXPR, TREE_TYPE (lhs), lhs, rhs);
@@ -2779,17 +3020,17 @@ optimize_stdarg_builtin (tree call)
if (!va_list_simple_ptr)
return NULL_TREE;
- if (call_expr_nargs (call) != 2)
+ if (gimple_call_num_args (call) != 2)
return NULL_TREE;
- lhs = CALL_EXPR_ARG (call, 0);
+ lhs = gimple_call_arg (call, 0);
if (!POINTER_TYPE_P (TREE_TYPE (lhs))
|| TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (lhs)))
!= TYPE_MAIN_VARIANT (cfun_va_list))
return NULL_TREE;
lhs = build_fold_indirect_ref (lhs);
- rhs = CALL_EXPR_ARG (call, 1);
+ rhs = gimple_call_arg (call, 1);
if (TYPE_MAIN_VARIANT (TREE_TYPE (rhs))
!= TYPE_MAIN_VARIANT (cfun_va_list))
return NULL_TREE;
@@ -2798,53 +3039,73 @@ optimize_stdarg_builtin (tree call)
return build2 (MODIFY_EXPR, TREE_TYPE (lhs), lhs, rhs);
case BUILT_IN_VA_END:
+ /* No effect, so the statement will be deleted. */
return integer_zero_node;
default:
gcc_unreachable ();
}
}
-
+
/* Convert EXPR into a GIMPLE value suitable for substitution on the
RHS of an assignment. Insert the necessary statements before
- iterator *SI_P.
- When IGNORE is set, don't worry about the return value. */
+ iterator *SI_P. The statement at *SI_P, which must be a GIMPLE_CALL
+ is replaced. If the call is expected to produces a result, then it
+ is replaced by an assignment of the new RHS to the result variable.
+ If the result is to be ignored, then the call is replaced by a
+ GIMPLE_NOP. */
-static tree
-convert_to_gimple_builtin (block_stmt_iterator *si_p, tree expr, bool ignore)
+static void
+gimplify_and_update_call_from_tree (gimple_stmt_iterator *si_p, tree expr)
{
- tree_stmt_iterator ti;
- tree stmt = bsi_stmt (*si_p);
- tree tmp, stmts = NULL;
+ tree lhs;
+ tree tmp = NULL_TREE; /* Silence warning. */
+ gimple stmt, new_stmt;
+ gimple_stmt_iterator i;
+ gimple_seq stmts = gimple_seq_alloc();
struct gimplify_ctx gctx;
+ stmt = gsi_stmt (*si_p);
+
+ gcc_assert (is_gimple_call (stmt));
+
+ lhs = gimple_call_lhs (stmt);
+
push_gimplify_context (&gctx);
- if (ignore)
- {
- tmp = build_empty_stmt ();
- gimplify_and_add (expr, &stmts);
- }
- else
+
+ if (lhs == NULL_TREE)
+ gimplify_and_add (expr, &stmts);
+ else
tmp = get_initialized_tmp_var (expr, &stmts, NULL);
+
pop_gimplify_context (NULL);
- if (EXPR_HAS_LOCATION (stmt))
- annotate_all_with_locus (&stmts, EXPR_LOCATION (stmt));
+ if (gimple_has_location (stmt))
+ annotate_all_with_location (stmts, gimple_location (stmt));
/* The replacement can expose previously unreferenced variables. */
- for (ti = tsi_start (stmts); !tsi_end_p (ti); tsi_next (&ti))
+ for (i = gsi_start (stmts); !gsi_end_p (i); gsi_next (&i))
+ {
+ new_stmt = gsi_stmt (i);
+ find_new_referenced_vars (new_stmt);
+ gsi_insert_before (si_p, new_stmt, GSI_NEW_STMT);
+ mark_symbols_for_renaming (new_stmt);
+ gsi_next (si_p);
+ }
+
+ if (lhs == NULL_TREE)
+ new_stmt = gimple_build_nop ();
+ else
{
- tree new_stmt = tsi_stmt (ti);
- find_new_referenced_vars (tsi_stmt_ptr (ti));
- bsi_insert_before (si_p, new_stmt, BSI_NEW_STMT);
- mark_symbols_for_renaming (new_stmt);
- bsi_next (si_p);
+ new_stmt = gimple_build_assign (lhs, tmp);
+ copy_virtual_operands (new_stmt, stmt);
+ move_ssa_defining_stmt_for_defs (new_stmt, stmt);
}
- return tmp;
+ gimple_set_location (new_stmt, gimple_location (stmt));
+ gsi_replace (si_p, new_stmt, false);
}
-
/* A simple pass that attempts to fold all builtin functions. This pass
is run after we've propagated as many constants as we can. */
@@ -2857,32 +3118,32 @@ execute_fold_all_builtins (void)
FOR_EACH_BB (bb)
{
- block_stmt_iterator i;
- for (i = bsi_start (bb); !bsi_end_p (i); )
+ gimple_stmt_iterator i;
+ for (i = gsi_start_bb (bb); !gsi_end_p (i); )
{
- tree *stmtp = bsi_stmt_ptr (i);
- tree old_stmt = *stmtp;
- tree call = get_rhs (*stmtp);
+ gimple stmt, old_stmt;
tree callee, result;
enum built_in_function fcode;
- if (!call || TREE_CODE (call) != CALL_EXPR)
+ stmt = gsi_stmt (i);
+
+ if (gimple_code (stmt) != GIMPLE_CALL)
{
- bsi_next (&i);
+ gsi_next (&i);
continue;
}
- callee = get_callee_fndecl (call);
+ callee = gimple_call_fndecl (stmt);
if (!callee || DECL_BUILT_IN_CLASS (callee) != BUILT_IN_NORMAL)
{
- bsi_next (&i);
+ gsi_next (&i);
continue;
}
fcode = DECL_FUNCTION_CODE (callee);
- result = ccp_fold_builtin (*stmtp, call);
+ result = ccp_fold_builtin (stmt);
if (result)
- gimple_remove_stmt_histograms (cfun, *stmtp);
+ gimple_remove_stmt_histograms (cfun, stmt);
if (!result)
switch (DECL_FUNCTION_CODE (callee))
@@ -2891,77 +3152,71 @@ execute_fold_all_builtins (void)
/* Resolve __builtin_constant_p. If it hasn't been
folded to integer_one_node by now, it's fairly
certain that the value simply isn't constant. */
- result = integer_zero_node;
+ result = integer_zero_node;
break;
case BUILT_IN_STACK_RESTORE:
- result = optimize_stack_restore (bb, *stmtp, i);
+ result = optimize_stack_restore (i);
if (result)
break;
- bsi_next (&i);
+ gsi_next (&i);
continue;
case BUILT_IN_VA_START:
case BUILT_IN_VA_END:
case BUILT_IN_VA_COPY:
/* These shouldn't be folded before pass_stdarg. */
- result = optimize_stdarg_builtin (*stmtp);
+ result = optimize_stdarg_builtin (stmt);
if (result)
break;
/* FALLTHRU */
default:
- bsi_next (&i);
+ gsi_next (&i);
continue;
}
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Simplified\n ");
- print_generic_stmt (dump_file, *stmtp, dump_flags);
+ print_gimple_stmt (dump_file, stmt, 0, dump_flags);
}
- push_stmt_changes (stmtp);
+ old_stmt = stmt;
+ push_stmt_changes (gsi_stmt_ptr (&i));
- if (!set_rhs (stmtp, result))
- {
- result = convert_to_gimple_builtin (&i, result,
- TREE_CODE (old_stmt)
- != GIMPLE_MODIFY_STMT);
- if (result)
- {
- bool ok = set_rhs (stmtp, result);
- gcc_assert (ok);
- todoflags |= TODO_rebuild_alias;
- }
- }
+ if (!update_call_from_tree (&i, result))
+ {
+ gimplify_and_update_call_from_tree (&i, result);
+ todoflags |= TODO_rebuild_alias;
+ }
- pop_stmt_changes (stmtp);
+ stmt = gsi_stmt (i);
+ pop_stmt_changes (gsi_stmt_ptr (&i));
- if (maybe_clean_or_replace_eh_stmt (old_stmt, *stmtp)
- && tree_purge_dead_eh_edges (bb))
+ if (maybe_clean_or_replace_eh_stmt (old_stmt, stmt)
+ && gimple_purge_dead_eh_edges (bb))
cfg_changed = true;
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "to\n ");
- print_generic_stmt (dump_file, *stmtp, dump_flags);
+ print_gimple_stmt (dump_file, stmt, 0, dump_flags);
fprintf (dump_file, "\n");
}
/* Retry the same statement if it changed into another
builtin, there might be new opportunities now. */
- call = get_rhs (*stmtp);
- if (!call || TREE_CODE (call) != CALL_EXPR)
+ if (gimple_code (stmt) != GIMPLE_CALL)
{
- bsi_next (&i);
+ gsi_next (&i);
continue;
}
- callee = get_callee_fndecl (call);
+ callee = gimple_call_fndecl (stmt);
if (!callee
- || DECL_BUILT_IN_CLASS (callee) != BUILT_IN_NORMAL
+ || DECL_BUILT_IN_CLASS (callee) != BUILT_IN_NORMAL
|| DECL_FUNCTION_CODE (callee) == fcode)
- bsi_next (&i);
+ gsi_next (&i);
}
}
diff --git a/gcc/tree-ssa-coalesce.c b/gcc/tree-ssa-coalesce.c
index a96029aa7c5..3af0c3285d8 100644
--- a/gcc/tree-ssa-coalesce.c
+++ b/gcc/tree-ssa-coalesce.c
@@ -75,7 +75,7 @@ typedef struct coalesce_list_d
possibly on CRITICAL edge and in HOT basic block. */
static inline int
-coalesce_cost (int frequency, bool hot, bool critical)
+coalesce_cost (int frequency, bool optimize_for_size, bool critical)
{
/* Base costs on BB frequencies bounded by 1. */
int cost = frequency;
@@ -83,12 +83,8 @@ coalesce_cost (int frequency, bool hot, bool critical)
if (!cost)
cost = 1;
- if (optimize_size)
+ if (optimize_for_size)
cost = 1;
- else
- /* It is more important to coalesce in HOT blocks. */
- if (hot)
- cost *= 2;
/* Inserting copy on critical edge costs more than inserting it elsewhere. */
if (critical)
@@ -102,7 +98,7 @@ coalesce_cost (int frequency, bool hot, bool critical)
static inline int
coalesce_cost_bb (basic_block bb)
{
- return coalesce_cost (bb->frequency, maybe_hot_bb_p (bb), false);
+ return coalesce_cost (bb->frequency, optimize_bb_for_size_p (bb), false);
}
@@ -115,7 +111,7 @@ coalesce_cost_edge (edge e)
return MUST_COALESCE_COST;
return coalesce_cost (EDGE_FREQUENCY (e),
- maybe_hot_edge_p (e),
+ optimize_edge_for_size_p (e),
EDGE_CRITICAL_P (e));
}
@@ -841,16 +837,15 @@ build_ssa_conflict_graph (tree_live_info_p liveinfo)
FOR_EACH_BB (bb)
{
- block_stmt_iterator bsi;
- tree phi;
+ gimple_stmt_iterator gsi;
/* Start with live on exit temporaries. */
live_track_init (live, live_on_exit (liveinfo, bb));
- for (bsi = bsi_last (bb); !bsi_end_p (bsi); bsi_prev (&bsi))
+ for (gsi = gsi_last_bb (bb); !gsi_end_p (gsi); gsi_prev (&gsi))
{
tree var;
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
/* A copy between 2 partitions does not introduce an interference
by itself. If they did, you would never be able to coalesce
@@ -859,12 +854,14 @@ build_ssa_conflict_graph (tree_live_info_p liveinfo)
This is handled by simply removing the SRC of the copy from the
live list, and processing the stmt normally. */
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_assign (stmt))
{
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- if (TREE_CODE (lhs) == SSA_NAME && TREE_CODE (rhs) == SSA_NAME)
- live_track_clear_var (live, rhs);
+ tree lhs = gimple_assign_lhs (stmt);
+ tree rhs1 = gimple_assign_rhs1 (stmt);
+ if (gimple_assign_copy_p (stmt)
+ && TREE_CODE (lhs) == SSA_NAME
+ && TREE_CODE (rhs1) == SSA_NAME)
+ live_track_clear_var (live, rhs1);
}
FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_DEF)
@@ -880,8 +877,9 @@ build_ssa_conflict_graph (tree_live_info_p liveinfo)
There must be a conflict recorded between the result of the PHI and
any variables that are live. Otherwise the out-of-ssa translation
may create incorrect code. */
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
+ gimple phi = gsi_stmt (gsi);
tree result = PHI_RESULT (phi);
if (live_track_live_p (live, result))
live_track_process_def (live, result, graph);
@@ -915,11 +913,11 @@ print_exprs (FILE *f, const char *str1, tree expr1, const char *str2,
printed and compilation is then terminated. */
static inline void
-abnormal_corrupt (tree phi, int i)
+abnormal_corrupt (gimple phi, int i)
{
- edge e = PHI_ARG_EDGE (phi, i);
- tree res = PHI_RESULT (phi);
- tree arg = PHI_ARG_DEF (phi, i);
+ edge e = gimple_phi_arg_edge (phi, i);
+ tree res = gimple_phi_result (phi);
+ tree arg = gimple_phi_arg_def (phi, i);
fprintf (stderr, " Corrupt SSA across abnormal edge BB%d->BB%d\n",
e->src->index, e->dest->index);
@@ -959,10 +957,10 @@ fail_abnormal_edge_coalesce (int x, int y)
static var_map
create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
basic_block bb;
tree var;
- tree stmt;
+ gimple stmt;
tree first;
var_map map;
ssa_op_iter iter;
@@ -981,24 +979,25 @@ create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy)
FOR_EACH_BB (bb)
{
- tree phi, arg;
+ tree arg;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- int i;
+ gimple phi = gsi_stmt (gsi);
+ size_t i;
int ver;
tree res;
bool saw_copy = false;
- res = PHI_RESULT (phi);
+ res = gimple_phi_result (phi);
ver = SSA_NAME_VERSION (res);
register_ssa_partition (map, res);
/* Register ssa_names and coalesces between the args and the result
of all PHI. */
- for (i = 0; i < PHI_NUM_ARGS (phi); i++)
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
{
- edge e = PHI_ARG_EDGE (phi, i);
+ edge e = gimple_phi_arg_edge (phi, i);
arg = PHI_ARG_DEF (phi, i);
if (TREE_CODE (arg) == SSA_NAME)
register_ssa_partition (map, arg);
@@ -1024,27 +1023,29 @@ create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy)
bitmap_set_bit (used_in_copy, ver);
}
- 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);
+ stmt = gsi_stmt (gsi);
/* Register USE and DEF operands in each statement. */
FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, (SSA_OP_DEF|SSA_OP_USE))
register_ssa_partition (map, var);
/* Check for copy coalesces. */
- switch (TREE_CODE (stmt))
+ switch (gimple_code (stmt))
{
- case GIMPLE_MODIFY_STMT:
+ case GIMPLE_ASSIGN:
{
- tree op1 = GIMPLE_STMT_OPERAND (stmt, 0);
- tree op2 = GIMPLE_STMT_OPERAND (stmt, 1);
- if (TREE_CODE (op1) == SSA_NAME
- && TREE_CODE (op2) == SSA_NAME
- && SSA_NAME_VAR (op1) == SSA_NAME_VAR (op2))
+ tree lhs = gimple_assign_lhs (stmt);
+ tree rhs1 = gimple_assign_rhs1 (stmt);
+
+ if (gimple_assign_copy_p (stmt)
+ && TREE_CODE (lhs) == SSA_NAME
+ && TREE_CODE (rhs1) == SSA_NAME
+ && SSA_NAME_VAR (lhs) == SSA_NAME_VAR (rhs1))
{
- v1 = SSA_NAME_VERSION (op1);
- v2 = SSA_NAME_VERSION (op2);
+ v1 = SSA_NAME_VERSION (lhs);
+ v2 = SSA_NAME_VERSION (rhs1);
cost = coalesce_cost_bb (bb);
add_coalesce (cl, v1, v2, cost);
bitmap_set_bit (used_in_copy, v1);
@@ -1053,24 +1054,31 @@ create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy)
}
break;
- case ASM_EXPR:
+ case GIMPLE_ASM:
{
unsigned long noutputs, i;
+ unsigned long ninputs;
tree *outputs, link;
- noutputs = list_length (ASM_OUTPUTS (stmt));
+ noutputs = gimple_asm_noutputs (stmt);
+ ninputs = gimple_asm_ninputs (stmt);
outputs = (tree *) alloca (noutputs * sizeof (tree));
- for (i = 0, link = ASM_OUTPUTS (stmt); link;
- ++i, link = TREE_CHAIN (link))
+ for (i = 0; i < noutputs; ++i) {
+ link = gimple_asm_output_op (stmt, i);
outputs[i] = TREE_VALUE (link);
+ }
- for (link = ASM_INPUTS (stmt); link; link = TREE_CHAIN (link))
+ for (i = 0; i < ninputs; ++i)
{
- const char *constraint
- = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
- tree input = TREE_VALUE (link);
+ const char *constraint;
+ tree input;
char *end;
unsigned long match;
+ link = gimple_asm_input_op (stmt, i);
+ constraint
+ = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
+ input = TREE_VALUE (link);
+
if (TREE_CODE (input) != SSA_NAME)
continue;
@@ -1087,7 +1095,7 @@ create_outofssa_var_map (coalesce_list_p cl, bitmap used_in_copy)
if (SSA_NAME_VAR (outputs[match]) == SSA_NAME_VAR (input))
{
cost = coalesce_cost (REG_BR_PROB_BASE,
- maybe_hot_bb_p (bb),
+ optimize_bb_for_size_p (bb),
false);
add_coalesce (cl, v1, v2, cost);
bitmap_set_bit (used_in_copy, v1);
@@ -1247,7 +1255,7 @@ coalesce_partitions (var_map map, ssa_conflicts_p graph, coalesce_list_p cl,
FILE *debug)
{
int x = 0, y = 0;
- tree var1, var2, phi;
+ tree var1, var2;
int cost;
basic_block bb;
edge e;
@@ -1262,8 +1270,11 @@ coalesce_partitions (var_map map, ssa_conflicts_p graph, coalesce_list_p cl,
FOR_EACH_EDGE (e, ei, bb->preds)
if (e->flags & EDGE_ABNORMAL)
{
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ gimple_stmt_iterator gsi;
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
+ gsi_next (&gsi))
{
+ gimple phi = gsi_stmt (gsi);
tree res = PHI_RESULT (phi);
tree arg = PHI_ARG_DEF (phi, e->dest_idx);
int v1 = SSA_NAME_VERSION (res);
@@ -1437,4 +1448,3 @@ coalesce_ssa_name (void)
return map;
}
-
diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c
index bc8a874eeda..654ba950228 100644
--- a/gcc/tree-ssa-copy.c
+++ b/gcc/tree-ssa-copy.c
@@ -184,6 +184,55 @@ may_propagate_copy (tree dest, tree orig)
return true;
}
+/* Like may_propagate_copy, but use as the destination expression
+ the principal expression (typically, the RHS) contained in
+ statement DEST. This is more efficient when working with the
+ gimple tuples representation. */
+
+bool
+may_propagate_copy_into_stmt (gimple dest, tree orig)
+{
+ tree type_d;
+ tree type_o;
+
+ /* If the statement is a switch or a single-rhs assignment,
+ then the expression to be replaced by the propagation may
+ be an SSA_NAME. Fortunately, there is an explicit tree
+ for the expression, so we delegate to may_propagate_copy. */
+
+ if (gimple_assign_single_p (dest))
+ return may_propagate_copy (gimple_assign_rhs1 (dest), orig);
+ else if (gimple_code (dest) == GIMPLE_SWITCH)
+ return may_propagate_copy (gimple_switch_index (dest), orig);
+
+ /* In other cases, the expression is not materialized, so there
+ is no destination to pass to may_propagate_copy. On the other
+ hand, the expression cannot be an SSA_NAME, so the analysis
+ is much simpler. */
+
+ if (TREE_CODE (orig) == SSA_NAME
+ && (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (orig)
+ || TREE_CODE (SSA_NAME_VAR (orig)) == MEMORY_PARTITION_TAG))
+ return false;
+
+ if (is_gimple_assign (dest))
+ type_d = TREE_TYPE (gimple_assign_lhs (dest));
+ else if (gimple_code (dest) == GIMPLE_COND)
+ type_d = boolean_type_node;
+ else if (is_gimple_call (dest)
+ && gimple_call_lhs (dest) != NULL_TREE)
+ type_d = TREE_TYPE (gimple_call_lhs (dest));
+ else
+ gcc_unreachable ();
+
+ type_o = TREE_TYPE (orig);
+
+ if (!useless_type_conversion_p (type_d, type_o))
+ return false;
+
+ return true;
+}
+
/* Similarly, but we know that we're propagating into an ASM_EXPR. */
bool
@@ -303,7 +352,7 @@ merge_alias_info (tree orig_name, tree new_name)
static void
replace_exp_1 (use_operand_p op_p, tree val,
- bool for_propagation ATTRIBUTE_UNUSED)
+ bool for_propagation ATTRIBUTE_UNUSED)
{
tree op = USE_FROM_PTR (op_p);
@@ -337,6 +386,18 @@ propagate_value (use_operand_p op_p, tree val)
replace_exp_1 (op_p, val, true);
}
+/* Replace *OP_P with value VAL (assumed to be a constant or another SSA_NAME).
+
+ Use this version when not const/copy propagating values. For example,
+ PRE uses this version when building expressions as they would appear
+ in specific blocks taking into account actions of PHI nodes. */
+
+void
+replace_exp (use_operand_p op_p, tree val)
+{
+ replace_exp_1 (op_p, val, false);
+}
+
/* Propagate the value VAL (assumed to be a constant or another SSA_NAME)
into the tree pointed to by OP_P.
@@ -351,13 +412,14 @@ propagate_tree_value (tree *op_p, tree val)
{
#if defined ENABLE_CHECKING
gcc_assert (!(TREE_CODE (val) == SSA_NAME
+ && *op_p
&& TREE_CODE (*op_p) == SSA_NAME
&& !may_propagate_copy (*op_p, val)));
#endif
if (TREE_CODE (val) == SSA_NAME)
{
- if (TREE_CODE (*op_p) == SSA_NAME && POINTER_TYPE_P (TREE_TYPE (*op_p)))
+ if (*op_p && TREE_CODE (*op_p) == SSA_NAME && POINTER_TYPE_P (TREE_TYPE (*op_p)))
merge_alias_info (*op_p, val);
*op_p = val;
}
@@ -366,18 +428,52 @@ propagate_tree_value (tree *op_p, tree val)
}
-/* Replace *OP_P with value VAL (assumed to be a constant or another SSA_NAME).
-
- Use this version when not const/copy propagating values. For example,
- PRE uses this version when building expressions as they would appear
- in specific blocks taking into account actions of PHI nodes. */
+/* Like propagate_tree_value, but use as the operand to replace
+ the principal expression (typically, the RHS) contained in the
+ statement referenced by iterator GSI. Note that it is not
+ always possible to update the statement in-place, so a new
+ statement may be created to replace the original. */
void
-replace_exp (use_operand_p op_p, tree val)
+propagate_tree_value_into_stmt (gimple_stmt_iterator *gsi, tree val)
{
- replace_exp_1 (op_p, val, false);
-}
+ gimple stmt = gsi_stmt (*gsi);
+ if (is_gimple_assign (stmt))
+ {
+ tree expr = NULL_TREE;
+ if (gimple_assign_single_p (stmt))
+ expr = gimple_assign_rhs1 (stmt);
+ propagate_tree_value (&expr, val);
+ gimple_assign_set_rhs_from_tree (gsi, expr);
+ stmt = gsi_stmt (*gsi);
+ }
+ else if (gimple_code (stmt) == GIMPLE_COND)
+ {
+ tree lhs = NULL_TREE;
+ tree rhs = fold_convert (TREE_TYPE (val), integer_zero_node);
+ propagate_tree_value (&lhs, val);
+ gimple_cond_set_code (stmt, NE_EXPR);
+ gimple_cond_set_lhs (stmt, lhs);
+ gimple_cond_set_rhs (stmt, rhs);
+ }
+ else if (is_gimple_call (stmt)
+ && gimple_call_lhs (stmt) != NULL_TREE)
+ {
+ gimple new_stmt;
+
+ tree expr = NULL_TREE;
+ propagate_tree_value (&expr, val);
+ new_stmt = gimple_build_assign (gimple_call_lhs (stmt), expr);
+ copy_virtual_operands (new_stmt, stmt);
+ move_ssa_defining_stmt_for_defs (new_stmt, stmt);
+ gsi_replace (gsi, new_stmt, false);
+ }
+ else if (gimple_code (stmt) == GIMPLE_SWITCH)
+ propagate_tree_value (gimple_switch_index_ptr (stmt), val);
+ else
+ gcc_unreachable ();
+}
/*---------------------------------------------------------------------------
Copy propagation
@@ -403,24 +499,17 @@ static tree *cached_last_copy_of;
/* Return true if this statement may generate a useful copy. */
static bool
-stmt_may_generate_copy (tree stmt)
+stmt_may_generate_copy (gimple stmt)
{
- tree lhs, rhs;
- stmt_ann_t ann;
-
- if (TREE_CODE (stmt) == PHI_NODE)
- return !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (PHI_RESULT (stmt));
+ if (gimple_code (stmt) == GIMPLE_PHI)
+ return !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (gimple_phi_result (stmt));
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
return false;
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- ann = stmt_ann (stmt);
-
/* If the statement has volatile operands, it won't generate a
useful copy. */
- if (ann->has_volatile_ops)
+ if (gimple_has_volatile_ops (stmt))
return false;
/* Statements with loads and/or stores will never generate a useful copy. */
@@ -430,8 +519,8 @@ stmt_may_generate_copy (tree stmt)
/* Otherwise, the only statements that generate useful copies are
assignments whose RHS is just an SSA name that doesn't flow
through abnormal edges. */
- return (TREE_CODE (rhs) == SSA_NAME
- && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rhs));
+ return (gimple_assign_rhs_code (stmt) == SSA_NAME
+ && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (gimple_assign_rhs1 (stmt)));
}
@@ -584,15 +673,16 @@ dump_copy_of (FILE *file, tree var)
all, the names generated will be VUSEd in the same statements. */
static enum ssa_prop_result
-copy_prop_visit_assignment (tree stmt, tree *result_p)
+copy_prop_visit_assignment (gimple stmt, tree *result_p)
{
tree lhs, rhs;
prop_value_t *rhs_val;
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ lhs = gimple_assign_lhs (stmt);
+ rhs = gimple_assign_rhs1 (stmt);
+
- gcc_assert (TREE_CODE (rhs) == SSA_NAME);
+ gcc_assert (gimple_assign_rhs_code (stmt) == SSA_NAME);
rhs_val = get_copy_of_val (rhs);
@@ -620,45 +710,42 @@ copy_prop_visit_assignment (tree stmt, tree *result_p)
}
-/* Visit the COND_EXPR STMT. Return SSA_PROP_INTERESTING
+/* Visit the GIMPLE_COND STMT. Return SSA_PROP_INTERESTING
if it can determine which edge will be taken. Otherwise, return
SSA_PROP_VARYING. */
static enum ssa_prop_result
-copy_prop_visit_cond_stmt (tree stmt, edge *taken_edge_p)
+copy_prop_visit_cond_stmt (gimple stmt, edge *taken_edge_p)
{
- enum ssa_prop_result retval;
- tree cond;
+ enum ssa_prop_result retval = SSA_PROP_VARYING;
- cond = COND_EXPR_COND (stmt);
- retval = SSA_PROP_VARYING;
+ tree op0 = gimple_cond_lhs (stmt);
+ tree op1 = gimple_cond_rhs (stmt);
/* The only conditionals that we may be able to compute statically
are predicates involving two SSA_NAMEs. */
- if (COMPARISON_CLASS_P (cond)
- && TREE_CODE (TREE_OPERAND (cond, 0)) == SSA_NAME
- && TREE_CODE (TREE_OPERAND (cond, 1)) == SSA_NAME)
+ if (TREE_CODE (op0) == SSA_NAME && TREE_CODE (op1) == SSA_NAME)
{
- tree op0 = get_last_copy_of (TREE_OPERAND (cond, 0));
- tree op1 = get_last_copy_of (TREE_OPERAND (cond, 1));
+ op0 = get_last_copy_of (op0);
+ op1 = get_last_copy_of (op1);
/* See if we can determine the predicate's value. */
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Trying to determine truth value of ");
fprintf (dump_file, "predicate ");
- print_generic_stmt (dump_file, cond, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
}
/* We can fold COND and get a useful result only when we have
the same SSA_NAME on both sides of a comparison operator. */
if (op0 == op1)
{
- tree folded_cond = fold_binary (TREE_CODE (cond), boolean_type_node,
- op0, op1);
+ tree folded_cond = fold_binary (gimple_cond_code (stmt),
+ boolean_type_node, op0, op1);
if (folded_cond)
{
- basic_block bb = bb_for_stmt (stmt);
+ basic_block bb = gimple_bb (stmt);
*taken_edge_p = find_taken_edge (bb, folded_cond);
if (*taken_edge_p)
retval = SSA_PROP_INTERESTING;
@@ -685,26 +772,26 @@ copy_prop_visit_cond_stmt (tree stmt, edge *taken_edge_p)
SSA_PROP_VARYING. */
static enum ssa_prop_result
-copy_prop_visit_stmt (tree stmt, edge *taken_edge_p, tree *result_p)
+copy_prop_visit_stmt (gimple stmt, edge *taken_edge_p, tree *result_p)
{
enum ssa_prop_result retval;
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "\nVisiting statement:\n");
- print_generic_stmt (dump_file, stmt, dump_flags);
+ print_gimple_stmt (dump_file, stmt, 0, dump_flags);
fprintf (dump_file, "\n");
}
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == SSA_NAME
- && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == SSA_NAME)
+ if (gimple_assign_single_p (stmt)
+ && TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME)
{
/* If the statement is a copy assignment, evaluate its RHS to
see if the lattice value of its output has changed. */
retval = copy_prop_visit_assignment (stmt, result_p);
}
- else if (TREE_CODE (stmt) == COND_EXPR)
+ else if (gimple_code (stmt) == GIMPLE_COND)
{
/* See if we can determine which edge goes out of a conditional
jump. */
@@ -738,27 +825,26 @@ copy_prop_visit_stmt (tree stmt, edge *taken_edge_p, tree *result_p)
set it to be the value of the LHS of PHI. */
static enum ssa_prop_result
-copy_prop_visit_phi_node (tree phi)
+copy_prop_visit_phi_node (gimple phi)
{
enum ssa_prop_result retval;
- int i;
- tree lhs;
- prop_value_t phi_val = { 0, NULL_TREE, NULL_TREE };
+ unsigned i;
+ prop_value_t phi_val = { 0, NULL_TREE };
- lhs = PHI_RESULT (phi);
+ tree lhs = gimple_phi_result (phi);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "\nVisiting PHI node: ");
- print_generic_expr (dump_file, phi, dump_flags);
+ print_gimple_stmt (dump_file, phi, 0, dump_flags);
fprintf (dump_file, "\n\n");
}
- for (i = 0; i < PHI_NUM_ARGS (phi); i++)
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
{
prop_value_t *arg_val;
- tree arg = PHI_ARG_DEF (phi, i);
- edge e = PHI_ARG_EDGE (phi, i);
+ tree arg = gimple_phi_arg_def (phi, i);
+ edge e = gimple_phi_arg_edge (phi, i);
/* We don't care about values flowing through non-executable
edges. */
@@ -860,14 +946,14 @@ init_copy_prop (void)
FOR_EACH_BB (bb)
{
- block_stmt_iterator si;
- tree phi, def;
+ gimple_stmt_iterator si;
int depth = bb->loop_depth;
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
- tree stmt = bsi_stmt (si);
+ gimple stmt = gsi_stmt (si);
ssa_op_iter iter;
+ tree def;
/* The only statements that we care about are those that may
generate useful copies. We also need to mark conditional
@@ -880,31 +966,37 @@ init_copy_prop (void)
value was loop invariant, it will be hoisted by LICM and
exposed for copy propagation. */
if (stmt_ends_bb_p (stmt))
- DONT_SIMULATE_AGAIN (stmt) = false;
+ prop_set_simulate_again (stmt, true);
else if (stmt_may_generate_copy (stmt)
- && loop_depth_of_name (GIMPLE_STMT_OPERAND (stmt, 1)) <= depth)
- DONT_SIMULATE_AGAIN (stmt) = false;
+ /* Since we are iterating over the statements in
+ BB, not the phi nodes, STMT will always be an
+ assignment. */
+ && loop_depth_of_name (gimple_assign_rhs1 (stmt)) <= depth)
+ prop_set_simulate_again (stmt, true);
else
- DONT_SIMULATE_AGAIN (stmt) = true;
+ prop_set_simulate_again (stmt, false);
/* Mark all the outputs of this statement as not being
the copy of anything. */
FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_ALL_DEFS)
- if (DONT_SIMULATE_AGAIN (stmt))
+ if (!prop_simulate_again_p (stmt))
set_copy_of_val (def, def);
else
cached_last_copy_of[SSA_NAME_VERSION (def)] = def;
}
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
{
- def = PHI_RESULT (phi);
+ gimple phi = gsi_stmt (si);
+ tree def;
+
+ def = gimple_phi_result (phi);
if (!is_gimple_reg (def))
- DONT_SIMULATE_AGAIN (phi) = true;
+ prop_set_simulate_again (phi, false);
else
- DONT_SIMULATE_AGAIN (phi) = false;
+ prop_set_simulate_again (phi, true);
- if (DONT_SIMULATE_AGAIN (phi))
+ if (!prop_simulate_again_p (phi))
set_copy_of_val (def, def);
else
cached_last_copy_of[SSA_NAME_VERSION (def)] = def;
@@ -1084,4 +1176,3 @@ struct gimple_opt_pass pass_copy_prop =
| TODO_update_ssa /* todo_flags_finish */
}
};
-
diff --git a/gcc/tree-ssa-copyrename.c b/gcc/tree-ssa-copyrename.c
index 46b33143cb0..d30e2372e7e 100644
--- a/gcc/tree-ssa-copyrename.c
+++ b/gcc/tree-ssa-copyrename.c
@@ -23,13 +23,14 @@ along with GCC; see the file COPYING3. If not see
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
+#include "gimple.h"
#include "flags.h"
#include "basic-block.h"
#include "function.h"
#include "diagnostic.h"
#include "bitmap.h"
#include "tree-flow.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-inline.h"
#include "timevar.h"
#include "hashtab.h"
@@ -300,8 +301,9 @@ rename_ssa_copies (void)
{
var_map map;
basic_block bb;
- block_stmt_iterator bsi;
- tree phi, stmt, var, part_var;
+ gimple_stmt_iterator gsi;
+ tree var, part_var;
+ gimple stmt, phi;
unsigned x;
FILE *debug;
bool updated = false;
@@ -316,16 +318,15 @@ rename_ssa_copies (void)
FOR_EACH_BB (bb)
{
/* Scan for real copies. */
- 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 (gimple_assign_ssa_name_copy_p (stmt))
{
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ tree lhs = gimple_assign_lhs (stmt);
+ tree rhs = gimple_assign_rhs1 (stmt);
- if (TREE_CODE (lhs) == SSA_NAME && TREE_CODE (rhs) == SSA_NAME)
- updated |= copy_rename_partition_coalesce (map, lhs, rhs, debug);
+ updated |= copy_rename_partition_coalesce (map, lhs, rhs, debug);
}
}
}
@@ -333,18 +334,21 @@ rename_ssa_copies (void)
FOR_EACH_BB (bb)
{
/* Treat PHI nodes as copies between the result and each argument. */
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- int i;
- tree res = PHI_RESULT (phi);
+ size_t i;
+ tree res;
+
+ phi = gsi_stmt (gsi);
+ res = gimple_phi_result (phi);
/* Do not process virtual SSA_NAMES. */
if (!is_gimple_reg (SSA_NAME_VAR (res)))
continue;
- for (i = 0; i < PHI_NUM_ARGS (phi); i++)
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
{
- tree arg = PHI_ARG_DEF (phi, i);
+ tree arg = gimple_phi_arg (phi, i)->def;
if (TREE_CODE (arg) == SSA_NAME)
updated |= copy_rename_partition_coalesce (map, res, arg, debug);
}
@@ -407,4 +411,3 @@ struct gimple_opt_pass pass_rename_ssa_copies =
TODO_dump_func | TODO_verify_ssa /* todo_flags_finish */
}
};
-
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index 760e20d14bc..3c750469682 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -1,5 +1,5 @@
/* Dead code elimination pass for the GNU compiler.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
Contributed by Ben Elliston <bje@redhat.com>
and Andrew MacLeod <amacleod@redhat.com>
@@ -59,14 +59,14 @@ along with GCC; see the file COPYING3. If not see
#include "tree.h"
#include "diagnostic.h"
#include "tree-flow.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-dump.h"
#include "tree-pass.h"
#include "timevar.h"
#include "flags.h"
#include "cfgloop.h"
#include "tree-scalar-evolution.h"
-
+
static struct stmt_stats
{
int total;
@@ -75,7 +75,9 @@ static struct stmt_stats
int removed_phis;
} stats;
-static VEC(tree,heap) *worklist;
+#define STMT_NECESSARY GF_PLF_1
+
+static VEC(gimple,heap) *worklist;
/* Vector indicating an SSA name has already been processed and marked
as necessary. */
@@ -196,30 +198,26 @@ find_all_control_dependences (struct edge_list *el)
find_control_dependence (el, i);
}
-
-#define NECESSARY(stmt) stmt->base.asm_written_flag
-
/* If STMT is not already marked necessary, mark it, and add it to the
worklist if ADD_TO_WORKLIST is true. */
static inline void
-mark_stmt_necessary (tree stmt, bool add_to_worklist)
+mark_stmt_necessary (gimple stmt, bool add_to_worklist)
{
gcc_assert (stmt);
- gcc_assert (!DECL_P (stmt));
- if (NECESSARY (stmt))
+ if (gimple_plf (stmt, STMT_NECESSARY))
return;
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Marking useful stmt: ");
- print_generic_stmt (dump_file, stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
fprintf (dump_file, "\n");
}
- NECESSARY (stmt) = 1;
+ gimple_set_plf (stmt, STMT_NECESSARY, true);
if (add_to_worklist)
- VEC_safe_push (tree, heap, worklist, stmt);
+ VEC_safe_push (gimple, heap, worklist, stmt);
}
@@ -228,7 +226,7 @@ mark_stmt_necessary (tree stmt, bool add_to_worklist)
static inline void
mark_operand_necessary (tree op)
{
- tree stmt;
+ gimple stmt;
int ver;
gcc_assert (op);
@@ -241,11 +239,11 @@ mark_operand_necessary (tree op)
stmt = SSA_NAME_DEF_STMT (op);
gcc_assert (stmt);
- if (NECESSARY (stmt) || IS_EMPTY_STMT (stmt))
+ if (gimple_plf (stmt, STMT_NECESSARY) || gimple_nop_p (stmt))
return;
- NECESSARY (stmt) = 1;
- VEC_safe_push (tree, heap, worklist, stmt);
+ gimple_set_plf (stmt, STMT_NECESSARY, true);
+ VEC_safe_push (gimple, heap, worklist, stmt);
}
@@ -256,77 +254,76 @@ mark_operand_necessary (tree op)
necessary. */
static void
-mark_stmt_if_obviously_necessary (tree stmt, bool aggressive)
+mark_stmt_if_obviously_necessary (gimple stmt, bool aggressive)
{
- stmt_ann_t ann;
- tree op;
-
+ tree lhs = NULL_TREE;
/* With non-call exceptions, we have to assume that all statements could
throw. If a statement may throw, it is inherently necessary. */
if (flag_non_call_exceptions
- && tree_could_throw_p (stmt))
+ && stmt_could_throw_p (stmt))
{
mark_stmt_necessary (stmt, true);
return;
}
- /* Statements that are implicitly live. Most function calls, asm and return
- statements are required. Labels and BIND_EXPR nodes are kept because
- they are control flow, and we have no way of knowing whether they can be
- removed. DCE can eliminate all the other statements in a block, and CFG
- can then remove the block and labels. */
- switch (TREE_CODE (stmt))
+ /* Statements that are implicitly live. Most function calls, asm
+ and return statements are required. Labels and GIMPLE_BIND nodes
+ are kept because they are control flow, and we have no way of
+ knowing whether they can be removed. DCE can eliminate all the
+ other statements in a block, and CFG can then remove the block
+ and labels. */
+ switch (gimple_code (stmt))
{
- case PREDICT_EXPR:
- case LABEL_EXPR:
- case CASE_LABEL_EXPR:
+ case GIMPLE_PREDICT:
+ case GIMPLE_LABEL:
mark_stmt_necessary (stmt, false);
return;
- case ASM_EXPR:
- case RESX_EXPR:
- case RETURN_EXPR:
- case CHANGE_DYNAMIC_TYPE_EXPR:
+ case GIMPLE_ASM:
+ case GIMPLE_RESX:
+ case GIMPLE_RETURN:
+ case GIMPLE_CHANGE_DYNAMIC_TYPE:
mark_stmt_necessary (stmt, true);
return;
- case CALL_EXPR:
+ case GIMPLE_CALL:
/* Most, but not all function calls are required. Function calls that
produce no result and have no side effects (i.e. const pure
functions) are unnecessary. */
- if (TREE_SIDE_EFFECTS (stmt))
- mark_stmt_necessary (stmt, true);
- return;
-
- case GIMPLE_MODIFY_STMT:
- op = get_call_expr_in (stmt);
- if (op && TREE_SIDE_EFFECTS (op))
+ if (gimple_has_side_effects (stmt))
{
mark_stmt_necessary (stmt, true);
return;
}
-
+ if (!gimple_call_lhs (stmt))
+ return;
+ lhs = gimple_call_lhs (stmt);
+ /* Fall through */
+
+ case GIMPLE_ASSIGN:
+ if (!lhs)
+ lhs = gimple_assign_lhs (stmt);
/* These values are mildly magic bits of the EH runtime. We can't
see the entire lifetime of these values until landing pads are
generated. */
- if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == EXC_PTR_EXPR
- || TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == FILTER_EXPR)
+ if (TREE_CODE (lhs) == EXC_PTR_EXPR
+ || TREE_CODE (lhs) == FILTER_EXPR)
{
mark_stmt_necessary (stmt, true);
return;
}
break;
- case GOTO_EXPR:
+ case GIMPLE_GOTO:
gcc_assert (!simple_goto_p (stmt));
mark_stmt_necessary (stmt, true);
return;
- case COND_EXPR:
- gcc_assert (EDGE_COUNT (bb_for_stmt (stmt)->succs) == 2);
+ case GIMPLE_COND:
+ gcc_assert (EDGE_COUNT (gimple_bb (stmt)->succs) == 2);
/* Fall through. */
- case SWITCH_EXPR:
+ case GIMPLE_SWITCH:
if (! aggressive)
mark_stmt_necessary (stmt, true);
break;
@@ -335,12 +332,10 @@ mark_stmt_if_obviously_necessary (tree stmt, bool aggressive)
break;
}
- ann = stmt_ann (stmt);
-
/* If the statement has volatile operands, it needs to be preserved.
Same for statements that can alter control flow in unpredictable
ways. */
- if (ann->has_volatile_ops || is_ctrl_altering_stmt (stmt))
+ if (gimple_has_volatile_ops (stmt) || is_ctrl_altering_stmt (stmt))
{
mark_stmt_necessary (stmt, true);
return;
@@ -372,16 +367,16 @@ mark_control_dependent_edges_necessary (basic_block bb, struct edge_list *el)
EXECUTE_IF_CONTROL_DEPENDENT (bi, bb->index, edge_number)
{
- tree t;
+ gimple stmt;
basic_block cd_bb = INDEX_EDGE_PRED_BB (el, edge_number);
if (TEST_BIT (last_stmt_necessary, cd_bb->index))
continue;
SET_BIT (last_stmt_necessary, cd_bb->index);
- t = last_stmt (cd_bb);
- if (t && is_ctrl_stmt (t))
- mark_stmt_necessary (t, true);
+ stmt = last_stmt (cd_bb);
+ if (stmt && is_ctrl_stmt (stmt))
+ mark_stmt_necessary (stmt, true);
}
}
@@ -397,22 +392,24 @@ static void
find_obviously_necessary_stmts (struct edge_list *el)
{
basic_block bb;
- block_stmt_iterator i;
+ gimple_stmt_iterator gsi;
edge e;
+ gimple phi, stmt;
FOR_EACH_BB (bb)
{
- tree phi;
-
/* PHI nodes are never inherently necessary. */
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- NECESSARY (phi) = 0;
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ phi = gsi_stmt (gsi);
+ gimple_set_plf (phi, STMT_NECESSARY, false);
+ }
/* Check all statements in the block. */
- for (i = bsi_start (bb); ! bsi_end_p (i); bsi_next (&i))
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree stmt = bsi_stmt (i);
- NECESSARY (stmt) = 0;
+ stmt = gsi_stmt (gsi);
+ gimple_set_plf (stmt, STMT_NECESSARY, false);
mark_stmt_if_obviously_necessary (stmt, el != NULL);
}
}
@@ -442,21 +439,21 @@ find_obviously_necessary_stmts (struct edge_list *el)
static void
propagate_necessity (struct edge_list *el)
{
- tree stmt;
+ gimple stmt;
bool aggressive = (el ? true : false);
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "\nProcessing worklist:\n");
- while (VEC_length (tree, worklist) > 0)
+ while (VEC_length (gimple, worklist) > 0)
{
/* Take STMT from worklist. */
- stmt = VEC_pop (tree, worklist);
+ stmt = VEC_pop (gimple, worklist);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "processing: ");
- print_generic_stmt (dump_file, stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
fprintf (dump_file, "\n");
}
@@ -465,7 +462,7 @@ propagate_necessity (struct edge_list *el)
/* Mark the last statements of the basic blocks that the block
containing STMT is control dependent on, but only if we haven't
already done so. */
- basic_block bb = bb_for_stmt (stmt);
+ basic_block bb = gimple_bb (stmt);
if (bb != ENTRY_BLOCK_PTR
&& ! TEST_BIT (visited_control_parents, bb->index))
{
@@ -474,7 +471,7 @@ propagate_necessity (struct edge_list *el)
}
}
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
{
/* PHI nodes are somewhat special in that each PHI alternative has
data and control dependencies. All the statements feeding the
@@ -482,9 +479,9 @@ propagate_necessity (struct edge_list *el)
we also consider the control dependent edges leading to the
predecessor block associated with each PHI alternative as
necessary. */
- int k;
+ size_t k;
- for (k = 0; k < PHI_NUM_ARGS (stmt); k++)
+ for (k = 0; k < gimple_phi_num_args (stmt); k++)
{
tree arg = PHI_ARG_DEF (stmt, k);
if (TREE_CODE (arg) == SSA_NAME)
@@ -493,9 +490,9 @@ propagate_necessity (struct edge_list *el)
if (aggressive)
{
- for (k = 0; k < PHI_NUM_ARGS (stmt); k++)
+ for (k = 0; k < gimple_phi_num_args (stmt); k++)
{
- basic_block arg_bb = PHI_ARG_EDGE (stmt, k)->src;
+ basic_block arg_bb = gimple_phi_arg_edge (stmt, k)->src;
if (arg_bb != ENTRY_BLOCK_PTR
&& ! TEST_BIT (visited_control_parents, arg_bb->index))
{
@@ -529,35 +526,33 @@ propagate_necessity (struct edge_list *el)
static bool
remove_dead_phis (basic_block bb)
{
- tree prev, phi;
bool something_changed = false;
+ gimple_seq phis;
+ gimple phi;
+ gimple_stmt_iterator gsi;
+ phis = phi_nodes (bb);
- prev = NULL_TREE;
- phi = phi_nodes (bb);
- while (phi)
+ for (gsi = gsi_start (phis); !gsi_end_p (gsi);)
{
stats.total_phis++;
+ phi = gsi_stmt (gsi);
- if (! NECESSARY (phi))
+ if (!gimple_plf (phi, STMT_NECESSARY))
{
- tree next = PHI_CHAIN (phi);
-
something_changed = true;
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Deleting : ");
- print_generic_stmt (dump_file, phi, TDF_SLIM);
+ print_gimple_stmt (dump_file, phi, 0, TDF_SLIM);
fprintf (dump_file, "\n");
}
- remove_phi_node (phi, prev, true);
+ remove_phi_node (&gsi, true);
stats.removed_phis++;
- phi = next;
}
else
{
- prev = phi;
- phi = PHI_CHAIN (phi);
+ gsi_next (&gsi);
}
}
return something_changed;
@@ -568,14 +563,14 @@ remove_dead_phis (basic_block bb)
containing I so that we don't have to look it up. */
static void
-remove_dead_stmt (block_stmt_iterator *i, basic_block bb)
+remove_dead_stmt (gimple_stmt_iterator *i, basic_block bb)
{
- tree t = bsi_stmt (*i);
+ gimple stmt = gsi_stmt (*i);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Deleting : ");
- print_generic_stmt (dump_file, t, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
fprintf (dump_file, "\n");
}
@@ -587,7 +582,7 @@ remove_dead_stmt (block_stmt_iterator *i, basic_block bb)
immediate post-dominator. The blocks we are circumventing will be
removed by cleanup_tree_cfg if this change in the flow graph makes them
unreachable. */
- if (is_ctrl_stmt (t))
+ if (is_ctrl_stmt (stmt))
{
basic_block post_dom_bb;
@@ -649,8 +644,8 @@ remove_dead_stmt (block_stmt_iterator *i, basic_block bb)
}
}
- bsi_remove (i, true);
- release_defs (t);
+ gsi_remove (i, true);
+ release_defs (stmt);
}
@@ -662,7 +657,9 @@ eliminate_unnecessary_stmts (void)
{
bool something_changed = false;
basic_block bb;
- block_stmt_iterator i;
+ gimple_stmt_iterator gsi;
+ gimple stmt;
+ tree call;
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "\nEliminating unnecessary statements:\n");
@@ -677,51 +674,56 @@ eliminate_unnecessary_stmts (void)
FOR_EACH_BB (bb)
{
/* Remove dead statements. */
- for (i = bsi_start (bb); ! bsi_end_p (i) ; )
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi);)
{
- tree t = bsi_stmt (i);
+ stmt = gsi_stmt (gsi);
stats.total++;
- /* If `i' is not necessary then remove it. */
- if (! NECESSARY (t))
+ /* If GSI is not necessary then remove it. */
+ if (!gimple_plf (stmt, STMT_NECESSARY))
{
- remove_dead_stmt (&i, bb);
+ remove_dead_stmt (&gsi, bb);
something_changed = true;
}
- else
+ else if (is_gimple_call (stmt))
{
- tree call = get_call_expr_in (t);
+ call = gimple_call_fndecl (stmt);
if (call)
{
tree name;
+ gimple g;
/* When LHS of var = call (); is dead, simplify it into
call (); saving one operand. */
- if (TREE_CODE (t) == GIMPLE_MODIFY_STMT
- && (TREE_CODE ((name = GIMPLE_STMT_OPERAND (t, 0)))
- == SSA_NAME)
- && !TEST_BIT (processed, SSA_NAME_VERSION (name)))
+ name = gimple_call_lhs (stmt);
+ if (name && TREE_CODE (name) == SSA_NAME
+ && !TEST_BIT (processed, SSA_NAME_VERSION (name)))
{
- tree oldlhs = GIMPLE_STMT_OPERAND (t, 0);
something_changed = true;
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Deleting LHS of call: ");
- print_generic_stmt (dump_file, t, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
fprintf (dump_file, "\n");
}
- push_stmt_changes (bsi_stmt_ptr (i));
- TREE_BLOCK (call) = TREE_BLOCK (t);
- bsi_replace (&i, call, false);
- maybe_clean_or_replace_eh_stmt (t, call);
- mark_symbols_for_renaming (call);
- pop_stmt_changes (bsi_stmt_ptr (i));
- release_ssa_name (oldlhs);
+
+ push_stmt_changes (gsi_stmt_ptr (&gsi));
+ g = gimple_copy (stmt);
+ gimple_call_set_lhs (g, NULL_TREE);
+ gsi_replace (&gsi, g, false);
+ maybe_clean_or_replace_eh_stmt (stmt, g);
+ mark_symbols_for_renaming (g);
+ pop_stmt_changes (gsi_stmt_ptr (&gsi));
+ release_ssa_name (name);
}
- notice_special_calls (call);
+ notice_special_calls (stmt);
}
- bsi_next (&i);
+ gsi_next (&gsi);
+ }
+ else
+ {
+ gsi_next (&gsi);
}
}
}
@@ -749,7 +751,7 @@ print_stats (void)
fprintf (dump_file, "Removed %d of %d PHI nodes (%d%%)\n",
stats.removed_phis, stats.total_phis, (int) percg);
}
-
+
/* Initialization for this pass. Set up the used data structures. */
static void
@@ -772,7 +774,7 @@ tree_dce_init (bool aggressive)
processed = sbitmap_alloc (num_ssa_names + 1);
sbitmap_zero (processed);
- worklist = VEC_alloc (tree, heap, 64);
+ worklist = VEC_alloc (gimple, heap, 64);
cfg_altered = false;
}
@@ -795,9 +797,9 @@ tree_dce_done (bool aggressive)
sbitmap_free (processed);
- VEC_free (tree, heap, worklist);
+ VEC_free (gimple, heap, worklist);
}
-
+
/* Main routine to eliminate dead code.
AGGRESSIVE controls the aggressiveness of the algorithm.
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 0b159382e7e..cd7defa869c 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -46,6 +46,37 @@ along with GCC; see the file COPYING3. If not see
/* This file implements optimizations on the dominator tree. */
+/* Representation of a "naked" right-hand-side expression, to be used
+ in recording available expressions in the expression hash table. */
+
+enum expr_kind
+{
+ EXPR_SINGLE,
+ EXPR_UNARY,
+ EXPR_BINARY,
+ EXPR_CALL
+};
+
+struct hashable_expr
+{
+ tree type;
+ enum expr_kind kind;
+ union {
+ struct { tree rhs; } single;
+ struct { enum tree_code op; tree opnd; } unary;
+ struct { enum tree_code op; tree opnd0; tree opnd1; } binary;
+ struct { tree fn; bool pure; size_t nargs; tree *args; } call;
+ } ops;
+};
+
+/* Structure for recording known values of a conditional expression
+ at the exits from its block. */
+
+struct cond_equivalence
+{
+ struct hashable_expr cond;
+ tree value;
+};
/* Structure for recording edge equivalences as well as any pending
edge redirections during the dominator optimizer.
@@ -72,11 +103,10 @@ struct edge_info
are true or false. The number of recorded conditions can vary, but
can be determined by the condition's code. So we have an array
and its maximum index rather than use a varray. */
- tree *cond_equivalences;
+ struct cond_equivalence *cond_equivalences;
unsigned int max_cond_equivalences;
};
-
/* Hash table with expressions made available during the renaming process.
When an assignment of the form X_i = EXPR is found, the statement is
stored in this table. If the same expression EXPR is later found on the
@@ -91,7 +121,11 @@ static htab_t avail_exprs;
(null). When we finish processing the block, we pop off entries and
remove the expressions from the global hash table until we hit the
marker. */
-static VEC(tree,heap) *avail_exprs_stack;
+typedef struct expr_hash_elt * expr_hash_elt_t;
+DEF_VEC_P(expr_hash_elt_t);
+DEF_VEC_ALLOC_P(expr_hash_elt_t,heap);
+
+static VEC(expr_hash_elt_t,heap) *avail_exprs_stack;
/* Stack of statements we need to rescan during finalization for newly
exposed variables.
@@ -100,22 +134,13 @@ static VEC(tree,heap) *avail_exprs_stack;
expressions are removed from AVAIL_EXPRS. Else we may change the
hash code for an expression and be unable to find/remove it from
AVAIL_EXPRS. */
-typedef tree *tree_p;
-DEF_VEC_P(tree_p);
-DEF_VEC_ALLOC_P(tree_p,heap);
-
-static VEC(tree_p,heap) *stmts_to_rescan;
+typedef gimple *gimple_p;
+DEF_VEC_P(gimple_p);
+DEF_VEC_ALLOC_P(gimple_p,heap);
-/* Structure for entries in the expression hash table.
+static VEC(gimple_p,heap) *stmts_to_rescan;
- This requires more memory for the hash table entries, but allows us
- to avoid creating silly tree nodes and annotations for conditionals,
- eliminates 2 global hash tables and two block local varrays.
-
- It also allows us to reduce the number of hash table lookups we
- have to perform in lookup_avail_expr and finally it allows us to
- significantly reduce the number of calls into the hashing routine
- itself. */
+/* Structure for entries in the expression hash table. */
struct expr_hash_elt
{
@@ -123,13 +148,17 @@ struct expr_hash_elt
tree lhs;
/* The expression (rhs) we want to record. */
- tree rhs;
+ struct hashable_expr expr;
/* The stmt pointer if this element corresponds to a statement. */
- tree stmt;
+ gimple stmt;
- /* The hash value for RHS/ann. */
+ /* The hash value for RHS. */
hashval_t hash;
+
+ /* A unique stamp, typically the address of the hash
+ element itself, used in removing entries from the table. */
+ struct expr_hash_elt *stamp;
};
/* Stack of dest,src pairs that need to be restored during finalization.
@@ -157,28 +186,22 @@ struct opt_stats_d
static struct opt_stats_d opt_stats;
-struct eq_expr_value
-{
- tree src;
- tree dst;
-};
-
/* Local functions. */
static void optimize_stmt (struct dom_walk_data *,
- basic_block bb,
- block_stmt_iterator);
-static tree lookup_avail_expr (tree, bool);
+ basic_block,
+ gimple_stmt_iterator);
+static tree lookup_avail_expr (gimple, bool);
static hashval_t avail_expr_hash (const void *);
static hashval_t real_avail_expr_hash (const void *);
static int avail_expr_eq (const void *, const void *);
static void htab_statistics (FILE *, htab_t);
-static void record_cond (tree, tree);
+static void record_cond (struct cond_equivalence *);
static void record_const_or_copy (tree, tree);
static void record_equality (tree, tree);
static void record_equivalences_from_phis (basic_block);
static void record_equivalences_from_incoming_edge (basic_block);
-static bool eliminate_redundant_computations (tree);
-static void record_equivalences_from_stmt (tree, int, stmt_ann_t);
+static bool eliminate_redundant_computations (gimple_stmt_iterator *);
+static void record_equivalences_from_stmt (gimple, int);
static void dom_thread_across_edge (struct dom_walk_data *, edge);
static void dom_opt_finalize_block (struct dom_walk_data *, basic_block);
static void dom_opt_initialize_block (struct dom_walk_data *, basic_block);
@@ -188,6 +211,364 @@ static void restore_vars_to_original_value (void);
static edge single_incoming_edge_ignoring_loop_edges (basic_block);
+/* Given a statement STMT, initialize the hash table element pointed to
+ by ELEMENT. */
+
+static void
+initialize_hash_element (gimple stmt, tree lhs,
+ struct expr_hash_elt *element)
+{
+ enum gimple_code code = gimple_code (stmt);
+ struct hashable_expr *expr = &element->expr;
+
+ if (code == GIMPLE_ASSIGN)
+ {
+ enum tree_code subcode = gimple_assign_rhs_code (stmt);
+
+ expr->type = NULL_TREE;
+
+ switch (get_gimple_rhs_class (subcode))
+ {
+ case GIMPLE_SINGLE_RHS:
+ expr->kind = EXPR_SINGLE;
+ expr->ops.single.rhs = gimple_assign_rhs1 (stmt);
+ break;
+ case GIMPLE_UNARY_RHS:
+ expr->kind = EXPR_UNARY;
+ expr->type = TREE_TYPE (gimple_assign_lhs (stmt));
+ expr->ops.unary.op = subcode;
+ expr->ops.unary.opnd = gimple_assign_rhs1 (stmt);
+ break;
+ case GIMPLE_BINARY_RHS:
+ expr->kind = EXPR_BINARY;
+ expr->type = TREE_TYPE (gimple_assign_lhs (stmt));
+ expr->ops.binary.op = subcode;
+ expr->ops.binary.opnd0 = gimple_assign_rhs1 (stmt);
+ expr->ops.binary.opnd1 = gimple_assign_rhs2 (stmt);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+ }
+ else if (code == GIMPLE_COND)
+ {
+ expr->type = boolean_type_node;
+ expr->kind = EXPR_BINARY;
+ expr->ops.binary.op = gimple_cond_code (stmt);
+ expr->ops.binary.opnd0 = gimple_cond_lhs (stmt);
+ expr->ops.binary.opnd1 = gimple_cond_rhs (stmt);
+ }
+ else if (code == GIMPLE_CALL)
+ {
+ size_t nargs = gimple_call_num_args (stmt);
+ size_t i;
+
+ gcc_assert (gimple_call_lhs (stmt));
+
+ expr->type = TREE_TYPE (gimple_call_lhs (stmt));
+ expr->kind = EXPR_CALL;
+ expr->ops.call.fn = gimple_call_fn (stmt);
+
+ if (gimple_call_flags (stmt) & (ECF_CONST | ECF_PURE))
+ expr->ops.call.pure = true;
+ else
+ expr->ops.call.pure = false;
+
+ expr->ops.call.nargs = nargs;
+ expr->ops.call.args = (tree *) xcalloc (nargs, sizeof (tree));
+ for (i = 0; i < nargs; i++)
+ expr->ops.call.args[i] = gimple_call_arg (stmt, i);
+ }
+ else if (code == GIMPLE_SWITCH)
+ {
+ expr->type = TREE_TYPE (gimple_switch_index (stmt));
+ expr->kind = EXPR_SINGLE;
+ expr->ops.single.rhs = gimple_switch_index (stmt);
+ }
+ else if (code == GIMPLE_GOTO)
+ {
+ expr->type = TREE_TYPE (gimple_goto_dest (stmt));
+ expr->kind = EXPR_SINGLE;
+ expr->ops.single.rhs = gimple_goto_dest (stmt);
+ }
+ else
+ gcc_unreachable ();
+
+ element->lhs = lhs;
+ element->stmt = stmt;
+ element->hash = avail_expr_hash (element);
+ element->stamp = element;
+}
+
+/* Given a conditional expression COND as a tree, initialize
+ a hashable_expr expression EXPR. The conditional must be a
+ comparison or logical negation. A constant or a variable is
+ not permitted. */
+
+static void
+initialize_expr_from_cond (tree cond, struct hashable_expr *expr)
+{
+ expr->type = boolean_type_node;
+
+ if (COMPARISON_CLASS_P (cond))
+ {
+ expr->kind = EXPR_BINARY;
+ expr->ops.binary.op = TREE_CODE (cond);
+ expr->ops.binary.opnd0 = TREE_OPERAND (cond, 0);
+ expr->ops.binary.opnd1 = TREE_OPERAND (cond, 1);
+ }
+ else if (TREE_CODE (cond) == TRUTH_NOT_EXPR)
+ {
+ expr->kind = EXPR_UNARY;
+ expr->ops.unary.op = TRUTH_NOT_EXPR;
+ expr->ops.unary.opnd = TREE_OPERAND (cond, 0);
+ }
+ else
+ gcc_unreachable ();
+}
+
+/* Given a hashable_expr expression EXPR and an LHS,
+ initialize the hash table element pointed to by ELEMENT. */
+
+static void
+initialize_hash_element_from_expr (struct hashable_expr *expr,
+ tree lhs,
+ struct expr_hash_elt *element)
+{
+ element->expr = *expr;
+ element->lhs = lhs;
+ element->stmt = NULL;
+ element->hash = avail_expr_hash (element);
+ element->stamp = element;
+}
+
+/* Compare two hashable_expr structures for equivalence.
+ They are considered equivalent when the the expressions
+ they denote must necessarily be equal. The logic is intended
+ to follow that of operand_equal_p in fold-const.c */
+
+static bool
+hashable_expr_equal_p (const struct hashable_expr *expr0,
+ const struct hashable_expr *expr1)
+{
+ tree type0 = expr0->type;
+ tree type1 = expr1->type;
+
+ /* If either type is NULL, there is nothing to check. */
+ if ((type0 == NULL_TREE) ^ (type1 == NULL_TREE))
+ return false;
+
+ /* If both types don't have the same signedness, precision, and mode,
+ then we can't consider them equal. */
+ if (type0 != type1
+ && (TREE_CODE (type0) == ERROR_MARK
+ || TREE_CODE (type1) == ERROR_MARK
+ || TYPE_UNSIGNED (type0) != TYPE_UNSIGNED (type1)
+ || TYPE_PRECISION (type0) != TYPE_PRECISION (type1)
+ || TYPE_MODE (type0) != TYPE_MODE (type1)))
+ return false;
+
+ if (expr0->kind != expr1->kind)
+ return false;
+
+ switch (expr0->kind)
+ {
+ case EXPR_SINGLE:
+ return operand_equal_p (expr0->ops.single.rhs,
+ expr1->ops.single.rhs, 0);
+
+ case EXPR_UNARY:
+ if (expr0->ops.unary.op != expr1->ops.unary.op)
+ return false;
+
+ 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;
+
+ return operand_equal_p (expr0->ops.unary.opnd,
+ expr1->ops.unary.opnd, 0);
+
+ case EXPR_BINARY:
+ {
+ if (expr0->ops.binary.op != expr1->ops.binary.op)
+ return false;
+
+ if (operand_equal_p (expr0->ops.binary.opnd0,
+ expr1->ops.binary.opnd0, 0)
+ && operand_equal_p (expr0->ops.binary.opnd1,
+ expr1->ops.binary.opnd1, 0))
+ return true;
+
+ /* For commutative ops, allow the other order. */
+ return (commutative_tree_code (expr0->ops.binary.op)
+ && operand_equal_p (expr0->ops.binary.opnd0,
+ expr1->ops.binary.opnd1, 0)
+ && operand_equal_p (expr0->ops.binary.opnd1,
+ expr1->ops.binary.opnd0, 0));
+ }
+
+ case EXPR_CALL:
+ {
+ size_t i;
+
+ /* If the calls are to different functions, then they
+ clearly cannot be equal. */
+ if (! operand_equal_p (expr0->ops.call.fn,
+ expr1->ops.call.fn, 0))
+ return false;
+
+ if (! expr0->ops.call.pure)
+ return false;
+
+ if (expr0->ops.call.nargs != expr1->ops.call.nargs)
+ return false;
+
+ for (i = 0; i < expr0->ops.call.nargs; i++)
+ if (! operand_equal_p (expr0->ops.call.args[i],
+ expr1->ops.call.args[i], 0))
+ return false;
+
+ return true;
+ }
+
+ default:
+ gcc_unreachable ();
+ }
+}
+
+/* Compute a hash value for a hashable_expr value EXPR and a
+ previously accumulated hash value VAL. If two hashable_expr
+ values compare equal with hashable_expr_equal_p, they must
+ hash to the same value, given an identical value of VAL.
+ The logic is intended to follow iterative_hash_expr in tree.c. */
+
+static hashval_t
+iterative_hash_hashable_expr (const struct hashable_expr *expr, hashval_t val)
+{
+ switch (expr->kind)
+ {
+ case EXPR_SINGLE:
+ val = iterative_hash_expr (expr->ops.single.rhs, val);
+ break;
+
+ case EXPR_UNARY:
+ val = iterative_hash_object (expr->ops.unary.op, val);
+
+ /* Make sure to include signedness in the hash computation.
+ 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 (CONVERT_EXPR_CODE_P (expr->ops.unary.op)
+ || expr->ops.unary.op == NON_LVALUE_EXPR)
+ val += TYPE_UNSIGNED (expr->type);
+
+ val = iterative_hash_expr (expr->ops.unary.opnd, val);
+ break;
+
+ case EXPR_BINARY:
+ val = iterative_hash_object (expr->ops.binary.op, val);
+ if (commutative_tree_code (expr->ops.binary.op))
+ val = iterative_hash_exprs_commutative (expr->ops.binary.opnd0,
+ expr->ops.binary.opnd1, val);
+ else
+ {
+ val = iterative_hash_expr (expr->ops.binary.opnd0, val);
+ val = iterative_hash_expr (expr->ops.binary.opnd1, val);
+ }
+ break;
+
+ case EXPR_CALL:
+ {
+ size_t i;
+ enum tree_code code = CALL_EXPR;
+
+ val = iterative_hash_object (code, val);
+ val = iterative_hash_expr (expr->ops.call.fn, val);
+ for (i = 0; i < expr->ops.call.nargs; i++)
+ val = iterative_hash_expr (expr->ops.call.args[i], val);
+ }
+ break;
+
+ default:
+ gcc_unreachable ();
+ }
+
+ return val;
+}
+
+/* Print a diagnostic dump of an expression hash table entry. */
+
+static void
+print_expr_hash_elt (FILE * stream, const struct expr_hash_elt *element)
+{
+ if (element->stmt)
+ fprintf (stream, "STMT ");
+ else
+ fprintf (stream, "COND ");
+
+ if (element->lhs)
+ {
+ print_generic_expr (stream, element->lhs, 0);
+ fprintf (stream, " = ");
+ }
+
+ switch (element->expr.kind)
+ {
+ case EXPR_SINGLE:
+ print_generic_expr (stream, element->expr.ops.single.rhs, 0);
+ break;
+
+ case EXPR_UNARY:
+ fprintf (stream, "%s ", tree_code_name[element->expr.ops.unary.op]);
+ print_generic_expr (stream, element->expr.ops.unary.opnd, 0);
+ break;
+
+ case EXPR_BINARY:
+ print_generic_expr (stream, element->expr.ops.binary.opnd0, 0);
+ fprintf (stream, " %s ", tree_code_name[element->expr.ops.binary.op]);
+ print_generic_expr (stream, element->expr.ops.binary.opnd1, 0);
+ break;
+
+ case EXPR_CALL:
+ {
+ size_t i;
+ size_t nargs = element->expr.ops.call.nargs;
+
+ print_generic_expr (stream, element->expr.ops.call.fn, 0);
+ fprintf (stream, " (");
+ for (i = 0; i < nargs; i++)
+ {
+ print_generic_expr (stream, element->expr.ops.call.args[i], 0);
+ if (i + 1 < nargs)
+ fprintf (stream, ", ");
+ }
+ fprintf (stream, ")");
+ }
+ break;
+ }
+ fprintf (stream, "\n");
+
+ if (element->stmt)
+ {
+ fprintf (stream, " ");
+ print_gimple_stmt (stream, element->stmt, 0, 0);
+ }
+}
+
+/* Delete an expr_hash_elt and reclaim its storage. */
+
+static void
+free_expr_hash_elt (void *elt)
+{
+ struct expr_hash_elt *element = ((struct expr_hash_elt *)elt);
+
+ if (element->expr.kind == EXPR_CALL)
+ free (element->expr.ops.call.args);
+
+ free (element);
+}
+
/* Allocate an EDGE_INFO for edge E and attach it to E.
Return the new EDGE_INFO structure. */
@@ -247,10 +628,10 @@ tree_ssa_dominator_optimize (void)
memset (&opt_stats, 0, sizeof (opt_stats));
/* Create our hash tables. */
- avail_exprs = htab_create (1024, real_avail_expr_hash, avail_expr_eq, free);
- avail_exprs_stack = VEC_alloc (tree, heap, 20);
+ avail_exprs = htab_create (1024, real_avail_expr_hash, avail_expr_eq, free_expr_hash_elt);
+ avail_exprs_stack = VEC_alloc (expr_hash_elt_t, heap, 20);
const_and_copies_stack = VEC_alloc (tree, heap, 20);
- stmts_to_rescan = VEC_alloc (tree_p, heap, 20);
+ stmts_to_rescan = VEC_alloc (gimple_p, heap, 20);
need_eh_cleanup = BITMAP_ALLOC (NULL);
/* Setup callbacks for the generic dominator tree walker. */
@@ -291,12 +672,11 @@ tree_ssa_dominator_optimize (void)
walk_dominator_tree (&walk_data, ENTRY_BLOCK_PTR);
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
basic_block bb;
FOR_EACH_BB (bb)
- {
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- update_stmt_if_modified (bsi_stmt (bsi));
+ {for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ update_stmt_if_modified (gsi_stmt (gsi));
}
}
@@ -336,7 +716,7 @@ tree_ssa_dominator_optimize (void)
}
}
- tree_purge_all_dead_eh_edges (need_eh_cleanup);
+ gimple_purge_all_dead_eh_edges (need_eh_cleanup);
bitmap_zero (need_eh_cleanup);
}
@@ -379,9 +759,10 @@ tree_ssa_dominator_optimize (void)
/* Free asserted bitmaps and stacks. */
BITMAP_FREE (need_eh_cleanup);
- VEC_free (tree, heap, avail_exprs_stack);
+ VEC_free (expr_hash_elt_t, heap, avail_exprs_stack);
VEC_free (tree, heap, const_and_copies_stack);
- VEC_free (tree_p, heap, stmts_to_rescan);
+ VEC_free (gimple_p, heap, stmts_to_rescan);
+
return 0;
}
@@ -414,22 +795,22 @@ struct gimple_opt_pass pass_dominator =
};
-/* Given a stmt CONDSTMT containing a COND_EXPR, canonicalize the
- COND_EXPR into a canonical form. */
+/* Given a conditional statement CONDSTMT, convert the
+ condition to a canonical form. */
static void
-canonicalize_comparison (tree condstmt)
+canonicalize_comparison (gimple condstmt)
{
- tree cond = COND_EXPR_COND (condstmt);
tree op0;
tree op1;
- enum tree_code code = TREE_CODE (cond);
+ enum tree_code code;
- if (!COMPARISON_CLASS_P (cond))
- return;
+ gcc_assert (gimple_code (condstmt) == GIMPLE_COND);
- op0 = TREE_OPERAND (cond, 0);
- op1 = TREE_OPERAND (cond, 1);
+ op0 = gimple_cond_lhs (condstmt);
+ op1 = gimple_cond_rhs (condstmt);
+
+ code = gimple_cond_code (condstmt);
/* If it would be profitable to swap the operands, then do so to
canonicalize the statement, enabling better optimization.
@@ -446,17 +827,13 @@ canonicalize_comparison (tree condstmt)
|| code == LE_EXPR
|| code == GE_EXPR)
{
- TREE_SET_CODE (cond, swap_tree_comparison (code));
- swap_tree_operands (condstmt,
- &TREE_OPERAND (cond, 0),
- &TREE_OPERAND (cond, 1));
- /* If one operand was in the operand cache, but the other is
- not, because it is a constant, this is a case that the
- internal updating code of swap_tree_operands can't handle
- properly. */
- if (TREE_CODE_CLASS (TREE_CODE (op0))
- != TREE_CODE_CLASS (TREE_CODE (op1)))
- update_stmt (condstmt);
+ code = swap_tree_comparison (code);
+
+ gimple_cond_set_code (condstmt, code);
+ gimple_cond_set_lhs (condstmt, op1);
+ gimple_cond_set_rhs (condstmt, op0);
+
+ update_stmt (condstmt);
}
}
}
@@ -474,7 +851,7 @@ dom_opt_initialize_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
/* Push a marker on the stacks of local information so that we know how
far to unwind when we finalize this block. */
- VEC_safe_push (tree, heap, avail_exprs_stack, NULL_TREE);
+ VEC_safe_push (expr_hash_elt_t, heap, avail_exprs_stack, NULL);
VEC_safe_push (tree, heap, const_and_copies_stack, NULL_TREE);
record_equivalences_from_incoming_edge (bb);
@@ -483,52 +860,6 @@ dom_opt_initialize_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
record_equivalences_from_phis (bb);
}
-/* Given an expression EXPR (a relational expression or a statement),
- initialize the hash table element pointed to by ELEMENT. */
-
-static void
-initialize_hash_element (tree expr, tree lhs, struct expr_hash_elt *element)
-{
- /* Hash table elements may be based on conditional expressions or statements.
-
- For the former case, we have no annotation and we want to hash the
- conditional expression. In the latter case we have an annotation and
- we want to record the expression the statement evaluates. */
- if (COMPARISON_CLASS_P (expr) || TREE_CODE (expr) == TRUTH_NOT_EXPR)
- {
- element->stmt = NULL;
- element->rhs = expr;
- }
- else if (TREE_CODE (expr) == COND_EXPR)
- {
- element->stmt = expr;
- element->rhs = COND_EXPR_COND (expr);
- }
- else if (TREE_CODE (expr) == SWITCH_EXPR)
- {
- element->stmt = expr;
- element->rhs = SWITCH_COND (expr);
- }
- else if (TREE_CODE (expr) == RETURN_EXPR && TREE_OPERAND (expr, 0))
- {
- element->stmt = expr;
- element->rhs = GIMPLE_STMT_OPERAND (TREE_OPERAND (expr, 0), 1);
- }
- else if (TREE_CODE (expr) == GOTO_EXPR)
- {
- element->stmt = expr;
- element->rhs = GOTO_DESTINATION (expr);
- }
- else
- {
- element->stmt = expr;
- element->rhs = GENERIC_TREE_OPERAND (expr, 1);
- }
-
- element->lhs = lhs;
- element->hash = avail_expr_hash (element);
-}
-
/* Remove all the expressions in LOCALS from TABLE, stopping when there are
LIMIT entries left in LOCALs. */
@@ -536,15 +867,25 @@ static void
remove_local_expressions_from_table (void)
{
/* Remove all the expressions made available in this block. */
- while (VEC_length (tree, avail_exprs_stack) > 0)
+ while (VEC_length (expr_hash_elt_t, avail_exprs_stack) > 0)
{
struct expr_hash_elt element;
- tree expr = VEC_pop (tree, avail_exprs_stack);
+ expr_hash_elt_t victim = VEC_pop (expr_hash_elt_t, avail_exprs_stack);
- if (expr == NULL_TREE)
+ if (victim == NULL)
break;
- initialize_hash_element (expr, NULL, &element);
+ element = *victim;
+
+ /* This must precede the actual removal from the hash table,
+ as ELEMENT and the table entry may share a call argument
+ vector which will be freed during removal. */
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "<<<< ");
+ print_expr_hash_elt (dump_file, &element);
+ }
+
htab_remove_elt_with_hash (avail_exprs, &element, element.hash);
}
}
@@ -565,6 +906,15 @@ restore_vars_to_original_value (void)
if (dest == NULL)
break;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "<<<< COPY ");
+ print_generic_expr (dump_file, dest, 0);
+ fprintf (dump_file, " = ");
+ print_generic_expr (dump_file, SSA_NAME_VALUE (dest), 0);
+ fprintf (dump_file, "\n");
+ }
+
prev_value = VEC_pop (tree, const_and_copies_stack);
SSA_NAME_VALUE (dest) = prev_value;
}
@@ -573,7 +923,8 @@ restore_vars_to_original_value (void)
/* A trivial wrapper so that we can present the generic jump
threading code with a simple API for simplifying statements. */
static tree
-simplify_stmt_for_jump_threading (tree stmt, tree within_stmt ATTRIBUTE_UNUSED)
+simplify_stmt_for_jump_threading (gimple stmt,
+ gimple within_stmt ATTRIBUTE_UNUSED)
{
return lookup_avail_expr (stmt, false);
}
@@ -585,16 +936,16 @@ simplify_stmt_for_jump_threading (tree stmt, tree within_stmt ATTRIBUTE_UNUSED)
static void
dom_thread_across_edge (struct dom_walk_data *walk_data, edge e)
{
- /* If we don't already have a dummy condition, build it now. */
if (! walk_data->global_data)
- {
- tree dummy_cond = build2 (NE_EXPR, boolean_type_node,
- integer_zero_node, integer_zero_node);
- dummy_cond = build3 (COND_EXPR, void_type_node, dummy_cond, NULL, NULL);
- walk_data->global_data = dummy_cond;
- }
+ {
+ gimple dummy_cond =
+ gimple_build_cond (NE_EXPR,
+ integer_zero_node, integer_zero_node,
+ NULL, NULL);
+ walk_data->global_data = dummy_cond;
+ }
- thread_across_edge ((tree) walk_data->global_data, e, false,
+ thread_across_edge ((gimple) walk_data->global_data, e, false,
&const_and_copies_stack,
simplify_stmt_for_jump_threading);
}
@@ -606,8 +957,7 @@ dom_thread_across_edge (struct dom_walk_data *walk_data, edge e)
static void
dom_opt_finalize_block (struct dom_walk_data *walk_data, basic_block bb)
{
- tree last;
-
+ gimple last;
/* If we have an outgoing edge to a block with multiple incoming and
outgoing edges, then we may be able to thread the edge, i.e., we
@@ -620,9 +970,7 @@ dom_opt_finalize_block (struct dom_walk_data *walk_data, basic_block bb)
dom_thread_across_edge (walk_data, single_succ_edge (bb));
}
else if ((last = last_stmt (bb))
- && TREE_CODE (last) == COND_EXPR
- && (COMPARISON_CLASS_P (COND_EXPR_COND (last))
- || TREE_CODE (COND_EXPR_COND (last)) == SSA_NAME)
+ && gimple_code (last) == GIMPLE_COND
&& EDGE_COUNT (bb->succs) == 2
&& (EDGE_SUCC (bb, 0)->flags & EDGE_ABNORMAL) == 0
&& (EDGE_SUCC (bb, 1)->flags & EDGE_ABNORMAL) == 0)
@@ -641,33 +989,28 @@ dom_opt_finalize_block (struct dom_walk_data *walk_data, basic_block bb)
/* Push a marker onto the available expression stack so that we
unwind any expressions related to the TRUE arm before processing
the false arm below. */
- VEC_safe_push (tree, heap, avail_exprs_stack, NULL_TREE);
+ VEC_safe_push (expr_hash_elt_t, heap, avail_exprs_stack, NULL);
VEC_safe_push (tree, heap, const_and_copies_stack, NULL_TREE);
edge_info = (struct edge_info *) true_edge->aux;
/* If we have info associated with this edge, record it into
- our equivalency tables. */
+ our equivalence tables. */
if (edge_info)
{
- tree *cond_equivalences = edge_info->cond_equivalences;
+ struct cond_equivalence *cond_equivalences = edge_info->cond_equivalences;
tree lhs = edge_info->lhs;
tree rhs = edge_info->rhs;
- /* If we have a simple NAME = VALUE equivalency record it. */
+ /* If we have a simple NAME = VALUE equivalence, record it. */
if (lhs && TREE_CODE (lhs) == SSA_NAME)
record_const_or_copy (lhs, rhs);
/* If we have 0 = COND or 1 = COND equivalences, record them
into our expression hash tables. */
if (cond_equivalences)
- for (i = 0; i < edge_info->max_cond_equivalences; i += 2)
- {
- tree expr = cond_equivalences[i];
- tree value = cond_equivalences[i + 1];
-
- record_cond (expr, value);
- }
+ for (i = 0; i < edge_info->max_cond_equivalences; i++)
+ record_cond (&cond_equivalences[i]);
}
dom_thread_across_edge (walk_data, true_edge);
@@ -687,27 +1030,22 @@ dom_opt_finalize_block (struct dom_walk_data *walk_data, basic_block bb)
edge_info = (struct edge_info *) false_edge->aux;
/* If we have info associated with this edge, record it into
- our equivalency tables. */
+ our equivalence tables. */
if (edge_info)
{
- tree *cond_equivalences = edge_info->cond_equivalences;
+ struct cond_equivalence *cond_equivalences = edge_info->cond_equivalences;
tree lhs = edge_info->lhs;
tree rhs = edge_info->rhs;
- /* If we have a simple NAME = VALUE equivalency record it. */
+ /* If we have a simple NAME = VALUE equivalence, record it. */
if (lhs && TREE_CODE (lhs) == SSA_NAME)
record_const_or_copy (lhs, rhs);
/* If we have 0 = COND or 1 = COND equivalences, record them
into our expression hash tables. */
if (cond_equivalences)
- for (i = 0; i < edge_info->max_cond_equivalences; i += 2)
- {
- tree expr = cond_equivalences[i];
- tree value = cond_equivalences[i + 1];
-
- record_cond (expr, value);
- }
+ for (i = 0; i < edge_info->max_cond_equivalences; i++)
+ record_cond (&cond_equivalences[i]);
}
/* Now thread the edge. */
@@ -724,16 +1062,16 @@ dom_opt_finalize_block (struct dom_walk_data *walk_data, basic_block bb)
/* If we queued any statements to rescan in this block, then
go ahead and rescan them now. */
- while (VEC_length (tree_p, stmts_to_rescan) > 0)
+ while (VEC_length (gimple_p, stmts_to_rescan) > 0)
{
- tree *stmt_p = VEC_last (tree_p, stmts_to_rescan);
- tree stmt = *stmt_p;
- basic_block stmt_bb = bb_for_stmt (stmt);
+ gimple *stmt_p = VEC_last (gimple_p, stmts_to_rescan);
+ gimple stmt = *stmt_p;
+ basic_block stmt_bb = gimple_bb (stmt);
if (stmt_bb != bb)
break;
- VEC_pop (tree_p, stmts_to_rescan);
+ VEC_pop (gimple_p, stmts_to_rescan);
pop_stmt_changes (stmt_p);
}
}
@@ -747,17 +1085,19 @@ dom_opt_finalize_block (struct dom_walk_data *walk_data, basic_block bb)
static void
record_equivalences_from_phis (basic_block bb)
{
- tree phi;
-
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ gimple_stmt_iterator gsi;
+
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree lhs = PHI_RESULT (phi);
+ gimple phi = gsi_stmt (gsi);
+
+ tree lhs = gimple_phi_result (phi);
tree rhs = NULL;
- int i;
+ size_t i;
- for (i = 0; i < PHI_NUM_ARGS (phi); i++)
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
{
- tree t = PHI_ARG_DEF (phi, i);
+ tree t = gimple_phi_arg_def (phi, i);
/* Ignore alternatives which are the same as our LHS. Since
LHS is a PHI_RESULT, it is known to be a SSA_NAME, so we
@@ -787,8 +1127,7 @@ record_equivalences_from_phis (basic_block bb)
this, since this is a true assignment and not an equivalence
inferred from a comparison. All uses of this ssa name are dominated
by this assignment, so unwinding just costs time and space. */
- if (i == PHI_NUM_ARGS (phi)
- && may_propagate_copy (lhs, rhs))
+ if (i == gimple_phi_num_args (phi) && may_propagate_copy (lhs, rhs))
SSA_NAME_VALUE (lhs) = rhs;
}
}
@@ -851,21 +1190,14 @@ record_equivalences_from_incoming_edge (basic_block bb)
{
tree lhs = edge_info->lhs;
tree rhs = edge_info->rhs;
- tree *cond_equivalences = edge_info->cond_equivalences;
+ struct cond_equivalence *cond_equivalences = edge_info->cond_equivalences;
if (lhs)
record_equality (lhs, rhs);
if (cond_equivalences)
- {
- for (i = 0; i < edge_info->max_cond_equivalences; i += 2)
- {
- tree expr = cond_equivalences[i];
- tree value = cond_equivalences[i + 1];
-
- record_cond (expr, value);
- }
- }
+ for (i = 0; i < edge_info->max_cond_equivalences; i++)
+ record_cond (&cond_equivalences[i]);
}
}
}
@@ -907,38 +1239,56 @@ htab_statistics (FILE *file, htab_t htab)
htab_collisions (htab));
}
-/* Enter a statement into the true/false expression hash table indicating
- that the condition COND has the value VALUE. */
+
+/* Enter condition equivalence into the expression hash table.
+ This indicates that a conditional expression has a known
+ boolean value. */
static void
-record_cond (tree cond, tree value)
+record_cond (struct cond_equivalence *p)
{
struct expr_hash_elt *element = XCNEW (struct expr_hash_elt);
void **slot;
- initialize_hash_element (cond, value, element);
+ initialize_hash_element_from_expr (&p->cond, p->value, element);
slot = htab_find_slot_with_hash (avail_exprs, (void *)element,
element->hash, INSERT);
if (*slot == NULL)
{
*slot = (void *) element;
- VEC_safe_push (tree, heap, avail_exprs_stack, cond);
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "1>>> ");
+ print_expr_hash_elt (dump_file, element);
+ }
+
+ VEC_safe_push (expr_hash_elt_t, heap, avail_exprs_stack, element);
}
else
free (element);
}
-/* Build a new conditional using NEW_CODE, OP0 and OP1 and store
- the new conditional into *p, then store a boolean_true_node
- into *(p + 1). */
+/* Build a cond_equivalence record indicating that the comparison
+ CODE holds between operands OP0 and OP1. */
static void
-build_and_record_new_cond (enum tree_code new_code, tree op0, tree op1, tree *p)
+build_and_record_new_cond (enum tree_code code,
+ tree op0, tree op1,
+ struct cond_equivalence *p)
{
- *p = build2 (new_code, boolean_type_node, op0, op1);
- p++;
- *p = boolean_true_node;
+ struct hashable_expr *cond = &p->cond;
+
+ gcc_assert (TREE_CODE_CLASS (code) == tcc_comparison);
+
+ cond->type = boolean_type_node;
+ cond->kind = EXPR_BINARY;
+ cond->ops.binary.op = code;
+ cond->ops.binary.opnd0 = op0;
+ cond->ops.binary.opnd1 = op1;
+
+ p->value = boolean_true_node;
}
/* Record that COND is true and INVERTED is false into the edge information
@@ -964,119 +1314,125 @@ record_conditions (struct edge_info *edge_info, tree cond, tree inverted)
case GT_EXPR:
if (FLOAT_TYPE_P (TREE_TYPE (op0)))
{
- edge_info->max_cond_equivalences = 12;
- edge_info->cond_equivalences = XNEWVEC (tree, 12);
+ edge_info->max_cond_equivalences = 6;
+ edge_info->cond_equivalences = XNEWVEC (struct cond_equivalence, 6);
build_and_record_new_cond (ORDERED_EXPR, op0, op1,
- &edge_info->cond_equivalences[8]);
+ &edge_info->cond_equivalences[4]);
build_and_record_new_cond (LTGT_EXPR, op0, op1,
- &edge_info->cond_equivalences[10]);
+ &edge_info->cond_equivalences[5]);
}
else
- {
- edge_info->max_cond_equivalences = 8;
- edge_info->cond_equivalences = XNEWVEC (tree, 8);
+ {
+ edge_info->max_cond_equivalences = 4;
+ edge_info->cond_equivalences = XNEWVEC (struct cond_equivalence, 4);
}
build_and_record_new_cond ((TREE_CODE (cond) == LT_EXPR
? LE_EXPR : GE_EXPR),
- op0, op1, &edge_info->cond_equivalences[4]);
+ op0, op1, &edge_info->cond_equivalences[2]);
build_and_record_new_cond (NE_EXPR, op0, op1,
- &edge_info->cond_equivalences[6]);
+ &edge_info->cond_equivalences[3]);
break;
case GE_EXPR:
case LE_EXPR:
if (FLOAT_TYPE_P (TREE_TYPE (op0)))
{
- edge_info->max_cond_equivalences = 6;
- edge_info->cond_equivalences = XNEWVEC (tree, 6);
+ edge_info->max_cond_equivalences = 3;
+ edge_info->cond_equivalences = XNEWVEC (struct cond_equivalence, 3);
build_and_record_new_cond (ORDERED_EXPR, op0, op1,
- &edge_info->cond_equivalences[4]);
+ &edge_info->cond_equivalences[2]);
}
else
{
- edge_info->max_cond_equivalences = 4;
- edge_info->cond_equivalences = XNEWVEC (tree, 4);
+ edge_info->max_cond_equivalences = 2;
+ edge_info->cond_equivalences = XNEWVEC (struct cond_equivalence, 2);
}
break;
case EQ_EXPR:
if (FLOAT_TYPE_P (TREE_TYPE (op0)))
{
- edge_info->max_cond_equivalences = 10;
- edge_info->cond_equivalences = XNEWVEC (tree, 10);
+ edge_info->max_cond_equivalences = 5;
+ edge_info->cond_equivalences = XNEWVEC (struct cond_equivalence, 5);
build_and_record_new_cond (ORDERED_EXPR, op0, op1,
- &edge_info->cond_equivalences[8]);
+ &edge_info->cond_equivalences[4]);
}
else
{
- edge_info->max_cond_equivalences = 8;
- edge_info->cond_equivalences = XNEWVEC (tree, 8);
+ edge_info->max_cond_equivalences = 4;
+ edge_info->cond_equivalences = XNEWVEC (struct cond_equivalence, 4);
}
build_and_record_new_cond (LE_EXPR, op0, op1,
- &edge_info->cond_equivalences[4]);
+ &edge_info->cond_equivalences[2]);
build_and_record_new_cond (GE_EXPR, op0, op1,
- &edge_info->cond_equivalences[6]);
+ &edge_info->cond_equivalences[3]);
break;
case UNORDERED_EXPR:
- edge_info->max_cond_equivalences = 16;
- edge_info->cond_equivalences = XNEWVEC (tree, 16);
+ edge_info->max_cond_equivalences = 8;
+ edge_info->cond_equivalences = XNEWVEC (struct cond_equivalence, 8);
build_and_record_new_cond (NE_EXPR, op0, op1,
- &edge_info->cond_equivalences[4]);
+ &edge_info->cond_equivalences[2]);
build_and_record_new_cond (UNLE_EXPR, op0, op1,
- &edge_info->cond_equivalences[6]);
+ &edge_info->cond_equivalences[3]);
build_and_record_new_cond (UNGE_EXPR, op0, op1,
- &edge_info->cond_equivalences[8]);
+ &edge_info->cond_equivalences[4]);
build_and_record_new_cond (UNEQ_EXPR, op0, op1,
- &edge_info->cond_equivalences[10]);
+ &edge_info->cond_equivalences[5]);
build_and_record_new_cond (UNLT_EXPR, op0, op1,
- &edge_info->cond_equivalences[12]);
+ &edge_info->cond_equivalences[6]);
build_and_record_new_cond (UNGT_EXPR, op0, op1,
- &edge_info->cond_equivalences[14]);
+ &edge_info->cond_equivalences[7]);
break;
case UNLT_EXPR:
case UNGT_EXPR:
- edge_info->max_cond_equivalences = 8;
- edge_info->cond_equivalences = XNEWVEC (tree, 8);
+ edge_info->max_cond_equivalences = 4;
+ edge_info->cond_equivalences = XNEWVEC (struct cond_equivalence, 4);
build_and_record_new_cond ((TREE_CODE (cond) == UNLT_EXPR
? UNLE_EXPR : UNGE_EXPR),
- op0, op1, &edge_info->cond_equivalences[4]);
+ op0, op1, &edge_info->cond_equivalences[2]);
build_and_record_new_cond (NE_EXPR, op0, op1,
- &edge_info->cond_equivalences[6]);
+ &edge_info->cond_equivalences[3]);
break;
case UNEQ_EXPR:
- edge_info->max_cond_equivalences = 8;
- edge_info->cond_equivalences = XNEWVEC (tree, 8);
+ edge_info->max_cond_equivalences = 4;
+ edge_info->cond_equivalences = XNEWVEC (struct cond_equivalence, 4);
build_and_record_new_cond (UNLE_EXPR, op0, op1,
- &edge_info->cond_equivalences[4]);
+ &edge_info->cond_equivalences[2]);
build_and_record_new_cond (UNGE_EXPR, op0, op1,
- &edge_info->cond_equivalences[6]);
+ &edge_info->cond_equivalences[3]);
break;
case LTGT_EXPR:
- edge_info->max_cond_equivalences = 8;
- edge_info->cond_equivalences = XNEWVEC (tree, 8);
+ edge_info->max_cond_equivalences = 4;
+ edge_info->cond_equivalences = XNEWVEC (struct cond_equivalence, 4);
build_and_record_new_cond (NE_EXPR, op0, op1,
- &edge_info->cond_equivalences[4]);
+ &edge_info->cond_equivalences[2]);
build_and_record_new_cond (ORDERED_EXPR, op0, op1,
- &edge_info->cond_equivalences[6]);
+ &edge_info->cond_equivalences[3]);
break;
default:
- edge_info->max_cond_equivalences = 4;
- edge_info->cond_equivalences = XNEWVEC (tree, 4);
+ edge_info->max_cond_equivalences = 2;
+ edge_info->cond_equivalences = XNEWVEC (struct cond_equivalence, 2);
break;
}
/* Now store the original true and false conditions into the first
two slots. */
- edge_info->cond_equivalences[0] = cond;
- edge_info->cond_equivalences[1] = boolean_true_node;
- edge_info->cond_equivalences[2] = inverted;
- edge_info->cond_equivalences[3] = boolean_false_node;
+ initialize_expr_from_cond (cond, &edge_info->cond_equivalences[0].cond);
+ edge_info->cond_equivalences[0].value = boolean_true_node;
+
+ /* It is possible for INVERTED to be the negation of a comparison,
+ and not a valid RHS or GIMPLE_COND condition. This happens because
+ invert_truthvalue may return such an expression when asked to invert
+ a floating-point comparison. These comparisons are not assumed to
+ obey the trichotomy law. */
+ initialize_expr_from_cond (inverted, &edge_info->cond_equivalences[1].cond);
+ edge_info->cond_equivalences[1].value = boolean_false_node;
}
/* A helper function for record_const_or_copy and record_equality.
@@ -1087,12 +1443,20 @@ record_const_or_copy_1 (tree x, tree y, tree prev_x)
{
SSA_NAME_VALUE (x) = y;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "0>>> COPY ");
+ print_generic_expr (dump_file, x, 0);
+ fprintf (dump_file, " = ");
+ print_generic_expr (dump_file, y, 0);
+ fprintf (dump_file, "\n");
+ }
+
VEC_reserve (tree, heap, const_and_copies_stack, 2);
VEC_quick_push (tree, const_and_copies_stack, prev_x);
VEC_quick_push (tree, const_and_copies_stack, x);
}
-
/* Return the loop depth of the basic block of the defining statement of X.
This number should not be treated as absolutely correct because the loop
information may not be completely up-to-date when dom runs. However, it
@@ -1102,7 +1466,7 @@ record_const_or_copy_1 (tree x, tree y, tree prev_x)
int
loop_depth_of_name (tree x)
{
- tree defstmt;
+ gimple defstmt;
basic_block defbb;
/* If it's not an SSA_NAME, we have no clue where the definition is. */
@@ -1113,14 +1477,13 @@ loop_depth_of_name (tree x)
Note that there may not actually be a bb for this statement, if the
ssa_name is live on entry. */
defstmt = SSA_NAME_DEF_STMT (x);
- defbb = bb_for_stmt (defstmt);
+ defbb = gimple_bb (defstmt);
if (!defbb)
return 0;
return defbb->loop_depth;
}
-
/* Record that X is equal to Y in const_and_copies. Record undo
information in the block-local vector. */
@@ -1129,6 +1492,8 @@ record_const_or_copy (tree x, tree y)
{
tree prev_x = SSA_NAME_VALUE (x);
+ gcc_assert (TREE_CODE (x) == SSA_NAME);
+
if (TREE_CODE (y) == SSA_NAME)
{
tree tmp = SSA_NAME_VALUE (y);
@@ -1189,34 +1554,34 @@ record_equality (tree x, tree y)
i_2 = i_1 +/- ... */
static bool
-simple_iv_increment_p (tree stmt)
+simple_iv_increment_p (gimple stmt)
{
- tree lhs, rhs, preinc, phi;
- unsigned i;
+ tree lhs, preinc;
+ gimple phi;
+ size_t i;
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
return false;
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
+ lhs = gimple_assign_lhs (stmt);
if (TREE_CODE (lhs) != SSA_NAME)
return false;
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
-
- if (TREE_CODE (rhs) != PLUS_EXPR
- && TREE_CODE (rhs) != MINUS_EXPR)
+ if (gimple_assign_rhs_code (stmt) != PLUS_EXPR
+ && gimple_assign_rhs_code (stmt) != MINUS_EXPR)
return false;
- preinc = TREE_OPERAND (rhs, 0);
+ preinc = gimple_assign_rhs1 (stmt);
+
if (TREE_CODE (preinc) != SSA_NAME)
return false;
phi = SSA_NAME_DEF_STMT (preinc);
- if (TREE_CODE (phi) != PHI_NODE)
+ if (gimple_code (phi) != GIMPLE_PHI)
return false;
- for (i = 0; i < (unsigned) PHI_NUM_ARGS (phi); i++)
- if (PHI_ARG_DEF (phi, i) == lhs)
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
+ if (gimple_phi_arg_def (phi, i) == lhs)
return true;
return false;
@@ -1236,29 +1601,30 @@ cprop_into_successor_phis (basic_block bb)
FOR_EACH_EDGE (e, ei, bb->succs)
{
- tree phi;
int indx;
+ gimple_stmt_iterator gsi;
/* If this is an abnormal edge, then we do not want to copy propagate
into the PHI alternative associated with this edge. */
if (e->flags & EDGE_ABNORMAL)
continue;
- phi = phi_nodes (e->dest);
- if (! phi)
+ gsi = gsi_start_phis (e->dest);
+ if (gsi_end_p (gsi))
continue;
indx = e->dest_idx;
- for ( ; phi; phi = PHI_CHAIN (phi))
+ for ( ; !gsi_end_p (gsi); gsi_next (&gsi))
{
tree new_val;
use_operand_p orig_p;
tree orig_val;
+ gimple phi = gsi_stmt (gsi);
/* The alternative may be associated with a constant, so verify
it is an SSA_NAME before doing anything with it. */
- orig_p = PHI_ARG_DEF_PTR (phi, indx);
- orig_val = USE_FROM_PTR (orig_p);
+ orig_p = gimple_phi_arg_imm_use_ptr (phi, indx);
+ orig_val = get_use_from_ptr (orig_p);
if (TREE_CODE (orig_val) != SSA_NAME)
continue;
@@ -1281,30 +1647,29 @@ cprop_into_successor_phis (basic_block bb)
static void
record_edge_info (basic_block bb)
{
- block_stmt_iterator bsi = bsi_last (bb);
+ gimple_stmt_iterator gsi = gsi_last_bb (bb);
struct edge_info *edge_info;
- if (! bsi_end_p (bsi))
+ if (! gsi_end_p (gsi))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
- if (stmt && TREE_CODE (stmt) == SWITCH_EXPR)
+ if (gimple_code (stmt) == GIMPLE_SWITCH)
{
- tree cond = SWITCH_COND (stmt);
+ tree index = gimple_switch_index (stmt);
- if (TREE_CODE (cond) == SSA_NAME)
+ if (TREE_CODE (index) == SSA_NAME)
{
- tree labels = SWITCH_LABELS (stmt);
- int i, n_labels = TREE_VEC_LENGTH (labels);
+ int i;
+ int n_labels = gimple_switch_num_labels (stmt);
tree *info = XCNEWVEC (tree, last_basic_block);
edge e;
edge_iterator ei;
for (i = 0; i < n_labels; i++)
{
- tree label = TREE_VEC_ELT (labels, i);
+ tree label = gimple_switch_label (stmt, i);
basic_block target_bb = label_to_block (CASE_LABEL (label));
-
if (CASE_HIGH (label)
|| !CASE_LOW (label)
|| info[target_bb->index])
@@ -1316,13 +1681,13 @@ record_edge_info (basic_block bb)
FOR_EACH_EDGE (e, ei, bb->succs)
{
basic_block target_bb = e->dest;
- tree node = info[target_bb->index];
+ tree label = info[target_bb->index];
- if (node != NULL && node != error_mark_node)
+ if (label != NULL && label != error_mark_node)
{
- tree x = fold_convert (TREE_TYPE (cond), CASE_LOW (node));
+ tree x = fold_convert (TREE_TYPE (index), CASE_LOW (label));
edge_info = allocate_edge_info (e);
- edge_info->lhs = cond;
+ edge_info->lhs = index;
edge_info->rhs = x;
}
}
@@ -1331,133 +1696,116 @@ record_edge_info (basic_block bb)
}
/* A COND_EXPR may create equivalences too. */
- if (stmt && TREE_CODE (stmt) == COND_EXPR)
+ if (gimple_code (stmt) == GIMPLE_COND)
{
- tree cond = COND_EXPR_COND (stmt);
edge true_edge;
edge false_edge;
- extract_true_false_edges_from_block (bb, &true_edge, &false_edge);
-
- /* If the conditional is a single variable 'X', record 'X = 1'
- for the true edge and 'X = 0' on the false edge. */
- if (SSA_VAR_P (cond))
- {
- struct edge_info *edge_info;
-
- edge_info = allocate_edge_info (true_edge);
- edge_info->lhs = cond;
- edge_info->rhs = constant_boolean_node (1, TREE_TYPE (cond));
-
- edge_info = allocate_edge_info (false_edge);
- edge_info->lhs = cond;
- edge_info->rhs = constant_boolean_node (0, TREE_TYPE (cond));
- }
- /* Equality tests may create one or two equivalences. */
- else if (COMPARISON_CLASS_P (cond))
- {
- tree op0 = TREE_OPERAND (cond, 0);
- tree op1 = TREE_OPERAND (cond, 1);
-
- /* Special case comparing booleans against a constant as we
- know the value of OP0 on both arms of the branch, i.e., we
- can record an equivalence for OP0 rather than COND. */
- if ((TREE_CODE (cond) == EQ_EXPR || TREE_CODE (cond) == NE_EXPR)
- && TREE_CODE (op0) == SSA_NAME
- && TREE_CODE (TREE_TYPE (op0)) == BOOLEAN_TYPE
- && is_gimple_min_invariant (op1))
- {
- if (TREE_CODE (cond) == EQ_EXPR)
- {
- edge_info = allocate_edge_info (true_edge);
- edge_info->lhs = op0;
- edge_info->rhs = (integer_zerop (op1)
- ? boolean_false_node
- : boolean_true_node);
-
- edge_info = allocate_edge_info (false_edge);
- edge_info->lhs = op0;
- edge_info->rhs = (integer_zerop (op1)
- ? boolean_true_node
- : boolean_false_node);
- }
- else
- {
- edge_info = allocate_edge_info (true_edge);
- edge_info->lhs = op0;
- edge_info->rhs = (integer_zerop (op1)
- ? boolean_true_node
- : boolean_false_node);
-
- edge_info = allocate_edge_info (false_edge);
- edge_info->lhs = op0;
- edge_info->rhs = (integer_zerop (op1)
- ? boolean_false_node
- : boolean_true_node);
- }
- }
-
- else if (is_gimple_min_invariant (op0)
- && (TREE_CODE (op1) == SSA_NAME
- || is_gimple_min_invariant (op1)))
- {
- tree inverted = invert_truthvalue (cond);
- struct edge_info *edge_info;
-
- edge_info = allocate_edge_info (true_edge);
- record_conditions (edge_info, cond, inverted);
-
- if (TREE_CODE (cond) == EQ_EXPR)
- {
- edge_info->lhs = op1;
- edge_info->rhs = op0;
- }
-
- edge_info = allocate_edge_info (false_edge);
- record_conditions (edge_info, inverted, cond);
-
- if (TREE_CODE (cond) == NE_EXPR)
- {
- edge_info->lhs = op1;
- edge_info->rhs = op0;
- }
- }
-
- else if (TREE_CODE (op0) == SSA_NAME
- && (is_gimple_min_invariant (op1)
- || TREE_CODE (op1) == SSA_NAME))
- {
- tree inverted = invert_truthvalue (cond);
- struct edge_info *edge_info;
-
- edge_info = allocate_edge_info (true_edge);
- record_conditions (edge_info, cond, inverted);
-
- if (TREE_CODE (cond) == EQ_EXPR)
- {
- edge_info->lhs = op0;
- edge_info->rhs = op1;
- }
-
- edge_info = allocate_edge_info (false_edge);
- record_conditions (edge_info, inverted, cond);
+ tree op0 = gimple_cond_lhs (stmt);
+ tree op1 = gimple_cond_rhs (stmt);
+ enum tree_code code = gimple_cond_code (stmt);
- if (TREE_CODE (cond) == NE_EXPR)
- {
- edge_info->lhs = op0;
- edge_info->rhs = op1;
- }
- }
- }
+ extract_true_false_edges_from_block (bb, &true_edge, &false_edge);
- /* ??? TRUTH_NOT_EXPR can create an equivalence too. */
- }
+ /* Special case comparing booleans against a constant as we
+ know the value of OP0 on both arms of the branch. i.e., we
+ can record an equivalence for OP0 rather than COND. */
+ if ((code == EQ_EXPR || code == NE_EXPR)
+ && TREE_CODE (op0) == SSA_NAME
+ && TREE_CODE (TREE_TYPE (op0)) == BOOLEAN_TYPE
+ && is_gimple_min_invariant (op1))
+ {
+ if (code == EQ_EXPR)
+ {
+ edge_info = allocate_edge_info (true_edge);
+ edge_info->lhs = op0;
+ edge_info->rhs = (integer_zerop (op1)
+ ? boolean_false_node
+ : boolean_true_node);
+
+ edge_info = allocate_edge_info (false_edge);
+ edge_info->lhs = op0;
+ edge_info->rhs = (integer_zerop (op1)
+ ? boolean_true_node
+ : boolean_false_node);
+ }
+ else
+ {
+ edge_info = allocate_edge_info (true_edge);
+ edge_info->lhs = op0;
+ edge_info->rhs = (integer_zerop (op1)
+ ? boolean_true_node
+ : boolean_false_node);
+
+ edge_info = allocate_edge_info (false_edge);
+ edge_info->lhs = op0;
+ edge_info->rhs = (integer_zerop (op1)
+ ? boolean_false_node
+ : boolean_true_node);
+ }
+ }
+ else if (is_gimple_min_invariant (op0)
+ && (TREE_CODE (op1) == SSA_NAME
+ || is_gimple_min_invariant (op1)))
+ {
+ tree cond = build2 (code, boolean_type_node, op0, op1);
+ tree inverted = invert_truthvalue (cond);
+ struct edge_info *edge_info;
+
+ edge_info = allocate_edge_info (true_edge);
+ record_conditions (edge_info, cond, inverted);
+
+ if (code == EQ_EXPR)
+ {
+ edge_info->lhs = op1;
+ edge_info->rhs = op0;
+ }
+
+ edge_info = allocate_edge_info (false_edge);
+ record_conditions (edge_info, inverted, cond);
+
+ if (code == NE_EXPR)
+ {
+ edge_info->lhs = op1;
+ edge_info->rhs = op0;
+ }
+ }
+
+ else if (TREE_CODE (op0) == SSA_NAME
+ && (is_gimple_min_invariant (op1)
+ || TREE_CODE (op1) == SSA_NAME))
+ {
+ tree cond = build2 (code, boolean_type_node, op0, op1);
+ tree inverted = invert_truthvalue (cond);
+ struct edge_info *edge_info;
+
+ edge_info = allocate_edge_info (true_edge);
+ record_conditions (edge_info, cond, inverted);
+
+ if (code == EQ_EXPR)
+ {
+ edge_info->lhs = op0;
+ edge_info->rhs = op1;
+ }
+
+ edge_info = allocate_edge_info (false_edge);
+ record_conditions (edge_info, inverted, cond);
+
+ if (TREE_CODE (cond) == NE_EXPR)
+ {
+ edge_info->lhs = op0;
+ edge_info->rhs = op1;
+ }
+ }
+ }
+
+ /* ??? TRUTH_NOT_EXPR can create an equivalence too. */
}
}
/* Propagate information from BB to its outgoing edges.
- This can include equivalency information implied by control statements
+ This can include equivalence information implied by control statements
at the end of BB and const/copy propagation into PHIs in BB's
successor blocks. */
@@ -1476,16 +1824,17 @@ propagate_to_outgoing_edges (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
table. */
static bool
-eliminate_redundant_computations (tree stmt)
+eliminate_redundant_computations (gimple_stmt_iterator* gsi)
{
- tree *expr_p, def = NULL_TREE;
- bool insert = true;
+ tree expr_type;
tree cached_lhs;
+ bool insert = true;
bool retval = false;
- bool modify_expr_p = false;
+ bool assigns_var_p = false;
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
- def = GIMPLE_STMT_OPERAND (stmt, 0);
+ gimple stmt = gsi_stmt (*gsi);
+
+ tree def = gimple_get_lhs (stmt);
/* Certain expressions on the RHS can be optimized away, but can not
themselves be entered into the hash tables. */
@@ -1503,80 +1852,116 @@ eliminate_redundant_computations (tree stmt)
opt_stats.num_exprs_considered++;
- /* Get a pointer to the expression we are trying to optimize. */
- if (TREE_CODE (stmt) == COND_EXPR)
- expr_p = &COND_EXPR_COND (stmt);
- else if (TREE_CODE (stmt) == SWITCH_EXPR)
- expr_p = &SWITCH_COND (stmt);
- else if (TREE_CODE (stmt) == RETURN_EXPR && TREE_OPERAND (stmt, 0))
+ /* Get the type of the expression we are trying to optimize. */
+ if (is_gimple_assign (stmt))
{
- expr_p = &GIMPLE_STMT_OPERAND (TREE_OPERAND (stmt, 0), 1);
- modify_expr_p = true;
+ expr_type = TREE_TYPE (gimple_assign_lhs (stmt));
+ assigns_var_p = true;
}
- else
+ else if (gimple_code (stmt) == GIMPLE_COND)
+ expr_type = boolean_type_node;
+ else if (is_gimple_call (stmt))
{
- expr_p = &GENERIC_TREE_OPERAND (stmt, 1);
- modify_expr_p = true;
+ gcc_assert (gimple_call_lhs (stmt));
+ expr_type = TREE_TYPE (gimple_call_lhs (stmt));
+ assigns_var_p = true;
}
+ else if (gimple_code (stmt) == GIMPLE_SWITCH)
+ expr_type = TREE_TYPE (gimple_switch_index (stmt));
+ else
+ gcc_unreachable ();
+
+ if (!cached_lhs)
+ return false;
/* It is safe to ignore types here since we have already done
type checking in the hashing and equality routines. In fact
type checking here merely gets in the way of constant
propagation. Also, make sure that it is safe to propagate
- CACHED_LHS into *EXPR_P. */
- if (cached_lhs
- && ((TREE_CODE (cached_lhs) != SSA_NAME
- && (modify_expr_p
- || useless_type_conversion_p (TREE_TYPE (*expr_p),
- TREE_TYPE (cached_lhs))))
- || may_propagate_copy (*expr_p, cached_lhs)))
- {
+ CACHED_LHS into the expression in STMT. */
+ if ((TREE_CODE (cached_lhs) != SSA_NAME
+ && (assigns_var_p
+ || useless_type_conversion_p (expr_type, TREE_TYPE (cached_lhs))))
+ || may_propagate_copy_into_stmt (stmt, cached_lhs))
+ {
+#if defined ENABLE_CHECKING
+ gcc_assert (TREE_CODE (cached_lhs) == SSA_NAME
+ || is_gimple_min_invariant (cached_lhs));
+#endif
+
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " Replaced redundant expr '");
- print_generic_expr (dump_file, *expr_p, dump_flags);
+ print_gimple_expr (dump_file, stmt, 0, dump_flags);
fprintf (dump_file, "' with '");
print_generic_expr (dump_file, cached_lhs, dump_flags);
- fprintf (dump_file, "'\n");
+ fprintf (dump_file, "'\n");
}
opt_stats.num_re++;
-#if defined ENABLE_CHECKING
- gcc_assert (TREE_CODE (cached_lhs) == SSA_NAME
- || is_gimple_min_invariant (cached_lhs));
-#endif
-
if (TREE_CODE (cached_lhs) == ADDR_EXPR
- || (POINTER_TYPE_P (TREE_TYPE (*expr_p))
+ || (POINTER_TYPE_P (expr_type)
&& is_gimple_min_invariant (cached_lhs)))
retval = true;
- if (modify_expr_p
- && !useless_type_conversion_p (TREE_TYPE (*expr_p),
- TREE_TYPE (cached_lhs)))
- cached_lhs = fold_convert (TREE_TYPE (*expr_p), cached_lhs);
+ if (assigns_var_p
+ && !useless_type_conversion_p (expr_type, TREE_TYPE (cached_lhs)))
+ cached_lhs = fold_convert (expr_type, cached_lhs);
- propagate_tree_value (expr_p, cached_lhs);
- mark_stmt_modified (stmt);
- }
+ propagate_tree_value_into_stmt (gsi, cached_lhs);
+
+ /* Since it is always necessary to mark the result as modified,
+ perhaps we should move this into propagate_tree_value_into_stmt
+ itself. */
+ gimple_set_modified (gsi_stmt (*gsi), true);
+ }
return retval;
}
-/* STMT, a GIMPLE_MODIFY_STMT, may create certain equivalences, in either
+/* Return true if statement GS is an assignment that peforms a useless
+ type conversion. It is is intended to be a tuples analog of function
+ tree_ssa_useless_type_conversion. */
+
+static bool
+gimple_assign_unary_useless_conversion_p (gimple gs)
+{
+ if (is_gimple_assign (gs)
+ && (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))
+ {
+ tree lhs_type = TREE_TYPE (gimple_assign_lhs (gs));
+ tree rhs_type = TREE_TYPE (gimple_assign_rhs1 (gs));
+ return useless_type_conversion_p (lhs_type, rhs_type);
+ }
+
+ return false;
+}
+
+/* STMT, a GIMPLE_ASSIGN, may create certain equivalences, in either
the available expressions table or the const_and_copies table.
Detect and record those equivalences. */
+/* We handle only very simple copy equivalences here. The heavy
+ lifing is done by eliminate_redundant_computations. */
static void
-record_equivalences_from_stmt (tree stmt, int may_optimize_p, stmt_ann_t ann)
+record_equivalences_from_stmt (gimple stmt, int may_optimize_p)
{
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- enum tree_code lhs_code = TREE_CODE (lhs);
+ tree lhs;
+ enum tree_code lhs_code;
- if (lhs_code == SSA_NAME)
- {
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ gcc_assert (is_gimple_assign (stmt));
+
+ lhs = gimple_assign_lhs (stmt);
+ lhs_code = TREE_CODE (lhs);
+ if (lhs_code == SSA_NAME
+ && (gimple_assign_single_p (stmt)
+ || gimple_assign_unary_useless_conversion_p (stmt)))
+ {
+ tree rhs = gimple_assign_rhs1 (stmt);
+
/* Strip away any useless type conversions. */
STRIP_USELESS_TYPE_CONVERSION (rhs);
@@ -1589,24 +1974,53 @@ record_equivalences_from_stmt (tree stmt, int may_optimize_p, stmt_ann_t ann)
if (may_optimize_p
&& (TREE_CODE (rhs) == SSA_NAME
|| is_gimple_min_invariant (rhs)))
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "==== ASGN ");
+ print_generic_expr (dump_file, lhs, 0);
+ fprintf (dump_file, " = ");
+ print_generic_expr (dump_file, rhs, 0);
+ fprintf (dump_file, "\n");
+ }
+
SSA_NAME_VALUE (lhs) = rhs;
+ }
}
/* A memory store, even an aliased store, creates a useful
equivalence. By exchanging the LHS and RHS, creating suitable
vops and recording the result in the available expression table,
we may be able to expose more redundant loads. */
- if (!ann->has_volatile_ops
- && stmt_references_memory_p (stmt)
- && (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == SSA_NAME
- || is_gimple_min_invariant (GIMPLE_STMT_OPERAND (stmt, 1)))
+ if (!gimple_has_volatile_ops (stmt)
+ && gimple_references_memory_p (stmt)
+ && gimple_assign_single_p (stmt)
+ && (TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME
+ || is_gimple_min_invariant (gimple_assign_rhs1 (stmt)))
&& !is_gimple_reg (lhs))
{
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- tree new_stmt;
+ tree rhs = gimple_assign_rhs1 (stmt);
+ gimple new_stmt;
/* Build a new statement with the RHS and LHS exchanged. */
- new_stmt = build_gimple_modify_stmt (rhs, lhs);
+ if (TREE_CODE (rhs) == SSA_NAME)
+ {
+ /* NOTE tuples. The call to gimple_build_assign below replaced
+ a call to build_gimple_modify_stmt, which did not set the
+ SSA_NAME_DEF_STMT on the LHS of the assignment. Doing so
+ may cause an SSA validation failure, as the LHS may be a
+ default-initialized name and should have no definition. I'm
+ a bit dubious of this, as the artificial statement that we
+ generate here may in fact be ill-formed, but it is simply
+ used as an internal device in this pass, and never becomes
+ part of the CFG. */
+ gimple defstmt = SSA_NAME_DEF_STMT (rhs);
+ new_stmt = gimple_build_assign (rhs, lhs);
+ SSA_NAME_DEF_STMT (rhs) = defstmt;
+ }
+ else
+ new_stmt = gimple_build_assign (rhs, lhs);
+
create_ssa_artificial_load_stmt (new_stmt, stmt, true);
/* Finally enter the statement into the available expression
@@ -1619,7 +2033,7 @@ record_equivalences_from_stmt (tree stmt, int may_optimize_p, stmt_ann_t ann)
CONST_AND_COPIES. */
static bool
-cprop_operand (tree stmt, use_operand_p op_p)
+cprop_operand (gimple stmt, use_operand_p op_p)
{
bool may_have_exposed_new_symbols = false;
tree val;
@@ -1645,7 +2059,7 @@ cprop_operand (tree stmt, use_operand_p op_p)
return false;
/* Do not replace hard register operands in asm statements. */
- if (TREE_CODE (stmt) == ASM_EXPR
+ if (gimple_code (stmt) == GIMPLE_ASM
&& !may_propagate_copy_into_asm (op))
return false;
@@ -1717,7 +2131,7 @@ cprop_operand (tree stmt, use_operand_p op_p)
/* And note that we modified this statement. This is now
safe, even if we changed virtual operands since we will
rescan the statement and rewrite its operands again. */
- mark_stmt_modified (stmt);
+ gimple_set_modified (stmt, true);
}
return may_have_exposed_new_symbols;
}
@@ -1729,7 +2143,7 @@ cprop_operand (tree stmt, use_operand_p op_p)
vdef_ops of STMT. */
static bool
-cprop_into_stmt (tree stmt)
+cprop_into_stmt (gimple stmt)
{
bool may_have_exposed_new_symbols = false;
use_operand_p op_p;
@@ -1744,7 +2158,6 @@ cprop_into_stmt (tree stmt)
return may_have_exposed_new_symbols;
}
-
/* Optimize the statement pointed to by iterator SI.
We try to perform some simplistic global redundancy elimination and
@@ -1762,28 +2175,26 @@ cprop_into_stmt (tree stmt)
static void
optimize_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
- basic_block bb, block_stmt_iterator si)
+ basic_block bb, gimple_stmt_iterator si)
{
- stmt_ann_t ann;
- tree stmt, old_stmt;
+ gimple stmt, old_stmt;
bool may_optimize_p;
bool may_have_exposed_new_symbols = false;
- old_stmt = stmt = bsi_stmt (si);
+ old_stmt = stmt = gsi_stmt (si);
- if (TREE_CODE (stmt) == COND_EXPR)
+ if (gimple_code (stmt) == GIMPLE_COND)
canonicalize_comparison (stmt);
update_stmt_if_modified (stmt);
- ann = stmt_ann (stmt);
opt_stats.num_stmts++;
may_have_exposed_new_symbols = false;
- push_stmt_changes (bsi_stmt_ptr (si));
+ push_stmt_changes (gsi_stmt_ptr (&si));
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Optimizing statement ");
- print_generic_stmt (dump_file, stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
}
/* Const/copy propagate into USES, VUSES and the RHS of VDEFs. */
@@ -1791,27 +2202,34 @@ optimize_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
/* If the statement has been modified with constant replacements,
fold its RHS before checking for redundant computations. */
- if (ann->modified)
+ if (gimple_modified_p (stmt))
{
- tree rhs;
+ tree rhs = NULL;
/* Try to fold the statement making sure that STMT is kept
up to date. */
- if (fold_stmt (bsi_stmt_ptr (si)))
+ if (fold_stmt (&si))
{
- stmt = bsi_stmt (si);
- ann = stmt_ann (stmt);
+ stmt = gsi_stmt (si);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " Folded to: ");
- print_generic_stmt (dump_file, stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
}
}
- rhs = get_rhs (stmt);
+ /* We only need to consider cases that can yield a gimple operand. */
+ if (gimple_assign_single_p (stmt))
+ rhs = gimple_assign_rhs1 (stmt);
+ else if (gimple_code (stmt) == GIMPLE_GOTO)
+ rhs = gimple_goto_dest (stmt);
+ else if (gimple_code (stmt) == GIMPLE_SWITCH)
+ /* This should never be an ADDR_EXPR. */
+ rhs = gimple_switch_index (stmt);
+
if (rhs && TREE_CODE (rhs) == ADDR_EXPR)
- recompute_tree_invariant_for_addr_expr (rhs);
+ recompute_tree_invariant_for_addr_expr (rhs);
/* Constant/copy propagation above may change the set of
virtual operands associated with this statement. Folding
@@ -1823,26 +2241,24 @@ optimize_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
/* Check for redundant computations. Do this optimization only
for assignments that have no volatile ops and conditionals. */
- may_optimize_p = (!ann->has_volatile_ops
- && ((TREE_CODE (stmt) == RETURN_EXPR
- && TREE_OPERAND (stmt, 0)
- && TREE_CODE (TREE_OPERAND (stmt, 0))
- == GIMPLE_MODIFY_STMT
- && ! (TREE_SIDE_EFFECTS
- (GIMPLE_STMT_OPERAND
- (TREE_OPERAND (stmt, 0), 1))))
- || (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && ! TREE_SIDE_EFFECTS (GIMPLE_STMT_OPERAND (stmt,
- 1)))
- || TREE_CODE (stmt) == COND_EXPR
- || TREE_CODE (stmt) == SWITCH_EXPR));
+ may_optimize_p = (!gimple_has_volatile_ops (stmt)
+ && ((is_gimple_assign (stmt)
+ && !gimple_rhs_has_side_effects (stmt))
+ || (is_gimple_call (stmt)
+ && gimple_call_lhs (stmt) != NULL_TREE
+ && !gimple_rhs_has_side_effects (stmt))
+ || gimple_code (stmt) == GIMPLE_COND
+ || gimple_code (stmt) == GIMPLE_SWITCH));
if (may_optimize_p)
- may_have_exposed_new_symbols |= eliminate_redundant_computations (stmt);
+ {
+ may_have_exposed_new_symbols |= eliminate_redundant_computations (&si);
+ stmt = gsi_stmt (si);
+ }
/* Record any additional equivalences created by this statement. */
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
- record_equivalences_from_stmt (stmt, may_optimize_p, ann);
+ if (is_gimple_assign (stmt))
+ record_equivalences_from_stmt (stmt, may_optimize_p);
/* If STMT is a COND_EXPR and it was modified, then we may know
where it goes. If that is the case, then mark the CFG as altered.
@@ -1869,14 +2285,15 @@ optimize_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
Ultimately I suspect we're going to need to change the interface
into the SSA_NAME manager. */
- if (ann->modified)
+ if (gimple_modified_p (stmt))
{
tree val = NULL;
- if (TREE_CODE (stmt) == COND_EXPR)
- val = COND_EXPR_COND (stmt);
- else if (TREE_CODE (stmt) == SWITCH_EXPR)
- val = SWITCH_COND (stmt);
+ if (gimple_code (stmt) == GIMPLE_COND)
+ val = fold_binary (gimple_cond_code (stmt), boolean_type_node,
+ gimple_cond_lhs (stmt), gimple_cond_rhs (stmt));
+ else if (gimple_code (stmt) == GIMPLE_SWITCH)
+ val = gimple_switch_index (stmt);
if (val && TREE_CODE (val) == INTEGER_CST && find_taken_edge (bb, val))
cfg_altered = true;
@@ -1897,47 +2314,50 @@ optimize_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
AVAIL_EXPRS have been processed. The change buffer stack for
all the pushed statements will be processed when this queue
is emptied. */
- VEC_safe_push (tree_p, heap, stmts_to_rescan, bsi_stmt_ptr (si));
+ VEC_safe_push (gimple_p, heap, stmts_to_rescan, gsi_stmt_ptr (&si));
}
else
{
/* Otherwise, just discard the recently pushed change buffer. If
not, the STMTS_TO_RESCAN queue will get out of synch with the
change buffer stack. */
- discard_stmt_changes (bsi_stmt_ptr (si));
+ discard_stmt_changes (gsi_stmt_ptr (&si));
}
}
-/* Search for an existing instance of STMT in the AVAIL_EXPRS table. If
- found, return its LHS. Otherwise insert STMT in the table and return
- NULL_TREE.
+/* Search for an existing instance of STMT in the AVAIL_EXPRS table.
+ If found, return its LHS. Otherwise insert STMT in the table and
+ return NULL_TREE.
- Also, when an expression is first inserted in the AVAIL_EXPRS table, it
- is also added to the stack pointed to by BLOCK_AVAIL_EXPRS_P, so that they
- can be removed when we finish processing this block and its children.
-
- NOTE: This function assumes that STMT is a GIMPLE_MODIFY_STMT node that
- contains no CALL_EXPR on its RHS and makes no volatile nor
- aliased references. */
+ Also, when an expression is first inserted in the table, it is also
+ is also added to AVAIL_EXPRS_STACK, so that it can be removed when
+ we finish processing this block and its children. */
static tree
-lookup_avail_expr (tree stmt, bool insert)
+lookup_avail_expr (gimple stmt, bool insert)
{
void **slot;
tree lhs;
tree temp;
struct expr_hash_elt *element = XNEW (struct expr_hash_elt);
- lhs = TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- ? GIMPLE_STMT_OPERAND (stmt, 0) : NULL;
+ /* Get LHS of assignment or call, else NULL_TREE. */
+ lhs = gimple_get_lhs (stmt);
initialize_hash_element (stmt, lhs, element);
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "LKUP ");
+ print_expr_hash_elt (dump_file, element);
+ }
+
/* Don't bother remembering constant assignments and copy operations.
Constants and copy operations are handled by the constant/copy propagator
in optimize_stmt. */
- if (TREE_CODE (element->rhs) == SSA_NAME
- || is_gimple_min_invariant (element->rhs))
+ if (element->expr.kind == EXPR_SINGLE
+ && (TREE_CODE (element->expr.ops.single.rhs) == SSA_NAME
+ || is_gimple_min_invariant (element->expr.ops.single.rhs)))
{
free (element);
return NULL_TREE;
@@ -1949,14 +2369,20 @@ lookup_avail_expr (tree stmt, bool insert)
if (slot == NULL)
{
free (element);
- return NULL_TREE;
+ return NULL_TREE;
}
if (*slot == NULL)
{
*slot = (void *) element;
- VEC_safe_push (tree, heap, avail_exprs_stack,
- stmt ? stmt : element->rhs);
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "2>>> ");
+ print_expr_hash_elt (dump_file, element);
+ }
+
+ VEC_safe_push (expr_hash_elt_t, heap, avail_exprs_stack, element);
return NULL_TREE;
}
@@ -1974,31 +2400,36 @@ lookup_avail_expr (tree stmt, bool insert)
}
free (element);
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "FIND: ");
+ print_generic_expr (dump_file, lhs, 0);
+ fprintf (dump_file, "\n");
+ }
+
return lhs;
}
-/* Hashing and equality functions for AVAIL_EXPRS. The table stores
- GIMPLE_MODIFY_STMT statements. We compute a value number for expressions
- using the code of the expression and the SSA numbers of its operands. */
+/* Hashing and equality functions for AVAIL_EXPRS. We compute a value number
+ for expressions using the code of the expression and the SSA numbers of
+ its operands. */
static hashval_t
avail_expr_hash (const void *p)
{
- tree stmt = ((const struct expr_hash_elt *)p)->stmt;
- tree rhs = ((const struct expr_hash_elt *)p)->rhs;
+ gimple stmt = ((const struct expr_hash_elt *)p)->stmt;
+ const struct hashable_expr *expr = &((const struct expr_hash_elt *)p)->expr;
tree vuse;
ssa_op_iter iter;
hashval_t val = 0;
- /* iterative_hash_expr knows how to deal with any expression and
- deals with commutative operators as well, so just use it instead
- of duplicating such complexities here. */
- val = iterative_hash_expr (rhs, val);
+ val = iterative_hash_hashable_expr (expr, val);
/* If the hash table entry is not associated with a statement, then we
can just hash the expression and not worry about virtual operands
and such. */
- if (!stmt || !stmt_ann (stmt))
+ if (!stmt)
return val;
/* Add the SSA version numbers of every vuse operand. This is important
@@ -2020,27 +2451,34 @@ real_avail_expr_hash (const void *p)
static int
avail_expr_eq (const void *p1, const void *p2)
{
- tree stmt1 = ((const struct expr_hash_elt *)p1)->stmt;
- tree rhs1 = ((const struct expr_hash_elt *)p1)->rhs;
- tree stmt2 = ((const struct expr_hash_elt *)p2)->stmt;
- tree rhs2 = ((const struct expr_hash_elt *)p2)->rhs;
-
- /* If they are the same physical expression, return true. */
- if (rhs1 == rhs2 && stmt1 == stmt2)
+ gimple stmt1 = ((const struct expr_hash_elt *)p1)->stmt;
+ const struct hashable_expr *expr1 = &((const struct expr_hash_elt *)p1)->expr;
+ const struct expr_hash_elt *stamp1 = ((const struct expr_hash_elt *)p1)->stamp;
+ gimple stmt2 = ((const struct expr_hash_elt *)p2)->stmt;
+ const struct hashable_expr *expr2 = &((const struct expr_hash_elt *)p2)->expr;
+ const struct expr_hash_elt *stamp2 = ((const struct expr_hash_elt *)p2)->stamp;
+
+ /* This case should apply only when removing entries from the table. */
+ if (stamp1 == stamp2)
return true;
- /* If their codes are not equal, then quit now. */
- if (TREE_CODE (rhs1) != TREE_CODE (rhs2))
+ /* FIXME tuples:
+ We add stmts to a hash table and them modify them. To detect the case
+ that we modify a stmt and then search for it, we assume that the hash
+ is always modified by that change.
+ We have to fully check why this doesn't happen on trunk or rewrite
+ this in a more reliable (and easier to understand) way. */
+ if (((const struct expr_hash_elt *)p1)->hash
+ != ((const struct expr_hash_elt *)p2)->hash)
return false;
/* In case of a collision, both RHS have to be identical and have the
same VUSE operands. */
- if (types_compatible_p (TREE_TYPE (rhs1), TREE_TYPE (rhs2))
- && operand_equal_p (rhs1, rhs2, OEP_PURE_SAME))
+ if (hashable_expr_equal_p (expr1, expr2)
+ && types_compatible_p (expr1->type, expr2->type))
{
+ /* Note that STMT1 and/or STMT2 may be NULL. */
bool ret = compare_ssa_operands_equal (stmt1, stmt2, SSA_OP_VUSE);
- gcc_assert (!ret || ((const struct expr_hash_elt *)p1)->hash
- == ((const struct expr_hash_elt *)p2)->hash);
return ret;
}
@@ -2054,18 +2492,18 @@ avail_expr_eq (const void *p1, const void *p2)
NULL. */
static tree
-degenerate_phi_result (tree phi)
+degenerate_phi_result (gimple phi)
{
- tree lhs = PHI_RESULT (phi);
+ tree lhs = gimple_phi_result (phi);
tree val = NULL;
- int i;
+ size_t i;
/* Ignoring arguments which are the same as LHS, if all the remaining
arguments are the same, then the PHI is a degenerate and has the
value of that common argument. */
- for (i = 0; i < PHI_NUM_ARGS (phi); i++)
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
{
- tree arg = PHI_ARG_DEF (phi, i);
+ tree arg = gimple_phi_arg_def (phi, i);
if (arg == lhs)
continue;
@@ -2074,51 +2512,54 @@ degenerate_phi_result (tree phi)
else if (!operand_equal_p (arg, val, 0))
break;
}
- return (i == PHI_NUM_ARGS (phi) ? val : NULL);
+ return (i == gimple_phi_num_args (phi) ? val : NULL);
}
-/* Given a tree node T, which is either a PHI_NODE or GIMPLE_MODIFY_STMT,
+/* Given a statement STMT, which is either a PHI node or an assignment,
remove it from the IL. */
static void
-remove_stmt_or_phi (tree t)
+remove_stmt_or_phi (gimple stmt)
{
- if (TREE_CODE (t) == PHI_NODE)
- remove_phi_node (t, NULL, true);
+ gimple_stmt_iterator gsi = gsi_for_stmt (stmt);
+
+ if (gimple_code (stmt) == GIMPLE_PHI)
+ remove_phi_node (&gsi, true);
else
{
- block_stmt_iterator bsi = bsi_for_stmt (t);
- bsi_remove (&bsi, true);
- release_defs (t);
+ gsi_remove (&gsi, true);
+ release_defs (stmt);
}
}
-/* Given a tree node T, which is either a PHI_NODE or GIMPLE_MODIFY_STMT,
+/* Given a statement STMT, which is either a PHI node or an assignment,
return the "rhs" of the node, in the case of a non-degenerate
- PHI, NULL is returned. */
+ phi, NULL is returned. */
static tree
-get_rhs_or_phi_arg (tree t)
+get_rhs_or_phi_arg (gimple stmt)
{
- if (TREE_CODE (t) == PHI_NODE)
- return degenerate_phi_result (t);
- else if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
- return GIMPLE_STMT_OPERAND (t, 1);
- gcc_unreachable ();
+ if (gimple_code (stmt) == GIMPLE_PHI)
+ return degenerate_phi_result (stmt);
+ else if (gimple_assign_single_p (stmt))
+ return gimple_assign_rhs1 (stmt);
+ else
+ gcc_unreachable ();
}
-/* Given a tree node T, which is either a PHI_NODE or a GIMPLE_MODIFY_STMT,
+/* Given a statement STMT, which is either a PHI node or an assignment,
return the "lhs" of the node. */
static tree
-get_lhs_or_phi_result (tree t)
+get_lhs_or_phi_result (gimple stmt)
{
- if (TREE_CODE (t) == PHI_NODE)
- return PHI_RESULT (t);
- else if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
- return GIMPLE_STMT_OPERAND (t, 0);
- gcc_unreachable ();
+ if (gimple_code (stmt) == GIMPLE_PHI)
+ return gimple_phi_result (stmt);
+ else if (is_gimple_assign (stmt))
+ return gimple_assign_lhs (stmt);
+ else
+ gcc_unreachable ();
}
/* Propagate RHS into all uses of LHS (when possible).
@@ -2133,7 +2574,7 @@ get_lhs_or_phi_result (tree t)
opportunities. */
static void
-propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap interesting_names)
+propagate_rhs_into_lhs (gimple stmt, tree lhs, tree rhs, bitmap interesting_names)
{
/* First verify that propagation is valid and isn't going to move a
loop variant variable outside its loop. */
@@ -2145,7 +2586,7 @@ propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap interesting_names)
{
use_operand_p use_p;
imm_use_iterator iter;
- tree use_stmt;
+ gimple use_stmt;
bool all = true;
/* Dump details. */
@@ -2166,8 +2607,8 @@ propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap interesting_names)
{
/* It's not always safe to propagate into an ASM_EXPR. */
- if (TREE_CODE (use_stmt) == ASM_EXPR
- && ! may_propagate_copy_into_asm (lhs))
+ if (gimple_code (use_stmt) == GIMPLE_ASM
+ && ! may_propagate_copy_into_asm (lhs))
{
all = false;
continue;
@@ -2177,8 +2618,7 @@ propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap interesting_names)
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " Original statement:");
- print_generic_expr (dump_file, use_stmt, dump_flags);
- fprintf (dump_file, "\n");
+ print_gimple_stmt (dump_file, use_stmt, 0, dump_flags);
}
push_stmt_changes (&use_stmt);
@@ -2197,7 +2637,7 @@ propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap interesting_names)
Second, if we're propagating a virtual operand and the
propagation does not change the underlying _DECL node for
the virtual operand, then no further actions are necessary. */
- if (TREE_CODE (use_stmt) == PHI_NODE
+ if (gimple_code (use_stmt) == GIMPLE_PHI
|| (! is_gimple_reg (lhs)
&& TREE_CODE (rhs) == SSA_NAME
&& SSA_NAME_VAR (lhs) == SSA_NAME_VAR (rhs)))
@@ -2206,13 +2646,12 @@ propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap interesting_names)
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " Updated statement:");
- print_generic_expr (dump_file, use_stmt, dump_flags);
- fprintf (dump_file, "\n");
+ print_gimple_stmt (dump_file, use_stmt, 0, dump_flags);
}
/* Propagation into a PHI may expose new degenerate PHIs,
so mark the result of the PHI as interesting. */
- if (TREE_CODE (use_stmt) == PHI_NODE)
+ if (gimple_code (use_stmt) == GIMPLE_PHI)
{
tree result = get_lhs_or_phi_result (use_stmt);
bitmap_set_bit (interesting_names, SSA_NAME_VERSION (result));
@@ -2226,6 +2665,12 @@ propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap interesting_names)
real statement. Folding may (or may not) be possible,
we may expose new operands, expose dead EH edges,
etc. */
+ /* NOTE tuples. In the tuples world, fold_stmt_inplace
+ cannot fold a call that simplifies to a constant,
+ because the GIMPLE_CALL must be replaced by a
+ GIMPLE_ASSIGN, and there is no way to effect such a
+ transformation in-place. We might want to consider
+ using the more general fold_stmt here. */
fold_stmt_inplace (use_stmt);
/* Sometimes propagation can expose new operands to the
@@ -2237,34 +2682,32 @@ propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap interesting_names)
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " Updated statement:");
- print_generic_expr (dump_file, use_stmt, dump_flags);
- fprintf (dump_file, "\n");
+ print_gimple_stmt (dump_file, use_stmt, 0, dump_flags);
}
/* If we replaced a variable index with a constant, then
we would need to update the invariant flag for ADDR_EXPRs. */
- if (TREE_CODE (use_stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 1)) == ADDR_EXPR)
+ if (gimple_assign_single_p (use_stmt)
+ && TREE_CODE (gimple_assign_rhs1 (use_stmt)) == ADDR_EXPR)
recompute_tree_invariant_for_addr_expr
- (GIMPLE_STMT_OPERAND (use_stmt, 1));
+ (gimple_assign_rhs1 (use_stmt));
/* If we cleaned up EH information from the statement,
mark its containing block as needing EH cleanups. */
if (maybe_clean_or_replace_eh_stmt (use_stmt, use_stmt))
{
- bitmap_set_bit (need_eh_cleanup, bb_for_stmt (use_stmt)->index);
+ bitmap_set_bit (need_eh_cleanup, gimple_bb (use_stmt)->index);
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, " Flagged to clear EH edges.\n");
}
/* Propagation may expose new trivial copy/constant propagation
opportunities. */
- if (TREE_CODE (use_stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 0)) == SSA_NAME
- && (TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 1)) == SSA_NAME
- || is_gimple_min_invariant (GIMPLE_STMT_OPERAND (use_stmt,
- 1))))
- {
+ if (gimple_assign_single_p (use_stmt)
+ && TREE_CODE (gimple_assign_lhs (use_stmt)) == SSA_NAME
+ && (TREE_CODE (gimple_assign_rhs1 (use_stmt)) == SSA_NAME
+ || is_gimple_min_invariant (gimple_assign_rhs1 (use_stmt))))
+ {
tree result = get_lhs_or_phi_result (use_stmt);
bitmap_set_bit (interesting_names, SSA_NAME_VERSION (result));
}
@@ -2273,41 +2716,44 @@ propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap interesting_names)
the CFG unexecutable. We want to identify them as PHI nodes
at the destination of those unexecutable edges may become
degenerates. */
- else if (TREE_CODE (use_stmt) == COND_EXPR
- || TREE_CODE (use_stmt) == SWITCH_EXPR
- || TREE_CODE (use_stmt) == GOTO_EXPR)
- {
+ else if (gimple_code (use_stmt) == GIMPLE_COND
+ || gimple_code (use_stmt) == GIMPLE_SWITCH
+ || gimple_code (use_stmt) == GIMPLE_GOTO)
+ {
tree val;
- if (TREE_CODE (use_stmt) == COND_EXPR)
- val = COND_EXPR_COND (use_stmt);
- else if (TREE_CODE (use_stmt) == SWITCH_EXPR)
- val = SWITCH_COND (use_stmt);
+ if (gimple_code (use_stmt) == GIMPLE_COND)
+ val = fold_binary (gimple_cond_code (use_stmt),
+ boolean_type_node,
+ gimple_cond_lhs (use_stmt),
+ gimple_cond_rhs (use_stmt));
+ else if (gimple_code (use_stmt) == GIMPLE_SWITCH)
+ val = gimple_switch_index (use_stmt);
else
- val = GOTO_DESTINATION (use_stmt);
+ val = gimple_goto_dest (use_stmt);
- if (is_gimple_min_invariant (val))
+ if (val && is_gimple_min_invariant (val))
{
- basic_block bb = bb_for_stmt (use_stmt);
+ basic_block bb = gimple_bb (use_stmt);
edge te = find_taken_edge (bb, val);
edge_iterator ei;
edge e;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi, psi;
/* Remove all outgoing edges except TE. */
for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei));)
{
if (e != te)
{
- tree phi;
-
/* Mark all the PHI nodes at the destination of
the unexecutable edge as interesting. */
- for (phi = phi_nodes (e->dest);
- phi;
- phi = PHI_CHAIN (phi))
- {
- tree result = PHI_RESULT (phi);
+ for (psi = gsi_start_phis (e->dest);
+ !gsi_end_p (psi);
+ gsi_next (&psi))
+ {
+ gimple phi = gsi_stmt (psi);
+
+ tree result = gimple_phi_result (phi);
int version = SSA_NAME_VERSION (result);
bitmap_set_bit (interesting_names, version);
@@ -2323,8 +2769,8 @@ propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap interesting_names)
ei_next (&ei);
}
- bsi = bsi_last (bb_for_stmt (use_stmt));
- bsi_remove (&bsi, true);
+ gsi = gsi_last_bb (gimple_bb (use_stmt));
+ gsi_remove (&gsi, true);
/* And fixup the flags on the single remaining edge. */
te->flags &= ~(EDGE_TRUE_VALUE | EDGE_FALSE_VALUE);
@@ -2346,7 +2792,7 @@ propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap interesting_names)
}
}
-/* T is either a PHI node (potentially a degenerate PHI node) or
+/* STMT is either a PHI node (potentially a degenerate PHI node) or
a statement that is a trivial copy or constant initialization.
Attempt to eliminate T by propagating its RHS into all uses of
@@ -2354,12 +2800,12 @@ propagate_rhs_into_lhs (tree stmt, tree lhs, tree rhs, bitmap interesting_names)
for nodes we want to revisit later.
All exit paths should clear INTERESTING_NAMES for the result
- of T. */
+ of STMT. */
static void
-eliminate_const_or_copy (tree t, bitmap interesting_names)
+eliminate_const_or_copy (gimple stmt, bitmap interesting_names)
{
- tree lhs = get_lhs_or_phi_result (t);
+ tree lhs = get_lhs_or_phi_result (stmt);
tree rhs;
int version = SSA_NAME_VERSION (lhs);
@@ -2371,22 +2817,22 @@ eliminate_const_or_copy (tree t, bitmap interesting_names)
if (has_zero_uses (lhs))
{
bitmap_clear_bit (interesting_names, version);
- remove_stmt_or_phi (t);
+ remove_stmt_or_phi (stmt);
return;
}
/* Get the RHS of the assignment or PHI node if the PHI is a
degenerate. */
- rhs = get_rhs_or_phi_arg (t);
+ rhs = get_rhs_or_phi_arg (stmt);
if (!rhs)
{
bitmap_clear_bit (interesting_names, version);
return;
}
- propagate_rhs_into_lhs (t, lhs, rhs, interesting_names);
+ propagate_rhs_into_lhs (stmt, lhs, rhs, interesting_names);
- /* Note that T may well have been deleted by now, so do
+ /* Note that STMT may well have been deleted by now, so do
not access it, instead use the saved version # to clear
T's entry in the worklist. */
bitmap_clear_bit (interesting_names, version);
@@ -2400,12 +2846,13 @@ eliminate_const_or_copy (tree t, bitmap interesting_names)
static void
eliminate_degenerate_phis_1 (basic_block bb, bitmap interesting_names)
{
- tree phi, next;
+ gimple_stmt_iterator gsi;
basic_block son;
- for (phi = phi_nodes (bb); phi; phi = next)
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- next = PHI_CHAIN (phi);
+ gimple phi = gsi_stmt (gsi);
+
eliminate_const_or_copy (phi, interesting_names);
}
@@ -2512,7 +2959,7 @@ eliminate_degenerate_phis (void)
such edges from the CFG as needed. */
if (!bitmap_empty_p (need_eh_cleanup))
{
- tree_purge_all_dead_eh_edges (need_eh_cleanup);
+ gimple_purge_all_dead_eh_edges (need_eh_cleanup);
BITMAP_FREE (need_eh_cleanup);
}
diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c
index 2f7e9238ab1..b4be5142e01 100644
--- a/gcc/tree-ssa-dse.c
+++ b/gcc/tree-ssa-dse.c
@@ -63,7 +63,7 @@ along with GCC; see the file COPYING3. If not see
relationship between dead store and redundant load elimination. In
fact, they are the same transformation applied to different views of
the CFG. */
-
+
struct dse_global_data
{
@@ -97,7 +97,7 @@ static void dse_initialize_block_local_data (struct dom_walk_data *,
bool);
static void dse_optimize_stmt (struct dom_walk_data *,
basic_block,
- block_stmt_iterator);
+ gimple_stmt_iterator);
static void dse_record_phis (struct dom_walk_data *, basic_block);
static void dse_finalize_block (struct dom_walk_data *, basic_block);
static void record_voperand_set (bitmap, bitmap *, unsigned int);
@@ -105,12 +105,13 @@ static void record_voperand_set (bitmap, bitmap *, unsigned int);
/* Returns uid of statement STMT. */
static unsigned
-get_stmt_uid (tree stmt)
+get_stmt_uid (gimple stmt)
{
- if (TREE_CODE (stmt) == PHI_NODE)
- return SSA_NAME_VERSION (PHI_RESULT (stmt)) + gimple_stmt_max_uid (cfun);
+ if (gimple_code (stmt) == GIMPLE_PHI)
+ return SSA_NAME_VERSION (gimple_phi_result (stmt))
+ + gimple_stmt_max_uid (cfun);
- return gimple_stmt_uid (stmt);
+ return gimple_uid (stmt);
}
/* Set bit UID in bitmaps GLOBAL and *LOCAL, creating *LOCAL as needed. */
@@ -162,7 +163,7 @@ memory_ssa_name_same (tree *expr_p, int *walk_subtrees ATTRIBUTE_UNUSED,
{
struct address_walk_data *walk_data = (struct address_walk_data *) data;
tree expr = *expr_p;
- tree def_stmt;
+ gimple def_stmt;
basic_block def_bb;
if (TREE_CODE (expr) != SSA_NAME)
@@ -174,7 +175,7 @@ memory_ssa_name_same (tree *expr_p, int *walk_subtrees ATTRIBUTE_UNUSED,
return NULL_TREE;
def_stmt = SSA_NAME_DEF_STMT (expr);
- def_bb = bb_for_stmt (def_stmt);
+ def_bb = gimple_bb (def_stmt);
/* DEF_STMT must dominate both stores. So if it is in the same
basic block as one, it does not post-dominate that store. */
@@ -185,7 +186,7 @@ memory_ssa_name_same (tree *expr_p, int *walk_subtrees ATTRIBUTE_UNUSED,
|| !dominated_by_p (CDI_POST_DOMINATORS, walk_data->store2_bb,
def_bb))
/* Return non-NULL to stop the walk. */
- return def_stmt;
+ return *expr_p;
}
return NULL_TREE;
@@ -195,14 +196,14 @@ memory_ssa_name_same (tree *expr_p, int *walk_subtrees ATTRIBUTE_UNUSED,
might be modified after STORE1, before control reaches STORE2. */
static bool
-memory_address_same (tree store1, tree store2)
+memory_address_same (gimple store1, gimple store2)
{
struct address_walk_data walk_data;
- walk_data.store1_bb = bb_for_stmt (store1);
- walk_data.store2_bb = bb_for_stmt (store2);
+ walk_data.store1_bb = gimple_bb (store1);
+ walk_data.store2_bb = gimple_bb (store2);
- return (walk_tree (&GIMPLE_STMT_OPERAND (store1, 0), memory_ssa_name_same,
+ return (walk_tree (gimple_assign_lhs_ptr (store1), memory_ssa_name_same,
&walk_data, NULL)
== NULL);
}
@@ -214,15 +215,15 @@ memory_address_same (tree store1, tree store2)
STMT. *USE_P is set to the vop killed by *USE_STMT. */
static bool
-get_kill_of_stmt_lhs (tree stmt,
+get_kill_of_stmt_lhs (gimple stmt,
use_operand_p * first_use_p,
- use_operand_p * use_p, tree * use_stmt)
+ use_operand_p * use_p, gimple * use_stmt)
{
tree lhs;
- gcc_assert (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT);
+ gcc_assert (is_gimple_assign (stmt));
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
+ lhs = gimple_assign_lhs (stmt);
/* We now walk the chain of single uses of the single VDEFs.
We succeeded finding a kill if the lhs of the use stmt is
@@ -231,7 +232,7 @@ get_kill_of_stmt_lhs (tree stmt,
the stmt. */
do
{
- tree use_lhs, use_rhs;
+ tree use_lhs;
def_operand_p def_p;
/* The stmt must have a single VDEF. */
@@ -245,17 +246,14 @@ get_kill_of_stmt_lhs (tree stmt,
first_use_p = use_p;
/* If there are possible hidden uses, give up. */
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
- return false;
- use_rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- if (TREE_CODE (use_rhs) == CALL_EXPR
- || (!is_gimple_min_invariant (use_rhs)
- && TREE_CODE (use_rhs) != SSA_NAME))
+ if (!gimple_assign_single_p (stmt)
+ || (TREE_CODE (gimple_assign_rhs1 (stmt)) != SSA_NAME
+ && !is_gimple_min_invariant (gimple_assign_rhs1 (stmt))))
return false;
/* If the use stmts lhs matches the original lhs we have
found the kill, otherwise continue walking. */
- use_lhs = GIMPLE_STMT_OPERAND (stmt, 0);
+ use_lhs = gimple_assign_lhs (stmt);
if (operand_equal_p (use_lhs, lhs, 0))
{
*use_stmt = stmt;
@@ -266,16 +264,16 @@ get_kill_of_stmt_lhs (tree stmt,
}
/* A helper of dse_optimize_stmt.
- Given a GIMPLE_MODIFY_STMT in STMT, check that each VDEF has one
+ Given a GIMPLE_ASSIGN in STMT, check that each VDEF has one
use, and that one use is another VDEF clobbering the first one.
Return TRUE if the above conditions are met, otherwise FALSE. */
static bool
-dse_possible_dead_store_p (tree stmt,
+dse_possible_dead_store_p (gimple stmt,
use_operand_p *first_use_p,
use_operand_p *use_p,
- tree *use_stmt,
+ gimple *use_stmt,
struct dse_global_data *dse_gd,
struct dse_block_local_data *bd)
{
@@ -283,8 +281,9 @@ dse_possible_dead_store_p (tree stmt,
bool fail = false;
def_operand_p var1;
vuse_vec_p vv;
- tree defvar = NULL_TREE, temp;
+ tree defvar = NULL_TREE;
tree prev_defvar = NULL_TREE;
+ gimple temp;
/* We want to verify that each virtual definition in STMT has
precisely one use and that all the virtual definitions are
@@ -309,9 +308,9 @@ dse_possible_dead_store_p (tree stmt,
gcc_assert (*use_p != NULL_USE_OPERAND_P);
*first_use_p = *use_p;
- /* ??? If we hit a PHI_NODE we could skip to the PHI_RESULT uses.
+ /* ??? If we hit a GIMPLE_PHI we could skip to the PHI_RESULT uses.
Don't bother to do that for now. */
- if (TREE_CODE (temp) == PHI_NODE)
+ if (gimple_code (temp) == GIMPLE_PHI)
{
fail = true;
break;
@@ -326,10 +325,10 @@ dse_possible_dead_store_p (tree stmt,
So we must make sure we're talking about the same LHS.
*/
- if (TREE_CODE (temp) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_assign (temp))
{
- tree base1 = get_base_address (GIMPLE_STMT_OPERAND (stmt, 0));
- tree base2 = get_base_address (GIMPLE_STMT_OPERAND (temp, 0));
+ tree base1 = get_base_address (gimple_assign_lhs (stmt));
+ tree base2 = get_base_address (gimple_assign_lhs (temp));
while (base1 && INDIRECT_REF_P (base1))
base1 = TREE_OPERAND (base1, 0);
@@ -360,7 +359,7 @@ dse_possible_dead_store_p (tree stmt,
if (fail)
{
- record_voperand_set (dse_gd->stores, &bd->stores, gimple_stmt_uid (stmt));
+ record_voperand_set (dse_gd->stores, &bd->stores, gimple_uid (stmt));
return false;
}
@@ -382,36 +381,35 @@ dse_possible_dead_store_p (tree stmt,
static void
dse_optimize_stmt (struct dom_walk_data *walk_data,
basic_block bb ATTRIBUTE_UNUSED,
- block_stmt_iterator bsi)
+ gimple_stmt_iterator gsi)
{
struct dse_block_local_data *bd
= (struct dse_block_local_data *)
VEC_last (void_p, walk_data->block_data_stack);
struct dse_global_data *dse_gd
= (struct dse_global_data *) walk_data->global_data;
- tree stmt = bsi_stmt (bsi);
- stmt_ann_t ann = stmt_ann (stmt);
+ gimple stmt = gsi_stmt (gsi);
/* If this statement has no virtual defs, then there is nothing
to do. */
if (ZERO_SSA_OPERANDS (stmt, SSA_OP_VDEF))
return;
- /* We know we have virtual definitions. If this is a GIMPLE_MODIFY_STMT
+ /* We know we have virtual definitions. If this is a GIMPLE_ASSIGN
that's not also a function call, then record it into our table. */
- if (get_call_expr_in (stmt))
+ if (is_gimple_call (stmt) && gimple_call_fndecl (stmt))
return;
- if (ann->has_volatile_ops)
+ if (gimple_has_volatile_ops (stmt))
return;
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_assign (stmt))
{
use_operand_p first_use_p = NULL_USE_OPERAND_P;
use_operand_p use_p = NULL;
- tree use_stmt;
+ gimple use_stmt;
- if (!dse_possible_dead_store_p (stmt, &first_use_p, &use_p, &use_stmt,
+ if (!dse_possible_dead_store_p (stmt, &first_use_p, &use_p, &use_stmt,
dse_gd, bd))
return;
@@ -421,8 +419,8 @@ dse_optimize_stmt (struct dom_walk_data *walk_data,
SSA-form variables in the address will have the same values. */
if (use_p != NULL_USE_OPERAND_P
&& bitmap_bit_p (dse_gd->stores, get_stmt_uid (use_stmt))
- && !operand_equal_p (GIMPLE_STMT_OPERAND (stmt, 0),
- GIMPLE_STMT_OPERAND (use_stmt, 0), 0)
+ && !operand_equal_p (gimple_assign_lhs (stmt),
+ gimple_assign_lhs (use_stmt), 0)
&& memory_address_same (stmt, use_stmt))
{
/* If we have precisely one immediate use at this point, but
@@ -431,7 +429,8 @@ dse_optimize_stmt (struct dom_walk_data *walk_data,
memory location. */
if (!get_kill_of_stmt_lhs (stmt, &first_use_p, &use_p, &use_stmt))
{
- record_voperand_set (dse_gd->stores, &bd->stores, gimple_stmt_uid (stmt));
+ record_voperand_set (dse_gd->stores, &bd->stores,
+ gimple_uid (stmt));
return;
}
}
@@ -442,8 +441,8 @@ dse_optimize_stmt (struct dom_walk_data *walk_data,
memory location, then we may have found redundant store. */
if (use_p != NULL_USE_OPERAND_P
&& bitmap_bit_p (dse_gd->stores, get_stmt_uid (use_stmt))
- && operand_equal_p (GIMPLE_STMT_OPERAND (stmt, 0),
- GIMPLE_STMT_OPERAND (use_stmt, 0), 0)
+ && operand_equal_p (gimple_assign_lhs (stmt),
+ gimple_assign_lhs (use_stmt), 0)
&& memory_address_same (stmt, use_stmt))
{
ssa_op_iter op_iter;
@@ -462,18 +461,19 @@ dse_optimize_stmt (struct dom_walk_data *walk_data,
*p = *u; *p = *v; where p might be v, then USE_STMT
acts as a use as well as definition, so store in STMT
is not dead. */
- if (LOADED_SYMS (use_stmt)
- && bitmap_intersect_p (LOADED_SYMS (use_stmt),
- STORED_SYMS (use_stmt)))
+ if (gimple_loaded_syms (use_stmt)
+ && bitmap_intersect_p (gimple_loaded_syms (use_stmt),
+ gimple_stored_syms (use_stmt)))
{
- record_voperand_set (dse_gd->stores, &bd->stores, ann->uid);
+ record_voperand_set (dse_gd->stores, &bd->stores,
+ gimple_uid (stmt));
return;
}
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " Deleted dead store '");
- print_generic_expr (dump_file, bsi_stmt (bsi), dump_flags);
+ print_gimple_stmt (dump_file, gsi_stmt (gsi), dump_flags, 0);
fprintf (dump_file, "'\n");
}
@@ -481,7 +481,8 @@ dse_optimize_stmt (struct dom_walk_data *walk_data,
stmt_lhs = USE_FROM_PTR (first_use_p);
FOR_EACH_SSA_VDEF_OPERAND (var1, vv, stmt, op_iter)
{
- tree usevar, temp;
+ tree usevar;
+ gimple temp;
single_imm_use (DEF_FROM_PTR (var1), &use_p, &temp);
gcc_assert (VUSE_VECT_NUM_ELEM (*vv) == 1);
@@ -494,14 +495,14 @@ dse_optimize_stmt (struct dom_walk_data *walk_data,
}
/* Remove the dead store. */
- bsi_remove (&bsi, true);
+ gsi_remove (&gsi, true);
/* And release any SSA_NAMEs set in this statement back to the
SSA_NAME manager. */
release_defs (stmt);
}
- record_voperand_set (dse_gd->stores, &bd->stores, gimple_stmt_uid (stmt));
+ record_voperand_set (dse_gd->stores, &bd->stores, gimple_uid (stmt));
}
}
@@ -515,13 +516,15 @@ dse_record_phis (struct dom_walk_data *walk_data, basic_block bb)
VEC_last (void_p, walk_data->block_data_stack);
struct dse_global_data *dse_gd
= (struct dse_global_data *) walk_data->global_data;
- tree phi;
+ gimple phi;
+ gimple_stmt_iterator gsi;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- if (!is_gimple_reg (PHI_RESULT (phi)))
- record_voperand_set (dse_gd->stores,
- &bd->stores,
- get_stmt_uid (phi));
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ phi = gsi_stmt (gsi);
+ if (!is_gimple_reg (gimple_phi_result (phi)))
+ record_voperand_set (dse_gd->stores, &bd->stores, get_stmt_uid (phi));
+ }
}
static void
@@ -633,7 +636,7 @@ struct gimple_opt_pass pass_dse =
static unsigned int
execute_simple_dse (void)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
basic_block bb;
bitmap variables_loaded = BITMAP_ALLOC (NULL);
unsigned int todo = 0;
@@ -641,24 +644,29 @@ execute_simple_dse (void)
/* Collect into VARIABLES LOADED all variables that are read in function
body. */
FOR_EACH_BB (bb)
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- if (LOADED_SYMS (bsi_stmt (bsi)))
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+
+ if (gimple_loaded_syms (gsi_stmt (gsi)))
bitmap_ior_into (variables_loaded,
- LOADED_SYMS (bsi_stmt (bsi)));
+ gimple_loaded_syms (gsi_stmt (gsi)));
/* Look for statements writing into the write only variables.
And try to remove them. */
FOR_EACH_BB (bb)
- for (bsi = bsi_start (bb); !bsi_end_p (bsi);)
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi);)
{
- tree stmt = bsi_stmt (bsi), op;
+ gimple stmt = gsi_stmt (gsi);
+ tree op;
bool removed = false;
ssa_op_iter iter;
- if (STORED_SYMS (stmt) && TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (stmt) != RETURN_EXPR
- && !bitmap_intersect_p (STORED_SYMS (stmt), variables_loaded))
+ if (gimple_stored_syms (stmt)
+ && !bitmap_empty_p (gimple_stored_syms (stmt))
+ && (is_gimple_assign (stmt)
+ || (is_gimple_call (stmt)
+ && gimple_call_lhs (stmt)))
+ && !bitmap_intersect_p (gimple_stored_syms (stmt), variables_loaded))
{
unsigned int i;
bitmap_iterator bi;
@@ -673,7 +681,7 @@ execute_simple_dse (void)
from removing them as dead. The flag thus has no use for us
and we need to look into all operands. */
- EXECUTE_IF_SET_IN_BITMAP (STORED_SYMS (stmt), 0, i, bi)
+ EXECUTE_IF_SET_IN_BITMAP (gimple_stored_syms (stmt), 0, i, bi)
{
tree var = referenced_var_lookup (i);
if (TREE_ADDRESSABLE (var)
@@ -682,8 +690,8 @@ execute_simple_dse (void)
dead = false;
}
- if (dead && LOADED_SYMS (stmt))
- EXECUTE_IF_SET_IN_BITMAP (LOADED_SYMS (stmt), 0, i, bi)
+ if (dead && gimple_loaded_syms (stmt))
+ EXECUTE_IF_SET_IN_BITMAP (gimple_loaded_syms (stmt), 0, i, bi)
if (TREE_THIS_VOLATILE (referenced_var_lookup (i)))
dead = false;
@@ -695,49 +703,44 @@ execute_simple_dse (void)
/* Look for possible occurrence var = indirect_ref (...) where
indirect_ref itself is volatile. */
- if (dead && TREE_THIS_VOLATILE (GIMPLE_STMT_OPERAND (stmt, 1)))
+ if (dead && is_gimple_assign (stmt)
+ && TREE_THIS_VOLATILE (gimple_assign_rhs1 (stmt)))
dead = false;
if (dead)
{
- tree call = get_call_expr_in (stmt);
-
/* When LHS of var = call (); is dead, simplify it into
call (); saving one operand. */
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && call
- && TREE_SIDE_EFFECTS (call))
+ if (is_gimple_call (stmt)
+ && gimple_has_side_effects (stmt))
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Deleted LHS of call: ");
- print_generic_stmt (dump_file, stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
fprintf (dump_file, "\n");
}
- push_stmt_changes (bsi_stmt_ptr (bsi));
- TREE_BLOCK (call) = TREE_BLOCK (stmt);
- bsi_replace (&bsi, call, false);
- maybe_clean_or_replace_eh_stmt (stmt, call);
- mark_symbols_for_renaming (call);
- pop_stmt_changes (bsi_stmt_ptr (bsi));
+ push_stmt_changes (gsi_stmt_ptr (&gsi));
+ gimple_call_set_lhs (stmt, NULL);
+ pop_stmt_changes (gsi_stmt_ptr (&gsi));
}
else
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " Deleted dead store '");
- print_generic_expr (dump_file, stmt, dump_flags);
+ print_gimple_stmt (dump_file, stmt, 0, dump_flags);
fprintf (dump_file, "'\n");
}
removed = true;
- bsi_remove (&bsi, true);
+ gsi_remove (&gsi, true);
todo |= TODO_cleanup_cfg;
}
todo |= TODO_remove_unused_locals | TODO_ggc_collect;
}
}
if (!removed)
- bsi_next (&bsi);
+ gsi_next (&gsi);
}
BITMAP_FREE (variables_loaded);
return todo;
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index c49f0a48909..bf860d90758 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -33,17 +33,13 @@ along with GCC; see the file COPYING3. If not see
#include "tree-dump.h"
#include "langhooks.h"
#include "flags.h"
+#include "gimple.h"
/* This pass propagates the RHS of assignment statements into use
sites of the LHS of the assignment. It's basically a specialized
form of tree combination. It is hoped all of this can disappear
when we have a generalized tree combiner.
- Note carefully that after propagation the resulting statement
- must still be a proper gimple statement. Right now we simply
- only perform propagations we know will result in valid gimple
- code. One day we'll want to generalize this code.
-
One class of common cases we handle is forward propagating a single use
variable into a COND_EXPR.
@@ -162,6 +158,7 @@ static bool forward_propagate_addr_expr (tree name, tree rhs);
/* Set to true if we delete EH edges during the optimization. */
static bool cfg_changed;
+static tree rhs_to_tree (tree type, gimple stmt);
/* Get the next statement we can propagate NAME's value into skipping
trivial copies. Returns the statement that is suitable as a
@@ -169,25 +166,25 @@ static bool cfg_changed;
This only returns destinations in a single-use chain. FINAL_NAME_P
if non-NULL is written to the ssa name that represents the use. */
-static tree
+static gimple
get_prop_dest_stmt (tree name, tree *final_name_p)
{
use_operand_p use;
- tree use_stmt;
+ gimple use_stmt;
do {
/* If name has multiple uses, bail out. */
if (!single_imm_use (name, &use, &use_stmt))
- return NULL_TREE;
+ return NULL;
/* If this is not a trivial copy, we found it. */
- if (TREE_CODE (use_stmt) != GIMPLE_MODIFY_STMT
- || TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 0)) != SSA_NAME
- || GIMPLE_STMT_OPERAND (use_stmt, 1) != name)
+ if (!gimple_assign_copy_p (use_stmt)
+ || TREE_CODE (gimple_assign_lhs (use_stmt)) != SSA_NAME
+ || gimple_assign_rhs1 (use_stmt) != name)
break;
/* Continue searching uses of the copy destination. */
- name = GIMPLE_STMT_OPERAND (use_stmt, 0);
+ name = gimple_assign_lhs (use_stmt);
} while (1);
if (final_name_p)
@@ -204,27 +201,28 @@ get_prop_dest_stmt (tree name, tree *final_name_p)
it is set to whether the chain to NAME is a single use chain
or not. SINGLE_USE_P is not written to if SINGLE_USE_ONLY is set. */
-static tree
+static gimple
get_prop_source_stmt (tree name, bool single_use_only, bool *single_use_p)
{
bool single_use = true;
do {
- tree def_stmt = SSA_NAME_DEF_STMT (name);
+ gimple def_stmt = SSA_NAME_DEF_STMT (name);
if (!has_single_use (name))
{
single_use = false;
if (single_use_only)
- return NULL_TREE;
+ return NULL;
}
/* If name is defined by a PHI node or is the default def, bail out. */
- if (TREE_CODE (def_stmt) != GIMPLE_MODIFY_STMT)
- return NULL_TREE;
+ if (gimple_code (def_stmt) != GIMPLE_ASSIGN)
+ return NULL;
/* If name is not a simple copy destination, we found it. */
- if (TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1)) != SSA_NAME)
+ if (!gimple_assign_copy_p (def_stmt)
+ || TREE_CODE (gimple_assign_rhs1 (def_stmt)) != SSA_NAME)
{
tree rhs;
@@ -233,19 +231,19 @@ 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_STMT_OPERAND (def_stmt, 1);
- if (CONVERT_EXPR_P (rhs)
- && TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME
- && POINTER_TYPE_P (TREE_TYPE (rhs))
- && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (rhs, 0))))
- name = TREE_OPERAND (rhs, 0);
+ rhs = gimple_assign_rhs1 (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)))
+ name = rhs;
else
return def_stmt;
}
else
{
/* Continue searching the def of the copy source name. */
- name = GIMPLE_STMT_OPERAND (def_stmt, 1);
+ name = gimple_assign_rhs1 (def_stmt);
}
} while (1);
}
@@ -254,41 +252,43 @@ get_prop_source_stmt (tree name, bool single_use_only, bool *single_use_p)
propagation source. Returns true if so, otherwise false. */
static bool
-can_propagate_from (tree def_stmt)
+can_propagate_from (gimple def_stmt)
{
- tree rhs = GIMPLE_STMT_OPERAND (def_stmt, 1);
use_operand_p use_p;
ssa_op_iter iter;
+ gcc_assert (is_gimple_assign (def_stmt));
/* If the rhs has side-effects we cannot propagate from it. */
- if (TREE_SIDE_EFFECTS (rhs))
+ if (gimple_has_volatile_ops (def_stmt))
return false;
/* If the rhs is a load we cannot propagate from it. */
- if (REFERENCE_CLASS_P (rhs)
- || DECL_P (rhs))
+ if (TREE_CODE_CLASS (gimple_assign_rhs_code (def_stmt)) == tcc_reference
+ || TREE_CODE_CLASS (gimple_assign_rhs_code (def_stmt)) == tcc_declaration)
return false;
/* Constants can be always propagated. */
- if (is_gimple_min_invariant (rhs))
+ if (is_gimple_min_invariant
+ (rhs_to_tree (TREE_TYPE (gimple_assign_lhs (def_stmt)), def_stmt)))
return true;
- /* If any of the SSA operands occurs in abnormal PHIs we cannot
- propagate from this stmt. */
+ /* We cannot propagate ssa names that occur in abnormal phi nodes. */
FOR_EACH_SSA_USE_OPERAND (use_p, def_stmt, iter, SSA_OP_USE)
if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (USE_FROM_PTR (use_p)))
return false;
/* If the definition is a conversion of a pointer to a function type,
- then we can not apply optimizations as some targets require function
- pointers to be canonicalized and in this case this optimization could
- eliminate a necessary canonicalization. */
- if (CONVERT_EXPR_P (rhs)
- && POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (rhs, 0)))
- && TREE_CODE (TREE_TYPE (TREE_TYPE
- (TREE_OPERAND (rhs, 0)))) == FUNCTION_TYPE)
- return false;
-
+ then we can not apply optimizations as some targets require
+ function pointers to be canonicalized and in this case this
+ optimization could eliminate a necessary canonicalization. */
+ if (is_gimple_assign (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))
+ && TREE_CODE (TREE_TYPE (TREE_TYPE (rhs))) == FUNCTION_TYPE)
+ return false;
+ }
return true;
}
@@ -299,10 +299,10 @@ can_propagate_from (tree def_stmt)
as well, otherwise false. */
static bool
-remove_prop_source_from_use (tree name, tree up_to_stmt)
+remove_prop_source_from_use (tree name, gimple up_to_stmt)
{
- block_stmt_iterator bsi;
- tree stmt;
+ gimple_stmt_iterator gsi;
+ gimple stmt;
do {
if (!has_zero_uses (name))
@@ -312,16 +312,38 @@ remove_prop_source_from_use (tree name, tree up_to_stmt)
if (stmt == up_to_stmt)
return true;
- bsi = bsi_for_stmt (stmt);
+ gsi = gsi_for_stmt (stmt);
release_defs (stmt);
- bsi_remove (&bsi, true);
+ gsi_remove (&gsi, true);
- name = GIMPLE_STMT_OPERAND (stmt, 1);
- } while (TREE_CODE (name) == SSA_NAME);
+ name = (gimple_assign_copy_p (stmt)) ? gimple_assign_rhs1 (stmt) : NULL;
+ } while (name && TREE_CODE (name) == SSA_NAME);
return false;
}
+/* Return the rhs of a gimple_assign STMT in a form of a single tree,
+ converted to type TYPE.
+
+ This should disappear, but is needed so we can combine expressions and use
+ the fold() interfaces. Long term, we need to develop folding and combine
+ routines that deal with gimple exclusively . */
+
+static tree
+rhs_to_tree (tree type, gimple stmt)
+{
+ enum tree_code code = gimple_assign_rhs_code (stmt);
+ if (get_gimple_rhs_class (code) == GIMPLE_BINARY_RHS)
+ return fold_convert (type, build2 (code, type, gimple_assign_rhs1 (stmt),
+ gimple_assign_rhs2 (stmt)));
+ else if (get_gimple_rhs_class (code) == GIMPLE_UNARY_RHS)
+ return fold_convert (type, build1 (code, type, gimple_assign_rhs1 (stmt)));
+ else if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS)
+ return gimple_assign_rhs1 (stmt);
+ else
+ gcc_unreachable ();
+}
+
/* Combine OP0 CODE OP1 in the context of a COND_EXPR. Returns
the folded result in a form suitable for COND_EXPR_COND or
NULL_TREE, if there is no suitable simplified form. If
@@ -347,28 +369,124 @@ combine_cond_expr_cond (enum tree_code code, tree type,
t = canonicalize_cond_expr_cond (t);
/* Bail out if we required an invariant but didn't get one. */
- if (!t
- || (invariant_only
- && !is_gimple_min_invariant (t)))
+ if (!t || (invariant_only && !is_gimple_min_invariant (t)))
return NULL_TREE;
return t;
}
/* Propagate from the ssa name definition statements of COND_EXPR
- in statement STMT into the conditional if that simplifies it.
+ in GIMPLE_COND statement STMT into the conditional if that simplifies it.
Returns zero if no statement was changed, one if there were
- changes and two if cfg_cleanup needs to run. */
+ changes and two if cfg_cleanup needs to run.
+
+ This must be kept in sync with forward_propagate_into_cond. */
static int
-forward_propagate_into_cond (tree cond_expr, tree stmt)
+forward_propagate_into_gimple_cond (gimple stmt)
{
+ int did_something = 0;
+
+ do {
+ tree tmp = NULL_TREE;
+ tree name, rhs0 = NULL_TREE, rhs1 = NULL_TREE;
+ gimple def_stmt;
+ bool single_use0_p = false, single_use1_p = false;
+ enum tree_code code = gimple_cond_code (stmt);
+
+ /* We can do tree combining on SSA_NAME and comparison expressions. */
+ if (TREE_CODE_CLASS (gimple_cond_code (stmt)) == tcc_comparison
+ && TREE_CODE (gimple_cond_lhs (stmt)) == SSA_NAME)
+ {
+ /* For comparisons use the first operand, that is likely to
+ simplify comparisons against constants. */
+ name = gimple_cond_lhs (stmt);
+ def_stmt = get_prop_source_stmt (name, false, &single_use0_p);
+ if (def_stmt && can_propagate_from (def_stmt))
+ {
+ tree op1 = gimple_cond_rhs (stmt);
+ rhs0 = rhs_to_tree (TREE_TYPE (op1), def_stmt);
+ tmp = combine_cond_expr_cond (code, boolean_type_node, rhs0,
+ op1, !single_use0_p);
+ }
+ /* If that wasn't successful, try the second operand. */
+ if (tmp == NULL_TREE
+ && TREE_CODE (gimple_cond_rhs (stmt)) == SSA_NAME)
+ {
+ tree op0 = gimple_cond_lhs (stmt);
+ name = gimple_cond_rhs (stmt);
+ def_stmt = get_prop_source_stmt (name, false, &single_use1_p);
+ if (!def_stmt || !can_propagate_from (def_stmt))
+ return did_something;
+
+ rhs1 = rhs_to_tree (TREE_TYPE (op0), def_stmt);
+ tmp = combine_cond_expr_cond (code, boolean_type_node, op0, rhs1,
+ !single_use1_p);
+ }
+ /* If that wasn't successful either, try both operands. */
+ if (tmp == NULL_TREE
+ && rhs0 != NULL_TREE
+ && rhs1 != NULL_TREE)
+ tmp = combine_cond_expr_cond (code, boolean_type_node, rhs0,
+ fold_convert (TREE_TYPE (rhs0), rhs1),
+ !(single_use0_p && single_use1_p));
+ }
+
+ if (tmp)
+ {
+ if (dump_file && tmp)
+ {
+ tree cond = build2 (gimple_cond_code (stmt),
+ boolean_type_node,
+ gimple_cond_lhs (stmt),
+ gimple_cond_rhs (stmt));
+ fprintf (dump_file, " Replaced '");
+ print_generic_expr (dump_file, cond, 0);
+ fprintf (dump_file, "' with '");
+ print_generic_expr (dump_file, tmp, 0);
+ fprintf (dump_file, "'\n");
+ }
+
+ gimple_cond_set_condition_from_tree (stmt, unshare_expr (tmp));
+ update_stmt (stmt);
+
+ /* Remove defining statements. */
+ remove_prop_source_from_use (name, NULL);
+
+ if (is_gimple_min_invariant (tmp))
+ did_something = 2;
+ else if (did_something == 0)
+ did_something = 1;
+
+ /* Continue combining. */
+ continue;
+ }
+
+ break;
+ } while (1);
+
+ return did_something;
+}
+
+
+/* Propagate from the ssa name definition statements of COND_EXPR
+ in the rhs of statement STMT into the conditional if that simplifies it.
+ Returns zero if no statement was changed, one if there were
+ changes and two if cfg_cleanup needs to run.
+
+ This must be kept in sync with forward_propagate_into_gimple_cond. */
+
+static int
+forward_propagate_into_cond (gimple_stmt_iterator *gsi_p)
+{
+ gimple stmt = gsi_stmt (*gsi_p);
int did_something = 0;
do {
tree tmp = NULL_TREE;
- tree cond = COND_EXPR_COND (cond_expr);
- tree name, def_stmt, rhs0 = NULL_TREE, rhs1 = NULL_TREE;
+ tree cond = gimple_assign_rhs1 (stmt);
+ tree name, rhs0 = NULL_TREE, rhs1 = NULL_TREE;
+ gimple def_stmt;
bool single_use0_p = false, single_use1_p = false;
/* We can do tree combining on SSA_NAME and comparison expressions. */
@@ -379,14 +497,12 @@ forward_propagate_into_cond (tree cond_expr, tree stmt)
simplify comparisons against constants. */
name = TREE_OPERAND (cond, 0);
def_stmt = get_prop_source_stmt (name, false, &single_use0_p);
- if (def_stmt != NULL_TREE
- && can_propagate_from (def_stmt))
+ if (def_stmt && can_propagate_from (def_stmt))
{
tree op1 = TREE_OPERAND (cond, 1);
- rhs0 = GIMPLE_STMT_OPERAND (def_stmt, 1);
+ rhs0 = rhs_to_tree (TREE_TYPE (op1), def_stmt);
tmp = combine_cond_expr_cond (TREE_CODE (cond), boolean_type_node,
- fold_convert (TREE_TYPE (op1), rhs0),
- op1, !single_use0_p);
+ rhs0, op1, !single_use0_p);
}
/* If that wasn't successful, try the second operand. */
if (tmp == NULL_TREE
@@ -395,34 +511,30 @@ forward_propagate_into_cond (tree cond_expr, tree stmt)
tree op0 = TREE_OPERAND (cond, 0);
name = TREE_OPERAND (cond, 1);
def_stmt = get_prop_source_stmt (name, false, &single_use1_p);
- if (def_stmt == NULL_TREE
- || !can_propagate_from (def_stmt))
+ if (!def_stmt || !can_propagate_from (def_stmt))
return did_something;
- rhs1 = GIMPLE_STMT_OPERAND (def_stmt, 1);
+ rhs1 = rhs_to_tree (TREE_TYPE (op0), def_stmt);
tmp = combine_cond_expr_cond (TREE_CODE (cond), boolean_type_node,
- op0,
- fold_convert (TREE_TYPE (op0), rhs1),
- !single_use1_p);
+ op0, rhs1, !single_use1_p);
}
/* If that wasn't successful either, try both operands. */
if (tmp == NULL_TREE
&& rhs0 != NULL_TREE
&& rhs1 != NULL_TREE)
tmp = combine_cond_expr_cond (TREE_CODE (cond), boolean_type_node,
- rhs0,
- fold_convert (TREE_TYPE (rhs0), rhs1),
+ rhs0, fold_convert (TREE_TYPE (rhs0),
+ rhs1),
!(single_use0_p && single_use1_p));
}
else if (TREE_CODE (cond) == SSA_NAME)
{
name = cond;
def_stmt = get_prop_source_stmt (name, true, NULL);
- if (def_stmt == NULL_TREE
- || !can_propagate_from (def_stmt))
+ if (def_stmt || !can_propagate_from (def_stmt))
return did_something;
- rhs0 = GIMPLE_STMT_OPERAND (def_stmt, 1);
+ rhs0 = gimple_assign_rhs1 (def_stmt);
tmp = combine_cond_expr_cond (NE_EXPR, boolean_type_node, rhs0,
build_int_cst (TREE_TYPE (rhs0), 0),
false);
@@ -439,7 +551,8 @@ forward_propagate_into_cond (tree cond_expr, tree stmt)
fprintf (dump_file, "'\n");
}
- COND_EXPR_COND (cond_expr) = unshare_expr (tmp);
+ gimple_assign_set_rhs_from_tree (gsi_p, unshare_expr (tmp));
+ stmt = gsi_stmt (*gsi_p);
update_stmt (stmt);
/* Remove defining statements. */
@@ -464,20 +577,20 @@ forward_propagate_into_cond (tree cond_expr, tree stmt)
relevant data structures to match. */
static void
-tidy_after_forward_propagate_addr (tree stmt)
+tidy_after_forward_propagate_addr (gimple stmt)
{
/* We may have turned a trapping insn into a non-trapping insn. */
if (maybe_clean_or_replace_eh_stmt (stmt, stmt)
- && tree_purge_dead_eh_edges (bb_for_stmt (stmt)))
+ && gimple_purge_dead_eh_edges (gimple_bb (stmt)))
cfg_changed = true;
- if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == ADDR_EXPR)
- recompute_tree_invariant_for_addr_expr (GIMPLE_STMT_OPERAND (stmt, 1));
+ if (TREE_CODE (gimple_assign_rhs1 (stmt)) == ADDR_EXPR)
+ recompute_tree_invariant_for_addr_expr (gimple_assign_rhs1 (stmt));
mark_symbols_for_renaming (stmt);
}
-/* DEF_RHS contains the address of the 0th element in an array.
+/* DEF_RHS contains the address of the 0th element in an array.
USE_STMT uses type of DEF_RHS to compute the address of an
arbitrary element within the array. The (variable) byte offset
of the element is contained in OFFSET.
@@ -494,9 +607,11 @@ tidy_after_forward_propagate_addr (tree stmt)
static bool
forward_propagate_addr_into_variable_array_index (tree offset,
- tree def_rhs, tree use_stmt)
+ tree def_rhs,
+ gimple_stmt_iterator *use_stmt_gsi)
{
tree index;
+ gimple offset_def, use_stmt = gsi_stmt (*use_stmt_gsi);
/* Try to find an expression for a proper index. This is either
a multiplication expression by the element size or just the
@@ -506,31 +621,32 @@ forward_propagate_addr_into_variable_array_index (tree offset,
else
{
/* Get the offset's defining statement. */
- offset = SSA_NAME_DEF_STMT (offset);
+ offset_def = SSA_NAME_DEF_STMT (offset);
/* The statement which defines OFFSET before type conversion
- must be a simple GIMPLE_MODIFY_STMT. */
- if (TREE_CODE (offset) != GIMPLE_MODIFY_STMT)
+ must be a simple GIMPLE_ASSIGN. */
+ if (gimple_code (offset_def) != GIMPLE_ASSIGN)
return false;
/* The RHS of the statement which defines OFFSET must be a
multiplication of an object by the size of the array elements.
This implicitly verifies that the size of the array elements
is constant. */
- offset = GIMPLE_STMT_OPERAND (offset, 1);
- if (TREE_CODE (offset) != MULT_EXPR
- || TREE_CODE (TREE_OPERAND (offset, 1)) != INTEGER_CST
- || !simple_cst_equal (TREE_OPERAND (offset, 1),
- TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (def_rhs)))))
+ offset = gimple_assign_rhs1 (offset_def);
+ if (gimple_assign_rhs_code (offset_def) != MULT_EXPR
+ || TREE_CODE (gimple_assign_rhs2 (offset_def)) != INTEGER_CST
+ || !simple_cst_equal (gimple_assign_rhs2 (offset_def),
+ TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (def_rhs)))))
return false;
/* The first operand to the MULT_EXPR is the desired index. */
- index = TREE_OPERAND (offset, 0);
+ index = offset;
}
/* Replace the pointer addition with array indexing. */
- GIMPLE_STMT_OPERAND (use_stmt, 1) = unshare_expr (def_rhs);
- TREE_OPERAND (TREE_OPERAND (GIMPLE_STMT_OPERAND (use_stmt, 1), 0), 1)
+ gimple_assign_set_rhs_from_tree (use_stmt_gsi, unshare_expr (def_rhs));
+ use_stmt = gsi_stmt (*use_stmt_gsi);
+ TREE_OPERAND (TREE_OPERAND (gimple_assign_rhs1 (use_stmt), 0), 1)
= index;
/* That should have created gimple, so there is no need to
@@ -546,21 +662,25 @@ forward_propagate_addr_into_variable_array_index (tree offset,
Try to forward propagate the ADDR_EXPR into the use USE_STMT.
Often this will allow for removal of an ADDR_EXPR and INDIRECT_REF
node or for recovery of array indexing from pointer arithmetic.
-
+
Return true if the propagation was successful (the propagation can
be not totally successful, yet things may have been changed). */
static bool
-forward_propagate_addr_expr_1 (tree name, tree def_rhs, tree use_stmt,
+forward_propagate_addr_expr_1 (tree name, tree def_rhs,
+ gimple_stmt_iterator *use_stmt_gsi,
bool single_use_p)
{
- tree lhs, rhs, array_ref;
+ tree lhs, rhs, rhs2, array_ref;
tree *rhsp, *lhsp;
+ gimple use_stmt = gsi_stmt (*use_stmt_gsi);
+ enum tree_code rhs_code;
gcc_assert (TREE_CODE (def_rhs) == ADDR_EXPR);
- lhs = GIMPLE_STMT_OPERAND (use_stmt, 0);
- rhs = GIMPLE_STMT_OPERAND (use_stmt, 1);
+ lhs = gimple_assign_lhs (use_stmt);
+ rhs_code = gimple_assign_rhs_code (use_stmt);
+ rhs = gimple_assign_rhs1 (use_stmt);
/* Trivial cases. The use statement could be a trivial copy or a
useless conversion. Recurse to the uses of the lhs as copyprop does
@@ -568,21 +688,29 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs, tree use_stmt,
all useless conversions. Treat the case of a single-use name and
a conversion to def_rhs type separate, though. */
if (TREE_CODE (lhs) == SSA_NAME
- && (rhs == name
- || CONVERT_EXPR_P (rhs))
- && useless_type_conversion_p (TREE_TYPE (rhs), TREE_TYPE (def_rhs)))
+ && ((rhs_code == SSA_NAME && rhs == name)
+ || 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_STMT_OPERAND (use_stmt, 1) = unshare_expr (def_rhs);
+ gimple_assign_set_rhs1 (use_stmt, unshare_expr (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;
}
/* Now strip away any outer COMPONENT_REF/ARRAY_REF nodes from the LHS.
ADDR_EXPR will not appear on the LHS. */
- lhsp = &GIMPLE_STMT_OPERAND (use_stmt, 0);
+ lhsp = gimple_assign_lhs_ptr (use_stmt);
while (handled_component_p (*lhsp))
lhsp = &TREE_OPERAND (*lhsp, 0);
lhs = *lhsp;
@@ -609,13 +737,13 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs, tree use_stmt,
/* Strip away any outer COMPONENT_REF, ARRAY_REF or ADDR_EXPR
nodes from the RHS. */
- rhsp = &GIMPLE_STMT_OPERAND (use_stmt, 1);
+ rhsp = gimple_assign_rhs1_ptr (use_stmt);
while (handled_component_p (*rhsp)
|| TREE_CODE (*rhsp) == ADDR_EXPR)
rhsp = &TREE_OPERAND (*rhsp, 0);
rhs = *rhsp;
- /* Now see if the RHS node is an INDIRECT_REF using NAME. If so,
+ /* Now see if the RHS node is an INDIRECT_REF using NAME. If so,
propagate the ADDR_EXPR into the use of NAME and fold the result. */
if (TREE_CODE (rhs) == INDIRECT_REF
&& TREE_OPERAND (rhs, 0) == name
@@ -654,8 +782,8 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs, tree use_stmt,
/* If we have folded the VCE, then we have to create a new statement. */
if (TREE_CODE (new_rhs) != VIEW_CONVERT_EXPR)
{
- block_stmt_iterator bsi = bsi_for_stmt (use_stmt);
- new_rhs = force_gimple_operand_bsi (&bsi, new_rhs, true, NULL, true, BSI_SAME_STMT);
+ gimple_stmt_iterator gsi = gsi_for_stmt (use_stmt);
+ new_rhs = force_gimple_operand_gsi (&gsi, new_rhs, true, NULL, true, GSI_SAME_STMT);
/* As we change the deference to a SSA_NAME, we need to return false to make sure that
the statement does not get removed. */
res = false;
@@ -668,8 +796,8 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs, tree use_stmt,
/* If the use of the ADDR_EXPR is not a POINTER_PLUS_EXPR, there
is nothing to do. */
- if (TREE_CODE (rhs) != POINTER_PLUS_EXPR
- || TREE_OPERAND (rhs, 0) != name)
+ if (gimple_assign_rhs_code (use_stmt) != POINTER_PLUS_EXPR
+ || gimple_assign_rhs1 (use_stmt) != name)
return false;
/* The remaining cases are all for turning pointer arithmetic into
@@ -682,44 +810,33 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs, tree use_stmt,
|| !integer_zerop (TREE_OPERAND (array_ref, 1)))
return false;
+ rhs2 = gimple_assign_rhs2 (use_stmt);
/* Try to optimize &x[0] p+ C where C is a multiple of the size
of the elements in X into &x[C/element size]. */
- if (TREE_CODE (TREE_OPERAND (rhs, 1)) == INTEGER_CST)
+ if (TREE_CODE (rhs2) == INTEGER_CST)
{
- tree orig = unshare_expr (rhs);
- TREE_OPERAND (rhs, 0) = unshare_expr (def_rhs);
-
- /* If folding succeeds, then we have just exposed new variables
- in USE_STMT which will need to be renamed. If folding fails,
- then we need to put everything back the way it was. */
- if (fold_stmt_inplace (use_stmt))
+ tree new_rhs = maybe_fold_stmt_addition (gimple_expr_type (use_stmt),
+ array_ref, rhs2);
+ if (new_rhs)
{
+ gimple_assign_set_rhs_from_tree (use_stmt_gsi, new_rhs);
+ use_stmt = gsi_stmt (*use_stmt_gsi);
+ update_stmt (use_stmt);
tidy_after_forward_propagate_addr (use_stmt);
return true;
}
- else
- {
- GIMPLE_STMT_OPERAND (use_stmt, 1) = orig;
- update_stmt (use_stmt);
- return false;
- }
}
/* Try to optimize &x[0] p+ OFFSET where OFFSET is defined by
converting a multiplication of an index by the size of the
array elements, then the result is converted into the proper
type for the arithmetic. */
- if (TREE_CODE (TREE_OPERAND (rhs, 1)) == SSA_NAME
+ if (TREE_CODE (rhs2) == SSA_NAME
/* Avoid problems with IVopts creating PLUS_EXPRs with a
different type than their operands. */
- && useless_type_conversion_p (TREE_TYPE (rhs), TREE_TYPE (name)))
- {
- bool res;
-
- res = forward_propagate_addr_into_variable_array_index (TREE_OPERAND (rhs, 1),
- def_rhs, use_stmt);
- return res;
- }
+ && useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (name)))
+ return forward_propagate_addr_into_variable_array_index (rhs2, def_rhs,
+ use_stmt_gsi);
return false;
}
@@ -733,9 +850,9 @@ forward_propagate_addr_expr_1 (tree name, tree def_rhs, tree use_stmt,
static bool
forward_propagate_addr_expr (tree name, tree rhs)
{
- int stmt_loop_depth = bb_for_stmt (SSA_NAME_DEF_STMT (name))->loop_depth;
+ int stmt_loop_depth = gimple_bb (SSA_NAME_DEF_STMT (name))->loop_depth;
imm_use_iterator iter;
- tree use_stmt;
+ gimple use_stmt;
bool all = true;
bool single_use_p = has_single_use (name);
@@ -746,16 +863,16 @@ forward_propagate_addr_expr (tree name, tree rhs)
/* If the use is not in a simple assignment statement, then
there is nothing we can do. */
- if (TREE_CODE (use_stmt) != GIMPLE_MODIFY_STMT)
+ if (gimple_code (use_stmt) != GIMPLE_ASSIGN)
{
all = false;
continue;
}
/* If the use is in a deeper loop nest, then we do not want
- to propagate the ADDR_EXPR into the loop as that is likely
- adding expression evaluations into the loop. */
- if (bb_for_stmt (use_stmt)->loop_depth > stmt_loop_depth)
+ to propagate the ADDR_EXPR into the loop as that is likely
+ adding expression evaluations into the loop. */
+ if (gimple_bb (use_stmt)->loop_depth > stmt_loop_depth)
{
all = false;
continue;
@@ -763,30 +880,34 @@ forward_propagate_addr_expr (tree name, tree rhs)
push_stmt_changes (&use_stmt);
- result = forward_propagate_addr_expr_1 (name, rhs, use_stmt,
- single_use_p);
+ {
+ gimple_stmt_iterator gsi = gsi_for_stmt (use_stmt);
+ result = forward_propagate_addr_expr_1 (name, rhs, &gsi,
+ single_use_p);
+ use_stmt = gsi_stmt (gsi);
+ }
all &= result;
pop_stmt_changes (&use_stmt);
/* Remove intermediate now unused copy and conversion chains. */
- use_rhs = GIMPLE_STMT_OPERAND (use_stmt, 1);
+ use_rhs = gimple_assign_rhs1 (use_stmt);
if (result
- && TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 0)) == SSA_NAME
+ && TREE_CODE (gimple_assign_lhs (use_stmt)) == SSA_NAME
&& (TREE_CODE (use_rhs) == SSA_NAME
|| (CONVERT_EXPR_P (use_rhs)
&& TREE_CODE (TREE_OPERAND (use_rhs, 0)) == SSA_NAME)))
{
- block_stmt_iterator bsi = bsi_for_stmt (use_stmt);
+ gimple_stmt_iterator gsi = gsi_for_stmt (use_stmt);
release_defs (use_stmt);
- bsi_remove (&bsi, true);
+ gsi_remove (&gsi, true);
}
}
return all;
}
-/* Forward propagate the comparison COND defined in STMT like
+/* Forward propagate the comparison defined in STMT like
cond_1 = x CMP y to uses of the form
a_1 = (T')cond_1
a_1 = !cond_1
@@ -794,83 +915,95 @@ forward_propagate_addr_expr (tree name, tree rhs)
Returns true if stmt is now unused. */
static bool
-forward_propagate_comparison (tree cond, tree stmt)
+forward_propagate_comparison (gimple stmt)
{
- tree name = GIMPLE_STMT_OPERAND (stmt, 0);
- tree use_stmt, tmp = NULL_TREE;
+ tree name = gimple_assign_lhs (stmt);
+ gimple use_stmt;
+ tree tmp = NULL_TREE;
/* Don't propagate ssa names that occur in abnormal phis. */
- if ((TREE_CODE (TREE_OPERAND (cond, 0)) == SSA_NAME
- && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (TREE_OPERAND (cond, 0)))
- || (TREE_CODE (TREE_OPERAND (cond, 1)) == SSA_NAME
- && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (TREE_OPERAND (cond, 1))))
+ if ((TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME
+ && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (gimple_assign_rhs1 (stmt)))
+ || (TREE_CODE (gimple_assign_rhs2 (stmt)) == SSA_NAME
+ && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (gimple_assign_rhs2 (stmt))))
return false;
/* Do not un-cse comparisons. But propagate through copies. */
use_stmt = get_prop_dest_stmt (name, &name);
- if (use_stmt == NULL_TREE)
+ if (!use_stmt)
return false;
/* Conversion of the condition result to another integral type. */
- if (TREE_CODE (use_stmt) == GIMPLE_MODIFY_STMT
- && (CONVERT_EXPR_P (GIMPLE_STMT_OPERAND (use_stmt, 1))
- || COMPARISON_CLASS_P (GIMPLE_STMT_OPERAND (use_stmt, 1))
- || TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 1)) == TRUTH_NOT_EXPR)
- && INTEGRAL_TYPE_P (TREE_TYPE (GIMPLE_STMT_OPERAND (use_stmt, 0))))
+ if (is_gimple_assign (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)
+ && INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_lhs (use_stmt))))
{
- tree lhs = GIMPLE_STMT_OPERAND (use_stmt, 0);
- tree rhs = GIMPLE_STMT_OPERAND (use_stmt, 1);
+ tree lhs = gimple_assign_lhs (use_stmt);
/* We can propagate the condition into a conversion. */
- if (CONVERT_EXPR_P (rhs))
+ 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. */
- tmp = build2 (TREE_CODE (cond), TREE_TYPE (lhs),
- TREE_OPERAND (cond, 0), TREE_OPERAND (cond, 1));
+ tmp = build2 (gimple_assign_rhs_code (stmt), TREE_TYPE (lhs),
+ gimple_assign_rhs1 (stmt), gimple_assign_rhs2 (stmt));
}
/* We can propagate the condition into X op CST where op
is EQ_EXPR or NE_EXPR and CST is either one or zero. */
- else if (COMPARISON_CLASS_P (rhs)
- && TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME
- && TREE_CODE (TREE_OPERAND (rhs, 1)) == INTEGER_CST)
- {
- enum tree_code code = TREE_CODE (rhs);
- tree cst = TREE_OPERAND (rhs, 1);
-
- tmp = combine_cond_expr_cond (code, TREE_TYPE (lhs),
- fold_convert (TREE_TYPE (cst), cond),
- cst, false);
- if (tmp == NULL_TREE)
- return false;
- }
+ else if (TREE_CODE_CLASS (gimple_assign_rhs_code (use_stmt))
+ == tcc_comparison
+ && TREE_CODE (gimple_assign_rhs1 (use_stmt)) == SSA_NAME
+ && TREE_CODE (gimple_assign_rhs2 (use_stmt)) == INTEGER_CST)
+ {
+ enum tree_code code = gimple_assign_rhs_code (use_stmt);
+ tree cst = gimple_assign_rhs2 (use_stmt);
+ tree cond;
+
+ cond = build2 (gimple_assign_rhs_code (stmt),
+ TREE_TYPE (cst),
+ gimple_assign_rhs1 (stmt),
+ gimple_assign_rhs2 (stmt));
+
+ tmp = combine_cond_expr_cond (code, TREE_TYPE (lhs), cond, cst, false);
+ if (tmp == NULL_TREE)
+ return false;
+ }
/* We can propagate the condition into a statement that
computes the logical negation of the comparison result. */
- else if (TREE_CODE (rhs) == TRUTH_NOT_EXPR)
+ else if (gimple_assign_rhs_code (use_stmt) == TRUTH_NOT_EXPR)
{
- tree type = TREE_TYPE (TREE_OPERAND (cond, 0));
+ tree type = TREE_TYPE (gimple_assign_rhs1 (stmt));
bool nans = HONOR_NANS (TYPE_MODE (type));
enum tree_code code;
- code = invert_tree_comparison (TREE_CODE (cond), nans);
+ code = invert_tree_comparison (gimple_assign_rhs_code (stmt), nans);
if (code == ERROR_MARK)
return false;
- tmp = build2 (code, TREE_TYPE (lhs), TREE_OPERAND (cond, 0),
- TREE_OPERAND (cond, 1));
+ tmp = build2 (code, TREE_TYPE (lhs), gimple_assign_rhs1 (stmt),
+ gimple_assign_rhs2 (stmt));
}
else
return false;
- GIMPLE_STMT_OPERAND (use_stmt, 1) = unshare_expr (tmp);
- update_stmt (use_stmt);
+ {
+ gimple_stmt_iterator gsi = gsi_for_stmt (use_stmt);
+ gimple_assign_set_rhs_from_tree (&gsi, unshare_expr (tmp));
+ use_stmt = gsi_stmt (gsi);
+ update_stmt (use_stmt);
+ }
/* Remove defining statements. */
remove_prop_source_from_use (name, stmt);
if (dump_file && (dump_flags & TDF_DETAILS))
{
+ tree old_rhs = rhs_to_tree (TREE_TYPE (gimple_assign_lhs (stmt)),
+ stmt);
fprintf (dump_file, " Replaced '");
- print_generic_expr (dump_file, rhs, dump_flags);
+ print_generic_expr (dump_file, old_rhs, dump_flags);
fprintf (dump_file, "' with '");
print_generic_expr (dump_file, tmp, dump_flags);
fprintf (dump_file, "'\n");
@@ -897,23 +1030,24 @@ forward_propagate_comparison (tree cond, tree stmt)
than one forward link. */
static void
-simplify_not_neg_expr (tree stmt)
+simplify_not_neg_expr (gimple_stmt_iterator *gsi_p)
{
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- tree rhs_def_stmt = SSA_NAME_DEF_STMT (TREE_OPERAND (rhs, 0));
+ gimple stmt = gsi_stmt (*gsi_p);
+ tree rhs = gimple_assign_rhs1 (stmt);
+ gimple rhs_def_stmt = SSA_NAME_DEF_STMT (rhs);
/* See if the RHS_DEF_STMT has the same form as our statement. */
- if (TREE_CODE (rhs_def_stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (rhs_def_stmt, 1)) == TREE_CODE (rhs))
+ if (is_gimple_assign (rhs_def_stmt)
+ && gimple_assign_rhs_code (rhs_def_stmt) == gimple_assign_rhs_code (stmt))
{
- tree rhs_def_operand =
- TREE_OPERAND (GIMPLE_STMT_OPERAND (rhs_def_stmt, 1), 0);
+ tree rhs_def_operand = gimple_assign_rhs1 (rhs_def_stmt);
/* Verify that RHS_DEF_OPERAND is a suitable SSA_NAME. */
if (TREE_CODE (rhs_def_operand) == SSA_NAME
&& ! SSA_NAME_OCCURS_IN_ABNORMAL_PHI (rhs_def_operand))
{
- GIMPLE_STMT_OPERAND (stmt, 1) = rhs_def_operand;
+ gimple_assign_set_rhs_from_tree (gsi_p, rhs_def_operand);
+ stmt = gsi_stmt (*gsi_p);
update_stmt (stmt);
}
}
@@ -923,26 +1057,26 @@ simplify_not_neg_expr (tree stmt)
the condition which we may be able to optimize better. */
static void
-simplify_switch_expr (tree stmt)
+simplify_gimple_switch (gimple stmt)
{
- tree cond = SWITCH_COND (stmt);
+ tree cond = gimple_switch_index (stmt);
tree def, to, ti;
+ gimple def_stmt;
/* The optimization that we really care about is removing unnecessary
casts. That will let us do much better in propagating the inferred
constant at the switch target. */
if (TREE_CODE (cond) == SSA_NAME)
{
- def = SSA_NAME_DEF_STMT (cond);
- if (TREE_CODE (def) == GIMPLE_MODIFY_STMT)
+ def_stmt = SSA_NAME_DEF_STMT (cond);
+ if (is_gimple_assign (def_stmt))
{
- def = GIMPLE_STMT_OPERAND (def, 1);
- if (TREE_CODE (def) == NOP_EXPR)
+ if (gimple_assign_rhs_code (def_stmt) == NOP_EXPR)
{
int need_precision;
bool fail;
- def = TREE_OPERAND (def, 0);
+ def = gimple_assign_rhs1 (def_stmt);
#ifdef ENABLE_CHECKING
/* ??? Why was Jeff testing this? We are gimple... */
@@ -968,7 +1102,7 @@ simplify_switch_expr (tree stmt)
if (!fail)
{
- SWITCH_COND (stmt) = def;
+ gimple_switch_set_index (stmt, def);
update_stmt (stmt);
}
}
@@ -988,33 +1122,32 @@ tree_ssa_forward_propagate_single_use_vars (void)
FOR_EACH_BB (bb)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
- /* Note we update BSI within the loop as necessary. */
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); )
+ /* Note we update GSI within the loop as necessary. */
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); )
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
/* If this statement sets an SSA_NAME to an address,
try to propagate the address into the uses of the SSA_NAME. */
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_assign (stmt))
{
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
-
+ tree lhs = gimple_assign_lhs (stmt);
+ tree rhs = gimple_assign_rhs1 (stmt);
if (TREE_CODE (lhs) != SSA_NAME)
{
- bsi_next (&bsi);
+ gsi_next (&gsi);
continue;
}
- if (TREE_CODE (rhs) == ADDR_EXPR
+ if (gimple_assign_rhs_code (stmt) == ADDR_EXPR
/* Handle pointer conversions on invariant addresses
as well, as this is valid gimple. */
- || (CONVERT_EXPR_P (rhs)
- && TREE_CODE (TREE_OPERAND (rhs, 0)) == ADDR_EXPR
- && POINTER_TYPE_P (TREE_TYPE (rhs))))
+ || (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt))
+ && TREE_CODE (rhs) == ADDR_EXPR
+ && POINTER_TYPE_P (TREE_TYPE (lhs))))
{
STRIP_NOPS (rhs);
if (!stmt_references_abnormal_ssa_name (stmt)
@@ -1022,61 +1155,64 @@ tree_ssa_forward_propagate_single_use_vars (void)
{
release_defs (stmt);
todoflags |= TODO_remove_unused_locals;
- bsi_remove (&bsi, true);
+ gsi_remove (&gsi, true);
}
else
- bsi_next (&bsi);
+ gsi_next (&gsi);
}
- else if ((TREE_CODE (rhs) == BIT_NOT_EXPR
- || TREE_CODE (rhs) == NEGATE_EXPR)
- && TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME)
+ else if ((gimple_assign_rhs_code (stmt) == BIT_NOT_EXPR
+ || gimple_assign_rhs_code (stmt) == NEGATE_EXPR)
+ && TREE_CODE (rhs) == SSA_NAME)
{
- simplify_not_neg_expr (stmt);
- bsi_next (&bsi);
+ simplify_not_neg_expr (&gsi);
+ gsi_next (&gsi);
}
- else if (TREE_CODE (rhs) == COND_EXPR)
+ else if (gimple_assign_rhs_code (stmt) == COND_EXPR)
{
+ /* In this case the entire COND_EXPR is in rhs1. */
int did_something;
fold_defer_overflow_warnings ();
- did_something = forward_propagate_into_cond (rhs, stmt);
+ did_something = forward_propagate_into_cond (&gsi);
+ stmt = gsi_stmt (gsi);
if (did_something == 2)
cfg_changed = true;
fold_undefer_overflow_warnings (!TREE_NO_WARNING (rhs)
&& did_something, stmt, WARN_STRICT_OVERFLOW_CONDITIONAL);
- bsi_next (&bsi);
+ gsi_next (&gsi);
}
- else if (COMPARISON_CLASS_P (rhs))
+ else if (TREE_CODE_CLASS (gimple_assign_rhs_code (stmt))
+ == tcc_comparison)
{
- if (forward_propagate_comparison (rhs, stmt))
+ if (forward_propagate_comparison (stmt))
{
release_defs (stmt);
todoflags |= TODO_remove_unused_locals;
- bsi_remove (&bsi, true);
+ gsi_remove (&gsi, true);
}
else
- bsi_next (&bsi);
+ gsi_next (&gsi);
}
else
- bsi_next (&bsi);
+ gsi_next (&gsi);
}
- else if (TREE_CODE (stmt) == SWITCH_EXPR)
+ else if (gimple_code (stmt) == GIMPLE_SWITCH)
{
- simplify_switch_expr (stmt);
- bsi_next (&bsi);
+ simplify_gimple_switch (stmt);
+ gsi_next (&gsi);
}
- else if (TREE_CODE (stmt) == COND_EXPR)
+ else if (gimple_code (stmt) == GIMPLE_COND)
{
int did_something;
fold_defer_overflow_warnings ();
- did_something = forward_propagate_into_cond (stmt, stmt);
+ did_something = forward_propagate_into_gimple_cond (stmt);
if (did_something == 2)
cfg_changed = true;
fold_undefer_overflow_warnings (did_something, stmt,
WARN_STRICT_OVERFLOW_CONDITIONAL);
- bsi_next (&bsi);
+ gsi_next (&gsi);
}
else
- bsi_next (&bsi);
+ gsi_next (&gsi);
}
}
diff --git a/gcc/tree-ssa-ifcombine.c b/gcc/tree-ssa-ifcombine.c
index 93e7810cb3b..a4a74ee6be4 100644
--- a/gcc/tree-ssa-ifcombine.c
+++ b/gcc/tree-ssa-ifcombine.c
@@ -101,14 +101,13 @@ recognize_if_then_else (basic_block cond_bb,
static bool
bb_no_side_effects_p (basic_block bb)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
- 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))
{
- tree stmt = bsi_stmt (bsi);
- stmt_ann_t ann = stmt_ann (stmt);
+ gimple stmt = gsi_stmt (gsi);
- if (ann->has_volatile_ops
+ if (gimple_has_volatile_ops (stmt)
|| !ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS))
return false;
}
@@ -125,12 +124,16 @@ same_phi_args_p (basic_block bb1, basic_block bb2, basic_block dest)
{
edge e1 = find_edge (bb1, dest);
edge e2 = find_edge (bb2, dest);
- tree phi;
+ gimple_stmt_iterator gsi;
+ gimple phi;
- for (phi = phi_nodes (dest); phi; phi = PHI_CHAIN (phi))
- if (!operand_equal_p (PHI_ARG_DEF_FROM_EDGE (phi, e1),
- PHI_ARG_DEF_FROM_EDGE (phi, e2), 0))
- return false;
+ for (gsi = gsi_start_phis (dest); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ phi = gsi_stmt (gsi);
+ if (!operand_equal_p (PHI_ARG_DEF_FROM_EDGE (phi, e1),
+ PHI_ARG_DEF_FROM_EDGE (phi, e2), 0))
+ return false;
+ }
return true;
}
@@ -146,71 +149,86 @@ get_name_for_bit_test (tree candidate)
if (TREE_CODE (candidate) == SSA_NAME
&& has_single_use (candidate))
{
- tree def_stmt = SSA_NAME_DEF_STMT (candidate);
- if (TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT
- && CONVERT_EXPR_P (GIMPLE_STMT_OPERAND (def_stmt, 1)))
+ gimple def_stmt = SSA_NAME_DEF_STMT (candidate);
+ if (is_gimple_assign (def_stmt)
+ && gimple_assign_cast_p (def_stmt))
{
- tree rhs = GIMPLE_STMT_OPERAND (def_stmt, 1);
- if (TYPE_PRECISION (TREE_TYPE (rhs))
- <= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (rhs, 0))))
- return TREE_OPERAND (rhs, 0);
+ if (TYPE_PRECISION (TREE_TYPE (candidate))
+ <= TYPE_PRECISION (TREE_TYPE (gimple_assign_rhs1 (def_stmt))))
+ return gimple_assign_rhs1 (def_stmt);
}
}
return candidate;
}
-/* Recognize a single bit test pattern in COND_EXPR and its defining
+/* Helpers for recognize_single_bit_test defined mainly for source code
+ formating. */
+
+static int
+operand_precision (tree t)
+{
+ return TYPE_PRECISION (TREE_TYPE (t));
+}
+
+static bool
+integral_operand_p (tree t)
+{
+ return INTEGRAL_TYPE_P (TREE_TYPE (t));
+}
+
+/* Recognize a single bit test pattern in GIMPLE_COND and its defining
statements. Store the name being tested in *NAME and the bit
- in *BIT. The COND_EXPR computes *NAME & (1 << *BIT).
+ in *BIT. The GIMPLE_COND computes *NAME & (1 << *BIT).
Returns true if the pattern matched, false otherwise. */
static bool
-recognize_single_bit_test (tree cond_expr, tree *name, tree *bit)
+recognize_single_bit_test (gimple cond, tree *name, tree *bit)
{
- tree t;
+ gimple stmt;
/* Get at the definition of the result of the bit test. */
- t = TREE_OPERAND (cond_expr, 0);
- if (TREE_CODE (t) == NE_EXPR
- && integer_zerop (TREE_OPERAND (t, 1)))
- t = TREE_OPERAND (t, 0);
- if (TREE_CODE (t) != SSA_NAME)
+ if (gimple_cond_code (cond) != NE_EXPR
+ || TREE_CODE (gimple_cond_lhs (cond)) != SSA_NAME
+ || !integer_zerop (gimple_cond_rhs (cond)))
return false;
- t = SSA_NAME_DEF_STMT (t);
- if (TREE_CODE (t) != GIMPLE_MODIFY_STMT)
+ stmt = SSA_NAME_DEF_STMT (gimple_cond_lhs (cond));
+ if (!is_gimple_assign (stmt))
return false;
- t = GIMPLE_STMT_OPERAND (t, 1);
/* Look at which bit is tested. One form to recognize is
D.1985_5 = state_3(D) >> control1_4(D);
D.1986_6 = (int) D.1985_5;
D.1987_7 = op0 & 1;
if (D.1987_7 != 0) */
- if (TREE_CODE (t) == BIT_AND_EXPR
- && integer_onep (TREE_OPERAND (t, 1))
- && TREE_CODE (TREE_OPERAND (t, 0)) == SSA_NAME)
+ if (gimple_assign_rhs_code (stmt) == BIT_AND_EXPR
+ && integer_onep (gimple_assign_rhs2 (stmt))
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME)
{
- tree orig_name = TREE_OPERAND (t, 0);
+ tree orig_name = gimple_assign_rhs1 (stmt);
/* Look through copies and conversions to eventually
find the stmt that computes the shift. */
- t = orig_name;
- do {
- t = SSA_NAME_DEF_STMT (t);
- if (TREE_CODE (t) != GIMPLE_MODIFY_STMT)
- break;
- t = GIMPLE_STMT_OPERAND (t, 1);
- if (CONVERT_EXPR_P (t))
- t = TREE_OPERAND (t, 0);
- } while (TREE_CODE (t) == SSA_NAME);
+ stmt = SSA_NAME_DEF_STMT (orig_name);
+
+ while (is_gimple_assign (stmt)
+ && (gimple_assign_ssa_name_copy_p (stmt)
+ || (gimple_assign_cast_p (stmt)
+ && integral_operand_p (gimple_assign_lhs (stmt))
+ && integral_operand_p (gimple_assign_rhs1 (stmt))
+ && (operand_precision (gimple_assign_lhs (stmt))
+ <= operand_precision (gimple_assign_rhs1 (stmt))))))
+ {
+ stmt = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmt));
+ }
/* If we found such, decompose it. */
- if (TREE_CODE (t) == RSHIFT_EXPR)
+ if (is_gimple_assign (stmt)
+ && gimple_assign_rhs_code (stmt) == RSHIFT_EXPR)
{
/* op0 & (1 << op1) */
- *bit = TREE_OPERAND (t, 1);
- *name = TREE_OPERAND (t, 0);
+ *bit = gimple_assign_rhs2 (stmt);
+ *name = gimple_assign_rhs1 (stmt);
}
else
{
@@ -225,13 +243,13 @@ recognize_single_bit_test (tree cond_expr, tree *name, tree *bit)
/* Another form is
D.1987_7 = op0 & (1 << CST)
if (D.1987_7 != 0) */
- if (TREE_CODE (t) == BIT_AND_EXPR
- && TREE_CODE (TREE_OPERAND (t, 0)) == SSA_NAME
- && integer_pow2p (TREE_OPERAND (t, 1)))
+ if (gimple_assign_rhs_code (stmt) == BIT_AND_EXPR
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME
+ && integer_pow2p (gimple_assign_rhs2 (stmt)))
{
- *name = TREE_OPERAND (t, 0);
+ *name = gimple_assign_rhs1 (stmt);
*bit = build_int_cst (integer_type_node,
- tree_log2 (TREE_OPERAND (t, 1)));
+ tree_log2 (gimple_assign_rhs2 (stmt)));
return true;
}
@@ -239,31 +257,31 @@ recognize_single_bit_test (tree cond_expr, tree *name, tree *bit)
D.1986_6 = 1 << control1_4(D)
D.1987_7 = op0 & D.1986_6
if (D.1987_7 != 0) */
- if (TREE_CODE (t) == BIT_AND_EXPR
- && TREE_CODE (TREE_OPERAND (t, 0)) == SSA_NAME
- && TREE_CODE (TREE_OPERAND (t, 1)) == SSA_NAME)
+ if (gimple_assign_rhs_code (stmt) == BIT_AND_EXPR
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME
+ && TREE_CODE (gimple_assign_rhs2 (stmt)) == SSA_NAME)
{
- tree tmp;
+ gimple tmp;
/* Both arguments of the BIT_AND_EXPR can be the single-bit
specifying expression. */
- tmp = SSA_NAME_DEF_STMT (TREE_OPERAND (t, 0));
- if (TREE_CODE (tmp) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (tmp, 1)) == LSHIFT_EXPR
- && integer_onep (TREE_OPERAND (GIMPLE_STMT_OPERAND (tmp, 1), 0)))
+ tmp = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmt));
+ if (is_gimple_assign (tmp)
+ && gimple_assign_rhs_code (tmp) == LSHIFT_EXPR
+ && integer_onep (gimple_assign_rhs1 (tmp)))
{
- *name = TREE_OPERAND (t, 1);
- *bit = TREE_OPERAND (GIMPLE_STMT_OPERAND (tmp, 1), 1);
+ *name = gimple_assign_rhs2 (stmt);
+ *bit = gimple_assign_rhs2 (tmp);
return true;
}
- tmp = SSA_NAME_DEF_STMT (TREE_OPERAND (t, 1));
- if (TREE_CODE (tmp) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (tmp, 1)) == LSHIFT_EXPR
- && integer_onep (TREE_OPERAND (GIMPLE_STMT_OPERAND (tmp, 1), 0)))
+ tmp = SSA_NAME_DEF_STMT (gimple_assign_rhs2 (stmt));
+ if (is_gimple_assign (tmp)
+ && gimple_assign_rhs_code (tmp) == LSHIFT_EXPR
+ && integer_onep (gimple_assign_rhs1 (tmp)))
{
- *name = TREE_OPERAND (t, 0);
- *bit = TREE_OPERAND (GIMPLE_STMT_OPERAND (tmp, 1), 1);
+ *name = gimple_assign_rhs1 (stmt);
+ *bit = gimple_assign_rhs2 (tmp);
return true;
}
}
@@ -271,33 +289,28 @@ recognize_single_bit_test (tree cond_expr, tree *name, tree *bit)
return false;
}
-/* Recognize a bit test pattern in COND_EXPR and its defining
+/* Recognize a bit test pattern in a GIMPLE_COND and its defining
statements. Store the name being tested in *NAME and the bits
in *BITS. The COND_EXPR computes *NAME & *BITS.
Returns true if the pattern matched, false otherwise. */
static bool
-recognize_bits_test (tree cond_expr, tree *name, tree *bits)
+recognize_bits_test (gimple cond, tree *name, tree *bits)
{
- tree t;
+ gimple stmt;
/* Get at the definition of the result of the bit test. */
- t = TREE_OPERAND (cond_expr, 0);
- if (TREE_CODE (t) == NE_EXPR
- && integer_zerop (TREE_OPERAND (t, 1)))
- t = TREE_OPERAND (t, 0);
- if (TREE_CODE (t) != SSA_NAME)
- return false;
- t = SSA_NAME_DEF_STMT (t);
- if (TREE_CODE (t) != GIMPLE_MODIFY_STMT)
+ if (gimple_cond_code (cond) != NE_EXPR
+ || TREE_CODE (gimple_cond_lhs (cond)) != SSA_NAME
+ || !integer_zerop (gimple_cond_rhs (cond)))
return false;
- t = GIMPLE_STMT_OPERAND (t, 1);
-
- if (TREE_CODE (t) != BIT_AND_EXPR)
+ stmt = SSA_NAME_DEF_STMT (gimple_cond_lhs (cond));
+ if (!is_gimple_assign (stmt)
+ || gimple_assign_rhs_code (stmt) != BIT_AND_EXPR)
return false;
- *name = get_name_for_bit_test (TREE_OPERAND (t, 0));
- *bits = TREE_OPERAND (t, 1);
+ *name = get_name_for_bit_test (gimple_assign_rhs1 (stmt));
+ *bits = gimple_assign_rhs2 (stmt);
return true;
}
@@ -309,18 +322,18 @@ recognize_bits_test (tree cond_expr, tree *name, tree *bits)
static bool
ifcombine_ifandif (basic_block inner_cond_bb, basic_block outer_cond_bb)
{
- block_stmt_iterator bsi;
- tree inner_cond, outer_cond;
+ gimple_stmt_iterator gsi;
+ gimple inner_cond, outer_cond;
tree name1, name2, bit1, bit2;
inner_cond = last_stmt (inner_cond_bb);
if (!inner_cond
- || TREE_CODE (inner_cond) != COND_EXPR)
+ || gimple_code (inner_cond) != GIMPLE_COND)
return false;
outer_cond = last_stmt (outer_cond_bb);
if (!outer_cond
- || TREE_CODE (outer_cond) != COND_EXPR)
+ || gimple_code (outer_cond) != GIMPLE_COND)
return false;
/* See if we test a single bit of the same name in both tests. In
@@ -334,23 +347,23 @@ ifcombine_ifandif (basic_block inner_cond_bb, basic_block outer_cond_bb)
tree t, t2;
/* Do it. */
- bsi = bsi_for_stmt (inner_cond);
+ gsi = gsi_for_stmt (inner_cond);
t = fold_build2 (LSHIFT_EXPR, TREE_TYPE (name1),
build_int_cst (TREE_TYPE (name1), 1), bit1);
t2 = fold_build2 (LSHIFT_EXPR, TREE_TYPE (name1),
build_int_cst (TREE_TYPE (name1), 1), bit2);
t = fold_build2 (BIT_IOR_EXPR, TREE_TYPE (name1), t, t2);
- t = force_gimple_operand_bsi (&bsi, t, true, NULL_TREE,
- true, BSI_SAME_STMT);
+ t = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
+ true, GSI_SAME_STMT);
t2 = fold_build2 (BIT_AND_EXPR, TREE_TYPE (name1), name1, t);
- t2 = force_gimple_operand_bsi (&bsi, t2, true, NULL_TREE,
- true, BSI_SAME_STMT);
- COND_EXPR_COND (inner_cond) = fold_build2 (EQ_EXPR, boolean_type_node,
- t2, t);
+ t2 = force_gimple_operand_gsi (&gsi, t2, true, NULL_TREE,
+ true, GSI_SAME_STMT);
+ t = fold_build2 (EQ_EXPR, boolean_type_node, t2, t);
+ gimple_cond_set_condition_from_tree (inner_cond, t);
update_stmt (inner_cond);
/* Leave CFG optimization to cfg_cleanup. */
- COND_EXPR_COND (outer_cond) = boolean_true_node;
+ gimple_cond_set_condition_from_tree (outer_cond, boolean_true_node);
update_stmt (outer_cond);
if (dump_file)
@@ -378,17 +391,17 @@ ifcombine_ifandif (basic_block inner_cond_bb, basic_block outer_cond_bb)
static bool
ifcombine_iforif (basic_block inner_cond_bb, basic_block outer_cond_bb)
{
- tree inner_cond, outer_cond;
+ gimple inner_cond, outer_cond;
tree name1, name2, bits1, bits2;
inner_cond = last_stmt (inner_cond_bb);
if (!inner_cond
- || TREE_CODE (inner_cond) != COND_EXPR)
+ || gimple_code (inner_cond) != GIMPLE_COND)
return false;
outer_cond = last_stmt (outer_cond_bb);
if (!outer_cond
- || TREE_CODE (outer_cond) != COND_EXPR)
+ || gimple_code (outer_cond) != GIMPLE_COND)
return false;
/* See if we have two bit tests of the same name in both tests.
@@ -397,7 +410,7 @@ ifcombine_iforif (basic_block inner_cond_bb, basic_block outer_cond_bb)
if (recognize_bits_test (inner_cond, &name1, &bits1)
&& recognize_bits_test (outer_cond, &name2, &bits2))
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
tree t;
/* Find the common name which is bit-tested. */
@@ -428,19 +441,20 @@ ifcombine_iforif (basic_block inner_cond_bb, basic_block outer_cond_bb)
return false;
/* Do it. */
- bsi = bsi_for_stmt (inner_cond);
+ gsi = gsi_for_stmt (inner_cond);
t = fold_build2 (BIT_IOR_EXPR, TREE_TYPE (name1), bits1, bits2);
- t = force_gimple_operand_bsi (&bsi, t, true, NULL_TREE,
- true, BSI_SAME_STMT);
+ t = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
+ true, GSI_SAME_STMT);
t = fold_build2 (BIT_AND_EXPR, TREE_TYPE (name1), name1, t);
- t = force_gimple_operand_bsi (&bsi, t, true, NULL_TREE,
- true, BSI_SAME_STMT);
- COND_EXPR_COND (inner_cond) = fold_build2 (NE_EXPR, boolean_type_node, t,
- build_int_cst (TREE_TYPE (t), 0));
+ t = force_gimple_operand_gsi (&gsi, t, true, NULL_TREE,
+ true, GSI_SAME_STMT);
+ t = fold_build2 (NE_EXPR, boolean_type_node, t,
+ build_int_cst (TREE_TYPE (t), 0));
+ gimple_cond_set_condition_from_tree (inner_cond, t);
update_stmt (inner_cond);
/* Leave CFG optimization to cfg_cleanup. */
- COND_EXPR_COND (outer_cond) = boolean_false_node;
+ gimple_cond_set_condition_from_tree (outer_cond, boolean_false_node);
update_stmt (outer_cond);
if (dump_file)
@@ -460,17 +474,15 @@ ifcombine_iforif (basic_block inner_cond_bb, basic_block outer_cond_bb)
/* See if we have two comparisons that we can merge into one.
This happens for C++ operator overloading where for example
GE_EXPR is implemented as GT_EXPR || EQ_EXPR. */
- else if (COMPARISON_CLASS_P (COND_EXPR_COND (inner_cond))
- && COMPARISON_CLASS_P (COND_EXPR_COND (outer_cond))
- && operand_equal_p (TREE_OPERAND (COND_EXPR_COND (inner_cond), 0),
- TREE_OPERAND (COND_EXPR_COND (outer_cond), 0), 0)
- && operand_equal_p (TREE_OPERAND (COND_EXPR_COND (inner_cond), 1),
- TREE_OPERAND (COND_EXPR_COND (outer_cond), 1), 0))
+ else if (TREE_CODE_CLASS (gimple_cond_code (inner_cond)) == tcc_comparison
+ && TREE_CODE_CLASS (gimple_cond_code (outer_cond)) == tcc_comparison
+ && operand_equal_p (gimple_cond_lhs (inner_cond),
+ gimple_cond_lhs (outer_cond), 0)
+ && operand_equal_p (gimple_cond_rhs (inner_cond),
+ gimple_cond_rhs (outer_cond), 0))
{
- tree ccond1 = COND_EXPR_COND (inner_cond);
- tree ccond2 = COND_EXPR_COND (outer_cond);
- enum tree_code code1 = TREE_CODE (ccond1);
- enum tree_code code2 = TREE_CODE (ccond2);
+ enum tree_code code1 = gimple_cond_code (inner_cond);
+ enum tree_code code2 = gimple_cond_code (outer_cond);
enum tree_code code;
tree t;
@@ -487,7 +499,7 @@ ifcombine_iforif (basic_block inner_cond_bb, basic_block outer_cond_bb)
code = LE_EXPR;
else if (CHK (GT, GE))
code = GE_EXPR;
- else if (INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (ccond1, 0)))
+ else if (INTEGRAL_TYPE_P (TREE_TYPE (gimple_cond_lhs (inner_cond)))
|| flag_unsafe_math_optimizations)
{
if (CHK (LT, GT))
@@ -505,16 +517,16 @@ ifcombine_iforif (basic_block inner_cond_bb, basic_block outer_cond_bb)
#undef CHK
/* Do it. */
- t = fold_build2 (code, boolean_type_node,
- TREE_OPERAND (ccond2, 0), TREE_OPERAND (ccond2, 1));
+ t = fold_build2 (code, boolean_type_node, gimple_cond_lhs (outer_cond),
+ gimple_cond_rhs (outer_cond));
t = canonicalize_cond_expr_cond (t);
if (!t)
return false;
- COND_EXPR_COND (inner_cond) = t;
+ gimple_cond_set_condition_from_tree (inner_cond, t);
update_stmt (inner_cond);
/* Leave CFG optimization to cfg_cleanup. */
- COND_EXPR_COND (outer_cond) = boolean_false_node;
+ gimple_cond_set_condition_from_tree (outer_cond, boolean_false_node);
update_stmt (outer_cond);
if (dump_file)
@@ -611,10 +623,10 @@ tree_ssa_ifcombine (void)
for (i = 0; i < n_basic_blocks - NUM_FIXED_BLOCKS; ++i)
{
basic_block bb = bbs[i];
- tree stmt = last_stmt (bb);
+ gimple stmt = last_stmt (bb);
if (stmt
- && TREE_CODE (stmt) == COND_EXPR)
+ && gimple_code (stmt) == GIMPLE_COND)
cfg_changed |= tree_ssa_ifcombine_bb (bb);
}
diff --git a/gcc/tree-ssa-live.c b/gcc/tree-ssa-live.c
index a5f75963da0..fa3834d21c5 100644
--- a/gcc/tree-ssa-live.c
+++ b/gcc/tree-ssa-live.c
@@ -403,8 +403,7 @@ static inline void mark_all_vars_used (tree *, void *data);
/* Helper function for mark_all_vars_used, called via walk_tree. */
static tree
-mark_all_vars_used_1 (tree *tp, int *walk_subtrees,
- void *data)
+mark_all_vars_used_1 (tree *tp, int *walk_subtrees, void *data)
{
tree t = *tp;
enum tree_code_class c = TREE_CODE_CLASS (TREE_CODE (t));
@@ -412,8 +411,8 @@ mark_all_vars_used_1 (tree *tp, int *walk_subtrees,
if (TREE_CODE (t) == SSA_NAME)
t = SSA_NAME_VAR (t);
- if ((IS_EXPR_CODE_CLASS (c)
- || IS_GIMPLE_STMT_CODE_CLASS (c))
+
+ if (IS_EXPR_CODE_CLASS (c)
&& (b = TREE_BLOCK (t)) != NULL)
TREE_USED (b) = true;
@@ -584,6 +583,7 @@ remove_unused_locals (void)
if (optimize)
mark_scope_block_unused (DECL_INITIAL (current_function_decl));
+
/* Assume all locals are unused. */
FOR_EACH_REFERENCED_VAR (t, rvi)
var_ann (t)->used = false;
@@ -591,23 +591,34 @@ remove_unused_locals (void)
/* Walk the CFG marking all referenced symbols. */
FOR_EACH_BB (bb)
{
- block_stmt_iterator bsi;
- tree phi, def;
+ gimple_stmt_iterator gsi;
+ size_t i;
/* Walk the statements. */
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- mark_all_vars_used (bsi_stmt_ptr (bsi), NULL);
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple stmt = gsi_stmt (gsi);
+ tree b = gimple_block (stmt);
+
+ if (b)
+ TREE_USED (b) = true;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (i = 0; i < gimple_num_ops (stmt); i++)
+ mark_all_vars_used (gimple_op_ptr (gsi_stmt (gsi), i), NULL);
+ }
+
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
use_operand_p arg_p;
ssa_op_iter i;
+ tree def;
+ gimple phi = gsi_stmt (gsi);
/* No point processing globals. */
- if (is_global_var (SSA_NAME_VAR (PHI_RESULT (phi))))
+ if (is_global_var (SSA_NAME_VAR (gimple_phi_result (phi))))
continue;
- def = PHI_RESULT (phi);
+ def = gimple_phi_result (phi);
mark_all_vars_used (&def, NULL);
FOR_EACH_PHI_ARG (arg_p, phi, i, SSA_OP_ALL_USES)
@@ -822,7 +833,7 @@ static void
set_var_live_on_entry (tree ssa_name, tree_live_info_p live)
{
int p;
- tree stmt;
+ gimple stmt;
use_operand_p use;
basic_block def_bb = NULL;
imm_use_iterator imm_iter;
@@ -835,7 +846,7 @@ set_var_live_on_entry (tree ssa_name, tree_live_info_p live)
stmt = SSA_NAME_DEF_STMT (ssa_name);
if (stmt)
{
- def_bb = bb_for_stmt (stmt);
+ def_bb = gimple_bb (stmt);
/* Mark defs in liveout bitmap temporarily. */
if (def_bb)
bitmap_set_bit (live->liveout[def_bb->index], p);
@@ -847,16 +858,16 @@ set_var_live_on_entry (tree ssa_name, tree_live_info_p live)
add it to the list of live on entry blocks. */
FOR_EACH_IMM_USE_FAST (use, imm_iter, ssa_name)
{
- tree use_stmt = USE_STMT (use);
+ gimple use_stmt = USE_STMT (use);
basic_block add_block = NULL;
- if (TREE_CODE (use_stmt) == PHI_NODE)
+ if (gimple_code (use_stmt) == GIMPLE_PHI)
{
/* Uses in PHI's are considered to be live at exit of the SRC block
as this is where a copy would be inserted. Check to see if it is
defined in that block, or whether its live on entry. */
int index = PHI_ARG_INDEX_FROM_USE (use);
- edge e = PHI_ARG_EDGE (use_stmt, index);
+ edge e = gimple_phi_arg_edge (use_stmt, index);
if (e->src != ENTRY_BLOCK_PTR)
{
if (e->src != def_bb)
@@ -866,7 +877,7 @@ set_var_live_on_entry (tree ssa_name, tree_live_info_p live)
else
{
/* If its not defined in this block, its live on entry. */
- basic_block use_bb = bb_for_stmt (use_stmt);
+ basic_block use_bb = gimple_bb (use_stmt);
if (use_bb != def_bb)
add_block = use_bb;
}
@@ -891,9 +902,6 @@ set_var_live_on_entry (tree ssa_name, tree_live_info_p live)
void
calculate_live_on_exit (tree_live_info_p liveinfo)
{
- unsigned i;
- int p;
- tree t, phi;
basic_block bb;
edge e;
edge_iterator ei;
@@ -905,20 +913,29 @@ calculate_live_on_exit (tree_live_info_p liveinfo)
/* Set all the live-on-exit bits for uses in PHIs. */
FOR_EACH_BB (bb)
{
+ gimple_stmt_iterator gsi;
+ size_t i;
+
/* Mark the PHI arguments which are live on exit to the pred block. */
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- for (i = 0; i < (unsigned)PHI_NUM_ARGS (phi); i++)
- {
- t = PHI_ARG_DEF (phi, i);
- if (TREE_CODE (t) != SSA_NAME)
- continue;
- p = var_to_partition (liveinfo->map, t);
- if (p == NO_PARTITION)
- continue;
- e = PHI_ARG_EDGE (phi, i);
- if (e->src != ENTRY_BLOCK_PTR)
- bitmap_set_bit (liveinfo->liveout[e->src->index], p);
- }
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple phi = gsi_stmt (gsi);
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
+ {
+ tree t = PHI_ARG_DEF (phi, i);
+ int p;
+
+ if (TREE_CODE (t) != SSA_NAME)
+ continue;
+
+ p = var_to_partition (liveinfo->map, t);
+ if (p == NO_PARTITION)
+ continue;
+ e = gimple_phi_arg_edge (phi, i);
+ if (e->src != ENTRY_BLOCK_PTR)
+ bitmap_set_bit (liveinfo->liveout[e->src->index], p);
+ }
+ }
/* Add each successors live on entry to this bock live on exit. */
FOR_EACH_EDGE (e, ei, bb->succs)
@@ -1067,7 +1084,7 @@ verify_live_on_entry (tree_live_info_p live)
{
unsigned i;
tree var;
- tree phi, stmt;
+ gimple stmt;
basic_block bb;
edge e;
int num;
@@ -1091,13 +1108,13 @@ verify_live_on_entry (tree_live_info_p live)
bitmap loe;
var = partition_to_var (map, i);
stmt = SSA_NAME_DEF_STMT (var);
- tmp = bb_for_stmt (stmt);
+ tmp = gimple_bb (stmt);
d = gimple_default_def (cfun, SSA_NAME_VAR (var));
loe = live_on_entry (live, e->dest);
if (loe && bitmap_bit_p (loe, i))
{
- if (!IS_EMPTY_STMT (stmt))
+ if (!gimple_nop_p (stmt))
{
num++;
print_generic_expr (stderr, var, TDF_SLIM);
@@ -1105,7 +1122,7 @@ verify_live_on_entry (tree_live_info_p live)
if (tmp)
fprintf (stderr, " in BB%d, ", tmp->index);
fprintf (stderr, "by:\n");
- print_generic_expr (stderr, stmt, TDF_SLIM);
+ print_gimple_stmt (stderr, stmt, 0, TDF_SLIM);
fprintf (stderr, "\nIt is also live-on-entry to entry BB %d",
entry_block);
fprintf (stderr, " So it appears to have multiple defs.\n");
@@ -1116,7 +1133,8 @@ verify_live_on_entry (tree_live_info_p live)
{
num++;
print_generic_expr (stderr, var, TDF_SLIM);
- fprintf (stderr, " is live-on-entry to BB%d ",entry_block);
+ fprintf (stderr, " is live-on-entry to BB%d ",
+ entry_block);
if (d)
{
fprintf (stderr, " but is not the default def of ");
@@ -1133,15 +1151,18 @@ verify_live_on_entry (tree_live_info_p live)
{
/* The only way this var shouldn't be marked live on entry is
if it occurs in a PHI argument of the block. */
- int z, ok = 0;
- for (phi = phi_nodes (e->dest);
- phi && !ok;
- phi = PHI_CHAIN (phi))
+ size_t z;
+ bool ok = false;
+ gimple_stmt_iterator gsi;
+ for (gsi = gsi_start_phis (e->dest);
+ !gsi_end_p (gsi) && !ok;
+ gsi_next (&gsi))
{
- for (z = 0; z < PHI_NUM_ARGS (phi); z++)
- if (var == PHI_ARG_DEF (phi, z))
+ gimple phi = gsi_stmt (gsi);
+ for (z = 0; z < gimple_phi_num_args (phi); z++)
+ if (var == gimple_phi_arg_def (phi, z))
{
- ok = 1;
+ ok = true;
break;
}
}
diff --git a/gcc/tree-ssa-live.h b/gcc/tree-ssa-live.h
index 4f021609b2f..de4726245f8 100644
--- a/gcc/tree-ssa-live.h
+++ b/gcc/tree-ssa-live.h
@@ -361,8 +361,8 @@ extern var_map coalesce_ssa_name (void);
/* From tree-ssa-ter.c */
-extern tree *find_replaceable_exprs (var_map);
-extern void dump_replaceable_exprs (FILE *, tree *);
+extern gimple *find_replaceable_exprs (var_map);
+extern void dump_replaceable_exprs (FILE *, gimple *);
#endif /* _TREE_SSA_LIVE_H */
diff --git a/gcc/tree-ssa-loop-ch.c b/gcc/tree-ssa-loop-ch.c
index 47b93f8beeb..33e85c839dc 100644
--- a/gcc/tree-ssa-loop-ch.c
+++ b/gcc/tree-ssa-loop-ch.c
@@ -50,14 +50,21 @@ static bool
should_duplicate_loop_header_p (basic_block header, struct loop *loop,
int *limit)
{
- block_stmt_iterator bsi;
- tree last;
+ gimple_stmt_iterator bsi;
+ gimple last;
/* Do not copy one block more than once (we do not really want to do
loop peeling here). */
if (header->aux)
return false;
+ /* Loop header copying usually increases size of the code. This used not to
+ be true, since quite often it is possible to verify that the condition is
+ satisfied in the first iteration and therefore to eliminate it. Jump
+ threading handles these cases now. */
+ if (optimize_loop_for_size_p (loop))
+ return false;
+
gcc_assert (EDGE_COUNT (header->succs) > 0);
if (single_succ_p (header))
return false;
@@ -71,19 +78,19 @@ should_duplicate_loop_header_p (basic_block header, struct loop *loop,
return false;
last = last_stmt (header);
- if (TREE_CODE (last) != COND_EXPR)
+ if (gimple_code (last) != GIMPLE_COND)
return false;
/* Approximately copy the conditions that used to be used in jump.c --
at most 20 insns and no calls. */
- for (bsi = bsi_start (header); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (bsi = gsi_start_bb (header); !gsi_end_p (bsi); gsi_next (&bsi))
{
- last = bsi_stmt (bsi);
+ last = gsi_stmt (bsi);
- if (TREE_CODE (last) == LABEL_EXPR)
+ if (gimple_code (last) == GIMPLE_LABEL)
continue;
- if (get_call_expr_in (last))
+ if (is_gimple_call (last))
return false;
*limit -= estimate_num_insns (last, &eni_size_weights);
@@ -99,17 +106,17 @@ should_duplicate_loop_header_p (basic_block header, struct loop *loop,
static bool
do_while_loop_p (struct loop *loop)
{
- tree stmt = last_stmt (loop->latch);
+ gimple stmt = last_stmt (loop->latch);
/* If the latch of the loop is not empty, it is not a do-while loop. */
if (stmt
- && TREE_CODE (stmt) != LABEL_EXPR)
+ && gimple_code (stmt) != GIMPLE_LABEL)
return false;
/* If the header contains just a condition, it is not a do-while loop. */
stmt = last_and_only_stmt (loop->header);
if (stmt
- && TREE_CODE (stmt) == COND_EXPR)
+ && gimple_code (stmt) == GIMPLE_COND)
return false;
return true;
@@ -196,7 +203,7 @@ copy_loop_headers (void)
entry = loop_preheader_edge (loop);
- if (!tree_duplicate_sese_region (entry, exit, bbs, n_bbs, copied_bbs))
+ if (!gimple_duplicate_sese_region (entry, exit, bbs, n_bbs, copied_bbs))
{
fprintf (dump_file, "Duplication failed.\n");
continue;
@@ -208,27 +215,27 @@ copy_loop_headers (void)
we assume that "j < j + 10" is true. We don't want to warn
about that case for -Wstrict-overflow, because in general we
don't warn about overflow involving loops. Prevent the
- warning by setting TREE_NO_WARNING. */
+ warning by setting the no_warning flag in the condition. */
if (warn_strict_overflow > 0)
{
unsigned int i;
for (i = 0; i < n_bbs; ++i)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
- for (bsi = bsi_start (copied_bbs[i]);
- !bsi_end_p (bsi);
- bsi_next (&bsi))
+ for (bsi = gsi_start_bb (copied_bbs[i]);
+ !gsi_end_p (bsi);
+ gsi_next (&bsi))
{
- tree stmt = bsi_stmt (bsi);
- if (TREE_CODE (stmt) == COND_EXPR)
- TREE_NO_WARNING (stmt) = 1;
- else if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ gimple stmt = gsi_stmt (bsi);
+ if (gimple_code (stmt) == GIMPLE_COND)
+ gimple_set_no_warning (stmt, true);
+ else if (is_gimple_assign (stmt))
{
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- if (COMPARISON_CLASS_P (rhs))
- TREE_NO_WARNING (stmt) = 1;
+ enum tree_code rhs_code = gimple_assign_rhs_code (stmt);
+ if (TREE_CODE_CLASS (rhs_code) == tcc_comparison)
+ gimple_set_no_warning (stmt, true);
}
}
}
diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c
index 899eb8ab1a9..527b810e335 100644
--- a/gcc/tree-ssa-loop-im.c
+++ b/gcc/tree-ssa-loop-im.c
@@ -70,7 +70,7 @@ along with GCC; see the file COPYING3. If not see
struct depend
{
- tree stmt;
+ gimple stmt;
struct depend *next;
};
@@ -99,16 +99,16 @@ struct lim_aux_data
MAX_LOOP loop. */
};
-#define LIM_DATA(STMT) (TREE_CODE (STMT) == PHI_NODE \
- ? NULL \
- : (struct lim_aux_data *) (stmt_ann (STMT)->common.aux))
+/* Maps statements to their lim_aux_data. */
+
+static struct pointer_map_t *lim_aux_data_map;
/* Description of a memory reference location. */
typedef struct mem_ref_loc
{
tree *ref; /* The reference itself. */
- tree stmt; /* The statement in that it occurs. */
+ gimple stmt; /* The statement in that it occurs. */
} *mem_ref_loc_p;
DEF_VEC_P(mem_ref_loc_p);
@@ -203,6 +203,51 @@ static bool ref_indep_loop_p (struct loop *, mem_ref_p);
block will be executed. */
#define ALWAYS_EXECUTED_IN(BB) ((struct loop *) (BB)->aux)
+static struct lim_aux_data *
+init_lim_data (gimple stmt)
+{
+ void **p = pointer_map_insert (lim_aux_data_map, stmt);
+
+ *p = XCNEW (struct lim_aux_data);
+ return (struct lim_aux_data *) *p;
+}
+
+static struct lim_aux_data *
+get_lim_data (gimple stmt)
+{
+ void **p = pointer_map_contains (lim_aux_data_map, stmt);
+ if (!p)
+ return NULL;
+
+ return (struct lim_aux_data *) *p;
+}
+
+/* Releases the memory occupied by DATA. */
+
+static void
+free_lim_aux_data (struct lim_aux_data *data)
+{
+ struct depend *dep, *next;
+
+ for (dep = data->depends; dep; dep = next)
+ {
+ next = dep->next;
+ free (dep);
+ }
+ free (data);
+}
+
+static void
+clear_lim_data (gimple stmt)
+{
+ void **p = pointer_map_contains (lim_aux_data_map, stmt);
+ if (!p)
+ return;
+
+ free_lim_aux_data ((struct lim_aux_data *) *p);
+ *p = NULL;
+}
+
/* Calls CBCK for each index in memory reference ADDR_P. There are two
kinds situations handled; in each of these cases, the memory reference
and DATA are passed to the callback:
@@ -301,46 +346,32 @@ for_each_index (tree *addr_p, bool (*cbck) (tree, tree *, void *), void *data)
Otherwise return MOVE_IMPOSSIBLE. */
enum move_pos
-movement_possibility (tree stmt)
+movement_possibility (gimple stmt)
{
- tree lhs, rhs;
+ tree lhs;
+ enum move_pos ret = MOVE_POSSIBLE;
if (flag_unswitch_loops
- && TREE_CODE (stmt) == COND_EXPR)
+ && gimple_code (stmt) == GIMPLE_COND)
{
/* If we perform unswitching, force the operands of the invariant
condition to be moved out of the loop. */
return MOVE_POSSIBLE;
}
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (gimple_get_lhs (stmt) == NULL_TREE)
return MOVE_IMPOSSIBLE;
if (!ZERO_SSA_OPERANDS (stmt, SSA_OP_VIRTUAL_DEFS))
return MOVE_IMPOSSIBLE;
- if (stmt_ends_bb_p (stmt))
- return MOVE_IMPOSSIBLE;
-
- if (stmt_ann (stmt)->has_volatile_ops)
- return MOVE_IMPOSSIBLE;
-
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- if (TREE_CODE (lhs) == SSA_NAME
- && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
+ if (stmt_ends_bb_p (stmt)
+ || gimple_has_volatile_ops (stmt)
+ || gimple_has_side_effects (stmt)
+ || stmt_could_throw_p (stmt))
return MOVE_IMPOSSIBLE;
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
-
- if (TREE_SIDE_EFFECTS (rhs)
- || tree_could_throw_p (rhs))
- return MOVE_IMPOSSIBLE;
-
- if (TREE_CODE (lhs) != SSA_NAME
- || tree_could_trap_p (rhs))
- return MOVE_PRESERVE_EXECUTION;
-
- if (get_call_expr_in (stmt))
+ if (is_gimple_call (stmt))
{
/* While pure or const call is guaranteed to have no side effects, we
cannot move it arbitrarily. Consider code like
@@ -360,9 +391,23 @@ movement_possibility (tree stmt)
invalid arguments, moving out a function call that is not executed
may cause performance regressions in case the call is costly and
not executed at all. */
- return MOVE_PRESERVE_EXECUTION;
+ ret = MOVE_PRESERVE_EXECUTION;
+ lhs = gimple_call_lhs (stmt);
}
- return MOVE_POSSIBLE;
+ else if (is_gimple_assign (stmt))
+ lhs = gimple_assign_lhs (stmt);
+ else
+ return MOVE_IMPOSSIBLE;
+
+ if (TREE_CODE (lhs) == SSA_NAME
+ && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
+ return MOVE_IMPOSSIBLE;
+
+ if (TREE_CODE (lhs) != SSA_NAME
+ || gimple_could_trap_p (stmt))
+ return MOVE_PRESERVE_EXECUTION;
+
+ return ret;
}
/* Suppose that operand DEF is used inside the LOOP. Returns the outermost
@@ -373,23 +418,31 @@ movement_possibility (tree stmt)
static struct loop *
outermost_invariant_loop (tree def, struct loop *loop)
{
- tree def_stmt;
+ gimple def_stmt;
basic_block def_bb;
struct loop *max_loop;
+ struct lim_aux_data *lim_data;
- if (TREE_CODE (def) != SSA_NAME)
+ if (!def)
return superloop_at_depth (loop, 1);
+ if (TREE_CODE (def) != SSA_NAME)
+ {
+ gcc_assert (is_gimple_min_invariant (def));
+ return superloop_at_depth (loop, 1);
+ }
+
def_stmt = SSA_NAME_DEF_STMT (def);
- def_bb = bb_for_stmt (def_stmt);
+ def_bb = gimple_bb (def_stmt);
if (!def_bb)
return superloop_at_depth (loop, 1);
max_loop = find_common_loop (loop, def_bb->loop_father);
- if (LIM_DATA (def_stmt) && LIM_DATA (def_stmt)->max_loop)
+ lim_data = get_lim_data (def_stmt);
+ if (lim_data != NULL && lim_data->max_loop != NULL)
max_loop = find_common_loop (max_loop,
- loop_outer (LIM_DATA (def_stmt)->max_loop));
+ loop_outer (lim_data->max_loop));
if (max_loop == loop)
return NULL;
max_loop = superloop_at_depth (loop, loop_depth (max_loop) + 1);
@@ -397,42 +450,6 @@ outermost_invariant_loop (tree def, struct loop *loop)
return max_loop;
}
-/* Returns the outermost superloop of LOOP in that the expression EXPR is
- invariant. */
-
-static struct loop *
-outermost_invariant_loop_expr (tree expr, struct loop *loop)
-{
- enum tree_code_class codeclass = TREE_CODE_CLASS (TREE_CODE (expr));
- unsigned i, nops;
- struct loop *max_loop = superloop_at_depth (loop, 1), *aloop;
-
- if (TREE_CODE (expr) == SSA_NAME
- || TREE_CODE (expr) == INTEGER_CST
- || is_gimple_min_invariant (expr))
- return outermost_invariant_loop (expr, loop);
-
- if (codeclass != tcc_unary
- && codeclass != tcc_binary
- && codeclass != tcc_expression
- && codeclass != tcc_vl_exp
- && codeclass != tcc_comparison)
- return NULL;
-
- nops = TREE_OPERAND_LENGTH (expr);
- for (i = 0; i < nops; i++)
- {
- aloop = outermost_invariant_loop_expr (TREE_OPERAND (expr, i), loop);
- if (!aloop)
- return NULL;
-
- if (flow_loop_nested_p (max_loop, aloop))
- max_loop = aloop;
- }
-
- return max_loop;
-}
-
/* DATA is a structure containing information associated with a statement
inside LOOP. DEF is one of the operands of this statement.
@@ -449,10 +466,11 @@ static bool
add_dependency (tree def, struct lim_aux_data *data, struct loop *loop,
bool add_cost)
{
- tree def_stmt = SSA_NAME_DEF_STMT (def);
- basic_block def_bb = bb_for_stmt (def_stmt);
+ gimple def_stmt = SSA_NAME_DEF_STMT (def);
+ basic_block def_bb = gimple_bb (def_stmt);
struct loop *max_loop;
struct depend *dep;
+ struct lim_aux_data *def_data;
if (!def_bb)
return true;
@@ -464,7 +482,8 @@ add_dependency (tree def, struct lim_aux_data *data, struct loop *loop,
if (flow_loop_nested_p (data->max_loop, max_loop))
data->max_loop = max_loop;
- if (!LIM_DATA (def_stmt))
+ def_data = get_lim_data (def_stmt);
+ if (!def_data)
return true;
if (add_cost
@@ -473,7 +492,7 @@ add_dependency (tree def, struct lim_aux_data *data, struct loop *loop,
on it, we will be able to avoid creating a new register for
it (since it will be only used in these dependent invariants). */
&& def_bb->loop_father == loop)
- data->cost += LIM_DATA (def_stmt)->cost;
+ data->cost += def_data->cost;
dep = XNEW (struct depend);
dep->stmt = def_stmt;
@@ -488,36 +507,39 @@ add_dependency (tree def, struct lim_aux_data *data, struct loop *loop,
values. */
static unsigned
-stmt_cost (tree stmt)
+stmt_cost (gimple stmt)
{
- tree rhs;
+ tree fndecl;
unsigned cost = 1;
/* Always try to create possibilities for unswitching. */
- if (TREE_CODE (stmt) == COND_EXPR)
+ if (gimple_code (stmt) == GIMPLE_COND)
return LIM_EXPENSIVE;
- rhs = GENERIC_TREE_OPERAND (stmt, 1);
-
/* Hoisting memory references out should almost surely be a win. */
- if (stmt_references_memory_p (stmt))
+ if (gimple_references_memory_p (stmt))
cost += 20;
- switch (TREE_CODE (rhs))
+ if (is_gimple_call (stmt))
{
- case CALL_EXPR:
/* We should be hoisting calls if possible. */
/* Unless the call is a builtin_constant_p; this always folds to a
constant, so moving it is useless. */
- rhs = get_callee_fndecl (rhs);
- if (DECL_BUILT_IN_CLASS (rhs) == BUILT_IN_NORMAL
- && DECL_FUNCTION_CODE (rhs) == BUILT_IN_CONSTANT_P)
+ fndecl = gimple_call_fndecl (stmt);
+ if (fndecl
+ && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
+ && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_CONSTANT_P)
return 0;
- cost += 20;
- break;
+ return cost + 20;
+ }
+
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
+ return cost;
+ switch (gimple_assign_rhs_code (stmt))
+ {
case MULT_EXPR:
case TRUNC_DIV_EXPR:
case CEIL_DIV_EXPR:
@@ -575,27 +597,31 @@ outermost_indep_loop (struct loop *outer, struct loop *loop, mem_ref_p ref)
it is a store or load. Otherwise, returns NULL. */
static tree *
-simple_mem_ref_in_stmt (tree stmt, bool *is_store)
+simple_mem_ref_in_stmt (gimple stmt, bool *is_store)
{
- tree *lhs, *rhs;
+ tree *lhs;
+ enum tree_code code;
/* Recognize MEM = (SSA_NAME | invariant) and SSA_NAME = MEM patterns. */
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
return NULL;
- lhs = &GIMPLE_STMT_OPERAND (stmt, 0);
- rhs = &GIMPLE_STMT_OPERAND (stmt, 1);
+ code = gimple_assign_rhs_code (stmt);
+
+ lhs = gimple_assign_lhs_ptr (stmt);
if (TREE_CODE (*lhs) == SSA_NAME)
{
- if (!is_gimple_addressable (*rhs))
+ if (get_gimple_rhs_class (code) != GIMPLE_SINGLE_RHS
+ || !is_gimple_addressable (gimple_assign_rhs1 (stmt)))
return NULL;
*is_store = false;
- return rhs;
+ return gimple_assign_rhs1_ptr (stmt);
}
- else if (TREE_CODE (*rhs) == SSA_NAME
- || is_gimple_min_invariant (*rhs))
+ else if (code == SSA_NAME
+ || (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS
+ && is_gimple_min_invariant (gimple_assign_rhs1 (stmt))))
{
*is_store = true;
return lhs;
@@ -607,7 +633,7 @@ simple_mem_ref_in_stmt (tree stmt, bool *is_store)
/* Returns the memory reference contained in STMT. */
static mem_ref_p
-mem_ref_in_stmt (tree stmt)
+mem_ref_in_stmt (gimple stmt)
{
bool store;
tree *mem = simple_mem_ref_in_stmt (stmt, &store);
@@ -636,12 +662,12 @@ mem_ref_in_stmt (tree stmt)
is defined in, and true otherwise. */
static bool
-determine_max_movement (tree stmt, bool must_preserve_exec)
+determine_max_movement (gimple stmt, bool must_preserve_exec)
{
- basic_block bb = bb_for_stmt (stmt);
+ basic_block bb = gimple_bb (stmt);
struct loop *loop = bb->loop_father;
struct loop *level;
- struct lim_aux_data *lim_data = LIM_DATA (stmt);
+ struct lim_aux_data *lim_data = get_lim_data (stmt);
tree val;
ssa_op_iter iter;
@@ -687,24 +713,25 @@ determine_max_movement (tree stmt, bool must_preserve_exec)
operands) is hoisted at least out of the loop LEVEL. */
static void
-set_level (tree stmt, struct loop *orig_loop, struct loop *level)
+set_level (gimple stmt, struct loop *orig_loop, struct loop *level)
{
- struct loop *stmt_loop = bb_for_stmt (stmt)->loop_father;
+ struct loop *stmt_loop = gimple_bb (stmt)->loop_father;
struct depend *dep;
+ struct lim_aux_data *lim_data;
stmt_loop = find_common_loop (orig_loop, stmt_loop);
- if (LIM_DATA (stmt) && LIM_DATA (stmt)->tgt_loop)
+ lim_data = get_lim_data (stmt);
+ if (lim_data != NULL && lim_data->tgt_loop != NULL)
stmt_loop = find_common_loop (stmt_loop,
- loop_outer (LIM_DATA (stmt)->tgt_loop));
+ loop_outer (lim_data->tgt_loop));
if (flow_loop_nested_p (stmt_loop, level))
return;
- gcc_assert (LIM_DATA (stmt));
- gcc_assert (level == LIM_DATA (stmt)->max_loop
- || flow_loop_nested_p (LIM_DATA (stmt)->max_loop, level));
+ gcc_assert (level == lim_data->max_loop
+ || flow_loop_nested_p (lim_data->max_loop, level));
- LIM_DATA (stmt)->tgt_loop = level;
- for (dep = LIM_DATA (stmt)->depends; dep; dep = dep->next)
+ lim_data->tgt_loop = level;
+ for (dep = lim_data->depends; dep; dep = dep->next)
set_level (dep->stmt, orig_loop, level);
}
@@ -713,70 +740,50 @@ set_level (tree stmt, struct loop *orig_loop, struct loop *level)
information to set it more sanely. */
static void
-set_profitable_level (tree stmt)
+set_profitable_level (gimple stmt)
{
- set_level (stmt, bb_for_stmt (stmt)->loop_father, LIM_DATA (stmt)->max_loop);
+ set_level (stmt, gimple_bb (stmt)->loop_father, get_lim_data (stmt)->max_loop);
}
-/* Returns true if STMT is not a pure call. */
+/* Returns true if STMT is a call that has side effects. */
static bool
-nonpure_call_p (tree stmt)
+nonpure_call_p (gimple stmt)
{
- tree call = get_call_expr_in (stmt);
-
- if (!call)
+ if (gimple_code (stmt) != GIMPLE_CALL)
return false;
- return TREE_SIDE_EFFECTS (call) != 0;
-}
-
-/* Releases the memory occupied by DATA. */
-
-static void
-free_lim_aux_data (struct lim_aux_data *data)
-{
- struct depend *dep, *next;
-
- for (dep = data->depends; dep; dep = next)
- {
- next = dep->next;
- free (dep);
- }
- free (data);
+ return gimple_has_side_effects (stmt);
}
/* Rewrite a/b to a*(1/b). Return the invariant stmt to process. */
-static tree
-rewrite_reciprocal (block_stmt_iterator *bsi)
+static gimple
+rewrite_reciprocal (gimple_stmt_iterator *bsi)
{
- tree stmt, lhs, rhs, stmt1, stmt2, var, name, tmp;
+ gimple stmt, stmt1, stmt2;
+ tree var, name, lhs, type;
- stmt = bsi_stmt (*bsi);
- lhs = GENERIC_TREE_OPERAND (stmt, 0);
- rhs = GENERIC_TREE_OPERAND (stmt, 1);
+ stmt = gsi_stmt (*bsi);
+ lhs = gimple_assign_lhs (stmt);
+ type = TREE_TYPE (lhs);
- /* stmt must be GIMPLE_MODIFY_STMT. */
- var = create_tmp_var (TREE_TYPE (rhs), "reciptmp");
+ var = create_tmp_var (type, "reciptmp");
add_referenced_var (var);
- tmp = build2 (RDIV_EXPR, TREE_TYPE (rhs),
- build_real (TREE_TYPE (rhs), dconst1),
- TREE_OPERAND (rhs, 1));
- stmt1 = build_gimple_modify_stmt (var, tmp);
+ stmt1 = gimple_build_assign_with_ops (RDIV_EXPR,
+ var, build_real (type, dconst1), gimple_assign_rhs2 (stmt));
name = make_ssa_name (var, stmt1);
- GIMPLE_STMT_OPERAND (stmt1, 0) = name;
- tmp = build2 (MULT_EXPR, TREE_TYPE (rhs),
- name, TREE_OPERAND (rhs, 0));
- stmt2 = build_gimple_modify_stmt (lhs, tmp);
+ gimple_assign_set_lhs (stmt1, name);
+
+ stmt2 = gimple_build_assign_with_ops (MULT_EXPR, lhs, name,
+ gimple_assign_rhs1 (stmt));
/* Replace division stmt with reciprocal and multiply stmts.
The multiply stmt is not invariant, so update iterator
and avoid rescanning. */
- bsi_replace (bsi, stmt1, true);
- bsi_insert_after (bsi, stmt2, BSI_NEW_STMT);
- SSA_NAME_DEF_STMT (lhs) = stmt2;
+ gsi_replace (bsi, stmt1, true);
+ gsi_insert_after (bsi, stmt2, GSI_NEW_STMT);
/* Continue processing with invariant reciprocal statement. */
return stmt1;
@@ -785,82 +792,78 @@ rewrite_reciprocal (block_stmt_iterator *bsi)
/* Check if the pattern at *BSI is a bittest of the form
(A >> B) & 1 != 0 and in this case rewrite it to A & (1 << B) != 0. */
-static tree
-rewrite_bittest (block_stmt_iterator *bsi)
+static gimple
+rewrite_bittest (gimple_stmt_iterator *bsi)
{
- tree stmt, lhs, rhs, var, name, use_stmt, stmt1, stmt2, t;
+ gimple stmt, use_stmt, stmt1, stmt2;
+ tree lhs, var, name, t, a, b;
use_operand_p use;
- stmt = bsi_stmt (*bsi);
- lhs = GENERIC_TREE_OPERAND (stmt, 0);
- rhs = GENERIC_TREE_OPERAND (stmt, 1);
+ stmt = gsi_stmt (*bsi);
+ lhs = gimple_assign_lhs (stmt);
/* Verify that the single use of lhs is a comparison against zero. */
if (TREE_CODE (lhs) != SSA_NAME
|| !single_imm_use (lhs, &use, &use_stmt)
- || TREE_CODE (use_stmt) != COND_EXPR)
+ || gimple_code (use_stmt) != GIMPLE_COND)
return stmt;
- t = COND_EXPR_COND (use_stmt);
- if (TREE_OPERAND (t, 0) != lhs
- || (TREE_CODE (t) != NE_EXPR
- && TREE_CODE (t) != EQ_EXPR)
- || !integer_zerop (TREE_OPERAND (t, 1)))
+ if (gimple_cond_lhs (use_stmt) != lhs
+ || (gimple_cond_code (use_stmt) != NE_EXPR
+ && gimple_cond_code (use_stmt) != EQ_EXPR)
+ || !integer_zerop (gimple_cond_rhs (use_stmt)))
return stmt;
/* Get at the operands of the shift. The rhs is TMP1 & 1. */
- stmt1 = SSA_NAME_DEF_STMT (TREE_OPERAND (rhs, 0));
- if (TREE_CODE (stmt1) != GIMPLE_MODIFY_STMT)
+ stmt1 = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmt));
+ if (gimple_code (stmt1) != GIMPLE_ASSIGN)
return stmt;
/* There is a conversion in between possibly inserted by fold. */
- t = GIMPLE_STMT_OPERAND (stmt1, 1);
- if (CONVERT_EXPR_P (t))
+ if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (stmt1)))
{
- t = TREE_OPERAND (t, 0);
+ t = gimple_assign_rhs1 (stmt1);
if (TREE_CODE (t) != SSA_NAME
|| !has_single_use (t))
return stmt;
stmt1 = SSA_NAME_DEF_STMT (t);
- if (TREE_CODE (stmt1) != GIMPLE_MODIFY_STMT)
+ if (gimple_code (stmt1) != GIMPLE_ASSIGN)
return stmt;
- t = GIMPLE_STMT_OPERAND (stmt1, 1);
}
/* Verify that B is loop invariant but A is not. Verify that with
all the stmt walking we are still in the same loop. */
- if (TREE_CODE (t) == RSHIFT_EXPR
- && loop_containing_stmt (stmt1) == loop_containing_stmt (stmt)
- && outermost_invariant_loop_expr (TREE_OPERAND (t, 1),
- loop_containing_stmt (stmt1)) != NULL
- && outermost_invariant_loop_expr (TREE_OPERAND (t, 0),
- loop_containing_stmt (stmt1)) == NULL)
- {
- tree a = TREE_OPERAND (t, 0);
- tree b = TREE_OPERAND (t, 1);
+ if (gimple_assign_rhs_code (stmt1) != RSHIFT_EXPR
+ || loop_containing_stmt (stmt1) != loop_containing_stmt (stmt))
+ return stmt;
+ a = gimple_assign_rhs1 (stmt1);
+ b = gimple_assign_rhs2 (stmt1);
+
+ if (outermost_invariant_loop (b, loop_containing_stmt (stmt1)) != NULL
+ && outermost_invariant_loop (a, loop_containing_stmt (stmt1)) == NULL)
+ {
/* 1 << B */
var = create_tmp_var (TREE_TYPE (a), "shifttmp");
add_referenced_var (var);
t = fold_build2 (LSHIFT_EXPR, TREE_TYPE (a),
build_int_cst (TREE_TYPE (a), 1), b);
- stmt1 = build_gimple_modify_stmt (var, t);
+ stmt1 = gimple_build_assign (var, t);
name = make_ssa_name (var, stmt1);
- GIMPLE_STMT_OPERAND (stmt1, 0) = name;
+ gimple_assign_set_lhs (stmt1, name);
/* A & (1 << B) */
t = fold_build2 (BIT_AND_EXPR, TREE_TYPE (a), a, name);
- stmt2 = build_gimple_modify_stmt (var, t);
+ stmt2 = gimple_build_assign (var, t);
name = make_ssa_name (var, stmt2);
- GIMPLE_STMT_OPERAND (stmt2, 0) = name;
+ gimple_assign_set_lhs (stmt2, name);
/* Replace the SSA_NAME we compare against zero. Adjust
the type of zero accordingly. */
SET_USE (use, name);
- TREE_OPERAND (COND_EXPR_COND (use_stmt), 1)
- = build_int_cst_type (TREE_TYPE (name), 0);
+ gimple_cond_set_rhs (use_stmt, build_int_cst_type (TREE_TYPE (name), 0));
- bsi_insert_before (bsi, stmt1, BSI_SAME_STMT);
- bsi_replace (bsi, stmt2, true);
+ gsi_insert_before (bsi, stmt1, GSI_SAME_STMT);
+ gsi_replace (bsi, stmt2, true);
return stmt1;
}
@@ -878,10 +881,11 @@ determine_invariantness_stmt (struct dom_walk_data *dw_data ATTRIBUTE_UNUSED,
basic_block bb)
{
enum move_pos pos;
- block_stmt_iterator bsi;
- tree stmt, rhs;
+ gimple_stmt_iterator bsi;
+ gimple stmt;
bool maybe_never = ALWAYS_EXECUTED_IN (bb) == NULL;
struct loop *outermost = ALWAYS_EXECUTED_IN (bb);
+ struct lim_aux_data *lim_data;
if (!loop_outer (bb->loop_father))
return;
@@ -890,9 +894,9 @@ determine_invariantness_stmt (struct dom_walk_data *dw_data ATTRIBUTE_UNUSED,
fprintf (dump_file, "Basic block %d (loop %d -- depth %d):\n\n",
bb->index, bb->loop_father->num, loop_depth (bb->loop_father));
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
{
- stmt = bsi_stmt (bsi);
+ stmt = gsi_stmt (bsi);
pos = movement_possibility (stmt);
if (pos == MOVE_IMPOSSIBLE)
@@ -906,61 +910,63 @@ determine_invariantness_stmt (struct dom_walk_data *dw_data ATTRIBUTE_UNUSED,
store-motion work. */
else if (stmt_makes_single_store (stmt))
{
- stmt_ann (stmt)->common.aux
- = xcalloc (1, sizeof (struct lim_aux_data));
- LIM_DATA (stmt)->always_executed_in = outermost;
+ struct lim_aux_data *lim_data = init_lim_data (stmt);
+ lim_data->always_executed_in = outermost;
}
continue;
}
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_assign (stmt)
+ && (get_gimple_rhs_class (gimple_assign_rhs_code (stmt))
+ == GIMPLE_BINARY_RHS))
{
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ tree op0 = gimple_assign_rhs1 (stmt);
+ tree op1 = gimple_assign_rhs2 (stmt);
+ struct loop *ol1 = outermost_invariant_loop (op1,
+ loop_containing_stmt (stmt));
/* If divisor is invariant, convert a/b to a*(1/b), allowing reciprocal
to be hoisted out of loop, saving expensive divide. */
if (pos == MOVE_POSSIBLE
- && TREE_CODE (rhs) == RDIV_EXPR
+ && gimple_assign_rhs_code (stmt) == RDIV_EXPR
&& flag_unsafe_math_optimizations
&& !flag_trapping_math
- && outermost_invariant_loop_expr (TREE_OPERAND (rhs, 1),
- loop_containing_stmt (stmt)) != NULL
- && outermost_invariant_loop_expr (rhs,
- loop_containing_stmt (stmt)) == NULL)
+ && ol1 != NULL
+ && outermost_invariant_loop (op0, ol1) == NULL)
stmt = rewrite_reciprocal (&bsi);
/* If the shift count is invariant, convert (A >> B) & 1 to
A & (1 << B) allowing the bit mask to be hoisted out of the loop
saving an expensive shift. */
if (pos == MOVE_POSSIBLE
- && TREE_CODE (rhs) == BIT_AND_EXPR
- && integer_onep (TREE_OPERAND (rhs, 1))
- && TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME
- && has_single_use (TREE_OPERAND (rhs, 0)))
+ && gimple_assign_rhs_code (stmt) == BIT_AND_EXPR
+ && integer_onep (op1)
+ && TREE_CODE (op0) == SSA_NAME
+ && has_single_use (op0))
stmt = rewrite_bittest (&bsi);
}
- stmt_ann (stmt)->common.aux = xcalloc (1, sizeof (struct lim_aux_data));
- LIM_DATA (stmt)->always_executed_in = outermost;
+ lim_data = init_lim_data (stmt);
+ lim_data->always_executed_in = outermost;
if (maybe_never && pos == MOVE_PRESERVE_EXECUTION)
continue;
if (!determine_max_movement (stmt, pos == MOVE_PRESERVE_EXECUTION))
{
- LIM_DATA (stmt)->max_loop = NULL;
+ lim_data->max_loop = NULL;
continue;
}
if (dump_file && (dump_flags & TDF_DETAILS))
{
- print_generic_stmt_indented (dump_file, stmt, 0, 2);
+ print_gimple_stmt (dump_file, stmt, 2, 0);
fprintf (dump_file, " invariant up to level %d, cost %d.\n\n",
- loop_depth (LIM_DATA (stmt)->max_loop),
- LIM_DATA (stmt)->cost);
+ loop_depth (lim_data->max_loop),
+ lim_data->cost);
}
- if (LIM_DATA (stmt)->cost >= LIM_EXPENSIVE)
+ if (lim_data->cost >= LIM_EXPENSIVE)
set_profitable_level (stmt);
}
}
@@ -993,50 +999,51 @@ move_computations_stmt (struct dom_walk_data *dw_data ATTRIBUTE_UNUSED,
basic_block bb)
{
struct loop *level;
- block_stmt_iterator bsi;
- tree stmt;
+ gimple_stmt_iterator bsi;
+ gimple stmt;
unsigned cost = 0;
+ struct lim_aux_data *lim_data;
if (!loop_outer (bb->loop_father))
return;
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); )
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); )
{
- stmt = bsi_stmt (bsi);
+ stmt = gsi_stmt (bsi);
- if (!LIM_DATA (stmt))
+ lim_data = get_lim_data (stmt);
+ if (lim_data == NULL)
{
- bsi_next (&bsi);
+ gsi_next (&bsi);
continue;
}
- cost = LIM_DATA (stmt)->cost;
- level = LIM_DATA (stmt)->tgt_loop;
- free_lim_aux_data (LIM_DATA (stmt));
- stmt_ann (stmt)->common.aux = NULL;
+ cost = lim_data->cost;
+ level = lim_data->tgt_loop;
+ clear_lim_data (stmt);
if (!level)
{
- bsi_next (&bsi);
+ gsi_next (&bsi);
continue;
}
/* We do not really want to move conditionals out of the loop; we just
placed it here to force its operands to be moved if necessary. */
- if (TREE_CODE (stmt) == COND_EXPR)
+ if (gimple_code (stmt) == GIMPLE_COND)
continue;
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Moving statement\n");
- print_generic_stmt (dump_file, stmt, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
fprintf (dump_file, "(cost %u) out of loop %d.\n\n",
cost, level->num);
}
mark_virtual_ops_for_renaming (stmt);
- bsi_insert_on_edge (loop_preheader_edge (level), stmt);
- bsi_remove (&bsi, false);
+ gsi_insert_on_edge (loop_preheader_edge (level), stmt);
+ gsi_remove (&bsi, false);
}
}
@@ -1056,7 +1063,7 @@ move_computations (void)
walk_dominator_tree (&walk_data, ENTRY_BLOCK_PTR);
fini_walk_dominator_tree (&walk_data);
- bsi_commit_edge_inserts ();
+ gsi_commit_edge_inserts ();
if (need_ssa_update_p ())
rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa);
}
@@ -1067,20 +1074,20 @@ move_computations (void)
static bool
may_move_till (tree ref, tree *index, void *data)
{
- struct loop *loop = (struct loop*) data, *max_loop;
+ struct loop *loop = (struct loop *) data, *max_loop;
/* If REF is an array reference, check also that the step and the lower
bound is invariant in LOOP. */
if (TREE_CODE (ref) == ARRAY_REF)
{
- tree step = array_ref_element_size (ref);
- tree lbound = array_ref_low_bound (ref);
+ tree step = TREE_OPERAND (ref, 3);
+ tree lbound = TREE_OPERAND (ref, 2);
- max_loop = outermost_invariant_loop_expr (step, loop);
+ max_loop = outermost_invariant_loop (step, loop);
if (!max_loop)
return false;
- max_loop = outermost_invariant_loop_expr (lbound, loop);
+ max_loop = outermost_invariant_loop (lbound, loop);
if (!max_loop)
return false;
}
@@ -1092,35 +1099,25 @@ may_move_till (tree ref, tree *index, void *data)
return true;
}
-/* Forces statements defining (invariant) SSA names in expression EXPR to be
+/* If OP is SSA NAME, force the statement that defines it to be
moved out of the LOOP. ORIG_LOOP is the loop in that EXPR is used. */
static void
-force_move_till_expr (tree expr, struct loop *orig_loop, struct loop *loop)
+force_move_till_op (tree op, struct loop *orig_loop, struct loop *loop)
{
- enum tree_code_class codeclass = TREE_CODE_CLASS (TREE_CODE (expr));
- unsigned i, nops;
-
- if (TREE_CODE (expr) == SSA_NAME)
- {
- tree stmt = SSA_NAME_DEF_STMT (expr);
- if (IS_EMPTY_STMT (stmt))
- return;
+ gimple stmt;
- set_level (stmt, orig_loop, loop);
- return;
- }
+ if (!op
+ || is_gimple_min_invariant (op))
+ return;
- if (codeclass != tcc_unary
- && codeclass != tcc_binary
- && codeclass != tcc_expression
- && codeclass != tcc_vl_exp
- && codeclass != tcc_comparison)
+ gcc_assert (TREE_CODE (op) == SSA_NAME);
+
+ stmt = SSA_NAME_DEF_STMT (op);
+ if (gimple_nop_p (stmt))
return;
- nops = TREE_OPERAND_LENGTH (expr);
- for (i = 0; i < nops; i++)
- force_move_till_expr (TREE_OPERAND (expr, i), orig_loop, loop);
+ set_level (stmt, orig_loop, loop);
}
/* Forces statement defining invariants in REF (and *INDEX) to be moved out of
@@ -1136,26 +1133,18 @@ struct fmt_data
static bool
force_move_till (tree ref, tree *index, void *data)
{
- tree stmt;
struct fmt_data *fmt_data = (struct fmt_data *) data;
if (TREE_CODE (ref) == ARRAY_REF)
{
- tree step = array_ref_element_size (ref);
- tree lbound = array_ref_low_bound (ref);
+ tree step = TREE_OPERAND (ref, 3);
+ tree lbound = TREE_OPERAND (ref, 2);
- force_move_till_expr (step, fmt_data->orig_loop, fmt_data->loop);
- force_move_till_expr (lbound, fmt_data->orig_loop, fmt_data->loop);
+ force_move_till_op (step, fmt_data->orig_loop, fmt_data->loop);
+ force_move_till_op (lbound, fmt_data->orig_loop, fmt_data->loop);
}
- if (TREE_CODE (*index) != SSA_NAME)
- return true;
-
- stmt = SSA_NAME_DEF_STMT (*index);
- if (IS_EMPTY_STMT (stmt))
- return true;
-
- set_level (stmt, fmt_data->orig_loop, fmt_data->loop);
+ force_move_till_op (*index, fmt_data->orig_loop, fmt_data->loop);
return true;
}
@@ -1256,7 +1245,7 @@ mem_ref_locs_alloc (void)
description REF. The reference occurs in statement STMT. */
static void
-record_mem_ref_loc (mem_ref_p ref, struct loop *loop, tree stmt, tree *loc)
+record_mem_ref_loc (mem_ref_p ref, struct loop *loop, gimple stmt, tree *loc)
{
mem_ref_loc_p aref = XNEW (struct mem_ref_loc);
mem_ref_locs_p accs;
@@ -1298,7 +1287,7 @@ mark_ref_stored (mem_ref_p ref, struct loop *loop)
well. */
static void
-gather_mem_refs_stmt (struct loop *loop, tree stmt)
+gather_mem_refs_stmt (struct loop *loop, gimple stmt)
{
tree *mem = NULL;
hashval_t hash;
@@ -1358,7 +1347,7 @@ fail:
static void
gather_mem_refs_in_loops (void)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
basic_block bb;
struct loop *loop;
loop_iterator li;
@@ -1371,8 +1360,8 @@ gather_mem_refs_in_loops (void)
if (loop == current_loops->tree_root)
continue;
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- gather_mem_refs_stmt (loop, bsi_stmt (bsi));
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ gather_mem_refs_stmt (loop, gsi_stmt (bsi));
}
/* Propagate the information about clobbered vops and accessed memory
@@ -1826,9 +1815,10 @@ execute_sm (struct loop *loop, VEC (edge, heap) *exits, mem_ref_p ref)
{
tree tmp_var;
unsigned i;
- tree load, store;
+ gimple load, store;
struct fmt_data fmt_data;
edge ex;
+ struct lim_aux_data *lim_data;
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -1847,19 +1837,19 @@ execute_sm (struct loop *loop, VEC (edge, heap) *exits, mem_ref_p ref)
rewrite_mem_refs (loop, ref, tmp_var);
/* Emit the load & stores. */
- load = build_gimple_modify_stmt (tmp_var, unshare_expr (ref->mem));
- get_stmt_ann (load)->common.aux = xcalloc (1, sizeof (struct lim_aux_data));
- LIM_DATA (load)->max_loop = loop;
- LIM_DATA (load)->tgt_loop = loop;
+ load = gimple_build_assign (tmp_var, unshare_expr (ref->mem));
+ lim_data = init_lim_data (load);
+ lim_data->max_loop = loop;
+ lim_data->tgt_loop = loop;
/* Put this into the latch, so that we are sure it will be processed after
all dependencies. */
- bsi_insert_on_edge (loop_latch_edge (loop), load);
+ gsi_insert_on_edge (loop_latch_edge (loop), load);
for (i = 0; VEC_iterate (edge, exits, i, ex); i++)
{
- store = build_gimple_modify_stmt (unshare_expr (ref->mem), tmp_var);
- bsi_insert_on_edge (ex, store);
+ store = gimple_build_assign (unshare_expr (ref->mem), tmp_var);
+ gsi_insert_on_edge (ex, store);
}
}
@@ -1895,10 +1885,10 @@ ref_always_accessed_p (struct loop *loop, mem_ref_p ref)
get_all_locs_in_loop (loop, ref, &locs);
for (i = 0; VEC_iterate (mem_ref_loc_p, locs, i, loc); i++)
{
- if (!LIM_DATA (loc->stmt))
+ if (!get_lim_data (loc->stmt))
continue;
- must_exec = LIM_DATA (loc->stmt)->always_executed_in;
+ must_exec = get_lim_data (loc->stmt)->always_executed_in;
if (!must_exec)
continue;
@@ -2135,7 +2125,7 @@ store_motion (void)
store_motion_loop (loop, sm_executed);
BITMAP_FREE (sm_executed);
- bsi_commit_edge_inserts ();
+ gsi_commit_edge_inserts ();
}
/* Fills ALWAYS_EXECUTED_IN information for basic blocks of LOOP, i.e.
@@ -2212,20 +2202,20 @@ static void
tree_ssa_lim_initialize (void)
{
sbitmap contains_call = sbitmap_alloc (last_basic_block);
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
struct loop *loop;
basic_block bb;
sbitmap_zero (contains_call);
FOR_EACH_BB (bb)
{
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
{
- if (nonpure_call_p (bsi_stmt (bsi)))
+ if (nonpure_call_p (gsi_stmt (bsi)))
break;
}
- if (!bsi_end_p (bsi))
+ if (!gsi_end_p (bsi))
SET_BIT (contains_call, bb->index);
}
@@ -2233,6 +2223,8 @@ tree_ssa_lim_initialize (void)
fill_always_executed_in (loop, contains_call);
sbitmap_free (contains_call);
+
+ lim_aux_data_map = pointer_map_create ();
}
/* Cleans up after the invariant motion pass. */
@@ -2250,6 +2242,8 @@ tree_ssa_lim_finalize (void)
bb->aux = NULL;
}
+ pointer_map_destroy (lim_aux_data_map);
+
VEC_free (mem_ref_p, heap, memory_accesses.refs_list);
htab_delete (memory_accesses.refs);
diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c
index 67af0b374d6..e278c55b08b 100644
--- a/gcc/tree-ssa-loop-ivcanon.c
+++ b/gcc/tree-ssa-loop-ivcanon.c
@@ -1,5 +1,5 @@
/* Induction variable canonicalization.
- Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
@@ -72,8 +72,9 @@ static void
create_canonical_iv (struct loop *loop, edge exit, tree niter)
{
edge in;
- tree cond, type, var;
- block_stmt_iterator incr_at;
+ tree type, var;
+ gimple cond;
+ gimple_stmt_iterator incr_at;
enum tree_code cmp;
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -97,16 +98,16 @@ create_canonical_iv (struct loop *loop, edge exit, tree niter)
niter = fold_build2 (PLUS_EXPR, type,
niter,
build_int_cst (type, 1));
- incr_at = bsi_last (in->src);
+ incr_at = gsi_last_bb (in->src);
create_iv (niter,
build_int_cst (type, -1),
NULL_TREE, loop,
&incr_at, false, NULL, &var);
cmp = (exit->flags & EDGE_TRUE_VALUE) ? EQ_EXPR : NE_EXPR;
- COND_EXPR_COND (cond) = build2 (cmp, boolean_type_node,
- var,
- build_int_cst (type, 0));
+ gimple_cond_set_code (cond, cmp);
+ gimple_cond_set_lhs (cond, var);
+ gimple_cond_set_rhs (cond, build_int_cst (type, 0));
update_stmt (cond);
}
@@ -116,12 +117,12 @@ unsigned
tree_num_loop_insns (struct loop *loop, eni_weights *weights)
{
basic_block *body = get_loop_body (loop);
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
unsigned size = 1, i;
for (i = 0; i < loop->num_nodes; i++)
- for (bsi = bsi_start (body[i]); !bsi_end_p (bsi); bsi_next (&bsi))
- size += estimate_num_insns (bsi_stmt (bsi), weights);
+ for (gsi = gsi_start_bb (body[i]); !gsi_end_p (gsi); gsi_next (&gsi))
+ size += estimate_num_insns (gsi_stmt (gsi), weights);
free (body);
return size;
@@ -163,7 +164,7 @@ try_unroll_loop_completely (struct loop *loop,
enum unroll_level ul)
{
unsigned HOST_WIDE_INT n_unroll, ninsns, max_unroll, unr_insns;
- tree cond;
+ gimple cond;
if (loop->inner)
return false;
@@ -183,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))
{
@@ -195,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)
{
@@ -216,11 +224,11 @@ try_unroll_loop_completely (struct loop *loop,
sbitmap_ones (wont_exit);
RESET_BIT (wont_exit, 0);
- if (!tree_duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
- n_unroll, wont_exit,
- exit, &to_remove,
- DLTHE_FLAG_UPDATE_FREQ
- | DLTHE_FLAG_COMPLETTE_PEEL))
+ if (!gimple_duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
+ n_unroll, wont_exit,
+ exit, &to_remove,
+ DLTHE_FLAG_UPDATE_FREQ
+ | DLTHE_FLAG_COMPLETTE_PEEL))
{
free_original_copy_tables ();
free (wont_exit);
@@ -239,8 +247,10 @@ try_unroll_loop_completely (struct loop *loop,
}
cond = last_stmt (exit->src);
- COND_EXPR_COND (cond) = (exit->flags & EDGE_TRUE_VALUE) ? boolean_true_node
- : boolean_false_node;
+ if (exit->flags & EDGE_TRUE_VALUE)
+ gimple_cond_make_true (cond);
+ else
+ gimple_cond_make_false (cond);
update_stmt (cond);
update_ssa (TODO_update_ssa);
@@ -349,7 +359,7 @@ tree_unroll_loops_completely (bool may_increase_size, bool unroll_outer)
FOR_EACH_LOOP (li, loop, LI_ONLY_INNERMOST)
{
- if (may_increase_size && maybe_hot_bb_p (loop->header)
+ if (may_increase_size && optimize_loop_for_speed_p (loop)
/* Unroll outermost loops only if asked to do so or they do
not cause code growth. */
&& (unroll_outer
@@ -386,11 +396,9 @@ empty_loop_p (struct loop *loop)
{
edge exit;
struct tree_niter_desc niter;
- tree phi, def;
basic_block *body;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
unsigned i;
- tree stmt;
/* If the loop has multiple exits, it is too hard for us to handle.
Similarly, if the exit is not dominating, we cannot determine
@@ -404,8 +412,11 @@ empty_loop_p (struct loop *loop)
return false;
/* Values of all loop exit phi nodes must be invariants. */
- for (phi = phi_nodes (exit->dest); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start(phi_nodes (exit->dest)); !gsi_end_p (gsi); gsi_next (&gsi))
{
+ gimple phi = gsi_stmt (gsi);
+ tree def;
+
if (!is_gimple_reg (PHI_RESULT (phi)))
continue;
@@ -427,11 +438,12 @@ empty_loop_p (struct loop *loop)
return false;
}
- for (bsi = bsi_start (body[i]); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (gsi = gsi_start_bb (body[i]); !gsi_end_p (gsi); gsi_next (&gsi))
{
- stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
+
if (!ZERO_SSA_OPERANDS (stmt, SSA_OP_VIRTUAL_DEFS)
- || stmt_ann (stmt)->has_volatile_ops)
+ || gimple_has_volatile_ops (stmt))
{
free (body);
return false;
@@ -439,25 +451,19 @@ empty_loop_p (struct loop *loop)
/* Also, asm statements and calls may have side effects and we
cannot change the number of times they are executed. */
- switch (TREE_CODE (stmt))
+ switch (gimple_code (stmt))
{
- case RETURN_EXPR:
- case GIMPLE_MODIFY_STMT:
- stmt = get_call_expr_in (stmt);
- if (!stmt)
- break;
-
- case CALL_EXPR:
- if (TREE_SIDE_EFFECTS (stmt))
+ case GIMPLE_CALL:
+ if (gimple_has_side_effects (stmt))
{
free (body);
return false;
}
break;
- case ASM_EXPR:
+ case GIMPLE_ASM:
/* We cannot remove volatile assembler. */
- if (ASM_VOLATILE_P (stmt))
+ if (gimple_asm_volatile_p (stmt))
{
free (body);
return false;
@@ -480,8 +486,7 @@ static void
remove_empty_loop (struct loop *loop)
{
edge exit = single_dom_exit (loop), non_exit;
- tree cond_stmt = last_stmt (exit->src);
- tree do_exit;
+ gimple cond_stmt = last_stmt (exit->src);
basic_block *body;
unsigned n_before, freq_in, freq_h;
gcov_type exit_count = exit->count;
@@ -494,11 +499,9 @@ remove_empty_loop (struct loop *loop)
non_exit = EDGE_SUCC (exit->src, 1);
if (exit->flags & EDGE_TRUE_VALUE)
- do_exit = boolean_true_node;
+ gimple_cond_make_true (cond_stmt);
else
- do_exit = boolean_false_node;
-
- COND_EXPR_COND (cond_stmt) = do_exit;
+ gimple_cond_make_false (cond_stmt);
update_stmt (cond_stmt);
/* Let us set the probabilities of the edges coming from the exit block. */
@@ -569,3 +572,4 @@ remove_empty_loops (void)
}
return 0;
}
+
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index ce5c05cd88f..1a1e58b1a81 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -163,7 +163,7 @@ struct iv_use
unsigned id; /* The id of the use. */
enum use_type type; /* Type of the use. */
struct iv *iv; /* The induction variable it is based on. */
- tree stmt; /* Statement in that it occurs. */
+ gimple stmt; /* Statement in that it occurs. */
tree *op_p; /* The place where it occurs. */
bitmap related_cands; /* The set of "related" iv candidates, plus the common
important ones. */
@@ -191,7 +191,7 @@ struct iv_cand
bool important; /* Whether this is an "important" candidate, i.e. such
that it should be considered by all uses. */
enum iv_position pos; /* Where it is computed. */
- tree incremented_at; /* For original biv, the statement where it is
+ gimple incremented_at;/* For original biv, the statement where it is
incremented. */
tree var_before; /* The variable used for it before increment. */
tree var_after; /* The variable used for it after increment. */
@@ -448,7 +448,7 @@ dump_use (FILE *file, struct iv_use *use)
}
fprintf (file, " in statement ");
- print_generic_expr (file, use->stmt, TDF_SLIM);
+ print_gimple_stmt (file, use->stmt, 0, 0);
fprintf (file, "\n");
fprintf (file, " at position ");
@@ -544,9 +544,9 @@ name_info (struct ivopts_data *data, tree name)
emitted in LOOP. */
static bool
-stmt_after_ip_normal_pos (struct loop *loop, tree stmt)
+stmt_after_ip_normal_pos (struct loop *loop, gimple stmt)
{
- basic_block bb = ip_normal_pos (loop), sbb = bb_for_stmt (stmt);
+ basic_block bb = ip_normal_pos (loop), sbb = gimple_bb (stmt);
gcc_assert (bb);
@@ -563,11 +563,11 @@ stmt_after_ip_normal_pos (struct loop *loop, tree stmt)
variable CAND is incremented. */
static bool
-stmt_after_ip_original_pos (struct iv_cand *cand, tree stmt)
+stmt_after_ip_original_pos (struct iv_cand *cand, gimple stmt)
{
- basic_block cand_bb = bb_for_stmt (cand->incremented_at);
- basic_block stmt_bb = bb_for_stmt (stmt);
- block_stmt_iterator bsi;
+ basic_block cand_bb = gimple_bb (cand->incremented_at);
+ basic_block stmt_bb = gimple_bb (stmt);
+ gimple_stmt_iterator bsi;
if (!dominated_by_p (CDI_DOMINATORS, stmt_bb, cand_bb))
return false;
@@ -577,11 +577,11 @@ stmt_after_ip_original_pos (struct iv_cand *cand, tree stmt)
/* Scan the block from the end, since the original ivs are usually
incremented at the end of the loop body. */
- for (bsi = bsi_last (stmt_bb); ; bsi_prev (&bsi))
+ for (bsi = gsi_last_bb (stmt_bb); ; gsi_prev (&bsi))
{
- if (bsi_stmt (bsi) == cand->incremented_at)
+ if (gsi_stmt (bsi) == cand->incremented_at)
return false;
- if (bsi_stmt (bsi) == stmt)
+ if (gsi_stmt (bsi) == stmt)
return true;
}
}
@@ -590,7 +590,7 @@ stmt_after_ip_original_pos (struct iv_cand *cand, tree stmt)
CAND is incremented in LOOP. */
static bool
-stmt_after_increment (struct loop *loop, struct iv_cand *cand, tree stmt)
+stmt_after_increment (struct loop *loop, struct iv_cand *cand, gimple stmt)
{
switch (cand->pos)
{
@@ -858,7 +858,7 @@ get_iv (struct ivopts_data *data, tree var)
if (!name_info (data, var)->iv)
{
- bb = bb_for_stmt (SSA_NAME_DEF_STMT (var));
+ bb = gimple_bb (SSA_NAME_DEF_STMT (var));
if (!bb
|| !flow_bb_inside_loop_p (data->current_loop, bb))
@@ -872,9 +872,9 @@ get_iv (struct ivopts_data *data, tree var)
not define a simple affine biv with nonzero step. */
static tree
-determine_biv_step (tree phi)
+determine_biv_step (gimple phi)
{
- struct loop *loop = bb_for_stmt (phi)->loop_father;
+ struct loop *loop = gimple_bb (phi)->loop_father;
tree name = PHI_RESULT (phi);
affine_iv iv;
@@ -892,12 +892,16 @@ determine_biv_step (tree phi)
static bool
find_bivs (struct ivopts_data *data)
{
- tree phi, step, type, base;
+ gimple phi;
+ tree step, type, base;
bool found = false;
struct loop *loop = data->current_loop;
+ gimple_stmt_iterator psi;
- for (phi = phi_nodes (loop->header); phi; phi = PHI_CHAIN (phi))
+ for (psi = gsi_start_phis (loop->header); !gsi_end_p (psi); gsi_next (&psi))
{
+ phi = gsi_stmt (psi);
+
if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (PHI_RESULT (phi)))
continue;
@@ -933,13 +937,17 @@ find_bivs (struct ivopts_data *data)
static void
mark_bivs (struct ivopts_data *data)
{
- tree phi, var;
+ gimple phi;
+ tree var;
struct iv *iv, *incr_iv;
struct loop *loop = data->current_loop;
basic_block incr_bb;
+ gimple_stmt_iterator psi;
- for (phi = phi_nodes (loop->header); phi; phi = PHI_CHAIN (phi))
+ for (psi = gsi_start_phis (loop->header); !gsi_end_p (psi); gsi_next (&psi))
{
+ phi = gsi_stmt (psi);
+
iv = get_iv (data, PHI_RESULT (phi));
if (!iv)
continue;
@@ -950,7 +958,7 @@ mark_bivs (struct ivopts_data *data)
continue;
/* If the increment is in the subloop, ignore it. */
- incr_bb = bb_for_stmt (SSA_NAME_DEF_STMT (var));
+ incr_bb = gimple_bb (SSA_NAME_DEF_STMT (var));
if (incr_bb->loop_father != data->current_loop
|| (incr_bb->flags & BB_IRREDUCIBLE_LOOP))
continue;
@@ -964,7 +972,7 @@ mark_bivs (struct ivopts_data *data)
parameters to IV. */
static bool
-find_givs_in_stmt_scev (struct ivopts_data *data, tree stmt, affine_iv *iv)
+find_givs_in_stmt_scev (struct ivopts_data *data, gimple stmt, affine_iv *iv)
{
tree lhs;
struct loop *loop = data->current_loop;
@@ -972,14 +980,14 @@ find_givs_in_stmt_scev (struct ivopts_data *data, tree stmt, affine_iv *iv)
iv->base = NULL_TREE;
iv->step = NULL_TREE;
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
return false;
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
+ lhs = gimple_assign_lhs (stmt);
if (TREE_CODE (lhs) != SSA_NAME)
return false;
- if (!simple_iv (loop, stmt, GIMPLE_STMT_OPERAND (stmt, 1), iv, true))
+ if (!simple_iv (loop, stmt, lhs, iv, true))
return false;
iv->base = expand_simple_operations (iv->base);
@@ -993,14 +1001,14 @@ find_givs_in_stmt_scev (struct ivopts_data *data, tree stmt, affine_iv *iv)
/* Finds general ivs in statement STMT. */
static void
-find_givs_in_stmt (struct ivopts_data *data, tree stmt)
+find_givs_in_stmt (struct ivopts_data *data, gimple stmt)
{
affine_iv iv;
if (!find_givs_in_stmt_scev (data, stmt, &iv))
return;
- set_iv (data, GIMPLE_STMT_OPERAND (stmt, 0), iv.base, iv.step);
+ set_iv (data, gimple_assign_lhs (stmt), iv.base, iv.step);
}
/* Finds general ivs in basic block BB. */
@@ -1008,10 +1016,10 @@ find_givs_in_stmt (struct ivopts_data *data, tree stmt)
static void
find_givs_in_bb (struct ivopts_data *data, basic_block bb)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- find_givs_in_stmt (data, bsi_stmt (bsi));
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ find_givs_in_stmt (data, gsi_stmt (bsi));
}
/* Finds general ivs. */
@@ -1070,7 +1078,7 @@ find_induction_variables (struct ivopts_data *data)
static struct iv_use *
record_use (struct ivopts_data *data, tree *use_p, struct iv *iv,
- tree stmt, enum use_type use_type)
+ gimple stmt, enum use_type use_type)
{
struct iv_use *use = XCNEW (struct iv_use);
@@ -1107,7 +1115,7 @@ record_invariant (struct ivopts_data *data, tree op, bool nonlinear_use)
|| !is_gimple_reg (op))
return;
- bb = bb_for_stmt (SSA_NAME_DEF_STMT (op));
+ bb = gimple_bb (SSA_NAME_DEF_STMT (op));
if (bb
&& flow_bb_inside_loop_p (data->current_loop, bb))
return;
@@ -1127,7 +1135,7 @@ find_interesting_uses_op (struct ivopts_data *data, tree op)
{
struct iv *iv;
struct iv *civ;
- tree stmt;
+ gimple stmt;
struct iv_use *use;
if (TREE_CODE (op) != SSA_NAME)
@@ -1156,8 +1164,8 @@ find_interesting_uses_op (struct ivopts_data *data, tree op)
*civ = *iv;
stmt = SSA_NAME_DEF_STMT (op);
- gcc_assert (TREE_CODE (stmt) == PHI_NODE
- || TREE_CODE (stmt) == GIMPLE_MODIFY_STMT);
+ gcc_assert (gimple_code (stmt) == GIMPLE_PHI
+ || is_gimple_assign (stmt));
use = record_use (data, NULL, civ, stmt, USE_NONLINEAR_EXPR);
iv->use_id = use->id;
@@ -1165,47 +1173,40 @@ find_interesting_uses_op (struct ivopts_data *data, tree op)
return use;
}
-/* Given a condition *COND_P, checks whether it is a compare of an induction
- variable and an invariant. If this is the case, CONTROL_VAR is set
- to location of the iv, BOUND to the location of the invariant,
- IV_VAR and IV_BOUND are set to the corresponding induction variable
- descriptions, and true is returned. If this is not the case,
- CONTROL_VAR and BOUND are set to the arguments of the condition and
- false is returned. */
+/* Given a condition in statement STMT, checks whether it is a compare
+ of an induction variable and an invariant. If this is the case,
+ CONTROL_VAR is set to location of the iv, BOUND to the location of
+ the invariant, IV_VAR and IV_BOUND are set to the corresponding
+ induction variable descriptions, and true is returned. If this is not
+ the case, CONTROL_VAR and BOUND are set to the arguments of the
+ condition and false is returned. */
static bool
-extract_cond_operands (struct ivopts_data *data, tree *cond_p,
+extract_cond_operands (struct ivopts_data *data, gimple stmt,
tree **control_var, tree **bound,
struct iv **iv_var, struct iv **iv_bound)
{
- /* The nodes returned when COND has just one operand. Note that you should
- not modify anything in BOUND or IV_BOUND because of this. */
+ /* The objects returned when COND has constant operands. */
static struct iv const_iv;
static tree zero;
- tree cond = *cond_p;
tree *op0 = &zero, *op1 = &zero, *tmp_op;
struct iv *iv0 = &const_iv, *iv1 = &const_iv, *tmp_iv;
bool ret = false;
- zero = integer_zero_node;
- const_iv.step = integer_zero_node;
-
- if (TREE_CODE (cond) == SSA_NAME)
+ if (gimple_code (stmt) == GIMPLE_COND)
{
- op0 = cond_p;
- iv0 = get_iv (data, cond);
- ret = (iv0 && !integer_zerop (iv0->step));
- goto end;
+ op0 = gimple_cond_lhs_ptr (stmt);
+ op1 = gimple_cond_rhs_ptr (stmt);
}
-
- if (!COMPARISON_CLASS_P (cond))
+ else
{
- op0 = cond_p;
- goto end;
+ op0 = gimple_assign_rhs1_ptr (stmt);
+ op1 = gimple_assign_rhs2_ptr (stmt);
}
- op0 = &TREE_OPERAND (cond, 0);
- op1 = &TREE_OPERAND (cond, 1);
+ zero = integer_zero_node;
+ const_iv.step = integer_zero_node;
+
if (TREE_CODE (*op0) == SSA_NAME)
iv0 = get_iv (data, *op0);
if (TREE_CODE (*op1) == SSA_NAME)
@@ -1237,16 +1238,16 @@ end:
return ret;
}
-/* Checks whether the condition *COND_P in STMT is interesting
- and if so, records it. */
+/* Checks whether the condition in STMT is interesting and if so,
+ records it. */
static void
-find_interesting_uses_cond (struct ivopts_data *data, tree stmt, tree *cond_p)
+find_interesting_uses_cond (struct ivopts_data *data, gimple stmt)
{
tree *var_p, *bound_p;
struct iv *var_iv, *civ;
- if (!extract_cond_operands (data, cond_p, &var_p, &bound_p, &var_iv, NULL))
+ if (!extract_cond_operands (data, stmt, &var_p, &bound_p, &var_iv, NULL))
{
find_interesting_uses_op (data, *var_p);
find_interesting_uses_op (data, *bound_p);
@@ -1255,7 +1256,7 @@ find_interesting_uses_cond (struct ivopts_data *data, tree stmt, tree *cond_p)
civ = XNEW (struct iv);
*civ = *var_iv;
- record_use (data, cond_p, civ, stmt, USE_COMPARE);
+ record_use (data, NULL, civ, stmt, USE_COMPARE);
}
/* Returns true if expression EXPR is obviously invariant in LOOP,
@@ -1275,7 +1276,7 @@ expr_invariant_in_loop_p (struct loop *loop, tree expr)
if (TREE_CODE (expr) == SSA_NAME)
{
- def_bb = bb_for_stmt (SSA_NAME_DEF_STMT (expr));
+ def_bb = gimple_bb (SSA_NAME_DEF_STMT (expr));
if (def_bb
&& flow_bb_inside_loop_p (loop, def_bb))
return false;
@@ -1283,7 +1284,7 @@ expr_invariant_in_loop_p (struct loop *loop, tree expr)
return true;
}
- if (!EXPR_P (expr) && !GIMPLE_STMT_P (expr))
+ if (!EXPR_P (expr))
return false;
len = TREE_OPERAND_LENGTH (expr);
@@ -1294,6 +1295,29 @@ expr_invariant_in_loop_p (struct loop *loop, tree expr)
return true;
}
+/* Returns true if statement STMT is obviously invariant in LOOP,
+ i.e. if all its operands on the RHS are defined outside of the LOOP.
+ LOOP should not be the function body. */
+
+bool
+stmt_invariant_in_loop_p (struct loop *loop, gimple stmt)
+{
+ unsigned i;
+ tree lhs;
+
+ gcc_assert (loop_depth (loop) > 0);
+
+ lhs = gimple_get_lhs (stmt);
+ for (i = 0; i < gimple_num_ops (stmt); i++)
+ {
+ tree op = gimple_op (stmt, i);
+ if (op != lhs && !expr_invariant_in_loop_p (loop, op))
+ return false;
+ }
+
+ return true;
+}
+
/* Cumulates the steps of indices into DATA and replaces their values with the
initial ones. Returns false when the value of the index cannot be determined.
Callback for for_each_index. */
@@ -1301,7 +1325,7 @@ expr_invariant_in_loop_p (struct loop *loop, tree expr)
struct ifs_ivopts_data
{
struct ivopts_data *ivopts_data;
- tree stmt;
+ gimple stmt;
tree step;
};
@@ -1553,7 +1577,7 @@ may_be_nonaddressable_p (tree expr)
/* Finds addresses in *OP_P inside STMT. */
static void
-find_interesting_uses_address (struct ivopts_data *data, tree stmt, tree *op_p)
+find_interesting_uses_address (struct ivopts_data *data, gimple stmt, tree *op_p)
{
tree base = *op_p, step = build_int_cst (sizetype, 0);
struct iv *civ;
@@ -1561,7 +1585,7 @@ find_interesting_uses_address (struct ivopts_data *data, tree stmt, tree *op_p)
/* Do not play with volatile memory references. A bit too conservative,
perhaps, but safe. */
- if (stmt_ann (stmt)->has_volatile_ops)
+ if (gimple_has_volatile_ops (stmt))
goto fail;
/* Ignore bitfields for now. Not really something terribly complicated
@@ -1657,7 +1681,7 @@ fail:
/* Finds and records invariants used in STMT. */
static void
-find_invariants_stmt (struct ivopts_data *data, tree stmt)
+find_invariants_stmt (struct ivopts_data *data, gimple stmt)
{
ssa_op_iter iter;
use_operand_p use_p;
@@ -1673,61 +1697,55 @@ find_invariants_stmt (struct ivopts_data *data, tree stmt)
/* Finds interesting uses of induction variables in the statement STMT. */
static void
-find_interesting_uses_stmt (struct ivopts_data *data, tree stmt)
+find_interesting_uses_stmt (struct ivopts_data *data, gimple stmt)
{
struct iv *iv;
- tree op, lhs, rhs;
+ tree op, *lhs, *rhs;
ssa_op_iter iter;
use_operand_p use_p;
+ enum tree_code code;
find_invariants_stmt (data, stmt);
- if (TREE_CODE (stmt) == COND_EXPR)
+ if (gimple_code (stmt) == GIMPLE_COND)
{
- find_interesting_uses_cond (data, stmt, &COND_EXPR_COND (stmt));
+ find_interesting_uses_cond (data, stmt);
return;
}
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_assign (stmt))
{
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ lhs = gimple_assign_lhs_ptr (stmt);
+ rhs = gimple_assign_rhs1_ptr (stmt);
- if (TREE_CODE (lhs) == SSA_NAME)
+ if (TREE_CODE (*lhs) == SSA_NAME)
{
/* If the statement defines an induction variable, the uses are not
interesting by themselves. */
- iv = get_iv (data, lhs);
+ iv = get_iv (data, *lhs);
if (iv && !integer_zerop (iv->step))
return;
}
- switch (TREE_CODE_CLASS (TREE_CODE (rhs)))
+ code = gimple_assign_rhs_code (stmt);
+ if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS
+ && (REFERENCE_CLASS_P (*rhs)
+ || is_gimple_val (*rhs)))
{
- case tcc_comparison:
- find_interesting_uses_cond (data, stmt,
- &GIMPLE_STMT_OPERAND (stmt, 1));
- return;
+ if (REFERENCE_CLASS_P (*rhs))
+ find_interesting_uses_address (data, stmt, rhs);
+ else
+ find_interesting_uses_op (data, *rhs);
- case tcc_reference:
- find_interesting_uses_address (data, stmt,
- &GIMPLE_STMT_OPERAND (stmt, 1));
- if (REFERENCE_CLASS_P (lhs))
- find_interesting_uses_address (data, stmt,
- &GIMPLE_STMT_OPERAND (stmt, 0));
+ if (REFERENCE_CLASS_P (*lhs))
+ find_interesting_uses_address (data, stmt, lhs);
return;
-
- default: ;
}
-
- if (REFERENCE_CLASS_P (lhs)
- && is_gimple_val (rhs))
+ else if (TREE_CODE_CLASS (code) == tcc_comparison)
{
- find_interesting_uses_address (data, stmt,
- &GIMPLE_STMT_OPERAND (stmt, 0));
- find_interesting_uses_op (data, rhs);
+ find_interesting_uses_cond (data, stmt);
return;
}
@@ -1740,11 +1758,10 @@ find_interesting_uses_stmt (struct ivopts_data *data, tree stmt)
call (memory). */
}
- if (TREE_CODE (stmt) == PHI_NODE
- && bb_for_stmt (stmt) == data->current_loop->header)
+ if (gimple_code (stmt) == GIMPLE_PHI
+ && gimple_bb (stmt) == data->current_loop->header)
{
- lhs = PHI_RESULT (stmt);
- iv = get_iv (data, lhs);
+ iv = get_iv (data, PHI_RESULT (stmt));
if (iv && !integer_zerop (iv->step))
return;
@@ -1771,10 +1788,13 @@ find_interesting_uses_stmt (struct ivopts_data *data, tree stmt)
static void
find_interesting_uses_outside (struct ivopts_data *data, edge exit)
{
- tree phi, def;
+ gimple phi;
+ gimple_stmt_iterator psi;
+ tree def;
- for (phi = phi_nodes (exit->dest); phi; phi = PHI_CHAIN (phi))
+ for (psi = gsi_start_phis (exit->dest); !gsi_end_p (psi); gsi_next (&psi))
{
+ phi = gsi_stmt (psi);
def = PHI_ARG_DEF_FROM_EDGE (phi, exit);
if (is_gimple_reg (def))
find_interesting_uses_op (data, def);
@@ -1787,8 +1807,7 @@ static void
find_interesting_uses (struct ivopts_data *data)
{
basic_block bb;
- block_stmt_iterator bsi;
- tree phi;
+ gimple_stmt_iterator bsi;
basic_block *body = get_loop_body (data->current_loop);
unsigned i;
struct version_info *info;
@@ -1807,10 +1826,10 @@ find_interesting_uses (struct ivopts_data *data)
&& !flow_bb_inside_loop_p (data->current_loop, e->dest))
find_interesting_uses_outside (data, e);
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- find_interesting_uses_stmt (data, phi);
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- find_interesting_uses_stmt (data, bsi_stmt (bsi));
+ for (bsi = gsi_start_phis (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ find_interesting_uses_stmt (data, gsi_stmt (bsi));
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ find_interesting_uses_stmt (data, gsi_stmt (bsi));
}
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -2033,7 +2052,7 @@ find_depends (tree *expr_p, int *ws ATTRIBUTE_UNUSED, void *data)
static struct iv_cand *
add_candidate_1 (struct ivopts_data *data,
tree base, tree step, bool important, enum iv_position pos,
- struct iv_use *use, tree incremented_at)
+ struct iv_use *use, gimple incremented_at)
{
unsigned i;
struct iv_cand *cand = NULL;
@@ -2157,10 +2176,10 @@ add_candidate (struct ivopts_data *data,
tree base, tree step, bool important, struct iv_use *use)
{
if (ip_normal_pos (data->current_loop))
- add_candidate_1 (data, base, step, important, IP_NORMAL, use, NULL_TREE);
+ add_candidate_1 (data, base, step, important, IP_NORMAL, use, NULL);
if (ip_end_pos (data->current_loop)
&& allow_ip_end_pos_p (data->current_loop))
- add_candidate_1 (data, base, step, important, IP_END, use, NULL_TREE);
+ add_candidate_1 (data, base, step, important, IP_END, use, NULL);
}
/* Add a standard "0 + 1 * iteration" iv candidate for a
@@ -2193,7 +2212,8 @@ add_standard_iv_candidates (struct ivopts_data *data)
static void
add_old_iv_candidates (struct ivopts_data *data, struct iv *iv)
{
- tree phi, def;
+ gimple phi;
+ tree def;
struct iv_cand *cand;
add_candidate (data, iv->base, iv->step, true, NULL);
@@ -2204,7 +2224,7 @@ add_old_iv_candidates (struct ivopts_data *data, struct iv *iv)
iv->step, true, NULL);
phi = SSA_NAME_DEF_STMT (iv->ssa_name);
- if (TREE_CODE (phi) == PHI_NODE)
+ if (gimple_code (phi) == GIMPLE_PHI)
{
/* Additionally record the possibility of leaving the original iv
untouched. */
@@ -2255,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);
}
@@ -2643,7 +2665,7 @@ computation_cost (tree expr)
/* Returns variable containing the value of candidate CAND at statement AT. */
static tree
-var_at_stmt (struct loop *loop, struct iv_cand *cand, tree stmt)
+var_at_stmt (struct loop *loop, struct iv_cand *cand, gimple stmt)
{
if (stmt_after_increment (loop, cand, stmt))
return cand->var_after;
@@ -2713,7 +2735,7 @@ determine_common_wider_type (tree *a, tree *b)
static bool
get_computation_aff (struct loop *loop,
- struct iv_use *use, struct iv_cand *cand, tree at,
+ struct iv_use *use, struct iv_cand *cand, gimple at,
struct affine_tree_combination *aff)
{
tree ubase = use->iv->base;
@@ -2788,7 +2810,7 @@ get_computation_aff (struct loop *loop,
static tree
get_computation_at (struct loop *loop,
- struct iv_use *use, struct iv_cand *cand, tree at)
+ struct iv_use *use, struct iv_cand *cand, gimple at)
{
aff_tree aff;
tree type = TREE_TYPE (use->iv->base);
@@ -3458,7 +3480,7 @@ difference_cost (struct ivopts_data *data,
static comp_cost
get_computation_cost_at (struct ivopts_data *data,
struct iv_use *use, struct iv_cand *cand,
- bool address_p, bitmap *depends_on, tree at)
+ bool address_p, bitmap *depends_on, gimple at)
{
tree ubase = use->iv->base, ustep = use->iv->step;
tree cbase, cstep;
@@ -3672,7 +3694,7 @@ determine_use_iv_cost_address (struct ivopts_data *data,
stores it to VAL. */
static void
-cand_value_at (struct loop *loop, struct iv_cand *cand, tree at, tree niter,
+cand_value_at (struct loop *loop, struct iv_cand *cand, gimple at, tree niter,
aff_tree *val)
{
aff_tree step, delta, nit;
@@ -3725,7 +3747,7 @@ iv_elimination_compare (struct ivopts_data *data, struct iv_use *use)
basic_block ex_bb;
edge exit;
- ex_bb = bb_for_stmt (use->stmt);
+ ex_bb = gimple_bb (use->stmt);
exit = EDGE_SUCC (ex_bb, 0);
if (flow_bb_inside_loop_p (loop, exit->dest))
exit = EDGE_SUCC (ex_bb, 1);
@@ -3751,11 +3773,10 @@ may_eliminate_iv (struct ivopts_data *data,
/* For now works only for exits that dominate the loop latch.
TODO: extend to other conditions inside loop body. */
- ex_bb = bb_for_stmt (use->stmt);
+ ex_bb = gimple_bb (use->stmt);
if (use->stmt != last_stmt (ex_bb)
- || TREE_CODE (use->stmt) != COND_EXPR)
- return false;
- if (!dominated_by_p (CDI_DOMINATORS, loop->latch, ex_bb))
+ || gimple_code (use->stmt) != GIMPLE_COND
+ || !dominated_by_p (CDI_DOMINATORS, loop->latch, ex_bb))
return false;
exit = EDGE_SUCC (ex_bb, 0);
@@ -3834,7 +3855,7 @@ determine_use_iv_cost_condition (struct ivopts_data *data,
/* Try expressing the original giv. If it is compared with an invariant,
note that we cannot get rid of it. */
- ok = extract_cond_operands (data, use->op_p, NULL, NULL, NULL, &cmp_iv);
+ ok = extract_cond_operands (data, use->stmt, NULL, NULL, NULL, &cmp_iv);
gcc_assert (ok);
express_cost = get_computation_cost (data, use, cand, false,
@@ -4050,7 +4071,9 @@ static void
determine_set_costs (struct ivopts_data *data)
{
unsigned j, n;
- tree phi, op;
+ gimple phi;
+ gimple_stmt_iterator psi;
+ tree op;
struct loop *loop = data->current_loop;
bitmap_iterator bi;
@@ -4083,8 +4106,9 @@ determine_set_costs (struct ivopts_data *data)
}
n = 0;
- for (phi = phi_nodes (loop->header); phi; phi = PHI_CHAIN (phi))
+ for (psi = gsi_start_phis (loop->header); !gsi_end_p (psi); gsi_next (&psi))
{
+ phi = gsi_stmt (psi);
op = PHI_RESULT (phi);
if (!is_gimple_reg (op))
@@ -4925,7 +4949,7 @@ find_optimal_iv_set (struct ivopts_data *data)
static void
create_new_iv (struct ivopts_data *data, struct iv_cand *cand)
{
- block_stmt_iterator incr_pos;
+ gimple_stmt_iterator incr_pos;
tree base;
bool after = false;
@@ -4935,11 +4959,11 @@ create_new_iv (struct ivopts_data *data, struct iv_cand *cand)
switch (cand->pos)
{
case IP_NORMAL:
- incr_pos = bsi_last (ip_normal_pos (data->current_loop));
+ incr_pos = gsi_last_bb (ip_normal_pos (data->current_loop));
break;
case IP_END:
- incr_pos = bsi_last (ip_end_pos (data->current_loop));
+ incr_pos = gsi_last_bb (ip_end_pos (data->current_loop));
after = true;
break;
@@ -4984,17 +5008,15 @@ create_new_ivs (struct ivopts_data *data, struct iv_ca *set)
is true, remove also the ssa name defined by the statement. */
static void
-remove_statement (tree stmt, bool including_defined_name)
+remove_statement (gimple stmt, bool including_defined_name)
{
- if (TREE_CODE (stmt) == PHI_NODE)
- {
- remove_phi_node (stmt, NULL_TREE, including_defined_name);
- }
+ gimple_stmt_iterator bsi = gsi_for_stmt (stmt);
+
+ if (gimple_code (stmt) == GIMPLE_PHI)
+ remove_phi_node (&bsi, including_defined_name);
else
{
- block_stmt_iterator bsi = bsi_for_stmt (stmt);
-
- bsi_remove (&bsi, true);
+ gsi_remove (&bsi, true);
release_defs (stmt);
}
}
@@ -5007,8 +5029,9 @@ rewrite_use_nonlinear_expr (struct ivopts_data *data,
struct iv_use *use, struct iv_cand *cand)
{
tree comp;
- tree op, tgt, ass;
- block_stmt_iterator bsi;
+ tree op, tgt;
+ gimple ass;
+ gimple_stmt_iterator bsi;
/* An important special case -- if we are asked to express value of
the original iv by itself, just exit; there is no need to
@@ -5018,10 +5041,10 @@ rewrite_use_nonlinear_expr (struct ivopts_data *data,
&& cand->incremented_at == use->stmt)
{
tree step, ctype, utype;
- enum tree_code incr_code = PLUS_EXPR;
+ enum tree_code incr_code = PLUS_EXPR, old_code;
- gcc_assert (TREE_CODE (use->stmt) == GIMPLE_MODIFY_STMT);
- gcc_assert (GIMPLE_STMT_OPERAND (use->stmt, 0) == cand->var_after);
+ gcc_assert (is_gimple_assign (use->stmt));
+ gcc_assert (gimple_assign_lhs (use->stmt) == cand->var_after);
step = cand->iv->step;
ctype = TREE_TYPE (step);
@@ -5037,16 +5060,16 @@ rewrite_use_nonlinear_expr (struct ivopts_data *data,
computations in the loop -- otherwise, the computation
we rely upon may be removed in remove_unused_ivs,
thus leading to ICE. */
- op = GIMPLE_STMT_OPERAND (use->stmt, 1);
- if (TREE_CODE (op) == PLUS_EXPR
- || TREE_CODE (op) == MINUS_EXPR
- || TREE_CODE (op) == POINTER_PLUS_EXPR)
+ old_code = gimple_assign_rhs_code (use->stmt);
+ if (old_code == PLUS_EXPR
+ || old_code == MINUS_EXPR
+ || old_code == POINTER_PLUS_EXPR)
{
- if (TREE_OPERAND (op, 0) == cand->var_before)
- op = TREE_OPERAND (op, 1);
- else if (TREE_CODE (op) != MINUS_EXPR
- && TREE_OPERAND (op, 1) == cand->var_before)
- op = TREE_OPERAND (op, 0);
+ if (gimple_assign_rhs1 (use->stmt) == cand->var_before)
+ op = gimple_assign_rhs2 (use->stmt);
+ else if (old_code != MINUS_EXPR
+ && gimple_assign_rhs2 (use->stmt) == cand->var_before)
+ op = gimple_assign_rhs1 (use->stmt);
else
op = NULL_TREE;
}
@@ -5071,39 +5094,41 @@ rewrite_use_nonlinear_expr (struct ivopts_data *data,
gcc_assert (comp != NULL_TREE);
}
- switch (TREE_CODE (use->stmt))
+ switch (gimple_code (use->stmt))
{
- case PHI_NODE:
+ case GIMPLE_PHI:
tgt = PHI_RESULT (use->stmt);
/* If we should keep the biv, do not replace it. */
if (name_info (data, tgt)->preserve_biv)
return;
- bsi = bsi_after_labels (bb_for_stmt (use->stmt));
+ bsi = gsi_after_labels (gimple_bb (use->stmt));
break;
- case GIMPLE_MODIFY_STMT:
- tgt = GIMPLE_STMT_OPERAND (use->stmt, 0);
- bsi = bsi_for_stmt (use->stmt);
+ case GIMPLE_ASSIGN:
+ tgt = gimple_assign_lhs (use->stmt);
+ bsi = gsi_for_stmt (use->stmt);
break;
default:
gcc_unreachable ();
}
- op = force_gimple_operand_bsi (&bsi, comp, false, SSA_NAME_VAR (tgt),
- true, BSI_SAME_STMT);
+ op = force_gimple_operand_gsi (&bsi, comp, false, SSA_NAME_VAR (tgt),
+ true, GSI_SAME_STMT);
- if (TREE_CODE (use->stmt) == PHI_NODE)
+ if (gimple_code (use->stmt) == GIMPLE_PHI)
{
- ass = build_gimple_modify_stmt (tgt, op);
- bsi_insert_before (&bsi, ass, BSI_SAME_STMT);
+ ass = gimple_build_assign (tgt, op);
+ gsi_insert_before (&bsi, ass, GSI_SAME_STMT);
remove_statement (use->stmt, false);
- SSA_NAME_DEF_STMT (tgt) = ass;
}
else
- GIMPLE_STMT_OPERAND (use->stmt, 1) = op;
+ {
+ gimple_assign_set_rhs_from_tree (&bsi, op);
+ use->stmt = gsi_stmt (bsi);
+ }
}
/* Replaces ssa name in index IDX by its basic variable. Callback for
@@ -5222,7 +5247,7 @@ rewrite_use_address (struct ivopts_data *data,
struct iv_use *use, struct iv_cand *cand)
{
aff_tree aff;
- block_stmt_iterator bsi = bsi_for_stmt (use->stmt);
+ gimple_stmt_iterator bsi = gsi_for_stmt (use->stmt);
tree ref;
bool ok;
@@ -5243,7 +5268,7 @@ rewrite_use_compare (struct ivopts_data *data,
struct iv_use *use, struct iv_cand *cand)
{
tree comp, *var_p, op, bound;
- block_stmt_iterator bsi = bsi_for_stmt (use->stmt);
+ gimple_stmt_iterator bsi = gsi_for_stmt (use->stmt);
enum tree_code compare;
struct cost_pair *cp = get_use_iv_cost (data, use, cand);
bool ok;
@@ -5256,10 +5281,12 @@ rewrite_use_compare (struct ivopts_data *data,
compare = iv_elimination_compare (data, use);
bound = unshare_expr (fold_convert (var_type, bound));
- op = force_gimple_operand_bsi (&bsi, bound, true, NULL_TREE,
- true, BSI_SAME_STMT);
+ op = force_gimple_operand_gsi (&bsi, bound, true, NULL_TREE,
+ true, GSI_SAME_STMT);
- *use->op_p = build2 (compare, boolean_type_node, var, op);
+ gimple_cond_set_lhs (use->stmt, var);
+ gimple_cond_set_code (use->stmt, compare);
+ gimple_cond_set_rhs (use->stmt, op);
return;
}
@@ -5268,11 +5295,11 @@ rewrite_use_compare (struct ivopts_data *data,
comp = get_computation (data->current_loop, use, cand);
gcc_assert (comp != NULL_TREE);
- ok = extract_cond_operands (data, use->op_p, &var_p, NULL, NULL, NULL);
+ ok = extract_cond_operands (data, use->stmt, &var_p, NULL, NULL, NULL);
gcc_assert (ok);
- *var_p = force_gimple_operand_bsi (&bsi, comp, true, SSA_NAME_VAR (*var_p),
- true, BSI_SAME_STMT);
+ *var_p = force_gimple_operand_gsi (&bsi, comp, true, SSA_NAME_VAR (*var_p),
+ true, GSI_SAME_STMT);
}
/* Rewrites USE using candidate CAND. */
@@ -5452,7 +5479,7 @@ tree_ssa_iv_optimize_loop (struct ivopts_data *data, struct loop *loop)
{
fprintf (dump_file, " single exit %d -> %d, exit condition ",
exit->src->index, exit->dest->index);
- print_generic_expr (dump_file, last_stmt (exit->src), TDF_SLIM);
+ print_gimple_stmt (dump_file, last_stmt (exit->src), 0, TDF_SLIM);
fprintf (dump_file, "\n");
}
diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c
index 1ff6254c0b1..05e87d241cd 100644
--- a/gcc/tree-ssa-loop-manip.c
+++ b/gcc/tree-ssa-loop-manip.c
@@ -49,10 +49,12 @@ along with GCC; see the file COPYING3. If not see
void
create_iv (tree base, tree step, tree var, struct loop *loop,
- block_stmt_iterator *incr_pos, bool after,
+ gimple_stmt_iterator *incr_pos, bool after,
tree *var_before, tree *var_after)
{
- tree stmt, initial, step1, stmts;
+ gimple stmt;
+ tree initial, step1;
+ gimple_seq stmts;
tree vb, va;
enum tree_code incr_op = PLUS_EXPR;
edge pe = loop_preheader_edge (loop);
@@ -63,10 +65,10 @@ create_iv (tree base, tree step, tree var, struct loop *loop,
add_referenced_var (var);
}
- vb = make_ssa_name (var, NULL_TREE);
+ vb = make_ssa_name (var, NULL);
if (var_before)
*var_before = vb;
- va = make_ssa_name (var, NULL_TREE);
+ va = make_ssa_name (var, NULL);
if (var_after)
*var_after = va;
@@ -106,20 +108,17 @@ create_iv (tree base, tree step, tree var, struct loop *loop,
loop (i.e. the step should be loop invariant). */
step = force_gimple_operand (step, &stmts, true, NULL_TREE);
if (stmts)
- bsi_insert_on_edge_immediate (pe, stmts);
+ gsi_insert_seq_on_edge_immediate (pe, stmts);
- stmt = build_gimple_modify_stmt (va,
- build2 (incr_op, TREE_TYPE (base),
- vb, step));
- SSA_NAME_DEF_STMT (va) = stmt;
+ stmt = gimple_build_assign_with_ops (incr_op, va, vb, step);
if (after)
- bsi_insert_after (incr_pos, stmt, BSI_NEW_STMT);
+ gsi_insert_after (incr_pos, stmt, GSI_NEW_STMT);
else
- bsi_insert_before (incr_pos, stmt, BSI_NEW_STMT);
+ gsi_insert_before (incr_pos, stmt, GSI_NEW_STMT);
initial = force_gimple_operand (base, &stmts, true, var);
if (stmts)
- bsi_insert_on_edge_immediate (pe, stmts);
+ gsi_insert_seq_on_edge_immediate (pe, stmts);
stmt = create_phi_node (vb, loop->header);
SSA_NAME_DEF_STMT (vb) = stmt;
@@ -132,8 +131,8 @@ create_iv (tree base, tree step, tree var, struct loop *loop,
static void
add_exit_phis_edge (basic_block exit, tree use)
{
- tree phi, def_stmt = SSA_NAME_DEF_STMT (use);
- basic_block def_bb = bb_for_stmt (def_stmt);
+ gimple phi, def_stmt = SSA_NAME_DEF_STMT (use);
+ basic_block def_bb = gimple_bb (def_stmt);
struct loop *def_loop;
edge e;
edge_iterator ei;
@@ -151,7 +150,8 @@ add_exit_phis_edge (basic_block exit, tree use)
return;
phi = create_phi_node (use, exit);
- create_new_def_for (PHI_RESULT (phi), phi, PHI_RESULT_PTR (phi));
+ create_new_def_for (gimple_phi_result (phi), phi,
+ gimple_phi_result_ptr (phi));
FOR_EACH_EDGE (e, ei, exit->preds)
add_phi_arg (phi, use, e);
}
@@ -164,7 +164,7 @@ add_exit_phis_var (tree var, bitmap livein, bitmap exits)
{
bitmap def;
unsigned index;
- basic_block def_bb = bb_for_stmt (SSA_NAME_DEF_STMT (var));
+ basic_block def_bb = gimple_bb (SSA_NAME_DEF_STMT (var));
bitmap_iterator bi;
if (is_gimple_reg (var))
@@ -243,7 +243,7 @@ find_uses_to_rename_use (basic_block bb, tree use, bitmap *use_blocks,
return;
ver = SSA_NAME_VERSION (use);
- def_bb = bb_for_stmt (SSA_NAME_DEF_STMT (use));
+ def_bb = gimple_bb (SSA_NAME_DEF_STMT (use));
if (!def_bb)
return;
def_loop = def_bb->loop_father;
@@ -270,11 +270,11 @@ find_uses_to_rename_use (basic_block bb, tree use, bitmap *use_blocks,
NEED_PHIS. */
static void
-find_uses_to_rename_stmt (tree stmt, bitmap *use_blocks, bitmap need_phis)
+find_uses_to_rename_stmt (gimple stmt, bitmap *use_blocks, bitmap need_phis)
{
ssa_op_iter iter;
tree var;
- basic_block bb = bb_for_stmt (stmt);
+ basic_block bb = gimple_bb (stmt);
FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_ALL_USES)
find_uses_to_rename_use (bb, var, use_blocks, need_phis);
@@ -288,18 +288,17 @@ find_uses_to_rename_stmt (tree stmt, bitmap *use_blocks, bitmap need_phis)
static void
find_uses_to_rename_bb (basic_block bb, bitmap *use_blocks, bitmap need_phis)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
edge e;
edge_iterator ei;
- tree phi;
FOR_EACH_EDGE (e, ei, bb->succs)
- for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
- find_uses_to_rename_use (bb, PHI_ARG_DEF_FROM_EDGE (phi, e),
+ for (bsi = gsi_start_phis (e->dest); !gsi_end_p (bsi); gsi_next (&bsi))
+ find_uses_to_rename_use (bb, PHI_ARG_DEF_FROM_EDGE (gsi_stmt (bsi), e),
use_blocks, need_phis);
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- find_uses_to_rename_stmt (bsi_stmt (bsi), use_blocks, need_phis);
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ find_uses_to_rename_stmt (gsi_stmt (bsi), use_blocks, need_phis);
}
/* Marks names that are used outside of the loop they are defined in
@@ -407,14 +406,14 @@ rewrite_into_loop_closed_ssa (bitmap changed_bbs, unsigned update_flag)
static void
check_loop_closed_ssa_use (basic_block bb, tree use)
{
- tree def;
+ gimple def;
basic_block def_bb;
if (TREE_CODE (use) != SSA_NAME || !is_gimple_reg (use))
return;
def = SSA_NAME_DEF_STMT (use);
- def_bb = bb_for_stmt (def);
+ def_bb = gimple_bb (def);
gcc_assert (!def_bb
|| flow_bb_inside_loop_p (def_bb->loop_father, bb));
}
@@ -422,7 +421,7 @@ check_loop_closed_ssa_use (basic_block bb, tree use)
/* Checks invariants of loop closed ssa form in statement STMT in BB. */
static void
-check_loop_closed_ssa_stmt (basic_block bb, tree stmt)
+check_loop_closed_ssa_stmt (basic_block bb, gimple stmt)
{
ssa_op_iter iter;
tree var;
@@ -437,9 +436,10 @@ void
verify_loop_closed_ssa (void)
{
basic_block bb;
- block_stmt_iterator bsi;
- tree phi;
- unsigned i;
+ gimple_stmt_iterator bsi;
+ gimple phi;
+ edge e;
+ edge_iterator ei;
if (number_of_loops () <= 1)
return;
@@ -448,13 +448,16 @@ verify_loop_closed_ssa (void)
FOR_EACH_BB (bb)
{
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- for (i = 0; i < (unsigned) PHI_NUM_ARGS (phi); i++)
- check_loop_closed_ssa_use (PHI_ARG_EDGE (phi, i)->src,
- PHI_ARG_DEF (phi, i));
+ for (bsi = gsi_start_phis (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ {
+ phi = gsi_stmt (bsi);
+ FOR_EACH_EDGE (e, ei, bb->preds)
+ check_loop_closed_ssa_use (e->src,
+ PHI_ARG_DEF_FROM_EDGE (phi, e));
+ }
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- check_loop_closed_ssa_stmt (bb, bsi_stmt (bsi));
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
+ check_loop_closed_ssa_stmt (bb, gsi_stmt (bsi));
}
}
@@ -466,11 +469,14 @@ split_loop_exit_edge (edge exit)
{
basic_block dest = exit->dest;
basic_block bb = split_edge (exit);
- tree phi, new_phi, new_name, name;
+ gimple phi, new_phi;
+ tree new_name, name;
use_operand_p op_p;
+ gimple_stmt_iterator psi;
- for (phi = phi_nodes (dest); phi; phi = PHI_CHAIN (phi))
+ for (psi = gsi_start_phis (dest); !gsi_end_p (psi); gsi_next (&psi))
{
+ phi = gsi_stmt (psi);
op_p = PHI_ARG_DEF_PTR_FROM_EDGE (phi, single_succ_edge (bb));
name = USE_FROM_PTR (op_p);
@@ -507,7 +513,7 @@ ip_end_pos (struct loop *loop)
basic_block
ip_normal_pos (struct loop *loop)
{
- tree last;
+ gimple last;
basic_block bb;
edge exit;
@@ -517,7 +523,7 @@ ip_normal_pos (struct loop *loop)
bb = single_pred (loop->latch);
last = last_stmt (bb);
if (!last
- || TREE_CODE (last) != COND_EXPR)
+ || gimple_code (last) != GIMPLE_COND)
return NULL;
exit = EDGE_SUCC (bb, 0);
@@ -536,21 +542,21 @@ ip_normal_pos (struct loop *loop)
the increment should be inserted after *BSI. */
void
-standard_iv_increment_position (struct loop *loop, block_stmt_iterator *bsi,
+standard_iv_increment_position (struct loop *loop, gimple_stmt_iterator *bsi,
bool *insert_after)
{
basic_block bb = ip_normal_pos (loop), latch = ip_end_pos (loop);
- tree last = last_stmt (latch);
+ gimple last = last_stmt (latch);
if (!bb
- || (last && TREE_CODE (last) != LABEL_EXPR))
+ || (last && gimple_code (last) != GIMPLE_LABEL))
{
- *bsi = bsi_last (latch);
+ *bsi = gsi_last_bb (latch);
*insert_after = true;
}
else
{
- *bsi = bsi_last (bb);
+ *bsi = gsi_last_bb (bb);
*insert_after = false;
}
}
@@ -584,7 +590,7 @@ copy_phi_node_args (unsigned first_new_block)
after the loop has been duplicated. */
bool
-tree_duplicate_loop_to_header_edge (struct loop *loop, edge e,
+gimple_duplicate_loop_to_header_edge (struct loop *loop, edge e,
unsigned int ndupl, sbitmap wont_exit,
edge orig, VEC (edge, heap) **to_remove,
int flags)
@@ -673,7 +679,7 @@ determine_exit_conditions (struct loop *loop, struct tree_niter_desc *desc,
tree *exit_base, tree *exit_step,
enum tree_code *exit_cmp, tree *exit_bound)
{
- tree stmts;
+ gimple_seq stmts;
tree base = desc->control.base;
tree step = desc->control.step;
tree bound = desc->bound;
@@ -748,7 +754,7 @@ determine_exit_conditions (struct loop *loop, struct tree_niter_desc *desc,
cond = force_gimple_operand (unshare_expr (cond), &stmts, false, NULL_TREE);
if (stmts)
- bsi_insert_on_edge_immediate (loop_preheader_edge (loop), stmts);
+ gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
/* cond now may be a gimple comparison, which would be OK, but also any
other gimple rhs (say a && b). In this case we need to force it to
operand. */
@@ -756,16 +762,16 @@ determine_exit_conditions (struct loop *loop, struct tree_niter_desc *desc,
{
cond = force_gimple_operand (cond, &stmts, true, NULL_TREE);
if (stmts)
- bsi_insert_on_edge_immediate (loop_preheader_edge (loop), stmts);
+ gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
}
*enter_cond = cond;
base = force_gimple_operand (unshare_expr (base), &stmts, true, NULL_TREE);
if (stmts)
- bsi_insert_on_edge_immediate (loop_preheader_edge (loop), stmts);
+ gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
bound = force_gimple_operand (unshare_expr (bound), &stmts, true, NULL_TREE);
if (stmts)
- bsi_insert_on_edge_immediate (loop_preheader_edge (loop), stmts);
+ gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
*exit_base = base;
*exit_step = bigstep;
@@ -859,15 +865,18 @@ tree_transform_and_unroll_loop (struct loop *loop, unsigned factor,
transform_callback transform,
void *data)
{
- tree exit_if, ctr_before, ctr_after;
+ gimple exit_if;
+ tree ctr_before, ctr_after;
tree enter_main_cond, exit_base, exit_step, exit_bound;
enum tree_code exit_cmp;
- tree phi_old_loop, phi_new_loop, phi_rest, init, next, new_init, var;
+ gimple phi_old_loop, phi_new_loop, phi_rest;
+ gimple_stmt_iterator psi_old_loop, psi_new_loop;
+ tree init, next, new_init, var;
struct loop *new_loop;
basic_block rest, exit_bb;
edge old_entry, new_entry, old_latch, precond_edge, new_exit;
edge new_nonexit, e;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
use_operand_p op;
bool ok;
unsigned est_niter, prob_entry, scale_unrolled, scale_rest, freq_e, freq_h;
@@ -937,11 +946,12 @@ tree_transform_and_unroll_loop (struct loop *loop, unsigned factor,
REG_BR_PROB_BASE,
REG_BR_PROB_BASE - exit->probability);
- bsi = bsi_last (exit_bb);
- exit_if = build3 (COND_EXPR, void_type_node, boolean_true_node,
- NULL_TREE, NULL_TREE);
+ bsi = gsi_last_bb (exit_bb);
+ exit_if = gimple_build_cond (EQ_EXPR, integer_zero_node,
+ integer_zero_node,
+ NULL_TREE, NULL_TREE);
- bsi_insert_after (&bsi, exit_if, BSI_NEW_STMT);
+ gsi_insert_after (&bsi, exit_if, GSI_NEW_STMT);
new_exit = make_edge (exit_bb, rest, EDGE_FALSE_VALUE | irr);
rescan_loop_exit (new_exit, true, false);
@@ -962,12 +972,14 @@ tree_transform_and_unroll_loop (struct loop *loop, unsigned factor,
old_entry = loop_preheader_edge (loop);
new_entry = loop_preheader_edge (new_loop);
old_latch = loop_latch_edge (loop);
- for (phi_old_loop = phi_nodes (loop->header),
- phi_new_loop = phi_nodes (new_loop->header);
- phi_old_loop;
- phi_old_loop = PHI_CHAIN (phi_old_loop),
- phi_new_loop = PHI_CHAIN (phi_new_loop))
+ for (psi_old_loop = gsi_start_phis (loop->header),
+ psi_new_loop = gsi_start_phis (new_loop->header);
+ !gsi_end_p (psi_old_loop);
+ gsi_next (&psi_old_loop), gsi_next (&psi_new_loop))
{
+ phi_old_loop = gsi_stmt (psi_old_loop);
+ phi_new_loop = gsi_stmt (psi_new_loop);
+
init = PHI_ARG_DEF_FROM_EDGE (phi_old_loop, old_entry);
op = PHI_ARG_DEF_PTR_FROM_EDGE (phi_new_loop, new_entry);
gcc_assert (operand_equal_for_phi_arg_p (init, USE_FROM_PTR (op)));
@@ -986,7 +998,7 @@ tree_transform_and_unroll_loop (struct loop *loop, unsigned factor,
add_referenced_var (var);
}
- new_init = make_ssa_name (var, NULL_TREE);
+ new_init = make_ssa_name (var, NULL);
phi_rest = create_phi_node (new_init, rest);
SSA_NAME_DEF_STMT (new_init) = phi_rest;
@@ -1007,7 +1019,7 @@ tree_transform_and_unroll_loop (struct loop *loop, unsigned factor,
sbitmap_ones (wont_exit);
RESET_BIT (wont_exit, factor - 1);
- ok = tree_duplicate_loop_to_header_edge
+ ok = gimple_duplicate_loop_to_header_edge
(loop, loop_latch_edge (loop), factor - 1,
wont_exit, new_exit, &to_remove, DLTHE_FLAG_UPDATE_FREQ);
free (wont_exit);
@@ -1049,12 +1061,13 @@ tree_transform_and_unroll_loop (struct loop *loop, unsigned factor,
/* Finally create the new counter for number of iterations and add the new
exit instruction. */
- bsi = bsi_last (exit_bb);
- exit_if = bsi_stmt (bsi);
+ bsi = gsi_last_bb (exit_bb);
+ exit_if = gsi_stmt (bsi);
create_iv (exit_base, exit_step, NULL_TREE, loop,
&bsi, false, &ctr_before, &ctr_after);
- COND_EXPR_COND (exit_if) = build2 (exit_cmp, boolean_type_node, ctr_after,
- exit_bound);
+ gimple_cond_set_code (exit_if, exit_cmp);
+ gimple_cond_set_lhs (exit_if, ctr_after);
+ gimple_cond_set_rhs (exit_if, exit_bound);
update_stmt (exit_if);
#ifdef ENABLE_CHECKING
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index 80b45c298b7..33aacae83b5 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -368,7 +368,8 @@ bound_difference (struct loop *loop, tree x, tree y, bounds *bnds)
int cnt = 0;
edge e;
basic_block bb;
- tree cond, c0, c1;
+ tree c0, c1;
+ gimple cond;
enum tree_code cmp;
/* Get rid of unnecessary casts, but preserve the value of
@@ -427,12 +428,10 @@ bound_difference (struct loop *loop, tree x, tree y, bounds *bnds)
if (!(e->flags & (EDGE_TRUE_VALUE | EDGE_FALSE_VALUE)))
continue;
- cond = COND_EXPR_COND (last_stmt (e->src));
- if (!COMPARISON_CLASS_P (cond))
- continue;
- c0 = TREE_OPERAND (cond, 0);
- cmp = TREE_CODE (cond);
- c1 = TREE_OPERAND (cond, 1);
+ cond = last_stmt (e->src);
+ c0 = gimple_cond_lhs (cond);
+ cmp = gimple_cond_code (cond);
+ c1 = gimple_cond_rhs (cond);
if (e->flags & EDGE_FALSE_VALUE)
cmp = invert_tree_comparison (cmp, false);
@@ -698,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);
@@ -720,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);
@@ -1349,7 +1348,7 @@ simplify_replace_tree (tree expr, tree old, tree new_tree)
|| operand_equal_p (expr, old, 0))
return unshare_expr (new_tree);
- if (!EXPR_P (expr) && !GIMPLE_STMT_P (expr))
+ if (!EXPR_P (expr))
return expr;
n = TREE_OPERAND_LENGTH (expr);
@@ -1376,8 +1375,9 @@ tree
expand_simple_operations (tree expr)
{
unsigned i, n;
- tree ret = NULL_TREE, e, ee, stmt;
+ tree ret = NULL_TREE, e, ee, e1;
enum tree_code code;
+ gimple stmt;
if (expr == NULL_TREE)
return expr;
@@ -1415,17 +1415,17 @@ expand_simple_operations (tree expr)
return expr;
stmt = SSA_NAME_DEF_STMT (expr);
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
{
basic_block src, dest;
- if (PHI_NUM_ARGS (stmt) != 1)
+ if (gimple_phi_num_args (stmt) != 1)
return expr;
e = PHI_ARG_DEF (stmt, 0);
/* Avoid propagating through loop exit phi nodes, which
could break loop-closed SSA form restrictions. */
- dest = bb_for_stmt (stmt);
+ dest = gimple_bb (stmt);
src = single_pred (dest);
if (TREE_CODE (e) == SSA_NAME
&& src->loop_father != dest->loop_father)
@@ -1433,24 +1433,43 @@ expand_simple_operations (tree expr)
return expand_simple_operations (e);
}
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
return expr;
- e = GIMPLE_STMT_OPERAND (stmt, 1);
- if (/* Casts are simple. */
- !CONVERT_EXPR_P (e)
- /* Copies are simple. */
- && TREE_CODE (e) != SSA_NAME
- /* Assignments of invariants are simple. */
- && !is_gimple_min_invariant (e)
+ e = gimple_assign_rhs1 (stmt);
+ code = gimple_assign_rhs_code (stmt);
+ if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS)
+ {
+ if (is_gimple_min_invariant (e))
+ return e;
+
+ if (code == SSA_NAME)
+ return expand_simple_operations (e);
+
+ return expr;
+ }
+
+ switch (code)
+ {
+ CASE_CONVERT:
+ /* Casts are simple. */
+ ee = expand_simple_operations (e);
+ return fold_build1 (code, TREE_TYPE (expr), ee);
+
+ case PLUS_EXPR:
+ case MINUS_EXPR:
+ case POINTER_PLUS_EXPR:
/* And increments and decrements by a constant are simple. */
- && !((TREE_CODE (e) == PLUS_EXPR
- || TREE_CODE (e) == MINUS_EXPR
- || TREE_CODE (e) == POINTER_PLUS_EXPR)
- && is_gimple_min_invariant (TREE_OPERAND (e, 1))))
- return expr;
+ e1 = gimple_assign_rhs2 (stmt);
+ if (!is_gimple_min_invariant (e1))
+ return expr;
- return expand_simple_operations (e);
+ ee = expand_simple_operations (e);
+ return fold_build2 (code, TREE_TYPE (expr), ee, e1);
+
+ default:
+ return expr;
+ }
}
/* Tries to simplify EXPR using the condition COND. Returns the simplified
@@ -1585,6 +1604,7 @@ simplify_using_initial_conditions (struct loop *loop, tree expr)
{
edge e;
basic_block bb;
+ gimple stmt;
tree cond;
int cnt = 0;
@@ -1605,7 +1625,11 @@ simplify_using_initial_conditions (struct loop *loop, tree expr)
if (!(e->flags & (EDGE_TRUE_VALUE | EDGE_FALSE_VALUE)))
continue;
- cond = COND_EXPR_COND (last_stmt (e->src));
+ stmt = last_stmt (e->src);
+ cond = fold_build2 (gimple_cond_code (stmt),
+ boolean_type_node,
+ gimple_cond_lhs (stmt),
+ gimple_cond_rhs (stmt));
if (e->flags & EDGE_FALSE_VALUE)
cond = invert_truthvalue (cond);
expr = tree_simplify_using_condition (cond, expr);
@@ -1676,9 +1700,9 @@ bool
loop_only_exit_p (const struct loop *loop, const_edge exit)
{
basic_block *body;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
unsigned i;
- tree call;
+ gimple call;
if (exit != single_exit (loop))
return false;
@@ -1686,10 +1710,13 @@ loop_only_exit_p (const struct loop *loop, const_edge exit)
body = get_loop_body (loop);
for (i = 0; i < loop->num_nodes; i++)
{
- for (bsi = bsi_start (body[0]); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (bsi = gsi_start_bb (body[i]); !gsi_end_p (bsi); gsi_next (&bsi))
{
- call = get_call_expr_in (bsi_stmt (bsi));
- if (call && TREE_SIDE_EFFECTS (call))
+ call = gsi_stmt (bsi);
+ if (gimple_code (call) != GIMPLE_CALL)
+ continue;
+
+ if (gimple_has_side_effects (call))
{
free (body);
return false;
@@ -1714,7 +1741,8 @@ number_of_iterations_exit (struct loop *loop, edge exit,
struct tree_niter_desc *niter,
bool warn)
{
- tree stmt, cond, type;
+ gimple stmt;
+ tree type;
tree op0, op1;
enum tree_code code;
affine_iv iv0, iv1;
@@ -1724,15 +1752,14 @@ number_of_iterations_exit (struct loop *loop, edge exit,
niter->assumptions = boolean_false_node;
stmt = last_stmt (exit->src);
- if (!stmt || TREE_CODE (stmt) != COND_EXPR)
+ if (!stmt || gimple_code (stmt) != GIMPLE_COND)
return false;
/* We want the condition for staying inside loop. */
- cond = COND_EXPR_COND (stmt);
+ code = gimple_cond_code (stmt);
if (exit->flags & EDGE_TRUE_VALUE)
- cond = invert_truthvalue (cond);
+ code = invert_tree_comparison (code, false);
- code = TREE_CODE (cond);
switch (code)
{
case GT_EXPR:
@@ -1746,8 +1773,8 @@ number_of_iterations_exit (struct loop *loop, edge exit,
return false;
}
- op0 = TREE_OPERAND (cond, 0);
- op1 = TREE_OPERAND (cond, 1);
+ op0 = gimple_cond_lhs (stmt);
+ op1 = gimple_cond_rhs (stmt);
type = TREE_TYPE (op0);
if (TREE_CODE (type) != INTEGER_TYPE
@@ -1805,7 +1832,7 @@ number_of_iterations_exit (struct loop *loop, edge exit,
if (warn)
{
const char *wording;
- location_t loc = EXPR_LOCATION (stmt);
+ location_t loc = gimple_location (stmt);
/* We can provide a more specific warning if one of the operator is
constant and the other advances by +1 or -1. */
@@ -1915,36 +1942,43 @@ find_loop_niter (struct loop *loop, edge *exit)
result by a chain of operations such that all but exactly one of their
operands are constants. */
-static tree
+static gimple
chain_of_csts_start (struct loop *loop, tree x)
{
- tree stmt = SSA_NAME_DEF_STMT (x);
+ gimple stmt = SSA_NAME_DEF_STMT (x);
tree use;
- basic_block bb = bb_for_stmt (stmt);
+ basic_block bb = gimple_bb (stmt);
+ enum tree_code code;
if (!bb
|| !flow_bb_inside_loop_p (loop, bb))
- return NULL_TREE;
+ return NULL;
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
{
if (bb == loop->header)
return stmt;
- return NULL_TREE;
+ return NULL;
}
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
- return NULL_TREE;
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
+ return NULL;
- if (!ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS))
- return NULL_TREE;
- if (SINGLE_SSA_DEF_OPERAND (stmt, SSA_OP_DEF) == NULL_DEF_OPERAND_P)
- return NULL_TREE;
+ code = gimple_assign_rhs_code (stmt);
+ if (gimple_references_memory_p (stmt)
+ /* Before alias information is computed, operand scanning marks
+ statements that write memory volatile. However, the statements
+ that only read memory are not marked, thus gimple_references_memory_p
+ returns false for them. */
+ || TREE_CODE_CLASS (code) == tcc_reference
+ || TREE_CODE_CLASS (code) == tcc_declaration
+ || SINGLE_SSA_DEF_OPERAND (stmt, SSA_OP_DEF) == NULL_DEF_OPERAND_P)
+ return NULL;
use = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_USE);
if (use == NULL_USE_OPERAND_P)
- return NULL_TREE;
+ return NULL;
return chain_of_csts_start (loop, use);
}
@@ -1957,32 +1991,32 @@ chain_of_csts_start (struct loop *loop, tree x)
* the value of the phi node in the next iteration can be derived from the
value in the current iteration by a chain of operations with constants.
- If such phi node exists, it is returned. If X is a constant, X is returned
- unchanged. Otherwise NULL_TREE is returned. */
+ If such phi node exists, it is returned, otherwise NULL is returned. */
-static tree
+static gimple
get_base_for (struct loop *loop, tree x)
{
- tree phi, init, next;
+ gimple phi;
+ tree init, next;
if (is_gimple_min_invariant (x))
- return x;
+ return NULL;
phi = chain_of_csts_start (loop, x);
if (!phi)
- return NULL_TREE;
+ return NULL;
init = PHI_ARG_DEF_FROM_EDGE (phi, loop_preheader_edge (loop));
next = PHI_ARG_DEF_FROM_EDGE (phi, loop_latch_edge (loop));
if (TREE_CODE (next) != SSA_NAME)
- return NULL_TREE;
+ return NULL;
if (!is_gimple_min_invariant (init))
- return NULL_TREE;
+ return NULL;
if (chain_of_csts_start (loop, next) != phi)
- return NULL_TREE;
+ return NULL;
return phi;
}
@@ -1998,9 +2032,7 @@ get_base_for (struct loop *loop, tree x)
static tree
get_val_for (tree x, tree base)
{
- tree stmt, nx, val;
- use_operand_p op;
- ssa_op_iter iter;
+ gimple stmt;
gcc_assert (is_gimple_min_invariant (base));
@@ -2008,24 +2040,41 @@ get_val_for (tree x, tree base)
return base;
stmt = SSA_NAME_DEF_STMT (x);
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
return base;
- FOR_EACH_SSA_USE_OPERAND (op, stmt, iter, SSA_OP_USE)
+ gcc_assert (is_gimple_assign (stmt));
+
+ /* 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. */
+ 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)
{
- nx = USE_FROM_PTR (op);
- val = get_val_for (nx, base);
- SET_USE (op, val);
- val = fold (GIMPLE_STMT_OPERAND (stmt, 1));
- SET_USE (op, nx);
- /* only iterate loop once. */
- return val;
+ return fold_build1 (gimple_assign_rhs_code (stmt),
+ gimple_expr_type (stmt),
+ get_val_for (gimple_assign_rhs1 (stmt), base));
}
-
- /* Should never reach here. */
- gcc_unreachable ();
+ 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
+ gcc_unreachable ();
}
+
/* Tries to count the number of iterations of LOOP till it exits by EXIT
by brute force -- i.e. by determining the value of the operands of the
condition at EXIT in first few iterations of the loop (assuming that
@@ -2036,20 +2085,20 @@ get_val_for (tree x, tree base)
tree
loop_niter_by_eval (struct loop *loop, edge exit)
{
- tree cond, cnd, acnd;
- tree op[2], val[2], next[2], aval[2], phi[2];
+ tree acnd;
+ tree op[2], val[2], next[2], aval[2];
+ gimple phi, cond;
unsigned i, j;
enum tree_code cmp;
cond = last_stmt (exit->src);
- if (!cond || TREE_CODE (cond) != COND_EXPR)
+ if (!cond || gimple_code (cond) != GIMPLE_COND)
return chrec_dont_know;
- cnd = COND_EXPR_COND (cond);
+ cmp = gimple_cond_code (cond);
if (exit->flags & EDGE_TRUE_VALUE)
- cnd = invert_truthvalue (cnd);
+ cmp = invert_tree_comparison (cmp, false);
- cmp = TREE_CODE (cnd);
switch (cmp)
{
case EQ_EXPR:
@@ -2058,8 +2107,8 @@ loop_niter_by_eval (struct loop *loop, edge exit)
case GE_EXPR:
case LT_EXPR:
case LE_EXPR:
- for (j = 0; j < 2; j++)
- op[j] = TREE_OPERAND (cnd, j);
+ op[0] = gimple_cond_lhs (cond);
+ op[1] = gimple_cond_rhs (cond);
break;
default:
@@ -2068,23 +2117,19 @@ loop_niter_by_eval (struct loop *loop, edge exit)
for (j = 0; j < 2; j++)
{
- phi[j] = get_base_for (loop, op[j]);
- if (!phi[j])
- return chrec_dont_know;
- }
-
- for (j = 0; j < 2; j++)
- {
- if (TREE_CODE (phi[j]) == PHI_NODE)
+ if (is_gimple_min_invariant (op[j]))
{
- val[j] = PHI_ARG_DEF_FROM_EDGE (phi[j], loop_preheader_edge (loop));
- next[j] = PHI_ARG_DEF_FROM_EDGE (phi[j], loop_latch_edge (loop));
+ val[j] = op[j];
+ next[j] = NULL_TREE;
+ op[j] = NULL_TREE;
}
else
{
- val[j] = phi[j];
- next[j] = NULL_TREE;
- op[j] = NULL_TREE;
+ phi = get_base_for (loop, op[j]);
+ if (!phi)
+ return chrec_dont_know;
+ val[j] = PHI_ARG_DEF_FROM_EDGE (phi, loop_preheader_edge (loop));
+ next[j] = PHI_ARG_DEF_FROM_EDGE (phi, loop_latch_edge (loop));
}
}
@@ -2166,17 +2211,48 @@ find_loop_niter_by_eval (struct loop *loop, edge *exit)
*/
+static double_int derive_constant_upper_bound_ops (tree, tree,
+ enum tree_code, tree);
+
+/* Returns a constant upper bound on the value of the right-hand side of
+ an assignment statement STMT. */
+
+static double_int
+derive_constant_upper_bound_assign (gimple stmt)
+{
+ enum tree_code code = gimple_assign_rhs_code (stmt);
+ tree op0 = gimple_assign_rhs1 (stmt);
+ tree op1 = gimple_assign_rhs2 (stmt);
+
+ return derive_constant_upper_bound_ops (TREE_TYPE (gimple_assign_lhs (stmt)),
+ op0, code, op1);
+}
+
/* Returns a constant upper bound on the value of expression VAL. VAL
is considered to be unsigned. If its type is signed, its value must
be nonnegative. */
static double_int
-derive_constant_upper_bound (const_tree val)
+derive_constant_upper_bound (tree val)
{
- tree type = TREE_TYPE (val);
- tree op0, op1, subtype, maxt;
+ enum tree_code code;
+ tree op0, op1;
+
+ extract_ops_from_tree (val, &code, &op0, &op1);
+ return derive_constant_upper_bound_ops (TREE_TYPE (val), op0, code, op1);
+}
+
+/* Returns a constant upper bound on the value of expression OP0 CODE OP1,
+ whose type is TYPE. The expression is considered to be unsigned. If
+ its type is signed, its value must be nonnegative. */
+
+static double_int
+derive_constant_upper_bound_ops (tree type, tree op0,
+ enum tree_code code, tree op1)
+{
+ tree subtype, maxt;
double_int bnd, max, mmax, cst;
- tree stmt;
+ gimple stmt;
if (INTEGRAL_TYPE_P (type))
maxt = TYPE_MAX_VALUE (type);
@@ -2185,13 +2261,12 @@ derive_constant_upper_bound (const_tree val)
max = tree_to_double_int (maxt);
- switch (TREE_CODE (val))
+ switch (code)
{
case INTEGER_CST:
- return tree_to_double_int (val);
+ return tree_to_double_int (op0);
CASE_CONVERT:
- op0 = TREE_OPERAND (val, 0);
subtype = TREE_TYPE (op0);
if (!TYPE_UNSIGNED (subtype)
/* If TYPE is also signed, the fact that VAL is nonnegative implies
@@ -2219,9 +2294,6 @@ derive_constant_upper_bound (const_tree val)
case PLUS_EXPR:
case POINTER_PLUS_EXPR:
case MINUS_EXPR:
- op0 = TREE_OPERAND (val, 0);
- op1 = TREE_OPERAND (val, 1);
-
if (TREE_CODE (op1) != INTEGER_CST
|| !tree_expr_nonnegative_p (op0))
return max;
@@ -2231,7 +2303,7 @@ derive_constant_upper_bound (const_tree val)
of the signedness of the type. */
cst = tree_to_double_int (op1);
cst = double_int_sext (cst, TYPE_PRECISION (type));
- if (TREE_CODE (val) == PLUS_EXPR)
+ if (code != MINUS_EXPR)
cst = double_int_neg (cst);
bnd = derive_constant_upper_bound (op0);
@@ -2285,8 +2357,6 @@ derive_constant_upper_bound (const_tree val)
case FLOOR_DIV_EXPR:
case EXACT_DIV_EXPR:
- op0 = TREE_OPERAND (val, 0);
- op1 = TREE_OPERAND (val, 1);
if (TREE_CODE (op1) != INTEGER_CST
|| tree_int_cst_sign_bit (op1))
return max;
@@ -2295,18 +2365,17 @@ derive_constant_upper_bound (const_tree val)
return double_int_udiv (bnd, tree_to_double_int (op1), FLOOR_DIV_EXPR);
case BIT_AND_EXPR:
- op1 = TREE_OPERAND (val, 1);
if (TREE_CODE (op1) != INTEGER_CST
|| tree_int_cst_sign_bit (op1))
return max;
return tree_to_double_int (op1);
case SSA_NAME:
- stmt = SSA_NAME_DEF_STMT (val);
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT
- || GIMPLE_STMT_OPERAND (stmt, 0) != val)
+ stmt = SSA_NAME_DEF_STMT (op0);
+ if (gimple_code (stmt) != GIMPLE_ASSIGN
+ || gimple_assign_lhs (stmt) != op0)
return max;
- return derive_constant_upper_bound (GIMPLE_STMT_OPERAND (stmt, 1));
+ return derive_constant_upper_bound_assign (stmt);
default:
return max;
@@ -2349,7 +2418,7 @@ record_niter_bound (struct loop *loop, double_int i_bound, bool realistic,
static void
record_estimate (struct loop *loop, tree bound, double_int i_bound,
- tree at_stmt, bool is_exit, bool realistic, bool upper)
+ gimple at_stmt, bool is_exit, bool realistic, bool upper)
{
double_int delta;
edge exit;
@@ -2357,7 +2426,7 @@ record_estimate (struct loop *loop, tree bound, double_int i_bound,
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Statement %s", is_exit ? "(exit)" : "");
- print_generic_expr (dump_file, at_stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, at_stmt, 0, TDF_SLIM);
fprintf (dump_file, " is %sexecuted at most ",
upper ? "" : "probably ");
print_generic_expr (dump_file, bound, TDF_SLIM);
@@ -2395,7 +2464,7 @@ record_estimate (struct loop *loop, tree bound, double_int i_bound,
if (is_exit
|| (exit != NULL
&& dominated_by_p (CDI_DOMINATORS,
- exit->src, bb_for_stmt (at_stmt))))
+ exit->src, gimple_bb (at_stmt))))
delta = double_int_one;
else
delta = double_int_two;
@@ -2415,7 +2484,7 @@ record_estimate (struct loop *loop, tree bound, double_int i_bound,
UPPER is true if we are sure the induction variable does not wrap. */
static void
-record_nonwrapping_iv (struct loop *loop, tree base, tree step, tree stmt,
+record_nonwrapping_iv (struct loop *loop, tree base, tree step, gimple stmt,
tree low, tree high, bool realistic, bool upper)
{
tree niter_bound, extreme, delta;
@@ -2434,7 +2503,7 @@ record_nonwrapping_iv (struct loop *loop, tree base, tree step, tree stmt,
fprintf (dump_file, " + ");
print_generic_expr (dump_file, step, TDF_SLIM);
fprintf (dump_file, " * iteration does not wrap in statement ");
- print_generic_expr (dump_file, stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
fprintf (dump_file, " in loop %d.\n", loop->num);
}
@@ -2515,7 +2584,7 @@ array_at_struct_end_p (tree ref)
struct ilb_data
{
struct loop *loop;
- tree stmt;
+ gimple stmt;
bool reliable;
};
@@ -2602,7 +2671,7 @@ idx_infer_loop_bounds (tree base, tree *idx, void *dta)
STMT is guaranteed to be executed in every iteration of LOOP.*/
static void
-infer_loop_bounds_from_ref (struct loop *loop, tree stmt, tree ref,
+infer_loop_bounds_from_ref (struct loop *loop, gimple stmt, tree ref,
bool reliable)
{
struct ilb_data data;
@@ -2618,14 +2687,12 @@ infer_loop_bounds_from_ref (struct loop *loop, tree stmt, tree ref,
executed in every iteration of LOOP. */
static void
-infer_loop_bounds_from_array (struct loop *loop, tree stmt, bool reliable)
+infer_loop_bounds_from_array (struct loop *loop, gimple stmt, bool reliable)
{
- tree call;
-
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_assign (stmt))
{
- tree op0 = GIMPLE_STMT_OPERAND (stmt, 0);
- tree op1 = GIMPLE_STMT_OPERAND (stmt, 1);
+ tree op0 = gimple_assign_lhs (stmt);
+ tree op1 = gimple_assign_rhs1 (stmt);
/* For each memory access, analyze its access function
and record a bound on the loop iteration domain. */
@@ -2635,17 +2702,21 @@ infer_loop_bounds_from_array (struct loop *loop, tree stmt, bool reliable)
if (REFERENCE_CLASS_P (op1))
infer_loop_bounds_from_ref (loop, stmt, op1, reliable);
}
-
-
- call = get_call_expr_in (stmt);
- if (call)
+ else if (is_gimple_call (stmt))
{
- tree arg;
- call_expr_arg_iterator iter;
+ tree arg, lhs;
+ unsigned i, n = gimple_call_num_args (stmt);
+
+ lhs = gimple_call_lhs (stmt);
+ if (lhs && REFERENCE_CLASS_P (lhs))
+ infer_loop_bounds_from_ref (loop, stmt, lhs, reliable);
- FOR_EACH_CALL_EXPR_ARG (arg, iter, call)
- if (REFERENCE_CLASS_P (arg))
- infer_loop_bounds_from_ref (loop, stmt, arg, reliable);
+ for (i = 0; i < n; i++)
+ {
+ arg = gimple_call_arg (stmt, i);
+ if (REFERENCE_CLASS_P (arg))
+ infer_loop_bounds_from_ref (loop, stmt, arg, reliable);
+ }
}
}
@@ -2653,14 +2724,14 @@ infer_loop_bounds_from_array (struct loop *loop, tree stmt, bool reliable)
that signed arithmetics in STMT does not overflow. */
static void
-infer_loop_bounds_from_signedness (struct loop *loop, tree stmt)
+infer_loop_bounds_from_signedness (struct loop *loop, gimple stmt)
{
tree def, base, step, scev, type, low, high;
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
return;
- def = GIMPLE_STMT_OPERAND (stmt, 0);
+ def = gimple_assign_lhs (stmt);
if (TREE_CODE (def) != SSA_NAME)
return;
@@ -2703,7 +2774,7 @@ infer_loop_bounds_from_undefined (struct loop *loop)
{
unsigned i;
basic_block *bbs;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
basic_block bb;
bool reliable;
@@ -2718,9 +2789,9 @@ infer_loop_bounds_from_undefined (struct loop *loop)
# of iterations of the loop. However, we can use it as a guess. */
reliable = dominated_by_p (CDI_DOMINATORS, loop->latch, bb);
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (bsi);
infer_loop_bounds_from_array (loop, stmt, reliable);
@@ -2830,9 +2901,9 @@ estimate_numbers_of_iterations (void)
/* Returns true if statement S1 dominates statement S2. */
bool
-stmt_dominates_stmt_p (tree s1, tree s2)
+stmt_dominates_stmt_p (gimple s1, gimple s2)
{
- basic_block bb1 = bb_for_stmt (s1), bb2 = bb_for_stmt (s2);
+ basic_block bb1 = gimple_bb (s1), bb2 = gimple_bb (s2);
if (!bb1
|| s1 == s2)
@@ -2840,10 +2911,16 @@ stmt_dominates_stmt_p (tree s1, tree s2)
if (bb1 == bb2)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
+
+ if (gimple_code (s2) == GIMPLE_PHI)
+ return false;
+
+ if (gimple_code (s1) == GIMPLE_PHI)
+ return true;
- for (bsi = bsi_start (bb1); bsi_stmt (bsi) != s2; bsi_next (&bsi))
- if (bsi_stmt (bsi) == s1)
+ for (bsi = gsi_start_bb (bb1); gsi_stmt (bsi) != s2; gsi_next (&bsi))
+ if (gsi_stmt (bsi) == s1)
return true;
return false;
@@ -2859,7 +2936,7 @@ stmt_dominates_stmt_p (tree s1, tree s2)
statements in the loop. */
static bool
-n_of_executions_at_most (tree stmt,
+n_of_executions_at_most (gimple stmt,
struct nb_iter_bound *niter_bound,
tree niter)
{
@@ -2900,7 +2977,7 @@ n_of_executions_at_most (tree stmt,
else
{
if (!stmt
- || (bb_for_stmt (stmt) != bb_for_stmt (niter_bound->stmt)
+ || (gimple_bb (stmt) != gimple_bb (niter_bound->stmt)
&& !stmt_dominates_stmt_p (niter_bound->stmt, stmt)))
{
bound = double_int_add (bound, double_int_one);
@@ -2943,7 +3020,7 @@ nowrap_type_p (tree type)
bool
scev_probably_wraps_p (tree base, tree step,
- tree at_stmt, struct loop *loop,
+ gimple at_stmt, struct loop *loop,
bool use_overflow_semantics)
{
struct nb_iter_bound *bound;
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c
index 14044c407d7..6da4bf232aa 100644
--- a/gcc/tree-ssa-loop-prefetch.c
+++ b/gcc/tree-ssa-loop-prefetch.c
@@ -201,7 +201,7 @@ struct mem_ref_group
struct mem_ref
{
- tree stmt; /* Statement in that the reference appears. */
+ gimple stmt; /* Statement in that the reference appears. */
tree mem; /* The reference. */
HOST_WIDE_INT delta; /* Constant offset of the reference. */
struct mem_ref_group *group; /* The group of references it belongs to. */
@@ -278,7 +278,7 @@ find_or_create_group (struct mem_ref_group **groups, tree base,
WRITE_P. The reference occurs in statement STMT. */
static void
-record_ref (struct mem_ref_group *group, tree stmt, tree mem,
+record_ref (struct mem_ref_group *group, gimple stmt, tree mem,
HOST_WIDE_INT delta, bool write_p)
{
struct mem_ref **aref;
@@ -344,7 +344,7 @@ release_mem_refs (struct mem_ref_group *groups)
struct ar_data
{
struct loop *loop; /* Loop of the reference. */
- tree stmt; /* Statement of the reference. */
+ gimple stmt; /* Statement of the reference. */
HOST_WIDE_INT *step; /* Step of the memory reference. */
HOST_WIDE_INT *delta; /* Offset of the memory reference. */
};
@@ -411,7 +411,7 @@ idx_analyze_ref (tree base, tree *index, void *data)
static bool
analyze_ref (struct loop *loop, tree *ref_p, tree *base,
HOST_WIDE_INT *step, HOST_WIDE_INT *delta,
- tree stmt)
+ gimple stmt)
{
struct ar_data ar_data;
tree off;
@@ -451,7 +451,7 @@ analyze_ref (struct loop *loop, tree *ref_p, tree *base,
static bool
gather_memory_references_ref (struct loop *loop, struct mem_ref_group **refs,
- tree ref, bool write_p, tree stmt)
+ tree ref, bool write_p, gimple stmt)
{
tree base;
HOST_WIDE_INT step, delta;
@@ -480,8 +480,9 @@ gather_memory_references (struct loop *loop, bool *no_other_refs)
basic_block *body = get_loop_body_in_dom_order (loop);
basic_block bb;
unsigned i;
- block_stmt_iterator bsi;
- tree stmt, lhs, rhs, call;
+ gimple_stmt_iterator bsi;
+ gimple stmt;
+ tree lhs, rhs;
struct mem_ref_group *refs = NULL;
*no_other_refs = true;
@@ -494,22 +495,21 @@ gather_memory_references (struct loop *loop, bool *no_other_refs)
if (bb->loop_father != loop)
continue;
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
{
- stmt = bsi_stmt (bsi);
- call = get_call_expr_in (stmt);
- if (call && !(call_expr_flags (call) & ECF_CONST))
- *no_other_refs = false;
+ stmt = gsi_stmt (bsi);
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
{
- if (!ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS))
+ if (!ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS)
+ || (is_gimple_call (stmt)
+ && !(gimple_call_flags (stmt) & ECF_CONST)))
*no_other_refs = false;
continue;
}
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ lhs = gimple_assign_lhs (stmt);
+ rhs = gimple_assign_rhs1 (stmt);
if (REFERENCE_CLASS_P (rhs))
*no_other_refs &= gather_memory_references_ref (loop, &refs,
@@ -869,8 +869,9 @@ static void
issue_prefetch_ref (struct mem_ref *ref, unsigned unroll_factor, unsigned ahead)
{
HOST_WIDE_INT delta;
- tree addr, addr_base, prefetch, write_p, local;
- block_stmt_iterator bsi;
+ tree addr, addr_base, write_p, local;
+ gimple prefetch;
+ gimple_stmt_iterator bsi;
unsigned n_prefetches, ap;
bool nontemporal = ref->reuse_distance >= L2_CACHE_SIZE_BYTES;
@@ -879,13 +880,13 @@ issue_prefetch_ref (struct mem_ref *ref, unsigned unroll_factor, unsigned ahead)
nontemporal ? " nontemporal" : "",
(void *) ref);
- bsi = bsi_for_stmt (ref->stmt);
+ bsi = gsi_for_stmt (ref->stmt);
n_prefetches = ((unroll_factor + ref->prefetch_mod - 1)
/ ref->prefetch_mod);
addr_base = build_fold_addr_expr_with_type (ref->mem, ptr_type_node);
- addr_base = force_gimple_operand_bsi (&bsi, unshare_expr (addr_base),
- true, NULL, true, BSI_SAME_STMT);
+ addr_base = force_gimple_operand_gsi (&bsi, unshare_expr (addr_base),
+ true, NULL, true, GSI_SAME_STMT);
write_p = ref->write_p ? integer_one_node : integer_zero_node;
local = build_int_cst (integer_type_node, nontemporal ? 0 : 3);
@@ -895,13 +896,13 @@ issue_prefetch_ref (struct mem_ref *ref, unsigned unroll_factor, unsigned ahead)
delta = (ahead + ap * ref->prefetch_mod) * ref->group->step;
addr = fold_build2 (POINTER_PLUS_EXPR, ptr_type_node,
addr_base, size_int (delta));
- addr = force_gimple_operand_bsi (&bsi, unshare_expr (addr), true, NULL,
- true, BSI_SAME_STMT);
+ addr = force_gimple_operand_gsi (&bsi, unshare_expr (addr), true, NULL,
+ true, GSI_SAME_STMT);
/* Create the prefetch instruction. */
- prefetch = build_call_expr (built_in_decls[BUILT_IN_PREFETCH],
- 3, addr, write_p, local);
- bsi_insert_before (&bsi, prefetch, BSI_SAME_STMT);
+ prefetch = gimple_build_call (built_in_decls[BUILT_IN_PREFETCH],
+ 3, addr, write_p, local);
+ gsi_insert_before (&bsi, prefetch, GSI_SAME_STMT);
}
}
@@ -960,7 +961,7 @@ mark_nontemporal_store (struct mem_ref *ref)
fprintf (dump_file, "Marked reference %p as a nontemporal store.\n",
(void *) ref);
- MOVE_NONTEMPORAL (ref->stmt) = true;
+ gimple_assign_set_nontemporal_move (ref->stmt, true);
ref->storent_p = true;
return true;
@@ -973,22 +974,22 @@ emit_mfence_after_loop (struct loop *loop)
{
VEC (edge, heap) *exits = get_loop_exit_edges (loop);
edge exit;
- tree call;
- block_stmt_iterator bsi;
+ gimple call;
+ gimple_stmt_iterator bsi;
unsigned i;
for (i = 0; VEC_iterate (edge, exits, i, exit); i++)
{
- call = build_function_call_expr (FENCE_FOLLOWING_MOVNT, NULL_TREE);
+ call = gimple_build_call (FENCE_FOLLOWING_MOVNT, 0);
if (!single_pred_p (exit->dest)
/* If possible, we prefer not to insert the fence on other paths
in cfg. */
&& !(exit->flags & EDGE_ABNORMAL))
split_loop_exit_edge (exit);
- bsi = bsi_after_labels (exit->dest);
+ bsi = gsi_after_labels (exit->dest);
- bsi_insert_before (&bsi, call, BSI_NEW_STMT);
+ gsi_insert_before (&bsi, call, GSI_NEW_STMT);
mark_virtual_ops_for_renaming (call);
}
@@ -1459,7 +1460,7 @@ loop_prefetch_arrays (struct loop *loop)
struct tree_niter_desc desc;
bool unrolled = false, no_other_refs;
- if (!maybe_hot_bb_p (loop->header))
+ if (optimize_loop_nest_for_size_p (loop))
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, " ignored (cold area)\n");
diff --git a/gcc/tree-ssa-loop-unswitch.c b/gcc/tree-ssa-loop-unswitch.c
index b63c2095df4..850270f49c0 100644
--- a/gcc/tree-ssa-loop-unswitch.c
+++ b/gcc/tree-ssa-loop-unswitch.c
@@ -103,26 +103,29 @@ tree_ssa_unswitch_loops (void)
static tree
tree_may_unswitch_on (basic_block bb, struct loop *loop)
{
- tree stmt, def, cond, use;
+ gimple stmt, def;
+ tree cond, use;
basic_block def_bb;
ssa_op_iter iter;
/* BB must end in a simple conditional jump. */
stmt = last_stmt (bb);
- if (!stmt || TREE_CODE (stmt) != COND_EXPR)
+ if (!stmt || gimple_code (stmt) != GIMPLE_COND)
return NULL_TREE;
/* Condition must be invariant. */
FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_USE)
{
def = SSA_NAME_DEF_STMT (use);
- def_bb = bb_for_stmt (def);
+ def_bb = gimple_bb (def);
if (def_bb
&& flow_bb_inside_loop_p (loop, def_bb))
return NULL_TREE;
}
- cond = COND_EXPR_COND (stmt);
+ cond = build2 (gimple_cond_code (stmt), boolean_type_node,
+ gimple_cond_lhs (stmt), gimple_cond_rhs (stmt));
+
/* To keep the things simple, we do not directly remove the conditions,
but just replace tests with 0/1. Prevent the infinite loop where we
would unswitch again on such a condition. */
@@ -140,14 +143,18 @@ static tree
simplify_using_entry_checks (struct loop *loop, tree cond)
{
edge e = loop_preheader_edge (loop);
- tree stmt;
+ gimple stmt;
while (1)
{
stmt = last_stmt (e->src);
if (stmt
- && TREE_CODE (stmt) == COND_EXPR
- && operand_equal_p (COND_EXPR_COND (stmt), cond, 0))
+ && gimple_code (stmt) == GIMPLE_COND
+ && gimple_cond_code (stmt) == TREE_CODE (cond)
+ && operand_equal_p (gimple_cond_lhs (stmt),
+ TREE_OPERAND (cond, 0), 0)
+ && operand_equal_p (gimple_cond_rhs (stmt),
+ TREE_OPERAND (cond, 1), 0))
return (e->flags & EDGE_TRUE_VALUE
? boolean_true_node
: boolean_false_node);
@@ -171,7 +178,8 @@ tree_unswitch_single_loop (struct loop *loop, int num)
basic_block *bbs;
struct loop *nloop;
unsigned i;
- tree cond = NULL_TREE, stmt;
+ tree cond = NULL_TREE;
+ gimple stmt;
bool changed = false;
/* Do not unswitch too much. */
@@ -220,13 +228,13 @@ tree_unswitch_single_loop (struct loop *loop, int num)
if (integer_nonzerop (cond))
{
/* Remove false path. */
- COND_EXPR_COND (stmt) = boolean_true_node;
+ gimple_cond_set_condition_from_tree (stmt, boolean_true_node);
changed = true;
}
else if (integer_zerop (cond))
{
/* Remove true path. */
- COND_EXPR_COND (stmt) = boolean_false_node;
+ gimple_cond_set_condition_from_tree (stmt, boolean_false_node);
changed = true;
}
else
diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c
index 52f5a7f58f8..ec3782a5450 100644
--- a/gcc/tree-ssa-loop.c
+++ b/gcc/tree-ssa-loop.c
@@ -37,16 +37,6 @@ along with GCC; see the file COPYING3. If not see
#include "tree-inline.h"
#include "tree-scalar-evolution.h"
-/* Initializes the loop structures. */
-
-static void
-tree_loop_optimizer_init (void)
-{
- loop_optimizer_init (LOOPS_NORMAL
- | LOOPS_HAVE_RECORDED_EXITS);
- rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa);
-}
-
/* The loop superpass. */
static bool
@@ -79,7 +69,10 @@ struct gimple_opt_pass pass_tree_loop =
static unsigned int
tree_ssa_loop_init (void)
{
- tree_loop_optimizer_init ();
+ loop_optimizer_init (LOOPS_NORMAL
+ | LOOPS_HAVE_RECORDED_EXITS);
+ rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa);
+
if (number_of_loops () <= 1)
return 0;
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index 49fd1707d1e..9f88ba6aec7 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -110,9 +110,9 @@ struct occurrence {
inserted in BB. */
tree recip_def;
- /* If non-NULL, the GIMPLE_MODIFY_STMT for a reciprocal computation that
+ /* If non-NULL, the GIMPLE_ASSIGN for a reciprocal computation that
was inserted in BB. */
- tree recip_def_stmt;
+ gimple recip_def_stmt;
/* Pointer to a list of "struct occurrence"s for blocks dominated
by BB. */
@@ -271,15 +271,15 @@ compute_merit (struct occurrence *occ)
/* Return whether USE_STMT is a floating-point division by DEF. */
static inline bool
-is_division_by (tree use_stmt, tree def)
+is_division_by (gimple use_stmt, tree def)
{
- return TREE_CODE (use_stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 1)) == RDIV_EXPR
- && TREE_OPERAND (GIMPLE_STMT_OPERAND (use_stmt, 1), 1) == def
+ return is_gimple_assign (use_stmt)
+ && gimple_assign_rhs_code (use_stmt) == RDIV_EXPR
+ && gimple_assign_rhs2 (use_stmt) == def
/* Do not recognize x / x as valid division, as we are getting
confused later by replacing all immediate uses x in such
a stmt. */
- && TREE_OPERAND (GIMPLE_STMT_OPERAND (use_stmt, 1), 0) != def;
+ && gimple_assign_rhs1 (use_stmt) != def;
}
/* Walk the subset of the dominator tree rooted at OCC, setting the
@@ -292,11 +292,12 @@ is_division_by (tree use_stmt, tree def)
be used. */
static void
-insert_reciprocals (block_stmt_iterator *def_bsi, struct occurrence *occ,
+insert_reciprocals (gimple_stmt_iterator *def_gsi, struct occurrence *occ,
tree def, tree recip_def, int threshold)
{
- tree type, new_stmt;
- block_stmt_iterator bsi;
+ tree type;
+ gimple new_stmt;
+ gimple_stmt_iterator gsi;
struct occurrence *occ_child;
if (!recip_def
@@ -306,34 +307,31 @@ insert_reciprocals (block_stmt_iterator *def_bsi, struct occurrence *occ,
/* Make a variable with the replacement and substitute it. */
type = TREE_TYPE (def);
recip_def = make_rename_temp (type, "reciptmp");
- new_stmt = build_gimple_modify_stmt (recip_def,
- fold_build2 (RDIV_EXPR, type,
- build_one_cst (type),
- def));
-
+ new_stmt = gimple_build_assign_with_ops (RDIV_EXPR, recip_def,
+ build_one_cst (type), def);
if (occ->bb_has_division)
{
/* Case 1: insert before an existing division. */
- bsi = bsi_after_labels (occ->bb);
- while (!bsi_end_p (bsi) && !is_division_by (bsi_stmt (bsi), def))
- bsi_next (&bsi);
+ gsi = gsi_after_labels (occ->bb);
+ while (!gsi_end_p (gsi) && !is_division_by (gsi_stmt (gsi), def))
+ gsi_next (&gsi);
- bsi_insert_before (&bsi, new_stmt, BSI_SAME_STMT);
+ gsi_insert_before (&gsi, new_stmt, GSI_SAME_STMT);
}
- else if (def_bsi && occ->bb == def_bsi->bb)
+ else if (def_gsi && occ->bb == def_gsi->bb)
{
/* Case 2: insert right after the definition. Note that this will
never happen if the definition statement can throw, because in
that case the sole successor of the statement's basic block will
dominate all the uses as well. */
- bsi_insert_after (def_bsi, new_stmt, BSI_NEW_STMT);
+ gsi_insert_after (def_gsi, new_stmt, GSI_NEW_STMT);
}
else
{
/* Case 3: insert in a basic block not containing defs/uses. */
- bsi = bsi_after_labels (occ->bb);
- bsi_insert_before (&bsi, new_stmt, BSI_SAME_STMT);
+ gsi = gsi_after_labels (occ->bb);
+ gsi_insert_before (&gsi, new_stmt, GSI_SAME_STMT);
}
occ->recip_def_stmt = new_stmt;
@@ -341,7 +339,7 @@ insert_reciprocals (block_stmt_iterator *def_bsi, struct occurrence *occ,
occ->recip_def = recip_def;
for (occ_child = occ->children; occ_child; occ_child = occ_child->next)
- insert_reciprocals (def_bsi, occ_child, def, recip_def, threshold);
+ insert_reciprocals (def_gsi, occ_child, def, recip_def, threshold);
}
@@ -351,13 +349,14 @@ insert_reciprocals (block_stmt_iterator *def_bsi, struct occurrence *occ,
static inline void
replace_reciprocal (use_operand_p use_p)
{
- tree use_stmt = USE_STMT (use_p);
- basic_block bb = bb_for_stmt (use_stmt);
+ gimple use_stmt = USE_STMT (use_p);
+ basic_block bb = gimple_bb (use_stmt);
struct occurrence *occ = (struct occurrence *) bb->aux;
- if (occ->recip_def && use_stmt != occ->recip_def_stmt)
+ if (optimize_bb_for_speed_p (bb)
+ && occ->recip_def && use_stmt != occ->recip_def_stmt)
{
- TREE_SET_CODE (GIMPLE_STMT_OPERAND (use_stmt, 1), MULT_EXPR);
+ gimple_assign_set_rhs_code (use_stmt, MULT_EXPR);
SET_USE (use_p, occ->recip_def);
fold_stmt_inplace (use_stmt);
update_stmt (use_stmt);
@@ -398,7 +397,7 @@ free_bb (struct occurrence *occ)
DEF must be a GIMPLE register of a floating-point type. */
static void
-execute_cse_reciprocals_1 (block_stmt_iterator *def_bsi, tree def)
+execute_cse_reciprocals_1 (gimple_stmt_iterator *def_gsi, tree def)
{
use_operand_p use_p;
imm_use_iterator use_iter;
@@ -409,10 +408,10 @@ execute_cse_reciprocals_1 (block_stmt_iterator *def_bsi, tree def)
FOR_EACH_IMM_USE_FAST (use_p, use_iter, def)
{
- tree use_stmt = USE_STMT (use_p);
+ gimple use_stmt = USE_STMT (use_p);
if (is_division_by (use_stmt, def))
{
- register_division_in (bb_for_stmt (use_stmt));
+ register_division_in (gimple_bb (use_stmt));
count++;
}
}
@@ -421,11 +420,11 @@ execute_cse_reciprocals_1 (block_stmt_iterator *def_bsi, tree def)
threshold = targetm.min_divisions_for_recip_mul (TYPE_MODE (TREE_TYPE (def)));
if (count >= threshold)
{
- tree use_stmt;
+ gimple use_stmt;
for (occ = occ_head; occ; occ = occ->next)
{
compute_merit (occ);
- insert_reciprocals (def_bsi, occ, def, NULL, threshold);
+ insert_reciprocals (def_gsi, occ, def, NULL, threshold);
}
FOR_EACH_IMM_USE_STMT (use_stmt, use_iter, def)
@@ -447,7 +446,7 @@ execute_cse_reciprocals_1 (block_stmt_iterator *def_bsi, tree def)
static bool
gate_cse_reciprocals (void)
{
- return optimize && !optimize_size && flag_reciprocal_math;
+ return optimize && flag_reciprocal_math;
}
/* Go through all the floating-point SSA_NAMEs, and call
@@ -478,56 +477,58 @@ execute_cse_reciprocals (void)
FOR_EACH_BB (bb)
{
- block_stmt_iterator bsi;
- tree phi, def;
+ gimple_stmt_iterator gsi;
+ gimple phi;
+ tree def;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
+ phi = gsi_stmt (gsi);
def = PHI_RESULT (phi);
if (FLOAT_TYPE_P (TREE_TYPE (def))
&& is_gimple_reg (def))
execute_cse_reciprocals_1 (NULL, def);
}
- for (bsi = bsi_after_labels (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (gsi = gsi_after_labels (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
+ if (gimple_has_lhs (stmt)
&& (def = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_DEF)) != NULL
&& FLOAT_TYPE_P (TREE_TYPE (def))
&& TREE_CODE (def) == SSA_NAME)
- execute_cse_reciprocals_1 (&bsi, def);
+ execute_cse_reciprocals_1 (&gsi, def);
}
+ if (optimize_bb_for_size_p (bb))
+ continue;
+
/* Scan for a/func(b) and convert it to reciprocal a*rfunc(b). */
- for (bsi = bsi_after_labels (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (gsi = gsi_after_labels (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
tree fndecl;
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == RDIV_EXPR)
+ if (is_gimple_assign (stmt)
+ && gimple_assign_rhs_code (stmt) == RDIV_EXPR)
{
- tree arg1 = TREE_OPERAND (GIMPLE_STMT_OPERAND (stmt, 1), 1);
- tree stmt1;
+ tree arg1 = gimple_assign_rhs2 (stmt);
+ gimple stmt1;
if (TREE_CODE (arg1) != SSA_NAME)
continue;
stmt1 = SSA_NAME_DEF_STMT (arg1);
- if (TREE_CODE (stmt1) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (stmt1, 1)) == CALL_EXPR
- && (fndecl
- = get_callee_fndecl (GIMPLE_STMT_OPERAND (stmt1, 1)))
+ if (is_gimple_call (stmt1)
+ && gimple_call_lhs (stmt1)
+ && (fndecl = gimple_call_fndecl (stmt1))
&& (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
|| DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD))
{
enum built_in_function code;
bool md_code;
- tree arg10;
- tree tmp;
code = DECL_FUNCTION_CODE (fndecl);
md_code = DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD;
@@ -536,12 +537,10 @@ execute_cse_reciprocals (void)
if (!fndecl)
continue;
- arg10 = CALL_EXPR_ARG (GIMPLE_STMT_OPERAND (stmt1, 1), 0);
- tmp = build_call_expr (fndecl, 1, arg10);
- GIMPLE_STMT_OPERAND (stmt1, 1) = tmp;
+ gimple_call_set_fndecl (stmt1, fndecl);
update_stmt (stmt1);
- TREE_SET_CODE (GIMPLE_STMT_OPERAND (stmt, 1), MULT_EXPR);
+ gimple_assign_set_rhs_code (stmt, MULT_EXPR);
fold_stmt_inplace (stmt);
update_stmt (stmt);
}
@@ -582,18 +581,18 @@ struct gimple_opt_pass pass_cse_reciprocals =
statements in the vector. */
static bool
-maybe_record_sincos (VEC(tree, heap) **stmts,
- basic_block *top_bb, tree use_stmt)
+maybe_record_sincos (VEC(gimple, heap) **stmts,
+ basic_block *top_bb, gimple use_stmt)
{
- basic_block use_bb = bb_for_stmt (use_stmt);
+ basic_block use_bb = gimple_bb (use_stmt);
if (*top_bb
&& (*top_bb == use_bb
|| dominated_by_p (CDI_DOMINATORS, use_bb, *top_bb)))
- VEC_safe_push (tree, heap, *stmts, use_stmt);
+ VEC_safe_push (gimple, heap, *stmts, use_stmt);
else if (!*top_bb
|| dominated_by_p (CDI_DOMINATORS, *top_bb, use_bb))
{
- VEC_safe_push (tree, heap, *stmts, use_stmt);
+ VEC_safe_push (gimple, heap, *stmts, use_stmt);
*top_bb = use_bb;
}
else
@@ -613,20 +612,21 @@ maybe_record_sincos (VEC(tree, heap) **stmts,
static void
execute_cse_sincos_1 (tree name)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
imm_use_iterator use_iter;
- tree def_stmt, use_stmt, fndecl, res, call, stmt, type;
+ tree fndecl, res, type;
+ gimple def_stmt, use_stmt, stmt;
int seen_cos = 0, seen_sin = 0, seen_cexpi = 0;
- VEC(tree, heap) *stmts = NULL;
+ VEC(gimple, heap) *stmts = NULL;
basic_block top_bb = NULL;
int i;
type = TREE_TYPE (name);
FOR_EACH_IMM_USE_STMT (use_stmt, use_iter, name)
{
- if (TREE_CODE (use_stmt) != GIMPLE_MODIFY_STMT
- || TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 1)) != CALL_EXPR
- || !(fndecl = get_callee_fndecl (GIMPLE_STMT_OPERAND (use_stmt, 1)))
+ if (gimple_code (use_stmt) != GIMPLE_CALL
+ || !gimple_call_lhs (use_stmt)
+ || !(fndecl = gimple_call_fndecl (use_stmt))
|| DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_NORMAL)
continue;
@@ -650,7 +650,7 @@ execute_cse_sincos_1 (tree name)
if (seen_cos + seen_sin + seen_cexpi <= 1)
{
- VEC_free(tree, heap, stmts);
+ VEC_free(gimple, heap, stmts);
return;
}
@@ -660,51 +660,57 @@ execute_cse_sincos_1 (tree name)
if (!fndecl)
return;
res = make_rename_temp (TREE_TYPE (TREE_TYPE (fndecl)), "sincostmp");
- call = build_call_expr (fndecl, 1, name);
- stmt = build_gimple_modify_stmt (res, call);
+ stmt = gimple_build_call (fndecl, 1, name);
+ gimple_call_set_lhs (stmt, res);
+
def_stmt = SSA_NAME_DEF_STMT (name);
if (!SSA_NAME_IS_DEFAULT_DEF (name)
- && TREE_CODE (def_stmt) != PHI_NODE
- && bb_for_stmt (def_stmt) == top_bb)
+ && gimple_code (def_stmt) != GIMPLE_PHI
+ && gimple_bb (def_stmt) == top_bb)
{
- bsi = bsi_for_stmt (def_stmt);
- bsi_insert_after (&bsi, stmt, BSI_SAME_STMT);
+ gsi = gsi_for_stmt (def_stmt);
+ gsi_insert_after (&gsi, stmt, GSI_SAME_STMT);
}
else
{
- bsi = bsi_after_labels (top_bb);
- bsi_insert_before (&bsi, stmt, BSI_SAME_STMT);
+ gsi = gsi_after_labels (top_bb);
+ gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
}
update_stmt (stmt);
/* And adjust the recorded old call sites. */
- for (i = 0; VEC_iterate(tree, stmts, i, use_stmt); ++i)
+ for (i = 0; VEC_iterate(gimple, stmts, i, use_stmt); ++i)
{
- fndecl = get_callee_fndecl (GIMPLE_STMT_OPERAND (use_stmt, 1));
+ tree rhs = NULL;
+ fndecl = gimple_call_fndecl (use_stmt);
+
switch (DECL_FUNCTION_CODE (fndecl))
{
CASE_FLT_FN (BUILT_IN_COS):
- GIMPLE_STMT_OPERAND (use_stmt, 1) = fold_build1 (REALPART_EXPR,
- type, res);
+ rhs = fold_build1 (REALPART_EXPR, type, res);
break;
CASE_FLT_FN (BUILT_IN_SIN):
- GIMPLE_STMT_OPERAND (use_stmt, 1) = fold_build1 (IMAGPART_EXPR,
- type, res);
+ rhs = fold_build1 (IMAGPART_EXPR, type, res);
break;
CASE_FLT_FN (BUILT_IN_CEXPI):
- GIMPLE_STMT_OPERAND (use_stmt, 1) = res;
+ rhs = res;
break;
default:;
gcc_unreachable ();
}
- update_stmt (use_stmt);
+ /* Replace call with a copy. */
+ stmt = gimple_build_assign (gimple_call_lhs (use_stmt), rhs);
+
+ gsi = gsi_for_stmt (use_stmt);
+ gsi_insert_after (&gsi, stmt, GSI_SAME_STMT);
+ gsi_remove (&gsi, true);
}
- VEC_free(tree, heap, stmts);
+ VEC_free(gimple, heap, stmts);
}
/* Go through all calls to sin, cos and cexpi and call execute_cse_sincos_1
@@ -719,16 +725,16 @@ execute_cse_sincos (void)
FOR_EACH_BB (bb)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
- for (bsi = bsi_after_labels (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (gsi = gsi_after_labels (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
tree fndecl;
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == CALL_EXPR
- && (fndecl = get_callee_fndecl (GIMPLE_STMT_OPERAND (stmt, 1)))
+ if (is_gimple_call (stmt)
+ && gimple_call_lhs (stmt)
+ && (fndecl = gimple_call_fndecl (stmt))
&& DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL)
{
tree arg;
@@ -738,8 +744,7 @@ execute_cse_sincos (void)
CASE_FLT_FN (BUILT_IN_COS):
CASE_FLT_FN (BUILT_IN_SIN):
CASE_FLT_FN (BUILT_IN_CEXPI):
- arg = GIMPLE_STMT_OPERAND (stmt, 1);
- arg = CALL_EXPR_ARG (arg, 0);
+ arg = gimple_call_arg (stmt, 0);
if (TREE_CODE (arg) == SSA_NAME)
execute_cse_sincos_1 (arg);
break;
@@ -793,23 +798,23 @@ execute_convert_to_rsqrt (void)
FOR_EACH_BB (bb)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
- for (bsi = bsi_after_labels (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (gsi = gsi_after_labels (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
tree fndecl;
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == CALL_EXPR
- && (fndecl = get_callee_fndecl (GIMPLE_STMT_OPERAND (stmt, 1)))
+ if (is_gimple_call (stmt)
+ && gimple_call_lhs (stmt)
+ && (fndecl = gimple_call_fndecl (stmt))
&& (DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
|| DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD))
{
enum built_in_function code;
bool md_code;
tree arg1;
- tree stmt1;
+ gimple stmt1;
code = DECL_FUNCTION_CODE (fndecl);
md_code = DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_MD;
@@ -818,30 +823,28 @@ execute_convert_to_rsqrt (void)
if (!fndecl)
continue;
- arg1 = CALL_EXPR_ARG (GIMPLE_STMT_OPERAND (stmt, 1), 0);
+ arg1 = gimple_call_arg (stmt, 0);
if (TREE_CODE (arg1) != SSA_NAME)
continue;
stmt1 = SSA_NAME_DEF_STMT (arg1);
- if (TREE_CODE (stmt1) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (stmt1, 1)) == RDIV_EXPR)
+ if (is_gimple_assign (stmt1)
+ && gimple_assign_rhs_code (stmt1) == RDIV_EXPR)
{
tree arg10, arg11;
- tree tmp;
- arg10 = TREE_OPERAND (GIMPLE_STMT_OPERAND (stmt1, 1), 0);
- arg11 = TREE_OPERAND (GIMPLE_STMT_OPERAND (stmt1, 1), 1);
+ arg10 = gimple_assign_rhs1 (stmt1);
+ arg11 = gimple_assign_rhs2 (stmt1);
/* Swap operands of RDIV_EXPR. */
- TREE_OPERAND (GIMPLE_STMT_OPERAND (stmt1, 1), 0) = arg11;
- TREE_OPERAND (GIMPLE_STMT_OPERAND (stmt1, 1), 1) = arg10;
+ gimple_assign_set_rhs1 (stmt1, arg11);
+ gimple_assign_set_rhs2 (stmt1, arg10);
fold_stmt_inplace (stmt1);
update_stmt (stmt1);
- tmp = build_call_expr (fndecl, 1, arg1);
- GIMPLE_STMT_OPERAND (stmt, 1) = tmp;
+ gimple_call_set_fndecl (stmt, fndecl);
update_stmt (stmt);
}
}
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index 0aeea9f7f93..801d2debabb 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -1,5 +1,6 @@
/* SSA operands management for trees.
- Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008
+ Free Software Foundation, Inc.
This file is part of GCC.
@@ -74,6 +75,10 @@ along with GCC; see the file COPYING3. If not see
operand vector for VUSE, then the new vector will also be modified
such that it contains 'a_5' rather than 'a'. */
+/* Helper functions from gimple.c. These are GIMPLE manipulation
+ routines that only the operand scanner should need. */
+void gimple_set_stored_syms (gimple, bitmap, bitmap_obstack *);
+void gimple_set_loaded_syms (gimple, bitmap, bitmap_obstack *);
/* Structure storing statistics on how many call clobbers we have, and
how many where avoided. */
@@ -122,7 +127,7 @@ static struct
#define opf_no_vops (1 << 1)
/* Operand is an implicit reference. This is used to distinguish
- explicit assignments in the form of GIMPLE_MODIFY_STMT from
+ explicit assignments in the form of MODIFY_EXPR from
clobbering sites like function calls or ASM_EXPRs. */
#define opf_implicit (1 << 2)
@@ -148,7 +153,7 @@ static bitmap build_loads;
/* Set for building all the stored symbols. */
static bitmap build_stores;
-static void get_expr_operands (tree, tree *, int);
+static void get_expr_operands (gimple, tree *, int);
/* Number of functions with initialized ssa_operands. */
static int n_initialized = 0;
@@ -178,7 +183,7 @@ static int n_initialized = 0;
struct scb_d
{
/* Pointer to the statement being modified. */
- tree *stmt_p;
+ gimple *stmt_p;
/* If the statement references memory these are the sets of symbols
loaded and stored by the statement. */
@@ -256,12 +261,18 @@ operand_build_sort_virtual (VEC(tree,heap) *list)
operand_build_cmp);
}
-
/* Return true if the SSA operands cache is active. */
bool
ssa_operands_active (void)
{
+ /* This function may be invoked from contexts where CFUN is NULL
+ (IPA passes), return false for now. FIXME: operands may be
+ active in each individual function, maybe this function should
+ take CFUN as a parameter. */
+ if (cfun == NULL)
+ return false;
+
return cfun->gimple_df && gimple_ssa_operands (cfun)->ops_active;
}
@@ -430,6 +441,7 @@ fini_ssa_operands (void)
if (!n_initialized)
bitmap_obstack_release (&operands_bitmap_obstack);
+
if (dump_file && (dump_flags & TDF_STATS))
{
fprintf (dump_file, "Original clobbered vars: %d\n",
@@ -571,11 +583,11 @@ alloc_vop (int num)
sure the stmt pointer is set to the current stmt. */
static inline void
-set_virtual_use_link (use_operand_p ptr, tree stmt)
+set_virtual_use_link (use_operand_p ptr, gimple stmt)
{
/* fold_stmt may have changed the stmt pointers. */
- if (ptr->stmt != stmt)
- ptr->stmt = stmt;
+ if (ptr->loc.stmt != stmt)
+ ptr->loc.stmt = stmt;
/* If this use isn't in a list, add it to the correct list. */
if (!ptr->prev)
@@ -601,7 +613,7 @@ add_def_op (tree *op, def_optype_p last)
/* Adds OP to the list of uses of statement STMT after LAST. */
static inline use_optype_p
-add_use_op (tree stmt, tree *op, use_optype_p last)
+add_use_op (gimple stmt, tree *op, use_optype_p last)
{
use_optype_p new_use;
@@ -619,7 +631,7 @@ add_use_op (tree stmt, tree *op, use_optype_p last)
The new vop is appended after PREV. */
static inline voptype_p
-add_vop (tree stmt, tree op, int num, voptype_p prev)
+add_vop (gimple stmt, tree op, int num, voptype_p prev)
{
voptype_p new_vop;
int x;
@@ -645,7 +657,7 @@ add_vop (tree stmt, tree op, int num, voptype_p prev)
LAST to the new element. */
static inline voptype_p
-add_vuse_op (tree stmt, tree op, int num, voptype_p last)
+add_vuse_op (gimple stmt, tree op, int num, voptype_p last)
{
voptype_p new_vop = add_vop (stmt, op, num, last);
VDEF_RESULT (new_vop) = NULL_TREE;
@@ -657,7 +669,7 @@ add_vuse_op (tree stmt, tree op, int num, voptype_p last)
LAST to the new element. */
static inline voptype_p
-add_vdef_op (tree stmt, tree op, int num, voptype_p last)
+add_vdef_op (gimple stmt, tree op, int num, voptype_p last)
{
voptype_p new_vop = add_vop (stmt, op, num, last);
VDEF_RESULT (new_vop) = op;
@@ -669,7 +681,7 @@ add_vdef_op (tree stmt, tree op, int num, voptype_p last)
TODO -- Make build_defs VEC of tree *. */
static inline void
-finalize_ssa_defs (tree stmt)
+finalize_ssa_defs (gimple stmt)
{
unsigned new_i;
struct def_optype_d new_list;
@@ -677,12 +689,12 @@ finalize_ssa_defs (tree stmt)
unsigned int num = VEC_length (tree, build_defs);
/* There should only be a single real definition per assignment. */
- gcc_assert ((stmt && TREE_CODE (stmt) != GIMPLE_MODIFY_STMT) || num <= 1);
+ gcc_assert ((stmt && gimple_code (stmt) != GIMPLE_ASSIGN) || num <= 1);
new_list.next = NULL;
last = &new_list;
- old_ops = DEF_OPS (stmt);
+ old_ops = gimple_def_ops (stmt);
new_i = 0;
@@ -703,13 +715,13 @@ finalize_ssa_defs (tree stmt)
last = add_def_op ((tree *) VEC_index (tree, build_defs, new_i), last);
/* Now set the stmt's operands. */
- DEF_OPS (stmt) = new_list.next;
+ gimple_set_def_ops (stmt, new_list.next);
#ifdef ENABLE_CHECKING
{
def_optype_p ptr;
unsigned x = 0;
- for (ptr = DEF_OPS (stmt); ptr; ptr = ptr->next)
+ for (ptr = gimple_def_ops (stmt); ptr; ptr = ptr->next)
x++;
gcc_assert (x == num);
@@ -722,30 +734,16 @@ finalize_ssa_defs (tree stmt)
TODO -- Make build_uses VEC of tree *. */
static inline void
-finalize_ssa_uses (tree stmt)
+finalize_ssa_uses (gimple stmt)
{
unsigned new_i;
struct use_optype_d new_list;
use_optype_p old_ops, ptr, last;
-#ifdef ENABLE_CHECKING
- {
- unsigned x;
- unsigned num = VEC_length (tree, build_uses);
-
- /* If the pointer to the operand is the statement itself, something is
- wrong. It means that we are pointing to a local variable (the
- initial call to update_stmt_operands does not pass a pointer to a
- statement). */
- for (x = 0; x < num; x++)
- gcc_assert (*((tree *)VEC_index (tree, build_uses, x)) != stmt);
- }
-#endif
-
new_list.next = NULL;
last = &new_list;
- old_ops = USE_OPS (stmt);
+ old_ops = gimple_use_ops (stmt);
/* If there is anything in the old list, free it. */
if (old_ops)
@@ -763,12 +761,12 @@ finalize_ssa_uses (tree stmt)
last);
/* Now set the stmt's operands. */
- USE_OPS (stmt) = new_list.next;
+ gimple_set_use_ops (stmt, new_list.next);
#ifdef ENABLE_CHECKING
{
unsigned x = 0;
- for (ptr = USE_OPS (stmt); ptr; ptr = ptr->next)
+ for (ptr = gimple_use_ops (stmt); ptr; ptr = ptr->next)
x++;
gcc_assert (x == VEC_length (tree, build_uses));
@@ -778,27 +776,17 @@ finalize_ssa_uses (tree stmt)
/* Takes elements from BUILD_VDEFS and turns them into vdef operands of
- STMT. FIXME, for now VDEF operators should have a single operand
- in their RHS. */
+ STMT. */
static inline void
-finalize_ssa_vdefs (tree stmt)
+finalize_ssa_vdefs (gimple stmt)
{
unsigned new_i;
struct voptype_d new_list;
voptype_p old_ops, ptr, last;
- stmt_ann_t ann = stmt_ann (stmt);
/* Set the symbols referenced by STMT. */
- if (!bitmap_empty_p (build_stores))
- {
- if (ann->operands.stores == NULL)
- ann->operands.stores = BITMAP_ALLOC (&operands_bitmap_obstack);
-
- bitmap_copy (ann->operands.stores, build_stores);
- }
- else
- BITMAP_FREE (ann->operands.stores);
+ gimple_set_stored_syms (stmt, build_stores, &operands_bitmap_obstack);
/* If aliases have not been computed, do not instantiate a virtual
operator on STMT. Initially, we only compute the SSA form on
@@ -813,7 +801,7 @@ finalize_ssa_vdefs (tree stmt)
new_list.next = NULL;
last = &new_list;
- old_ops = VDEF_OPS (stmt);
+ old_ops = gimple_vdef_ops (stmt);
new_i = 0;
while (old_ops && new_i < VEC_length (tree, build_vdefs))
{
@@ -868,12 +856,12 @@ finalize_ssa_vdefs (tree stmt)
}
/* Now set STMT's operands. */
- VDEF_OPS (stmt) = new_list.next;
+ gimple_set_vdef_ops (stmt, new_list.next);
#ifdef ENABLE_CHECKING
{
unsigned x = 0;
- for (ptr = VDEF_OPS (stmt); ptr; ptr = ptr->next)
+ for (ptr = gimple_vdef_ops (stmt); ptr; ptr = ptr->next)
x++;
gcc_assert (x == VEC_length (tree, build_vdefs));
@@ -886,24 +874,14 @@ finalize_ssa_vdefs (tree stmt)
STMT. */
static inline void
-finalize_ssa_vuse_ops (tree stmt)
+finalize_ssa_vuse_ops (gimple stmt)
{
unsigned new_i, old_i;
voptype_p old_ops, last;
VEC(tree,heap) *new_ops;
- stmt_ann_t ann;
/* Set the symbols referenced by STMT. */
- ann = stmt_ann (stmt);
- if (!bitmap_empty_p (build_loads))
- {
- if (ann->operands.loads == NULL)
- ann->operands.loads = BITMAP_ALLOC (&operands_bitmap_obstack);
-
- bitmap_copy (ann->operands.loads, build_loads);
- }
- else
- BITMAP_FREE (ann->operands.loads);
+ gimple_set_loaded_syms (stmt, build_loads, &operands_bitmap_obstack);
/* If aliases have not been computed, do not instantiate a virtual
operator on STMT. Initially, we only compute the SSA form on
@@ -916,7 +894,7 @@ finalize_ssa_vuse_ops (tree stmt)
return;
/* STMT should have at most one VUSE operator. */
- old_ops = VUSE_OPS (stmt);
+ old_ops = gimple_vuse_ops (stmt);
gcc_assert (old_ops == NULL || old_ops->next == NULL);
new_ops = NULL;
@@ -961,7 +939,7 @@ finalize_ssa_vuse_ops (tree stmt)
for (old_i = 0; old_i < VUSE_NUM (old_ops); old_i++)
delink_imm_use (VUSE_OP_PTR (old_ops, old_i));
add_vop_to_freelist (old_ops);
- VUSE_OPS (stmt) = NULL;
+ gimple_set_vuse_ops (stmt, NULL);
}
/* If there are any operands, instantiate a VUSE operator for STMT. */
@@ -975,7 +953,7 @@ finalize_ssa_vuse_ops (tree stmt)
for (i = 0; VEC_iterate (tree, new_ops, i, op); i++)
SET_USE (VUSE_OP_PTR (last, (int) i), op);
- VUSE_OPS (stmt) = last;
+ gimple_set_vuse_ops (stmt, last);
VEC_free (tree, heap, new_ops);
}
@@ -983,10 +961,10 @@ finalize_ssa_vuse_ops (tree stmt)
{
unsigned x;
- if (VUSE_OPS (stmt))
+ if (gimple_vuse_ops (stmt))
{
- gcc_assert (VUSE_OPS (stmt)->next == NULL);
- x = VUSE_NUM (VUSE_OPS (stmt));
+ gcc_assert (gimple_vuse_ops (stmt)->next == NULL);
+ x = VUSE_NUM (gimple_vuse_ops (stmt));
}
else
x = 0;
@@ -999,7 +977,7 @@ finalize_ssa_vuse_ops (tree stmt)
/* Return a new VUSE operand vector for STMT. */
static void
-finalize_ssa_vuses (tree stmt)
+finalize_ssa_vuses (gimple stmt)
{
unsigned num, num_vdefs;
unsigned vuse_index;
@@ -1069,12 +1047,15 @@ cleanup_build_arrays (void)
/* Finalize all the build vectors, fill the new ones into INFO. */
static inline void
-finalize_ssa_stmt_operands (tree stmt)
+finalize_ssa_stmt_operands (gimple stmt)
{
finalize_ssa_defs (stmt);
finalize_ssa_uses (stmt);
- finalize_ssa_vdefs (stmt);
- finalize_ssa_vuses (stmt);
+ if (gimple_has_mem_ops (stmt))
+ {
+ finalize_ssa_vdefs (stmt);
+ finalize_ssa_vuses (stmt);
+ }
cleanup_build_arrays ();
}
@@ -1266,26 +1247,26 @@ access_can_touch_variable (tree ref, tree alias, HOST_WIDE_INT offset,
D.874_2 = (*my_char_ref_1)[1]{lb: 1 sz: 1};
*/
if (ref
- && flag_strict_aliasing
- && TREE_CODE (ref) != INDIRECT_REF
- && !MTAG_P (alias)
- && base
- && (TREE_CODE (base) != INDIRECT_REF
- || TREE_CODE (TREE_TYPE (base)) != UNION_TYPE)
- && (TREE_CODE (base) != INDIRECT_REF
- || TREE_CODE (ref) != ARRAY_REF
- || offset != 0
- || (DECL_SIZE (alias)
- && TREE_CODE (DECL_SIZE (alias)) == INTEGER_CST
- && size != -1
- && (unsigned HOST_WIDE_INT)size
- != TREE_INT_CST_LOW (DECL_SIZE (alias))))
- && !AGGREGATE_TYPE_P (TREE_TYPE (alias))
- && TREE_CODE (TREE_TYPE (alias)) != COMPLEX_TYPE
- && !var_ann (alias)->is_heapvar
- /* When the struct has may_alias attached to it, we need not to
- return true. */
- && get_alias_set (base))
+ && flag_strict_aliasing
+ && TREE_CODE (ref) != INDIRECT_REF
+ && !MTAG_P (alias)
+ && base
+ && (TREE_CODE (base) != INDIRECT_REF
+ || TREE_CODE (TREE_TYPE (base)) != UNION_TYPE)
+ && (TREE_CODE (base) != INDIRECT_REF
+ || TREE_CODE (ref) != ARRAY_REF
+ || offset != 0
+ || (DECL_SIZE (alias)
+ && TREE_CODE (DECL_SIZE (alias)) == INTEGER_CST
+ && size != -1
+ && (unsigned HOST_WIDE_INT)size
+ != TREE_INT_CST_LOW (DECL_SIZE (alias))))
+ && !AGGREGATE_TYPE_P (TREE_TYPE (alias))
+ && TREE_CODE (TREE_TYPE (alias)) != COMPLEX_TYPE
+ && !var_ann (alias)->is_heapvar
+ /* When the struct has may_alias attached to it, we need not to
+ return true. */
+ && get_alias_set (base))
{
#ifdef ACCESS_DEBUGGING
fprintf (stderr, "Access to ");
@@ -1304,11 +1285,12 @@ access_can_touch_variable (tree ref, tree alias, HOST_WIDE_INT offset,
&& flag_strict_aliasing
&& TREE_CODE (ref) != INDIRECT_REF
&& !MTAG_P (alias)
+ && !var_ann (alias)->is_heapvar
&& !POINTER_TYPE_P (TREE_TYPE (alias))
&& offsetgtz
&& DECL_SIZE (alias)
&& TREE_CODE (DECL_SIZE (alias)) == INTEGER_CST
- && uoffset > TREE_INT_CST_LOW (DECL_SIZE (alias)))
+ && uoffset >= TREE_INT_CST_LOW (DECL_SIZE (alias)))
{
#ifdef ACCESS_DEBUGGING
fprintf (stderr, "Access to ");
@@ -1323,7 +1305,7 @@ access_can_touch_variable (tree ref, tree alias, HOST_WIDE_INT offset,
return true;
}
-/* Add VAR to the virtual operands array. FLAGS is as in
+/* Add VAR to the virtual operands for STMT. FLAGS is as in
get_expr_operands. FULL_REF is a tree that contains the entire
pointer dereference expression, if available, or NULL otherwise.
OFFSET and SIZE come from the memory access expression that
@@ -1331,7 +1313,7 @@ access_can_touch_variable (tree ref, tree alias, HOST_WIDE_INT offset,
affected statement is a call site. */
static void
-add_virtual_operand (tree var, stmt_ann_t s_ann, int flags,
+add_virtual_operand (tree var, gimple stmt, int flags,
tree full_ref, HOST_WIDE_INT offset,
HOST_WIDE_INT size, bool is_call_site)
{
@@ -1343,7 +1325,7 @@ add_virtual_operand (tree var, stmt_ann_t s_ann, int flags,
v_ann = var_ann (sym);
/* Mark the statement as having memory operands. */
- s_ann->references_memory = true;
+ gimple_set_references_memory (stmt, true);
/* If the variable cannot be modified and this is a VDEF change
it into a VUSE. This happens when read-only variables are marked
@@ -1351,7 +1333,7 @@ add_virtual_operand (tree var, stmt_ann_t s_ann, int flags,
check that this only happens on non-specific stores.
Note that if this is a specific store, i.e. associated with a
- GIMPLE_MODIFY_STMT, then we can't suppress the VDEF, lest we run
+ MODIFY_EXPR, then we can't suppress the VDEF, lest we run
into validation problems.
This can happen when programs cast away const, leaving us with a
@@ -1373,9 +1355,8 @@ add_virtual_operand (tree var, stmt_ann_t s_ann, int flags,
if (aliases == NULL)
{
- if (!gimple_aliases_computed_p (cfun)
- && (flags & opf_def))
- s_ann->has_volatile_ops = true;
+ if (!gimple_aliases_computed_p (cfun) && (flags & opf_def))
+ gimple_set_has_volatile_ops (stmt, true);
/* The variable is not aliased or it is an alias tag. */
if (flags & opf_def)
@@ -1449,18 +1430,18 @@ add_virtual_operand (tree var, stmt_ann_t s_ann, int flags,
}
-/* Add *VAR_P to the appropriate operand array for S_ANN. FLAGS is as in
- get_expr_operands. If *VAR_P is a GIMPLE register, it will be added to
- the statement's real operands, otherwise it is added to virtual
- operands. */
+/* Add *VAR_P to the appropriate operand array for statement STMT.
+ FLAGS is as in get_expr_operands. If *VAR_P is a GIMPLE register,
+ it will be added to the statement's real operands, otherwise it is
+ added to virtual operands. */
static void
-add_stmt_operand (tree *var_p, stmt_ann_t s_ann, int flags)
+add_stmt_operand (tree *var_p, gimple stmt, int flags)
{
tree var, sym;
var_ann_t v_ann;
- gcc_assert (SSA_VAR_P (*var_p) && s_ann);
+ gcc_assert (SSA_VAR_P (*var_p));
var = *var_p;
sym = (TREE_CODE (var) == SSA_NAME ? SSA_NAME_VAR (var) : var);
@@ -1468,7 +1449,7 @@ add_stmt_operand (tree *var_p, stmt_ann_t s_ann, int flags)
/* Mark statements with volatile operands. */
if (TREE_THIS_VOLATILE (sym))
- s_ann->has_volatile_ops = true;
+ gimple_set_has_volatile_ops (stmt, true);
if (is_gimple_reg (sym))
{
@@ -1479,7 +1460,7 @@ add_stmt_operand (tree *var_p, stmt_ann_t s_ann, int flags)
append_use (var_p);
}
else
- add_virtual_operand (var, s_ann, flags, NULL_TREE, 0, -1, false);
+ add_virtual_operand (var, stmt, flags, NULL_TREE, 0, -1, false);
}
/* Subroutine of get_indirect_ref_operands. ADDR is the address
@@ -1487,14 +1468,14 @@ add_stmt_operand (tree *var_p, stmt_ann_t s_ann, int flags)
is the same as in get_indirect_ref_operands. */
static void
-get_addr_dereference_operands (tree stmt, tree *addr, int flags, tree full_ref,
- HOST_WIDE_INT offset, HOST_WIDE_INT size,
- bool recurse_on_base)
+get_addr_dereference_operands (gimple stmt, tree *addr, int flags,
+ tree full_ref, HOST_WIDE_INT offset,
+ HOST_WIDE_INT size, bool recurse_on_base)
{
tree ptr = *addr;
- stmt_ann_t s_ann = stmt_ann (stmt);
- s_ann->references_memory = true;
+ /* Mark the statement as having memory operands. */
+ gimple_set_references_memory (stmt, true);
if (SSA_VAR_P (ptr))
{
@@ -1506,7 +1487,7 @@ get_addr_dereference_operands (tree stmt, tree *addr, int flags, tree full_ref,
&& pi->name_mem_tag)
{
/* PTR has its own memory tag. Use it. */
- add_virtual_operand (pi->name_mem_tag, s_ann, flags,
+ add_virtual_operand (pi->name_mem_tag, stmt, flags,
full_ref, offset, size, false);
}
else
@@ -1524,13 +1505,14 @@ get_addr_dereference_operands (tree stmt, tree *addr, int flags, tree full_ref,
&& 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 ");
print_generic_expr (dump_file, ptr, dump_flags);
fprintf (dump_file, " in ");
- print_generic_stmt (dump_file, stmt, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
}
if (TREE_CODE (ptr) == SSA_NAME)
@@ -1542,7 +1524,7 @@ get_addr_dereference_operands (tree stmt, tree *addr, int flags, tree full_ref,
and size. */
if (v_ann->symbol_mem_tag)
{
- add_virtual_operand (v_ann->symbol_mem_tag, s_ann, flags,
+ add_virtual_operand (v_ann->symbol_mem_tag, stmt, flags,
full_ref, 0, -1, false);
/* Make sure we add the SMT itself. */
if (!(flags & opf_no_vops))
@@ -1558,7 +1540,7 @@ get_addr_dereference_operands (tree stmt, tree *addr, int flags, tree full_ref,
volatile so we won't optimize it out too actively. */
else if (!gimple_aliases_computed_p (cfun)
&& (flags & opf_def))
- s_ann->has_volatile_ops = true;
+ gimple_set_has_volatile_ops (stmt, true);
}
}
else if (TREE_CODE (ptr) == INTEGER_CST)
@@ -1566,7 +1548,7 @@ get_addr_dereference_operands (tree stmt, tree *addr, int flags, tree full_ref,
/* If a constant is used as a pointer, we can't generate a real
operand for it but we mark the statement volatile to prevent
optimizations from messing things up. */
- s_ann->has_volatile_ops = true;
+ gimple_set_has_volatile_ops (stmt, true);
return;
}
else
@@ -1600,15 +1582,14 @@ get_addr_dereference_operands (tree stmt, tree *addr, int flags, tree full_ref,
something else will do it for us. */
static void
-get_indirect_ref_operands (tree stmt, tree expr, int flags, tree full_ref,
+get_indirect_ref_operands (gimple stmt, tree expr, int flags, tree full_ref,
HOST_WIDE_INT offset, HOST_WIDE_INT size,
bool recurse_on_base)
{
tree *pptr = &TREE_OPERAND (expr, 0);
- stmt_ann_t s_ann = stmt_ann (stmt);
if (TREE_THIS_VOLATILE (expr))
- s_ann->has_volatile_ops = true;
+ gimple_set_has_volatile_ops (stmt, true);
get_addr_dereference_operands (stmt, pptr, flags, full_ref, offset, size,
recurse_on_base);
@@ -1618,26 +1599,25 @@ get_indirect_ref_operands (tree stmt, tree expr, int flags, tree full_ref,
/* A subroutine of get_expr_operands to handle TARGET_MEM_REF. */
static void
-get_tmr_operands (tree stmt, tree expr, int flags)
+get_tmr_operands (gimple stmt, tree expr, int flags)
{
tree tag;
- stmt_ann_t s_ann = stmt_ann (stmt);
- /* This statement references memory. */
- s_ann->references_memory = 1;
+ /* Mark the statement as having memory operands. */
+ gimple_set_references_memory (stmt, true);
/* First record the real operands. */
get_expr_operands (stmt, &TMR_BASE (expr), opf_use);
get_expr_operands (stmt, &TMR_INDEX (expr), opf_use);
if (TMR_SYMBOL (expr))
- add_to_addressable_set (TMR_SYMBOL (expr), &s_ann->addresses_taken);
+ gimple_add_to_addresses_taken (stmt, TMR_SYMBOL (expr));
tag = TMR_TAG (expr);
if (!tag)
{
/* Something weird, so ensure that we will be careful. */
- s_ann->has_volatile_ops = true;
+ gimple_set_has_volatile_ops (stmt, true);
return;
}
if (!MTAG_P (tag))
@@ -1646,7 +1626,7 @@ get_tmr_operands (tree stmt, tree expr, int flags)
return;
}
- add_virtual_operand (tag, s_ann, flags, expr, 0, -1, false);
+ add_virtual_operand (tag, stmt, flags, expr, 0, -1, false);
}
@@ -1654,21 +1634,19 @@ get_tmr_operands (tree stmt, tree expr, int flags)
clobbered variables in the function. */
static void
-add_call_clobber_ops (tree stmt, tree callee)
+add_call_clobber_ops (gimple stmt, tree callee ATTRIBUTE_UNUSED)
{
unsigned u;
bitmap_iterator bi;
- stmt_ann_t s_ann = stmt_ann (stmt);
bitmap not_read_b, not_written_b;
- tree call = get_call_expr_in (stmt);
- gcc_assert (!(call_expr_flags (call) & (ECF_PURE | ECF_CONST)));
+ gcc_assert (!(gimple_call_flags (stmt) & (ECF_PURE | ECF_CONST)));
/* If we created .GLOBAL_VAR earlier, just use it. */
if (gimple_global_var (cfun))
{
tree var = gimple_global_var (cfun);
- add_virtual_operand (var, s_ann, opf_def, NULL, 0, -1, true);
+ add_virtual_operand (var, stmt, opf_def, NULL, 0, -1, true);
return;
}
@@ -1676,7 +1654,8 @@ add_call_clobber_ops (tree stmt, tree callee)
set for each static if the call being processed does not read
or write that variable. */
not_read_b = callee ? ipa_reference_get_not_read_global (callee) : NULL;
- not_written_b = callee ? ipa_reference_get_not_written_global (callee) : NULL;
+ not_written_b = callee ? ipa_reference_get_not_written_global (callee) : NULL;
+
/* Add a VDEF operand for every call clobbered variable. */
EXECUTE_IF_SET_IN_BITMAP (gimple_call_clobbered_vars (cfun), 0, u, bi)
{
@@ -1702,12 +1681,12 @@ add_call_clobber_ops (tree stmt, tree callee)
{
clobber_stats.static_write_clobbers_avoided++;
if (!not_read)
- add_virtual_operand (var, s_ann, opf_use, NULL, 0, -1, true);
+ add_virtual_operand (var, stmt, opf_use, NULL, 0, -1, true);
else
clobber_stats.static_read_clobbers_avoided++;
}
else
- add_virtual_operand (var, s_ann, opf_def, NULL, 0, -1, true);
+ add_virtual_operand (var, stmt, opf_def, NULL, 0, -1, true);
}
}
@@ -1716,22 +1695,20 @@ add_call_clobber_ops (tree stmt, tree callee)
function. */
static void
-add_call_read_ops (tree stmt, tree callee)
+add_call_read_ops (gimple stmt, tree callee ATTRIBUTE_UNUSED)
{
unsigned u;
bitmap_iterator bi;
- stmt_ann_t s_ann = stmt_ann (stmt);
bitmap not_read_b;
- tree call = get_call_expr_in (stmt);
/* Const functions do not reference memory. */
- if (call_expr_flags (call) & ECF_CONST)
+ if (gimple_call_flags (stmt) & ECF_CONST)
return;
not_read_b = callee ? ipa_reference_get_not_read_global (callee) : NULL;
/* For pure functions we compute non-escaped uses separately. */
- if (call_expr_flags (call) & ECF_PURE)
+ if (gimple_call_flags (stmt) & ECF_PURE)
EXECUTE_IF_SET_IN_BITMAP (gimple_call_used_vars (cfun), 0, u, bi)
{
tree var = referenced_var_lookup (u);
@@ -1749,7 +1726,7 @@ add_call_read_ops (tree stmt, tree callee)
/* See if this variable is really used by this function. */
if (!not_read)
- add_virtual_operand (var, s_ann, opf_use, NULL, 0, -1, true);
+ add_virtual_operand (var, stmt, opf_use, NULL, 0, -1, true);
else
clobber_stats.static_readonly_clobbers_avoided++;
}
@@ -1760,7 +1737,7 @@ add_call_read_ops (tree stmt, tree callee)
if (gimple_global_var (cfun))
{
tree var = gimple_global_var (cfun);
- add_virtual_operand (var, s_ann, opf_use, NULL, 0, -1, true);
+ add_virtual_operand (var, stmt, opf_use, NULL, 0, -1, true);
return;
}
@@ -1782,67 +1759,55 @@ add_call_read_ops (tree stmt, tree callee)
continue;
}
- add_virtual_operand (var, s_ann, opf_use, NULL, 0, -1, true);
+ add_virtual_operand (var, stmt, opf_use, NULL, 0, -1, true);
}
}
-/* A subroutine of get_expr_operands to handle CALL_EXPR. */
+/* If STMT is a call that may clobber globals and other symbols that
+ escape, add them to the VDEF/VUSE lists for it. */
static void
-get_call_expr_operands (tree stmt, tree expr)
+maybe_add_call_clobbered_vops (gimple stmt)
{
- int call_flags = call_expr_flags (expr);
- int i, nargs;
- stmt_ann_t ann = stmt_ann (stmt);
+ int call_flags = gimple_call_flags (stmt);
- ann->references_memory = true;
+ /* Mark the statement as having memory operands. */
+ gimple_set_references_memory (stmt, true);
/* If aliases have been computed already, add VDEF or VUSE
operands for all the symbols that have been found to be
call-clobbered. */
- if (gimple_aliases_computed_p (cfun)
- && !(call_flags & ECF_NOVOPS))
+ if (gimple_aliases_computed_p (cfun) && !(call_flags & ECF_NOVOPS))
{
/* A 'pure' or a 'const' function never call-clobbers anything.
A 'noreturn' function might, but since we don't return anyway
there is no point in recording that. */
- if (TREE_SIDE_EFFECTS (expr)
- && !(call_flags & (ECF_PURE | ECF_CONST | ECF_NORETURN)))
- add_call_clobber_ops (stmt, get_callee_fndecl (expr));
+ if (!(call_flags & (ECF_PURE | ECF_CONST | ECF_NORETURN)))
+ add_call_clobber_ops (stmt, gimple_call_fndecl (stmt));
else if (!(call_flags & ECF_CONST))
- add_call_read_ops (stmt, get_callee_fndecl (expr));
+ add_call_read_ops (stmt, gimple_call_fndecl (stmt));
}
-
- /* Find uses in the called function. */
- get_expr_operands (stmt, &CALL_EXPR_FN (expr), opf_use);
- nargs = call_expr_nargs (expr);
- for (i = 0; i < nargs; i++)
- get_expr_operands (stmt, &CALL_EXPR_ARG (expr, i), opf_use);
-
- get_expr_operands (stmt, &CALL_EXPR_STATIC_CHAIN (expr), opf_use);
}
/* Scan operands in the ASM_EXPR stmt referred to in INFO. */
static void
-get_asm_expr_operands (tree stmt)
+get_asm_expr_operands (gimple stmt)
{
- stmt_ann_t s_ann;
- int i, noutputs;
+ size_t i, noutputs;
const char **oconstraints;
const char *constraint;
bool allows_mem, allows_reg, is_inout;
- tree link;
- s_ann = stmt_ann (stmt);
- noutputs = list_length (ASM_OUTPUTS (stmt));
+ noutputs = gimple_asm_noutputs (stmt);
oconstraints = (const char **) alloca ((noutputs) * sizeof (const char *));
/* Gather all output operands. */
- for (i = 0, link = ASM_OUTPUTS (stmt); link; i++, link = TREE_CHAIN (link))
+ for (i = 0; i < gimple_asm_noutputs (stmt); i++)
{
+ tree link = gimple_asm_output_op (stmt, i);
constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
oconstraints[i] = constraint;
parse_output_constraint (&constraint, i, 0, 0, &allows_mem,
@@ -1856,16 +1821,17 @@ get_asm_expr_operands (tree stmt)
if (!allows_reg && allows_mem)
{
tree t = get_base_address (TREE_VALUE (link));
- if (t && DECL_P (t) && s_ann)
- add_to_addressable_set (t, &s_ann->addresses_taken);
+ if (t && DECL_P (t))
+ gimple_add_to_addresses_taken (stmt, t);
}
get_expr_operands (stmt, &TREE_VALUE (link), opf_def);
}
/* Gather all input operands. */
- for (link = ASM_INPUTS (stmt); link; link = TREE_CHAIN (link))
+ for (i = 0; i < gimple_asm_ninputs (stmt); i++)
{
+ tree link = gimple_asm_input_op (stmt, i);
constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (link)));
parse_input_constraint (&constraint, 0, 0, noutputs, 0, oconstraints,
&allows_mem, &allows_reg);
@@ -1875,57 +1841,39 @@ get_asm_expr_operands (tree stmt)
if (!allows_reg && allows_mem)
{
tree t = get_base_address (TREE_VALUE (link));
- if (t && DECL_P (t) && s_ann)
- add_to_addressable_set (t, &s_ann->addresses_taken);
+ if (t && DECL_P (t))
+ gimple_add_to_addresses_taken (stmt, t);
}
get_expr_operands (stmt, &TREE_VALUE (link), 0);
}
/* Clobber all memory and addressable symbols for asm ("" : : : "memory"); */
- for (link = ASM_CLOBBERS (stmt); link; link = TREE_CHAIN (link))
- if (strcmp (TREE_STRING_POINTER (TREE_VALUE (link)), "memory") == 0)
- {
- unsigned i;
- bitmap_iterator bi;
-
- s_ann->references_memory = true;
-
- EXECUTE_IF_SET_IN_BITMAP (gimple_call_clobbered_vars (cfun), 0, i, bi)
- {
- tree var = referenced_var (i);
- add_stmt_operand (&var, s_ann, opf_def | opf_implicit);
- }
-
- EXECUTE_IF_SET_IN_BITMAP (gimple_addressable_vars (cfun), 0, i, bi)
- {
- tree var = referenced_var (i);
- add_stmt_operand (&var, s_ann, opf_def | opf_implicit);
- }
- break;
- }
-}
-
-
-/* Scan operands for the assignment expression EXPR in statement STMT. */
-
-static void
-get_modify_stmt_operands (tree stmt, tree expr)
-{
- /* First get operands from the RHS. */
- get_expr_operands (stmt, &GIMPLE_STMT_OPERAND (expr, 1), opf_use);
+ for (i = 0; i < gimple_asm_nclobbers (stmt); i++)
+ {
+ tree link = gimple_asm_clobber_op (stmt, i);
+ if (strcmp (TREE_STRING_POINTER (TREE_VALUE (link)), "memory") == 0)
+ {
+ unsigned i;
+ bitmap_iterator bi;
- /* For the LHS, use a regular definition (opf_def) for GIMPLE
- registers. If the LHS is a store to memory, we will need
- a preserving definition (VDEF).
+ /* Mark the statement as having memory operands. */
+ gimple_set_references_memory (stmt, true);
- Preserving definitions are those that modify a part of an
- aggregate object. Stores through a pointer are also represented
- with VDEF operators.
+ EXECUTE_IF_SET_IN_BITMAP (gimple_call_clobbered_vars (cfun), 0, i, bi)
+ {
+ tree var = referenced_var (i);
+ add_stmt_operand (&var, stmt, opf_def | opf_implicit);
+ }
- We used to distinguish between preserving and killing definitions.
- We always emit preserving definitions now. */
- get_expr_operands (stmt, &GIMPLE_STMT_OPERAND (expr, 0), opf_def);
+ EXECUTE_IF_SET_IN_BITMAP (gimple_addressable_vars (cfun), 0, i, bi)
+ {
+ tree var = referenced_var (i);
+ add_stmt_operand (&var, stmt, opf_def | opf_implicit);
+ }
+ break;
+ }
+ }
}
@@ -1934,12 +1882,11 @@ get_modify_stmt_operands (tree stmt, tree expr)
interpret the operands found. */
static void
-get_expr_operands (tree stmt, tree *expr_p, int flags)
+get_expr_operands (gimple stmt, tree *expr_p, int flags)
{
enum tree_code code;
enum tree_code_class codeclass;
tree expr = *expr_p;
- stmt_ann_t s_ann = stmt_ann (stmt);
if (expr == NULL)
return;
@@ -1954,7 +1901,7 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
reference to it, but the fact that the statement takes its
address will be of interest to some passes (e.g. alias
resolution). */
- add_to_addressable_set (TREE_OPERAND (expr, 0), &s_ann->addresses_taken);
+ gimple_add_to_addresses_taken (stmt, TREE_OPERAND (expr, 0));
/* If the address is invariant, there may be no interesting
variable references inside. */
@@ -1973,13 +1920,13 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
case SSA_NAME:
case SYMBOL_MEMORY_TAG:
case NAME_MEMORY_TAG:
- add_stmt_operand (expr_p, s_ann, flags);
+ add_stmt_operand (expr_p, stmt, flags);
return;
case VAR_DECL:
case PARM_DECL:
case RESULT_DECL:
- add_stmt_operand (expr_p, s_ann, flags);
+ add_stmt_operand (expr_p, stmt, flags);
return;
case MISALIGNED_INDIRECT_REF:
@@ -2005,7 +1952,7 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
HOST_WIDE_INT offset, size, maxsize;
if (TREE_THIS_VOLATILE (expr))
- s_ann->has_volatile_ops = true;
+ gimple_set_has_volatile_ops (stmt, true);
ref = get_ref_base_and_extent (expr, &offset, &size, &maxsize);
if (TREE_CODE (ref) == INDIRECT_REF)
@@ -2020,7 +1967,7 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
if (code == COMPONENT_REF)
{
if (TREE_THIS_VOLATILE (TREE_OPERAND (expr, 1)))
- s_ann->has_volatile_ops = true;
+ gimple_set_has_volatile_ops (stmt, true);
get_expr_operands (stmt, &TREE_OPERAND (expr, 2), opf_use);
}
else if (code == ARRAY_REF || code == ARRAY_RANGE_REF)
@@ -2040,10 +1987,6 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
get_expr_operands (stmt, &TREE_OPERAND (expr, 0), flags);
return;
- case CALL_EXPR:
- get_call_expr_operands (stmt, expr);
- return;
-
case COND_EXPR:
case VEC_COND_EXPR:
get_expr_operands (stmt, &TREE_OPERAND (expr, 0), opf_use);
@@ -2051,10 +1994,6 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
get_expr_operands (stmt, &TREE_OPERAND (expr, 2), opf_use);
return;
- case GIMPLE_MODIFY_STMT:
- get_modify_stmt_operands (stmt, expr);
- return;
-
case CONSTRUCTOR:
{
/* General aggregate CONSTRUCTORs have been decomposed, but they
@@ -2100,101 +2039,14 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
}
case CHANGE_DYNAMIC_TYPE_EXPR:
- get_expr_operands (stmt, &CHANGE_DYNAMIC_TYPE_LOCATION (expr), opf_use);
- return;
-
- case OMP_FOR:
- {
- tree c, clauses = OMP_FOR_CLAUSES (stmt);
- int i;
-
- for (i = 0; i < TREE_VEC_LENGTH (OMP_FOR_INIT (expr)); i++)
- {
- tree init = TREE_VEC_ELT (OMP_FOR_INIT (expr), i);
- tree cond = TREE_VEC_ELT (OMP_FOR_COND (expr), i);
- tree incr = TREE_VEC_ELT (OMP_FOR_INCR (expr), i);
-
- get_expr_operands (stmt, &GIMPLE_STMT_OPERAND (init, 0), opf_def);
- get_expr_operands (stmt, &GIMPLE_STMT_OPERAND (init, 1), opf_use);
- get_expr_operands (stmt, &TREE_OPERAND (cond, 1), opf_use);
- get_expr_operands (stmt,
- &TREE_OPERAND (GIMPLE_STMT_OPERAND (incr, 1),
- 1), opf_use);
- }
-
- c = find_omp_clause (clauses, OMP_CLAUSE_SCHEDULE);
- if (c)
- get_expr_operands (stmt, &OMP_CLAUSE_SCHEDULE_CHUNK_EXPR (c),
- opf_use);
- return;
- }
-
- case OMP_CONTINUE:
- {
- get_expr_operands (stmt, &TREE_OPERAND (expr, 0), opf_def);
- get_expr_operands (stmt, &TREE_OPERAND (expr, 1), opf_use);
- return;
- }
-
- case OMP_PARALLEL:
- {
- tree c, clauses = OMP_PARALLEL_CLAUSES (stmt);
-
- if (OMP_PARALLEL_DATA_ARG (stmt))
- {
- get_expr_operands (stmt, &OMP_PARALLEL_DATA_ARG (stmt), opf_use);
- add_to_addressable_set (OMP_PARALLEL_DATA_ARG (stmt),
- &s_ann->addresses_taken);
- }
-
- c = find_omp_clause (clauses, OMP_CLAUSE_IF);
- if (c)
- get_expr_operands (stmt, &OMP_CLAUSE_IF_EXPR (c), opf_use);
- c = find_omp_clause (clauses, OMP_CLAUSE_NUM_THREADS);
- if (c)
- get_expr_operands (stmt, &OMP_CLAUSE_NUM_THREADS_EXPR (c), opf_use);
- return;
- }
-
- case OMP_SECTIONS:
- {
- get_expr_operands (stmt, &OMP_SECTIONS_CONTROL (expr), opf_def);
- return;
- }
-
- case OMP_ATOMIC_LOAD:
- {
- tree *addr = &TREE_OPERAND (expr, 1);
- get_expr_operands (stmt, &TREE_OPERAND (expr, 0), opf_def);
-
- if (TREE_CODE (*addr) == ADDR_EXPR)
- get_expr_operands (stmt, &TREE_OPERAND (*addr, 0), opf_def);
- else
- get_addr_dereference_operands (stmt, addr, opf_def,
- NULL_TREE, 0, -1, true);
- return;
- }
-
- case OMP_ATOMIC_STORE:
- {
- get_expr_operands (stmt, &TREE_OPERAND (expr, 0), opf_use);
- return;
- }
+ gcc_unreachable ();
- case BLOCK:
case FUNCTION_DECL:
- case EXC_PTR_EXPR:
- case FILTER_EXPR:
case LABEL_DECL:
case CONST_DECL:
- case OMP_SINGLE:
- case OMP_MASTER:
- case OMP_ORDERED:
- case OMP_CRITICAL:
- case OMP_RETURN:
- case OMP_SECTION:
- case OMP_SECTIONS_SWITCH:
- case PREDICT_EXPR:
+ case CASE_LABEL_EXPR:
+ case FILTER_EXPR:
+ case EXC_PTR_EXPR:
/* Expressions that make no memory references. */
return;
@@ -2221,59 +2073,28 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
build_* operand vectors will have potential operands in them. */
static void
-parse_ssa_operands (tree stmt)
+parse_ssa_operands (gimple stmt)
{
- enum tree_code code;
+ enum gimple_code code = gimple_code (stmt);
- code = TREE_CODE (stmt);
- switch (code)
+ if (code == GIMPLE_ASM)
+ get_asm_expr_operands (stmt);
+ else
{
- case GIMPLE_MODIFY_STMT:
- get_modify_stmt_operands (stmt, stmt);
- break;
+ size_t i, start = 0;
- case COND_EXPR:
- get_expr_operands (stmt, &COND_EXPR_COND (stmt), opf_use);
- break;
-
- case SWITCH_EXPR:
- get_expr_operands (stmt, &SWITCH_COND (stmt), opf_use);
- break;
-
- case ASM_EXPR:
- get_asm_expr_operands (stmt);
- break;
-
- case RETURN_EXPR:
- get_expr_operands (stmt, &TREE_OPERAND (stmt, 0), opf_use);
- break;
-
- case GOTO_EXPR:
- get_expr_operands (stmt, &GOTO_DESTINATION (stmt), opf_use);
- break;
-
- case LABEL_EXPR:
- get_expr_operands (stmt, &LABEL_EXPR_LABEL (stmt), opf_use);
- break;
+ if (code == GIMPLE_ASSIGN || code == GIMPLE_CALL)
+ {
+ get_expr_operands (stmt, gimple_op_ptr (stmt, 0), opf_def);
+ start = 1;
+ }
- case BIND_EXPR:
- case CASE_LABEL_EXPR:
- case TRY_CATCH_EXPR:
- case TRY_FINALLY_EXPR:
- case EH_FILTER_EXPR:
- case CATCH_EXPR:
- case RESX_EXPR:
- /* These nodes contain no variable references. */
- break;
+ for (i = start; i < gimple_num_ops (stmt); i++)
+ get_expr_operands (stmt, gimple_op_ptr (stmt, i), opf_use);
- default:
- /* Notice that if get_expr_operands tries to use &STMT as the
- operand pointer (which may only happen for USE operands), we
- will fail in add_stmt_operand. This default will handle
- statements like empty statements, or CALL_EXPRs that may
- appear on the RHS of a statement or as statements themselves. */
- get_expr_operands (stmt, &stmt, opf_use);
- break;
+ /* Add call-clobbered operands, if needed. */
+ if (code == GIMPLE_CALL)
+ maybe_add_call_clobbered_vops (stmt);
}
}
@@ -2281,17 +2102,16 @@ parse_ssa_operands (tree stmt)
/* Create an operands cache for STMT. */
static void
-build_ssa_operands (tree stmt)
+build_ssa_operands (gimple stmt)
{
- stmt_ann_t ann = get_stmt_ann (stmt);
-
/* Initially assume that the statement has no volatile operands and
makes no memory references. */
- ann->has_volatile_ops = false;
- ann->references_memory = false;
+ gimple_set_has_volatile_ops (stmt, false);
+ gimple_set_references_memory (stmt, false);
+
/* Just clear the bitmap so we don't end up reallocating it over and over. */
- if (ann->addresses_taken)
- bitmap_clear (ann->addresses_taken);
+ if (gimple_addresses_taken (stmt))
+ bitmap_clear (gimple_addresses_taken (stmt));
start_ssa_stmt_operands ();
parse_ssa_operands (stmt);
@@ -2299,13 +2119,10 @@ build_ssa_operands (tree stmt)
operand_build_sort_virtual (build_vdefs);
finalize_ssa_stmt_operands (stmt);
- if (ann->addresses_taken && bitmap_empty_p (ann->addresses_taken))
- ann->addresses_taken = NULL;
-
/* For added safety, assume that statements with volatile operands
also reference memory. */
- if (ann->has_volatile_ops)
- ann->references_memory = true;
+ if (gimple_has_volatile_ops (stmt))
+ gimple_set_references_memory (stmt, true);
}
@@ -2313,12 +2130,12 @@ build_ssa_operands (tree stmt)
the stmt operand lists. */
void
-free_stmt_operands (tree stmt)
+free_stmt_operands (gimple stmt)
{
- def_optype_p defs = DEF_OPS (stmt), last_def;
- use_optype_p uses = USE_OPS (stmt), last_use;
- voptype_p vuses = VUSE_OPS (stmt);
- voptype_p vdefs = VDEF_OPS (stmt), vdef, next_vdef;
+ def_optype_p defs = gimple_def_ops (stmt), last_def;
+ use_optype_p uses = gimple_use_ops (stmt), last_use;
+ voptype_p vuses = gimple_vuse_ops (stmt);
+ voptype_p vdefs = gimple_vdef_ops (stmt), vdef, next_vdef;
unsigned i;
if (defs)
@@ -2327,7 +2144,7 @@ free_stmt_operands (tree stmt)
continue;
last_def->next = gimple_ssa_operands (cfun)->free_defs;
gimple_ssa_operands (cfun)->free_defs = defs;
- DEF_OPS (stmt) = NULL;
+ gimple_set_def_ops (stmt, NULL);
}
if (uses)
@@ -2337,7 +2154,7 @@ free_stmt_operands (tree stmt)
delink_imm_use (USE_OP_PTR (last_use));
last_use->next = gimple_ssa_operands (cfun)->free_uses;
gimple_ssa_operands (cfun)->free_uses = uses;
- USE_OPS (stmt) = NULL;
+ gimple_set_use_ops (stmt, NULL);
}
if (vuses)
@@ -2345,7 +2162,7 @@ free_stmt_operands (tree stmt)
for (i = 0; i < VUSE_NUM (vuses); i++)
delink_imm_use (VUSE_OP_PTR (vuses, i));
add_vop_to_freelist (vuses);
- VUSE_OPS (stmt) = NULL;
+ gimple_set_vuse_ops (stmt, NULL);
}
if (vdefs)
@@ -2356,46 +2173,35 @@ free_stmt_operands (tree stmt)
delink_imm_use (VDEF_OP_PTR (vdef, 0));
add_vop_to_freelist (vdef);
}
- VDEF_OPS (stmt) = NULL;
+ gimple_set_vdef_ops (stmt, NULL);
}
-}
+ if (gimple_has_ops (stmt))
+ gimple_set_addresses_taken (stmt, NULL);
-/* Free any operands vectors in OPS. */
-
-void
-free_ssa_operands (stmt_operands_p ops)
-{
- ops->def_ops = NULL;
- ops->use_ops = NULL;
- ops->vdef_ops = NULL;
- ops->vuse_ops = NULL;
- BITMAP_FREE (ops->loads);
- BITMAP_FREE (ops->stores);
+ if (gimple_has_mem_ops (stmt))
+ {
+ gimple_set_stored_syms (stmt, NULL, &operands_bitmap_obstack);
+ gimple_set_loaded_syms (stmt, NULL, &operands_bitmap_obstack);
+ }
}
/* Get the operands of statement STMT. */
void
-update_stmt_operands (tree stmt)
+update_stmt_operands (gimple stmt)
{
- stmt_ann_t ann = get_stmt_ann (stmt);
-
/* If update_stmt_operands is called before SSA is initialized, do
nothing. */
if (!ssa_operands_active ())
return;
- /* The optimizers cannot handle statements that are nothing but a
- _DECL. This indicates a bug in the gimplifier. */
- gcc_assert (!SSA_VAR_P (stmt));
-
timevar_push (TV_TREE_OPS);
- gcc_assert (ann->modified);
+ gcc_assert (gimple_modified_p (stmt));
build_ssa_operands (stmt);
- ann->modified = 0;
+ gimple_set_modified (stmt, false);
timevar_pop (TV_TREE_OPS);
}
@@ -2404,50 +2210,45 @@ update_stmt_operands (tree stmt)
/* Copies virtual operands from SRC to DST. */
void
-copy_virtual_operands (tree dest, tree src)
+copy_virtual_operands (gimple dest, gimple src)
{
unsigned int i, n;
voptype_p src_vuses, dest_vuses;
voptype_p src_vdefs, dest_vdefs;
struct voptype_d vuse;
struct voptype_d vdef;
- stmt_ann_t dest_ann;
- VDEF_OPS (dest) = NULL;
- VUSE_OPS (dest) = NULL;
+ if (!gimple_has_mem_ops (src))
+ return;
- dest_ann = get_stmt_ann (dest);
- BITMAP_FREE (dest_ann->operands.loads);
- BITMAP_FREE (dest_ann->operands.stores);
+ gimple_set_vdef_ops (dest, NULL);
+ gimple_set_vuse_ops (dest, NULL);
- if (LOADED_SYMS (src))
- {
- dest_ann->operands.loads = BITMAP_ALLOC (&operands_bitmap_obstack);
- bitmap_copy (dest_ann->operands.loads, LOADED_SYMS (src));
- }
-
- if (STORED_SYMS (src))
- {
- dest_ann->operands.stores = BITMAP_ALLOC (&operands_bitmap_obstack);
- bitmap_copy (dest_ann->operands.stores, STORED_SYMS (src));
- }
+ gimple_set_stored_syms (dest, gimple_stored_syms (src),
+ &operands_bitmap_obstack);
+ gimple_set_loaded_syms (dest, gimple_loaded_syms (src),
+ &operands_bitmap_obstack);
/* Copy all the VUSE operators and corresponding operands. */
dest_vuses = &vuse;
- for (src_vuses = VUSE_OPS (src); src_vuses; src_vuses = src_vuses->next)
+ for (src_vuses = gimple_vuse_ops (src);
+ src_vuses;
+ src_vuses = src_vuses->next)
{
n = VUSE_NUM (src_vuses);
dest_vuses = add_vuse_op (dest, NULL_TREE, n, dest_vuses);
for (i = 0; i < n; i++)
SET_USE (VUSE_OP_PTR (dest_vuses, i), VUSE_OP (src_vuses, i));
- if (VUSE_OPS (dest) == NULL)
- VUSE_OPS (dest) = vuse.next;
+ if (gimple_vuse_ops (dest) == NULL)
+ gimple_set_vuse_ops (dest, vuse.next);
}
/* Copy all the VDEF operators and corresponding operands. */
dest_vdefs = &vdef;
- for (src_vdefs = VDEF_OPS (src); src_vdefs; src_vdefs = src_vdefs->next)
+ for (src_vdefs = gimple_vdef_ops (src);
+ src_vdefs;
+ src_vdefs = src_vdefs->next)
{
n = VUSE_NUM (src_vdefs);
dest_vdefs = add_vdef_op (dest, NULL_TREE, n, dest_vdefs);
@@ -2455,8 +2256,8 @@ copy_virtual_operands (tree dest, tree src)
for (i = 0; i < n; i++)
SET_USE (VUSE_OP_PTR (dest_vdefs, i), VUSE_OP (src_vdefs, i));
- if (VDEF_OPS (dest) == NULL)
- VDEF_OPS (dest) = vdef.next;
+ if (gimple_vdef_ops (dest) == NULL)
+ gimple_set_vdef_ops (dest, vdef.next);
}
}
@@ -2469,19 +2270,15 @@ copy_virtual_operands (tree dest, tree src)
uses of this stmt will be de-linked. */
void
-create_ssa_artificial_load_stmt (tree new_stmt, tree old_stmt,
+create_ssa_artificial_load_stmt (gimple new_stmt, gimple old_stmt,
bool delink_imm_uses_p)
{
tree op;
ssa_op_iter iter;
use_operand_p use_p;
unsigned i;
- stmt_ann_t ann;
- /* Create the stmt annotation but make sure to not mark the stmt
- as modified as we will build operands ourselves. */
- ann = get_stmt_ann (new_stmt);
- ann->modified = 0;
+ gimple_set_modified (new_stmt, false);
/* Process NEW_STMT looking for operands. */
start_ssa_stmt_operands ();
@@ -2521,7 +2318,7 @@ create_ssa_artificial_load_stmt (tree new_stmt, tree old_stmt,
to test the validity of the swap operation. */
void
-swap_tree_operands (tree stmt, tree *exp0, tree *exp1)
+swap_tree_operands (gimple stmt, tree *exp0, tree *exp1)
{
tree op0, op1;
op0 = *exp0;
@@ -2536,14 +2333,14 @@ swap_tree_operands (tree stmt, tree *exp0, tree *exp1)
use0 = use1 = NULL;
/* Find the 2 operands in the cache, if they are there. */
- for (ptr = USE_OPS (stmt); ptr; ptr = ptr->next)
+ for (ptr = gimple_use_ops (stmt); ptr; ptr = ptr->next)
if (USE_OP_PTR (ptr)->use == exp0)
{
use0 = ptr;
break;
}
- for (ptr = USE_OPS (stmt); ptr; ptr = ptr->next)
+ for (ptr = gimple_use_ops (stmt); ptr; ptr = ptr->next)
if (USE_OP_PTR (ptr)->use == exp1)
{
use1 = ptr;
@@ -2565,19 +2362,13 @@ swap_tree_operands (tree stmt, tree *exp0, tree *exp1)
*exp1 = op0;
}
-
-/* Add the base address of REF to the set *ADDRESSES_TAKEN. If
- *ADDRESSES_TAKEN is NULL, a new set is created. REF may be
- a single variable whose address has been taken or any other valid
- GIMPLE memory reference (structure reference, array, etc). */
+/* Add the base address of REF to SET. */
void
-add_to_addressable_set (tree ref, bitmap *addresses_taken)
+add_to_addressable_set (tree ref, bitmap *set)
{
tree var;
- gcc_assert (addresses_taken);
-
/* Note that it is *NOT OKAY* to use the target of a COMPONENT_REF
as the only thing we take the address of. If VAR is a structure,
taking the address of a field means that the whole structure may
@@ -2586,14 +2377,29 @@ add_to_addressable_set (tree ref, bitmap *addresses_taken)
var = get_base_address (ref);
if (var && SSA_VAR_P (var))
{
- if (*addresses_taken == NULL)
- *addresses_taken = BITMAP_GGC_ALLOC ();
- bitmap_set_bit (*addresses_taken, DECL_UID (var));
+ if (*set == NULL)
+ *set = BITMAP_ALLOC (&operands_bitmap_obstack);
+
+ bitmap_set_bit (*set, DECL_UID (var));
TREE_ADDRESSABLE (var) = 1;
}
}
+/* Add the base address of REF to the set of addresses taken by STMT.
+ REF may be a single variable whose address has been taken or any
+ other valid GIMPLE memory reference (structure reference, array,
+ etc). If the base address of REF is a decl that has sub-variables,
+ also add all of its sub-variables. */
+
+void
+gimple_add_to_addresses_taken (gimple stmt, tree ref)
+{
+ gcc_assert (gimple_has_ops (stmt));
+ add_to_addressable_set (ref, gimple_addresses_taken_ptr (stmt));
+}
+
+
/* Scan the immediate_use list for VAR making sure its linked properly.
Return TRUE if there is a problem and emit an error message to F. */
@@ -2653,10 +2459,10 @@ verify_imm_links (FILE *f, tree var)
return false;
error:
- if (ptr->stmt && stmt_modified_p (ptr->stmt))
+ if (ptr->loc.stmt && gimple_modified_p (ptr->loc.stmt))
{
- fprintf (f, " STMT MODIFIED. - <%p> ", (void *)ptr->stmt);
- print_generic_stmt (f, ptr->stmt, TDF_SLIM);
+ fprintf (f, " STMT MODIFIED. - <%p> ", (void *)ptr->loc.stmt);
+ print_gimple_stmt (f, ptr->loc.stmt, 0, TDF_SLIM);
}
fprintf (f, " IMM ERROR : (use_p : tree - %p:%p)", (void *)ptr,
(void *)ptr->use);
@@ -2688,13 +2494,13 @@ dump_immediate_uses_for (FILE *file, tree var)
FOR_EACH_IMM_USE_FAST (use_p, iter, var)
{
- if (use_p->stmt == NULL && use_p->use == NULL)
+ if (use_p->loc.stmt == NULL && use_p->use == NULL)
fprintf (file, "***end of stmt iterator marker***\n");
else
if (!is_gimple_reg (USE_FROM_PTR (use_p)))
- print_generic_stmt (file, USE_STMT (use_p), TDF_VOPS|TDF_MEMSYMS);
+ print_gimple_stmt (file, USE_STMT (use_p), 0, TDF_VOPS|TDF_MEMSYMS);
else
- print_generic_stmt (file, USE_STMT (use_p), TDF_SLIM);
+ print_gimple_stmt (file, USE_STMT (use_p), 0, TDF_SLIM);
}
fprintf(file, "\n");
}
@@ -2745,15 +2551,15 @@ debug_immediate_uses_for (tree var)
needed to keep the SSA form up to date. */
void
-push_stmt_changes (tree *stmt_p)
+push_stmt_changes (gimple *stmt_p)
{
- tree stmt;
+ gimple stmt;
scb_t buf;
-
+
stmt = *stmt_p;
/* It makes no sense to keep track of PHI nodes. */
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
return;
buf = XNEW (struct scb_d);
@@ -2761,7 +2567,7 @@ push_stmt_changes (tree *stmt_p)
buf->stmt_p = stmt_p;
- if (stmt_references_memory_p (stmt))
+ if (gimple_references_memory_p (stmt))
{
tree op;
ssa_op_iter i;
@@ -2815,9 +2621,10 @@ mark_difference_for_renaming (bitmap s1, bitmap s2)
the statement. */
void
-pop_stmt_changes (tree *stmt_p)
+pop_stmt_changes (gimple *stmt_p)
{
- tree op, stmt;
+ tree op;
+ gimple stmt;
ssa_op_iter iter;
bitmap loads, stores;
scb_t buf;
@@ -2825,7 +2632,7 @@ pop_stmt_changes (tree *stmt_p)
stmt = *stmt_p;
/* It makes no sense to keep track of PHI nodes. */
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
return;
buf = VEC_pop (scb_t, scb_stack);
@@ -2843,7 +2650,7 @@ pop_stmt_changes (tree *stmt_p)
memory anymore, but we still need to act on the differences in
the sets of symbols. */
loads = stores = NULL;
- if (stmt_references_memory_p (stmt))
+ if (gimple_references_memory_p (stmt))
{
tree op;
ssa_op_iter i;
@@ -2906,14 +2713,14 @@ pop_stmt_changes (tree *stmt_p)
statement. It avoids the expensive operand re-scan. */
void
-discard_stmt_changes (tree *stmt_p)
+discard_stmt_changes (gimple *stmt_p)
{
scb_t buf;
- tree stmt;
+ gimple stmt;
/* It makes no sense to keep track of PHI nodes. */
stmt = *stmt_p;
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
return;
buf = VEC_pop (scb_t, scb_stack);
@@ -2925,15 +2732,3 @@ discard_stmt_changes (tree *stmt_p)
buf->stmt_p = NULL;
free (buf);
}
-
-
-/* Returns true if statement STMT may access memory. */
-
-bool
-stmt_references_memory_p (tree stmt)
-{
- if (!gimple_ssa_operands (cfun)->ops_active || TREE_CODE (stmt) == PHI_NODE)
- return false;
-
- return stmt_ann (stmt)->references_memory;
-}
diff --git a/gcc/tree-ssa-operands.h b/gcc/tree-ssa-operands.h
index ba9793d8346..cdbc050b579 100644
--- a/gcc/tree-ssa-operands.h
+++ b/gcc/tree-ssa-operands.h
@@ -157,15 +157,7 @@ typedef struct stmt_operands_d *stmt_operands_p;
#define SET_USE(USE, V) set_ssa_use_from_ptr (USE, V)
#define SET_DEF(DEF, V) ((*(DEF)) = (V))
-#define USE_STMT(USE) (USE)->stmt
-
-#define DEF_OPS(STMT) (stmt_ann (STMT)->operands.def_ops)
-#define USE_OPS(STMT) (stmt_ann (STMT)->operands.use_ops)
-#define VUSE_OPS(STMT) (stmt_ann (STMT)->operands.vuse_ops)
-#define VDEF_OPS(STMT) (stmt_ann (STMT)->operands.vdef_ops)
-
-#define LOADED_SYMS(STMT) (stmt_ann (STMT)->operands.loads)
-#define STORED_SYMS(STMT) (stmt_ann (STMT)->operands.stores)
+#define USE_STMT(USE) (USE)->loc.stmt
#define USE_OP_PTR(OP) (&((OP)->use_ptr))
#define USE_OP(OP) (USE_FROM_PTR (USE_OP_PTR (OP)))
@@ -187,11 +179,11 @@ typedef struct stmt_operands_d *stmt_operands_p;
#define VDEF_NUM(OP) VUSE_VECT_NUM_ELEM ((OP)->usev)
#define VDEF_VECT(OP) &((OP)->usev)
-#define PHI_RESULT_PTR(PHI) get_phi_result_ptr (PHI)
+#define PHI_RESULT_PTR(PHI) gimple_phi_result_ptr (PHI)
#define PHI_RESULT(PHI) DEF_FROM_PTR (PHI_RESULT_PTR (PHI))
#define SET_PHI_RESULT(PHI, V) SET_DEF (PHI_RESULT_PTR (PHI), (V))
-#define PHI_ARG_DEF_PTR(PHI, I) get_phi_arg_def_ptr ((PHI), (I))
+#define PHI_ARG_DEF_PTR(PHI, I) gimple_phi_arg_imm_use_ptr ((PHI), (I))
#define PHI_ARG_DEF(PHI, I) USE_FROM_PTR (PHI_ARG_DEF_PTR ((PHI), (I)))
#define SET_PHI_ARG_DEF(PHI, I, V) \
SET_USE (PHI_ARG_DEF_PTR ((PHI), (I)), (V))
@@ -204,14 +196,13 @@ typedef struct stmt_operands_d *stmt_operands_p;
extern void init_ssa_operands (void);
extern void fini_ssa_operands (void);
-extern void free_ssa_operands (stmt_operands_p);
-extern void update_stmt_operands (tree);
-extern void free_stmt_operands (tree);
+extern void update_stmt_operands (gimple);
+extern void free_stmt_operands (gimple);
extern bool verify_imm_links (FILE *f, tree var);
-extern void copy_virtual_operands (tree, tree);
+extern void copy_virtual_operands (gimple, gimple);
extern int operand_build_cmp (const void *, const void *);
-extern void create_ssa_artificial_load_stmt (tree, tree, bool);
+extern void create_ssa_artificial_load_stmt (gimple, gimple, bool);
extern void dump_immediate_uses (FILE *file);
extern void dump_immediate_uses_for (FILE *file, tree var);
@@ -222,10 +213,10 @@ extern void debug_decl_set (bitmap);
extern bool ssa_operands_active (void);
-extern void add_to_addressable_set (tree, bitmap *);
-extern void push_stmt_changes (tree *);
-extern void pop_stmt_changes (tree *);
-extern void discard_stmt_changes (tree *);
+extern void push_stmt_changes (gimple *);
+extern void pop_stmt_changes (gimple *);
+extern void discard_stmt_changes (gimple *);
+void add_to_addressable_set (tree, bitmap *);
enum ssa_op_iter_type {
ssa_op_iter_none = 0,
@@ -250,7 +241,7 @@ typedef struct ssa_operand_iterator_d
enum ssa_op_iter_type iter_type;
int phi_i;
int num_phi;
- tree phi_stmt;
+ gimple phi_stmt;
bool done;
unsigned int vuse_index;
unsigned int mayuse_index;
@@ -316,7 +307,7 @@ typedef struct ssa_operand_iterator_d
/* This macro will execute a loop over a stmt, regardless of whether it is
a real stmt or a PHI node, looking at the USE nodes matching FLAGS. */
#define FOR_EACH_PHI_OR_STMT_USE(USEVAR, STMT, ITER, FLAGS) \
- for ((USEVAR) = (TREE_CODE (STMT) == PHI_NODE \
+ for ((USEVAR) = (gimple_code (STMT) == GIMPLE_PHI \
? op_iter_init_phiuse (&(ITER), STMT, FLAGS) \
: op_iter_init_use (&(ITER), STMT, FLAGS)); \
!op_iter_done (&(ITER)); \
@@ -325,7 +316,7 @@ typedef struct ssa_operand_iterator_d
/* This macro will execute a loop over a stmt, regardless of whether it is
a real stmt or a PHI node, looking at the DEF nodes matching FLAGS. */
#define FOR_EACH_PHI_OR_STMT_DEF(DEFVAR, STMT, ITER, FLAGS) \
- for ((DEFVAR) = (TREE_CODE (STMT) == PHI_NODE \
+ for ((DEFVAR) = (gimple_code (STMT) == GIMPLE_PHI \
? op_iter_init_phidef (&(ITER), STMT, FLAGS) \
: op_iter_init_def (&(ITER), STMT, FLAGS)); \
!op_iter_done (&(ITER)); \
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index 80917a88525..72ba04a09b8 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -37,19 +37,20 @@ along with GCC; see the file COPYING3. If not see
#include "pointer-set.h"
#include "domwalk.h"
+static unsigned int tree_ssa_phiopt (void);
static unsigned int tree_ssa_phiopt_worker (bool);
static bool conditional_replacement (basic_block, basic_block,
- edge, edge, tree, tree, tree);
+ edge, edge, gimple, tree, tree);
static bool value_replacement (basic_block, basic_block,
- edge, edge, tree, tree, tree);
+ edge, edge, gimple, tree, tree);
static bool minmax_replacement (basic_block, basic_block,
- edge, edge, tree, tree, tree);
+ edge, edge, gimple, tree, tree);
static bool abs_replacement (basic_block, basic_block,
- edge, edge, tree, tree, tree);
+ edge, edge, gimple, tree, tree);
static bool cond_store_replacement (basic_block, basic_block, edge, edge,
struct pointer_set_t *);
static struct pointer_set_t * get_non_trapping (void);
-static void replace_phi_edge_with_variable (basic_block, edge, tree, tree);
+static void replace_phi_edge_with_variable (basic_block, edge, gimple, tree);
/* This pass tries to replaces an if-then-else block with an
assignment. We have four kinds of transformations. Some of these
@@ -208,18 +209,17 @@ tree_ssa_phiopt_worker (bool do_store_elim)
for (i = 0; i < n; i++)
{
- tree cond_expr;
- tree phi;
+ gimple cond_stmt, phi;
basic_block bb1, bb2;
edge e1, e2;
tree arg0, arg1;
bb = bb_order[i];
- cond_expr = last_stmt (bb);
- /* Check to see if the last statement is a COND_EXPR. */
- if (!cond_expr
- || TREE_CODE (cond_expr) != COND_EXPR)
+ cond_stmt = last_stmt (bb);
+ /* Check to see if the last statement is a GIMPLE_COND. */
+ if (!cond_stmt
+ || gimple_code (cond_stmt) != GIMPLE_COND)
continue;
e1 = EDGE_SUCC (bb, 0);
@@ -278,16 +278,17 @@ tree_ssa_phiopt_worker (bool do_store_elim)
}
else
{
- phi = phi_nodes (bb2);
+ gimple_seq phis = phi_nodes (bb2);
/* Check to make sure that there is only one PHI node.
TODO: we could do it with more than one iff the other PHI nodes
have the same elements for these two edges. */
- if (!phi || PHI_CHAIN (phi) != NULL)
+ if (! gimple_seq_singleton_p (phis))
continue;
- arg0 = PHI_ARG_DEF_TREE (phi, e1->dest_idx);
- arg1 = PHI_ARG_DEF_TREE (phi, e2->dest_idx);
+ phi = gsi_stmt (gsi_start (phis));
+ arg0 = gimple_phi_arg_def (phi, e1->dest_idx);
+ arg1 = gimple_phi_arg_def (phi, e2->dest_idx);
/* Something is wrong if we cannot find the arguments in the PHI
node. */
@@ -314,7 +315,7 @@ tree_ssa_phiopt_worker (bool do_store_elim)
{
/* In cond-store replacement we have added some loads on edges
and new VOPS (as we moved the store, and created a load). */
- bsi_commit_edge_inserts ();
+ gsi_commit_edge_inserts ();
return TODO_cleanup_cfg | TODO_update_ssa_only_virtuals;
}
else if (cfgchanged)
@@ -382,19 +383,8 @@ blocks_in_phiopt_order (void)
bool
empty_block_p (basic_block bb)
{
- block_stmt_iterator bsi;
-
/* BB must have no executable statements. */
- bsi = bsi_start (bb);
- while (!bsi_end_p (bsi)
- && (TREE_CODE (bsi_stmt (bsi)) == LABEL_EXPR
- || IS_EMPTY_STMT (bsi_stmt (bsi))))
- bsi_next (&bsi);
-
- if (!bsi_end_p (bsi))
- return false;
-
- return true;
+ return gsi_end_p (gsi_after_labels (bb));
}
/* Replace PHI node element whose edge is E in block BB with variable NEW.
@@ -403,11 +393,11 @@ empty_block_p (basic_block bb)
static void
replace_phi_edge_with_variable (basic_block cond_block,
- edge e, tree phi, tree new_tree)
+ edge e, gimple phi, tree new_tree)
{
- basic_block bb = bb_for_stmt (phi);
+ basic_block bb = gimple_bb (phi);
basic_block block_to_remove;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
/* Change the PHI argument to new. */
SET_USE (PHI_ARG_DEF_PTR (phi, e->dest_idx), new_tree);
@@ -435,8 +425,8 @@ replace_phi_edge_with_variable (basic_block cond_block,
delete_basic_block (block_to_remove);
/* Eliminate the COND_EXPR at the end of COND_BLOCK. */
- bsi = bsi_last (cond_block);
- bsi_remove (&bsi, true);
+ gsi = gsi_last_bb (cond_block);
+ gsi_remove (&gsi, true);
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,
@@ -453,16 +443,15 @@ replace_phi_edge_with_variable (basic_block cond_block,
static bool
conditional_replacement (basic_block cond_bb, basic_block middle_bb,
- edge e0, edge e1, tree phi,
+ edge e0, edge e1, gimple phi,
tree arg0, tree arg1)
{
tree result;
- tree old_result = NULL;
- tree new_stmt, cond;
- block_stmt_iterator bsi;
+ gimple stmt, new_stmt;
+ tree cond;
+ gimple_stmt_iterator gsi;
edge true_edge, false_edge;
- tree new_var = NULL;
- tree new_var1;
+ tree new_var, new_var2;
/* FIXME: Gimplification of complex type is too hard for now. */
if (TREE_CODE (TREE_TYPE (arg0)) == COMPLEX_TYPE
@@ -480,61 +469,7 @@ conditional_replacement (basic_block cond_bb, basic_block middle_bb,
if (!empty_block_p (middle_bb))
return false;
- /* If the condition is not a naked SSA_NAME and its type does not
- match the type of the result, then we have to create a new
- variable to optimize this case as it would likely create
- non-gimple code when the condition was converted to the
- result's type. */
- cond = COND_EXPR_COND (last_stmt (cond_bb));
- result = PHI_RESULT (phi);
- if (TREE_CODE (cond) != SSA_NAME
- && !useless_type_conversion_p (TREE_TYPE (result), TREE_TYPE (cond)))
- {
- tree tmp;
-
- if (!COMPARISON_CLASS_P (cond))
- return false;
-
- tmp = create_tmp_var (TREE_TYPE (cond), NULL);
- add_referenced_var (tmp);
- new_var = make_ssa_name (tmp, NULL);
- old_result = cond;
- cond = new_var;
- }
-
- /* If the condition was a naked SSA_NAME and the type is not the
- same as the type of the result, then convert the type of the
- condition. */
- if (!useless_type_conversion_p (TREE_TYPE (result), TREE_TYPE (cond)))
- cond = fold_convert (TREE_TYPE (result), cond);
-
- /* We need to know which is the true edge and which is the false
- edge so that we know when to invert the condition below. */
- extract_true_false_edges_from_block (cond_bb, &true_edge, &false_edge);
-
- /* Insert our new statement at the end of conditional block before the
- COND_EXPR. */
- bsi = bsi_last (cond_bb);
- bsi_insert_before (&bsi, build_empty_stmt (), BSI_NEW_STMT);
-
- if (old_result)
- {
- tree new1;
-
- new1 = build2 (TREE_CODE (old_result), TREE_TYPE (old_result),
- TREE_OPERAND (old_result, 0),
- TREE_OPERAND (old_result, 1));
-
- new1 = build_gimple_modify_stmt (new_var, new1);
- SSA_NAME_DEF_STMT (new_var) = new1;
-
- bsi_insert_after (&bsi, new1, BSI_NEW_STMT);
- }
-
- new_var1 = duplicate_ssa_name (PHI_RESULT (phi), NULL);
-
-
- /* At this point we know we have a COND_EXPR with two successors.
+ /* At this point we know we have a GIMPLE_COND with two successors.
One successor is BB, the other successor is an empty block which
falls through into BB.
@@ -549,71 +484,46 @@ conditional_replacement (basic_block cond_bb, basic_block middle_bb,
We use the condition as-is if the argument associated with the
true edge has the value one or the argument associated with the
false edge as the value zero. Note that those conditions are not
- the same since only one of the outgoing edges from the COND_EXPR
+ the same since only one of the outgoing edges from the GIMPLE_COND
will directly reach BB and thus be associated with an argument. */
- if ((e0 == true_edge && integer_onep (arg0))
- || (e0 == false_edge && integer_zerop (arg0))
- || (e1 == true_edge && integer_onep (arg1))
- || (e1 == false_edge && integer_zerop (arg1)))
- {
- new_stmt = build_gimple_modify_stmt (new_var1, cond);
- }
- else
- {
- tree cond1 = invert_truthvalue (cond);
-
- cond = cond1;
-
- /* If what we get back is a conditional expression, there is no
- way that it can be gimple. */
- if (TREE_CODE (cond) == COND_EXPR)
- {
- release_ssa_name (new_var1);
- return false;
- }
- /* If COND is not something we can expect to be reducible to a GIMPLE
- condition, return early. */
- if (is_gimple_cast (cond))
- cond1 = TREE_OPERAND (cond, 0);
- if (TREE_CODE (cond1) == TRUTH_NOT_EXPR
- && !is_gimple_val (TREE_OPERAND (cond1, 0)))
- {
- release_ssa_name (new_var1);
- return false;
- }
+ stmt = last_stmt (cond_bb);
+ result = PHI_RESULT (phi);
- /* If what we get back is not gimple try to create it as gimple by
- using a temporary variable. */
- if (is_gimple_cast (cond)
- && !is_gimple_val (TREE_OPERAND (cond, 0)))
- {
- tree op0, tmp, cond_tmp;
-
- /* Only "real" casts are OK here, not everything that is
- acceptable to is_gimple_cast. Make sure we don't do
- anything stupid here. */
- gcc_assert (CONVERT_EXPR_P (cond));
-
- op0 = TREE_OPERAND (cond, 0);
- tmp = create_tmp_var (TREE_TYPE (op0), NULL);
- add_referenced_var (tmp);
- cond_tmp = make_ssa_name (tmp, NULL);
- new_stmt = build_gimple_modify_stmt (cond_tmp, op0);
- SSA_NAME_DEF_STMT (cond_tmp) = new_stmt;
-
- bsi_insert_after (&bsi, new_stmt, BSI_NEW_STMT);
- cond = fold_convert (TREE_TYPE (result), cond_tmp);
- }
+ /* To handle special cases like floating point comparison, it is easier and
+ less error-prone to build a tree and gimplify it on the fly though it is
+ less efficient. */
+ cond = fold_build2 (gimple_cond_code (stmt), boolean_type_node,
+ gimple_cond_lhs (stmt), gimple_cond_rhs (stmt));
- new_stmt = build_gimple_modify_stmt (new_var1, cond);
+ /* We need to know which is the true edge and which is the false
+ edge so that we know when to invert the condition below. */
+ extract_true_false_edges_from_block (cond_bb, &true_edge, &false_edge);
+ if ((e0 == true_edge && integer_zerop (arg0))
+ || (e0 == false_edge && integer_onep (arg0))
+ || (e1 == true_edge && integer_zerop (arg1))
+ || (e1 == false_edge && integer_onep (arg1)))
+ cond = fold_build1 (TRUTH_NOT_EXPR, TREE_TYPE (cond), cond);
+
+ /* Insert our new statements at the end of conditional block before the
+ COND_STMT. */
+ gsi = gsi_for_stmt (stmt);
+ new_var = force_gimple_operand_gsi (&gsi, cond, true, NULL, true,
+ GSI_SAME_STMT);
+
+ if (!useless_type_conversion_p (TREE_TYPE (result), TREE_TYPE (new_var)))
+ {
+ new_var2 = create_tmp_var (TREE_TYPE (result), NULL);
+ add_referenced_var (new_var2);
+ new_stmt = gimple_build_assign_with_ops (CONVERT_EXPR, new_var2,
+ new_var, NULL);
+ new_var2 = make_ssa_name (new_var2, new_stmt);
+ gimple_assign_set_lhs (new_stmt, new_var2);
+ gsi_insert_before (&gsi, new_stmt, GSI_SAME_STMT);
+ new_var = new_var2;
}
- bsi_insert_after (&bsi, new_stmt, BSI_NEW_STMT);
-
- SSA_NAME_DEF_STMT (new_var1) = new_stmt;
-
- replace_phi_edge_with_variable (cond_bb, e1, phi, new_var1);
+ replace_phi_edge_with_variable (cond_bb, e1, phi, new_var);
/* Note that we optimized this PHI. */
return true;
@@ -627,11 +537,12 @@ conditional_replacement (basic_block cond_bb, basic_block middle_bb,
static bool
value_replacement (basic_block cond_bb, basic_block middle_bb,
- edge e0, edge e1, tree phi,
+ edge e0, edge e1, gimple phi,
tree arg0, tree arg1)
{
- tree cond;
+ gimple cond;
edge true_edge, false_edge;
+ enum tree_code code;
/* If the type says honor signed zeros we cannot do this
optimization. */
@@ -641,10 +552,11 @@ value_replacement (basic_block cond_bb, basic_block middle_bb,
if (!empty_block_p (middle_bb))
return false;
- cond = COND_EXPR_COND (last_stmt (cond_bb));
+ cond = last_stmt (cond_bb);
+ code = gimple_cond_code (cond);
/* This transformation is only valid for equality comparisons. */
- if (TREE_CODE (cond) != NE_EXPR && TREE_CODE (cond) != EQ_EXPR)
+ if (code != NE_EXPR && code != EQ_EXPR)
return false;
/* We need to know which is the true edge and which is the false
@@ -662,10 +574,10 @@ value_replacement (basic_block cond_bb, basic_block middle_bb,
We now need to verify that the two arguments in the PHI node match
the two arguments to the equality comparison. */
- if ((operand_equal_for_phi_arg_p (arg0, TREE_OPERAND (cond, 0))
- && operand_equal_for_phi_arg_p (arg1, TREE_OPERAND (cond, 1)))
- || (operand_equal_for_phi_arg_p (arg1, TREE_OPERAND (cond, 0))
- && operand_equal_for_phi_arg_p (arg0, TREE_OPERAND (cond, 1))))
+ if ((operand_equal_for_phi_arg_p (arg0, gimple_cond_lhs (cond))
+ && operand_equal_for_phi_arg_p (arg1, gimple_cond_rhs (cond)))
+ || (operand_equal_for_phi_arg_p (arg1, gimple_cond_lhs (cond))
+ && operand_equal_for_phi_arg_p (arg0, gimple_cond_rhs (cond))))
{
edge e;
tree arg;
@@ -673,7 +585,7 @@ value_replacement (basic_block cond_bb, basic_block middle_bb,
/* For NE_EXPR, we want to build an assignment result = arg where
arg is the PHI argument associated with the true edge. For
EQ_EXPR we want the PHI argument associated with the false edge. */
- e = (TREE_CODE (cond) == NE_EXPR ? true_edge : false_edge);
+ e = (code == NE_EXPR ? true_edge : false_edge);
/* Unfortunately, E may not reach BB (it may instead have gone to
OTHER_BLOCK). If that is the case, then we want the single outgoing
@@ -705,15 +617,15 @@ value_replacement (basic_block cond_bb, basic_block middle_bb,
static bool
minmax_replacement (basic_block cond_bb, basic_block middle_bb,
- edge e0, edge e1, tree phi,
+ edge e0, edge e1, gimple phi,
tree arg0, tree arg1)
{
tree result, type;
- tree cond, new_stmt;
+ gimple cond, new_stmt;
edge true_edge, false_edge;
enum tree_code cmp, minmax, ass_code;
tree smaller, larger, arg_true, arg_false;
- block_stmt_iterator bsi, bsi_from;
+ gimple_stmt_iterator gsi, gsi_from;
type = TREE_TYPE (PHI_RESULT (phi));
@@ -721,21 +633,21 @@ minmax_replacement (basic_block cond_bb, basic_block middle_bb,
if (HONOR_NANS (TYPE_MODE (type)))
return false;
- cond = COND_EXPR_COND (last_stmt (cond_bb));
- cmp = TREE_CODE (cond);
+ cond = last_stmt (cond_bb);
+ cmp = gimple_cond_code (cond);
result = PHI_RESULT (phi);
/* This transformation is only valid for order comparisons. Record which
operand is smaller/larger if the result of the comparison is true. */
if (cmp == LT_EXPR || cmp == LE_EXPR)
{
- smaller = TREE_OPERAND (cond, 0);
- larger = TREE_OPERAND (cond, 1);
+ smaller = gimple_cond_lhs (cond);
+ larger = gimple_cond_rhs (cond);
}
else if (cmp == GT_EXPR || cmp == GE_EXPR)
{
- smaller = TREE_OPERAND (cond, 1);
- larger = TREE_OPERAND (cond, 0);
+ smaller = gimple_cond_rhs (cond);
+ larger = gimple_cond_lhs (cond);
}
else
return false;
@@ -796,20 +708,19 @@ minmax_replacement (basic_block cond_bb, basic_block middle_bb,
b = MAX (a, d);
x = MIN (b, u); */
- tree assign = last_and_only_stmt (middle_bb);
- tree lhs, rhs, op0, op1, bound;
+ gimple assign = last_and_only_stmt (middle_bb);
+ tree lhs, op0, op1, bound;
if (!assign
- || TREE_CODE (assign) != GIMPLE_MODIFY_STMT)
+ || gimple_code (assign) != GIMPLE_ASSIGN)
return false;
- lhs = GIMPLE_STMT_OPERAND (assign, 0);
- rhs = GIMPLE_STMT_OPERAND (assign, 1);
- ass_code = TREE_CODE (rhs);
+ lhs = gimple_assign_lhs (assign);
+ ass_code = gimple_assign_rhs_code (assign);
if (ass_code != MAX_EXPR && ass_code != MIN_EXPR)
return false;
- op0 = TREE_OPERAND (rhs, 0);
- op1 = TREE_OPERAND (rhs, 1);
+ op0 = gimple_assign_rhs1 (assign);
+ op1 = gimple_assign_rhs2 (assign);
if (true_edge->src == middle_bb)
{
@@ -931,17 +842,16 @@ minmax_replacement (basic_block cond_bb, basic_block middle_bb,
}
/* Move the statement from the middle block. */
- bsi = bsi_last (cond_bb);
- bsi_from = bsi_last (middle_bb);
- bsi_move_before (&bsi_from, &bsi);
+ gsi = gsi_last_bb (cond_bb);
+ gsi_from = gsi_last_bb (middle_bb);
+ gsi_move_before (&gsi_from, &gsi);
}
/* Emit the statement to compute min/max. */
result = duplicate_ssa_name (PHI_RESULT (phi), NULL);
- new_stmt = build_gimple_modify_stmt (result, build2 (minmax, type, arg0, arg1));
- SSA_NAME_DEF_STMT (result) = new_stmt;
- bsi = bsi_last (cond_bb);
- bsi_insert_before (&bsi, new_stmt, BSI_NEW_STMT);
+ new_stmt = gimple_build_assign_with_ops (minmax, result, arg0, arg1);
+ gsi = gsi_last_bb (cond_bb);
+ gsi_insert_before (&gsi, new_stmt, GSI_NEW_STMT);
replace_phi_edge_with_variable (cond_bb, e1, phi, result);
return true;
@@ -956,13 +866,13 @@ minmax_replacement (basic_block cond_bb, basic_block middle_bb,
static bool
abs_replacement (basic_block cond_bb, basic_block middle_bb,
edge e0 ATTRIBUTE_UNUSED, edge e1,
- tree phi, tree arg0, tree arg1)
+ gimple phi, tree arg0, tree arg1)
{
tree result;
- tree new_stmt, cond;
- block_stmt_iterator bsi;
+ gimple new_stmt, cond;
+ gimple_stmt_iterator gsi;
edge true_edge, false_edge;
- tree assign;
+ gimple assign;
edge e;
tree rhs, lhs;
bool negate;
@@ -985,38 +895,37 @@ abs_replacement (basic_block cond_bb, basic_block middle_bb,
/* If we got here, then we have found the only executable statement
in OTHER_BLOCK. If it is anything other than arg = -arg1 or
arg1 = -arg0, then we can not optimize. */
- if (TREE_CODE (assign) != GIMPLE_MODIFY_STMT)
+ if (gimple_code (assign) != GIMPLE_ASSIGN)
return false;
- lhs = GIMPLE_STMT_OPERAND (assign, 0);
- rhs = GIMPLE_STMT_OPERAND (assign, 1);
+ lhs = gimple_assign_lhs (assign);
- if (TREE_CODE (rhs) != NEGATE_EXPR)
+ if (gimple_assign_rhs_code (assign) != NEGATE_EXPR)
return false;
- rhs = TREE_OPERAND (rhs, 0);
+ rhs = gimple_assign_rhs1 (assign);
/* The assignment has to be arg0 = -arg1 or arg1 = -arg0. */
if (!(lhs == arg0 && rhs == arg1)
&& !(lhs == arg1 && rhs == arg0))
return false;
- cond = COND_EXPR_COND (last_stmt (cond_bb));
+ cond = last_stmt (cond_bb);
result = PHI_RESULT (phi);
/* Only relationals comparing arg[01] against zero are interesting. */
- cond_code = TREE_CODE (cond);
+ cond_code = gimple_cond_code (cond);
if (cond_code != GT_EXPR && cond_code != GE_EXPR
&& cond_code != LT_EXPR && cond_code != LE_EXPR)
return false;
/* Make sure the conditional is arg[01] OP y. */
- if (TREE_OPERAND (cond, 0) != rhs)
+ if (gimple_cond_lhs (cond) != rhs)
return false;
- if (FLOAT_TYPE_P (TREE_TYPE (TREE_OPERAND (cond, 1)))
- ? real_zerop (TREE_OPERAND (cond, 1))
- : integer_zerop (TREE_OPERAND (cond, 1)))
+ if (FLOAT_TYPE_P (TREE_TYPE (gimple_cond_rhs (cond)))
+ ? real_zerop (gimple_cond_rhs (cond))
+ : integer_zerop (gimple_cond_rhs (cond)))
;
else
return false;
@@ -1050,24 +959,19 @@ abs_replacement (basic_block cond_bb, basic_block middle_bb,
lhs = result;
/* Build the modify expression with abs expression. */
- new_stmt = build_gimple_modify_stmt (lhs,
- build1 (ABS_EXPR, TREE_TYPE (lhs), rhs));
- SSA_NAME_DEF_STMT (lhs) = new_stmt;
+ new_stmt = gimple_build_assign_with_ops (ABS_EXPR, lhs, rhs, NULL);
- bsi = bsi_last (cond_bb);
- bsi_insert_before (&bsi, new_stmt, BSI_NEW_STMT);
+ gsi = gsi_last_bb (cond_bb);
+ gsi_insert_before (&gsi, new_stmt, GSI_NEW_STMT);
if (negate)
{
- /* Get the right BSI. We want to insert after the recently
+ /* Get the right GSI. We want to insert after the recently
added ABS_EXPR statement (which we know is the first statement
in the block. */
- new_stmt = build_gimple_modify_stmt (result,
- build1 (NEGATE_EXPR, TREE_TYPE (lhs),
- lhs));
- SSA_NAME_DEF_STMT (result) = new_stmt;
+ new_stmt = gimple_build_assign_with_ops (NEGATE_EXPR, result, lhs, NULL);
- bsi_insert_after (&bsi, new_stmt, BSI_NEW_STMT);
+ gsi_insert_after (&gsi, new_stmt, GSI_NEW_STMT);
}
replace_phi_edge_with_variable (cond_bb, e1, phi, result);
@@ -1188,21 +1092,22 @@ add_or_mark_expr (basic_block bb, tree exp,
static void
nt_init_block (struct dom_walk_data *data ATTRIBUTE_UNUSED, basic_block bb)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
/* Mark this BB as being on the path to dominator root. */
bb->aux = (void*)1;
/* And walk the statements in order. */
- 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))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_assign (stmt))
{
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- add_or_mark_expr (bb, rhs, nontrap_set, false);
- add_or_mark_expr (bb, lhs, nontrap_set, true);
+ add_or_mark_expr (bb, gimple_assign_lhs (stmt), nontrap_set, true);
+ add_or_mark_expr (bb, gimple_assign_rhs1 (stmt), nontrap_set, false);
+ if (get_gimple_rhs_num_ops (gimple_assign_rhs_code (stmt)) > 1)
+ add_or_mark_expr (bb, gimple_assign_rhs2 (stmt), nontrap_set,
+ false);
}
}
}
@@ -1274,21 +1179,26 @@ static bool
cond_store_replacement (basic_block middle_bb, basic_block join_bb,
edge e0, edge e1, struct pointer_set_t *nontrap)
{
- tree assign = last_and_only_stmt (middle_bb);
- tree lhs, rhs, newexpr, name;
- tree newphi;
- block_stmt_iterator bsi;
+ gimple assign = last_and_only_stmt (middle_bb);
+ tree lhs, rhs, name;
+ gimple newphi, new_stmt;
+ gimple_stmt_iterator gsi;
+ enum tree_code code;
/* Check if middle_bb contains of only one store. */
if (!assign
- || TREE_CODE (assign) != GIMPLE_MODIFY_STMT)
+ || gimple_code (assign) != GIMPLE_ASSIGN)
return false;
- lhs = GIMPLE_STMT_OPERAND (assign, 0);
+ lhs = gimple_assign_lhs (assign);
+ rhs = gimple_assign_rhs1 (assign);
if (!INDIRECT_REF_P (lhs))
return false;
- rhs = GIMPLE_STMT_OPERAND (assign, 1);
- if (TREE_CODE (rhs) != SSA_NAME && !is_gimple_min_invariant (rhs))
+
+ /* RHS is either a single SSA_NAME or a constant. */
+ code = gimple_assign_rhs_code (assign);
+ if (get_gimple_rhs_class (code) != GIMPLE_SINGLE_RHS
+ || (code != SSA_NAME && !is_gimple_min_invariant (rhs)))
return false;
/* Prove that we can move the store down. We could also check
TREE_THIS_NOTRAP here, but in that case we also could move stores,
@@ -1299,8 +1209,8 @@ cond_store_replacement (basic_block middle_bb, basic_block join_bb,
/* Now we've checked the constraints, so do the transformation:
1) Remove the single store. */
mark_symbols_for_renaming (assign);
- bsi = bsi_for_stmt (assign);
- bsi_remove (&bsi, true);
+ gsi = gsi_for_stmt (assign);
+ gsi_remove (&gsi, true);
/* 2) Create a temporary where we can store the old content
of the memory touched by the store, if we need to. */
@@ -1317,11 +1227,11 @@ cond_store_replacement (basic_block middle_bb, basic_block join_bb,
/* 3) Insert a load from the memory of the store to the temporary
on the edge which did not contain the store. */
lhs = unshare_expr (lhs);
- newexpr = build_gimple_modify_stmt (condstoretemp, lhs);
- name = make_ssa_name (condstoretemp, newexpr);
- GIMPLE_STMT_OPERAND (newexpr, 0) = name;
- mark_symbols_for_renaming (newexpr);
- bsi_insert_on_edge (e1, newexpr);
+ new_stmt = gimple_build_assign (condstoretemp, lhs);
+ name = make_ssa_name (condstoretemp, new_stmt);
+ gimple_assign_set_lhs (new_stmt, name);
+ mark_symbols_for_renaming (new_stmt);
+ gsi_insert_on_edge (e1, new_stmt);
/* 4) Create a PHI node at the join block, with one argument
holding the old RHS, and the other holding the temporary
@@ -1331,20 +1241,18 @@ cond_store_replacement (basic_block middle_bb, basic_block join_bb,
add_phi_arg (newphi, name, e1);
lhs = unshare_expr (lhs);
- newexpr = build_gimple_modify_stmt (lhs, PHI_RESULT (newphi));
- mark_symbols_for_renaming (newexpr);
+ new_stmt = gimple_build_assign (lhs, PHI_RESULT (newphi));
+ mark_symbols_for_renaming (new_stmt);
/* 5) Insert that PHI node. */
- bsi = bsi_start (join_bb);
- while (!bsi_end_p (bsi) && TREE_CODE (bsi_stmt (bsi)) == LABEL_EXPR)
- bsi_next (&bsi);
- if (bsi_end_p (bsi))
+ gsi = gsi_after_labels (join_bb);
+ if (gsi_end_p (gsi))
{
- bsi = bsi_last (join_bb);
- bsi_insert_after (&bsi, newexpr, BSI_NEW_STMT);
+ gsi = gsi_last_bb (join_bb);
+ gsi_insert_after (&gsi, new_stmt, GSI_NEW_STMT);
}
else
- bsi_insert_before (&bsi, newexpr, BSI_NEW_STMT);
+ gsi_insert_before (&gsi, new_stmt, GSI_NEW_STMT);
return true;
}
diff --git a/gcc/tree-ssa-phiprop.c b/gcc/tree-ssa-phiprop.c
index f408939b07d..ff3ee4a439f 100644
--- a/gcc/tree-ssa-phiprop.c
+++ b/gcc/tree-ssa-phiprop.c
@@ -95,7 +95,7 @@ along with GCC; see the file COPYING3. If not see
struct phiprop_d
{
tree value;
- tree vop_stmt;
+ gimple vop_stmt;
};
/* Verify if the value recorded for NAME in PHIVN is still valid at
@@ -104,7 +104,7 @@ struct phiprop_d
static bool
phivn_valid_p (struct phiprop_d *phivn, tree name, basic_block bb)
{
- tree vop_stmt = phivn[SSA_NAME_VERSION (name)].vop_stmt;
+ gimple vop_stmt = phivn[SSA_NAME_VERSION (name)].vop_stmt;
ssa_op_iter ui;
tree vuse;
@@ -112,17 +112,17 @@ phivn_valid_p (struct phiprop_d *phivn, tree name, basic_block bb)
by bb. */
FOR_EACH_SSA_TREE_OPERAND (vuse, vop_stmt, ui, SSA_OP_VUSE)
{
- tree use_stmt;
+ gimple use_stmt;
imm_use_iterator ui2;
bool ok = true;
FOR_EACH_IMM_USE_STMT (use_stmt, ui2, vuse)
{
/* If BB does not dominate a VDEF, the value is invalid. */
- if (((TREE_CODE (use_stmt) == GIMPLE_MODIFY_STMT
+ if (((is_gimple_assign (use_stmt)
&& !ZERO_SSA_OPERANDS (use_stmt, SSA_OP_VDEF))
- || TREE_CODE (use_stmt) == PHI_NODE)
- && !dominated_by_p (CDI_DOMINATORS, bb_for_stmt (use_stmt), bb))
+ || gimple_code (use_stmt) == GIMPLE_PHI)
+ && !dominated_by_p (CDI_DOMINATORS, gimple_bb (use_stmt), bb))
{
ok = false;
BREAK_FROM_IMM_USE_STMT (ui2);
@@ -139,31 +139,36 @@ phivn_valid_p (struct phiprop_d *phivn, tree name, basic_block bb)
BB with the virtual operands from USE_STMT. */
static tree
-phiprop_insert_phi (basic_block bb, tree phi, tree use_stmt,
+phiprop_insert_phi (basic_block bb, gimple phi, gimple use_stmt,
struct phiprop_d *phivn, size_t n)
{
- tree res, new_phi;
+ tree res;
+ gimple new_phi;
edge_iterator ei;
edge e;
+ gcc_assert (is_gimple_assign (use_stmt)
+ && gimple_assign_rhs_code (use_stmt) == INDIRECT_REF);
+
/* Build a new PHI node to replace the definition of
the indirect reference lhs. */
- res = GIMPLE_STMT_OPERAND (use_stmt, 0);
+ res = gimple_assign_lhs (use_stmt);
SSA_NAME_DEF_STMT (res) = new_phi = create_phi_node (res, bb);
/* Add PHI arguments for each edge inserting loads of the
addressable operands. */
FOR_EACH_EDGE (e, ei, bb->preds)
{
- tree old_arg, new_var, tmp;
+ tree old_arg, new_var;
+ gimple tmp;
old_arg = PHI_ARG_DEF_FROM_EDGE (phi, e);
while (TREE_CODE (old_arg) == SSA_NAME
&& (SSA_NAME_VERSION (old_arg) >= n
|| phivn[SSA_NAME_VERSION (old_arg)].value == NULL_TREE))
{
- tree def_stmt = SSA_NAME_DEF_STMT (old_arg);
- old_arg = GIMPLE_STMT_OPERAND (def_stmt, 1);
+ gimple def_stmt = SSA_NAME_DEF_STMT (old_arg);
+ old_arg = gimple_assign_rhs1 (def_stmt);
}
if (TREE_CODE (old_arg) == SSA_NAME)
@@ -171,18 +176,19 @@ phiprop_insert_phi (basic_block bb, tree phi, tree use_stmt,
new_var = phivn[SSA_NAME_VERSION (old_arg)].value;
else
{
+ gcc_assert (TREE_CODE (old_arg) == ADDR_EXPR);
old_arg = TREE_OPERAND (old_arg, 0);
new_var = create_tmp_var (TREE_TYPE (old_arg), NULL);
- tmp = build2 (GIMPLE_MODIFY_STMT, void_type_node,
- NULL_TREE, unshare_expr (old_arg));
+ tmp = gimple_build_assign (new_var, unshare_expr (old_arg));
if (TREE_CODE (TREE_TYPE (old_arg)) == COMPLEX_TYPE
|| TREE_CODE (TREE_TYPE (old_arg)) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (new_var) = 1;
+ gcc_assert (is_gimple_reg (new_var));
add_referenced_var (new_var);
new_var = make_ssa_name (new_var, tmp);
- GIMPLE_STMT_OPERAND (tmp, 0) = new_var;
+ gimple_assign_set_lhs (tmp, new_var);
- bsi_insert_on_edge (e, tmp);
+ gsi_insert_on_edge (e, tmp);
update_stmt (tmp);
mark_symbols_for_renaming (tmp);
@@ -211,11 +217,13 @@ phiprop_insert_phi (basic_block bb, tree phi, tree use_stmt,
with aliasing issues as we are moving memory reads. */
static bool
-propagate_with_phi (basic_block bb, tree phi, struct phiprop_d *phivn, size_t n)
+propagate_with_phi (basic_block bb, gimple phi, struct phiprop_d *phivn,
+ size_t n)
{
tree ptr = PHI_RESULT (phi);
- tree use_stmt, res = NULL_TREE;
- block_stmt_iterator bsi;
+ gimple use_stmt;
+ tree res = NULL_TREE;
+ gimple_stmt_iterator gsi;
imm_use_iterator ui;
use_operand_p arg_p, use;
ssa_op_iter i;
@@ -238,10 +246,10 @@ propagate_with_phi (basic_block bb, tree phi, struct phiprop_d *phivn, size_t n)
&& (SSA_NAME_VERSION (arg) >= n
|| phivn[SSA_NAME_VERSION (arg)].value == NULL_TREE))
{
- tree def_stmt = SSA_NAME_DEF_STMT (arg);
- if (TREE_CODE (def_stmt) != GIMPLE_MODIFY_STMT)
+ gimple def_stmt = SSA_NAME_DEF_STMT (arg);
+ if (gimple_code (def_stmt) != GIMPLE_ASSIGN)
return false;
- arg = GIMPLE_STMT_OPERAND (def_stmt, 1);
+ arg = gimple_assign_rhs1 (def_stmt);
}
if ((TREE_CODE (arg) != ADDR_EXPR
/* Avoid to have to decay *&a to a[0] later. */
@@ -255,10 +263,8 @@ propagate_with_phi (basic_block bb, tree phi, struct phiprop_d *phivn, size_t n)
/* Find a dereferencing use. First follow (single use) ssa
copy chains for ptr. */
while (single_imm_use (ptr, &use, &use_stmt)
- && TREE_CODE (use_stmt) == GIMPLE_MODIFY_STMT
- && GIMPLE_STMT_OPERAND (use_stmt, 1) == ptr
- && TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 0)) == SSA_NAME)
- ptr = GIMPLE_STMT_OPERAND (use_stmt, 0);
+ && gimple_assign_ssa_name_copy_p (use_stmt))
+ ptr = gimple_assign_lhs (use_stmt);
/* Replace the first dereference of *ptr if there is one and if we
can move the loads to the place of the ptr phi node. */
@@ -269,23 +275,23 @@ propagate_with_phi (basic_block bb, tree phi, struct phiprop_d *phivn, size_t n)
tree vuse;
/* Check whether this is a load of *ptr. */
- if (!(TREE_CODE (use_stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 0)) == SSA_NAME
- && TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 1)) == INDIRECT_REF
- && TREE_OPERAND (GIMPLE_STMT_OPERAND (use_stmt, 1), 0) == ptr
+ if (!(is_gimple_assign (use_stmt)
+ && TREE_CODE (gimple_assign_lhs (use_stmt)) == SSA_NAME
+ && gimple_assign_rhs_code (use_stmt) == INDIRECT_REF
+ && TREE_OPERAND (gimple_assign_rhs1 (use_stmt), 0) == ptr
/* We cannot replace a load that may throw or is volatile. */
- && !tree_can_throw_internal (use_stmt)))
+ && !stmt_can_throw_internal (use_stmt)))
continue;
/* Check if we can move the loads. The def stmts of all virtual uses
need to be post-dominated by bb. */
FOR_EACH_SSA_TREE_OPERAND (vuse, use_stmt, ui2, SSA_OP_VUSE)
{
- tree def_stmt = SSA_NAME_DEF_STMT (vuse);
+ gimple def_stmt = SSA_NAME_DEF_STMT (vuse);
if (!SSA_NAME_IS_DEFAULT_DEF (vuse)
- && (bb_for_stmt (def_stmt) == bb
+ && (gimple_bb (def_stmt) == bb
|| !dominated_by_p (CDI_DOMINATORS,
- bb, bb_for_stmt (def_stmt))))
+ bb, gimple_bb (def_stmt))))
goto next;
}
@@ -302,8 +308,8 @@ propagate_with_phi (basic_block bb, tree phi, struct phiprop_d *phivn, size_t n)
/* Remove old stmt. The phi is taken care of by DCE, if we
want to delete it here we also have to delete all intermediate
copies. */
- bsi = bsi_for_stmt (use_stmt);
- bsi_remove (&bsi, 0);
+ gsi = gsi_for_stmt (use_stmt);
+ gsi_remove (&gsi, false);
phi_inserted = true;
}
@@ -311,7 +317,7 @@ propagate_with_phi (basic_block bb, tree phi, struct phiprop_d *phivn, size_t n)
{
/* Further replacements are easy, just make a copy out of the
load. */
- GIMPLE_STMT_OPERAND (use_stmt, 1) = res;
+ gimple_assign_set_rhs1 (use_stmt, res);
update_stmt (use_stmt);
}
@@ -330,10 +336,10 @@ tree_ssa_phiprop_1 (basic_block bb, struct phiprop_d *phivn, size_t n)
{
bool did_something = false;
basic_block son;
- tree phi;
+ gimple_stmt_iterator gsi;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- did_something |= propagate_with_phi (bb, phi, phivn, n);
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ did_something |= propagate_with_phi (bb, gsi_stmt (gsi), phivn, n);
for (son = first_dom_son (CDI_DOMINATORS, bb);
son;
@@ -355,7 +361,7 @@ tree_ssa_phiprop (void)
phivn = XCNEWVEC (struct phiprop_d, num_ssa_names);
if (tree_ssa_phiprop_1 (ENTRY_BLOCK_PTR, phivn, num_ssa_names))
- bsi_commit_edge_inserts ();
+ gsi_commit_edge_inserts ();
free (phivn);
diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c
index ed337a39c46..8324f09aaa2 100644
--- a/gcc/tree-ssa-pre.c
+++ b/gcc/tree-ssa-pre.c
@@ -30,7 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic.h"
#include "tree-inline.h"
#include "tree-flow.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-dump.h"
#include "timevar.h"
#include "fibheap.h"
@@ -60,7 +60,7 @@ along with GCC; see the file COPYING3. If not see
*/
/* For ease of terminology, "expression node" in the below refers to
- every expression node but GIMPLE_MODIFY_STMT, because GIMPLE_MODIFY_STMT's
+ every expression node but GIMPLE_ASSIGN, because GIMPLE_ASSIGNs
represent the actual statement containing the expressions we care about,
and we cache the value number by putting it in the expression. */
@@ -193,13 +193,8 @@ pre_expr_eq (const void *p1, const void *p2)
switch (e1->kind)
{
case CONSTANT:
- {
- tree const0 = PRE_EXPR_CONSTANT (e1);
- tree const1 = PRE_EXPR_CONSTANT (e2);
- return TREE_TYPE (const1) == TREE_TYPE (const0)
- && expressions_equal_p (const0, const1);
- }
- break;
+ return vn_constant_eq_with_type (PRE_EXPR_CONSTANT (e1),
+ PRE_EXPR_CONSTANT (e2));
case NAME:
return PRE_EXPR_NAME (e1) == PRE_EXPR_NAME (e2);
case NARY:
@@ -219,7 +214,7 @@ pre_expr_hash (const void *p1)
switch (e->kind)
{
case CONSTANT:
- return iterative_hash_expr (PRE_EXPR_CONSTANT (e), 0);
+ return vn_hash_constant_with_type (PRE_EXPR_CONSTANT (e));
case NAME:
return iterative_hash_expr (PRE_EXPR_NAME (e), 0);
case NARY:
@@ -321,9 +316,8 @@ get_or_alloc_expr_for_name (tree name)
result_id = lookup_expression_id (result);
if (result_id != 0)
{
- pre_expr newresult = expression_for_id (result_id);
- pool_free (pre_expr_pool, result);
- result = newresult;
+ pool_free (pre_expr_pool, result);
+ result = expression_for_id (result_id);
return result;
}
get_or_alloc_expression_id (result);
@@ -428,7 +422,7 @@ static struct
} pre_stats;
static bool do_partial_partial;
-static pre_expr bitmap_find_leader (bitmap_set_t, unsigned int , tree);
+static pre_expr bitmap_find_leader (bitmap_set_t, unsigned int, gimple);
static void bitmap_value_insert_into_set (bitmap_set_t, pre_expr);
static void bitmap_value_replace_in_set (bitmap_set_t, pre_expr);
static void bitmap_set_copy (bitmap_set_t, bitmap_set_t);
@@ -436,9 +430,10 @@ static bool bitmap_set_contains_value (bitmap_set_t, unsigned int);
static void bitmap_insert_into_set (bitmap_set_t, pre_expr);
static void bitmap_insert_into_set_1 (bitmap_set_t, pre_expr, bool);
static bitmap_set_t bitmap_set_new (void);
-static tree create_expression_by_pieces (basic_block, pre_expr, tree, tree,
- tree);
-static tree find_or_generate_expression (basic_block, pre_expr, tree, tree);
+static tree create_expression_by_pieces (basic_block, pre_expr, gimple_seq *,
+ gimple, tree);
+static tree find_or_generate_expression (basic_block, pre_expr, gimple_seq *,
+ gimple);
/* We can add and remove elements and entries to and from sets
and hash tables, so we use alloc pools for them. */
@@ -1009,9 +1004,8 @@ get_or_alloc_expr_for_constant (tree constant)
result_id = lookup_expression_id (newexpr);
if (result_id != 0)
{
- pre_expr newresult = expression_for_id (result_id);
- pool_free (pre_expr_pool, newexpr);
- newexpr = newresult;
+ pool_free (pre_expr_pool, newexpr);
+ newexpr = expression_for_id (result_id);
return newexpr;
}
value_id = get_or_alloc_constant_value_id (constant);
@@ -1025,7 +1019,7 @@ get_or_alloc_expr_for_constant (tree constant)
a constant. */
static tree
-get_constant_for_value_id (unsigned int v, tree type)
+get_constant_for_value_id (unsigned int v)
{
if (value_id_constant_p (v))
{
@@ -1036,8 +1030,7 @@ get_constant_for_value_id (unsigned int v, tree type)
FOR_EACH_EXPR_ID_IN_SET (exprset, i, bi)
{
pre_expr expr = expression_for_id (i);
- if (expr->kind == CONSTANT
- && TREE_TYPE (PRE_EXPR_CONSTANT (expr)) == type)
+ if (expr->kind == CONSTANT)
return PRE_EXPR_CONSTANT (expr);
}
}
@@ -1053,6 +1046,30 @@ get_or_alloc_expr_for (tree t)
return get_or_alloc_expr_for_name (t);
else if (is_gimple_min_invariant (t))
return get_or_alloc_expr_for_constant (t);
+ else
+ {
+ /* More complex expressions can result from SCCVN expression
+ simplification that inserts values for them. As they all
+ do not have VOPs the get handled by the nary ops struct. */
+ vn_nary_op_t result;
+ unsigned int result_id;
+ vn_nary_op_lookup (t, &result);
+ if (result != NULL)
+ {
+ pre_expr e = (pre_expr) pool_alloc (pre_expr_pool);
+ e->kind = NARY;
+ PRE_EXPR_NARY (e) = result;
+ result_id = lookup_expression_id (e);
+ if (result_id != 0)
+ {
+ pool_free (pre_expr_pool, e);
+ e = expression_for_id (result_id);
+ return e;
+ }
+ alloc_expression_id (e);
+ return e;
+ }
+ }
return NULL;
}
@@ -1077,15 +1094,24 @@ fully_constant_expression (pre_expr e)
constants. */
tree naryop0 = nary->op[0];
tree naryop1 = nary->op[1];
- pre_expr rep0 = get_or_alloc_expr_for (naryop0);
- pre_expr rep1 = get_or_alloc_expr_for (naryop1);
- unsigned int vrep0 = get_expr_value_id (rep0);
- unsigned int vrep1 = get_expr_value_id (rep1);
- tree const0 = get_constant_for_value_id (vrep0,
- TREE_TYPE (nary->op[0]));
- tree const1 = get_constant_for_value_id (vrep1,
- TREE_TYPE (nary->op[1]));
- tree result = NULL;
+ tree const0, const1, result;
+ if (is_gimple_min_invariant (naryop0))
+ const0 = naryop0;
+ else
+ {
+ pre_expr rep0 = get_or_alloc_expr_for (naryop0);
+ unsigned int vrep0 = get_expr_value_id (rep0);
+ const0 = get_constant_for_value_id (vrep0);
+ }
+ if (is_gimple_min_invariant (naryop1))
+ const1 = naryop1;
+ else
+ {
+ pre_expr rep1 = get_or_alloc_expr_for (naryop1);
+ unsigned int vrep1 = get_expr_value_id (rep1);
+ const1 = get_constant_for_value_id (vrep1);
+ }
+ result = NULL;
if (const0 && const1)
{
tree type1 = TREE_TYPE (nary->op[0]);
@@ -1104,11 +1130,16 @@ fully_constant_expression (pre_expr e)
/* We have to go from trees to pre exprs to value ids to
constants. */
tree naryop0 = nary->op[0];
- pre_expr rep0 = get_or_alloc_expr_for (naryop0);
- unsigned int vrep0 = get_expr_value_id (rep0);
- tree const0 = get_constant_for_value_id (vrep0,
- TREE_TYPE (nary->op[0]));
- tree result = NULL;
+ tree const0, result;
+ if (is_gimple_min_invariant (naryop0))
+ const0 = naryop0;
+ else
+ {
+ pre_expr rep0 = get_or_alloc_expr_for (naryop0);
+ unsigned int vrep0 = get_expr_value_id (rep0);
+ const0 = get_constant_for_value_id (vrep0);
+ }
+ result = NULL;
if (const0)
{
tree type1 = TREE_TYPE (nary->op[0]);
@@ -1145,11 +1176,11 @@ translate_vuses_through_block (VEC (tree, gc) *vuses,
for (i = 0; VEC_iterate (tree, vuses, i, oldvuse); i++)
{
- tree phi = SSA_NAME_DEF_STMT (oldvuse);
- if (TREE_CODE (phi) == PHI_NODE
- && bb_for_stmt (phi) == phiblock)
+ gimple phi = SSA_NAME_DEF_STMT (oldvuse);
+ if (gimple_code (phi) == GIMPLE_PHI
+ && gimple_bb (phi) == phiblock)
{
- edge e = find_edge (block, bb_for_stmt (phi));
+ edge e = find_edge (block, gimple_bb (phi));
if (e)
{
tree def = PHI_ARG_DEF (phi, e->dest_idx);
@@ -1183,9 +1214,9 @@ find_leader_in_sets (unsigned int val, bitmap_set_t set1, bitmap_set_t set2)
{
pre_expr result;
- result = bitmap_find_leader (set1, val, NULL_TREE);
+ result = bitmap_find_leader (set1, val, NULL);
if (!result && set2)
- result = bitmap_find_leader (set2, val, NULL_TREE);
+ result = bitmap_find_leader (set2, val, NULL);
return result;
}
@@ -1244,6 +1275,7 @@ get_representative_for (const pre_expr e)
case NAME:
return PRE_EXPR_NAME (e);
case CONSTANT:
+ return PRE_EXPR_CONSTANT (e);
case NARY:
case REFERENCE:
{
@@ -1284,7 +1316,7 @@ get_representative_for (const pre_expr e)
get_var_ann (pretemp);
}
- name = make_ssa_name (pretemp, build_empty_stmt ());
+ name = make_ssa_name (pretemp, gimple_build_nop ());
VN_INFO_GET (name)->value_id = value_id;
if (e->kind == CONSTANT)
VN_INFO (name)->valnum = PRE_EXPR_CONSTANT (e);
@@ -1534,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)
@@ -1572,19 +1604,19 @@ phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2,
break;
case NAME:
{
- tree phi = NULL;
+ gimple phi = NULL;
edge e;
- tree def_stmt;
+ gimple def_stmt;
tree name = PRE_EXPR_NAME (expr);
def_stmt = SSA_NAME_DEF_STMT (name);
- if (TREE_CODE (def_stmt) == PHI_NODE
- && bb_for_stmt (def_stmt) == phiblock)
+ if (gimple_code (def_stmt) == GIMPLE_PHI
+ && gimple_bb (def_stmt) == phiblock)
phi = def_stmt;
else
return expr;
- e = find_edge (pred, bb_for_stmt (phi));
+ e = find_edge (pred, gimple_bb (phi));
if (e)
{
tree def = PHI_ARG_DEF (phi, e->dest_idx);
@@ -1663,7 +1695,7 @@ phi_translate_set (bitmap_set_t dest, bitmap_set_t set, basic_block pred,
Return NULL if no leader is found. */
static pre_expr
-bitmap_find_leader (bitmap_set_t set, unsigned int val, tree stmt)
+bitmap_find_leader (bitmap_set_t set, unsigned int val, gimple stmt)
{
if (value_id_constant_p (val))
{
@@ -1703,10 +1735,10 @@ bitmap_find_leader (bitmap_set_t set, unsigned int val, tree stmt)
be an SSA_NAME first in the list of expressions. */
if (stmt)
{
- tree def_stmt = SSA_NAME_DEF_STMT (PRE_EXPR_NAME (val));
- if (TREE_CODE (def_stmt) != PHI_NODE
- && bb_for_stmt (def_stmt) == bb_for_stmt (stmt)
- && stmt_ann (def_stmt)->uid >= stmt_ann (stmt)->uid)
+ gimple def_stmt = SSA_NAME_DEF_STMT (PRE_EXPR_NAME (val));
+ if (gimple_code (def_stmt) != GIMPLE_PHI
+ && gimple_bb (def_stmt) == gimple_bb (stmt)
+ && gimple_uid (def_stmt) >= gimple_uid (stmt))
continue;
}
return val;
@@ -1734,11 +1766,11 @@ value_dies_in_block_x (pre_expr expr, basic_block block)
rather than stores. */
for (i = 0; VEC_iterate (tree, vuses, i, vuse); i++)
{
- tree def = SSA_NAME_DEF_STMT (vuse);
+ gimple def = SSA_NAME_DEF_STMT (vuse);
- if (bb_for_stmt (def) != block)
+ if (gimple_bb (def) != block)
continue;
- if (TREE_CODE (def) == PHI_NODE)
+ if (gimple_code (def) == GIMPLE_PHI)
continue;
return true;
}
@@ -2343,11 +2375,9 @@ compute_antic (void)
if we have a pure or constant call. */
static bool
-can_value_number_call (tree stmt)
+can_value_number_call (gimple stmt)
{
- tree call = get_call_expr_in (stmt);
-
- if (call_expr_flags (call) & (ECF_PURE | ECF_CONST))
+ if (gimple_call_flags (stmt) & (ECF_PURE | ECF_CONST))
return true;
return false;
}
@@ -2356,9 +2386,11 @@ can_value_number_call (tree stmt)
FILTER_EXPR or EXC_PTR_EXPR. */
static bool
-is_exception_related (tree op)
+is_exception_related (gimple stmt)
{
- return TREE_CODE (op) == FILTER_EXPR || TREE_CODE (op) == EXC_PTR_EXPR;
+ return (is_gimple_assign (stmt)
+ && (gimple_assign_rhs_code (stmt) == FILTER_EXPR
+ || gimple_assign_rhs_code (stmt) == EXC_PTR_EXPR));
}
/* Return true if OP is a tree which we can perform PRE on
@@ -2382,67 +2414,71 @@ can_PRE_operation (tree op)
/* Inserted expressions are placed onto this worklist, which is used
for performing quick dead code elimination of insertions we made
that didn't turn out to be necessary. */
-static VEC(tree,heap) *inserted_exprs;
+static VEC(gimple,heap) *inserted_exprs;
/* Pool allocated fake store expressions are placed onto this
worklist, which, after performing dead code elimination, is walked
to see which expressions need to be put into GC'able memory */
-static VEC(tree, heap) *need_creation;
+static VEC(gimple, heap) *need_creation;
-/* For COMPONENT_REF's and ARRAY_REF's, we can't have any intermediates for the
- COMPONENT_REF or INDIRECT_REF or ARRAY_REF portion, because we'd end up with
- trying to rename aggregates into ssa form directly, which is a no
- no.
+/* The actual worker for create_component_ref_by_pieces. */
- Thus, this routine doesn't create temporaries, it just builds a
- single access expression for the array, calling
- find_or_generate_expression to build the innermost pieces.
-
- This function is a subroutine of create_expression_by_pieces, and
- should not be called on it's own unless you really know what you
- are doing.
-*/
static tree
-create_component_ref_by_pieces (basic_block block, vn_reference_t ref,
- unsigned int operand,
- tree stmts,
- tree domstmt,
- bool in_call)
+create_component_ref_by_pieces_1 (basic_block block, vn_reference_t ref,
+ unsigned int *operand, gimple_seq *stmts,
+ gimple domstmt)
{
vn_reference_op_t currop = VEC_index (vn_reference_op_s, ref->operands,
- operand);
+ *operand);
tree genop;
+ ++*operand;
switch (currop->opcode)
{
case CALL_EXPR:
{
- tree folded;
- unsigned int i;
- vn_reference_op_t declop = VEC_index (vn_reference_op_s,
- ref->operands, 1);
- unsigned int nargs = VEC_length (vn_reference_op_s, ref->operands) - 2;
- tree *args = XNEWVEC (tree, nargs);
-
- for (i = 0; i < nargs; i++)
+ tree folded, sc = currop->op1;
+ unsigned int nargs = 0;
+ tree *args = XNEWVEC (tree, VEC_length (vn_reference_op_s,
+ ref->operands) - 1);
+ while (*operand < VEC_length (vn_reference_op_s, ref->operands))
{
- args[i] = create_component_ref_by_pieces (block, ref,
- operand + 2 + i, stmts,
- domstmt, true);
+ args[nargs] = create_component_ref_by_pieces_1 (block, ref,
+ operand, stmts,
+ domstmt);
+ nargs++;
}
- folded = build_call_array (currop->type, declop->op0, nargs, args);
+ folded = build_call_array (currop->type,
+ TREE_CODE (currop->op0) == FUNCTION_DECL
+ ? build_fold_addr_expr (currop->op0)
+ : 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;
+ case ADDR_EXPR:
+ if (currop->op0)
+ {
+ gcc_assert (is_gimple_min_invariant (currop->op0));
+ return currop->op0;
+ }
+ /* Fallthrough. */
case REALPART_EXPR:
case IMAGPART_EXPR:
case VIEW_CONVERT_EXPR:
{
tree folded;
- tree genop0 = create_component_ref_by_pieces (block, ref,
- operand + 1,
- stmts, domstmt,
- in_call);
+ tree genop0 = create_component_ref_by_pieces_1 (block, ref,
+ operand,
+ stmts, domstmt);
if (!genop0)
return NULL_TREE;
folded = fold_build1 (currop->opcode, currop->type,
@@ -2454,45 +2490,29 @@ create_component_ref_by_pieces (basic_block block, vn_reference_t ref,
case MISALIGNED_INDIRECT_REF:
case INDIRECT_REF:
{
- /* Inside a CALL_EXPR op0 is the actual indirect_ref. */
- if (in_call)
- {
- tree folded;
- tree op0 = TREE_OPERAND (currop->op0, 0);
- pre_expr op0expr = get_or_alloc_expr_for (op0);
- tree genop0 = find_or_generate_expression (block, op0expr, stmts,
- domstmt);
- if (!genop0)
- return NULL_TREE;
- folded = fold_build1 (currop->opcode, currop->type,
- genop0);
- return folded;
- }
- else
- {
-
- tree folded;
- tree genop1 = create_component_ref_by_pieces (block, ref,
- operand + 1,
- stmts, domstmt,
- in_call);
- if (!genop1)
- return NULL_TREE;
- genop1 = fold_convert (build_pointer_type (currop->type),
- genop1);
+ tree folded;
+ tree genop1 = create_component_ref_by_pieces_1 (block, ref,
+ operand,
+ stmts, domstmt);
+ if (!genop1)
+ return NULL_TREE;
+ genop1 = fold_convert (build_pointer_type (currop->type),
+ genop1);
- folded = fold_build1 (currop->opcode, currop->type,
- genop1);
- return folded;
- }
+ 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;
case BIT_FIELD_REF:
{
tree folded;
- tree genop0 = create_component_ref_by_pieces (block, ref, operand + 1,
- stmts, domstmt,
- in_call);
+ tree genop0 = create_component_ref_by_pieces_1 (block, ref, operand,
+ stmts, domstmt);
pre_expr op1expr = get_or_alloc_expr_for (currop->op0);
pre_expr op2expr = get_or_alloc_expr_for (currop->op1);
tree genop1;
@@ -2517,17 +2537,14 @@ create_component_ref_by_pieces (basic_block block, vn_reference_t ref,
case ARRAY_RANGE_REF:
case ARRAY_REF:
{
- vn_reference_op_t op0expr;
tree genop0;
tree genop1 = currop->op0;
pre_expr op1expr;
tree genop2 = currop->op1;
pre_expr op2expr;
tree genop3;
- op0expr = VEC_index (vn_reference_op_s, ref->operands, operand + 1);
- genop0 = create_component_ref_by_pieces (block, ref, operand + 1,
- stmts, domstmt,
- in_call);
+ genop0 = create_component_ref_by_pieces_1 (block, ref, operand,
+ stmts, domstmt);
if (!genop0)
return NULL_TREE;
op1expr = get_or_alloc_expr_for (genop1);
@@ -2553,8 +2570,8 @@ create_component_ref_by_pieces (basic_block block, vn_reference_t ref,
tree op1;
tree genop2 = currop->op1;
pre_expr op2expr;
- op0 = create_component_ref_by_pieces (block, ref, operand + 1,
- stmts, domstmt, in_call);
+ op0 = create_component_ref_by_pieces_1 (block, ref, operand,
+ stmts, domstmt);
if (!op0)
return NULL_TREE;
/* op1 should be a FIELD_DECL, which are represented by
@@ -2590,11 +2607,6 @@ create_component_ref_by_pieces (basic_block block, vn_reference_t ref,
case CONST_DECL:
case RESULT_DECL:
case FUNCTION_DECL:
- /* For ADDR_EXPR in a CALL_EXPR, op0 is actually the entire
- ADDR_EXPR, not just it's operand. */
- case ADDR_EXPR:
- if (currop->opcode == ADDR_EXPR)
- gcc_assert (currop->op0 != NULL);
return currop->op0;
default:
@@ -2602,6 +2614,26 @@ create_component_ref_by_pieces (basic_block block, vn_reference_t ref,
}
}
+/* For COMPONENT_REF's and ARRAY_REF's, we can't have any intermediates for the
+ COMPONENT_REF or INDIRECT_REF or ARRAY_REF portion, because we'd end up with
+ trying to rename aggregates into ssa form directly, which is a no no.
+
+ Thus, this routine doesn't create temporaries, it just builds a
+ single access expression for the array, calling
+ find_or_generate_expression to build the innermost pieces.
+
+ This function is a subroutine of create_expression_by_pieces, and
+ should not be called on it's own unless you really know what you
+ are doing. */
+
+static tree
+create_component_ref_by_pieces (basic_block block, vn_reference_t ref,
+ gimple_seq *stmts, gimple domstmt)
+{
+ unsigned int op = 0;
+ return create_component_ref_by_pieces_1 (block, ref, &op, stmts, domstmt);
+}
+
/* Find a leader for an expression, or generate one using
create_expression_by_pieces if it's ANTIC but
complex.
@@ -2616,17 +2648,12 @@ create_component_ref_by_pieces (basic_block block, vn_reference_t ref,
on failure. */
static tree
-find_or_generate_expression (basic_block block, pre_expr expr, tree stmts,
- tree domstmt)
+find_or_generate_expression (basic_block block, pre_expr expr,
+ gimple_seq *stmts, gimple domstmt)
{
- pre_expr leader;
+ pre_expr leader = bitmap_find_leader (AVAIL_OUT (block),
+ get_expr_value_id (expr), domstmt);
tree genop = NULL;
-
- if (expr->kind == CONSTANT)
- return PRE_EXPR_CONSTANT (expr);
-
- leader = bitmap_find_leader (AVAIL_OUT (block),
- get_expr_value_id (expr), domstmt);
if (leader)
{
if (leader->kind == NAME)
@@ -2666,7 +2693,7 @@ find_or_generate_expression (basic_block block, pre_expr expr, tree stmts,
return genop;
}
-#define NECESSARY(stmt) stmt->base.asm_written_flag
+#define NECESSARY GF_PLF_1
/* Create an expression in pieces, so that we can handle very complex
expressions that may be ANTIC, but not necessary GIMPLE.
@@ -2687,16 +2714,17 @@ find_or_generate_expression (basic_block block, pre_expr expr, tree stmts,
can return NULL_TREE to signal failure. */
static tree
-create_expression_by_pieces (basic_block block, pre_expr expr, tree stmts,
- tree domstmt,
- tree type)
+create_expression_by_pieces (basic_block block, pre_expr expr,
+ gimple_seq *stmts, gimple domstmt, tree type)
{
tree temp, name;
- tree folded, forced_stmts, newexpr;
+ tree folded, newexpr;
+ gimple_seq forced_stmts;
unsigned int value_id;
- tree_stmt_iterator tsi;
+ gimple_stmt_iterator gsi;
tree exprtype = type ? type : get_expr_type (expr);
pre_expr nameexpr;
+ gimple newstmt;
switch (expr->kind)
{
@@ -2711,8 +2739,7 @@ create_expression_by_pieces (basic_block block, pre_expr expr, tree stmts,
case REFERENCE:
{
vn_reference_t ref = PRE_EXPR_REFERENCE (expr);
- folded = create_component_ref_by_pieces (block, ref, 0, stmts,
- domstmt, false);
+ folded = create_component_ref_by_pieces (block, ref, stmts, domstmt);
}
break;
case NARY:
@@ -2730,10 +2757,14 @@ create_expression_by_pieces (basic_block block, pre_expr expr, tree stmts,
stmts, domstmt);
if (!genop1 || !genop2)
return NULL_TREE;
-
genop1 = fold_convert (TREE_TYPE (nary->op[0]),
genop1);
- genop2 = fold_convert (TREE_TYPE (nary->op[1]), genop2);
+ /* Ensure op2 is a sizetype for POINTER_PLUS_EXPR. It
+ may be a constant with the wrong type. */
+ if (nary->opcode == POINTER_PLUS_EXPR)
+ genop2 = fold_convert (sizetype, genop2);
+ else
+ genop2 = fold_convert (TREE_TYPE (nary->op[1]), genop2);
folded = fold_build2 (nary->opcode, nary->type,
genop1, genop2);
@@ -2772,14 +2803,14 @@ create_expression_by_pieces (basic_block block, pre_expr expr, tree stmts,
to the value sets and chain them in the instruction stream. */
if (forced_stmts)
{
- tsi = tsi_start (forced_stmts);
- for (; !tsi_end_p (tsi); tsi_next (&tsi))
+ gsi = gsi_start (forced_stmts);
+ for (; !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree stmt = tsi_stmt (tsi);
- tree forcedname = GIMPLE_STMT_OPERAND (stmt, 0);
+ gimple stmt = gsi_stmt (gsi);
+ tree forcedname = gimple_get_lhs (stmt);
pre_expr nameexpr;
- VEC_safe_push (tree, heap, inserted_exprs, stmt);
+ VEC_safe_push (gimple, heap, inserted_exprs, stmt);
if (TREE_CODE (forcedname) == SSA_NAME)
{
VN_INFO_GET (forcedname)->valnum = forcedname;
@@ -2791,8 +2822,7 @@ create_expression_by_pieces (basic_block block, pre_expr expr, tree stmts,
}
mark_symbols_for_renaming (stmt);
}
- tsi = tsi_last (stmts);
- tsi_link_after (&tsi, forced_stmts, TSI_CONTINUE_LINKING);
+ gimple_seq_add_seq (stmts, forced_stmts);
}
/* Build and insert the assignment of the end result to the temporary
@@ -2810,17 +2840,16 @@ create_expression_by_pieces (basic_block block, pre_expr expr, tree stmts,
|| TREE_CODE (exprtype) == VECTOR_TYPE)
DECL_GIMPLE_REG_P (temp) = 1;
- newexpr = build_gimple_modify_stmt (temp, newexpr);
- name = make_ssa_name (temp, newexpr);
- GIMPLE_STMT_OPERAND (newexpr, 0) = name;
- NECESSARY (newexpr) = 0;
+ newstmt = gimple_build_assign (temp, newexpr);
+ name = make_ssa_name (temp, newstmt);
+ gimple_assign_set_lhs (newstmt, name);
+ gimple_set_plf (newstmt, NECESSARY, false);
- tsi = tsi_last (stmts);
- tsi_link_after (&tsi, newexpr, TSI_CONTINUE_LINKING);
- VEC_safe_push (tree, heap, inserted_exprs, newexpr);
+ gimple_seq_add_stmt (stmts, newstmt);
+ VEC_safe_push (gimple, heap, inserted_exprs, newstmt);
/* All the symbols in NEWEXPR should be put into SSA form. */
- mark_symbols_for_renaming (newexpr);
+ mark_symbols_for_renaming (newstmt);
/* Add a value number to the temporary.
The value may already exist in either NEW_SETS, or AVAIL_OUT, because
@@ -2840,7 +2869,7 @@ create_expression_by_pieces (basic_block block, pre_expr expr, tree stmts,
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Inserted ");
- print_generic_expr (dump_file, newexpr, 0);
+ print_gimple_stmt (dump_file, newstmt, 0, 0);
fprintf (dump_file, " in predecessor %d\n", block->index);
}
@@ -2867,7 +2896,8 @@ 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))
{
@@ -2899,7 +2929,7 @@ insert_into_preds_of_block (basic_block block, unsigned int exprnum,
/* Make the necessary insertions. */
FOR_EACH_EDGE (pred, ei, block->preds)
{
- tree stmts = alloc_stmt_list ();
+ gimple_seq stmts = NULL;
tree builtexpr;
bprime = pred->src;
eprime = avail[bprime->index];
@@ -2908,10 +2938,10 @@ insert_into_preds_of_block (basic_block block, unsigned int exprnum,
{
builtexpr = create_expression_by_pieces (bprime,
eprime,
- stmts, NULL_TREE,
+ &stmts, NULL,
type);
gcc_assert (!(pred->flags & EDGE_ABNORMAL));
- bsi_insert_on_edge (pred, stmts);
+ gsi_insert_seq_on_edge (pred, stmts);
avail[bprime->index] = get_or_alloc_expr_for_name (builtexpr);
insertions = true;
}
@@ -2946,18 +2976,16 @@ insert_into_preds_of_block (basic_block block, unsigned int exprnum,
}
if (stmts)
{
- tree_stmt_iterator tsi;
- tsi = tsi_start (stmts);
- for (; !tsi_end_p (tsi); tsi_next (&tsi))
+ gimple_stmt_iterator gsi;
+ gsi = gsi_start (stmts);
+ for (; !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree stmt = tsi_stmt (tsi);
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- VEC_safe_push (tree, heap, inserted_exprs, stmt);
- NECESSARY (lhs) = 0;
+ gimple stmt = gsi_stmt (gsi);
+ VEC_safe_push (gimple, heap, inserted_exprs, stmt);
+ gimple_set_plf (stmt, NECESSARY, false);
}
- bsi_insert_on_edge (pred, stmts);
+ gsi_insert_seq_on_edge (pred, stmts);
}
- NECESSARY (forcedexpr) = 0;
avail[bprime->index] = get_or_alloc_expr_for_name (forcedexpr);
}
}
@@ -2987,18 +3015,16 @@ insert_into_preds_of_block (basic_block block, unsigned int exprnum,
if (stmts)
{
- tree_stmt_iterator tsi;
- tsi = tsi_start (stmts);
- for (; !tsi_end_p (tsi); tsi_next (&tsi))
+ gimple_stmt_iterator gsi;
+ gsi = gsi_start (stmts);
+ for (; !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree stmt = tsi_stmt (tsi);
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- VEC_safe_push (tree, heap, inserted_exprs, stmt);
- NECESSARY (lhs) = 0;
+ gimple stmt = gsi_stmt (gsi);
+ VEC_safe_push (gimple, heap, inserted_exprs, stmt);
+ gimple_set_plf (stmt, NECESSARY, false);
}
- bsi_insert_on_edge (pred, stmts);
+ gsi_insert_seq_on_edge (pred, stmts);
}
- NECESSARY (forcedexpr) = 0;
avail[bprime->index] = get_or_alloc_expr_for_name (forcedexpr);
}
}
@@ -3025,24 +3051,34 @@ 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;
- temp = create_phi_node (temp, block);
- NECESSARY (temp) = 0;
- VN_INFO_GET (PHI_RESULT (temp))->valnum = PHI_RESULT (temp);
- VN_INFO (PHI_RESULT (temp))->value_id = val;
- VEC_safe_push (tree, heap, inserted_exprs, temp);
+ phi = create_phi_node (temp, block);
FOR_EACH_EDGE (pred, ei, block->preds)
{
pre_expr ae = avail[pred->src->index];
gcc_assert (get_expr_type (ae) == type
|| useless_type_conversion_p (type, get_expr_type (ae)));
if (ae->kind == CONSTANT)
- add_phi_arg (temp, PRE_EXPR_CONSTANT (ae), pred);
+ add_phi_arg (phi, PRE_EXPR_CONSTANT (ae), pred);
else
- add_phi_arg (temp, PRE_EXPR_NAME (avail[pred->src->index]), pred);
+ 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 (PHI_RESULT (temp));
+ newphi = get_or_alloc_expr_for_name (gimple_phi_result (phi));
add_to_value (val, newphi);
/* The value should *not* exist in PHI_GEN, or else we wouldn't be doing
@@ -3068,7 +3104,7 @@ insert_into_preds_of_block (basic_block block, unsigned int exprnum,
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Created phi ");
- print_generic_expr (dump_file, temp, 0);
+ print_gimple_stmt (dump_file, phi, 0, 0);
fprintf (dump_file, " in block %d\n", block->index);
}
pre_stats.phis++;
@@ -3117,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))
@@ -3132,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);
@@ -3162,16 +3193,9 @@ do_regular_insertion (basic_block block, basic_block dom)
}
eprime = fully_constant_expression (eprime);
- if (eprime->kind == CONSTANT)
- {
- edoubleprime = eprime;
- }
- else
- {
- vprime = get_expr_value_id (eprime);
- edoubleprime = bitmap_find_leader (AVAIL_OUT (bprime),
- vprime, NULL_TREE);
- }
+ vprime = get_expr_value_id (eprime);
+ edoubleprime = bitmap_find_leader (AVAIL_OUT (bprime),
+ vprime, NULL);
if (edoubleprime == NULL)
{
avail[bprime->index] = eprime;
@@ -3201,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;
@@ -3209,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);
@@ -3219,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++;
}
}
}
@@ -3274,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),
@@ -3303,17 +3328,9 @@ do_partial_partial_insertion (basic_block block, basic_block dom)
}
eprime = fully_constant_expression (eprime);
- if (eprime->kind == CONSTANT)
- {
- edoubleprime = eprime;
- }
- else
- {
- vprime = get_expr_value_id (eprime);
- edoubleprime = bitmap_find_leader (AVAIL_OUT (bprime),
- vprime, NULL_TREE);
- }
-
+ vprime = get_expr_value_id (eprime);
+ edoubleprime = bitmap_find_leader (AVAIL_OUT (bprime),
+ vprime, NULL);
if (edoubleprime == NULL)
{
by_all = false;
@@ -3427,128 +3444,18 @@ add_to_exp_gen (basic_block block, tree op)
result = get_or_alloc_expr_for_name (op);
bitmap_value_insert_into_set (EXP_GEN (block), result);
if (TREE_CODE (op) != SSA_NAME
- || TREE_CODE (SSA_NAME_DEF_STMT (op)) != PHI_NODE)
+ || gimple_code (SSA_NAME_DEF_STMT (op)) != GIMPLE_PHI)
bitmap_value_insert_into_set (maximal_set, result);
}
}
-/* For each real store operation of the form
- *a = <value> that we see, create a corresponding fake store of the
- form storetmp_<version> = *a.
-
- This enables AVAIL computation to mark the results of stores as
- available. Without this, you'd need to do some computation to
- mark the result of stores as ANTIC and AVAIL at all the right
- points.
- To save memory, we keep the store
- statements pool allocated until we decide whether they are
- necessary or not. */
-
-static void
-insert_fake_stores (void)
-{
- basic_block block;
-
- FOR_ALL_BB (block)
- {
- block_stmt_iterator bsi;
- for (bsi = bsi_start (block); !bsi_end_p (bsi); bsi_next (&bsi))
- {
- tree stmt = bsi_stmt (bsi);
-
- /* We can't generate SSA names for stores that are complex
- or aggregate. We also want to ignore things whose
- virtual uses occur in abnormal phis. */
-
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == INDIRECT_REF
- || handled_component_p (GIMPLE_STMT_OPERAND (stmt, 0)))
- && !AGGREGATE_TYPE_P (TREE_TYPE (GIMPLE_STMT_OPERAND (stmt, 0))))
- {
- ssa_op_iter iter;
- def_operand_p defp;
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- tree new_tree, new_lhs;
- bool notokay = false;
-
- FOR_EACH_SSA_DEF_OPERAND (defp, stmt, iter, SSA_OP_VIRTUAL_DEFS)
- {
- tree defvar = DEF_FROM_PTR (defp);
- if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (defvar))
- {
- notokay = true;
- break;
- }
- }
-
- if (notokay)
- continue;
-
- if (!storetemp || TREE_TYPE (rhs) != TREE_TYPE (storetemp))
- {
- storetemp = create_tmp_var (TREE_TYPE (rhs), "storetmp");
- if (TREE_CODE (TREE_TYPE (storetemp)) == VECTOR_TYPE
- || TREE_CODE (TREE_TYPE (storetemp)) == COMPLEX_TYPE)
- DECL_GIMPLE_REG_P (storetemp) = 1;
- get_var_ann (storetemp);
- }
-
- new_tree = build_gimple_modify_stmt (NULL_TREE, lhs);
- new_lhs = make_ssa_name (storetemp, new_tree);
- GIMPLE_STMT_OPERAND (new_tree, 0) = new_lhs;
- create_ssa_artificial_load_stmt (new_tree, stmt, false);
-
- NECESSARY (new_tree) = 0;
- VEC_safe_push (tree, heap, inserted_exprs, new_tree);
- VEC_safe_push (tree, heap, need_creation, new_tree);
- bsi_insert_after (&bsi, new_tree, BSI_NEW_STMT);
- }
- }
- }
-}
-
-/* Turn the pool allocated fake stores that we created back into real
- GC allocated ones if they turned out to be necessary to PRE some
- expressions. */
-
-static void
-realify_fake_stores (void)
-{
- unsigned int i;
- tree stmt;
-
- for (i = 0; VEC_iterate (tree, need_creation, i, stmt); i++)
- {
- if (NECESSARY (stmt))
- {
- block_stmt_iterator bsi, bsi2;
- tree rhs;
-
- /* Mark the temp variable as referenced */
- add_referenced_var (SSA_NAME_VAR (GIMPLE_STMT_OPERAND (stmt, 0)));
-
- /* Put the statement before the store in the IR stream
- as a plain ssa name copy. */
- bsi = bsi_for_stmt (stmt);
- bsi_prev (&bsi);
- rhs = GIMPLE_STMT_OPERAND (bsi_stmt (bsi), 1);
- GIMPLE_STMT_OPERAND (stmt, 1) = rhs;
- bsi2 = bsi_for_stmt (stmt);
- bsi_remove (&bsi2, true);
- bsi_insert_before (&bsi, stmt, BSI_SAME_STMT);
- }
- else
- release_defs (stmt);
- }
-}
-
/* Create value ids for PHI in BLOCK. */
static void
-make_values_for_phi (tree phi, basic_block block)
+make_values_for_phi (gimple phi, basic_block block)
{
- tree result = PHI_RESULT (phi);
+ tree result = gimple_phi_result (phi);
+
/* We have no need for virtual phis, as they don't represent
actual computations. */
if (is_gimple_reg (result))
@@ -3632,8 +3539,8 @@ compute_avail (void)
/* Loop until the worklist is empty. */
while (sp)
{
- block_stmt_iterator bsi;
- tree stmt, phi;
+ gimple_stmt_iterator gsi;
+ gimple stmt;
basic_block dom;
unsigned int stmt_uid = 1;
@@ -3647,21 +3554,18 @@ compute_avail (void)
bitmap_set_copy (AVAIL_OUT (block), AVAIL_OUT (dom));
/* Generate values for PHI nodes. */
- for (phi = phi_nodes (block); phi; phi = PHI_CHAIN (phi))
- make_values_for_phi (phi, block);
+ for (gsi = gsi_start_phis (block); !gsi_end_p (gsi); gsi_next (&gsi))
+ make_values_for_phi (gsi_stmt (gsi), block);
/* Now compute value numbers and populate value sets with all
the expressions computed in BLOCK. */
- for (bsi = bsi_start (block); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (gsi = gsi_start_bb (block); !gsi_end_p (gsi); gsi_next (&gsi))
{
- stmt_ann_t ann;
ssa_op_iter iter;
tree op;
- stmt = bsi_stmt (bsi);
- ann = stmt_ann (stmt);
-
- set_gimple_stmt_uid (stmt, stmt_uid++);
+ stmt = gsi_stmt (gsi);
+ gimple_set_uid (stmt, stmt_uid++);
FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_DEF)
{
@@ -3676,106 +3580,151 @@ compute_avail (void)
bitmap_value_insert_into_set (AVAIL_OUT (block), e);
}
- switch (TREE_CODE (stmt))
+ if (gimple_has_volatile_ops (stmt)
+ || stmt_could_throw_p (stmt))
+ continue;
+
+ switch (gimple_code (stmt))
{
- case RETURN_EXPR:
- if (!ann->has_volatile_ops)
- FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_USE)
- add_to_exp_gen (block, op);
+ case GIMPLE_RETURN:
+ FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_USE)
+ add_to_exp_gen (block, op);
continue;
- case GIMPLE_MODIFY_STMT:
+
+ case GIMPLE_CALL:
{
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- if (!ann->has_volatile_ops
- && !tree_could_throw_p (stmt))
- {
- pre_expr result = NULL;
- switch (TREE_CODE_CLASS (TREE_CODE (rhs)))
- {
- case tcc_unary:
- if (is_exception_related (rhs))
- continue;
- case tcc_binary:
- {
- vn_nary_op_t nary;
- unsigned int i;
+ vn_reference_t ref;
+ unsigned int i;
+ vn_reference_op_t vro;
+ pre_expr result = NULL;
+ VEC(vn_reference_op_s, heap) *ops = NULL;
- vn_nary_op_lookup (rhs, &nary);
+ if (!can_value_number_call (stmt))
+ continue;
- if (!nary)
- continue;
+ copy_reference_ops_from_call (stmt, &ops);
+ vn_reference_lookup_pieces (shared_vuses_from_stmt (stmt),
+ ops, &ref, false);
+ VEC_free (vn_reference_op_s, heap, ops);
+ if (!ref)
+ continue;
- for (i = 0; i < nary->length; i++)
- if (TREE_CODE (nary->op[i]) == SSA_NAME)
- add_to_exp_gen (block, nary->op[i]);
+ for (i = 0; VEC_iterate (vn_reference_op_s,
+ ref->operands, i,
+ vro); i++)
+ {
+ if (vro->op0 && TREE_CODE (vro->op0) == SSA_NAME)
+ add_to_exp_gen (block, vro->op0);
+ if (vro->op1 && TREE_CODE (vro->op1) == SSA_NAME)
+ add_to_exp_gen (block, vro->op1);
+ if (vro->op2 && TREE_CODE (vro->op2) == SSA_NAME)
+ add_to_exp_gen (block, vro->op2);
+ }
+ result = (pre_expr) pool_alloc (pre_expr_pool);
+ result->kind = REFERENCE;
+ result->id = 0;
+ PRE_EXPR_REFERENCE (result) = ref;
+
+ get_or_alloc_expression_id (result);
+ add_to_value (get_expr_value_id (result), result);
+ if (!in_fre)
+ {
+ bitmap_value_insert_into_set (EXP_GEN (block),
+ result);
+ bitmap_value_insert_into_set (maximal_set, result);
+ }
+ continue;
+ }
- result = (pre_expr) pool_alloc (pre_expr_pool);
- result->kind = NARY;
- result->id = 0;
- PRE_EXPR_NARY (result) = nary;
- }
- break;
- case tcc_vl_exp:
- if (!can_value_number_call (rhs))
- continue;
+ case GIMPLE_ASSIGN:
+ {
+ pre_expr result = NULL;
+ switch (TREE_CODE_CLASS (gimple_assign_rhs_code (stmt)))
+ {
+ case tcc_unary:
+ if (is_exception_related (stmt))
+ continue;
+ case tcc_binary:
+ {
+ vn_nary_op_t nary;
+ unsigned int i;
+
+ vn_nary_op_lookup_pieces (gimple_num_ops (stmt) - 1,
+ gimple_assign_rhs_code (stmt),
+ gimple_expr_type (stmt),
+ gimple_assign_rhs1 (stmt),
+ gimple_assign_rhs2 (stmt),
+ NULL_TREE, NULL_TREE, &nary);
+
+ if (!nary)
+ continue;
+
+ for (i = 0; i < nary->length; i++)
+ if (TREE_CODE (nary->op[i]) == SSA_NAME)
+ add_to_exp_gen (block, nary->op[i]);
+
+ result = (pre_expr) pool_alloc (pre_expr_pool);
+ result->kind = NARY;
+ result->id = 0;
+ PRE_EXPR_NARY (result) = nary;
+ break;
+ }
- case tcc_declaration:
- case tcc_reference:
- {
- vn_reference_t ref;
- unsigned int i;
- vn_reference_op_t vro;
-
- vn_reference_lookup (rhs,
- shared_vuses_from_stmt (stmt),
- true, &ref);
- if (!ref)
- continue;
-
- for (i = 0; VEC_iterate (vn_reference_op_s,
- ref->operands, i,
- vro); i++)
- {
- if (vro->op0 && TREE_CODE (vro->op0) == SSA_NAME)
- add_to_exp_gen (block, vro->op0);
- if (vro->op1 && TREE_CODE (vro->op1) == SSA_NAME)
- add_to_exp_gen (block, vro->op1);
- }
- result = (pre_expr) pool_alloc (pre_expr_pool);
- result->kind = REFERENCE;
- result->id = 0;
- PRE_EXPR_REFERENCE (result) = ref;
- }
- break;
- default:
+ case tcc_declaration:
+ case tcc_reference:
+ {
+ vn_reference_t ref;
+ unsigned int i;
+ vn_reference_op_t vro;
+
+ vn_reference_lookup (gimple_assign_rhs1 (stmt),
+ shared_vuses_from_stmt (stmt),
+ false, &ref);
+ if (!ref)
+ continue;
+
+ for (i = 0; VEC_iterate (vn_reference_op_s,
+ ref->operands, i,
+ vro); i++)
{
- /* For any other statement that we don't
- recognize, simply add all referenced
- SSA_NAMEs to EXP_GEN. */
- FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_USE)
- add_to_exp_gen (block, op);
- continue;
+ if (vro->op0 && TREE_CODE (vro->op0) == SSA_NAME)
+ add_to_exp_gen (block, vro->op0);
+ if (vro->op1 && TREE_CODE (vro->op1) == SSA_NAME)
+ add_to_exp_gen (block, vro->op1);
+ if (vro->op2 && TREE_CODE (vro->op2) == SSA_NAME)
+ add_to_exp_gen (block, vro->op2);
}
- }
- get_or_alloc_expression_id (result);
- add_to_value (get_expr_value_id (result), result);
- if (!in_fre)
- {
- bitmap_value_insert_into_set (EXP_GEN (block),
- result);
- bitmap_value_insert_into_set (maximal_set, result);
- }
+ result = (pre_expr) pool_alloc (pre_expr_pool);
+ result->kind = REFERENCE;
+ result->id = 0;
+ PRE_EXPR_REFERENCE (result) = ref;
+ break;
+ }
+ default:
+ /* For any other statement that we don't
+ recognize, simply add all referenced
+ SSA_NAMEs to EXP_GEN. */
+ FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_USE)
+ add_to_exp_gen (block, op);
+ continue;
+ }
+
+ get_or_alloc_expression_id (result);
+ add_to_value (get_expr_value_id (result), result);
+ if (!in_fre)
+ {
+ bitmap_value_insert_into_set (EXP_GEN (block), result);
+ bitmap_value_insert_into_set (maximal_set, result);
}
+
continue;
}
default:
break;
-
}
-
-
}
+
/* Put the dominator children of BLOCK on the worklist of blocks
to compute available sets for. */
for (son = first_dom_son (CDI_DOMINATORS, block);
@@ -3793,30 +3742,27 @@ compute_avail (void)
be used for replacement. */
static tree
-do_SCCVN_insertion (tree stmt, tree ssa_vn)
+do_SCCVN_insertion (gimple stmt, tree ssa_vn)
{
- basic_block bb = bb_for_stmt (stmt);
- block_stmt_iterator bsi;
- tree expr, stmts;
+ basic_block bb = gimple_bb (stmt);
+ gimple_stmt_iterator gsi;
+ gimple_seq stmts = NULL;
+ tree expr;
pre_expr e;
/* First create a value expression from the expression we want
to insert and associate it with the value handle for SSA_VN. */
-
- /* TODO: Handle complex expressions. */
- e = get_or_alloc_expr_for (VN_INFO (ssa_vn)->expr);
+ e = get_or_alloc_expr_for (vn_get_expr_for (ssa_vn));
if (e == NULL)
return NULL_TREE;
-/* Then use create_expression_by_pieces to generate a valid
+ /* Then use create_expression_by_pieces to generate a valid
expression to insert at this point of the IL stream. */
- stmts = alloc_stmt_list ();
- expr = create_expression_by_pieces (bb, e, stmts, stmt,
- NULL);
+ expr = create_expression_by_pieces (bb, e, &stmts, stmt, NULL);
if (expr == NULL_TREE)
return NULL_TREE;
- bsi = bsi_for_stmt (stmt);
- bsi_insert_before (&bsi, stmts, BSI_SAME_STMT);
+ gsi = gsi_for_stmt (stmt);
+ gsi_insert_seq_before (&gsi, stmts, GSI_SAME_STMT);
return expr;
}
@@ -3831,30 +3777,35 @@ eliminate (void)
FOR_EACH_BB (b)
{
- block_stmt_iterator i;
+ gimple_stmt_iterator i;
- for (i = bsi_start (b); !bsi_end_p (i); bsi_next (&i))
+ for (i = gsi_start_bb (b); !gsi_end_p (i); gsi_next (&i))
{
- tree stmt = bsi_stmt (i);
+ gimple stmt = gsi_stmt (i);
/* Lookup the RHS of the expression, see if we have an
available computation for it. If so, replace the RHS with
the available computation. */
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == SSA_NAME
- && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) != SSA_NAME
- && !is_gimple_min_invariant (GIMPLE_STMT_OPERAND (stmt, 1))
- && !stmt_ann (stmt)->has_volatile_ops)
+ if (gimple_has_lhs (stmt)
+ && TREE_CODE (gimple_get_lhs (stmt)) == SSA_NAME
+ && !gimple_assign_ssa_name_copy_p (stmt)
+ && (!gimple_assign_single_p (stmt)
+ || !is_gimple_min_invariant (gimple_assign_rhs1 (stmt)))
+ && !gimple_has_volatile_ops (stmt)
+ && !has_zero_uses (gimple_get_lhs (stmt)))
{
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- tree *rhs_p = &GIMPLE_STMT_OPERAND (stmt, 1);
+ tree lhs = gimple_get_lhs (stmt);
+ tree rhs = NULL_TREE;
tree sprime = NULL;
pre_expr lhsexpr = get_or_alloc_expr_for_name (lhs);
pre_expr sprimeexpr;
+ if (gimple_assign_single_p (stmt))
+ rhs = gimple_assign_rhs1 (stmt);
+
sprimeexpr = bitmap_find_leader (AVAIL_OUT (b),
get_expr_value_id (lhsexpr),
- NULL_TREE);
+ NULL);
if (sprimeexpr)
{
@@ -3876,14 +3827,15 @@ eliminate (void)
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Replaced ");
- print_generic_expr (dump_file, *rhs_p, 0);
+ print_gimple_expr (dump_file, stmt, 0, 0);
fprintf (dump_file, " with ");
print_generic_expr (dump_file, sprime, 0);
fprintf (dump_file, " in ");
- print_generic_stmt (dump_file, stmt, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
}
pre_stats.eliminations++;
- propagate_tree_value (rhs_p, sprime);
+ propagate_tree_value_into_stmt (&i, sprime);
+ stmt = gsi_stmt (i);
update_stmt (stmt);
continue;
}
@@ -3897,38 +3849,41 @@ eliminate (void)
if (val != VN_TOP
&& TREE_CODE (val) == SSA_NAME
&& VN_INFO (val)->needs_insertion
- && can_PRE_operation (VN_INFO (val)->expr))
+ && can_PRE_operation (vn_get_expr_for (val)))
sprime = do_SCCVN_insertion (stmt, val);
}
if (sprime
&& sprime != lhs
- && (TREE_CODE (*rhs_p) != SSA_NAME
- || may_propagate_copy (*rhs_p, sprime)))
+ && (rhs == NULL_TREE
+ || TREE_CODE (rhs) != SSA_NAME
+ || may_propagate_copy (rhs, sprime)))
{
- gcc_assert (sprime != *rhs_p);
+ gcc_assert (sprime != rhs);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Replaced ");
- print_generic_expr (dump_file, *rhs_p, 0);
+ print_gimple_expr (dump_file, stmt, 0, 0);
fprintf (dump_file, " with ");
print_generic_expr (dump_file, sprime, 0);
fprintf (dump_file, " in ");
- print_generic_stmt (dump_file, stmt, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
}
if (TREE_CODE (sprime) == SSA_NAME)
- NECESSARY (SSA_NAME_DEF_STMT (sprime)) = 1;
+ gimple_set_plf (SSA_NAME_DEF_STMT (sprime),
+ NECESSARY, true);
/* We need to make sure the new and old types actually match,
which may require adding a simple cast, which fold_convert
will do for us. */
- if (TREE_CODE (*rhs_p) != SSA_NAME
- && !useless_type_conversion_p (TREE_TYPE (*rhs_p),
- TREE_TYPE (sprime)))
- sprime = fold_convert (TREE_TYPE (*rhs_p), sprime);
+ if ((!rhs || TREE_CODE (rhs) != SSA_NAME)
+ && !useless_type_conversion_p (gimple_expr_type (stmt),
+ TREE_TYPE (sprime)))
+ sprime = fold_convert (gimple_expr_type (stmt), sprime);
pre_stats.eliminations++;
- propagate_tree_value (rhs_p, sprime);
+ propagate_tree_value_into_stmt (&i, sprime);
+ stmt = gsi_stmt (i);
update_stmt (stmt);
/* If we removed EH side effects from the statement, clean
@@ -3936,7 +3891,7 @@ eliminate (void)
if (maybe_clean_or_replace_eh_stmt (stmt, stmt))
{
bitmap_set_bit (need_eh_cleanup,
- bb_for_stmt (stmt)->index);
+ gimple_bb (stmt)->index);
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, " Removed EH side effects.\n");
}
@@ -3944,36 +3899,24 @@ eliminate (void)
}
/* Visit COND_EXPRs and fold the comparison with the
available value-numbers. */
- else if (TREE_CODE (stmt) == COND_EXPR
- && COMPARISON_CLASS_P (COND_EXPR_COND (stmt)))
+ else if (gimple_code (stmt) == GIMPLE_COND)
{
- tree cond = COND_EXPR_COND (stmt);
- tree op0 = TREE_OPERAND (cond, 0);
- tree op1 = TREE_OPERAND (cond, 1);
+ tree op0 = gimple_cond_lhs (stmt);
+ tree op1 = gimple_cond_rhs (stmt);
tree result;
if (TREE_CODE (op0) == SSA_NAME)
op0 = VN_INFO (op0)->valnum;
if (TREE_CODE (op1) == SSA_NAME)
op1 = VN_INFO (op1)->valnum;
- result = fold_binary (TREE_CODE (cond), TREE_TYPE (cond),
+ result = fold_binary (gimple_cond_code (stmt), boolean_type_node,
op0, op1);
if (result && TREE_CODE (result) == INTEGER_CST)
{
- COND_EXPR_COND (stmt) = result;
- update_stmt (stmt);
- todo = TODO_cleanup_cfg;
- }
- }
- else if (TREE_CODE (stmt) == COND_EXPR
- && TREE_CODE (COND_EXPR_COND (stmt)) == SSA_NAME)
- {
- tree op = COND_EXPR_COND (stmt);
- op = VN_INFO (op)->valnum;
- if (TREE_CODE (op) == INTEGER_CST)
- {
- COND_EXPR_COND (stmt) = integer_zerop (op)
- ? boolean_false_node : boolean_true_node;
+ if (integer_zerop (result))
+ gimple_cond_make_false (stmt);
+ else
+ gimple_cond_make_true (stmt);
update_stmt (stmt);
todo = TODO_cleanup_cfg;
}
@@ -3992,10 +3935,10 @@ eliminate (void)
mark that statement necessary. Return the stmt, if it is newly
necessary. */
-static inline tree
+static inline gimple
mark_operand_necessary (tree op)
{
- tree stmt;
+ gimple stmt;
gcc_assert (op);
@@ -4005,11 +3948,11 @@ mark_operand_necessary (tree op)
stmt = SSA_NAME_DEF_STMT (op);
gcc_assert (stmt);
- if (NECESSARY (stmt)
- || IS_EMPTY_STMT (stmt))
+ if (gimple_plf (stmt, NECESSARY)
+ || gimple_nop_p (stmt))
return NULL;
- NECESSARY (stmt) = 1;
+ gimple_set_plf (stmt, NECESSARY, true);
return stmt;
}
@@ -4021,36 +3964,36 @@ mark_operand_necessary (tree op)
static void
remove_dead_inserted_code (void)
{
- VEC(tree,heap) *worklist = NULL;
+ VEC(gimple,heap) *worklist = NULL;
int i;
- tree t;
+ gimple t;
- worklist = VEC_alloc (tree, heap, VEC_length (tree, inserted_exprs));
- for (i = 0; VEC_iterate (tree, inserted_exprs, i, t); i++)
+ worklist = VEC_alloc (gimple, heap, VEC_length (gimple, inserted_exprs));
+ for (i = 0; VEC_iterate (gimple, inserted_exprs, i, t); i++)
{
- if (NECESSARY (t))
- VEC_quick_push (tree, worklist, t);
+ if (gimple_plf (t, NECESSARY))
+ VEC_quick_push (gimple, worklist, t);
}
- while (VEC_length (tree, worklist) > 0)
+ while (VEC_length (gimple, worklist) > 0)
{
- t = VEC_pop (tree, worklist);
+ t = VEC_pop (gimple, worklist);
/* PHI nodes are somewhat special in that each PHI alternative has
data and control dependencies. All the statements feeding the
PHI node's arguments are always necessary. */
- if (TREE_CODE (t) == PHI_NODE)
+ if (gimple_code (t) == GIMPLE_PHI)
{
- int k;
+ unsigned k;
- VEC_reserve (tree, heap, worklist, PHI_NUM_ARGS (t));
- for (k = 0; k < PHI_NUM_ARGS (t); k++)
+ VEC_reserve (gimple, heap, worklist, gimple_phi_num_args (t));
+ for (k = 0; k < gimple_phi_num_args (t); k++)
{
tree arg = PHI_ARG_DEF (t, k);
if (TREE_CODE (arg) == SSA_NAME)
{
- arg = mark_operand_necessary (arg);
- if (arg)
- VEC_quick_push (tree, worklist, arg);
+ gimple n = mark_operand_necessary (arg);
+ if (n)
+ VEC_quick_push (gimple, worklist, n);
}
}
}
@@ -4069,38 +4012,34 @@ remove_dead_inserted_code (void)
FOR_EACH_SSA_TREE_OPERAND (use, t, iter, SSA_OP_ALL_USES)
{
- tree n = mark_operand_necessary (use);
+ gimple n = mark_operand_necessary (use);
if (n)
- VEC_safe_push (tree, heap, worklist, n);
+ VEC_safe_push (gimple, heap, worklist, n);
}
}
}
- for (i = 0; VEC_iterate (tree, inserted_exprs, i, t); i++)
+ for (i = 0; VEC_iterate (gimple, inserted_exprs, i, t); i++)
{
- if (!NECESSARY (t))
+ if (!gimple_plf (t, NECESSARY))
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Removing unnecessary insertion:");
- print_generic_stmt (dump_file, t, 0);
+ print_gimple_stmt (dump_file, t, 0, 0);
}
- if (TREE_CODE (t) == PHI_NODE)
- {
- remove_phi_node (t, NULL_TREE, true);
- }
+ gsi = gsi_for_stmt (t);
+ if (gimple_code (t) == GIMPLE_PHI)
+ remove_phi_node (&gsi, true);
else
- {
- bsi = bsi_for_stmt (t);
- bsi_remove (&bsi, true);
- release_defs (t);
- }
+ gsi_remove (&gsi, true);
+ release_defs (t);
}
}
- VEC_free (tree, heap, worklist);
+ VEC_free (gimple, heap, worklist);
}
/* Initialize data structures used by PRE. */
@@ -4165,20 +4104,19 @@ init_pre (bool do_fre)
/* Deallocate data structures used by PRE. */
static void
-fini_pre (void)
+fini_pre (bool do_fre)
{
basic_block bb;
free (postorder);
VEC_free (bitmap_set_t, heap, value_expressions);
- VEC_free (tree, heap, inserted_exprs);
- VEC_free (tree, heap, need_creation);
+ VEC_free (gimple, heap, inserted_exprs);
+ VEC_free (gimple, heap, need_creation);
bitmap_obstack_release (&grand_bitmap_obstack);
free_alloc_pool (bitmap_set_pool);
free_alloc_pool (pre_expr_pool);
htab_delete (phi_translate_table);
htab_delete (expression_to_id);
- remove_fake_exit_edges ();
FOR_ALL_BB (bb)
{
@@ -4190,13 +4128,13 @@ fini_pre (void)
if (!bitmap_empty_p (need_eh_cleanup))
{
- tree_purge_all_dead_eh_edges (need_eh_cleanup);
+ gimple_purge_all_dead_eh_edges (need_eh_cleanup);
cleanup_tree_cfg ();
}
BITMAP_FREE (need_eh_cleanup);
- if (current_loops != NULL)
+ if (!do_fre)
loop_optimizer_finalize ();
}
@@ -4204,7 +4142,7 @@ fini_pre (void)
only wants to do full redundancy elimination. */
static unsigned int
-execute_pre (bool do_fre)
+execute_pre (bool do_fre ATTRIBUTE_UNUSED)
{
unsigned int todo = 0;
@@ -4214,8 +4152,6 @@ execute_pre (bool do_fre)
loop_optimizer_init may create new phis, etc. */
if (!do_fre)
loop_optimizer_init (LOOPS_NORMAL);
- if (0 && !do_fre)
- insert_fake_stores ();
if (!run_scc_vn (do_fre))
{
@@ -4266,18 +4202,19 @@ execute_pre (bool do_fre)
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);
- bsi_commit_edge_inserts ();
+
+ /* 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 ();
free_scc_vn ();
if (!do_fre)
- {
- remove_dead_inserted_code ();
- if (0)
- realify_fake_stores ();
- }
+ remove_dead_inserted_code ();
- fini_pre ();
+ fini_pre (do_fre);
return todo;
}
@@ -4293,7 +4230,8 @@ do_pre (void)
static bool
gate_pre (void)
{
- return flag_tree_pre != 0;
+ /* PRE tends to generate bigger code. */
+ return flag_tree_pre != 0 && optimize_function_for_speed_p (cfun);
}
struct gimple_opt_pass pass_pre =
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index b0371805568..4c246e679fe 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -41,6 +41,7 @@
#include "varray.h"
#include "vec.h"
#include "value-prof.h"
+#include "gimple.h"
/* This file implements a generic value propagation engine based on
the same propagation used by the SSA-CCP algorithm [1].
@@ -96,7 +97,7 @@
5- Simulation terminates when all three work lists are drained.
Before calling ssa_propagate, it is important to clear
- DONT_SIMULATE_AGAIN for all the statements in the program that
+ prop_simulate_again_p for all the statements in the program that
should be simulated. This initialization allows an implementation
to specify which statements should never be simulated.
@@ -118,13 +119,16 @@
static ssa_prop_visit_stmt_fn ssa_prop_visit_stmt;
static ssa_prop_visit_phi_fn ssa_prop_visit_phi;
-/* Use the deprecated flag to mark statements that have been
- added to one of the SSA edges worklists. This flag is used to
- avoid visiting statements unnecessarily when draining an SSA edge
- worklist. If while simulating a basic block, we find a statement with
+/* Keep track of statements that have been added to one of the SSA
+ edges worklists. This flag is used to avoid visiting statements
+ unnecessarily when draining an SSA edge worklist. If while
+ simulating a basic block, we find a statement with
STMT_IN_SSA_EDGE_WORKLIST set, we clear it to prevent SSA edge
- processing from visiting it again. */
-#define STMT_IN_SSA_EDGE_WORKLIST(T) ((T)->base.deprecated_flag)
+ processing from visiting it again.
+
+ NOTE: users of the propagation engine are not allowed to use
+ the GF_PLF_1 flag. */
+#define STMT_IN_SSA_EDGE_WORKLIST GF_PLF_1
/* A bitmap to keep track of executable blocks in the CFG. */
static sbitmap executable_blocks;
@@ -142,7 +146,7 @@ static sbitmap bb_in_list;
definition has changed. SSA edges are def-use edges in the SSA
web. For each D-U edge, we store the target statement or PHI node
U. */
-static GTY(()) VEC(tree,gc) *interesting_ssa_edges;
+static GTY(()) VEC(gimple,gc) *interesting_ssa_edges;
/* Identical to INTERESTING_SSA_EDGES. For performance reasons, the
list of SSA edges is split into two. One contains all SSA edges
@@ -158,7 +162,7 @@ static GTY(()) VEC(tree,gc) *interesting_ssa_edges;
don't use a separate worklist for VARYING edges, we end up with
situations where lattice values move from
UNDEFINED->INTERESTING->VARYING instead of UNDEFINED->VARYING. */
-static GTY(()) VEC(tree,gc) *varying_ssa_edges;
+static GTY(()) VEC(gimple,gc) *varying_ssa_edges;
/* Return true if the block worklist empty. */
@@ -257,16 +261,16 @@ add_ssa_edge (tree var, bool is_varying)
FOR_EACH_IMM_USE_FAST (use_p, iter, var)
{
- tree use_stmt = USE_STMT (use_p);
+ gimple use_stmt = USE_STMT (use_p);
- if (!DONT_SIMULATE_AGAIN (use_stmt)
- && !STMT_IN_SSA_EDGE_WORKLIST (use_stmt))
+ if (prop_simulate_again_p (use_stmt)
+ && !gimple_plf (use_stmt, STMT_IN_SSA_EDGE_WORKLIST))
{
- STMT_IN_SSA_EDGE_WORKLIST (use_stmt) = 1;
+ gimple_set_plf (use_stmt, STMT_IN_SSA_EDGE_WORKLIST, true);
if (is_varying)
- VEC_safe_push (tree, gc, varying_ssa_edges, use_stmt);
+ VEC_safe_push (gimple, gc, varying_ssa_edges, use_stmt);
else
- VEC_safe_push (tree, gc, interesting_ssa_edges, use_stmt);
+ VEC_safe_push (gimple, gc, interesting_ssa_edges, use_stmt);
}
}
}
@@ -302,7 +306,7 @@ add_control_edge (edge e)
/* Simulate the execution of STMT and update the work lists accordingly. */
static void
-simulate_stmt (tree stmt)
+simulate_stmt (gimple stmt)
{
enum ssa_prop_result val = SSA_PROP_NOT_INTERESTING;
edge taken_edge = NULL;
@@ -310,20 +314,20 @@ simulate_stmt (tree stmt)
/* Don't bother visiting statements that are already
considered varying by the propagator. */
- if (DONT_SIMULATE_AGAIN (stmt))
+ if (!prop_simulate_again_p (stmt))
return;
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
{
val = ssa_prop_visit_phi (stmt);
- output_name = PHI_RESULT (stmt);
+ output_name = gimple_phi_result (stmt);
}
else
val = ssa_prop_visit_stmt (stmt, &taken_edge, &output_name);
if (val == SSA_PROP_VARYING)
{
- DONT_SIMULATE_AGAIN (stmt) = 1;
+ prop_set_simulate_again (stmt, false);
/* If the statement produced a new varying value, add the SSA
edges coming out of OUTPUT_NAME. */
@@ -336,7 +340,7 @@ simulate_stmt (tree stmt)
{
edge e;
edge_iterator ei;
- basic_block bb = bb_for_stmt (stmt);
+ basic_block bb = gimple_bb (stmt);
FOR_EACH_EDGE (e, ei, bb->succs)
add_control_edge (e);
}
@@ -362,36 +366,36 @@ simulate_stmt (tree stmt)
SSA edge is added to it in simulate_stmt. */
static void
-process_ssa_edge_worklist (VEC(tree,gc) **worklist)
+process_ssa_edge_worklist (VEC(gimple,gc) **worklist)
{
/* Drain the entire worklist. */
- while (VEC_length (tree, *worklist) > 0)
+ while (VEC_length (gimple, *worklist) > 0)
{
basic_block bb;
/* Pull the statement to simulate off the worklist. */
- tree stmt = VEC_pop (tree, *worklist);
+ gimple stmt = VEC_pop (gimple, *worklist);
/* If this statement was already visited by simulate_block, then
we don't need to visit it again here. */
- if (!STMT_IN_SSA_EDGE_WORKLIST (stmt))
+ if (!gimple_plf (stmt, STMT_IN_SSA_EDGE_WORKLIST))
continue;
/* STMT is no longer in a worklist. */
- STMT_IN_SSA_EDGE_WORKLIST (stmt) = 0;
+ gimple_set_plf (stmt, STMT_IN_SSA_EDGE_WORKLIST, false);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "\nSimulating statement (from ssa_edges): ");
- print_generic_stmt (dump_file, stmt, dump_flags);
+ print_gimple_stmt (dump_file, stmt, 0, dump_flags);
}
- bb = bb_for_stmt (stmt);
+ bb = gimple_bb (stmt);
/* PHI nodes are always visited, regardless of whether or not
the destination block is executable. Otherwise, visit the
statement only if its block is marked executable. */
- if (TREE_CODE (stmt) == PHI_NODE
+ if (gimple_code (stmt) == GIMPLE_PHI
|| TEST_BIT (executable_blocks, bb->index))
simulate_stmt (stmt);
}
@@ -404,7 +408,7 @@ process_ssa_edge_worklist (VEC(tree,gc) **worklist)
static void
simulate_block (basic_block block)
{
- tree phi;
+ gimple_stmt_iterator gsi;
/* There is nothing to do for the exit block. */
if (block == EXIT_BLOCK_PTR)
@@ -415,14 +419,14 @@ simulate_block (basic_block block)
/* Always simulate PHI nodes, even if we have simulated this block
before. */
- for (phi = phi_nodes (block); phi; phi = PHI_CHAIN (phi))
- simulate_stmt (phi);
+ for (gsi = gsi_start_phis (block); !gsi_end_p (gsi); gsi_next (&gsi))
+ simulate_stmt (gsi_stmt (gsi));
/* If this is the first time we've simulated this block, then we
must simulate each of its statements. */
if (!TEST_BIT (executable_blocks, block->index))
{
- block_stmt_iterator j;
+ gimple_stmt_iterator j;
unsigned int normal_edge_count;
edge e, normal_edge;
edge_iterator ei;
@@ -430,17 +434,17 @@ simulate_block (basic_block block)
/* Note that we have simulated this block. */
SET_BIT (executable_blocks, block->index);
- for (j = bsi_start (block); !bsi_end_p (j); bsi_next (&j))
+ for (j = gsi_start_bb (block); !gsi_end_p (j); gsi_next (&j))
{
- tree stmt = bsi_stmt (j);
+ gimple stmt = gsi_stmt (j);
/* If this statement is already in the worklist then
"cancel" it. The reevaluation implied by the worklist
entry will produce the same value we generate here and
thus reevaluating it again from the worklist is
pointless. */
- if (STMT_IN_SSA_EDGE_WORKLIST (stmt))
- STMT_IN_SSA_EDGE_WORKLIST (stmt) = 0;
+ if (gimple_plf (stmt, STMT_IN_SSA_EDGE_WORKLIST))
+ gimple_set_plf (stmt, STMT_IN_SSA_EDGE_WORKLIST, false);
simulate_stmt (stmt);
}
@@ -482,8 +486,8 @@ ssa_prop_init (void)
size_t i;
/* Worklists of SSA edges. */
- interesting_ssa_edges = VEC_alloc (tree, gc, 20);
- varying_ssa_edges = VEC_alloc (tree, gc, 20);
+ interesting_ssa_edges = VEC_alloc (gimple, gc, 20);
+ varying_ssa_edges = VEC_alloc (gimple, gc, 20);
executable_blocks = sbitmap_alloc (last_basic_block);
sbitmap_zero (executable_blocks);
@@ -506,10 +510,13 @@ ssa_prop_init (void)
(including the edges coming out of ENTRY_BLOCK_PTR). */
FOR_ALL_BB (bb)
{
- block_stmt_iterator si;
+ gimple_stmt_iterator si;
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
- STMT_IN_SSA_EDGE_WORKLIST (bsi_stmt (si)) = 0;
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
+ gimple_set_plf (gsi_stmt (si), STMT_IN_SSA_EDGE_WORKLIST, false);
+
+ for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
+ gimple_set_plf (gsi_stmt (si), STMT_IN_SSA_EDGE_WORKLIST, false);
FOR_EACH_EDGE (e, ei, bb->succs)
e->flags &= ~EDGE_EXECUTABLE;
@@ -527,8 +534,8 @@ ssa_prop_init (void)
static void
ssa_prop_fini (void)
{
- VEC_free (tree, gc, interesting_ssa_edges);
- VEC_free (tree, gc, varying_ssa_edges);
+ VEC_free (gimple, gc, interesting_ssa_edges);
+ VEC_free (gimple, gc, varying_ssa_edges);
VEC_free (basic_block, heap, cfg_blocks);
cfg_blocks = NULL;
sbitmap_free (bb_in_list);
@@ -536,47 +543,20 @@ ssa_prop_fini (void)
}
-/* Get the main expression from statement STMT. */
-
-tree
-get_rhs (tree stmt)
-{
- enum tree_code code = TREE_CODE (stmt);
-
- switch (code)
- {
- case RETURN_EXPR:
- stmt = TREE_OPERAND (stmt, 0);
- if (!stmt || TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
- return stmt;
- /* FALLTHRU */
-
- case GIMPLE_MODIFY_STMT:
- stmt = GENERIC_TREE_OPERAND (stmt, 1);
- if (TREE_CODE (stmt) == WITH_SIZE_EXPR)
- return TREE_OPERAND (stmt, 0);
- else
- return stmt;
-
- case COND_EXPR:
- return COND_EXPR_COND (stmt);
- case SWITCH_EXPR:
- return SWITCH_COND (stmt);
- case GOTO_EXPR:
- return GOTO_DESTINATION (stmt);
- case LABEL_EXPR:
- return LABEL_EXPR_LABEL (stmt);
-
- default:
- return stmt;
- }
-}
-
-
-/* Return true if EXPR is a valid GIMPLE expression. */
+/* Return true if EXPR is an acceptable right-hand-side for a
+ GIMPLE assignment. We validate the entire tree, not just
+ the root node, thus catching expressions that embed complex
+ operands that are not permitted in GIMPLE. This function
+ is needed because the folding routines in fold-const.c
+ may return such expressions in some cases, e.g., an array
+ access with an embedded index addition. It may make more
+ sense to have folding routines that are sensitive to the
+ constraints on GIMPLE operands, rather than abandoning any
+ any attempt to fold if the usual folding turns out to be too
+ aggressive. */
bool
-valid_gimple_expression_p (tree expr)
+valid_gimple_rhs_p (tree expr)
{
enum tree_code code = TREE_CODE (expr);
@@ -588,6 +568,7 @@ valid_gimple_expression_p (tree expr)
break;
case tcc_constant:
+ /* All constants are ok. */
break;
case tcc_binary:
@@ -604,23 +585,26 @@ valid_gimple_expression_p (tree expr)
case tcc_expression:
switch (code)
- {
- case ADDR_EXPR:
- {
- tree t = TREE_OPERAND (expr, 0);
- while (handled_component_p (t))
- {
- /* ??? More checks needed, see the GIMPLE verifier. */
- if ((TREE_CODE (t) == ARRAY_REF
- || TREE_CODE (t) == ARRAY_RANGE_REF)
- && !is_gimple_val (TREE_OPERAND (t, 1)))
- return false;
- t = TREE_OPERAND (t, 0);
- }
- if (!is_gimple_id (t))
- return false;
- break;
- }
+ {
+ case ADDR_EXPR:
+ {
+ tree t;
+ if (is_gimple_min_invariant (expr))
+ return true;
+ t = TREE_OPERAND (expr, 0);
+ while (handled_component_p (t))
+ {
+ /* ??? More checks needed, see the GIMPLE verifier. */
+ if ((TREE_CODE (t) == ARRAY_REF
+ || TREE_CODE (t) == ARRAY_RANGE_REF)
+ && !is_gimple_val (TREE_OPERAND (t, 1)))
+ return false;
+ t = TREE_OPERAND (t, 0);
+ }
+ if (!is_gimple_id (t))
+ return false;
+ }
+ break;
case TRUTH_NOT_EXPR:
if (!is_gimple_val (TREE_OPERAND (expr, 0)))
@@ -645,24 +629,11 @@ valid_gimple_expression_p (tree expr)
break;
case tcc_vl_exp:
- switch (code)
- {
- case CALL_EXPR:
- break;
- default:
- return false;
- }
- break;
+ return false;
case tcc_exceptional:
- switch (code)
- {
- case SSA_NAME:
- break;
-
- default:
- return false;
- }
+ if (code != SSA_NAME)
+ return false;
break;
default:
@@ -673,101 +644,144 @@ valid_gimple_expression_p (tree expr)
}
-/* Set the main expression of *STMT_P to EXPR. If EXPR is not a valid
- GIMPLE expression no changes are done and the function returns
- false. */
+/* Return true if EXPR is a CALL_EXPR suitable for representation
+ as a single GIMPLE_CALL statement. If the arguments require
+ further gimplification, return false. */
bool
-set_rhs (tree *stmt_p, tree expr)
+valid_gimple_call_p (tree expr)
{
- tree stmt = *stmt_p, op;
- tree new_stmt;
- tree var;
- ssa_op_iter iter;
- int eh_region;
+ unsigned i, nargs;
- if (!valid_gimple_expression_p (expr))
+ if (TREE_CODE (expr) != CALL_EXPR)
return false;
- if (EXPR_HAS_LOCATION (stmt)
- && (EXPR_P (expr)
- || GIMPLE_STMT_P (expr))
- && ! EXPR_HAS_LOCATION (expr)
- && TREE_SIDE_EFFECTS (expr)
- && TREE_CODE (expr) != LABEL_EXPR)
- SET_EXPR_LOCATION (expr, EXPR_LOCATION (stmt));
+ nargs = call_expr_nargs (expr);
+ for (i = 0; i < nargs; i++)
+ if (! is_gimple_operand (CALL_EXPR_ARG (expr, i)))
+ return false;
- switch (TREE_CODE (stmt))
- {
- case RETURN_EXPR:
- op = TREE_OPERAND (stmt, 0);
- if (TREE_CODE (op) != GIMPLE_MODIFY_STMT)
- {
- GIMPLE_STMT_OPERAND (stmt, 0) = expr;
- break;
- }
- stmt = op;
- /* FALLTHRU */
+ return true;
+}
- case GIMPLE_MODIFY_STMT:
- op = GIMPLE_STMT_OPERAND (stmt, 1);
- if (TREE_CODE (op) == WITH_SIZE_EXPR)
- TREE_OPERAND (op, 0) = expr;
- else
- GIMPLE_STMT_OPERAND (stmt, 1) = expr;
- break;
- case COND_EXPR:
- if (!is_gimple_condexpr (expr))
- return false;
- COND_EXPR_COND (stmt) = expr;
- break;
- case SWITCH_EXPR:
- SWITCH_COND (stmt) = expr;
- break;
- case GOTO_EXPR:
- GOTO_DESTINATION (stmt) = expr;
- break;
- case LABEL_EXPR:
- LABEL_EXPR_LABEL (stmt) = expr;
- break;
+/* Make SSA names defined by OLD_STMT point to NEW_STMT
+ as their defining statement. */
- default:
- /* Replace the whole statement with EXPR. If EXPR has no side
- effects, then replace *STMT_P with an empty statement. */
- new_stmt = TREE_SIDE_EFFECTS (expr) ? expr : build_empty_stmt ();
- *stmt_p = new_stmt;
-
- /* Preserve the annotation, the histograms and the EH region information
- associated with the original statement. The EH information
- needs to be preserved only if the new statement still can throw. */
- new_stmt->base.ann = (tree_ann_t) stmt_ann (stmt);
- gimple_move_stmt_histograms (cfun, new_stmt, stmt);
- if (tree_could_throw_p (new_stmt))
- {
- eh_region = lookup_stmt_eh_region (stmt);
- /* We couldn't possibly turn a nothrow into a throw statement. */
- gcc_assert (eh_region >= 0);
- remove_stmt_from_eh_region (stmt);
- add_stmt_to_eh_region (new_stmt, eh_region);
- }
+void
+move_ssa_defining_stmt_for_defs (gimple new_stmt, gimple old_stmt)
+{
+ tree var;
+ ssa_op_iter iter;
- if (gimple_in_ssa_p (cfun)
- && TREE_SIDE_EFFECTS (expr))
- {
- /* Fix all the SSA_NAMEs created by *STMT_P to point to its new
- replacement. */
- FOR_EACH_SSA_TREE_OPERAND (var, stmt, iter, SSA_OP_ALL_DEFS)
- {
- if (TREE_CODE (var) == SSA_NAME)
- SSA_NAME_DEF_STMT (var) = *stmt_p;
- }
- }
- stmt->base.ann = NULL;
- break;
+ if (gimple_in_ssa_p (cfun))
+ {
+ /* Make defined SSA_NAMEs point to the new
+ statement as their definition. */
+ FOR_EACH_SSA_TREE_OPERAND (var, old_stmt, iter, SSA_OP_ALL_DEFS)
+ {
+ if (TREE_CODE (var) == SSA_NAME)
+ SSA_NAME_DEF_STMT (var) = new_stmt;
+ }
}
+}
- return true;
+
+/* Update a GIMPLE_CALL statement at iterator *SI_P to reflect the
+ value of EXPR, which is expected to be the result of folding the
+ call. This can only be done if EXPR is a CALL_EXPR with valid
+ GIMPLE operands as arguments, or if it is a suitable RHS expression
+ for a GIMPLE_ASSIGN. More complex expressions will require
+ gimplification, which will introduce addtional statements. In this
+ event, no update is performed, and the function returns false.
+ Note that we cannot mutate a GIMPLE_CALL in-place, so we always
+ replace the statement at *SI_P with an entirely new statement.
+ The new statement need not be a call, e.g., if the original call
+ folded to a constant. */
+
+bool
+update_call_from_tree (gimple_stmt_iterator *si_p, tree expr)
+{
+ tree lhs;
+
+ gimple stmt = gsi_stmt (*si_p);
+
+ gcc_assert (is_gimple_call (stmt));
+
+ lhs = gimple_call_lhs (stmt);
+
+ if (valid_gimple_call_p (expr))
+ {
+ /* The call has simplified to another call. */
+ tree fn = CALL_EXPR_FN (expr);
+ unsigned i;
+ unsigned nargs = call_expr_nargs (expr);
+ VEC(tree, heap) *args = NULL;
+ gimple new_stmt;
+
+ if (nargs > 0)
+ {
+ args = VEC_alloc (tree, heap, nargs);
+ VEC_safe_grow (tree, heap, args, nargs);
+
+ for (i = 0; i < nargs; i++)
+ VEC_replace (tree, args, i, CALL_EXPR_ARG (expr, i));
+ }
+
+ new_stmt = gimple_build_call_vec (fn, args);
+ gimple_call_set_lhs (new_stmt, lhs);
+ copy_virtual_operands (new_stmt, stmt);
+ move_ssa_defining_stmt_for_defs (new_stmt, stmt);
+ gimple_set_location (new_stmt, gimple_location (stmt));
+ gsi_replace (si_p, new_stmt, false);
+ VEC_free (tree, heap, args);
+
+ return true;
+ }
+ else if (valid_gimple_rhs_p (expr))
+ {
+ gimple new_stmt;
+
+ /* The call has simplified to an expression
+ that cannot be represented as a GIMPLE_CALL. */
+ if (lhs)
+ {
+ /* A value is expected.
+ Introduce a new GIMPLE_ASSIGN statement. */
+ STRIP_USELESS_TYPE_CONVERSION (expr);
+ new_stmt = gimple_build_assign (lhs, expr);
+ copy_virtual_operands (new_stmt, stmt);
+ move_ssa_defining_stmt_for_defs (new_stmt, stmt);
+ }
+ else if (!TREE_SIDE_EFFECTS (expr))
+ {
+ /* No value is expected, and EXPR has no effect.
+ Replace it with an empty statement. */
+ new_stmt = gimple_build_nop ();
+ }
+ else
+ {
+ /* No value is expected, but EXPR has an effect,
+ e.g., it could be a reference to a volatile
+ variable. Create an assignment statement
+ with a dummy (unused) lhs variable. */
+ STRIP_USELESS_TYPE_CONVERSION (expr);
+ lhs = create_tmp_var (TREE_TYPE (expr), NULL);
+ new_stmt = gimple_build_assign (lhs, expr);
+ add_referenced_var (lhs);
+ lhs = make_ssa_name (lhs, new_stmt);
+ gimple_assign_set_lhs (new_stmt, lhs);
+ copy_virtual_operands (new_stmt, stmt);
+ move_ssa_defining_stmt_for_defs (new_stmt, stmt);
+ }
+ gimple_set_location (new_stmt, gimple_location (stmt));
+ gsi_replace (si_p, new_stmt, false);
+ return true;
+ }
+ else
+ /* The call simplified to an expression that is
+ not a valid GIMPLE RHS. */
+ return false;
}
@@ -787,8 +801,8 @@ ssa_propagate (ssa_prop_visit_stmt_fn visit_stmt,
/* Iterate until the worklists are empty. */
while (!cfg_blocks_empty_p ()
- || VEC_length (tree, interesting_ssa_edges) > 0
- || VEC_length (tree, varying_ssa_edges) > 0)
+ || VEC_length (gimple, interesting_ssa_edges) > 0
+ || VEC_length (gimple, varying_ssa_edges) > 0)
{
if (!cfg_blocks_empty_p ())
{
@@ -809,40 +823,29 @@ ssa_propagate (ssa_prop_visit_stmt_fn visit_stmt,
}
-/* Return the first VDEF operand for STMT. */
-
-tree
-first_vdef (tree stmt)
-{
- ssa_op_iter iter;
- tree op;
-
- /* Simply return the first operand we arrive at. */
- FOR_EACH_SSA_TREE_OPERAND (op, stmt, iter, SSA_OP_VIRTUAL_DEFS)
- return (op);
-
- gcc_unreachable ();
-}
-
-
/* Return true if STMT is of the form 'LHS = mem_ref', where 'mem_ref'
is a non-volatile pointer dereference, a structure reference or a
reference to a single _DECL. Ignore volatile memory references
because they are not interesting for the optimizers. */
bool
-stmt_makes_single_load (tree stmt)
+stmt_makes_single_load (gimple stmt)
{
tree rhs;
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
+ return false;
+
+ /* Only a GIMPLE_SINGLE_RHS assignment may have a
+ declaration or reference as its RHS. */
+ if (get_gimple_rhs_class (gimple_assign_rhs_code (stmt))
+ != GIMPLE_SINGLE_RHS)
return false;
if (ZERO_SSA_OPERANDS (stmt, SSA_OP_VDEF|SSA_OP_VUSE))
return false;
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- STRIP_NOPS (rhs);
+ rhs = gimple_assign_rhs1 (stmt);
return (!TREE_THIS_VOLATILE (rhs)
&& (DECL_P (rhs)
@@ -856,18 +859,22 @@ stmt_makes_single_load (tree stmt)
because they are not interesting for the optimizers. */
bool
-stmt_makes_single_store (tree stmt)
+stmt_makes_single_store (gimple stmt)
{
tree lhs;
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (gimple_code (stmt) != GIMPLE_ASSIGN
+ && gimple_code (stmt) != GIMPLE_CALL)
return false;
if (ZERO_SSA_OPERANDS (stmt, SSA_OP_VDEF))
return false;
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- STRIP_NOPS (lhs);
+ lhs = gimple_get_lhs (stmt);
+
+ /* A call statement may have a null LHS. */
+ if (!lhs)
+ return false;
return (!TREE_THIS_VOLATILE (lhs)
&& (DECL_P (lhs)
@@ -875,30 +882,6 @@ stmt_makes_single_store (tree stmt)
}
-/* If STMT makes a single memory load and all the virtual use operands
- have the same value in array VALUES, return it. Otherwise, return
- NULL. */
-
-prop_value_t *
-get_value_loaded_by (tree stmt, prop_value_t *values)
-{
- ssa_op_iter i;
- tree vuse;
- prop_value_t *prev_val = NULL;
- prop_value_t *val = NULL;
-
- FOR_EACH_SSA_TREE_OPERAND (vuse, stmt, i, SSA_OP_VIRTUAL_USES)
- {
- val = &values[SSA_NAME_VERSION (vuse)];
- if (prev_val && prev_val->value != val->value)
- return NULL;
- prev_val = val;
- }
-
- return val;
-}
-
-
/* Propagation statistics. */
struct prop_stats_d
{
@@ -911,13 +894,10 @@ struct prop_stats_d
static struct prop_stats_d prop_stats;
/* Replace USE references in statement STMT with the values stored in
- PROP_VALUE. Return true if at least one reference was replaced. If
- REPLACED_ADDRESSES_P is given, it will be set to true if an address
- constant was replaced. */
+ PROP_VALUE. Return true if at least one reference was replaced. */
-bool
-replace_uses_in (tree stmt, bool *replaced_addresses_p,
- prop_value_t *prop_value)
+static bool
+replace_uses_in (gimple stmt, prop_value_t *prop_value)
{
bool replaced = false;
use_operand_p use;
@@ -931,7 +911,7 @@ replace_uses_in (tree stmt, bool *replaced_addresses_p,
if (val == tuse || val == NULL_TREE)
continue;
- if (TREE_CODE (stmt) == ASM_EXPR
+ if (gimple_code (stmt) == GIMPLE_ASM
&& !may_propagate_copy_into_asm (tuse))
continue;
@@ -946,144 +926,6 @@ replace_uses_in (tree stmt, bool *replaced_addresses_p,
propagate_value (use, val);
replaced = true;
- if (POINTER_TYPE_P (TREE_TYPE (tuse)) && replaced_addresses_p)
- *replaced_addresses_p = true;
- }
-
- return replaced;
-}
-
-
-/* Replace the VUSE references in statement STMT with the values
- stored in PROP_VALUE. Return true if a reference was replaced. If
- REPLACED_ADDRESSES_P is given, it will be set to true if an address
- constant was replaced.
-
- Replacing VUSE operands is slightly more complex than replacing
- regular USEs. We are only interested in two types of replacements
- here:
-
- 1- If the value to be replaced is a constant or an SSA name for a
- GIMPLE register, then we are making a copy/constant propagation
- from a memory store. For instance,
-
- # a_3 = VDEF <a_2>
- a.b = x_1;
- ...
- # VUSE <a_3>
- y_4 = a.b;
-
- This replacement is only possible iff STMT is an assignment
- whose RHS is identical to the LHS of the statement that created
- the VUSE(s) that we are replacing. Otherwise, we may do the
- wrong replacement:
-
- # a_3 = VDEF <a_2>
- # b_5 = VDEF <b_4>
- *p = 10;
- ...
- # VUSE <b_5>
- x_8 = b;
-
- Even though 'b_5' acquires the value '10' during propagation,
- there is no way for the propagator to tell whether the
- replacement is correct in every reached use, because values are
- computed at definition sites. Therefore, when doing final
- substitution of propagated values, we have to check each use
- site. Since the RHS of STMT ('b') is different from the LHS of
- the originating statement ('*p'), we cannot replace 'b' with
- '10'.
-
- Similarly, when merging values from PHI node arguments,
- propagators need to take care not to merge the same values
- stored in different locations:
-
- if (...)
- # a_3 = VDEF <a_2>
- a.b = 3;
- else
- # a_4 = VDEF <a_2>
- a.c = 3;
- # a_5 = PHI <a_3, a_4>
-
- It would be wrong to propagate '3' into 'a_5' because that
- operation merges two stores to different memory locations.
-
-
- 2- If the value to be replaced is an SSA name for a virtual
- register, then we simply replace each VUSE operand with its
- value from PROP_VALUE. This is the same replacement done by
- replace_uses_in. */
-
-static bool
-replace_vuses_in (tree stmt, bool *replaced_addresses_p,
- prop_value_t *prop_value)
-{
- bool replaced = false;
- ssa_op_iter iter;
- use_operand_p vuse;
-
- if (stmt_makes_single_load (stmt))
- {
- /* If STMT is an assignment whose RHS is a single memory load,
- see if we are trying to propagate a constant or a GIMPLE
- register (case #1 above). */
- prop_value_t *val = get_value_loaded_by (stmt, prop_value);
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
-
- if (val
- && val->value
- && (is_gimple_reg (val->value)
- || is_gimple_min_invariant (val->value))
- && simple_cst_equal (rhs, val->mem_ref) == 1)
-
- {
- /* If we are replacing a constant address, inform our
- caller. */
- if (TREE_CODE (val->value) != SSA_NAME
- && POINTER_TYPE_P (TREE_TYPE (GIMPLE_STMT_OPERAND (stmt, 1)))
- && replaced_addresses_p)
- *replaced_addresses_p = true;
-
- /* We can only perform the substitution if the load is done
- from the same memory location as the original store.
- Since we already know that there are no intervening
- stores between DEF_STMT and STMT, we only need to check
- that the RHS of STMT is the same as the memory reference
- propagated together with the value. */
- GIMPLE_STMT_OPERAND (stmt, 1) = val->value;
-
- if (TREE_CODE (val->value) != SSA_NAME)
- prop_stats.num_const_prop++;
- else
- prop_stats.num_copy_prop++;
-
- /* Since we have replaced the whole RHS of STMT, there
- is no point in checking the other VUSEs, as they will
- all have the same value. */
- return true;
- }
- }
-
- /* Otherwise, the values for every VUSE operand must be other
- SSA_NAMEs that can be propagated into STMT. */
- FOR_EACH_SSA_USE_OPERAND (vuse, stmt, iter, SSA_OP_VIRTUAL_USES)
- {
- tree var = USE_FROM_PTR (vuse);
- tree val = prop_value[SSA_NAME_VERSION (var)].value;
-
- if (val == NULL_TREE || var == val)
- continue;
-
- /* Constants and copies propagated between real and virtual
- operands are only possible in the cases handled above. They
- should be ignored in any other context. */
- if (is_gimple_min_invariant (val) || is_gimple_reg (val))
- continue;
-
- propagate_value (vuse, val);
- prop_stats.num_copy_prop++;
- replaced = true;
}
return replaced;
@@ -1094,18 +936,20 @@ replace_vuses_in (tree stmt, bool *replaced_addresses_p,
values from PROP_VALUE. */
static void
-replace_phi_args_in (tree phi, prop_value_t *prop_value)
+replace_phi_args_in (gimple phi, prop_value_t *prop_value)
{
- int i;
+ size_t i;
bool replaced = false;
- tree prev_phi = NULL;
if (dump_file && (dump_flags & TDF_DETAILS))
- prev_phi = unshare_expr (phi);
+ {
+ fprintf (dump_file, "Folding PHI node: ");
+ print_gimple_stmt (dump_file, phi, 0, TDF_SLIM);
+ }
- for (i = 0; i < PHI_NUM_ARGS (phi); i++)
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
{
- tree arg = PHI_ARG_DEF (phi, i);
+ tree arg = gimple_phi_arg_def (phi, i);
if (TREE_CODE (arg) == SSA_NAME)
{
@@ -1125,72 +969,84 @@ replace_phi_args_in (tree phi, prop_value_t *prop_value)
through an abnormal edge, update the replacement
accordingly. */
if (TREE_CODE (val) == SSA_NAME
- && PHI_ARG_EDGE (phi, i)->flags & EDGE_ABNORMAL)
+ && gimple_phi_arg_edge (phi, i)->flags & EDGE_ABNORMAL)
SSA_NAME_OCCURS_IN_ABNORMAL_PHI (val) = 1;
}
}
}
- if (replaced && dump_file && (dump_flags & TDF_DETAILS))
+ if (dump_file && (dump_flags & TDF_DETAILS))
{
- fprintf (dump_file, "Folded PHI node: ");
- print_generic_stmt (dump_file, prev_phi, TDF_SLIM);
- fprintf (dump_file, " into: ");
- print_generic_stmt (dump_file, phi, TDF_SLIM);
- fprintf (dump_file, "\n");
+ if (!replaced)
+ fprintf (dump_file, "No folding possible\n");
+ else
+ {
+ fprintf (dump_file, "Folded into: ");
+ print_gimple_stmt (dump_file, phi, 0, TDF_SLIM);
+ fprintf (dump_file, "\n");
+ }
}
}
-/* If STMT has a predicate whose value can be computed using the value
- range information computed by VRP, compute its value and return true.
- Otherwise, return false. */
+/* If the statement pointed by SI has a predicate whose value can be
+ computed using the value range information computed by VRP, compute
+ its value and return true. Otherwise, return false. */
static bool
-fold_predicate_in (tree stmt)
+fold_predicate_in (gimple_stmt_iterator *si)
{
- tree *pred_p = NULL;
- bool modify_stmt_p = false;
+ bool assignment_p = false;
tree val;
+ gimple stmt = gsi_stmt (*si);
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && COMPARISON_CLASS_P (GIMPLE_STMT_OPERAND (stmt, 1)))
+ if (is_gimple_assign (stmt)
+ && TREE_CODE_CLASS (gimple_assign_rhs_code (stmt)) == tcc_comparison)
{
- modify_stmt_p = true;
- pred_p = &GIMPLE_STMT_OPERAND (stmt, 1);
+ assignment_p = true;
+ val = vrp_evaluate_conditional (gimple_assign_rhs_code (stmt),
+ gimple_assign_rhs1 (stmt),
+ gimple_assign_rhs2 (stmt),
+ stmt);
}
- else if (TREE_CODE (stmt) == COND_EXPR)
- pred_p = &COND_EXPR_COND (stmt);
+ else if (gimple_code (stmt) == GIMPLE_COND)
+ val = vrp_evaluate_conditional (gimple_cond_code (stmt),
+ gimple_cond_lhs (stmt),
+ gimple_cond_rhs (stmt),
+ stmt);
else
return false;
- if (TREE_CODE (*pred_p) == SSA_NAME)
- val = vrp_evaluate_conditional (EQ_EXPR,
- *pred_p,
- boolean_true_node,
- stmt);
- else
- val = vrp_evaluate_conditional (TREE_CODE (*pred_p),
- TREE_OPERAND (*pred_p, 0),
- TREE_OPERAND (*pred_p, 1),
- stmt);
if (val)
{
- if (modify_stmt_p)
- val = fold_convert (TREE_TYPE (*pred_p), val);
+ if (assignment_p)
+ val = fold_convert (gimple_expr_type (stmt), val);
if (dump_file)
{
fprintf (dump_file, "Folding predicate ");
- print_generic_expr (dump_file, *pred_p, 0);
+ print_gimple_expr (dump_file, stmt, 0, 0);
fprintf (dump_file, " to ");
print_generic_expr (dump_file, val, 0);
fprintf (dump_file, "\n");
}
prop_stats.num_pred_folded++;
- *pred_p = val;
+
+ if (is_gimple_assign (stmt))
+ gimple_assign_set_rhs_from_tree (si, val);
+ else
+ {
+ gcc_assert (gimple_code (stmt) == GIMPLE_COND);
+ if (integer_zerop (val))
+ gimple_cond_make_false (stmt);
+ else if (integer_onep (val))
+ gimple_cond_make_true (stmt);
+ else
+ gcc_unreachable ();
+ }
+
return true;
}
@@ -1222,128 +1078,133 @@ substitute_and_fold (prop_value_t *prop_value, bool use_ranges_p)
return false;
if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "\nSubstituing values and folding statements\n\n");
+ fprintf (dump_file, "\nSubstituting values and folding statements\n\n");
memset (&prop_stats, 0, sizeof (prop_stats));
/* Substitute values in every statement of every basic block. */
FOR_EACH_BB (bb)
{
- block_stmt_iterator i;
- tree phi;
+ gimple_stmt_iterator i;
/* Propagate known values into PHI nodes. */
if (prop_value)
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- replace_phi_args_in (phi, prop_value);
+ for (i = gsi_start_phis (bb); !gsi_end_p (i); gsi_next (&i))
+ replace_phi_args_in (gsi_stmt (i), prop_value);
/* Propagate known values into stmts. Do a backward walk to expose
more trivially deletable stmts. */
- for (i = bsi_last (bb); !bsi_end_p (i);)
+ for (i = gsi_last_bb (bb); !gsi_end_p (i);)
{
- bool replaced_address, did_replace;
- tree call, prev_stmt = NULL;
- tree stmt = bsi_stmt (i);
+ bool did_replace;
+ gimple stmt = gsi_stmt (i);
+ enum gimple_code code = gimple_code (stmt);
/* Ignore ASSERT_EXPRs. They are used by VRP to generate
range information for names and they are discarded
afterwards. */
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == ASSERT_EXPR)
+
+ if (code == GIMPLE_ASSIGN
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == ASSERT_EXPR)
{
- bsi_prev (&i);
+ gsi_prev (&i);
continue;
}
/* No point propagating into a stmt whose result is not used,
but instead we might be able to remove a trivially dead stmt. */
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == SSA_NAME
- && !stmt_ann (stmt)->has_volatile_ops
- && has_zero_uses (GIMPLE_STMT_OPERAND (stmt, 0))
- && !tree_could_throw_p (stmt)
- && (!(call = get_call_expr_in (stmt))
- || !TREE_SIDE_EFFECTS (call)))
+ if (gimple_get_lhs (stmt)
+ && TREE_CODE (gimple_get_lhs (stmt)) == SSA_NAME
+ && has_zero_uses (gimple_get_lhs (stmt))
+ && !stmt_could_throw_p (stmt)
+ && !gimple_has_side_effects (stmt))
{
- block_stmt_iterator i2;
+ gimple_stmt_iterator i2;
+
if (dump_file && dump_flags & TDF_DETAILS)
{
fprintf (dump_file, "Removing dead stmt ");
- print_generic_expr (dump_file, stmt, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
fprintf (dump_file, "\n");
}
prop_stats.num_dce++;
- bsi_prev (&i);
- i2 = bsi_for_stmt (stmt);
- bsi_remove (&i2, true);
+ gsi_prev (&i);
+ i2 = gsi_for_stmt (stmt);
+ gsi_remove (&i2, true);
release_defs (stmt);
continue;
}
/* Record the state of the statement before replacements. */
- push_stmt_changes (bsi_stmt_ptr (i));
+ push_stmt_changes (gsi_stmt_ptr (&i));
/* Replace the statement with its folded version and mark it
folded. */
did_replace = false;
- replaced_address = false;
if (dump_file && (dump_flags & TDF_DETAILS))
- prev_stmt = unshare_expr (stmt);
+ {
+ fprintf (dump_file, "Folding statement: ");
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
+ }
/* If we have range information, see if we can fold
predicate expressions. */
if (use_ranges_p)
- did_replace = fold_predicate_in (stmt);
-
- if (prop_value)
{
- /* Only replace real uses if we couldn't fold the
- statement using value range information (value range
- information is not collected on virtuals, so we only
- need to check this for real uses). */
- if (!did_replace)
- did_replace |= replace_uses_in (stmt, &replaced_address,
- prop_value);
-
- did_replace |= replace_vuses_in (stmt, &replaced_address,
- prop_value);
+ did_replace = fold_predicate_in (&i);
+ /* fold_predicate_in should not have reallocated STMT. */
+ gcc_assert (gsi_stmt (i) == stmt);
}
+ /* Only replace real uses if we couldn't fold the
+ statement using value range information. */
+ if (prop_value
+ && !did_replace)
+ did_replace |= replace_uses_in (stmt, prop_value);
+
/* If we made a replacement, fold and cleanup the statement. */
if (did_replace)
{
- tree old_stmt = stmt;
- tree rhs;
+ gimple old_stmt = stmt;
- fold_stmt (bsi_stmt_ptr (i));
- stmt = bsi_stmt (i);
+ fold_stmt (&i);
+ stmt = gsi_stmt (i);
/* If we cleaned up EH information from the statement,
remove EH edges. */
if (maybe_clean_or_replace_eh_stmt (old_stmt, stmt))
- tree_purge_dead_eh_edges (bb);
-
- rhs = get_rhs (stmt);
- if (TREE_CODE (rhs) == ADDR_EXPR)
- recompute_tree_invariant_for_addr_expr (rhs);
-
- if (dump_file && (dump_flags & TDF_DETAILS))
- {
- fprintf (dump_file, "Folded statement: ");
- print_generic_stmt (dump_file, prev_stmt, TDF_SLIM);
- fprintf (dump_file, " into: ");
- print_generic_stmt (dump_file, stmt, TDF_SLIM);
- fprintf (dump_file, "\n");
- }
+ gimple_purge_dead_eh_edges (bb);
+
+ if (is_gimple_assign (stmt)
+ && (get_gimple_rhs_class (gimple_assign_rhs_code (stmt))
+ == GIMPLE_SINGLE_RHS))
+ {
+ tree rhs = gimple_assign_rhs1 (stmt);
+
+ if (TREE_CODE (rhs) == ADDR_EXPR)
+ recompute_tree_invariant_for_addr_expr (rhs);
+ }
/* Determine what needs to be done to update the SSA form. */
- pop_stmt_changes (bsi_stmt_ptr (i));
+ pop_stmt_changes (gsi_stmt_ptr (&i));
something_changed = true;
}
else
{
/* The statement was not modified, discard the change buffer. */
- discard_stmt_changes (bsi_stmt_ptr (i));
+ discard_stmt_changes (gsi_stmt_ptr (&i));
+ }
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ if (did_replace)
+ {
+ fprintf (dump_file, "Folded into: ");
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
+ fprintf (dump_file, "\n");
+ }
+ else
+ fprintf (dump_file, "Not folded\n");
}
/* Some statements may be simplified using ranges. For
@@ -1355,7 +1216,7 @@ substitute_and_fold (prop_value_t *prop_value, bool use_ranges_p)
if (use_ranges_p)
simplify_stmt_using_ranges (stmt);
- bsi_prev (&i);
+ gsi_prev (&i);
}
}
diff --git a/gcc/tree-ssa-propagate.h b/gcc/tree-ssa-propagate.h
index 18133788309..3922f7d7cc5 100644
--- a/gcc/tree-ssa-propagate.h
+++ b/gcc/tree-ssa-propagate.h
@@ -22,9 +22,21 @@ along with GCC; see the file COPYING3. If not see
#ifndef _TREE_SSA_PROPAGATE_H
#define _TREE_SSA_PROPAGATE_H 1
-/* Use the TREE_VISITED bitflag to mark statements and PHI nodes that
- have been deemed varying and should not be simulated again. */
-#define DONT_SIMULATE_AGAIN(T) TREE_VISITED (T)
+/* If SIM_P is true, statement S will be simulated again. */
+
+static inline void
+prop_set_simulate_again (gimple s, bool visit_p)
+{
+ gimple_set_visited (s, visit_p);
+}
+
+/* Return true if statement T should be simulated again. */
+
+static inline bool
+prop_simulate_again_p (gimple s)
+{
+ return gimple_visited_p (s);
+}
/* Lattice values used for propagation purposes. Specific instances
of a propagation engine must return these values from the statement
@@ -57,16 +69,6 @@ struct prop_value_d {
/* Propagated value. */
tree value;
-
- /* If this value is held in an SSA name for a non-register
- variable, this field holds the actual memory reference
- associated with this value. This field is taken from
- the LHS of the assignment that generated the associated SSA
- name. However, in the case of PHI nodes, this field is copied
- from the PHI arguments (assuming that all the arguments have
- the same memory reference). See replace_vuses_in for a more
- detailed description. */
- tree mem_ref;
};
typedef struct prop_value_d prop_value_t;
@@ -106,20 +108,18 @@ typedef struct value_range_d value_range_t;
/* Call-back functions used by the value propagation engine. */
-typedef enum ssa_prop_result (*ssa_prop_visit_stmt_fn) (tree, edge *, tree *);
-typedef enum ssa_prop_result (*ssa_prop_visit_phi_fn) (tree);
+typedef enum ssa_prop_result (*ssa_prop_visit_stmt_fn) (gimple, edge *, tree *);
+typedef enum ssa_prop_result (*ssa_prop_visit_phi_fn) (gimple);
/* In tree-ssa-propagate.c */
void ssa_propagate (ssa_prop_visit_stmt_fn, ssa_prop_visit_phi_fn);
-tree get_rhs (tree);
-bool valid_gimple_expression_p (tree expr);
-bool set_rhs (tree *, tree);
-tree first_vdef (tree);
-bool stmt_makes_single_load (tree);
-bool stmt_makes_single_store (tree);
-prop_value_t *get_value_loaded_by (tree, prop_value_t *);
-bool replace_uses_in (tree, bool *, prop_value_t *);
+bool valid_gimple_rhs_p (tree);
+bool valid_gimple_call_p (tree);
+void move_ssa_defining_stmt_for_defs (gimple, gimple);
+bool update_call_from_tree (gimple_stmt_iterator *, tree);
+bool stmt_makes_single_load (gimple);
+bool stmt_makes_single_store (gimple);
bool substitute_and_fold (prop_value_t *, bool);
#endif /* _TREE_SSA_PROPAGATE_H */
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index 5fcaa7bbb16..e4e7db69d2e 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic.h"
#include "tree-inline.h"
#include "tree-flow.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-dump.h"
#include "timevar.h"
#include "tree-iterator.h"
@@ -230,23 +230,21 @@ get_rank (tree e)
if (TREE_CODE (e) == SSA_NAME)
{
- tree stmt;
- tree rhs;
+ gimple stmt;
long rank, maxrank;
- int i;
- int n;
+ int i, n;
if (TREE_CODE (SSA_NAME_VAR (e)) == PARM_DECL
&& SSA_NAME_IS_DEFAULT_DEF (e))
return find_operand_rank (e);
stmt = SSA_NAME_DEF_STMT (e);
- if (bb_for_stmt (stmt) == NULL)
+ if (gimple_bb (stmt) == NULL)
return 0;
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT
+ if (!is_gimple_assign (stmt)
|| !ZERO_SSA_OPERANDS (stmt, SSA_OP_VIRTUAL_DEFS))
- return bb_rank[bb_for_stmt (stmt)->index];
+ return bb_rank[gimple_bb (stmt)->index];
/* If we already have a rank for this expression, use that. */
rank = find_operand_rank (e);
@@ -256,19 +254,28 @@ get_rank (tree e)
/* Otherwise, find the maximum rank for the operands, or the bb
rank, whichever is less. */
rank = 0;
- maxrank = bb_rank[bb_for_stmt(stmt)->index];
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- n = TREE_OPERAND_LENGTH (rhs);
- if (n == 0)
- rank = MAX (rank, get_rank (rhs));
+ maxrank = bb_rank[gimple_bb(stmt)->index];
+ if (gimple_assign_single_p (stmt))
+ {
+ tree rhs = gimple_assign_rhs1 (stmt);
+ n = TREE_OPERAND_LENGTH (rhs);
+ if (n == 0)
+ rank = MAX (rank, get_rank (rhs));
+ else
+ {
+ for (i = 0;
+ i < n && TREE_OPERAND (rhs, i) && rank != maxrank; i++)
+ rank = MAX(rank, get_rank (TREE_OPERAND (rhs, i)));
+ }
+ }
else
{
- for (i = 0;
- i < n
- && TREE_OPERAND (rhs, i)
- && rank != maxrank;
- i++)
- rank = MAX(rank, get_rank (TREE_OPERAND (rhs, i)));
+ n = gimple_num_ops (stmt);
+ for (i = 1; i < n && rank != maxrank; i++)
+ {
+ gcc_assert (gimple_op (stmt, i));
+ rank = MAX(rank, get_rank (gimple_op (stmt, i)));
+ }
}
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -349,21 +356,21 @@ add_to_ops_vec (VEC(operand_entry_t, heap) **ops, tree op)
operation with tree code CODE, and is inside LOOP. */
static bool
-is_reassociable_op (tree stmt, enum tree_code code, struct loop *loop)
+is_reassociable_op (gimple stmt, enum tree_code code, struct loop *loop)
{
- basic_block bb;
+ basic_block bb = gimple_bb (stmt);
- if (IS_EMPTY_STMT (stmt))
+ if (gimple_bb (stmt) == NULL)
return false;
- bb = bb_for_stmt (stmt);
if (!flow_bb_inside_loop_p (loop, bb))
return false;
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == code
- && has_single_use (GIMPLE_STMT_OPERAND (stmt, 0)))
+ if (is_gimple_assign (stmt)
+ && gimple_assign_rhs_code (stmt) == code
+ && has_single_use (gimple_assign_lhs (stmt)))
return true;
+
return false;
}
@@ -374,15 +381,13 @@ is_reassociable_op (tree stmt, enum tree_code code, struct loop *loop)
static tree
get_unary_op (tree name, enum tree_code opcode)
{
- tree stmt = SSA_NAME_DEF_STMT (name);
- tree rhs;
+ gimple stmt = SSA_NAME_DEF_STMT (name);
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_assign (stmt))
return NULL_TREE;
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- if (TREE_CODE (rhs) == opcode)
- return TREE_OPERAND (rhs, 0);
+ if (gimple_assign_rhs_code (stmt) == opcode)
+ return gimple_assign_rhs1 (stmt);
return NULL_TREE;
}
@@ -722,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. */
@@ -806,18 +1220,20 @@ optimize_ops_list (enum tree_code opcode,
update" operation. */
static bool
-is_phi_for_stmt (tree stmt, tree operand)
+is_phi_for_stmt (gimple stmt, tree operand)
{
- tree def_stmt;
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
+ gimple def_stmt;
+ tree lhs;
use_operand_p arg_p;
ssa_op_iter i;
if (TREE_CODE (operand) != SSA_NAME)
return false;
+ lhs = gimple_assign_lhs (stmt);
+
def_stmt = SSA_NAME_DEF_STMT (operand);
- if (TREE_CODE (def_stmt) != PHI_NODE)
+ if (gimple_code (def_stmt) != GIMPLE_PHI)
return false;
FOR_EACH_PHI_ARG (arg_p, def_stmt, i, SSA_OP_USE)
@@ -831,10 +1247,11 @@ is_phi_for_stmt (tree stmt, tree operand)
order. */
static void
-rewrite_expr_tree (tree stmt, unsigned int opindex,
+rewrite_expr_tree (gimple stmt, unsigned int opindex,
VEC(operand_entry_t, heap) * ops)
{
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ tree rhs1 = gimple_assign_rhs1 (stmt);
+ tree rhs2 = gimple_assign_rhs2 (stmt);
operand_entry_t oe;
/* If we have three operands left, then we want to make sure the one
@@ -897,24 +1314,22 @@ rewrite_expr_tree (tree stmt, unsigned int opindex,
oe1 = VEC_index (operand_entry_t, ops, opindex);
oe2 = VEC_index (operand_entry_t, ops, opindex + 1);
- if (TREE_OPERAND (rhs, 0) != oe1->op
- || TREE_OPERAND (rhs, 1) != oe2->op)
+ if (rhs1 != oe1->op || rhs2 != oe2->op)
{
-
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Transforming ");
- print_generic_expr (dump_file, rhs, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
}
- TREE_OPERAND (rhs, 0) = oe1->op;
- TREE_OPERAND (rhs, 1) = oe2->op;
+ gimple_assign_set_rhs1 (stmt, oe1->op);
+ gimple_assign_set_rhs2 (stmt, oe2->op);
update_stmt (stmt);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " into ");
- print_generic_stmt (dump_file, rhs, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
}
}
@@ -927,28 +1342,27 @@ rewrite_expr_tree (tree stmt, unsigned int opindex,
/* Rewrite the next operator. */
oe = VEC_index (operand_entry_t, ops, opindex);
- if (oe->op != TREE_OPERAND (rhs, 1))
+ if (oe->op != rhs2)
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Transforming ");
- print_generic_expr (dump_file, rhs, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
}
- TREE_OPERAND (rhs, 1) = oe->op;
+ gimple_assign_set_rhs2 (stmt, oe->op);
update_stmt (stmt);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " into ");
- print_generic_stmt (dump_file, rhs, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
}
}
/* Recurse on the LHS of the binary operator, which is guaranteed to
be the non-leaf side. */
- rewrite_expr_tree (SSA_NAME_DEF_STMT (TREE_OPERAND (rhs, 0)),
- opindex + 1, ops);
+ rewrite_expr_tree (SSA_NAME_DEF_STMT (rhs1), opindex + 1, ops);
}
/* Transform STMT, which is really (A +B) + (C + D) into the left
@@ -956,114 +1370,114 @@ rewrite_expr_tree (tree stmt, unsigned int opindex,
Recurse on D if necessary. */
static void
-linearize_expr (tree stmt)
+linearize_expr (gimple stmt)
{
- block_stmt_iterator bsinow, bsirhs;
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- enum tree_code rhscode = TREE_CODE (rhs);
- tree binrhs = SSA_NAME_DEF_STMT (TREE_OPERAND (rhs, 1));
- tree binlhs = SSA_NAME_DEF_STMT (TREE_OPERAND (rhs, 0));
- tree newbinrhs = NULL_TREE;
+ gimple_stmt_iterator gsinow, gsirhs;
+ gimple binlhs = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (stmt));
+ gimple binrhs = SSA_NAME_DEF_STMT (gimple_assign_rhs2 (stmt));
+ enum tree_code rhscode = gimple_assign_rhs_code (stmt);
+ gimple newbinrhs = NULL;
struct loop *loop = loop_containing_stmt (stmt);
- gcc_assert (is_reassociable_op (binlhs, TREE_CODE (rhs), loop)
- && is_reassociable_op (binrhs, TREE_CODE (rhs), loop));
+ gcc_assert (is_reassociable_op (binlhs, rhscode, loop)
+ && is_reassociable_op (binrhs, rhscode, loop));
+
+ gsinow = gsi_for_stmt (stmt);
+ gsirhs = gsi_for_stmt (binrhs);
+ gsi_move_before (&gsirhs, &gsinow);
- bsinow = bsi_for_stmt (stmt);
- bsirhs = bsi_for_stmt (binrhs);
- bsi_move_before (&bsirhs, &bsinow);
+ gimple_assign_set_rhs2 (stmt, gimple_assign_rhs1 (binrhs));
+ gimple_assign_set_rhs1 (binrhs, gimple_assign_lhs (binlhs));
+ gimple_assign_set_rhs1 (stmt, gimple_assign_lhs (binrhs));
- TREE_OPERAND (rhs, 1) = TREE_OPERAND (GIMPLE_STMT_OPERAND (binrhs, 1), 0);
- if (TREE_CODE (TREE_OPERAND (rhs, 1)) == SSA_NAME)
- newbinrhs = SSA_NAME_DEF_STMT (TREE_OPERAND (rhs, 1));
- TREE_OPERAND (GIMPLE_STMT_OPERAND (binrhs, 1), 0)
- = GIMPLE_STMT_OPERAND (binlhs, 0);
- TREE_OPERAND (rhs, 0) = GIMPLE_STMT_OPERAND (binrhs, 0);
+ if (TREE_CODE (gimple_assign_rhs2 (stmt)) == SSA_NAME)
+ newbinrhs = SSA_NAME_DEF_STMT (gimple_assign_rhs2 (stmt));
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Linearized: ");
- print_generic_stmt (dump_file, rhs, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
}
reassociate_stats.linearized++;
update_stmt (binrhs);
update_stmt (binlhs);
update_stmt (stmt);
- TREE_VISITED (binrhs) = 1;
- TREE_VISITED (binlhs) = 1;
- TREE_VISITED (stmt) = 1;
+
+ gimple_set_visited (stmt, true);
+ gimple_set_visited (binlhs, true);
+ gimple_set_visited (binrhs, true);
/* Tail recurse on the new rhs if it still needs reassociation. */
if (newbinrhs && is_reassociable_op (newbinrhs, rhscode, loop))
+ /* ??? This should probably be linearize_expr (newbinrhs) but I don't
+ want to change the algorithm while converting to tuples. */
linearize_expr (stmt);
}
-/* If LHS has a single immediate use that is a GIMPLE_MODIFY_STMT, return
+/* If LHS has a single immediate use that is a GIMPLE_ASSIGN statement, return
it. Otherwise, return NULL. */
-static tree
+static gimple
get_single_immediate_use (tree lhs)
{
use_operand_p immuse;
- tree immusestmt;
+ gimple immusestmt;
if (TREE_CODE (lhs) == SSA_NAME
- && single_imm_use (lhs, &immuse, &immusestmt))
- {
- if (TREE_CODE (immusestmt) == RETURN_EXPR)
- immusestmt = TREE_OPERAND (immusestmt, 0);
- if (TREE_CODE (immusestmt) == GIMPLE_MODIFY_STMT)
- return immusestmt;
- }
- return NULL_TREE;
+ && single_imm_use (lhs, &immuse, &immusestmt)
+ && is_gimple_assign (immusestmt))
+ return immusestmt;
+
+ return NULL;
}
-static VEC(tree, heap) *broken_up_subtracts;
+static VEC(tree, heap) *broken_up_subtracts;
/* Recursively negate the value of TONEGATE, and return the SSA_NAME
representing the negated value. Insertions of any necessary
- instructions go before BSI.
+ instructions go before GSI.
This function is recursive in that, if you hand it "a_5" as the
value to negate, and a_5 is defined by "a_5 = b_3 + b_4", it will
transform b_3 + b_4 into a_5 = -b_3 + -b_4. */
static tree
-negate_value (tree tonegate, block_stmt_iterator *bsi)
+negate_value (tree tonegate, gimple_stmt_iterator *gsi)
{
- tree negatedef = tonegate;
+ gimple negatedefstmt= NULL;
tree resultofnegate;
- if (TREE_CODE (tonegate) == SSA_NAME)
- negatedef = SSA_NAME_DEF_STMT (tonegate);
-
/* If we are trying to negate a name, defined by an add, negate the
add operands instead. */
+ if (TREE_CODE (tonegate) == SSA_NAME)
+ negatedefstmt = SSA_NAME_DEF_STMT (tonegate);
if (TREE_CODE (tonegate) == SSA_NAME
- && TREE_CODE (negatedef) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (negatedef, 0)) == SSA_NAME
- && has_single_use (GIMPLE_STMT_OPERAND (negatedef, 0))
- && TREE_CODE (GIMPLE_STMT_OPERAND (negatedef, 1)) == PLUS_EXPR)
+ && is_gimple_assign (negatedefstmt)
+ && TREE_CODE (gimple_assign_lhs (negatedefstmt)) == SSA_NAME
+ && has_single_use (gimple_assign_lhs (negatedefstmt))
+ && gimple_assign_rhs_code (negatedefstmt) == PLUS_EXPR)
{
- block_stmt_iterator bsi;
- tree binop = GIMPLE_STMT_OPERAND (negatedef, 1);
-
- bsi = bsi_for_stmt (negatedef);
- TREE_OPERAND (binop, 0) = negate_value (TREE_OPERAND (binop, 0),
- &bsi);
- bsi = bsi_for_stmt (negatedef);
- TREE_OPERAND (binop, 1) = negate_value (TREE_OPERAND (binop, 1),
- &bsi);
- update_stmt (negatedef);
- return GIMPLE_STMT_OPERAND (negatedef, 0);
+ gimple_stmt_iterator gsi;
+ tree rhs1 = gimple_assign_rhs1 (negatedefstmt);
+ tree rhs2 = gimple_assign_rhs2 (negatedefstmt);
+
+ gsi = gsi_for_stmt (negatedefstmt);
+ rhs1 = negate_value (rhs1, &gsi);
+ gimple_assign_set_rhs1 (negatedefstmt, rhs1);
+
+ gsi = gsi_for_stmt (negatedefstmt);
+ rhs2 = negate_value (rhs2, &gsi);
+ gimple_assign_set_rhs2 (negatedefstmt, rhs2);
+
+ update_stmt (negatedefstmt);
+ return gimple_assign_lhs (negatedefstmt);
}
tonegate = fold_build1 (NEGATE_EXPR, TREE_TYPE (tonegate), tonegate);
- resultofnegate = force_gimple_operand_bsi (bsi, tonegate, true,
- NULL_TREE, true, BSI_SAME_STMT);
+ resultofnegate = force_gimple_operand_gsi (gsi, tonegate, true,
+ NULL_TREE, true, GSI_SAME_STMT);
VEC_safe_push (tree, heap, broken_up_subtracts, resultofnegate);
return resultofnegate;
-
}
/* Return true if we should break up the subtract in STMT into an add
@@ -1073,14 +1487,12 @@ negate_value (tree tonegate, block_stmt_iterator *bsi)
exposes the adds to reassociation. */
static bool
-should_break_up_subtract (tree stmt)
+should_break_up_subtract (gimple stmt)
{
-
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- tree binlhs = TREE_OPERAND (rhs, 0);
- tree binrhs = TREE_OPERAND (rhs, 1);
- tree immusestmt;
+ tree lhs = gimple_assign_lhs (stmt);
+ tree binlhs = gimple_assign_rhs1 (stmt);
+ tree binrhs = gimple_assign_rhs2 (stmt);
+ gimple immusestmt;
struct loop *loop = loop_containing_stmt (stmt);
if (TREE_CODE (binlhs) == SSA_NAME
@@ -1093,28 +1505,29 @@ should_break_up_subtract (tree stmt)
if (TREE_CODE (lhs) == SSA_NAME
&& (immusestmt = get_single_immediate_use (lhs))
- && TREE_CODE (GIMPLE_STMT_OPERAND (immusestmt, 1)) == PLUS_EXPR)
+ && is_gimple_assign (immusestmt)
+ && (gimple_assign_rhs_code (immusestmt) == PLUS_EXPR
+ || gimple_assign_rhs_code (immusestmt) == MULT_EXPR))
return true;
return false;
-
}
/* Transform STMT from A - B into A + -B. */
static void
-break_up_subtract (tree stmt, block_stmt_iterator *bsi)
+break_up_subtract (gimple stmt, gimple_stmt_iterator *gsip)
{
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ tree rhs1 = gimple_assign_rhs1 (stmt);
+ tree rhs2 = gimple_assign_rhs2 (stmt);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Breaking up subtract ");
- print_generic_stmt (dump_file, stmt, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
}
- TREE_SET_CODE (GIMPLE_STMT_OPERAND (stmt, 1), PLUS_EXPR);
- TREE_OPERAND (rhs, 1) = negate_value (TREE_OPERAND (rhs, 1), bsi);
-
+ rhs2 = negate_value (rhs2, gsip);
+ gimple_assign_set_rhs_with_ops (gsip, PLUS_EXPR, rhs1, rhs2);
update_stmt (stmt);
}
@@ -1122,19 +1535,20 @@ break_up_subtract (tree stmt, block_stmt_iterator *bsi)
Place the operands of the expression tree in the vector named OPS. */
static void
-linearize_expr_tree (VEC(operand_entry_t, heap) **ops, tree stmt)
+linearize_expr_tree (VEC(operand_entry_t, heap) **ops, gimple stmt,
+ bool is_associative, bool set_visited)
{
- block_stmt_iterator bsinow, bsilhs;
- tree rhs = GENERIC_TREE_OPERAND (stmt, 1);
- tree binrhs = TREE_OPERAND (rhs, 1);
- tree binlhs = TREE_OPERAND (rhs, 0);
- tree binlhsdef, binrhsdef;
+ gimple_stmt_iterator gsinow, gsilhs;
+ tree binlhs = gimple_assign_rhs1 (stmt);
+ tree binrhs = gimple_assign_rhs2 (stmt);
+ gimple binlhsdef, binrhsdef;
bool binlhsisreassoc = false;
bool binrhsisreassoc = false;
- enum tree_code rhscode = TREE_CODE (rhs);
+ enum tree_code rhscode = gimple_assign_rhs_code (stmt);
struct loop *loop = loop_containing_stmt (stmt);
- TREE_VISITED (stmt) = 1;
+ if (set_visited)
+ gimple_set_visited (stmt, true);
if (TREE_CODE (binlhs) == SSA_NAME)
{
@@ -1158,6 +1572,13 @@ linearize_expr_tree (VEC(operand_entry_t, heap) **ops, tree 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);
@@ -1168,17 +1589,18 @@ linearize_expr_tree (VEC(operand_entry_t, heap) **ops, tree stmt)
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "swapping operands of ");
- print_generic_expr (dump_file, stmt, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
}
- swap_tree_operands (stmt, &TREE_OPERAND (rhs, 0),
- &TREE_OPERAND (rhs, 1));
+ swap_tree_operands (stmt,
+ gimple_assign_rhs1_ptr (stmt),
+ gimple_assign_rhs2_ptr (stmt));
update_stmt (stmt);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " is now ");
- print_generic_stmt (dump_file, stmt, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
}
/* We want to make it so the lhs is always the reassociative op,
@@ -1190,18 +1612,18 @@ linearize_expr_tree (VEC(operand_entry_t, heap) **ops, tree stmt)
else if (binrhsisreassoc)
{
linearize_expr (stmt);
- gcc_assert (rhs == GIMPLE_STMT_OPERAND (stmt, 1));
- binlhs = TREE_OPERAND (rhs, 0);
- binrhs = TREE_OPERAND (rhs, 1);
+ binlhs = gimple_assign_rhs1 (stmt);
+ binrhs = gimple_assign_rhs2 (stmt);
}
gcc_assert (TREE_CODE (binrhs) != SSA_NAME
|| !is_reassociable_op (SSA_NAME_DEF_STMT (binrhs),
rhscode, loop));
- bsinow = bsi_for_stmt (stmt);
- bsilhs = bsi_for_stmt (SSA_NAME_DEF_STMT (binlhs));
- bsi_move_before (&bsilhs, &bsinow);
- linearize_expr_tree (ops, SSA_NAME_DEF_STMT (binlhs));
+ 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),
+ is_associative, set_visited);
add_to_ops_vec (ops, binrhs);
}
@@ -1216,7 +1638,7 @@ repropagate_negates (void)
for (i = 0; VEC_iterate (tree, broken_up_subtracts, i, negate); i++)
{
- tree user = get_single_immediate_use (negate);
+ gimple user = get_single_immediate_use (negate);
/* The negate operand can be either operand of a PLUS_EXPR
(it can be the LHS if the RHS is a constant for example).
@@ -1224,27 +1646,27 @@ repropagate_negates (void)
Force the negate operand to the RHS of the PLUS_EXPR, then
transform the PLUS_EXPR into a MINUS_EXPR. */
if (user
- && TREE_CODE (user) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (user, 1)) == PLUS_EXPR)
+ && is_gimple_assign (user)
+ && gimple_assign_rhs_code (user) == PLUS_EXPR)
{
- tree rhs = GIMPLE_STMT_OPERAND (user, 1);
-
/* If the negated operand appears on the LHS of the
PLUS_EXPR, exchange the operands of the PLUS_EXPR
to force the negated operand to the RHS of the PLUS_EXPR. */
- if (TREE_OPERAND (GIMPLE_STMT_OPERAND (user, 1), 0) == negate)
+ if (gimple_assign_rhs1 (user) == negate)
{
- tree temp = TREE_OPERAND (rhs, 0);
- TREE_OPERAND (rhs, 0) = TREE_OPERAND (rhs, 1);
- TREE_OPERAND (rhs, 1) = temp;
+ swap_tree_operands (user,
+ gimple_assign_rhs1_ptr (user),
+ gimple_assign_rhs2_ptr (user));
}
/* Now transform the PLUS_EXPR into a MINUS_EXPR and replace
the RHS of the PLUS_EXPR with the operand of the NEGATE_EXPR. */
- if (TREE_OPERAND (GIMPLE_STMT_OPERAND (user, 1), 1) == negate)
+ if (gimple_assign_rhs2 (user) == negate)
{
- TREE_SET_CODE (rhs, MINUS_EXPR);
- TREE_OPERAND (rhs, 1) = get_unary_op (negate, NEGATE_EXPR);
+ tree rhs1 = gimple_assign_rhs1 (user);
+ tree rhs2 = get_unary_op (negate, NEGATE_EXPR);
+ gimple_stmt_iterator gsi = gsi_for_stmt (user);
+ gimple_assign_set_rhs_with_ops (&gsi, MINUS_EXPR, rhs1, rhs2);
update_stmt (user);
}
}
@@ -1264,43 +1686,50 @@ repropagate_negates (void)
k = t - q
we want to break up k = t - q, but we won't until we've transformed q
- = b - r, which won't be broken up until we transform b = c - d. */
+ = b - r, which won't be broken up until we transform b = c - d.
+
+ En passant, clear the GIMPLE visited flag on every statement. */
static void
break_up_subtract_bb (basic_block bb)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
basic_block son;
- 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))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
+ gimple_set_visited (stmt, false);
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ /* Look for simple gimple subtract operations. */
+ if (is_gimple_assign (stmt)
+ && gimple_assign_rhs_code (stmt) == MINUS_EXPR)
{
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ tree lhs = gimple_assign_lhs (stmt);
+ tree rhs1 = gimple_assign_rhs1 (stmt);
+ tree rhs2 = gimple_assign_rhs2 (stmt);
- TREE_VISITED (stmt) = 0;
/* If associative-math we can do reassociation for
non-integral types. Or, we can do reassociation for
non-saturating fixed-point types. */
if ((!INTEGRAL_TYPE_P (TREE_TYPE (lhs))
- || !INTEGRAL_TYPE_P (TREE_TYPE (rhs)))
- && (!SCALAR_FLOAT_TYPE_P (TREE_TYPE (rhs))
- || !SCALAR_FLOAT_TYPE_P (TREE_TYPE(lhs))
+ || !INTEGRAL_TYPE_P (TREE_TYPE (rhs1))
+ || !INTEGRAL_TYPE_P (TREE_TYPE (rhs2)))
+ && (!SCALAR_FLOAT_TYPE_P (TREE_TYPE (lhs))
+ || !SCALAR_FLOAT_TYPE_P (TREE_TYPE(rhs1))
+ || !SCALAR_FLOAT_TYPE_P (TREE_TYPE(rhs2))
|| !flag_associative_math)
- && (!NON_SAT_FIXED_POINT_TYPE_P (TREE_TYPE (rhs))
- || !NON_SAT_FIXED_POINT_TYPE_P (TREE_TYPE(lhs))))
+ && (!NON_SAT_FIXED_POINT_TYPE_P (TREE_TYPE (lhs))
+ || !NON_SAT_FIXED_POINT_TYPE_P (TREE_TYPE(rhs1))
+ || !NON_SAT_FIXED_POINT_TYPE_P (TREE_TYPE(rhs2))))
continue;
/* Check for a subtract used only in an addition. If this
is the case, transform it into add of a negate for better
reassociation. IE transform C = A-B into C = A + -B if C
is only used in an addition. */
- if (TREE_CODE (rhs) == MINUS_EXPR)
- if (should_break_up_subtract (stmt))
- break_up_subtract (stmt, &bsi);
+ if (should_break_up_subtract (stmt))
+ break_up_subtract (stmt, &gsi);
}
}
for (son = first_dom_son (CDI_DOMINATORS, bb);
@@ -1315,36 +1744,69 @@ break_up_subtract_bb (basic_block bb)
static void
reassociate_bb (basic_block bb)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
basic_block son;
- for (bsi = bsi_last (bb); !bsi_end_p (bsi); bsi_prev (&bsi))
+ for (gsi = gsi_last_bb (bb); !gsi_end_p (gsi); gsi_prev (&gsi))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_assign (stmt))
{
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ tree lhs, rhs1, rhs2;
+ enum tree_code rhs_code = gimple_assign_rhs_code (stmt);
- /* If this was part of an already processed tree, we don't
- need to touch it again. */
- if (TREE_VISITED (stmt))
+ /* If this is not a gimple binary expression, there is
+ nothing for us to do with it. */
+ if (get_gimple_rhs_class (rhs_code) != GIMPLE_BINARY_RHS)
continue;
+ /* If this was part of an already processed statement,
+ we don't need to touch it again. */
+ if (gimple_visited_p (stmt))
+ {
+ /* 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);
+ rhs2 = gimple_assign_rhs2 (stmt);
+
/* If associative-math we can do reassociation for
non-integral types. Or, we can do reassociation for
non-saturating fixed-point types. */
if ((!INTEGRAL_TYPE_P (TREE_TYPE (lhs))
- || !INTEGRAL_TYPE_P (TREE_TYPE (rhs)))
- && (!SCALAR_FLOAT_TYPE_P (TREE_TYPE (rhs))
- || !SCALAR_FLOAT_TYPE_P (TREE_TYPE(lhs))
+ || !INTEGRAL_TYPE_P (TREE_TYPE (rhs1))
+ || !INTEGRAL_TYPE_P (TREE_TYPE (rhs2)))
+ && (!SCALAR_FLOAT_TYPE_P (TREE_TYPE (lhs))
+ || !SCALAR_FLOAT_TYPE_P (TREE_TYPE(rhs1))
+ || !SCALAR_FLOAT_TYPE_P (TREE_TYPE(rhs2))
|| !flag_associative_math)
- && (!NON_SAT_FIXED_POINT_TYPE_P (TREE_TYPE (rhs))
- || !NON_SAT_FIXED_POINT_TYPE_P (TREE_TYPE(lhs))))
+ && (!NON_SAT_FIXED_POINT_TYPE_P (TREE_TYPE (lhs))
+ || !NON_SAT_FIXED_POINT_TYPE_P (TREE_TYPE(rhs1))
+ || !NON_SAT_FIXED_POINT_TYPE_P (TREE_TYPE(rhs2))))
continue;
- if (associative_tree_code (TREE_CODE (rhs)))
+ if (associative_tree_code (rhs_code))
{
VEC(operand_entry_t, heap) *ops = NULL;
@@ -1353,30 +1815,40 @@ reassociate_bb (basic_block bb)
if (TREE_CODE (lhs) == SSA_NAME && has_zero_uses (lhs))
continue;
- TREE_VISITED (stmt) = 1;
- linearize_expr_tree (&ops, stmt);
+ gimple_set_visited (stmt, true);
+ 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 (TREE_CODE (rhs), &ops);
+ 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)
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Transforming ");
- print_generic_expr (dump_file, rhs, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
}
- GIMPLE_STMT_OPERAND (stmt, 1)
- = VEC_last (operand_entry_t, ops)->op;
+
+ gimple_assign_set_rhs_from_tree (&gsi,
+ VEC_last (operand_entry_t,
+ ops)->op);
update_stmt (stmt);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " into ");
- print_generic_stmt (dump_file,
- GIMPLE_STMT_OPERAND (stmt, 1), 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
}
}
else
@@ -1408,7 +1880,7 @@ dump_ops_vector (FILE *file, VEC (operand_entry_t, heap) *ops)
for (i = 0; VEC_iterate (operand_entry_t, ops, i, oe); i++)
{
fprintf (file, "Op %d -> rank: %d, tree: ", i, oe->rank);
- print_generic_stmt (file, oe->op, 0);
+ print_generic_expr (file, oe->op, 0);
}
}
@@ -1542,3 +2014,4 @@ struct gimple_opt_pass pass_reassoc =
TODO_dump_func | TODO_ggc_collect | TODO_verify_ssa /* todo_flags_finish */
}
};
+
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 48b5297b4d8..0b995d6837d 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -29,7 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic.h"
#include "tree-inline.h"
#include "tree-flow.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-dump.h"
#include "timevar.h"
#include "fibheap.h"
@@ -210,6 +210,86 @@ VN_INFO_GET (tree name)
}
+/* Get the representative expression for the SSA_NAME NAME. Returns
+ the representative SSA_NAME if there is no expression associated with it. */
+
+tree
+vn_get_expr_for (tree name)
+{
+ vn_ssa_aux_t vn = VN_INFO (name);
+ gimple def_stmt;
+ tree expr = NULL_TREE;
+
+ if (vn->valnum == VN_TOP)
+ return name;
+
+ /* If the value-number is a constant it is the representative
+ expression. */
+ if (TREE_CODE (vn->valnum) != SSA_NAME)
+ return vn->valnum;
+
+ /* Get to the information of the value of this SSA_NAME. */
+ vn = VN_INFO (vn->valnum);
+
+ /* If the value-number is a constant it is the representative
+ expression. */
+ if (TREE_CODE (vn->valnum) != SSA_NAME)
+ return vn->valnum;
+
+ /* Else if we have an expression, return it. */
+ if (vn->expr != NULL_TREE)
+ return vn->expr;
+
+ /* Otherwise use the defining statement to build the expression. */
+ def_stmt = SSA_NAME_DEF_STMT (vn->valnum);
+
+ /* If the value number is a default-definition or a PHI result
+ use it directly. */
+ if (gimple_nop_p (def_stmt)
+ || gimple_code (def_stmt) == GIMPLE_PHI)
+ return vn->valnum;
+
+ if (!is_gimple_assign (def_stmt))
+ return vn->valnum;
+
+ /* FIXME tuples. This is incomplete and likely will miss some
+ simplifications. */
+ switch (TREE_CODE_CLASS (gimple_assign_rhs_code (def_stmt)))
+ {
+ case tcc_reference:
+ if (gimple_assign_rhs_code (def_stmt) == VIEW_CONVERT_EXPR
+ && gimple_assign_rhs_code (def_stmt) == REALPART_EXPR
+ && gimple_assign_rhs_code (def_stmt) == IMAGPART_EXPR)
+ expr = fold_build1 (gimple_assign_rhs_code (def_stmt),
+ gimple_expr_type (def_stmt),
+ TREE_OPERAND (gimple_assign_rhs1 (def_stmt), 0));
+ break;
+
+ case tcc_unary:
+ expr = fold_build1 (gimple_assign_rhs_code (def_stmt),
+ gimple_expr_type (def_stmt),
+ gimple_assign_rhs1 (def_stmt));
+ break;
+
+ case tcc_binary:
+ expr = fold_build2 (gimple_assign_rhs_code (def_stmt),
+ gimple_expr_type (def_stmt),
+ gimple_assign_rhs1 (def_stmt),
+ gimple_assign_rhs2 (def_stmt));
+ break;
+
+ default:;
+ }
+ if (expr == NULL_TREE)
+ return vn->valnum;
+
+ /* Cache the expression. */
+ vn->expr = expr;
+
+ return expr;
+}
+
+
/* Free a phi operation structure VP. */
static void
@@ -236,7 +316,7 @@ vn_constant_eq (const void *p1, const void *p2)
const struct vn_constant_s *vc1 = (const struct vn_constant_s *) p1;
const struct vn_constant_s *vc2 = (const struct vn_constant_s *) p2;
- return expressions_equal_p (vc1->constant, vc2->constant);
+ return vn_constant_eq_with_type (vc1->constant, vc2->constant);
}
/* Hash table hash function for vn_constant_t. */
@@ -256,8 +336,8 @@ get_constant_value_id (tree constant)
{
void **slot;
struct vn_constant_s vc;
-
- vc.hashcode = iterative_hash_expr (constant, 0);
+
+ vc.hashcode = vn_hash_constant_with_type (constant);
vc.constant = constant;
slot = htab_find_slot_with_hash (constant_to_value_id, &vc,
vc.hashcode, NO_INSERT);
@@ -275,7 +355,7 @@ get_or_alloc_constant_value_id (tree constant)
void **slot;
vn_constant_t vc = XNEW (struct vn_constant_s);
- vc->hashcode = iterative_hash_expr (constant, 0);
+ vc->hashcode = vn_hash_constant_with_type (constant);
vc->constant = constant;
slot = htab_find_slot_with_hash (constant_to_value_id, vc,
vc->hashcode, INSERT);
@@ -319,7 +399,8 @@ static hashval_t
vn_reference_op_compute_hash (const vn_reference_op_t vro1)
{
return iterative_hash_expr (vro1->op0, vro1->opcode)
- + iterative_hash_expr (vro1->op1, vro1->opcode);
+ + iterative_hash_expr (vro1->op1, vro1->opcode)
+ + iterative_hash_expr (vro1->op2, vro1->opcode);
}
/* Return the hashcode for a given reference operation P1. */
@@ -398,7 +479,7 @@ vn_reference_eq (const void *p1, const void *p2)
/* Place the vuses from STMT into *result. */
static inline void
-vuses_to_vec (tree stmt, VEC (tree, gc) **result)
+vuses_to_vec (gimple stmt, VEC (tree, gc) **result)
{
ssa_op_iter iter;
tree vuse;
@@ -418,7 +499,7 @@ vuses_to_vec (tree stmt, VEC (tree, gc) **result)
the vector. */
VEC (tree, gc) *
-copy_vuses_from_stmt (tree stmt)
+copy_vuses_from_stmt (gimple stmt)
{
VEC (tree, gc) *vuses = NULL;
@@ -430,7 +511,7 @@ copy_vuses_from_stmt (tree stmt)
/* Place the vdefs from STMT into *result. */
static inline void
-vdefs_to_vec (tree stmt, VEC (tree, gc) **result)
+vdefs_to_vec (gimple stmt, VEC (tree, gc) **result)
{
ssa_op_iter iter;
tree vdef;
@@ -448,7 +529,7 @@ vdefs_to_vec (tree stmt, VEC (tree, gc) **result)
the vector. */
static VEC (tree, gc) *
-copy_vdefs_from_stmt (tree stmt)
+copy_vdefs_from_stmt (gimple stmt)
{
VEC (tree, gc) *vdefs = NULL;
@@ -465,7 +546,7 @@ static VEC (tree, gc) *shared_lookup_vops;
variable. */
VEC (tree, gc) *
-shared_vuses_from_stmt (tree stmt)
+shared_vuses_from_stmt (gimple stmt)
{
VEC_truncate (tree, shared_lookup_vops, 0);
vuses_to_vec (stmt, &shared_lookup_vops);
@@ -473,54 +554,12 @@ shared_vuses_from_stmt (tree stmt)
return shared_lookup_vops;
}
-/* Copy the operations present in load/store/call REF into RESULT, a vector of
+/* Copy the operations present in load/store REF into RESULT, a vector of
vn_reference_op_s's. */
-static void
+void
copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
{
- /* Calls are different from all other reference operations. */
- if (TREE_CODE (ref) == CALL_EXPR)
- {
- vn_reference_op_s temp;
- tree callfn;
- call_expr_arg_iterator iter;
- tree callarg;
-
- /* Copy the call_expr opcode, type, function being called, and
- arguments. */
- memset (&temp, 0, sizeof (temp));
- temp.type = TREE_TYPE (ref);
- temp.opcode = CALL_EXPR;
- VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
-
- /* We make no attempt to simplify the called function because
- the typical &FUNCTION_DECL form is also used in function pointer
- cases that become constant. If we simplify the original to
- FUNCTION_DECL but not the function pointer case (which can
- happen because we have no fold functions that operate on
- vn_reference_t), we will claim they are not equivalent.
-
- An example of this behavior can be see if CALL_EXPR_FN below is
- replaced with get_callee_fndecl and gcc.dg/tree-ssa/ssa-pre-13.c
- is compiled. */
- callfn = CALL_EXPR_FN (ref);
- temp.type = TREE_TYPE (callfn);
- temp.opcode = TREE_CODE (callfn);
- temp.op0 = callfn;
- VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
-
- FOR_EACH_CALL_EXPR_ARG (callarg, iter, ref)
- {
- memset (&temp, 0, sizeof (temp));
- temp.type = TREE_TYPE (callarg);
- temp.opcode = TREE_CODE (callarg);
- temp.op0 = callarg;
- VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
- }
- return;
- }
-
if (TREE_CODE (ref) == TARGET_MEM_REF)
{
vn_reference_op_s temp;
@@ -556,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);
@@ -607,6 +648,13 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
case SSA_NAME:
temp.op0 = ref;
break;
+ case ADDR_EXPR:
+ if (is_gimple_min_invariant (ref))
+ {
+ temp.op0 = ref;
+ break;
+ }
+ /* Fallthrough. */
/* These are only interesting for their operands, their
existence, and their type. They will never be the last
ref in the chain of references (IE they require an
@@ -615,21 +663,134 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
case IMAGPART_EXPR:
case REALPART_EXPR:
case VIEW_CONVERT_EXPR:
- case ADDR_EXPR:
break;
default:
gcc_unreachable ();
-
}
VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
- if (REFERENCE_CLASS_P (ref) || TREE_CODE (ref) == ADDR_EXPR)
+ if (REFERENCE_CLASS_P (ref)
+ || (TREE_CODE (ref) == ADDR_EXPR
+ && !is_gimple_min_invariant (ref)))
ref = TREE_OPERAND (ref, 0);
else
ref = NULL_TREE;
}
}
+/* 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. */
+
+void
+copy_reference_ops_from_call (gimple call,
+ VEC(vn_reference_op_s, heap) **result)
+{
+ vn_reference_op_s temp;
+ unsigned i;
+
+ /* 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,
+ just chain them together. */
+ for (i = 0; i < gimple_call_num_args (call); ++i)
+ {
+ tree callarg = gimple_call_arg (call, i);
+ copy_reference_ops_from_ref (callarg, result);
+ }
+}
+
/* Create a vector of vn_reference_op_s structures from REF, a
REFERENCE_CLASS_P tree. The vector is not shared. */
@@ -642,6 +803,18 @@ create_reference_ops_from_ref (tree ref)
return result;
}
+/* Create a vector of vn_reference_op_s structures from CALL, a
+ call statement. The vector is not shared. */
+
+static VEC(vn_reference_op_s, heap) *
+create_reference_ops_from_call (gimple call)
+{
+ VEC (vn_reference_op_s, heap) *result = NULL;
+
+ copy_reference_ops_from_call (call, &result);
+ return result;
+}
+
static VEC(vn_reference_op_s, heap) *shared_lookup_references;
/* Create a vector of vn_reference_op_s structures from REF, a
@@ -658,6 +831,20 @@ shared_reference_ops_from_ref (tree ref)
return shared_lookup_references;
}
+/* Create a vector of vn_reference_op_s structures from CALL, a
+ call statement. The vector is shared among all callers of
+ this function. */
+
+static VEC(vn_reference_op_s, heap) *
+shared_reference_ops_from_call (gimple call)
+{
+ if (!call)
+ return NULL;
+ VEC_truncate (vn_reference_op_s, shared_lookup_references, 0);
+ copy_reference_ops_from_call (call, &shared_lookup_references);
+ return shared_lookup_references;
+}
+
/* Transform any SSA_NAME's in a vector of vn_reference_op_s
structures into their value numbers. This is done in-place, and
@@ -719,16 +906,17 @@ valueize_vuses (VEC (tree, gc) *orig)
Take into account only definitions that alias REF if following
back-edges. */
-static tree
+static gimple
get_def_ref_stmt_vuses (tree ref, VEC (tree, gc) *vuses)
{
- tree def_stmt, vuse;
+ gimple def_stmt;
+ tree vuse;
unsigned int i;
gcc_assert (VEC_length (tree, vuses) >= 1);
def_stmt = SSA_NAME_DEF_STMT (VEC_index (tree, vuses, 0));
- if (TREE_CODE (def_stmt) == PHI_NODE)
+ if (gimple_code (def_stmt) == GIMPLE_PHI)
{
/* We can only handle lookups over PHI nodes for a single
virtual operand. */
@@ -738,23 +926,22 @@ get_def_ref_stmt_vuses (tree ref, VEC (tree, gc) *vuses)
goto cont;
}
else
- return NULL_TREE;
+ return NULL;
}
/* Verify each VUSE reaches the same defining stmt. */
for (i = 1; VEC_iterate (tree, vuses, i, vuse); ++i)
{
- tree tmp = SSA_NAME_DEF_STMT (vuse);
+ gimple tmp = SSA_NAME_DEF_STMT (vuse);
if (tmp != def_stmt)
- return NULL_TREE;
+ return NULL;
}
/* Now see if the definition aliases ref, and loop until it does. */
cont:
while (def_stmt
- && TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT
- && !get_call_expr_in (def_stmt)
- && !refs_may_alias_p (ref, GIMPLE_STMT_OPERAND (def_stmt, 0)))
+ && is_gimple_assign (def_stmt)
+ && !refs_may_alias_p (ref, gimple_get_lhs (def_stmt)))
def_stmt = get_single_def_stmt_with_phi (ref, def_stmt);
return def_stmt;
@@ -796,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;
@@ -808,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;
}
@@ -822,7 +1031,8 @@ vn_reference_lookup (tree op, VEC (tree, gc) *vuses, bool maywalk,
vn_reference_t *vnresult)
{
struct vn_reference_s vr1;
- tree result, def_stmt;
+ tree result;
+ gimple def_stmt;
if (vnresult)
*vnresult = NULL;
@@ -837,12 +1047,8 @@ vn_reference_lookup (tree op, VEC (tree, gc) *vuses, bool maywalk,
&& maywalk
&& vr1.vuses
&& VEC_length (tree, vr1.vuses) >= 1
- && !get_call_expr_in (op)
&& (def_stmt = get_def_ref_stmt_vuses (op, vr1.vuses))
- && TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT
- /* If there is a call involved, op must be assumed to
- be clobbered. */
- && !get_call_expr_in (def_stmt))
+ && 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. */
@@ -1055,6 +1261,38 @@ vn_nary_op_lookup (tree op, vn_nary_op_t *vnresult)
return ((vn_nary_op_t)*slot)->result;
}
+/* Lookup the rhs of STMT in the current hash table, and return the resulting
+ value number if it exists in the hash table. Return NULL_TREE if
+ it does not exist in the hash table. VNRESULT will contain the
+ vn_nary_op_t from the hashtable if it exists. */
+
+tree
+vn_nary_op_lookup_stmt (gimple stmt, vn_nary_op_t *vnresult)
+{
+ void **slot;
+ struct vn_nary_op_s vno1;
+ unsigned i;
+
+ if (vnresult)
+ *vnresult = NULL;
+ vno1.opcode = gimple_assign_rhs_code (stmt);
+ vno1.length = gimple_num_ops (stmt) - 1;
+ vno1.type = TREE_TYPE (gimple_assign_lhs (stmt));
+ for (i = 0; i < vno1.length; ++i)
+ vno1.op[i] = gimple_op (stmt, i + 1);
+ vno1.hashcode = vn_nary_op_compute_hash (&vno1);
+ slot = htab_find_slot_with_hash (current_info->nary, &vno1, vno1.hashcode,
+ NO_INSERT);
+ if (!slot && current_info == optimistic_info)
+ slot = htab_find_slot_with_hash (valid_info->nary, &vno1, vno1.hashcode,
+ NO_INSERT);
+ if (!slot)
+ return NULL_TREE;
+ if (vnresult)
+ *vnresult = (vn_nary_op_t)*slot;
+ return ((vn_nary_op_t)*slot)->result;
+}
+
/* Insert a n-ary operation into the current hash table using it's
pieces. Return the vn_nary_op_t structure we created and put in
the hashtable. */
@@ -1126,6 +1364,36 @@ vn_nary_op_insert (tree op, tree result)
return vno1;
}
+/* Insert the rhs of STMT into the current hash table with a value number of
+ RESULT. */
+
+vn_nary_op_t
+vn_nary_op_insert_stmt (gimple stmt, tree result)
+{
+ unsigned length = gimple_num_ops (stmt) - 1;
+ void **slot;
+ vn_nary_op_t vno1;
+ unsigned i;
+
+ vno1 = (vn_nary_op_t) obstack_alloc (&current_info->nary_obstack,
+ (sizeof (struct vn_nary_op_s)
+ - sizeof (tree) * (4 - length)));
+ vno1->value_id = VN_INFO (result)->value_id;
+ vno1->opcode = gimple_assign_rhs_code (stmt);
+ vno1->length = length;
+ vno1->type = TREE_TYPE (gimple_assign_lhs (stmt));
+ for (i = 0; i < vno1->length; ++i)
+ vno1->op[i] = gimple_op (stmt, i + 1);
+ vno1->result = result;
+ vno1->hashcode = vn_nary_op_compute_hash (vno1);
+ slot = htab_find_slot_with_hash (current_info->nary, vno1, vno1->hashcode,
+ INSERT);
+ gcc_assert (!*slot);
+
+ *slot = vno1;
+ return vno1;
+}
+
/* Compute a hashcode for PHI operation VP1 and return it. */
static inline hashval_t
@@ -1190,24 +1458,24 @@ 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
-vn_phi_lookup (tree phi)
+tree
+vn_phi_lookup (gimple phi)
{
void **slot;
struct vn_phi_s vp1;
- int i;
+ unsigned i;
VEC_truncate (tree, shared_lookup_phiargs, 0);
/* Canonicalize the SSA_NAME's to their value number. */
- for (i = 0; i < PHI_NUM_ARGS (phi); i++)
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
{
tree def = PHI_ARG_DEF (phi, i);
def = TREE_CODE (def) == SSA_NAME ? SSA_VAL (def) : def;
VEC_safe_push (tree, heap, shared_lookup_phiargs, def);
}
vp1.phiargs = shared_lookup_phiargs;
- vp1.block = bb_for_stmt (phi);
+ vp1.block = gimple_bb (phi);
vp1.hashcode = vn_phi_compute_hash (&vp1);
slot = htab_find_slot_with_hash (current_info->phis, &vp1, vp1.hashcode,
NO_INSERT);
@@ -1223,15 +1491,15 @@ vn_phi_lookup (tree phi)
RESULT. */
static vn_phi_t
-vn_phi_insert (tree phi, tree result)
+vn_phi_insert (gimple phi, tree result)
{
void **slot;
vn_phi_t vp1 = (vn_phi_t) pool_alloc (current_info->phis_pool);
- int i;
+ unsigned i;
VEC (tree, heap) *args = NULL;
/* Canonicalize the SSA_NAME's to their value number. */
- for (i = 0; i < PHI_NUM_ARGS (phi); i++)
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
{
tree def = PHI_ARG_DEF (phi, i);
def = TREE_CODE (def) == SSA_NAME ? SSA_VAL (def) : def;
@@ -1239,7 +1507,7 @@ vn_phi_insert (tree phi, tree result)
}
vp1->value_id = VN_INFO (result)->value_id;
vp1->phiargs = args;
- vp1->block = bb_for_stmt (phi);
+ vp1->block = gimple_bb (phi);
vp1->result = result;
vp1->hashcode = vn_phi_compute_hash (vp1);
@@ -1313,7 +1581,7 @@ set_ssa_val_to (tree from, tree to)
Return true if a value number changed. */
static bool
-defs_to_varying (tree stmt)
+defs_to_varying (gimple stmt)
{
bool changed = false;
ssa_op_iter iter;
@@ -1330,7 +1598,7 @@ defs_to_varying (tree stmt)
}
static bool expr_has_constants (tree expr);
-static tree try_to_simplify (tree stmt, tree rhs);
+static tree try_to_simplify (gimple stmt);
/* Visit a copy between LHS and RHS, return true if the value number
changed. */
@@ -1338,7 +1606,6 @@ static tree try_to_simplify (tree stmt, tree rhs);
static bool
visit_copy (tree lhs, tree rhs)
{
-
/* Follow chains of copies to their destination. */
while (SSA_VAL (rhs) != rhs && TREE_CODE (SSA_VAL (rhs)) == SSA_NAME)
rhs = SSA_VAL (rhs);
@@ -1355,10 +1622,10 @@ visit_copy (tree lhs, tree rhs)
value number of LHS has changed as a result. */
static bool
-visit_unary_op (tree lhs, tree op)
+visit_unary_op (tree lhs, gimple stmt)
{
bool changed = false;
- tree result = vn_nary_op_lookup (op, NULL);
+ tree result = vn_nary_op_lookup_stmt (stmt, NULL);
if (result)
{
@@ -1367,7 +1634,7 @@ visit_unary_op (tree lhs, tree op)
else
{
changed = set_ssa_val_to (lhs, lhs);
- vn_nary_op_insert (op, lhs);
+ vn_nary_op_insert_stmt (stmt, lhs);
}
return changed;
@@ -1377,19 +1644,60 @@ visit_unary_op (tree lhs, tree op)
value number of LHS has changed as a result. */
static bool
-visit_binary_op (tree lhs, tree op)
+visit_binary_op (tree lhs, gimple stmt)
+{
+ bool changed = false;
+ tree result = vn_nary_op_lookup_stmt (stmt, NULL);
+
+ if (result)
+ {
+ changed = set_ssa_val_to (lhs, result);
+ }
+ else
+ {
+ changed = set_ssa_val_to (lhs, lhs);
+ vn_nary_op_insert_stmt (stmt, lhs);
+ }
+
+ return changed;
+}
+
+/* Visit a call STMT storing into LHS. Return true if the value number
+ of the LHS has changed as a result. */
+
+static bool
+visit_reference_op_call (tree lhs, gimple stmt)
{
bool changed = false;
- tree result = vn_nary_op_lookup (op, NULL);
+ struct vn_reference_s vr1;
+ tree result;
+ vr1.vuses = valueize_vuses (shared_vuses_from_stmt (stmt));
+ vr1.operands = valueize_refs (shared_reference_ops_from_call (stmt));
+ vr1.hashcode = vn_reference_compute_hash (&vr1);
+ result = vn_reference_lookup_1 (&vr1, NULL);
if (result)
{
changed = set_ssa_val_to (lhs, result);
+ if (TREE_CODE (result) == SSA_NAME
+ && VN_INFO (result)->has_constants)
+ VN_INFO (lhs)->has_constants = true;
}
else
{
+ void **slot;
+ vn_reference_t vr2;
changed = set_ssa_val_to (lhs, lhs);
- vn_nary_op_insert (op, lhs);
+ vr2 = (vn_reference_t) pool_alloc (current_info->references_pool);
+ vr2->vuses = valueize_vuses (copy_vuses_from_stmt (stmt));
+ vr2->operands = valueize_refs (create_reference_ops_from_call (stmt));
+ vr2->hashcode = vr1.hashcode;
+ vr2->result = lhs;
+ slot = htab_find_slot_with_hash (current_info->references,
+ vr2, vr2->hashcode, INSERT);
+ if (*slot)
+ free_reference (*slot);
+ *slot = vr2;
}
return changed;
@@ -1399,7 +1707,7 @@ visit_binary_op (tree lhs, tree op)
and return true if the value number of the LHS has changed as a result. */
static bool
-visit_reference_op_load (tree lhs, tree op, tree stmt)
+visit_reference_op_load (tree lhs, tree op, gimple stmt)
{
bool changed = false;
tree result = vn_reference_lookup (op, shared_vuses_from_stmt (stmt), true,
@@ -1420,7 +1728,7 @@ visit_reference_op_load (tree lhs, tree op, tree stmt)
&& !is_gimple_min_invariant (val)
&& TREE_CODE (val) != SSA_NAME)
{
- tree tem = try_to_simplify (stmt, val);
+ tree tem = try_to_simplify (stmt);
if (tem)
val = tem;
}
@@ -1432,9 +1740,10 @@ visit_reference_op_load (tree lhs, tree op, tree stmt)
a new SSA_NAME we create. */
if (!result && may_insert)
{
- result = make_ssa_name (SSA_NAME_VAR (lhs), NULL_TREE);
+ result = make_ssa_name (SSA_NAME_VAR (lhs), NULL);
/* Initialize value-number information properly. */
VN_INFO_GET (result)->valnum = result;
+ VN_INFO (result)->value_id = get_next_value_id ();
VN_INFO (result)->expr = val;
VN_INFO (result)->has_constants = expr_has_constants (val);
VN_INFO (result)->needs_insertion = true;
@@ -1488,7 +1797,7 @@ visit_reference_op_load (tree lhs, tree op, tree stmt)
and return true if the value number of the LHS has changed as a result. */
static bool
-visit_reference_op_store (tree lhs, tree op, tree stmt)
+visit_reference_op_store (tree lhs, tree op, gimple stmt)
{
bool changed = false;
tree result;
@@ -1587,13 +1896,13 @@ visit_reference_op_store (tree lhs, tree op, tree stmt)
changed. */
static bool
-visit_phi (tree phi)
+visit_phi (gimple phi)
{
bool changed = false;
tree result;
tree sameval = VN_TOP;
bool allsame = true;
- int i;
+ unsigned i;
/* TODO: We could check for this in init_sccvn, and replace this
with a gcc_assert. */
@@ -1602,7 +1911,7 @@ visit_phi (tree phi)
/* See if all non-TOP arguments have the same value. TOP is
equivalent to everything, so we can ignore it. */
- for (i = 0; i < PHI_NUM_ARGS (phi); i++)
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
{
tree def = PHI_ARG_DEF (phi, i);
@@ -1689,6 +1998,32 @@ expr_has_constants (tree expr)
return false;
}
+/* Return true if STMT contains constants. */
+
+static bool
+stmt_has_constants (gimple stmt)
+{
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
+ return false;
+
+ switch (get_gimple_rhs_class (gimple_assign_rhs_code (stmt)))
+ {
+ case GIMPLE_UNARY_RHS:
+ return is_gimple_min_invariant (gimple_assign_rhs1 (stmt));
+
+ case GIMPLE_BINARY_RHS:
+ return (is_gimple_min_invariant (gimple_assign_rhs1 (stmt))
+ || is_gimple_min_invariant (gimple_assign_rhs2 (stmt)));
+ case GIMPLE_SINGLE_RHS:
+ /* Constants inside reference ops are rarely interesting, but
+ it can take a lot of looking to find them. */
+ return is_gimple_min_invariant (gimple_assign_rhs1 (stmt));
+ default:
+ gcc_unreachable ();
+ }
+ return false;
+}
+
/* Replace SSA_NAMES in expr with their value numbers, and return the
result.
This is performed in place. */
@@ -1721,11 +2056,11 @@ valueize_expr (tree expr)
simplified. */
static tree
-simplify_binary_expression (tree stmt, tree rhs)
+simplify_binary_expression (gimple stmt)
{
tree result = NULL_TREE;
- tree op0 = TREE_OPERAND (rhs, 0);
- tree op1 = TREE_OPERAND (rhs, 1);
+ tree op0 = gimple_assign_rhs1 (stmt);
+ tree op1 = gimple_assign_rhs2 (stmt);
/* This will not catch every single case we could combine, but will
catch those with constants. The goal here is to simultaneously
@@ -1733,8 +2068,9 @@ simplify_binary_expression (tree stmt, tree rhs)
expansion of expressions during simplification. */
if (TREE_CODE (op0) == SSA_NAME)
{
- if (VN_INFO (op0)->has_constants)
- op0 = valueize_expr (VN_INFO (op0)->expr);
+ if (VN_INFO (op0)->has_constants
+ || TREE_CODE_CLASS (gimple_assign_rhs_code (stmt)) == tcc_comparison)
+ op0 = valueize_expr (vn_get_expr_for (op0));
else if (SSA_VAL (op0) != VN_TOP && SSA_VAL (op0) != op0)
op0 = SSA_VAL (op0);
}
@@ -1742,28 +2078,29 @@ simplify_binary_expression (tree stmt, tree rhs)
if (TREE_CODE (op1) == SSA_NAME)
{
if (VN_INFO (op1)->has_constants)
- op1 = valueize_expr (VN_INFO (op1)->expr);
+ op1 = valueize_expr (vn_get_expr_for (op1));
else if (SSA_VAL (op1) != VN_TOP && SSA_VAL (op1) != op1)
op1 = SSA_VAL (op1);
}
/* Avoid folding if nothing changed. */
- if (op0 == TREE_OPERAND (rhs, 0)
- && op1 == TREE_OPERAND (rhs, 1))
+ if (op0 == gimple_assign_rhs1 (stmt)
+ && op1 == gimple_assign_rhs2 (stmt))
return NULL_TREE;
fold_defer_overflow_warnings ();
- result = fold_binary (TREE_CODE (rhs), TREE_TYPE (rhs), op0, op1);
+ result = fold_binary (gimple_assign_rhs_code (stmt),
+ TREE_TYPE (gimple_get_lhs (stmt)), op0, op1);
- fold_undefer_overflow_warnings (result && valid_gimple_expression_p (result),
+ fold_undefer_overflow_warnings (result && valid_gimple_rhs_p (result),
stmt, 0);
/* Make sure result is not a complex expression consisting
of operators of operators (IE (a + b) + (a + c))
Otherwise, we will end up with unbounded expressions if
fold does anything at all. */
- if (result && valid_gimple_expression_p (result))
+ if (result && valid_gimple_rhs_p (result))
return result;
return NULL_TREE;
@@ -1773,24 +2110,32 @@ simplify_binary_expression (tree stmt, tree rhs)
simplified. */
static tree
-simplify_unary_expression (tree rhs)
+simplify_unary_expression (gimple stmt)
{
tree result = NULL_TREE;
- tree op0 = TREE_OPERAND (rhs, 0);
+ tree orig_op0, op0 = gimple_assign_rhs1 (stmt);
+
+ /* We handle some tcc_reference codes here that are all
+ GIMPLE_ASSIGN_SINGLE codes. */
+ if (gimple_assign_rhs_code (stmt) == REALPART_EXPR
+ || gimple_assign_rhs_code (stmt) == IMAGPART_EXPR
+ || gimple_assign_rhs_code (stmt) == VIEW_CONVERT_EXPR)
+ op0 = TREE_OPERAND (op0, 0);
if (TREE_CODE (op0) != SSA_NAME)
return NULL_TREE;
+ orig_op0 = op0;
if (VN_INFO (op0)->has_constants)
- op0 = valueize_expr (VN_INFO (op0)->expr);
- else if (CONVERT_EXPR_P (rhs)
- || TREE_CODE (rhs) == REALPART_EXPR
- || TREE_CODE (rhs) == IMAGPART_EXPR
- || TREE_CODE (rhs) == VIEW_CONVERT_EXPR)
+ op0 = valueize_expr (vn_get_expr_for (op0));
+ else if (gimple_assign_cast_p (stmt)
+ || gimple_assign_rhs_code (stmt) == REALPART_EXPR
+ || gimple_assign_rhs_code (stmt) == IMAGPART_EXPR
+ || gimple_assign_rhs_code (stmt) == VIEW_CONVERT_EXPR)
{
/* We want to do tree-combining on conversion-like expressions.
Make sure we feed only SSA_NAMEs or constants to fold though. */
- tree tem = valueize_expr (VN_INFO (op0)->expr);
+ tree tem = valueize_expr (vn_get_expr_for (op0));
if (UNARY_CLASS_P (tem)
|| BINARY_CLASS_P (tem)
|| TREE_CODE (tem) == VIEW_CONVERT_EXPR
@@ -1800,36 +2145,38 @@ simplify_unary_expression (tree rhs)
}
/* Avoid folding if nothing changed, but remember the expression. */
- if (op0 == TREE_OPERAND (rhs, 0))
- return rhs;
+ if (op0 == orig_op0)
+ return NULL_TREE;
- result = fold_unary (TREE_CODE (rhs), TREE_TYPE (rhs), op0);
+ result = fold_unary (gimple_assign_rhs_code (stmt),
+ gimple_expr_type (stmt), op0);
if (result)
{
STRIP_USELESS_TYPE_CONVERSION (result);
- if (valid_gimple_expression_p (result))
+ if (valid_gimple_rhs_p (result))
return result;
}
- return rhs;
+ return NULL_TREE;
}
/* Try to simplify RHS using equivalences and constant folding. */
static tree
-try_to_simplify (tree stmt, tree rhs)
+try_to_simplify (gimple stmt)
{
tree tem;
/* For stores we can end up simplifying a SSA_NAME rhs. Just return
in this case, there is no point in doing extra work. */
- if (TREE_CODE (rhs) == SSA_NAME)
- return rhs;
+ if (gimple_assign_copy_p (stmt)
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME)
+ return NULL_TREE;
- switch (TREE_CODE_CLASS (TREE_CODE (rhs)))
+ switch (TREE_CODE_CLASS (gimple_assign_rhs_code (stmt)))
{
case tcc_declaration:
- tem = get_symbol_constant_value (rhs);
+ tem = get_symbol_constant_value (gimple_assign_rhs1 (stmt));
if (tem)
return tem;
break;
@@ -1837,29 +2184,29 @@ try_to_simplify (tree stmt, tree rhs)
case tcc_reference:
/* Do not do full-blown reference lookup here, but simplify
reads from constant aggregates. */
- tem = fold_const_aggregate_ref (rhs);
+ tem = fold_const_aggregate_ref (gimple_assign_rhs1 (stmt));
if (tem)
return tem;
/* Fallthrough for some codes that can operate on registers. */
- if (!(TREE_CODE (rhs) == REALPART_EXPR
- || TREE_CODE (rhs) == IMAGPART_EXPR
- || TREE_CODE (rhs) == VIEW_CONVERT_EXPR))
+ if (!(TREE_CODE (gimple_assign_rhs1 (stmt)) == REALPART_EXPR
+ || TREE_CODE (gimple_assign_rhs1 (stmt)) == IMAGPART_EXPR
+ || TREE_CODE (gimple_assign_rhs1 (stmt)) == VIEW_CONVERT_EXPR))
break;
/* We could do a little more with unary ops, if they expand
into binary ops, but it's debatable whether it is worth it. */
case tcc_unary:
- return simplify_unary_expression (rhs);
+ return simplify_unary_expression (stmt);
break;
case tcc_comparison:
case tcc_binary:
- return simplify_binary_expression (stmt, rhs);
+ return simplify_binary_expression (stmt);
break;
default:
break;
}
- return rhs;
+ return NULL_TREE;
}
/* Visit and value number USE, return true if the value number
@@ -1869,67 +2216,52 @@ static bool
visit_use (tree use)
{
bool changed = false;
- tree stmt = SSA_NAME_DEF_STMT (use);
- stmt_ann_t ann;
+ gimple stmt = SSA_NAME_DEF_STMT (use);
VN_INFO (use)->use_processed = true;
gcc_assert (!SSA_NAME_IN_FREE_LIST (use));
if (dump_file && (dump_flags & TDF_DETAILS)
- && !IS_EMPTY_STMT (stmt))
+ && !SSA_NAME_IS_DEFAULT_DEF (use))
{
fprintf (dump_file, "Value numbering ");
print_generic_expr (dump_file, use, 0);
fprintf (dump_file, " stmt = ");
- print_generic_stmt (dump_file, stmt, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
}
- /* RETURN_EXPR may have an embedded MODIFY_STMT. */
- if (TREE_CODE (stmt) == RETURN_EXPR
- && TREE_CODE (TREE_OPERAND (stmt, 0)) == GIMPLE_MODIFY_STMT)
- stmt = TREE_OPERAND (stmt, 0);
-
- ann = stmt_ann (stmt);
-
/* Handle uninitialized uses. */
- if (IS_EMPTY_STMT (stmt))
- {
- changed = set_ssa_val_to (use, use);
- }
+ if (SSA_NAME_IS_DEFAULT_DEF (use))
+ changed = set_ssa_val_to (use, use);
else
{
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
+ changed = visit_phi (stmt);
+ else if (!gimple_has_lhs (stmt)
+ || gimple_has_volatile_ops (stmt)
+ || stmt_could_throw_p (stmt))
+ changed = defs_to_varying (stmt);
+ else if (is_gimple_assign (stmt))
{
- changed = visit_phi (stmt);
- }
- else if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT
- || (ann && ann->has_volatile_ops)
- || tree_could_throw_p (stmt))
- {
- changed = defs_to_varying (stmt);
- }
- else
- {
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ tree lhs = gimple_assign_lhs (stmt);
tree simplified;
- STRIP_USELESS_TYPE_CONVERSION (rhs);
-
/* Shortcut for copies. Simplifying copies is pointless,
since we copy the expression and value they represent. */
- if (TREE_CODE (rhs) == SSA_NAME && TREE_CODE (lhs) == SSA_NAME)
+ if (gimple_assign_copy_p (stmt)
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME
+ && TREE_CODE (lhs) == SSA_NAME)
{
- changed = visit_copy (lhs, rhs);
+ changed = visit_copy (lhs, gimple_assign_rhs1 (stmt));
goto done;
}
- simplified = try_to_simplify (stmt, rhs);
- if (simplified && simplified != rhs)
+ simplified = try_to_simplify (stmt);
+ if (simplified)
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "RHS ");
- print_generic_expr (dump_file, rhs, 0);
+ print_gimple_expr (dump_file, stmt, 0, 0);
fprintf (dump_file, " simplified to ");
print_generic_expr (dump_file, simplified, 0);
if (TREE_CODE (lhs) == SSA_NAME)
@@ -1943,16 +2275,17 @@ visit_use (tree use)
screw up phi congruence because constants are not
uniquely associated with a single ssa name that can be
looked up. */
- if (simplified && is_gimple_min_invariant (simplified)
- && TREE_CODE (lhs) == SSA_NAME
- && simplified != rhs)
+ if (simplified
+ && is_gimple_min_invariant (simplified)
+ && TREE_CODE (lhs) == SSA_NAME)
{
VN_INFO (lhs)->expr = simplified;
VN_INFO (lhs)->has_constants = true;
changed = set_ssa_val_to (lhs, simplified);
goto done;
}
- else if (simplified && TREE_CODE (simplified) == SSA_NAME
+ else if (simplified
+ && TREE_CODE (simplified) == SSA_NAME
&& TREE_CODE (lhs) == SSA_NAME)
{
changed = visit_copy (lhs, simplified);
@@ -1967,13 +2300,10 @@ visit_use (tree use)
valuizing may change the IL stream. */
VN_INFO (lhs)->expr = unshare_expr (simplified);
}
- rhs = simplified;
- }
- else if (expr_has_constants (rhs) && TREE_CODE (lhs) == SSA_NAME)
- {
- VN_INFO (lhs)->has_constants = true;
- VN_INFO (lhs)->expr = unshare_expr (rhs);
}
+ else if (stmt_has_constants (stmt)
+ && TREE_CODE (lhs) == SSA_NAME)
+ VN_INFO (lhs)->has_constants = true;
else if (TREE_CODE (lhs) == SSA_NAME)
{
/* We reset expr and constantness here because we may
@@ -1982,56 +2312,64 @@ visit_use (tree use)
even if they were optimistically constant. */
VN_INFO (lhs)->has_constants = false;
- VN_INFO (lhs)->expr = lhs;
+ VN_INFO (lhs)->expr = NULL_TREE;
}
if (TREE_CODE (lhs) == SSA_NAME
/* We can substitute SSA_NAMEs that are live over
abnormal edges with their constant value. */
- && !is_gimple_min_invariant (rhs)
+ && !(gimple_assign_copy_p (stmt)
+ && is_gimple_min_invariant (gimple_assign_rhs1 (stmt)))
+ && !(simplified
+ && is_gimple_min_invariant (simplified))
&& SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
changed = defs_to_varying (stmt);
else if (REFERENCE_CLASS_P (lhs) || DECL_P (lhs))
{
- changed = visit_reference_op_store (lhs, rhs, stmt);
+ changed = visit_reference_op_store (lhs, gimple_assign_rhs1 (stmt), stmt);
}
else if (TREE_CODE (lhs) == SSA_NAME)
{
- if (is_gimple_min_invariant (rhs))
+ if ((gimple_assign_copy_p (stmt)
+ && is_gimple_min_invariant (gimple_assign_rhs1 (stmt)))
+ || (simplified
+ && is_gimple_min_invariant (simplified)))
{
VN_INFO (lhs)->has_constants = true;
- VN_INFO (lhs)->expr = rhs;
- changed = set_ssa_val_to (lhs, rhs);
+ if (simplified)
+ changed = set_ssa_val_to (lhs, simplified);
+ else
+ changed = set_ssa_val_to (lhs, gimple_assign_rhs1 (stmt));
}
else
{
- switch (TREE_CODE_CLASS (TREE_CODE (rhs)))
+ switch (get_gimple_rhs_class (gimple_assign_rhs_code (stmt)))
{
- case tcc_unary:
- changed = visit_unary_op (lhs, rhs);
- break;
- case tcc_binary:
- changed = visit_binary_op (lhs, rhs);
- break;
- /* If tcc_vl_expr ever encompasses more than
- CALL_EXPR, this will need to be changed. */
- case tcc_vl_exp:
- if (call_expr_flags (rhs) & (ECF_PURE | ECF_CONST))
- changed = visit_reference_op_load (lhs, rhs, stmt);
- else
- changed = defs_to_varying (stmt);
+ case GIMPLE_UNARY_RHS:
+ changed = visit_unary_op (lhs, stmt);
break;
- case tcc_declaration:
- case tcc_reference:
- changed = visit_reference_op_load (lhs, rhs, stmt);
+ case GIMPLE_BINARY_RHS:
+ changed = visit_binary_op (lhs, stmt);
break;
- case tcc_expression:
- if (TREE_CODE (rhs) == ADDR_EXPR)
+ case GIMPLE_SINGLE_RHS:
+ switch (TREE_CODE_CLASS (gimple_assign_rhs_code (stmt)))
{
- changed = visit_unary_op (lhs, rhs);
- goto done;
+ case tcc_declaration:
+ case tcc_reference:
+ changed = visit_reference_op_load
+ (lhs, gimple_assign_rhs1 (stmt), stmt);
+ break;
+ case tcc_expression:
+ if (gimple_assign_rhs_code (stmt) == ADDR_EXPR)
+ {
+ changed = visit_unary_op (lhs, stmt);
+ break;
+ }
+ /* Fallthrough. */
+ default:
+ changed = defs_to_varying (stmt);
}
- /* Fallthrough. */
+ break;
default:
changed = defs_to_varying (stmt);
break;
@@ -2041,6 +2379,39 @@ visit_use (tree use)
else
changed = defs_to_varying (stmt);
}
+ else if (is_gimple_call (stmt))
+ {
+ tree lhs = gimple_call_lhs (stmt);
+
+ /* ??? We could try to simplify calls. */
+
+ if (stmt_has_constants (stmt)
+ && TREE_CODE (lhs) == SSA_NAME)
+ VN_INFO (lhs)->has_constants = true;
+ else if (TREE_CODE (lhs) == SSA_NAME)
+ {
+ /* We reset expr and constantness here because we may
+ have been value numbering optimistically, and
+ iterating. They may become non-constant in this case,
+ even if they were optimistically constant. */
+ VN_INFO (lhs)->has_constants = false;
+ VN_INFO (lhs)->expr = NULL_TREE;
+ }
+
+ if (TREE_CODE (lhs) == SSA_NAME
+ && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs))
+ changed = defs_to_varying (stmt);
+ /* ??? We should handle stores from calls. */
+ else if (TREE_CODE (lhs) == SSA_NAME)
+ {
+ if (gimple_call_flags (stmt) & (ECF_PURE | ECF_CONST))
+ changed = visit_reference_op_call (lhs, stmt);
+ else
+ changed = defs_to_varying (stmt);
+ }
+ else
+ changed = defs_to_varying (stmt);
+ }
}
done:
return changed;
@@ -2053,20 +2424,20 @@ compare_ops (const void *pa, const void *pb)
{
const tree opa = *((const tree *)pa);
const tree opb = *((const tree *)pb);
- tree opstmta = SSA_NAME_DEF_STMT (opa);
- tree opstmtb = SSA_NAME_DEF_STMT (opb);
+ gimple opstmta = SSA_NAME_DEF_STMT (opa);
+ gimple opstmtb = SSA_NAME_DEF_STMT (opb);
basic_block bba;
basic_block bbb;
- if (IS_EMPTY_STMT (opstmta) && IS_EMPTY_STMT (opstmtb))
+ if (gimple_nop_p (opstmta) && gimple_nop_p (opstmtb))
return 0;
- else if (IS_EMPTY_STMT (opstmta))
+ else if (gimple_nop_p (opstmta))
return -1;
- else if (IS_EMPTY_STMT (opstmtb))
+ else if (gimple_nop_p (opstmtb))
return 1;
- bba = bb_for_stmt (opstmta);
- bbb = bb_for_stmt (opstmtb);
+ bba = gimple_bb (opstmta);
+ bbb = gimple_bb (opstmtb);
if (!bba && !bbb)
return 0;
@@ -2077,13 +2448,14 @@ compare_ops (const void *pa, const void *pb)
if (bba == bbb)
{
- if (TREE_CODE (opstmta) == PHI_NODE && TREE_CODE (opstmtb) == PHI_NODE)
+ if (gimple_code (opstmta) == GIMPLE_PHI
+ && gimple_code (opstmtb) == GIMPLE_PHI)
return 0;
- else if (TREE_CODE (opstmta) == PHI_NODE)
+ else if (gimple_code (opstmta) == GIMPLE_PHI)
return -1;
- else if (TREE_CODE (opstmtb) == PHI_NODE)
+ else if (gimple_code (opstmtb) == GIMPLE_PHI)
return 1;
- return gimple_stmt_uid (opstmta) - gimple_stmt_uid (opstmtb);
+ return gimple_uid (opstmta) - gimple_uid (opstmtb);
}
return rpo_numbers[bba->index] - rpo_numbers[bbb->index];
}
@@ -2129,6 +2501,9 @@ process_scc (VEC (tree, heap) *scc)
{
changed = false;
iterations++;
+ /* As we are value-numbering optimistically we have to
+ clear the expression tables and the simplified expressions
+ in each iteration until we converge. */
htab_empty (optimistic_info->nary);
htab_empty (optimistic_info->phis);
htab_empty (optimistic_info->references);
@@ -2137,6 +2512,8 @@ process_scc (VEC (tree, heap) *scc)
empty_alloc_pool (optimistic_info->phis_pool);
empty_alloc_pool (optimistic_info->references_pool);
for (i = 0; VEC_iterate (tree, scc, i, var); i++)
+ VN_INFO (var)->expr = NULL_TREE;
+ for (i = 0; VEC_iterate (tree, scc, i, var); i++)
changed |= visit_use (var);
}
@@ -2209,7 +2586,8 @@ DFS (tree name)
VEC(ssa_op_iter, heap) *itervec = NULL;
VEC(tree, heap) *namevec = NULL;
use_operand_p usep = NULL;
- tree defstmt, use;
+ gimple defstmt;
+ tree use;
ssa_op_iter iter;
start_over:
@@ -2223,10 +2601,10 @@ start_over:
defstmt = SSA_NAME_DEF_STMT (name);
/* Recursively DFS on our operands, looking for SCC's. */
- if (!IS_EMPTY_STMT (defstmt))
+ if (!gimple_nop_p (defstmt))
{
/* Push a new iterator. */
- if (TREE_CODE (defstmt) == PHI_NODE)
+ if (gimple_code (defstmt) == GIMPLE_PHI)
usep = op_iter_init_phiuse (&iter, defstmt, SSA_OP_ALL_USES);
else
usep = op_iter_init_use (&iter, defstmt, SSA_OP_ALL_USES);
@@ -2377,7 +2755,7 @@ init_scc_vn (void)
if (name)
{
VN_INFO_GET (name)->valnum = VN_TOP;
- VN_INFO (name)->expr = name;
+ VN_INFO (name)->expr = NULL_TREE;
VN_INFO (name)->value_id = 0;
}
}
@@ -2587,22 +2965,20 @@ get_next_value_id (void)
}
-/* Compare two expressions E1 and E2 and return true if they are
- equal. */
+/* Compare two expressions E1 and E2 and return true if they are equal. */
bool
expressions_equal_p (tree e1, tree e2)
{
- tree te1, te2;
-
+ /* The obvious case. */
if (e1 == e2)
return true;
- te1 = TREE_TYPE (e1);
- te2 = TREE_TYPE (e2);
- if (te1 != te2)
+ /* If only one of them is null, they cannot be equal. */
+ if (!e1 || !e2)
return false;
+ /* Recurse on elements of lists. */
if (TREE_CODE (e1) == TREE_LIST && TREE_CODE (e2) == TREE_LIST)
{
tree lop1 = e1;
@@ -2617,10 +2993,11 @@ expressions_equal_p (tree e1, tree e2)
return false;
}
return true;
-
}
- else if (TREE_CODE (e1) == TREE_CODE (e2)
- && operand_equal_p (e1, e2, OEP_PURE_SAME))
+
+ /* Now perform the actual comparison. */
+ if (TREE_CODE (e1) == TREE_CODE (e2)
+ && operand_equal_p (e1, e2, OEP_PURE_SAME))
return true;
return false;
diff --git a/gcc/tree-ssa-sccvn.h b/gcc/tree-ssa-sccvn.h
index 314cf8f8c9b..84f096ef224 100644
--- a/gcc/tree-ssa-sccvn.h
+++ b/gcc/tree-ssa-sccvn.h
@@ -104,7 +104,30 @@ typedef struct vn_constant_s
hashval_t hashcode;
tree constant;
} *vn_constant_t;
-
+
+/* Hash the constant CONSTANT with distinguishing type incompatible
+ constants in the types_compatible_p sense. */
+
+static inline hashval_t
+vn_hash_constant_with_type (tree constant)
+{
+ tree type = TREE_TYPE (constant);
+ return (iterative_hash_expr (constant, 0)
+ + INTEGRAL_TYPE_P (type)
+ + (INTEGRAL_TYPE_P (type)
+ ? TYPE_PRECISION (type) + TYPE_UNSIGNED (type) : 0));
+}
+
+/* Compare the constants C1 and C2 with distinguishing type incompatible
+ constants in the types_compatible_p sense. */
+
+static inline bool
+vn_constant_eq_with_type (tree c1, tree c2)
+{
+ return (expressions_equal_p (c1, c2)
+ && types_compatible_p (TREE_TYPE (c1), TREE_TYPE (c2)));
+}
+
typedef struct vn_ssa_aux
{
/* Value number. This may be an SSA name or a constant. */
@@ -138,24 +161,30 @@ typedef struct vn_ssa_aux
/* Return the value numbering info for an SSA_NAME. */
extern vn_ssa_aux_t VN_INFO (tree);
extern vn_ssa_aux_t VN_INFO_GET (tree);
+tree vn_get_expr_for (tree);
bool run_scc_vn (bool);
void free_scc_vn (void);
tree vn_nary_op_lookup (tree, vn_nary_op_t *);
+tree vn_nary_op_lookup_stmt (gimple, vn_nary_op_t *);
tree vn_nary_op_lookup_pieces (unsigned int, enum tree_code,
tree, tree, tree, tree, tree,
vn_nary_op_t *);
vn_nary_op_t vn_nary_op_insert (tree, tree);
+vn_nary_op_t vn_nary_op_insert_stmt (gimple, tree);
vn_nary_op_t vn_nary_op_insert_pieces (unsigned int, enum tree_code,
tree, tree, tree, tree,
tree, tree, unsigned int);
+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 *);
@@ -166,6 +195,6 @@ unsigned int get_next_value_id (void);
unsigned int get_constant_value_id (tree);
unsigned int get_or_alloc_constant_value_id (tree);
bool value_id_constant_p (unsigned int);
-VEC (tree, gc) *shared_vuses_from_stmt (tree);
-VEC (tree, gc) *copy_vuses_from_stmt (tree);
+VEC (tree, gc) *shared_vuses_from_stmt (gimple);
+VEC (tree, gc) *copy_vuses_from_stmt (gimple);
#endif /* TREE_SSA_SCCVN_H */
diff --git a/gcc/tree-ssa-sink.c b/gcc/tree-ssa-sink.c
index ebf54e2070b..e56cce0edb1 100644
--- a/gcc/tree-ssa-sink.c
+++ b/gcc/tree-ssa-sink.c
@@ -28,7 +28,7 @@ along with GCC; see the file COPYING3. If not see
#include "diagnostic.h"
#include "tree-inline.h"
#include "tree-flow.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-dump.h"
#include "timevar.h"
#include "fibheap.h"
@@ -82,18 +82,18 @@ static struct
we return NULL. */
static basic_block
-find_bb_for_arg (tree phi, tree def)
+find_bb_for_arg (gimple phi, tree def)
{
- int i;
+ size_t i;
bool foundone = false;
basic_block result = NULL;
- for (i = 0; i < PHI_NUM_ARGS (phi); i++)
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
if (PHI_ARG_DEF (phi, i) == def)
{
if (foundone)
return NULL;
foundone = true;
- result = PHI_ARG_EDGE (phi, i)->src;
+ result = gimple_phi_arg_edge (phi, i)->src;
}
return result;
}
@@ -107,9 +107,9 @@ find_bb_for_arg (tree phi, tree def)
used in, so that you only have one place you can sink it to. */
static bool
-all_immediate_uses_same_place (tree stmt)
+all_immediate_uses_same_place (gimple stmt)
{
- tree firstuse = NULL_TREE;
+ gimple firstuse = NULL;
ssa_op_iter op_iter;
imm_use_iterator imm_iter;
use_operand_p use_p;
@@ -119,7 +119,7 @@ all_immediate_uses_same_place (tree stmt)
{
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, var)
{
- if (firstuse == NULL_TREE)
+ if (firstuse == NULL)
firstuse = USE_STMT (use_p);
else
if (firstuse != USE_STMT (use_p))
@@ -134,16 +134,16 @@ all_immediate_uses_same_place (tree stmt)
but we still must avoid moving them around. */
bool
-is_hidden_global_store (tree stmt)
+is_hidden_global_store (gimple stmt)
{
/* Check virtual definitions. If we get here, the only virtual
- definitions we should see are those generated by assignment
+ definitions we should see are those generated by assignment or call
statements. */
if (!ZERO_SSA_OPERANDS (stmt, SSA_OP_VIRTUAL_DEFS))
{
tree lhs;
- gcc_assert (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT);
+ gcc_assert (is_gimple_assign (stmt) || is_gimple_call (stmt));
/* Note that we must not check the individual virtual operands
here. In particular, if this is an aliased store, we could
@@ -170,7 +170,8 @@ is_hidden_global_store (tree stmt)
address is a pointer, we check if its name tag or symbol tag is
a global variable. Otherwise, we check if the base variable
is a global. */
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
+ lhs = gimple_get_lhs (stmt);
+
if (REFERENCE_CLASS_P (lhs))
lhs = get_base_address (lhs);
@@ -200,7 +201,7 @@ is_hidden_global_store (tree stmt)
/* Find the nearest common dominator of all of the immediate uses in IMM. */
static basic_block
-nearest_common_dominator_of_uses (tree stmt)
+nearest_common_dominator_of_uses (gimple stmt)
{
bitmap blocks = BITMAP_ALLOC (NULL);
basic_block commondom;
@@ -216,18 +217,18 @@ nearest_common_dominator_of_uses (tree stmt)
{
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, var)
{
- tree usestmt = USE_STMT (use_p);
+ gimple usestmt = USE_STMT (use_p);
basic_block useblock;
- if (TREE_CODE (usestmt) == PHI_NODE)
+ if (gimple_code (usestmt) == GIMPLE_PHI)
{
int idx = PHI_ARG_INDEX_FROM_USE (use_p);
- useblock = PHI_ARG_EDGE (usestmt, idx)->src;
+ useblock = gimple_phi_arg_edge (usestmt, idx)->src;
}
else
{
- useblock = bb_for_stmt (usestmt);
+ useblock = gimple_bb (usestmt);
}
/* Short circuit. Nothing dominates the entry block. */
@@ -249,23 +250,22 @@ nearest_common_dominator_of_uses (tree stmt)
/* Given a statement (STMT) and the basic block it is currently in (FROMBB),
determine the location to sink the statement to, if any.
- Returns true if there is such location; in that case, TOBB is set to the
- basic block of the location, and TOBSI points to the statement before
- that STMT should be moved. */
+ Returns true if there is such location; in that case, TOGSI points to the
+ statement before that STMT should be moved. */
static bool
-statement_sink_location (tree stmt, basic_block frombb, basic_block *tobb,
- block_stmt_iterator *tobsi)
+statement_sink_location (gimple stmt, basic_block frombb,
+ gimple_stmt_iterator *togsi)
{
- tree use, def;
+ gimple use;
+ tree def;
use_operand_p one_use = NULL_USE_OPERAND_P;
basic_block sinkbb;
use_operand_p use_p;
def_operand_p def_p;
ssa_op_iter iter;
- stmt_ann_t ann;
- tree rhs;
imm_use_iterator imm_iter;
+ enum tree_code code;
FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_ALL_DEFS)
{
@@ -281,9 +281,8 @@ statement_sink_location (tree stmt, basic_block frombb, basic_block *tobb,
if (one_use == NULL_USE_OPERAND_P)
return false;
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
return false;
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
/* There are a few classes of things we can't or don't move, some because we
don't have code to handle it, some because it's not profitable and some
@@ -305,13 +304,13 @@ statement_sink_location (tree stmt, basic_block frombb, basic_block *tobb,
sunk.
*/
- ann = stmt_ann (stmt);
+ code = gimple_assign_rhs_code (stmt);
if (stmt_ends_bb_p (stmt)
- || TREE_SIDE_EFFECTS (rhs)
- || TREE_CODE (rhs) == EXC_PTR_EXPR
- || TREE_CODE (rhs) == FILTER_EXPR
+ || gimple_has_side_effects (stmt)
+ || code == EXC_PTR_EXPR
+ || code == FILTER_EXPR
|| is_hidden_global_store (stmt)
- || ann->has_volatile_ops
+ || gimple_has_volatile_ops (stmt)
|| !ZERO_SSA_OPERANDS (stmt, SSA_OP_VUSE))
return false;
@@ -365,20 +364,19 @@ statement_sink_location (tree stmt, basic_block frombb, basic_block *tobb,
fprintf (dump_file, "Common dominator of all uses is %d\n",
commondom->index);
}
- *tobb = commondom;
- *tobsi = bsi_after_labels (commondom);
+ *togsi = gsi_after_labels (commondom);
return true;
}
use = USE_STMT (one_use);
- if (TREE_CODE (use) != PHI_NODE)
+ if (gimple_code (use) != GIMPLE_PHI)
{
- sinkbb = bb_for_stmt (use);
+ sinkbb = gimple_bb (use);
if (sinkbb == frombb || sinkbb->loop_depth > frombb->loop_depth
|| sinkbb->loop_father != frombb->loop_father)
return false;
- *tobb = sinkbb;
- *tobsi = bsi_for_stmt (use);
+
+ *togsi = gsi_for_stmt (use);
return true;
}
@@ -399,14 +397,13 @@ statement_sink_location (tree stmt, basic_block frombb, basic_block *tobb,
If the use is a phi, and is in the same bb as the def,
we can't sink it. */
- if (bb_for_stmt (use) == frombb)
+ if (gimple_bb (use) == frombb)
return false;
if (sinkbb == frombb || sinkbb->loop_depth > frombb->loop_depth
|| sinkbb->loop_father != frombb->loop_father)
return false;
- *tobb = sinkbb;
- *tobsi = bsi_after_labels (sinkbb);
+ *togsi = gsi_after_labels (sinkbb);
return true;
}
@@ -417,7 +414,7 @@ static void
sink_code_in_bb (basic_block bb)
{
basic_block son;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
edge_iterator ei;
edge e;
bool last = true;
@@ -432,50 +429,49 @@ sink_code_in_bb (basic_block bb)
if (e->flags & EDGE_ABNORMAL)
goto earlyout;
- for (bsi = bsi_last (bb); !bsi_end_p (bsi);)
+ for (gsi = gsi_last_bb (bb); !gsi_end_p (gsi);)
{
- tree stmt = bsi_stmt (bsi);
- block_stmt_iterator tobsi;
- basic_block tobb;
+ gimple stmt = gsi_stmt (gsi);
+ gimple_stmt_iterator togsi;
- if (!statement_sink_location (stmt, bb, &tobb, &tobsi))
+ if (!statement_sink_location (stmt, bb, &togsi))
{
- if (!bsi_end_p (bsi))
- bsi_prev (&bsi);
+ if (!gsi_end_p (gsi))
+ gsi_prev (&gsi);
last = false;
continue;
}
if (dump_file)
{
fprintf (dump_file, "Sinking ");
- print_generic_expr (dump_file, stmt, TDF_VOPS);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_VOPS);
fprintf (dump_file, " from bb %d to bb %d\n",
- bb->index, tobb->index);
+ bb->index, (gsi_bb (togsi))->index);
}
/* If this is the end of the basic block, we need to insert at the end
of the basic block. */
- if (bsi_end_p (tobsi))
- bsi_move_to_bb_end (&bsi, tobb);
+ if (gsi_end_p (togsi))
+ gsi_move_to_bb_end (&gsi, gsi_bb (togsi));
else
- bsi_move_before (&bsi, &tobsi);
+ gsi_move_before (&gsi, &togsi);
sink_stats.sunk++;
/* If we've just removed the last statement of the BB, the
- bsi_end_p() test below would fail, but bsi_prev() would have
+ gsi_end_p() test below would fail, but gsi_prev() would have
succeeded, and we want it to succeed. So we keep track of
whether we're at the last statement and pick up the new last
statement. */
if (last)
{
- bsi = bsi_last (bb);
+ gsi = gsi_last_bb (bb);
continue;
}
last = false;
- if (!bsi_end_p (bsi))
- bsi_prev (&bsi);
+ if (!gsi_end_p (gsi))
+ gsi_prev (&gsi);
}
earlyout:
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 6121437b245..6db829808d8 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -39,7 +39,7 @@
#include "tree-inline.h"
#include "varray.h"
#include "c-tree.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "hashtab.h"
#include "function.h"
#include "cgraph.h"
@@ -3087,7 +3087,6 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p)
switch (TREE_CODE_CLASS (TREE_CODE (t)))
{
case tcc_expression:
- case tcc_vl_exp:
{
switch (TREE_CODE (t))
{
@@ -3109,37 +3108,6 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p)
return;
}
break;
- case CALL_EXPR:
- /* XXX: In interprocedural mode, if we didn't have the
- body, we would need to do *each pointer argument =
- &ANYTHING added. */
- if (call_expr_flags (t) & (ECF_MALLOC | ECF_MAY_BE_ALLOCA))
- {
- varinfo_t vi;
- tree heapvar = heapvar_lookup (t);
-
- if (heapvar == NULL)
- {
- heapvar = create_tmp_var_raw (ptr_type_node, "HEAP");
- DECL_EXTERNAL (heapvar) = 1;
- get_var_ann (heapvar)->is_heapvar = 1;
- if (gimple_referenced_vars (cfun))
- add_referenced_var (heapvar);
- heapvar_insert (t, heapvar);
- }
-
- temp.var = create_variable_info_for (heapvar,
- alias_get_name (heapvar));
-
- vi = get_varinfo (temp.var);
- vi->is_artificial_var = 1;
- vi->is_heap_var = 1;
- temp.type = ADDRESSOF;
- temp.offset = 0;
- VEC_safe_push (ce_s, heap, *results, &temp);
- return;
- }
- break;
default:;
}
break;
@@ -3163,48 +3131,10 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p)
}
break;
}
- case tcc_unary:
- {
- switch (TREE_CODE (t))
- {
- CASE_CONVERT:
- {
- tree op = TREE_OPERAND (t, 0);
-
- /* Cast from non-pointer to pointers are bad news for us.
- Anything else, we see through */
- if (!(POINTER_TYPE_P (TREE_TYPE (t))
- && ! POINTER_TYPE_P (TREE_TYPE (op))))
- {
- get_constraint_for_1 (op, results, address_p);
- return;
- }
-
- /* FALLTHRU */
- }
- default:;
- }
- break;
- }
- case tcc_binary:
- {
- if (TREE_CODE (t) == POINTER_PLUS_EXPR)
- {
- get_constraint_for_ptr_offset (TREE_OPERAND (t, 0),
- TREE_OPERAND (t, 1), results);
- return;
- }
- break;
- }
case tcc_exceptional:
{
switch (TREE_CODE (t))
{
- case PHI_NODE:
- {
- get_constraint_for_1 (PHI_RESULT (t), results, address_p);
- return;
- }
case SSA_NAME:
{
get_constraint_for_ssa_var (t, results, address_p);
@@ -3544,20 +3474,23 @@ make_escape_constraint (tree op)
RHS. */
static void
-handle_rhs_call (tree rhs)
+handle_rhs_call (gimple stmt)
{
- tree arg;
- call_expr_arg_iterator iter;
+ unsigned i;
- FOR_EACH_CALL_EXPR_ARG (arg, iter, rhs)
- /* Find those pointers being passed, and make sure they end up
- pointing to anything. */
- if (could_have_pointers (arg))
- make_escape_constraint (arg);
+ for (i = 0; i < gimple_call_num_args (stmt); ++i)
+ {
+ tree arg = gimple_call_arg (stmt, i);
+
+ /* Find those pointers being passed, and make sure they end up
+ pointing to anything. */
+ if (could_have_pointers (arg))
+ make_escape_constraint (arg);
+ }
/* The static chain escapes as well. */
- if (CALL_EXPR_STATIC_CHAIN (rhs))
- make_escape_constraint (CALL_EXPR_STATIC_CHAIN (rhs));
+ if (gimple_call_chain (stmt))
+ make_escape_constraint (gimple_call_chain (stmt));
}
/* For non-IPA mode, generate constraints necessary for a call
@@ -3612,22 +3545,20 @@ handle_lhs_call (tree lhs, int flags)
const function that returns a pointer in the statement STMT. */
static void
-handle_const_call (tree stmt)
+handle_const_call (gimple stmt)
{
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- tree call = get_call_expr_in (stmt);
+ tree lhs = gimple_call_lhs (stmt);
VEC(ce_s, heap) *lhsc = NULL;
struct constraint_expr rhsc;
- unsigned int j;
+ unsigned int j, k;
struct constraint_expr *lhsp;
- tree arg, tmpvar;
- call_expr_arg_iterator iter;
+ tree tmpvar;
struct constraint_expr tmpc;
get_constraint_for (lhs, &lhsc);
/* If this is a nested function then it can return anything. */
- if (CALL_EXPR_STATIC_CHAIN (call))
+ if (gimple_call_chain (stmt))
{
rhsc.var = anything_id;
rhsc.offset = 0;
@@ -3652,18 +3583,22 @@ handle_const_call (tree stmt)
process_constraint (new_constraint (tmpc, rhsc));
/* May return arguments. */
- FOR_EACH_CALL_EXPR_ARG (arg, iter, call)
- if (could_have_pointers (arg))
- {
- VEC(ce_s, heap) *argc = NULL;
- struct constraint_expr *argp;
- int i;
-
- get_constraint_for (arg, &argc);
- for (i = 0; VEC_iterate (ce_s, argc, i, argp); i++)
- process_constraint (new_constraint (tmpc, *argp));
- VEC_free (ce_s, heap, argc);
- }
+ for (k = 0; k < gimple_call_num_args (stmt); ++k)
+ {
+ tree arg = gimple_call_arg (stmt, k);
+
+ if (could_have_pointers (arg))
+ {
+ VEC(ce_s, heap) *argc = NULL;
+ struct constraint_expr *argp;
+ int i;
+
+ get_constraint_for (arg, &argc);
+ for (i = 0; VEC_iterate (ce_s, argc, i, argp); i++)
+ process_constraint (new_constraint (tmpc, *argp));
+ VEC_free (ce_s, heap, argc);
+ }
+ }
for (j = 0; VEC_iterate (ce_s, lhsc, j, lhsp); j++)
process_constraint (new_constraint (*lhsp, tmpc));
@@ -3675,28 +3610,30 @@ handle_const_call (tree stmt)
pure function in statement STMT. */
static void
-handle_pure_call (tree stmt)
+handle_pure_call (gimple stmt)
{
- tree call = get_call_expr_in (stmt);
- tree arg;
- call_expr_arg_iterator iter;
+ unsigned i;
/* Memory reached from pointer arguments is call-used. */
- FOR_EACH_CALL_EXPR_ARG (arg, iter, call)
- if (could_have_pointers (arg))
- make_constraint_to (callused_id, arg);
+ for (i = 0; i < gimple_call_num_args (stmt); ++i)
+ {
+ tree arg = gimple_call_arg (stmt, i);
+
+ if (could_have_pointers (arg))
+ make_constraint_to (callused_id, arg);
+ }
/* The static chain is used as well. */
- if (CALL_EXPR_STATIC_CHAIN (call))
- make_constraint_to (callused_id, CALL_EXPR_STATIC_CHAIN (call));
+ if (gimple_call_chain (stmt))
+ make_constraint_to (callused_id, gimple_call_chain (stmt));
/* If the call returns a pointer it may point to reachable memory
from the arguments. Not so for malloc functions though. */
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && could_have_pointers (GIMPLE_STMT_OPERAND (stmt, 0))
- && !(call_expr_flags (call) & ECF_MALLOC))
+ if (gimple_call_lhs (stmt)
+ && could_have_pointers (gimple_call_lhs (stmt))
+ && !(gimple_call_flags (stmt) & ECF_MALLOC))
{
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
+ tree lhs = gimple_call_lhs (stmt);
VEC(ce_s, heap) *lhsc = NULL;
struct constraint_expr rhsc;
struct constraint_expr *lhsp;
@@ -3705,7 +3642,7 @@ handle_pure_call (tree stmt)
get_constraint_for (lhs, &lhsc);
/* If this is a nested function then it can return anything. */
- if (CALL_EXPR_STATIC_CHAIN (call))
+ if (gimple_call_chain (stmt))
{
rhsc.var = anything_id;
rhsc.offset = 0;
@@ -3733,40 +3670,37 @@ handle_pure_call (tree stmt)
when building alias sets and computing alias grouping heuristics. */
static void
-find_func_aliases (tree origt)
+find_func_aliases (gimple origt)
{
- tree call, t = origt;
+ gimple t = origt;
VEC(ce_s, heap) *lhsc = NULL;
VEC(ce_s, heap) *rhsc = NULL;
struct constraint_expr *c;
enum escape_type stmt_escape_type;
- if (TREE_CODE (t) == RETURN_EXPR && TREE_OPERAND (t, 0))
- t = TREE_OPERAND (t, 0);
-
/* Now build constraints expressions. */
- if (TREE_CODE (t) == PHI_NODE)
+ if (gimple_code (t) == GIMPLE_PHI)
{
- gcc_assert (!AGGREGATE_TYPE_P (TREE_TYPE (PHI_RESULT (t))));
+ gcc_assert (!AGGREGATE_TYPE_P (TREE_TYPE (gimple_phi_result (t))));
/* Only care about pointers and structures containing
pointers. */
- if (could_have_pointers (PHI_RESULT (t)))
+ if (could_have_pointers (gimple_phi_result (t)))
{
- int i;
+ size_t i;
unsigned int j;
/* For a phi node, assign all the arguments to
the result. */
- get_constraint_for (PHI_RESULT (t), &lhsc);
- for (i = 0; i < PHI_NUM_ARGS (t); i++)
+ get_constraint_for (gimple_phi_result (t), &lhsc);
+ for (i = 0; i < gimple_phi_num_args (t); i++)
{
tree rhstype;
tree strippedrhs = PHI_ARG_DEF (t, i);
STRIP_NOPS (strippedrhs);
rhstype = TREE_TYPE (strippedrhs);
- get_constraint_for (PHI_ARG_DEF (t, i), &rhsc);
+ get_constraint_for (gimple_phi_arg_def (t, i), &rhsc);
for (j = 0; VEC_iterate (ce_s, lhsc, j, c); j++)
{
@@ -3782,87 +3716,73 @@ find_func_aliases (tree origt)
}
}
/* In IPA mode, we need to generate constraints to pass call
- arguments through their calls. There are two cases, either a
- GIMPLE_MODIFY_STMT when we are returning a value, or just a plain
- CALL_EXPR when we are not.
+ arguments through their calls. There are two cases,
+ either a GIMPLE_CALL returning a value, or just a plain
+ GIMPLE_CALL when we are not.
In non-ipa mode, we need to generate constraints for each
pointer passed by address. */
- else if ((call = get_call_expr_in (t)) != NULL_TREE)
+ else if (is_gimple_call (t))
{
- int flags = call_expr_flags (call);
if (!in_ipa_mode)
{
+ int flags = gimple_call_flags (t);
+
/* Const functions can return their arguments and addresses
of global memory but not of escaped memory. */
if (flags & ECF_CONST)
{
- if (TREE_CODE (t) == GIMPLE_MODIFY_STMT
- && could_have_pointers (GIMPLE_STMT_OPERAND (t, 1)))
+ if (gimple_call_lhs (t)
+ && could_have_pointers (gimple_call_lhs (t)))
handle_const_call (t);
}
+ /* Pure functions can return addresses in and of memory
+ reachable from their arguments, but they are not an escape
+ point for reachable memory of their arguments. */
else if (flags & ECF_PURE)
{
handle_pure_call (t);
- if (TREE_CODE (t) == GIMPLE_MODIFY_STMT
- && could_have_pointers (GIMPLE_STMT_OPERAND (t, 1)))
- handle_lhs_call (GIMPLE_STMT_OPERAND (t, 0), flags);
+ if (gimple_call_lhs (t)
+ && could_have_pointers (gimple_call_lhs (t)))
+ handle_lhs_call (gimple_call_lhs (t), flags);
}
- /* Pure functions can return addresses in and of memory
- reachable from their arguments, but they are not an escape
- point for reachable memory of their arguments. But as we
- do not compute call-used memory separately we cannot do
- something special here. */
- else if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
+ else
{
- handle_rhs_call (GIMPLE_STMT_OPERAND (t, 1));
- if (could_have_pointers (GIMPLE_STMT_OPERAND (t, 1)))
- handle_lhs_call (GIMPLE_STMT_OPERAND (t, 0), flags);
+ handle_rhs_call (t);
+ if (gimple_call_lhs (t)
+ && could_have_pointers (gimple_call_lhs (t)))
+ handle_lhs_call (gimple_call_lhs (t), flags);
}
- else
- handle_rhs_call (t);
}
else
{
tree lhsop;
- tree rhsop;
- tree arg;
- call_expr_arg_iterator iter;
varinfo_t fi;
int i = 1;
+ size_t j;
tree decl;
- if (TREE_CODE (t) == GIMPLE_MODIFY_STMT)
- {
- lhsop = GIMPLE_STMT_OPERAND (t, 0);
- rhsop = GIMPLE_STMT_OPERAND (t, 1);
- }
- else
- {
- lhsop = NULL;
- rhsop = t;
- }
- decl = get_callee_fndecl (rhsop);
+
+ lhsop = gimple_call_lhs (t);
+ decl = gimple_call_fndecl (t);
/* If we can directly resolve the function being called, do so.
Otherwise, it must be some sort of indirect expression that
we should still be able to handle. */
if (decl)
- {
- fi = get_vi_for_tree (decl);
- }
+ fi = get_vi_for_tree (decl);
else
{
- decl = CALL_EXPR_FN (rhsop);
+ decl = gimple_call_fn (t);
fi = get_vi_for_tree (decl);
}
/* Assign all the passed arguments to the appropriate incoming
parameters of the function. */
-
- FOR_EACH_CALL_EXPR_ARG (arg, iter, rhsop)
+ for (j = 0; j < gimple_call_num_args (t); j++)
{
struct constraint_expr lhs ;
struct constraint_expr *rhsp;
+ tree arg = gimple_call_arg (t, j);
get_constraint_for (arg, &rhsc);
if (TREE_CODE (decl) != FUNCTION_DECL)
@@ -3914,19 +3834,36 @@ find_func_aliases (tree origt)
/* Otherwise, just a regular assignment statement. Only care about
operations with pointer result, others are dealt with as escape
points if they have pointer operands. */
- else if (TREE_CODE (t) == GIMPLE_MODIFY_STMT
- && could_have_pointers (GIMPLE_STMT_OPERAND (t, 0)))
+ else if (is_gimple_assign (t)
+ && could_have_pointers (gimple_assign_lhs (t)))
{
- tree lhsop = GIMPLE_STMT_OPERAND (t, 0);
- tree rhsop = GIMPLE_STMT_OPERAND (t, 1);
+ /* Otherwise, just a regular assignment statement. */
+ tree lhsop = gimple_assign_lhs (t);
+ tree rhsop = (gimple_num_ops (t) == 2) ? gimple_assign_rhs1 (t) : NULL;
- if (AGGREGATE_TYPE_P (TREE_TYPE (lhsop)))
+ if (rhsop && AGGREGATE_TYPE_P (TREE_TYPE (lhsop)))
do_structure_copy (lhsop, rhsop);
else
{
unsigned int j;
+ struct constraint_expr temp;
get_constraint_for (lhsop, &lhsc);
- get_constraint_for (rhsop, &rhsc);
+
+ 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 ((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))
+ get_constraint_for (rhsop, &rhsc);
+ else
+ {
+ temp.type = ADDRESSOF;
+ temp.var = anything_id;
+ temp.offset = 0;
+ VEC_safe_push (ce_s, heap, rhsc, &temp);
+ }
for (j = 0; VEC_iterate (ce_s, lhsc, j, c); j++)
{
struct constraint_expr *c2;
@@ -3937,11 +3874,11 @@ find_func_aliases (tree origt)
}
}
}
- else if (TREE_CODE (t) == CHANGE_DYNAMIC_TYPE_EXPR)
+ else if (gimple_code (t) == GIMPLE_CHANGE_DYNAMIC_TYPE)
{
unsigned int j;
- get_constraint_for (CHANGE_DYNAMIC_TYPE_LOCATION (t), &lhsc);
+ get_constraint_for (gimple_cdt_location (t), &lhsc);
for (j = 0; VEC_iterate (ce_s, lhsc, j, c); ++j)
get_varinfo (c->var)->no_tbaa_pruning = true;
}
@@ -3949,48 +3886,46 @@ find_func_aliases (tree origt)
stmt_escape_type = is_escape_site (t);
if (stmt_escape_type == ESCAPE_STORED_IN_GLOBAL)
{
- tree rhs;
- gcc_assert (TREE_CODE (t) == GIMPLE_MODIFY_STMT);
- rhs = GIMPLE_STMT_OPERAND (t, 1);
- if (TREE_CODE (rhs) == ADDR_EXPR)
+ gcc_assert (is_gimple_assign (t));
+ if (gimple_assign_rhs_code (t) == ADDR_EXPR)
{
+ tree rhs = gimple_assign_rhs1 (t);
tree base = get_base_address (TREE_OPERAND (rhs, 0));
if (base
&& (!DECL_P (base)
|| !is_global_var (base)))
make_escape_constraint (rhs);
}
- else if (TREE_CODE (rhs) == SSA_NAME
- && POINTER_TYPE_P (TREE_TYPE (rhs)))
- make_escape_constraint (rhs);
- else if (could_have_pointers (rhs))
- make_escape_constraint (rhs);
+ else if (get_gimple_rhs_class (gimple_assign_rhs_code (t))
+ == GIMPLE_SINGLE_RHS)
+ {
+ if (could_have_pointers (gimple_assign_rhs1 (t)))
+ make_escape_constraint (gimple_assign_rhs1 (t));
+ }
+ else
+ gcc_unreachable ();
}
else if (stmt_escape_type == ESCAPE_BAD_CAST)
{
- tree rhs;
- gcc_assert (TREE_CODE (t) == GIMPLE_MODIFY_STMT);
- rhs = GIMPLE_STMT_OPERAND (t, 1);
- gcc_assert (CONVERT_EXPR_P (rhs)
- || TREE_CODE (rhs) == VIEW_CONVERT_EXPR);
- rhs = TREE_OPERAND (rhs, 0);
- make_escape_constraint (rhs);
+ gcc_assert (is_gimple_assign (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));
}
else if (stmt_escape_type == ESCAPE_TO_ASM)
{
- tree link;
- int i;
- for (i = 0, link = ASM_OUTPUTS (t); link; i++, link = TREE_CHAIN (link))
+ unsigned i;
+ for (i = 0; i < gimple_asm_noutputs (t); ++i)
{
- tree op = TREE_VALUE (link);
+ tree op = TREE_VALUE (gimple_asm_output_op (t, i));
if (op && could_have_pointers (op))
/* Strictly we'd only need the constraints from ESCAPED and
NONLOCAL. */
make_escape_constraint (op);
}
- for (i = 0, link = ASM_INPUTS (t); link; i++, link = TREE_CHAIN (link))
+ for (i = 0; i < gimple_asm_ninputs (t); ++i)
{
- tree op = TREE_VALUE (link);
+ tree op = TREE_VALUE (gimple_asm_input_op (t, i));
if (op && could_have_pointers (op))
/* Strictly we'd only need the constraint to ESCAPED. */
make_escape_constraint (op);
@@ -4002,7 +3937,7 @@ find_func_aliases (tree origt)
number of statements re-scanned. It's not really necessary to
re-scan *all* statements. */
if (!in_ipa_mode)
- mark_stmt_modified (origt);
+ gimple_set_modified (origt, true);
VEC_free (ce_s, heap, rhsc);
VEC_free (ce_s, heap, lhsc);
}
@@ -4411,16 +4346,20 @@ 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;
if (TREE_CODE (decl) == FUNCTION_DECL && in_ipa_mode)
return create_function_info_for (decl, name);
- if (var_can_have_subvars (decl) && use_field_sensitive)
- push_fields_onto_fieldstack (decltype, &fieldstack, 0);
+ if (var_can_have_subvars (decl) && use_field_sensitive
+ && (!var_ann (decl)
+ || var_ann (decl)->noalias_state == 0)
+ && (!var_ann (decl)
+ || !var_ann (decl)->is_heapvar))
+ 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
@@ -4445,7 +4384,13 @@ create_variable_info_for (tree decl, const char *name)
VEC_safe_push (varinfo_t, heap, varmap, vi);
if (is_global && (!flag_whole_program || !in_ipa_mode)
&& could_have_pointers (decl))
- make_constraint_from (vi, escaped_id);
+ {
+ if (var_ann (decl)
+ && var_ann (decl)->noalias_state == NO_ALIAS_ANYTHING)
+ make_constraint_from (vi, vi->id);
+ else
+ make_constraint_from (vi, escaped_id);
+ }
stats.total_vars++;
if (use_field_sensitive
@@ -4616,6 +4561,7 @@ intra_create_variable_infos (void)
heapvar_insert (t, heapvar);
ann = get_var_ann (heapvar);
+ ann->is_heapvar = 1;
if (flag_argument_noalias == 1)
ann->noalias_state = NO_ALIAS;
else if (flag_argument_noalias == 2)
@@ -5435,25 +5381,28 @@ compute_points_to_sets (void)
/* Now walk all statements and derive aliases. */
FOR_EACH_BB (bb)
{
- block_stmt_iterator bsi;
- tree phi;
+ gimple_stmt_iterator gsi;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- if (is_gimple_reg (PHI_RESULT (phi)))
- find_func_aliases (phi);
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple phi = gsi_stmt (gsi);
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); )
+ if (is_gimple_reg (gimple_phi_result (phi)))
+ find_func_aliases (phi);
+ }
+
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); )
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
find_func_aliases (stmt);
- /* The information in CHANGE_DYNAMIC_TYPE_EXPR nodes has now
- been captured, and we can remove them. */
- if (TREE_CODE (stmt) == CHANGE_DYNAMIC_TYPE_EXPR)
- bsi_remove (&bsi, true);
+ /* The information in GIMPLE_CHANGE_DYNAMIC_TYPE statements
+ has now been captured, and we can remove them. */
+ if (gimple_code (stmt) == GIMPLE_CHANGE_DYNAMIC_TYPE)
+ gsi_remove (&gsi, true);
else
- bsi_next (&bsi);
+ gsi_next (&gsi);
}
}
@@ -5559,8 +5508,7 @@ delete_points_to_sets (void)
static bool
gate_ipa_pta (void)
{
- return (flag_unit_at_a_time != 0
- && flag_ipa_pta
+ return (flag_ipa_pta
/* Don't bother doing anything if the program has errors. */
&& !(errorcount || sorrycount));
}
@@ -5608,22 +5556,19 @@ ipa_pta_execute (void)
FOR_EACH_BB_FN (bb, func)
{
- block_stmt_iterator bsi;
- tree phi;
+ gimple_stmt_iterator gsi;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi);
+ gsi_next (&gsi))
{
- if (is_gimple_reg (PHI_RESULT (phi)))
- {
- find_func_aliases (phi);
- }
- }
+ gimple phi = gsi_stmt (gsi);
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- {
- tree stmt = bsi_stmt (bsi);
- find_func_aliases (stmt);
+ if (is_gimple_reg (gimple_phi_result (phi)))
+ find_func_aliases (phi);
}
+
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ find_func_aliases (gsi_stmt (gsi));
}
current_function_decl = old_func_decl;
pop_cfun ();
@@ -5709,5 +5654,4 @@ delete_alias_heapvars (void)
heapvar_for_stmt = NULL;
}
-
#include "gt-tree-ssa-structalias.h"
diff --git a/gcc/tree-ssa-structalias.h b/gcc/tree-ssa-structalias.h
index 0d0d6bdf073..e684f5def7f 100644
--- a/gcc/tree-ssa-structalias.h
+++ b/gcc/tree-ssa-structalias.h
@@ -25,8 +25,8 @@ struct constraint;
typedef struct constraint *constraint_t;
/* In tree-ssa-alias.c. */
-enum escape_type is_escape_site (tree);
-void update_mem_sym_stats_from_stmt (tree, tree, long, long);
+enum escape_type is_escape_site (gimple);
+void update_mem_sym_stats_from_stmt (tree, gimple, long, long);
/* In tree-ssa-structalias.c. */
extern void compute_points_to_sets (void);
diff --git a/gcc/tree-ssa-ter.c b/gcc/tree-ssa-ter.c
index e02867520c8..099c19742e4 100644
--- a/gcc/tree-ssa-ter.c
+++ b/gcc/tree-ssa-ter.c
@@ -89,7 +89,7 @@ along with GCC; see the file COPYING3. If not see
TER implements this but stepping through the instructions in a block and
tracking potential expressions for replacement, and the partitions they are
dependent on. Expressions are represented by the SSA_NAME_VERSION of the
- DEF on the LHS of a GIMPLE_MODIFY_STMT and the expression is the RHS.
+ DEF on the LHS of a GIMPLE_ASSIGN and the expression is the RHS.
When a stmt is determined to be a possible replacement expression, the
following steps are taken:
@@ -159,7 +159,7 @@ typedef struct temp_expr_table_d
{
var_map map;
bitmap *partition_dependencies; /* Partitions expr is dependent on. */
- tree *replaceable_expressions; /* Replacement expression table. */
+ gimple *replaceable_expressions; /* Replacement expression table. */
bitmap *expr_decl_uids; /* Base uids of exprs. */
bitmap *kill_list; /* Expr's killed by a partition. */
int virtual_partition; /* Pseudo partition for virtual ops. */
@@ -216,10 +216,10 @@ new_temp_expr_table (var_map map)
/* Free TER table T. If there are valid replacements, return the expression
vector. */
-static tree *
+static gimple *
free_temp_expr_table (temp_expr_table_p t)
{
- tree *ret = NULL;
+ gimple *ret = NULL;
unsigned i;
#ifdef ENABLE_CHECKING
@@ -255,7 +255,7 @@ version_to_be_replaced_p (temp_expr_table_p tab, int version)
{
if (!tab->replaceable_expressions)
return false;
- return tab->replaceable_expressions[version] != NULL_TREE;
+ return tab->replaceable_expressions[version] != NULL;
}
@@ -360,20 +360,20 @@ add_dependence (temp_expr_table_p tab, int version, tree var)
/* Return TRUE if expression STMT is suitable for replacement. */
static inline bool
-is_replaceable_p (tree stmt)
+is_replaceable_p (gimple stmt)
{
- tree call_expr;
use_operand_p use_p;
- tree def, use_stmt;
+ tree def;
+ gimple use_stmt;
location_t locus1, locus2;
tree block1, block2;
/* Only consider modify stmts. */
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_assign (stmt))
return false;
/* If the statement may throw an exception, it cannot be replaced. */
- if (tree_could_throw_p (stmt))
+ if (stmt_could_throw_p (stmt))
return false;
/* Punt if there is more than 1 def. */
@@ -386,33 +386,21 @@ is_replaceable_p (tree stmt)
return false;
/* If the use isn't in this block, it wont be replaced either. */
- if (bb_for_stmt (use_stmt) != bb_for_stmt (stmt))
+ if (gimple_bb (use_stmt) != gimple_bb (stmt))
return false;
- if (GIMPLE_STMT_P (stmt))
- {
- locus1 = GIMPLE_STMT_LOCUS (stmt);
- block1 = GIMPLE_STMT_BLOCK (stmt);
- }
- else
- {
- locus1 = *EXPR_LOCUS (stmt);
- block1 = TREE_BLOCK (stmt);
- }
- if (GIMPLE_STMT_P (use_stmt))
- {
- locus2 = GIMPLE_STMT_LOCUS (use_stmt);
- block2 = GIMPLE_STMT_BLOCK (use_stmt);
- }
- if (TREE_CODE (use_stmt) == PHI_NODE)
+ locus1 = gimple_location (stmt);
+ block1 = gimple_block (stmt);
+
+ if (gimple_code (use_stmt) == GIMPLE_PHI)
{
locus2 = 0;
block2 = NULL_TREE;
}
else
{
- locus2 = *EXPR_LOCUS (use_stmt);
- block2 = TREE_BLOCK (use_stmt);
+ locus2 = gimple_location (use_stmt);
+ block2 = gimple_block (use_stmt);
}
if (!optimize
@@ -420,7 +408,7 @@ is_replaceable_p (tree stmt)
return false;
/* Used in this block, but at the TOP of the block, not the end. */
- if (TREE_CODE (use_stmt) == PHI_NODE)
+ if (gimple_code (use_stmt) == GIMPLE_PHI)
return false;
/* There must be no VDEFs. */
@@ -428,26 +416,26 @@ is_replaceable_p (tree stmt)
return false;
/* Without alias info we can't move around loads. */
- if (stmt_ann (stmt)->references_memory && !optimize)
+ if (gimple_references_memory_p (stmt) && !optimize)
return false;
/* Float expressions must go through memory if float-store is on. */
if (flag_float_store
- && FLOAT_TYPE_P (TREE_TYPE (GENERIC_TREE_OPERAND (stmt, 1))))
+ && FLOAT_TYPE_P (gimple_expr_type (stmt)))
return false;
/* An assignment with a register variable on the RHS is not
replaceable. */
- if (TREE_CODE (GENERIC_TREE_OPERAND (stmt, 1)) == VAR_DECL
- && DECL_HARD_REGISTER (GENERIC_TREE_OPERAND (stmt, 1)))
+ if (gimple_assign_rhs_code (stmt) == VAR_DECL
+ && DECL_HARD_REGISTER (gimple_assign_rhs1 (stmt)))
return false;
/* No function calls can be replaced. */
- if ((call_expr = get_call_expr_in (stmt)) != NULL_TREE)
+ if (is_gimple_call (stmt))
return false;
/* Leave any stmt with volatile operands alone as well. */
- if (stmt_ann (stmt)->has_volatile_ops)
+ if (gimple_has_volatile_ops (stmt))
return false;
return true;
@@ -480,7 +468,7 @@ finished_with_expr (temp_expr_table_p tab, int version, bool free_expr)
/* Create an expression entry for a replaceable expression. */
static void
-process_replaceable (temp_expr_table_p tab, tree stmt)
+process_replaceable (temp_expr_table_p tab, gimple stmt)
{
tree var, def, basevar;
int version;
@@ -574,7 +562,7 @@ mark_replaceable (temp_expr_table_p tab, tree var, bool more_replacing)
/* Set the replaceable expression. */
if (!tab->replaceable_expressions)
- tab->replaceable_expressions = XCNEWVEC (tree, num_ssa_names + 1);
+ tab->replaceable_expressions = XCNEWVEC (gimple, num_ssa_names + 1);
tab->replaceable_expressions[version] = SSA_NAME_DEF_STMT (var);
}
@@ -585,20 +573,20 @@ mark_replaceable (temp_expr_table_p tab, tree var, bool more_replacing)
static void
find_replaceable_in_bb (temp_expr_table_p tab, basic_block bb)
{
- block_stmt_iterator bsi;
- tree stmt, def, use;
- stmt_ann_t ann;
+ gimple_stmt_iterator bsi;
+ gimple stmt;
+ tree def, use;
int partition;
var_map map = tab->map;
ssa_op_iter iter;
bool stmt_replaceable;
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ for (bsi = gsi_start_bb (bb); !gsi_end_p (bsi); gsi_next (&bsi))
{
- stmt = bsi_stmt (bsi);
- ann = stmt_ann (stmt);
+ stmt = gsi_stmt (bsi);
stmt_replaceable = is_replaceable_p (stmt);
+
/* Determine if this stmt finishes an existing expression. */
FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_USE)
{
@@ -627,7 +615,7 @@ find_replaceable_in_bb (temp_expr_table_p tab, basic_block bb)
/* Mark expression as replaceable unless stmt is volatile or the
def variable has the same root variable as something in the
substitution list. */
- if (ann->has_volatile_ops || same_root_var)
+ if (gimple_has_volatile_ops (stmt) || same_root_var)
finished_with_expr (tab, ver, true);
else
mark_replaceable (tab, use, stmt_replaceable);
@@ -665,12 +653,12 @@ find_replaceable_in_bb (temp_expr_table_p tab, basic_block bb)
NULL is returned by the function, otherwise an expression vector indexed
by SSA_NAME version numbers. */
-extern tree *
+extern gimple *
find_replaceable_exprs (var_map map)
{
basic_block bb;
temp_expr_table_p table;
- tree *ret;
+ gimple *ret;
table = new_temp_expr_table (map);
FOR_EACH_BB (bb)
@@ -700,23 +688,20 @@ find_replaceable_exprs (var_map map)
/* Dump TER expression table EXPR to file F. */
-extern void
-dump_replaceable_exprs (FILE *f, tree *expr)
+void
+dump_replaceable_exprs (FILE *f, gimple *expr)
{
- tree stmt, var;
- int x;
+ tree var;
+ unsigned x;
fprintf (f, "\nReplacing Expressions\n");
- for (x = 0; x < (int)num_ssa_names; x++)
+ for (x = 0; x < num_ssa_names; x++)
if (expr[x])
{
- stmt = expr[x];
- var = SINGLE_SSA_TREE_OPERAND (stmt, SSA_OP_DEF);
- gcc_assert (var != NULL_TREE);
+ var = ssa_name (x);
print_generic_expr (f, var, TDF_SLIM);
fprintf (f, " replace with --> ");
- print_generic_expr (f, GENERIC_TREE_OPERAND (stmt, 1),
- TDF_SLIM);
+ print_gimple_stmt (f, expr[x], 0, TDF_SLIM);
fprintf (f, "\n");
}
fprintf (f, "\n");
@@ -728,7 +713,7 @@ dump_replaceable_exprs (FILE *f, tree *expr)
exclusively to debug TER. F is the place to send debug info and T is the
table being debugged. */
-extern void
+void
debug_ter (FILE *f, temp_expr_table_p t)
{
unsigned x, y;
diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c
index 462da5d6058..a193d94b010 100644
--- a/gcc/tree-ssa-threadedge.c
+++ b/gcc/tree-ssa-threadedge.c
@@ -55,7 +55,7 @@ static int stmt_count;
bool
potentially_threadable_block (basic_block bb)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
/* If BB has a single successor or a single predecessor, then
there is no threading opportunity. */
@@ -64,12 +64,12 @@ potentially_threadable_block (basic_block bb)
/* If BB does not end with a conditional, switch or computed goto,
then there is no threading opportunity. */
- bsi = bsi_last (bb);
- if (bsi_end_p (bsi)
- || ! bsi_stmt (bsi)
- || (TREE_CODE (bsi_stmt (bsi)) != COND_EXPR
- && TREE_CODE (bsi_stmt (bsi)) != GOTO_EXPR
- && TREE_CODE (bsi_stmt (bsi)) != SWITCH_EXPR))
+ gsi = gsi_last_bb (bb);
+ if (gsi_end_p (gsi)
+ || ! gsi_stmt (gsi)
+ || (gimple_code (gsi_stmt (gsi)) != GIMPLE_COND
+ && gimple_code (gsi_stmt (gsi)) != GIMPLE_GOTO
+ && gimple_code (gsi_stmt (gsi)) != GIMPLE_SWITCH))
return false;
return true;
@@ -80,28 +80,27 @@ potentially_threadable_block (basic_block bb)
BB. If no such ASSERT_EXPR is found, return OP. */
static tree
-lhs_of_dominating_assert (tree op, basic_block bb, tree stmt)
+lhs_of_dominating_assert (tree op, basic_block bb, gimple stmt)
{
imm_use_iterator imm_iter;
- tree use_stmt;
+ gimple use_stmt;
use_operand_p use_p;
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, op)
{
use_stmt = USE_STMT (use_p);
if (use_stmt != stmt
- && TREE_CODE (use_stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (use_stmt, 1)) == ASSERT_EXPR
- && TREE_OPERAND (GIMPLE_STMT_OPERAND (use_stmt, 1), 0) == op
- && dominated_by_p (CDI_DOMINATORS, bb, bb_for_stmt (use_stmt)))
+ && gimple_assign_single_p (use_stmt)
+ && TREE_CODE (gimple_assign_rhs1 (use_stmt)) == ASSERT_EXPR
+ && TREE_OPERAND (gimple_assign_rhs1 (use_stmt), 0) == op
+ && dominated_by_p (CDI_DOMINATORS, bb, gimple_bb (use_stmt)))
{
- return GIMPLE_STMT_OPERAND (use_stmt, 0);
+ return gimple_assign_lhs (use_stmt);
}
}
return op;
}
-
/* We record temporary equivalences created by PHI nodes or
statements within the target block. Doing so allows us to
identify more jump threading opportunities, even in blocks
@@ -161,23 +160,24 @@ record_temporary_equivalence (tree x, tree y, VEC(tree, heap) **stack)
static bool
record_temporary_equivalences_from_phis (edge e, VEC(tree, heap) **stack)
{
- tree phi;
+ gimple_stmt_iterator gsi;
/* Each PHI creates a temporary equivalence, record them.
These are context sensitive equivalences and will be removed
later. */
- for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (e->dest); !gsi_end_p (gsi); gsi_next (&gsi))
{
+ gimple phi = gsi_stmt (gsi);
tree src = PHI_ARG_DEF_FROM_EDGE (phi, e);
- tree dst = PHI_RESULT (phi);
+ tree dst = gimple_phi_result (phi);
/* If the desired argument is not the same as this PHI's result
and it is set by a PHI in E->dest, then we can not thread
through E->dest. */
if (src != dst
&& TREE_CODE (src) == SSA_NAME
- && TREE_CODE (SSA_NAME_DEF_STMT (src)) == PHI_NODE
- && bb_for_stmt (SSA_NAME_DEF_STMT (src)) == e->dest)
+ && gimple_code (SSA_NAME_DEF_STMT (src)) == GIMPLE_PHI
+ && gimple_bb (SSA_NAME_DEF_STMT (src)) == e->dest)
return false;
/* We consider any non-virtual PHI as a statement since it
@@ -190,6 +190,56 @@ record_temporary_equivalences_from_phis (edge e, VEC(tree, heap) **stack)
return true;
}
+/* Fold the RHS of an assignment statement and return it as a tree.
+ May return NULL_TREE if no simplification is possible. */
+
+static tree
+fold_assignment_stmt (gimple stmt)
+{
+ enum tree_code subcode = gimple_assign_rhs_code (stmt);
+
+ switch (get_gimple_rhs_class (subcode))
+ {
+ case GIMPLE_SINGLE_RHS:
+ {
+ tree rhs = gimple_assign_rhs1 (stmt);
+
+ if (TREE_CODE (rhs) == COND_EXPR)
+ {
+ /* Sadly, we have to handle conditional assignments specially
+ here, because fold expects all the operands of an expression
+ to be folded before the expression itself is folded, but we
+ can't just substitute the folded condition here. */
+ tree cond = fold (COND_EXPR_COND (rhs));
+ if (cond == boolean_true_node)
+ rhs = COND_EXPR_THEN (rhs);
+ else if (cond == boolean_false_node)
+ rhs = COND_EXPR_ELSE (rhs);
+ }
+
+ return fold (rhs);
+ }
+ break;
+ case GIMPLE_UNARY_RHS:
+ {
+ tree lhs = gimple_assign_lhs (stmt);
+ tree op0 = gimple_assign_rhs1 (stmt);
+ return fold_unary (subcode, TREE_TYPE (lhs), op0);
+ }
+ break;
+ case GIMPLE_BINARY_RHS:
+ {
+ tree lhs = gimple_assign_lhs (stmt);
+ tree op0 = gimple_assign_rhs1 (stmt);
+ tree op1 = gimple_assign_rhs2 (stmt);
+ return fold_binary (subcode, TREE_TYPE (lhs), op0, op1);
+ }
+ break;
+ default:
+ gcc_unreachable ();
+ }
+}
+
/* Try to simplify each statement in E->dest, ultimately leading to
a simplification of the COND_EXPR at the end of E->dest.
@@ -204,17 +254,17 @@ record_temporary_equivalences_from_phis (edge e, VEC(tree, heap) **stack)
If we are able to simplify a statement into the form
SSA_NAME = (SSA_NAME | gimple invariant), then we can record
- a context sensitive equivalency which may help us simplify
+ a context sensitive equivalence which may help us simplify
later statements in E->dest. */
-static tree
+static gimple
record_temporary_equivalences_from_stmts_at_dest (edge e,
VEC(tree, heap) **stack,
- tree (*simplify) (tree,
- tree))
+ tree (*simplify) (gimple,
+ gimple))
{
- block_stmt_iterator bsi;
- tree stmt = NULL;
+ gimple stmt = NULL;
+ gimple_stmt_iterator gsi;
int max_stmt_count;
max_stmt_count = PARAM_VALUE (PARAM_MAX_JUMP_THREAD_DUPLICATION_STMTS);
@@ -223,21 +273,20 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
we discover. Note any equivalences we discover are context
sensitive (ie, are dependent on traversing E) and must be unwound
when we're finished processing E. */
- for (bsi = bsi_start (e->dest); ! bsi_end_p (bsi); bsi_next (&bsi))
+ for (gsi = gsi_start_bb (e->dest); !gsi_end_p (gsi); gsi_next (&gsi))
{
tree cached_lhs = NULL;
- tree rhs;
- stmt = bsi_stmt (bsi);
+ stmt = gsi_stmt (gsi);
/* Ignore empty statements and labels. */
- if (IS_EMPTY_STMT (stmt) || TREE_CODE (stmt) == LABEL_EXPR)
+ if (gimple_code (stmt) == GIMPLE_NOP || gimple_code (stmt) == GIMPLE_LABEL)
continue;
/* If the statement has volatile operands, then we assume we
can not thread through this block. This is overly
conservative in some ways. */
- if (TREE_CODE (stmt) == ASM_EXPR && ASM_VOLATILE_P (stmt))
+ if (gimple_code (stmt) == GIMPLE_ASM && gimple_asm_volatile_p (stmt))
return NULL;
/* If duplicating this block is going to cause too much code
@@ -246,15 +295,16 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
if (stmt_count > max_stmt_count)
return NULL;
- /* If this is not a GIMPLE_MODIFY_STMT which sets an SSA_NAME to a new
+ /* If this is not a statement that sets an SSA_NAME to a new
value, then do not try to simplify this statement as it will
not simplify in any way that is helpful for jump threading. */
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT
- || TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) != SSA_NAME)
+ if ((gimple_code (stmt) != GIMPLE_ASSIGN
+ || TREE_CODE (gimple_assign_lhs (stmt)) != SSA_NAME)
+ && (gimple_code (stmt) != GIMPLE_CALL
+ || gimple_call_lhs (stmt) == NULL_TREE
+ || TREE_CODE (gimple_call_lhs (stmt)) != SSA_NAME))
continue;
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
-
/* The result of __builtin_object_size depends on all the arguments
of a phi node. Temporarily using only one edge produces invalid
results. For example
@@ -272,9 +322,9 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
remaining bytes. If we use only one edge on the phi, the result will
change to be the remaining bytes for the corresponding phi argument. */
- if (TREE_CODE (rhs) == CALL_EXPR)
+ if (is_gimple_call (stmt))
{
- tree fndecl = get_callee_fndecl (rhs);
+ tree fndecl = gimple_call_fndecl (stmt);
if (fndecl && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_OBJECT_SIZE)
continue;
}
@@ -286,16 +336,18 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
Handle simple copy operations as well as implied copies from
ASSERT_EXPRs. */
- if (TREE_CODE (rhs) == SSA_NAME)
- cached_lhs = rhs;
- else if (TREE_CODE (rhs) == ASSERT_EXPR)
- cached_lhs = TREE_OPERAND (rhs, 0);
+ if (gimple_assign_single_p (stmt)
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME)
+ cached_lhs = gimple_assign_rhs1 (stmt);
+ else if (gimple_assign_single_p (stmt)
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == ASSERT_EXPR)
+ cached_lhs = TREE_OPERAND (gimple_assign_rhs1 (stmt), 0);
else
{
/* A statement that is not a trivial copy or ASSERT_EXPR.
We're going to temporarily copy propagate the operands
and see if that allows us to simplify this statement. */
- tree *copy, pre_fold_expr;
+ tree *copy;
ssa_op_iter iter;
use_operand_p use_p;
unsigned int num, i = 0;
@@ -318,33 +370,17 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
}
/* Try to fold/lookup the new expression. Inserting the
- expression into the hash table is unlikely to help
- Sadly, we have to handle conditional assignments specially
- here, because fold expects all the operands of an expression
- to be folded before the expression itself is folded, but we
- can't just substitute the folded condition here. */
- if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == COND_EXPR)
- {
- tree cond = COND_EXPR_COND (GIMPLE_STMT_OPERAND (stmt, 1));
- cond = fold (cond);
- if (cond == boolean_true_node)
- pre_fold_expr = COND_EXPR_THEN (GIMPLE_STMT_OPERAND (stmt, 1));
- else if (cond == boolean_false_node)
- pre_fold_expr = COND_EXPR_ELSE (GIMPLE_STMT_OPERAND (stmt, 1));
- else
- pre_fold_expr = GIMPLE_STMT_OPERAND (stmt, 1);
- }
+ expression into the hash table is unlikely to help. */
+ if (is_gimple_call (stmt))
+ cached_lhs = fold_call_stmt (stmt, false);
else
- pre_fold_expr = GIMPLE_STMT_OPERAND (stmt, 1);
-
- if (pre_fold_expr)
- {
- cached_lhs = fold (pre_fold_expr);
- if (TREE_CODE (cached_lhs) != SSA_NAME
- && !is_gimple_min_invariant (cached_lhs))
- cached_lhs = (*simplify) (stmt, stmt);
- }
+ cached_lhs = fold_assignment_stmt (stmt);
+ if (!cached_lhs
+ || (TREE_CODE (cached_lhs) != SSA_NAME
+ && !is_gimple_min_invariant (cached_lhs)))
+ cached_lhs = (*simplify) (stmt, stmt);
+
/* Restore the statement's original uses/defs. */
i = 0;
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE | SSA_OP_VUSE)
@@ -358,16 +394,14 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
if (cached_lhs
&& (TREE_CODE (cached_lhs) == SSA_NAME
|| is_gimple_min_invariant (cached_lhs)))
- record_temporary_equivalence (GIMPLE_STMT_OPERAND (stmt, 0),
- cached_lhs,
- stack);
+ record_temporary_equivalence (gimple_get_lhs (stmt), cached_lhs, stack);
}
return stmt;
}
/* Simplify the control statement at the end of the block E->dest.
- To avoid allocating memory unnecessarily, a scratch COND_EXPR
+ To avoid allocating memory unnecessarily, a scratch GIMPLE_COND
is available to use/clobber in DUMMY_COND.
Use SIMPLIFY (a pointer to a callback function) to further simplify
@@ -378,30 +412,24 @@ record_temporary_equivalences_from_stmts_at_dest (edge e,
static tree
simplify_control_stmt_condition (edge e,
- tree stmt,
- tree dummy_cond,
- tree (*simplify) (tree, tree),
+ gimple stmt,
+ gimple dummy_cond,
+ tree (*simplify) (gimple, gimple),
bool handle_dominating_asserts)
{
tree cond, cached_lhs;
-
- if (TREE_CODE (stmt) == COND_EXPR)
- cond = COND_EXPR_COND (stmt);
- else if (TREE_CODE (stmt) == GOTO_EXPR)
- cond = GOTO_DESTINATION (stmt);
- else
- cond = SWITCH_COND (stmt);
+ enum gimple_code code = gimple_code (stmt);
/* For comparisons, we have to update both operands, then try
to simplify the comparison. */
- if (COMPARISON_CLASS_P (cond))
+ if (code == GIMPLE_COND)
{
tree op0, op1;
enum tree_code cond_code;
- op0 = TREE_OPERAND (cond, 0);
- op1 = TREE_OPERAND (cond, 1);
- cond_code = TREE_CODE (cond);
+ op0 = gimple_cond_lhs (stmt);
+ op1 = gimple_cond_rhs (stmt);
+ cond_code = gimple_cond_code (stmt);
/* Get the current value of both operands. */
if (TREE_CODE (op0) == SSA_NAME)
@@ -434,11 +462,10 @@ simplify_control_stmt_condition (edge e,
example, op0 might be a constant while op1 is an
SSA_NAME. Failure to canonicalize will cause us to
miss threading opportunities. */
- if (cond_code != SSA_NAME
- && tree_swap_operands_p (op0, op1, false))
+ if (tree_swap_operands_p (op0, op1, false))
{
tree tmp;
- cond_code = swap_tree_comparison (TREE_CODE (cond));
+ cond_code = swap_tree_comparison (cond_code);
tmp = op0;
op0 = op1;
op1 = tmp;
@@ -446,34 +473,46 @@ simplify_control_stmt_condition (edge e,
/* Stuff the operator and operands into our dummy conditional
expression. */
- TREE_SET_CODE (COND_EXPR_COND (dummy_cond), cond_code);
- TREE_OPERAND (COND_EXPR_COND (dummy_cond), 0) = op0;
- TREE_OPERAND (COND_EXPR_COND (dummy_cond), 1) = op1;
+ gimple_cond_set_code (dummy_cond, cond_code);
+ gimple_cond_set_lhs (dummy_cond, op0);
+ gimple_cond_set_rhs (dummy_cond, op1);
/* We absolutely do not care about any type conversions
we only care about a zero/nonzero value. */
fold_defer_overflow_warnings ();
- cached_lhs = fold (COND_EXPR_COND (dummy_cond));
- while (CONVERT_EXPR_P (cached_lhs))
- cached_lhs = TREE_OPERAND (cached_lhs, 0);
+ cached_lhs = fold_binary (cond_code, boolean_type_node, op0, op1);
+ if (cached_lhs)
+ while (CONVERT_EXPR_P (cached_lhs))
+ cached_lhs = TREE_OPERAND (cached_lhs, 0);
- fold_undefer_overflow_warnings (is_gimple_min_invariant (cached_lhs),
+ fold_undefer_overflow_warnings ((cached_lhs
+ && is_gimple_min_invariant (cached_lhs)),
stmt, WARN_STRICT_OVERFLOW_CONDITIONAL);
/* If we have not simplified the condition down to an invariant,
then use the pass specific callback to simplify the condition. */
- if (! is_gimple_min_invariant (cached_lhs))
- cached_lhs = (*simplify) (dummy_cond, stmt);
+ if (!cached_lhs
+ || !is_gimple_min_invariant (cached_lhs))
+ cached_lhs = (*simplify) (dummy_cond, stmt);
+
+ return cached_lhs;
}
+ if (code == GIMPLE_SWITCH)
+ cond = gimple_switch_index (stmt);
+ else if (code == GIMPLE_GOTO)
+ cond = gimple_goto_dest (stmt);
+ else
+ gcc_unreachable ();
+
/* We can have conditionals which just test the state of a variable
rather than use a relational operator. These are simpler to handle. */
- else if (TREE_CODE (cond) == SSA_NAME)
+ if (TREE_CODE (cond) == SSA_NAME)
{
cached_lhs = cond;
- /* Get the variable's current value from the equivalency chains.
+ /* Get the variable's current value from the equivalence chains.
It is possible to get loops in the SSA_NAME_VALUE chains
(consider threading the backedge of a loop where we have
@@ -527,13 +566,13 @@ simplify_control_stmt_condition (edge e,
SIMPLIFY is a pass-specific function used to simplify statements. */
void
-thread_across_edge (tree dummy_cond,
+thread_across_edge (gimple dummy_cond,
edge e,
bool handle_dominating_asserts,
VEC(tree, heap) **stack,
- tree (*simplify) (tree, tree))
+ tree (*simplify) (gimple, gimple))
{
- tree stmt;
+ gimple stmt;
/* If E is a backedge, then we want to verify that the COND_EXPR,
SWITCH_EXPR or GOTO_EXPR at the end of e->dest is not affected
@@ -543,15 +582,15 @@ thread_across_edge (tree dummy_cond,
{
ssa_op_iter iter;
use_operand_p use_p;
- tree last = bsi_stmt (bsi_last (e->dest));
+ gimple last = gsi_stmt (gsi_last_bb (e->dest));
FOR_EACH_SSA_USE_OPERAND (use_p, last, iter, SSA_OP_USE | SSA_OP_VUSE)
{
tree use = USE_FROM_PTR (use_p);
if (TREE_CODE (use) == SSA_NAME
- && TREE_CODE (SSA_NAME_DEF_STMT (use)) != PHI_NODE
- && bb_for_stmt (SSA_NAME_DEF_STMT (use)) == e->dest)
+ && gimple_code (SSA_NAME_DEF_STMT (use)) != GIMPLE_PHI
+ && gimple_bb (SSA_NAME_DEF_STMT (use)) == e->dest)
goto fail;
}
}
@@ -570,9 +609,9 @@ thread_across_edge (tree dummy_cond,
/* If we stopped at a COND_EXPR or SWITCH_EXPR, see if we know which arm
will be taken. */
- if (TREE_CODE (stmt) == COND_EXPR
- || TREE_CODE (stmt) == GOTO_EXPR
- || TREE_CODE (stmt) == SWITCH_EXPR)
+ if (gimple_code (stmt) == GIMPLE_COND
+ || gimple_code (stmt) == GIMPLE_GOTO
+ || gimple_code (stmt) == GIMPLE_SWITCH)
{
tree cond;
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c
index 54f87afaf68..b6d2fafaa0f 100644
--- a/gcc/tree-ssa-threadupdate.c
+++ b/gcc/tree-ssa-threadupdate.c
@@ -169,23 +169,23 @@ struct thread_stats_d thread_stats;
static void
remove_ctrl_stmt_and_useless_edges (basic_block bb, basic_block dest_bb)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
edge e;
edge_iterator ei;
- bsi = bsi_last (bb);
+ gsi = gsi_last_bb (bb);
/* If the duplicate ends with a control statement, then remove it.
Note that if we are duplicating the template block rather than the
original basic block, then the duplicate might not have any real
statements in it. */
- if (!bsi_end_p (bsi)
- && bsi_stmt (bsi)
- && (TREE_CODE (bsi_stmt (bsi)) == COND_EXPR
- || TREE_CODE (bsi_stmt (bsi)) == GOTO_EXPR
- || TREE_CODE (bsi_stmt (bsi)) == SWITCH_EXPR))
- bsi_remove (&bsi, true);
+ if (!gsi_end_p (gsi)
+ && gsi_stmt (gsi)
+ && (gimple_code (gsi_stmt (gsi)) == GIMPLE_COND
+ || gimple_code (gsi_stmt (gsi)) == GIMPLE_GOTO
+ || gimple_code (gsi_stmt (gsi)) == GIMPLE_SWITCH))
+ gsi_remove (&gsi, true);
for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); )
{
@@ -311,7 +311,7 @@ static void
create_edge_and_update_destination_phis (struct redirection_data *rd)
{
edge e = make_edge (rd->dup_block, rd->outgoing_edge->dest, EDGE_FALLTHRU);
- tree phi;
+ gimple_stmt_iterator gsi;
rescan_loop_exit (e, true, false);
e->probability = REG_BR_PROB_BASE;
@@ -322,10 +322,12 @@ create_edge_and_update_destination_phis (struct redirection_data *rd)
from the duplicate block, then we will need to add a new argument
to them. The argument should have the same value as the argument
associated with the outgoing edge stored in RD. */
- for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (e->dest); !gsi_end_p (gsi); gsi_next (&gsi))
{
+ gimple phi = gsi_stmt (gsi);
+
int indx = rd->outgoing_edge->dest_idx;
- add_phi_arg (phi, PHI_ARG_DEF (phi, indx), e);
+ add_phi_arg (phi, gimple_phi_arg_def (phi, indx), e);
}
}
@@ -468,24 +470,24 @@ redirect_edges (void **slot, void *data)
static bool
redirection_block_p (basic_block bb)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
/* Advance to the first executable statement. */
- bsi = bsi_start (bb);
- while (!bsi_end_p (bsi)
- && (TREE_CODE (bsi_stmt (bsi)) == LABEL_EXPR
- || IS_EMPTY_STMT (bsi_stmt (bsi))))
- bsi_next (&bsi);
-
+ gsi = gsi_start_bb (bb);
+ while (!gsi_end_p (gsi)
+ && (gimple_code (gsi_stmt (gsi)) == GIMPLE_LABEL
+ || gimple_nop_p (gsi_stmt (gsi))))
+ gsi_next (&gsi);
+
/* Check if this is an empty block. */
- if (bsi_end_p (bsi))
+ if (gsi_end_p (gsi))
return true;
/* Test that we've reached the terminating control statement. */
- return bsi_stmt (bsi)
- && (TREE_CODE (bsi_stmt (bsi)) == COND_EXPR
- || TREE_CODE (bsi_stmt (bsi)) == GOTO_EXPR
- || TREE_CODE (bsi_stmt (bsi)) == SWITCH_EXPR);
+ return gsi_stmt (gsi)
+ && (gimple_code (gsi_stmt (gsi)) == GIMPLE_COND
+ || gimple_code (gsi_stmt (gsi)) == GIMPLE_GOTO
+ || gimple_code (gsi_stmt (gsi)) == GIMPLE_SWITCH);
}
/* BB is a block which ends with a COND_EXPR or SWITCH_EXPR and when BB
@@ -992,7 +994,7 @@ mark_threaded_blocks (bitmap threaded_blocks)
/* If optimizing for size, only thread through block if we don't have
to duplicate it or it's an otherwise empty redirection block. */
- if (optimize_size)
+ if (optimize_function_for_size_p (cfun))
{
EXECUTE_IF_SET_IN_BITMAP (tmp, 0, i, bi)
{
diff --git a/gcc/tree-ssa-uncprop.c b/gcc/tree-ssa-uncprop.c
index 0d19c2dfa5f..335d7aed14b 100644
--- a/gcc/tree-ssa-uncprop.c
+++ b/gcc/tree-ssa-uncprop.c
@@ -1,5 +1,5 @@
/* Routines for discovering and unpropagating edge equivalences.
- Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc.
This file is part of GCC.
@@ -65,50 +65,35 @@ associate_equivalences_with_edges (void)
then it might create a useful equivalence. */
FOR_EACH_BB (bb)
{
- block_stmt_iterator bsi = bsi_last (bb);
- tree stmt;
+ gimple_stmt_iterator gsi = gsi_last_bb (bb);
+ gimple stmt;
/* If the block does not end with a COND_EXPR or SWITCH_EXPR
then there is nothing to do. */
- if (bsi_end_p (bsi))
+ if (gsi_end_p (gsi))
continue;
- stmt = bsi_stmt (bsi);
+ stmt = gsi_stmt (gsi);
if (!stmt)
continue;
/* A COND_EXPR may create an equivalency in a variety of different
ways. */
- if (TREE_CODE (stmt) == COND_EXPR)
+ if (gimple_code (stmt) == GIMPLE_COND)
{
- tree cond = COND_EXPR_COND (stmt);
edge true_edge;
edge false_edge;
struct edge_equivalency *equivalency;
+ enum tree_code code = gimple_cond_code (stmt);
extract_true_false_edges_from_block (bb, &true_edge, &false_edge);
- /* If the conditional is a single variable 'X', record 'X = 1'
- for the true edge and 'X = 0' on the false edge. */
- if (TREE_CODE (cond) == SSA_NAME
- && !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (cond))
- {
- equivalency = XNEW (struct edge_equivalency);
- equivalency->rhs = constant_boolean_node (1, TREE_TYPE (cond));
- equivalency->lhs = cond;
- true_edge->aux = equivalency;
-
- equivalency = XNEW (struct edge_equivalency);
- equivalency->rhs = constant_boolean_node (0, TREE_TYPE (cond));
- equivalency->lhs = cond;
- false_edge->aux = equivalency;
- }
/* Equality tests may create one or two equivalences. */
- else if (TREE_CODE (cond) == EQ_EXPR || TREE_CODE (cond) == NE_EXPR)
+ if (code == EQ_EXPR || code == NE_EXPR)
{
- tree op0 = TREE_OPERAND (cond, 0);
- tree op1 = TREE_OPERAND (cond, 1);
+ tree op0 = gimple_cond_lhs (stmt);
+ tree op1 = gimple_cond_rhs (stmt);
/* Special case comparing booleans against a constant as we
know the value of OP0 on both arms of the branch. i.e., we
@@ -118,7 +103,7 @@ associate_equivalences_with_edges (void)
&& TREE_CODE (TREE_TYPE (op0)) == BOOLEAN_TYPE
&& is_gimple_min_invariant (op1))
{
- if (TREE_CODE (cond) == EQ_EXPR)
+ if (code == EQ_EXPR)
{
equivalency = XNEW (struct edge_equivalency);
equivalency->lhs = op0;
@@ -170,7 +155,7 @@ associate_equivalences_with_edges (void)
equivalency = XNEW (struct edge_equivalency);
equivalency->lhs = op0;
equivalency->rhs = op1;
- if (TREE_CODE (cond) == EQ_EXPR)
+ if (code == EQ_EXPR)
true_edge->aux = equivalency;
else
false_edge->aux = equivalency;
@@ -184,15 +169,14 @@ associate_equivalences_with_edges (void)
/* For a SWITCH_EXPR, a case label which represents a single
value and which is the only case label which reaches the
target block creates an equivalence. */
- if (TREE_CODE (stmt) == SWITCH_EXPR)
+ else if (gimple_code (stmt) == GIMPLE_SWITCH)
{
- tree cond = SWITCH_COND (stmt);
+ tree cond = gimple_switch_index (stmt);
if (TREE_CODE (cond) == SSA_NAME
&& !SSA_NAME_OCCURS_IN_ABNORMAL_PHI (cond))
{
- tree labels = SWITCH_LABELS (stmt);
- int i, n_labels = TREE_VEC_LENGTH (labels);
+ int i, n_labels = gimple_switch_num_labels (stmt);
tree *info = XCNEWVEC (tree, n_basic_blocks);
/* Walk over the case label vector. Record blocks
@@ -200,10 +184,9 @@ associate_equivalences_with_edges (void)
a single value. */
for (i = 0; i < n_labels; i++)
{
- tree label = TREE_VEC_ELT (labels, i);
+ tree label = gimple_switch_label (stmt, i);
basic_block bb = label_to_block (CASE_LABEL (label));
-
if (CASE_HIGH (label)
|| !CASE_LOW (label)
|| info[bb->index])
@@ -475,11 +458,12 @@ uncprop_into_successor_phis (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
destination of the edge. Then remove the temporary equivalence. */
FOR_EACH_EDGE (e, ei, bb->succs)
{
- tree phi = phi_nodes (e->dest);
+ gimple_seq phis = phi_nodes (e->dest);
+ gimple_stmt_iterator gsi;
/* If there are no PHI nodes in this destination, then there is
no sense in recording any equivalences. */
- if (!phi)
+ if (!phis)
continue;
/* Record any equivalency associated with E. */
@@ -490,9 +474,10 @@ uncprop_into_successor_phis (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
}
/* Walk over the PHI nodes, unpropagating values. */
- for ( ; phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start (phis) ; !gsi_end_p (gsi); gsi_next (&gsi))
{
/* Sigh. We'll have more efficient access to this one day. */
+ gimple phi = gsi_stmt (gsi);
tree arg = PHI_ARG_DEF (phi, e->dest_idx);
struct equiv_hash_elt equiv_hash_elt;
void **slot;
@@ -624,3 +609,4 @@ struct gimple_opt_pass pass_uncprop =
TODO_dump_func | TODO_verify_ssa /* todo_flags_finish */
}
};
+
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 2ac1c1184ee..eed15c6773f 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -37,7 +37,7 @@ along with GCC; see the file COPYING3. If not see
#include "bitmap.h"
#include "pointer-set.h"
#include "tree-flow.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-inline.h"
#include "varray.h"
#include "timevar.h"
@@ -171,19 +171,23 @@ redirect_edge_var_map_destroy (void)
edge
ssa_redirect_edge (edge e, basic_block dest)
{
- tree phi;
+ gimple_stmt_iterator gsi;
+ gimple phi;
redirect_edge_var_map_clear (e);
/* Remove the appropriate PHI arguments in E's destination block. */
- for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (e->dest); !gsi_end_p (gsi); gsi_next (&gsi))
{
- tree def = PHI_ARG_DEF (phi, e->dest_idx);
+ tree def;
+
+ phi = gsi_stmt (gsi);
+ def = gimple_phi_arg_def (phi, e->dest_idx);
if (def == NULL_TREE)
continue;
- redirect_edge_var_map_add (e, PHI_RESULT (phi), def);
+ redirect_edge_var_map_add (e, gimple_phi_result (phi), def);
}
e = redirect_edge_succ_nodup (e, dest);
@@ -191,26 +195,31 @@ ssa_redirect_edge (edge e, basic_block dest)
return e;
}
+
/* Add PHI arguments queued in PENDING_STMT list on edge E to edge
E->dest. */
void
flush_pending_stmts (edge e)
{
- tree phi;
+ gimple phi;
edge_var_map_vector v;
edge_var_map *vm;
int i;
+ gimple_stmt_iterator gsi;
v = redirect_edge_var_map_vector (e);
if (!v)
return;
- for (phi = phi_nodes (e->dest), i = 0;
- phi && VEC_iterate (edge_var_map, v, i, vm);
- phi = PHI_CHAIN (phi), i++)
+ for (gsi = gsi_start_phis (e->dest), i = 0;
+ !gsi_end_p (gsi) && VEC_iterate (edge_var_map, v, i, vm);
+ gsi_next (&gsi), i++)
{
- tree def = redirect_edge_var_map_def (vm);
+ tree def;
+
+ phi = gsi_stmt (gsi);
+ def = redirect_edge_var_map_def (vm);
add_phi_arg (phi, def, e);
}
@@ -256,7 +265,7 @@ verify_ssa_name (tree ssa_name, bool is_virtual)
}
if (SSA_NAME_IS_DEFAULT_DEF (ssa_name)
- && !IS_EMPTY_STMT (SSA_NAME_DEF_STMT (ssa_name)))
+ && !gimple_nop_p (SSA_NAME_DEF_STMT (ssa_name)))
{
error ("found a default name with a non-empty defining statement");
return true;
@@ -279,7 +288,7 @@ verify_ssa_name (tree ssa_name, bool is_virtual)
static bool
verify_def (basic_block bb, basic_block *definition_block, tree ssa_name,
- tree stmt, bool is_virtual)
+ gimple stmt, bool is_virtual)
{
if (verify_ssa_name (ssa_name, is_virtual))
goto err;
@@ -297,9 +306,9 @@ verify_def (basic_block bb, basic_block *definition_block, tree ssa_name,
{
error ("SSA_NAME_DEF_STMT is wrong");
fprintf (stderr, "Expected definition statement:\n");
- print_generic_stmt (stderr, SSA_NAME_DEF_STMT (ssa_name), TDF_VOPS);
+ print_gimple_stmt (stderr, SSA_NAME_DEF_STMT (ssa_name), 4, TDF_VOPS);
fprintf (stderr, "\nActual definition statement:\n");
- print_generic_stmt (stderr, stmt, TDF_VOPS);
+ print_gimple_stmt (stderr, stmt, 4, TDF_VOPS);
goto err;
}
@@ -309,7 +318,7 @@ err:
fprintf (stderr, "while verifying SSA_NAME ");
print_generic_expr (stderr, ssa_name, 0);
fprintf (stderr, " in statement\n");
- print_generic_stmt (stderr, stmt, TDF_VOPS);
+ print_gimple_stmt (stderr, stmt, 4, TDF_VOPS);
return true;
}
@@ -331,7 +340,7 @@ err:
static bool
verify_use (basic_block bb, basic_block def_bb, use_operand_p use_p,
- tree stmt, bool check_abnormal, bitmap names_defined_in_bb)
+ gimple stmt, bool check_abnormal, bitmap names_defined_in_bb)
{
bool err = false;
tree ssa_name = USE_FROM_PTR (use_p);
@@ -342,7 +351,7 @@ verify_use (basic_block bb, basic_block def_bb, use_operand_p use_p,
TREE_VISITED (ssa_name) = 1;
- if (IS_EMPTY_STMT (SSA_NAME_DEF_STMT (ssa_name))
+ if (gimple_nop_p (SSA_NAME_DEF_STMT (ssa_name))
&& SSA_NAME_IS_DEFAULT_DEF (ssa_name))
; /* Default definitions have empty statements. Nothing to do. */
else if (!def_bb)
@@ -381,9 +390,9 @@ verify_use (basic_block bb, basic_block def_bb, use_operand_p use_p,
}
else
{
- tree listvar ;
+ tree listvar;
if (use_p->prev->use == NULL)
- listvar = use_p->prev->stmt;
+ listvar = use_p->prev->loc.ssa_name;
else
listvar = USE_FROM_PTR (use_p->prev);
if (listvar != ssa_name)
@@ -398,7 +407,7 @@ verify_use (basic_block bb, basic_block def_bb, use_operand_p use_p,
fprintf (stderr, "for SSA_NAME: ");
print_generic_expr (stderr, ssa_name, TDF_VOPS);
fprintf (stderr, " in statement:\n");
- print_generic_stmt (stderr, stmt, TDF_VOPS);
+ print_gimple_stmt (stderr, stmt, 0, TDF_VOPS);
}
return err;
@@ -414,11 +423,11 @@ verify_use (basic_block bb, basic_block def_bb, use_operand_p use_p,
definition of SSA_NAME. */
static bool
-verify_phi_args (tree phi, basic_block bb, basic_block *definition_block)
+verify_phi_args (gimple phi, basic_block bb, basic_block *definition_block)
{
edge e;
bool err = false;
- unsigned i, phi_num_args = PHI_NUM_ARGS (phi);
+ size_t i, phi_num_args = gimple_phi_num_args (phi);
if (EDGE_COUNT (bb->preds) != phi_num_args)
{
@@ -429,7 +438,7 @@ verify_phi_args (tree phi, basic_block bb, basic_block *definition_block)
for (i = 0; i < phi_num_args; i++)
{
- use_operand_p op_p = PHI_ARG_DEF_PTR (phi, i);
+ use_operand_p op_p = gimple_phi_arg_imm_use_ptr (phi, i);
tree op = USE_FROM_PTR (op_p);
e = EDGE_PRED (bb, i);
@@ -451,7 +460,7 @@ verify_phi_args (tree phi, basic_block bb, basic_block *definition_block)
if (TREE_CODE (op) == SSA_NAME)
{
- err = verify_ssa_name (op, !is_gimple_reg (PHI_RESULT (phi)));
+ err = verify_ssa_name (op, !is_gimple_reg (gimple_phi_result (phi)));
err |= verify_use (e->src, definition_block[SSA_NAME_VERSION (op)],
op_p, phi, e->flags & EDGE_ABNORMAL, NULL);
}
@@ -475,7 +484,7 @@ error:
if (err)
{
fprintf (stderr, "for PHI node\n");
- print_generic_stmt (stderr, phi, TDF_VOPS|TDF_MEMSYMS);
+ print_gimple_stmt (stderr, phi, 0, TDF_VOPS|TDF_MEMSYMS);
}
@@ -735,13 +744,13 @@ verify_ssa (bool check_modified_stmt)
tree name = ssa_name (i);
if (name)
{
- tree stmt;
+ gimple stmt;
TREE_VISITED (name) = 0;
stmt = SSA_NAME_DEF_STMT (name);
- if (!IS_EMPTY_STMT (stmt))
+ if (!gimple_nop_p (stmt))
{
- basic_block bb = bb_for_stmt (stmt);
+ basic_block bb = gimple_bb (stmt);
verify_def (bb, definition_block,
name, stmt, !is_gimple_reg (name));
@@ -756,9 +765,9 @@ verify_ssa (bool check_modified_stmt)
FOR_EACH_BB (bb)
{
edge e;
- tree phi;
+ gimple phi;
edge_iterator ei;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
/* Make sure that all edges have a clear 'aux' field. */
FOR_EACH_EDGE (e, ei, bb->preds)
@@ -772,45 +781,46 @@ verify_ssa (bool check_modified_stmt)
}
/* Verify the arguments for every PHI node in the block. */
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
+ phi = gsi_stmt (gsi);
if (verify_phi_args (phi, bb, definition_block))
goto err;
bitmap_set_bit (names_defined_in_bb,
- SSA_NAME_VERSION (PHI_RESULT (phi)));
+ SSA_NAME_VERSION (gimple_phi_result (phi)));
}
/* Now verify all the uses and vuses in every statement of the block. */
- 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))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
use_operand_p use_p;
- if (check_modified_stmt && stmt_modified_p (stmt))
+ if (check_modified_stmt && gimple_modified_p (stmt))
{
error ("stmt (%p) marked modified after optimization pass: ",
(void *)stmt);
- print_generic_stmt (stderr, stmt, TDF_VOPS);
+ print_gimple_stmt (stderr, stmt, 0, TDF_VOPS);
goto err;
}
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) != SSA_NAME)
+ if (is_gimple_assign (stmt)
+ && TREE_CODE (gimple_assign_lhs (stmt)) != SSA_NAME)
{
tree lhs, base_address;
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
+ lhs = gimple_assign_lhs (stmt);
base_address = get_base_address (lhs);
if (base_address
&& gimple_aliases_computed_p (cfun)
&& SSA_VAR_P (base_address)
- && !stmt_ann (stmt)->has_volatile_ops
+ && !gimple_has_volatile_ops (stmt)
&& ZERO_SSA_OPERANDS (stmt, SSA_OP_VDEF))
{
error ("statement makes a memory store, but has no VDEFS");
- print_generic_stmt (stderr, stmt, TDF_VOPS);
+ print_gimple_stmt (stderr, stmt, 0, TDF_VOPS);
goto err;
}
}
@@ -820,7 +830,7 @@ verify_ssa (bool check_modified_stmt)
if (verify_ssa_name (op, true))
{
error ("in statement");
- print_generic_stmt (stderr, stmt, TDF_VOPS|TDF_MEMSYMS);
+ print_gimple_stmt (stderr, stmt, 0, TDF_VOPS|TDF_MEMSYMS);
goto err;
}
}
@@ -830,7 +840,7 @@ verify_ssa (bool check_modified_stmt)
if (verify_ssa_name (op, false))
{
error ("in statement");
- print_generic_stmt (stderr, stmt, TDF_VOPS|TDF_MEMSYMS);
+ print_gimple_stmt (stderr, stmt, 0, TDF_VOPS|TDF_MEMSYMS);
goto err;
}
}
@@ -951,7 +961,7 @@ delete_tree_ssa (void)
{
size_t i;
basic_block bb;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
referenced_var_iterator rvi;
tree var;
@@ -967,17 +977,32 @@ delete_tree_ssa (void)
release_ssa_name (var);
}
- /* Remove annotations from every tree in the function. */
+ /* FIXME. This may not be necessary. We will release all this
+ memory en masse in free_ssa_operands. This clearing used to be
+ necessary to avoid problems with the inliner, but it may not be
+ needed anymore. */
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))
{
- tree stmt = bsi_stmt (bsi);
- stmt_ann_t ann = get_stmt_ann (stmt);
+ gimple stmt = gsi_stmt (gsi);
+
+ if (gimple_has_ops (stmt))
+ {
+ gimple_set_def_ops (stmt, NULL);
+ gimple_set_use_ops (stmt, NULL);
+ gimple_set_addresses_taken (stmt, NULL);
+ }
- free_ssa_operands (&ann->operands);
- ann->addresses_taken = 0;
- mark_stmt_modified (stmt);
+ if (gimple_has_mem_ops (stmt))
+ {
+ gimple_set_vdef_ops (stmt, NULL);
+ gimple_set_vuse_ops (stmt, NULL);
+ BITMAP_FREE (stmt->gsmem.membase.stores);
+ BITMAP_FREE (stmt->gsmem.membase.loads);
+ }
+
+ gimple_set_modified (stmt, true);
}
set_phi_nodes (bb, NULL);
}
@@ -1001,7 +1026,8 @@ delete_tree_ssa (void)
fini_ssanames ();
fini_phinodes ();
- /* we no longer maintain the SSA operand cache at this point. */
+
+ /* We no longer maintain the SSA operand cache at this point. */
if (ssa_operands_active ())
fini_ssa_operands ();
@@ -1139,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;
}
@@ -1209,12 +1241,9 @@ tree_ssa_useless_type_conversion (tree expr)
if (CONVERT_EXPR_P (expr)
|| TREE_CODE (expr) == VIEW_CONVERT_EXPR
|| TREE_CODE (expr) == NON_LVALUE_EXPR)
- /* FIXME: Use of GENERIC_TREE_TYPE here is a temporary measure to work
- around known bugs with GIMPLE_MODIFY_STMTs appearing in places
- they shouldn't. See PR 30391. */
return useless_type_conversion_p
(TREE_TYPE (expr),
- GENERIC_TREE_TYPE (TREE_OPERAND (expr, 0)));
+ TREE_TYPE (TREE_OPERAND (expr, 0)));
return false;
}
@@ -1238,33 +1267,33 @@ static bool
walk_use_def_chains_1 (tree var, walk_use_def_chains_fn fn, void *data,
struct pointer_set_t *visited, bool is_dfs)
{
- tree def_stmt;
+ gimple def_stmt;
if (pointer_set_insert (visited, var))
return false;
def_stmt = SSA_NAME_DEF_STMT (var);
- if (TREE_CODE (def_stmt) != PHI_NODE)
+ if (gimple_code (def_stmt) != GIMPLE_PHI)
{
/* If we reached the end of the use-def chain, call FN. */
return fn (var, def_stmt, data);
}
else
{
- int i;
+ size_t i;
/* When doing a breadth-first search, call FN before following the
use-def links for each argument. */
if (!is_dfs)
- for (i = 0; i < PHI_NUM_ARGS (def_stmt); i++)
- if (fn (PHI_ARG_DEF (def_stmt, i), def_stmt, data))
+ for (i = 0; i < gimple_phi_num_args (def_stmt); i++)
+ if (fn (gimple_phi_arg_def (def_stmt, i), def_stmt, data))
return true;
/* Follow use-def links out of each PHI argument. */
- for (i = 0; i < PHI_NUM_ARGS (def_stmt); i++)
+ for (i = 0; i < gimple_phi_num_args (def_stmt); i++)
{
- tree arg = PHI_ARG_DEF (def_stmt, i);
+ tree arg = gimple_phi_arg_def (def_stmt, i);
/* ARG may be NULL for newly introduced PHI nodes. */
if (arg
@@ -1276,8 +1305,8 @@ walk_use_def_chains_1 (tree var, walk_use_def_chains_fn fn, void *data,
/* When doing a depth-first search, call FN after following the
use-def links for each argument. */
if (is_dfs)
- for (i = 0; i < PHI_NUM_ARGS (def_stmt); i++)
- if (fn (PHI_ARG_DEF (def_stmt, i), def_stmt, data))
+ for (i = 0; i < gimple_phi_num_args (def_stmt); i++)
+ if (fn (gimple_phi_arg_def (def_stmt, i), def_stmt, data))
return true;
}
@@ -1310,7 +1339,7 @@ void
walk_use_def_chains (tree var, walk_use_def_chains_fn fn, void *data,
bool is_dfs)
{
- tree def_stmt;
+ gimple def_stmt;
gcc_assert (TREE_CODE (var) == SSA_NAME);
@@ -1318,7 +1347,7 @@ walk_use_def_chains (tree var, walk_use_def_chains_fn fn, void *data,
/* We only need to recurse if the reaching definition comes from a PHI
node. */
- if (TREE_CODE (def_stmt) != PHI_NODE)
+ if (gimple_code (def_stmt) != GIMPLE_PHI)
(*fn) (var, def_stmt, data);
else
{
@@ -1345,7 +1374,7 @@ ssa_undefined_value_p (tree t)
return false;
/* The value is undefined iff its definition statement is empty. */
- return IS_EMPTY_STMT (SSA_NAME_DEF_STMT (t));
+ return gimple_nop_p (SSA_NAME_DEF_STMT (t));
}
/* Emit warnings for uninitialized variables. This is done in two passes.
@@ -1370,8 +1399,8 @@ static void
warn_uninit (tree t, const char *gmsgid, void *data)
{
tree var = SSA_NAME_VAR (t);
- tree context = (tree) data;
- location_t *locus;
+ gimple context = (gimple) data;
+ location_t location;
expanded_location xloc, floc;
if (!ssa_undefined_value_p (t))
@@ -1382,23 +1411,30 @@ warn_uninit (tree t, const char *gmsgid, void *data)
if (TREE_NO_WARNING (var))
return;
- locus = (context != NULL && EXPR_HAS_LOCATION (context)
- ? EXPR_LOCUS (context)
- : &DECL_SOURCE_LOCATION (var));
- warning_at (*locus, OPT_Wuninitialized, gmsgid, var);
- xloc = expand_location (*locus);
+ /* 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);
+ 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 {
- tree stmt;
+ gimple stmt;
bool always_executed;
+ bool warn_possibly_uninitialized;
};
/* Called via walk_tree, look for SSA_NAMEs that have empty definitions
@@ -1407,18 +1443,57 @@ struct walk_data {
static tree
warn_uninitialized_var (tree *tp, int *walk_subtrees, void *data_)
{
- struct walk_data *data = (struct walk_data *)data_;
+ struct walk_stmt_info *wi = (struct walk_stmt_info *) 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;
@@ -1446,17 +1521,17 @@ warn_uninitialized_var (tree *tp, int *walk_subtrees, void *data_)
and warn about them. */
static void
-warn_uninitialized_phi (tree phi)
+warn_uninitialized_phi (gimple phi)
{
- int i, n = PHI_NUM_ARGS (phi);
+ size_t i, n = gimple_phi_num_args (phi);
/* Don't look at memory tags. */
- if (!is_gimple_reg (PHI_RESULT (phi)))
+ if (!is_gimple_reg (gimple_phi_result (phi)))
return;
for (i = 0; i < n; ++i)
{
- tree op = PHI_ARG_DEF (phi, i);
+ tree op = gimple_phi_arg_def (phi, i);
if (TREE_CODE (op) == SSA_NAME)
warn_uninit (op, "%qD may be used uninitialized in this function",
NULL);
@@ -1464,42 +1539,60 @@ warn_uninitialized_phi (tree phi)
}
static unsigned int
-execute_early_warn_uninitialized (void)
+warn_uninitialized_vars (bool warn_possibly_uninitialized)
{
- block_stmt_iterator bsi;
+ 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)
{
data.always_executed = dominated_by_p (CDI_POST_DOMINATORS,
single_succ (ENTRY_BLOCK_PTR), bb);
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- {
- data.stmt = bsi_stmt (bsi);
- walk_tree (bsi_stmt_ptr (bsi), warn_uninitialized_var,
- &data, NULL);
- }
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ struct walk_stmt_info wi;
+ data.stmt = gsi_stmt (gsi);
+ memset (&wi, 0, sizeof (wi));
+ wi.info = &data;
+ walk_gimple_op (gsi_stmt (gsi), warn_uninitialized_var, &wi);
+ }
}
return 0;
}
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;
- tree phi;
+ gimple_stmt_iterator gsi;
/* 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 (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- warn_uninitialized_phi (phi);
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ warn_uninitialized_phi (gsi_stmt (gsi));
+
return 0;
}
@@ -1554,32 +1647,33 @@ execute_update_addresses_taken (void)
{
tree var;
referenced_var_iterator rvi;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
basic_block bb;
bitmap addresses_taken = BITMAP_ALLOC (NULL);
bitmap vars_updated = BITMAP_ALLOC (NULL);
bool update_vops = false;
- tree phi;
/* Collect into ADDRESSES_TAKEN all variables whose address is taken within
the function body. */
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_ann_t s_ann = stmt_ann (bsi_stmt (bsi));
-
- if (s_ann->addresses_taken)
- bitmap_ior_into (addresses_taken, s_ann->addresses_taken);
+ bitmap taken = gimple_addresses_taken (gsi_stmt (gsi));
+ if (taken)
+ bitmap_ior_into (addresses_taken, taken);
}
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- unsigned i, phi_num_args = PHI_NUM_ARGS (phi);
- for (i = 0; i < phi_num_args; i++)
+ size_t i;
+ gimple phi = gsi_stmt (gsi);
+
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
{
tree op = PHI_ARG_DEF (phi, i), var;
if (TREE_CODE (op) == ADDR_EXPR
- && (var = get_base_address (TREE_OPERAND (op, 0))) != NULL_TREE
+ && (var = get_base_address (TREE_OPERAND (op, 0))) != NULL
&& DECL_P (var))
bitmap_set_bit (addresses_taken, DECL_UID (var));
}
@@ -1611,14 +1705,14 @@ execute_update_addresses_taken (void)
variables. */
if (update_vops)
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))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
- if ((LOADED_SYMS (stmt)
- && bitmap_intersect_p (LOADED_SYMS (stmt), vars_updated))
- || (STORED_SYMS (stmt)
- && bitmap_intersect_p (STORED_SYMS (stmt), vars_updated)))
+ if ((gimple_loaded_syms (stmt)
+ && bitmap_intersect_p (gimple_loaded_syms (stmt), vars_updated))
+ || (gimple_stored_syms (stmt)
+ && bitmap_intersect_p (gimple_stored_syms (stmt), vars_updated)))
update_stmt (stmt);
}
BITMAP_FREE (addresses_taken);
diff --git a/gcc/tree-ssanames.c b/gcc/tree-ssanames.c
index 8d675b43c49..f3101d28271 100644
--- a/gcc/tree-ssanames.c
+++ b/gcc/tree-ssanames.c
@@ -115,17 +115,12 @@ ssanames_print_statistics (void)
used without a preceding definition). */
tree
-make_ssa_name_fn (struct function *fn, tree var, tree stmt)
+make_ssa_name_fn (struct function *fn, tree var, gimple stmt)
{
tree t;
use_operand_p imm;
- gcc_assert (DECL_P (var)
- || TREE_CODE (var) == INDIRECT_REF);
-
- gcc_assert (!stmt
- || EXPR_P (stmt) || GIMPLE_STMT_P (stmt)
- || TREE_CODE (stmt) == PHI_NODE);
+ gcc_assert (DECL_P (var));
/* If our free list has an element, then use it. */
if (FREE_SSANAMES (fn))
@@ -161,7 +156,7 @@ make_ssa_name_fn (struct function *fn, tree var, tree stmt)
imm->use = NULL;
imm->prev = imm;
imm->next = imm;
- imm->stmt = t;
+ imm->loc.ssa_name = t;
return t;
}
@@ -219,7 +214,8 @@ release_ssa_name (tree var)
imm->prev = imm;
imm->next = imm;
- imm->stmt = var;
+ imm->loc.ssa_name = var;
+
/* First put back the right tree node so that the tree checking
macros do not complain. */
TREE_SET_CODE (var, SSA_NAME);
@@ -243,7 +239,7 @@ release_ssa_name (tree var)
/* Creates a duplicate of a ssa name NAME defined in statement STMT. */
tree
-duplicate_ssa_name (tree name, tree stmt)
+duplicate_ssa_name (tree name, gimple stmt)
{
tree new_name = make_ssa_name (SSA_NAME_VAR (name), stmt);
struct ptr_info_def *old_ptr_info = SSA_NAME_PTR_INFO (name);
@@ -285,7 +281,7 @@ duplicate_ssa_name_ptr_info (tree name, struct ptr_info_def *ptr_info)
/* Release all the SSA_NAMEs created by STMT. */
void
-release_defs (tree stmt)
+release_defs (gimple stmt)
{
tree def;
ssa_op_iter iter;
diff --git a/gcc/tree-stdarg.c b/gcc/tree-stdarg.c
index f9228872dc2..00fce82e750 100644
--- a/gcc/tree-stdarg.c
+++ b/gcc/tree-stdarg.c
@@ -112,7 +112,8 @@ static unsigned HOST_WIDE_INT
va_list_counter_bump (struct stdarg_info *si, tree counter, tree rhs,
bool gpr_p)
{
- tree stmt, lhs, orig_lhs;
+ tree lhs, orig_lhs;
+ gimple stmt;
unsigned HOST_WIDE_INT ret = 0, val, counter_val;
unsigned int max_size;
@@ -130,6 +131,8 @@ va_list_counter_bump (struct stdarg_info *si, tree counter, tree rhs,
orig_lhs = lhs = rhs;
while (lhs)
{
+ enum tree_code rhs_code;
+
if (si->offsets[SSA_NAME_VERSION (lhs)] != -1)
{
if (counter_val >= max_size)
@@ -144,38 +147,32 @@ va_list_counter_bump (struct stdarg_info *si, tree counter, tree rhs,
stmt = SSA_NAME_DEF_STMT (lhs);
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT
- || GIMPLE_STMT_OPERAND (stmt, 0) != lhs)
+ if (!is_gimple_assign (stmt) || gimple_assign_lhs (stmt) != lhs)
return (unsigned HOST_WIDE_INT) -1;
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
- rhs = TREE_OPERAND (rhs, 0);
-
- if (TREE_CODE (rhs) == SSA_NAME)
+ rhs_code = gimple_assign_rhs_code (stmt);
+ if ((get_gimple_rhs_class (rhs_code) == GIMPLE_SINGLE_RHS
+ || gimple_assign_cast_p (stmt))
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME)
{
- lhs = rhs;
+ lhs = gimple_assign_rhs1 (stmt);
continue;
}
- if (CONVERT_EXPR_P (rhs)
- && TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME)
+ if ((rhs_code == POINTER_PLUS_EXPR
+ || rhs_code == PLUS_EXPR)
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME
+ && host_integerp (gimple_assign_rhs2 (stmt), 1))
{
- lhs = TREE_OPERAND (rhs, 0);
+ ret += tree_low_cst (gimple_assign_rhs2 (stmt), 1);
+ lhs = gimple_assign_rhs1 (stmt);
continue;
}
- if ((TREE_CODE (rhs) == POINTER_PLUS_EXPR
- || TREE_CODE (rhs) == PLUS_EXPR)
- && TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME
- && TREE_CODE (TREE_OPERAND (rhs, 1)) == INTEGER_CST
- && host_integerp (TREE_OPERAND (rhs, 1), 1))
- {
- ret += tree_low_cst (TREE_OPERAND (rhs, 1), 1);
- lhs = TREE_OPERAND (rhs, 0);
- continue;
- }
+ if (get_gimple_rhs_class (rhs_code) != GIMPLE_SINGLE_RHS)
+ return (unsigned HOST_WIDE_INT) -1;
+ rhs = gimple_assign_rhs1 (stmt);
if (TREE_CODE (counter) != TREE_CODE (rhs))
return (unsigned HOST_WIDE_INT) -1;
@@ -196,6 +193,8 @@ va_list_counter_bump (struct stdarg_info *si, tree counter, tree rhs,
val = ret + counter_val;
while (lhs)
{
+ enum tree_code rhs_code;
+
if (si->offsets[SSA_NAME_VERSION (lhs)] != -1)
break;
@@ -206,31 +205,22 @@ va_list_counter_bump (struct stdarg_info *si, tree counter, tree rhs,
stmt = SSA_NAME_DEF_STMT (lhs);
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
- rhs = TREE_OPERAND (rhs, 0);
-
- if (TREE_CODE (rhs) == SSA_NAME)
+ rhs_code = gimple_assign_rhs_code (stmt);
+ if ((get_gimple_rhs_class (rhs_code) == GIMPLE_SINGLE_RHS
+ || gimple_assign_cast_p (stmt))
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME)
{
- lhs = rhs;
+ lhs = gimple_assign_rhs1 (stmt);
continue;
}
- if (CONVERT_EXPR_P (rhs)
- && TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME)
+ if ((rhs_code == POINTER_PLUS_EXPR
+ || rhs_code == PLUS_EXPR)
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME
+ && host_integerp (gimple_assign_rhs2 (stmt), 1))
{
- lhs = TREE_OPERAND (rhs, 0);
- continue;
- }
-
- if ((TREE_CODE (rhs) == POINTER_PLUS_EXPR
- || TREE_CODE (rhs) == PLUS_EXPR)
- && TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME
- && TREE_CODE (TREE_OPERAND (rhs, 1)) == INTEGER_CST
- && host_integerp (TREE_OPERAND (rhs, 1), 1))
- {
- val -= tree_low_cst (TREE_OPERAND (rhs, 1), 1);
- lhs = TREE_OPERAND (rhs, 0);
+ val -= tree_low_cst (gimple_assign_rhs2 (stmt), 1);
+ lhs = gimple_assign_rhs1 (stmt);
continue;
}
@@ -247,7 +237,7 @@ static tree
find_va_list_reference (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
void *data)
{
- bitmap va_list_vars = (bitmap) data;
+ bitmap va_list_vars = (bitmap) ((struct walk_stmt_info *) data)->info;
tree var = *tp;
if (TREE_CODE (var) == SSA_NAME)
@@ -442,12 +432,6 @@ check_va_list_escapes (struct stdarg_info *si, tree lhs, tree rhs)
if (! POINTER_TYPE_P (TREE_TYPE (rhs)))
return;
- if (((TREE_CODE (rhs) == POINTER_PLUS_EXPR
- || TREE_CODE (rhs) == PLUS_EXPR)
- && TREE_CODE (TREE_OPERAND (rhs, 1)) == INTEGER_CST)
- || CONVERT_EXPR_P (rhs))
- rhs = TREE_OPERAND (rhs, 0);
-
if (TREE_CODE (rhs) != SSA_NAME
|| ! bitmap_bit_p (si->va_list_escape_vars,
DECL_UID (SSA_NAME_VAR (rhs))))
@@ -504,11 +488,12 @@ check_all_va_list_escapes (struct stdarg_info *si)
FOR_EACH_BB (bb)
{
- block_stmt_iterator i;
+ gimple_stmt_iterator i;
- for (i = bsi_start (bb); !bsi_end_p (i); bsi_next (&i))
+ for (i = gsi_start_bb (bb); !gsi_end_p (i); gsi_next (&i))
{
- tree stmt = bsi_stmt (i), use;
+ gimple stmt = gsi_stmt (i);
+ tree use;
ssa_op_iter iter;
FOR_EACH_SSA_TREE_OPERAND (use, stmt, iter, SSA_OP_ALL_USES)
@@ -517,16 +502,13 @@ check_all_va_list_escapes (struct stdarg_info *si)
DECL_UID (SSA_NAME_VAR (use))))
continue;
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_assign (stmt))
{
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
-
- if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
- rhs = TREE_OPERAND (rhs, 0);
+ tree rhs = gimple_assign_rhs1 (stmt);
+ enum tree_code rhs_code = gimple_assign_rhs_code (stmt);
/* x = *ap_temp; */
- if (TREE_CODE (rhs) == INDIRECT_REF
+ if (gimple_assign_rhs_code (stmt) == INDIRECT_REF
&& TREE_OPERAND (rhs, 0) == use
&& TYPE_SIZE_UNIT (TREE_TYPE (rhs))
&& host_integerp (TYPE_SIZE_UNIT (TREE_TYPE (rhs)), 1)
@@ -550,13 +532,16 @@ check_all_va_list_escapes (struct stdarg_info *si)
other_ap_temp = (some_type *) ap_temp;
ap = ap_temp;
statements. */
- if ((TREE_CODE (rhs) == POINTER_PLUS_EXPR
- && TREE_CODE (TREE_OPERAND (rhs, 1)) == INTEGER_CST)
- || CONVERT_EXPR_P (rhs))
- rhs = TREE_OPERAND (rhs, 0);
-
- if (rhs == use)
+ if (rhs == use
+ && ((rhs_code == POINTER_PLUS_EXPR
+ && (TREE_CODE (gimple_assign_rhs2 (stmt))
+ == INTEGER_CST))
+ || gimple_assign_cast_p (stmt)
+ || (get_gimple_rhs_class (rhs_code)
+ == GIMPLE_SINGLE_RHS)))
{
+ tree lhs = gimple_assign_lhs (stmt);
+
if (TREE_CODE (lhs) == SSA_NAME
&& bitmap_bit_p (si->va_list_escape_vars,
DECL_UID (SSA_NAME_VAR (lhs))))
@@ -572,7 +557,7 @@ check_all_va_list_escapes (struct stdarg_info *si)
if (dump_file && (dump_flags & TDF_DETAILS))
{
fputs ("va_list escapes in ", dump_file);
- print_generic_expr (dump_file, stmt, dump_flags);
+ print_gimple_stmt (dump_file, stmt, 0, dump_flags);
fputc ('\n', dump_file);
}
return true;
@@ -604,6 +589,7 @@ execute_optimize_stdarg (void)
bool va_list_escapes = false;
bool va_list_simple_ptr;
struct stdarg_info si;
+ struct walk_stmt_info wi;
const char *funcname = NULL;
tree cfun_va_list;
@@ -624,18 +610,17 @@ execute_optimize_stdarg (void)
FOR_EACH_BB (bb)
{
- block_stmt_iterator i;
+ gimple_stmt_iterator i;
- for (i = bsi_start (bb); !bsi_end_p (i); bsi_next (&i))
+ for (i = gsi_start_bb (bb); !gsi_end_p (i); gsi_next (&i))
{
- tree stmt = bsi_stmt (i);
- tree call = get_call_expr_in (stmt), callee;
- tree ap;
+ gimple stmt = gsi_stmt (i);
+ tree callee, ap;
- if (!call)
+ if (!is_gimple_call (stmt))
continue;
- callee = get_callee_fndecl (call);
+ callee = gimple_call_fndecl (stmt);
if (!callee
|| DECL_BUILT_IN_CLASS (callee) != BUILT_IN_NORMAL)
continue;
@@ -655,7 +640,7 @@ execute_optimize_stdarg (void)
}
si.va_start_count++;
- ap = CALL_EXPR_ARG (call, 0);
+ ap = gimple_call_arg (stmt, 0);
if (TREE_CODE (ap) != ADDR_EXPR)
{
@@ -731,10 +716,12 @@ execute_optimize_stdarg (void)
cfun->va_list_fpr_size = VA_LIST_MAX_FPR_SIZE;
calculate_dominance_info (CDI_DOMINATORS);
+ memset (&wi, 0, sizeof (wi));
+ wi.info = si.va_list_vars;
FOR_EACH_BB (bb)
{
- block_stmt_iterator i;
+ gimple_stmt_iterator i;
si.compute_sizes = -1;
si.bb = bb;
@@ -745,12 +732,13 @@ execute_optimize_stdarg (void)
any real data movement. */
if (va_list_simple_ptr)
{
- tree phi, lhs, rhs;
+ tree lhs, rhs;
use_operand_p uop;
ssa_op_iter soi;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (i = gsi_start_phis (bb); !gsi_end_p (i); gsi_next (&i))
{
+ gimple phi = gsi_stmt (i);
lhs = PHI_RESULT (phi);
if (!is_gimple_reg (lhs))
@@ -766,14 +754,12 @@ execute_optimize_stdarg (void)
else
check_va_list_escapes (&si, lhs, rhs);
- if (si.va_list_escapes
- || walk_tree (&phi, find_va_list_reference,
- si.va_list_vars, NULL))
+ if (si.va_list_escapes)
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
fputs ("va_list escapes in ", dump_file);
- print_generic_expr (dump_file, phi, dump_flags);
+ print_gimple_stmt (dump_file, phi, 0, dump_flags);
fputc ('\n', dump_file);
}
va_list_escapes = true;
@@ -782,18 +768,16 @@ execute_optimize_stdarg (void)
}
}
- for (i = bsi_start (bb);
- !bsi_end_p (i) && !va_list_escapes;
- bsi_next (&i))
+ for (i = gsi_start_bb (bb);
+ !gsi_end_p (i) && !va_list_escapes;
+ gsi_next (&i))
{
- tree stmt = bsi_stmt (i);
- tree call;
+ gimple stmt = gsi_stmt (i);
/* Don't look at __builtin_va_{start,end}, they are ok. */
- call = get_call_expr_in (stmt);
- if (call)
+ if (is_gimple_call (stmt))
{
- tree callee = get_callee_fndecl (call);
+ tree callee = gimple_call_fndecl (stmt);
if (callee
&& DECL_BUILT_IN_CLASS (callee) == BUILT_IN_NORMAL
@@ -802,44 +786,54 @@ execute_optimize_stdarg (void)
continue;
}
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_assign (stmt))
{
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
-
- if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
- rhs = TREE_OPERAND (rhs, 0);
+ tree lhs = gimple_assign_lhs (stmt);
+ tree rhs = gimple_assign_rhs1 (stmt);
if (va_list_simple_ptr)
{
- /* Check for tem = ap. */
- if (va_list_ptr_read (&si, rhs, lhs))
- continue;
+ if (get_gimple_rhs_class (gimple_assign_rhs_code (stmt))
+ == GIMPLE_SINGLE_RHS)
+ {
+ /* Check for tem = ap. */
+ if (va_list_ptr_read (&si, rhs, lhs))
+ continue;
- /* Check for the last insn in:
- tem1 = ap;
- tem2 = tem1 + CST;
- ap = tem2;
- sequence. */
- else if (va_list_ptr_write (&si, lhs, rhs))
- continue;
+ /* Check for the last insn in:
+ tem1 = ap;
+ tem2 = tem1 + CST;
+ ap = tem2;
+ sequence. */
+ else if (va_list_ptr_write (&si, lhs, rhs))
+ continue;
+ }
- else
+ if ((gimple_assign_rhs_code (stmt) == POINTER_PLUS_EXPR
+ && TREE_CODE (gimple_assign_rhs2 (stmt)) == INTEGER_CST)
+ || 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);
}
else
{
- /* Check for ap[0].field = temp. */
- if (va_list_counter_struct_op (&si, lhs, rhs, true))
- continue;
+ if (get_gimple_rhs_class (gimple_assign_rhs_code (stmt))
+ == GIMPLE_SINGLE_RHS)
+ {
+ /* Check for ap[0].field = temp. */
+ if (va_list_counter_struct_op (&si, lhs, rhs, true))
+ continue;
- /* Check for temp = ap[0].field. */
- else if (va_list_counter_struct_op (&si, rhs, lhs, false))
- continue;
+ /* Check for temp = ap[0].field. */
+ else if (va_list_counter_struct_op (&si, rhs, lhs,
+ false))
+ continue;
+ }
/* Do any architecture specific checking. */
- else if (targetm.stdarg_optimize_hook
- && targetm.stdarg_optimize_hook (&si, lhs, rhs))
+ if (targetm.stdarg_optimize_hook
+ && targetm.stdarg_optimize_hook (&si, stmt))
continue;
}
}
@@ -851,13 +845,12 @@ execute_optimize_stdarg (void)
fully), or some unexpected use of va_list. None of these should
happen in a gimplified VA_ARG_EXPR. */
if (si.va_list_escapes
- || walk_tree (&stmt, find_va_list_reference,
- si.va_list_vars, NULL))
+ || walk_gimple_op (stmt, find_va_list_reference, &wi))
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
fputs ("va_list escapes in ", dump_file);
- print_generic_expr (dump_file, stmt, dump_flags);
+ print_gimple_stmt (dump_file, stmt, 0, dump_flags);
fputc ('\n', dump_file);
}
va_list_escapes = true;
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c
index 2205c1a8b71..8bcfcfde5ca 100644
--- a/gcc/tree-switch-conversion.c
+++ b/gcc/tree-switch-conversion.c
@@ -147,10 +147,10 @@ struct switch_conv_info
/* The first load statement that loads a temporary from a new static array.
*/
- tree arr_ref_first;
+ gimple arr_ref_first;
/* The last load statement that loads a temporary from a new static array. */
- tree arr_ref_last;
+ gimple arr_ref_last;
/* String reason why the case wasn't a good candidate that is written to the
dump file, if there is one. */
@@ -166,22 +166,21 @@ static struct switch_conv_info info;
satisfies the size of the new array. */
static bool
-check_range (tree swtch)
+check_range (gimple swtch)
{
tree min_case, max_case;
- tree cases = SWITCH_LABELS (swtch);
- unsigned int branch_num = TREE_VEC_LENGTH (cases);
+ unsigned int branch_num = gimple_switch_num_labels (swtch);
tree range_max;
/* The gimplifier has already sorted the cases by CASE_LOW and ensured there
is a default label which is the last in the vector. */
- min_case = TREE_VEC_ELT (cases, 0);
+ min_case = gimple_switch_label (swtch, 1);
info.range_min = CASE_LOW (min_case);
gcc_assert (branch_num > 1);
- gcc_assert (CASE_LOW (TREE_VEC_ELT (cases, branch_num - 1)) == NULL_TREE);
- max_case = TREE_VEC_ELT (cases, branch_num - 2);
+ gcc_assert (CASE_LOW (gimple_switch_label (swtch, 0)) == NULL_TREE);
+ max_case = gimple_switch_label (swtch, branch_num - 1);
if (CASE_HIGH (max_case) != NULL_TREE)
range_max = CASE_HIGH (max_case);
else
@@ -283,25 +282,26 @@ check_process_case (tree cs)
static bool
check_final_bb (void)
{
- tree phi;
+ gimple_stmt_iterator gsi;
info.phi_count = 0;
- for (phi = phi_nodes (info.final_bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (info.final_bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
- int i;
+ gimple phi = gsi_stmt (gsi);
+ unsigned int i;
info.phi_count++;
- for (i = 0; i < PHI_NUM_ARGS (phi); i++)
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
{
- basic_block bb = PHI_ARG_EDGE (phi, i)->src;
+ basic_block bb = gimple_phi_arg_edge (phi, i)->src;
if ((bb == info.switch_bb
|| (single_pred_p (bb) && single_pred (bb) == info.switch_bb))
- && !is_gimple_min_invariant (PHI_ARG_ELT (phi, i).def))
+ && !is_gimple_min_invariant (gimple_phi_arg_def (phi, i)))
{
info.reason = " Non-invariant value from a case\n";
- return false; /* non invariant argument */
+ return false; /* Non-invariant argument. */
}
}
}
@@ -326,10 +326,8 @@ create_temp_arrays (void)
sizeof (tree));
for (i = 0; i < info.phi_count; i++)
- {
- info.constructors[i] = VEC_alloc (constructor_elt, gc,
- tree_low_cst (info.range_size, 1) + 1);
- }
+ info.constructors[i]
+ = VEC_alloc (constructor_elt, gc, tree_low_cst (info.range_size, 1) + 1);
}
/* Free the arrays created by create_temp_arrays(). The vectors that are
@@ -351,10 +349,10 @@ free_temp_arrays (void)
static void
gather_default_values (tree default_case)
{
- tree phi;
+ gimple_stmt_iterator gsi;
basic_block bb = label_to_block (CASE_LABEL (default_case));
edge e;
- int i;
+ int i = 0;
gcc_assert (CASE_LOW (default_case) == NULL_TREE);
@@ -363,11 +361,12 @@ gather_default_values (tree default_case)
else
e = single_succ_edge (bb);
- for (phi = phi_nodes (info.final_bb), i = 0; phi; phi = PHI_CHAIN (phi), i++)
+ for (gsi = gsi_start_phis (info.final_bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
+ gimple phi = gsi_stmt (gsi);
tree val = PHI_ARG_DEF_FROM_EDGE (phi, e);
gcc_assert (val);
- info.default_values[i] = val;
+ info.default_values[i++] = val;
}
}
@@ -376,18 +375,18 @@ gather_default_values (tree default_case)
order of phi nodes. SWTCH is the switch statement being converted. */
static void
-build_constructors (tree swtch)
+build_constructors (gimple swtch)
{
- int i;
- tree cases = SWITCH_LABELS (swtch);
+ unsigned i, branch_num = gimple_switch_num_labels (swtch);
tree pos = info.range_min;
- for (i = 0; i < TREE_VEC_LENGTH (cases) - 1; i++)
+ for (i = 1; i < branch_num; i++)
{
- tree cs = TREE_VEC_ELT (cases, i);
+ tree cs = gimple_switch_label (swtch, i);
basic_block bb = label_to_block (CASE_LABEL (cs));
edge e;
- tree phi, high;
+ tree high;
+ gimple_stmt_iterator gsi;
int j;
if (bb == info.final_bb)
@@ -405,7 +404,8 @@ build_constructors (tree swtch)
elt = VEC_quick_push (constructor_elt,
info.constructors[k], NULL);
- elt->index = int_const_binop (MINUS_EXPR, pos, info.range_min, 0);
+ elt->index = int_const_binop (MINUS_EXPR, pos,
+ info.range_min, 0);
elt->value = info.default_values[k];
}
@@ -418,8 +418,10 @@ build_constructors (tree swtch)
high = CASE_HIGH (cs);
else
high = CASE_LOW (cs);
- for (phi = phi_nodes (info.final_bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (info.final_bb);
+ !gsi_end_p (gsi); gsi_next (&gsi))
{
+ gimple phi = gsi_stmt (gsi);
tree val = PHI_ARG_DEF_FROM_EDGE (phi, e);
pos = CASE_LOW (cs);
@@ -449,15 +451,12 @@ build_constructors (tree swtch)
is a temporary variable holding the index for loads from the new array. */
static void
-build_one_array (tree swtch, int num, tree arr_index_type, tree phi, tree tidx)
+build_one_array (gimple swtch, int num, tree arr_index_type, gimple phi,
+ tree tidx)
{
- tree array_type;
- tree ctor;
- tree decl;
- tree value_type;
- tree name;
- tree fetch, load;
- block_stmt_iterator bsi;
+ tree array_type, ctor, decl, value_type, name, fetch;
+ gimple load;
+ gimple_stmt_iterator gsi;
gcc_assert (info.default_values[num]);
value_type = TREE_TYPE (info.default_values[num]);
@@ -478,21 +477,19 @@ build_one_array (tree swtch, int num, tree arr_index_type, tree phi, tree tidx)
varpool_finalize_decl (decl);
mark_sym_for_renaming (decl);
- name = make_ssa_name (SSA_NAME_VAR (PHI_RESULT (phi)), NULL_TREE);
+ name = make_ssa_name (SSA_NAME_VAR (PHI_RESULT (phi)), NULL);
info.target_inbound_names[num] = name;
fetch = build4 (ARRAY_REF, value_type, decl, tidx, NULL_TREE,
NULL_TREE);
- load = build_gimple_modify_stmt (name, fetch);
+ load = gimple_build_assign (name, fetch);
SSA_NAME_DEF_STMT (name) = load;
- bsi = bsi_for_stmt (swtch);
- bsi_insert_before (&bsi, load, BSI_SAME_STMT);
+ gsi = gsi_for_stmt (swtch);
+ gsi_insert_before (&gsi, load, GSI_SAME_STMT);
mark_symbols_for_renaming (load);
info.arr_ref_last = load;
-
- return;
}
/* Builds and initializes static arrays initialized with values gathered from
@@ -500,54 +497,53 @@ build_one_array (tree swtch, int num, tree arr_index_type, tree phi, tree tidx)
them. */
static void
-build_arrays (tree swtch)
+build_arrays (gimple swtch)
{
tree arr_index_type;
tree tidx, sub;
- block_stmt_iterator bsi;
- tree phi = phi_nodes (info.final_bb);
+ gimple stmt;
+ gimple_stmt_iterator gsi;
int i;
- bsi = bsi_for_stmt (swtch);
+ gsi = gsi_for_stmt (swtch);
arr_index_type = build_index_type (info.range_size);
tidx = make_rename_temp (arr_index_type, "csti");
sub = fold_build2 (MINUS_EXPR, TREE_TYPE (info.index_expr), info.index_expr,
fold_convert (TREE_TYPE (info.index_expr),
info.range_min));
- sub = force_gimple_operand_bsi (&bsi, fold_convert (arr_index_type, sub),
- false, NULL, true, BSI_SAME_STMT);
- sub = build_gimple_modify_stmt (tidx, sub);
-
- bsi_insert_before (&bsi, sub, BSI_SAME_STMT);
- mark_symbols_for_renaming (sub);
- info.arr_ref_first = sub;
+ sub = force_gimple_operand_gsi (&gsi, fold_convert (arr_index_type, sub),
+ false, NULL, true, GSI_SAME_STMT);
+ stmt = gimple_build_assign (tidx, sub);
- for (phi = phi_nodes (info.final_bb), i = 0; phi; phi = PHI_CHAIN (phi), i++)
- build_one_array (swtch, i, arr_index_type, phi, tidx);
+ gsi_insert_before (&gsi, stmt, GSI_SAME_STMT);
+ mark_symbols_for_renaming (stmt);
+ info.arr_ref_first = stmt;
- return;
+ for (gsi = gsi_start_phis (info.final_bb), i = 0;
+ !gsi_end_p (gsi); gsi_next (&gsi), i++)
+ build_one_array (swtch, i, arr_index_type, gsi_stmt (gsi), tidx);
}
/* Generates and appropriately inserts loads of default values at the position
given by BSI. Returns the last inserted statement. */
-static tree
-gen_def_assigns (block_stmt_iterator *bsi)
+static gimple
+gen_def_assigns (gimple_stmt_iterator *gsi)
{
int i;
- tree assign = NULL_TREE;
+ gimple assign = NULL;
for (i = 0; i < info.phi_count; i++)
{
- tree name = make_ssa_name (SSA_NAME_VAR (info.target_inbound_names[i]),
- NULL_TREE);
+ tree name
+ = make_ssa_name (SSA_NAME_VAR (info.target_inbound_names[i]), NULL);
info.target_outbound_names[i] = name;
- assign = build_gimple_modify_stmt (name, info.default_values[i]);
+ assign = gimple_build_assign (name, info.default_values[i]);
SSA_NAME_DEF_STMT (name) = assign;
- bsi_insert_before (bsi, assign, BSI_SAME_STMT);
- find_new_referenced_vars (&assign);
+ gsi_insert_before (gsi, assign, GSI_SAME_STMT);
+ find_new_referenced_vars (assign);
mark_symbols_for_renaming (assign);
}
return assign;
@@ -583,11 +579,13 @@ prune_bbs (basic_block bbd, basic_block final)
static void
fix_phi_nodes (edge e1f, edge e2f, basic_block bbf)
{
- tree phi;
+ gimple_stmt_iterator gsi;
int i;
- for (phi = phi_nodes (bbf), i = 0; phi; phi = PHI_CHAIN (phi), i++)
+ for (gsi = gsi_start_phis (bbf), i = 0;
+ !gsi_end_p (gsi); gsi_next (&gsi), i++)
{
+ gimple phi = gsi_stmt (gsi);
add_phi_arg (phi, info.target_inbound_names[i], e1f);
add_phi_arg (phi, info.target_outbound_names[i], e2f);
}
@@ -616,28 +614,29 @@ fix_phi_nodes (edge e1f, edge e2f, basic_block bbf)
*/
static void
-gen_inbound_check (tree swtch)
+gen_inbound_check (gimple swtch)
{
tree label_decl1 = create_artificial_label ();
tree label_decl2 = create_artificial_label ();
tree label_decl3 = create_artificial_label ();
- tree label1, label2, label3;
+ gimple label1, label2, label3;
tree utype;
tree tmp_u;
- tree cast, cast_assign;
- tree ulb, minus, minus_assign;
+ tree cast;
+ gimple cast_assign, minus_assign;
+ tree ulb, minus;
tree bound;
- tree if_expr;
+ gimple cond_stmt;
- tree last_assign;
- block_stmt_iterator bsi;
+ gimple last_assign;
+ gimple_stmt_iterator gsi;
basic_block bb0, bb1, bb2, bbf, bbd;
edge e01, e02, e21, e1d, e1f, e2f;
gcc_assert (info.default_values);
- bb0 = bb_for_stmt (swtch);
+ bb0 = gimple_bb (swtch);
/* Make sure we do not generate arithmetics in a subrange. */
if (TREE_TYPE (TREE_TYPE (info.index_expr)))
@@ -646,52 +645,50 @@ gen_inbound_check (tree swtch)
utype = unsigned_type_for (TREE_TYPE (info.index_expr));
/* (end of) block 0 */
- bsi = bsi_for_stmt (info.arr_ref_first);
+ gsi = gsi_for_stmt (info.arr_ref_first);
tmp_u = make_rename_temp (utype, "csui");
cast = fold_convert (utype, info.index_expr);
- cast_assign = build_gimple_modify_stmt (tmp_u, cast);
- find_new_referenced_vars (&cast_assign);
- bsi_insert_before (&bsi, cast_assign, BSI_SAME_STMT);
+ cast_assign = gimple_build_assign (tmp_u, cast);
+ find_new_referenced_vars (cast_assign);
+ gsi_insert_before (&gsi, cast_assign, GSI_SAME_STMT);
mark_symbols_for_renaming (cast_assign);
ulb = fold_convert (utype, info.range_min);
minus = fold_build2 (MINUS_EXPR, utype, tmp_u, ulb);
- minus = force_gimple_operand_bsi (&bsi, minus, false, NULL, true,
- BSI_SAME_STMT);
- minus_assign = build_gimple_modify_stmt (tmp_u, minus);
- find_new_referenced_vars (&minus_assign);
- bsi_insert_before (&bsi, minus_assign, BSI_SAME_STMT);
+ minus = force_gimple_operand_gsi (&gsi, minus, false, NULL, true,
+ GSI_SAME_STMT);
+ minus_assign = gimple_build_assign (tmp_u, minus);
+ find_new_referenced_vars (minus_assign);
+ gsi_insert_before (&gsi, minus_assign, GSI_SAME_STMT);
mark_symbols_for_renaming (minus_assign);
bound = fold_convert (utype, info.range_size);
- if_expr = build3 (COND_EXPR, void_type_node,
- build2 (LE_EXPR, boolean_type_node, tmp_u, bound),
- NULL_TREE, NULL_TREE);
+ cond_stmt = gimple_build_cond (LE_EXPR, tmp_u, bound, NULL_TREE, NULL_TREE);
- find_new_referenced_vars (&if_expr);
- bsi_insert_before (&bsi, if_expr, BSI_SAME_STMT);
- mark_symbols_for_renaming (if_expr);
+ find_new_referenced_vars (cond_stmt);
+ gsi_insert_before (&gsi, cond_stmt, GSI_SAME_STMT);
+ mark_symbols_for_renaming (cond_stmt);
/* block 2 */
- bsi = bsi_for_stmt (info.arr_ref_first);
- label2 = build1 (LABEL_EXPR, void_type_node, label_decl2);
- bsi_insert_before (&bsi, label2, BSI_SAME_STMT);
- last_assign = gen_def_assigns (&bsi);
+ gsi = gsi_for_stmt (info.arr_ref_first);
+ label2 = gimple_build_label (label_decl2);
+ gsi_insert_before (&gsi, label2, GSI_SAME_STMT);
+ last_assign = gen_def_assigns (&gsi);
/* block 1 */
- bsi = bsi_for_stmt (info.arr_ref_first);
- label1 = build1 (LABEL_EXPR, void_type_node, label_decl1);
- bsi_insert_before (&bsi, label1, BSI_SAME_STMT);
+ gsi = gsi_for_stmt (info.arr_ref_first);
+ label1 = gimple_build_label (label_decl1);
+ gsi_insert_before (&gsi, label1, GSI_SAME_STMT);
/* block F */
- bsi = bsi_start (info.final_bb);
- label3 = build1 (LABEL_EXPR, void_type_node, label_decl3);
- bsi_insert_before (&bsi, label3, BSI_SAME_STMT);
+ gsi = gsi_start_bb (info.final_bb);
+ label3 = gimple_build_label (label_decl3);
+ gsi_insert_before (&gsi, label3, GSI_SAME_STMT);
/* cfg fix */
- e02 = split_block (bb0, if_expr);
+ e02 = split_block (bb0, cond_stmt);
bb2 = e02->dest;
e21 = split_block (bb2, last_assign);
@@ -728,8 +725,8 @@ gen_inbound_check (tree swtch)
bb2->frequency = EDGE_FREQUENCY (e02);
bbf->frequency = EDGE_FREQUENCY (e1f) + EDGE_FREQUENCY (e2f);
- prune_bbs (bbd, info.final_bb); /* to keep calc_dfs_tree() in dominance.c
- happy */
+ prune_bbs (bbd, info.final_bb); /* To keep calc_dfs_tree() in dominance.c
+ happy. */
fix_phi_nodes (e1f, e2f, bbf);
@@ -742,31 +739,24 @@ gen_inbound_check (tree swtch)
one after another until one fails or the conversion is completed. */
static bool
-process_switch (tree swtch)
+process_switch (gimple swtch)
{
- int i;
- tree cases;
+ unsigned int i, branch_num = gimple_switch_num_labels (swtch);
tree index_type;
/* Operand 2 is either NULL_TREE or a vector of cases (stmt.c). */
- if (TREE_OPERAND (swtch, 2) == NULL_TREE)
+ if (branch_num < 2)
{
- info.reason = "swtch has no labels\n";
+ info.reason = "switch has no labels\n";
return false;
}
- /* Comment from stmt.c:
- The switch body is lowered in gimplify.c, we should never have switches
- with a non-NULL SWITCH_BODY here. */
- gcc_assert (!SWITCH_BODY (swtch));
-
- cases = SWITCH_LABELS (swtch);
info.final_bb = NULL;
- info.switch_bb = bb_for_stmt (swtch);
- info.index_expr = SWITCH_COND (swtch);
+ info.switch_bb = gimple_bb (swtch);
+ info.index_expr = gimple_switch_index (swtch);
index_type = TREE_TYPE (info.index_expr);
- info.arr_ref_first = NULL_TREE;
- info.arr_ref_last = NULL_TREE;
+ info.arr_ref_first = NULL;
+ info.arr_ref_last = NULL;
info.default_prob = 0;
info.default_count = 0;
info.other_count = 0;
@@ -785,16 +775,13 @@ process_switch (tree swtch)
/* For all the cases, see whether they are empty, the assignments they
represent constant and so on... */
- for (i = 0; i < TREE_VEC_LENGTH (cases); i++)
- {
- tree part_case = TREE_VEC_ELT (cases, i);
- if (!check_process_case (part_case))
- {
- if (dump_file)
- fprintf (dump_file, "Processing of case %i failed\n", i);
- return false;
- }
- }
+ for (i = 0; i < branch_num; i++)
+ if (!check_process_case (gimple_switch_label (swtch, i)))
+ {
+ if (dump_file)
+ fprintf (dump_file, "Processing of case %i failed\n", i);
+ return false;
+ }
if (!check_final_bb ())
return false;
@@ -803,7 +790,7 @@ process_switch (tree swtch)
transformation. */
create_temp_arrays ();
- gather_default_values (TREE_VEC_ELT (cases, TREE_VEC_LENGTH (cases) - 1));
+ gather_default_values (gimple_switch_label (swtch, 0));
build_constructors (swtch);
build_arrays (swtch); /* Build the static arrays and assignments. */
@@ -824,17 +811,17 @@ do_switchconv (void)
FOR_EACH_BB (bb)
{
- tree stmt = last_stmt (bb);
- if (stmt && TREE_CODE (stmt) == SWITCH_EXPR)
+ gimple stmt = last_stmt (bb);
+ if (stmt && gimple_code (stmt) == GIMPLE_SWITCH)
{
- expanded_location loc = expand_location (EXPR_LOCATION (stmt));
-
if (dump_file)
{
+ expanded_location loc = expand_location (gimple_location (stmt));
+
fprintf (dump_file, "beginning to process the following "
"SWITCH statement (%s:%d) : ------- \n",
loc.file, loc.line);
- print_generic_stmt (dump_file, stmt, 2);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
fprintf (dump_file, "\n");
}
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index 92127b4b7af..935b41941a0 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -100,11 +100,8 @@ along with GCC; see the file COPYING3. If not see
struct tailcall
{
- /* The block in that the call occur. */
- basic_block call_block;
-
/* The iterator pointing to the call statement. */
- block_stmt_iterator call_bsi;
+ gimple_stmt_iterator call_gsi;
/* True if it is a call to the current function. */
bool tail_recursion;
@@ -191,13 +188,13 @@ suitable_for_tail_call_opt_p (void)
}
/* Checks whether the expression EXPR in stmt AT is independent of the
- statement pointed to by BSI (in a sense that we already know EXPR's value
- at BSI). We use the fact that we are only called from the chain of
+ statement pointed to by GSI (in a sense that we already know EXPR's value
+ at GSI). We use the fact that we are only called from the chain of
basic blocks that have only single successor. Returns the expression
- containing the value of EXPR at BSI. */
+ containing the value of EXPR at GSI. */
static tree
-independent_of_stmt_p (tree expr, tree at, block_stmt_iterator bsi)
+independent_of_stmt_p (tree expr, gimple at, gimple_stmt_iterator gsi)
{
basic_block bb, call_bb, at_bb;
edge e;
@@ -210,8 +207,8 @@ independent_of_stmt_p (tree expr, tree at, block_stmt_iterator bsi)
return NULL_TREE;
/* Mark the blocks in the chain leading to the end. */
- at_bb = bb_for_stmt (at);
- call_bb = bb_for_stmt (bsi_stmt (bsi));
+ at_bb = gimple_bb (at);
+ call_bb = gimple_bb (gsi_stmt (gsi));
for (bb = call_bb; bb != at_bb; bb = single_succ (bb))
bb->aux = &bb->aux;
bb->aux = &bb->aux;
@@ -219,7 +216,7 @@ independent_of_stmt_p (tree expr, tree at, block_stmt_iterator bsi)
while (1)
{
at = SSA_NAME_DEF_STMT (expr);
- bb = bb_for_stmt (at);
+ bb = gimple_bb (at);
/* The default definition or defined before the chain. */
if (!bb || !bb->aux)
@@ -227,16 +224,16 @@ independent_of_stmt_p (tree expr, tree at, block_stmt_iterator bsi)
if (bb == call_bb)
{
- for (; !bsi_end_p (bsi); bsi_next (&bsi))
- if (bsi_stmt (bsi) == at)
+ for (; !gsi_end_p (gsi); gsi_next (&gsi))
+ if (gsi_stmt (gsi) == at)
break;
- if (!bsi_end_p (bsi))
+ if (!gsi_end_p (gsi))
expr = NULL_TREE;
break;
}
- if (TREE_CODE (at) != PHI_NODE)
+ if (gimple_code (at) != GIMPLE_PHI)
{
expr = NULL_TREE;
break;
@@ -263,27 +260,33 @@ independent_of_stmt_p (tree expr, tree at, block_stmt_iterator bsi)
return expr;
}
-/* Simulates the effect of an assignment of ASS in STMT on the return value
- of the tail recursive CALL passed in ASS_VAR. M and A are the
- multiplicative and the additive factor for the real return value. */
+/* Simulates the effect of an assignment STMT on the return value of the tail
+ recursive CALL passed in ASS_VAR. M and A are the multiplicative and the
+ additive factor for the real return value. */
static bool
-process_assignment (tree ass, tree stmt, block_stmt_iterator call, tree *m,
+process_assignment (gimple stmt, gimple_stmt_iterator call, tree *m,
tree *a, tree *ass_var)
{
tree op0, op1, non_ass_var;
- tree dest = GIMPLE_STMT_OPERAND (ass, 0);
- tree src = GIMPLE_STMT_OPERAND (ass, 1);
- enum tree_code code = TREE_CODE (src);
- tree src_var = src;
-
+ tree dest = gimple_assign_lhs (stmt);
+ enum tree_code code = gimple_assign_rhs_code (stmt);
+ enum gimple_rhs_class rhs_class = get_gimple_rhs_class (code);
+ tree src_var = gimple_assign_rhs1 (stmt);
+
/* See if this is a simple copy operation of an SSA name to the function
result. In that case we may have a simple tail call. Ignore type
conversions that can never produce extra code between the function
call and the function return. */
- STRIP_NOPS (src_var);
- if (TREE_CODE (src_var) == SSA_NAME)
+ if ((rhs_class == GIMPLE_SINGLE_RHS || gimple_assign_cast_p (stmt))
+ && (TREE_CODE (src_var) == SSA_NAME))
{
+ /* Reject a tailcall if the type conversion might need
+ additional code. */
+ if (gimple_assign_cast_p (stmt)
+ && TYPE_MODE (TREE_TYPE (dest)) != TYPE_MODE (TREE_TYPE (src_var)))
+ return false;
+
if (src_var != *ass_var)
return false;
@@ -291,7 +294,7 @@ process_assignment (tree ass, tree stmt, block_stmt_iterator call, tree *m,
return true;
}
- if (TREE_CODE_CLASS (code) != tcc_binary)
+ if (rhs_class != GIMPLE_BINARY_RHS)
return false;
/* Accumulator optimizations will reverse the order of operations.
@@ -311,8 +314,8 @@ process_assignment (tree ass, tree stmt, block_stmt_iterator call, tree *m,
TODO -- Extend it for cases where the linear transformation of the output
is expressed in a more complicated way. */
- op0 = TREE_OPERAND (src, 0);
- op1 = TREE_OPERAND (src, 1);
+ op0 = gimple_assign_rhs1 (stmt);
+ op1 = gimple_assign_rhs2 (stmt);
if (op0 == *ass_var
&& (non_ass_var = independent_of_stmt_p (op1, stmt, call)))
@@ -346,7 +349,8 @@ process_assignment (tree ass, tree stmt, block_stmt_iterator call, tree *m,
*ass_var = dest;
return true;
- /* TODO -- Handle other codes (NEGATE_EXPR, MINUS_EXPR, POINTER_PLUS_EXPR). */
+ /* TODO -- Handle other codes (NEGATE_EXPR, MINUS_EXPR,
+ POINTER_PLUS_EXPR). */
default:
return false;
@@ -359,12 +363,14 @@ static tree
propagate_through_phis (tree var, edge e)
{
basic_block dest = e->dest;
- tree phi;
-
- for (phi = phi_nodes (dest); phi; phi = PHI_CHAIN (phi))
- if (PHI_ARG_DEF_FROM_EDGE (phi, e) == var)
- return PHI_RESULT (phi);
-
+ gimple_stmt_iterator gsi;
+
+ for (gsi = gsi_start_phis (dest); !gsi_end_p (gsi); gsi_next (&gsi))
+ {
+ gimple phi = gsi_stmt (gsi);
+ if (PHI_ARG_DEF_FROM_EDGE (phi, e) == var)
+ return PHI_RESULT (phi);
+ }
return var;
}
@@ -374,52 +380,44 @@ propagate_through_phis (tree var, edge e)
static void
find_tail_calls (basic_block bb, struct tailcall **ret)
{
- tree ass_var, ret_var, stmt, func, param, call = NULL_TREE;
- block_stmt_iterator bsi, absi;
+ tree ass_var = NULL_TREE, ret_var, func, param;
+ gimple stmt, call = NULL;
+ gimple_stmt_iterator gsi, agsi;
bool tail_recursion;
struct tailcall *nw;
edge e;
tree m, a;
basic_block abb;
- stmt_ann_t ann;
+ size_t idx;
if (!single_succ_p (bb))
return;
- for (bsi = bsi_last (bb); !bsi_end_p (bsi); bsi_prev (&bsi))
+ for (gsi = gsi_last_bb (bb); !gsi_end_p (gsi); gsi_prev (&gsi))
{
- stmt = bsi_stmt (bsi);
+ stmt = gsi_stmt (gsi);
/* Ignore labels. */
- if (TREE_CODE (stmt) == LABEL_EXPR)
+ if (gimple_code (stmt) == GIMPLE_LABEL)
continue;
/* Check for a call. */
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
- {
- ass_var = GIMPLE_STMT_OPERAND (stmt, 0);
- call = GIMPLE_STMT_OPERAND (stmt, 1);
- if (TREE_CODE (call) == WITH_SIZE_EXPR)
- call = TREE_OPERAND (call, 0);
- }
- else
+ if (is_gimple_call (stmt))
{
- ass_var = NULL_TREE;
call = stmt;
+ ass_var = gimple_call_lhs (stmt);
+ break;
}
- if (TREE_CODE (call) == CALL_EXPR)
- break;
-
/* If the statement has virtual or volatile operands, fail. */
- ann = stmt_ann (stmt);
if (!ZERO_SSA_OPERANDS (stmt, (SSA_OP_VUSE | SSA_OP_VIRTUAL_DEFS))
- || ann->has_volatile_ops
- || (!gimple_aliases_computed_p (cfun) && ann->references_memory))
+ || gimple_has_volatile_ops (stmt)
+ || (!gimple_aliases_computed_p (cfun)
+ && gimple_references_memory_p (stmt)))
return;
}
- if (bsi_end_p (bsi))
+ if (gsi_end_p (gsi))
{
edge_iterator ei;
/* Recurse to the predecessors. */
@@ -445,16 +443,15 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
/* We found the call, check whether it is suitable. */
tail_recursion = false;
- func = get_callee_fndecl (call);
+ func = gimple_call_fndecl (call);
if (func == current_function_decl)
{
- call_expr_arg_iterator iter;
tree arg;
- for (param = DECL_ARGUMENTS (func),
- arg = first_call_expr_arg (call, &iter);
- param && arg;
- param = TREE_CHAIN (param), arg = next_call_expr_arg (&iter))
+ for (param = DECL_ARGUMENTS (func), idx = 0;
+ param && idx < gimple_call_num_args (call);
+ param = TREE_CHAIN (param), idx ++)
{
+ arg = gimple_call_arg (call, idx);
if (param != arg)
{
/* Make sure there are no problems with copying. The parameter
@@ -463,7 +460,7 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
we emitted a suitable type conversion statement. */
if (!is_gimple_reg_type (TREE_TYPE (param))
|| !useless_type_conversion_p (TREE_TYPE (param),
- TREE_TYPE (arg)))
+ TREE_TYPE (arg)))
break;
/* The parameter should be a real operand, so that phi node
@@ -471,13 +468,13 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
of copying the value. This test implies is_gimple_reg_type
from the previous condition, however this one could be
relaxed by being more careful with copying the new value
- of the parameter (emitting appropriate GIMPLE_MODIFY_STMT and
+ of the parameter (emitting appropriate GIMPLE_ASSIGN and
updating the virtual operands). */
if (!is_gimple_reg (param))
break;
}
}
- if (!arg && !param)
+ if (idx == gimple_call_num_args (call) && !param)
tail_recursion = true;
}
@@ -489,48 +486,36 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
a = NULL_TREE;
abb = bb;
- absi = bsi;
+ agsi = gsi;
while (1)
{
- bsi_next (&absi);
+ gsi_next (&agsi);
- while (bsi_end_p (absi))
+ while (gsi_end_p (agsi))
{
ass_var = propagate_through_phis (ass_var, single_succ_edge (abb));
abb = single_succ (abb);
- absi = bsi_start (abb);
+ agsi = gsi_start_bb (abb);
}
- stmt = bsi_stmt (absi);
+ stmt = gsi_stmt (agsi);
- if (TREE_CODE (stmt) == LABEL_EXPR)
+ if (gimple_code (stmt) == GIMPLE_LABEL)
continue;
- if (TREE_CODE (stmt) == RETURN_EXPR)
+ if (gimple_code (stmt) == GIMPLE_RETURN)
break;
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
return;
- if (!process_assignment (stmt, stmt, bsi, &m, &a, &ass_var))
+ /* This is a gimple assign. */
+ if (! process_assignment (stmt, gsi, &m, &a, &ass_var))
return;
}
/* See if this is a tail call we can handle. */
- ret_var = TREE_OPERAND (stmt, 0);
- if (ret_var
- && TREE_CODE (ret_var) == GIMPLE_MODIFY_STMT)
- {
- tree ret_op = GIMPLE_STMT_OPERAND (ret_var, 1);
- STRIP_NOPS (ret_op);
- if (!tail_recursion
- && TREE_CODE (ret_op) != SSA_NAME)
- return;
-
- if (!process_assignment (ret_var, stmt, bsi, &m, &a, &ass_var))
- return;
- ret_var = GIMPLE_STMT_OPERAND (ret_var, 0);
- }
+ ret_var = gimple_return_retval (stmt);
/* We may proceed if there either is no return value, or the return value
is identical to the call's return. */
@@ -545,8 +530,7 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
nw = XNEW (struct tailcall);
- nw->call_block = bb;
- nw->call_bsi = bsi;
+ nw->call_gsi = gsi;
nw->tail_recursion = tail_recursion;
@@ -557,15 +541,70 @@ find_tail_calls (basic_block bb, struct tailcall **ret)
*ret = nw;
}
-/* Adjust the accumulator values according to A and M after BSI, and update
- the phi nodes on edge BACK. */
+/* Helper to insert PHI_ARGH to the phi of VAR in the destination of edge E. */
static void
-adjust_accumulator_values (block_stmt_iterator bsi, tree m, tree a, edge back)
+add_successor_phi_arg (edge e, tree var, tree phi_arg)
+{
+ gimple_stmt_iterator gsi;
+
+ for (gsi = gsi_start_phis (e->dest); !gsi_end_p (gsi); gsi_next (&gsi))
+ if (PHI_RESULT (gsi_stmt (gsi)) == var)
+ break;
+
+ gcc_assert (!gsi_end_p (gsi));
+ add_phi_arg (gsi_stmt (gsi), phi_arg, e);
+}
+
+/* Creates a GIMPLE statement which computes the operation specified by
+ CODE, OP0 and OP1 to a new variable with name LABEL and inserts the
+ statement in the position specified by GSI and UPDATE. Returns the
+ tree node of the statement's result. */
+
+static tree
+adjust_return_value_with_ops (enum tree_code code, const char *label,
+ tree op0, tree op1, gimple_stmt_iterator gsi,
+ enum gsi_iterator_update update)
{
- tree stmt, var, phi, tmp;
+
tree ret_type = TREE_TYPE (DECL_RESULT (current_function_decl));
- tree a_acc_arg = a_acc, m_acc_arg = m_acc;
+ tree tmp = create_tmp_var (ret_type, label);
+ gimple stmt = gimple_build_assign_with_ops (code, tmp, op0, op1);
+ tree result;
+
+ add_referenced_var (tmp);
+ result = make_ssa_name (tmp, stmt);
+ gimple_assign_set_lhs (stmt, result);
+ update_stmt (stmt);
+ gsi_insert_before (&gsi, stmt, update);
+ return result;
+}
+
+/* Creates a new GIMPLE statement that adjusts the value of accumulator ACC by
+ the computation specified by CODE and OP1 and insert the statement
+ at the position specified by GSI as a new statement. Returns new SSA name
+ of updated accumulator. */
+
+static tree
+update_accumulator_with_ops (enum tree_code code, tree acc, tree op1,
+ gimple_stmt_iterator gsi)
+{
+ gimple stmt = gimple_build_assign_with_ops (code, SSA_NAME_VAR (acc), acc,
+ op1);
+ tree var = make_ssa_name (SSA_NAME_VAR (acc), stmt);
+ gimple_assign_set_lhs (stmt, var);
+ update_stmt (stmt);
+ gsi_insert_after (&gsi, stmt, GSI_NEW_STMT);
+ return var;
+}
+
+/* Adjust the accumulator values according to A and M after GSI, and update
+ the phi nodes on edge BACK. */
+
+static void
+adjust_accumulator_values (gimple_stmt_iterator gsi, tree m, tree a, edge back)
+{
+ tree var, a_acc_arg = a_acc, m_acc_arg = m_acc;
if (a)
{
@@ -574,58 +613,23 @@ adjust_accumulator_values (block_stmt_iterator bsi, tree m, tree a, edge back)
if (integer_onep (a))
var = m_acc;
else
- {
- stmt = build_gimple_modify_stmt (NULL_TREE,
- build2 (MULT_EXPR, ret_type,
- m_acc, a));
-
- tmp = create_tmp_var (ret_type, "acc_tmp");
- add_referenced_var (tmp);
-
- var = make_ssa_name (tmp, stmt);
- GIMPLE_STMT_OPERAND (stmt, 0) = var;
- bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
- }
+ var = adjust_return_value_with_ops (MULT_EXPR, "acc_tmp", m_acc,
+ a, gsi, GSI_NEW_STMT);
}
else
var = a;
- stmt = build_gimple_modify_stmt (NULL_TREE, build2 (PLUS_EXPR, ret_type,
- a_acc, var));
- var = make_ssa_name (SSA_NAME_VAR (a_acc), stmt);
- GIMPLE_STMT_OPERAND (stmt, 0) = var;
- bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
- a_acc_arg = var;
+ a_acc_arg = update_accumulator_with_ops (PLUS_EXPR, a_acc, var, gsi);
}
if (m)
- {
- stmt = build_gimple_modify_stmt (NULL_TREE,
- build2 (MULT_EXPR, ret_type,
- m_acc, m));
- var = make_ssa_name (SSA_NAME_VAR (m_acc), stmt);
- GIMPLE_STMT_OPERAND (stmt, 0) = var;
- bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
- m_acc_arg = var;
- }
+ m_acc_arg = update_accumulator_with_ops (MULT_EXPR, m_acc, m, gsi);
if (a_acc)
- {
- for (phi = phi_nodes (back->dest); phi; phi = PHI_CHAIN (phi))
- if (PHI_RESULT (phi) == a_acc)
- break;
-
- add_phi_arg (phi, a_acc_arg, back);
- }
+ add_successor_phi_arg (back, a_acc, a_acc_arg);
if (m_acc)
- {
- for (phi = phi_nodes (back->dest); phi; phi = PHI_CHAIN (phi))
- if (PHI_RESULT (phi) == m_acc)
- break;
-
- add_phi_arg (phi, m_acc_arg, back);
- }
+ add_successor_phi_arg (back, m_acc, m_acc_arg);
}
/* Adjust value of the return at the end of BB according to M and A
@@ -634,56 +638,23 @@ adjust_accumulator_values (block_stmt_iterator bsi, tree m, tree a, edge back)
static void
adjust_return_value (basic_block bb, tree m, tree a)
{
- tree ret_stmt = last_stmt (bb), ret_var, var, stmt, tmp;
- tree ret_type = TREE_TYPE (DECL_RESULT (current_function_decl));
- tree *ret_op;
- block_stmt_iterator bsi = bsi_last (bb);
+ tree retval;
+ gimple ret_stmt = gimple_seq_last_stmt (bb_seq (bb));
+ gimple_stmt_iterator gsi = gsi_last_bb (bb);
- gcc_assert (TREE_CODE (ret_stmt) == RETURN_EXPR);
+ gcc_assert (gimple_code (ret_stmt) == GIMPLE_RETURN);
- ret_var = TREE_OPERAND (ret_stmt, 0);
- if (!ret_var)
+ retval = gimple_return_retval (ret_stmt);
+ if (!retval || retval == error_mark_node)
return;
- if (TREE_CODE (ret_var) == GIMPLE_MODIFY_STMT)
- {
- ret_op = &GIMPLE_STMT_OPERAND (ret_var, 1);
- ret_var = *ret_op;
- }
- else
- ret_op = &TREE_OPERAND (ret_stmt, 0);
-
if (m)
- {
- stmt = build_gimple_modify_stmt (NULL_TREE,
- build2 (MULT_EXPR, ret_type,
- m_acc, ret_var));
-
- tmp = create_tmp_var (ret_type, "acc_tmp");
- add_referenced_var (tmp);
-
- var = make_ssa_name (tmp, stmt);
- GIMPLE_STMT_OPERAND (stmt, 0) = var;
- bsi_insert_before (&bsi, stmt, BSI_SAME_STMT);
- }
- else
- var = ret_var;
-
+ retval = adjust_return_value_with_ops (MULT_EXPR, "mul_tmp", m_acc, retval,
+ gsi, GSI_SAME_STMT);
if (a)
- {
- stmt = build_gimple_modify_stmt (NULL_TREE,
- build2 (PLUS_EXPR, ret_type,
- a_acc, var));
-
- tmp = create_tmp_var (ret_type, "acc_tmp");
- add_referenced_var (tmp);
-
- var = make_ssa_name (tmp, stmt);
- GIMPLE_STMT_OPERAND (stmt, 0) = var;
- bsi_insert_before (&bsi, stmt, BSI_SAME_STMT);
- }
-
- *ret_op = var;
+ retval = adjust_return_value_with_ops (PLUS_EXPR, "acc_tmp", a_acc, retval,
+ gsi, GSI_SAME_STMT);
+ gimple_return_set_retval (ret_stmt, retval);
update_stmt (ret_stmt);
}
@@ -735,90 +706,92 @@ arg_needs_copy_p (tree param)
static void
eliminate_tail_call (struct tailcall *t)
{
- tree param, stmt, rslt, call;
+ tree param, rslt;
+ gimple stmt, call;
tree arg;
- call_expr_arg_iterator iter;
+ size_t idx;
basic_block bb, first;
edge e;
- tree phi;
- block_stmt_iterator bsi;
- tree orig_stmt;
+ gimple phi;
+ gimple_stmt_iterator gsi;
+ gimple orig_stmt;
- stmt = orig_stmt = bsi_stmt (t->call_bsi);
- bb = t->call_block;
+ stmt = orig_stmt = gsi_stmt (t->call_gsi);
+ bb = gsi_bb (t->call_gsi);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Eliminated tail recursion in bb %d : ",
bb->index);
- print_generic_stmt (dump_file, stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
fprintf (dump_file, "\n");
}
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
- stmt = GIMPLE_STMT_OPERAND (stmt, 1);
+ gcc_assert (is_gimple_call (stmt));
first = single_succ (ENTRY_BLOCK_PTR);
- /* Remove the code after call_bsi that will become unreachable. The
+ /* Remove the code after call_gsi that will become unreachable. The
possibly unreachable code in other blocks is removed later in
cfg cleanup. */
- bsi = t->call_bsi;
- bsi_next (&bsi);
- while (!bsi_end_p (bsi))
+ gsi = t->call_gsi;
+ gsi_next (&gsi);
+ while (!gsi_end_p (gsi))
{
- tree t = bsi_stmt (bsi);
+ gimple t = gsi_stmt (gsi);
/* Do not remove the return statement, so that redirect_edge_and_branch
sees how the block ends. */
- if (TREE_CODE (t) == RETURN_EXPR)
+ if (gimple_code (t) == GIMPLE_RETURN)
break;
- bsi_remove (&bsi, true);
+ gsi_remove (&gsi, true);
release_defs (t);
}
/* Number of executions of function has reduced by the tailcall. */
- e = single_succ_edge (t->call_block);
+ e = single_succ_edge (gsi_bb (t->call_gsi));
decrease_profile (EXIT_BLOCK_PTR, e->count, EDGE_FREQUENCY (e));
decrease_profile (ENTRY_BLOCK_PTR, e->count, EDGE_FREQUENCY (e));
if (e->dest != EXIT_BLOCK_PTR)
decrease_profile (e->dest, e->count, EDGE_FREQUENCY (e));
/* Replace the call by a jump to the start of function. */
- e = redirect_edge_and_branch (single_succ_edge (t->call_block), first);
+ e = redirect_edge_and_branch (single_succ_edge (gsi_bb (t->call_gsi)),
+ first);
gcc_assert (e);
- PENDING_STMT (e) = NULL_TREE;
+ PENDING_STMT (e) = NULL;
/* Add phi node entries for arguments. The ordering of the phi nodes should
be the same as the ordering of the arguments. */
for (param = DECL_ARGUMENTS (current_function_decl),
- arg = first_call_expr_arg (stmt, &iter),
- phi = phi_nodes (first);
+ idx = 0, gsi = gsi_start_phis (first);
param;
- param = TREE_CHAIN (param), arg = next_call_expr_arg (&iter))
+ param = TREE_CHAIN (param), idx++)
{
if (!arg_needs_copy_p (param))
continue;
+
+ arg = gimple_call_arg (stmt, idx);
+ phi = gsi_stmt (gsi);
gcc_assert (param == SSA_NAME_VAR (PHI_RESULT (phi)));
add_phi_arg (phi, arg, e);
- phi = PHI_CHAIN (phi);
+ gsi_next (&gsi);
}
/* Update the values of accumulators. */
- adjust_accumulator_values (t->call_bsi, t->mult, t->add, e);
+ adjust_accumulator_values (t->call_gsi, t->mult, t->add, e);
- call = bsi_stmt (t->call_bsi);
- if (TREE_CODE (call) == GIMPLE_MODIFY_STMT)
+ call = gsi_stmt (t->call_gsi);
+ rslt = gimple_call_lhs (call);
+ if (rslt != NULL_TREE)
{
- rslt = GIMPLE_STMT_OPERAND (call, 0);
-
/* Result of the call will no longer be defined. So adjust the
SSA_NAME_DEF_STMT accordingly. */
- SSA_NAME_DEF_STMT (rslt) = build_empty_stmt ();
+ SSA_NAME_DEF_STMT (rslt) = gimple_build_nop ();
}
- bsi_remove (&t->call_bsi, true);
+ gsi_remove (&t->call_gsi, true);
release_defs (call);
}
@@ -866,21 +839,40 @@ optimize_tail_call (struct tailcall *t, bool opt_tailcalls)
if (opt_tailcalls)
{
- tree stmt = bsi_stmt (t->call_bsi);
+ gimple stmt = gsi_stmt (t->call_gsi);
- stmt = get_call_expr_in (stmt);
- CALL_EXPR_TAILCALL (stmt) = 1;
+ gimple_call_set_tail (stmt, true);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Found tail call ");
- print_generic_expr (dump_file, stmt, dump_flags);
- fprintf (dump_file, " in bb %i\n", t->call_block->index);
+ print_gimple_stmt (dump_file, stmt, 0, dump_flags);
+ fprintf (dump_file, " in bb %i\n", (gsi_bb (t->call_gsi))->index);
}
}
return false;
}
+/* Creates a tail-call accumulator of the same type as the return type of the
+ current function. LABEL is the name used to creating the temporary
+ variable for the accumulator. The accumulator will be inserted in the
+ phis of a basic block BB with single predecessor with an initial value
+ INIT converted to the current function return type. */
+
+static tree
+create_tailcall_accumulator (const char *label, basic_block bb, tree init)
+{
+ tree ret_type = TREE_TYPE (DECL_RESULT (current_function_decl));
+ tree tmp = create_tmp_var (ret_type, label);
+ gimple phi;
+
+ add_referenced_var (tmp);
+ phi = create_phi_node (tmp, bb);
+ /* RET_TYPE can be a float when -ffast-maths is enabled. */
+ add_phi_arg (phi, fold_convert (ret_type, init), single_pred_edge (bb));
+ return PHI_RESULT (phi);
+}
+
/* Optimizes tail calls in the function, turning the tail recursion
into iteration. */
@@ -892,7 +884,8 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls)
struct tailcall *tailcalls = NULL, *act, *next;
bool changed = false;
basic_block first = single_succ (ENTRY_BLOCK_PTR);
- tree stmt, param, ret_type, tmp, phi;
+ tree param;
+ gimple stmt;
edge_iterator ei;
if (!suitable_for_tail_opt_p ())
@@ -907,7 +900,7 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls)
stmt = last_stmt (e->src);
if (stmt
- && TREE_CODE (stmt) == RETURN_EXPR)
+ && gimple_code (stmt) == GIMPLE_RETURN)
find_tail_calls (e->src, &tailcalls);
}
@@ -932,7 +925,7 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls)
{
tree name = gimple_default_def (cfun, param);
tree new_name = make_ssa_name (param, SSA_NAME_DEF_STMT (name));
- tree phi;
+ gimple phi;
set_default_def (param, new_name);
phi = create_phi_node (name, first);
@@ -943,44 +936,12 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls)
}
if (act->add && !a_acc)
- {
- ret_type = TREE_TYPE (DECL_RESULT (current_function_decl));
-
- tmp = create_tmp_var (ret_type, "add_acc");
- add_referenced_var (tmp);
-
- phi = create_phi_node (tmp, first);
- add_phi_arg (phi,
- /* RET_TYPE can be a float when -ffast-maths is
- enabled. */
- fold_convert (ret_type, integer_zero_node),
- single_pred_edge (first));
- a_acc = PHI_RESULT (phi);
- }
+ a_acc = create_tailcall_accumulator ("add_acc", first,
+ integer_zero_node);
if (act->mult && !m_acc)
- {
- ret_type = TREE_TYPE (DECL_RESULT (current_function_decl));
-
- tmp = create_tmp_var (ret_type, "mult_acc");
- add_referenced_var (tmp);
-
- phi = create_phi_node (tmp, first);
- add_phi_arg (phi,
- /* RET_TYPE can be a float when -ffast-maths is
- enabled. */
- fold_convert (ret_type, integer_one_node),
- single_pred_edge (first));
- m_acc = PHI_RESULT (phi);
- }
- }
-
-
- if (phis_constructed)
- {
- /* Reverse the order of the phi nodes, so that it matches the order
- of operands of the function, as assumed by eliminate_tail_call. */
- set_phi_nodes (first, phi_reverse (phi_nodes (first)));
+ m_acc = create_tailcall_accumulator ("mult_acc", first,
+ integer_one_node);
}
for (; tailcalls; tailcalls = next)
@@ -998,7 +959,7 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls)
stmt = last_stmt (e->src);
if (stmt
- && TREE_CODE (stmt) == RETURN_EXPR)
+ && gimple_code (stmt) == GIMPLE_RETURN)
adjust_return_value (e->src, m_acc, a_acc);
}
}
diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c
index 9f2640d09d6..93cd643d0f2 100644
--- a/gcc/tree-vect-analyze.c
+++ b/gcc/tree-vect-analyze.c
@@ -44,6 +44,50 @@ along with GCC; see the file COPYING3. If not see
static bool vect_can_advance_ivs_p (loop_vec_info);
+/* Return the smallest scalar part of STMT.
+ This is used to determine the vectype of the stmt. We generally set the
+ vectype according to the type of the result (lhs). For stmts whose
+ result-type is different than the type of the arguments (e.g., demotion,
+ promotion), vectype will be reset appropriately (later). Note that we have
+ to visit the smallest datatype in this function, because that determines the
+ VF. If the smallest datatype in the loop is present only as the rhs of a
+ promotion operation - we'd miss it.
+ Such a case, where a variable of this datatype does not appear in the lhs
+ anywhere in the loop, can only occur if it's an invariant: e.g.:
+ 'int_x = (int) short_inv', which we'd expect to have been optimized away by
+ invariant motion. However, we cannot rely on invariant motion to always take
+ invariants out of the loop, and so in the case of promotion we also have to
+ check the rhs.
+ LHS_SIZE_UNIT and RHS_SIZE_UNIT contain the sizes of the corresponding
+ types. */
+
+tree
+vect_get_smallest_scalar_type (gimple stmt, HOST_WIDE_INT *lhs_size_unit,
+ HOST_WIDE_INT *rhs_size_unit)
+{
+ tree scalar_type = gimple_expr_type (stmt);
+ HOST_WIDE_INT lhs, rhs;
+
+ lhs = rhs = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (scalar_type));
+
+ if (is_gimple_assign (stmt)
+ && (gimple_assign_cast_p (stmt)
+ || gimple_assign_rhs_code (stmt) == WIDEN_MULT_EXPR
+ || gimple_assign_rhs_code (stmt) == FLOAT_EXPR))
+ {
+ tree rhs_type = TREE_TYPE (gimple_assign_rhs1 (stmt));
+
+ rhs = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (rhs_type));
+ if (rhs < lhs)
+ scalar_type = rhs_type;
+ }
+
+ *lhs_size_unit = lhs;
+ *rhs_size_unit = rhs;
+ return scalar_type;
+}
+
+
/* Function vect_determine_vectorization_factor
Determine the vectorization factor (VF). VF is the number of data elements
@@ -75,14 +119,15 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo);
int nbbs = loop->num_nodes;
- block_stmt_iterator si;
+ gimple_stmt_iterator si;
unsigned int vectorization_factor = 0;
tree scalar_type;
- tree phi;
+ gimple phi;
tree vectype;
unsigned int nunits;
stmt_vec_info stmt_info;
int i;
+ HOST_WIDE_INT dummy;
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "=== vect_determine_vectorization_factor ===");
@@ -91,13 +136,14 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
{
basic_block bb = bbs[i];
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
{
+ phi = gsi_stmt (si);
stmt_info = vinfo_for_stmt (phi);
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "==> examining phi: ");
- print_generic_expr (vect_dump, phi, TDF_SLIM);
+ print_gimple_stmt (vect_dump, phi, 0, TDF_SLIM);
}
gcc_assert (stmt_info);
@@ -142,15 +188,15 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
}
}
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
- tree stmt = bsi_stmt (si);
+ gimple stmt = gsi_stmt (si);
stmt_info = vinfo_for_stmt (stmt);
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "==> examining statement: ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
gcc_assert (stmt_info);
@@ -164,23 +210,22 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
continue;
}
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (gimple_get_lhs (stmt) == NULL_TREE)
{
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS))
{
fprintf (vect_dump, "not vectorized: irregular stmt.");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
return false;
}
- if (!GIMPLE_STMT_P (stmt)
- && VECTOR_MODE_P (TYPE_MODE (TREE_TYPE (stmt))))
+ if (VECTOR_MODE_P (TYPE_MODE (gimple_expr_type (stmt))))
{
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS))
{
fprintf (vect_dump, "not vectorized: vector stmt in loop:");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
return false;
}
@@ -196,39 +241,12 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
}
else
{
- tree operation;
gcc_assert (! STMT_VINFO_DATA_REF (stmt_info)
&& !is_pattern_stmt_p (stmt_info));
- /* We generally set the vectype according to the type of the
- result (lhs).
- For stmts whose result-type is different than the type of the
- arguments (e.g. demotion, promotion), vectype will be reset
- appropriately (later). Note that we have to visit the smallest
- datatype in this function, because that determines the VF.
- If the smallest datatype in the loop is present only as the
- rhs of a promotion operation - we'd miss it here.
- Such a case, where a variable of this datatype does not appear
- in the lhs anywhere in the loop, can only occur if it's an
- invariant: e.g.: 'int_x = (int) short_inv', which we'd expect
- to have been optimized away by invariant motion. However, we
- cannot rely on invariant motion to always take invariants out
- of the loop, and so in the case of promotion we also have to
- check the rhs. */
- scalar_type = TREE_TYPE (GIMPLE_STMT_OPERAND (stmt, 0));
-
- operation = GIMPLE_STMT_OPERAND (stmt, 1);
- if (CONVERT_EXPR_P (operation)
- || TREE_CODE (operation) == WIDEN_MULT_EXPR
- || TREE_CODE (operation) == FLOAT_EXPR)
- {
- tree rhs_type = TREE_TYPE (TREE_OPERAND (operation, 0));
- if (TREE_INT_CST_LOW (TYPE_SIZE_UNIT (rhs_type)) <
- TREE_INT_CST_LOW (TYPE_SIZE_UNIT (scalar_type)))
- scalar_type = rhs_type;
- }
-
+ scalar_type = vect_get_smallest_scalar_type (stmt, &dummy,
+ &dummy);
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "get vectype for scalar type: ");
@@ -315,11 +333,11 @@ vect_analyze_operations (loop_vec_info loop_vinfo)
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo);
int nbbs = loop->num_nodes;
- block_stmt_iterator si;
+ gimple_stmt_iterator si;
unsigned int vectorization_factor = 0;
int i;
bool ok;
- tree phi;
+ gimple phi;
stmt_vec_info stmt_info;
bool need_to_vectorize = false;
int min_profitable_iters;
@@ -337,15 +355,16 @@ vect_analyze_operations (loop_vec_info loop_vinfo)
{
basic_block bb = bbs[i];
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
{
+ phi = gsi_stmt (si);
ok = true;
stmt_info = vinfo_for_stmt (phi);
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "examining phi: ");
- print_generic_expr (vect_dump, phi, TDF_SLIM);
+ print_gimple_stmt (vect_dump, phi, 0, TDF_SLIM);
}
if (! is_loop_header_bb_p (bb))
@@ -398,22 +417,22 @@ vect_analyze_operations (loop_vec_info loop_vinfo)
{
fprintf (vect_dump,
"not vectorized: relevant phi not supported: ");
- print_generic_expr (vect_dump, phi, TDF_SLIM);
+ print_gimple_stmt (vect_dump, phi, 0, TDF_SLIM);
}
return false;
}
}
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
- tree stmt = bsi_stmt (si);
+ gimple stmt = gsi_stmt (si);
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
enum vect_def_type relevance = STMT_VINFO_RELEVANT (stmt_info);
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "==> examining statement: ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
gcc_assert (stmt_info);
@@ -454,8 +473,7 @@ vect_analyze_operations (loop_vec_info loop_vinfo)
if (STMT_VINFO_RELEVANT_P (stmt_info))
{
- gcc_assert (GIMPLE_STMT_P (stmt)
- || !VECTOR_MODE_P (TYPE_MODE (TREE_TYPE (stmt))));
+ gcc_assert (!VECTOR_MODE_P (TYPE_MODE (gimple_expr_type (stmt))));
gcc_assert (STMT_VINFO_VECTYPE (stmt_info));
need_to_vectorize = true;
}
@@ -463,12 +481,12 @@ 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)
- || vectorizable_load (stmt, NULL, NULL, NULL)
+ || vectorizable_load (stmt, NULL, NULL, NULL, NULL)
|| vectorizable_call (stmt, NULL, NULL)
|| vectorizable_store (stmt, NULL, NULL, NULL)
|| vectorizable_condition (stmt, NULL, NULL)
@@ -480,7 +498,7 @@ vect_analyze_operations (loop_vec_info loop_vinfo)
{
fprintf (vect_dump, "not vectorized: relevant stmt not ");
fprintf (vect_dump, "supported: ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
return false;
}
@@ -497,7 +515,7 @@ vect_analyze_operations (loop_vec_info loop_vinfo)
{
fprintf (vect_dump, "not vectorized: live stmt not ");
fprintf (vect_dump, "supported: ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
return false;
}
@@ -520,7 +538,7 @@ vect_analyze_operations (loop_vec_info loop_vinfo)
{
fprintf (vect_dump, "not vectorized: the size of group "
"of strided accesses is not a power of 2");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
return false;
}
@@ -649,7 +667,7 @@ vect_analyze_operations (loop_vec_info loop_vinfo)
used in STMT for anything other than indexing an array. */
static bool
-exist_non_indexing_operands_for_use_p (tree use, tree stmt)
+exist_non_indexing_operands_for_use_p (tree use, gimple stmt)
{
tree operand;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
@@ -673,10 +691,12 @@ exist_non_indexing_operands_for_use_p (tree use, tree stmt)
Therefore, all we need to check is if STMT falls into the
first case, and whether var corresponds to USE. */
- if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == SSA_NAME)
+ if (TREE_CODE (gimple_assign_lhs (stmt)) == SSA_NAME)
return false;
- operand = GIMPLE_STMT_OPERAND (stmt, 1);
+ if (!gimple_assign_copy_p (stmt))
+ return false;
+ operand = gimple_assign_rhs1 (stmt);
if (TREE_CODE (operand) != SSA_NAME)
return false;
@@ -698,17 +718,18 @@ exist_non_indexing_operands_for_use_p (tree use, tree stmt)
static void
vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop)
{
- tree phi;
basic_block bb = loop->header;
tree dumy;
- VEC(tree,heap) *worklist = VEC_alloc (tree, heap, 64);
+ VEC(gimple,heap) *worklist = VEC_alloc (gimple, heap, 64);
+ gimple_stmt_iterator gsi;
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "=== vect_analyze_scalar_cycles ===");
/* First - identify all inductions. */
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
+ gimple phi = gsi_stmt (gsi);
tree access_fn = NULL;
tree def = PHI_RESULT (phi);
stmt_vec_info stmt_vinfo = vinfo_for_stmt (phi);
@@ -716,7 +737,7 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop)
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "Analyze phi: ");
- print_generic_expr (vect_dump, phi, TDF_SLIM);
+ print_gimple_stmt (vect_dump, phi, 0, TDF_SLIM);
}
/* Skip virtual phi's. The data dependences that are associated with
@@ -737,7 +758,7 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop)
if (!access_fn
|| !vect_is_simple_iv_evolution (loop->num, access_fn, &dumy, &dumy))
{
- VEC_safe_push (tree, heap, worklist, phi);
+ VEC_safe_push (gimple, heap, worklist, phi);
continue;
}
@@ -748,17 +769,17 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop)
/* Second - identify all reductions. */
- while (VEC_length (tree, worklist) > 0)
+ while (VEC_length (gimple, worklist) > 0)
{
- tree phi = VEC_pop (tree, worklist);
+ gimple phi = VEC_pop (gimple, worklist);
tree def = PHI_RESULT (phi);
stmt_vec_info stmt_vinfo = vinfo_for_stmt (phi);
- tree reduc_stmt;
+ gimple reduc_stmt;
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "Analyze phi: ");
- print_generic_expr (vect_dump, phi, TDF_SLIM);
+ print_gimple_stmt (vect_dump, phi, 0, TDF_SLIM);
}
gcc_assert (is_gimple_reg (SSA_NAME_VAR (def)));
@@ -778,7 +799,7 @@ vect_analyze_scalar_cycles_1 (loop_vec_info loop_vinfo, struct loop *loop)
fprintf (vect_dump, "Unknown def-use cycle pattern.");
}
- VEC_free (tree, heap, worklist);
+ VEC_free (gimple, heap, worklist);
return;
}
@@ -825,6 +846,31 @@ vect_analyze_scalar_cycles (loop_vec_info loop_vinfo)
}
+/* Find the place of the data-ref in STMT in the interleaving chain that starts
+ from FIRST_STMT. Return -1 if the data-ref is not a part of the chain. */
+
+static int
+vect_get_place_in_interleaving_chain (gimple stmt, gimple first_stmt)
+{
+ gimple next_stmt = first_stmt;
+ int result = 0;
+
+ if (first_stmt != DR_GROUP_FIRST_DR (vinfo_for_stmt (stmt)))
+ return -1;
+
+ while (next_stmt && next_stmt != stmt)
+ {
+ result++;
+ next_stmt = DR_GROUP_NEXT_DR (vinfo_for_stmt (next_stmt));
+ }
+
+ if (next_stmt)
+ return result;
+ else
+ return -1;
+}
+
+
/* Function vect_insert_into_interleaving_chain.
Insert DRA into the interleaving chain of DRB according to DRA's INIT. */
@@ -833,7 +879,8 @@ static void
vect_insert_into_interleaving_chain (struct data_reference *dra,
struct data_reference *drb)
{
- tree prev, next, next_init;
+ gimple prev, next;
+ tree next_init;
stmt_vec_info stmtinfo_a = vinfo_for_stmt (DR_STMT (dra));
stmt_vec_info stmtinfo_b = vinfo_for_stmt (DR_STMT (drb));
@@ -855,7 +902,7 @@ vect_insert_into_interleaving_chain (struct data_reference *dra,
/* We got to the end of the list. Insert here. */
DR_GROUP_NEXT_DR (vinfo_for_stmt (prev)) = DR_STMT (dra);
- DR_GROUP_NEXT_DR (stmtinfo_a) = NULL_TREE;
+ DR_GROUP_NEXT_DR (stmtinfo_a) = NULL;
}
@@ -888,8 +935,10 @@ vect_update_interleaving_chain (struct data_reference *drb,
{
stmt_vec_info stmtinfo_a = vinfo_for_stmt (DR_STMT (dra));
stmt_vec_info stmtinfo_b = vinfo_for_stmt (DR_STMT (drb));
- tree next_init, init_dra_chain, init_drb_chain, first_a, first_b;
- tree node, prev, next, node_init, first_stmt;
+ tree next_init, init_dra_chain, init_drb_chain;
+ gimple first_a, first_b;
+ tree node_init;
+ gimple node, prev, next, first_stmt;
/* 1. New stmts - both DRA and DRB are not a part of any chain. */
if (!DR_GROUP_FIRST_DR (stmtinfo_a) && !DR_GROUP_FIRST_DR (stmtinfo_b))
@@ -912,10 +961,10 @@ vect_update_interleaving_chain (struct data_reference *drb,
/* 3. DRA is a part of a chain and DRB is not. */
if (DR_GROUP_FIRST_DR (stmtinfo_a) && !DR_GROUP_FIRST_DR (stmtinfo_b))
{
- tree old_first_stmt = DR_GROUP_FIRST_DR (stmtinfo_a);
+ gimple old_first_stmt = DR_GROUP_FIRST_DR (stmtinfo_a);
tree init_old = DR_INIT (STMT_VINFO_DATA_REF (vinfo_for_stmt (
old_first_stmt)));
- tree tmp;
+ gimple tmp;
if (tree_int_cst_compare (init_old, DR_INIT (drb)) > 0)
{
@@ -991,7 +1040,7 @@ vect_update_interleaving_chain (struct data_reference *drb,
{
/* We got to the end of the list. Insert here. */
DR_GROUP_NEXT_DR (vinfo_for_stmt (prev)) = node;
- DR_GROUP_NEXT_DR (vinfo_for_stmt (node)) = NULL_TREE;
+ DR_GROUP_NEXT_DR (vinfo_for_stmt (node)) = NULL;
prev = node;
}
DR_GROUP_FIRST_DR (vinfo_for_stmt (node)) = first_stmt;
@@ -1122,8 +1171,8 @@ vect_check_interleaving (struct data_reference *dra,
static bool
vect_same_range_drs (data_reference_p dr_i, data_reference_p dr_j)
{
- tree stmt_i = DR_STMT (dr_i);
- tree stmt_j = DR_STMT (dr_j);
+ gimple stmt_i = DR_STMT (dr_i);
+ gimple stmt_j = DR_STMT (dr_j);
if (operand_equal_p (DR_REF (dr_i), DR_REF (dr_j), 0)
|| (DR_GROUP_FIRST_DR (vinfo_for_stmt (stmt_i))
@@ -1170,7 +1219,7 @@ vect_mark_for_runtime_alias_test (ddr_p ddr, loop_vec_info loop_vinfo)
print_generic_expr (vect_dump, DR_REF (DDR_B (ddr)), TDF_SLIM);
}
- if (optimize_size)
+ if (optimize_loop_nest_for_size_p (loop))
{
if (vect_print_dump_info (REPORT_DR_DETAILS))
fprintf (vect_dump, "versioning not supported when optimizing for size.");
@@ -1351,7 +1400,7 @@ vect_analyze_data_ref_dependences (loop_vec_info loop_vinfo)
static bool
vect_compute_data_ref_alignment (struct data_reference *dr)
{
- tree stmt = DR_STMT (dr);
+ gimple stmt = DR_STMT (dr);
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);
@@ -1570,7 +1619,7 @@ vect_verify_datarefs_alignment (loop_vec_info loop_vinfo)
for (i = 0; VEC_iterate (data_reference_p, datarefs, i, dr); i++)
{
- tree stmt = DR_STMT (dr);
+ gimple stmt = DR_STMT (dr);
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
/* For interleaving, only the alignment of the first access matters. */
@@ -1608,7 +1657,7 @@ vect_verify_datarefs_alignment (loop_vec_info loop_vinfo)
static bool
vector_alignment_reachable_p (struct data_reference *dr)
{
- tree stmt = DR_STMT (dr);
+ gimple stmt = DR_STMT (dr);
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
@@ -1773,7 +1822,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
bool do_peeling = false;
bool do_versioning = false;
bool stat;
- tree stmt;
+ gimple stmt;
stmt_vec_info stmt_info;
int vect_versioning_for_alias_required;
@@ -1857,7 +1906,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
{
int mis;
int npeel = 0;
- tree stmt = DR_STMT (dr0);
+ gimple stmt = DR_STMT (dr0);
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
int nelements = TYPE_VECTOR_SUBPARTS (vectype);
@@ -1944,7 +1993,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
/* Try versioning if:
1) flag_tree_vect_loop_version is TRUE
- 2) optimize_size is FALSE
+ 2) optimize loop for speed
3) there is at least one unsupported misaligned data ref with an unknown
misalignment, and
4) all misaligned data refs with a known misalignment are supported, and
@@ -1952,7 +2001,7 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
do_versioning =
flag_tree_vect_loop_version
- && (!optimize_size)
+ && optimize_loop_nest_for_speed_p (loop)
&& (!loop->inner); /* FORNOW */
if (do_versioning)
@@ -1973,12 +2022,12 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
if (!supportable_dr_alignment)
{
- tree stmt;
+ gimple stmt;
int mask;
tree vectype;
if (known_alignment_for_access_p (dr)
- || VEC_length (tree,
+ || VEC_length (gimple,
LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo))
>= (unsigned) PARAM_VALUE (PARAM_VECT_MAX_VERSION_FOR_ALIGNMENT_CHECKS))
{
@@ -2004,29 +2053,29 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
gcc_assert (!LOOP_VINFO_PTR_MASK (loop_vinfo)
|| LOOP_VINFO_PTR_MASK (loop_vinfo) == mask);
LOOP_VINFO_PTR_MASK (loop_vinfo) = mask;
- VEC_safe_push (tree, heap,
+ VEC_safe_push (gimple, heap,
LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo),
DR_STMT (dr));
}
}
/* Versioning requires at least one misaligned data reference. */
- if (VEC_length (tree, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo)) == 0)
+ if (VEC_length (gimple, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo)) == 0)
do_versioning = false;
else if (!do_versioning)
- VEC_truncate (tree, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo), 0);
+ VEC_truncate (gimple, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo), 0);
}
if (do_versioning)
{
- VEC(tree,heap) *may_misalign_stmts
+ VEC(gimple,heap) *may_misalign_stmts
= LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo);
- tree stmt;
+ gimple stmt;
/* It can now be assumed that the data references in the statements
in LOOP_VINFO_MAY_MISALIGN_STMTS will be aligned in the version
of the loop being vectorized. */
- for (i = 0; VEC_iterate (tree, may_misalign_stmts, i, stmt); i++)
+ for (i = 0; VEC_iterate (gimple, may_misalign_stmts, i, stmt); i++)
{
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
dr = STMT_VINFO_DATA_REF (stmt_info);
@@ -2088,7 +2137,7 @@ vect_analyze_group_access (struct data_reference *dr)
tree step = DR_STEP (dr);
tree scalar_type = TREE_TYPE (DR_REF (dr));
HOST_WIDE_INT type_size = TREE_INT_CST_LOW (TYPE_SIZE_UNIT (scalar_type));
- tree stmt = DR_STMT (dr);
+ gimple stmt = DR_STMT (dr);
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
HOST_WIDE_INT dr_step = TREE_INT_CST_LOW (step);
@@ -2132,12 +2181,12 @@ vect_analyze_group_access (struct data_reference *dr)
if (DR_GROUP_FIRST_DR (vinfo_for_stmt (stmt)) == stmt)
{
/* First stmt in the interleaving chain. Check the chain. */
- tree next = DR_GROUP_NEXT_DR (vinfo_for_stmt (stmt));
+ gimple next = DR_GROUP_NEXT_DR (vinfo_for_stmt (stmt));
struct data_reference *data_ref = dr;
unsigned int count = 1;
tree next_step;
tree prev_init = DR_INIT (data_ref);
- tree prev = stmt;
+ gimple prev = stmt;
HOST_WIDE_INT diff, count_in_bytes;
while (next)
@@ -2280,7 +2329,7 @@ vect_analyze_group_access (struct data_reference *dr)
/* SLP: create an SLP data structure for every interleaving group of
stores for further analysis in vect_analyse_slp. */
if (!DR_IS_READ (dr) && !slp_impossible)
- VEC_safe_push (tree, heap, LOOP_VINFO_STRIDED_STORES (loop_vinfo), stmt);
+ VEC_safe_push (gimple, heap, LOOP_VINFO_STRIDED_STORES (loop_vinfo), stmt);
}
return true;
@@ -2296,7 +2345,7 @@ vect_analyze_data_ref_access (struct data_reference *dr)
{
tree step = DR_STEP (dr);
tree scalar_type = TREE_TYPE (DR_REF (dr));
- tree stmt = DR_STMT (dr);
+ gimple stmt = DR_STMT (dr);
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);
@@ -2317,7 +2366,7 @@ vect_analyze_data_ref_access (struct data_reference *dr)
{
/* Interleaved accesses are not yet supported within outer-loop
vectorization for references in the inner-loop. */
- DR_GROUP_FIRST_DR (vinfo_for_stmt (stmt)) = NULL_TREE;
+ DR_GROUP_FIRST_DR (vinfo_for_stmt (stmt)) = NULL;
/* For the rest of the analysis we use the outer-loop step. */
step = STMT_VINFO_DR_STEP (stmt_info);
@@ -2338,7 +2387,7 @@ vect_analyze_data_ref_access (struct data_reference *dr)
if (!tree_int_cst_compare (step, TYPE_SIZE_UNIT (scalar_type)))
{
/* Mark that it is not interleaving. */
- DR_GROUP_FIRST_DR (vinfo_for_stmt (stmt)) = NULL_TREE;
+ DR_GROUP_FIRST_DR (vinfo_for_stmt (stmt)) = NULL;
return true;
}
@@ -2458,7 +2507,7 @@ vect_prune_runtime_alias_test_list (loop_vec_info loop_vinfo)
/* Recursively free the memory allocated for the SLP tree rooted at NODE. */
-void
+static void
vect_free_slp_tree (slp_tree node)
{
if (!node)
@@ -2470,50 +2519,58 @@ vect_free_slp_tree (slp_tree node)
if (SLP_TREE_RIGHT (node))
vect_free_slp_tree (SLP_TREE_RIGHT (node));
- VEC_free (tree, heap, SLP_TREE_SCALAR_STMTS (node));
+ VEC_free (gimple, heap, SLP_TREE_SCALAR_STMTS (node));
if (SLP_TREE_VEC_STMTS (node))
- VEC_free (tree, heap, SLP_TREE_VEC_STMTS (node));
+ VEC_free (gimple, heap, SLP_TREE_VEC_STMTS (node));
free (node);
}
-/* Get the defs for the RHS (collect them in DEF_STMTS0/1), check that they are
- of a legal type and that they match the defs of the first stmt of the SLP
- group (stored in FIRST_STMT_...). */
+/* Free the memory allocated for the SLP instance. */
+
+void
+vect_free_slp_instance (slp_instance instance)
+{
+ vect_free_slp_tree (SLP_INSTANCE_TREE (instance));
+ VEC_free (int, heap, SLP_INSTANCE_LOAD_PERMUTATION (instance));
+ VEC_free (slp_tree, heap, SLP_INSTANCE_LOADS (instance));
+}
+
+
+/* Get the defs for the rhs of STMT (collect them in DEF_STMTS0/1), check that
+ they are of a legal type and that they match the defs of the first stmt of
+ the SLP group (stored in FIRST_STMT_...). */
static bool
vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, slp_tree slp_node,
- tree rhs, VEC (tree, heap) **def_stmts0,
- VEC (tree, heap) **def_stmts1,
+ gimple stmt, VEC (gimple, heap) **def_stmts0,
+ VEC (gimple, heap) **def_stmts1,
enum vect_def_type *first_stmt_dt0,
enum vect_def_type *first_stmt_dt1,
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;
- enum operation_type op_type = TREE_OPERAND_LENGTH (rhs);
- unsigned int i, number_of_oprnds = op_type;
- tree def, def_stmt;
+ unsigned int i, number_of_oprnds;
+ tree def;
+ gimple def_stmt;
enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type};
stmt_vec_info stmt_info =
- vinfo_for_stmt (VEC_index (tree, SLP_TREE_SCALAR_STMTS (slp_node), 0));
+ vinfo_for_stmt (VEC_index (gimple, SLP_TREE_SCALAR_STMTS (slp_node), 0));
+ enum gimple_rhs_class rhs_class;
+ struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- /* Store. */
- if (!op_type)
- number_of_oprnds = 1;
- else
- gcc_assert (op_type == unary_op || op_type == binary_op);
+ rhs_class = get_gimple_rhs_class (gimple_assign_rhs_code (stmt));
+ number_of_oprnds = gimple_num_ops (stmt) - 1; /* RHS only */
for (i = 0; i < number_of_oprnds; i++)
{
- if (op_type)
- oprnd = TREE_OPERAND (rhs, i);
- else
- oprnd = rhs;
+ oprnd = gimple_op (stmt, i + 1);
if (!vect_is_simple_use (oprnd, loop_vinfo, &def_stmt, &def, &dt[i])
|| (!def_stmt && dt[i] != vect_constant_def))
@@ -2527,6 +2584,60 @@ 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 && gimple_bb (def_stmt)
+ && flow_bb_inside_loop_p (loop, gimple_bb (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. */
@@ -2537,7 +2648,7 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, slp_tree slp_node,
*first_stmt_const_oprnd = oprnd;
/* Analyze costs (for the first stmt of the group only). */
- if (op_type)
+ if (rhs_class != GIMPLE_SINGLE_RHS)
/* Not memory operation (we don't call this functions for loads). */
vect_model_simple_cost (stmt_info, ncopies_for_cost, dt, slp_node);
else
@@ -2600,9 +2711,9 @@ vect_get_and_check_slp_defs (loop_vec_info loop_vinfo, slp_tree slp_node,
case vect_loop_def:
if (i == 0)
- VEC_safe_push (tree, heap, *def_stmts0, def_stmt);
+ VEC_safe_push (gimple, heap, *def_stmts0, def_stmt);
else
- VEC_safe_push (tree, heap, *def_stmts1, def_stmt);
+ VEC_safe_push (gimple, heap, *def_stmts1, def_stmt);
break;
default:
@@ -2624,25 +2735,25 @@ 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 (int, heap) **load_permutation,
+ VEC (slp_tree, heap) **loads)
{
- VEC (tree, heap) *def_stmts0 = VEC_alloc (tree, heap, group_size);
- VEC (tree, heap) *def_stmts1 = VEC_alloc (tree, heap, group_size);
+ VEC (gimple, heap) *def_stmts0 = VEC_alloc (gimple, heap, group_size);
+ VEC (gimple, heap) *def_stmts1 = VEC_alloc (gimple, heap, group_size);
unsigned int i;
- VEC (tree, heap) *stmts = SLP_TREE_SCALAR_STMTS (*node);
- tree stmt = VEC_index (tree, stmts, 0);
+ VEC (gimple, heap) *stmts = SLP_TREE_SCALAR_STMTS (*node);
+ gimple stmt = VEC_index (gimple, stmts, 0);
enum vect_def_type first_stmt_dt0 = 0, first_stmt_dt1 = 0;
- enum tree_code first_stmt_code = 0;
+ enum tree_code first_stmt_code = 0, rhs_code;
tree first_stmt_def1_type = NULL_TREE, first_stmt_def0_type = NULL_TREE;
- tree lhs, rhs, prev_stmt = NULL_TREE;
+ tree lhs;
bool stop_recursion = false, need_same_oprnds = false;
tree vectype, scalar_type, first_op1 = NULL_TREE;
unsigned int vectorization_factor = 0, ncopies;
@@ -2652,28 +2763,35 @@ 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;
+ HOST_WIDE_INT dummy;
+ bool permutation = false;
+ unsigned int load_place;
+ gimple first_load;
/* For every stmt in NODE find its def stmt/s. */
- for (i = 0; VEC_iterate (tree, stmts, i, stmt); i++)
+ for (i = 0; VEC_iterate (gimple, stmts, i, stmt); i++)
{
if (vect_print_dump_info (REPORT_SLP))
{
fprintf (vect_dump, "Build SLP for ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ lhs = gimple_get_lhs (stmt);
+ if (lhs == NULL_TREE)
{
if (vect_print_dump_info (REPORT_SLP))
{
- fprintf (vect_dump, "Build SLP failed: not MODIFY_STMT ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ fprintf (vect_dump,
+ "Build SLP failed: not GIMPLE_ASSIGN nor GIMPLE_CALL");
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
return false;
}
- scalar_type = TREE_TYPE (GIMPLE_STMT_OPERAND (stmt, 0));
+ scalar_type = vect_get_smallest_scalar_type (stmt, &dummy, &dummy);
vectype = get_vectype_for_scalar_type (scalar_type);
if (!vectype)
{
@@ -2688,34 +2806,33 @@ 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 ");
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ /* 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
+ rhs_code = gimple_assign_rhs_code (stmt);
/* Check the operation. */
if (i == 0)
{
- first_stmt_code = TREE_CODE (rhs);
+ first_stmt_code = rhs_code;
/* Shift arguments should be equal in all the packed stmts for a
vector shift with scalar shift operand. */
- if (TREE_CODE (rhs) == LSHIFT_EXPR || TREE_CODE (rhs) == RSHIFT_EXPR
- || TREE_CODE (rhs) == LROTATE_EXPR
- || TREE_CODE (rhs) == RROTATE_EXPR)
+ if (rhs_code == LSHIFT_EXPR || rhs_code == RSHIFT_EXPR
+ || rhs_code == LROTATE_EXPR
+ || rhs_code == RROTATE_EXPR)
{
vec_mode = TYPE_MODE (vectype);
/* First see if we have a vector/vector shift. */
- optab = optab_for_tree_code (TREE_CODE (rhs), vectype,
+ optab = optab_for_tree_code (rhs_code, vectype,
optab_vector);
if (!optab
@@ -2723,7 +2840,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, slp_tree *node,
== CODE_FOR_nothing))
{
/* No vector/vector shift, try for a vector/scalar shift. */
- optab = optab_for_tree_code (TREE_CODE (rhs), vectype,
+ optab = optab_for_tree_code (rhs_code, vectype,
optab_scalar);
if (!optab)
@@ -2736,41 +2853,45 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, slp_tree *node,
if (icode == CODE_FOR_nothing)
{
if (vect_print_dump_info (REPORT_SLP))
- fprintf (vect_dump,
- "Build SLP failed: op not supported by target.");
+ fprintf (vect_dump, "Build SLP failed: "
+ "op not supported by target.");
return false;
}
optab_op2_mode = insn_data[icode].operand[2].mode;
if (!VECTOR_MODE_P (optab_op2_mode))
{
need_same_oprnds = true;
- first_op1 = TREE_OPERAND (rhs, 1);
+ first_op1 = gimple_assign_rhs2 (stmt);
}
}
}
}
else
{
- if (first_stmt_code != TREE_CODE (rhs))
+ if (first_stmt_code != rhs_code
+ && (first_stmt_code != IMAGPART_EXPR
+ || rhs_code != REALPART_EXPR)
+ && (first_stmt_code != REALPART_EXPR
+ || rhs_code != IMAGPART_EXPR))
{
if (vect_print_dump_info (REPORT_SLP))
{
fprintf (vect_dump,
"Build SLP failed: different operation in stmt ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
return false;
}
if (need_same_oprnds
- && !operand_equal_p (first_op1, TREE_OPERAND (rhs, 1), 0))
+ && !operand_equal_p (first_op1, gimple_assign_rhs2 (stmt), 0))
{
if (vect_print_dump_info (REPORT_SLP))
{
fprintf (vect_dump,
"Build SLP failed: different shift arguments in ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
return false;
@@ -2783,92 +2904,83 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, slp_tree *node,
if (REFERENCE_CLASS_P (lhs))
{
/* Store. */
- if (!vect_get_and_check_slp_defs (loop_vinfo, *node, rhs,
+ if (!vect_get_and_check_slp_defs (loop_vinfo, *node, stmt,
&def_stmts0, &def_stmts1,
&first_stmt_dt0,
&first_stmt_dt1,
&first_stmt_def0_type,
&first_stmt_def1_type,
&first_stmt_const_oprnd,
- ncopies_for_cost))
+ ncopies_for_cost,
+ &pattern0, &pattern1))
return false;
}
else
{
/* Load. */
- if (i == 0)
- {
- /* 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. */
- if (DR_GROUP_FIRST_DR (vinfo_for_stmt (stmt)) != stmt
- || DR_GROUP_GAP (vinfo_for_stmt (stmt)) != 0)
- {
- /* FORNOW: data permutations and gaps in loads are not
- supported. */
- if (vect_print_dump_info (REPORT_SLP))
- {
- fprintf (vect_dump, "Build SLP failed: strided "
- " loads need permutation or have gaps ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
- }
-
- return false;
- }
-
- first_dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (stmt));
- if (vect_supportable_dr_alignment (first_dr)
- == dr_unaligned_unsupported)
- {
- if (vect_print_dump_info (REPORT_SLP))
- {
- fprintf (vect_dump, "Build SLP failed: unsupported "
- " unaligned load ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
- }
-
- return false;
- }
-
- /* Analyze costs (for the first stmt in the group). */
- vect_model_load_cost (vinfo_for_stmt (stmt),
- ncopies_for_cost, *node);
- }
- else
- {
- /* Check that we have consecutive loads from interleaving
- chain and that there is no gap between the loads. */
- if (DR_GROUP_NEXT_DR (vinfo_for_stmt (prev_stmt)) != stmt
- || DR_GROUP_GAP (vinfo_for_stmt (stmt)) != 1)
- {
- /* FORNOW: data permutations and gaps in loads are not
- supported. */
- if (vect_print_dump_info (REPORT_SLP))
- {
- fprintf (vect_dump, "Build SLP failed: strided "
- " loads need permutation or have gaps ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
- }
- return false;
- }
- }
-
- prev_stmt = stmt;
-
- /* We stop the tree when we reach a group of loads. */
- stop_recursion = true;
- continue;
- }
- } /* Strided access. */
+ /* FORNOW: Check that there is no gap between the loads. */
+ if ((DR_GROUP_FIRST_DR (vinfo_for_stmt (stmt)) == stmt
+ && DR_GROUP_GAP (vinfo_for_stmt (stmt)) != 0)
+ || (DR_GROUP_FIRST_DR (vinfo_for_stmt (stmt)) != stmt
+ && DR_GROUP_GAP (vinfo_for_stmt (stmt)) != 1))
+ {
+ if (vect_print_dump_info (REPORT_SLP))
+ {
+ fprintf (vect_dump, "Build SLP failed: strided "
+ "loads have gaps ");
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
+ }
+
+ return false;
+ }
+
+ first_load = DR_GROUP_FIRST_DR (vinfo_for_stmt (stmt));
+
+ if (first_load == stmt)
+ {
+ first_dr = STMT_VINFO_DATA_REF (vinfo_for_stmt (stmt));
+ if (vect_supportable_dr_alignment (first_dr)
+ == dr_unaligned_unsupported)
+ {
+ if (vect_print_dump_info (REPORT_SLP))
+ {
+ fprintf (vect_dump, "Build SLP failed: unsupported "
+ "unaligned load ");
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
+ }
+
+ return false;
+ }
+
+ /* Analyze costs (for the first stmt in the group). */
+ vect_model_load_cost (vinfo_for_stmt (stmt),
+ ncopies_for_cost, *node);
+ }
+
+ /* Store the place of this load in the interleaving chain. In
+ case that permutation is needed we later decide if a specific
+ permutation is supported. */
+ load_place = vect_get_place_in_interleaving_chain (stmt,
+ first_load);
+ if (load_place != i)
+ permutation = true;
+
+ VEC_safe_push (int, heap, *load_permutation, load_place);
+
+ /* We stop the tree when we reach a group of loads. */
+ stop_recursion = true;
+ continue;
+ }
+ } /* Strided access. */
else
{
- if (REFERENCE_CLASS_P (rhs))
+ if (TREE_CODE_CLASS (rhs_code) == tcc_reference)
{
/* Not strided load. */
if (vect_print_dump_info (REPORT_SLP))
{
fprintf (vect_dump, "Build SLP failed: not strided load ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
/* FORNOW: Not strided loads are not supported. */
@@ -2876,26 +2988,28 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, slp_tree *node,
}
/* Not memory operation. */
- if (!BINARY_CLASS_P (rhs) && !UNARY_CLASS_P (rhs))
+ if (TREE_CODE_CLASS (rhs_code) != tcc_binary
+ && TREE_CODE_CLASS (rhs_code) != tcc_unary)
{
if (vect_print_dump_info (REPORT_SLP))
{
fprintf (vect_dump, "Build SLP failed: operation");
fprintf (vect_dump, " unsupported ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
return false;
}
/* Find the def-stmts. */
- if (!vect_get_and_check_slp_defs (loop_vinfo, *node, rhs, &def_stmts0,
- &def_stmts1, &first_stmt_dt0,
- &first_stmt_dt1,
+ if (!vect_get_and_check_slp_defs (loop_vinfo, *node, stmt,
+ &def_stmts0, &def_stmts1,
+ &first_stmt_dt0, &first_stmt_dt1,
&first_stmt_def0_type,
&first_stmt_def1_type,
&first_stmt_const_oprnd,
- ncopies_for_cost))
+ ncopies_for_cost,
+ &pattern0, &pattern1))
return false;
}
}
@@ -2906,7 +3020,15 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, slp_tree *node,
/* Strided loads were reached - stop the recursion. */
if (stop_recursion)
- return true;
+ {
+ if (permutation)
+ {
+ VEC_safe_push (slp_tree, heap, *loads, *node);
+ *inside_cost += TARG_VEC_PERMUTE_COST * group_size;
+ }
+
+ return true;
+ }
/* Create SLP_TREE nodes for the definition node/s. */
if (first_stmt_dt0 == vect_loop_def)
@@ -2919,8 +3041,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, load_permutation, loads))
return false;
SLP_TREE_LEFT (*node) = left_node;
@@ -2936,8 +3058,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, load_permutation, loads))
return false;
SLP_TREE_RIGHT (*node) = right_node;
@@ -2951,16 +3073,16 @@ static void
vect_print_slp_tree (slp_tree node)
{
int i;
- tree stmt;
+ gimple stmt;
if (!node)
return;
fprintf (vect_dump, "node ");
- for (i = 0; VEC_iterate (tree, SLP_TREE_SCALAR_STMTS (node), i, stmt); i++)
+ for (i = 0; VEC_iterate (gimple, SLP_TREE_SCALAR_STMTS (node), i, stmt); i++)
{
fprintf (vect_dump, "\n\tstmt %d ", i);
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
fprintf (vect_dump, "\n");
@@ -2978,12 +3100,12 @@ static void
vect_mark_slp_stmts (slp_tree node, enum slp_vect_type mark, int j)
{
int i;
- tree stmt;
+ gimple stmt;
if (!node)
return;
- for (i = 0; VEC_iterate (tree, SLP_TREE_SCALAR_STMTS (node), i, stmt); i++)
+ for (i = 0; VEC_iterate (gimple, SLP_TREE_SCALAR_STMTS (node), i, stmt); i++)
if (j < 0 || i == j)
STMT_SLP_TYPE (vinfo_for_stmt (stmt)) = mark;
@@ -2992,24 +3114,138 @@ vect_mark_slp_stmts (slp_tree node, enum slp_vect_type mark, int j)
}
+/* Check if the permutation required by the SLP INSTANCE is supported.
+ Reorganize the SLP nodes stored in SLP_INSTANCE_LOADS if needed. */
+
+static bool
+vect_supported_slp_permutation_p (slp_instance instance)
+{
+ slp_tree node = VEC_index (slp_tree, SLP_INSTANCE_LOADS (instance), 0);
+ gimple stmt = VEC_index (gimple, SLP_TREE_SCALAR_STMTS (node), 0);
+ gimple first_load = DR_GROUP_FIRST_DR (vinfo_for_stmt (stmt));
+ VEC (slp_tree, heap) *sorted_loads = NULL;
+ int index;
+ slp_tree *tmp_loads = NULL;
+ int group_size = SLP_INSTANCE_GROUP_SIZE (instance), i, j;
+ slp_tree load;
+
+ /* FORNOW: The only supported loads permutation is loads from the same
+ location in all the loads in the node, when the data-refs in
+ nodes of LOADS constitute an interleaving chain.
+ Sort the nodes according to the order of accesses in the chain. */
+ tmp_loads = (slp_tree *) xmalloc (sizeof (slp_tree) * group_size);
+ for (i = 0, j = 0;
+ VEC_iterate (int, SLP_INSTANCE_LOAD_PERMUTATION (instance), i, index)
+ && VEC_iterate (slp_tree, SLP_INSTANCE_LOADS (instance), j, load);
+ i += group_size, j++)
+ {
+ gimple scalar_stmt = VEC_index (gimple, SLP_TREE_SCALAR_STMTS (load), 0);
+ /* Check that the loads are all in the same interleaving chain. */
+ if (DR_GROUP_FIRST_DR (vinfo_for_stmt (scalar_stmt)) != first_load)
+ {
+ if (vect_print_dump_info (REPORT_DETAILS))
+ {
+ fprintf (vect_dump, "Build SLP failed: unsupported data "
+ "permutation ");
+ print_gimple_stmt (vect_dump, scalar_stmt, 0, TDF_SLIM);
+ }
+
+ free (tmp_loads);
+ return false;
+ }
+
+ tmp_loads[index] = load;
+ }
+
+ sorted_loads = VEC_alloc (slp_tree, heap, group_size);
+ for (i = 0; i < group_size; i++)
+ VEC_safe_push (slp_tree, heap, sorted_loads, tmp_loads[i]);
+
+ VEC_free (slp_tree, heap, SLP_INSTANCE_LOADS (instance));
+ SLP_INSTANCE_LOADS (instance) = sorted_loads;
+ free (tmp_loads);
+
+ if (!vect_transform_slp_perm_load (stmt, NULL, NULL,
+ SLP_INSTANCE_UNROLLING_FACTOR (instance),
+ instance, true))
+ return false;
+
+ return true;
+}
+
+
+/* Check if the required load permutation is supported.
+ LOAD_PERMUTATION contains a list of indices of the loads.
+ In SLP this permutation is relative to the order of strided stores that are
+ the base of the SLP instance. */
+
+static bool
+vect_supported_load_permutation_p (slp_instance slp_instn, int group_size,
+ VEC (int, heap) *load_permutation)
+{
+ int i = 0, j, prev = -1, next, k;
+ bool supported;
+
+ /* FORNOW: permutations are only supported for loop-aware SLP. */
+ if (!slp_instn)
+ return false;
+
+ if (vect_print_dump_info (REPORT_SLP))
+ {
+ fprintf (vect_dump, "Load permutation ");
+ for (i = 0; VEC_iterate (int, load_permutation, i, next); i++)
+ fprintf (vect_dump, "%d ", next);
+ }
+
+ /* FORNOW: the only supported permutation is 0..01..1.. of length equal to
+ GROUP_SIZE and where each sequence of same drs is of GROUP_SIZE length as
+ well. */
+ supported = true;
+ for (j = 0; j < group_size; j++)
+ {
+ for (i = j * group_size, k = 0;
+ VEC_iterate (int, load_permutation, i, next) && k < group_size;
+ i++, k++)
+ {
+ if (i != j * group_size && next != prev)
+ {
+ supported = false;
+ break;
+ }
+
+ prev = next;
+ }
+ }
+
+ if (supported && i == group_size * group_size
+ && vect_supported_slp_permutation_p (slp_instn))
+ return true;
+
+ return false;
+}
+
/* 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
-vect_analyze_slp_instance (loop_vec_info loop_vinfo, tree stmt)
+vect_analyze_slp_instance (loop_vec_info loop_vinfo, gimple stmt)
{
slp_instance new_instance;
slp_tree node = XNEW (struct _slp_tree);
unsigned int group_size = DR_GROUP_SIZE (vinfo_for_stmt (stmt));
unsigned int unrolling_factor = 1, nunits;
- tree vectype, scalar_type, next;
+ tree vectype, scalar_type;
+ gimple next;
unsigned int vectorization_factor = 0, ncopies;
bool slp_impossible = false;
int inside_cost = 0, outside_cost = 0, ncopies_for_cost;
-
- /* FORNOW: multiple types are not supported. */
- scalar_type = TREE_TYPE (DR_REF (STMT_VINFO_DATA_REF (vinfo_for_stmt (stmt))));
+ unsigned int max_nunits = 0;
+ VEC (int, heap) *load_permutation;
+ VEC (slp_tree, heap) *loads;
+
+ scalar_type = TREE_TYPE (DR_REF (STMT_VINFO_DATA_REF (
+ vinfo_for_stmt (stmt))));
vectype = get_vectype_for_scalar_type (scalar_type);
if (!vectype)
{
@@ -3024,21 +3260,14 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, tree 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 (tree, heap, group_size);
+ SLP_TREE_SCALAR_STMTS (node) = VEC_alloc (gimple, heap, group_size);
next = stmt;
/* Collect the stores and store them in SLP_TREE_SCALAR_STMTS. */
while (next)
{
- VEC_safe_push (tree, heap, SLP_TREE_SCALAR_STMTS (node), next);
+ VEC_safe_push (gimple, heap, SLP_TREE_SCALAR_STMTS (node), next);
next = DR_GROUP_NEXT_DR (vinfo_for_stmt (next));
}
@@ -3056,18 +3285,49 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, tree stmt)
factor (number of vectors is 1 if NUNITS >= GROUP_SIZE, and is
GROUP_SIZE / NUNITS otherwise. */
ncopies_for_cost = unrolling_factor * group_size / nunits;
+
+ load_permutation = VEC_alloc (int, heap, group_size * group_size);
+ loads = VEC_alloc (slp_tree, heap, group_size);
/* 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,
+ &load_permutation, &loads))
{
/* 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 in the
+ loop. */
+ 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;
+ SLP_INSTANCE_LOADS (new_instance) = loads;
+ SLP_INSTANCE_LOAD_PERMUTATION (new_instance) = load_permutation;
+ if (VEC_length (slp_tree, loads))
+ {
+ if (!vect_supported_load_permutation_p (new_instance, group_size,
+ load_permutation))
+ {
+ if (vect_print_dump_info (REPORT_SLP))
+ {
+ fprintf (vect_dump, "Build SLP failed: unsupported load "
+ "permutation ");
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
+ }
+
+ vect_free_slp_instance (new_instance);
+ return false;
+ }
+ }
+ else
+ VEC_free (int, heap, SLP_INSTANCE_LOAD_PERMUTATION (new_instance));
+
VEC_safe_push (slp_instance, heap, LOOP_VINFO_SLP_INSTANCES (loop_vinfo),
new_instance);
if (vect_print_dump_info (REPORT_SLP))
@@ -3079,7 +3339,9 @@ vect_analyze_slp_instance (loop_vec_info loop_vinfo, tree stmt)
/* Failed to SLP. */
/* Free the allocated memory. */
vect_free_slp_tree (node);
-
+ VEC_free (int, heap, load_permutation);
+ VEC_free (slp_tree, heap, loads);
+
if (slp_impossible)
return false;
@@ -3096,13 +3358,13 @@ static bool
vect_analyze_slp (loop_vec_info loop_vinfo)
{
unsigned int i;
- VEC (tree, heap) *strided_stores = LOOP_VINFO_STRIDED_STORES (loop_vinfo);
- tree store;
+ VEC (gimple, heap) *strided_stores = LOOP_VINFO_STRIDED_STORES (loop_vinfo);
+ gimple store;
if (vect_print_dump_info (REPORT_SLP))
fprintf (vect_dump, "=== vect_analyze_slp ===");
- for (i = 0; VEC_iterate (tree, strided_stores, i, store); i++)
+ for (i = 0; VEC_iterate (gimple, strided_stores, i, store); i++)
if (!vect_analyze_slp_instance (loop_vinfo, store))
{
/* SLP failed. No instance can be SLPed in the loop. */
@@ -3158,19 +3420,20 @@ static void
vect_detect_hybrid_slp_stmts (slp_tree node)
{
int i;
- tree stmt;
+ gimple stmt;
imm_use_iterator imm_iter;
- tree use_stmt;
+ gimple use_stmt;
if (!node)
return;
- for (i = 0; VEC_iterate (tree, SLP_TREE_SCALAR_STMTS (node), i, stmt); i++)
+ for (i = 0; VEC_iterate (gimple, SLP_TREE_SCALAR_STMTS (node), i, stmt); i++)
if (PURE_SLP_STMT (vinfo_for_stmt (stmt))
- && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) == SSA_NAME)
- FOR_EACH_IMM_USE_STMT (use_stmt, imm_iter, GIMPLE_STMT_OPERAND (stmt, 0))
+ && 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));
@@ -3231,7 +3494,7 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo)
for (i = 0; VEC_iterate (data_reference_p, datarefs, i, dr); i++)
{
- tree stmt;
+ gimple stmt;
stmt_vec_info stmt_info;
basic_block bb;
tree base, offset, init;
@@ -3253,7 +3516,7 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo)
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS))
{
fprintf (vect_dump, "not vectorized: data ref analysis failed ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
return false;
}
@@ -3281,7 +3544,7 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo)
init = unshare_expr (DR_INIT (dr));
/* Update DR field in stmt_vec_info struct. */
- bb = bb_for_stmt (stmt);
+ bb = gimple_bb (stmt);
/* If the dataref is in an inner-loop of the loop that is considered for
for vectorization, we also want to analyze the access relative to
@@ -3392,7 +3655,7 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo)
{
fprintf (vect_dump,
"not vectorized: more than one data ref in stmt: ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
return false;
}
@@ -3408,7 +3671,7 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo)
{
fprintf (vect_dump,
"not vectorized: no vectype for stmt: ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
fprintf (vect_dump, " scalar_type: ");
print_generic_expr (vect_dump, scalar_type, TDF_DETAILS);
}
@@ -3427,7 +3690,7 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo)
Mark STMT as "relevant for vectorization" and add it to WORKLIST. */
static void
-vect_mark_relevant (VEC(tree,heap) **worklist, tree stmt,
+vect_mark_relevant (VEC(gimple,heap) **worklist, gimple stmt,
enum vect_relevant relevant, bool live_p)
{
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
@@ -3439,7 +3702,7 @@ vect_mark_relevant (VEC(tree,heap) **worklist, tree stmt,
if (STMT_VINFO_IN_PATTERN_P (stmt_info))
{
- tree pattern_stmt;
+ gimple pattern_stmt;
/* This is the last stmt in a sequence that was detected as a
pattern that can potentially be vectorized. Don't mark the stmt
@@ -3469,7 +3732,7 @@ vect_mark_relevant (VEC(tree,heap) **worklist, tree stmt,
return;
}
- VEC_safe_push (tree, heap, *worklist, stmt);
+ VEC_safe_push (gimple, heap, *worklist, stmt);
}
@@ -3486,7 +3749,7 @@ vect_mark_relevant (VEC(tree,heap) **worklist, tree stmt,
CHECKME: what other side effects would the vectorizer allow? */
static bool
-vect_stmt_relevant_p (tree stmt, loop_vec_info loop_vinfo,
+vect_stmt_relevant_p (gimple stmt, loop_vec_info loop_vinfo,
enum vect_relevant *relevant, bool *live_p)
{
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
@@ -3504,7 +3767,7 @@ vect_stmt_relevant_p (tree stmt, loop_vec_info loop_vinfo,
*relevant = vect_used_in_loop;
/* changing memory. */
- if (TREE_CODE (stmt) != PHI_NODE)
+ if (gimple_code (stmt) != GIMPLE_PHI)
if (!ZERO_SSA_OPERANDS (stmt, SSA_OP_VIRTUAL_DEFS))
{
if (vect_print_dump_info (REPORT_DETAILS))
@@ -3517,7 +3780,7 @@ vect_stmt_relevant_p (tree stmt, loop_vec_info loop_vinfo,
{
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, DEF_FROM_PTR (def_p))
{
- basic_block bb = bb_for_stmt (USE_STMT (use_p));
+ basic_block bb = gimple_bb (USE_STMT (use_p));
if (!flow_bb_inside_loop_p (loop, bb))
{
if (vect_print_dump_info (REPORT_DETAILS))
@@ -3525,7 +3788,7 @@ vect_stmt_relevant_p (tree stmt, loop_vec_info loop_vinfo,
/* We expect all such uses to be in the loop exit phis
(because of loop closed form) */
- gcc_assert (TREE_CODE (USE_STMT (use_p)) == PHI_NODE);
+ gcc_assert (gimple_code (USE_STMT (use_p)) == GIMPLE_PHI);
gcc_assert (bb == single_exit (loop)->dest);
*live_p = true;
@@ -3563,14 +3826,15 @@ vect_stmt_relevant_p (tree stmt, loop_vec_info loop_vinfo,
Return true if everything is as expected. Return false otherwise. */
static bool
-process_use (tree stmt, tree use, loop_vec_info loop_vinfo, bool live_p,
- enum vect_relevant relevant, VEC(tree,heap) **worklist)
+process_use (gimple stmt, tree use, loop_vec_info loop_vinfo, bool live_p,
+ enum vect_relevant relevant, VEC(gimple,heap) **worklist)
{
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt);
stmt_vec_info dstmt_vinfo;
basic_block bb, def_bb;
- tree def, def_stmt;
+ tree def;
+ gimple def_stmt;
enum vect_def_type dt;
/* case 1: we are only interested in uses that need to be vectorized. Uses
@@ -3585,10 +3849,10 @@ process_use (tree stmt, tree use, loop_vec_info loop_vinfo, bool live_p,
return false;
}
- if (!def_stmt || IS_EMPTY_STMT (def_stmt))
+ if (!def_stmt || gimple_nop_p (def_stmt))
return true;
- def_bb = bb_for_stmt (def_stmt);
+ def_bb = gimple_bb (def_stmt);
if (!flow_bb_inside_loop_p (loop, def_bb))
{
if (vect_print_dump_info (REPORT_DETAILS))
@@ -3602,10 +3866,10 @@ process_use (tree stmt, tree use, loop_vec_info loop_vinfo, bool live_p,
as there should be no other uses for DEF_STMT in the loop. So we just
check that everything is as expected, and we are done. */
dstmt_vinfo = vinfo_for_stmt (def_stmt);
- bb = bb_for_stmt (stmt);
- if (TREE_CODE (stmt) == PHI_NODE
+ bb = gimple_bb (stmt);
+ if (gimple_code (stmt) == GIMPLE_PHI
&& STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_reduction_def
- && TREE_CODE (def_stmt) != PHI_NODE
+ && gimple_code (def_stmt) != GIMPLE_PHI
&& STMT_VINFO_DEF_TYPE (dstmt_vinfo) == vect_reduction_def
&& bb->loop_father == def_bb->loop_father)
{
@@ -3710,47 +3974,47 @@ process_use (tree stmt, tree use, loop_vec_info loop_vinfo, bool live_p,
static bool
vect_mark_stmts_to_be_vectorized (loop_vec_info loop_vinfo)
{
- VEC(tree,heap) *worklist;
+ VEC(gimple,heap) *worklist;
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo);
unsigned int nbbs = loop->num_nodes;
- block_stmt_iterator si;
- tree stmt;
- stmt_ann_t ann;
+ gimple_stmt_iterator si;
+ gimple stmt;
unsigned int i;
stmt_vec_info stmt_vinfo;
basic_block bb;
- tree phi;
+ gimple phi;
bool live_p;
enum vect_relevant relevant;
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "=== vect_mark_stmts_to_be_vectorized ===");
- worklist = VEC_alloc (tree, heap, 64);
+ worklist = VEC_alloc (gimple, heap, 64);
/* 1. Init worklist. */
for (i = 0; i < nbbs; i++)
{
bb = bbs[i];
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
{
+ phi = gsi_stmt (si);
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "init: phi relevant? ");
- print_generic_expr (vect_dump, phi, TDF_SLIM);
+ print_gimple_stmt (vect_dump, phi, 0, TDF_SLIM);
}
if (vect_stmt_relevant_p (phi, loop_vinfo, &relevant, &live_p))
vect_mark_relevant (&worklist, phi, relevant, live_p);
}
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
- stmt = bsi_stmt (si);
+ stmt = gsi_stmt (si);
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "init: stmt relevant? ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
if (vect_stmt_relevant_p (stmt, loop_vinfo, &relevant, &live_p))
@@ -3759,22 +4023,21 @@ vect_mark_stmts_to_be_vectorized (loop_vec_info loop_vinfo)
}
/* 2. Process_worklist */
- while (VEC_length (tree, worklist) > 0)
+ while (VEC_length (gimple, worklist) > 0)
{
use_operand_p use_p;
ssa_op_iter iter;
- stmt = VEC_pop (tree, worklist);
+ stmt = VEC_pop (gimple, worklist);
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "worklist: examine stmt: ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
/* Examine the USEs of STMT. For each USE, mark the stmt that defines it
(DEF_STMT) as relevant/irrelevant and live/dead according to the
liveness and relevance properties of STMT. */
- ann = stmt_ann (stmt);
stmt_vinfo = vinfo_for_stmt (stmt);
relevant = STMT_VINFO_RELEVANT (stmt_vinfo);
live_p = STMT_VINFO_LIVE_P (stmt_vinfo);
@@ -3812,25 +4075,25 @@ vect_mark_stmts_to_be_vectorized (loop_vec_info loop_vinfo)
switch (tmp_relevant)
{
case vect_unused_in_loop:
- gcc_assert (TREE_CODE (stmt) != PHI_NODE);
+ gcc_assert (gimple_code (stmt) != GIMPLE_PHI);
relevant = vect_used_by_reduction;
break;
case vect_used_in_outer_by_reduction:
case vect_used_in_outer:
- gcc_assert (TREE_CODE (stmt) != WIDEN_SUM_EXPR
- && TREE_CODE (stmt) != DOT_PROD_EXPR);
+ gcc_assert (gimple_code (stmt) != WIDEN_SUM_EXPR
+ && gimple_code (stmt) != DOT_PROD_EXPR);
break;
case vect_used_by_reduction:
- if (TREE_CODE (stmt) == PHI_NODE)
+ if (gimple_code (stmt) == GIMPLE_PHI)
break;
/* fall through */
case vect_used_in_loop:
default:
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "unsupported use of reduction.");
- VEC_free (tree, heap, worklist);
+ VEC_free (gimple, heap, worklist);
return false;
}
live_p = false;
@@ -3841,13 +4104,13 @@ vect_mark_stmts_to_be_vectorized (loop_vec_info loop_vinfo)
tree op = USE_FROM_PTR (use_p);
if (!process_use (stmt, op, loop_vinfo, live_p, relevant, &worklist))
{
- VEC_free (tree, heap, worklist);
+ VEC_free (gimple, heap, worklist);
return false;
}
}
} /* while worklist */
- VEC_free (tree, heap, worklist);
+ VEC_free (gimple, heap, worklist);
return true;
}
@@ -3866,22 +4129,24 @@ vect_can_advance_ivs_p (loop_vec_info loop_vinfo)
{
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
basic_block bb = loop->header;
- tree phi;
+ gimple phi;
+ gimple_stmt_iterator gsi;
/* Analyze phi functions of the loop header. */
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "vect_can_advance_ivs_p:");
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
tree access_fn = NULL;
tree evolution_part;
+ phi = gsi_stmt (gsi);
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "Analyze phi: ");
- print_generic_expr (vect_dump, phi, TDF_SLIM);
+ print_gimple_stmt (vect_dump, phi, 0, TDF_SLIM);
}
/* Skip virtual phi's. The data dependences that are associated with
@@ -3948,7 +4213,7 @@ vect_can_advance_ivs_p (loop_vec_info loop_vinfo)
can be constructed, place it in NUMBER_OF_ITERATIONS.
Return the loop exit condition. */
-static tree
+static gimple
vect_get_loop_niters (struct loop *loop, tree *number_of_iterations)
{
tree niters;
@@ -4016,7 +4281,7 @@ loop_vec_info
vect_analyze_loop_form (struct loop *loop)
{
loop_vec_info loop_vinfo;
- tree loop_cond;
+ gimple loop_cond;
tree number_of_iterations = NULL;
loop_vec_info inner_loop_vinfo = NULL;
diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c
index 8313e54bdbc..9919389dfc3 100644
--- a/gcc/tree-vect-generic.c
+++ b/gcc/tree-vect-generic.c
@@ -30,7 +30,7 @@ along with GCC; see the file COPYING3. If not see
#include "machmode.h"
#include "langhooks.h"
#include "tree-flow.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-iterator.h"
#include "tree-pass.h"
#include "flags.h"
@@ -96,35 +96,35 @@ build_word_mode_vector_type (int nunits)
return vector_last_type;
}
-typedef tree (*elem_op_func) (block_stmt_iterator *,
+typedef tree (*elem_op_func) (gimple_stmt_iterator *,
tree, tree, tree, tree, tree, enum tree_code);
static inline tree
-tree_vec_extract (block_stmt_iterator *bsi, tree type,
+tree_vec_extract (gimple_stmt_iterator *gsi, tree type,
tree t, tree bitsize, tree bitpos)
{
if (bitpos)
- return gimplify_build3 (bsi, BIT_FIELD_REF, type, t, bitsize, bitpos);
+ return gimplify_build3 (gsi, BIT_FIELD_REF, type, t, bitsize, bitpos);
else
- return gimplify_build1 (bsi, VIEW_CONVERT_EXPR, type, t);
+ return gimplify_build1 (gsi, VIEW_CONVERT_EXPR, type, t);
}
static tree
-do_unop (block_stmt_iterator *bsi, tree inner_type, tree a,
+do_unop (gimple_stmt_iterator *gsi, tree inner_type, tree a,
tree b ATTRIBUTE_UNUSED, tree bitpos, tree bitsize,
enum tree_code code)
{
- a = tree_vec_extract (bsi, inner_type, a, bitsize, bitpos);
- return gimplify_build1 (bsi, code, inner_type, a);
+ a = tree_vec_extract (gsi, inner_type, a, bitsize, bitpos);
+ return gimplify_build1 (gsi, code, inner_type, a);
}
static tree
-do_binop (block_stmt_iterator *bsi, tree inner_type, tree a, tree b,
+do_binop (gimple_stmt_iterator *gsi, tree inner_type, tree a, tree b,
tree bitpos, tree bitsize, enum tree_code code)
{
- a = tree_vec_extract (bsi, inner_type, a, bitsize, bitpos);
- b = tree_vec_extract (bsi, inner_type, b, bitsize, bitpos);
- return gimplify_build2 (bsi, code, inner_type, a, b);
+ a = tree_vec_extract (gsi, inner_type, a, bitsize, bitpos);
+ b = tree_vec_extract (gsi, inner_type, b, bitsize, bitpos);
+ return gimplify_build2 (gsi, code, inner_type, a, b);
}
/* Expand vector addition to scalars. This does bit twiddling
@@ -141,7 +141,7 @@ do_binop (block_stmt_iterator *bsi, tree inner_type, tree a, tree b,
This optimization should be done only if 4 vector items or more
fit into a word. */
static tree
-do_plus_minus (block_stmt_iterator *bsi, tree word_type, tree a, tree b,
+do_plus_minus (gimple_stmt_iterator *gsi, tree word_type, tree a, tree b,
tree bitpos ATTRIBUTE_UNUSED, tree bitsize ATTRIBUTE_UNUSED,
enum tree_code code)
{
@@ -153,26 +153,26 @@ do_plus_minus (block_stmt_iterator *bsi, tree word_type, tree a, tree b,
low_bits = build_replicated_const (word_type, inner_type, max >> 1);
high_bits = build_replicated_const (word_type, inner_type, max & ~(max >> 1));
- a = tree_vec_extract (bsi, word_type, a, bitsize, bitpos);
- b = tree_vec_extract (bsi, word_type, b, bitsize, bitpos);
+ a = tree_vec_extract (gsi, word_type, a, bitsize, bitpos);
+ b = tree_vec_extract (gsi, word_type, b, bitsize, bitpos);
- signs = gimplify_build2 (bsi, BIT_XOR_EXPR, word_type, a, b);
- b_low = gimplify_build2 (bsi, BIT_AND_EXPR, word_type, b, low_bits);
+ signs = gimplify_build2 (gsi, BIT_XOR_EXPR, word_type, a, b);
+ b_low = gimplify_build2 (gsi, BIT_AND_EXPR, word_type, b, low_bits);
if (code == PLUS_EXPR)
- a_low = gimplify_build2 (bsi, BIT_AND_EXPR, word_type, a, low_bits);
+ a_low = gimplify_build2 (gsi, BIT_AND_EXPR, word_type, a, low_bits);
else
{
- a_low = gimplify_build2 (bsi, BIT_IOR_EXPR, word_type, a, high_bits);
- signs = gimplify_build1 (bsi, BIT_NOT_EXPR, word_type, signs);
+ a_low = gimplify_build2 (gsi, BIT_IOR_EXPR, word_type, a, high_bits);
+ signs = gimplify_build1 (gsi, BIT_NOT_EXPR, word_type, signs);
}
- signs = gimplify_build2 (bsi, BIT_AND_EXPR, word_type, signs, high_bits);
- result_low = gimplify_build2 (bsi, code, word_type, a_low, b_low);
- return gimplify_build2 (bsi, BIT_XOR_EXPR, word_type, result_low, signs);
+ signs = gimplify_build2 (gsi, BIT_AND_EXPR, word_type, signs, high_bits);
+ result_low = gimplify_build2 (gsi, code, word_type, a_low, b_low);
+ return gimplify_build2 (gsi, BIT_XOR_EXPR, word_type, result_low, signs);
}
static tree
-do_negate (block_stmt_iterator *bsi, tree word_type, tree b,
+do_negate (gimple_stmt_iterator *gsi, tree word_type, tree b,
tree unused ATTRIBUTE_UNUSED, tree bitpos ATTRIBUTE_UNUSED,
tree bitsize ATTRIBUTE_UNUSED,
enum tree_code code ATTRIBUTE_UNUSED)
@@ -185,19 +185,19 @@ do_negate (block_stmt_iterator *bsi, tree word_type, tree b,
low_bits = build_replicated_const (word_type, inner_type, max >> 1);
high_bits = build_replicated_const (word_type, inner_type, max & ~(max >> 1));
- b = tree_vec_extract (bsi, word_type, b, bitsize, bitpos);
+ b = tree_vec_extract (gsi, word_type, b, bitsize, bitpos);
- b_low = gimplify_build2 (bsi, BIT_AND_EXPR, word_type, b, low_bits);
- signs = gimplify_build1 (bsi, BIT_NOT_EXPR, word_type, b);
- signs = gimplify_build2 (bsi, BIT_AND_EXPR, word_type, signs, high_bits);
- result_low = gimplify_build2 (bsi, MINUS_EXPR, word_type, high_bits, b_low);
- return gimplify_build2 (bsi, BIT_XOR_EXPR, word_type, result_low, signs);
+ b_low = gimplify_build2 (gsi, BIT_AND_EXPR, word_type, b, low_bits);
+ signs = gimplify_build1 (gsi, BIT_NOT_EXPR, word_type, b);
+ signs = gimplify_build2 (gsi, BIT_AND_EXPR, word_type, signs, high_bits);
+ result_low = gimplify_build2 (gsi, MINUS_EXPR, word_type, high_bits, b_low);
+ return gimplify_build2 (gsi, BIT_XOR_EXPR, word_type, result_low, signs);
}
/* Expand a vector operation to scalars, by using many operations
whose type is the vector type's inner type. */
static tree
-expand_vector_piecewise (block_stmt_iterator *bsi, elem_op_func f,
+expand_vector_piecewise (gimple_stmt_iterator *gsi, elem_op_func f,
tree type, tree inner_type,
tree a, tree b, enum tree_code code)
{
@@ -213,7 +213,7 @@ expand_vector_piecewise (block_stmt_iterator *bsi, elem_op_func f,
for (i = 0; i < nunits;
i += delta, index = int_const_binop (PLUS_EXPR, index, part_width, 0))
{
- tree result = f (bsi, inner_type, a, b, index, part_width, code);
+ tree result = f (gsi, inner_type, a, b, index, part_width, code);
constructor_elt *ce = VEC_quick_push (constructor_elt, v, NULL);
ce->index = NULL_TREE;
ce->value = result;
@@ -226,7 +226,7 @@ expand_vector_piecewise (block_stmt_iterator *bsi, elem_op_func f,
a scalar integer type, or to use a different size for the items
in the vector type. */
static tree
-expand_vector_parallel (block_stmt_iterator *bsi, elem_op_func f, tree type,
+expand_vector_parallel (gimple_stmt_iterator *gsi, elem_op_func f, tree type,
tree a, tree b,
enum tree_code code)
{
@@ -239,23 +239,24 @@ expand_vector_parallel (block_stmt_iterator *bsi, elem_op_func f, tree type,
one word, do it a word at a time; finally, if the vector is smaller
than one word, do it as a scalar. */
if (TYPE_MODE (TREE_TYPE (type)) == word_mode)
- return expand_vector_piecewise (bsi, f,
+ return expand_vector_piecewise (gsi, f,
type, TREE_TYPE (type),
a, b, code);
else if (n_words > 1)
{
tree word_type = build_word_mode_vector_type (n_words);
- result = expand_vector_piecewise (bsi, f,
+ result = expand_vector_piecewise (gsi, f,
word_type, TREE_TYPE (word_type),
a, b, code);
- result = gimplify_val (bsi, word_type, result);
+ result = force_gimple_operand_gsi (gsi, result, true, NULL, true,
+ GSI_SAME_STMT);
}
else
{
/* Use a single scalar operation with a mode no wider than word_mode. */
mode = mode_for_size (tree_low_cst (TYPE_SIZE (type), 1), MODE_INT, 0);
compute_type = lang_hooks.types.type_for_mode (mode, 1);
- result = f (bsi, compute_type, a, b, NULL_TREE, NULL_TREE, code);
+ result = f (gsi, compute_type, a, b, NULL_TREE, NULL_TREE, code);
}
return result;
@@ -267,7 +268,7 @@ expand_vector_parallel (block_stmt_iterator *bsi, elem_op_func f, tree type,
they can process at least four items, that is, only if the vector
holds at least four items and if a word can hold four items. */
static tree
-expand_vector_addition (block_stmt_iterator *bsi,
+expand_vector_addition (gimple_stmt_iterator *gsi,
elem_op_func f, elem_op_func f_parallel,
tree type, tree a, tree b, enum tree_code code)
{
@@ -277,17 +278,17 @@ expand_vector_addition (block_stmt_iterator *bsi,
if (INTEGRAL_TYPE_P (TREE_TYPE (type))
&& parts_per_word >= 4
&& TYPE_VECTOR_SUBPARTS (type) >= 4)
- return expand_vector_parallel (bsi, f_parallel,
+ return expand_vector_parallel (gsi, f_parallel,
type, a, b, code);
else
- return expand_vector_piecewise (bsi, f,
+ return expand_vector_piecewise (gsi, f,
type, TREE_TYPE (type),
a, b, code);
}
static tree
-expand_vector_operation (block_stmt_iterator *bsi, tree type, tree compute_type,
- tree rhs, enum tree_code code)
+expand_vector_operation (gimple_stmt_iterator *gsi, tree type, tree compute_type,
+ gimple assign, enum tree_code code)
{
enum machine_mode compute_mode = TYPE_MODE (compute_type);
@@ -305,28 +306,28 @@ expand_vector_operation (block_stmt_iterator *bsi, tree type, tree compute_type,
case PLUS_EXPR:
case MINUS_EXPR:
if (!TYPE_OVERFLOW_TRAPS (type))
- return expand_vector_addition (bsi, do_binop, do_plus_minus, type,
- TREE_OPERAND (rhs, 0),
- TREE_OPERAND (rhs, 1), code);
+ return expand_vector_addition (gsi, do_binop, do_plus_minus, type,
+ gimple_assign_rhs1 (assign),
+ gimple_assign_rhs2 (assign), code);
break;
case NEGATE_EXPR:
if (!TYPE_OVERFLOW_TRAPS (type))
- return expand_vector_addition (bsi, do_unop, do_negate, type,
- TREE_OPERAND (rhs, 0),
+ return expand_vector_addition (gsi, do_unop, do_negate, type,
+ gimple_assign_rhs1 (assign),
NULL_TREE, code);
break;
case BIT_AND_EXPR:
case BIT_IOR_EXPR:
case BIT_XOR_EXPR:
- return expand_vector_parallel (bsi, do_binop, type,
- TREE_OPERAND (rhs, 0),
- TREE_OPERAND (rhs, 1), code);
+ return expand_vector_parallel (gsi, do_binop, type,
+ gimple_assign_rhs1 (assign),
+ gimple_assign_rhs2 (assign), code);
case BIT_NOT_EXPR:
- return expand_vector_parallel (bsi, do_unop, type,
- TREE_OPERAND (rhs, 0),
+ return expand_vector_parallel (gsi, do_unop, type,
+ gimple_assign_rhs1 (assign),
NULL_TREE, code);
default:
@@ -334,13 +335,13 @@ expand_vector_operation (block_stmt_iterator *bsi, tree type, tree compute_type,
}
if (TREE_CODE_CLASS (code) == tcc_unary)
- return expand_vector_piecewise (bsi, do_unop, type, compute_type,
- TREE_OPERAND (rhs, 0),
+ return expand_vector_piecewise (gsi, do_unop, type, compute_type,
+ gimple_assign_rhs1 (assign),
NULL_TREE, code);
else
- return expand_vector_piecewise (bsi, do_binop, type, compute_type,
- TREE_OPERAND (rhs, 0),
- TREE_OPERAND (rhs, 1), code);
+ return expand_vector_piecewise (gsi, do_binop, type, compute_type,
+ gimple_assign_rhs1 (assign),
+ gimple_assign_rhs2 (assign), code);
}
/* Return a type for the widest vector mode whose components are of mode
@@ -387,43 +388,34 @@ type_for_widest_vector_mode (enum machine_mode inner_mode, optab op, int satp)
/* Process one statement. If we identify a vector operation, expand it. */
static void
-expand_vector_operations_1 (block_stmt_iterator *bsi)
+expand_vector_operations_1 (gimple_stmt_iterator *gsi)
{
- tree stmt = bsi_stmt (*bsi);
- tree *p_lhs, *p_rhs, lhs, rhs, type, compute_type;
+ gimple stmt = gsi_stmt (*gsi);
+ tree lhs, rhs1, rhs2 = NULL, type, compute_type;
enum tree_code code;
enum machine_mode compute_mode;
optab op;
+ enum gimple_rhs_class rhs_class;
+ tree new_rhs;
- switch (TREE_CODE (stmt))
- {
- case RETURN_EXPR:
- stmt = TREE_OPERAND (stmt, 0);
- if (!stmt || TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
- return;
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
+ return;
- /* FALLTHRU */
+ code = gimple_assign_rhs_code (stmt);
+ rhs_class = get_gimple_rhs_class (code);
- case GIMPLE_MODIFY_STMT:
- p_lhs = &GIMPLE_STMT_OPERAND (stmt, 0);
- p_rhs = &GIMPLE_STMT_OPERAND (stmt, 1);
- lhs = *p_lhs;
- rhs = *p_rhs;
- break;
+ if (rhs_class != GIMPLE_UNARY_RHS && rhs_class != GIMPLE_BINARY_RHS)
+ return;
- default:
- return;
- }
+ lhs = gimple_assign_lhs (stmt);
+ rhs1 = gimple_assign_rhs1 (stmt);
+ type = gimple_expr_type (stmt);
+ if (rhs_class == GIMPLE_BINARY_RHS)
+ rhs2 = gimple_assign_rhs2 (stmt);
- type = TREE_TYPE (rhs);
if (TREE_CODE (type) != VECTOR_TYPE)
return;
- code = TREE_CODE (rhs);
- if (TREE_CODE_CLASS (code) != tcc_unary
- && TREE_CODE_CLASS (code) != tcc_binary)
- return;
-
if (code == NOP_EXPR
|| code == FLOAT_EXPR
|| code == FIX_TRUNC_EXPR
@@ -435,17 +427,18 @@ expand_vector_operations_1 (block_stmt_iterator *bsi)
/* The signedness is determined from input argument. */
if (code == VEC_UNPACK_FLOAT_HI_EXPR
|| code == VEC_UNPACK_FLOAT_LO_EXPR)
- type = TREE_TYPE (TREE_OPERAND (rhs, 0));
+ type = TREE_TYPE (rhs1);
/* Choose between vector shift/rotate by vector and vector shift/rotate by
scalar */
- if (code == LSHIFT_EXPR || code == RSHIFT_EXPR || code == LROTATE_EXPR
+ if (code == LSHIFT_EXPR
+ || code == RSHIFT_EXPR
+ || code == LROTATE_EXPR
|| code == RROTATE_EXPR)
{
/* If the 2nd argument is vector, we need a vector/vector shift */
- if (VECTOR_MODE_P (TYPE_MODE (TREE_TYPE (TREE_OPERAND (rhs, 1)))))
+ if (VECTOR_MODE_P (TYPE_MODE (TREE_TYPE (rhs2))))
op = optab_for_tree_code (code, type, optab_vector);
-
else
{
/* Try for a vector/scalar shift, and if we don't have one, see if we
@@ -471,7 +464,7 @@ expand_vector_operations_1 (block_stmt_iterator *bsi)
|| code == VEC_PACK_TRUNC_EXPR
|| code == VEC_PACK_SAT_EXPR
|| code == VEC_PACK_FIX_TRUNC_EXPR)
- type = TREE_TYPE (TREE_OPERAND (rhs, 0));
+ type = TREE_TYPE (rhs1);
/* Optabs will try converting a negation into a subtraction, so
look for it as well. TODO: negation of floating-point vectors
@@ -513,13 +506,17 @@ expand_vector_operations_1 (block_stmt_iterator *bsi)
}
gcc_assert (code != VEC_LSHIFT_EXPR && code != VEC_RSHIFT_EXPR);
- rhs = expand_vector_operation (bsi, type, compute_type, rhs, code);
- if (useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (rhs)))
- *p_rhs = rhs;
- else
- *p_rhs = gimplify_build1 (bsi, VIEW_CONVERT_EXPR, TREE_TYPE (lhs), rhs);
+ new_rhs = expand_vector_operation (gsi, type, compute_type, stmt, code);
+ if (!useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (new_rhs)))
+ new_rhs = gimplify_build1 (gsi, VIEW_CONVERT_EXPR, TREE_TYPE (lhs),
+ new_rhs);
+
+ /* NOTE: We should avoid using gimple_assign_set_rhs_from_tree. One
+ way to do it is change expand_vector_operation and its callees to
+ return a tree_code, RHS1 and RHS2 instead of a tree. */
+ gimple_assign_set_rhs_from_tree (gsi, new_rhs);
- mark_stmt_modified (bsi_stmt (*bsi));
+ gimple_set_modified (gsi_stmt (*gsi), true);
}
/* Use this to lower vector operations introduced by the vectorizer,
@@ -534,15 +531,15 @@ gate_expand_vector_operations (void)
static unsigned int
expand_vector_operations (void)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
basic_block bb;
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))
{
- expand_vector_operations_1 (&bsi);
- update_stmt_if_modified (bsi_stmt (bsi));
+ expand_vector_operations_1 (&gsi);
+ update_stmt_if_modified (gsi_stmt (gsi));
}
}
return 0;
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c
index b9a302d8430..8486775ab77 100644
--- a/gcc/tree-vect-patterns.c
+++ b/gcc/tree-vect-patterns.c
@@ -1,5 +1,5 @@
/* Analysis Utilities for Loop Vectorization.
- Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
Contributed by Dorit Nuzman <dorit@il.ibm.com>
This file is part of GCC.
@@ -42,14 +42,14 @@ along with GCC; see the file COPYING3. If not see
/* Function prototypes */
static void vect_pattern_recog_1
- (tree (* ) (tree, tree *, tree *), block_stmt_iterator);
-static bool widened_name_p (tree, tree, tree *, tree *);
+ (gimple (* ) (gimple, tree *, tree *), gimple_stmt_iterator);
+static bool widened_name_p (tree, gimple, tree *, gimple *);
/* Pattern recognition functions */
-static tree vect_recog_widen_sum_pattern (tree, tree *, tree *);
-static tree vect_recog_widen_mult_pattern (tree, tree *, tree *);
-static tree vect_recog_dot_prod_pattern (tree, tree *, tree *);
-static tree vect_recog_pow_pattern (tree, tree *, tree *);
+static gimple vect_recog_widen_sum_pattern (gimple, tree *, tree *);
+static gimple vect_recog_widen_mult_pattern (gimple, tree *, tree *);
+static gimple vect_recog_dot_prod_pattern (gimple, tree *, tree *);
+static gimple vect_recog_pow_pattern (gimple, tree *, tree *);
static vect_recog_func_ptr vect_vect_recog_func_ptrs[NUM_PATTERNS] = {
vect_recog_widen_mult_pattern,
vect_recog_widen_sum_pattern,
@@ -66,12 +66,12 @@ static vect_recog_func_ptr vect_vect_recog_func_ptrs[NUM_PATTERNS] = {
*/
static bool
-widened_name_p (tree name, tree use_stmt, tree *half_type, tree *def_stmt)
+widened_name_p (tree name, gimple use_stmt, tree *half_type, gimple *def_stmt)
{
tree dummy;
+ gimple dummy_gimple;
loop_vec_info loop_vinfo;
stmt_vec_info stmt_vinfo;
- tree expr;
tree type = TREE_TYPE (name);
tree oprnd0;
enum vect_def_type dt;
@@ -90,14 +90,13 @@ widened_name_p (tree name, tree use_stmt, tree *half_type, tree *def_stmt)
if (! *def_stmt)
return false;
- if (TREE_CODE (*def_stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_assign (*def_stmt))
return false;
- expr = GIMPLE_STMT_OPERAND (*def_stmt, 1);
- if (TREE_CODE (expr) != NOP_EXPR)
+ if (gimple_assign_rhs_code (*def_stmt) != NOP_EXPR)
return false;
- oprnd0 = TREE_OPERAND (expr, 0);
+ oprnd0 = gimple_assign_rhs1 (*def_stmt);
*half_type = TREE_TYPE (oprnd0);
if (!INTEGRAL_TYPE_P (type) || !INTEGRAL_TYPE_P (*half_type)
@@ -105,12 +104,24 @@ widened_name_p (tree name, tree use_stmt, tree *half_type, tree *def_stmt)
|| (TYPE_PRECISION (type) < (TYPE_PRECISION (*half_type) * 2)))
return false;
- if (!vect_is_simple_use (oprnd0, loop_vinfo, &dummy, &dummy, &dt))
+ if (!vect_is_simple_use (oprnd0, loop_vinfo, &dummy_gimple, &dummy, &dt))
return false;
return true;
}
+/* Helper to return a new temporary for pattern of TYPE for STMT. If STMT
+ is NULL, the caller must set SSA_NAME_DEF_STMT for the returned SSA var. */
+
+static tree
+vect_recog_temp_ssa_var (tree type, gimple stmt)
+{
+ tree var = create_tmp_var (type, "patt");
+
+ add_referenced_var (var);
+ var = make_ssa_name (var, stmt);
+ return var;
+}
/* Function vect_recog_dot_prod_pattern
@@ -157,24 +168,24 @@ widened_name_p (tree name, tree use_stmt, tree *half_type, tree *def_stmt)
the correct order (as is the case when this computation is in an
inner-loop nested in an outer-loop that us being vectorized). */
-static tree
-vect_recog_dot_prod_pattern (tree last_stmt, tree *type_in, tree *type_out)
+static gimple
+vect_recog_dot_prod_pattern (gimple last_stmt, tree *type_in, tree *type_out)
{
- tree stmt, expr;
+ gimple stmt;
tree oprnd0, oprnd1;
tree oprnd00, oprnd01;
stmt_vec_info stmt_vinfo = vinfo_for_stmt (last_stmt);
tree type, half_type;
- tree pattern_expr;
+ gimple pattern_stmt;
tree prod_type;
loop_vec_info loop_info = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
struct loop *loop = LOOP_VINFO_LOOP (loop_info);
+ tree var, rhs;
- if (TREE_CODE (last_stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_assign (last_stmt))
return NULL;
- expr = GIMPLE_STMT_OPERAND (last_stmt, 1);
- type = TREE_TYPE (expr);
+ type = gimple_expr_type (last_stmt);
/* Look for the following pattern
DX = (TYPE1) X;
@@ -200,7 +211,7 @@ vect_recog_dot_prod_pattern (tree last_stmt, tree *type_in, tree *type_out)
/* Starting from LAST_STMT, follow the defs of its uses in search
of the above pattern. */
- if (TREE_CODE (expr) != PLUS_EXPR)
+ if (gimple_assign_rhs_code (last_stmt) != PLUS_EXPR)
return NULL;
if (STMT_VINFO_IN_PATTERN_P (stmt_vinfo))
@@ -208,22 +219,21 @@ vect_recog_dot_prod_pattern (tree last_stmt, tree *type_in, tree *type_out)
/* Has been detected as widening-summation? */
stmt = STMT_VINFO_RELATED_STMT (stmt_vinfo);
- expr = GIMPLE_STMT_OPERAND (stmt, 1);
- type = TREE_TYPE (expr);
- if (TREE_CODE (expr) != WIDEN_SUM_EXPR)
+ type = gimple_expr_type (stmt);
+ if (gimple_assign_rhs_code (stmt) != WIDEN_SUM_EXPR)
return NULL;
- oprnd0 = TREE_OPERAND (expr, 0);
- oprnd1 = TREE_OPERAND (expr, 1);
+ oprnd0 = gimple_assign_rhs1 (stmt);
+ oprnd1 = gimple_assign_rhs2 (stmt);
half_type = TREE_TYPE (oprnd0);
}
else
{
- tree def_stmt;
+ gimple def_stmt;
if (STMT_VINFO_DEF_TYPE (stmt_vinfo) != vect_reduction_def)
return NULL;
- oprnd0 = TREE_OPERAND (expr, 0);
- oprnd1 = TREE_OPERAND (expr, 1);
+ oprnd0 = gimple_assign_rhs1 (last_stmt);
+ oprnd1 = gimple_assign_rhs2 (last_stmt);
if (TYPE_MAIN_VARIANT (TREE_TYPE (oprnd0)) != TYPE_MAIN_VARIANT (type)
|| TYPE_MAIN_VARIANT (TREE_TYPE (oprnd1)) != TYPE_MAIN_VARIANT (type))
return NULL;
@@ -232,8 +242,7 @@ vect_recog_dot_prod_pattern (tree last_stmt, tree *type_in, tree *type_out)
if (widened_name_p (oprnd0, stmt, &half_type, &def_stmt))
{
stmt = def_stmt;
- expr = GIMPLE_STMT_OPERAND (stmt, 1);
- oprnd0 = TREE_OPERAND (expr, 0);
+ oprnd0 = gimple_assign_rhs1 (stmt);
}
else
half_type = type;
@@ -248,37 +257,35 @@ vect_recog_dot_prod_pattern (tree last_stmt, tree *type_in, tree *type_out)
stmt = SSA_NAME_DEF_STMT (oprnd0);
/* FORNOW. Can continue analyzing the def-use chain when this stmt in a phi
inside the loop (in case we are analyzing an outer-loop). */
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_assign (stmt))
return NULL;
stmt_vinfo = vinfo_for_stmt (stmt);
gcc_assert (stmt_vinfo);
if (STMT_VINFO_DEF_TYPE (stmt_vinfo) != vect_loop_def)
return NULL;
- expr = GIMPLE_STMT_OPERAND (stmt, 1);
- if (TREE_CODE (expr) != MULT_EXPR)
+ if (gimple_assign_rhs_code (stmt) != MULT_EXPR)
return NULL;
if (STMT_VINFO_IN_PATTERN_P (stmt_vinfo))
{
/* Has been detected as a widening multiplication? */
stmt = STMT_VINFO_RELATED_STMT (stmt_vinfo);
- expr = GIMPLE_STMT_OPERAND (stmt, 1);
- if (TREE_CODE (expr) != WIDEN_MULT_EXPR)
+ if (gimple_assign_rhs_code (stmt) != WIDEN_MULT_EXPR)
return NULL;
stmt_vinfo = vinfo_for_stmt (stmt);
gcc_assert (stmt_vinfo);
gcc_assert (STMT_VINFO_DEF_TYPE (stmt_vinfo) == vect_loop_def);
- oprnd00 = TREE_OPERAND (expr, 0);
- oprnd01 = TREE_OPERAND (expr, 1);
+ oprnd00 = gimple_assign_rhs1 (stmt);
+ oprnd01 = gimple_assign_rhs2 (stmt);
}
else
{
tree half_type0, half_type1;
- tree def_stmt;
+ gimple def_stmt;
tree oprnd0, oprnd1;
- oprnd0 = TREE_OPERAND (expr, 0);
- oprnd1 = TREE_OPERAND (expr, 1);
+ oprnd0 = gimple_assign_rhs1 (stmt);
+ oprnd1 = gimple_assign_rhs2 (stmt);
if (TYPE_MAIN_VARIANT (TREE_TYPE (oprnd0))
!= TYPE_MAIN_VARIANT (prod_type)
|| TYPE_MAIN_VARIANT (TREE_TYPE (oprnd1))
@@ -286,10 +293,10 @@ vect_recog_dot_prod_pattern (tree last_stmt, tree *type_in, tree *type_out)
return NULL;
if (!widened_name_p (oprnd0, stmt, &half_type0, &def_stmt))
return NULL;
- oprnd00 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 0);
+ oprnd00 = gimple_assign_rhs1 (def_stmt);
if (!widened_name_p (oprnd1, stmt, &half_type1, &def_stmt))
return NULL;
- oprnd01 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 0);
+ oprnd01 = gimple_assign_rhs1 (def_stmt);
if (TYPE_MAIN_VARIANT (half_type0) != TYPE_MAIN_VARIANT (half_type1))
return NULL;
if (TYPE_PRECISION (prod_type) != TYPE_PRECISION (half_type0) * 2)
@@ -301,11 +308,14 @@ vect_recog_dot_prod_pattern (tree last_stmt, tree *type_in, tree *type_out)
*type_out = type;
/* Pattern detected. Create a stmt to be used to replace the pattern: */
- pattern_expr = build3 (DOT_PROD_EXPR, type, oprnd00, oprnd01, oprnd1);
+ var = vect_recog_temp_ssa_var (type, NULL);
+ rhs = build3 (DOT_PROD_EXPR, type, oprnd00, oprnd01, oprnd1),
+ pattern_stmt = gimple_build_assign (var, rhs);
+
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "vect_recog_dot_prod_pattern: detected: ");
- print_generic_expr (vect_dump, pattern_expr, TDF_SLIM);
+ print_gimple_stmt (vect_dump, pattern_stmt, 0, TDF_SLIM);
}
/* We don't allow changing the order of the computation in the inner-loop
@@ -317,10 +327,9 @@ vect_recog_dot_prod_pattern (tree last_stmt, tree *type_in, tree *type_out)
return NULL;
}
- return pattern_expr;
+ return pattern_stmt;
}
-
-
+
/* Function vect_recog_widen_mult_pattern
Try to find the following pattern:
@@ -352,34 +361,35 @@ vect_recog_dot_prod_pattern (tree last_stmt, tree *type_in, tree *type_out)
WIDEN_MULT <a_t, b_t>
*/
-static tree
-vect_recog_widen_mult_pattern (tree last_stmt,
+static gimple
+vect_recog_widen_mult_pattern (gimple last_stmt,
tree *type_in,
tree *type_out)
{
- tree expr;
- tree def_stmt0, def_stmt1;
+ gimple def_stmt0, def_stmt1;
tree oprnd0, oprnd1;
tree type, half_type0, half_type1;
- tree pattern_expr;
+ gimple pattern_stmt;
tree vectype;
tree dummy;
+ tree var;
enum tree_code dummy_code;
+ int dummy_int;
+ VEC (tree, heap) *dummy_vec;
- if (TREE_CODE (last_stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_assign (last_stmt))
return NULL;
- expr = GIMPLE_STMT_OPERAND (last_stmt, 1);
- type = TREE_TYPE (expr);
+ type = gimple_expr_type (last_stmt);
/* Starting from LAST_STMT, follow the defs of its uses in search
of the above pattern. */
- if (TREE_CODE (expr) != MULT_EXPR)
+ if (gimple_assign_rhs_code (last_stmt) != MULT_EXPR)
return NULL;
- oprnd0 = TREE_OPERAND (expr, 0);
- oprnd1 = TREE_OPERAND (expr, 1);
+ oprnd0 = gimple_assign_rhs1 (last_stmt);
+ oprnd1 = gimple_assign_rhs2 (last_stmt);
if (TYPE_MAIN_VARIANT (TREE_TYPE (oprnd0)) != TYPE_MAIN_VARIANT (type)
|| TYPE_MAIN_VARIANT (TREE_TYPE (oprnd1)) != TYPE_MAIN_VARIANT (type))
return NULL;
@@ -387,12 +397,12 @@ vect_recog_widen_mult_pattern (tree last_stmt,
/* Check argument 0 */
if (!widened_name_p (oprnd0, last_stmt, &half_type0, &def_stmt0))
return NULL;
- oprnd0 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt0, 1), 0);
+ oprnd0 = gimple_assign_rhs1 (def_stmt0);
/* Check argument 1 */
if (!widened_name_p (oprnd1, last_stmt, &half_type1, &def_stmt1))
return NULL;
- oprnd1 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt1, 1), 0);
+ oprnd1 = gimple_assign_rhs1 (def_stmt1);
if (TYPE_MAIN_VARIANT (half_type0) != TYPE_MAIN_VARIANT (half_type1))
return NULL;
@@ -405,18 +415,23 @@ vect_recog_widen_mult_pattern (tree last_stmt,
vectype = get_vectype_for_scalar_type (half_type0);
if (!vectype
|| !supportable_widening_operation (WIDEN_MULT_EXPR, last_stmt, vectype,
- &dummy, &dummy, &dummy_code,
- &dummy_code))
+ &dummy, &dummy, &dummy_code,
+ &dummy_code, &dummy_int, &dummy_vec))
return NULL;
*type_in = vectype;
*type_out = NULL_TREE;
/* Pattern supported. Create a stmt to be used to replace the pattern: */
- pattern_expr = build2 (WIDEN_MULT_EXPR, type, oprnd0, oprnd1);
+ var = vect_recog_temp_ssa_var (type, NULL);
+ pattern_stmt = gimple_build_assign_with_ops (WIDEN_MULT_EXPR, var, oprnd0,
+ oprnd1);
+ SSA_NAME_DEF_STMT (var) = pattern_stmt;
+
if (vect_print_dump_info (REPORT_DETAILS))
- print_generic_expr (vect_dump, pattern_expr, TDF_SLIM);
- return pattern_expr;
+ print_gimple_stmt (vect_dump, pattern_stmt, 0, TDF_SLIM);
+
+ return pattern_stmt;
}
@@ -441,43 +456,40 @@ vect_recog_widen_mult_pattern (tree last_stmt,
* Return value: A new stmt that will be used to replace the sequence of
stmts that constitute the pattern. In this case it will be:
- x * x
+ x = x * x
or
- sqrt (x)
+ x = sqrt (x)
*/
-static tree
-vect_recog_pow_pattern (tree last_stmt, tree *type_in, tree *type_out)
+static gimple
+vect_recog_pow_pattern (gimple last_stmt, tree *type_in, tree *type_out)
{
- tree expr;
tree type;
- tree fn, base, exp;
+ tree fn, base, exp = NULL;
+ gimple stmt;
+ tree var;
- if (TREE_CODE (last_stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_call (last_stmt) || gimple_call_lhs (last_stmt) == NULL)
return NULL;
- expr = GIMPLE_STMT_OPERAND (last_stmt, 1);
- type = TREE_TYPE (expr);
-
- if (TREE_CODE (expr) != CALL_EXPR)
- return NULL_TREE;
+ type = gimple_expr_type (last_stmt);
- fn = get_callee_fndecl (expr);
+ fn = gimple_call_fndecl (last_stmt);
switch (DECL_FUNCTION_CODE (fn))
{
case BUILT_IN_POWIF:
case BUILT_IN_POWI:
case BUILT_IN_POWF:
case BUILT_IN_POW:
- base = CALL_EXPR_ARG (expr, 0);
- exp = CALL_EXPR_ARG (expr, 1);
+ base = gimple_call_arg (last_stmt, 0);
+ exp = gimple_call_arg (last_stmt, 1);
if (TREE_CODE (exp) != REAL_CST
&& TREE_CODE (exp) != INTEGER_CST)
- return NULL_TREE;
+ return NULL;
break;
- default:;
- return NULL_TREE;
+ default:
+ return NULL;
}
/* We now have a pow or powi builtin function call with a constant
@@ -492,7 +504,11 @@ vect_recog_pow_pattern (tree last_stmt, tree *type_in, tree *type_out)
&& REAL_VALUES_EQUAL (TREE_REAL_CST (exp), dconst2)))
{
*type_in = TREE_TYPE (base);
- return build2 (MULT_EXPR, TREE_TYPE (base), base, base);
+
+ var = vect_recog_temp_ssa_var (TREE_TYPE (base), NULL);
+ stmt = gimple_build_assign_with_ops (MULT_EXPR, var, base, base);
+ SSA_NAME_DEF_STMT (var) = stmt;
+ return stmt;
}
/* Catch square root. */
@@ -503,13 +519,18 @@ vect_recog_pow_pattern (tree last_stmt, tree *type_in, tree *type_out)
*type_in = get_vectype_for_scalar_type (TREE_TYPE (base));
if (*type_in)
{
- newfn = build_call_expr (newfn, 1, base);
- if (vectorizable_function (newfn, *type_in, *type_in) != NULL_TREE)
- return newfn;
+ gimple stmt = gimple_build_call (newfn, 1, base);
+ if (vectorizable_function (stmt, *type_in, *type_in)
+ != NULL_TREE)
+ {
+ var = vect_recog_temp_ssa_var (TREE_TYPE (base), stmt);
+ gimple_call_set_lhs (stmt, var);
+ return stmt;
+ }
}
}
- return NULL_TREE;
+ return NULL;
}
@@ -552,22 +573,22 @@ vect_recog_pow_pattern (tree last_stmt, tree *type_in, tree *type_out)
the correct order (as is the case when this computation is in an
inner-loop nested in an outer-loop that us being vectorized). */
-static tree
-vect_recog_widen_sum_pattern (tree last_stmt, tree *type_in, tree *type_out)
+static gimple
+vect_recog_widen_sum_pattern (gimple last_stmt, tree *type_in, tree *type_out)
{
- tree stmt, expr;
+ gimple stmt;
tree oprnd0, oprnd1;
stmt_vec_info stmt_vinfo = vinfo_for_stmt (last_stmt);
tree type, half_type;
- tree pattern_expr;
+ gimple pattern_stmt;
loop_vec_info loop_info = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
struct loop *loop = LOOP_VINFO_LOOP (loop_info);
+ tree var;
- if (TREE_CODE (last_stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_assign (last_stmt))
return NULL;
- expr = GIMPLE_STMT_OPERAND (last_stmt, 1);
- type = TREE_TYPE (expr);
+ type = gimple_expr_type (last_stmt);
/* Look for the following pattern
DX = (TYPE) X;
@@ -579,14 +600,14 @@ vect_recog_widen_sum_pattern (tree last_stmt, tree *type_in, tree *type_out)
/* Starting from LAST_STMT, follow the defs of its uses in search
of the above pattern. */
- if (TREE_CODE (expr) != PLUS_EXPR)
+ if (gimple_assign_rhs_code (last_stmt) != PLUS_EXPR)
return NULL;
if (STMT_VINFO_DEF_TYPE (stmt_vinfo) != vect_reduction_def)
return NULL;
- oprnd0 = TREE_OPERAND (expr, 0);
- oprnd1 = TREE_OPERAND (expr, 1);
+ oprnd0 = gimple_assign_rhs1 (last_stmt);
+ oprnd1 = gimple_assign_rhs2 (last_stmt);
if (TYPE_MAIN_VARIANT (TREE_TYPE (oprnd0)) != TYPE_MAIN_VARIANT (type)
|| TYPE_MAIN_VARIANT (TREE_TYPE (oprnd1)) != TYPE_MAIN_VARIANT (type))
return NULL;
@@ -600,16 +621,20 @@ vect_recog_widen_sum_pattern (tree last_stmt, tree *type_in, tree *type_out)
if (!widened_name_p (oprnd0, last_stmt, &half_type, &stmt))
return NULL;
- oprnd0 = TREE_OPERAND (GIMPLE_STMT_OPERAND (stmt, 1), 0);
+ oprnd0 = gimple_assign_rhs1 (stmt);
*type_in = half_type;
*type_out = type;
/* Pattern detected. Create a stmt to be used to replace the pattern: */
- pattern_expr = build2 (WIDEN_SUM_EXPR, type, oprnd0, oprnd1);
+ var = vect_recog_temp_ssa_var (type, NULL);
+ pattern_stmt = gimple_build_assign_with_ops (WIDEN_SUM_EXPR, var,
+ oprnd0, oprnd1);
+ SSA_NAME_DEF_STMT (var) = pattern_stmt;
+
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "vect_recog_widen_sum_pattern: detected: ");
- print_generic_expr (vect_dump, pattern_expr, TDF_SLIM);
+ print_gimple_stmt (vect_dump, pattern_stmt, 0, TDF_SLIM);
}
/* We don't allow changing the order of the computation in the inner-loop
@@ -621,7 +646,7 @@ vect_recog_widen_sum_pattern (tree last_stmt, tree *type_in, tree *type_out)
return NULL;
}
- return pattern_expr;
+ return pattern_stmt;
}
@@ -649,23 +674,19 @@ vect_recog_widen_sum_pattern (tree last_stmt, tree *type_in, tree *type_out)
static void
vect_pattern_recog_1 (
- tree (* vect_recog_func) (tree, tree *, tree *),
- block_stmt_iterator si)
+ gimple (* vect_recog_func) (gimple, tree *, tree *),
+ gimple_stmt_iterator si)
{
- tree stmt = bsi_stmt (si);
+ gimple stmt = gsi_stmt (si), pattern_stmt;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
stmt_vec_info pattern_stmt_info;
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
- tree pattern_expr;
tree pattern_vectype;
tree type_in, type_out;
- tree pattern_type;
enum tree_code code;
- tree var, var_name;
- stmt_ann_t ann;
- pattern_expr = (* vect_recog_func) (stmt, &type_in, &type_out);
- if (!pattern_expr)
+ pattern_stmt = (* vect_recog_func) (stmt, &type_in, &type_out);
+ if (!pattern_stmt)
return;
if (VECTOR_MODE_P (TYPE_MODE (type_in)))
@@ -685,8 +706,15 @@ vect_pattern_recog_1 (
if (!pattern_vectype)
return;
- optab = optab_for_tree_code (TREE_CODE (pattern_expr), pattern_vectype,
- optab_default);
+ if (is_gimple_assign (pattern_stmt))
+ code = gimple_assign_rhs_code (pattern_stmt);
+ else
+ {
+ gcc_assert (is_gimple_call (pattern_stmt));
+ code = CALL_EXPR;
+ }
+
+ optab = optab_for_tree_code (code, pattern_vectype, optab_default);
vec_mode = TYPE_MODE (pattern_vectype);
if (!optab
|| (icode = optab_handler (optab, vec_mode)->insn_code) ==
@@ -702,28 +730,20 @@ vect_pattern_recog_1 (
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "pattern recognized: ");
- print_generic_expr (vect_dump, pattern_expr, TDF_SLIM);
+ print_gimple_stmt (vect_dump, pattern_stmt, 0, TDF_SLIM);
}
- /* Mark the stmts that are involved in the pattern,
- create a new stmt to express the pattern and insert it. */
- code = TREE_CODE (pattern_expr);
- pattern_type = TREE_TYPE (pattern_expr);
- var = create_tmp_var (pattern_type, "patt");
- add_referenced_var (var);
- var_name = make_ssa_name (var, NULL_TREE);
- pattern_expr = build_gimple_modify_stmt (var_name, pattern_expr);
- SSA_NAME_DEF_STMT (var_name) = pattern_expr;
- bsi_insert_before (&si, pattern_expr, BSI_SAME_STMT);
- ann = stmt_ann (pattern_expr);
- set_stmt_info (ann, new_stmt_vec_info (pattern_expr, loop_vinfo));
- pattern_stmt_info = vinfo_for_stmt (pattern_expr);
+ /* Mark the stmts that are involved in the pattern. */
+ gsi_insert_before (&si, pattern_stmt, GSI_SAME_STMT);
+ set_vinfo_for_stmt (pattern_stmt,
+ new_stmt_vec_info (pattern_stmt, loop_vinfo));
+ pattern_stmt_info = vinfo_for_stmt (pattern_stmt);
STMT_VINFO_RELATED_STMT (pattern_stmt_info) = stmt;
STMT_VINFO_DEF_TYPE (pattern_stmt_info) = STMT_VINFO_DEF_TYPE (stmt_info);
STMT_VINFO_VECTYPE (pattern_stmt_info) = pattern_vectype;
STMT_VINFO_IN_PATTERN_P (stmt_info) = true;
- STMT_VINFO_RELATED_STMT (stmt_info) = pattern_expr;
+ STMT_VINFO_RELATED_STMT (stmt_info) = pattern_stmt;
return;
}
@@ -804,10 +824,10 @@ vect_pattern_recog (loop_vec_info loop_vinfo)
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo);
unsigned int nbbs = loop->num_nodes;
- block_stmt_iterator si;
- tree stmt;
+ gimple_stmt_iterator si;
+ gimple stmt;
unsigned int i, j;
- tree (* vect_recog_func_ptr) (tree, tree *, tree *);
+ gimple (* vect_recog_func_ptr) (gimple, tree *, tree *);
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "=== vect_pattern_recog ===");
@@ -817,9 +837,9 @@ vect_pattern_recog (loop_vec_info loop_vinfo)
for (i = 0; i < nbbs; i++)
{
basic_block bb = bbs[i];
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
- stmt = bsi_stmt (si);
+ stmt = gsi_stmt (si);
/* Scan over all generic vect_recog_xxx_pattern functions. */
for (j = 0; j < NUM_PATTERNS; j++)
diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c
index 1fa786da0b9..3a77c5bab1c 100644
--- a/gcc/tree-vect-transform.c
+++ b/gcc/tree-vect-transform.c
@@ -46,20 +46,22 @@ along with GCC; see the file COPYING3. If not see
#include "real.h"
/* Utility functions for the code transformation. */
-static bool vect_transform_stmt (tree, block_stmt_iterator *, bool *, slp_tree);
+static bool vect_transform_stmt (gimple, gimple_stmt_iterator *, bool *,
+ slp_tree, slp_instance);
static tree vect_create_destination_var (tree, tree);
static tree vect_create_data_ref_ptr
- (tree, struct loop*, tree, tree *, tree *, bool, bool *);
+ (gimple, struct loop*, tree, tree *, gimple *, bool, bool *);
static tree vect_create_addr_base_for_vector_ref
- (tree, tree *, tree, struct loop *);
+ (gimple, gimple_seq *, tree, struct loop *);
static tree vect_get_new_vect_var (tree, enum vect_var_kind, const char *);
-static tree vect_get_vec_def_for_operand (tree, tree, tree *);
-static tree vect_init_vector (tree, tree, tree, block_stmt_iterator *);
+static tree vect_get_vec_def_for_operand (tree, gimple, tree *);
+static tree vect_init_vector (gimple, tree, tree, gimple_stmt_iterator *);
static void vect_finish_stmt_generation
- (tree stmt, tree vec_stmt, block_stmt_iterator *);
+ (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, tree, enum tree_code, tree);
-static tree get_initial_def_for_reduction (tree, tree, tree *);
+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). */
static void vect_generate_tmps_on_preheader
@@ -73,7 +75,7 @@ static int vect_min_worthwhile_factor (enum tree_code);
static int
-cost_for_stmt (tree stmt)
+cost_for_stmt (gimple stmt)
{
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
@@ -148,11 +150,11 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo)
/* Requires loop versioning tests to handle misalignment. */
- if (VEC_length (tree, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo)))
+ if (VEC_length (gimple, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo)))
{
/* FIXME: Make cost depend on complexity of individual check. */
vec_outside_cost +=
- VEC_length (tree, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo));
+ VEC_length (gimple, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo));
if (vect_print_dump_info (REPORT_COST))
fprintf (vect_dump, "cost model: Adding cost of checks for loop "
"versioning to treat misalignment.\n");
@@ -168,7 +170,7 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo)
"versioning aliasing.\n");
}
- if (VEC_length (tree, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo))
+ if (VEC_length (gimple, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo))
|| VEC_length (ddr_p, LOOP_VINFO_MAY_ALIAS_DDRS (loop_vinfo)))
{
vec_outside_cost += TARG_COND_TAKEN_BRANCH_COST;
@@ -188,7 +190,7 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo)
for (i = 0; i < nbbs; i++)
{
- block_stmt_iterator si;
+ gimple_stmt_iterator si;
basic_block bb = bbs[i];
if (bb->loop_father == loop->inner)
@@ -196,9 +198,9 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo)
else
factor = 1;
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
- tree stmt = bsi_stmt (si);
+ gimple stmt = gsi_stmt (si);
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
/* Skip stmts that are not vectorized inside the loop. */
if (!STMT_VINFO_RELEVANT_P (stmt_info)
@@ -338,7 +340,7 @@ vect_estimate_min_profitable_iters (loop_vec_info loop_vinfo)
if (runtime_test)
{
/* Cost model check occurs at versioning. */
- if (VEC_length (tree, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo))
+ if (VEC_length (gimple, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo))
|| VEC_length (ddr_p, LOOP_VINFO_MAY_ALIAS_DDRS (loop_vinfo)))
scalar_outside_cost += TARG_COND_NOT_TAKEN_BRANCH_COST;
else
@@ -451,18 +453,34 @@ vect_model_reduction_cost (stmt_vec_info stmt_info, enum tree_code reduc_code,
enum tree_code code;
optab optab;
tree vectype;
- tree orig_stmt;
+ gimple stmt, orig_stmt;
tree reduction_op;
enum machine_mode mode;
- tree operation = GIMPLE_STMT_OPERAND (STMT_VINFO_STMT (stmt_info), 1);
- int op_type = TREE_CODE_LENGTH (TREE_CODE (operation));
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
+
/* Cost of reduction op inside loop. */
STMT_VINFO_INSIDE_OF_LOOP_COST (stmt_info) += ncopies * TARG_VEC_STMT_COST;
- reduction_op = TREE_OPERAND (operation, op_type-1);
+ stmt = STMT_VINFO_STMT (stmt_info);
+
+ switch (get_gimple_rhs_class (gimple_assign_rhs_code (stmt)))
+ {
+ case GIMPLE_SINGLE_RHS:
+ gcc_assert (TREE_OPERAND_LENGTH (gimple_assign_rhs1 (stmt)) == ternary_op);
+ reduction_op = TREE_OPERAND (gimple_assign_rhs1 (stmt), 2);
+ break;
+ case GIMPLE_UNARY_RHS:
+ reduction_op = gimple_assign_rhs1 (stmt);
+ break;
+ case GIMPLE_BINARY_RHS:
+ reduction_op = gimple_assign_rhs2 (stmt);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
vectype = get_vectype_for_scalar_type (TREE_TYPE (reduction_op));
if (!vectype)
{
@@ -480,7 +498,7 @@ vect_model_reduction_cost (stmt_vec_info stmt_info, enum tree_code reduc_code,
if (!orig_stmt)
orig_stmt = STMT_VINFO_STMT (stmt_info);
- code = TREE_CODE (GIMPLE_STMT_OPERAND (orig_stmt, 1));
+ code = gimple_assign_rhs_code (orig_stmt);
/* Add in cost for initial definition. */
outer_cost += TARG_SCALAR_TO_VEC_COST;
@@ -498,7 +516,7 @@ vect_model_reduction_cost (stmt_vec_info stmt_info, enum tree_code reduc_code,
{
int vec_size_in_bits = tree_low_cst (TYPE_SIZE (vectype), 1);
tree bitsize =
- TYPE_SIZE (TREE_TYPE ( GIMPLE_STMT_OPERAND (orig_stmt, 0)));
+ TYPE_SIZE (TREE_TYPE (gimple_assign_lhs (orig_stmt)));
int element_bitsize = tree_low_cst (bitsize, 1);
int nelements = vec_size_in_bits / element_bitsize;
@@ -562,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. */
@@ -590,7 +612,7 @@ vect_model_simple_cost (stmt_vec_info stmt_info, int ncopies,
static int
vect_cost_strided_group_size (stmt_vec_info stmt_info)
{
- tree first_stmt = DR_GROUP_FIRST_DR (stmt_info);
+ gimple first_stmt = DR_GROUP_FIRST_DR (stmt_info);
if (first_stmt == STMT_VINFO_STMT (stmt_info))
return DR_GROUP_SIZE (stmt_info);
@@ -611,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
@@ -661,10 +687,14 @@ vect_model_load_cost (stmt_vec_info stmt_info, int ncopies, slp_tree slp_node)
{
int group_size;
int alignment_support_cheme;
- tree first_stmt;
+ gimple first_stmt;
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)
@@ -846,21 +876,21 @@ vect_get_new_vect_var (tree type, enum vect_var_kind var_kind, const char *name)
FORNOW: We are only handling array accesses with step 1. */
static tree
-vect_create_addr_base_for_vector_ref (tree stmt,
- tree *new_stmt_list,
+vect_create_addr_base_for_vector_ref (gimple stmt,
+ gimple_seq *new_stmt_list,
tree offset,
struct loop *loop)
{
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
- struct loop *containing_loop = (bb_for_stmt (stmt))->loop_father;
+ struct loop *containing_loop = (gimple_bb (stmt))->loop_father;
tree data_ref_base = unshare_expr (DR_BASE_ADDRESS (dr));
tree base_name;
tree data_ref_base_var;
- tree new_base_stmt;
tree vec_stmt;
tree addr_base, addr_expr;
- tree dest, new_stmt;
+ tree dest;
+ gimple_seq seq = NULL;
tree base_offset = unshare_expr (DR_OFFSET (dr));
tree init = unshare_expr (DR_INIT (dr));
tree vect_ptr_type, addr_expr2;
@@ -883,17 +913,17 @@ vect_create_addr_base_for_vector_ref (tree stmt,
base_name = build_fold_indirect_ref (data_ref_base);
data_ref_base_var = create_tmp_var (TREE_TYPE (data_ref_base), "batmp");
add_referenced_var (data_ref_base_var);
- data_ref_base = force_gimple_operand (data_ref_base, &new_base_stmt,
- true, data_ref_base_var);
- append_to_statement_list_force(new_base_stmt, new_stmt_list);
+ data_ref_base = force_gimple_operand (data_ref_base, &seq, true,
+ data_ref_base_var);
+ gimple_seq_add_seq (new_stmt_list, seq);
/* Create base_offset */
base_offset = size_binop (PLUS_EXPR, base_offset, init);
base_offset = fold_convert (sizetype, base_offset);
dest = create_tmp_var (TREE_TYPE (base_offset), "base_off");
add_referenced_var (dest);
- base_offset = force_gimple_operand (base_offset, &new_stmt, true, dest);
- append_to_statement_list_force (new_stmt, new_stmt_list);
+ base_offset = force_gimple_operand (base_offset, &seq, true, dest);
+ gimple_seq_add_seq (new_stmt_list, seq);
if (offset)
{
@@ -903,10 +933,10 @@ vect_create_addr_base_for_vector_ref (tree stmt,
offset = fold_build2 (MULT_EXPR, TREE_TYPE (offset), offset, step);
base_offset = fold_build2 (PLUS_EXPR, TREE_TYPE (base_offset),
base_offset, offset);
- base_offset = force_gimple_operand (base_offset, &new_stmt, false, tmp);
- append_to_statement_list_force (new_stmt, new_stmt_list);
+ base_offset = force_gimple_operand (base_offset, &seq, false, tmp);
+ gimple_seq_add_seq (new_stmt_list, seq);
}
-
+
/* base + base_offset */
addr_base = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (data_ref_base),
data_ref_base, base_offset);
@@ -921,8 +951,8 @@ vect_create_addr_base_for_vector_ref (tree stmt,
addr_expr2 = vect_get_new_vect_var (vect_ptr_type, vect_pointer_var,
get_name (base_name));
add_referenced_var (addr_expr2);
- vec_stmt = force_gimple_operand (vec_stmt, &new_stmt, false, addr_expr2);
- append_to_statement_list_force (new_stmt, new_stmt_list);
+ vec_stmt = force_gimple_operand (vec_stmt, &seq, false, addr_expr2);
+ gimple_seq_add_seq (new_stmt_list, seq);
if (vect_print_dump_info (REPORT_DETAILS))
{
@@ -944,8 +974,8 @@ vect_create_addr_base_for_vector_ref (tree stmt,
Input:
1. STMT: a stmt that references memory. Expected to be of the form
- GIMPLE_MODIFY_STMT <name, data-ref> or
- GIMPLE_MODIFY_STMT <data-ref, name>.
+ GIMPLE_ASSIGN <name, data-ref> or
+ GIMPLE_ASSIGN <data-ref, name>.
2. AT_LOOP: the loop where the vector memref is to be created.
3. OFFSET (optional): an offset to be added to the initial address accessed
by the data-ref in STMT.
@@ -978,8 +1008,8 @@ vect_create_addr_base_for_vector_ref (tree stmt,
4. Return the pointer. */
static tree
-vect_create_data_ref_ptr (tree stmt, struct loop *at_loop,
- tree offset, tree *initial_address, tree *ptr_incr,
+vect_create_data_ref_ptr (gimple stmt, struct loop *at_loop,
+ tree offset, tree *initial_address, gimple *ptr_incr,
bool only_init, bool *inv_p)
{
tree base_name;
@@ -987,23 +1017,23 @@ vect_create_data_ref_ptr (tree stmt, struct loop *at_loop,
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
bool nested_in_vect_loop = nested_in_vect_loop_p (loop, stmt);
- struct loop *containing_loop = (bb_for_stmt (stmt))->loop_father;
+ struct loop *containing_loop = (gimple_bb (stmt))->loop_father;
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
tree vect_ptr_type;
tree vect_ptr;
tree tag;
tree new_temp;
- tree vec_stmt;
- tree new_stmt_list = NULL_TREE;
+ gimple vec_stmt;
+ gimple_seq new_stmt_list = NULL;
edge pe;
basic_block new_bb;
tree vect_ptr_init;
struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
tree vptr;
- block_stmt_iterator incr_bsi;
+ gimple_stmt_iterator incr_gsi;
bool insert_after;
tree indx_before_incr, indx_after_incr;
- tree incr;
+ gimple incr;
tree step;
/* Check the step (evolution) of the load in LOOP, and record
@@ -1020,7 +1050,7 @@ vect_create_data_ref_ptr (tree stmt, struct loop *at_loop,
/* Create an expression for the first address accessed by this load
in LOOP. */
- base_name = build_fold_indirect_ref (unshare_expr (DR_BASE_ADDRESS (dr)));
+ base_name = build_fold_indirect_ref (unshare_expr (DR_BASE_ADDRESS (dr)));
if (vect_print_dump_info (REPORT_DETAILS))
{
@@ -1099,18 +1129,18 @@ vect_create_data_ref_ptr (tree stmt, struct loop *at_loop,
pe = loop_preheader_edge (loop);
if (new_stmt_list)
{
- new_bb = bsi_insert_on_edge_immediate (pe, new_stmt_list);
+ new_bb = gsi_insert_seq_on_edge_immediate (pe, new_stmt_list);
gcc_assert (!new_bb);
}
*initial_address = new_temp;
/* Create: p = (vectype *) initial_base */
- vec_stmt = fold_convert (vect_ptr_type, new_temp);
- vec_stmt = build_gimple_modify_stmt (vect_ptr, vec_stmt);
+ vec_stmt = gimple_build_assign (vect_ptr,
+ fold_convert (vect_ptr_type, new_temp));
vect_ptr_init = make_ssa_name (vect_ptr, vec_stmt);
- GIMPLE_STMT_OPERAND (vec_stmt, 0) = vect_ptr_init;
- new_bb = bsi_insert_on_edge_immediate (pe, vec_stmt);
+ gimple_assign_set_lhs (vec_stmt, vect_ptr_init);
+ new_bb = gsi_insert_on_edge_immediate (pe, vec_stmt);
gcc_assert (!new_bb);
@@ -1135,15 +1165,14 @@ vect_create_data_ref_ptr (tree stmt, struct loop *at_loop,
if (*inv_p)
step = size_zero_node;
- standard_iv_increment_position (loop, &incr_bsi, &insert_after);
+ standard_iv_increment_position (loop, &incr_gsi, &insert_after);
create_iv (vect_ptr_init,
fold_convert (vect_ptr_type, step),
- NULL_TREE, loop, &incr_bsi, insert_after,
+ NULL_TREE, loop, &incr_gsi, insert_after,
&indx_before_incr, &indx_after_incr);
- incr = bsi_stmt (incr_bsi);
- set_stmt_info (stmt_ann (incr),
- new_stmt_vec_info (incr, loop_vinfo));
+ incr = gsi_stmt (incr_gsi);
+ set_vinfo_for_stmt (incr, new_stmt_vec_info (incr, loop_vinfo));
/* Copy the points-to information if it exists. */
if (DR_PTR_INFO (dr))
@@ -1169,13 +1198,13 @@ vect_create_data_ref_ptr (tree stmt, struct loop *at_loop,
gcc_assert (nested_in_vect_loop);
if (!only_init)
{
- standard_iv_increment_position (containing_loop, &incr_bsi,
+ standard_iv_increment_position (containing_loop, &incr_gsi,
&insert_after);
create_iv (vptr, fold_convert (vect_ptr_type, DR_STEP (dr)), NULL_TREE,
- containing_loop, &incr_bsi, insert_after, &indx_before_incr,
+ containing_loop, &incr_gsi, insert_after, &indx_before_incr,
&indx_after_incr);
- incr = bsi_stmt (incr_bsi);
- set_stmt_info (stmt_ann (incr), new_stmt_vec_info (incr, loop_vinfo));
+ incr = gsi_stmt (incr_gsi);
+ set_vinfo_for_stmt (incr, new_stmt_vec_info (incr, loop_vinfo));
/* Copy the points-to information if it exists. */
if (DR_PTR_INFO (dr))
@@ -1230,16 +1259,15 @@ vect_create_data_ref_ptr (tree stmt, struct loop *at_loop,
*/
static tree
-bump_vector_ptr (tree dataref_ptr, tree ptr_incr, block_stmt_iterator *bsi,
- tree stmt, tree bump)
+bump_vector_ptr (tree dataref_ptr, gimple ptr_incr, gimple_stmt_iterator *gsi,
+ gimple stmt, tree bump)
{
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info);
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
- tree vptr_type = TREE_TYPE (dataref_ptr);
tree ptr_var = SSA_NAME_VAR (dataref_ptr);
tree update = TYPE_SIZE_UNIT (vectype);
- tree incr_stmt;
+ gimple incr_stmt;
ssa_op_iter iter;
use_operand_p use_p;
tree new_dataref_ptr;
@@ -1247,12 +1275,11 @@ bump_vector_ptr (tree dataref_ptr, tree ptr_incr, block_stmt_iterator *bsi,
if (bump)
update = bump;
- incr_stmt = build_gimple_modify_stmt (ptr_var,
- build2 (POINTER_PLUS_EXPR, vptr_type,
- dataref_ptr, update));
+ incr_stmt = gimple_build_assign_with_ops (POINTER_PLUS_EXPR, ptr_var,
+ dataref_ptr, update);
new_dataref_ptr = make_ssa_name (ptr_var, incr_stmt);
- GIMPLE_STMT_OPERAND (incr_stmt, 0) = new_dataref_ptr;
- vect_finish_stmt_generation (stmt, incr_stmt, bsi);
+ gimple_assign_set_lhs (incr_stmt, new_dataref_ptr);
+ vect_finish_stmt_generation (stmt, incr_stmt, gsi);
/* Copy the points-to information if it exists. */
if (DR_PTR_INFO (dr))
@@ -1313,12 +1340,12 @@ vect_create_destination_var (tree scalar_dest, tree vectype)
It will be used in the vectorization of STMT. */
static tree
-vect_init_vector (tree stmt, tree vector_var, tree vector_type,
- block_stmt_iterator *bsi)
+vect_init_vector (gimple stmt, tree vector_var, tree vector_type,
+ gimple_stmt_iterator *gsi)
{
stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt);
tree new_var;
- tree init_stmt;
+ gimple init_stmt;
tree vec_oprnd;
edge pe;
tree new_temp;
@@ -1326,12 +1353,12 @@ vect_init_vector (tree stmt, tree vector_var, tree vector_type,
new_var = vect_get_new_vect_var (vector_type, vect_simple_var, "cst_");
add_referenced_var (new_var);
- init_stmt = build_gimple_modify_stmt (new_var, vector_var);
+ init_stmt = gimple_build_assign (new_var, vector_var);
new_temp = make_ssa_name (new_var, init_stmt);
- GIMPLE_STMT_OPERAND (init_stmt, 0) = new_temp;
+ gimple_assign_set_lhs (init_stmt, new_temp);
- if (bsi)
- vect_finish_stmt_generation (stmt, init_stmt, bsi);
+ if (gsi)
+ vect_finish_stmt_generation (stmt, init_stmt, gsi);
else
{
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
@@ -1340,17 +1367,17 @@ vect_init_vector (tree stmt, tree vector_var, tree vector_type,
if (nested_in_vect_loop_p (loop, stmt))
loop = loop->inner;
pe = loop_preheader_edge (loop);
- new_bb = bsi_insert_on_edge_immediate (pe, init_stmt);
+ new_bb = gsi_insert_on_edge_immediate (pe, init_stmt);
gcc_assert (!new_bb);
}
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "created new init_stmt: ");
- print_generic_expr (vect_dump, init_stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, init_stmt, 0, TDF_SLIM);
}
- vec_oprnd = GIMPLE_STMT_OPERAND (init_stmt, 0);
+ vec_oprnd = gimple_assign_lhs (init_stmt);
return vec_oprnd;
}
@@ -1358,14 +1385,14 @@ vect_init_vector (tree stmt, tree vector_var, tree vector_type,
/* For constant and loop invariant defs of SLP_NODE this function returns
(vector) defs (VEC_OPRNDS) that will be used in the vectorized stmts.
OP_NUM determines if we gather defs for operand 0 or operand 1 of the scalar
- stmts. */
+ stmts. NUMBER_OF_VECTORS is the number of vector defs to create. */
static void
vect_get_constant_vectors (slp_tree slp_node, VEC(tree,heap) **vec_oprnds,
- unsigned int op_num)
+ unsigned int op_num, unsigned int number_of_vectors)
{
- VEC (tree, heap) *stmts = SLP_TREE_SCALAR_STMTS (slp_node);
- tree stmt = VEC_index (tree, stmts, 0);
+ VEC (gimple, heap) *stmts = SLP_TREE_SCALAR_STMTS (slp_node);
+ gimple stmt = VEC_index (gimple, stmts, 0);
stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt);
tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
int nunits = TYPE_VECTOR_SUBPARTS (vectype);
@@ -1373,12 +1400,11 @@ vect_get_constant_vectors (slp_tree slp_node, VEC(tree,heap) **vec_oprnds,
tree t = NULL_TREE;
int j, number_of_places_left_in_vector;
tree vector_type;
- tree op, vop, operation;
- int group_size = VEC_length (tree, stmts);
+ tree op, vop;
+ int group_size = VEC_length (gimple, stmts);
unsigned int vec_num, i;
int number_of_copies = 1;
bool is_store = false;
- unsigned int number_of_vectors = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
VEC (tree, heap) *voprnds = VEC_alloc (tree, heap, number_of_vectors);
bool constant_p;
@@ -1407,13 +1433,12 @@ vect_get_constant_vectors (slp_tree slp_node, VEC(tree,heap) **vec_oprnds,
constant_p = true;
for (j = 0; j < number_of_copies; j++)
{
- for (i = group_size - 1; VEC_iterate (tree, stmts, i, stmt); i--)
+ for (i = group_size - 1; VEC_iterate (gimple, stmts, i, stmt); i--)
{
- operation = GIMPLE_STMT_OPERAND (stmt, 1);
if (is_store)
- op = operation;
+ op = gimple_assign_rhs1 (stmt);
else
- op = TREE_OPERAND (operation, op_num);
+ op = gimple_op (stmt, op_num + 1);
if (!CONSTANT_CLASS_P (op))
constant_p = false;
@@ -1466,22 +1491,22 @@ 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)
{
tree vec_oprnd;
- tree vec_def_stmt;
+ gimple vec_def_stmt;
unsigned int i;
gcc_assert (SLP_TREE_VEC_STMTS (slp_node));
- for (i = 0;
- VEC_iterate (tree, SLP_TREE_VEC_STMTS (slp_node), i, vec_def_stmt);
+ for (i = 0;
+ VEC_iterate (gimple, SLP_TREE_VEC_STMTS (slp_node), i, vec_def_stmt);
i++)
{
gcc_assert (vec_def_stmt);
- vec_oprnd = GIMPLE_STMT_OPERAND (vec_def_stmt, 0);
+ vec_oprnd = gimple_get_lhs (vec_def_stmt);
VEC_quick_push (tree, *vec_oprnds, vec_oprnd);
}
}
@@ -1494,46 +1519,73 @@ 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,
VEC (tree,heap) **vec_oprnds1)
{
- tree operation, first_stmt;
+ gimple first_stmt;
+ enum tree_code code;
+ int number_of_vects;
+ HOST_WIDE_INT lhs_size_unit, rhs_size_unit;
+
+ first_stmt = VEC_index (gimple, SLP_TREE_SCALAR_STMTS (slp_node), 0);
+ /* 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);
+ /* Number of vector stmts was calculated according to LHS in
+ vect_schedule_slp_instance(), fix it by replacing LHS with RHS, if
+ necessary. See vect_get_smallest_scalar_type() for details. */
+ vect_get_smallest_scalar_type (first_stmt, &lhs_size_unit,
+ &rhs_size_unit);
+ if (rhs_size_unit != lhs_size_unit)
+ {
+ number_of_vects *= rhs_size_unit;
+ number_of_vects /= lhs_size_unit;
+ }
+ }
/* 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. */
- vect_get_constant_vectors (slp_node, vec_oprnds0, 0);
+ vect_get_constant_vectors (slp_node, vec_oprnds0, 0, number_of_vects);
- first_stmt = VEC_index (tree, 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;
- operation = GIMPLE_STMT_OPERAND (first_stmt, 1);
- if (TREE_OPERAND_LENGTH (operation) == unary_op || !vec_oprnds1)
+ code = gimple_assign_rhs_code (first_stmt);
+ 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. */
- vect_get_constant_vectors (slp_node, vec_oprnds1, 1);
+ vect_get_constant_vectors (slp_node, vec_oprnds1, 1, number_of_vects);
}
@@ -1550,12 +1602,12 @@ vect_get_slp_defs (slp_tree slp_node, VEC (tree,heap) **vec_oprnds0,
[X, X + S, X + 2*S, X + 3*S]. */
static tree
-get_initial_def_for_induction (tree iv_phi)
+get_initial_def_for_induction (gimple iv_phi)
{
stmt_vec_info stmt_vinfo = vinfo_for_stmt (iv_phi);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- tree scalar_type = TREE_TYPE (PHI_RESULT_TREE (iv_phi));
+ tree scalar_type = TREE_TYPE (gimple_phi_result (iv_phi));
tree vectype;
int nunits;
edge pe = loop_preheader_edge (loop);
@@ -1565,8 +1617,8 @@ get_initial_def_for_induction (tree iv_phi)
tree access_fn;
tree new_var;
tree new_name;
- tree init_stmt;
- tree induction_phi, induc_def, new_stmt, vec_def, vec_dest;
+ gimple init_stmt, induction_phi, new_stmt;
+ tree induc_def, vec_def, vec_dest;
tree init_expr, step_expr;
int vf = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
int i;
@@ -1575,14 +1627,14 @@ get_initial_def_for_induction (tree iv_phi)
tree expr;
stmt_vec_info phi_info = vinfo_for_stmt (iv_phi);
bool nested_in_vect_loop = false;
- tree stmts;
+ gimple_seq stmts = NULL;
imm_use_iterator imm_iter;
use_operand_p use_p;
- tree exit_phi;
+ gimple exit_phi;
edge latch_e;
tree loop_arg;
- block_stmt_iterator si;
- basic_block bb = bb_for_stmt (iv_phi);
+ gimple_stmt_iterator si;
+ basic_block bb = gimple_bb (iv_phi);
vectype = get_vectype_for_scalar_type (scalar_type);
gcc_assert (vectype);
@@ -1593,9 +1645,9 @@ get_initial_def_for_induction (tree iv_phi)
gcc_assert (ncopies >= 1);
/* Find the first insertion point in the BB. */
- si = bsi_after_labels (bb);
+ si = gsi_after_labels (bb);
- if (INTEGRAL_TYPE_P (scalar_type))
+ if (INTEGRAL_TYPE_P (scalar_type) || POINTER_TYPE_P (scalar_type))
step_expr = build_int_cst (scalar_type, 0);
else
step_expr = build_real (scalar_type, dconst0);
@@ -1608,7 +1660,7 @@ get_initial_def_for_induction (tree iv_phi)
}
else
iv_loop = loop;
- gcc_assert (iv_loop == (bb_for_stmt (iv_phi))->loop_father);
+ gcc_assert (iv_loop == (gimple_bb (iv_phi))->loop_father);
latch_e = loop_latch_edge (iv_loop);
loop_arg = PHI_ARG_DEF_FROM_EDGE (iv_phi, latch_e);
@@ -1639,7 +1691,7 @@ get_initial_def_for_induction (tree iv_phi)
new_name = force_gimple_operand (init_expr, &stmts, false, new_var);
if (stmts)
{
- new_bb = bsi_insert_on_edge_immediate (pe, stmts);
+ new_bb = gsi_insert_seq_on_edge_immediate (pe, stmts);
gcc_assert (!new_bb);
}
@@ -1647,21 +1699,21 @@ get_initial_def_for_induction (tree iv_phi)
t = tree_cons (NULL_TREE, init_expr, t);
for (i = 1; i < nunits; i++)
{
- tree tmp;
-
/* Create: new_name_i = new_name + step_expr */
- tmp = fold_build2 (PLUS_EXPR, scalar_type, new_name, step_expr);
- init_stmt = build_gimple_modify_stmt (new_var, tmp);
+ enum tree_code code = POINTER_TYPE_P (scalar_type)
+ ? POINTER_PLUS_EXPR : PLUS_EXPR;
+ init_stmt = gimple_build_assign_with_ops (code, new_var,
+ new_name, step_expr);
new_name = make_ssa_name (new_var, init_stmt);
- GIMPLE_STMT_OPERAND (init_stmt, 0) = new_name;
+ gimple_assign_set_lhs (init_stmt, new_name);
- new_bb = bsi_insert_on_edge_immediate (pe, init_stmt);
+ new_bb = gsi_insert_on_edge_immediate (pe, init_stmt);
gcc_assert (!new_bb);
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "created new init_stmt: ");
- print_generic_expr (vect_dump, init_stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, init_stmt, 0, TDF_SLIM);
}
t = tree_cons (NULL_TREE, new_name, t);
}
@@ -1707,19 +1759,17 @@ get_initial_def_for_induction (tree iv_phi)
vec_dest = vect_get_new_vect_var (vectype, vect_simple_var, "vec_iv_");
add_referenced_var (vec_dest);
induction_phi = create_phi_node (vec_dest, iv_loop->header);
- set_stmt_info (get_stmt_ann (induction_phi),
- new_stmt_vec_info (induction_phi, loop_vinfo));
+ set_vinfo_for_stmt (induction_phi,
+ new_stmt_vec_info (induction_phi, loop_vinfo));
induc_def = PHI_RESULT (induction_phi);
/* Create the iv update inside the loop */
- new_stmt = build_gimple_modify_stmt (NULL_TREE,
- build2 (PLUS_EXPR, vectype,
- induc_def, vec_step));
+ new_stmt = gimple_build_assign_with_ops (PLUS_EXPR, vec_dest,
+ induc_def, vec_step);
vec_def = make_ssa_name (vec_dest, new_stmt);
- GIMPLE_STMT_OPERAND (new_stmt, 0) = vec_def;
- bsi_insert_before (&si, new_stmt, BSI_SAME_STMT);
- set_stmt_info (get_stmt_ann (new_stmt),
- new_stmt_vec_info (new_stmt, loop_vinfo));
+ gimple_assign_set_lhs (new_stmt, vec_def);
+ gsi_insert_before (&si, new_stmt, GSI_SAME_STMT);
+ set_vinfo_for_stmt (new_stmt, new_stmt_vec_info (new_stmt, loop_vinfo));
/* Set the arguments of the phi node: */
add_phi_arg (induction_phi, vec_init, pe);
@@ -1752,16 +1802,15 @@ get_initial_def_for_induction (tree iv_phi)
prev_stmt_vinfo = vinfo_for_stmt (induction_phi);
for (i = 1; i < ncopies; i++)
{
- tree tmp;
-
/* vec_i = vec_prev + vec_step */
- tmp = build2 (PLUS_EXPR, vectype, vec_def, vec_step);
- new_stmt = build_gimple_modify_stmt (NULL_TREE, tmp);
+ new_stmt = gimple_build_assign_with_ops (PLUS_EXPR, vec_dest,
+ vec_def, vec_step);
vec_def = make_ssa_name (vec_dest, new_stmt);
- GIMPLE_STMT_OPERAND (new_stmt, 0) = vec_def;
- bsi_insert_before (&si, new_stmt, BSI_SAME_STMT);
- set_stmt_info (get_stmt_ann (new_stmt),
- new_stmt_vec_info (new_stmt, loop_vinfo));
+ gimple_assign_set_lhs (new_stmt, vec_def);
+
+ gsi_insert_before (&si, new_stmt, GSI_SAME_STMT);
+ set_vinfo_for_stmt (new_stmt,
+ new_stmt_vec_info (new_stmt, loop_vinfo));
STMT_VINFO_RELATED_STMT (prev_stmt_vinfo) = new_stmt;
prev_stmt_vinfo = vinfo_for_stmt (new_stmt);
}
@@ -1774,7 +1823,7 @@ get_initial_def_for_induction (tree iv_phi)
exit_phi = NULL;
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, loop_arg)
{
- if (!flow_bb_inside_loop_p (iv_loop, bb_for_stmt (USE_STMT (use_p))))
+ if (!flow_bb_inside_loop_p (iv_loop, gimple_bb (USE_STMT (use_p))))
{
exit_phi = USE_STMT (use_p);
break;
@@ -1792,7 +1841,7 @@ get_initial_def_for_induction (tree iv_phi)
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "vector of inductions after inner-loop:");
- print_generic_expr (vect_dump, new_stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, new_stmt, 0, TDF_SLIM);
}
}
}
@@ -1800,10 +1849,10 @@ get_initial_def_for_induction (tree iv_phi)
if (vect_print_dump_info (REPORT_DETAILS))
{
- fprintf (vect_dump, "transform induction: created def-use cycle:");
- print_generic_expr (vect_dump, induction_phi, TDF_SLIM);
+ fprintf (vect_dump, "transform induction: created def-use cycle: ");
+ print_gimple_stmt (vect_dump, induction_phi, 0, TDF_SLIM);
fprintf (vect_dump, "\n");
- print_generic_expr (vect_dump, SSA_NAME_DEF_STMT (vec_def), TDF_SLIM);
+ print_gimple_stmt (vect_dump, SSA_NAME_DEF_STMT (vec_def), 0, TDF_SLIM);
}
STMT_VINFO_VEC_STMT (phi_info) = induction_phi;
@@ -1823,11 +1872,11 @@ get_initial_def_for_induction (tree iv_phi)
needs to be introduced. */
static tree
-vect_get_vec_def_for_operand (tree op, tree stmt, tree *scalar_def)
+vect_get_vec_def_for_operand (tree op, gimple stmt, tree *scalar_def)
{
tree vec_oprnd;
- tree vec_stmt;
- tree def_stmt;
+ gimple vec_stmt;
+ gimple def_stmt;
stmt_vec_info def_stmt_info = NULL;
stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt);
tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
@@ -1860,7 +1909,7 @@ vect_get_vec_def_for_operand (tree op, tree stmt, tree *scalar_def)
if (def_stmt)
{
fprintf (vect_dump, " def_stmt = ");
- print_generic_expr (vect_dump, def_stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, def_stmt, 0, TDF_SLIM);
}
}
@@ -1913,16 +1962,18 @@ vect_get_vec_def_for_operand (tree op, tree stmt, tree *scalar_def)
case vect_loop_def:
{
if (scalar_def)
- *scalar_def = def_stmt;
+ *scalar_def = NULL/* FIXME tuples: def_stmt*/;
/* Get the def from the vectorized stmt. */
def_stmt_info = vinfo_for_stmt (def_stmt);
vec_stmt = STMT_VINFO_VEC_STMT (def_stmt_info);
gcc_assert (vec_stmt);
- if (TREE_CODE (vec_stmt) == PHI_NODE)
+ if (gimple_code (vec_stmt) == GIMPLE_PHI)
vec_oprnd = PHI_RESULT (vec_stmt);
+ else if (is_gimple_call (vec_stmt))
+ vec_oprnd = gimple_call_lhs (vec_stmt);
else
- vec_oprnd = GIMPLE_STMT_OPERAND (vec_stmt, 0);
+ vec_oprnd = gimple_assign_lhs (vec_stmt);
return vec_oprnd;
}
@@ -1931,8 +1982,8 @@ vect_get_vec_def_for_operand (tree op, tree stmt, tree *scalar_def)
{
struct loop *loop;
- gcc_assert (TREE_CODE (def_stmt) == PHI_NODE);
- loop = (bb_for_stmt (def_stmt))->loop_father;
+ gcc_assert (gimple_code (def_stmt) == GIMPLE_PHI);
+ loop = (gimple_bb (def_stmt))->loop_father;
/* Get the def before the loop */
op = PHI_ARG_DEF_FROM_EDGE (def_stmt, loop_preheader_edge (loop));
@@ -1942,12 +1993,12 @@ vect_get_vec_def_for_operand (tree op, tree stmt, tree *scalar_def)
/* Case 5: operand is defined by loop-header phi - induction. */
case vect_induction_def:
{
- gcc_assert (TREE_CODE (def_stmt) == PHI_NODE);
+ gcc_assert (gimple_code (def_stmt) == GIMPLE_PHI);
/* Get the def from the vectorized stmt. */
def_stmt_info = vinfo_for_stmt (def_stmt);
vec_stmt = STMT_VINFO_VEC_STMT (def_stmt_info);
- gcc_assert (vec_stmt && (TREE_CODE (vec_stmt) == PHI_NODE));
+ gcc_assert (vec_stmt && gimple_code (vec_stmt) == GIMPLE_PHI);
vec_oprnd = PHI_RESULT (vec_stmt);
return vec_oprnd;
}
@@ -2017,7 +2068,7 @@ vect_get_vec_def_for_operand (tree op, tree stmt, tree *scalar_def)
static tree
vect_get_vec_def_for_stmt_copy (enum vect_def_type dt, tree vec_oprnd)
{
- tree vec_stmt_for_operand;
+ gimple vec_stmt_for_operand;
stmt_vec_info def_stmt_info;
/* Do nothing; can reuse same def. */
@@ -2029,7 +2080,11 @@ vect_get_vec_def_for_stmt_copy (enum vect_def_type dt, tree vec_oprnd)
gcc_assert (def_stmt_info);
vec_stmt_for_operand = STMT_VINFO_RELATED_STMT (def_stmt_info);
gcc_assert (vec_stmt_for_operand);
- vec_oprnd = GIMPLE_STMT_OPERAND (vec_stmt_for_operand, 0);
+ 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;
}
@@ -2059,8 +2114,9 @@ vect_get_vec_defs_for_stmt_copy (enum vect_def_type *dt,
/* Get vectorized definitions for OP0 and OP1, or SLP_NODE if it is not NULL. */
static void
-vect_get_vec_defs (tree op0, tree op1, tree stmt, VEC(tree,heap) **vec_oprnds0,
- VEC(tree,heap) **vec_oprnds1, slp_tree slp_node)
+vect_get_vec_defs (tree op0, tree op1, gimple stmt,
+ VEC(tree,heap) **vec_oprnds0, VEC(tree,heap) **vec_oprnds1,
+ slp_tree slp_node)
{
if (slp_node)
vect_get_slp_defs (slp_node, vec_oprnds0, vec_oprnds1);
@@ -2087,30 +2143,29 @@ vect_get_vec_defs (tree op0, tree op1, tree stmt, VEC(tree,heap) **vec_oprnds0,
Insert a new stmt. */
static void
-vect_finish_stmt_generation (tree stmt, tree vec_stmt,
- block_stmt_iterator *bsi)
+vect_finish_stmt_generation (gimple stmt, gimple vec_stmt,
+ gimple_stmt_iterator *gsi)
{
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
- gcc_assert (stmt == bsi_stmt (*bsi));
- gcc_assert (TREE_CODE (stmt) != LABEL_EXPR);
+ gcc_assert (stmt == gsi_stmt (*gsi));
+ gcc_assert (gimple_code (stmt) != GIMPLE_LABEL);
- bsi_insert_before (bsi, vec_stmt, BSI_SAME_STMT);
+ gsi_insert_before (gsi, vec_stmt, GSI_SAME_STMT);
- set_stmt_info (get_stmt_ann (vec_stmt),
- new_stmt_vec_info (vec_stmt, loop_vinfo));
+ set_vinfo_for_stmt (vec_stmt, new_stmt_vec_info (vec_stmt, loop_vinfo));
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "add new stmt: ");
- print_generic_expr (vect_dump, vec_stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, vec_stmt, 0, TDF_SLIM);
}
- /* Make sure bsi points to the stmt that is being vectorized. */
- gcc_assert (stmt == bsi_stmt (*bsi));
+ /* Make sure gsi points to the stmt that is being vectorized. */
+ gcc_assert (stmt == gsi_stmt (*gsi));
- SET_EXPR_LOCATION (vec_stmt, EXPR_LOCATION (stmt));
+ gimple_set_location (vec_stmt, gimple_location (stmt));
}
@@ -2158,14 +2213,14 @@ vect_finish_stmt_generation (tree stmt, tree vec_stmt,
A cost model should help decide between these two schemes. */
static tree
-get_initial_def_for_reduction (tree stmt, tree init_val, tree *adjustment_def)
+get_initial_def_for_reduction (gimple stmt, tree init_val, tree *adjustment_def)
{
stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
int nunits = TYPE_VECTOR_SUBPARTS (vectype);
- enum tree_code code = TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1));
+ enum tree_code code = gimple_assign_rhs_code (stmt);
tree type = TREE_TYPE (init_val);
tree vecdef;
tree def_for_init;
@@ -2179,7 +2234,7 @@ get_initial_def_for_reduction (tree stmt, tree init_val, tree *adjustment_def)
if (nested_in_vect_loop_p (loop, stmt))
nested_in_vect_loop = true;
else
- gcc_assert (loop == (bb_for_stmt (stmt))->loop_father);
+ gcc_assert (loop == (gimple_bb (stmt))->loop_father);
vecdef = vect_get_vec_def_for_operand (init_val, stmt, NULL);
@@ -2225,6 +2280,11 @@ get_initial_def_for_reduction (tree 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.
@@ -2267,10 +2327,13 @@ get_initial_def_for_reduction (tree stmt, tree init_val, tree *adjustment_def)
*/
static void
-vect_create_epilog_for_reduction (tree vect_def, tree stmt,
- enum tree_code reduc_code, tree reduction_phi)
+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);
@@ -2278,29 +2341,29 @@ vect_create_epilog_for_reduction (tree vect_def, tree stmt,
basic_block exit_bb;
tree scalar_dest;
tree scalar_type;
- tree new_phi;
- block_stmt_iterator exit_bsi;
+ gimple new_phi = NULL, phi;
+ gimple_stmt_iterator exit_gsi;
tree vec_dest;
tree new_temp = NULL_TREE;
tree new_name;
- tree epilog_stmt = NULL_TREE;
- tree new_scalar_dest, exit_phi, new_dest;
+ gimple epilog_stmt = NULL;
+ tree new_scalar_dest, new_dest;
+ gimple exit_phi;
tree bitsize, bitpos, bytesize;
- enum tree_code code = TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1));
+ 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;
bool extract_scalar_result = false;
tree reduction_op, expr;
- tree orig_stmt;
- tree use_stmt;
- tree operation = GIMPLE_STMT_OPERAND (stmt, 1);
+ gimple orig_stmt;
+ gimple use_stmt;
bool nested_in_vect_loop = false;
- int op_type;
- VEC(tree,heap) *phis = NULL;
- int i;
+ VEC(gimple,heap) *phis = NULL;
+ enum vect_def_type dt = vect_unknown_def_type;
+ int j, i;
if (nested_in_vect_loop_p (loop, stmt))
{
@@ -2308,33 +2371,56 @@ vect_create_epilog_for_reduction (tree vect_def, tree stmt,
nested_in_vect_loop = true;
}
- op_type = TREE_OPERAND_LENGTH (operation);
- reduction_op = TREE_OPERAND (operation, op_type-1);
+ switch (get_gimple_rhs_class (gimple_assign_rhs_code (stmt)))
+ {
+ case GIMPLE_SINGLE_RHS:
+ gcc_assert (TREE_OPERAND_LENGTH (gimple_assign_rhs1 (stmt)) == ternary_op);
+ reduction_op = TREE_OPERAND (gimple_assign_rhs1 (stmt), 2);
+ break;
+ case GIMPLE_UNARY_RHS:
+ reduction_op = gimple_assign_rhs1 (stmt);
+ break;
+ case GIMPLE_BINARY_RHS:
+ reduction_op = gimple_assign_rhs2 (stmt);
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
vectype = get_vectype_for_scalar_type (TREE_TYPE (reduction_op));
gcc_assert (vectype);
mode = TYPE_MODE (vectype);
/*** 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_generic_expr (vect_dump, reduction_phi, TDF_SLIM);
- fprintf (vect_dump, "\n");
- print_generic_expr (vect_dump, SSA_NAME_DEF_STMT (vect_def), 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
@@ -2358,7 +2444,7 @@ vect_create_epilog_for_reduction (tree vect_def, tree 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.
***/
@@ -2367,9 +2453,23 @@ vect_create_epilog_for_reduction (tree vect_def, tree 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);
- exit_bsi = bsi_after_labels (exit_bb);
+ 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
(i.e. when reduc_code is not available) and in the final adjustment
@@ -2393,8 +2493,8 @@ vect_create_epilog_for_reduction (tree vect_def, tree stmt,
gcc_assert (STMT_VINFO_IN_PATTERN_P (stmt_vinfo));
gcc_assert (STMT_VINFO_RELATED_STMT (stmt_vinfo) == stmt);
}
- code = TREE_CODE (GIMPLE_STMT_OPERAND (orig_stmt, 1));
- scalar_dest = GIMPLE_STMT_OPERAND (orig_stmt, 0);
+ code = gimple_assign_rhs_code (orig_stmt);
+ scalar_dest = gimple_assign_lhs (orig_stmt);
scalar_type = TREE_TYPE (scalar_dest);
new_scalar_dest = vect_create_destination_var (scalar_dest, NULL);
bitsize = TYPE_SIZE (scalar_type);
@@ -2409,6 +2509,9 @@ vect_create_epilog_for_reduction (tree vect_def, tree 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. */
@@ -2424,10 +2527,10 @@ vect_create_epilog_for_reduction (tree vect_def, tree stmt,
vec_dest = vect_create_destination_var (scalar_dest, vectype);
tmp = build1 (reduc_code, vectype, PHI_RESULT (new_phi));
- epilog_stmt = build_gimple_modify_stmt (vec_dest, tmp);
+ epilog_stmt = gimple_build_assign (vec_dest, tmp);
new_temp = make_ssa_name (vec_dest, epilog_stmt);
- GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_temp;
- bsi_insert_before (&exit_bsi, epilog_stmt, BSI_SAME_STMT);
+ gimple_assign_set_lhs (epilog_stmt, new_temp);
+ gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
extract_scalar_result = true;
}
@@ -2480,17 +2583,17 @@ vect_create_epilog_for_reduction (tree vect_def, tree stmt,
bit_offset /= 2)
{
tree bitpos = size_int (bit_offset);
- tree tmp = build2 (shift_code, vectype, new_temp, bitpos);
- epilog_stmt = build_gimple_modify_stmt (vec_dest, tmp);
+ epilog_stmt = gimple_build_assign_with_ops (shift_code, vec_dest,
+ new_temp, bitpos);
new_name = make_ssa_name (vec_dest, epilog_stmt);
- GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_name;
- bsi_insert_before (&exit_bsi, epilog_stmt, BSI_SAME_STMT);
+ gimple_assign_set_lhs (epilog_stmt, new_name);
+ gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
- tmp = build2 (code, vectype, new_name, new_temp);
- epilog_stmt = build_gimple_modify_stmt (vec_dest, tmp);
+ epilog_stmt = gimple_build_assign_with_ops (code, vec_dest,
+ new_name, new_temp);
new_temp = make_ssa_name (vec_dest, epilog_stmt);
- GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_temp;
- bsi_insert_before (&exit_bsi, epilog_stmt, BSI_SAME_STMT);
+ gimple_assign_set_lhs (epilog_stmt, new_temp);
+ gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
}
extract_scalar_result = true;
@@ -2516,30 +2619,30 @@ vect_create_epilog_for_reduction (tree vect_def, tree stmt,
vec_size_in_bits = tree_low_cst (TYPE_SIZE (vectype), 1);
rhs = build3 (BIT_FIELD_REF, scalar_type, vec_temp, bitsize,
bitsize_zero_node);
- epilog_stmt = build_gimple_modify_stmt (new_scalar_dest, rhs);
+ epilog_stmt = gimple_build_assign (new_scalar_dest, rhs);
new_temp = make_ssa_name (new_scalar_dest, epilog_stmt);
- GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_temp;
- bsi_insert_before (&exit_bsi, epilog_stmt, BSI_SAME_STMT);
+ gimple_assign_set_lhs (epilog_stmt, new_temp);
+ gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
for (bit_offset = element_bitsize;
bit_offset < vec_size_in_bits;
bit_offset += element_bitsize)
{
- tree tmp;
tree bitpos = bitsize_int (bit_offset);
tree rhs = build3 (BIT_FIELD_REF, scalar_type, vec_temp, bitsize,
bitpos);
- epilog_stmt = build_gimple_modify_stmt (new_scalar_dest, rhs);
+ epilog_stmt = gimple_build_assign (new_scalar_dest, rhs);
new_name = make_ssa_name (new_scalar_dest, epilog_stmt);
- GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_name;
- bsi_insert_before (&exit_bsi, epilog_stmt, BSI_SAME_STMT);
+ gimple_assign_set_lhs (epilog_stmt, new_name);
+ gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
- tmp = build2 (code, scalar_type, new_name, new_temp);
- epilog_stmt = build_gimple_modify_stmt (new_scalar_dest, tmp);
+ epilog_stmt = gimple_build_assign_with_ops (code,
+ new_scalar_dest,
+ new_name, new_temp);
new_temp = make_ssa_name (new_scalar_dest, epilog_stmt);
- GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_temp;
- bsi_insert_before (&exit_bsi, epilog_stmt, BSI_SAME_STMT);
+ gimple_assign_set_lhs (epilog_stmt, new_temp);
+ gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
}
extract_scalar_result = false;
@@ -2565,10 +2668,10 @@ vect_create_epilog_for_reduction (tree vect_def, tree stmt,
bitpos = bitsize_zero_node;
rhs = build3 (BIT_FIELD_REF, scalar_type, new_temp, bitsize, bitpos);
- epilog_stmt = build_gimple_modify_stmt (new_scalar_dest, rhs);
+ epilog_stmt = gimple_build_assign (new_scalar_dest, rhs);
new_temp = make_ssa_name (new_scalar_dest, epilog_stmt);
- GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_temp;
- bsi_insert_before (&exit_bsi, epilog_stmt, BSI_SAME_STMT);
+ gimple_assign_set_lhs (epilog_stmt, new_temp);
+ gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
}
vect_finalize_reduction:
@@ -2592,10 +2695,11 @@ vect_finalize_reduction:
expr = build2 (code, scalar_type, new_temp, adjustment_def);
new_dest = vect_create_destination_var (scalar_dest, scalar_type);
}
- epilog_stmt = build_gimple_modify_stmt (new_dest, expr);
+ epilog_stmt = gimple_build_assign (new_dest, expr);
new_temp = make_ssa_name (new_dest, epilog_stmt);
- GIMPLE_STMT_OPERAND (epilog_stmt, 0) = new_temp;
- bsi_insert_before (&exit_bsi, epilog_stmt, BSI_SAME_STMT);
+ gimple_assign_set_lhs (epilog_stmt, new_temp);
+ SSA_NAME_DEF_STMT (new_temp) = epilog_stmt;
+ gsi_insert_before (&exit_gsi, epilog_stmt, GSI_SAME_STMT);
}
@@ -2605,33 +2709,37 @@ vect_finalize_reduction:
Find the loop-closed-use at the loop exit of the original scalar result.
(The reduction result is expected to have two immediate uses - one at the
latch block, and one at the loop exit). */
- phis = VEC_alloc (tree, heap, 10);
+ phis = VEC_alloc (gimple, heap, 10);
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, scalar_dest)
{
- if (!flow_bb_inside_loop_p (loop, bb_for_stmt (USE_STMT (use_p))))
+ if (!flow_bb_inside_loop_p (loop, gimple_bb (USE_STMT (use_p))))
{
exit_phi = USE_STMT (use_p);
- VEC_quick_push (tree, phis, exit_phi);
+ VEC_quick_push (gimple, phis, exit_phi);
}
}
/* We expect to have found an exit_phi because of loop-closed-ssa form. */
- gcc_assert (!VEC_empty (tree, phis));
+ gcc_assert (!VEC_empty (gimple, phis));
- for (i = 0; VEC_iterate (tree, phis, i, exit_phi); i++)
+ for (i = 0; VEC_iterate (gimple, phis, i, exit_phi); i++)
{
if (nested_in_vect_loop)
{
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_stmt_info (get_stmt_ann (epilog_stmt),
- new_stmt_vec_info (epilog_stmt, loop_vinfo));
+ 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;
}
@@ -2641,7 +2749,7 @@ vect_finalize_reduction:
FOR_EACH_IMM_USE_ON_STMT (use_p, imm_iter)
SET_USE (use_p, new_temp);
}
- VEC_free (tree, heap, phis);
+ VEC_free (gimple, heap, phis);
}
@@ -2686,49 +2794,44 @@ vect_finalize_reduction:
does *NOT* necessarily hold for reduction patterns. */
bool
-vectorizable_reduction (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
+vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi,
+ gimple *vec_stmt)
{
tree vec_dest;
tree scalar_dest;
- tree op;
tree loop_vec_def0 = NULL_TREE, loop_vec_def1 = NULL_TREE;
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);
- tree operation;
enum tree_code code, orig_code, epilog_reduc_code = 0;
enum machine_mode vec_mode;
int op_type;
optab optab, reduc_optab;
tree new_temp = NULL_TREE;
- tree def, def_stmt;
+ tree def;
+ gimple def_stmt;
enum vect_def_type dt;
- tree new_phi;
+ gimple new_phi = NULL;
tree scalar_type;
bool is_simple_use;
- tree orig_stmt;
+ gimple orig_stmt;
stmt_vec_info orig_stmt_info;
tree expr = NULL_TREE;
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;
- tree new_stmt = NULL_TREE;
+ 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);
@@ -2772,14 +2875,41 @@ vectorizable_reduction (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
inside the loop body. The last operand is the reduction variable,
which is defined by the loop-header-phi. */
- gcc_assert (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT);
+ gcc_assert (is_gimple_assign (stmt));
- operation = GIMPLE_STMT_OPERAND (stmt, 1);
- code = TREE_CODE (operation);
- op_type = TREE_OPERAND_LENGTH (operation);
- if (op_type != binary_op && op_type != ternary_op)
- return false;
- scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
+ /* Flatten RHS */
+ switch (get_gimple_rhs_class (gimple_assign_rhs_code (stmt)))
+ {
+ case GIMPLE_SINGLE_RHS:
+ op_type = TREE_OPERAND_LENGTH (gimple_assign_rhs1 (stmt));
+ if (op_type == ternary_op)
+ {
+ tree rhs = gimple_assign_rhs1 (stmt);
+ ops[0] = TREE_OPERAND (rhs, 0);
+ ops[1] = TREE_OPERAND (rhs, 1);
+ ops[2] = TREE_OPERAND (rhs, 2);
+ code = TREE_CODE (rhs);
+ }
+ else
+ return false;
+ break;
+
+ case GIMPLE_BINARY_RHS:
+ code = gimple_assign_rhs_code (stmt);
+ op_type = TREE_CODE_LENGTH (code);
+ gcc_assert (op_type == binary_op);
+ ops[0] = gimple_assign_rhs1 (stmt);
+ ops[1] = gimple_assign_rhs2 (stmt);
+ break;
+
+ case GIMPLE_UNARY_RHS:
+ return false;
+
+ default:
+ gcc_unreachable ();
+ }
+
+ scalar_dest = gimple_assign_lhs (stmt);
scalar_type = TREE_TYPE (scalar_dest);
if (!POINTER_TYPE_P (scalar_type) && !INTEGRAL_TYPE_P (scalar_type)
&& !SCALAR_FLOAT_TYPE_P (scalar_type))
@@ -2789,8 +2919,8 @@ vectorizable_reduction (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
The last use is the reduction variable. */
for (i = 0; i < op_type-1; i++)
{
- op = TREE_OPERAND (operation, i);
- is_simple_use = vect_is_simple_use (op, loop_vinfo, &def_stmt, &def, &dt);
+ is_simple_use = vect_is_simple_use (ops[i], loop_vinfo, &def_stmt,
+ &def, &dt);
gcc_assert (is_simple_use);
if (dt != vect_loop_def
&& dt != vect_invariant_def
@@ -2799,11 +2929,10 @@ vectorizable_reduction (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
return false;
}
- op = TREE_OPERAND (operation, i);
- is_simple_use = vect_is_simple_use (op, loop_vinfo, &def_stmt, &def, &dt);
+ is_simple_use = vect_is_simple_use (ops[i], loop_vinfo, &def_stmt, &def, &dt);
gcc_assert (is_simple_use);
gcc_assert (dt == vect_reduction_def);
- gcc_assert (TREE_CODE (def_stmt) == PHI_NODE);
+ gcc_assert (gimple_code (def_stmt) == GIMPLE_PHI);
if (orig_stmt)
gcc_assert (orig_stmt == vect_is_simple_reduction (loop_vinfo, def_stmt));
else
@@ -2883,7 +3012,7 @@ vectorizable_reduction (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
{
/* This is a reduction pattern: get the vectype from the type of the
reduction variable, and get the tree-code from orig_stmt. */
- orig_code = TREE_CODE (GIMPLE_STMT_OPERAND (orig_stmt, 1));
+ orig_code = gimple_assign_rhs_code (orig_stmt);
vectype = get_vectype_for_scalar_type (TREE_TYPE (def));
if (!vectype)
{
@@ -2936,31 +3065,64 @@ vectorizable_reduction (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
/* 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)
{
- op = TREE_OPERAND (operation, 0);
- loop_vec_def0 = vect_get_vec_def_for_operand (op, stmt, NULL);
+ loop_vec_def0 = vect_get_vec_def_for_operand (ops[0], stmt, NULL);
if (op_type == ternary_op)
{
- op = TREE_OPERAND (operation, 1);
- loop_vec_def1 = vect_get_vec_def_for_operand (op, stmt, NULL);
+ loop_vec_def1 = vect_get_vec_def_for_operand (ops[1], stmt, NULL);
}
/* Get the vector def for the reduction variable from the phi node */
reduc_def = PHI_RESULT (new_phi);
+ first_phi = new_phi;
}
else
{
@@ -2969,9 +3131,12 @@ vectorizable_reduction (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
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_STMT_OPERAND (new_stmt ,0);
+ 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. */
@@ -2980,21 +3145,25 @@ vectorizable_reduction (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
else
expr = build3 (code, vectype, loop_vec_def0, loop_vec_def1,
reduc_def);
- new_stmt = build_gimple_modify_stmt (vec_dest, expr);
+ new_stmt = gimple_build_assign (vec_dest, expr);
new_temp = make_ssa_name (vec_dest, new_stmt);
- GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
- vect_finish_stmt_generation (stmt, new_stmt, bsi);
+ gimple_assign_set_lhs (new_stmt, new_temp);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
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;
}
@@ -3003,14 +3172,14 @@ vectorizable_reduction (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
of the function, or NULL_TREE if the function cannot be vectorized. */
tree
-vectorizable_function (tree call, tree vectype_out, tree vectype_in)
+vectorizable_function (gimple call, tree vectype_out, tree vectype_in)
{
- tree fndecl = get_callee_fndecl (call);
+ tree fndecl = gimple_call_fndecl (call);
enum built_in_function code;
/* We only handle functions that do not read or clobber memory -- i.e.
const or novops ones. */
- if (!(call_expr_flags (call) & (ECF_CONST | ECF_NOVOPS)))
+ if (!(gimple_call_flags (call) & (ECF_CONST | ECF_NOVOPS)))
return NULL_TREE;
if (!fndecl
@@ -3031,11 +3200,10 @@ vectorizable_function (tree call, tree vectype_out, tree vectype_in)
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
bool
-vectorizable_call (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
+vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt)
{
tree vec_dest;
tree scalar_dest;
- tree operation;
tree op, type;
tree vec_oprnd0 = NULL_TREE, vec_oprnd1 = NULL_TREE;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt), prev_stmt_info;
@@ -3043,14 +3211,14 @@ vectorizable_call (tree stmt, block_stmt_iterator *bsi, tree *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, rhs, new_temp, def, def_stmt, rhs_type, lhs_type;
+ 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};
- tree new_stmt;
- int ncopies, j, nargs;
- call_expr_arg_iterator iter;
- tree vargs;
+ gimple new_stmt;
+ int ncopies, j;
+ VEC(tree, heap) *vargs = NULL;
enum { NARROW, NONE, WIDEN } modifier;
+ size_t i, nargs;
if (!STMT_VINFO_RELEVANT_P (stmt_info))
return false;
@@ -3063,26 +3231,25 @@ vectorizable_call (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
return false;
/* Is STMT a vectorizable call? */
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
- return false;
-
- if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) != SSA_NAME)
+ if (!is_gimple_call (stmt))
return false;
- operation = GIMPLE_STMT_OPERAND (stmt, 1);
- if (TREE_CODE (operation) != CALL_EXPR)
+ if (TREE_CODE (gimple_call_lhs (stmt)) != SSA_NAME)
return false;
/* Process function arguments. */
rhs_type = NULL_TREE;
- nargs = 0;
- FOR_EACH_CALL_EXPR_ARG (op, iter, operation)
+ 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++)
{
- /* 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 (nargs >= 2)
- return false;
+ op = gimple_call_arg (stmt, i);
/* We can only handle calls with arguments of the same type. */
if (rhs_type
@@ -3094,26 +3261,20 @@ vectorizable_call (tree stmt, block_stmt_iterator *bsi, tree *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.");
return false;
}
-
- ++nargs;
}
- /* 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;
nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in);
- lhs_type = TREE_TYPE (GIMPLE_STMT_OPERAND (stmt, 0));
+ lhs_type = TREE_TYPE (gimple_call_lhs (stmt));
vectype_out = get_vectype_for_scalar_type (lhs_type);
if (!vectype_out)
return false;
@@ -3133,7 +3294,7 @@ vectorizable_call (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
is available. TODO -- in some cases, it might be profitable to
insert the calls for pieces of the vector, in order to be able
to vectorize other operations in the loop. */
- fndecl = vectorizable_function (operation, vectype_out, vectype_in);
+ fndecl = vectorizable_function (stmt, vectype_out, vectype_in);
if (fndecl == NULL_TREE)
{
if (vect_print_dump_info (REPORT_DETAILS))
@@ -3153,14 +3314,6 @@ vectorizable_call (tree stmt, block_stmt_iterator *bsi, tree *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;
@@ -3175,16 +3328,8 @@ vectorizable_call (tree stmt, block_stmt_iterator *bsi, tree *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_STMT_OPERAND (stmt, 0);
+ scalar_dest = gimple_call_lhs (stmt);
vec_dest = vect_create_destination_var (scalar_dest, vectype_out);
prev_stmt_info = NULL;
@@ -3194,12 +3339,14 @@ vectorizable_call (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
for (j = 0; j < ncopies; ++j)
{
/* Build argument list for the vectorized call. */
- /* FIXME: Rewrite this so that it doesn't
- construct a temporary list. */
- vargs = NULL_TREE;
- nargs = 0;
- FOR_EACH_CALL_EXPR_ARG (op, iter, operation)
+ if (j == 0)
+ vargs = VEC_alloc (tree, heap, nargs);
+ else
+ VEC_truncate (tree, vargs, 0);
+
+ for (i = 0; i < nargs; i++)
{
+ op = gimple_call_arg (stmt, i);
if (j == 0)
vec_oprnd0
= vect_get_vec_def_for_operand (op, stmt, NULL);
@@ -3207,18 +3354,14 @@ vectorizable_call (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
vec_oprnd0
= vect_get_vec_def_for_stmt_copy (dt[nargs], vec_oprnd0);
- vargs = tree_cons (NULL_TREE, vec_oprnd0, vargs);
-
- ++nargs;
+ VEC_quick_push (tree, vargs, vec_oprnd0);
}
- vargs = nreverse (vargs);
- rhs = build_function_call_expr (fndecl, vargs);
- new_stmt = build_gimple_modify_stmt (vec_dest, rhs);
+ new_stmt = gimple_build_call_vec (fndecl, vargs);
new_temp = make_ssa_name (vec_dest, new_stmt);
- GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
+ gimple_call_set_lhs (new_stmt, new_temp);
- vect_finish_stmt_generation (stmt, new_stmt, bsi);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
@@ -3234,12 +3377,14 @@ vectorizable_call (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
for (j = 0; j < ncopies; ++j)
{
/* Build argument list for the vectorized call. */
- /* FIXME: Rewrite this so that it doesn't
- construct a temporary list. */
- vargs = NULL_TREE;
- nargs = 0;
- FOR_EACH_CALL_EXPR_ARG (op, iter, operation)
+ if (j == 0)
+ vargs = VEC_alloc (tree, heap, nargs * 2);
+ else
+ VEC_truncate (tree, vargs, 0);
+
+ for (i = 0; i < nargs; i++)
{
+ op = gimple_call_arg (stmt, i);
if (j == 0)
{
vec_oprnd0
@@ -3255,19 +3400,15 @@ vectorizable_call (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
= vect_get_vec_def_for_stmt_copy (dt[nargs], vec_oprnd0);
}
- vargs = tree_cons (NULL_TREE, vec_oprnd0, vargs);
- vargs = tree_cons (NULL_TREE, vec_oprnd1, vargs);
-
- ++nargs;
+ VEC_quick_push (tree, vargs, vec_oprnd0);
+ VEC_quick_push (tree, vargs, vec_oprnd1);
}
- vargs = nreverse (vargs);
- rhs = build_function_call_expr (fndecl, vargs);
- new_stmt = build_gimple_modify_stmt (vec_dest, rhs);
+ new_stmt = gimple_build_call_vec (fndecl, vargs);
new_temp = make_ssa_name (vec_dest, new_stmt);
- GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
+ gimple_call_set_lhs (new_stmt, new_temp);
- vect_finish_stmt_generation (stmt, new_stmt, bsi);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
@@ -3286,13 +3427,21 @@ vectorizable_call (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
return false;
}
+ VEC_free (tree, heap, vargs);
+
/* The call in STMT might prevent it from being removed in dce.
We however cannot remove it here, due to the way the ssa name
it defines is mapped to the new definition. So just replace
rhs of the statement with something harmless. */
+
type = TREE_TYPE (scalar_dest);
- GIMPLE_STMT_OPERAND (stmt, 1) = fold_convert (type, integer_zero_node);
- update_stmt (stmt);
+ new_stmt = gimple_build_assign (gimple_call_lhs (stmt),
+ fold_convert (type, integer_zero_node));
+ set_vinfo_for_stmt (new_stmt, stmt_info);
+ set_vinfo_for_stmt (stmt, NULL);
+ STMT_VINFO_STMT (stmt_info) = new_stmt;
+ gsi_replace (gsi, new_stmt, false);
+ SSA_NAME_DEF_STMT (gimple_assign_lhs (new_stmt)) = new_stmt;
return true;
}
@@ -3301,20 +3450,20 @@ vectorizable_call (tree stmt, block_stmt_iterator *bsi, tree *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).
STMT is the original scalar stmt that we are vectorizing. */
-static tree
-vect_gen_widened_results_half (enum tree_code code, tree vectype, tree decl,
+static gimple
+vect_gen_widened_results_half (enum tree_code code,
+ tree decl,
tree vec_oprnd0, tree vec_oprnd1, int op_type,
- tree vec_dest, block_stmt_iterator *bsi,
- tree stmt)
+ tree vec_dest, gimple_stmt_iterator *gsi,
+ gimple stmt)
{
- tree expr;
- tree new_stmt;
+ gimple new_stmt;
tree new_temp;
tree sym;
ssa_op_iter iter;
@@ -3324,23 +3473,24 @@ vect_gen_widened_results_half (enum tree_code code, tree vectype, tree decl,
{
/* Target specific support */
if (op_type == binary_op)
- expr = build_call_expr (decl, 2, vec_oprnd0, vec_oprnd1);
+ new_stmt = gimple_build_call (decl, 2, vec_oprnd0, vec_oprnd1);
else
- expr = build_call_expr (decl, 1, vec_oprnd0);
+ new_stmt = gimple_build_call (decl, 1, vec_oprnd0);
+ new_temp = make_ssa_name (vec_dest, new_stmt);
+ gimple_call_set_lhs (new_stmt, new_temp);
}
else
- {
+ {
/* Generic support */
gcc_assert (op_type == TREE_CODE_LENGTH (code));
- if (op_type == binary_op)
- expr = build2 (code, vectype, vec_oprnd0, vec_oprnd1);
- else
- expr = build1 (code, vectype, vec_oprnd0);
+ if (op_type != binary_op)
+ vec_oprnd1 = NULL;
+ new_stmt = gimple_build_assign_with_ops (code, vec_dest, vec_oprnd0,
+ vec_oprnd1);
+ new_temp = make_ssa_name (vec_dest, new_stmt);
+ gimple_assign_set_lhs (new_stmt, new_temp);
}
- new_stmt = build_gimple_modify_stmt (vec_dest, expr);
- new_temp = make_ssa_name (vec_dest, new_stmt);
- GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
- vect_finish_stmt_generation (stmt, new_stmt, bsi);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (code == CALL_EXPR)
{
@@ -3362,23 +3512,22 @@ vect_gen_widened_results_half (enum tree_code code, tree vectype, tree decl,
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
bool
-vectorizable_conversion (tree stmt, block_stmt_iterator *bsi,
- tree *vec_stmt, slp_tree slp_node)
+vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi,
+ gimple *vec_stmt, slp_tree slp_node)
{
tree vec_dest;
tree scalar_dest;
- tree operation;
tree op0;
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;
- tree def, def_stmt;
+ tree def;
+ gimple def_stmt;
enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type};
- tree new_stmt = NULL_TREE;
+ gimple new_stmt = NULL;
stmt_vec_info prev_stmt_info;
int nunits_in;
int nunits_out;
@@ -3391,6 +3540,9 @@ vectorizable_conversion (tree stmt, block_stmt_iterator *bsi,
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? */
@@ -3400,26 +3552,25 @@ vectorizable_conversion (tree stmt, block_stmt_iterator *bsi,
if (STMT_VINFO_DEF_TYPE (stmt_info) != vect_loop_def)
return false;
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_assign (stmt))
return false;
- if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) != SSA_NAME)
+ if (TREE_CODE (gimple_assign_lhs (stmt)) != SSA_NAME)
return false;
- operation = GIMPLE_STMT_OPERAND (stmt, 1);
- code = TREE_CODE (operation);
+ code = gimple_assign_rhs_code (stmt);
if (code != FIX_TRUNC_EXPR && code != FLOAT_EXPR)
return false;
/* Check types of lhs and rhs. */
- op0 = TREE_OPERAND (operation, 0);
+ op0 = gimple_assign_rhs1 (stmt);
rhs_type = TREE_TYPE (op0);
vectype_in = get_vectype_for_scalar_type (rhs_type);
if (!vectype_in)
return false;
nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in);
- scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
+ scalar_dest = gimple_assign_lhs (stmt);
lhs_type = TREE_TYPE (scalar_dest);
vectype_out = get_vectype_for_scalar_type (lhs_type);
if (!vectype_out)
@@ -3444,6 +3595,8 @@ vectorizable_conversion (tree stmt, block_stmt_iterator *bsi,
|| (!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
@@ -3458,14 +3611,6 @@ vectorizable_conversion (tree stmt, block_stmt_iterator *bsi,
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]))
{
@@ -3476,17 +3621,18 @@ vectorizable_conversion (tree stmt, block_stmt_iterator *bsi,
/* 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;
}
@@ -3524,21 +3670,19 @@ vectorizable_conversion (tree stmt, block_stmt_iterator *bsi,
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++)
{
- new_stmt = build_call_expr (builtin_decl, 1, vop0);
-
/* Arguments are ready. create the new vector stmt. */
- new_stmt = build_gimple_modify_stmt (vec_dest, new_stmt);
+ new_stmt = gimple_build_call (builtin_decl, 1, vop0);
new_temp = make_ssa_name (vec_dest, new_stmt);
- GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
- vect_finish_stmt_generation (stmt, new_stmt, bsi);
+ gimple_call_set_lhs (new_stmt, new_temp);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
FOR_EACH_SSA_TREE_OPERAND (sym, new_stmt, iter,
SSA_OP_ALL_VIRTUALS)
{
@@ -3547,7 +3691,7 @@ vectorizable_conversion (tree stmt, block_stmt_iterator *bsi,
mark_sym_for_renaming (sym);
}
if (slp_node)
- VEC_quick_push (tree, SLP_TREE_VEC_STMTS (slp_node), new_stmt);
+ VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node), new_stmt);
}
if (j == 0)
@@ -3574,9 +3718,9 @@ vectorizable_conversion (tree stmt, block_stmt_iterator *bsi,
/* 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, bsi, stmt);
+ unary_op, vec_dest, gsi, stmt);
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
else
@@ -3585,9 +3729,9 @@ vectorizable_conversion (tree stmt, block_stmt_iterator *bsi,
/* 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, bsi, stmt);
+ unary_op, vec_dest, gsi, stmt);
STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
prev_stmt_info = vinfo_for_stmt (new_stmt);
}
@@ -3614,10 +3758,11 @@ vectorizable_conversion (tree stmt, block_stmt_iterator *bsi,
/* Arguments are ready. Create the new vector stmt. */
expr = build2 (code1, vectype_out, vec_oprnd0, vec_oprnd1);
- new_stmt = build_gimple_modify_stmt (vec_dest, expr);
+ new_stmt = gimple_build_assign_with_ops (code1, vec_dest, vec_oprnd0,
+ vec_oprnd1);
new_temp = make_ssa_name (vec_dest, new_stmt);
- GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
- vect_finish_stmt_generation (stmt, new_stmt, bsi);
+ gimple_assign_set_lhs (new_stmt, new_temp);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (j == 0)
STMT_VINFO_VEC_STMT (stmt_info) = new_stmt;
@@ -3645,8 +3790,8 @@ vectorizable_conversion (tree stmt, block_stmt_iterator *bsi,
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
bool
-vectorizable_assignment (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
- slp_tree slp_node)
+vectorizable_assignment (gimple stmt, gimple_stmt_iterator *gsi,
+ gimple *vec_stmt, slp_tree slp_node)
{
tree vec_dest;
tree scalar_dest;
@@ -3655,18 +3800,22 @@ vectorizable_assignment (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
tree new_temp;
- tree def, def_stmt;
+ tree def;
+ 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)
@@ -3679,14 +3828,19 @@ vectorizable_assignment (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
return false;
/* Is vectorizable assignment? */
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_assign (stmt))
return false;
- scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
+ scalar_dest = gimple_assign_lhs (stmt);
if (TREE_CODE (scalar_dest) != SSA_NAME)
return false;
- op = GIMPLE_STMT_OPERAND (stmt, 1);
+ if (gimple_assign_single_p (stmt)
+ || gimple_assign_rhs_code (stmt) == PAREN_EXPR)
+ op = gimple_assign_rhs1 (stmt);
+ else
+ return false;
+
if (!vect_is_simple_use (op, loop_vinfo, &def_stmt, &def, &dt[0]))
{
if (vect_print_dump_info (REPORT_DETAILS))
@@ -3716,14 +3870,14 @@ vectorizable_assignment (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
/* Arguments are ready. create the new vector stmt. */
for (i = 0; VEC_iterate (tree, vec_oprnds, i, vop); i++)
{
- *vec_stmt = build_gimple_modify_stmt (vec_dest, vop);
+ *vec_stmt = gimple_build_assign (vec_dest, vop);
new_temp = make_ssa_name (vec_dest, *vec_stmt);
- GIMPLE_STMT_OPERAND (*vec_stmt, 0) = new_temp;
- vect_finish_stmt_generation (stmt, *vec_stmt, bsi);
+ gimple_assign_set_lhs (*vec_stmt, new_temp);
+ vect_finish_stmt_generation (stmt, *vec_stmt, gsi);
STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt;
if (slp_node)
- VEC_quick_push (tree, SLP_TREE_VEC_STMTS (slp_node), *vec_stmt);
+ VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node), *vec_stmt);
}
VEC_free (tree, heap, vec_oprnds);
@@ -3766,17 +3920,25 @@ vect_min_worthwhile_factor (enum tree_code code)
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
bool
-vectorizable_induction (tree phi, block_stmt_iterator *bsi ATTRIBUTE_UNUSED,
- tree *vec_stmt)
+vectorizable_induction (gimple phi, gimple_stmt_iterator *gsi ATTRIBUTE_UNUSED,
+ gimple *vec_stmt)
{
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;
@@ -3787,7 +3949,7 @@ vectorizable_induction (tree phi, block_stmt_iterator *bsi ATTRIBUTE_UNUSED,
gcc_assert (STMT_VINFO_DEF_TYPE (stmt_info) == vect_induction_def);
- if (TREE_CODE (phi) != PHI_NODE)
+ if (gimple_code (phi) != GIMPLE_PHI)
return false;
if (!vec_stmt) /* transformation not required. */
@@ -3818,18 +3980,16 @@ vectorizable_induction (tree phi, block_stmt_iterator *bsi ATTRIBUTE_UNUSED,
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
bool
-vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
- slp_tree slp_node)
+vectorizable_operation (gimple stmt, gimple_stmt_iterator *gsi,
+ gimple *vec_stmt, slp_tree slp_node)
{
tree vec_dest;
tree scalar_dest;
- tree operation;
tree op0, op1 = NULL;
tree vec_oprnd1 = NULL_TREE;
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;
@@ -3837,14 +3997,15 @@ vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
optab optab;
int icode;
enum machine_mode optab_op2_mode;
- tree def, def_stmt;
+ tree def;
+ gimple def_stmt;
enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type};
- tree new_stmt = NULL_TREE;
+ gimple new_stmt = NULL;
stmt_vec_info prev_stmt_info;
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;
@@ -3852,18 +4013,15 @@ vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
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;
@@ -3872,13 +4030,13 @@ vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
return false;
/* Is STMT a vectorizable binary/unary operation? */
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_assign (stmt))
return false;
- if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) != SSA_NAME)
+ if (TREE_CODE (gimple_assign_lhs (stmt)) != SSA_NAME)
return false;
- scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
+ scalar_dest = gimple_assign_lhs (stmt);
vectype_out = get_vectype_for_scalar_type (TREE_TYPE (scalar_dest));
if (!vectype_out)
return false;
@@ -3886,8 +4044,7 @@ vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
if (nunits_out != nunits_in)
return false;
- operation = GIMPLE_STMT_OPERAND (stmt, 1);
- code = TREE_CODE (operation);
+ code = gimple_assign_rhs_code (stmt);
/* For pointer addition, we should use the normal plus for
the vector addition. */
@@ -3895,7 +4052,7 @@ vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
code = PLUS_EXPR;
/* Support only unary or binary operations. */
- op_type = TREE_OPERAND_LENGTH (operation);
+ op_type = TREE_CODE_LENGTH (code);
if (op_type != unary_op && op_type != binary_op)
{
if (vect_print_dump_info (REPORT_DETAILS))
@@ -3903,7 +4060,7 @@ vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
return false;
}
- op0 = TREE_OPERAND (operation, 0);
+ op0 = gimple_assign_rhs1 (stmt);
if (!vect_is_simple_use (op0, loop_vinfo, &def_stmt, &def, &dt[0]))
{
if (vect_print_dump_info (REPORT_DETAILS))
@@ -3913,7 +4070,7 @@ vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
if (op_type == binary_op)
{
- op1 = TREE_OPERAND (operation, 1);
+ op1 = gimple_assign_rhs2 (stmt);
if (!vect_is_simple_use (op1, loop_vinfo, &def_stmt, &def, &dt[1]))
{
if (vect_print_dump_info (REPORT_DETAILS))
@@ -4140,23 +4297,19 @@ vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
/* Arguments are ready. Create the new vector stmt. */
for (i = 0; VEC_iterate (tree, vec_oprnds0, i, vop0); i++)
{
- if (op_type == binary_op)
- {
- vop1 = VEC_index (tree, vec_oprnds1, i);
- new_stmt = build_gimple_modify_stmt (vec_dest,
- build2 (code, vectype, vop0, vop1));
- }
- else
- new_stmt = build_gimple_modify_stmt (vec_dest,
- build1 (code, vectype, vop0));
-
+ vop1 = ((op_type == binary_op)
+ ? VEC_index (tree, vec_oprnds1, i) : NULL);
+ new_stmt = gimple_build_assign_with_ops (code, vec_dest, vop0, vop1);
new_temp = make_ssa_name (vec_dest, new_stmt);
- GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
- vect_finish_stmt_generation (stmt, new_stmt, bsi);
+ gimple_assign_set_lhs (new_stmt, new_temp);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (slp_node)
- VEC_quick_push (tree, SLP_TREE_VEC_STMTS (slp_node), new_stmt);
+ 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
@@ -4172,6 +4325,109 @@ vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
}
+/* 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
@@ -4181,30 +4437,29 @@ vectorizable_operation (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
bool
-vectorizable_type_demotion (tree stmt, block_stmt_iterator *bsi,
- tree *vec_stmt)
+vectorizable_type_demotion (gimple stmt, gimple_stmt_iterator *gsi,
+ gimple *vec_stmt, slp_tree slp_node)
{
tree vec_dest;
tree scalar_dest;
- tree operation;
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, def_stmt;
+ tree def;
+ gimple def_stmt;
enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type};
- tree new_stmt;
stmt_vec_info prev_stmt_info;
int nunits_in;
int nunits_out;
tree vectype_out;
int ncopies;
- int j;
- tree expr;
+ 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;
@@ -4213,46 +4468,45 @@ vectorizable_type_demotion (tree stmt, block_stmt_iterator *bsi,
return false;
/* Is STMT a vectorizable type-demotion operation? */
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_assign (stmt))
return false;
- if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) != SSA_NAME)
+ if (TREE_CODE (gimple_assign_lhs (stmt)) != SSA_NAME)
return false;
- operation = GIMPLE_STMT_OPERAND (stmt, 1);
- code = TREE_CODE (operation);
- if (code != NOP_EXPR && code != CONVERT_EXPR)
+ code = gimple_assign_rhs_code (stmt);
+ if (!CONVERT_EXPR_CODE_P (code))
return false;
- op0 = TREE_OPERAND (operation, 0);
+ op0 = gimple_assign_rhs1 (stmt);
vectype_in = get_vectype_for_scalar_type (TREE_TYPE (op0));
if (!vectype_in)
return false;
nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in);
- scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
+ scalar_dest = gimple_assign_lhs (stmt);
vectype_out = get_vectype_for_scalar_type (TREE_TYPE (scalar_dest));
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. */
@@ -4264,7 +4518,8 @@ vectorizable_type_demotion (tree stmt, block_stmt_iterator *bsi,
}
/* 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;
@@ -4283,45 +4538,157 @@ vectorizable_type_demotion (tree stmt, block_stmt_iterator *bsi,
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. */
- expr = build2 (code1, vectype_out, vec_oprnd0, vec_oprnd1);
- new_stmt = build_gimple_modify_stmt (vec_dest, expr);
- new_temp = make_ssa_name (vec_dest, new_stmt);
- GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
- vect_finish_stmt_generation (stmt, new_stmt, bsi);
+ /* 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);
+ }
}
@@ -4334,30 +4701,32 @@ vectorizable_type_demotion (tree stmt, block_stmt_iterator *bsi,
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
bool
-vectorizable_type_promotion (tree stmt, block_stmt_iterator *bsi,
- tree *vec_stmt)
+vectorizable_type_promotion (gimple stmt, gimple_stmt_iterator *gsi,
+ gimple *vec_stmt, slp_tree slp_node)
{
tree vec_dest;
tree scalar_dest;
- tree operation;
tree op0, op1 = NULL;
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, def_stmt;
+ tree def;
+ gimple def_stmt;
enum vect_def_type dt[2] = {vect_unknown_def_type, vect_unknown_def_type};
- tree 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;
@@ -4366,47 +4735,46 @@ vectorizable_type_promotion (tree stmt, block_stmt_iterator *bsi,
return false;
/* Is STMT a vectorizable type-promotion operation? */
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_assign (stmt))
return false;
- if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) != SSA_NAME)
+ if (TREE_CODE (gimple_assign_lhs (stmt)) != SSA_NAME)
return false;
- operation = GIMPLE_STMT_OPERAND (stmt, 1);
- code = TREE_CODE (operation);
- if (code != NOP_EXPR && code != CONVERT_EXPR
+ code = gimple_assign_rhs_code (stmt);
+ if (!CONVERT_EXPR_CODE_P (code)
&& code != WIDEN_MULT_EXPR)
return false;
- op0 = TREE_OPERAND (operation, 0);
+ op0 = gimple_assign_rhs1 (stmt);
vectype_in = get_vectype_for_scalar_type (TREE_TYPE (op0));
if (!vectype_in)
return false;
nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in);
- scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
+ scalar_dest = gimple_assign_lhs (stmt);
vectype_out = get_vectype_for_scalar_type (TREE_TYPE (scalar_dest));
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. */
@@ -4420,7 +4788,7 @@ vectorizable_type_promotion (tree stmt, block_stmt_iterator *bsi,
op_type = TREE_CODE_LENGTH (code);
if (op_type == binary_op)
{
- op1 = TREE_OPERAND (operation, 1);
+ op1 = gimple_assign_rhs2 (stmt);
if (!vect_is_simple_use (op1, loop_vinfo, &def_stmt, &def, &dt[1]))
{
if (vect_print_dump_info (REPORT_DETAILS))
@@ -4431,9 +4799,14 @@ vectorizable_type_promotion (tree stmt, block_stmt_iterator *bsi,
/* 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. */
@@ -4452,7 +4825,38 @@ vectorizable_type_promotion (tree stmt, block_stmt_iterator *bsi,
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
@@ -4465,38 +4869,46 @@ vectorizable_type_promotion (tree stmt, block_stmt_iterator *bsi,
/* 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, bsi, 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, bsi, 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;
}
@@ -4605,17 +5017,19 @@ vect_strided_store_supported (tree vectype)
static bool
vect_permute_store_chain (VEC(tree,heap) *dr_chain,
unsigned int length,
- tree stmt,
- block_stmt_iterator *bsi,
+ gimple stmt,
+ gimple_stmt_iterator *gsi,
VEC(tree,heap) **result_chain)
{
- tree perm_dest, perm_stmt, vect1, vect2, high, low;
+ tree perm_dest, vect1, vect2, high, low;
+ gimple perm_stmt;
tree vectype = STMT_VINFO_VECTYPE (vinfo_for_stmt (stmt));
- tree scalar_dest, tmp;
+ tree scalar_dest;
int i;
unsigned int j;
+ enum tree_code high_code, low_code;
- scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
+ scalar_dest = gimple_assign_lhs (stmt);
/* Check that the operation is supported. */
if (!vect_strided_store_supported (vectype))
@@ -4639,13 +5053,20 @@ vect_permute_store_chain (VEC(tree,heap) *dr_chain,
DECL_GIMPLE_REG_P (perm_dest) = 1;
add_referenced_var (perm_dest);
if (BYTES_BIG_ENDIAN)
- tmp = build2 (VEC_INTERLEAVE_HIGH_EXPR, vectype, vect1, vect2);
+ {
+ high_code = VEC_INTERLEAVE_HIGH_EXPR;
+ low_code = VEC_INTERLEAVE_LOW_EXPR;
+ }
else
- tmp = build2 (VEC_INTERLEAVE_LOW_EXPR, vectype, vect1, vect2);
- perm_stmt = build_gimple_modify_stmt (perm_dest, tmp);
+ {
+ low_code = VEC_INTERLEAVE_HIGH_EXPR;
+ high_code = VEC_INTERLEAVE_LOW_EXPR;
+ }
+ perm_stmt = gimple_build_assign_with_ops (high_code, perm_dest,
+ vect1, vect2);
high = make_ssa_name (perm_dest, perm_stmt);
- GIMPLE_STMT_OPERAND (perm_stmt, 0) = high;
- vect_finish_stmt_generation (stmt, perm_stmt, bsi);
+ gimple_assign_set_lhs (perm_stmt, high);
+ vect_finish_stmt_generation (stmt, perm_stmt, gsi);
VEC_replace (tree, *result_chain, 2*j, high);
/* Create interleaving stmt:
@@ -4656,14 +5077,11 @@ vect_permute_store_chain (VEC(tree,heap) *dr_chain,
perm_dest = create_tmp_var (vectype, "vect_inter_low");
DECL_GIMPLE_REG_P (perm_dest) = 1;
add_referenced_var (perm_dest);
- if (BYTES_BIG_ENDIAN)
- tmp = build2 (VEC_INTERLEAVE_LOW_EXPR, vectype, vect1, vect2);
- else
- tmp = build2 (VEC_INTERLEAVE_HIGH_EXPR, vectype, vect1, vect2);
- perm_stmt = build_gimple_modify_stmt (perm_dest, tmp);
+ perm_stmt = gimple_build_assign_with_ops (low_code, perm_dest,
+ vect1, vect2);
low = make_ssa_name (perm_dest, perm_stmt);
- GIMPLE_STMT_OPERAND (perm_stmt, 0) = low;
- vect_finish_stmt_generation (stmt, perm_stmt, bsi);
+ gimple_assign_set_lhs (perm_stmt, low);
+ vect_finish_stmt_generation (stmt, perm_stmt, gsi);
VEC_replace (tree, *result_chain, 2*j+1, low);
}
dr_chain = VEC_copy (tree, heap, *result_chain);
@@ -4681,7 +5099,7 @@ vect_permute_store_chain (VEC(tree,heap) *dr_chain,
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
bool
-vectorizable_store (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
+vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
slp_tree slp_node)
{
tree scalar_dest;
@@ -4696,14 +5114,15 @@ vectorizable_store (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
enum machine_mode vec_mode;
tree dummy;
enum dr_alignment_support alignment_support_scheme;
- tree def, def_stmt;
+ tree def;
+ gimple def_stmt;
enum vect_def_type dt;
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;
- tree next_stmt, first_stmt = NULL_TREE;
+ gimple next_stmt, first_stmt = NULL;
bool strided_store = false;
unsigned int group_size, i;
VEC(tree,heap) *dr_chain = NULL, *oprnds = NULL, *result_chain = NULL;
@@ -4713,10 +5132,13 @@ vectorizable_store (tree stmt, block_stmt_iterator *bsi, tree *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);
@@ -4736,16 +5158,17 @@ vectorizable_store (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
/* Is vectorizable store? */
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_assign (stmt))
return false;
- scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
+ scalar_dest = gimple_assign_lhs (stmt);
if (TREE_CODE (scalar_dest) != ARRAY_REF
&& TREE_CODE (scalar_dest) != INDIRECT_REF
&& !STMT_VINFO_STRIDED_ACCESS (stmt_info))
return false;
- op = GIMPLE_STMT_OPERAND (stmt, 1);
+ gcc_assert (gimple_assign_single_p (stmt));
+ op = gimple_assign_rhs1 (stmt);
if (!vect_is_simple_use (op, loop_vinfo, &def_stmt, &def, &dt))
{
if (vect_print_dump_info (REPORT_DETAILS))
@@ -4795,7 +5218,8 @@ vectorizable_store (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
next_stmt = DR_GROUP_NEXT_DR (stmt_info);
while (next_stmt)
{
- op = GIMPLE_STMT_OPERAND (next_stmt, 1);
+ gcc_assert (gimple_assign_single_p (next_stmt));
+ op = gimple_assign_rhs1 (next_stmt);
if (!vect_is_simple_use (op, loop_vinfo, &def_stmt, &def, &dt))
{
if (vect_print_dump_info (REPORT_DETAILS))
@@ -4810,8 +5234,7 @@ vectorizable_store (tree stmt, block_stmt_iterator *bsi, tree *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;
}
@@ -4833,7 +5256,7 @@ vectorizable_store (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
< DR_GROUP_SIZE (vinfo_for_stmt (first_stmt))
&& !slp)
{
- *vec_stmt = NULL_TREE;
+ *vec_stmt = NULL;
return true;
}
@@ -4841,7 +5264,7 @@ vectorizable_store (tree stmt, block_stmt_iterator *bsi, tree *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;
@@ -4906,8 +5329,8 @@ vectorizable_store (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
prev_stmt_info = NULL;
for (j = 0; j < ncopies; j++)
{
- tree new_stmt;
- tree ptr_incr;
+ gimple new_stmt;
+ gimple ptr_incr;
if (j == 0)
{
@@ -4936,7 +5359,8 @@ vectorizable_store (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
there is no interleaving, GROUP_SIZE is 1, and only one
iteration of the loop will be executed. */
gcc_assert (next_stmt);
- op = GIMPLE_STMT_OPERAND (next_stmt, 1);
+ gcc_assert (gimple_assign_single_p (next_stmt));
+ op = gimple_assign_rhs1 (next_stmt);
vec_oprnd = vect_get_vec_def_for_operand (op, next_stmt,
NULL);
@@ -4953,9 +5377,6 @@ vectorizable_store (tree stmt, block_stmt_iterator *bsi, tree *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(),
@@ -4972,14 +5393,14 @@ vectorizable_store (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
VEC_replace(tree, oprnds, i, vec_oprnd);
}
dataref_ptr =
- bump_vector_ptr (dataref_ptr, ptr_incr, bsi, stmt, NULL_TREE);
+ bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt, NULL_TREE);
}
if (strided_store)
{
result_chain = VEC_alloc (tree, heap, group_size);
/* Permute. */
- if (!vect_permute_store_chain (dr_chain, group_size, stmt, bsi,
+ if (!vect_permute_store_chain (dr_chain, group_size, stmt, gsi,
&result_chain))
return false;
}
@@ -4989,7 +5410,7 @@ vectorizable_store (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
{
if (i > 0)
/* Bump the vector pointer. */
- dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, bsi, stmt,
+ dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt,
NULL_TREE);
if (slp)
@@ -5001,9 +5422,12 @@ vectorizable_store (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
data_ref = build_fold_indirect_ref (dataref_ptr);
/* Arguments are ready. Create the new vector stmt. */
- new_stmt = build_gimple_modify_stmt (data_ref, vec_oprnd);
- vect_finish_stmt_generation (stmt, new_stmt, bsi);
+ 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;
@@ -5078,7 +5502,7 @@ vectorizable_store (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
Return value - the result of the loop-header phi node. */
static tree
-vect_setup_realignment (tree stmt, block_stmt_iterator *bsi,
+vect_setup_realignment (gimple stmt, gimple_stmt_iterator *gsi,
tree *realignment_token,
enum dr_alignment_support alignment_support_scheme,
tree init_addr,
@@ -5089,22 +5513,22 @@ vect_setup_realignment (tree stmt, block_stmt_iterator *bsi,
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
edge pe;
- tree scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
+ tree scalar_dest = gimple_assign_lhs (stmt);
tree vec_dest;
- tree inc;
+ gimple inc;
tree ptr;
tree data_ref;
- tree new_stmt;
+ gimple new_stmt;
basic_block new_bb;
tree msq_init = NULL_TREE;
tree new_temp;
- tree phi_stmt;
+ gimple phi_stmt;
tree msq = NULL_TREE;
- tree stmts = NULL_TREE;
+ gimple_seq stmts = NULL;
bool inv_p;
bool compute_in_loop = false;
bool nested_in_vect_loop = nested_in_vect_loop_p (loop, stmt);
- struct loop *containing_loop = (bb_for_stmt (stmt))->loop_father;
+ struct loop *containing_loop = (gimple_bb (stmt))->loop_father;
struct loop *loop_for_initial_load;
gcc_assert (alignment_support_scheme == dr_explicit_realign
@@ -5188,13 +5612,13 @@ vect_setup_realignment (tree stmt, block_stmt_iterator *bsi,
ptr = vect_create_data_ref_ptr (stmt, loop_for_initial_load, NULL_TREE,
&init_addr, &inc, true, &inv_p);
data_ref = build1 (ALIGN_INDIRECT_REF, vectype, ptr);
- new_stmt = build_gimple_modify_stmt (vec_dest, data_ref);
+ new_stmt = gimple_build_assign (vec_dest, data_ref);
new_temp = make_ssa_name (vec_dest, new_stmt);
- GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
+ gimple_assign_set_lhs (new_stmt, new_temp);
mark_symbols_for_renaming (new_stmt);
- new_bb = bsi_insert_on_edge_immediate (pe, new_stmt);
+ new_bb = gsi_insert_on_edge_immediate (pe, new_stmt);
gcc_assert (!new_bb);
- msq_init = GIMPLE_STMT_OPERAND (new_stmt, 0);
+ msq_init = gimple_assign_lhs (new_stmt);
}
/* 4. Create realignment token using a target builtin, if available.
@@ -5214,29 +5638,29 @@ vect_setup_realignment (tree stmt, block_stmt_iterator *bsi,
init_addr = vect_create_addr_base_for_vector_ref (stmt, &stmts,
NULL_TREE, loop);
pe = loop_preheader_edge (loop);
- new_bb = bsi_insert_on_edge_immediate (pe, stmts);
+ new_bb = gsi_insert_seq_on_edge_immediate (pe, stmts);
gcc_assert (!new_bb);
}
builtin_decl = targetm.vectorize.builtin_mask_for_load ();
- new_stmt = build_call_expr (builtin_decl, 1, init_addr);
- vec_dest = vect_create_destination_var (scalar_dest,
- TREE_TYPE (new_stmt));
- new_stmt = build_gimple_modify_stmt (vec_dest, new_stmt);
+ new_stmt = gimple_build_call (builtin_decl, 1, init_addr);
+ vec_dest =
+ vect_create_destination_var (scalar_dest,
+ gimple_call_return_type (new_stmt));
new_temp = make_ssa_name (vec_dest, new_stmt);
- GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
+ gimple_call_set_lhs (new_stmt, new_temp);
if (compute_in_loop)
- bsi_insert_before (bsi, new_stmt, BSI_SAME_STMT);
+ gsi_insert_before (gsi, new_stmt, GSI_SAME_STMT);
else
{
/* Generate the misalignment computation outside LOOP. */
pe = loop_preheader_edge (loop);
- new_bb = bsi_insert_on_edge_immediate (pe, new_stmt);
+ new_bb = gsi_insert_on_edge_immediate (pe, new_stmt);
gcc_assert (!new_bb);
}
- *realignment_token = GIMPLE_STMT_OPERAND (new_stmt, 0);
+ *realignment_token = gimple_call_lhs (new_stmt);
/* The result of the CALL_EXPR to this builtin is determined from
the value of the parameter and no global variables are touched
@@ -5257,7 +5681,7 @@ vect_setup_realignment (tree stmt, block_stmt_iterator *bsi,
pe = loop_preheader_edge (containing_loop);
vec_dest = vect_create_destination_var (scalar_dest, vectype);
- msq = make_ssa_name (vec_dest, NULL_TREE);
+ msq = make_ssa_name (vec_dest, NULL);
phi_stmt = create_phi_node (msq, containing_loop->header);
SSA_NAME_DEF_STMT (msq) = phi_stmt;
add_phi_arg (phi_stmt, msq_init, pe);
@@ -5393,13 +5817,13 @@ vect_strided_load_supported (tree vectype)
static bool
vect_permute_load_chain (VEC(tree,heap) *dr_chain,
unsigned int length,
- tree stmt,
- block_stmt_iterator *bsi,
+ gimple stmt,
+ gimple_stmt_iterator *gsi,
VEC(tree,heap) **result_chain)
{
- tree perm_dest, perm_stmt, data_ref, first_vect, second_vect;
+ tree perm_dest, data_ref, first_vect, second_vect;
+ gimple perm_stmt;
tree vectype = STMT_VINFO_VECTYPE (vinfo_for_stmt (stmt));
- tree tmp;
int i;
unsigned int j;
@@ -5420,13 +5844,13 @@ vect_permute_load_chain (VEC(tree,heap) *dr_chain,
DECL_GIMPLE_REG_P (perm_dest) = 1;
add_referenced_var (perm_dest);
- tmp = build2 (VEC_EXTRACT_EVEN_EXPR, vectype,
- first_vect, second_vect);
- perm_stmt = build_gimple_modify_stmt (perm_dest, tmp);
+ perm_stmt = gimple_build_assign_with_ops (VEC_EXTRACT_EVEN_EXPR,
+ perm_dest, first_vect,
+ second_vect);
data_ref = make_ssa_name (perm_dest, perm_stmt);
- GIMPLE_STMT_OPERAND (perm_stmt, 0) = data_ref;
- vect_finish_stmt_generation (stmt, perm_stmt, bsi);
+ gimple_assign_set_lhs (perm_stmt, data_ref);
+ vect_finish_stmt_generation (stmt, perm_stmt, gsi);
mark_symbols_for_renaming (perm_stmt);
VEC_replace (tree, *result_chain, j/2, data_ref);
@@ -5436,12 +5860,12 @@ vect_permute_load_chain (VEC(tree,heap) *dr_chain,
DECL_GIMPLE_REG_P (perm_dest) = 1;
add_referenced_var (perm_dest);
- tmp = build2 (VEC_EXTRACT_ODD_EXPR, vectype,
- first_vect, second_vect);
- perm_stmt = build_gimple_modify_stmt (perm_dest, tmp);
+ perm_stmt = gimple_build_assign_with_ops (VEC_EXTRACT_ODD_EXPR,
+ perm_dest, first_vect,
+ second_vect);
data_ref = make_ssa_name (perm_dest, perm_stmt);
- GIMPLE_STMT_OPERAND (perm_stmt, 0) = data_ref;
- vect_finish_stmt_generation (stmt, perm_stmt, bsi);
+ gimple_assign_set_lhs (perm_stmt, data_ref);
+ vect_finish_stmt_generation (stmt, perm_stmt, gsi);
mark_symbols_for_renaming (perm_stmt);
VEC_replace (tree, *result_chain, j/2+length/2, data_ref);
@@ -5460,12 +5884,12 @@ vect_permute_load_chain (VEC(tree,heap) *dr_chain,
*/
static bool
-vect_transform_strided_load (tree stmt, VEC(tree,heap) *dr_chain, int size,
- block_stmt_iterator *bsi)
+vect_transform_strided_load (gimple stmt, VEC(tree,heap) *dr_chain, int size,
+ gimple_stmt_iterator *gsi)
{
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- tree first_stmt = DR_GROUP_FIRST_DR (stmt_info);
- tree next_stmt, new_stmt;
+ gimple first_stmt = DR_GROUP_FIRST_DR (stmt_info);
+ gimple next_stmt, new_stmt;
VEC(tree,heap) *result_chain = NULL;
unsigned int i, gap_count;
tree tmp_data_ref;
@@ -5475,7 +5899,7 @@ vect_transform_strided_load (tree stmt, VEC(tree,heap) *dr_chain, int size,
vectors, that are ready for vector computation. */
result_chain = VEC_alloc (tree, heap, size);
/* Permute. */
- if (!vect_permute_load_chain (dr_chain, size, stmt, bsi, &result_chain))
+ if (!vect_permute_load_chain (dr_chain, size, stmt, gsi, &result_chain))
return false;
/* Put a permuted data-ref in the VECTORIZED_STMT field.
@@ -5512,9 +5936,10 @@ vect_transform_strided_load (tree stmt, VEC(tree,heap) *dr_chain, int size,
STMT_VINFO_VEC_STMT (vinfo_for_stmt (next_stmt)) = new_stmt;
else
{
- tree prev_stmt = STMT_VINFO_VEC_STMT (vinfo_for_stmt (next_stmt));
- tree rel_stmt = STMT_VINFO_RELATED_STMT (
- vinfo_for_stmt (prev_stmt));
+ gimple prev_stmt =
+ STMT_VINFO_VEC_STMT (vinfo_for_stmt (next_stmt));
+ gimple rel_stmt =
+ STMT_VINFO_RELATED_STMT (vinfo_for_stmt (prev_stmt));
while (rel_stmt)
{
prev_stmt = rel_stmt;
@@ -5537,6 +5962,313 @@ vect_transform_strided_load (tree stmt, VEC(tree,heap) *dr_chain, int size,
}
+/* Create NCOPIES permutation statements using the mask MASK_BYTES (by
+ building a vector of type MASK_TYPE from it) and two input vectors placed in
+ DR_CHAIN at FIRST_VEC_INDX and SECOND_VEC_INDX for the first copy and
+ shifting by STRIDE elements of DR_CHAIN for every copy.
+ (STRIDE is the number of vectorized stmts for NODE divided by the number of
+ copies).
+ VECT_STMTS_COUNTER specifies the index in the vectorized stmts of NODE, where
+ the created stmts must be inserted. */
+
+static inline void
+vect_create_mask_and_perm (gimple stmt, gimple next_scalar_stmt,
+ int *mask_array, int mask_nunits,
+ tree mask_element_type, tree mask_type,
+ int first_vec_indx, int second_vec_indx,
+ gimple_stmt_iterator *gsi, slp_tree node,
+ tree builtin_decl, tree vectype,
+ VEC(tree,heap) *dr_chain,
+ int ncopies, int vect_stmts_counter)
+{
+ tree t = NULL_TREE, mask_vec, mask, perm_dest;
+ gimple perm_stmt = NULL;
+ stmt_vec_info next_stmt_info;
+ int i, group_size, stride, dr_chain_size;
+ tree first_vec, second_vec, data_ref;
+ tree sym;
+ ssa_op_iter iter;
+ VEC (tree, heap) *params = NULL;
+
+ /* Create a vector mask. */
+ for (i = mask_nunits - 1; i >= 0; --i)
+ t = tree_cons (NULL_TREE, build_int_cst (mask_element_type, mask_array[i]),
+ t);
+
+ mask_vec = build_vector (mask_type, t);
+ mask = vect_init_vector (stmt, mask_vec, mask_type, NULL);
+
+ group_size = VEC_length (gimple, SLP_TREE_SCALAR_STMTS (node));
+ stride = SLP_TREE_NUMBER_OF_VEC_STMTS (node) / ncopies;
+ dr_chain_size = VEC_length (tree, dr_chain);
+
+ /* Initialize the vect stmts of NODE to properly insert the generated
+ stmts later. */
+ for (i = VEC_length (gimple, SLP_TREE_VEC_STMTS (node));
+ i < (int) SLP_TREE_NUMBER_OF_VEC_STMTS (node); i++)
+ VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (node), NULL);
+
+ perm_dest = vect_create_destination_var (gimple_assign_lhs (stmt), vectype);
+ for (i = 0; i < ncopies; i++)
+ {
+ first_vec = VEC_index (tree, dr_chain, first_vec_indx);
+ second_vec = VEC_index (tree, dr_chain, second_vec_indx);
+
+ /* Build argument list for the vectorized call. */
+ VEC_free (tree, heap, params);
+ params = VEC_alloc (tree, heap, 3);
+ VEC_quick_push (tree, params, first_vec);
+ VEC_quick_push (tree, params, second_vec);
+ VEC_quick_push (tree, params, mask);
+
+ /* Generate the permute statement. */
+ perm_stmt = gimple_build_call_vec (builtin_decl, params);
+ data_ref = make_ssa_name (perm_dest, perm_stmt);
+ gimple_call_set_lhs (perm_stmt, data_ref);
+ vect_finish_stmt_generation (stmt, perm_stmt, gsi);
+ FOR_EACH_SSA_TREE_OPERAND (sym, perm_stmt, iter, SSA_OP_ALL_VIRTUALS)
+ {
+ if (TREE_CODE (sym) == SSA_NAME)
+ sym = SSA_NAME_VAR (sym);
+ mark_sym_for_renaming (sym);
+ }
+
+ /* Store the vector statement in NODE. */
+ VEC_replace (gimple, SLP_TREE_VEC_STMTS (node),
+ stride * i + vect_stmts_counter, perm_stmt);
+
+ first_vec_indx += stride;
+ second_vec_indx += stride;
+ }
+
+ /* Mark the scalar stmt as vectorized. */
+ next_stmt_info = vinfo_for_stmt (next_scalar_stmt);
+ STMT_VINFO_VEC_STMT (next_stmt_info) = perm_stmt;
+}
+
+
+/* Given FIRST_MASK_ELEMENT - the mask element in element representation,
+ return in CURRENT_MASK_ELEMENT its equivalent in target specific
+ representation. Check that the mask is valid and return FALSE if not.
+ Return TRUE in NEED_NEXT_VECTOR if the permutation requires to move to
+ the next vector, i.e., the current first vector is not needed. */
+
+static bool
+vect_get_mask_element (gimple stmt, int first_mask_element, int m,
+ int mask_nunits, bool only_one_vec, int index,
+ int *mask, int *current_mask_element,
+ bool *need_next_vector)
+{
+ int i;
+ static int number_of_mask_fixes = 1;
+ static bool mask_fixed = false;
+ static bool needs_first_vector = false;
+
+ /* Convert to target specific representation. */
+ *current_mask_element = first_mask_element + m;
+ /* Adjust the value in case it's a mask for second and third vectors. */
+ *current_mask_element -= mask_nunits * (number_of_mask_fixes - 1);
+
+ if (*current_mask_element < mask_nunits)
+ needs_first_vector = true;
+
+ /* We have only one input vector to permute but the mask accesses values in
+ the next vector as well. */
+ if (only_one_vec && *current_mask_element >= mask_nunits)
+ {
+ if (vect_print_dump_info (REPORT_DETAILS))
+ {
+ fprintf (vect_dump, "permutation requires at least two vectors ");
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
+ }
+
+ return false;
+ }
+
+ /* The mask requires the next vector. */
+ if (*current_mask_element >= mask_nunits * 2)
+ {
+ if (needs_first_vector || mask_fixed)
+ {
+ /* We either need the first vector too or have already moved to the
+ next vector. In both cases, this permutation needs three
+ vectors. */
+ if (vect_print_dump_info (REPORT_DETAILS))
+ {
+ fprintf (vect_dump, "permutation requires at "
+ "least three vectors ");
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
+ }
+
+ return false;
+ }
+
+ /* We move to the next vector, dropping the first one and working with
+ the second and the third - we need to adjust the values of the mask
+ accordingly. */
+ *current_mask_element -= mask_nunits * number_of_mask_fixes;
+
+ for (i = 0; i < index; i++)
+ mask[i] -= mask_nunits * number_of_mask_fixes;
+
+ (number_of_mask_fixes)++;
+ mask_fixed = true;
+ }
+
+ *need_next_vector = mask_fixed;
+
+ /* This was the last element of this mask. Start a new one. */
+ if (index == mask_nunits - 1)
+ {
+ number_of_mask_fixes = 1;
+ mask_fixed = false;
+ needs_first_vector = false;
+ }
+
+ return true;
+}
+
+
+/* Generate vector permute statements from a list of loads in DR_CHAIN.
+ If ANALYZE_ONLY is TRUE, only check that it is possible to create valid
+ permute statements for SLP_NODE_INSTANCE. */
+bool
+vect_transform_slp_perm_load (gimple stmt, VEC (tree, heap) *dr_chain,
+ gimple_stmt_iterator *gsi, int vf,
+ slp_instance slp_node_instance, bool analyze_only)
+{
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+ tree mask_element_type = NULL_TREE, mask_type;
+ int i, j, k, m, scale, mask_nunits, nunits, vec_index = 0, scalar_index;
+ slp_tree node;
+ tree vectype = STMT_VINFO_VECTYPE (stmt_info), builtin_decl;
+ gimple next_scalar_stmt;
+ int group_size = SLP_INSTANCE_GROUP_SIZE (slp_node_instance);
+ int first_mask_element;
+ int index, unroll_factor, *mask, current_mask_element, ncopies;
+ bool only_one_vec = false, need_next_vector = false;
+ int first_vec_index, second_vec_index, orig_vec_stmts_num, vect_stmts_counter;
+
+ if (!targetm.vectorize.builtin_vec_perm)
+ {
+ if (vect_print_dump_info (REPORT_DETAILS))
+ {
+ fprintf (vect_dump, "no builtin for vect permute for ");
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
+ }
+
+ return false;
+ }
+
+ builtin_decl = targetm.vectorize.builtin_vec_perm (vectype,
+ &mask_element_type);
+ if (!builtin_decl || !mask_element_type)
+ {
+ if (vect_print_dump_info (REPORT_DETAILS))
+ {
+ fprintf (vect_dump, "no builtin for vect permute for ");
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
+ }
+
+ return false;
+ }
+
+ mask_type = get_vectype_for_scalar_type (mask_element_type);
+ mask_nunits = TYPE_VECTOR_SUBPARTS (mask_type);
+ mask = (int *) xmalloc (sizeof (int) * mask_nunits);
+ nunits = TYPE_VECTOR_SUBPARTS (vectype);
+ scale = mask_nunits / nunits;
+ unroll_factor = SLP_INSTANCE_UNROLLING_FACTOR (slp_node_instance);
+
+ /* The number of vector stmts to generate based only on SLP_NODE_INSTANCE
+ unrolling factor. */
+ orig_vec_stmts_num = group_size *
+ SLP_INSTANCE_UNROLLING_FACTOR (slp_node_instance) / nunits;
+ if (orig_vec_stmts_num == 1)
+ only_one_vec = true;
+
+ /* Number of copies is determined by the final vectorization factor
+ relatively to SLP_NODE_INSTANCE unrolling factor. */
+ ncopies = vf / SLP_INSTANCE_UNROLLING_FACTOR (slp_node_instance);
+
+ /* Generate permutation masks for every NODE. Number of masks for each NODE
+ is equal to GROUP_SIZE.
+ E.g., we have a group of three nodes with three loads from the same
+ location in each node, and the vector size is 4. I.e., we have a
+ a0b0c0a1b1c1... sequence and we need to create the following vectors:
+ for a's: a0a0a0a1 a1a1a2a2 a2a3a3a3
+ for b's: b0b0b0b1 b1b1b2b2 b2b3b3b3
+ ...
+
+ The masks for a's should be: {0,0,0,3} {3,3,6,6} {6,9,9,9} (in target
+ scpecific type, e.g., in bytes for Altivec.
+ The last mask is illegal since we assume two operands for permute
+ operation, and the mask element values can't be outside that range. Hence,
+ the last mask must be converted into {2,5,5,5}.
+ For the first two permutations we need the first and the second input
+ vectors: {a0,b0,c0,a1} and {b1,c1,a2,b2}, and for the last permutation
+ we need the second and the third vectors: {b1,c1,a2,b2} and
+ {c2,a3,b3,c3}. */
+
+ for (i = 0;
+ VEC_iterate (slp_tree, SLP_INSTANCE_LOADS (slp_node_instance),
+ i, node);
+ i++)
+ {
+ scalar_index = 0;
+ index = 0;
+ vect_stmts_counter = 0;
+ vec_index = 0;
+ first_vec_index = vec_index++;
+ if (only_one_vec)
+ second_vec_index = first_vec_index;
+ else
+ second_vec_index = vec_index++;
+
+ for (j = 0; j < unroll_factor; j++)
+ {
+ for (k = 0; k < group_size; k++)
+ {
+ first_mask_element = (i + j * group_size) * scale;
+ for (m = 0; m < scale; m++)
+ {
+ if (!vect_get_mask_element (stmt, first_mask_element, m,
+ mask_nunits, only_one_vec, index, mask,
+ &current_mask_element, &need_next_vector))
+ return false;
+
+ mask[index++] = current_mask_element;
+ }
+
+ if (index == mask_nunits)
+ {
+ index = 0;
+ if (!analyze_only)
+ {
+ if (need_next_vector)
+ {
+ first_vec_index = second_vec_index;
+ second_vec_index = vec_index;
+ }
+
+ next_scalar_stmt = VEC_index (gimple,
+ SLP_TREE_SCALAR_STMTS (node), scalar_index++);
+
+ vect_create_mask_and_perm (stmt, next_scalar_stmt,
+ mask, mask_nunits, mask_element_type, mask_type,
+ first_vec_index, second_vec_index, gsi, node,
+ builtin_decl, vectype, dr_chain, ncopies,
+ vect_stmts_counter++);
+ }
+ }
+ }
+ }
+ }
+
+ free (mask);
+ return true;
+}
+
/* vectorizable_load.
Check if STMT reads a non scalar data-ref (array/pointer/structure) that
@@ -5546,49 +6278,53 @@ vect_transform_strided_load (tree stmt, VEC(tree,heap) *dr_chain, int size,
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
bool
-vectorizable_load (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
- slp_tree slp_node)
+vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
+ slp_tree slp_node, slp_instance slp_node_instance)
{
tree scalar_dest;
tree vec_dest = NULL;
tree data_ref = NULL;
- tree op;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
stmt_vec_info prev_stmt_info;
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- struct loop *containing_loop = (bb_for_stmt (stmt))->loop_father;
+ struct loop *containing_loop = (gimple_bb (stmt))->loop_father;
bool nested_in_vect_loop = nested_in_vect_loop_p (loop, stmt);
struct data_reference *dr = STMT_VINFO_DATA_REF (stmt_info), *first_dr;
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
tree new_temp;
int mode;
- tree new_stmt = NULL_TREE;
+ gimple new_stmt = NULL;
tree dummy;
enum dr_alignment_support alignment_support_scheme;
tree dataref_ptr = NULL_TREE;
- tree ptr_incr;
+ 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;
tree realignment_token = NULL_TREE;
- tree phi = NULL_TREE;
+ gimple phi = NULL;
VEC(tree,heap) *dr_chain = NULL;
bool strided_load = false;
- tree first_stmt;
+ gimple first_stmt;
tree scalar_type;
bool inv_p;
bool compute_in_loop = false;
struct loop *at_loop;
int vec_num;
bool slp = (slp_node != NULL);
+ bool slp_perm = false;
+ 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);
@@ -5600,6 +6336,9 @@ vectorizable_load (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
return false;
}
+ if (slp && SLP_INSTANCE_LOAD_PERMUTATION (slp_node_instance))
+ slp_perm = true;
+
if (!STMT_VINFO_RELEVANT_P (stmt_info))
return false;
@@ -5607,16 +6346,16 @@ vectorizable_load (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
return false;
/* Is vectorizable load? */
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_assign (stmt))
return false;
- scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
+ scalar_dest = gimple_assign_lhs (stmt);
if (TREE_CODE (scalar_dest) != SSA_NAME)
return false;
- op = GIMPLE_STMT_OPERAND (stmt, 1);
- if (TREE_CODE (op) != ARRAY_REF
- && TREE_CODE (op) != INDIRECT_REF
+ code = gimple_assign_rhs_code (stmt);
+ if (code != ARRAY_REF
+ && code != INDIRECT_REF
&& !STMT_VINFO_STRIDED_ACCESS (stmt_info))
return false;
@@ -5682,7 +6421,6 @@ vectorizable_load (tree stmt, block_stmt_iterator *bsi, tree *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)
@@ -5692,6 +6430,8 @@ vectorizable_load (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
}
else
vec_num = group_size;
+
+ dr_chain = VEC_alloc (tree, heap, vec_num);
}
else
{
@@ -5818,7 +6558,7 @@ vectorizable_load (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
|| alignment_support_scheme == dr_explicit_realign)
&& !compute_in_loop)
{
- msq = vect_setup_realignment (first_stmt, bsi, &realignment_token,
+ msq = vect_setup_realignment (first_stmt, gsi, &realignment_token,
alignment_support_scheme, NULL_TREE,
&at_loop);
if (alignment_support_scheme == dr_explicit_realign_optimized)
@@ -5841,12 +6581,12 @@ vectorizable_load (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
&inv_p);
else
dataref_ptr =
- bump_vector_ptr (dataref_ptr, ptr_incr, bsi, stmt, NULL_TREE);
+ bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt, NULL_TREE);
for (i = 0; i < vec_num; i++)
{
if (i > 0)
- dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, bsi, stmt,
+ dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt,
NULL_TREE);
/* 2. Create the vector-load in the loop. */
@@ -5872,24 +6612,24 @@ vectorizable_load (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
tree vs_minus_1 = size_int (TYPE_VECTOR_SUBPARTS (vectype) - 1);
if (compute_in_loop)
- msq = vect_setup_realignment (first_stmt, bsi,
+ msq = vect_setup_realignment (first_stmt, gsi,
&realignment_token,
dr_explicit_realign,
dataref_ptr, NULL);
data_ref = build1 (ALIGN_INDIRECT_REF, vectype, dataref_ptr);
vec_dest = vect_create_destination_var (scalar_dest, vectype);
- new_stmt = build_gimple_modify_stmt (vec_dest, data_ref);
+ new_stmt = gimple_build_assign (vec_dest, data_ref);
new_temp = make_ssa_name (vec_dest, new_stmt);
- GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
- vect_finish_stmt_generation (stmt, new_stmt, bsi);
+ gimple_assign_set_lhs (new_stmt, new_temp);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
copy_virtual_operands (new_stmt, stmt);
mark_symbols_for_renaming (new_stmt);
msq = new_temp;
bump = size_binop (MULT_EXPR, vs_minus_1,
TYPE_SIZE_UNIT (scalar_type));
- ptr = bump_vector_ptr (dataref_ptr, NULL_TREE, bsi, stmt, bump);
+ ptr = bump_vector_ptr (dataref_ptr, NULL, gsi, stmt, bump);
data_ref = build1 (ALIGN_INDIRECT_REF, vectype, ptr);
break;
}
@@ -5900,10 +6640,10 @@ vectorizable_load (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
gcc_unreachable ();
}
vec_dest = vect_create_destination_var (scalar_dest, vectype);
- new_stmt = build_gimple_modify_stmt (vec_dest, data_ref);
+ new_stmt = gimple_build_assign (vec_dest, data_ref);
new_temp = make_ssa_name (vec_dest, new_stmt);
- GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
- vect_finish_stmt_generation (stmt, new_stmt, bsi);
+ gimple_assign_set_lhs (new_stmt, new_temp);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
mark_symbols_for_renaming (new_stmt);
/* 3. Handle explicit realignment if necessary/supported. Create in
@@ -5911,19 +6651,22 @@ vectorizable_load (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
if (alignment_support_scheme == dr_explicit_realign_optimized
|| alignment_support_scheme == dr_explicit_realign)
{
- lsq = GIMPLE_STMT_OPERAND (new_stmt, 0);
+ tree tmp;
+
+ lsq = gimple_assign_lhs (new_stmt);
if (!realignment_token)
realignment_token = dataref_ptr;
vec_dest = vect_create_destination_var (scalar_dest, vectype);
- new_stmt = build3 (REALIGN_LOAD_EXPR, vectype, msq, lsq,
- realignment_token);
- new_stmt = build_gimple_modify_stmt (vec_dest, new_stmt);
+ tmp = build3 (REALIGN_LOAD_EXPR, vectype, msq, lsq,
+ realignment_token);
+ new_stmt = gimple_build_assign (vec_dest, tmp);
new_temp = make_ssa_name (vec_dest, new_stmt);
- GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
- vect_finish_stmt_generation (stmt, new_stmt, bsi);
+ gimple_assign_set_lhs (new_stmt, new_temp);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
if (alignment_support_scheme == dr_explicit_realign_optimized)
{
+ gcc_assert (phi);
if (i == vec_num - 1 && j == ncopies - 1)
add_phi_arg (phi, lsq, loop_latch_edge (containing_loop));
msq = lsq;
@@ -5944,19 +6687,19 @@ vectorizable_load (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
/* CHECKME: bitpos depends on endianess? */
bitpos = bitsize_zero_node;
vec_inv = build3 (BIT_FIELD_REF, scalar_type, new_temp,
- bitsize, bitpos);
+ bitsize, bitpos);
vec_dest =
vect_create_destination_var (scalar_dest, NULL_TREE);
- new_stmt = build_gimple_modify_stmt (vec_dest, vec_inv);
+ new_stmt = gimple_build_assign (vec_dest, vec_inv);
new_temp = make_ssa_name (vec_dest, new_stmt);
- GIMPLE_STMT_OPERAND (new_stmt, 0) = new_temp;
- vect_finish_stmt_generation (stmt, new_stmt, bsi);
+ gimple_assign_set_lhs (new_stmt, new_temp);
+ vect_finish_stmt_generation (stmt, new_stmt, gsi);
for (k = nunits - 1; k >= 0; --k)
t = tree_cons (NULL_TREE, new_temp, t);
/* FIXME: use build_constructor directly. */
vec_inv = build_constructor_from_list (vectype, t);
- new_temp = vect_init_vector (stmt, vec_inv, vectype, bsi);
+ new_temp = vect_init_vector (stmt, vec_inv, vectype, gsi);
new_stmt = SSA_NAME_DEF_STMT (new_temp);
}
else
@@ -5965,34 +6708,47 @@ vectorizable_load (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
/* Collect vector loads and later create their permutation in
vect_transform_strided_load (). */
- if (strided_load)
+ if (strided_load || slp_perm)
VEC_quick_push (tree, dr_chain, new_temp);
/* Store vector loads in the corresponding SLP_NODE. */
- if (slp)
- VEC_quick_push (tree, SLP_TREE_VEC_STMTS (slp_node), new_stmt);
+ if (slp && !slp_perm)
+ VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (slp_node), new_stmt);
}
- /* FORNOW: SLP with multiple types is unsupported. */
- if (slp)
- return true;
+ if (slp && !slp_perm)
+ continue;
- if (strided_load)
- {
- if (!vect_transform_strided_load (stmt, dr_chain, group_size, bsi))
- return false;
- *vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
- VEC_free (tree, heap, dr_chain);
- dr_chain = VEC_alloc (tree, heap, group_size);
- }
+ if (slp_perm)
+ {
+ if (!vect_transform_slp_perm_load (stmt, dr_chain, gsi,
+ LOOP_VINFO_VECT_FACTOR (loop_vinfo),
+ slp_node_instance, false))
+ {
+ VEC_free (tree, heap, dr_chain);
+ return false;
+ }
+ }
else
- {
- if (j == 0)
- STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
- else
- STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
- prev_stmt_info = vinfo_for_stmt (new_stmt);
- }
+ {
+ if (strided_load)
+ {
+ if (!vect_transform_strided_load (stmt, dr_chain, group_size, gsi))
+ return false;
+
+ *vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
+ VEC_free (tree, heap, dr_chain);
+ dr_chain = VEC_alloc (tree, heap, group_size);
+ }
+ else
+ {
+ if (j == 0)
+ STMT_VINFO_VEC_STMT (stmt_info) = *vec_stmt = new_stmt;
+ else
+ STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt;
+ prev_stmt_info = vinfo_for_stmt (new_stmt);
+ }
+ }
}
if (dr_chain)
@@ -6008,37 +6764,42 @@ vectorizable_load (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt,
it can be supported. */
bool
-vectorizable_live_operation (tree stmt,
- block_stmt_iterator *bsi ATTRIBUTE_UNUSED,
- tree *vec_stmt ATTRIBUTE_UNUSED)
+vectorizable_live_operation (gimple stmt,
+ gimple_stmt_iterator *gsi ATTRIBUTE_UNUSED,
+ gimple *vec_stmt ATTRIBUTE_UNUSED)
{
- tree operation;
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);
int i;
int op_type;
tree op;
- tree def, def_stmt;
+ tree def;
+ gimple def_stmt;
enum vect_def_type dt;
+ enum tree_code code;
+ enum gimple_rhs_class rhs_class;
gcc_assert (STMT_VINFO_LIVE_P (stmt_info));
if (STMT_VINFO_DEF_TYPE (stmt_info) == vect_reduction_def)
return false;
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_assign (stmt))
return false;
- if (TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 0)) != SSA_NAME)
+ if (TREE_CODE (gimple_assign_lhs (stmt)) != SSA_NAME)
return false;
/* FORNOW. CHECKME. */
if (nested_in_vect_loop_p (loop, stmt))
return false;
- operation = GIMPLE_STMT_OPERAND (stmt, 1);
- op_type = TREE_OPERAND_LENGTH (operation);
+ code = gimple_assign_rhs_code (stmt);
+ op_type = TREE_CODE_LENGTH (code);
+ rhs_class = get_gimple_rhs_class (code);
+ gcc_assert (rhs_class != GIMPLE_UNARY_RHS || op_type == unary_op);
+ gcc_assert (rhs_class != GIMPLE_BINARY_RHS || op_type == binary_op);
/* FORNOW: support only if all uses are invariant. This means
that the scalar operations can remain in place, unvectorized.
@@ -6046,7 +6807,10 @@ vectorizable_live_operation (tree stmt,
for (i = 0; i < op_type; i++)
{
- op = TREE_OPERAND (operation, i);
+ if (rhs_class == GIMPLE_SINGLE_RHS)
+ op = TREE_OPERAND (gimple_op (stmt, 1), i);
+ else
+ op = gimple_op (stmt, i + 1);
if (op && !vect_is_simple_use (op, loop_vinfo, &def_stmt, &def, &dt))
{
if (vect_print_dump_info (REPORT_DETAILS))
@@ -6087,7 +6851,7 @@ vect_is_simple_cond (tree cond, loop_vec_info loop_vinfo)
if (TREE_CODE (lhs) == SSA_NAME)
{
- tree lhs_def_stmt = SSA_NAME_DEF_STMT (lhs);
+ gimple lhs_def_stmt = SSA_NAME_DEF_STMT (lhs);
if (!vect_is_simple_use (lhs, loop_vinfo, &lhs_def_stmt, &def, &dt))
return false;
}
@@ -6097,7 +6861,7 @@ vect_is_simple_cond (tree cond, loop_vec_info loop_vinfo)
if (TREE_CODE (rhs) == SSA_NAME)
{
- tree rhs_def_stmt = SSA_NAME_DEF_STMT (rhs);
+ gimple rhs_def_stmt = SSA_NAME_DEF_STMT (rhs);
if (!vect_is_simple_use (rhs, loop_vinfo, &rhs_def_stmt, &def, &dt))
return false;
}
@@ -6118,7 +6882,8 @@ vect_is_simple_cond (tree cond, loop_vec_info loop_vinfo)
Return FALSE if not a vectorizable STMT, TRUE otherwise. */
bool
-vectorizable_condition (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
+vectorizable_condition (gimple stmt, gimple_stmt_iterator *gsi,
+ gimple *vec_stmt)
{
tree scalar_dest = NULL_TREE;
tree vec_dest = NULL_TREE;
@@ -6135,6 +6900,7 @@ vectorizable_condition (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
enum vect_def_type dt;
int nunits = TYPE_VECTOR_SUBPARTS (vectype);
int ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits;
+ enum tree_code code;
gcc_assert (ncopies >= 1);
if (ncopies > 1)
@@ -6159,14 +6925,16 @@ vectorizable_condition (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
}
/* Is vectorizable conditional operation? */
- if (TREE_CODE (stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_assign (stmt))
return false;
- op = GIMPLE_STMT_OPERAND (stmt, 1);
+ code = gimple_assign_rhs_code (stmt);
- if (TREE_CODE (op) != COND_EXPR)
+ if (code != COND_EXPR)
return false;
+ gcc_assert (gimple_assign_single_p (stmt));
+ op = gimple_assign_rhs1 (stmt);
cond_expr = TREE_OPERAND (op, 0);
then_clause = TREE_OPERAND (op, 1);
else_clause = TREE_OPERAND (op, 2);
@@ -6181,7 +6949,7 @@ vectorizable_condition (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
if (TREE_CODE (then_clause) == SSA_NAME)
{
- tree then_def_stmt = SSA_NAME_DEF_STMT (then_clause);
+ gimple then_def_stmt = SSA_NAME_DEF_STMT (then_clause);
if (!vect_is_simple_use (then_clause, loop_vinfo,
&then_def_stmt, &def, &dt))
return false;
@@ -6193,7 +6961,7 @@ vectorizable_condition (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
if (TREE_CODE (else_clause) == SSA_NAME)
{
- tree else_def_stmt = SSA_NAME_DEF_STMT (else_clause);
+ gimple else_def_stmt = SSA_NAME_DEF_STMT (else_clause);
if (!vect_is_simple_use (else_clause, loop_vinfo,
&else_def_stmt, &def, &dt))
return false;
@@ -6215,7 +6983,7 @@ vectorizable_condition (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
/* Transform */
/* Handle def. */
- scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
+ scalar_dest = gimple_assign_lhs (stmt);
vec_dest = vect_create_destination_var (scalar_dest, vectype);
/* Handle cond expr. */
@@ -6232,10 +7000,10 @@ vectorizable_condition (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
vec_cond_expr = build3 (VEC_COND_EXPR, vectype,
vec_compare, vec_then_clause, vec_else_clause);
- *vec_stmt = build_gimple_modify_stmt (vec_dest, vec_cond_expr);
+ *vec_stmt = gimple_build_assign (vec_dest, vec_cond_expr);
new_temp = make_ssa_name (vec_dest, *vec_stmt);
- GIMPLE_STMT_OPERAND (*vec_stmt, 0) = new_temp;
- vect_finish_stmt_generation (stmt, *vec_stmt, bsi);
+ gimple_assign_set_lhs (*vec_stmt, new_temp);
+ vect_finish_stmt_generation (stmt, *vec_stmt, gsi);
return true;
}
@@ -6246,59 +7014,59 @@ vectorizable_condition (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
Create a vectorized stmt to replace STMT, and insert it at BSI. */
static bool
-vect_transform_stmt (tree stmt, block_stmt_iterator *bsi, bool *strided_store,
- slp_tree slp_node)
+vect_transform_stmt (gimple stmt, gimple_stmt_iterator *gsi,
+ bool *strided_store, slp_tree slp_node,
+ slp_instance slp_node_instance)
{
bool is_store = false;
- tree vec_stmt = NULL_TREE;
+ gimple vec_stmt = NULL;
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- tree orig_stmt_in_pattern;
+ gimple orig_stmt_in_pattern;
bool done;
switch (STMT_VINFO_TYPE (stmt_info))
{
case type_demotion_vec_info_type:
- gcc_assert (!slp_node);
- done = vectorizable_type_demotion (stmt, bsi, &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, bsi, &vec_stmt);
+ done = vectorizable_type_promotion (stmt, gsi, &vec_stmt, slp_node);
gcc_assert (done);
break;
case type_conversion_vec_info_type:
- done = vectorizable_conversion (stmt, bsi, &vec_stmt, slp_node);
+ done = vectorizable_conversion (stmt, gsi, &vec_stmt, slp_node);
gcc_assert (done);
break;
case induc_vec_info_type:
gcc_assert (!slp_node);
- done = vectorizable_induction (stmt, bsi, &vec_stmt);
+ done = vectorizable_induction (stmt, gsi, &vec_stmt);
gcc_assert (done);
break;
case op_vec_info_type:
- done = vectorizable_operation (stmt, bsi, &vec_stmt, slp_node);
+ done = vectorizable_operation (stmt, gsi, &vec_stmt, slp_node);
gcc_assert (done);
break;
case assignment_vec_info_type:
- done = vectorizable_assignment (stmt, bsi, &vec_stmt, slp_node);
+ done = vectorizable_assignment (stmt, gsi, &vec_stmt, slp_node);
gcc_assert (done);
break;
case load_vec_info_type:
- done = vectorizable_load (stmt, bsi, &vec_stmt, slp_node);
+ done = vectorizable_load (stmt, gsi, &vec_stmt, slp_node,
+ slp_node_instance);
gcc_assert (done);
break;
case store_vec_info_type:
- done = vectorizable_store (stmt, bsi, &vec_stmt, slp_node);
+ 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
@@ -6314,18 +7082,18 @@ vect_transform_stmt (tree stmt, block_stmt_iterator *bsi, bool *strided_store,
case condition_vec_info_type:
gcc_assert (!slp_node);
- done = vectorizable_condition (stmt, bsi, &vec_stmt);
+ done = vectorizable_condition (stmt, gsi, &vec_stmt);
gcc_assert (done);
break;
case call_vec_info_type:
gcc_assert (!slp_node);
- done = vectorizable_call (stmt, bsi, &vec_stmt);
+ done = vectorizable_call (stmt, gsi, &vec_stmt);
break;
case reduc_vec_info_type:
gcc_assert (!slp_node);
- done = vectorizable_reduction (stmt, bsi, &vec_stmt);
+ done = vectorizable_reduction (stmt, gsi, &vec_stmt);
gcc_assert (done);
break;
@@ -6341,7 +7109,7 @@ vect_transform_stmt (tree stmt, block_stmt_iterator *bsi, bool *strided_store,
if (STMT_VINFO_LIVE_P (stmt_info)
&& STMT_VINFO_TYPE (stmt_info) != reduc_vec_info_type)
{
- done = vectorizable_live_operation (stmt, bsi, &vec_stmt);
+ done = vectorizable_live_operation (stmt, gsi, &vec_stmt);
gcc_assert (done);
}
@@ -6375,19 +7143,20 @@ vect_transform_stmt (tree stmt, block_stmt_iterator *bsi, bool *strided_store,
static tree
vect_build_loop_niters (loop_vec_info loop_vinfo)
{
- tree ni_name, stmt, var;
+ tree ni_name, var;
+ gimple_seq stmts = NULL;
edge pe;
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
tree ni = unshare_expr (LOOP_VINFO_NITERS (loop_vinfo));
var = create_tmp_var (TREE_TYPE (ni), "niters");
add_referenced_var (var);
- ni_name = force_gimple_operand (ni, &stmt, false, var);
+ ni_name = force_gimple_operand (ni, &stmts, false, var);
pe = loop_preheader_edge (loop);
- if (stmt)
+ if (stmts)
{
- basic_block new_bb = bsi_insert_on_edge_immediate (pe, stmt);
+ basic_block new_bb = gsi_insert_seq_on_edge_immediate (pe, stmts);
gcc_assert (!new_bb);
}
@@ -6412,7 +7181,8 @@ vect_generate_tmps_on_preheader (loop_vec_info loop_vinfo,
edge pe;
basic_block new_bb;
- tree stmt, ni_name;
+ gimple_seq stmts;
+ tree ni_name;
tree var;
tree ratio_name;
tree ratio_mult_vf_name;
@@ -6437,9 +7207,10 @@ vect_generate_tmps_on_preheader (loop_vec_info loop_vinfo,
var = create_tmp_var (TREE_TYPE (ni), "bnd");
add_referenced_var (var);
- ratio_name = force_gimple_operand (ratio_name, &stmt, true, var);
+ stmts = NULL;
+ ratio_name = force_gimple_operand (ratio_name, &stmts, true, var);
pe = loop_preheader_edge (loop);
- new_bb = bsi_insert_on_edge_immediate (pe, stmt);
+ new_bb = gsi_insert_seq_on_edge_immediate (pe, stmts);
gcc_assert (!new_bb);
}
@@ -6452,10 +7223,11 @@ vect_generate_tmps_on_preheader (loop_vec_info loop_vinfo,
var = create_tmp_var (TREE_TYPE (ni), "ratio_mult_vf");
add_referenced_var (var);
- ratio_mult_vf_name = force_gimple_operand (ratio_mult_vf_name, &stmt,
+ stmts = NULL;
+ ratio_mult_vf_name = force_gimple_operand (ratio_mult_vf_name, &stmts,
true, var);
pe = loop_preheader_edge (loop);
- new_bb = bsi_insert_on_edge_immediate (pe, stmt);
+ new_bb = gsi_insert_seq_on_edge_immediate (pe, stmts);
gcc_assert (!new_bb);
}
@@ -6514,7 +7286,8 @@ vect_update_ivs_after_vectorizer (loop_vec_info loop_vinfo, tree niters,
{
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
basic_block exit_bb = single_exit (loop)->dest;
- tree phi, phi1;
+ gimple phi, phi1;
+ gimple_stmt_iterator gsi, gsi1;
basic_block update_bb = update_e->dest;
/* gcc_assert (vect_can_advance_ivs_p (loop_vinfo)); */
@@ -6522,21 +7295,23 @@ vect_update_ivs_after_vectorizer (loop_vec_info loop_vinfo, tree niters,
/* Make sure there exists a single-predecessor exit bb: */
gcc_assert (single_pred_p (exit_bb));
- for (phi = phi_nodes (loop->header), phi1 = phi_nodes (update_bb);
- phi && phi1;
- phi = PHI_CHAIN (phi), phi1 = PHI_CHAIN (phi1))
+ for (gsi = gsi_start_phis (loop->header), gsi1 = gsi_start_phis (update_bb);
+ !gsi_end_p (gsi) && !gsi_end_p (gsi1);
+ gsi_next (&gsi), gsi_next (&gsi1))
{
tree access_fn = NULL;
tree evolution_part;
tree init_expr;
tree step_expr;
tree var, ni, ni_name;
- block_stmt_iterator last_bsi;
+ gimple_stmt_iterator last_gsi;
+ phi = gsi_stmt (gsi);
+ phi1 = gsi_stmt (gsi1);
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "vect_update_ivs_after_vectorizer: phi: ");
- print_generic_expr (vect_dump, phi, TDF_SLIM);
+ print_gimple_stmt (vect_dump, phi, 0, TDF_SLIM);
}
/* Skip virtual phi's. */
@@ -6588,9 +7363,9 @@ vect_update_ivs_after_vectorizer (loop_vec_info loop_vinfo, tree niters,
var = create_tmp_var (TREE_TYPE (init_expr), "tmp");
add_referenced_var (var);
- last_bsi = bsi_last (exit_bb);
- ni_name = force_gimple_operand_bsi (&last_bsi, ni, false, var,
- true, BSI_SAME_STMT);
+ last_gsi = gsi_last_bb (exit_bb);
+ ni_name = force_gimple_operand_gsi (&last_gsi, ni, false, var,
+ true, GSI_SAME_STMT);
/* Fix phi expressions in the successor bb. */
SET_PHI_ARG_DEF (phi1, update_e->dest_idx, ni_name);
@@ -6665,7 +7440,7 @@ vect_do_peeling_for_loop_bound (loop_vec_info loop_vinfo, tree *ratio)
/* If cost model check not done during versioning and
peeling for alignment. */
- if (!VEC_length (tree, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo))
+ if (!VEC_length (gimple, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo))
&& !VEC_length (ddr_p, LOOP_VINFO_MAY_ALIAS_DDRS (loop_vinfo))
&& !LOOP_PEELING_FOR_ALIGNMENT (loop_vinfo))
{
@@ -6745,11 +7520,12 @@ vect_gen_niters_for_prolog_loop (loop_vec_info loop_vinfo, tree loop_niters)
{
struct data_reference *dr = LOOP_VINFO_UNALIGNED_DR (loop_vinfo);
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- tree var, stmt;
+ tree var;
+ gimple_seq stmts;
tree iters, iters_name;
edge pe;
basic_block new_bb;
- tree dr_stmt = DR_STMT (dr);
+ gimple dr_stmt = DR_STMT (dr);
stmt_vec_info stmt_info = vinfo_for_stmt (dr_stmt);
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
int vectype_align = TYPE_ALIGN (vectype) / BITS_PER_UNIT;
@@ -6776,7 +7552,7 @@ vect_gen_niters_for_prolog_loop (loop_vec_info loop_vinfo, tree loop_niters)
}
else
{
- tree new_stmts = NULL_TREE;
+ gimple_seq new_stmts = NULL;
tree start_addr = vect_create_addr_base_for_vector_ref (dr_stmt,
&new_stmts, NULL_TREE, loop);
tree ptr_type = TREE_TYPE (start_addr);
@@ -6790,7 +7566,7 @@ vect_gen_niters_for_prolog_loop (loop_vec_info loop_vinfo, tree loop_niters)
tree byte_misalign;
tree elem_misalign;
- new_bb = bsi_insert_on_edge_immediate (pe, new_stmts);
+ new_bb = gsi_insert_seq_on_edge_immediate (pe, new_stmts);
gcc_assert (!new_bb);
/* Create: byte_misalign = addr & (vectype_size - 1) */
@@ -6822,12 +7598,13 @@ vect_gen_niters_for_prolog_loop (loop_vec_info loop_vinfo, tree loop_niters)
var = create_tmp_var (niters_type, "prolog_loop_niters");
add_referenced_var (var);
- iters_name = force_gimple_operand (iters, &stmt, false, var);
+ stmts = NULL;
+ iters_name = force_gimple_operand (iters, &stmts, false, var);
/* Insert stmt on loop preheader edge. */
- if (stmt)
+ if (stmts)
{
- basic_block new_bb = bsi_insert_on_edge_immediate (pe, stmt);
+ basic_block new_bb = gsi_insert_seq_on_edge_immediate (pe, stmts);
gcc_assert (!new_bb);
}
@@ -6905,7 +7682,7 @@ vect_do_peeling_for_alignment (loop_vec_info loop_vinfo)
/* If cost model check not done during versioning. */
- if (!VEC_length (tree, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo))
+ if (!VEC_length (gimple, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo))
&& !VEC_length (ddr_p, LOOP_VINFO_MAY_ALIAS_DDRS (loop_vinfo)))
{
check_profitability = true;
@@ -6971,12 +7748,12 @@ vect_do_peeling_for_alignment (loop_vec_info loop_vinfo)
static void
vect_create_cond_for_align_checks (loop_vec_info loop_vinfo,
tree *cond_expr,
- tree *cond_expr_stmt_list)
+ gimple_seq *cond_expr_stmt_list)
{
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- VEC(tree,heap) *may_misalign_stmts
+ VEC(gimple,heap) *may_misalign_stmts
= LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo);
- tree ref_stmt, tmp;
+ gimple ref_stmt;
int mask = LOOP_VINFO_PTR_MASK (loop_vinfo);
tree mask_cst;
unsigned int i;
@@ -6984,7 +7761,8 @@ vect_create_cond_for_align_checks (loop_vec_info loop_vinfo,
tree int_ptrsize_type;
char tmp_name[20];
tree or_tmp_name = NULL_TREE;
- tree and_tmp, and_tmp_name, and_stmt;
+ tree and_tmp, and_tmp_name;
+ gimple and_stmt;
tree ptrsize_zero;
tree part_cond_expr;
@@ -7001,28 +7779,29 @@ vect_create_cond_for_align_checks (loop_vec_info loop_vinfo,
/* Create expression (mask & (dr_1 || ... || dr_n)) where dr_i is the address
of the first vector of the i'th data reference. */
- for (i = 0; VEC_iterate (tree, may_misalign_stmts, i, ref_stmt); i++)
+ for (i = 0; VEC_iterate (gimple, may_misalign_stmts, i, ref_stmt); i++)
{
- tree new_stmt_list = NULL_TREE;
+ gimple_seq new_stmt_list = NULL;
tree addr_base;
- tree addr_tmp, addr_tmp_name, addr_stmt;
- tree or_tmp, new_or_tmp_name, or_stmt;
+ tree addr_tmp, addr_tmp_name;
+ tree or_tmp, new_or_tmp_name;
+ gimple addr_stmt, or_stmt;
/* create: addr_tmp = (int)(address_of_first_vector) */
- addr_base = vect_create_addr_base_for_vector_ref (ref_stmt,
- &new_stmt_list, NULL_TREE, loop);
-
- if (new_stmt_list != NULL_TREE)
- append_to_statement_list_force (new_stmt_list, cond_expr_stmt_list);
+ addr_base =
+ vect_create_addr_base_for_vector_ref (ref_stmt, &new_stmt_list,
+ NULL_TREE, loop);
+ if (new_stmt_list != NULL)
+ gimple_seq_add_seq (cond_expr_stmt_list, new_stmt_list);
sprintf (tmp_name, "%s%d", "addr2int", i);
addr_tmp = create_tmp_var (int_ptrsize_type, tmp_name);
add_referenced_var (addr_tmp);
- addr_tmp_name = make_ssa_name (addr_tmp, NULL_TREE);
- addr_stmt = fold_convert (int_ptrsize_type, addr_base);
- addr_stmt = build_gimple_modify_stmt (addr_tmp_name, addr_stmt);
+ addr_tmp_name = make_ssa_name (addr_tmp, NULL);
+ 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;
- append_to_statement_list_force (addr_stmt, cond_expr_stmt_list);
+ gimple_seq_add_stmt (cond_expr_stmt_list, addr_stmt);
/* The addresses are OR together. */
@@ -7032,12 +7811,12 @@ vect_create_cond_for_align_checks (loop_vec_info loop_vinfo,
sprintf (tmp_name, "%s%d", "orptrs", i);
or_tmp = create_tmp_var (int_ptrsize_type, tmp_name);
add_referenced_var (or_tmp);
- new_or_tmp_name = make_ssa_name (or_tmp, NULL_TREE);
- tmp = build2 (BIT_IOR_EXPR, int_ptrsize_type,
- or_tmp_name, addr_tmp_name);
- or_stmt = build_gimple_modify_stmt (new_or_tmp_name, tmp);
+ new_or_tmp_name = make_ssa_name (or_tmp, NULL);
+ or_stmt = gimple_build_assign_with_ops (BIT_IOR_EXPR,
+ new_or_tmp_name,
+ or_tmp_name, addr_tmp_name);
SSA_NAME_DEF_STMT (new_or_tmp_name) = or_stmt;
- append_to_statement_list_force (or_stmt, cond_expr_stmt_list);
+ gimple_seq_add_stmt (cond_expr_stmt_list, or_stmt);
or_tmp_name = new_or_tmp_name;
}
else
@@ -7050,12 +7829,12 @@ vect_create_cond_for_align_checks (loop_vec_info loop_vinfo,
/* create: and_tmp = or_tmp & mask */
and_tmp = create_tmp_var (int_ptrsize_type, "andmask" );
add_referenced_var (and_tmp);
- and_tmp_name = make_ssa_name (and_tmp, NULL_TREE);
+ and_tmp_name = make_ssa_name (and_tmp, NULL);
- tmp = build2 (BIT_AND_EXPR, int_ptrsize_type, or_tmp_name, mask_cst);
- and_stmt = build_gimple_modify_stmt (and_tmp_name, tmp);
+ and_stmt = gimple_build_assign_with_ops (BIT_AND_EXPR, and_tmp_name,
+ or_tmp_name, mask_cst);
SSA_NAME_DEF_STMT (and_tmp_name) = and_stmt;
- append_to_statement_list_force (and_stmt, cond_expr_stmt_list);
+ gimple_seq_add_stmt (cond_expr_stmt_list, and_stmt);
/* Make and_tmp the left operand of the conditional test against zero.
if and_tmp has a nonzero bit then some address is unaligned. */
@@ -7124,7 +7903,7 @@ vect_vfa_segment_size (struct data_reference *dr, tree vect_factor)
static void
vect_create_cond_for_alias_checks (loop_vec_info loop_vinfo,
tree * cond_expr,
- tree * cond_expr_stmt_list)
+ gimple_seq * cond_expr_stmt_list)
{
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
VEC (ddr_p, heap) * may_alias_ddrs =
@@ -7151,10 +7930,10 @@ vect_create_cond_for_alias_checks (loop_vec_info loop_vinfo,
for (i = 0; VEC_iterate (ddr_p, may_alias_ddrs, i, ddr); i++)
{
struct data_reference *dr_a, *dr_b;
- tree dr_group_first_a, dr_group_first_b;
+ gimple dr_group_first_a, dr_group_first_b;
tree addr_base_a, addr_base_b;
tree segment_length_a, segment_length_b;
- tree stmt_a, stmt_b;
+ gimple stmt_a, stmt_b;
dr_a = DDR_A (ddr);
stmt_a = DR_STMT (DDR_A (ddr));
@@ -7209,7 +7988,7 @@ vect_create_cond_for_alias_checks (loop_vec_info loop_vinfo,
if (*cond_expr)
*cond_expr = fold_build2 (TRUTH_AND_EXPR, boolean_type_node,
- *cond_expr, part_cond_expr);
+ *cond_expr, part_cond_expr);
else
*cond_expr = part_cond_expr;
}
@@ -7241,15 +8020,16 @@ vect_loop_versioning (loop_vec_info loop_vinfo)
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
struct loop *nloop;
tree cond_expr = NULL_TREE;
- tree cond_expr_stmt_list = NULL_TREE;
+ gimple_seq cond_expr_stmt_list = NULL;
basic_block condition_bb;
- block_stmt_iterator cond_exp_bsi;
+ gimple_stmt_iterator gsi, cond_exp_gsi;
basic_block merge_bb;
basic_block new_exit_bb;
edge new_exit_e, e;
- tree orig_phi, new_phi, arg;
+ gimple orig_phi, new_phi;
+ tree arg;
unsigned prob = 4 * REG_BR_PROB_BASE / 5;
- tree gimplify_stmt_list;
+ gimple_seq gimplify_stmt_list = NULL;
tree scalar_loop_iters = LOOP_VINFO_NITERS (loop_vinfo);
int min_profitable_iters = 0;
unsigned int th;
@@ -7267,7 +8047,7 @@ vect_loop_versioning (loop_vec_info loop_vinfo)
cond_expr = force_gimple_operand (cond_expr, &cond_expr_stmt_list,
false, NULL_TREE);
- if (VEC_length (tree, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo)))
+ if (VEC_length (gimple, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo)))
vect_create_cond_for_align_checks (loop_vinfo, &cond_expr,
&cond_expr_stmt_list);
@@ -7278,9 +8058,8 @@ vect_loop_versioning (loop_vec_info loop_vinfo)
cond_expr =
fold_build2 (NE_EXPR, boolean_type_node, cond_expr, integer_zero_node);
cond_expr =
- force_gimple_operand (cond_expr, &gimplify_stmt_list, true,
- NULL_TREE);
- append_to_statement_list (gimplify_stmt_list, &cond_expr_stmt_list);
+ force_gimple_operand (cond_expr, &gimplify_stmt_list, true, NULL_TREE);
+ gimple_seq_add_seq (&cond_expr_stmt_list, gimplify_stmt_list);
initialize_original_copy_tables ();
nloop = loop_version (loop, cond_expr, &condition_bb,
@@ -7301,9 +8080,9 @@ vect_loop_versioning (loop_vec_info loop_vinfo)
new_exit_e = single_exit (loop);
e = EDGE_SUCC (new_exit_bb, 0);
- for (orig_phi = phi_nodes (merge_bb); orig_phi;
- orig_phi = PHI_CHAIN (orig_phi))
+ for (gsi = gsi_start_phis (merge_bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
+ orig_phi = gsi_stmt (gsi);
new_phi = create_phi_node (SSA_NAME_VAR (PHI_RESULT (orig_phi)),
new_exit_bb);
arg = PHI_ARG_DEF_FROM_EDGE (orig_phi, e);
@@ -7316,8 +8095,8 @@ vect_loop_versioning (loop_vec_info loop_vinfo)
update_ssa (TODO_update_ssa);
if (cond_expr_stmt_list)
{
- cond_exp_bsi = bsi_last (condition_bb);
- bsi_insert_before (&cond_exp_bsi, cond_expr_stmt_list, BSI_SAME_STMT);
+ cond_exp_gsi = gsi_last_bb (condition_bb);
+ gsi_insert_seq_before (&cond_exp_gsi, cond_expr_stmt_list, GSI_SAME_STMT);
}
}
@@ -7325,17 +8104,17 @@ vect_loop_versioning (loop_vec_info loop_vinfo)
stmt_vec_info. */
static void
-vect_remove_stores (tree first_stmt)
+vect_remove_stores (gimple first_stmt)
{
- tree next = first_stmt;
- tree tmp;
- block_stmt_iterator next_si;
+ gimple next = first_stmt;
+ gimple tmp;
+ gimple_stmt_iterator next_si;
while (next)
{
/* Free the attached stmt_vec_info and remove the stmt. */
- next_si = bsi_for_stmt (next);
- bsi_remove (&next_si, true);
+ next_si = gsi_for_stmt (next);
+ gsi_remove (&next_si, true);
tmp = DR_GROUP_NEXT_DR (vinfo_for_stmt (next));
free_stmt_vec_info (next);
next = tmp;
@@ -7346,32 +8125,71 @@ vect_remove_stores (tree 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)
{
- tree stmt;
+ gimple stmt;
bool strided_store, is_store;
- block_stmt_iterator si;
+ gimple_stmt_iterator si;
stmt_vec_info stmt_info;
+ unsigned int vec_stmts_size, nunits, group_size;
+ tree vectype;
+ int i;
+ slp_tree loads_node;
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(tree, SLP_TREE_SCALAR_STMTS (node), 0);
+ stmt = VEC_index (gimple, SLP_TREE_SCALAR_STMTS (node), 0);
stmt_info = vinfo_for_stmt (stmt);
- SLP_TREE_VEC_STMTS (node) = VEC_alloc (tree, heap, vec_stmts_size);
- SLP_TREE_NUMBER_OF_VEC_STMTS (node) = vec_stmts_size;
+ /* 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;
+
+ /* In case of load permutation we have to allocate vectorized statements for
+ all the nodes that participate in that permutation. */
+ if (SLP_INSTANCE_LOAD_PERMUTATION (instance))
+ {
+ for (i = 0;
+ VEC_iterate (slp_tree, SLP_INSTANCE_LOADS (instance), i, loads_node);
+ i++)
+ {
+ if (!SLP_TREE_VEC_STMTS (loads_node))
+ {
+ SLP_TREE_VEC_STMTS (loads_node) = VEC_alloc (gimple, heap,
+ vec_stmts_size);
+ SLP_TREE_NUMBER_OF_VEC_STMTS (loads_node) = vec_stmts_size;
+ }
+ }
+ }
+
+ if (!SLP_TREE_VEC_STMTS (node))
+ {
+ SLP_TREE_VEC_STMTS (node) = VEC_alloc (gimple, heap, vec_stmts_size);
+ SLP_TREE_NUMBER_OF_VEC_STMTS (node) = vec_stmts_size;
+ }
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "------>vectorizing SLP node starting from: ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
- si = bsi_for_stmt (stmt);
- is_store = vect_transform_stmt (stmt, &si, &strided_store, node);
+ si = gsi_for_stmt (stmt);
+ is_store = vect_transform_stmt (stmt, &si, &strided_store, node, instance);
if (is_store)
{
if (DR_GROUP_FIRST_DR (stmt_info))
@@ -7392,30 +8210,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.");
@@ -7436,7 +8245,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo);
int nbbs = loop->num_nodes;
- block_stmt_iterator si;
+ gimple_stmt_iterator si;
int i;
tree ratio = NULL;
int vectorization_factor = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
@@ -7447,7 +8256,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "=== vec_transform_loop ===");
- if (VEC_length (tree, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo))
+ if (VEC_length (gimple, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo))
|| VEC_length (ddr_p, LOOP_VINFO_MAY_ALIAS_DDRS (loop_vinfo)))
vect_loop_versioning (loop_vinfo);
@@ -7493,14 +8302,15 @@ vect_transform_loop (loop_vec_info loop_vinfo)
{
basic_block bb = bbs[i];
stmt_vec_info stmt_info;
- tree phi;
+ gimple phi;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
{
+ phi = gsi_stmt (si);
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "------>vectorizing phi: ");
- print_generic_expr (vect_dump, phi, TDF_SLIM);
+ print_gimple_stmt (vect_dump, phi, 0, TDF_SLIM);
}
stmt_info = vinfo_for_stmt (phi);
if (!stmt_info)
@@ -7519,19 +8329,19 @@ vect_transform_loop (loop_vec_info loop_vinfo)
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "transform phi.");
- vect_transform_stmt (phi, NULL, NULL, NULL);
+ vect_transform_stmt (phi, NULL, NULL, NULL, NULL);
}
}
- for (si = bsi_start (bb); !bsi_end_p (si);)
+ for (si = gsi_start_bb (bb); !gsi_end_p (si);)
{
- tree stmt = bsi_stmt (si);
+ gimple stmt = gsi_stmt (si);
bool is_store;
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "------>vectorizing statement: ");
- print_generic_expr (vect_dump, stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
}
stmt_info = vinfo_for_stmt (stmt);
@@ -7541,14 +8351,14 @@ vect_transform_loop (loop_vec_info loop_vinfo)
need to be vectorized. */
if (!stmt_info)
{
- bsi_next (&si);
+ gsi_next (&si);
continue;
}
if (!STMT_VINFO_RELEVANT_P (stmt_info)
&& !STMT_VINFO_LIVE_P (stmt_info))
{
- bsi_next (&si);
+ gsi_next (&si);
continue;
}
@@ -7573,14 +8383,14 @@ 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
vect_schedule_slp_instance and their vinfo is destroyed. */
if (is_store)
{
- bsi_next (&si);
+ gsi_next (&si);
continue;
}
}
@@ -7588,7 +8398,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
/* Hybrid SLP stmts must be vectorized in addition to SLP. */
if (PURE_SLP_STMT (stmt_info))
{
- bsi_next (&si);
+ gsi_next (&si);
continue;
}
}
@@ -7598,7 +8408,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
fprintf (vect_dump, "transform statement.");
strided_store = false;
- is_store = vect_transform_stmt (stmt, &si, &strided_store, NULL);
+ is_store = vect_transform_stmt (stmt, &si, &strided_store, NULL, NULL);
if (is_store)
{
if (STMT_VINFO_STRIDED_ACCESS (stmt_info))
@@ -7607,18 +8417,18 @@ vect_transform_loop (loop_vec_info loop_vinfo)
interleaving chain was completed - free all the stores in
the chain. */
vect_remove_stores (DR_GROUP_FIRST_DR (stmt_info));
- bsi_remove (&si, true);
+ gsi_remove (&si, true);
continue;
}
else
{
/* Free the attached stmt_vec_info and remove the stmt. */
free_stmt_vec_info (stmt);
- bsi_remove (&si, true);
+ gsi_remove (&si, true);
continue;
}
}
- bsi_next (&si);
+ gsi_next (&si);
} /* stmts in BB */
} /* BBs in loop */
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index 5bfa30b21d4..474860adedb 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -144,8 +144,10 @@ along with GCC; see the file COPYING3. If not see
#include "tree-data-ref.h"
#include "tree-scalar-evolution.h"
#include "input.h"
+#include "hashtab.h"
#include "tree-vectorizer.h"
#include "tree-pass.h"
+#include "langhooks.h"
/*************************************************************************
General Vectorization Utilities
@@ -163,6 +165,10 @@ static LOC vect_loop_location;
/* Bitmap of virtual variables to be renamed. */
bitmap vect_memsyms_to_rename;
+
+/* Vector mapping GIMPLE stmt to stmt_vec_info. */
+VEC(vec_void_p,heap) *stmt_vec_info_vec;
+
/*************************************************************************
Simple Loop Peeling Utilities
@@ -198,18 +204,17 @@ rename_use_op (use_operand_p op_p)
static void
rename_variables_in_bb (basic_block bb)
{
- tree phi;
- block_stmt_iterator bsi;
- tree stmt;
+ gimple_stmt_iterator gsi;
+ gimple stmt;
use_operand_p use_p;
ssa_op_iter iter;
edge e;
edge_iterator ei;
struct loop *loop = bb->loop_father;
- 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);
+ stmt = gsi_stmt (gsi);
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
rename_use_op (use_p);
}
@@ -218,8 +223,8 @@ rename_variables_in_bb (basic_block bb)
{
if (!flow_bb_inside_loop_p (loop, e->dest))
continue;
- for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
- rename_use_op (PHI_ARG_DEF_PTR_FROM_EDGE (phi, e));
+ for (gsi = gsi_start_phis (e->dest); !gsi_end_p (gsi); gsi_next (&gsi))
+ rename_use_op (PHI_ARG_DEF_PTR_FROM_EDGE (gsi_stmt (gsi), e));
}
}
@@ -253,13 +258,14 @@ slpeel_update_phis_for_duplicate_loop (struct loop *orig_loop,
struct loop *new_loop, bool after)
{
tree new_ssa_name;
- tree phi_new, phi_orig;
+ gimple phi_new, phi_orig;
tree def;
edge orig_loop_latch = loop_latch_edge (orig_loop);
edge orig_entry_e = loop_preheader_edge (orig_loop);
edge new_loop_exit_e = single_exit (new_loop);
edge new_loop_entry_e = loop_preheader_edge (new_loop);
edge entry_arg_e = (after ? orig_loop_latch : orig_entry_e);
+ gimple_stmt_iterator gsi_new, gsi_orig;
/*
step 1. For each loop-header-phi:
@@ -290,11 +296,14 @@ slpeel_update_phis_for_duplicate_loop (struct loop *orig_loop,
/* Scan the phis in the headers of the old and new loops
(they are organized in exactly the same order). */
- for (phi_new = phi_nodes (new_loop->header),
- phi_orig = phi_nodes (orig_loop->header);
- phi_new && phi_orig;
- phi_new = PHI_CHAIN (phi_new), phi_orig = PHI_CHAIN (phi_orig))
+ for (gsi_new = gsi_start_phis (new_loop->header),
+ gsi_orig = gsi_start_phis (orig_loop->header);
+ !gsi_end_p (gsi_new) && !gsi_end_p (gsi_orig);
+ gsi_next (&gsi_new), gsi_next (&gsi_orig))
{
+ phi_new = gsi_stmt (gsi_new);
+ phi_orig = gsi_stmt (gsi_orig);
+
/* step 1. */
def = PHI_ARG_DEF_FROM_EDGE (phi_orig, entry_arg_e);
add_phi_arg (phi_new, def, new_loop_entry_e);
@@ -485,8 +494,8 @@ slpeel_update_phi_nodes_for_guard1 (edge guard_edge, struct loop *loop,
bool is_new_loop, basic_block *new_exit_bb,
bitmap *defs)
{
- tree orig_phi, new_phi;
- tree update_phi, update_phi2;
+ gimple orig_phi, new_phi;
+ gimple update_phi, update_phi2;
tree guard_arg, loop_arg;
basic_block new_merge_bb = guard_edge->dest;
edge e = EDGE_SUCC (new_merge_bb, 0);
@@ -495,16 +504,21 @@ slpeel_update_phi_nodes_for_guard1 (edge guard_edge, struct loop *loop,
edge new_exit_e;
tree current_new_name;
tree name;
+ gimple_stmt_iterator gsi_orig, gsi_update;
/* Create new bb between loop and new_merge_bb. */
*new_exit_bb = split_edge (single_exit (loop));
new_exit_e = EDGE_SUCC (*new_exit_bb, 0);
- for (orig_phi = phi_nodes (orig_bb), update_phi = phi_nodes (update_bb);
- orig_phi && update_phi;
- orig_phi = PHI_CHAIN (orig_phi), update_phi = PHI_CHAIN (update_phi))
+ for (gsi_orig = gsi_start_phis (orig_bb),
+ gsi_update = gsi_start_phis (update_bb);
+ !gsi_end_p (gsi_orig) && !gsi_end_p (gsi_update);
+ gsi_next (&gsi_orig), gsi_next (&gsi_update))
{
+ orig_phi = gsi_stmt (gsi_orig);
+ update_phi = gsi_stmt (gsi_update);
+
/* Virtual phi; Mark it for renaming. We actually want to call
mar_sym_for_renaming, but since all ssa renaming datastructures
are going to be freed before we get to call ssa_update, we just
@@ -578,8 +592,6 @@ slpeel_update_phi_nodes_for_guard1 (edge guard_edge, struct loop *loop,
set_current_def (current_new_name, PHI_RESULT (new_phi));
bitmap_set_bit (*defs, SSA_NAME_VERSION (current_new_name));
}
-
- set_phi_nodes (new_merge_bb, phi_reverse (phi_nodes (new_merge_bb)));
}
@@ -613,8 +625,8 @@ static void
slpeel_update_phi_nodes_for_guard2 (edge guard_edge, struct loop *loop,
bool is_new_loop, basic_block *new_exit_bb)
{
- tree orig_phi, new_phi;
- tree update_phi, update_phi2;
+ gimple orig_phi, new_phi;
+ gimple update_phi, update_phi2;
tree guard_arg, loop_arg;
basic_block new_merge_bb = guard_edge->dest;
edge e = EDGE_SUCC (new_merge_bb, 0);
@@ -623,15 +635,16 @@ slpeel_update_phi_nodes_for_guard2 (edge guard_edge, struct loop *loop,
tree orig_def, orig_def_new_name;
tree new_name, new_name2;
tree arg;
+ gimple_stmt_iterator gsi;
/* Create new bb between loop and new_merge_bb. */
*new_exit_bb = split_edge (single_exit (loop));
new_exit_e = EDGE_SUCC (*new_exit_bb, 0);
- for (update_phi = phi_nodes (update_bb); update_phi;
- update_phi = PHI_CHAIN (update_phi))
+ for (gsi = gsi_start_phis (update_bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
+ update_phi = gsi_stmt (gsi);
orig_phi = update_phi;
orig_def = PHI_ARG_DEF_FROM_EDGE (orig_phi, e);
/* This loop-closed-phi actually doesn't represent a use
@@ -732,8 +745,6 @@ slpeel_update_phi_nodes_for_guard2 (edge guard_edge, struct loop *loop,
== guard_arg);
SET_PHI_ARG_DEF (update_phi2, guard_edge->dest_idx, PHI_RESULT (new_phi));
}
-
- set_phi_nodes (new_merge_bb, phi_reverse (phi_nodes (new_merge_bb)));
}
@@ -745,35 +756,40 @@ slpeel_update_phi_nodes_for_guard2 (edge guard_edge, struct loop *loop,
void
slpeel_make_loop_iterate_ntimes (struct loop *loop, tree niters)
{
- tree indx_before_incr, indx_after_incr, cond_stmt, cond;
- tree orig_cond;
+ tree indx_before_incr, indx_after_incr;
+ gimple cond_stmt;
+ gimple orig_cond;
edge exit_edge = single_exit (loop);
- block_stmt_iterator loop_cond_bsi;
- block_stmt_iterator incr_bsi;
+ gimple_stmt_iterator loop_cond_gsi;
+ gimple_stmt_iterator incr_gsi;
bool insert_after;
tree init = build_int_cst (TREE_TYPE (niters), 0);
tree step = build_int_cst (TREE_TYPE (niters), 1);
LOC loop_loc;
+ enum tree_code code;
orig_cond = get_loop_exit_condition (loop);
gcc_assert (orig_cond);
- loop_cond_bsi = bsi_for_stmt (orig_cond);
+ loop_cond_gsi = gsi_for_stmt (orig_cond);
- standard_iv_increment_position (loop, &incr_bsi, &insert_after);
+ standard_iv_increment_position (loop, &incr_gsi, &insert_after);
create_iv (init, step, NULL_TREE, loop,
- &incr_bsi, insert_after, &indx_before_incr, &indx_after_incr);
+ &incr_gsi, insert_after, &indx_before_incr, &indx_after_incr);
- if (exit_edge->flags & EDGE_TRUE_VALUE) /* 'then' edge exits the loop. */
- cond = build2 (GE_EXPR, boolean_type_node, indx_after_incr, niters);
- else /* 'then' edge loops back. */
- cond = build2 (LT_EXPR, boolean_type_node, indx_after_incr, niters);
+ indx_after_incr = force_gimple_operand_gsi (&loop_cond_gsi, indx_after_incr,
+ true, NULL_TREE, true,
+ GSI_SAME_STMT);
+ niters = force_gimple_operand_gsi (&loop_cond_gsi, niters, true, NULL_TREE,
+ true, GSI_SAME_STMT);
- cond_stmt = build3 (COND_EXPR, TREE_TYPE (orig_cond), cond,
- NULL_TREE, NULL_TREE);
- bsi_insert_before (&loop_cond_bsi, cond_stmt, BSI_SAME_STMT);
+ code = (exit_edge->flags & EDGE_TRUE_VALUE) ? GE_EXPR : LT_EXPR;
+ cond_stmt = gimple_build_cond (code, indx_after_incr, niters, NULL_TREE,
+ NULL_TREE);
+
+ gsi_insert_before (&loop_cond_gsi, cond_stmt, GSI_SAME_STMT);
/* Remove old loop exit test: */
- bsi_remove (&loop_cond_bsi, true);
+ gsi_remove (&loop_cond_gsi, true);
loop_loc = find_loop_location (loop);
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -781,7 +797,7 @@ slpeel_make_loop_iterate_ntimes (struct loop *loop, tree niters)
if (loop_loc != UNKNOWN_LOC)
fprintf (dump_file, "\nloop at %s:%d: ",
LOC_FILE (loop_loc), LOC_LINE (loop_loc));
- print_generic_expr (dump_file, cond_stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, cond_stmt, 0, TDF_SLIM);
}
loop->nb_iterations = niters;
@@ -799,8 +815,10 @@ slpeel_tree_duplicate_loop_to_edge_cfg (struct loop *loop, edge e)
bool at_exit;
bool was_imm_dom;
basic_block exit_dest;
- tree phi, phi_arg;
+ gimple phi;
+ tree phi_arg;
edge exit, new_exit;
+ gimple_stmt_iterator gsi;
at_exit = (e == single_exit (loop));
if (!at_exit && e != loop_preheader_edge (loop))
@@ -837,8 +855,9 @@ slpeel_tree_duplicate_loop_to_edge_cfg (struct loop *loop, edge e)
/* Duplicating phi args at exit bbs as coming
also from exit of duplicated loop. */
- for (phi = phi_nodes (exit_dest); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (exit_dest); !gsi_end_p (gsi); gsi_next (&gsi))
{
+ phi = gsi_stmt (gsi);
phi_arg = PHI_ARG_DEF_FROM_EDGE (phi, single_exit (loop));
if (phi_arg)
{
@@ -880,8 +899,11 @@ slpeel_tree_duplicate_loop_to_edge_cfg (struct loop *loop, edge e)
/* We have to add phi args to the loop->header here as coming
from new_exit_e edge. */
- for (phi = phi_nodes (loop->header); phi; phi = PHI_CHAIN (phi))
+ for (gsi = gsi_start_phis (loop->header);
+ !gsi_end_p (gsi);
+ gsi_next (&gsi))
{
+ phi = gsi_stmt (gsi);
phi_arg = PHI_ARG_DEF_FROM_EDGE (phi, entry_e);
if (phi_arg)
add_phi_arg (phi, phi_arg, new_exit_e);
@@ -908,26 +930,26 @@ static edge
slpeel_add_loop_guard (basic_block guard_bb, tree cond, basic_block exit_bb,
basic_block dom_bb)
{
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
edge new_e, enter_e;
- tree cond_stmt;
- tree gimplify_stmt_list;
+ gimple cond_stmt;
+ gimple_seq gimplify_stmt_list = NULL;
enter_e = EDGE_SUCC (guard_bb, 0);
enter_e->flags &= ~EDGE_FALLTHRU;
enter_e->flags |= EDGE_FALSE_VALUE;
- bsi = bsi_last (guard_bb);
+ gsi = gsi_last_bb (guard_bb);
cond =
force_gimple_operand (cond, &gimplify_stmt_list, true,
NULL_TREE);
- cond_stmt = build3 (COND_EXPR, void_type_node, cond,
- NULL_TREE, NULL_TREE);
+ cond_stmt = gimple_build_cond (NE_EXPR, cond, integer_zero_node,
+ NULL_TREE, NULL_TREE);
if (gimplify_stmt_list)
- bsi_insert_after (&bsi, gimplify_stmt_list, BSI_NEW_STMT);
+ gsi_insert_seq_after (&gsi, gimplify_stmt_list, GSI_NEW_STMT);
- bsi = bsi_last (guard_bb);
- bsi_insert_after (&bsi, cond_stmt, BSI_NEW_STMT);
+ gsi = gsi_last_bb (guard_bb);
+ gsi_insert_after (&gsi, cond_stmt, GSI_NEW_STMT);
/* Add new edge to connect guard block to the merge/loop-exit block. */
new_e = make_edge (guard_bb, exit_bb, EDGE_TRUE_VALUE);
@@ -949,8 +971,8 @@ slpeel_can_duplicate_loop_p (const struct loop *loop, const_edge e)
{
edge exit_e = single_exit (loop);
edge entry_e = loop_preheader_edge (loop);
- tree orig_cond = get_loop_exit_condition (loop);
- block_stmt_iterator loop_exit_bsi = bsi_last (exit_e->src);
+ gimple orig_cond = get_loop_exit_condition (loop);
+ gimple_stmt_iterator loop_exit_gsi = gsi_last_bb (exit_e->src);
if (need_ssa_update_p ())
return false;
@@ -963,7 +985,7 @@ slpeel_can_duplicate_loop_p (const struct loop *loop, const_edge e)
|| !empty_block_p (loop->latch)
|| !single_exit (loop)
/* Verify that new loop exit condition can be trivially modified. */
- || (!orig_cond || orig_cond != bsi_stmt (loop_exit_bsi))
+ || (!orig_cond || orig_cond != gsi_stmt (loop_exit_gsi))
|| (e != exit_e && e != entry_e))
return false;
@@ -1017,12 +1039,12 @@ set_prologue_iterations (basic_block bb_before_first_loop,
{
edge e;
basic_block cond_bb, then_bb;
- tree var, prologue_after_cost_adjust_name, stmt;
- block_stmt_iterator bsi;
- tree newphi;
+ tree var, prologue_after_cost_adjust_name;
+ gimple_stmt_iterator gsi;
+ gimple newphi;
edge e_true, e_false, e_fallthru;
- tree cond_stmt;
- tree gimplify_stmt_list;
+ gimple cond_stmt;
+ gimple_seq gimplify_stmt_list = NULL, stmts = NULL;
tree cost_pre_condition = NULL_TREE;
tree scalar_loop_iters =
unshare_expr (LOOP_VINFO_NITERS_UNCHANGED (loop_vec_info_for_loop (loop)));
@@ -1050,25 +1072,25 @@ set_prologue_iterations (basic_block bb_before_first_loop,
cost_pre_condition =
force_gimple_operand (cost_pre_condition, &gimplify_stmt_list,
true, NULL_TREE);
- cond_stmt = build3 (COND_EXPR, void_type_node, cost_pre_condition,
- NULL_TREE, NULL_TREE);
+ cond_stmt = gimple_build_cond (NE_EXPR, cost_pre_condition,
+ integer_zero_node, NULL_TREE, NULL_TREE);
- bsi = bsi_last (cond_bb);
+ gsi = gsi_last_bb (cond_bb);
if (gimplify_stmt_list)
- bsi_insert_after (&bsi, gimplify_stmt_list, BSI_NEW_STMT);
+ gsi_insert_seq_after (&gsi, gimplify_stmt_list, GSI_NEW_STMT);
- bsi = bsi_last (cond_bb);
- bsi_insert_after (&bsi, cond_stmt, BSI_NEW_STMT);
+ gsi = gsi_last_bb (cond_bb);
+ gsi_insert_after (&gsi, cond_stmt, GSI_NEW_STMT);
var = create_tmp_var (TREE_TYPE (scalar_loop_iters),
"prologue_after_cost_adjust");
add_referenced_var (var);
prologue_after_cost_adjust_name =
- force_gimple_operand (scalar_loop_iters, &stmt, false, var);
+ force_gimple_operand (scalar_loop_iters, &stmts, false, var);
- bsi = bsi_last (then_bb);
- if (stmt)
- bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
+ gsi = gsi_last_bb (then_bb);
+ if (stmts)
+ gsi_insert_seq_after (&gsi, stmts, GSI_NEW_STMT);
newphi = create_phi_node (var, bb_before_first_loop);
add_phi_arg (newphi, prologue_after_cost_adjust_name, e_fallthru);
@@ -1150,7 +1172,7 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop,
cfg_hooks->split_edge, the function tree_split_edge
is actually called and, when calling cfg_hooks->duplicate_block,
the function tree_duplicate_bb is called. */
- tree_register_cfg_hooks ();
+ gimple_register_cfg_hooks ();
/* 1. Generate a copy of LOOP and put it on E (E is the entry/exit of LOOP).
@@ -1381,18 +1403,17 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop,
LOC
find_loop_location (struct loop *loop)
{
- tree node = NULL_TREE;
+ gimple stmt = NULL;
basic_block bb;
- block_stmt_iterator si;
+ gimple_stmt_iterator si;
if (!loop)
return UNKNOWN_LOC;
- node = get_loop_exit_condition (loop);
+ stmt = get_loop_exit_condition (loop);
- if (node && CAN_HAVE_LOCATION_P (node) && EXPR_HAS_LOCATION (node)
- && EXPR_FILENAME (node) && EXPR_LINENO (node))
- return EXPR_LOC (node);
+ if (stmt && gimple_location (stmt) != UNKNOWN_LOC)
+ return gimple_location (stmt);
/* If we got here the loop is probably not "well formed",
try to estimate the loop location */
@@ -1402,11 +1423,11 @@ find_loop_location (struct loop *loop)
bb = loop->header;
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
- node = bsi_stmt (si);
- if (node && CAN_HAVE_LOCATION_P (node) && EXPR_HAS_LOCATION (node))
- return EXPR_LOC (node);
+ stmt = gsi_stmt (si);
+ if (gimple_location (stmt) != UNKNOWN_LOC)
+ return gimple_location (stmt);
}
return UNKNOWN_LOC;
@@ -1504,7 +1525,7 @@ vect_print_dump_info (enum verbosity_levels vl)
Create and initialize a new stmt_vec_info struct for STMT. */
stmt_vec_info
-new_stmt_vec_info (tree stmt, loop_vec_info loop_vinfo)
+new_stmt_vec_info (gimple stmt, loop_vec_info loop_vinfo)
{
stmt_vec_info res;
res = (stmt_vec_info) xcalloc (1, sizeof (struct _stmt_vec_info));
@@ -1526,7 +1547,8 @@ new_stmt_vec_info (tree stmt, loop_vec_info loop_vinfo)
STMT_VINFO_DR_STEP (res) = NULL;
STMT_VINFO_DR_ALIGNED_TO (res) = NULL;
- if (TREE_CODE (stmt) == PHI_NODE && is_loop_header_bb_p (bb_for_stmt (stmt)))
+ if (gimple_code (stmt) == GIMPLE_PHI
+ && is_loop_header_bb_p (gimple_bb (stmt)))
STMT_VINFO_DEF_TYPE (res) = vect_unknown_def_type;
else
STMT_VINFO_DEF_TYPE (res) = vect_loop_def;
@@ -1534,22 +1556,39 @@ new_stmt_vec_info (tree stmt, loop_vec_info loop_vinfo)
STMT_VINFO_INSIDE_OF_LOOP_COST (res) = 0;
STMT_VINFO_OUTSIDE_OF_LOOP_COST (res) = 0;
STMT_SLP_TYPE (res) = 0;
- DR_GROUP_FIRST_DR (res) = NULL_TREE;
- DR_GROUP_NEXT_DR (res) = NULL_TREE;
+ DR_GROUP_FIRST_DR (res) = NULL;
+ DR_GROUP_NEXT_DR (res) = NULL;
DR_GROUP_SIZE (res) = 0;
DR_GROUP_STORE_COUNT (res) = 0;
DR_GROUP_GAP (res) = 0;
- DR_GROUP_SAME_DR_STMT (res) = NULL_TREE;
+ DR_GROUP_SAME_DR_STMT (res) = NULL;
DR_GROUP_READ_WRITE_DEPENDENCE (res) = false;
return res;
}
+/* Create a hash table for stmt_vec_info. */
+
+void
+init_stmt_vec_info_vec (void)
+{
+ gcc_assert (!stmt_vec_info_vec);
+ stmt_vec_info_vec = VEC_alloc (vec_void_p, heap, 50);
+}
+
+/* Free hash table for stmt_vec_info. */
+
+void
+free_stmt_vec_info_vec (void)
+{
+ gcc_assert (stmt_vec_info_vec);
+ VEC_free (vec_void_p, heap, stmt_vec_info_vec);
+}
/* Free stmt vectorization related info. */
void
-free_stmt_vec_info (tree stmt)
+free_stmt_vec_info (gimple stmt)
{
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
@@ -1557,8 +1596,8 @@ free_stmt_vec_info (tree stmt)
return;
VEC_free (dr_p, heap, STMT_VINFO_SAME_ALIGN_REFS (stmt_info));
+ set_vinfo_for_stmt (stmt, NULL);
free (stmt_info);
- set_stmt_info (stmt_ann (stmt), NULL);
}
@@ -1586,7 +1625,7 @@ new_loop_vec_info (struct loop *loop)
{
loop_vec_info res;
basic_block *bbs;
- block_stmt_iterator si;
+ gimple_stmt_iterator si;
unsigned int i, nbbs;
res = (loop_vec_info) xcalloc (1, sizeof (struct _loop_vec_info));
@@ -1598,7 +1637,6 @@ new_loop_vec_info (struct loop *loop)
for (i = 0; i < loop->num_nodes; i++)
{
basic_block bb = bbs[i];
- tree phi;
/* BBs in a nested inner-loop will have been already processed (because
we will have called vect_analyze_loop_form for any nested inner-loop).
@@ -1611,18 +1649,21 @@ new_loop_vec_info (struct loop *loop)
{
/* Inner-loop bb. */
gcc_assert (loop->inner && bb->loop_father == loop->inner);
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
{
+ gimple phi = gsi_stmt (si);
stmt_vec_info stmt_info = vinfo_for_stmt (phi);
- loop_vec_info inner_loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
+ loop_vec_info inner_loop_vinfo =
+ STMT_VINFO_LOOP_VINFO (stmt_info);
gcc_assert (loop->inner == LOOP_VINFO_LOOP (inner_loop_vinfo));
STMT_VINFO_LOOP_VINFO (stmt_info) = res;
}
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
- tree stmt = bsi_stmt (si);
+ gimple stmt = gsi_stmt (si);
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
- loop_vec_info inner_loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
+ loop_vec_info inner_loop_vinfo =
+ STMT_VINFO_LOOP_VINFO (stmt_info);
gcc_assert (loop->inner == LOOP_VINFO_LOOP (inner_loop_vinfo));
STMT_VINFO_LOOP_VINFO (stmt_info) = res;
}
@@ -1630,17 +1671,18 @@ new_loop_vec_info (struct loop *loop)
else
{
/* bb in current nest. */
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
{
- stmt_ann_t ann = get_stmt_ann (phi);
- set_stmt_info (ann, new_stmt_vec_info (phi, res));
+ gimple phi = gsi_stmt (si);
+ gimple_set_uid (phi, 0);
+ set_vinfo_for_stmt (phi, new_stmt_vec_info (phi, res));
}
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
- tree stmt = bsi_stmt (si);
- stmt_ann_t ann = stmt_ann (stmt);
- set_stmt_info (ann, new_stmt_vec_info (stmt, res));
+ gimple stmt = gsi_stmt (si);
+ gimple_set_uid (stmt, 0);
+ set_vinfo_for_stmt (stmt, new_stmt_vec_info (stmt, res));
}
}
}
@@ -1667,10 +1709,12 @@ new_loop_vec_info (struct loop *loop)
LOOP_VINFO_DDRS (res) = VEC_alloc (ddr_p, heap, 10 * 10);
LOOP_VINFO_UNALIGNED_DR (res) = NULL;
LOOP_VINFO_MAY_MISALIGN_STMTS (res) =
- VEC_alloc (tree, heap, PARAM_VALUE (PARAM_VECT_MAX_VERSION_FOR_ALIGNMENT_CHECKS));
+ VEC_alloc (gimple, heap,
+ PARAM_VALUE (PARAM_VECT_MAX_VERSION_FOR_ALIGNMENT_CHECKS));
LOOP_VINFO_MAY_ALIAS_DDRS (res) =
- VEC_alloc (ddr_p, heap, PARAM_VALUE (PARAM_VECT_MAX_VERSION_FOR_ALIAS_CHECKS));
- LOOP_VINFO_STRIDED_STORES (res) = VEC_alloc (tree, heap, 10);
+ VEC_alloc (ddr_p, heap,
+ PARAM_VALUE (PARAM_VECT_MAX_VERSION_FOR_ALIAS_CHECKS));
+ LOOP_VINFO_STRIDED_STORES (res) = VEC_alloc (gimple, heap, 10);
LOOP_VINFO_SLP_INSTANCES (res) = VEC_alloc (slp_instance, heap, 10);
LOOP_VINFO_SLP_UNROLLING_FACTOR (res) = 1;
@@ -1689,7 +1733,7 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo, bool clean_stmts)
struct loop *loop;
basic_block *bbs;
int nbbs;
- block_stmt_iterator si;
+ gimple_stmt_iterator si;
int j;
VEC (slp_instance, heap) *slp_instances;
slp_instance instance;
@@ -1707,7 +1751,7 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo, bool clean_stmts)
free (LOOP_VINFO_BBS (loop_vinfo));
free_data_refs (LOOP_VINFO_DATAREFS (loop_vinfo));
free_dependence_relations (LOOP_VINFO_DDRS (loop_vinfo));
- VEC_free (tree, heap, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo));
+ VEC_free (gimple, heap, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo));
free (loop_vinfo);
loop->aux = NULL;
@@ -1717,14 +1761,13 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo, bool clean_stmts)
for (j = 0; j < nbbs; j++)
{
basic_block bb = bbs[j];
- tree phi;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- free_stmt_vec_info (phi);
+ for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
+ free_stmt_vec_info (gsi_stmt (si));
- for (si = bsi_start (bb); !bsi_end_p (si); )
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); )
{
- tree stmt = bsi_stmt (si);
+ gimple stmt = gsi_stmt (si);
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
if (stmt_info)
@@ -1732,7 +1775,7 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo, bool clean_stmts)
/* Check if this is a "pattern stmt" (introduced by the
vectorizer during the pattern recognition pass). */
bool remove_stmt_p = false;
- tree orig_stmt = STMT_VINFO_RELATED_STMT (stmt_info);
+ gimple orig_stmt = STMT_VINFO_RELATED_STMT (stmt_info);
if (orig_stmt)
{
stmt_vec_info orig_stmt_info = vinfo_for_stmt (orig_stmt);
@@ -1746,22 +1789,23 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo, bool clean_stmts)
/* Remove dead "pattern stmts". */
if (remove_stmt_p)
- bsi_remove (&si, true);
+ gsi_remove (&si, true);
}
- bsi_next (&si);
+ gsi_next (&si);
}
}
free (LOOP_VINFO_BBS (loop_vinfo));
free_data_refs (LOOP_VINFO_DATAREFS (loop_vinfo));
free_dependence_relations (LOOP_VINFO_DDRS (loop_vinfo));
- VEC_free (tree, heap, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo));
+ VEC_free (gimple, heap, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo));
VEC_free (ddr_p, heap, LOOP_VINFO_MAY_ALIAS_DDRS (loop_vinfo));
slp_instances = LOOP_VINFO_SLP_INSTANCES (loop_vinfo);
for (j = 0; VEC_iterate (slp_instance, slp_instances, j, instance); j++)
- vect_free_slp_tree (SLP_INSTANCE_TREE (instance));
+ vect_free_slp_instance (instance);
+
VEC_free (slp_instance, heap, LOOP_VINFO_SLP_INSTANCES (loop_vinfo));
- VEC_free (tree, heap, LOOP_VINFO_STRIDED_STORES (loop_vinfo));
+ VEC_free (gimple, heap, LOOP_VINFO_STRIDED_STORES (loop_vinfo));
free (loop_vinfo);
loop->aux = NULL;
@@ -1788,9 +1832,7 @@ vect_can_force_dr_alignment_p (const_tree decl, unsigned int alignment)
if (TREE_STATIC (decl))
return (alignment <= MAX_OFILE_ALIGNMENT);
else
- /* This used to be PREFERRED_STACK_BOUNDARY, however, that is not 100%
- correct until someone implements forced stack alignment. */
- return (alignment <= STACK_BOUNDARY);
+ return (alignment <= MAX_STACK_ALIGNMENT);
}
@@ -1850,7 +1892,7 @@ get_vectype_for_scalar_type (tree scalar_type)
enum dr_alignment_support
vect_supportable_dr_alignment (struct data_reference *dr)
{
- tree stmt = DR_STMT (dr);
+ gimple stmt = DR_STMT (dr);
stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
enum machine_mode mode = (int) TYPE_MODE (vectype);
@@ -1972,14 +2014,14 @@ vect_supportable_dr_alignment (struct data_reference *dr)
in reduction/induction computations). */
bool
-vect_is_simple_use (tree operand, loop_vec_info loop_vinfo, tree *def_stmt,
+vect_is_simple_use (tree operand, loop_vec_info loop_vinfo, gimple *def_stmt,
tree *def, enum vect_def_type *dt)
{
basic_block bb;
stmt_vec_info stmt_vinfo;
struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- *def_stmt = NULL_TREE;
+ *def_stmt = NULL;
*def = NULL_TREE;
if (vect_print_dump_info (REPORT_DETAILS))
@@ -2014,7 +2056,7 @@ vect_is_simple_use (tree operand, loop_vec_info loop_vinfo, tree *def_stmt,
}
*def_stmt = SSA_NAME_DEF_STMT (operand);
- if (*def_stmt == NULL_TREE )
+ if (*def_stmt == NULL)
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "no def_stmt.");
@@ -2024,27 +2066,19 @@ vect_is_simple_use (tree operand, loop_vec_info loop_vinfo, tree *def_stmt,
if (vect_print_dump_info (REPORT_DETAILS))
{
fprintf (vect_dump, "def_stmt: ");
- print_generic_expr (vect_dump, *def_stmt, TDF_SLIM);
+ print_gimple_stmt (vect_dump, *def_stmt, 0, TDF_SLIM);
}
/* empty stmt is expected only in case of a function argument.
- (Otherwise - we expect a phi_node or a GIMPLE_MODIFY_STMT). */
- if (IS_EMPTY_STMT (*def_stmt))
+ (Otherwise - we expect a phi_node or a GIMPLE_ASSIGN). */
+ if (gimple_nop_p (*def_stmt))
{
- tree arg = TREE_OPERAND (*def_stmt, 0);
- if (is_gimple_min_invariant (arg))
- {
- *def = operand;
- *dt = vect_invariant_def;
- return true;
- }
-
- if (vect_print_dump_info (REPORT_DETAILS))
- fprintf (vect_dump, "Unexpected empty stmt.");
- return false;
+ *def = operand;
+ *dt = vect_invariant_def;
+ return true;
}
- bb = bb_for_stmt (*def_stmt);
+ bb = gimple_bb (*def_stmt);
if (!flow_bb_inside_loop_p (loop, bb))
*dt = vect_invariant_def;
else
@@ -2063,16 +2097,21 @@ vect_is_simple_use (tree operand, loop_vec_info loop_vinfo, tree *def_stmt,
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "type of def: %d.",*dt);
- switch (TREE_CODE (*def_stmt))
+ switch (gimple_code (*def_stmt))
{
- case PHI_NODE:
- *def = PHI_RESULT (*def_stmt);
+ case GIMPLE_PHI:
+ *def = gimple_phi_result (*def_stmt);
break;
- case GIMPLE_MODIFY_STMT:
- *def = GIMPLE_STMT_OPERAND (*def_stmt, 0);
+ case GIMPLE_ASSIGN:
+ *def = gimple_assign_lhs (*def_stmt);
break;
+ case GIMPLE_CALL:
+ *def = gimple_call_lhs (*def_stmt);
+ if (*def != NULL)
+ break;
+ /* FALLTHRU */
default:
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "unsupported defining stmt: ");
@@ -2099,22 +2138,28 @@ vect_is_simple_use (tree operand, loop_vec_info loop_vinfo, tree *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, tree stmt, tree vectype,
+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 expr = GIMPLE_STMT_OPERAND (stmt, 1);
- tree type = TREE_TYPE (expr);
+ tree type = gimple_expr_type (stmt);
tree wide_vectype = get_vectype_for_scalar_type (type);
enum tree_code c1, c2;
@@ -2228,12 +2273,65 @@ supportable_widening_operation (enum tree_code code, tree 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;
@@ -2252,20 +2350,27 @@ supportable_widening_operation (enum tree_code code, tree 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_tree 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;
- tree expr = GIMPLE_STMT_OPERAND (stmt, 1);
- tree type = TREE_TYPE (expr);
+ 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)
{
@@ -2296,10 +2401,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;
}
@@ -2340,6 +2486,15 @@ reduction_code_for_scalar_code (enum tree_code code,
}
}
+/* Error reporting helper for vect_is_simple_reduction below. GIMPLE statement
+ STMT is printed with a message MSG. */
+
+static void
+report_vect_op (gimple stmt, const char *msg)
+{
+ fprintf (vect_dump, "%s", msg);
+ print_gimple_stmt (vect_dump, stmt, 0, TDF_SLIM);
+}
/* Function vect_is_simple_reduction
@@ -2360,17 +2515,16 @@ reduction_code_for_scalar_code (enum tree_code code,
Condition 1 is tested here.
Conditions 2,3 are tested in vect_mark_stmts_to_be_vectorized. */
-tree
-vect_is_simple_reduction (loop_vec_info loop_info, tree phi)
+gimple
+vect_is_simple_reduction (loop_vec_info loop_info, gimple phi)
{
- struct loop *loop = (bb_for_stmt (phi))->loop_father;
+ struct loop *loop = (gimple_bb (phi))->loop_father;
struct loop *vect_loop = LOOP_VINFO_LOOP (loop_info);
edge latch_e = loop_latch_edge (loop);
tree loop_arg = PHI_ARG_DEF_FROM_EDGE (phi, latch_e);
- tree def_stmt, def1, def2;
+ gimple def_stmt, def1, def2;
enum tree_code code;
- int op_type;
- tree operation, op1, op2;
+ tree op1, op2;
tree type;
int nloop_uses;
tree name;
@@ -2383,8 +2537,8 @@ vect_is_simple_reduction (loop_vec_info loop_info, tree phi)
nloop_uses = 0;
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, name)
{
- tree use_stmt = USE_STMT (use_p);
- if (flow_bb_inside_loop_p (loop, bb_for_stmt (use_stmt))
+ gimple use_stmt = USE_STMT (use_p);
+ if (flow_bb_inside_loop_p (loop, gimple_bb (use_stmt))
&& vinfo_for_stmt (use_stmt)
&& !is_pattern_stmt_p (vinfo_for_stmt (use_stmt)))
nloop_uses++;
@@ -2392,7 +2546,7 @@ vect_is_simple_reduction (loop_vec_info loop_info, tree phi)
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "reduction used in loop.");
- return NULL_TREE;
+ return NULL;
}
}
@@ -2403,7 +2557,7 @@ vect_is_simple_reduction (loop_vec_info loop_info, tree phi)
fprintf (vect_dump, "reduction: not ssa_name: ");
print_generic_expr (vect_dump, loop_arg, TDF_SLIM);
}
- return NULL_TREE;
+ return NULL;
}
def_stmt = SSA_NAME_DEF_STMT (loop_arg);
@@ -2411,22 +2565,22 @@ vect_is_simple_reduction (loop_vec_info loop_info, tree phi)
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "reduction: no def_stmt.");
- return NULL_TREE;
+ return NULL;
}
- if (TREE_CODE (def_stmt) != GIMPLE_MODIFY_STMT)
+ if (!is_gimple_assign (def_stmt))
{
if (vect_print_dump_info (REPORT_DETAILS))
- print_generic_expr (vect_dump, def_stmt, TDF_SLIM);
- return NULL_TREE;
+ print_gimple_stmt (vect_dump, def_stmt, 0, TDF_SLIM);
+ return NULL;
}
- name = GIMPLE_STMT_OPERAND (def_stmt, 0);
+ name = gimple_assign_lhs (def_stmt);
nloop_uses = 0;
FOR_EACH_IMM_USE_FAST (use_p, imm_iter, name)
{
- tree use_stmt = USE_STMT (use_p);
- if (flow_bb_inside_loop_p (loop, bb_for_stmt (use_stmt))
+ gimple use_stmt = USE_STMT (use_p);
+ if (flow_bb_inside_loop_p (loop, gimple_bb (use_stmt))
&& vinfo_for_stmt (use_stmt)
&& !is_pattern_stmt_p (vinfo_for_stmt (use_stmt)))
nloop_uses++;
@@ -2434,47 +2588,37 @@ vect_is_simple_reduction (loop_vec_info loop_info, tree phi)
{
if (vect_print_dump_info (REPORT_DETAILS))
fprintf (vect_dump, "reduction used in loop.");
- return NULL_TREE;
+ return NULL;
}
}
- operation = GIMPLE_STMT_OPERAND (def_stmt, 1);
- code = TREE_CODE (operation);
+ code = gimple_assign_rhs_code (def_stmt);
+
if (!commutative_tree_code (code) || !associative_tree_code (code))
{
if (vect_print_dump_info (REPORT_DETAILS))
- {
- fprintf (vect_dump, "reduction: not commutative/associative: ");
- print_generic_expr (vect_dump, operation, TDF_SLIM);
- }
- return NULL_TREE;
+ report_vect_op (def_stmt, "reduction: not commutative/associative: ");
+ return NULL;
}
- op_type = TREE_OPERAND_LENGTH (operation);
- if (op_type != binary_op)
+ if (get_gimple_rhs_class (code) != GIMPLE_BINARY_RHS)
{
if (vect_print_dump_info (REPORT_DETAILS))
- {
- fprintf (vect_dump, "reduction: not binary operation: ");
- print_generic_expr (vect_dump, operation, TDF_SLIM);
- }
- return NULL_TREE;
+ report_vect_op (def_stmt, "reduction: not binary operation: ");
+ return NULL;
}
- op1 = TREE_OPERAND (operation, 0);
- op2 = TREE_OPERAND (operation, 1);
+ op1 = gimple_assign_rhs1 (def_stmt);
+ op2 = gimple_assign_rhs2 (def_stmt);
if (TREE_CODE (op1) != SSA_NAME || TREE_CODE (op2) != SSA_NAME)
{
if (vect_print_dump_info (REPORT_DETAILS))
- {
- fprintf (vect_dump, "reduction: uses not ssa_names: ");
- print_generic_expr (vect_dump, operation, TDF_SLIM);
- }
- return NULL_TREE;
+ report_vect_op (def_stmt, "reduction: uses not ssa_names: ");
+ return NULL;
}
/* Check that it's ok to change the order of the computation. */
- type = TREE_TYPE (operation);
+ type = TREE_TYPE (gimple_assign_lhs (def_stmt));
if (TYPE_MAIN_VARIANT (type) != TYPE_MAIN_VARIANT (TREE_TYPE (op1))
|| TYPE_MAIN_VARIANT (type) != TYPE_MAIN_VARIANT (TREE_TYPE (op2)))
{
@@ -2487,7 +2631,7 @@ vect_is_simple_reduction (loop_vec_info loop_info, tree phi)
fprintf (vect_dump, ",");
print_generic_expr (vect_dump, TREE_TYPE (op2), TDF_SLIM);
}
- return NULL_TREE;
+ return NULL;
}
/* Generally, when vectorizing a reduction we change the order of the
@@ -2503,32 +2647,24 @@ vect_is_simple_reduction (loop_vec_info loop_info, tree phi)
{
/* Changing the order of operations changes the semantics. */
if (vect_print_dump_info (REPORT_DETAILS))
- {
- fprintf (vect_dump, "reduction: unsafe fp math optimization: ");
- print_generic_expr (vect_dump, operation, TDF_SLIM);
- }
- return NULL_TREE;
+ report_vect_op (def_stmt, "reduction: unsafe fp math optimization: ");
+ return NULL;
}
else if (INTEGRAL_TYPE_P (type) && TYPE_OVERFLOW_TRAPS (type)
&& !nested_in_vect_loop_p (vect_loop, def_stmt))
{
/* Changing the order of operations changes the semantics. */
if (vect_print_dump_info (REPORT_DETAILS))
- {
- fprintf (vect_dump, "reduction: unsafe int math optimization: ");
- print_generic_expr (vect_dump, operation, TDF_SLIM);
- }
- return NULL_TREE;
+ report_vect_op (def_stmt, "reduction: unsafe int math optimization: ");
+ return NULL;
}
else if (SAT_FIXED_POINT_TYPE_P (type))
{
/* Changing the order of operations changes the semantics. */
if (vect_print_dump_info (REPORT_DETAILS))
- {
- fprintf (vect_dump, "reduction: unsafe fixed-point math optimization: ");
- print_generic_expr (vect_dump, operation, TDF_SLIM);
- }
- return NULL_TREE;
+ report_vect_op (def_stmt,
+ "reduction: unsafe fixed-point math optimization: ");
+ return NULL;
}
/* reduction is safe. we're dealing with one of the following:
@@ -2537,14 +2673,11 @@ vect_is_simple_reduction (loop_vec_info loop_info, tree phi)
*/
def1 = SSA_NAME_DEF_STMT (op1);
def2 = SSA_NAME_DEF_STMT (op2);
- if (!def1 || !def2 || IS_EMPTY_STMT (def1) || IS_EMPTY_STMT (def2))
+ if (!def1 || !def2 || gimple_nop_p (def1) || gimple_nop_p (def2))
{
if (vect_print_dump_info (REPORT_DETAILS))
- {
- fprintf (vect_dump, "reduction: no defs for operands: ");
- print_generic_expr (vect_dump, operation, TDF_SLIM);
- }
- return NULL_TREE;
+ report_vect_op (def_stmt, "reduction: no defs for operands: ");
+ return NULL;
}
@@ -2553,48 +2686,40 @@ vect_is_simple_reduction (loop_vec_info loop_info, tree phi)
or it's an induction (defined by a loop-header phi-node). */
if (def2 == phi
- && flow_bb_inside_loop_p (loop, bb_for_stmt (def1))
- && (TREE_CODE (def1) == GIMPLE_MODIFY_STMT
+ && flow_bb_inside_loop_p (loop, gimple_bb (def1))
+ && (is_gimple_assign (def1)
|| STMT_VINFO_DEF_TYPE (vinfo_for_stmt (def1)) == vect_induction_def
- || (TREE_CODE (def1) == PHI_NODE
+ || (gimple_code (def1) == GIMPLE_PHI
&& STMT_VINFO_DEF_TYPE (vinfo_for_stmt (def1)) == vect_loop_def
- && !is_loop_header_bb_p (bb_for_stmt (def1)))))
+ && !is_loop_header_bb_p (gimple_bb (def1)))))
{
if (vect_print_dump_info (REPORT_DETAILS))
- {
- fprintf (vect_dump, "detected reduction:");
- print_generic_expr (vect_dump, operation, TDF_SLIM);
- }
+ report_vect_op (def_stmt, "detected reduction:");
return def_stmt;
}
else if (def1 == phi
- && flow_bb_inside_loop_p (loop, bb_for_stmt (def2))
- && (TREE_CODE (def2) == GIMPLE_MODIFY_STMT
+ && flow_bb_inside_loop_p (loop, gimple_bb (def2))
+ && (is_gimple_assign (def2)
|| STMT_VINFO_DEF_TYPE (vinfo_for_stmt (def2)) == vect_induction_def
- || (TREE_CODE (def2) == PHI_NODE
+ || (gimple_code (def2) == GIMPLE_PHI
&& STMT_VINFO_DEF_TYPE (vinfo_for_stmt (def2)) == vect_loop_def
- && !is_loop_header_bb_p (bb_for_stmt (def2)))))
+ && !is_loop_header_bb_p (gimple_bb (def2)))))
{
/* Swap operands (just for simplicity - so that the rest of the code
can assume that the reduction variable is always the last (second)
argument). */
if (vect_print_dump_info (REPORT_DETAILS))
- {
- fprintf (vect_dump, "detected reduction: need to swap operands:");
- print_generic_expr (vect_dump, operation, TDF_SLIM);
- }
- swap_tree_operands (def_stmt, &TREE_OPERAND (operation, 0),
- &TREE_OPERAND (operation, 1));
+ report_vect_op (def_stmt ,
+ "detected reduction: need to swap operands:");
+ swap_tree_operands (def_stmt, gimple_assign_rhs1_ptr (def_stmt),
+ gimple_assign_rhs2_ptr (def_stmt));
return def_stmt;
}
else
{
if (vect_print_dump_info (REPORT_DETAILS))
- {
- fprintf (vect_dump, "reduction: unknown pattern.");
- print_generic_expr (vect_dump, operation, TDF_SLIM);
- }
- return NULL_TREE;
+ report_vect_op (def_stmt, "reduction: unknown pattern.");
+ return NULL;
}
}
@@ -2673,25 +2798,28 @@ vectorize_loops (void)
need to be renamed. */
vect_memsyms_to_rename = BITMAP_ALLOC (NULL);
+ init_stmt_vec_info_vec ();
+
/* ----------- Analyze loops. ----------- */
/* If some loop was duplicated, it gets bigger number
than all previously defined loops. This fact allows us to run
only over initial loops skipping newly generated ones. */
FOR_EACH_LOOP (li, loop, 0)
- {
- loop_vec_info loop_vinfo;
+ if (optimize_loop_nest_for_speed_p (loop))
+ {
+ loop_vec_info loop_vinfo;
- vect_loop_location = find_loop_location (loop);
- loop_vinfo = vect_analyze_loop (loop);
- loop->aux = loop_vinfo;
+ vect_loop_location = find_loop_location (loop);
+ loop_vinfo = vect_analyze_loop (loop);
+ loop->aux = loop_vinfo;
- if (!loop_vinfo || !LOOP_VINFO_VECTORIZABLE_P (loop_vinfo))
- continue;
+ if (!loop_vinfo || !LOOP_VINFO_VECTORIZABLE_P (loop_vinfo))
+ continue;
- vect_transform_loop (loop_vinfo);
- num_vectorized_loops++;
- }
+ vect_transform_loop (loop_vinfo);
+ num_vectorized_loops++;
+ }
vect_loop_location = UNKNOWN_LOC;
statistics_counter_event (cfun, "Vectorized loops", num_vectorized_loops);
@@ -2717,6 +2845,8 @@ vectorize_loops (void)
loop->aux = NULL;
}
+ free_stmt_vec_info_vec ();
+
return num_vectorized_loops > 0 ? TODO_cleanup_cfg : 0;
}
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 1c082f85bef..678dc59da72 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -89,9 +89,9 @@ typedef struct _slp_tree {
struct _slp_tree *left;
struct _slp_tree *right;
/* A group of scalar stmts to be vectorized together. */
- VEC (tree, heap) *stmts;
+ VEC (gimple, heap) *stmts;
/* Vectorized stmt/s. */
- VEC (tree, heap) *vec_stmts;
+ VEC (gimple, heap) *vec_stmts;
/* Number of vector stmts that are created to replace the group of scalar
stmts. It is calculated during the transformation phase as the number of
scalar elements in one scalar iteration (GROUP_SIZE) multiplied by VF
@@ -105,6 +105,8 @@ typedef struct _slp_tree {
} cost;
} *slp_tree;
+DEF_VEC_P(slp_tree);
+DEF_VEC_ALLOC_P(slp_tree, heap);
/* SLP instance is a sequence of stmts in a loop that can be packed into
SIMD stmts. */
@@ -124,6 +126,13 @@ typedef struct _slp_instance {
int outside_of_loop; /* Statements generated outside loop. */
int inside_of_loop; /* Statements generated inside loop. */
} cost;
+
+ /* Loads permutation relatively to the stores, NULL if there is no
+ permutation. */
+ VEC (int, heap) *load_permutation;
+
+ /* The group of nodes that contain loads of this SLP instance. */
+ VEC (slp_tree, heap) *loads;
} *slp_instance;
DEF_VEC_P(slp_instance);
@@ -135,6 +144,8 @@ DEF_VEC_ALLOC_P(slp_instance, heap);
#define SLP_INSTANCE_UNROLLING_FACTOR(S) (S)->unrolling_factor
#define SLP_INSTANCE_OUTSIDE_OF_LOOP_COST(S) (S)->cost.outside_of_loop
#define SLP_INSTANCE_INSIDE_OF_LOOP_COST(S) (S)->cost.inside_of_loop
+#define SLP_INSTANCE_LOAD_PERMUTATION(S) (S)->load_permutation
+#define SLP_INSTANCE_LOADS(S) (S)->loads
#define SLP_TREE_LEFT(S) (S)->left
#define SLP_TREE_RIGHT(S) (S)->right
@@ -200,14 +211,14 @@ typedef struct _loop_vec_info {
/* Statements in the loop that have data references that are candidates for a
runtime (loop versioning) misalignment check. */
- VEC(tree,heap) *may_misalign_stmts;
+ VEC(gimple,heap) *may_misalign_stmts;
/* The loop location in the source. */
LOC loop_line_number;
/* All interleaving chains of stores in the loop, represented by the first
stmt in the chain. */
- VEC(tree, heap) *strided_stores;
+ VEC(gimple, heap) *strided_stores;
/* All SLP instances in the loop. This is a subset of the set of STRIDED_STORES
of the loop. */
@@ -255,10 +266,10 @@ loop_vec_info_for_loop (struct loop *loop)
}
static inline bool
-nested_in_vect_loop_p (struct loop *loop, tree stmt)
+nested_in_vect_loop_p (struct loop *loop, gimple stmt)
{
return (loop->inner
- && (loop->inner == (bb_for_stmt (stmt))->loop_father));
+ && (loop->inner == (gimple_bb (stmt))->loop_father));
}
/*-----------------------------------------------------------------*/
@@ -329,7 +340,7 @@ typedef struct _stmt_vec_info {
enum stmt_vec_info_type type;
/* The stmt to which this info struct refers to. */
- tree stmt;
+ gimple stmt;
/* The loop_vec_info with respect to which STMT is vectorized. */
loop_vec_info loop_vinfo;
@@ -347,7 +358,7 @@ typedef struct _stmt_vec_info {
tree vectype;
/* The vectorized version of the stmt. */
- tree vectorized_stmt;
+ gimple vectorized_stmt;
/** The following is relevant only for stmts that contain a non-scalar
@@ -378,7 +389,7 @@ typedef struct _stmt_vec_info {
related_stmt of the "pattern stmt" points back to this stmt (which is
the last stmt in the original sequence of stmts that constitutes the
pattern). */
- tree related_stmt;
+ gimple related_stmt;
/* List of datarefs that are known to have the same alignment as the dataref
of this stmt. */
@@ -389,9 +400,9 @@ typedef struct _stmt_vec_info {
/* Interleaving info. */
/* First data-ref in the interleaving group. */
- tree first_dr;
+ gimple first_dr;
/* Pointer to the next data-ref in the group. */
- tree next_dr;
+ gimple next_dr;
/* The size of the interleaving group. */
unsigned int size;
/* For stores, number of stores from this group seen. We vectorize the last
@@ -402,7 +413,7 @@ typedef struct _stmt_vec_info {
unsigned int gap;
/* In case that two or more stmts share data-ref, this is the pointer to the
previously detected stmt with the same dr. */
- tree same_dr_stmt;
+ gimple same_dr_stmt;
/* For loads only, if there is a store with the same location, this field is
TRUE. */
bool read_write_dep;
@@ -522,27 +533,55 @@ typedef struct _stmt_vec_info {
#define TARG_VEC_STORE_COST 1
#endif
-static inline void set_stmt_info (stmt_ann_t ann, stmt_vec_info stmt_info);
-static inline stmt_vec_info vinfo_for_stmt (tree stmt);
+/* Cost of vector permutation. */
+#ifndef TARG_VEC_PERMUTE_COST
+#define TARG_VEC_PERMUTE_COST 1
+#endif
-static inline void
-set_stmt_info (stmt_ann_t ann, stmt_vec_info stmt_info)
+/* 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);
+DEF_VEC_ALLOC_P (vec_void_p, heap);
+
+extern VEC(vec_void_p,heap) *stmt_vec_info_vec;
+
+void init_stmt_vec_info_vec (void);
+void free_stmt_vec_info_vec (void);
+
+static inline stmt_vec_info
+vinfo_for_stmt (gimple stmt)
{
- if (ann)
- ann->common.aux = (char *) stmt_info;
+ unsigned int uid = gimple_uid (stmt);
+ if (uid == 0)
+ return NULL;
+
+ gcc_assert (uid <= VEC_length (vec_void_p, stmt_vec_info_vec));
+ return (stmt_vec_info) VEC_index (vec_void_p, stmt_vec_info_vec, uid - 1);
}
-static inline stmt_vec_info
-vinfo_for_stmt (tree stmt)
+static inline void
+set_vinfo_for_stmt (gimple stmt, stmt_vec_info info)
{
- stmt_ann_t ann = stmt_ann (stmt);
- return ann ? (stmt_vec_info) ann->common.aux : NULL;
+ unsigned int uid = gimple_uid (stmt);
+ if (uid == 0)
+ {
+ gcc_assert (info);
+ uid = VEC_length (vec_void_p, stmt_vec_info_vec) + 1;
+ gimple_set_uid (stmt, uid);
+ VEC_safe_push (vec_void_p, heap, stmt_vec_info_vec, (vec_void_p) info);
+ }
+ else
+ VEC_replace (vec_void_p, stmt_vec_info_vec, uid - 1, (vec_void_p) info);
}
static inline bool
is_pattern_stmt_p (stmt_vec_info stmt_info)
{
- tree related_stmt;
+ gimple related_stmt;
stmt_vec_info related_stmt_info;
related_stmt = STMT_VINFO_RELATED_STMT (stmt_info);
@@ -583,6 +622,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. */
@@ -643,64 +692,75 @@ extern void slpeel_verify_cfg_after_peeling (struct loop *, struct loop *);
*************************************************************************/
/** In tree-vectorizer.c **/
extern tree get_vectype_for_scalar_type (tree);
-extern bool vect_is_simple_use (tree, loop_vec_info, tree *, tree *,
+extern bool vect_is_simple_use (tree, loop_vec_info, gimple *, tree *,
enum vect_def_type *);
extern bool vect_is_simple_iv_evolution (unsigned, tree, tree *, tree *);
-extern tree vect_is_simple_reduction (loop_vec_info, tree);
+extern gimple vect_is_simple_reduction (loop_vec_info, gimple);
extern bool vect_can_force_dr_alignment_p (const_tree, unsigned int);
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, tree, tree,
- tree *, tree *, enum tree_code *, enum tree_code *);
-extern bool supportable_narrowing_operation (enum tree_code, const_tree,
- const_tree, enum tree_code *);
+extern bool supportable_widening_operation (enum tree_code, gimple, tree,
+ tree *, tree *, enum tree_code *, enum tree_code *,
+ int *, VEC (tree, heap) **);
+extern bool supportable_narrowing_operation (enum tree_code, const_gimple,
+ 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);
extern void destroy_loop_vec_info (loop_vec_info, bool);
-extern stmt_vec_info new_stmt_vec_info (tree stmt, loop_vec_info);
-extern void free_stmt_vec_info (tree stmt);
+extern stmt_vec_info new_stmt_vec_info (gimple stmt, loop_vec_info);
+extern void free_stmt_vec_info (gimple stmt);
/** In tree-vect-analyze.c **/
/* Driver for analysis stage. */
extern loop_vec_info vect_analyze_loop (struct loop *);
-extern void vect_free_slp_tree (slp_tree);
+extern void vect_free_slp_instance (slp_instance);
extern loop_vec_info vect_analyze_loop_form (struct loop *);
+extern tree vect_get_smallest_scalar_type (gimple, HOST_WIDE_INT *,
+ HOST_WIDE_INT *);
/** In tree-vect-patterns.c **/
/* Pattern recognition functions.
Additional pattern recognition functions can (and will) be added
in the future. */
-typedef tree (* vect_recog_func_ptr) (tree, tree *, tree *);
+typedef gimple (* vect_recog_func_ptr) (gimple, tree *, tree *);
#define NUM_PATTERNS 4
void vect_pattern_recog (loop_vec_info);
/** In tree-vect-transform.c **/
-extern bool vectorizable_load (tree, block_stmt_iterator *, tree *, slp_tree);
-extern bool vectorizable_store (tree, block_stmt_iterator *, tree *, slp_tree);
-extern bool vectorizable_operation (tree, block_stmt_iterator *, tree *,
+extern bool vectorizable_load (gimple, gimple_stmt_iterator *, gimple *,
+ slp_tree, slp_instance);
+extern bool vectorizable_store (gimple, gimple_stmt_iterator *, gimple *,
+ slp_tree);
+extern bool vectorizable_operation (gimple, gimple_stmt_iterator *, gimple *,
slp_tree);
-extern bool vectorizable_type_promotion (tree, block_stmt_iterator *, tree *);
-extern bool vectorizable_type_demotion (tree, block_stmt_iterator *, tree *);
-extern bool vectorizable_conversion (tree, block_stmt_iterator *,
- tree *, slp_tree);
-extern bool vectorizable_assignment (tree, block_stmt_iterator *, tree *,
+extern bool vectorizable_type_promotion (gimple, gimple_stmt_iterator *,
+ gimple *, slp_tree);
+extern bool vectorizable_type_demotion (gimple, gimple_stmt_iterator *,
+ gimple *, slp_tree);
+extern bool vectorizable_conversion (gimple, gimple_stmt_iterator *, gimple *,
slp_tree);
-extern tree vectorizable_function (tree, tree, tree);
-extern bool vectorizable_call (tree, block_stmt_iterator *, tree *);
-extern bool vectorizable_condition (tree, block_stmt_iterator *, tree *);
-extern bool vectorizable_live_operation (tree, block_stmt_iterator *, tree *);
-extern bool vectorizable_reduction (tree, block_stmt_iterator *, tree *);
-extern bool vectorizable_induction (tree, block_stmt_iterator *, tree *);
+extern bool vectorizable_assignment (gimple, gimple_stmt_iterator *, gimple *,
+ slp_tree);
+extern tree vectorizable_function (gimple, tree, tree);
+extern bool vectorizable_call (gimple, gimple_stmt_iterator *, gimple *);
+extern bool vectorizable_condition (gimple, gimple_stmt_iterator *, gimple *);
+extern bool vectorizable_live_operation (gimple, gimple_stmt_iterator *,
+ gimple *);
+extern bool vectorizable_reduction (gimple, gimple_stmt_iterator *, gimple *);
+extern bool vectorizable_induction (gimple, gimple_stmt_iterator *, gimple *);
extern int vect_estimate_min_profitable_iters (loop_vec_info);
extern void vect_model_simple_cost (stmt_vec_info, int, enum vect_def_type *,
slp_tree);
extern void vect_model_store_cost (stmt_vec_info, int, enum vect_def_type,
slp_tree);
extern void vect_model_load_cost (stmt_vec_info, int, slp_tree);
+extern bool vect_transform_slp_perm_load (gimple, VEC (tree, heap) *,
+ gimple_stmt_iterator *, int, slp_instance, bool);
+
/* Driver for transformation stage. */
extern void vect_transform_loop (loop_vec_info);
diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
index 404531f4504..348382ecae3 100644
--- a/gcc/tree-vrp.c
+++ b/gcc/tree-vrp.c
@@ -38,9 +38,19 @@ along with GCC; see the file COPYING3. If not see
#include "tree-ssa-propagate.h"
#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);
@@ -64,7 +74,7 @@ struct assert_locus_d
edge e;
/* Pointer to the statement that generated this assertion. */
- block_stmt_iterator si;
+ gimple_stmt_iterator si;
/* Predicate code for the ASSERT_EXPR. Must be COMPARISON_CLASS_P. */
enum tree_code comp_code;
@@ -90,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;
@@ -104,7 +110,7 @@ static value_range_t **vr_value;
static int *vr_phi_edge_counts;
typedef struct {
- tree stmt;
+ gimple stmt;
tree vec;
} switch_update;
@@ -276,6 +282,18 @@ is_overflow_infinity (const_tree val)
&& (vrp_val_is_min (val) || vrp_val_is_max (val)));
}
+/* Return whether STMT has a constant rhs that is_overflow_infinity. */
+
+static inline bool
+stmt_overflow_infinity (gimple stmt)
+{
+ if (is_gimple_assign (stmt)
+ && get_gimple_rhs_class (gimple_assign_rhs_code (stmt)) ==
+ GIMPLE_SINGLE_RHS)
+ return is_overflow_infinity (gimple_assign_rhs1 (stmt));
+ return false;
+}
+
/* If VAL is now an overflow infinity, return VAL. Otherwise, return
the same value with TREE_OVERFLOW clear. This can be used to avoid
confusing a regular value with an overflow value. */
@@ -777,21 +795,143 @@ vrp_expr_computes_nonnegative (tree expr, bool *strict_overflow_p)
&& ssa_name_nonnegative_p (expr)));
}
+/* Return true if the result of assignment STMT is know to be non-negative.
+ If the return value is based on the assumption that signed overflow is
+ undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't change
+ *STRICT_OVERFLOW_P.*/
+
+static bool
+gimple_assign_nonnegative_warnv_p (gimple stmt, bool *strict_overflow_p)
+{
+ enum tree_code code = gimple_assign_rhs_code (stmt);
+ switch (get_gimple_rhs_class (code))
+ {
+ case GIMPLE_UNARY_RHS:
+ return tree_unary_nonnegative_warnv_p (gimple_assign_rhs_code (stmt),
+ gimple_expr_type (stmt),
+ gimple_assign_rhs1 (stmt),
+ strict_overflow_p);
+ case GIMPLE_BINARY_RHS:
+ return tree_binary_nonnegative_warnv_p (gimple_assign_rhs_code (stmt),
+ gimple_expr_type (stmt),
+ gimple_assign_rhs1 (stmt),
+ gimple_assign_rhs2 (stmt),
+ strict_overflow_p);
+ case GIMPLE_SINGLE_RHS:
+ return tree_single_nonnegative_warnv_p (gimple_assign_rhs1 (stmt),
+ strict_overflow_p);
+ case GIMPLE_INVALID_RHS:
+ gcc_unreachable ();
+ default:
+ gcc_unreachable ();
+ }
+}
+
+/* Return true if return value of call STMT is know to be non-negative.
+ If the return value is based on the assumption that signed overflow is
+ undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't change
+ *STRICT_OVERFLOW_P.*/
+
+static bool
+gimple_call_nonnegative_warnv_p (gimple stmt, bool *strict_overflow_p)
+{
+ tree arg0 = gimple_call_num_args (stmt) > 0 ?
+ gimple_call_arg (stmt, 0) : NULL_TREE;
+ tree arg1 = gimple_call_num_args (stmt) > 1 ?
+ gimple_call_arg (stmt, 1) : NULL_TREE;
+
+ return tree_call_nonnegative_warnv_p (gimple_expr_type (stmt),
+ gimple_call_fndecl (stmt),
+ arg0,
+ arg1,
+ strict_overflow_p);
+}
+
+/* Return true if STMT is know to to compute a non-negative value.
+ If the return value is based on the assumption that signed overflow is
+ undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't change
+ *STRICT_OVERFLOW_P.*/
+
+static bool
+gimple_stmt_nonnegative_warnv_p (gimple stmt, bool *strict_overflow_p)
+{
+ switch (gimple_code (stmt))
+ {
+ case GIMPLE_ASSIGN:
+ return gimple_assign_nonnegative_warnv_p (stmt, strict_overflow_p);
+ case GIMPLE_CALL:
+ return gimple_call_nonnegative_warnv_p (stmt, strict_overflow_p);
+ default:
+ gcc_unreachable ();
+ }
+}
+
+/* Return true if the result of assignment STMT is know to be non-zero.
+ If the return value is based on the assumption that signed overflow is
+ undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't change
+ *STRICT_OVERFLOW_P.*/
+
+static bool
+gimple_assign_nonzero_warnv_p (gimple stmt, bool *strict_overflow_p)
+{
+ enum tree_code code = gimple_assign_rhs_code (stmt);
+ switch (get_gimple_rhs_class (code))
+ {
+ case GIMPLE_UNARY_RHS:
+ return tree_unary_nonzero_warnv_p (gimple_assign_rhs_code (stmt),
+ gimple_expr_type (stmt),
+ gimple_assign_rhs1 (stmt),
+ strict_overflow_p);
+ case GIMPLE_BINARY_RHS:
+ return tree_binary_nonzero_warnv_p (gimple_assign_rhs_code (stmt),
+ gimple_expr_type (stmt),
+ gimple_assign_rhs1 (stmt),
+ gimple_assign_rhs2 (stmt),
+ strict_overflow_p);
+ case GIMPLE_SINGLE_RHS:
+ return tree_single_nonzero_warnv_p (gimple_assign_rhs1 (stmt),
+ strict_overflow_p);
+ case GIMPLE_INVALID_RHS:
+ gcc_unreachable ();
+ default:
+ gcc_unreachable ();
+ }
+}
+
+/* Return true if STMT is know to to compute a non-zero value.
+ If the return value is based on the assumption that signed overflow is
+ undefined, set *STRICT_OVERFLOW_P to true; otherwise, don't change
+ *STRICT_OVERFLOW_P.*/
+
+static bool
+gimple_stmt_nonzero_warnv_p (gimple stmt, bool *strict_overflow_p)
+{
+ switch (gimple_code (stmt))
+ {
+ case GIMPLE_ASSIGN:
+ return gimple_assign_nonzero_warnv_p (stmt, strict_overflow_p);
+ case GIMPLE_CALL:
+ return gimple_alloca_call_p (stmt);
+ default:
+ gcc_unreachable ();
+ }
+}
+
/* Like tree_expr_nonzero_warnv_p, but this function uses value ranges
obtained so far. */
static bool
-vrp_expr_computes_nonzero (tree expr, bool *strict_overflow_p)
+vrp_stmt_computes_nonzero (gimple stmt, bool *strict_overflow_p)
{
- if (tree_expr_nonzero_warnv_p (expr, strict_overflow_p)
- || (TREE_CODE (expr) == SSA_NAME
- && ssa_name_nonzero_p (expr)))
+ if (gimple_stmt_nonzero_warnv_p (stmt, strict_overflow_p))
return true;
/* If we have an expression of the form &X->a, then the expression
is nonnull if X is nonnull. */
- if (TREE_CODE (expr) == ADDR_EXPR)
+ if (is_gimple_assign (stmt)
+ && gimple_assign_rhs_code (stmt) == ADDR_EXPR)
{
+ tree expr = gimple_assign_rhs1 (stmt);
tree base = get_base_address (TREE_OPERAND (expr, 0));
if (base != NULL_TREE
@@ -1213,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. */
@@ -1893,6 +2057,22 @@ extract_range_from_binary_expr (value_range_t *vr,
&& code != TRUTH_AND_EXPR
&& code != TRUTH_OR_EXPR)
{
+ /* We can still do constant propagation here. */
+ tree const_op0 = op_with_constant_singleton_value_range (op0);
+ tree const_op1 = op_with_constant_singleton_value_range (op1);
+ if (const_op0 || const_op1)
+ {
+ tree tem = fold_binary (code, expr_type,
+ const_op0 ? const_op0 : op0,
+ const_op1 ? const_op1 : 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;
}
@@ -2297,6 +2477,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;
}
@@ -2348,8 +2540,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)))
{
@@ -2519,7 +2710,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
{
@@ -2709,10 +2903,9 @@ extract_range_from_comparison (value_range_t *vr, enum tree_code code,
tree type, tree op0, tree op1)
{
bool sop = false;
- tree val = vrp_evaluate_conditional_warnv_with_ops (code,
- op0,
- op1,
- false, &sop);
+ tree val;
+
+ val = vrp_evaluate_conditional_warnv_with_ops (code, op0, op1, false, &sop);
/* A disadvantage of using a special infinity as an overflow
representation is that we lose the ability to record overflow
@@ -2735,56 +2928,67 @@ extract_range_from_comparison (value_range_t *vr, enum tree_code code,
set_value_range_to_truthvalue (vr, type);
}
+/* Try to derive a nonnegative or nonzero range out of STMT relying
+ primarily on generic routines in fold in conjunction with range data.
+ Store the result in *VR */
+
+static void
+extract_range_basic (value_range_t *vr, gimple stmt)
+{
+ bool sop = false;
+ tree type = gimple_expr_type (stmt);
+
+ if (INTEGRAL_TYPE_P (type)
+ && gimple_stmt_nonnegative_warnv_p (stmt, &sop))
+ set_value_range_to_nonnegative (vr, type,
+ sop || stmt_overflow_infinity (stmt));
+ else if (vrp_stmt_computes_nonzero (stmt, &sop)
+ && !sop)
+ set_value_range_to_nonnull (vr, type);
+ else
+ set_value_range_to_varying (vr);
+}
+
-/* Try to compute a useful range out of expression EXPR and store it
+/* Try to compute a useful range out of assignment STMT and store it
in *VR. */
static void
-extract_range_from_expr (value_range_t *vr, tree expr)
+extract_range_from_assignment (value_range_t *vr, gimple stmt)
{
- enum tree_code code = TREE_CODE (expr);
+ enum tree_code code = gimple_assign_rhs_code (stmt);
if (code == ASSERT_EXPR)
- extract_range_from_assert (vr, expr);
+ extract_range_from_assert (vr, gimple_assign_rhs1 (stmt));
else if (code == SSA_NAME)
- extract_range_from_ssa_name (vr, expr);
+ extract_range_from_ssa_name (vr, gimple_assign_rhs1 (stmt));
else if (TREE_CODE_CLASS (code) == tcc_binary
|| code == TRUTH_AND_EXPR
|| code == TRUTH_OR_EXPR
|| code == TRUTH_XOR_EXPR)
- extract_range_from_binary_expr (vr, TREE_CODE (expr), TREE_TYPE (expr),
- TREE_OPERAND (expr, 0),
- TREE_OPERAND (expr, 1));
+ extract_range_from_binary_expr (vr, gimple_assign_rhs_code (stmt),
+ gimple_expr_type (stmt),
+ gimple_assign_rhs1 (stmt),
+ gimple_assign_rhs2 (stmt));
else if (TREE_CODE_CLASS (code) == tcc_unary)
- extract_range_from_unary_expr (vr, TREE_CODE (expr), TREE_TYPE (expr),
- TREE_OPERAND (expr, 0));
+ extract_range_from_unary_expr (vr, gimple_assign_rhs_code (stmt),
+ gimple_expr_type (stmt),
+ gimple_assign_rhs1 (stmt));
else if (code == COND_EXPR)
- extract_range_from_cond_expr (vr, expr);
+ extract_range_from_cond_expr (vr, gimple_assign_rhs1 (stmt));
else if (TREE_CODE_CLASS (code) == tcc_comparison)
- extract_range_from_comparison (vr, TREE_CODE (expr), TREE_TYPE (expr),
- TREE_OPERAND (expr, 0),
- TREE_OPERAND (expr, 1));
- else if (is_gimple_min_invariant (expr))
- set_value_range_to_value (vr, expr, NULL);
+ extract_range_from_comparison (vr, gimple_assign_rhs_code (stmt),
+ gimple_expr_type (stmt),
+ gimple_assign_rhs1 (stmt),
+ gimple_assign_rhs2 (stmt));
+ else if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS
+ && is_gimple_min_invariant (gimple_assign_rhs1 (stmt)))
+ set_value_range_to_value (vr, gimple_assign_rhs1 (stmt), NULL);
else
set_value_range_to_varying (vr);
- /* If we got a varying range from the tests above, try a final
- time to derive a nonnegative or nonzero range. This time
- relying primarily on generic routines in fold in conjunction
- with range data. */
if (vr->type == VR_VARYING)
- {
- bool sop = false;
-
- if (INTEGRAL_TYPE_P (TREE_TYPE (expr))
- && vrp_expr_computes_nonnegative (expr, &sop))
- set_value_range_to_nonnegative (vr, TREE_TYPE (expr),
- sop || is_overflow_infinity (expr));
- else if (vrp_expr_computes_nonzero (expr, &sop)
- && !sop)
- set_value_range_to_nonnull (vr, TREE_TYPE (expr));
- }
+ extract_range_basic (vr, stmt);
}
/* Given a range VR, a LOOP and a variable VAR, determine whether it
@@ -2792,8 +2996,8 @@ extract_range_from_expr (value_range_t *vr, tree expr)
for VAR. If so, update VR with the new limits. */
static void
-adjust_range_with_scev (value_range_t *vr, struct loop *loop, tree stmt,
- tree var)
+adjust_range_with_scev (value_range_t *vr, struct loop *loop,
+ gimple stmt, tree var)
{
tree init, step, chrec, tmin, tmax, min, max, type;
enum ev_direction dir;
@@ -2926,7 +3130,7 @@ adjust_range_with_scev (value_range_t *vr, struct loop *loop, tree stmt,
overflow. */
static bool
-vrp_var_may_overflow (tree var, tree stmt)
+vrp_var_may_overflow (tree var, gimple stmt)
{
struct loop *l;
tree chrec, init, step;
@@ -3374,31 +3578,32 @@ debug_all_value_ranges (void)
create a new SSA name N and return the assertion assignment
'V = ASSERT_EXPR <V, V OP W>'. */
-static tree
+static gimple
build_assert_expr_for (tree cond, tree v)
{
- tree n, assertion;
+ tree n;
+ gimple assertion;
gcc_assert (TREE_CODE (v) == SSA_NAME);
- n = duplicate_ssa_name (v, NULL_TREE);
+ n = duplicate_ssa_name (v, NULL);
if (COMPARISON_CLASS_P (cond))
{
tree a = build2 (ASSERT_EXPR, TREE_TYPE (v), v, cond);
- assertion = build_gimple_modify_stmt (n, a);
+ assertion = gimple_build_assign (n, a);
}
else if (TREE_CODE (cond) == TRUTH_NOT_EXPR)
{
/* Given !V, build the assignment N = false. */
tree op0 = TREE_OPERAND (cond, 0);
gcc_assert (op0 == v);
- assertion = build_gimple_modify_stmt (n, boolean_false_node);
+ assertion = gimple_build_assign (n, boolean_false_node);
}
else if (TREE_CODE (cond) == SSA_NAME)
{
/* Given V, build the assignment N = true. */
gcc_assert (v == cond);
- assertion = build_gimple_modify_stmt (n, boolean_true_node);
+ assertion = gimple_build_assign (n, boolean_true_node);
}
else
gcc_unreachable ();
@@ -3419,10 +3624,11 @@ build_assert_expr_for (tree cond, tree v)
point values. */
static inline bool
-fp_predicate (const_tree expr)
+fp_predicate (gimple stmt)
{
- return (COMPARISON_CLASS_P (expr)
- && FLOAT_TYPE_P (TREE_TYPE (TREE_OPERAND (expr, 0))));
+ GIMPLE_CHECK (stmt, GIMPLE_COND);
+
+ return FLOAT_TYPE_P (TREE_TYPE (gimple_cond_lhs (stmt)));
}
@@ -3432,7 +3638,7 @@ fp_predicate (const_tree expr)
inferred. */
static bool
-infer_value_range (tree stmt, tree op, enum tree_code *comp_code_p, tree *val_p)
+infer_value_range (gimple stmt, tree op, enum tree_code *comp_code_p, tree *val_p)
{
*val_p = NULL_TREE;
*comp_code_p = ERROR_MARK;
@@ -3444,19 +3650,21 @@ infer_value_range (tree stmt, tree op, enum tree_code *comp_code_p, tree *val_p)
/* Similarly, don't infer anything from statements that may throw
exceptions. */
- if (tree_could_throw_p (stmt))
+ if (stmt_could_throw_p (stmt))
return false;
/* If STMT is the last statement of a basic block with no
successors, there is no point inferring anything about any of its
operands. We would not be able to find a proper insertion point
for the assertion, anyway. */
- if (stmt_ends_bb_p (stmt) && EDGE_COUNT (bb_for_stmt (stmt)->succs) == 0)
+ if (stmt_ends_bb_p (stmt) && EDGE_COUNT (gimple_bb (stmt)->succs) == 0)
return false;
/* We can only assume that a pointer dereference will yield
non-NULL if -fdelete-null-pointer-checks is enabled. */
- if (flag_delete_null_pointer_checks && POINTER_TYPE_P (TREE_TYPE (op)))
+ if (flag_delete_null_pointer_checks
+ && POINTER_TYPE_P (TREE_TYPE (op))
+ && gimple_code (stmt) != GIMPLE_ASM)
{
unsigned num_uses, num_loads, num_stores;
@@ -3493,7 +3701,7 @@ dump_asserts_for (FILE *file, tree name)
while (loc)
{
fprintf (file, "\t");
- print_generic_expr (file, bsi_stmt (loc->si), 0);
+ print_gimple_stmt (file, gsi_stmt (loc->si), 0, 0);
fprintf (file, "\n\tBB #%d", loc->bb->index);
if (loc->e)
{
@@ -3563,7 +3771,7 @@ register_new_assert_for (tree name, tree expr,
tree val,
basic_block bb,
edge e,
- block_stmt_iterator si)
+ gimple_stmt_iterator si)
{
assert_locus_t n, loc, last_loc;
bool found;
@@ -3573,8 +3781,8 @@ register_new_assert_for (tree name, tree expr,
gcc_assert (bb == NULL || e == NULL);
if (e == NULL)
- gcc_assert (TREE_CODE (bsi_stmt (si)) != COND_EXPR
- && TREE_CODE (bsi_stmt (si)) != SWITCH_EXPR);
+ gcc_assert (gimple_code (gsi_stmt (si)) != GIMPLE_COND
+ && gimple_code (gsi_stmt (si)) != GIMPLE_SWITCH);
#endif
/* The new assertion A will be inserted at BB or E. We need to
@@ -3746,7 +3954,7 @@ extract_code_and_val_from_cond_with_ops (tree name, enum tree_code cond_code,
Return true if an assertion for NAME could be registered. */
static bool
-register_edge_assert_for_2 (tree name, edge e, block_stmt_iterator bsi,
+register_edge_assert_for_2 (tree name, edge e, gimple_stmt_iterator bsi,
enum tree_code cond_code,
tree cond_op0, tree cond_op1, bool invert)
{
@@ -3762,7 +3970,7 @@ register_edge_assert_for_2 (tree name, edge e, block_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);
@@ -3778,30 +3986,28 @@ register_edge_assert_for_2 (tree name, edge e, block_stmt_iterator bsi,
&& TREE_CODE (val) == INTEGER_CST
&& TYPE_UNSIGNED (TREE_TYPE (val)))
{
- tree def_stmt = SSA_NAME_DEF_STMT (name);
+ gimple def_stmt = SSA_NAME_DEF_STMT (name);
tree cst2 = NULL_TREE, name2 = NULL_TREE, name3 = NULL_TREE;
/* Extract CST2 from the (optional) addition. */
- if (TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1)) == PLUS_EXPR)
+ if (is_gimple_assign (def_stmt)
+ && gimple_assign_rhs_code (def_stmt) == PLUS_EXPR)
{
- name2 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 0);
- cst2 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 1);
+ name2 = gimple_assign_rhs1 (def_stmt);
+ cst2 = gimple_assign_rhs2 (def_stmt);
if (TREE_CODE (name2) == SSA_NAME
&& TREE_CODE (cst2) == INTEGER_CST)
def_stmt = SSA_NAME_DEF_STMT (name2);
}
/* Extract NAME2 from the (optional) sign-changing cast. */
- if (TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT
- && CONVERT_EXPR_P (GIMPLE_STMT_OPERAND (def_stmt, 1)))
+ if (gimple_assign_cast_p (def_stmt))
{
- tree rhs = GIMPLE_STMT_OPERAND (def_stmt, 1);
- if (CONVERT_EXPR_P (rhs)
- && ! TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (rhs, 0)))
- && (TYPE_PRECISION (TREE_TYPE (rhs))
- == TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (rhs, 0)))))
- name3 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 0);
+ 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)))))
+ name3 = gimple_assign_rhs1 (def_stmt);
}
/* If name3 is used later, create an ASSERT_EXPR for it. */
@@ -3810,7 +4016,7 @@ register_edge_assert_for_2 (tree name, edge e, block_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;
@@ -3839,7 +4045,7 @@ register_edge_assert_for_2 (tree name, edge e, block_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;
@@ -3878,10 +4084,11 @@ register_edge_assert_for_2 (tree name, edge e, block_stmt_iterator bsi,
static bool
register_edge_assert_for_1 (tree op, enum tree_code code,
- edge e, block_stmt_iterator bsi)
+ edge e, gimple_stmt_iterator bsi)
{
bool retval = false;
- tree op_def, rhs, val;
+ gimple op_def;
+ tree val;
enum tree_code rhs_code;
/* We only care about SSA_NAMEs. */
@@ -3905,17 +4112,16 @@ register_edge_assert_for_1 (tree op, enum tree_code code,
a truth operation or some bit operations, then we may be able
to register information about the operands of that assignment. */
op_def = SSA_NAME_DEF_STMT (op);
- if (TREE_CODE (op_def) != GIMPLE_MODIFY_STMT)
+ if (gimple_code (op_def) != GIMPLE_ASSIGN)
return retval;
- rhs = GIMPLE_STMT_OPERAND (op_def, 1);
- rhs_code = TREE_CODE (rhs);
+ rhs_code = gimple_assign_rhs_code (op_def);
- if (COMPARISON_CLASS_P (rhs))
+ if (TREE_CODE_CLASS (rhs_code) == tcc_comparison)
{
bool invert = (code == EQ_EXPR ? true : false);
- tree op0 = TREE_OPERAND (rhs, 0);
- tree op1 = TREE_OPERAND (rhs, 1);
+ tree op0 = gimple_assign_rhs1 (op_def);
+ tree op1 = gimple_assign_rhs2 (op_def);
if (TREE_CODE (op0) == SSA_NAME)
retval |= register_edge_assert_for_2 (op0, e, bsi, rhs_code, op0, op1,
@@ -3925,34 +4131,35 @@ register_edge_assert_for_1 (tree op, enum tree_code code,
invert);
}
else if ((code == NE_EXPR
- && (TREE_CODE (rhs) == TRUTH_AND_EXPR
- || TREE_CODE (rhs) == BIT_AND_EXPR))
+ && (gimple_assign_rhs_code (op_def) == TRUTH_AND_EXPR
+ || gimple_assign_rhs_code (op_def) == BIT_AND_EXPR))
|| (code == EQ_EXPR
- && (TREE_CODE (rhs) == TRUTH_OR_EXPR
- || TREE_CODE (rhs) == BIT_IOR_EXPR)))
+ && (gimple_assign_rhs_code (op_def) == TRUTH_OR_EXPR
+ || gimple_assign_rhs_code (op_def) == BIT_IOR_EXPR)))
{
/* Recurse on each operand. */
- retval |= register_edge_assert_for_1 (TREE_OPERAND (rhs, 0),
+ retval |= register_edge_assert_for_1 (gimple_assign_rhs1 (op_def),
code, e, bsi);
- retval |= register_edge_assert_for_1 (TREE_OPERAND (rhs, 1),
+ retval |= register_edge_assert_for_1 (gimple_assign_rhs2 (op_def),
code, e, bsi);
}
- else if (TREE_CODE (rhs) == TRUTH_NOT_EXPR)
+ else if (gimple_assign_rhs_code (op_def) == TRUTH_NOT_EXPR)
{
/* Recurse, flipping CODE. */
code = invert_tree_comparison (code, false);
- retval |= register_edge_assert_for_1 (TREE_OPERAND (rhs, 0),
+ retval |= register_edge_assert_for_1 (gimple_assign_rhs1 (op_def),
code, e, bsi);
}
- else if (TREE_CODE (rhs) == SSA_NAME)
+ else if (gimple_assign_rhs_code (op_def) == SSA_NAME)
{
/* Recurse through the copy. */
- retval |= register_edge_assert_for_1 (rhs, code, e, bsi);
+ retval |= register_edge_assert_for_1 (gimple_assign_rhs1 (op_def),
+ code, e, bsi);
}
- else if (CONVERT_EXPR_P (rhs))
+ else if (CONVERT_EXPR_CODE_P (gimple_assign_rhs_code (op_def)))
{
/* Recurse through the type conversion. */
- retval |= register_edge_assert_for_1 (TREE_OPERAND (rhs, 0),
+ retval |= register_edge_assert_for_1 (gimple_assign_rhs1 (op_def),
code, e, bsi);
}
@@ -3964,7 +4171,7 @@ register_edge_assert_for_1 (tree op, enum tree_code code,
Return true if an assertion for NAME could be registered. */
static bool
-register_edge_assert_for (tree name, edge e, block_stmt_iterator si,
+register_edge_assert_for (tree name, edge e, gimple_stmt_iterator si,
enum tree_code cond_code, tree cond_op0,
tree cond_op1)
{
@@ -3999,14 +4206,14 @@ register_edge_assert_for (tree name, edge e, block_stmt_iterator si,
if (((comp_code == EQ_EXPR && integer_onep (val))
|| (comp_code == NE_EXPR && integer_zerop (val))))
{
- tree def_stmt = SSA_NAME_DEF_STMT (name);
+ gimple def_stmt = SSA_NAME_DEF_STMT (name);
- if (TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT
- && (TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1)) == TRUTH_AND_EXPR
- || TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1)) == BIT_AND_EXPR))
+ if (is_gimple_assign (def_stmt)
+ && (gimple_assign_rhs_code (def_stmt) == TRUTH_AND_EXPR
+ || gimple_assign_rhs_code (def_stmt) == BIT_AND_EXPR))
{
- tree op0 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 0);
- tree op1 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 1);
+ tree op0 = gimple_assign_rhs1 (def_stmt);
+ tree op1 = gimple_assign_rhs2 (def_stmt);
retval |= register_edge_assert_for_1 (op0, NE_EXPR, e, si);
retval |= register_edge_assert_for_1 (op1, NE_EXPR, e, si);
}
@@ -4018,18 +4225,17 @@ register_edge_assert_for (tree name, edge e, block_stmt_iterator si,
if (((comp_code == EQ_EXPR && integer_zerop (val))
|| (comp_code == NE_EXPR && integer_onep (val))))
{
- tree def_stmt = SSA_NAME_DEF_STMT (name);
+ gimple def_stmt = SSA_NAME_DEF_STMT (name);
- if (TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT
- && (TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1)) == TRUTH_OR_EXPR
+ if (is_gimple_assign (def_stmt)
+ && (gimple_assign_rhs_code (def_stmt) == TRUTH_OR_EXPR
/* For BIT_IOR_EXPR only if NAME == 0 both operands have
necessarily zero value. */
|| (comp_code == EQ_EXPR
- && (TREE_CODE (GIMPLE_STMT_OPERAND (def_stmt, 1))
- == BIT_IOR_EXPR))))
+ && (gimple_assign_rhs_code (def_stmt) == BIT_IOR_EXPR))))
{
- tree op0 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 0);
- tree op1 = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 1);
+ tree op0 = gimple_assign_rhs1 (def_stmt);
+ tree op1 = gimple_assign_rhs2 (def_stmt);
retval |= register_edge_assert_for_1 (op0, EQ_EXPR, e, si);
retval |= register_edge_assert_for_1 (op1, EQ_EXPR, e, si);
}
@@ -4039,8 +4245,6 @@ register_edge_assert_for (tree name, edge e, block_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.
@@ -4050,17 +4254,17 @@ static bool find_assert_locations (basic_block bb);
list of assertions for the corresponding operands. */
static bool
-find_conditional_asserts (basic_block bb, tree last)
+find_conditional_asserts (basic_block bb, gimple last)
{
bool need_assert;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
tree op;
edge_iterator ei;
edge e;
ssa_op_iter iter;
need_assert = false;
- bsi = bsi_for_stmt (last);
+ bsi = gsi_for_stmt (last);
/* Look for uses of the operands in each of the sub-graphs
rooted at BB. We need to check each of the outgoing edges
@@ -4071,56 +4275,17 @@ find_conditional_asserts (basic_block bb, tree 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)
{
- tree cond = COND_EXPR_COND (last);
- if (op != cond)
- need_assert |= register_edge_assert_for (op, e, bsi,
- TREE_CODE (cond),
- TREE_OPERAND (cond, 0),
- TREE_OPERAND (cond, 1));
- else
- need_assert |= register_edge_assert_for (op, e, bsi, EQ_EXPR, op,
- boolean_true_node);
+ need_assert |= register_edge_assert_for (op, e, bsi,
+ gimple_cond_code (last),
+ gimple_cond_lhs (last),
+ gimple_cond_rhs (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;
}
@@ -4160,26 +4325,31 @@ compare_case_labels (const void *p1, const void *p2)
list of assertions for the corresponding operands. */
static bool
-find_switch_asserts (basic_block bb, tree last)
+find_switch_asserts (basic_block bb, gimple last)
{
bool need_assert;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator bsi;
tree op;
edge e;
- tree vec = SWITCH_LABELS (last), vec2;
- size_t n = TREE_VEC_LENGTH (vec);
+ tree vec2;
+ size_t n = gimple_switch_num_labels(last);
+#if GCC_VERSION >= 4000
unsigned int idx;
+#else
+ /* Work around GCC 3.4 bug (PR 37086). */
+ volatile unsigned int idx;
+#endif
need_assert = false;
- bsi = bsi_for_stmt (last);
- op = TREE_OPERAND (last, 0);
+ bsi = gsi_for_stmt (last);
+ op = gimple_switch_index (last);
if (TREE_CODE (op) != SSA_NAME)
return false;
/* Build a vector of case labels sorted by destination label. */
vec2 = make_tree_vec (n);
for (idx = 0; idx < n; ++idx)
- TREE_VEC_ELT (vec2, idx) = TREE_VEC_ELT (vec, idx);
+ TREE_VEC_ELT (vec2, idx) = gimple_switch_label (last, idx);
qsort (&TREE_VEC_ELT (vec2, 0), n, sizeof (tree), compare_case_labels);
for (idx = 0; idx < n; ++idx)
@@ -4217,18 +4387,6 @@ find_switch_asserts (basic_block bb, tree 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,
@@ -4245,10 +4403,6 @@ find_switch_asserts (basic_block bb, tree 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;
}
@@ -4317,46 +4471,40 @@ find_switch_asserts (basic_block bb, tree last)
inserted by process_assert_insertions. */
static bool
-find_assert_locations (basic_block bb)
+find_assert_locations_1 (basic_block bb, sbitmap live)
{
- block_stmt_iterator si;
- tree last, phi;
+ 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 (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
- {
- use_operand_p arg_p;
- ssa_op_iter i;
+ /* 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_TREE;
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
- tree stmt, op;
+ gimple stmt;
+ tree op;
ssa_op_iter i;
- stmt = bsi_stmt (si);
+ stmt = gsi_stmt (si);
/* See if we can derive an assertion for any of STMT's operands. */
FOR_EACH_SSA_TREE_OPERAND (op, stmt, i, SSA_OP_USE)
@@ -4364,12 +4512,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
@@ -4385,20 +4529,16 @@ find_assert_locations (basic_block bb)
if (comp_code == NE_EXPR && integer_zerop (value))
{
tree t = op;
- tree def_stmt = SSA_NAME_DEF_STMT (t);
+ gimple def_stmt = SSA_NAME_DEF_STMT (t);
- while (TREE_CODE (def_stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE
- (GIMPLE_STMT_OPERAND (def_stmt, 1)) == NOP_EXPR
+ while (is_gimple_assign (def_stmt)
+ && gimple_assign_rhs_code (def_stmt) == NOP_EXPR
&& TREE_CODE
- (TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1),
- 0)) == SSA_NAME
+ (gimple_assign_rhs1 (def_stmt)) == SSA_NAME
&& POINTER_TYPE_P
- (TREE_TYPE (TREE_OPERAND
- (GIMPLE_STMT_OPERAND (def_stmt,
- 1), 0))))
+ (TREE_TYPE (gimple_assign_rhs1 (def_stmt))))
{
- t = TREE_OPERAND (GIMPLE_STMT_OPERAND (def_stmt, 1), 0);
+ t = gimple_assign_rhs1 (def_stmt);
def_stmt = SSA_NAME_DEF_STMT (t);
/* Note we want to register the assert for the
@@ -4424,34 +4564,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
- && TREE_CODE (last) == COND_EXPR
- && !fp_predicate (COND_EXPR_COND (last))
- && !ZERO_SSA_OPERANDS (last, SSA_OP_USE))
- need_assert |= find_conditional_asserts (bb, last);
-
- if (last
- && TREE_CODE (last) == SWITCH_EXPR
- && !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. */
@@ -4460,32 +4679,33 @@ static bool
process_assert_insertions_for (tree name, assert_locus_t loc)
{
/* Build the comparison expression NAME_i COMP_CODE VAL. */
- tree stmt, cond, assert_expr;
+ gimple stmt;
+ tree cond;
+ gimple assert_stmt;
edge_iterator ei;
edge e;
cond = build2 (loc->comp_code, boolean_type_node, loc->expr, loc->val);
- assert_expr = build_assert_expr_for (cond, name);
-
+ assert_stmt = build_assert_expr_for (cond, name);
if (loc->e)
{
/* We have been asked to insert the assertion on an edge. This
is used only by COND_EXPR and SWITCH_EXPR assertions. */
#if defined ENABLE_CHECKING
- gcc_assert (TREE_CODE (bsi_stmt (loc->si)) == COND_EXPR
- || TREE_CODE (bsi_stmt (loc->si)) == SWITCH_EXPR);
+ gcc_assert (gimple_code (gsi_stmt (loc->si)) == GIMPLE_COND
+ || gimple_code (gsi_stmt (loc->si)) == GIMPLE_SWITCH);
#endif
- bsi_insert_on_edge (loc->e, assert_expr);
+ gsi_insert_on_edge (loc->e, assert_stmt);
return true;
}
/* Otherwise, we can insert right after LOC->SI iff the
statement must not be the last statement in the block. */
- stmt = bsi_stmt (loc->si);
+ stmt = gsi_stmt (loc->si);
if (!stmt_ends_bb_p (stmt))
{
- bsi_insert_after (&loc->si, assert_expr, BSI_SAME_STMT);
+ gsi_insert_after (&loc->si, assert_stmt, GSI_SAME_STMT);
return false;
}
@@ -4496,7 +4716,7 @@ process_assert_insertions_for (tree name, assert_locus_t loc)
FOR_EACH_EDGE (e, ei, loc->bb->succs)
if (!(e->flags & EDGE_ABNORMAL))
{
- bsi_insert_on_edge (e, assert_expr);
+ gsi_insert_on_edge (e, assert_stmt);
return true;
}
@@ -4535,7 +4755,7 @@ process_assert_insertions (void)
}
if (update_edges_p)
- bsi_commit_edge_inserts ();
+ gsi_commit_edge_inserts ();
statistics_counter_event (cfun, "Number of ASSERT_EXPR expressions inserted",
num_asserts);
@@ -4577,27 +4797,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);
@@ -4609,7 +4814,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);
}
@@ -4622,7 +4826,7 @@ insert_range_assertions (void)
IGNORE_OFF_BY_ONE is true if the ARRAY_REF is inside a ADDR_EXPR. */
static void
-check_array_ref (tree ref, location_t* locus, bool ignore_off_by_one)
+check_array_ref (tree ref, const location_t *location, bool ignore_off_by_one)
{
value_range_t* vr = NULL;
tree low_sub, up_sub;
@@ -4662,7 +4866,7 @@ check_array_ref (tree ref, location_t* locus, bool ignore_off_by_one)
&& tree_int_cst_lt (low_sub, low_bound))
{
warning (OPT_Warray_bounds,
- "%Harray subscript is outside array bounds", locus);
+ "%Harray subscript is outside array bounds", location);
TREE_NO_WARNING (ref) = 1;
}
}
@@ -4677,14 +4881,14 @@ check_array_ref (tree ref, location_t* locus, bool ignore_off_by_one)
up_sub)))
{
warning (OPT_Warray_bounds, "%Harray subscript is above array bounds",
- locus);
+ location);
TREE_NO_WARNING (ref) = 1;
}
else if (TREE_CODE (low_sub) == INTEGER_CST
&& tree_int_cst_lt (low_sub, low_bound))
{
warning (OPT_Warray_bounds, "%Harray subscript is below array bounds",
- locus);
+ location);
TREE_NO_WARNING (ref) = 1;
}
}
@@ -4693,14 +4897,20 @@ check_array_ref (tree ref, location_t* locus, bool ignore_off_by_one)
address of an ARRAY_REF, and call check_array_ref on it. */
static void
-search_for_addr_array(tree t, location_t* location)
+search_for_addr_array(tree t, const location_t *location)
{
while (TREE_CODE (t) == SSA_NAME)
{
- t = SSA_NAME_DEF_STMT (t);
- if (TREE_CODE (t) != GIMPLE_MODIFY_STMT)
+ gimple g = SSA_NAME_DEF_STMT (t);
+
+ if (gimple_code (g) != GIMPLE_ASSIGN)
return;
- t = GIMPLE_STMT_OPERAND (t, 1);
+
+ if (get_gimple_rhs_class (gimple_assign_rhs_code (g)) !=
+ GIMPLE_SINGLE_RHS)
+ return;
+
+ t = gimple_assign_rhs1 (g);
}
@@ -4729,14 +4939,8 @@ static tree
check_array_bounds (tree *tp, int *walk_subtree, void *data)
{
tree t = *tp;
- tree stmt = (tree)data;
- location_t *location = EXPR_LOCUS (stmt);
-
- if (!EXPR_HAS_LOCATION (stmt))
- {
- *walk_subtree = FALSE;
- return NULL_TREE;
- }
+ struct walk_stmt_info *wi = (struct walk_stmt_info *) data;
+ const location_t *location = (const location_t *) wi->info;
*walk_subtree = TRUE;
@@ -4746,14 +4950,6 @@ check_array_bounds (tree *tp, int *walk_subtree, void *data)
if (TREE_CODE (t) == INDIRECT_REF
|| (TREE_CODE (t) == RETURN_EXPR && TREE_OPERAND (t, 0)))
search_for_addr_array (TREE_OPERAND (t, 0), location);
- else if (TREE_CODE (t) == CALL_EXPR)
- {
- tree arg;
- call_expr_arg_iterator iter;
-
- FOR_EACH_CALL_EXPR_ARG (arg, iter, t)
- search_for_addr_array (arg, location);
- }
if (TREE_CODE (t) == ADDR_EXPR)
*walk_subtree = FALSE;
@@ -4768,7 +4964,7 @@ static void
check_all_array_refs (void)
{
basic_block bb;
- block_stmt_iterator si;
+ gimple_stmt_iterator si;
FOR_EACH_BB (bb)
{
@@ -4776,21 +4972,46 @@ check_all_array_refs (void)
if (single_pred_p (bb))
{
basic_block pred_bb = EDGE_PRED (bb, 0)->src;
- tree ls = NULL_TREE;
+ gimple ls = NULL;
- if (!bsi_end_p (bsi_last (pred_bb)))
- ls = bsi_stmt (bsi_last (pred_bb));
+ if (!gsi_end_p (gsi_last_bb (pred_bb)))
+ ls = gsi_stmt (gsi_last_bb (pred_bb));
- if (ls && TREE_CODE (ls) == COND_EXPR
- && ((COND_EXPR_COND (ls) == boolean_false_node
+ if (ls && gimple_code (ls) == GIMPLE_COND
+ && ((gimple_cond_false_p (ls)
&& (EDGE_PRED (bb, 0)->flags & EDGE_TRUE_VALUE))
- || (COND_EXPR_COND (ls) == boolean_true_node
+ || (gimple_cond_true_p (ls)
&& (EDGE_PRED (bb, 0)->flags & EDGE_FALSE_VALUE))))
continue;
}
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
- walk_tree (bsi_stmt_ptr (si), check_array_bounds,
- bsi_stmt (si), NULL);
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
+ {
+ gimple stmt = gsi_stmt (si);
+ const location_t *location = gimple_location_ptr (stmt);
+ struct walk_stmt_info wi;
+ if (!gimple_has_location (stmt))
+ continue;
+
+ if (is_gimple_call (stmt))
+ {
+ size_t i;
+ size_t n = gimple_call_num_args (stmt);
+ for (i = 0; i < n; i++)
+ {
+ tree arg = gimple_call_arg (stmt, i);
+ search_for_addr_array (arg, location);
+ }
+ }
+ else
+ {
+ memset (&wi, 0, sizeof (wi));
+ wi.info = CONST_CAST (void *, (const void *) location);
+
+ walk_gimple_op (gsi_stmt (si),
+ check_array_bounds,
+ &wi);
+ }
+ }
}
}
@@ -4822,21 +5043,22 @@ static void
remove_range_assertions (void)
{
basic_block bb;
- block_stmt_iterator si;
+ gimple_stmt_iterator si;
/* Note that the BSI iterator bump happens at the bottom of the
loop and no bump is necessary if we're removing the statement
referenced by the current BSI. */
FOR_EACH_BB (bb)
- for (si = bsi_start (bb); !bsi_end_p (si);)
+ for (si = gsi_start_bb (bb); !gsi_end_p (si);)
{
- tree stmt = bsi_stmt (si);
- tree use_stmt;
+ gimple stmt = gsi_stmt (si);
+ gimple use_stmt;
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT
- && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == ASSERT_EXPR)
+ if (is_gimple_assign (stmt)
+ && gimple_assign_rhs_code (stmt) == ASSERT_EXPR)
{
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1), var;
+ tree rhs = gimple_assign_rhs1 (stmt);
+ tree var;
tree cond = fold (ASSERT_EXPR_COND (rhs));
use_operand_p use_p;
imm_use_iterator iter;
@@ -4846,7 +5068,7 @@ remove_range_assertions (void)
/* Propagate the RHS into every use of the LHS. */
var = ASSERT_EXPR_VAR (rhs);
FOR_EACH_IMM_USE_STMT (use_stmt, iter,
- GIMPLE_STMT_OPERAND (stmt, 0))
+ gimple_assign_lhs (stmt))
FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
{
SET_USE (use_p, var);
@@ -4854,46 +5076,43 @@ remove_range_assertions (void)
}
/* And finally, remove the copy, it is not needed. */
- bsi_remove (&si, true);
+ gsi_remove (&si, true);
release_defs (stmt);
}
else
- bsi_next (&si);
+ gsi_next (&si);
}
-
- sbitmap_free (blocks_visited);
}
/* Return true if STMT is interesting for VRP. */
static bool
-stmt_interesting_for_vrp (tree stmt)
+stmt_interesting_for_vrp (gimple stmt)
{
- if (TREE_CODE (stmt) == PHI_NODE
- && is_gimple_reg (PHI_RESULT (stmt))
- && (INTEGRAL_TYPE_P (TREE_TYPE (PHI_RESULT (stmt)))
- || POINTER_TYPE_P (TREE_TYPE (PHI_RESULT (stmt)))))
+ if (gimple_code (stmt) == GIMPLE_PHI
+ && is_gimple_reg (gimple_phi_result (stmt))
+ && (INTEGRAL_TYPE_P (TREE_TYPE (gimple_phi_result (stmt)))
+ || POINTER_TYPE_P (TREE_TYPE (gimple_phi_result (stmt)))))
return true;
- else if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ else if (is_gimple_assign (stmt) || is_gimple_call (stmt))
{
- tree lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ tree lhs = gimple_get_lhs (stmt);
/* In general, assignments with virtual operands are not useful
for deriving ranges, with the obvious exception of calls to
builtin functions. */
- if (TREE_CODE (lhs) == SSA_NAME
+ if (lhs && TREE_CODE (lhs) == SSA_NAME
&& (INTEGRAL_TYPE_P (TREE_TYPE (lhs))
|| POINTER_TYPE_P (TREE_TYPE (lhs)))
- && ((TREE_CODE (rhs) == CALL_EXPR
- && TREE_CODE (CALL_EXPR_FN (rhs)) == ADDR_EXPR
- && DECL_P (TREE_OPERAND (CALL_EXPR_FN (rhs), 0))
- && DECL_IS_BUILTIN (TREE_OPERAND (CALL_EXPR_FN (rhs), 0)))
+ && ((is_gimple_call (stmt)
+ && gimple_call_fndecl (stmt) != NULL_TREE
+ && DECL_IS_BUILTIN (gimple_call_fndecl (stmt)))
|| ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS)))
return true;
}
- else if (TREE_CODE (stmt) == COND_EXPR || TREE_CODE (stmt) == SWITCH_EXPR)
+ else if (gimple_code (stmt) == GIMPLE_COND
+ || gimple_code (stmt) == GIMPLE_SWITCH)
return true;
return false;
@@ -4912,24 +5131,24 @@ vrp_initialize (void)
FOR_EACH_BB (bb)
{
- block_stmt_iterator si;
- tree phi;
+ gimple_stmt_iterator si;
- for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si))
{
+ gimple phi = gsi_stmt (si);
if (!stmt_interesting_for_vrp (phi))
{
tree lhs = PHI_RESULT (phi);
set_value_range_to_varying (get_value_range (lhs));
- DONT_SIMULATE_AGAIN (phi) = true;
+ prop_set_simulate_again (phi, false);
}
else
- DONT_SIMULATE_AGAIN (phi) = false;
+ prop_set_simulate_again (phi, true);
}
- for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
{
- tree stmt = bsi_stmt (si);
+ gimple stmt = gsi_stmt (si);
if (!stmt_interesting_for_vrp (stmt))
{
@@ -4937,11 +5156,11 @@ vrp_initialize (void)
tree def;
FOR_EACH_SSA_TREE_OPERAND (def, stmt, i, SSA_OP_DEF)
set_value_range_to_varying (get_value_range (def));
- DONT_SIMULATE_AGAIN (stmt) = true;
+ prop_set_simulate_again (stmt, false);
}
else
{
- DONT_SIMULATE_AGAIN (stmt) = false;
+ prop_set_simulate_again (stmt, true);
}
}
}
@@ -4952,13 +5171,12 @@ vrp_initialize (void)
the SSA name in *OUTPUT_P. */
static enum ssa_prop_result
-vrp_visit_assignment (tree stmt, tree *output_p)
+vrp_visit_assignment_or_call (gimple stmt, tree *output_p)
{
- tree lhs, rhs, def;
+ tree def, lhs;
ssa_op_iter iter;
-
- lhs = GIMPLE_STMT_OPERAND (stmt, 0);
- rhs = GIMPLE_STMT_OPERAND (stmt, 1);
+ enum gimple_code code = gimple_code (stmt);
+ lhs = gimple_get_lhs (stmt);
/* We only keep track of ranges in integral and pointer types. */
if (TREE_CODE (lhs) == SSA_NAME
@@ -4972,7 +5190,10 @@ vrp_visit_assignment (tree stmt, tree *output_p)
struct loop *l;
value_range_t new_vr = { VR_UNDEFINED, NULL_TREE, NULL_TREE, NULL };
- extract_range_from_expr (&new_vr, rhs);
+ if (code == GIMPLE_CALL)
+ extract_range_basic (&new_vr, stmt);
+ else
+ extract_range_from_assignment (&new_vr, stmt);
/* If STMT is inside a loop, we may be able to know something
else about the range of LHS by examining scalar evolution
@@ -5233,15 +5454,12 @@ vrp_evaluate_conditional_warnv_with_ops (enum tree_code code, tree op0,
if (use_equiv_p)
{
if (TREE_CODE (op0) == SSA_NAME && TREE_CODE (op1) == SSA_NAME)
- return compare_names (code, op0, op1,
- strict_overflow_p);
+ return compare_names (code, op0, op1, strict_overflow_p);
else if (TREE_CODE (op0) == SSA_NAME)
- return compare_name_with_value (code, op0, op1,
- strict_overflow_p);
+ return compare_name_with_value (code, op0, op1, strict_overflow_p);
else if (TREE_CODE (op1) == SSA_NAME)
return (compare_name_with_value
- (swap_tree_comparison (code), op1, op0,
- strict_overflow_p));
+ (swap_tree_comparison (code), op1, op0, strict_overflow_p));
}
else
{
@@ -5251,15 +5469,12 @@ vrp_evaluate_conditional_warnv_with_ops (enum tree_code code, tree op0,
vr1 = (TREE_CODE (op1) == SSA_NAME) ? get_value_range (op1) : NULL;
if (vr0 && vr1)
- return compare_ranges (code, vr0, vr1,
- strict_overflow_p);
+ return compare_ranges (code, vr0, vr1, strict_overflow_p);
else if (vr0 && vr1 == NULL)
- return compare_range_with_value (code, vr0, op1,
- strict_overflow_p);
+ return compare_range_with_value (code, vr0, op1, strict_overflow_p);
else if (vr0 == NULL && vr1)
return (compare_range_with_value
- (swap_tree_comparison (code), vr1, op0,
- strict_overflow_p));
+ (swap_tree_comparison (code), vr1, op0, strict_overflow_p));
}
return NULL_TREE;
}
@@ -5272,17 +5487,13 @@ vrp_evaluate_conditional_warnv_with_ops (enum tree_code code, tree op0,
appropriate. */
tree
-vrp_evaluate_conditional (enum tree_code code, tree op0, tree op1, tree stmt)
+vrp_evaluate_conditional (enum tree_code code, tree op0, tree op1, gimple stmt)
{
bool sop;
tree ret;
sop = false;
- ret = vrp_evaluate_conditional_warnv_with_ops (code,
- op0,
- op1,
- true,
- &sop);
+ ret = vrp_evaluate_conditional_warnv_with_ops (code, op0, op1, true, &sop);
if (ret && sop)
{
@@ -5304,13 +5515,13 @@ vrp_evaluate_conditional (enum tree_code code, tree op0, tree op1, tree stmt)
if (issue_strict_overflow_warning (wc))
{
- location_t locus;
+ location_t location;
- if (!EXPR_HAS_LOCATION (stmt))
- locus = input_location;
+ if (!gimple_has_location (stmt))
+ location = input_location;
else
- locus = EXPR_LOCATION (stmt);
- warning (OPT_Wstrict_overflow, "%H%s", &locus, warnmsg);
+ location = gimple_location (stmt);
+ warning (OPT_Wstrict_overflow, "%H%s", &location, warnmsg);
}
}
@@ -5344,14 +5555,14 @@ vrp_evaluate_conditional (enum tree_code code, tree op0, tree op1, tree stmt)
if (warnmsg)
{
- location_t locus;
+ location_t location;
- if (!EXPR_HAS_LOCATION (stmt))
- locus = input_location;
+ if (!gimple_has_location (stmt))
+ location = input_location;
else
- locus = EXPR_LOCATION (stmt);
+ location = gimple_location (stmt);
- warning (OPT_Wtype_limits, "%H%s", &locus, warnmsg);
+ warning (OPT_Wtype_limits, "%H%s", &location, warnmsg);
}
}
@@ -5365,13 +5576,12 @@ vrp_evaluate_conditional (enum tree_code code, tree op0, tree op1, tree stmt)
SSA_PROP_VARYING. */
static enum ssa_prop_result
-vrp_visit_cond_stmt (tree stmt, edge *taken_edge_p)
+vrp_visit_cond_stmt (gimple stmt, edge *taken_edge_p)
{
- tree cond, val;
+ tree val;
bool sop;
*taken_edge_p = NULL;
- cond = COND_EXPR_COND (stmt);
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -5379,7 +5589,7 @@ vrp_visit_cond_stmt (tree stmt, edge *taken_edge_p)
ssa_op_iter i;
fprintf (dump_file, "\nVisiting conditional with predicate: ");
- print_generic_expr (dump_file, cond, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
fprintf (dump_file, "\nWith known ranges\n");
FOR_EACH_SSA_TREE_OPERAND (use, stmt, i, SSA_OP_USE)
@@ -5437,22 +5647,14 @@ vrp_visit_cond_stmt (tree stmt, edge *taken_edge_p)
4 more predicates folded in SPEC. */
sop = false;
- if (TREE_CODE (cond) == SSA_NAME)
- val = vrp_evaluate_conditional_warnv_with_ops (EQ_EXPR,
- cond,
- boolean_true_node,
- false,
- &sop);
- else
- val = vrp_evaluate_conditional_warnv_with_ops (TREE_CODE (cond),
- TREE_OPERAND (cond, 0),
- TREE_OPERAND (cond, 1),
- false,
- &sop);
+ val = vrp_evaluate_conditional_warnv_with_ops (gimple_cond_code (stmt),
+ gimple_cond_lhs (stmt),
+ gimple_cond_rhs (stmt),
+ false, &sop);
if (val)
{
if (!sop)
- *taken_edge_p = find_taken_edge (bb_for_stmt (stmt), val);
+ *taken_edge_p = find_taken_edge (gimple_bb (stmt), val);
else
{
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -5477,7 +5679,7 @@ vrp_visit_cond_stmt (tree stmt, edge *taken_edge_p)
/* Searches the case label vector VEC for the index *IDX of the CASE_LABEL
that includes the value VAL. The search is restricted to the range
- [START_IDX, n - 2] where n is the size of VEC (n - 1 is the default label).
+ [START_IDX, n - 1] where n is the size of VEC.
If there is a CASE_LABEL for VAL, its index is placed in IDX and true is
returned.
@@ -5485,25 +5687,25 @@ vrp_visit_cond_stmt (tree stmt, edge *taken_edge_p)
If there is no CASE_LABEL for VAL and the is one that is larger than VAL,
it is placed in IDX and false is returned.
- If VAL is larger than any CASE_LABEL, n - 1 is placed on IDX and false is
+ If VAL is larger than any CASE_LABEL, n is placed on IDX and false is
returned. */
static bool
-find_case_label_index (tree vec, size_t start_idx, tree val, size_t *idx)
+find_case_label_index (gimple stmt, size_t start_idx, tree val, size_t *idx)
{
- size_t n = TREE_VEC_LENGTH (vec);
+ size_t n = gimple_switch_num_labels (stmt);
size_t low, high;
/* Find case label for minimum of the value range or the next one.
At each iteration we are searching in [low, high - 1]. */
- for (low = start_idx, high = n - 1; high != low; )
+ for (low = start_idx, high = n; high != low; )
{
tree t;
int cmp;
- /* Note that i != high, so we never ask for n - 1. */
+ /* Note that i != high, so we never ask for n. */
size_t i = (high + low) / 2;
- t = TREE_VEC_ELT (vec, i);
+ t = gimple_switch_label (stmt, i);
/* Cache the result of comparing CASE_LOW and val. */
cmp = tree_int_cst_compare (CASE_LOW (t), val);
@@ -5539,11 +5741,12 @@ find_case_label_index (tree vec, size_t start_idx, tree val, size_t *idx)
Returns true if the default label is not needed. */
static bool
-find_case_label_range (tree vec, tree min, tree max, size_t *min_idx, size_t *max_idx)
+find_case_label_range (gimple stmt, tree min, tree max, size_t *min_idx,
+ size_t *max_idx)
{
size_t i, j;
- bool min_take_default = !find_case_label_index (vec, 0, min, &i);
- bool max_take_default = !find_case_label_index (vec, i, max, &j);
+ bool min_take_default = !find_case_label_index (stmt, 1, min, &i);
+ bool max_take_default = !find_case_label_index (stmt, i, max, &j);
if (i == j
&& min_take_default
@@ -5566,20 +5769,20 @@ find_case_label_range (tree vec, tree min, tree max, size_t *min_idx, size_t *ma
/* If the case label range is continuous, we do not need
the default case label. Verify that. */
- high = CASE_LOW (TREE_VEC_ELT (vec, i));
- if (CASE_HIGH (TREE_VEC_ELT (vec, i)))
- high = CASE_HIGH (TREE_VEC_ELT (vec, i));
+ high = CASE_LOW (gimple_switch_label (stmt, i));
+ if (CASE_HIGH (gimple_switch_label (stmt, i)))
+ high = CASE_HIGH (gimple_switch_label (stmt, i));
for (k = i + 1; k <= j; ++k)
{
- low = CASE_LOW (TREE_VEC_ELT (vec, k));
+ low = CASE_LOW (gimple_switch_label (stmt, k));
if (!integer_onep (int_const_binop (MINUS_EXPR, low, high, 0)))
{
take_default = true;
break;
}
high = low;
- if (CASE_HIGH (TREE_VEC_ELT (vec, k)))
- high = CASE_HIGH (TREE_VEC_ELT (vec, k));
+ if (CASE_HIGH (gimple_switch_label (stmt, k)))
+ high = CASE_HIGH (gimple_switch_label (stmt, k));
}
*min_idx = i;
@@ -5594,16 +5797,15 @@ find_case_label_range (tree vec, tree min, tree max, size_t *min_idx, size_t *ma
SSA_PROP_VARYING. */
static enum ssa_prop_result
-vrp_visit_switch_stmt (tree stmt, edge *taken_edge_p)
+vrp_visit_switch_stmt (gimple stmt, edge *taken_edge_p)
{
tree op, val;
value_range_t *vr;
size_t i = 0, j = 0, n;
- tree vec;
bool take_default;
*taken_edge_p = NULL;
- op = TREE_OPERAND (stmt, 0);
+ op = gimple_switch_index (stmt);
if (TREE_CODE (op) != SSA_NAME)
return SSA_PROP_VARYING;
@@ -5622,26 +5824,26 @@ vrp_visit_switch_stmt (tree stmt, edge *taken_edge_p)
return SSA_PROP_VARYING;
/* Find the single edge that is taken from the switch expression. */
- vec = SWITCH_LABELS (stmt);
- n = TREE_VEC_LENGTH (vec);
+ n = gimple_switch_num_labels (stmt);
- take_default = !find_case_label_range (vec, vr->min, vr->max, &i, &j);
+ take_default = !find_case_label_range (stmt, vr->min, vr->max, &i, &j);
/* Check if the range spans no CASE_LABEL. If so, we only reach the default
label */
if (j < i)
{
gcc_assert (take_default);
- val = TREE_VEC_ELT (vec, n - 1);
+ val = gimple_switch_default_label (stmt);
}
else
{
/* Check if labels with index i to j and maybe the default label
are all reaching the same label. */
- val = TREE_VEC_ELT (vec, i);
+ val = gimple_switch_label (stmt, i);
if (take_default
- && CASE_LABEL (TREE_VEC_ELT (vec, n - 1)) != CASE_LABEL (val))
+ && CASE_LABEL (gimple_switch_default_label (stmt))
+ != CASE_LABEL (val))
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, " not a single destination for this "
@@ -5650,7 +5852,7 @@ vrp_visit_switch_stmt (tree stmt, edge *taken_edge_p)
}
for (++i; i <= j; ++i)
{
- if (CASE_LABEL (TREE_VEC_ELT (vec, i)) != CASE_LABEL (val))
+ if (CASE_LABEL (gimple_switch_label (stmt, i)) != CASE_LABEL (val))
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, " not a single destination for this "
@@ -5660,7 +5862,7 @@ vrp_visit_switch_stmt (tree stmt, edge *taken_edge_p)
}
}
- *taken_edge_p = find_edge (bb_for_stmt (stmt),
+ *taken_edge_p = find_edge (gimple_bb (stmt),
label_to_block (CASE_LABEL (val)));
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -5683,37 +5885,33 @@ vrp_visit_switch_stmt (tree stmt, edge *taken_edge_p)
If STMT produces a varying value, return SSA_PROP_VARYING. */
static enum ssa_prop_result
-vrp_visit_stmt (tree stmt, edge *taken_edge_p, tree *output_p)
+vrp_visit_stmt (gimple stmt, edge *taken_edge_p, tree *output_p)
{
tree def;
ssa_op_iter iter;
- stmt_ann_t ann;
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "\nVisiting statement:\n");
- print_generic_stmt (dump_file, stmt, dump_flags);
+ print_gimple_stmt (dump_file, stmt, 0, dump_flags);
fprintf (dump_file, "\n");
}
- ann = stmt_ann (stmt);
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_assign (stmt) || is_gimple_call (stmt))
{
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
-
/* In general, assignments with virtual operands are not useful
for deriving ranges, with the obvious exception of calls to
builtin functions. */
- if ((TREE_CODE (rhs) == CALL_EXPR
- && TREE_CODE (CALL_EXPR_FN (rhs)) == ADDR_EXPR
- && DECL_P (TREE_OPERAND (CALL_EXPR_FN (rhs), 0))
- && DECL_IS_BUILTIN (TREE_OPERAND (CALL_EXPR_FN (rhs), 0)))
+
+ if ((is_gimple_call (stmt)
+ && gimple_call_fndecl (stmt) != NULL_TREE
+ && DECL_IS_BUILTIN (gimple_call_fndecl (stmt)))
|| ZERO_SSA_OPERANDS (stmt, SSA_OP_ALL_VIRTUALS))
- return vrp_visit_assignment (stmt, output_p);
+ return vrp_visit_assignment_or_call (stmt, output_p);
}
- else if (TREE_CODE (stmt) == COND_EXPR)
+ else if (gimple_code (stmt) == GIMPLE_COND)
return vrp_visit_cond_stmt (stmt, taken_edge_p);
- else if (TREE_CODE (stmt) == SWITCH_EXPR)
+ else if (gimple_code (stmt) == GIMPLE_SWITCH)
return vrp_visit_switch_stmt (stmt, taken_edge_p);
/* All other statements produce nothing of interest for VRP, so mark
@@ -5876,9 +6074,9 @@ give_up:
value ranges, set a new range for the LHS of PHI. */
static enum ssa_prop_result
-vrp_visit_phi_node (tree phi)
+vrp_visit_phi_node (gimple phi)
{
- int i;
+ size_t i;
tree lhs = PHI_RESULT (phi);
value_range_t *lhs_vr = get_value_range (lhs);
value_range_t vr_result = { VR_UNDEFINED, NULL_TREE, NULL_TREE, NULL };
@@ -5889,19 +6087,19 @@ vrp_visit_phi_node (tree phi)
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "\nVisiting PHI node: ");
- print_generic_expr (dump_file, phi, dump_flags);
+ print_gimple_stmt (dump_file, phi, 0, dump_flags);
}
edges = 0;
- for (i = 0; i < PHI_NUM_ARGS (phi); i++)
+ for (i = 0; i < gimple_phi_num_args (phi); i++)
{
- edge e = PHI_ARG_EDGE (phi, i);
+ edge e = gimple_phi_arg_edge (phi, i);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file,
"\n Argument #%d (%d -> %d %sexecutable)\n",
- i, e->src->index, e->dest->index,
+ (int) i, e->src->index, e->dest->index,
(e->flags & EDGE_EXECUTABLE) ? "" : "not ");
}
@@ -6027,13 +6225,15 @@ varying:
than zero and the second operand is an exact power of two. */
static void
-simplify_div_or_mod_using_ranges (tree stmt, tree rhs, enum tree_code rhs_code)
+simplify_div_or_mod_using_ranges (gimple stmt)
{
+ enum tree_code rhs_code = gimple_assign_rhs_code (stmt);
tree val = NULL;
- tree op = TREE_OPERAND (rhs, 0);
- value_range_t *vr = get_value_range (TREE_OPERAND (rhs, 0));
+ tree op0 = gimple_assign_rhs1 (stmt);
+ tree op1 = gimple_assign_rhs2 (stmt);
+ value_range_t *vr = get_value_range (gimple_assign_rhs1 (stmt));
- if (TYPE_UNSIGNED (TREE_TYPE (op)))
+ if (TYPE_UNSIGNED (TREE_TYPE (op0)))
{
val = integer_one_node;
}
@@ -6048,39 +6248,41 @@ simplify_div_or_mod_using_ranges (tree stmt, tree rhs, enum tree_code rhs_code)
&& integer_onep (val)
&& issue_strict_overflow_warning (WARN_STRICT_OVERFLOW_MISC))
{
- location_t locus;
+ location_t location;
- if (!EXPR_HAS_LOCATION (stmt))
- locus = input_location;
+ if (!gimple_has_location (stmt))
+ location = input_location;
else
- locus = EXPR_LOCATION (stmt);
+ location = gimple_location (stmt);
warning (OPT_Wstrict_overflow,
("%Hassuming signed overflow does not occur when "
"simplifying / or %% to >> or &"),
- &locus);
+ &location);
}
}
if (val && integer_onep (val))
{
tree t;
- tree op0 = TREE_OPERAND (rhs, 0);
- tree op1 = TREE_OPERAND (rhs, 1);
if (rhs_code == TRUNC_DIV_EXPR)
{
t = build_int_cst (NULL_TREE, tree_log2 (op1));
- t = build2 (RSHIFT_EXPR, TREE_TYPE (op0), op0, t);
+ gimple_assign_set_rhs_code (stmt, RSHIFT_EXPR);
+ gimple_assign_set_rhs1 (stmt, op0);
+ gimple_assign_set_rhs2 (stmt, t);
}
else
{
t = build_int_cst (TREE_TYPE (op1), 1);
t = int_const_binop (MINUS_EXPR, op1, t, 0);
t = fold_convert (TREE_TYPE (op0), t);
- t = build2 (BIT_AND_EXPR, TREE_TYPE (op0), op0, t);
+
+ gimple_assign_set_rhs_code (stmt, BIT_AND_EXPR);
+ gimple_assign_set_rhs1 (stmt, op0);
+ gimple_assign_set_rhs2 (stmt, t);
}
- GIMPLE_STMT_OPERAND (stmt, 1) = t;
update_stmt (stmt);
}
}
@@ -6090,12 +6292,12 @@ simplify_div_or_mod_using_ranges (tree stmt, tree rhs, enum tree_code rhs_code)
ABS_EXPR into a NEGATE_EXPR. */
static void
-simplify_abs_using_ranges (tree stmt, tree rhs)
+simplify_abs_using_ranges (gimple stmt)
{
tree val = NULL;
- tree op = TREE_OPERAND (rhs, 0);
+ tree op = gimple_assign_rhs1 (stmt);
tree type = TREE_TYPE (op);
- value_range_t *vr = get_value_range (TREE_OPERAND (rhs, 0));
+ value_range_t *vr = get_value_range (op);
if (TYPE_UNSIGNED (type))
{
@@ -6124,28 +6326,25 @@ simplify_abs_using_ranges (tree stmt, tree rhs)
if (val
&& (integer_onep (val) || integer_zerop (val)))
{
- tree t;
-
if (sop && issue_strict_overflow_warning (WARN_STRICT_OVERFLOW_MISC))
{
- location_t locus;
+ location_t location;
- if (!EXPR_HAS_LOCATION (stmt))
- locus = input_location;
+ if (!gimple_has_location (stmt))
+ location = input_location;
else
- locus = EXPR_LOCATION (stmt);
+ location = gimple_location (stmt);
warning (OPT_Wstrict_overflow,
("%Hassuming signed overflow does not occur when "
"simplifying abs (X) to X or -X"),
- &locus);
+ &location);
}
+ gimple_assign_set_rhs1 (stmt, op);
if (integer_onep (val))
- t = build1 (NEGATE_EXPR, TREE_TYPE (op), op);
+ gimple_assign_set_rhs_code (stmt, NEGATE_EXPR);
else
- t = op;
-
- GIMPLE_STMT_OPERAND (stmt, 1) = t;
+ gimple_assign_set_rhs_code (stmt, SSA_NAME);
update_stmt (stmt);
}
}
@@ -6224,12 +6423,11 @@ test_for_singularity (enum tree_code cond_code, tree op0,
the original conditional. */
static void
-simplify_cond_using_ranges (tree stmt)
+simplify_cond_using_ranges (gimple stmt)
{
- tree cond = COND_EXPR_COND (stmt);
- tree op0 = TREE_OPERAND (cond, 0);
- tree op1 = TREE_OPERAND (cond, 1);
- enum tree_code cond_code = TREE_CODE (cond);
+ tree op0 = gimple_cond_lhs (stmt);
+ tree op1 = gimple_cond_rhs (stmt);
+ enum tree_code cond_code = gimple_cond_code (stmt);
if (cond_code != NE_EXPR
&& cond_code != EQ_EXPR
@@ -6243,24 +6441,26 @@ simplify_cond_using_ranges (tree 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)
{
fprintf (dump_file, "Simplified relational ");
- print_generic_expr (dump_file, cond, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
fprintf (dump_file, " into ");
}
- COND_EXPR_COND (stmt)
- = build2 (EQ_EXPR, boolean_type_node, op0, new);
+ gimple_cond_set_code (stmt, EQ_EXPR);
+ gimple_cond_set_lhs (stmt, op0);
+ gimple_cond_set_rhs (stmt, new_tree);
+
update_stmt (stmt);
if (dump_file)
{
- print_generic_expr (dump_file, COND_EXPR_COND (stmt), 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
fprintf (dump_file, "\n");
}
return;
@@ -6271,24 +6471,26 @@ simplify_cond_using_ranges (tree 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)
{
fprintf (dump_file, "Simplified relational ");
- print_generic_expr (dump_file, cond, 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
fprintf (dump_file, " into ");
}
- COND_EXPR_COND (stmt)
- = build2 (NE_EXPR, boolean_type_node, op0, new);
+ gimple_cond_set_code (stmt, NE_EXPR);
+ gimple_cond_set_lhs (stmt, op0);
+ gimple_cond_set_rhs (stmt, new_tree);
+
update_stmt (stmt);
if (dump_file)
{
- print_generic_expr (dump_file, COND_EXPR_COND (stmt), 0);
+ print_gimple_stmt (dump_file, stmt, 0, 0);
fprintf (dump_file, "\n");
}
return;
@@ -6302,15 +6504,15 @@ simplify_cond_using_ranges (tree stmt)
argument. */
static void
-simplify_switch_using_ranges (tree stmt)
+simplify_switch_using_ranges (gimple stmt)
{
- tree op = TREE_OPERAND (stmt, 0);
+ tree op = gimple_switch_index (stmt);
value_range_t *vr;
bool take_default;
edge e;
edge_iterator ei;
size_t i = 0, j = 0, n, n2;
- tree vec, vec2;
+ tree vec2;
switch_update su;
if (TREE_CODE (op) != SSA_NAME)
@@ -6324,35 +6526,36 @@ simplify_switch_using_ranges (tree stmt)
return;
/* Find case label for min/max of the value range. */
- vec = SWITCH_LABELS (stmt);
- n = TREE_VEC_LENGTH (vec);
- take_default = !find_case_label_range (vec, vr->min, vr->max, &i, &j);
+ n = gimple_switch_num_labels (stmt);
+ take_default = !find_case_label_range (stmt, vr->min, vr->max, &i, &j);
/* Bail out if this is just all edges taken. */
- if (i == 0
- && j == n - 2
+ if (i == 1
+ && j == n - 1
&& take_default)
return;
/* Build a new vector of taken case labels. */
vec2 = make_tree_vec (j - i + 1 + (int)take_default);
- for (n2 = 0; i <= j; ++i, ++n2)
- TREE_VEC_ELT (vec2, n2) = TREE_VEC_ELT (vec, i);
+ n2 = 0;
/* Add the default edge, if necessary. */
if (take_default)
- TREE_VEC_ELT (vec2, n2++) = TREE_VEC_ELT (vec, n - 1);
+ TREE_VEC_ELT (vec2, n2++) = gimple_switch_default_label (stmt);
+
+ for (; i <= j; ++i, ++n2)
+ TREE_VEC_ELT (vec2, n2) = gimple_switch_label (stmt, i);
/* Mark needed edges. */
for (i = 0; i < n2; ++i)
{
- e = find_edge (bb_for_stmt (stmt),
+ e = find_edge (gimple_bb (stmt),
label_to_block (CASE_LABEL (TREE_VEC_ELT (vec2, i))));
e->aux = (void *)-1;
}
/* Queue not needed edges for later removal. */
- FOR_EACH_EDGE (e, ei, bb_for_stmt (stmt)->succs)
+ FOR_EACH_EDGE (e, ei, gimple_bb (stmt)->succs)
{
if (e->aux == (void *)-1)
{
@@ -6376,31 +6579,29 @@ simplify_switch_using_ranges (tree stmt)
/* Simplify STMT using ranges if possible. */
void
-simplify_stmt_using_ranges (tree stmt)
+simplify_stmt_using_ranges (gimple stmt)
{
- if (TREE_CODE (stmt) == GIMPLE_MODIFY_STMT)
+ if (is_gimple_assign (stmt))
{
- tree rhs = GIMPLE_STMT_OPERAND (stmt, 1);
- enum tree_code rhs_code = TREE_CODE (rhs);
+ enum tree_code rhs_code = gimple_assign_rhs_code (stmt);
/* Transform TRUNC_DIV_EXPR and TRUNC_MOD_EXPR into RSHIFT_EXPR
and BIT_AND_EXPR respectively if the first operand is greater
than zero and the second operand is an exact power of two. */
if ((rhs_code == TRUNC_DIV_EXPR || rhs_code == TRUNC_MOD_EXPR)
- && INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (rhs, 0)))
- && integer_pow2p (TREE_OPERAND (rhs, 1)))
- simplify_div_or_mod_using_ranges (stmt, rhs, rhs_code);
+ && INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_rhs1 (stmt)))
+ && integer_pow2p (gimple_assign_rhs2 (stmt)))
+ simplify_div_or_mod_using_ranges (stmt);
/* Transform ABS (X) into X or -X as appropriate. */
if (rhs_code == ABS_EXPR
- && TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME
- && INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (rhs, 0))))
- simplify_abs_using_ranges (stmt, rhs);
+ && TREE_CODE (gimple_assign_rhs1 (stmt)) == SSA_NAME
+ && INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_rhs1 (stmt))))
+ simplify_abs_using_ranges (stmt);
}
- else if (TREE_CODE (stmt) == COND_EXPR
- && COMPARISON_CLASS_P (COND_EXPR_COND (stmt)))
+ else if (gimple_code (stmt) == GIMPLE_COND)
simplify_cond_using_ranges (stmt);
- else if (TREE_CODE (stmt) == SWITCH_EXPR)
+ else if (gimple_code (stmt) == GIMPLE_SWITCH)
simplify_switch_using_ranges (stmt);
}
@@ -6417,26 +6618,17 @@ static VEC(tree,heap) *stack;
for any overflow warnings. */
static tree
-simplify_stmt_for_jump_threading (tree stmt, tree within_stmt)
+simplify_stmt_for_jump_threading (gimple stmt, gimple within_stmt)
{
- tree conditional;
/* We only use VRP information to simplify conditionals. This is
overly conservative, but it's unclear if doing more would be
worth the compile time cost. */
- if (TREE_CODE (stmt) != COND_EXPR)
+ if (gimple_code (stmt) != GIMPLE_COND)
return NULL;
- conditional = COND_EXPR_COND (stmt);
- if (TREE_CODE (conditional) == SSA_NAME)
- return vrp_evaluate_conditional (EQ_EXPR,
- conditional,
- boolean_true_node,
- within_stmt);
- else
- return vrp_evaluate_conditional (TREE_CODE (conditional),
- TREE_OPERAND (conditional, 0),
- TREE_OPERAND (conditional, 1),
- within_stmt);
+ return vrp_evaluate_conditional (gimple_cond_code (stmt),
+ gimple_cond_lhs (stmt),
+ gimple_cond_rhs (stmt), within_stmt);
}
/* Blocks which have more than one predecessor and more than
@@ -6463,7 +6655,7 @@ static void
identify_jump_threads (void)
{
basic_block bb;
- tree dummy;
+ gimple dummy;
int i;
edge e;
@@ -6491,8 +6683,9 @@ identify_jump_threads (void)
/* To avoid lots of silly node creation, we create a single
conditional and just modify it in-place when attempting to
thread jumps. */
- dummy = build2 (EQ_EXPR, boolean_type_node, NULL, NULL);
- dummy = build3 (COND_EXPR, void_type_node, dummy, NULL, NULL);
+ dummy = gimple_build_cond (EQ_EXPR,
+ integer_zero_node, integer_zero_node,
+ NULL, NULL);
/* Walk through all the blocks finding those which present a
potential jump threading opportunity. We could set this up
@@ -6502,7 +6695,7 @@ identify_jump_threads (void)
point in compilation. */
FOR_EACH_BB (bb)
{
- tree last, cond;
+ gimple last;
/* If the generic jump threading code does not find this block
interesting, then there is nothing to do. */
@@ -6512,21 +6705,17 @@ identify_jump_threads (void)
/* We only care about blocks ending in a COND_EXPR. While there
may be some value in handling SWITCH_EXPR here, I doubt it's
terribly important. */
- last = bsi_stmt (bsi_last (bb));
- if (TREE_CODE (last) != COND_EXPR)
+ last = gsi_stmt (gsi_last_bb (bb));
+ if (gimple_code (last) != GIMPLE_COND)
continue;
/* We're basically looking for any kind of conditional with
integral type arguments. */
- cond = COND_EXPR_COND (last);
- if ((TREE_CODE (cond) == SSA_NAME
- && INTEGRAL_TYPE_P (TREE_TYPE (cond)))
- || (COMPARISON_CLASS_P (cond)
- && TREE_CODE (TREE_OPERAND (cond, 0)) == SSA_NAME
- && INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (cond, 0)))
- && (TREE_CODE (TREE_OPERAND (cond, 1)) == SSA_NAME
- || is_gimple_min_invariant (TREE_OPERAND (cond, 1)))
- && INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (cond, 1)))))
+ if (TREE_CODE (gimple_cond_lhs (last)) == SSA_NAME
+ && INTEGRAL_TYPE_P (TREE_TYPE (gimple_cond_lhs (last)))
+ && (TREE_CODE (gimple_cond_rhs (last)) == SSA_NAME
+ || is_gimple_min_invariant (gimple_cond_rhs (last)))
+ && INTEGRAL_TYPE_P (TREE_TYPE (gimple_cond_rhs (last))))
{
edge_iterator ei;
@@ -6541,8 +6730,7 @@ identify_jump_threads (void)
if (e->flags & (EDGE_DFS_BACK | EDGE_COMPLEX))
continue;
- thread_across_edge (dummy, e, true,
- &stack,
+ thread_across_edge (dummy, e, true, &stack,
simplify_stmt_for_jump_threading);
}
}
@@ -6718,7 +6906,13 @@ execute_vrp (void)
remove_edge (e);
/* Update SWITCH_EXPR case label vector. */
for (i = 0; VEC_iterate (switch_update, to_update_switch_stmts, i, su); ++i)
- SWITCH_LABELS (su->stmt) = su->vec;
+ {
+ size_t j;
+ size_t n = TREE_VEC_LENGTH (su->vec);
+ gimple_switch_set_num_labels (su->stmt, n);
+ for (j = 0; j < n; j++)
+ gimple_switch_set_label (su->stmt, j, TREE_VEC_ELT (su->vec, j));
+ }
if (VEC_length (edge, to_remove_edges) > 0)
free_dominance_info (CDI_DOMINATORS);
@@ -6728,7 +6922,6 @@ execute_vrp (void)
scev_finalize ();
loop_optimizer_finalize ();
-
return 0;
}
diff --git a/gcc/tree.c b/gcc/tree.c
index 0af11893883..5b9245958e1 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -105,8 +105,7 @@ const char *const tree_code_class_strings[] =
"binary",
"statement",
"vl_exp",
- "expression",
- "gimple_stmt"
+ "expression"
};
/* obstack.[ch] explicitly declined to prototype this. */
@@ -132,14 +131,12 @@ static const char * const tree_node_kind_names[] = {
"temp_tree_lists",
"vecs",
"binfos",
- "phi_nodes",
"ssa names",
"constructors",
"random kinds",
"lang_decl kinds",
"lang_type kinds",
"omp clauses",
- "gimple statements"
};
#endif /* GATHER_STATISTICS */
@@ -440,7 +437,7 @@ decl_assembler_name_hash (const_tree asmname)
/* Compute the number of bytes occupied by a tree with code CODE.
This function cannot be used for nodes that have variable sizes,
- including TREE_VEC, PHI_NODE, STRING_CST, and CALL_EXPR. */
+ including TREE_VEC, STRING_CST, and CALL_EXPR. */
size_t
tree_code_size (enum tree_code code)
{
@@ -488,10 +485,6 @@ tree_code_size (enum tree_code code)
return (sizeof (struct tree_exp)
+ (TREE_CODE_LENGTH (code) - 1) * sizeof (tree));
- case tcc_gimple_stmt:
- return (sizeof (struct gimple_stmt)
- + (TREE_CODE_LENGTH (code) - 1) * sizeof (char *));
-
case tcc_constant: /* a constant */
switch (code)
{
@@ -515,8 +508,7 @@ tree_code_size (enum tree_code code)
case PLACEHOLDER_EXPR: return sizeof (struct tree_common);
case TREE_VEC:
- case OMP_CLAUSE:
- case PHI_NODE: gcc_unreachable ();
+ case OMP_CLAUSE: gcc_unreachable ();
case SSA_NAME: return sizeof (struct tree_ssa_name);
@@ -543,10 +535,6 @@ tree_size (const_tree node)
const enum tree_code code = TREE_CODE (node);
switch (code)
{
- case PHI_NODE:
- return (sizeof (struct tree_phi_node)
- + (PHI_ARG_CAPACITY (node) - 1) * sizeof (struct phi_arg_d));
-
case TREE_BINFO:
return (offsetof (struct tree_binfo, base_binfos)
+ VEC_embedded_size (tree, BINFO_N_BASE_BINFOS (node)));
@@ -574,9 +562,8 @@ tree_size (const_tree node)
/* Return a newly allocated node of code CODE. For decl and type
nodes, some other fields are initialized. The rest of the node is
- initialized to zero. This function cannot be used for PHI_NODE,
- TREE_VEC or OMP_CLAUSE nodes, which is enforced by asserts in
- tree_code_size.
+ initialized to zero. This function cannot be used for TREE_VEC or
+ OMP_CLAUSE nodes, which is enforced by asserts in tree_code_size.
Achoo! I got a code in the node. */
@@ -618,10 +605,6 @@ make_node_stat (enum tree_code code MEM_STAT_DECL)
kind = c_kind;
break;
- case tcc_gimple_stmt:
- kind = gimple_stmt_kind;
- break;
-
case tcc_exceptional: /* something random, like an identifier. */
switch (code)
{
@@ -637,10 +620,6 @@ make_node_stat (enum tree_code code MEM_STAT_DECL)
kind = binfo_kind;
break;
- case PHI_NODE:
- kind = phi_kind;
- break;
-
case SSA_NAME:
kind = ssa_name_kind;
break;
@@ -739,17 +718,6 @@ make_node_stat (enum tree_code code MEM_STAT_DECL)
}
break;
- case tcc_gimple_stmt:
- switch (code)
- {
- case GIMPLE_MODIFY_STMT:
- TREE_SIDE_EFFECTS (t) = 1;
- break;
-
- default:
- break;
- }
-
default:
/* Other classes need no special treatment. */
break;
@@ -774,8 +742,7 @@ copy_node_stat (tree node MEM_STAT_DECL)
t = (tree) ggc_alloc_zone_pass_stat (length, &tree_zone);
memcpy (t, node, length);
- if (!GIMPLE_TUPLE_P (node))
- TREE_CHAIN (t) = 0;
+ TREE_CHAIN (t) = 0;
TREE_ASM_WRITTEN (t) = 0;
TREE_VISITED (t) = 0;
t->base.ann = 0;
@@ -2043,10 +2010,6 @@ expr_align (const_tree t)
align1 = TYPE_ALIGN (TREE_TYPE (t));
return MAX (align0, align1);
- case GIMPLE_MODIFY_STMT:
- /* We should never ask for the alignment of a gimple statement. */
- gcc_unreachable ();
-
case SAVE_EXPR: case COMPOUND_EXPR: case MODIFY_EXPR:
case INIT_EXPR: case TARGET_EXPR: case WITH_CLEANUP_EXPR:
case CLEANUP_POINT_EXPR:
@@ -2209,6 +2172,40 @@ decl_address_invariant_p (const_tree op)
return false;
}
+/* Return whether OP is a DECL whose address is interprocedural-invariant. */
+
+bool
+decl_address_ip_invariant_p (const_tree op)
+{
+ /* The conditions below are slightly less strict than the one in
+ staticp. */
+
+ switch (TREE_CODE (op))
+ {
+ case LABEL_DECL:
+ case FUNCTION_DECL:
+ case STRING_CST:
+ return true;
+
+ case VAR_DECL:
+ if (((TREE_STATIC (op) || DECL_EXTERNAL (op))
+ && !DECL_DLLIMPORT_P (op))
+ || DECL_THREAD_LOCAL_P (op))
+ return true;
+ break;
+
+ case CONST_DECL:
+ if ((TREE_STATIC (op) || DECL_EXTERNAL (op)))
+ return true;
+ break;
+
+ default:
+ break;
+ }
+
+ return false;
+}
+
/* Return true if T is function-invariant (internal function, does
not handle arithmetic; that's handled in skip_simple_arithmetic and
@@ -2418,8 +2415,6 @@ tree_node_structure (const_tree t)
case tcc_statement:
case tcc_vl_exp:
return TS_EXP;
- case tcc_gimple_stmt:
- return TS_GIMPLE_STATEMENT;
default: /* tcc_constant and tcc_exceptional */
break;
}
@@ -2433,13 +2428,10 @@ tree_node_structure (const_tree t)
case VECTOR_CST: return TS_VECTOR;
case STRING_CST: return TS_STRING;
/* tcc_exceptional cases. */
- /* FIXME tuples: eventually this should be TS_BASE. For now, nothing
- returns TS_BASE. */
case ERROR_MARK: return TS_COMMON;
case IDENTIFIER_NODE: return TS_IDENTIFIER;
case TREE_LIST: return TS_LIST;
case TREE_VEC: return TS_VEC;
- case PHI_NODE: return TS_PHI_NODE;
case SSA_NAME: return TS_SSA_NAME;
case PLACEHOLDER_EXPR: return TS_COMMON;
case STATEMENT_LIST: return TS_STATEMENT_LIST;
@@ -2636,7 +2628,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)
@@ -2668,7 +2660,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
@@ -2694,7 +2686,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:
@@ -2704,7 +2696,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:
@@ -2716,7 +2708,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:
@@ -2730,7 +2722,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:
@@ -2756,7 +2748,7 @@ substitute_in_expr (tree exp, tree f, tree r)
}
if (copy)
- new = fold (copy);
+ new_tree = fold (copy);
else
return exp;
}
@@ -2766,8 +2758,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
@@ -3289,15 +3281,6 @@ build2_stat (enum tree_code code, tree tt, tree arg0, tree arg1 MEM_STAT_DECL)
gcc_assert (TREE_CODE_LENGTH (code) == 2);
-#if 1
- /* FIXME tuples: Statement's aren't expressions! */
- if (code == GIMPLE_MODIFY_STMT)
- return build_gimple_modify_stmt_stat (arg0, arg1 PASS_MEM_STAT);
-#else
- /* Must use build_gimple_modify_stmt to construct GIMPLE_MODIFY_STMTs. */
- gcc_assert (code != GIMPLE_MODIFY_STMT);
-#endif
-
if ((code == MINUS_EXPR || code == PLUS_EXPR || code == MULT_EXPR)
&& arg0 && arg1 && tt && POINTER_TYPE_P (tt))
gcc_assert (TREE_CODE (arg0) == INTEGER_CST && TREE_CODE (arg1) == INTEGER_CST);
@@ -3336,21 +3319,6 @@ build2_stat (enum tree_code code, tree tt, tree arg0, tree arg1 MEM_STAT_DECL)
}
-/* Build a GIMPLE_MODIFY_STMT node. This tree code doesn't have a
- type, so we can't use build2 (a.k.a. build2_stat). */
-
-tree
-build_gimple_modify_stmt_stat (tree arg0, tree arg1 MEM_STAT_DECL)
-{
- tree t;
-
- t = make_node_stat (GIMPLE_MODIFY_STMT PASS_MEM_STAT);
- /* ?? We don't care about setting flags for tuples... */
- GIMPLE_STMT_OPERAND (t, 0) = arg0;
- GIMPLE_STMT_OPERAND (t, 1) = arg1;
- return t;
-}
-
tree
build3_stat (enum tree_code code, tree tt, tree arg0, tree arg1,
tree arg2 MEM_STAT_DECL)
@@ -3601,79 +3569,14 @@ expand_location (source_location loc)
/* Source location accessor functions. */
-/* The source location of this expression. Non-tree_exp nodes such as
- decls and constants can be shared among multiple locations, so
- return nothing. */
-location_t
-expr_location (const_tree node)
-{
- if (GIMPLE_STMT_P (node))
- return GIMPLE_STMT_LOCUS (node);
- return EXPR_P (node) ? node->exp.locus : UNKNOWN_LOCATION;
-}
-
-void
-set_expr_location (tree node, location_t locus)
-{
- if (GIMPLE_STMT_P (node))
- GIMPLE_STMT_LOCUS (node) = locus;
- else
- EXPR_CHECK (node)->exp.locus = locus;
-}
-
-bool
-expr_has_location (const_tree node)
-{
- return expr_location (node) != UNKNOWN_LOCATION;
-}
-
-source_location *
-expr_locus (const_tree node)
-{
- if (GIMPLE_STMT_P (node))
- return CONST_CAST (source_location *, &GIMPLE_STMT_LOCUS (node));
- return (EXPR_P (node)
- ? CONST_CAST (source_location *, &node->exp.locus)
- : (source_location *) NULL);
-}
-
void
set_expr_locus (tree node, source_location *loc)
{
if (loc == NULL)
- {
- if (GIMPLE_STMT_P (node))
- GIMPLE_STMT_LOCUS (node) = UNKNOWN_LOCATION;
- else
- EXPR_CHECK (node)->exp.locus = UNKNOWN_LOCATION;
- }
+ EXPR_CHECK (node)->exp.locus = UNKNOWN_LOCATION;
else
- {
- if (GIMPLE_STMT_P (node))
- GIMPLE_STMT_LOCUS (node) = *loc;
- else
- EXPR_CHECK (node)->exp.locus = *loc;
- }
-}
-
-/* Return the file name of the location of NODE. */
-const char *
-expr_filename (const_tree node)
-{
- if (GIMPLE_STMT_P (node))
- return LOCATION_FILE (GIMPLE_STMT_LOCUS (node));
- return LOCATION_FILE (EXPR_CHECK (node)->exp.locus);
+ EXPR_CHECK (node)->exp.locus = *loc;
}
-
-/* Return the line number of the location of NODE. */
-int
-expr_lineno (const_tree node)
-{
- if (GIMPLE_STMT_P (node))
- return LOCATION_LINE (GIMPLE_STMT_LOCUS (node));
- return LOCATION_LINE (EXPR_CHECK (node)->exp.locus);
-}
-
/* Return a declaration like DDECL except that its DECL_ATTRIBUTES
is ATTRIBUTE. */
@@ -4046,7 +3949,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;
@@ -4057,16 +3960,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;
@@ -4076,27 +3979,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)
{
@@ -5153,16 +5056,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));
@@ -5374,7 +5277,7 @@ commutative_tree_code (enum tree_code code)
}
/* Generate a hash value for an expression. This can be used iteratively
- by passing a previous result as the "val" argument.
+ by passing a previous result as the VAL argument.
This function is intended to produce the same hash for expressions which
would compare equal using operand_equal_p. */
@@ -5384,7 +5287,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);
@@ -5453,24 +5356,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. */
@@ -5502,6 +5404,29 @@ iterative_hash_expr (const_tree t, hashval_t val)
break;
}
}
+
+/* Generate a hash value for a pair of expressions. This can be used
+ iteratively by passing a previous result as the VAL argument.
+
+ The same hash value is always returned for a given pair of expressions,
+ regardless of the order in which they are presented. This is useful in
+ hashing the operands of commutative functions. */
+
+hashval_t
+iterative_hash_exprs_commutative (const_tree t1,
+ const_tree t2, hashval_t val)
+{
+ hashval_t one = iterative_hash_expr (t1, 0);
+ hashval_t two = iterative_hash_expr (t2, 0);
+ hashval_t t;
+
+ if (one > two)
+ t = one, one = two, two = t;
+ val = iterative_hash_hashval_t (one, val);
+ val = iterative_hash_hashval_t (two, val);
+
+ return val;
+}
/* Constructors for pointer, array and function types.
(RECORD_TYPE, UNION_TYPE and ENUMERAL_TYPE nodes are
@@ -5953,6 +5878,81 @@ build_function_type (tree value_type, tree arg_types)
return t;
}
+/* Build variant of function type ORIG_TYPE skipping ARGS_TO_SKIP. */
+
+tree
+build_function_type_skip_args (tree orig_type, bitmap args_to_skip)
+{
+ tree new_type = NULL;
+ tree args, new_args = NULL, t;
+ tree new_reversed;
+ int i = 0;
+
+ for (args = TYPE_ARG_TYPES (orig_type); args && args != void_list_node;
+ args = TREE_CHAIN (args), i++)
+ if (!bitmap_bit_p (args_to_skip, i))
+ new_args = tree_cons (NULL_TREE, TREE_VALUE (args), new_args);
+
+ new_reversed = nreverse (new_args);
+ if (args)
+ {
+ if (new_reversed)
+ TREE_CHAIN (new_args) = void_list_node;
+ else
+ new_reversed = void_list_node;
+ }
+ gcc_assert (new_reversed);
+
+ /* Use copy_node to preserve as much as possible from original type
+ (debug info, attribute lists etc.)
+ Exception is METHOD_TYPEs must have THIS argument.
+ When we are asked to remove it, we need to build new FUNCTION_TYPE
+ instead. */
+ if (TREE_CODE (orig_type) != METHOD_TYPE
+ || !bitmap_bit_p (args_to_skip, 0))
+ {
+ new_type = copy_node (orig_type);
+ TYPE_ARG_TYPES (new_type) = new_reversed;
+ }
+ else
+ new_type = build_function_type (TREE_TYPE (orig_type), new_reversed);
+
+ /* 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. */
+ t = TYPE_MAIN_VARIANT (orig_type);
+ if (orig_type != t)
+ {
+ TYPE_MAIN_VARIANT (new_type) = t;
+ TYPE_NEXT_VARIANT (new_type) = TYPE_NEXT_VARIANT (t);
+ TYPE_NEXT_VARIANT (t) = new_type;
+ }
+ else
+ {
+ TYPE_MAIN_VARIANT (new_type) = new_type;
+ TYPE_NEXT_VARIANT (new_type) = NULL;
+ }
+ return new_type;
+}
+
+/* Build variant of function type ORIG_TYPE skipping ARGS_TO_SKIP.
+
+ Arguments from DECL_ARGUMENTS list can't be removed now, since they are
+ linked by TREE_CHAIN directly. It is caller responsibility to eliminate
+ them when they are being duplicated (i.e. copy_arguments_for_versioning). */
+
+tree
+build_function_decl_skip_args (tree orig_decl, bitmap args_to_skip)
+{
+ tree new_decl = copy_node (orig_decl);
+ tree new_type;
+
+ new_type = TREE_TYPE (orig_decl);
+ if (prototype_p (new_type))
+ new_type = build_function_type_skip_args (new_type, args_to_skip);
+ TREE_TYPE (orig_decl) = new_type;
+ return new_decl;
+}
+
/* Build a function type. The RETURN_TYPE is the type returned by the
function. If VAARGS is set, no void_type_node is appended to the
the list. ARGP muse be alway be terminated be a NULL_TREE. */
@@ -5968,9 +5968,9 @@ build_function_type_list_1 (bool vaargs, tree return_type, va_list argp)
if (vaargs)
{
- last = args;
- if (args != NULL_TREE)
- args = nreverse (args);
+ last = args;
+ if (args != NULL_TREE)
+ args = nreverse (args);
gcc_assert (args != NULL_TREE && last != void_list_node);
}
else if (args == NULL_TREE)
@@ -6394,6 +6394,21 @@ int_fits_type_p (const_tree c, const_tree type)
for "unknown if constant fits", 0 for "constant known *not* to fit" and 1
for "constant known to fit". */
+ if (TREE_TYPE (c) == sizetype
+ && TYPE_UNSIGNED (TREE_TYPE (c))
+ && TREE_INT_CST_HIGH (c) == -1
+ && !TREE_OVERFLOW (c))
+ /* So c is an unsigned integer which type is sizetype.
+ sizetype'd integers are sign extended even though they are
+ unsigned. If the integer value fits in the lower end word of c,
+ and if the higher end word has all its bits set to 1, that
+ means the higher end bits are set to 1 only for sign extension.
+ So let's convert c into an equivalent zero extended unsigned
+ integer. */
+ c = force_fit_type_double (size_type_node,
+ TREE_INT_CST_LOW (c),
+ TREE_INT_CST_HIGH (c),
+ false, false);
/* Check if C >= type_low_bound. */
if (type_low_bound && TREE_CODE (type_low_bound) == INTEGER_CST)
{
@@ -6489,8 +6504,7 @@ get_type_static_bounds (const_tree type, mpz_t min, mpz_t max)
}
}
-/* auto_var_in_fn_p is called to determine whether VAR is an automatic
- variable defined in function FN. */
+/* Return true if VAR is an automatic variable defined in function FN. */
bool
auto_var_in_fn_p (const_tree var, const_tree fn)
@@ -7128,18 +7142,6 @@ tree_vec_elt_check_failed (int idx, int len, const char *file, int line,
idx + 1, len, function, trim_filename (file), line);
}
-/* Similar to above, except that the check is for the bounds of a PHI_NODE's
- (dynamically sized) vector. */
-
-void
-phi_node_elt_check_failed (int idx, int len, const char *file, int line,
- const char *function)
-{
- internal_error
- ("tree check: accessed elt %d of phi_node with %d elts in %s, at %s:%d",
- idx + 1, len, function, trim_filename (file), line);
-}
-
/* Similar to above, except that the check is for the bounds of the operand
vector of an expression node EXP. */
@@ -8690,6 +8692,10 @@ walk_tree_1 (tree *tp, walk_tree_fn func, void *data,
WALK_SUBTREE_TAIL (TREE_OPERAND (*tp, len));
}
+ case CHANGE_DYNAMIC_TYPE_EXPR:
+ WALK_SUBTREE (CHANGE_DYNAMIC_TYPE_NEW_TYPE (*tp));
+ WALK_SUBTREE_TAIL (CHANGE_DYNAMIC_TYPE_LOCATION (*tp));
+
case DECL_EXPR:
/* If this is a TYPE_DECL, walk into the fields of the type that it's
defining. We only want to walk into these fields of a type in this
@@ -8761,8 +8767,7 @@ walk_tree_1 (tree *tp, walk_tree_fn func, void *data,
/* FALLTHRU */
default:
- if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code))
- || IS_GIMPLE_STMT_CODE_CLASS (TREE_CODE_CLASS (code)))
+ if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code)))
{
int i, len;
@@ -8774,8 +8779,8 @@ walk_tree_1 (tree *tp, walk_tree_fn func, void *data,
if (len)
{
for (i = 0; i < len - 1; ++i)
- WALK_SUBTREE (GENERIC_TREE_OPERAND (*tp, i));
- WALK_SUBTREE_TAIL (GENERIC_TREE_OPERAND (*tp, len - 1));
+ WALK_SUBTREE (TREE_OPERAND (*tp, i));
+ WALK_SUBTREE_TAIL (TREE_OPERAND (*tp, len - 1));
}
}
/* If this is a type, walk the needed fields in the type. */
@@ -8807,31 +8812,6 @@ walk_tree_without_duplicates_1 (tree *tp, walk_tree_fn func, void *data,
}
-/* Return true if STMT is an empty statement or contains nothing but
- empty statements. */
-
-bool
-empty_body_p (tree stmt)
-{
- tree_stmt_iterator i;
- tree body;
-
- if (IS_EMPTY_STMT (stmt))
- return true;
- else if (TREE_CODE (stmt) == BIND_EXPR)
- body = BIND_EXPR_BODY (stmt);
- else if (TREE_CODE (stmt) == STATEMENT_LIST)
- body = stmt;
- else
- return false;
-
- for (i = tsi_start (body); !tsi_end_p (i); tsi_next (&i))
- if (!empty_body_p (tsi_stmt (i)))
- return false;
-
- return true;
-}
-
tree *
tree_block (tree t)
{
@@ -8839,28 +8819,10 @@ tree_block (tree t)
if (IS_EXPR_CODE_CLASS (c))
return &t->exp.block;
- else if (IS_GIMPLE_STMT_CODE_CLASS (c))
- return &GIMPLE_STMT_BLOCK (t);
gcc_unreachable ();
return NULL;
}
-tree *
-generic_tree_operand (tree node, int i)
-{
- if (GIMPLE_STMT_P (node))
- return &GIMPLE_STMT_OPERAND (node, i);
- return &TREE_OPERAND (node, i);
-}
-
-tree *
-generic_tree_type (tree node)
-{
- if (GIMPLE_STMT_P (node))
- return &void_type_node;
- return &TREE_TYPE (node);
-}
-
/* Build and return a TREE_LIST of arguments in the CALL_EXPR exp.
FIXME: don't use this function. It exists for compatibility with
the old representation of CALL_EXPRs where a list was used to hold the
@@ -8876,6 +8838,46 @@ call_expr_arglist (tree exp)
return arglist;
}
+
+/* Create a nameless artificial label and put it in the current function
+ context. Returns the newly created label. */
+
+tree
+create_artificial_label (void)
+{
+ tree lab = build_decl (LABEL_DECL, NULL_TREE, void_type_node);
+
+ DECL_ARTIFICIAL (lab) = 1;
+ DECL_IGNORED_P (lab) = 1;
+ DECL_CONTEXT (lab) = current_function_decl;
+ return lab;
+}
+
+/* Given a tree, try to return a useful variable name that we can use
+ to prefix a temporary that is being assigned the value of the tree.
+ I.E. given <temp> = &A, return A. */
+
+const char *
+get_name (tree t)
+{
+ tree stripped_decl;
+
+ stripped_decl = t;
+ STRIP_NOPS (stripped_decl);
+ if (DECL_P (stripped_decl) && DECL_NAME (stripped_decl))
+ return IDENTIFIER_POINTER (DECL_NAME (stripped_decl));
+ else
+ {
+ switch (TREE_CODE (stripped_decl))
+ {
+ case ADDR_EXPR:
+ return get_name (TREE_OPERAND (stripped_decl, 0));
+ default:
+ return NULL;
+ }
+ }
+}
+
/* Return true if TYPE has a variable argument list. */
bool
@@ -8941,7 +8943,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.def b/gcc/tree.def
index 26e72c44bd3..e9c891754bb 100644
--- a/gcc/tree.def
+++ b/gcc/tree.def
@@ -882,14 +882,6 @@ DEFTREECODE (ASM_EXPR, "asm_expr", tcc_statement, 4)
nodes to implement SSA versioning. */
DEFTREECODE (SSA_NAME, "ssa_name", tcc_exceptional, 0)
-/* SSA PHI operator. PHI_RESULT is the new SSA_NAME node created by
- the PHI node. PHI_ARG_LENGTH is the number of arguments.
- PHI_ARG_ELT returns the Ith tuple <ssa_name, edge> from the
- argument list. Each tuple contains the incoming reaching
- definition (SSA_NAME node) and the edge via which that definition
- is coming through. */
-DEFTREECODE (PHI_NODE, "phi_node", tcc_exceptional, 0)
-
/* Used to represent a typed exception handler. CATCH_TYPES is the type (or
list of types) handled, and CATCH_BODY is the code for the handler. */
DEFTREECODE (CATCH_EXPR, "catch_expr", tcc_statement, 2)
@@ -985,32 +977,15 @@ DEFTREECODE (TARGET_MEM_REF, "target_mem_ref", tcc_reference, 7)
exposed to TREE_RANGE_CHECK. */
/* OpenMP - #pragma omp parallel [clause1 ... clauseN]
Operand 0: OMP_PARALLEL_BODY: Code to be executed by all threads.
- Operand 1: OMP_PARALLEL_CLAUSES: List of clauses.
- Operand 2: OMP_PARALLEL_FN: FUNCTION_DECL used when outlining the
- body of the parallel region. Only valid after
- pass_lower_omp.
- Operand 3: OMP_PARALLEL_DATA_ARG: Local variable in the parent
- function containing data to be shared with the child
- function. */
+ Operand 1: OMP_PARALLEL_CLAUSES: List of clauses. */
-DEFTREECODE (OMP_PARALLEL, "omp_parallel", tcc_statement, 4)
+DEFTREECODE (OMP_PARALLEL, "omp_parallel", tcc_statement, 2)
/* OpenMP - #pragma omp task [clause1 ... clauseN]
Operand 0: OMP_TASK_BODY: Code to be executed by all threads.
- Operand 1: OMP_TASK_CLAUSES: List of clauses.
- Operand 2: OMP_TASK_FN: FUNCTION_DECL used when outlining the
- body of the task region. Only valid after
- pass_lower_omp.
- Operand 3: OMP_TASK_DATA_ARG: Local variable in the parent
- function containing data to be shared with the child
- function.
- Operand 4: OMP_TASK_COPYFN: FUNCTION_DECL used for constructing
- firstprivate variables.
- Operand 5: OMP_TASK_ARG_SIZE: Length of the task argument block.
- Operand 6: OMP_TASK_ARG_ALIGN: Required alignment of the task
- argument block. */
-
-DEFTREECODE (OMP_TASK, "omp_task", tcc_statement, 7)
+ Operand 1: OMP_TASK_CLAUSES: List of clauses. */
+
+DEFTREECODE (OMP_TASK, "omp_task", tcc_statement, 2)
/* OpenMP - #pragma omp for [clause1 ... clauseN]
Operand 0: OMP_FOR_BODY: Loop body.
@@ -1026,7 +1001,7 @@ DEFTREECODE (OMP_TASK, "omp_task", tcc_statement, 7)
OMP_FOR structured block, but are evaluated before the loop
body begins.
- VAR must be a signed integer variable, which is implicitly thread
+ VAR must be an integer or pointer variable, which is implicitly thread
private. N1, N2 and INCR are required to be loop invariant integer
expressions that are evaluated without any synchronization.
The evaluation order, frequency of evaluation and side-effects are
@@ -1035,14 +1010,8 @@ DEFTREECODE (OMP_FOR, "omp_for", tcc_statement, 6)
/* OpenMP - #pragma omp sections [clause1 ... clauseN]
Operand 0: OMP_SECTIONS_BODY: Sections body.
- Operand 1: OMP_SECTIONS_CLAUSES: List of clauses.
- Operand 2: OMP_SECTIONS_CONTROL: The control variable used for deciding
- which of the sections to execute. */
-DEFTREECODE (OMP_SECTIONS, "omp_sections", tcc_statement, 3)
-
-/* This tree immediately follows OMP_SECTIONS, and represents the switch
- used to decide which branch is taken. */
-DEFTREECODE (OMP_SECTIONS_SWITCH, "omp_sections_switch", tcc_statement, 0)
+ Operand 1: OMP_SECTIONS_CLAUSES: List of clauses. */
+DEFTREECODE (OMP_SECTIONS, "omp_sections", tcc_statement, 2)
/* OpenMP - #pragma omp single
Operand 0: OMP_SINGLE_BODY: Single section body.
@@ -1066,14 +1035,6 @@ DEFTREECODE (OMP_ORDERED, "omp_ordered", tcc_statement, 1)
Operand 1: OMP_CRITICAL_NAME: Identifier for critical section. */
DEFTREECODE (OMP_CRITICAL, "omp_critical", tcc_statement, 2)
-/* Return from an OpenMP directive. */
-DEFTREECODE (OMP_RETURN, "omp_return", tcc_statement, 0)
-
-/* OpenMP - An intermediate tree code to mark the location of the
- loop or sections iteration in the partially lowered code.
- The arguments are definition and use of the control variable. */
-DEFTREECODE (OMP_CONTINUE, "omp_continue", tcc_statement, 2)
-
/* OpenMP - #pragma omp atomic
Operand 0: The address at which the atomic operation is to be performed.
This address should be stabilized with save_expr.
@@ -1082,18 +1043,6 @@ DEFTREECODE (OMP_CONTINUE, "omp_continue", tcc_statement, 2)
build_fold_indirect_ref of the address. */
DEFTREECODE (OMP_ATOMIC, "omp_atomic", tcc_statement, 2)
-/* Codes used for lowering of OMP_ATOMIC. Although the form of the OMP_ATOMIC
- statement is very simple (just in form mem op= expr), various implicit
- conversions may cause the expression become more complex, so that it does
- not fit the gimple grammar very well. To overcome this problem, OMP_ATOMIC
- is rewritten as a sequence of two codes in gimplification:
-
- OMP_LOAD (tmp, mem)
- val = some computations involving tmp;
- OMP_STORE (val) */
-DEFTREECODE (OMP_ATOMIC_LOAD, "omp_atomic_load", tcc_statement, 2)
-DEFTREECODE (OMP_ATOMIC_STORE, "omp_atomic_store", tcc_statement, 1)
-
/* OpenMP clauses. */
DEFTREECODE (OMP_CLAUSE, "omp_clause", tcc_exceptional, 0)
@@ -1140,11 +1089,6 @@ DEFTREECODE (WIDEN_MULT_EXPR, "widen_mult_expr", tcc_binary, 2)
DEFTREECODE (VEC_LSHIFT_EXPR, "vec_lshift_expr", tcc_binary, 2)
DEFTREECODE (VEC_RSHIFT_EXPR, "vec_rshift_expr", tcc_binary, 2)
-/* GIMPLE tree codes. */
-
-/* Assignment expression. Operand 0 is the what to set; 1, the new value. */
-DEFTREECODE (GIMPLE_MODIFY_STMT, "gimple_modify_stmt", tcc_gimple_stmt, 2)
-
/* Widening vector multiplication.
The two operands are vectors with N elements of size S. Multiplying the
elements of the two vectors will result in N products of size 2*S.
diff --git a/gcc/tree.h b/gcc/tree.h
index 0ffd91bc40b..40cd4566e1e 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -69,8 +69,7 @@ enum tree_code_class {
but usually no interesting value. */
tcc_vl_exp, /* A function call or other expression with a
variable-length operand vector. */
- tcc_expression, /* Any other expression. */
- tcc_gimple_stmt /* A GIMPLE statement. */
+ tcc_expression /* Any other expression. */
};
/* Each tree code class has an associated string representation.
@@ -174,32 +173,10 @@ extern const enum tree_code_class tree_code_type[];
#define IS_EXPR_CODE_CLASS(CLASS)\
((CLASS) >= tcc_reference && (CLASS) <= tcc_expression)
-/* Returns nonzero iff CLASS is a GIMPLE statement. */
-
-#define IS_GIMPLE_STMT_CODE_CLASS(CLASS) ((CLASS) == tcc_gimple_stmt)
-
/* Returns nonzero iff NODE is an expression of some kind. */
#define EXPR_P(NODE) IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (NODE)))
-/* Returns nonzero iff NODE is an OpenMP directive. */
-
-#define OMP_DIRECTIVE_P(NODE) \
- (TREE_CODE (NODE) == OMP_PARALLEL \
- || TREE_CODE (NODE) == OMP_TASK \
- || TREE_CODE (NODE) == OMP_FOR \
- || TREE_CODE (NODE) == OMP_SECTIONS \
- || TREE_CODE (NODE) == OMP_SECTIONS_SWITCH \
- || TREE_CODE (NODE) == OMP_SINGLE \
- || TREE_CODE (NODE) == OMP_SECTION \
- || TREE_CODE (NODE) == OMP_MASTER \
- || TREE_CODE (NODE) == OMP_ORDERED \
- || TREE_CODE (NODE) == OMP_CRITICAL \
- || TREE_CODE (NODE) == OMP_RETURN \
- || TREE_CODE (NODE) == OMP_ATOMIC_LOAD \
- || TREE_CODE (NODE) == OMP_ATOMIC_STORE \
- || TREE_CODE (NODE) == OMP_CONTINUE)
-
/* Number of argument-words in each kind of tree-node. */
extern const unsigned char tree_code_length[];
@@ -407,8 +384,6 @@ struct tree_base GTY(())
unsigned spare : 23;
- /* FIXME tuples: Eventually, we need to move this somewhere external to
- the trees. */
union tree_ann_d *ann;
};
@@ -419,16 +394,6 @@ struct tree_common GTY(())
tree type;
};
-/* GIMPLE_MODIFY_STMT */
-struct gimple_stmt GTY(())
-{
- struct tree_base base;
- location_t locus;
- tree block;
- /* FIXME tuples: Eventually this should be of type ``struct gimple_expr''. */
- tree GTY ((length ("TREE_CODE_LENGTH (TREE_CODE (&%h))"))) operands[1];
-};
-
/* The following table lists the uses of each of the above flags and
for which types of nodes they are defined.
@@ -477,7 +442,7 @@ struct gimple_stmt GTY(())
POINTER_TYPE, REFERENCE_TYPE
MOVE_NONTEMPORAL in
- GIMPLE_MODIFY_STMT
+ MODIFY_EXPR
CASE_HIGH_SEEN in
CASE_LABEL_EXPR
@@ -523,9 +488,6 @@ struct gimple_stmt GTY(())
DECL_BY_REFERENCE in
PARM_DECL, RESULT_DECL
- OMP_RETURN_NOWAIT in
- OMP_RETURN
-
OMP_SECTION_LAST in
OMP_SECTION
@@ -815,14 +777,6 @@ enum tree_node_structure_enum {
__FUNCTION__); \
__t; })
-#define GIMPLE_STMT_CHECK(T) __extension__ \
-({ __typeof (T) const __t = (T); \
- char const __c = TREE_CODE_CLASS (TREE_CODE (__t)); \
- if (!IS_GIMPLE_STMT_CODE_CLASS (__c)) \
- tree_class_check_failed (__t, tcc_gimple_stmt, __FILE__, __LINE__,\
- __FUNCTION__); \
- __t; })
-
/* These checks have to be special cased. */
#define NON_TYPE_CHECK(T) __extension__ \
({ __typeof (T) const __t = (T); \
@@ -842,17 +796,6 @@ enum tree_node_structure_enum {
__FILE__, __LINE__, __FUNCTION__); \
&__t->vec.a[__i]; }))
-#define PHI_NODE_ELT_CHECK(T, I) __extension__ \
-(*({__typeof (T) const __t = (T); \
- const int __i = (I); \
- if (TREE_CODE (__t) != PHI_NODE) \
- tree_check_failed (__t, __FILE__, __LINE__, __FUNCTION__, \
- PHI_NODE, 0); \
- if (__i < 0 || __i >= __t->phi.capacity) \
- phi_node_elt_check_failed (__i, __t->phi.num_args, \
- __FILE__, __LINE__, __FUNCTION__); \
- &__t->phi.a[__i]; }))
-
#define OMP_CLAUSE_ELT_CHECK(T, I) __extension__ \
(*({__typeof (T) const __t = (T); \
const int __i = (I); \
@@ -868,8 +811,6 @@ enum tree_node_structure_enum {
#define TREE_OPERAND_CHECK(T, I) __extension__ \
(*({__typeof (T) const __t = EXPR_CHECK (T); \
const int __i = (I); \
- if (GIMPLE_TUPLE_P (__t)) \
- gcc_unreachable (); \
if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__t)) \
tree_operand_check_failed (__i, __t, \
__FILE__, __LINE__, __FUNCTION__); \
@@ -885,15 +826,6 @@ enum tree_node_structure_enum {
__FILE__, __LINE__, __FUNCTION__); \
&__t->exp.operands[__i]; }))
-/* Special checks for GIMPLE_STMT_OPERANDs. */
-#define GIMPLE_STMT_OPERAND_CHECK(T, I) __extension__ \
-(*({__typeof (T) const __t = GIMPLE_STMT_CHECK (T); \
- const int __i = (I); \
- if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__t)) \
- tree_operand_check_failed (__i, __t, \
- __FILE__, __LINE__, __FUNCTION__); \
- &__t->gstmt.operands[__i]; }))
-
#define TREE_RTL_OPERAND_CHECK(T, CODE, I) __extension__ \
(*(rtx *) \
({__typeof (T) const __t = (T); \
@@ -916,8 +848,6 @@ enum tree_node_structure_enum {
#define TREE_CHAIN(NODE) __extension__ \
(*({__typeof (NODE) const __t = (NODE); \
- if (GIMPLE_TUPLE_P (__t)) \
- gcc_unreachable (); \
&__t->common.chain; }))
/* In all nodes that are expressions, this is the data type of the expression.
@@ -926,8 +856,6 @@ enum tree_node_structure_enum {
In VECTOR_TYPE nodes, this is the type of the elements. */
#define TREE_TYPE(NODE) __extension__ \
(*({__typeof (NODE) const __t = (NODE); \
- if (GIMPLE_TUPLE_P (__t)) \
- gcc_unreachable (); \
&__t->common.type; }))
extern void tree_contains_struct_check_failed (const_tree,
@@ -985,14 +913,11 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
#define TREE_CLASS_CHECK(T, CODE) (T)
#define TREE_RANGE_CHECK(T, CODE1, CODE2) (T)
#define EXPR_CHECK(T) (T)
-#define GIMPLE_STMT_CHECK(T) (T)
#define NON_TYPE_CHECK(T) (T)
#define TREE_VEC_ELT_CHECK(T, I) ((T)->vec.a[I])
#define TREE_OPERAND_CHECK(T, I) ((T)->exp.operands[I])
#define TREE_OPERAND_CHECK_CODE(T, CODE, I) ((T)->exp.operands[I])
-#define GIMPLE_STMT_OPERAND_CHECK(T, I) ((T)->gstmt.operands[I])
#define TREE_RTL_OPERAND_CHECK(T, CODE, I) (*(rtx *) &((T)->exp.operands[I]))
-#define PHI_NODE_ELT_CHECK(T, i) ((T)->phi.a[i])
#define OMP_CLAUSE_ELT_CHECK(T, i) ((T)->omp_clause.ops[i])
#define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) (T)
#define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) (T)
@@ -1028,27 +953,6 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
TREE_CHECK5 (T, INTEGER_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, REAL_TYPE, \
FIXED_POINT_TYPE)
-/* Nonzero if NODE is a GIMPLE statement. */
-#define GIMPLE_STMT_P(NODE) \
- (TREE_CODE_CLASS (TREE_CODE ((NODE))) == tcc_gimple_stmt)
-
-/* Nonzero if NODE is a GIMPLE tuple. */
-#define GIMPLE_TUPLE_P(NODE) (GIMPLE_STMT_P (NODE) || TREE_CODE (NODE) == PHI_NODE)
-
-/* A GIMPLE tuple that has a ``locus'' field. */
-#define GIMPLE_TUPLE_HAS_LOCUS_P(NODE) GIMPLE_STMT_P ((NODE))
-
-/* Like TREE_OPERAND but works with GIMPLE stmt tuples as well.
-
- If you know the NODE is a GIMPLE statement, use GIMPLE_STMT_OPERAND. If the
- NODE code is unknown at compile time, use this macro. */
-#define GENERIC_TREE_OPERAND(NODE, I) *(generic_tree_operand ((NODE), (I)))
-
-/* Like TREE_TYPE but returns void_type_node for gimple tuples that have
- no type. */
-
-#define GENERIC_TREE_TYPE(NODE) *(generic_tree_type ((NODE)))
-
/* Here is how primitive or already-canonicalized types' hash codes
are made. */
#define TYPE_HASH(TYPE) (TYPE_UID (TYPE))
@@ -1057,16 +961,12 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
used in hash tables which are saved to a PCH. */
#define TREE_HASH(NODE) ((size_t) (NODE) & 0777777)
-/* The TREE_CHAIN but it is able to handle tuples. */
-#define GENERIC_NEXT(NODE) \
- (TREE_CODE (NODE) == PHI_NODE ? PHI_CHAIN (NODE) : \
- GIMPLE_STMT_P (NODE) ? NULL_TREE : TREE_CHAIN (NODE))
-
-/* Tests if expression is conversion expr (NOP_EXPRs or CONVERT_EXPRs). */
+/* Tests if CODE is a conversion expr (NOP_EXPR or CONVERT_EXPR). */
+#define CONVERT_EXPR_CODE_P(CODE) \
+ ((CODE) == NOP_EXPR || (CODE) == CONVERT_EXPR)
-#define CONVERT_EXPR_P(EXP) \
- (TREE_CODE (EXP) == NOP_EXPR \
- || TREE_CODE (EXP) == CONVERT_EXPR)
+/* Similarly, but accept an expressions instead of a tree code. */
+#define CONVERT_EXPR_P(EXP) CONVERT_EXPR_CODE_P (TREE_CODE (EXP))
/* Generate case for NOP_EXPR, CONVERT_EXPR. */
@@ -1082,7 +982,7 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
|| TREE_CODE (EXP) == NON_LVALUE_EXPR) \
&& TREE_OPERAND (EXP, 0) != error_mark_node \
&& (TYPE_MODE (TREE_TYPE (EXP)) \
- == TYPE_MODE (GENERIC_TREE_TYPE (TREE_OPERAND (EXP, 0))))) \
+ == TYPE_MODE (TREE_TYPE (TREE_OPERAND (EXP, 0))))) \
(EXP) = TREE_OPERAND (EXP, 0)
/* Like STRIP_NOPS, but don't let the signedness change either. */
@@ -1279,7 +1179,7 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
/* In a MODIFY_EXPR, means that the store in the expression is nontemporal. */
#define MOVE_NONTEMPORAL(NODE) \
- (GIMPLE_MODIFY_STMT_CHECK (NODE)->base.static_flag)
+ (EXPR_CHECK (NODE)->base.static_flag)
/* In an INTEGER_CST, REAL_CST, COMPLEX_CST, or VECTOR_CST, this means
there was an overflow in folding. */
@@ -1658,28 +1558,25 @@ struct tree_constructor GTY(())
#define VL_EXP_OPERAND_LENGTH(NODE) \
((int)TREE_INT_CST_LOW (VL_EXP_CHECK (NODE)->exp.operands[0]))
-/* In gimple statements. */
-#define GIMPLE_STMT_OPERAND(NODE, I) GIMPLE_STMT_OPERAND_CHECK (NODE, I)
-#define GIMPLE_STMT_LOCUS(NODE) (GIMPLE_STMT_CHECK (NODE)->gstmt.locus)
-#define GIMPLE_STMT_BLOCK(NODE) (GIMPLE_STMT_CHECK (NODE)->gstmt.block)
-
/* In a LOOP_EXPR node. */
#define LOOP_EXPR_BODY(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_EXPR, 0)
/* The source location of this expression. Non-tree_exp nodes such as
decls and constants can be shared among multiple locations, so
return nothing. */
-#define EXPR_LOCATION(NODE) expr_location ((NODE))
-#define SET_EXPR_LOCATION(NODE, FROM) set_expr_location ((NODE), (FROM))
-#define EXPR_HAS_LOCATION(NODE) expr_has_location ((NODE))
-#define EXPR_LOCUS(NODE) expr_locus ((NODE))
+#define EXPR_LOCATION(NODE) (EXPR_P ((NODE)) ? (NODE)->exp.locus : UNKNOWN_LOCATION)
+#define SET_EXPR_LOCATION(NODE, LOCUS) EXPR_CHECK ((NODE))->exp.locus = (LOCUS)
+#define EXPR_HAS_LOCATION(NODE) (EXPR_LOCATION (NODE) != UNKNOWN_LOCATION)
+#define EXPR_LOCUS(NODE) (EXPR_P (NODE) \
+ ? CONST_CAST (source_location *, &(NODE)->exp.locus) \
+ : (source_location *) NULL)
#define SET_EXPR_LOCUS(NODE, FROM) set_expr_locus ((NODE), (FROM))
-#define EXPR_FILENAME(NODE) (expr_filename ((NODE)))
-#define EXPR_LINENO(NODE) (expr_lineno ((NODE)))
+#define EXPR_FILENAME(NODE) LOCATION_FILE (EXPR_CHECK ((NODE))->exp.locus)
+#define EXPR_LINENO(NODE) LOCATION_LINE (EXPR_CHECK (NODE)->exp.locus)
/* True if a tree is an expression or statement that can have a
location. */
-#define CAN_HAVE_LOCATION_P(NODE) (EXPR_P (NODE) || GIMPLE_STMT_P (NODE))
+#define CAN_HAVE_LOCATION_P(NODE) (EXPR_P (NODE))
/* In a TARGET_EXPR node. */
#define TARGET_EXPR_SLOT(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 0)
@@ -1805,22 +1702,13 @@ struct tree_constructor GTY(())
#define OMP_PARALLEL_BODY(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 0)
#define OMP_PARALLEL_CLAUSES(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 1)
-#define OMP_PARALLEL_FN(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 2)
-#define OMP_PARALLEL_DATA_ARG(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 3)
#define OMP_TASK_BODY(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 0)
#define OMP_TASK_CLAUSES(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 1)
-#define OMP_TASK_FN(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 2)
-#define OMP_TASK_DATA_ARG(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 3)
-#define OMP_TASK_COPYFN(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 4)
-#define OMP_TASK_ARG_SIZE(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 5)
-#define OMP_TASK_ARG_ALIGN(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 6)
#define OMP_TASKREG_CHECK(NODE) TREE_RANGE_CHECK (NODE, OMP_PARALLEL, OMP_TASK)
#define OMP_TASKREG_BODY(NODE) TREE_OPERAND (OMP_TASKREG_CHECK (NODE), 0)
#define OMP_TASKREG_CLAUSES(NODE) TREE_OPERAND (OMP_TASKREG_CHECK (NODE), 1)
-#define OMP_TASKREG_FN(NODE) TREE_OPERAND (OMP_TASKREG_CHECK (NODE), 2)
-#define OMP_TASKREG_DATA_ARG(NODE) TREE_OPERAND (OMP_TASKREG_CHECK (NODE), 3)
#define OMP_FOR_BODY(NODE) TREE_OPERAND (OMP_FOR_CHECK (NODE), 0)
#define OMP_FOR_CLAUSES(NODE) TREE_OPERAND (OMP_FOR_CHECK (NODE), 1)
@@ -1831,7 +1719,6 @@ struct tree_constructor GTY(())
#define OMP_SECTIONS_BODY(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 0)
#define OMP_SECTIONS_CLAUSES(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 1)
-#define OMP_SECTIONS_CONTROL(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 2)
#define OMP_SECTION_BODY(NODE) TREE_OPERAND (OMP_SECTION_CHECK (NODE), 0)
@@ -1856,13 +1743,6 @@ struct tree_constructor GTY(())
#define OMP_SECTION_LAST(NODE) \
(OMP_SECTION_CHECK (NODE)->base.private_flag)
-/* True on an OMP_RETURN statement if the return does not require a
- thread synchronization via some sort of barrier. The exact barrier
- that would otherwise be emitted is dependent on the OMP statement
- with which this return is associated. */
-#define OMP_RETURN_NOWAIT(NODE) \
- (OMP_RETURN_CHECK (NODE)->base.private_flag)
-
/* True on an OMP_PARALLEL statement if it represents an explicit
combined parallel work-sharing constructs. */
#define OMP_PARALLEL_COMBINED(NODE) \
@@ -1887,6 +1767,8 @@ struct tree_constructor GTY(())
OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, \
OMP_CLAUSE_LASTPRIVATE),\
1)
+#define OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ(NODE) \
+ (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_init
#define OMP_CLAUSE_IF_EXPR(NODE) \
OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_IF), 0)
@@ -1908,6 +1790,10 @@ struct tree_constructor GTY(())
OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 1)
#define OMP_CLAUSE_REDUCTION_MERGE(NODE) \
OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 2)
+#define OMP_CLAUSE_REDUCTION_GIMPLE_INIT(NODE) \
+ (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_init
+#define OMP_CLAUSE_REDUCTION_GIMPLE_MERGE(NODE) \
+ (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_merge
#define OMP_CLAUSE_REDUCTION_PLACEHOLDER(NODE) \
OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 3)
@@ -1951,10 +1837,8 @@ struct tree_exp GTY(())
only field that can be relied upon. */
#define SSA_NAME_VAR(NODE) SSA_NAME_CHECK (NODE)->ssa_name.var
-/* Returns the statement which defines this reference. Note that
- we use the same field when chaining SSA_NAME nodes together on
- the SSA_NAME freelist. */
-#define SSA_NAME_DEF_STMT(NODE) SSA_NAME_CHECK (NODE)->common.chain
+/* Returns the statement which defines this SSA name. */
+#define SSA_NAME_DEF_STMT(NODE) SSA_NAME_CHECK (NODE)->ssa_name.def_stmt
/* Returns the SSA version number of this SSA name. Note that in
tree SSA, version numbers are not per variable and may be recycled. */
@@ -2000,7 +1884,12 @@ typedef struct ssa_use_operand_d GTY(())
{
struct ssa_use_operand_d* GTY((skip(""))) prev;
struct ssa_use_operand_d* GTY((skip(""))) next;
- tree GTY((skip(""))) stmt;
+ /* Immediate uses for a given SSA name are maintained as a cyclic
+ list. To recognize the root of this list, the location field
+ needs to point to the original SSA name. Since statements and
+ SSA names are of different data types, we need this union. See
+ the explanation in struct immediate_use_iterator_d. */
+ union { gimple stmt; tree ssa_name; } GTY((skip(""))) loc;
tree *GTY((skip(""))) use;
} ssa_use_operand_t;
@@ -2014,6 +1903,9 @@ struct tree_ssa_name GTY(())
/* _DECL wrapped by this SSA name. */
tree var;
+ /* Statement that defines this SSA name. */
+ gimple def_stmt;
+
/* SSA version number. */
unsigned int version;
@@ -2031,29 +1923,6 @@ struct tree_ssa_name GTY(())
struct ssa_use_operand_d imm_uses;
};
-/* In a PHI_NODE node. */
-
-/* These 2 macros should be considered off limits for use by developers. If
- you wish to access the use or def fields of a PHI_NODE in the SSA
- optimizers, use the accessor macros found in tree-ssa-operands.h.
- These two macros are to be used only by those accessor macros, and other
- select places where we *absolutely* must take the address of the tree. */
-
-#define PHI_RESULT_TREE(NODE) PHI_NODE_CHECK (NODE)->phi.result
-#define PHI_ARG_DEF_TREE(NODE, I) PHI_NODE_ELT_CHECK (NODE, I).def
-
-/* PHI_NODEs for each basic block are chained together in a single linked
- list. The head of the list is linked from the block annotation, and
- the link to the next PHI is in PHI_CHAIN. */
-#define PHI_CHAIN(NODE) PHI_NODE_CHECK (NODE)->phi.chain
-
-#define PHI_NUM_ARGS(NODE) PHI_NODE_CHECK (NODE)->phi.num_args
-#define PHI_ARG_CAPACITY(NODE) PHI_NODE_CHECK (NODE)->phi.capacity
-#define PHI_ARG_ELT(NODE, I) PHI_NODE_ELT_CHECK (NODE, I)
-#define PHI_ARG_EDGE(NODE, I) (EDGE_PRED (PHI_BB ((NODE)), (I)))
-#define PHI_BB(NODE) PHI_NODE_CHECK (NODE)->phi.bb
-#define PHI_ARG_IMM_USE_NODE(NODE, I) PHI_NODE_ELT_CHECK (NODE, I).imm_use
-
struct phi_arg_d GTY(())
{
/* imm_use MUST be the first element in struct because we do some
@@ -2062,22 +1931,6 @@ struct phi_arg_d GTY(())
tree def;
};
-struct tree_phi_node GTY(())
-{
- struct tree_base common;
- tree chain;
- tree result;
- int num_args;
- int capacity;
-
- /* Basic block holding this PHI node. */
- struct basic_block_def *bb;
-
- /* Arguments of the PHI node. These are maintained in the same
- order as predecessor edge vector BB->PREDS. */
- struct phi_arg_d GTY ((length ("((tree)&%h)->phi.num_args"))) a[1];
-};
-
#define OMP_CLAUSE_CODE(NODE) \
(OMP_CLAUSE_CHECK (NODE))->omp_clause.code
@@ -2100,6 +1953,12 @@ struct tree_omp_clause GTY(())
enum omp_clause_schedule_kind schedule_kind;
enum tree_code reduction_code;
} GTY ((skip)) subcode;
+
+ /* The gimplification of OMP_CLAUSE_REDUCTION_{INIT,MERGE} for omp-low's
+ usage. */
+ gimple_seq gimple_reduction_init;
+ gimple_seq gimple_reduction_merge;
+
tree GTY ((length ("omp_clause_num_ops[OMP_CLAUSE_CODE ((tree)&%h)]"))) ops[1];
};
@@ -3574,11 +3433,9 @@ union tree_node GTY ((ptr_alias (union lang_tree_node),
struct tree_vec GTY ((tag ("TS_VEC"))) vec;
struct tree_exp GTY ((tag ("TS_EXP"))) exp;
struct tree_ssa_name GTY ((tag ("TS_SSA_NAME"))) ssa_name;
- struct tree_phi_node GTY ((tag ("TS_PHI_NODE"))) phi;
struct tree_block GTY ((tag ("TS_BLOCK"))) block;
struct tree_binfo GTY ((tag ("TS_BINFO"))) binfo;
struct tree_statement_list GTY ((tag ("TS_STATEMENT_LIST"))) stmt_list;
- struct gimple_stmt GTY ((tag ("TS_GIMPLE_STATEMENT"))) gstmt;
struct tree_constructor GTY ((tag ("TS_CONSTRUCTOR"))) constructor;
struct tree_memory_tag GTY ((tag ("TS_MEMORY_TAG"))) mtag;
struct tree_omp_clause GTY ((tag ("TS_OMP_CLAUSE"))) omp_clause;
@@ -3734,11 +3591,9 @@ enum tree_index
TI_OPTIMIZATION_DEFAULT,
TI_OPTIMIZATION_CURRENT,
- TI_OPTIMIZATION_COLD,
- TI_OPTIMIZATION_HOT,
TI_TARGET_OPTION_DEFAULT,
TI_TARGET_OPTION_CURRENT,
- TI_CURRENT_OPTION_PRAGMA,
+ TI_CURRENT_TARGET_PRAGMA,
TI_CURRENT_OPTIMIZE_PRAGMA,
TI_MAX
@@ -3908,12 +3763,10 @@ extern GTY(()) tree global_trees[TI_MAX];
#define main_identifier_node global_trees[TI_MAIN_IDENTIFIER]
#define MAIN_NAME_P(NODE) (IDENTIFIER_NODE_CHECK (NODE) == main_identifier_node)
-/* Optimization options (OPTIMIZATION_NODE) to use for default, current, cold,
- and hot functions. */
+/* Optimization options (OPTIMIZATION_NODE) to use for default and current
+ functions. */
#define optimization_default_node global_trees[TI_OPTIMIZATION_DEFAULT]
#define optimization_current_node global_trees[TI_OPTIMIZATION_CURRENT]
-#define optimization_cold_node global_trees[TI_OPTIMIZATION_COLD]
-#define optimization_hot_node global_trees[TI_OPTIMIZATION_HOT]
/* Default/current target options (TARGET_OPTION_NODE). */
#define target_option_default_node global_trees[TI_TARGET_OPTION_DEFAULT]
@@ -3921,7 +3774,7 @@ extern GTY(()) tree global_trees[TI_MAX];
/* Default tree list option(), optimize() pragmas to be linked into the
attribute list. */
-#define current_option_pragma global_trees[TI_CURRENT_OPTION_PRAGMA]
+#define current_target_pragma global_trees[TI_CURRENT_TARGET_PRAGMA]
#define current_optimize_pragma global_trees[TI_CURRENT_OPTIMIZE_PRAGMA]
/* An enumeration of the standard C integer types. These must be
@@ -4006,8 +3859,8 @@ extern hashval_t decl_assembler_name_hash (const_tree asmname);
extern size_t tree_size (const_tree);
/* Compute the number of bytes occupied by a tree with code CODE. This
- function cannot be used for TREE_VEC or PHI_NODE codes, which are of
- variable length. */
+ function cannot be used for TREE_VEC codes, which are of variable
+ length. */
extern size_t tree_code_size (enum tree_code);
/* Lowest level primitive for allocating a node.
@@ -4083,10 +3936,6 @@ extern tree build7_stat (enum tree_code, tree, tree, tree, tree, tree,
#define build7(c,t1,t2,t3,t4,t5,t6,t7,t8) \
build7_stat (c,t1,t2,t3,t4,t5,t6,t7,t8 MEM_STAT_INFO)
-extern tree build_gimple_modify_stmt_stat (tree, tree MEM_STAT_DECL);
-#define build_gimple_modify_stmt(t1,t2) \
- build_gimple_modify_stmt_stat (t1,t2 MEM_STAT_INFO)
-
extern tree build_int_cst (tree, HOST_WIDE_INT);
extern tree build_int_cst_type (tree, HOST_WIDE_INT);
extern tree build_int_cstu (tree, unsigned HOST_WIDE_INT);
@@ -4141,6 +3990,8 @@ extern tree build_index_2_type (tree, tree);
extern tree build_array_type (tree, tree);
extern tree build_function_type (tree, tree);
extern tree build_function_type_list (tree, ...);
+extern tree build_function_type_skip_args (tree, bitmap);
+extern tree build_function_decl_skip_args (tree, bitmap);
extern tree build_varargs_function_type_list (tree, ...);
extern tree build_method_type_directly (tree, tree, tree);
extern tree build_method_type (tree, tree);
@@ -4821,15 +4672,19 @@ extern bool commutative_tree_code (enum tree_code);
extern tree upper_bound_in_type (tree, tree);
extern tree lower_bound_in_type (tree, tree);
extern int operand_equal_for_phi_arg_p (const_tree, const_tree);
-extern bool empty_body_p (tree);
extern tree call_expr_arg (tree, int);
extern tree *call_expr_argp (tree, int);
extern tree call_expr_arglist (tree);
+extern tree create_artificial_label (void);
+extern const char *get_name (tree);
extern bool stdarg_p (tree);
extern bool prototype_p (tree);
extern int function_args_count (tree);
extern bool auto_var_in_fn_p (const_tree, const_tree);
+/* In gimplify.c */
+extern tree unshare_expr (tree);
+
/* In stmt.c */
extern void expand_expr_stmt (tree);
@@ -4883,10 +4738,12 @@ extern tree fold_ignored_result (tree);
extern tree fold_abs_const (tree, tree);
extern tree fold_indirect_ref_1 (tree, tree);
extern void fold_defer_overflow_warnings (void);
-extern void fold_undefer_overflow_warnings (bool, const_tree, int);
+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,
int, bool);
@@ -4952,7 +4809,6 @@ extern tree constant_boolean_node (int, tree);
extern tree build_low_bits_mask (tree, unsigned);
extern bool tree_swap_operands_p (const_tree, const_tree, bool);
-extern void swap_tree_operands (tree, tree *, tree *);
extern enum tree_code swap_tree_comparison (enum tree_code);
extern bool ptr_difference_const (tree, tree, HOST_WIDE_INT *);
@@ -4969,8 +4825,7 @@ extern bool tree_binary_nonnegative_warnv_p (enum tree_code, tree, tree, tree,
bool *);
extern bool tree_single_nonnegative_warnv_p (tree t, bool *strict_overflow_p);
extern bool tree_invalid_nonnegative_warnv_p (tree t, bool *strict_overflow_p);
-extern bool tree_call_nonnegative_warnv_p (enum tree_code code, tree, tree,
- tree, tree, bool *);
+extern bool tree_call_nonnegative_warnv_p (tree, tree, tree, tree, bool *);
extern bool tree_expr_nonzero_warnv_p (tree, bool *);
@@ -4996,12 +4851,14 @@ extern tree build_call_expr (tree, int, ...);
extern tree mathfn_built_in (tree, enum built_in_function fn);
extern tree strip_float_extensions (tree);
extern tree c_strlen (tree, int);
-extern tree std_gimplify_va_arg_expr (tree, tree, tree *, tree *);
+extern tree std_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *);
extern tree build_va_arg_indirect_ref (tree);
extern tree build_string_literal (int, const char *);
extern bool validate_arglist (const_tree, ...);
extern rtx builtin_memset_read_str (void *, HOST_WIDE_INT, enum machine_mode);
extern int get_pointer_alignment (tree, unsigned int);
+extern tree fold_call_stmt (gimple, bool);
+extern tree gimple_fold_builtin_snprintf_chk (gimple, tree, enum built_in_function);
/* In convert.c */
extern tree strip_float_extensions (tree);
@@ -5009,6 +4866,7 @@ extern tree strip_float_extensions (tree);
/* In tree.c */
extern int really_constant_p (const_tree);
extern bool decl_address_invariant_p (const_tree);
+extern bool decl_address_ip_invariant_p (const_tree);
extern int int_fits_type_p (const_tree, const_tree);
#ifndef GENERATOR_FILE
extern void get_type_static_bounds (const_tree, mpz_t, mpz_t);
@@ -5018,6 +4876,8 @@ extern int tree_log2 (const_tree);
extern int tree_floor_log2 (const_tree);
extern int simple_cst_equal (const_tree, const_tree);
extern hashval_t iterative_hash_expr (const_tree, hashval_t);
+extern hashval_t iterative_hash_exprs_commutative (const_tree,
+ const_tree, hashval_t);
extern hashval_t iterative_hash_hashval_t (hashval_t, hashval_t);
extern int compare_tree_int (const_tree, unsigned HOST_WIDE_INT);
extern int type_list_equal (const_tree, const_tree);
@@ -5049,18 +4909,9 @@ extern tree build_addr (tree, tree);
extern bool fields_compatible_p (const_tree, const_tree);
extern tree find_compatible_field (tree, tree);
-extern location_t expr_location (const_tree);
-extern void set_expr_location (tree, location_t);
-extern bool expr_has_location (const_tree);
-
-extern location_t *expr_locus (const_tree);
extern void set_expr_locus (tree, source_location *);
-extern const char *expr_filename (const_tree);
-extern int expr_lineno (const_tree);
extern tree *tree_block (tree);
-extern tree *generic_tree_operand (tree, int);
-extern tree *generic_tree_type (tree);
extern location_t *block_nonartificial_location (tree);
/* In function.c */
@@ -5081,7 +4932,7 @@ extern void preserve_temp_slots (rtx);
extern int aggregate_value_p (const_tree, const_tree);
extern void push_function_context (void);
extern void pop_function_context (void);
-extern tree gimplify_parameters (void);
+extern gimple_seq gimplify_parameters (void);
/* In print-rtl.c */
#ifdef BUFSIZ
@@ -5139,6 +4990,7 @@ extern int flags_from_decl_or_type (const_tree);
extern int call_expr_flags (const_tree);
extern int setjmp_call_p (const_tree);
+extern bool gimple_alloca_call_p (const_gimple);
extern bool alloca_call_p (const_tree);
extern bool must_pass_in_stack_var_size (enum machine_mode, const_tree);
extern bool must_pass_in_stack_var_size_or_pad (enum machine_mode, const_tree);
@@ -5197,12 +5049,6 @@ extern void expand_anon_union_decl (tree, tree, tree);
extern tree tree_overlaps_hard_reg_set (tree, HARD_REG_SET *);
#endif
-/* In gimplify.c. */
-extern tree create_artificial_label (void);
-extern void gimplify_function_tree (tree);
-extern const char *get_name (const_tree);
-extern tree unshare_expr (tree);
-extern void sort_case_labels (tree);
/* Interface of the DWARF2 unwind info support. */
@@ -5284,14 +5130,12 @@ typedef enum
temp_list_kind,
vec_kind,
binfo_kind,
- phi_kind,
ssa_name_kind,
constr_kind,
x_kind,
lang_decl,
lang_type,
omp_clause_kind,
- gimple_stmt_kind,
all_kinds
} tree_node_kind;
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index a16e7d48378..fac124ffddf 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -78,22 +78,21 @@ static struct value_prof_hooks *value_prof_hooks;
same information as above. */
-static tree tree_divmod_fixed_value (tree, tree, tree, tree,
- tree, int, gcov_type, gcov_type);
-static tree tree_mod_pow2 (tree, tree, tree, tree, int, gcov_type, gcov_type);
-static tree tree_mod_subtract (tree, tree, tree, tree, int, int, int,
- gcov_type, gcov_type, gcov_type);
-static bool tree_divmod_fixed_value_transform (tree);
-static bool tree_mod_pow2_value_transform (tree);
-static bool tree_mod_subtract_transform (tree);
-static bool tree_stringops_transform (block_stmt_iterator *);
-static bool tree_ic_transform (tree);
+static tree gimple_divmod_fixed_value (gimple, tree, int, gcov_type, gcov_type);
+static tree gimple_mod_pow2 (gimple, int, gcov_type, gcov_type);
+static tree gimple_mod_subtract (gimple, int, int, int, gcov_type, gcov_type,
+ gcov_type);
+static bool gimple_divmod_fixed_value_transform (gimple_stmt_iterator *);
+static bool gimple_mod_pow2_value_transform (gimple_stmt_iterator *);
+static bool gimple_mod_subtract_transform (gimple_stmt_iterator *);
+static bool gimple_stringops_transform (gimple_stmt_iterator *);
+static bool gimple_ic_transform (gimple);
/* Allocate histogram value. */
static histogram_value
gimple_alloc_histogram_value (struct function *fun ATTRIBUTE_UNUSED,
- enum hist_type type, tree stmt, tree value)
+ enum hist_type type, gimple stmt, tree value)
{
histogram_value hist = (histogram_value) xcalloc (1, sizeof (*hist));
hist->hvalue.value = value;
@@ -115,13 +114,13 @@ histogram_hash (const void *x)
static int
histogram_eq (const void *x, const void *y)
{
- return ((const_histogram_value) x)->hvalue.stmt == (const_tree)y;
+ return ((const_histogram_value) x)->hvalue.stmt == (const_gimple) y;
}
/* Set histogram for STMT. */
static void
-set_histogram_value (struct function *fun, tree stmt, histogram_value hist)
+set_histogram_value (struct function *fun, gimple stmt, histogram_value hist)
{
void **loc;
if (!hist && !VALUE_HISTOGRAMS (fun))
@@ -144,7 +143,7 @@ set_histogram_value (struct function *fun, tree stmt, histogram_value hist)
/* Get histogram list for STMT. */
histogram_value
-gimple_histogram_value (struct function *fun, tree stmt)
+gimple_histogram_value (struct function *fun, gimple stmt)
{
if (!VALUE_HISTOGRAMS (fun))
return NULL;
@@ -155,16 +154,19 @@ gimple_histogram_value (struct function *fun, tree stmt)
/* Add histogram for STMT. */
void
-gimple_add_histogram_value (struct function *fun, tree stmt, histogram_value hist)
+gimple_add_histogram_value (struct function *fun, gimple stmt,
+ histogram_value hist)
{
hist->hvalue.next = gimple_histogram_value (fun, stmt);
set_histogram_value (fun, stmt, hist);
}
+
/* Remove histogram HIST from STMT's histogram list. */
void
-gimple_remove_histogram_value (struct function *fun, tree stmt, histogram_value hist)
+gimple_remove_histogram_value (struct function *fun, gimple stmt,
+ histogram_value hist)
{
histogram_value hist2 = gimple_histogram_value (fun, stmt);
if (hist == hist2)
@@ -184,13 +186,16 @@ gimple_remove_histogram_value (struct function *fun, tree stmt, histogram_value
free (hist);
}
+
/* Lookup histogram of type TYPE in the STMT. */
histogram_value
-gimple_histogram_value_of_type (struct function *fun, tree stmt, enum hist_type type)
+gimple_histogram_value_of_type (struct function *fun, gimple stmt,
+ enum hist_type type)
{
histogram_value hist;
- for (hist = gimple_histogram_value (fun, stmt); hist; hist = hist->hvalue.next)
+ for (hist = gimple_histogram_value (fun, stmt); hist;
+ hist = hist->hvalue.next)
if (hist->type == type)
return hist;
return NULL;
@@ -302,7 +307,7 @@ dump_histogram_value (FILE *dump_file, histogram_value hist)
/* Dump all histograms attached to STMT to DUMP_FILE. */
void
-dump_histograms_for_stmt (struct function *fun, FILE *dump_file, tree stmt)
+dump_histograms_for_stmt (struct function *fun, FILE *dump_file, gimple stmt)
{
histogram_value hist;
for (hist = gimple_histogram_value (fun, stmt); hist; hist = hist->hvalue.next)
@@ -312,7 +317,7 @@ dump_histograms_for_stmt (struct function *fun, FILE *dump_file, tree stmt)
/* Remove all histograms associated with STMT. */
void
-gimple_remove_stmt_histograms (struct function *fun, tree stmt)
+gimple_remove_stmt_histograms (struct function *fun, gimple stmt)
{
histogram_value val;
while ((val = gimple_histogram_value (fun, stmt)) != NULL)
@@ -322,18 +327,18 @@ gimple_remove_stmt_histograms (struct function *fun, tree stmt)
/* Duplicate all histograms associates with OSTMT to STMT. */
void
-gimple_duplicate_stmt_histograms (struct function *fun, tree stmt,
- struct function *ofun, tree ostmt)
+gimple_duplicate_stmt_histograms (struct function *fun, gimple stmt,
+ struct function *ofun, gimple ostmt)
{
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);
}
}
@@ -341,7 +346,7 @@ gimple_duplicate_stmt_histograms (struct function *fun, tree stmt,
/* Move all histograms associated with OSTMT to STMT. */
void
-gimple_move_stmt_histograms (struct function *fun, tree stmt, tree ostmt)
+gimple_move_stmt_histograms (struct function *fun, gimple stmt, gimple ostmt)
{
histogram_value val = gimple_histogram_value (fun, ostmt);
if (val)
@@ -370,36 +375,38 @@ visit_hist (void **slot, void *data)
{
error ("Dead histogram");
dump_histogram_value (stderr, hist);
- debug_generic_stmt (hist->hvalue.stmt);
+ debug_gimple_stmt (hist->hvalue.stmt);
error_found = true;
}
return 1;
}
+
/* Verify sanity of the histograms. */
void
verify_histograms (void)
{
basic_block bb;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
histogram_value hist;
struct pointer_set_t *visited_hists;
error_found = false;
visited_hists = pointer_set_create ();
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))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
- for (hist = gimple_histogram_value (cfun, stmt); hist; hist = hist->hvalue.next)
+ for (hist = gimple_histogram_value (cfun, stmt); hist;
+ hist = hist->hvalue.next)
{
if (hist->hvalue.stmt != stmt)
{
- error ("Histogram value statement does not correspond to statement"
- " it is associated with");
- debug_generic_stmt (stmt);
+ error ("Histogram value statement does not correspond to "
+ "the statement it is associated with");
+ debug_gimple_stmt (stmt);
dump_histogram_value (stderr, hist);
error_found = true;
}
@@ -439,38 +446,59 @@ free_histograms (void)
}
}
-/* The overall number of invocations of the counter should match execution count
- of basic block. Report it as error rather than internal error as it might
- mean that user has misused the profile somehow. */
+
+/* The overall number of invocations of the counter should match
+ execution count of basic block. Report it as error rather than
+ internal error as it might mean that user has misused the profile
+ somehow. */
+
static bool
-check_counter (tree 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 && EXPR_HAS_LOCATION (stmt)
- ? EXPR_LOCUS (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;
+ location_t locus;
+ locus = (stmt != NULL)
+ ? 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;
}
-/* Tree based transformations. */
+
+/* GIMPLE based transformations. */
+
static bool
-tree_value_profile_transformations (void)
+gimple_value_profile_transformations (void)
{
basic_block bb;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
bool changed = false;
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))
{
- tree stmt = bsi_stmt (bsi);
+ gimple stmt = gsi_stmt (gsi);
histogram_value th = gimple_histogram_value (cfun, stmt);
if (!th)
continue;
@@ -478,7 +506,7 @@ tree_value_profile_transformations (void)
if (dump_file)
{
fprintf (dump_file, "Trying transformations on stmt ");
- print_generic_stmt (dump_file, stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
dump_histograms_for_stmt (cfun, dump_file, stmt);
}
@@ -490,19 +518,19 @@ tree_value_profile_transformations (void)
current statement remain valid (although possibly
modified) upon return. */
if (flag_value_profile_transformations
- && (tree_mod_subtract_transform (stmt)
- || tree_divmod_fixed_value_transform (stmt)
- || tree_mod_pow2_value_transform (stmt)
- || tree_stringops_transform (&bsi)
- || tree_ic_transform (stmt)))
+ && (gimple_mod_subtract_transform (&gsi)
+ || gimple_divmod_fixed_value_transform (&gsi)
+ || gimple_mod_pow2_value_transform (&gsi)
+ || gimple_stringops_transform (&gsi)
+ || gimple_ic_transform (stmt)))
{
- stmt = bsi_stmt (bsi);
+ stmt = gsi_stmt (gsi);
changed = true;
/* Original statement may no longer be in the same block. */
- if (bb != bb_for_stmt (stmt))
+ if (bb != gimple_bb (stmt))
{
- bb = bb_for_stmt (stmt);
- bsi = bsi_for_stmt (stmt);
+ bb = gimple_bb (stmt);
+ gsi = gsi_for_stmt (stmt);
}
}
}
@@ -516,57 +544,55 @@ tree_value_profile_transformations (void)
return changed;
}
-/* Generate code for transformation 1 (with OPERATION, operands OP1
- and OP2, whose value is expected to be VALUE, parent modify-expr STMT and
- probability of taking the optimal path PROB, which is equivalent to COUNT/ALL
- within roundoff error). This generates the result into a temp and returns
- the temp; it does not replace or alter the original STMT. */
+
+/* Generate code for transformation 1 (with parent gimple assignment
+ STMT and probability of taking the optimal path PROB, which is
+ equivalent to COUNT/ALL within roundoff error). This generates the
+ result into a temp and returns the temp; it does not replace or
+ alter the original STMT. */
+
static tree
-tree_divmod_fixed_value (tree stmt, tree operation,
- tree op1, tree op2, tree value, int prob, gcov_type count,
- gcov_type all)
+gimple_divmod_fixed_value (gimple stmt, tree value, int prob, gcov_type count,
+ gcov_type all)
{
- tree stmt1, stmt2, stmt3;
+ gimple stmt1, stmt2, stmt3;
tree tmp1, tmp2, tmpv;
- tree label_decl1 = create_artificial_label ();
- tree label_decl2 = create_artificial_label ();
- tree label1, label2;
- tree bb1end, bb2end, bb3end;
+ gimple bb1end, bb2end, bb3end;
basic_block bb, bb2, bb3, bb4;
- tree optype = TREE_TYPE (operation);
+ tree optype, op1, op2;
edge e12, e13, e23, e24, e34;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
- bb = bb_for_stmt (stmt);
- bsi = bsi_for_stmt (stmt);
+ gcc_assert (is_gimple_assign (stmt)
+ && (gimple_assign_rhs_code (stmt) == TRUNC_DIV_EXPR
+ || gimple_assign_rhs_code (stmt) == TRUNC_MOD_EXPR));
+
+ optype = TREE_TYPE (gimple_assign_lhs (stmt));
+ op1 = gimple_assign_rhs1 (stmt);
+ op2 = gimple_assign_rhs2 (stmt);
+
+ bb = gimple_bb (stmt);
+ gsi = gsi_for_stmt (stmt);
tmpv = create_tmp_var (optype, "PROF");
tmp1 = create_tmp_var (optype, "PROF");
- stmt1 = build_gimple_modify_stmt (tmpv, fold_convert (optype, value));
- stmt2 = build_gimple_modify_stmt (tmp1, op2);
- stmt3 = build3 (COND_EXPR, void_type_node,
- build2 (NE_EXPR, boolean_type_node, tmp1, tmpv),
- NULL_TREE, NULL_TREE);
- bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt2, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt3, BSI_SAME_STMT);
+ stmt1 = gimple_build_assign (tmpv, fold_convert (optype, value));
+ stmt2 = gimple_build_assign (tmp1, op2);
+ stmt3 = gimple_build_cond (NE_EXPR, tmp1, tmpv, NULL_TREE, NULL_TREE);
+ gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
+ gsi_insert_before (&gsi, stmt2, GSI_SAME_STMT);
+ gsi_insert_before (&gsi, stmt3, GSI_SAME_STMT);
bb1end = stmt3;
tmp2 = create_tmp_var (optype, "PROF");
- label1 = build1 (LABEL_EXPR, void_type_node, label_decl1);
- stmt1 = build_gimple_modify_stmt (tmp2,
- build2 (TREE_CODE (operation), optype,
- op1, tmpv));
- bsi_insert_before (&bsi, label1, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
+ stmt1 = gimple_build_assign_with_ops (gimple_assign_rhs_code (stmt), tmp2,
+ op1, tmpv);
+ gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
bb2end = stmt1;
- label2 = build1 (LABEL_EXPR, void_type_node, label_decl2);
- stmt1 = build_gimple_modify_stmt (tmp2,
- build2 (TREE_CODE (operation), optype,
- op1, op2));
- bsi_insert_before (&bsi, label2, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
+ stmt1 = gimple_build_assign_with_ops (gimple_assign_rhs_code (stmt), tmp2,
+ op1, op2);
+ gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
bb3end = stmt1;
/* Fix CFG. */
@@ -602,35 +628,33 @@ tree_divmod_fixed_value (tree stmt, tree operation,
return tmp2;
}
+
/* Do transform 1) on INSN if applicable. */
+
static bool
-tree_divmod_fixed_value_transform (tree stmt)
+gimple_divmod_fixed_value_transform (gimple_stmt_iterator *si)
{
histogram_value histogram;
enum tree_code code;
gcov_type val, count, all;
- tree modify, op, op1, op2, result, value, tree_val;
+ tree result, value, tree_val;
gcov_type prob;
+ gimple stmt;
- modify = stmt;
- if (TREE_CODE (stmt) == RETURN_EXPR
- && TREE_OPERAND (stmt, 0)
- && TREE_CODE (TREE_OPERAND (stmt, 0)) == GIMPLE_MODIFY_STMT)
- modify = TREE_OPERAND (stmt, 0);
- if (TREE_CODE (modify) != GIMPLE_MODIFY_STMT)
+ stmt = gsi_stmt (*si);
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
return false;
- op = GIMPLE_STMT_OPERAND (modify, 1);
- if (!INTEGRAL_TYPE_P (TREE_TYPE (op)))
+
+ if (!INTEGRAL_TYPE_P (TREE_TYPE (gimple_assign_lhs (stmt))))
return false;
- code = TREE_CODE (op);
+
+ code = gimple_assign_rhs_code (stmt);
if (code != TRUNC_DIV_EXPR && code != TRUNC_MOD_EXPR)
return false;
- op1 = TREE_OPERAND (op, 0);
- op2 = TREE_OPERAND (op, 1);
-
- histogram = gimple_histogram_value_of_type (cfun, stmt, HIST_TYPE_SINGLE_VALUE);
+ histogram = gimple_histogram_value_of_type (cfun, stmt,
+ HIST_TYPE_SINGLE_VALUE);
if (!histogram)
return false;
@@ -643,11 +667,12 @@ tree_divmod_fixed_value_transform (tree stmt)
/* We require that count is at least half of all; this means
that for the transformation to fire the value must be constant
at least 50% of time (and 75% gives the guarantee of usage). */
- if (simple_cst_equal (op2, value) != 1 || 2 * count < all
- || !maybe_hot_bb_p (bb_for_stmt (stmt)))
+ if (simple_cst_equal (gimple_assign_rhs2 (stmt), value) != 1
+ || 2 * count < all
+ || optimize_bb_for_size_p (gimple_bb (stmt)))
return false;
- if (check_counter (stmt, "value", all, bb_for_stmt (stmt)->count))
+ if (check_counter (stmt, "value", &count, &all, gimple_bb (stmt)->count))
return false;
/* Compute probability of taking the optimal path. */
@@ -659,7 +684,7 @@ tree_divmod_fixed_value_transform (tree stmt)
tree_val = build_int_cst_wide (get_gcov_type (),
(unsigned HOST_WIDE_INT) val,
val >> (HOST_BITS_PER_WIDE_INT - 1) >> 1);
- result = tree_divmod_fixed_value (stmt, op, op1, op2, tree_val, prob, count, all);
+ result = gimple_divmod_fixed_value (stmt, tree_val, prob, count, all);
if (dump_file)
{
@@ -668,68 +693,61 @@ tree_divmod_fixed_value_transform (tree stmt)
fprintf (dump_file, "=");
print_generic_expr (dump_file, tree_val, TDF_SLIM);
fprintf (dump_file, " transformation on insn ");
- print_generic_stmt (dump_file, stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
}
- GIMPLE_STMT_OPERAND (modify, 1) = result;
+ gimple_assign_set_rhs_from_tree (si, result);
return true;
}
-/* Generate code for transformation 2 (with OPERATION, operands OP1
- and OP2, parent modify-expr STMT and probability of taking the optimal
- path PROB, which is equivalent to COUNT/ALL within roundoff error).
- This generates the result into a temp and returns
+/* Generate code for transformation 2 (with parent gimple assign STMT and
+ probability of taking the optimal path PROB, which is equivalent to COUNT/ALL
+ within roundoff error). This generates the result into a temp and returns
the temp; it does not replace or alter the original STMT. */
static tree
-tree_mod_pow2 (tree stmt, tree operation, tree op1, tree op2, int prob,
- gcov_type count, gcov_type all)
+gimple_mod_pow2 (gimple stmt, int prob, gcov_type count, gcov_type all)
{
- tree stmt1, stmt2, stmt3, stmt4;
+ gimple stmt1, stmt2, stmt3, stmt4;
tree tmp2, tmp3;
- tree label_decl1 = create_artificial_label ();
- tree label_decl2 = create_artificial_label ();
- tree label1, label2;
- tree bb1end, bb2end, bb3end;
+ gimple bb1end, bb2end, bb3end;
basic_block bb, bb2, bb3, bb4;
- tree optype = TREE_TYPE (operation);
+ tree optype, op1, op2;
edge e12, e13, e23, e24, e34;
- block_stmt_iterator bsi;
- tree result = create_tmp_var (optype, "PROF");
+ gimple_stmt_iterator gsi;
+ tree result;
- bb = bb_for_stmt (stmt);
- bsi = bsi_for_stmt (stmt);
+ gcc_assert (is_gimple_assign (stmt)
+ && gimple_assign_rhs_code (stmt) == TRUNC_MOD_EXPR);
+ optype = TREE_TYPE (gimple_assign_lhs (stmt));
+ op1 = gimple_assign_rhs1 (stmt);
+ op2 = gimple_assign_rhs2 (stmt);
+
+ bb = gimple_bb (stmt);
+ gsi = gsi_for_stmt (stmt);
+
+ result = create_tmp_var (optype, "PROF");
tmp2 = create_tmp_var (optype, "PROF");
tmp3 = create_tmp_var (optype, "PROF");
- stmt2 = build_gimple_modify_stmt (tmp2,
- build2 (PLUS_EXPR, optype, op2,
- build_int_cst (optype, -1)));
- stmt3 = build_gimple_modify_stmt (tmp3,
- build2 (BIT_AND_EXPR, optype, tmp2, op2));
- stmt4 = build3 (COND_EXPR, void_type_node,
- build2 (NE_EXPR, boolean_type_node,
- tmp3, build_int_cst (optype, 0)),
- NULL_TREE, NULL_TREE);
- bsi_insert_before (&bsi, stmt2, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt3, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt4, BSI_SAME_STMT);
+ stmt2 = gimple_build_assign_with_ops (PLUS_EXPR, tmp2, op2,
+ build_int_cst (optype, -1));
+ stmt3 = gimple_build_assign_with_ops (BIT_AND_EXPR, tmp3, tmp2, op2);
+ stmt4 = gimple_build_cond (NE_EXPR, tmp3, build_int_cst (optype, 0),
+ NULL_TREE, NULL_TREE);
+ gsi_insert_before (&gsi, stmt2, GSI_SAME_STMT);
+ gsi_insert_before (&gsi, stmt3, GSI_SAME_STMT);
+ gsi_insert_before (&gsi, stmt4, GSI_SAME_STMT);
bb1end = stmt4;
- /* tmp2 == op2-1 inherited from previous block */
- label1 = build1 (LABEL_EXPR, void_type_node, label_decl1);
- stmt1 = build_gimple_modify_stmt (result,
- build2 (BIT_AND_EXPR, optype, op1, tmp2));
- bsi_insert_before (&bsi, label1, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
+ /* tmp2 == op2-1 inherited from previous block. */
+ stmt1 = gimple_build_assign_with_ops (BIT_AND_EXPR, result, op1, tmp2);
+ gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
bb2end = stmt1;
- label2 = build1 (LABEL_EXPR, void_type_node, label_decl2);
- stmt1 = build_gimple_modify_stmt (result,
- build2 (TREE_CODE (operation), optype,
- op1, op2));
- bsi_insert_before (&bsi, label2, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
+ stmt1 = gimple_build_assign_with_ops (gimple_assign_rhs_code (stmt), result,
+ op1, op2);
+ gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
bb3end = stmt1;
/* Fix CFG. */
@@ -767,32 +785,28 @@ tree_mod_pow2 (tree stmt, tree operation, tree op1, tree op2, int prob,
/* Do transform 2) on INSN if applicable. */
static bool
-tree_mod_pow2_value_transform (tree stmt)
+gimple_mod_pow2_value_transform (gimple_stmt_iterator *si)
{
histogram_value histogram;
enum tree_code code;
gcov_type count, wrong_values, all;
- tree modify, op, op1, op2, result, value;
+ tree lhs_type, result, value;
gcov_type prob;
+ gimple stmt;
- modify = stmt;
- if (TREE_CODE (stmt) == RETURN_EXPR
- && TREE_OPERAND (stmt, 0)
- && TREE_CODE (TREE_OPERAND (stmt, 0)) == GIMPLE_MODIFY_STMT)
- modify = TREE_OPERAND (stmt, 0);
- if (TREE_CODE (modify) != GIMPLE_MODIFY_STMT)
+ stmt = gsi_stmt (*si);
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
return false;
- op = GIMPLE_STMT_OPERAND (modify, 1);
- if (!INTEGRAL_TYPE_P (TREE_TYPE (op)))
+
+ lhs_type = TREE_TYPE (gimple_assign_lhs (stmt));
+ if (!INTEGRAL_TYPE_P (lhs_type))
return false;
- code = TREE_CODE (op);
+
+ code = gimple_assign_rhs_code (stmt);
- if (code != TRUNC_MOD_EXPR || !TYPE_UNSIGNED (TREE_TYPE (op)))
+ if (code != TRUNC_MOD_EXPR || !TYPE_UNSIGNED (lhs_type))
return false;
- op1 = TREE_OPERAND (op, 0);
- op2 = TREE_OPERAND (op, 1);
-
histogram = gimple_histogram_value_of_type (cfun, stmt, HIST_TYPE_POW2);
if (!histogram)
return false;
@@ -804,20 +818,21 @@ tree_mod_pow2_value_transform (tree stmt)
gimple_remove_histogram_value (cfun, stmt, histogram);
/* We require that we hit a power of 2 at least half of all evaluations. */
- if (simple_cst_equal (op2, value) != 1 || count < wrong_values
- || !maybe_hot_bb_p (bb_for_stmt (stmt)))
+ if (simple_cst_equal (gimple_assign_rhs2 (stmt), value) != 1
+ || count < wrong_values
+ || optimize_bb_for_size_p (gimple_bb (stmt)))
return false;
if (dump_file)
{
fprintf (dump_file, "Mod power of 2 transformation on insn ");
- print_generic_stmt (dump_file, stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
}
/* Compute probability of taking the optimal path. */
all = count + wrong_values;
- if (check_counter (stmt, "pow2", all, bb_for_stmt (stmt)->count))
+ if (check_counter (stmt, "pow2", &count, &all, gimple_bb (stmt)->count))
return false;
if (all > 0)
@@ -825,82 +840,70 @@ tree_mod_pow2_value_transform (tree stmt)
else
prob = 0;
- result = tree_mod_pow2 (stmt, op, op1, op2, prob, count, all);
+ result = gimple_mod_pow2 (stmt, prob, count, all);
- GIMPLE_STMT_OPERAND (modify, 1) = result;
+ gimple_assign_set_rhs_from_tree (si, result);
return true;
}
-/* Generate code for transformations 3 and 4 (with OPERATION, operands OP1
- and OP2, parent modify-expr STMT, and NCOUNTS the number of cases to
- support. Currently only NCOUNTS==0 or 1 is supported and this is
- built into this interface. The probabilities of taking the optimal
- paths are PROB1 and PROB2, which are equivalent to COUNT1/ALL and
+/* Generate code for transformations 3 and 4 (with parent gimple assign STMT, and
+ NCOUNTS the number of cases to support. Currently only NCOUNTS==0 or 1 is
+ supported and this is built into this interface. The probabilities of taking
+ the optimal paths are PROB1 and PROB2, which are equivalent to COUNT1/ALL and
COUNT2/ALL respectively within roundoff error). This generates the
result into a temp and returns the temp; it does not replace or alter
the original STMT. */
/* FIXME: Generalize the interface to handle NCOUNTS > 1. */
static tree
-tree_mod_subtract (tree stmt, tree operation, tree op1, tree op2,
- int prob1, int prob2, int ncounts,
- gcov_type count1, gcov_type count2, gcov_type all)
+gimple_mod_subtract (gimple stmt, int prob1, int prob2, int ncounts,
+ gcov_type count1, gcov_type count2, gcov_type all)
{
- tree stmt1, stmt2, stmt3;
+ gimple stmt1, stmt2, stmt3;
tree tmp1;
- tree label_decl1 = create_artificial_label ();
- tree label_decl2 = create_artificial_label ();
- tree label_decl3 = create_artificial_label ();
- tree label1, label2, label3;
- tree bb1end, bb2end = NULL_TREE, bb3end;
+ gimple bb1end, bb2end = NULL, bb3end;
basic_block bb, bb2, bb3, bb4;
- tree optype = TREE_TYPE (operation);
+ tree optype, op1, op2;
edge e12, e23 = 0, e24, e34, e14;
- block_stmt_iterator bsi;
- tree result = create_tmp_var (optype, "PROF");
+ gimple_stmt_iterator gsi;
+ tree result;
+
+ gcc_assert (is_gimple_assign (stmt)
+ && gimple_assign_rhs_code (stmt) == TRUNC_MOD_EXPR);
+
+ optype = TREE_TYPE (gimple_assign_lhs (stmt));
+ op1 = gimple_assign_rhs1 (stmt);
+ op2 = gimple_assign_rhs2 (stmt);
- bb = bb_for_stmt (stmt);
- bsi = bsi_for_stmt (stmt);
+ bb = gimple_bb (stmt);
+ gsi = gsi_for_stmt (stmt);
+ result = create_tmp_var (optype, "PROF");
tmp1 = create_tmp_var (optype, "PROF");
- stmt1 = build_gimple_modify_stmt (result, op1);
- stmt2 = build_gimple_modify_stmt (tmp1, op2);
- stmt3 = build3 (COND_EXPR, void_type_node,
- build2 (LT_EXPR, boolean_type_node, result, tmp1),
- NULL_TREE, NULL_TREE);
- bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt2, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt3, BSI_SAME_STMT);
+ stmt1 = gimple_build_assign (result, op1);
+ stmt2 = gimple_build_assign (tmp1, op2);
+ stmt3 = gimple_build_cond (LT_EXPR, result, tmp1, NULL_TREE, NULL_TREE);
+ gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
+ gsi_insert_before (&gsi, stmt2, GSI_SAME_STMT);
+ gsi_insert_before (&gsi, stmt3, GSI_SAME_STMT);
bb1end = stmt3;
if (ncounts) /* Assumed to be 0 or 1 */
{
- label1 = build1 (LABEL_EXPR, void_type_node, label_decl1);
- stmt1 = build_gimple_modify_stmt (result,
- build2 (MINUS_EXPR, optype,
- result, tmp1));
- stmt2 = build3 (COND_EXPR, void_type_node,
- build2 (LT_EXPR, boolean_type_node, result, tmp1),
- NULL_TREE, NULL_TREE);
- bsi_insert_before (&bsi, label1, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt2, BSI_SAME_STMT);
+ 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, stmt1, GSI_SAME_STMT);
+ gsi_insert_before (&gsi, stmt2, GSI_SAME_STMT);
bb2end = stmt2;
}
/* Fallback case. */
- label2 = build1 (LABEL_EXPR, void_type_node, label_decl2);
- stmt1 = build_gimple_modify_stmt (result,
- build2 (TREE_CODE (operation), optype,
- result, tmp1));
- bsi_insert_before (&bsi, label2, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
+ stmt1 = gimple_build_assign_with_ops (gimple_assign_rhs_code (stmt), result,
+ result, tmp1);
+ gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
bb3end = stmt1;
- label3 = build1 (LABEL_EXPR, void_type_node, label_decl3);
- bsi_insert_before (&bsi, label3, BSI_SAME_STMT);
-
/* Fix CFG. */
/* Edge e23 connects bb2 to bb3, etc. */
/* However block 3 is optional; if it is not there, references
@@ -947,36 +950,34 @@ tree_mod_subtract (tree stmt, tree operation, tree op1, tree op2,
return result;
}
-/* Do transforms 3) and 4) on INSN if applicable. */
+
+/* Do transforms 3) and 4) on the statement pointed-to by SI if applicable. */
+
static bool
-tree_mod_subtract_transform (tree stmt)
+gimple_mod_subtract_transform (gimple_stmt_iterator *si)
{
histogram_value histogram;
enum tree_code code;
gcov_type count, wrong_values, all;
- tree modify, op, op1, op2, result, value;
+ tree lhs_type, result, value;
gcov_type prob1, prob2;
unsigned int i, steps;
gcov_type count1, count2;
+ gimple stmt;
- modify = stmt;
- if (TREE_CODE (stmt) == RETURN_EXPR
- && TREE_OPERAND (stmt, 0)
- && TREE_CODE (TREE_OPERAND (stmt, 0)) == GIMPLE_MODIFY_STMT)
- modify = TREE_OPERAND (stmt, 0);
- if (TREE_CODE (modify) != GIMPLE_MODIFY_STMT)
+ stmt = gsi_stmt (*si);
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
return false;
- op = GIMPLE_STMT_OPERAND (modify, 1);
- if (!INTEGRAL_TYPE_P (TREE_TYPE (op)))
+
+ lhs_type = TREE_TYPE (gimple_assign_lhs (stmt));
+ if (!INTEGRAL_TYPE_P (lhs_type))
return false;
- code = TREE_CODE (op);
+
+ code = gimple_assign_rhs_code (stmt);
- if (code != TRUNC_MOD_EXPR || !TYPE_UNSIGNED (TREE_TYPE (op)))
+ if (code != TRUNC_MOD_EXPR || !TYPE_UNSIGNED (lhs_type))
return false;
- op1 = TREE_OPERAND (op, 0);
- op2 = TREE_OPERAND (op, 1);
-
histogram = gimple_histogram_value_of_type (cfun, stmt, HIST_TYPE_INTERVAL);
if (!histogram)
return false;
@@ -995,12 +996,17 @@ tree_mod_subtract_transform (tree stmt)
count2 = histogram->hvalue.counters[1];
/* Compute probability of taking the optimal path. */
- if (check_counter (stmt, "interval", all, bb_for_stmt (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;
@@ -1011,14 +1017,14 @@ tree_mod_subtract_transform (tree stmt)
break;
}
if (i == steps
- || !maybe_hot_bb_p (bb_for_stmt (stmt)))
+ || optimize_bb_for_size_p (gimple_bb (stmt)))
return false;
gimple_remove_histogram_value (cfun, stmt, histogram);
if (dump_file)
{
fprintf (dump_file, "Mod subtract transformation on insn ");
- print_generic_stmt (dump_file, stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
}
/* Compute probability of taking the optimal path(s). */
@@ -1034,10 +1040,9 @@ tree_mod_subtract_transform (tree stmt)
/* In practice, "steps" is always 2. This interface reflects this,
and will need to be changed if "steps" can change. */
- result = tree_mod_subtract (stmt, op, op1, op2, prob1, prob2, i,
- count1, count2, all);
+ result = gimple_mod_subtract (stmt, prob1, prob2, i, count1, count2, all);
- GIMPLE_STMT_OPERAND (modify, 1) = result;
+ gimple_assign_set_rhs_from_tree (si, result);
return true;
}
@@ -1082,52 +1087,40 @@ find_func_by_pid (int pid)
old call
*/
-static tree
-tree_ic (tree stmt, tree call, struct cgraph_node* direct_call,
- int prob, gcov_type count, gcov_type all)
+static gimple
+gimple_ic (gimple stmt, gimple call, struct cgraph_node *direct_call,
+ int prob, gcov_type count, gcov_type all)
{
- tree stmt1, stmt2, stmt3;
+ gimple stmt1, stmt2, stmt3;
tree tmp1, tmpv, tmp;
- tree label_decl1 = create_artificial_label ();
- tree label_decl2 = create_artificial_label ();
- tree label1, label2;
- tree bb1end, bb2end, bb3end;
- tree new_call;
+ gimple bb1end, bb2end, bb3end;
basic_block bb, bb2, bb3, bb4;
tree optype = build_pointer_type (void_type_node);
edge e12, e13, e23, e24, e34;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
int region;
- bb = bb_for_stmt (stmt);
- bsi = bsi_for_stmt (stmt);
+ bb = gimple_bb (stmt);
+ gsi = gsi_for_stmt (stmt);
tmpv = create_tmp_var (optype, "PROF");
tmp1 = create_tmp_var (optype, "PROF");
- stmt1 = build_gimple_modify_stmt (tmpv,
- unshare_expr (CALL_EXPR_FN (call)));
+ stmt1 = gimple_build_assign (tmpv, unshare_expr (gimple_call_fn (call)));
+
tmp = fold_convert (optype, build_addr (direct_call->decl,
current_function_decl));
- stmt2 = build_gimple_modify_stmt (tmp1, tmp);
- stmt3 = build3 (COND_EXPR, void_type_node,
- build2 (NE_EXPR, boolean_type_node, tmp1, tmpv),
- NULL_TREE, NULL_TREE);
- bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt2, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt3, BSI_SAME_STMT);
+ stmt2 = gimple_build_assign (tmp1, tmp);
+ stmt3 = gimple_build_cond (NE_EXPR, tmp1, tmpv, NULL_TREE, NULL_TREE);
+ gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
+ gsi_insert_before (&gsi, stmt2, GSI_SAME_STMT);
+ gsi_insert_before (&gsi, stmt3, GSI_SAME_STMT);
bb1end = stmt3;
- label1 = build1 (LABEL_EXPR, void_type_node, label_decl1);
- stmt1 = unshare_expr (stmt);
- new_call = get_call_expr_in (stmt1);
- CALL_EXPR_FN (new_call) = build_addr (direct_call->decl,
- current_function_decl);
- bsi_insert_before (&bsi, label1, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
+ stmt1 = gimple_copy (stmt);
+ gimple_call_set_fn (stmt,
+ build_addr (direct_call->decl, current_function_decl));
+ gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
bb2end = stmt1;
-
- label2 = build1 (LABEL_EXPR, void_type_node, label_decl2);
- bsi_insert_before (&bsi, label2, BSI_SAME_STMT);
bb3end = stmt;
/* Fix CFG. */
@@ -1161,15 +1154,15 @@ tree_ic (tree stmt, tree call, struct cgraph_node* direct_call,
/* Fix eh edges */
region = lookup_stmt_eh_region (stmt);
- if (region >=0 && tree_could_throw_p (stmt1))
+ if (region >= 0 && stmt_could_throw_p (stmt1))
{
add_stmt_to_eh_region (stmt1, region);
make_eh_edges (stmt1);
}
- if (region >=0 && tree_could_throw_p (stmt))
+ if (region >= 0 && stmt_could_throw_p (stmt))
{
- tree_purge_dead_eh_edges (bb4);
+ gimple_purge_dead_eh_edges (bb4);
make_eh_edges (stmt);
}
@@ -1183,22 +1176,21 @@ tree_ic (tree stmt, tree call, struct cgraph_node* direct_call,
*/
static bool
-tree_ic_transform (tree stmt)
+gimple_ic_transform (gimple stmt)
{
histogram_value histogram;
- gcov_type val, count, all;
+ gcov_type val, count, all, bb_all;
gcov_type prob;
- tree call, callee, modify;
+ tree callee;
+ gimple modify;
struct cgraph_node *direct_call;
- call = get_call_expr_in (stmt);
-
- if (!call || TREE_CODE (call) != CALL_EXPR)
+ if (gimple_code (stmt) != GIMPLE_CALL)
return false;
- callee = CALL_EXPR_FN (call);
+ callee = gimple_call_fn (stmt);
- if (TREE_CODE (callee) == ADDR_EXPR)
+ if (TREE_CODE (callee) == FUNCTION_DECL)
return false;
histogram = gimple_histogram_value_of_type (cfun, stmt, HIST_TYPE_INDIR_CALL);
@@ -1213,6 +1205,14 @@ tree_ic_transform (tree 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
@@ -1222,18 +1222,18 @@ tree_ic_transform (tree stmt)
if (direct_call == NULL)
return false;
- modify = tree_ic (stmt, call, direct_call, prob, count, all);
+ modify = gimple_ic (stmt, stmt, direct_call, prob, count, all);
if (dump_file)
{
fprintf (dump_file, "Indirect call -> direct call ");
- print_generic_expr (dump_file, call, TDF_SLIM);
+ print_generic_expr (dump_file, gimple_call_fn (stmt), TDF_SLIM);
fprintf (dump_file, "=> ");
print_generic_expr (dump_file, direct_call->decl, TDF_SLIM);
fprintf (dump_file, " transformation on insn ");
- print_generic_stmt (dump_file, stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
fprintf (dump_file, " to ");
- print_generic_stmt (dump_file, modify, TDF_SLIM);
+ print_gimple_stmt (dump_file, modify, 0, TDF_SLIM);
fprintf (dump_file, "hist->count "HOST_WIDEST_INT_PRINT_DEC
" hist->all "HOST_WIDEST_INT_PRINT_DEC"\n", count, all);
}
@@ -1243,7 +1243,7 @@ tree_ic_transform (tree stmt)
/* Return true if the stringop CALL with FNDECL shall be profiled. */
static bool
-interesting_stringop_to_profile_p (tree fndecl, tree call)
+interesting_stringop_to_profile_p (tree fndecl, gimple call)
{
enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
@@ -1255,16 +1255,14 @@ interesting_stringop_to_profile_p (tree fndecl, tree call)
{
case BUILT_IN_MEMCPY:
case BUILT_IN_MEMPCPY:
- return validate_arglist (call,
- POINTER_TYPE, POINTER_TYPE, INTEGER_TYPE,
- VOID_TYPE);
+ return validate_gimple_arglist (call, POINTER_TYPE, POINTER_TYPE,
+ INTEGER_TYPE, VOID_TYPE);
case BUILT_IN_MEMSET:
- return validate_arglist (call,
- POINTER_TYPE, INTEGER_TYPE, INTEGER_TYPE,
- VOID_TYPE);
+ return validate_gimple_arglist (call, POINTER_TYPE, INTEGER_TYPE,
+ INTEGER_TYPE, VOID_TYPE);
case BUILT_IN_BZERO:
- return validate_arglist (call, POINTER_TYPE, INTEGER_TYPE,
- VOID_TYPE);
+ return validate_gimple_arglist (call, POINTER_TYPE, INTEGER_TYPE,
+ VOID_TYPE);
default:
gcc_unreachable ();
}
@@ -1279,27 +1277,23 @@ interesting_stringop_to_profile_p (tree fndecl, tree call)
assuming constant propagation of VALUE will happen later.
*/
static void
-tree_stringop_fixed_value (tree stmt, tree value, int prob, gcov_type count,
+gimple_stringop_fixed_value (gimple stmt, tree value, int prob, gcov_type count,
gcov_type all)
{
- tree stmt1, stmt2, stmt3;
+ gimple stmt1, stmt2, stmt3;
tree tmp1, tmpv;
- tree label_decl1 = create_artificial_label ();
- tree label_decl2 = create_artificial_label ();
- tree label1, label2;
- tree bb1end, bb2end;
+ gimple bb1end, bb2end;
basic_block bb, bb2, bb3, bb4;
edge e12, e13, e23, e24, e34;
- block_stmt_iterator bsi;
- tree call = get_call_expr_in (stmt);
- tree blck_size = CALL_EXPR_ARG (call, 2);
+ gimple_stmt_iterator gsi;
+ tree blck_size = gimple_call_arg (stmt, 2);
tree optype = TREE_TYPE (blck_size);
int region;
- bb = bb_for_stmt (stmt);
- bsi = bsi_for_stmt (stmt);
+ bb = gimple_bb (stmt);
+ gsi = gsi_for_stmt (stmt);
- if (bsi_end_p (bsi))
+ if (gsi_end_p (gsi))
{
edge_iterator ei;
for (ei = ei_start (bb->succs); (e34 = ei_safe_edge (ei)); )
@@ -1309,34 +1303,27 @@ tree_stringop_fixed_value (tree stmt, tree value, int prob, gcov_type count,
else
{
e34 = split_block (bb, stmt);
- bsi = bsi_for_stmt (stmt);
+ gsi = gsi_for_stmt (stmt);
}
bb4 = e34->dest;
tmpv = create_tmp_var (optype, "PROF");
tmp1 = create_tmp_var (optype, "PROF");
- stmt1 = build_gimple_modify_stmt (tmpv, fold_convert (optype, value));
- stmt2 = build_gimple_modify_stmt (tmp1, blck_size);
- stmt3 = build3 (COND_EXPR, void_type_node,
- build2 (NE_EXPR, boolean_type_node, tmp1, tmpv),
- NULL_TREE, NULL_TREE);
- bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt2, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt3, BSI_SAME_STMT);
+ stmt1 = gimple_build_assign (tmpv, fold_convert (optype, value));
+ stmt2 = gimple_build_assign (tmp1, blck_size);
+ stmt3 = gimple_build_cond (NE_EXPR, tmp1, tmpv, NULL_TREE, NULL_TREE);
+ gsi_insert_before (&gsi, stmt1, GSI_SAME_STMT);
+ gsi_insert_before (&gsi, stmt2, GSI_SAME_STMT);
+ gsi_insert_before (&gsi, stmt3, GSI_SAME_STMT);
bb1end = stmt3;
- label1 = build1 (LABEL_EXPR, void_type_node, label_decl1);
- stmt1 = unshare_expr (stmt);
- call = get_call_expr_in (stmt1);
- CALL_EXPR_ARG (call, 2) = value;
- bsi_insert_before (&bsi, label1, BSI_SAME_STMT);
- bsi_insert_before (&bsi, stmt1, BSI_SAME_STMT);
+ stmt1 = gimple_copy (stmt);
+ gimple_call_set_arg (stmt1, 2, value);
+ 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 = build1 (LABEL_EXPR, void_type_node, label_decl2);
- bsi_insert_before (&bsi, label2, BSI_SAME_STMT);
/* Fix CFG. */
/* Edge e23 connects bb2 to bb3, etc. */
@@ -1369,10 +1356,9 @@ tree_stringop_fixed_value (tree stmt, tree value, int prob, gcov_type count,
/* Find values inside STMT for that we want to measure histograms for
division/modulo optimization. */
static bool
-tree_stringops_transform (block_stmt_iterator *bsi)
+gimple_stringops_transform (gimple_stmt_iterator *gsi)
{
- tree stmt = bsi_stmt (*bsi);
- tree call = get_call_expr_in (stmt);
+ gimple stmt = gsi_stmt (*gsi);
tree fndecl;
tree blck_size;
enum built_in_function fcode;
@@ -1384,19 +1370,19 @@ tree_stringops_transform (block_stmt_iterator *bsi)
gcov_type prob;
tree tree_val;
- if (!call)
+ if (gimple_code (stmt) != GIMPLE_CALL)
return false;
- fndecl = get_callee_fndecl (call);
+ fndecl = gimple_call_fndecl (stmt);
if (!fndecl)
return false;
fcode = DECL_FUNCTION_CODE (fndecl);
- if (!interesting_stringop_to_profile_p (fndecl, call))
+ if (!interesting_stringop_to_profile_p (fndecl, stmt))
return false;
if (fcode == BUILT_IN_BZERO)
- blck_size = CALL_EXPR_ARG (call, 1);
+ blck_size = gimple_call_arg (stmt, 1);
else
- blck_size = CALL_EXPR_ARG (call, 2);
+ blck_size = gimple_call_arg (stmt, 2);
if (TREE_CODE (blck_size) == INTEGER_CST)
return false;
@@ -1411,28 +1397,28 @@ tree_stringops_transform (block_stmt_iterator *bsi)
/* We require that count is at least half of all; this means
that for the transformation to fire the value must be constant
at least 80% of time. */
- if ((6 * count / 5) < all || !maybe_hot_bb_p (bb_for_stmt (stmt)))
+ if ((6 * count / 5) < all || optimize_bb_for_size_p (gimple_bb (stmt)))
return false;
- if (check_counter (stmt, "value", all, bb_for_stmt (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;
else
prob = 0;
- dest = CALL_EXPR_ARG (call, 0);
+ dest = gimple_call_arg (stmt, 0);
dest_align = get_pointer_alignment (dest, BIGGEST_ALIGNMENT);
switch (fcode)
{
case BUILT_IN_MEMCPY:
case BUILT_IN_MEMPCPY:
- src = CALL_EXPR_ARG (call, 1);
+ src = gimple_call_arg (stmt, 1);
src_align = get_pointer_alignment (src, BIGGEST_ALIGNMENT);
if (!can_move_by_pieces (val, MIN (dest_align, src_align)))
return false;
break;
case BUILT_IN_MEMSET:
if (!can_store_by_pieces (val, builtin_memset_read_str,
- CALL_EXPR_ARG (call, 1),
+ gimple_call_arg (stmt, 1),
dest_align, true))
return false;
break;
@@ -1452,15 +1438,15 @@ tree_stringops_transform (block_stmt_iterator *bsi)
{
fprintf (dump_file, "Single value %i stringop transformation on ",
(int)val);
- print_generic_stmt (dump_file, stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, stmt, 0, TDF_SLIM);
}
- tree_stringop_fixed_value (stmt, tree_val, prob, count, all);
+ gimple_stringop_fixed_value (stmt, tree_val, prob, count, all);
return true;
}
void
-stringop_block_profile (tree stmt, unsigned int *expected_align,
+stringop_block_profile (gimple stmt, unsigned int *expected_align,
HOST_WIDE_INT *expected_size)
{
histogram_value histogram;
@@ -1520,31 +1506,25 @@ struct value_prof_hooks {
/* Find values inside STMT for that we want to measure histograms for
division/modulo optimization. */
static void
-tree_divmod_values_to_profile (tree stmt, histogram_values *values)
+gimple_divmod_values_to_profile (gimple stmt, histogram_values *values)
{
- tree assign, lhs, rhs, divisor, op0, type;
+ tree lhs, divisor, op0, type;
histogram_value hist;
- if (TREE_CODE (stmt) == RETURN_EXPR)
- assign = TREE_OPERAND (stmt, 0);
- else
- assign = stmt;
-
- if (!assign
- || TREE_CODE (assign) != GIMPLE_MODIFY_STMT)
+ if (gimple_code (stmt) != GIMPLE_ASSIGN)
return;
- lhs = GIMPLE_STMT_OPERAND (assign, 0);
+
+ lhs = gimple_assign_lhs (stmt);
type = TREE_TYPE (lhs);
if (!INTEGRAL_TYPE_P (type))
return;
- rhs = GIMPLE_STMT_OPERAND (assign, 1);
- switch (TREE_CODE (rhs))
+ switch (gimple_assign_rhs_code (stmt))
{
case TRUNC_DIV_EXPR:
case TRUNC_MOD_EXPR:
- divisor = TREE_OPERAND (rhs, 1);
- op0 = TREE_OPERAND (rhs, 0);
+ divisor = gimple_assign_rhs2 (stmt);
+ op0 = gimple_assign_rhs1 (stmt);
VEC_reserve (histogram_value, heap, *values, 3);
@@ -1552,12 +1532,13 @@ tree_divmod_values_to_profile (tree stmt, histogram_values *values)
/* Check for the case where the divisor is the same value most
of the time. */
VEC_quick_push (histogram_value, *values,
- gimple_alloc_histogram_value (cfun, HIST_TYPE_SINGLE_VALUE,
+ gimple_alloc_histogram_value (cfun,
+ HIST_TYPE_SINGLE_VALUE,
stmt, divisor));
/* For mod, check whether it is not often a noop (or replaceable by
a few subtractions). */
- if (TREE_CODE (rhs) == TRUNC_MOD_EXPR
+ if (gimple_assign_rhs_code (stmt) == TRUNC_MOD_EXPR
&& TYPE_UNSIGNED (type))
{
tree val;
@@ -1584,20 +1565,15 @@ tree_divmod_values_to_profile (tree stmt, histogram_values *values)
indirect/virtual call optimization. */
static void
-tree_indirect_call_to_profile (tree stmt, histogram_values *values)
+gimple_indirect_call_to_profile (gimple stmt, histogram_values *values)
{
- tree call;
- tree callee;
+ tree callee;
- call = get_call_expr_in (stmt);
-
- if (!call || TREE_CODE (call) != CALL_EXPR)
+ if (gimple_code (stmt) != GIMPLE_CALL
+ || gimple_call_fndecl (stmt) != NULL_TREE)
return;
- callee = CALL_EXPR_FN (call);
-
- if (TREE_CODE (callee) == ADDR_EXPR)
- return;
+ callee = gimple_call_fn (stmt);
VEC_reserve (histogram_value, heap, *values, 3);
@@ -1611,29 +1587,28 @@ tree_indirect_call_to_profile (tree stmt, histogram_values *values)
/* Find values inside STMT for that we want to measure histograms for
string operations. */
static void
-tree_stringops_values_to_profile (tree stmt, histogram_values *values)
+gimple_stringops_values_to_profile (gimple stmt, histogram_values *values)
{
- tree call = get_call_expr_in (stmt);
tree fndecl;
tree blck_size;
tree dest;
enum built_in_function fcode;
- if (!call)
+ if (gimple_code (stmt) != GIMPLE_CALL)
return;
- fndecl = get_callee_fndecl (call);
+ fndecl = gimple_call_fndecl (stmt);
if (!fndecl)
return;
fcode = DECL_FUNCTION_CODE (fndecl);
- if (!interesting_stringop_to_profile_p (fndecl, call))
+ if (!interesting_stringop_to_profile_p (fndecl, stmt))
return;
- dest = CALL_EXPR_ARG (call, 0);
+ dest = gimple_call_arg (stmt, 0);
if (fcode == BUILT_IN_BZERO)
- blck_size = CALL_EXPR_ARG (call, 1);
+ blck_size = gimple_call_arg (stmt, 1);
else
- blck_size = CALL_EXPR_ARG (call, 2);
+ blck_size = gimple_call_arg (stmt, 2);
if (TREE_CODE (blck_size) != INTEGER_CST)
{
@@ -1654,28 +1629,28 @@ tree_stringops_values_to_profile (tree stmt, histogram_values *values)
them to list VALUES. */
static void
-tree_values_to_profile (tree stmt, histogram_values *values)
+gimple_values_to_profile (gimple stmt, histogram_values *values)
{
if (flag_value_profile_transformations)
{
- tree_divmod_values_to_profile (stmt, values);
- tree_stringops_values_to_profile (stmt, values);
- tree_indirect_call_to_profile (stmt, values);
+ gimple_divmod_values_to_profile (stmt, values);
+ gimple_stringops_values_to_profile (stmt, values);
+ gimple_indirect_call_to_profile (stmt, values);
}
}
static void
-tree_find_values_to_profile (histogram_values *values)
+gimple_find_values_to_profile (histogram_values *values)
{
basic_block bb;
- block_stmt_iterator bsi;
+ gimple_stmt_iterator gsi;
unsigned i;
histogram_value hist = NULL;
*values = NULL;
FOR_EACH_BB (bb)
- for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
- tree_values_to_profile (bsi_stmt (bsi), values);
+ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
+ gimple_values_to_profile (gsi_stmt (gsi), values);
for (i = 0; VEC_iterate (histogram_value, *values, i, hist); i++)
{
@@ -1715,22 +1690,22 @@ tree_find_values_to_profile (histogram_values *values)
if (dump_file)
{
fprintf (dump_file, "Stmt ");
- print_generic_expr (dump_file, hist->hvalue.stmt, TDF_SLIM);
+ print_gimple_stmt (dump_file, hist->hvalue.stmt, 0, TDF_SLIM);
dump_histogram_value (dump_file, hist);
}
}
}
-static struct value_prof_hooks tree_value_prof_hooks = {
- tree_find_values_to_profile,
- tree_value_profile_transformations
+static struct value_prof_hooks gimple_value_prof_hooks = {
+ gimple_find_values_to_profile,
+ gimple_value_profile_transformations
};
void
-tree_register_value_prof_hooks (void)
+gimple_register_value_prof_hooks (void)
{
gcc_assert (current_ir_type () == IR_GIMPLE);
- value_prof_hooks = &tree_value_prof_hooks;
+ value_prof_hooks = &gimple_value_prof_hooks;
}
/* IR-independent entry points. */
diff --git a/gcc/value-prof.h b/gcc/value-prof.h
index 2ab9df1cb53..e66f4e2046a 100644
--- a/gcc/value-prof.h
+++ b/gcc/value-prof.h
@@ -46,7 +46,7 @@ struct histogram_value_t
struct
{
tree value; /* The value to profile. */
- tree stmt; /* Insn containing the value. */
+ gimple stmt; /* Insn containing the value. */
gcov_type *counters; /* Pointer to first counter. */
struct histogram_value_t *next; /* Linked list pointer. */
} hvalue;
@@ -71,7 +71,7 @@ DEF_VEC_ALLOC_P(histogram_value,heap);
typedef VEC(histogram_value,heap) *histogram_values;
/* Hooks registration. */
-extern void tree_register_value_prof_hooks (void);
+extern void gimple_register_value_prof_hooks (void);
/* IR-independent entry points. */
extern void find_values_to_profile (histogram_values *);
@@ -109,17 +109,19 @@ struct profile_hooks {
void (*gen_ior_profiler) (histogram_value, unsigned, unsigned);
};
-histogram_value gimple_histogram_value (struct function *, tree);
-histogram_value gimple_histogram_value_of_type (struct function *, tree, enum hist_type);
-void gimple_add_histogram_value (struct function *, tree, histogram_value);
-void dump_histograms_for_stmt (struct function *, FILE *, tree);
-void gimple_remove_histogram_value (struct function *, tree, histogram_value);
-void gimple_remove_stmt_histograms (struct function *, tree);
-void gimple_duplicate_stmt_histograms (struct function *, tree, struct function *, tree);
-void gimple_move_stmt_histograms (struct function *, tree, tree);
+histogram_value gimple_histogram_value (struct function *, gimple);
+histogram_value gimple_histogram_value_of_type (struct function *, gimple,
+ enum hist_type);
+void gimple_add_histogram_value (struct function *, gimple, histogram_value);
+void dump_histograms_for_stmt (struct function *, FILE *, gimple);
+void gimple_remove_histogram_value (struct function *, gimple, histogram_value);
+void gimple_remove_stmt_histograms (struct function *, gimple);
+void gimple_duplicate_stmt_histograms (struct function *, gimple,
+ struct function *, gimple);
+void gimple_move_stmt_histograms (struct function *, gimple, gimple);
void verify_histograms (void);
void free_histograms (void);
-void stringop_block_profile (tree, unsigned int *, HOST_WIDE_INT *);
+void stringop_block_profile (gimple, unsigned int *, HOST_WIDE_INT *);
/* In profile.c. */
extern void init_branch_prob (void);
diff --git a/gcc/varasm.c b/gcc/varasm.c
index ad2421298ba..5aa0140e002 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1723,7 +1723,7 @@ assemble_start_function (tree decl, const char *fnname)
because ASM_OUTPUT_MAX_SKIP_ALIGN might not do any alignment at all. */
if (! DECL_USER_ALIGN (decl)
&& align_functions_log > align
- && cfun->function_frequency != FUNCTION_FREQUENCY_UNLIKELY_EXECUTED)
+ && optimize_function_for_speed_p (cfun))
{
#ifdef ASM_OUTPUT_MAX_SKIP_ALIGN
ASM_OUTPUT_MAX_SKIP_ALIGN (asm_out_file,
@@ -2228,7 +2228,7 @@ contains_pointers_p (tree type)
}
}
-/* In unit-at-a-time mode, we delay assemble_external processing until
+/* We delay assemble_external processing until
the compilation unit is finalized. This is the best we can do for
right now (i.e. stage 3 of GCC 4.0) - the right thing is to delay
it all the way to final. See PR 17982 for further discussion. */
@@ -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);
@@ -5380,7 +5378,7 @@ assemble_alias (tree decl, tree target)
/* If the target has already been emitted, we don't have to queue the
alias. This saves a tad of memory. */
- if (!flag_unit_at_a_time || cgraph_global_info_ready)
+ if (cgraph_global_info_ready)
target_decl = find_decl_and_mark_needed (decl, target);
else
target_decl= NULL;
diff --git a/gcc/varpool.c b/gcc/varpool.c
index c2410f664f5..1d1cc9ed630 100644
--- a/gcc/varpool.c
+++ b/gcc/varpool.c
@@ -32,7 +32,7 @@ along with GCC; see the file COPYING3. If not see
#include "debug.h"
#include "target.h"
#include "output.h"
-#include "tree-gimple.h"
+#include "gimple.h"
#include "tree-flow.h"
/* This file contains basic routines manipulating variable pool.
@@ -61,7 +61,7 @@ struct varpool_node *varpool_nodes;
maintained in forward order. GTY is needed to make it friendly to
PCH.
- During unit-at-a-time compilation we construct the queue of needed variables
+ During compilation we construct the queue of needed variables
twice: first time it is during cgraph construction, second time it is at the
end of compilation in VARPOOL_REMOVE_UNREFERENCED_DECLS so we can avoid
optimized out variables being output.
@@ -214,17 +214,13 @@ varpool_reset_queue (void)
/* Determine if variable DECL is needed. That is, visible to something
either outside this translation unit, something magic in the system
- configury, or (if not doing unit-at-a-time) to something we haven't
- seen yet. */
+ configury */
bool
decide_is_variable_needed (struct varpool_node *node, tree decl)
{
/* If the user told us it is used, then it must be so. */
if (node->externally_visible || node->force_output)
return true;
- if (!flag_unit_at_a_time
- && lookup_attribute ("used", DECL_ATTRIBUTES (decl)))
- return true;
/* ??? If the assembler name is set by hand, it is possible to assemble
the name later after finalizing the function and the fact is noticed
@@ -257,7 +253,7 @@ decide_is_variable_needed (struct varpool_node *node, tree decl)
/* When not reordering top level variables, we have to assume that
we are going to keep everything. */
- if (flag_unit_at_a_time && flag_toplevel_reorder)
+ if (flag_toplevel_reorder)
return false;
/* We want to emit COMDAT variables only when absolutely necessary. */
@@ -280,7 +276,7 @@ varpool_finalize_decl (tree decl)
if this function has already run. */
if (node->finalized)
{
- if (cgraph_global_info_ready || (!flag_unit_at_a_time && !flag_openmp))
+ if (cgraph_global_info_ready)
varpool_assemble_pending_decls ();
return;
}
@@ -295,7 +291,7 @@ varpool_finalize_decl (tree decl)
there. */
else if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
varpool_mark_needed_node (node);
- if (cgraph_global_info_ready || (!flag_unit_at_a_time && !flag_openmp))
+ if (cgraph_global_info_ready)
varpool_assemble_pending_decls ();
}
diff --git a/gcc/vmsdbgout.c b/gcc/vmsdbgout.c
index 6699f52e91c..c655caa53b9 100644
--- a/gcc/vmsdbgout.c
+++ b/gcc/vmsdbgout.c
@@ -204,7 +204,7 @@ const struct gcc_debug_hooks vmsdbg_debug_hooks
vmsdbgout_decl,
vmsdbgout_global_decl,
debug_nothing_tree_int, /* type_decl */
- debug_nothing_tree_tree, /* imported_module_or_decl */
+ debug_nothing_tree_tree_tree_bool, /* imported_module_or_decl */
debug_nothing_tree, /* deferred_inline_function */
vmsdbgout_abstract_function,
debug_nothing_rtx, /* label */
diff --git a/gnattools/ChangeLog b/gnattools/ChangeLog
index 3c6d39f6ef0..169a0143f99 100644
--- a/gnattools/ChangeLog
+++ b/gnattools/ChangeLog
@@ -1,3 +1,31 @@
+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.
+ (ADA_CFLAGS): Substitute.
+ * configure: Regenerate.
+ * Makefile.in (ADA_CFLAGS): Substitute.
+ (T_ADA_CFLAGS, X_ADA_CFLAGS, ALL_ADA_CFLAGS): Remove.
+ (TOOLS_FLAGS_TO_PASS_1, TOOLS_FLAGS_TO_PASS_1re,
+ TOOLS_FLAGS_TO_PASS_NATIVE, TOOLS_FLAGS_TO_PASS_CROSS):
+ Pass ADA_CFLAGS.
+
+2008-07-30 Laurent Guerby <laurent@guerby.net>
+
+ PR ada/5911
+ * gnattools/Makefile.in: Replace stamp-gnatlib by
+ stamp-gnatlib-rts.
+
2008-06-26 Chris Proctor <chrisp_42@bigpond.com>
* configure.ac, configure: Fix target specific pairs.
diff --git a/gnattools/Makefile.in b/gnattools/Makefile.in
index efc5f7575f0..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,31 +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=
-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)
+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})
@@ -83,6 +70,7 @@ TOOLS_FLAGS_TO_PASS_1= \
"CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
"LDFLAGS=$(LDFLAGS)" \
"ADAFLAGS=$(ADAFLAGS)" \
+ "ADA_CFLAGS=$(ADA_CFLAGS)" \
"INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
"ADA_INCLUDES=-I- -I../rts $(ADA_INCLUDES_FOR_SUBDIR)"\
"exeext=$(exeext)" \
@@ -96,6 +84,7 @@ TOOLS_FLAGS_TO_PASS_1re= \
"CC=../../xgcc -B../../" \
"CFLAGS=$(CFLAGS)" \
"ADAFLAGS=$(ADAFLAGS)" \
+ "ADA_CFLAGS=$(ADA_CFLAGS)" \
"INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
"ADA_INCLUDES=-I../rts $(ADA_INCLUDES_FOR_SUBDIR)"\
"exeext=$(exeext)" \
@@ -112,6 +101,7 @@ TOOLS_FLAGS_TO_PASS_NATIVE= \
"CC=../../xgcc -B../../" \
"CFLAGS=$(CFLAGS)" \
"ADAFLAGS=$(ADAFLAGS)" \
+ "ADA_CFLAGS=$(ADA_CFLAGS)" \
"INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
"ADA_INCLUDES=-I../rts $(ADA_INCLUDES_FOR_SUBDIR)" \
"exeext=$(exeext)" \
@@ -128,6 +118,7 @@ TOOLS_FLAGS_TO_PASS_CROSS= \
"CFLAGS=$(CFLAGS) $(WARN_CFLAGS)" \
"LDFLAGS=$(LDFLAGS)" \
"ADAFLAGS=$(ADAFLAGS)" \
+ "ADA_CFLAGS=$(ADA_CFLAGS)" \
"INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
"ADA_INCLUDES=-I$(RTS_DIR)../adainclude -I$(RTS_DIR) $(ADA_INCLUDES_FOR_SUBDIR)" \
"exeext=$(exeext)" \
@@ -153,8 +144,8 @@ TOOLS_TARGET_PAIRS = @TOOLS_TARGET_PAIRS@
gnattools: @default_gnattools_target@
# Sanity check
-$(GCC_DIR)/stamp-gnatlib:
- @if [ ! -f $(GCC_DIR)/stamp-gnatlib ] ; \
+$(GCC_DIR)/stamp-gnatlib-rts:
+ @if [ ! -f $(GCC_DIR)/stamp-gnatlib-rts ] ; \
then \
echo "Cannot build gnattools while gnatlib is out of date or unbuilt" ; \
false; \
@@ -183,7 +174,7 @@ $(GCC_DIR)/stamp-tools:
# to be able to build gnatmake without a version of gnatmake around. Once
# everything has been compiled once, gnatmake can be recompiled with itself
# (see target regnattools)
-gnattools-native: $(GCC_DIR)/stamp-tools $(GCC_DIR)/stamp-gnatlib
+gnattools-native: $(GCC_DIR)/stamp-tools $(GCC_DIR)/stamp-gnatlib-rts
# gnattools1
$(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
$(TOOLS_FLAGS_TO_PASS_1) \
@@ -195,7 +186,7 @@ gnattools-native: $(GCC_DIR)/stamp-tools $(GCC_DIR)/stamp-gnatlib
# gnatmake/link can be built with recent gnatmake/link if they are available.
# This is especially convenient for building cross tools or for rebuilding
# the tools when the original bootstrap has already be done.
-regnattools: $(GCC_DIR)/stamp-gnatlib
+regnattools: $(GCC_DIR)/stamp-gnatlib-rts
# gnattools1-re
$(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \
$(TOOLS_FLAGS_TO_PASS_1re) \
diff --git a/gnattools/configure b/gnattools/configure
index de26ec95b2e..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 x_ada_cflags default_gnattools_target TOOLS_TARGET_PAIRS EXTRA_GNATTOOLS 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
@@ -1484,13 +1511,6 @@ echo "${ECHO_T}no, using $LN_S" >&6
fi
-# Determine x_ada_cflags
-case $host in
- hppa*) x_ada_cflags=-mdisable-indexing ;;
- *) x_ada_cflags= ;;
-esac
-
-
# Determine what to build for 'gnattools'
if test $build = $target ; then
# Note that build=target is almost certainly the wrong test; FIXME
@@ -1593,6 +1613,955 @@ case "${target}" in
;;
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,10 +3219,18 @@ s,@target_vendor@,$target_vendor,;t t
s,@target_os@,$target_os,;t t
s,@target_noncanonical@,$target_noncanonical,;t t
s,@LN_S@,$LN_S,;t t
-s,@x_ada_cflags@,$x_ada_cflags,;t t
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 cd5e8402bd9..ac0c6926633 100644
--- a/gnattools/configure.ac
+++ b/gnattools/configure.ac
@@ -51,13 +51,6 @@ ACX_NONCANONICAL_TARGET
# 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 'gnattools'
if test $build = $target ; then
# Note that build=target is almost certainly the wrong test; FIXME
@@ -160,6 +153,16 @@ case "${target}" in
;;
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..4f1c8217784 100644
--- a/libada/ChangeLog
+++ b/libada/ChangeLog
@@ -1,3 +1,46 @@
+2008-08-29 Laurent Guerby <laurent@guerby.net>
+
+ * Makefile.in (FLAGS_TO_PASS): renamed to LIBADA_FLAGS_TO_PASS to
+ avoid conflicts. Factor more flags to pass.
+ (libsubdir): New variable.
+ (install-gnatlib): New target.
+
+2008-08-28 Laurent Guerby <laurent@guerby.net>
+
+ * configure: Regenerate.
+
+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..05a42335f01 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,70 +40,63 @@ 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
+include $(GCC_DIR)/libgcc.mvars
-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
-
-FLAGS_TO_PASS = \
+target_noncanonical:=@target_noncanonical@
+version := $(shell cat $(srcdir)/../gcc/BASE-VER)
+libsubdir := $(libdir)/gcc/$(target_noncanonical)/$(version)
+
+# 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
+LIBADA_FLAGS_TO_PASS = \
"MAKEOVERRIDES=" \
"LDFLAGS=$(LDFLAGS)" \
"LN_S=$(LN_S)" \
"SHELL=$(SHELL)" \
- "exeext=$(exeext)" \
+ "GNATLIBFLAGS=$(GNATLIBFLAGS)" \
+ "GNATLIBCFLAGS=$(GNATLIBCFLAGS)" \
+ "TARGET_LIBGCC2_CFLAGS=$(TARGET_LIBGCC2_CFLAGS)" \
+ "THREAD_KIND=$(THREAD_KIND)" \
+ "TRACE=$(TRACE)" \
+ "libsubdir=$(libsubdir)" \
"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)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
- TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
- THREAD_KIND="$(THREAD_KIND)" \
- TRACE="$(TRACE)" \
- gnatlib \
+ $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) 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)" \
- GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
- TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
- THREAD_KIND="$(THREAD_KIND)" \
- TRACE="$(TRACE)" \
- $@ \
+ $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) $@ \
&& touch stamp-libada
+oscons:
+ $(MAKE) -C $(GCC_DIR) $(LIBADA_FLAGS_TO_PASS) ada/s-oscons.ads
+
+install-gnatlib: $(GCC_DIR)/ada/Makefile
+ $(MAKE) -C $(GCC_DIR)/ada $(LIBADA_FLAGS_TO_PASS) install-gnatlib
+
# Check uninstalled version.
check:
diff --git a/libada/configure b/libada/configure
index 1d821c407ea..4364253f75e 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 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
@@ -1466,13 +1493,6 @@ echo "${ECHO_T}no, using $LN_S" >&6
fi
-# Determine x_ada_cflags
-case $host in
- hppa*) x_ada_cflags=-mdisable-indexing ;;
- *) x_ada_cflags= ;;
-esac
-
-
# Determine what to build for 'gnatlib'
if test $build = $target \
&& test ${enable_shared} = yes ; then
@@ -1483,6 +1503,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"
@@ -2141,8 +3107,15 @@ s,@target_subdir@,$target_subdir,;t t
s,@MAINT@,$MAINT,;t t
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/libcpp/po/ChangeLog b/libcpp/po/ChangeLog
index c9f292d9370..4146c6d4e0c 100644
--- a/libcpp/po/ChangeLog
+++ b/libcpp/po/ChangeLog
@@ -1,3 +1,7 @@
+2008-08-27 Joseph S. Myers <joseph@codesourcery.com>
+
+ * cpplib.pot: Regenerate.
+
2008-03-28 Joseph S. Myers <joseph@codesourcery.com>
* fr.po: Update.
diff --git a/libcpp/po/cpplib.pot b/libcpp/po/cpplib.pot
index 9ed394333de..7612cf45c6e 100644
--- a/libcpp/po/cpplib.pot
+++ b/libcpp/po/cpplib.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n"
-"POT-Creation-Date: 2008-02-01 16:21+0000\n"
+"POT-Creation-Date: 2008-08-27 17:39+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -16,378 +16,389 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
-#: charset.c:671
+#: charset.c:674
#, c-format
msgid "conversion from %s to %s not supported by iconv"
msgstr ""
-#: charset.c:674
+#: charset.c:677
msgid "iconv_open"
msgstr ""
-#: charset.c:682
+#: charset.c:685
#, c-format
msgid "no iconv implementation, cannot convert from %s to %s"
msgstr ""
-#: charset.c:759
+#: charset.c:773
#, c-format
msgid "character 0x%lx is not in the basic source character set\n"
msgstr ""
-#: charset.c:776
-#: charset.c:1369
+#: charset.c:790
+#: charset.c:1398
msgid "converting to execution character set"
msgstr ""
-#: charset.c:782
+#: charset.c:796
#, c-format
msgid "character 0x%lx is not unibyte in execution character set"
msgstr ""
-#: charset.c:906
+#: charset.c:920
#, c-format
msgid "Character %x might not be NFKC"
msgstr ""
-#: charset.c:966
+#: charset.c:980
msgid "universal character names are only valid in C++ and C99"
msgstr ""
-#: charset.c:969
+#: charset.c:983
#, c-format
msgid "the meaning of '\\%c' is different in traditional C"
msgstr ""
-#: charset.c:978
+#: charset.c:992
msgid "In _cpp_valid_ucn but not a UCN"
msgstr ""
-#: charset.c:1003
+#: charset.c:1017
#, c-format
msgid "incomplete universal character name %.*s"
msgstr ""
-#: charset.c:1015
+#: charset.c:1029
#, c-format
msgid "%.*s is not a valid universal character"
msgstr ""
-#: charset.c:1025
+#: charset.c:1039
#: lex.c:484
msgid "'$' in identifier or number"
msgstr ""
-#: charset.c:1035
+#: charset.c:1049
#, c-format
msgid "universal character %.*s is not valid in an identifier"
msgstr ""
-#: charset.c:1039
+#: charset.c:1053
#, c-format
msgid "universal character %.*s is not valid at the start of an identifier"
msgstr ""
-#: charset.c:1073
-#: charset.c:1588
+#: charset.c:1085
+#: charset.c:1628
msgid "converting UCN to source character set"
msgstr ""
-#: charset.c:1077
+#: charset.c:1089
msgid "converting UCN to execution character set"
msgstr ""
-#: charset.c:1149
+#: charset.c:1161
msgid "the meaning of '\\x' is different in traditional C"
msgstr ""
-#: charset.c:1166
+#: charset.c:1178
msgid "\\x used with no following hex digits"
msgstr ""
-#: charset.c:1173
+#: charset.c:1185
msgid "hex escape sequence out of range"
msgstr ""
-#: charset.c:1212
+#: charset.c:1223
msgid "octal escape sequence out of range"
msgstr ""
-#: charset.c:1280
+#: charset.c:1289
msgid "the meaning of '\\a' is different in traditional C"
msgstr ""
-#: charset.c:1287
+#: charset.c:1296
#, c-format
msgid "non-ISO-standard escape sequence, '\\%c'"
msgstr ""
-#: charset.c:1295
+#: charset.c:1304
#, c-format
msgid "unknown escape sequence '\\%c'"
msgstr ""
-#: charset.c:1303
+#: charset.c:1312
#, c-format
msgid "unknown escape sequence: '\\%s'"
msgstr ""
-#: charset.c:1310
+#: charset.c:1319
msgid "converting escape sequence to execution character set"
msgstr ""
-#: charset.c:1432
-#: charset.c:1495
+#: charset.c:1463
+#: charset.c:1527
msgid "character constant too long for its type"
msgstr ""
-#: charset.c:1435
+#: charset.c:1466
msgid "multi-character character constant"
msgstr ""
-#: charset.c:1527
+#: charset.c:1566
msgid "empty character constant"
msgstr ""
-#: charset.c:1629
+#: charset.c:1675
#, c-format
msgid "failure to convert %s to %s"
msgstr ""
-#: directives.c:215
-#: directives.c:241
+#: directives.c:216
+#: directives.c:242
#, c-format
msgid "extra tokens at end of #%s directive"
msgstr ""
-#: directives.c:344
+#: directives.c:348
#, c-format
msgid "#%s is a GCC extension"
msgstr ""
-#: directives.c:356
+#: directives.c:352
+#, c-format
+msgid "#%s is a deprecated GCC extension"
+msgstr ""
+
+#: directives.c:366
msgid "suggest not using #elif in traditional C"
msgstr ""
-#: directives.c:359
+#: directives.c:369
#, c-format
msgid "traditional C ignores #%s with the # indented"
msgstr ""
-#: directives.c:363
+#: directives.c:373
#, c-format
msgid "suggest hiding #%s from traditional C with an indented #"
msgstr ""
-#: directives.c:389
+#: directives.c:399
msgid "embedding a directive within macro arguments is not portable"
msgstr ""
-#: directives.c:409
+#: directives.c:419
msgid "style of line directive is a GCC extension"
msgstr ""
-#: directives.c:464
+#: directives.c:474
#, c-format
msgid "invalid preprocessing directive #%s"
msgstr ""
-#: directives.c:532
+#: directives.c:542
msgid "\"defined\" cannot be used as a macro name"
msgstr ""
-#: directives.c:538
+#: directives.c:548
#, c-format
msgid "\"%s\" cannot be used as a macro name as it is an operator in C++"
msgstr ""
-#: directives.c:541
+#: directives.c:551
#, c-format
msgid "no macro name given in #%s directive"
msgstr ""
-#: directives.c:544
+#: directives.c:554
msgid "macro names must be identifiers"
msgstr ""
-#: directives.c:585
+#: directives.c:603
#, c-format
msgid "undefining \"%s\""
msgstr ""
-#: directives.c:640
+#: directives.c:658
msgid "missing terminating > character"
msgstr ""
-#: directives.c:695
+#: directives.c:713
#, c-format
msgid "#%s expects \"FILENAME\" or <FILENAME>"
msgstr ""
-#: directives.c:739
+#: directives.c:757
#, c-format
msgid "empty filename in #%s"
msgstr ""
-#: directives.c:749
+#: directives.c:767
msgid "#include nested too deeply"
msgstr ""
-#: directives.c:790
+#: directives.c:808
msgid "#include_next in primary source file"
msgstr ""
-#: directives.c:816
+#: directives.c:834
#, c-format
msgid "invalid flag \"%s\" in line directive"
msgstr ""
-#: directives.c:868
+#: directives.c:894
msgid "unexpected end of file after #line"
msgstr ""
-#: directives.c:871
+#: directives.c:897
#, c-format
msgid "\"%s\" after #line is not a positive integer"
msgstr ""
-#: directives.c:877
+#: directives.c:903
+#: directives.c:905
msgid "line number out of range"
msgstr ""
-#: directives.c:890
-#: directives.c:969
+#: directives.c:918
+#: directives.c:998
#, c-format
msgid "\"%s\" is not a valid filename"
msgstr ""
-#: directives.c:929
+#: directives.c:958
#, c-format
msgid "\"%s\" after # is not a positive integer"
msgstr ""
-#: directives.c:1031
+#: directives.c:1042
+#, c-format
+msgid "%s"
+msgstr ""
+
+#: directives.c:1066
#, c-format
msgid "invalid #%s directive"
msgstr ""
-#: directives.c:1094
+#: directives.c:1129
#, c-format
msgid "registering pragmas in namespace \"%s\" with mismatched name expansion"
msgstr ""
-#: directives.c:1103
+#: directives.c:1138
#, c-format
msgid "registering pragma \"%s\" with name expansion and no namespace"
msgstr ""
-#: directives.c:1121
+#: directives.c:1156
#, c-format
msgid "registering \"%s\" as both a pragma and a pragma namespace"
msgstr ""
-#: directives.c:1124
+#: directives.c:1159
#, c-format
msgid "#pragma %s %s is already registered"
msgstr ""
-#: directives.c:1127
+#: directives.c:1162
#, c-format
msgid "#pragma %s is already registered"
msgstr ""
-#: directives.c:1157
+#: directives.c:1192
msgid "registering pragma with NULL handler"
msgstr ""
-#: directives.c:1367
+#: directives.c:1402
msgid "#pragma once in main file"
msgstr ""
-#: directives.c:1390
+#: directives.c:1425
msgid "invalid #pragma GCC poison directive"
msgstr ""
-#: directives.c:1399
+#: directives.c:1434
#, c-format
msgid "poisoning existing macro \"%s\""
msgstr ""
-#: directives.c:1418
+#: directives.c:1453
msgid "#pragma system_header ignored outside include file"
msgstr ""
-#: directives.c:1442
+#: directives.c:1477
#, c-format
msgid "cannot find source file %s"
msgstr ""
-#: directives.c:1446
+#: directives.c:1481
#, c-format
msgid "current file is older than %s"
msgstr ""
-#: directives.c:1625
+#: directives.c:1665
msgid "_Pragma takes a parenthesized string literal"
msgstr ""
-#: directives.c:1698
+#: directives.c:1766
msgid "#else without #if"
msgstr ""
-#: directives.c:1703
+#: directives.c:1771
msgid "#else after #else"
msgstr ""
-#: directives.c:1705
-#: directives.c:1738
+#: directives.c:1773
+#: directives.c:1806
msgid "the conditional began here"
msgstr ""
-#: directives.c:1731
+#: directives.c:1799
msgid "#elif without #if"
msgstr ""
-#: directives.c:1736
+#: directives.c:1804
msgid "#elif after #else"
msgstr ""
-#: directives.c:1766
+#: directives.c:1842
msgid "#endif without #if"
msgstr ""
-#: directives.c:1843
+#: directives.c:1919
msgid "missing '(' after predicate"
msgstr ""
-#: directives.c:1858
+#: directives.c:1934
msgid "missing ')' to complete answer"
msgstr ""
-#: directives.c:1878
+#: directives.c:1954
msgid "predicate's answer is empty"
msgstr ""
-#: directives.c:1905
+#: directives.c:1981
msgid "assertion without predicate"
msgstr ""
-#: directives.c:1907
+#: directives.c:1983
msgid "predicate must be an identifier"
msgstr ""
-#: directives.c:1993
+#: directives.c:2069
#, c-format
msgid "\"%s\" re-asserted"
msgstr ""
-#: directives.c:2276
+#: directives.c:2375
#, c-format
msgid "unterminated #%s"
msgstr ""
-#: directives-only.c:221
-#: lex.c:1016
+#: directives-only.c:222
+#: lex.c:1089
#: traditional.c:162
msgid "unterminated comment"
msgstr ""
@@ -404,11 +415,11 @@ msgstr ""
msgid "error: "
msgstr ""
-#: errors.c:186
+#: errors.c:195
msgid "stdout"
msgstr ""
-#: errors.c:188
+#: errors.c:197
#, c-format
msgid "%s: %s"
msgstr ""
@@ -510,167 +521,177 @@ msgstr ""
msgid "this use of \"defined\" may not be portable"
msgstr ""
-#: expr.c:676
+#: expr.c:690
msgid "floating constant in preprocessor expression"
msgstr ""
-#: expr.c:682
+#: expr.c:696
msgid "imaginary number in preprocessor expression"
msgstr ""
-#: expr.c:727
+#: expr.c:743
#, c-format
msgid "\"%s\" is not defined"
msgstr ""
-#: expr.c:855
-#: expr.c:884
+#: expr.c:755
+msgid "assertions are a GCC extension"
+msgstr ""
+
+#: expr.c:758
+msgid "assertions are a deprecated extension"
+msgstr ""
+
+#: expr.c:890
+#: expr.c:919
#, c-format
msgid "missing binary operator before token \"%s\""
msgstr ""
-#: expr.c:875
+#: expr.c:910
#, c-format
msgid "token \"%s\" is not valid in preprocessor expressions"
msgstr ""
-#: expr.c:892
+#: expr.c:927
msgid "missing expression between '(' and ')'"
msgstr ""
-#: expr.c:895
-msgid "#if with no expression"
+#: expr.c:930
+#, c-format
+msgid "%s with no expression"
msgstr ""
-#: expr.c:898
+#: expr.c:933
#, c-format
msgid "operator '%s' has no right operand"
msgstr ""
-#: expr.c:903
+#: expr.c:938
#, c-format
msgid "operator '%s' has no left operand"
msgstr ""
-#: expr.c:929
+#: expr.c:964
msgid " ':' without preceding '?'"
msgstr ""
-#: expr.c:956
-msgid "unbalanced stack in #if"
+#: expr.c:991
+#, c-format
+msgid "unbalanced stack in %s"
msgstr ""
-#: expr.c:975
+#: expr.c:1011
#, c-format
msgid "impossible operator '%u'"
msgstr ""
-#: expr.c:1065
+#: expr.c:1101
msgid "missing ')' in expression"
msgstr ""
-#: expr.c:1086
+#: expr.c:1125
msgid "'?' without following ':'"
msgstr ""
-#: expr.c:1096
+#: expr.c:1135
msgid "integer overflow in preprocessor expression"
msgstr ""
-#: expr.c:1101
+#: expr.c:1140
msgid "missing '(' in expression"
msgstr ""
-#: expr.c:1133
+#: expr.c:1172
#, c-format
msgid "the left operand of \"%s\" changes sign when promoted"
msgstr ""
-#: expr.c:1138
+#: expr.c:1177
#, c-format
msgid "the right operand of \"%s\" changes sign when promoted"
msgstr ""
-#: expr.c:1397
+#: expr.c:1436
msgid "traditional C rejects the unary plus operator"
msgstr ""
-#: expr.c:1480
+#: expr.c:1519
msgid "comma operator in operand of #if"
msgstr ""
-#: expr.c:1612
+#: expr.c:1651
msgid "division by zero in #if"
msgstr ""
-#: files.c:458
+#: files.c:457
msgid "NULL directory in find_file"
msgstr ""
-#: files.c:496
+#: files.c:495
msgid "one or more PCH files were found, but they were invalid"
msgstr ""
-#: files.c:499
+#: files.c:498
msgid "use -Winvalid-pch for more information"
msgstr ""
-#: files.c:589
+#: files.c:588
#, c-format
msgid "%s is a block device"
msgstr ""
-#: files.c:606
+#: files.c:605
#, c-format
msgid "%s is too large"
msgstr ""
-#: files.c:641
+#: files.c:640
#, c-format
msgid "%s is shorter than expected"
msgstr ""
-#: files.c:872
+#: files.c:875
#, c-format
msgid "no include path in which to search for %s"
msgstr ""
-#: files.c:1238
+#: files.c:1286
msgid "Multiple include guards may be useful for:\n"
msgstr ""
-#: init.c:426
+#: init.c:428
msgid "cppchar_t must be an unsigned type"
msgstr ""
-#: init.c:430
+#: init.c:432
#, c-format
msgid ""
"preprocessor arithmetic has maximum precision of %lu bits; target requires %"
"lu bits"
msgstr ""
-#: init.c:437
+#: init.c:439
msgid "CPP arithmetic must be at least as precise as a target int"
msgstr ""
-#: init.c:440
+#: init.c:442
msgid "target char is less than 8 bits wide"
msgstr ""
-#: init.c:444
+#: init.c:446
msgid "target wchar_t is narrower than target char"
msgstr ""
-#: init.c:448
+#: init.c:450
msgid "target int is narrower than target char"
msgstr ""
-#: init.c:453
+#: init.c:455
msgid "CPP half-integer narrower than CPP character"
msgstr ""
-#: init.c:457
+#: init.c:459
#, c-format
msgid ""
"CPP on this host cannot handle wide character constants over %lu bits, but "
@@ -727,38 +748,38 @@ msgstr ""
msgid "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro"
msgstr ""
-#: lex.c:659
+#: lex.c:663
msgid "null character(s) preserved in literal"
msgstr ""
-#: lex.c:662
+#: lex.c:666
#, c-format
msgid "missing terminating %c character"
msgstr ""
-#: lex.c:1027
+#: lex.c:1100
msgid "C++ style comments are not allowed in ISO C90"
msgstr ""
-#: lex.c:1029
+#: lex.c:1102
msgid "(this will be reported only once per input file)"
msgstr ""
-#: lex.c:1034
+#: lex.c:1107
msgid "multi-line comment"
msgstr ""
-#: lex.c:1347
+#: lex.c:1420
#, c-format
msgid "unspellable token %s"
msgstr ""
-#: line-map.c:320
+#: line-map.c:319
#, c-format
msgid "In file included from %s:%u"
msgstr ""
-#: line-map.c:338
+#: line-map.c:337
#, c-format
msgid ""
",\n"
@@ -771,7 +792,7 @@ msgid "macro \"%s\" is not used"
msgstr ""
#: macro.c:126
-#: macro.c:322
+#: macro.c:321
#, c-format
msgid "invalid built-in macro \"%s\""
msgstr ""
@@ -780,109 +801,116 @@ msgstr ""
msgid "could not determine file timestamp"
msgstr ""
-#: macro.c:257
+#: macro.c:256
msgid "could not determine date and time"
msgstr ""
-#: macro.c:273
+#: macro.c:272
msgid "__COUNTER__ expanded inside directive with -fdirectives-only"
msgstr ""
-#: macro.c:426
+#: macro.c:427
msgid "invalid string literal, ignoring final '\\'"
msgstr ""
-#: macro.c:486
+#: macro.c:487
#, c-format
msgid "pasting \"%s\" and \"%s\" does not give a valid preprocessing token"
msgstr ""
-#: macro.c:561
+#: macro.c:562
msgid "ISO C99 requires rest arguments to be used"
msgstr ""
-#: macro.c:566
+#: macro.c:567
#, c-format
msgid "macro \"%s\" requires %u arguments, but only %u given"
msgstr ""
-#: macro.c:571
+#: macro.c:572
#, c-format
msgid "macro \"%s\" passed %u arguments, but takes just %u"
msgstr ""
-#: macro.c:730
+#: macro.c:731
#: traditional.c:680
#, c-format
msgid "unterminated argument list invoking macro \"%s\""
msgstr ""
-#: macro.c:840
+#: macro.c:848
#, c-format
msgid "function-like macro \"%s\" must be used with arguments in traditional C"
msgstr ""
-#: macro.c:1408
+#: macro.c:1016
+#, c-format
+msgid ""
+"invoking macro %s argument %d: empty macro arguments are undefined in ISO "
+"C90 and ISO C++98"
+msgstr ""
+
+#: macro.c:1449
#, c-format
msgid "duplicate macro parameter \"%s\""
msgstr ""
-#: macro.c:1454
+#: macro.c:1495
#, c-format
msgid "\"%s\" may not appear in macro parameter list"
msgstr ""
-#: macro.c:1462
+#: macro.c:1503
msgid "macro parameters must be comma-separated"
msgstr ""
-#: macro.c:1479
+#: macro.c:1520
msgid "parameter name missing"
msgstr ""
-#: macro.c:1496
+#: macro.c:1537
msgid "anonymous variadic macros were introduced in C99"
msgstr ""
-#: macro.c:1501
+#: macro.c:1542
msgid "ISO C does not permit named variadic macros"
msgstr ""
-#: macro.c:1510
+#: macro.c:1551
msgid "missing ')' in macro parameter list"
msgstr ""
-#: macro.c:1559
+#: macro.c:1600
msgid "'##' cannot appear at either end of a macro expansion"
msgstr ""
-#: macro.c:1593
+#: macro.c:1634
msgid "ISO C99 requires whitespace after the macro name"
msgstr ""
-#: macro.c:1617
+#: macro.c:1658
msgid "missing whitespace after the macro name"
msgstr ""
-#: macro.c:1647
+#: macro.c:1688
msgid "'#' is not followed by a macro parameter"
msgstr ""
-#: macro.c:1766
+#: macro.c:1807
#, c-format
msgid "\"%s\" redefined"
msgstr ""
-#: macro.c:1771
+#: macro.c:1812
msgid "this is the location of the previous definition"
msgstr ""
-#: macro.c:1828
+#: macro.c:1873
#, c-format
msgid "macro argument \"%s\" would be stringified in traditional C"
msgstr ""
-#: macro.c:1851
+#: macro.c:1896
#, c-format
msgid "invalid hash type %d in cpp_macro_definition"
msgstr ""
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 850bbd4b35b..cffc4d25ff5 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,3 +1,16 @@
+2008-08-25 Andreas Tobler <a.tobler@schweiz.org>
+
+ * src/powerpc/ffitarget.h (ffi_abi): Add FFI_LINUX and
+ FFI_LINUX_SOFT_FLOAT to the POWERPC_FREEBSD enum.
+ Add note about flag bits used for FFI_SYSV_TYPE_SMALL_STRUCT.
+ Adjust copyright notice.
+ * src/powerpc/ffi.c: Add two new flags to indicate if we have one
+ register or two register to use for FFI_SYSV structs.
+ (ffi_prep_cif_machdep): Pass the right register flag introduced above.
+ (ffi_closure_helper_SYSV): Fix the return type for
+ FFI_SYSV_TYPE_SMALL_STRUCT. Comment.
+ Adjust copyright notice.
+
2008-07-16 Kaz Kojima <kkojima@gcc.gnu.org>
* src/sh/ffi.c (ffi_prep_closure_loc): Turn INSN into an unsigned
diff --git a/libffi/src/powerpc/ffi.c b/libffi/src/powerpc/ffi.c
index e6b869f8737..73c1dd20766 100644
--- a/libffi/src/powerpc/ffi.c
+++ b/libffi/src/powerpc/ffi.c
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------------
ffi.c - Copyright (c) 1998 Geoffrey Keating
- Copyright (C) 2007 Free Software Foundation, Inc
+ Copyright (C) 2007, 2008 Free Software Foundation, Inc
PowerPC Foreign Function Interface
@@ -43,6 +43,10 @@ enum {
FLAG_RETURNS_128BITS = 1 << (31-27), /* cr6 */
+ FLAG_SYSV_SMST_R4 = 1 << (31-16), /* cr4, use r4 for FFI_SYSV 8 byte
+ structs. */
+ FLAG_SYSV_SMST_R3 = 1 << (31-15), /* cr3, use r3 for FFI_SYSV 4 byte
+ structs. */
FLAG_ARG_NEEDS_COPY = 1 << (31- 7),
FLAG_FP_ARGUMENTS = 1 << (31- 6), /* cr1.eq; specified by ABI */
FLAG_4_GPR_ARGUMENTS = 1 << (31- 5),
@@ -679,14 +683,14 @@ ffi_prep_cif_machdep (ffi_cif *cif)
The same applies for the structs returned in r3/r4. */
if (size <= 4)
{
- flags |= 1 << (31 - FFI_SYSV_TYPE_SMALL_STRUCT - 1);
+ flags |= FLAG_SYSV_SMST_R3;
flags |= 8 * (4 - size) << 4;
break;
}
/* These structs are returned in r3 and r4. See above. */
if (size <= 8)
{
- flags |= 1 << (31 - FFI_SYSV_TYPE_SMALL_STRUCT - 2);
+ flags |= FLAG_SYSV_SMST_R4;
flags |= 8 * (8 - size) << 4;
break;
}
@@ -1248,10 +1252,15 @@ ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue,
/* Tell ffi_closure_SYSV how to perform return type promotions.
Because the FFI_SYSV ABI returns the structures <= 8 bytes in r3/r4
- we have to tell ffi_closure_SYSV how to treat them. */
+ we have to tell ffi_closure_SYSV how to treat them. We combine the base
+ type FFI_SYSV_TYPE_SMALL_STRUCT - 1 with the size of the struct.
+ So a one byte struct gets the return type 16. Return type 1 to 15 are
+ already used and we never have a struct with size zero. That is the reason
+ for the subtraction of 1. See the comment in ffitarget.h about ordering.
+ */
if (cif->abi == FFI_SYSV && cif->rtype->type == FFI_TYPE_STRUCT
&& size <= 8)
- return FFI_SYSV_TYPE_SMALL_STRUCT + size;
+ return (FFI_SYSV_TYPE_SMALL_STRUCT - 1) + size;
#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE
else if (cif->rtype->type == FFI_TYPE_LONGDOUBLE
&& cif->abi != FFI_LINUX && cif->abi != FFI_LINUX_SOFT_FLOAT)
diff --git a/libffi/src/powerpc/ffitarget.h b/libffi/src/powerpc/ffitarget.h
index e3fa30be6b5..a39a6267166 100644
--- a/libffi/src/powerpc/ffitarget.h
+++ b/libffi/src/powerpc/ffitarget.h
@@ -1,6 +1,6 @@
/* -----------------------------------------------------------------*-C-*-
ffitarget.h - Copyright (c) 1996-2003 Red Hat, Inc.
- Copyright (C) 2007 Free Software Foundation, Inc
+ Copyright (C) 2007, 2008 Free Software Foundation, Inc
Target configuration macros for PowerPC.
Permission is hereby granted, free of charge, to any person obtaining
@@ -77,6 +77,8 @@ typedef enum ffi_abi {
FFI_SYSV,
FFI_GCC_SYSV,
FFI_LINUX64,
+ FFI_LINUX,
+ FFI_LINUX_SOFT_FLOAT,
FFI_DEFAULT_ABI = FFI_SYSV,
#endif
@@ -95,7 +97,9 @@ typedef enum ffi_abi {
/* Needed for soft-float long-double-128 support. */
#define FFI_TYPE_UINT128 (FFI_TYPE_LAST + 1)
-/* Needed for FFI_SYSV small structure returns. */
+/* Needed for FFI_SYSV small structure returns.
+ We use two flag bits, (FLAG_SYSV_SMST_R3, FLAG_SYSV_SMST_R4) which are
+ defined in ffi.c, to determine the exact return type and its size. */
#define FFI_SYSV_TYPE_SMALL_STRUCT (FFI_TYPE_LAST + 2)
#if defined(POWERPC64) || defined(POWERPC_AIX)
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 2459b539096..f8083c8dbbd 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,6 +1,84 @@
+2008-08-30 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/36895
+ * io/write.c (namelist_write_newline): New function to correctly mark
+ next records in both external and internal units.
+ (nml_write_obj): Use new function.
+ (namelist_write: Use new function.
+
+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
+ PR fortran/29952
+ PR fortran/36909
+ * runtime/error.c: New function runtime_error_at.
+ * gfortran.map: Ditto.
+ * libgfortran.h: Ditto.
+
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/gfortran.map b/libgfortran/gfortran.map
index 0671b60fb86..93973d5b338 100644
--- a/libgfortran/gfortran.map
+++ b/libgfortran/gfortran.map
@@ -1072,6 +1072,7 @@ GFORTRAN_1.1 {
_gfortran_pack_char4;
_gfortran_pack_s_char4;
_gfortran_reshape_char4;
+ _gfortran_runtime_warning_at;
_gfortran_selected_char_kind;
_gfortran_select_string_char4;
_gfortran_spread_char4;
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..65210bcbe1f 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;
}
}
@@ -1000,6 +1116,22 @@ list_formatted_write (st_parameter_dt *dtp, bt type, void *p, int kind,
#define NML_DIGITS 20
+static void
+namelist_write_newline (st_parameter_dt *dtp)
+{
+ if (!is_internal_unit (dtp))
+ {
+#ifdef HAVE_CRLF
+ write_character (dtp, "\r\n", 1, 2);
+#else
+ write_character (dtp, "\n", 1, 1);
+#endif
+ }
+ else
+ write_character (dtp, " ", 1, 1);
+}
+
+
static namelist_info *
nml_write_obj (st_parameter_dt *dtp, namelist_info * obj, index_type offset,
namelist_info * base, char * base_name)
@@ -1036,11 +1168,9 @@ nml_write_obj (st_parameter_dt *dtp, namelist_info * obj, index_type offset,
if (obj->type != GFC_DTYPE_DERIVED)
{
-#ifdef HAVE_CRLF
- write_character (dtp, "\r\n ", 1, 3);
-#else
- write_character (dtp, "\n ", 1, 2);
-#endif
+ namelist_write_newline (dtp);
+ write_character (dtp, " ", 1, 1);
+
len = 0;
if (base)
{
@@ -1245,11 +1375,8 @@ nml_write_obj (st_parameter_dt *dtp, namelist_info * obj, index_type offset,
if (num > 5)
{
num = 0;
-#ifdef HAVE_CRLF
- write_character (dtp, "\r\n ", 1, 3);
-#else
- write_character (dtp, "\n ", 1, 2);
-#endif
+ namelist_write_newline (dtp);
+ write_character (dtp, " ", 1, 1);
}
rep_ctr = 1;
}
@@ -1276,6 +1403,7 @@ obj_loop:
return retval;
}
+
/* This is the entry function for namelist writes. It outputs the name
of the namelist and iterates through the namelist by calls to
nml_write_obj. The call below has dummys in the arguments used in
@@ -1331,12 +1459,8 @@ namelist_write (st_parameter_dt *dtp)
}
}
-#ifdef HAVE_CRLF
- write_character (dtp, " /\r\n", 1, 5);
-#else
- write_character (dtp, " /\n", 1, 4);
-#endif
-
+ write_character (dtp, " /", 1, 3);
+ namelist_write_newline (dtp);
/* Restore the original delimiter. */
dtp->u.p.delim_status = tmp_delim;
}
diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h
index 10439bd3e5a..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
@@ -643,6 +649,9 @@ extern void runtime_error_at (const char *, const char *, ...)
__attribute__ ((noreturn, format (printf, 2, 3)));
iexport_proto(runtime_error_at);
+extern void runtime_warning_at (const char *, const char *, ...);
+iexport_proto(runtime_warning_at);
+
extern void internal_error (st_parameter_common *, const char *)
__attribute__ ((noreturn));
internal_proto(internal_error);
@@ -1207,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/runtime/error.c b/libgfortran/runtime/error.c
index 8cd966fa23f..0b9c16705eb 100644
--- a/libgfortran/runtime/error.c
+++ b/libgfortran/runtime/error.c
@@ -285,6 +285,21 @@ runtime_error_at (const char *where, const char *message, ...)
iexport(runtime_error_at);
+void
+runtime_warning_at (const char *where, const char *message, ...)
+{
+ va_list ap;
+
+ st_printf ("%s\n", where);
+ st_printf ("Fortran runtime warning: ");
+ va_start (ap, message);
+ st_vprintf (message, ap);
+ va_end (ap);
+ st_printf ("\n");
+}
+iexport(runtime_warning_at);
+
+
/* void internal_error()-- These are this-can't-happen errors
* that indicate something deeply wrong. */
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index ded506b0636..d9e14eb06c6 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,22 @@
+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.
+ Do not list GPL as Invariant Section.
+
+2008-07-28 Ilie Garbacea <ilie@mips.com>
+ Chao-ying Fu <fu@mips.com>
+
+ * configure.tgt: Enable futex for MIPS.
+ * config/linux/mips/futex.h: New file.
+
2008-07-16 Jakub Jelinek <jakub@redhat.com>
* team.c (gomp_team_end): Free team immediately if it has
diff --git a/libgomp/config/linux/mips/futex.h b/libgomp/config/linux/mips/futex.h
new file mode 100644
index 00000000000..9327cc84a49
--- /dev/null
+++ b/libgomp/config/linux/mips/futex.h
@@ -0,0 +1,75 @@
+/* Copyright (C) 2005, 2008 Free Software Foundation, Inc.
+ Contributed by Ilie Garbacea <ilie@mips.com>, Chao-ying Fu <fu@mips.com>.
+
+ This file is part of the GNU OpenMP Library (libgomp).
+
+ Libgomp is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as published by
+ the Free Software Foundation; either version 2.1 of the License, or
+ (at your option) any later version.
+
+ Libgomp 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 Lesser General Public License for
+ more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with libgomp; see the file COPYING.LIB. If not, write to the
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ MA 02110-1301, USA. */
+
+/* As a special exception, if you link this library with other files, some
+ of which are compiled with GCC, to produce an executable, this library
+ 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. */
+
+/* Provide target-specific access to the futex system call. */
+
+#include <sys/syscall.h>
+#define FUTEX_WAIT 0
+#define FUTEX_WAKE 1
+
+static inline void
+sys_futex0 (int *addr, int op, int val)
+{
+ register unsigned long __v0 asm("$2") = (unsigned long) SYS_futex;
+ register unsigned long __a0 asm("$4") = (unsigned long) addr;
+ register unsigned long __a1 asm("$5") = (unsigned long) op;
+ register unsigned long __a2 asm("$6") = (unsigned long) val;
+ register unsigned long __a3 asm("$7") = 0;
+
+ __asm volatile ("syscall"
+ /* returns $a3 (errno), $v0 (return value) */
+ : "=r" (__v0), "=r" (__a3)
+ /* arguments in v0 (syscall) a0-a3 */
+ : "r" (__v0), "r" (__a0), "r" (__a1), "r" (__a2), "r" (__a3)
+ /* clobbers at, v1, t0-t9, memory */
+ : "$1", "$3", "$8", "$9", "$10", "$11", "$12", "$13", "$14",
+ "$15", "$24", "$25", "memory");
+}
+
+static inline void
+futex_wait (int *addr, int val)
+{
+ sys_futex0 (addr, FUTEX_WAIT, val);
+}
+
+static inline void
+futex_wake (int *addr, int count)
+{
+ sys_futex0 (addr, FUTEX_WAKE, count);
+}
+
+static inline void
+cpu_relax (void)
+{
+ __asm volatile ("" : : : "memory");
+}
+
+static inline void
+atomic_write_barrier (void)
+{
+ __sync_synchronize ();
+}
diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt
index 68115abf71d..ef44a12a4bd 100644
--- a/libgomp/configure.tgt
+++ b/libgomp/configure.tgt
@@ -35,6 +35,10 @@ if test $enable_linux_futex = yes; then
config_path="linux/ia64 linux posix"
;;
+ mips*-*-linux*)
+ config_path="linux/mips linux posix"
+ ;;
+
powerpc*-*-linux*)
config_path="linux/powerpc linux posix"
;;
diff --git a/libgomp/libgomp.texi b/libgomp/libgomp.texi
index 6794ebe9335..edc37904b71 100644
--- a/libgomp/libgomp.texi
+++ b/libgomp/libgomp.texi
@@ -7,13 +7,12 @@
@copying
-Copyright @copyright{} 2006 Free Software Foundation, Inc.
+Copyright @copyright{} 2006, 2007, 2008 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.1 or
+under the terms of the GNU Free Documentation License, Version 1.2 or
any later version published by the Free Software Foundation; with the
-Invariant Sections being ``GNU General Public License'' and ``Funding
-Free Software'', the Front-Cover
+Invariant Sections being ``Funding Free Software'', the Front-Cover
texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
``GNU Free Documentation License''.
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 b77e66df94c..837035c05f1 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,27 @@
+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.
+ * Makefile.in: Rebuild deps.
+ (maintainer-clean-subdir): Depend on stamp-h rather than config.h.
+ Reverts 2007-07-11 change.
+
2008-06-19 Eric Blake <ebb9@byu.net>
Adjust strsignal to POSIX 200x prototype.
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index 40a1d47718b..e18aff75363 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -475,13 +475,13 @@ stamp-h: $(srcdir)/config.in config.status Makefile
config.status: $(srcdir)/configure
$(SHELL) ./config.status --recheck
-# Depending on stamp-h makes sure that config.status has been re-run
+# Depending on config.h makes sure that config.status has been re-run
# if needed. This prevents problems with parallel builds, in case
# subdirectories need to run config.status also.
all-subdir check-subdir installcheck-subdir info-subdir \
install-info-subdir clean-info-subdir dvi-subdir pdf-subdir install-subdir \
etags-subdir mostlyclean-subdir clean-subdir distclean-subdir \
-maintainer-clean-subdir: stamp-h
+maintainer-clean-subdir: config.h
@subdirs='$(SUBDIRS)'; \
target=`echo $@ | sed -e 's/-subdir//'`; \
for dir in $$subdirs ; do \
@@ -498,40 +498,41 @@ $(CONFIGURED_OFILES): stamp-picdir
# The dependencies in the remainder of this file are automatically
# generated by "make maint-deps". Manual edits will be lost.
-./_doprnt.o: $(srcdir)/_doprnt.c stamp-h $(INCDIR)/ansidecl.h \
+./_doprnt.o: $(srcdir)/_doprnt.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/_doprnt.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/_doprnt.c $(OUTPUT_OPTION)
-./alloca.o: $(srcdir)/alloca.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+./alloca.o: $(srcdir)/alloca.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/alloca.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/alloca.c $(OUTPUT_OPTION)
-./argv.o: $(srcdir)/argv.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
+./argv.o: $(srcdir)/argv.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/argv.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/argv.c $(OUTPUT_OPTION)
-./asprintf.o: $(srcdir)/asprintf.c stamp-h $(INCDIR)/ansidecl.h \
+./asprintf.o: $(srcdir)/asprintf.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/asprintf.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/asprintf.c $(OUTPUT_OPTION)
-./atexit.o: $(srcdir)/atexit.c stamp-h
+./atexit.o: $(srcdir)/atexit.c config.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/atexit.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/atexit.c $(OUTPUT_OPTION)
-./basename.o: $(srcdir)/basename.c stamp-h $(INCDIR)/ansidecl.h \
+./basename.o: $(srcdir)/basename.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/basename.c -o pic/$@; \
@@ -550,7 +551,7 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/bcopy.c $(OUTPUT_OPTION)
-./bsearch.o: $(srcdir)/bsearch.c stamp-h $(INCDIR)/ansidecl.h
+./bsearch.o: $(srcdir)/bsearch.c config.h $(INCDIR)/ansidecl.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/bsearch.c -o pic/$@; \
else true; fi
@@ -568,20 +569,21 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/calloc.c $(OUTPUT_OPTION)
-./choose-temp.o: $(srcdir)/choose-temp.c stamp-h $(INCDIR)/ansidecl.h \
+./choose-temp.o: $(srcdir)/choose-temp.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/choose-temp.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/choose-temp.c $(OUTPUT_OPTION)
-./clock.o: $(srcdir)/clock.c stamp-h
+./clock.o: $(srcdir)/clock.c config.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/clock.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/clock.c $(OUTPUT_OPTION)
-./concat.o: $(srcdir)/concat.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+./concat.o: $(srcdir)/concat.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/concat.c -o pic/$@; \
else true; fi
@@ -593,7 +595,7 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/copysign.c $(OUTPUT_OPTION)
-./cp-demangle.o: $(srcdir)/cp-demangle.c stamp-h $(INCDIR)/ansidecl.h \
+./cp-demangle.o: $(srcdir)/cp-demangle.c config.h $(INCDIR)/ansidecl.h \
$(srcdir)/cp-demangle.h $(INCDIR)/demangle.h \
$(INCDIR)/dyn-string.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
@@ -601,7 +603,7 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/cp-demangle.c $(OUTPUT_OPTION)
-./cp-demint.o: $(srcdir)/cp-demint.c stamp-h $(INCDIR)/ansidecl.h \
+./cp-demint.o: $(srcdir)/cp-demint.c config.h $(INCDIR)/ansidecl.h \
$(srcdir)/cp-demangle.h $(INCDIR)/demangle.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
@@ -609,7 +611,7 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/cp-demint.c $(OUTPUT_OPTION)
-./cplus-dem.o: $(srcdir)/cplus-dem.c stamp-h $(INCDIR)/ansidecl.h \
+./cplus-dem.o: $(srcdir)/cplus-dem.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/demangle.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
@@ -617,14 +619,14 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/cplus-dem.c $(OUTPUT_OPTION)
-./dyn-string.o: $(srcdir)/dyn-string.c stamp-h $(INCDIR)/ansidecl.h \
+./dyn-string.o: $(srcdir)/dyn-string.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/dyn-string.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/dyn-string.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/dyn-string.c $(OUTPUT_OPTION)
-./fdmatch.o: $(srcdir)/fdmatch.c stamp-h $(INCDIR)/ansidecl.h \
+./fdmatch.o: $(srcdir)/fdmatch.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/fdmatch.c -o pic/$@; \
@@ -637,93 +639,94 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/ffs.c $(OUTPUT_OPTION)
-./fibheap.o: $(srcdir)/fibheap.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/fibheap.h \
- $(INCDIR)/libiberty.h
+./fibheap.o: $(srcdir)/fibheap.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/fibheap.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/fibheap.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/fibheap.c $(OUTPUT_OPTION)
-./filename_cmp.o: $(srcdir)/filename_cmp.c stamp-h $(INCDIR)/filenames.h \
+./filename_cmp.o: $(srcdir)/filename_cmp.c config.h $(INCDIR)/filenames.h \
$(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/filename_cmp.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/filename_cmp.c $(OUTPUT_OPTION)
-./floatformat.o: $(srcdir)/floatformat.c stamp-h $(INCDIR)/ansidecl.h \
+./floatformat.o: $(srcdir)/floatformat.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/floatformat.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/floatformat.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/floatformat.c $(OUTPUT_OPTION)
-./fnmatch.o: $(srcdir)/fnmatch.c stamp-h $(INCDIR)/fnmatch.h \
+./fnmatch.o: $(srcdir)/fnmatch.c config.h $(INCDIR)/fnmatch.h \
$(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/fnmatch.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/fnmatch.c $(OUTPUT_OPTION)
-./fopen_unlocked.o: $(srcdir)/fopen_unlocked.c stamp-h $(INCDIR)/ansidecl.h \
+./fopen_unlocked.o: $(srcdir)/fopen_unlocked.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/fopen_unlocked.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/fopen_unlocked.c $(OUTPUT_OPTION)
-./getcwd.o: $(srcdir)/getcwd.c stamp-h
+./getcwd.o: $(srcdir)/getcwd.c config.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/getcwd.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/getcwd.c $(OUTPUT_OPTION)
-./getopt.o: $(srcdir)/getopt.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/getopt.h
+./getopt.o: $(srcdir)/getopt.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/getopt.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/getopt.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/getopt.c $(OUTPUT_OPTION)
-./getopt1.o: $(srcdir)/getopt1.c stamp-h $(INCDIR)/getopt.h
+./getopt1.o: $(srcdir)/getopt1.c config.h $(INCDIR)/getopt.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/getopt1.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/getopt1.c $(OUTPUT_OPTION)
-./getpagesize.o: $(srcdir)/getpagesize.c stamp-h
+./getpagesize.o: $(srcdir)/getpagesize.c config.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/getpagesize.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/getpagesize.c $(OUTPUT_OPTION)
-./getpwd.o: $(srcdir)/getpwd.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+./getpwd.o: $(srcdir)/getpwd.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/getpwd.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/getpwd.c $(OUTPUT_OPTION)
-./getruntime.o: $(srcdir)/getruntime.c stamp-h $(INCDIR)/ansidecl.h \
+./getruntime.o: $(srcdir)/getruntime.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/getruntime.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/getruntime.c $(OUTPUT_OPTION)
-./gettimeofday.o: $(srcdir)/gettimeofday.c stamp-h $(INCDIR)/ansidecl.h \
+./gettimeofday.o: $(srcdir)/gettimeofday.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/gettimeofday.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/gettimeofday.c $(OUTPUT_OPTION)
-./hashtab.o: $(srcdir)/hashtab.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/hashtab.h \
- $(INCDIR)/libiberty.h
+./hashtab.o: $(srcdir)/hashtab.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/hashtab.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/hashtab.c $(OUTPUT_OPTION)
-./hex.o: $(srcdir)/hex.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
+./hex.o: $(srcdir)/hex.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/hex.c -o pic/$@; \
@@ -742,7 +745,7 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/insque.c $(OUTPUT_OPTION)
-./lbasename.o: $(srcdir)/lbasename.c stamp-h $(INCDIR)/ansidecl.h \
+./lbasename.o: $(srcdir)/lbasename.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/filenames.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
@@ -750,28 +753,28 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/lbasename.c $(OUTPUT_OPTION)
-./lrealpath.o: $(srcdir)/lrealpath.c stamp-h $(INCDIR)/ansidecl.h \
+./lrealpath.o: $(srcdir)/lrealpath.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/lrealpath.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/lrealpath.c $(OUTPUT_OPTION)
-./make-relative-prefix.o: $(srcdir)/make-relative-prefix.c stamp-h \
+./make-relative-prefix.o: $(srcdir)/make-relative-prefix.c config.h \
$(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/make-relative-prefix.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/make-relative-prefix.c $(OUTPUT_OPTION)
-./make-temp-file.o: $(srcdir)/make-temp-file.c stamp-h $(INCDIR)/ansidecl.h \
+./make-temp-file.o: $(srcdir)/make-temp-file.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/make-temp-file.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/make-temp-file.c $(OUTPUT_OPTION)
-./md5.o: $(srcdir)/md5.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/md5.h
+./md5.o: $(srcdir)/md5.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/md5.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/md5.c -o pic/$@; \
else true; fi
@@ -813,7 +816,7 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/memset.c $(OUTPUT_OPTION)
-./mkstemps.o: $(srcdir)/mkstemps.c stamp-h $(INCDIR)/ansidecl.h
+./mkstemps.o: $(srcdir)/mkstemps.c config.h $(INCDIR)/ansidecl.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/mkstemps.c -o pic/$@; \
else true; fi
@@ -825,41 +828,41 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/msdos.c $(OUTPUT_OPTION)
-./objalloc.o: $(srcdir)/objalloc.c stamp-h $(INCDIR)/ansidecl.h \
+./objalloc.o: $(srcdir)/objalloc.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/objalloc.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/objalloc.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/objalloc.c $(OUTPUT_OPTION)
-./obstack.o: $(srcdir)/obstack.c stamp-h $(INCDIR)/obstack.h
+./obstack.o: $(srcdir)/obstack.c config.h $(INCDIR)/obstack.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/obstack.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/obstack.c $(OUTPUT_OPTION)
-./partition.o: $(srcdir)/partition.c stamp-h $(INCDIR)/ansidecl.h \
+./partition.o: $(srcdir)/partition.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h $(INCDIR)/partition.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/partition.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/partition.c $(OUTPUT_OPTION)
-./pex-common.o: $(srcdir)/pex-common.c stamp-h $(INCDIR)/ansidecl.h \
+./pex-common.o: $(srcdir)/pex-common.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h $(srcdir)/pex-common.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/pex-common.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/pex-common.c $(OUTPUT_OPTION)
-./pex-djgpp.o: $(srcdir)/pex-djgpp.c stamp-h $(INCDIR)/ansidecl.h \
+./pex-djgpp.o: $(srcdir)/pex-djgpp.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h $(srcdir)/pex-common.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/pex-djgpp.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/pex-djgpp.c $(OUTPUT_OPTION)
-./pex-msdos.o: $(srcdir)/pex-msdos.c stamp-h $(INCDIR)/ansidecl.h \
+./pex-msdos.o: $(srcdir)/pex-msdos.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h $(srcdir)/pex-common.h \
$(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
@@ -867,42 +870,42 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/pex-msdos.c $(OUTPUT_OPTION)
-./pex-one.o: $(srcdir)/pex-one.c stamp-h $(INCDIR)/ansidecl.h \
+./pex-one.o: $(srcdir)/pex-one.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/pex-one.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/pex-one.c $(OUTPUT_OPTION)
-./pex-unix.o: $(srcdir)/pex-unix.c stamp-h $(INCDIR)/ansidecl.h \
+./pex-unix.o: $(srcdir)/pex-unix.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h $(srcdir)/pex-common.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/pex-unix.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/pex-unix.c $(OUTPUT_OPTION)
-./pex-win32.o: $(srcdir)/pex-win32.c stamp-h $(INCDIR)/ansidecl.h \
+./pex-win32.o: $(srcdir)/pex-win32.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h $(srcdir)/pex-common.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/pex-win32.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/pex-win32.c $(OUTPUT_OPTION)
-./pexecute.o: $(srcdir)/pexecute.c stamp-h $(INCDIR)/ansidecl.h \
+./pexecute.o: $(srcdir)/pexecute.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/pexecute.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/pexecute.c $(OUTPUT_OPTION)
-./physmem.o: $(srcdir)/physmem.c stamp-h $(INCDIR)/ansidecl.h \
+./physmem.o: $(srcdir)/physmem.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/physmem.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/physmem.c $(OUTPUT_OPTION)
-./putenv.o: $(srcdir)/putenv.c stamp-h $(INCDIR)/ansidecl.h
+./putenv.o: $(srcdir)/putenv.c config.h $(INCDIR)/ansidecl.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/putenv.c -o pic/$@; \
else true; fi
@@ -914,14 +917,14 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/random.c $(OUTPUT_OPTION)
-./regex.o: $(srcdir)/regex.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/xregex.h \
+./regex.o: $(srcdir)/regex.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/xregex.h \
$(INCDIR)/xregex2.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/regex.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/regex.c $(OUTPUT_OPTION)
-./rename.o: $(srcdir)/rename.c stamp-h $(INCDIR)/ansidecl.h
+./rename.o: $(srcdir)/rename.c config.h $(INCDIR)/ansidecl.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/rename.c -o pic/$@; \
else true; fi
@@ -940,13 +943,13 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/safe-ctype.c $(OUTPUT_OPTION)
-./setenv.o: $(srcdir)/setenv.c stamp-h $(INCDIR)/ansidecl.h
+./setenv.o: $(srcdir)/setenv.c config.h $(INCDIR)/ansidecl.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/setenv.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/setenv.c $(OUTPUT_OPTION)
-./sha1.o: $(srcdir)/sha1.c stamp-h $(INCDIR)/sha1.h
+./sha1.o: $(srcdir)/sha1.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/sha1.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/sha1.c -o pic/$@; \
else true; fi
@@ -964,20 +967,21 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/snprintf.c $(OUTPUT_OPTION)
-./sort.o: $(srcdir)/sort.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
+./sort.o: $(srcdir)/sort.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(INCDIR)/sort.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/sort.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/sort.c $(OUTPUT_OPTION)
-./spaces.o: $(srcdir)/spaces.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+./spaces.o: $(srcdir)/spaces.c config.h $(INCDIR)/ansidecl.h \
+ $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/spaces.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/spaces.c $(OUTPUT_OPTION)
-./splay-tree.o: $(srcdir)/splay-tree.c stamp-h $(INCDIR)/ansidecl.h \
+./splay-tree.o: $(srcdir)/splay-tree.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h $(INCDIR)/splay-tree.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/splay-tree.c -o pic/$@; \
@@ -1014,7 +1018,7 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/strdup.c $(OUTPUT_OPTION)
-./strerror.o: $(srcdir)/strerror.c stamp-h $(INCDIR)/ansidecl.h \
+./strerror.o: $(srcdir)/strerror.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/strerror.c -o pic/$@; \
@@ -1045,7 +1049,7 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/strrchr.c $(OUTPUT_OPTION)
-./strsignal.o: $(srcdir)/strsignal.c stamp-h $(INCDIR)/ansidecl.h \
+./strsignal.o: $(srcdir)/strsignal.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/strsignal.c -o pic/$@; \
@@ -1064,13 +1068,13 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/strtod.c $(OUTPUT_OPTION)
-./strtol.o: $(srcdir)/strtol.c stamp-h $(INCDIR)/safe-ctype.h
+./strtol.o: $(srcdir)/strtol.c config.h $(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/strtol.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/strtol.c $(OUTPUT_OPTION)
-./strtoul.o: $(srcdir)/strtoul.c stamp-h $(INCDIR)/ansidecl.h \
+./strtoul.o: $(srcdir)/strtoul.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/safe-ctype.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/strtoul.c -o pic/$@; \
@@ -1090,14 +1094,14 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/tmpnam.c $(OUTPUT_OPTION)
-./unlink-if-ordinary.o: $(srcdir)/unlink-if-ordinary.c stamp-h \
+./unlink-if-ordinary.o: $(srcdir)/unlink-if-ordinary.c config.h \
$(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/unlink-if-ordinary.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/unlink-if-ordinary.c $(OUTPUT_OPTION)
-./vasprintf.o: $(srcdir)/vasprintf.c stamp-h $(INCDIR)/ansidecl.h \
+./vasprintf.o: $(srcdir)/vasprintf.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/vasprintf.c -o pic/$@; \
@@ -1122,7 +1126,7 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/vprintf.c $(OUTPUT_OPTION)
-./vsnprintf.o: $(srcdir)/vsnprintf.c stamp-h $(INCDIR)/ansidecl.h \
+./vsnprintf.o: $(srcdir)/vsnprintf.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/vsnprintf.c -o pic/$@; \
@@ -1135,54 +1139,54 @@ $(CONFIGURED_OFILES): stamp-picdir
else true; fi
$(COMPILE.c) $(srcdir)/vsprintf.c $(OUTPUT_OPTION)
-./waitpid.o: $(srcdir)/waitpid.c stamp-h $(INCDIR)/ansidecl.h
+./waitpid.o: $(srcdir)/waitpid.c config.h $(INCDIR)/ansidecl.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/waitpid.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/waitpid.c $(OUTPUT_OPTION)
-./xatexit.o: $(srcdir)/xatexit.c stamp-h $(INCDIR)/ansidecl.h \
+./xatexit.o: $(srcdir)/xatexit.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/xatexit.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/xatexit.c $(OUTPUT_OPTION)
-./xexit.o: $(srcdir)/xexit.c stamp-h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
+./xexit.o: $(srcdir)/xexit.c config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/xexit.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/xexit.c $(OUTPUT_OPTION)
-./xmalloc.o: $(srcdir)/xmalloc.c stamp-h $(INCDIR)/ansidecl.h \
+./xmalloc.o: $(srcdir)/xmalloc.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/xmalloc.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/xmalloc.c $(OUTPUT_OPTION)
-./xmemdup.o: $(srcdir)/xmemdup.c stamp-h $(INCDIR)/ansidecl.h \
+./xmemdup.o: $(srcdir)/xmemdup.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/xmemdup.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/xmemdup.c $(OUTPUT_OPTION)
-./xstrdup.o: $(srcdir)/xstrdup.c stamp-h $(INCDIR)/ansidecl.h \
+./xstrdup.o: $(srcdir)/xstrdup.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/xstrdup.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/xstrdup.c $(OUTPUT_OPTION)
-./xstrerror.o: $(srcdir)/xstrerror.c stamp-h $(INCDIR)/ansidecl.h \
+./xstrerror.o: $(srcdir)/xstrerror.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/xstrerror.c -o pic/$@; \
else true; fi
$(COMPILE.c) $(srcdir)/xstrerror.c $(OUTPUT_OPTION)
-./xstrndup.o: $(srcdir)/xstrndup.c stamp-h $(INCDIR)/ansidecl.h \
+./xstrndup.o: $(srcdir)/xstrndup.c config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
if [ x"$(PICFLAG)" != x ]; then \
$(COMPILE.c) $(PICFLAG) $(srcdir)/xstrndup.c -o pic/$@; \
diff --git a/libiberty/functions.texi b/libiberty/functions.texi
index e6ab84c6999..34566d8f17a 100644
--- a/libiberty/functions.texi
+++ b/libiberty/functions.texi
@@ -688,7 +688,9 @@ reading and writing.
@c pexecute.txh:266
@deftypefn Extension void pex_free (struct pex_obj @var{obj})
-Clean up and free all data associated with @var{obj}.
+Clean up and free all data associated with @var{obj}. If you have not
+yet called @code{pex_get_times} or @code{pex_get_status}, this will
+try to kill the subprocesses.
@end deftypefn
@@ -814,7 +816,7 @@ the output pipe is you, but you are blocked on the input pipe.
@end deftypefn
-@c pexecute.txh:272
+@c pexecute.txh:274
@deftypefn Extension {const char *} pex_one (int @var{flags}, const char *@var{executable}, char * const *@var{argv}, const char *@var{pname}, const char *@var{outname}, const char *@var{errname}, int *@var{status}, int *@var{err})
An interface to permit the easy execution of a
@@ -977,7 +979,7 @@ form @code{VAR=VALUE}, with the exception of the last element that must be
@end deftypefn
-@c pexecute.txh:284
+@c pexecute.txh:286
@deftypefn Extension int pexecute (const char *@var{program}, char * const *@var{argv}, const char *@var{this_pname}, const char *@var{temp_base}, char **@var{errmsg_fmt}, char **@var{errmsg_arg}, int @var{flags})
This is the old interface to execute one or more programs. It is
@@ -986,7 +988,7 @@ documented.
@end deftypefn
-@c strsignal.c:539
+@c strsignal.c:541
@deftypefn Supplemental void psignal (int @var{signo}, char *@var{message})
Print @var{message} to the standard error, followed by a colon,
@@ -1005,7 +1007,7 @@ name is unset/removed.
@end deftypefn
-@c pexecute.txh:292
+@c pexecute.txh:294
@deftypefn Extension int pwait (int @var{pid}, int *@var{status}, int @var{flags})
Another part of the old execution interface.
@@ -1256,7 +1258,7 @@ call to @code{strsignal}.
@end deftypefn
-@c strsignal.c:446
+@c strsignal.c:448
@deftypefn Extension {const char*} strsigno (int @var{signo})
Given an signal number, returns a pointer to a string containing the
@@ -1322,7 +1324,7 @@ that the converted value is unsigned.
@end deftypefn
-@c strsignal.c:500
+@c strsignal.c:502
@deftypefn Extension int strtosigno (const char *@var{name})
Given the symbolic name of a signal, map it to a signal number. If no
diff --git a/libiberty/maint-tool b/libiberty/maint-tool
index a460b5570e5..e6e87070d37 100644
--- a/libiberty/maint-tool
+++ b/libiberty/maint-tool
@@ -226,6 +226,7 @@ sub deps {
$mine{$f} = "\$(INCDIR)/$f";
$deps{$f} = join(' ', &deps_for("$incdir/$f"));
}
+ $mine{'config.h'} = "config.h";
opendir(INC, $srcdir);
while ($f = readdir INC) {
@@ -233,8 +234,7 @@ sub deps {
$mine{$f} = "\$(srcdir)/$f";
$deps{$f} = join(' ', &deps_for("$srcdir/$f"));
}
-
- $mine{'config.h'} = "stamp-h";
+ $mine{'config.h'} = "config.h";
open(IN, "$srcdir/Makefile.in");
open(OUT, ">$srcdir/Makefile.tmp");
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 4fa789a4d6d..ec3292ff1ce 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,561 @@
+2008-08-29 Mark Mitchell <mark@codesourcery.com>
+
+ * testsuite/25_algorithms/nth_element/2.cc: Constrain iterations
+ when testing on a simultor.
+
+2008-08-28 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * testsuite/tr1/6_containers/unordered_set/requirements/typedef.cc:
+ Rename to .../typedefs.cc.
+ * testsuite/tr1/6_containers/unordered_map/requirements/typedef.cc:
+ Likewise.
+ * testsuite/tr1/6_containers/unordered_multiset/requirements/
+ typedef.cc: Likewise.
+ * testsuite/tr1/6_containers/unordered_multimap/requirements/
+ typedef.cc: Likewise.
+ * testsuite/23_containers/unordered_set/requirements/typedef.cc:
+ Likewise.
+ * testsuite/23_containers/unordered_map/requirements/typedef.cc:
+ Likewise.
+ * testsuite/23_containers/unordered_multiset/requirements/typedef.cc:
+ Likewise.
+ * testsuite/23_containers/unordered_multimap/requirements/typedef.cc:
+ Likewise.
+
+2008-08-28 Chris Fairles <chris.fairles@gmail.com>
+
+ * acinclude.m4 ([GLIBCXX_CHECK_GTHREADS]): New. Checks for gthread
+ support used by c++0x thread library.
+ * configure.ac: Test unconditionally.
+ * configure: Regenerate.
+ * config.h.in: Regenerate.
+
+2008-08-27 Benjamin Kosnik <bkoz@redhat.com>
+
+ * doc/Makefile.am: Edit xml file list.
+ * doc/Makefile.in: Regenerate.
+ * configure: Regenerate.
+ * doc/xml/manual/intro.xml: Edit, correct links, structure.
+ * doc/xml/manual/configure.xml: Same.
+ * doc/xml/manual/debug.xml: Same.
+ * doc/xml/manual/test.xml: Same.
+ * doc/xml/manual/build.xml: Remove.
+ * doc/xml/manual/prerequisites.xml: Add.
+ * doc/html/*: Regenerate.
+
+2008-08-27 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/tr1_impl/hashtable (_Hashtable<>): Add missing pointer and
+ const_pointer typedefs.
+ * testsuite/tr1/6_containers/unordered_set/requirements/typedef.cc:
+ Add.
+ * testsuite/tr1/6_containers/unordered_map/requirements/typedef.cc:
+ Likewise.
+ * testsuite/tr1/6_containers/unordered_multiset/requirements/
+ typedef.cc: Likewise.
+ * testsuite/tr1/6_containers/unordered_multimap/requirements/
+ typedef.cc: Likewise.
+ * testsuite/23_containers/unordered_set/requirements/typedef.cc:
+ Likewise.
+ * testsuite/23_containers/unordered_map/requirements/typedef.cc:
+ Likewise.
+ * testsuite/23_containers/unordered_multiset/requirements/typedef.cc:
+ Likewise.
+ * testsuite/23_containers/unordered_multimap/requirements/typedef.cc:
+ Likewise.
+
+2008-08-27 Paul Brook <paul@codesourcery.com>
+
+ * libsupc++/eh_call.cc (__cxa_call_unexpected): Fix name of
+ __get_object_from_ambiguous_exception.
+
+2008-08-26 Ben Elliston <bje@au.ibm.com>
+
+ * src/mt_allocator.cc (__pool): Fix error in comment.
+
+2008-08-25 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * linkage.m4 ([GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1],
+ [GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT]): Remove
+ * configure.ac: Do not call the latter.
+ * crossconfig.m4: Likewise.
+ * libmath/mathconf.h: Adjust.
+ * configure: Regenerate.
+ * config.h.in: Likewise.
+
+2008-08-24 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * acinclude.m4 ([GLIBCXX_CHECK_RANDOM_TR1]): Simplify, just use
+ two test -r instead of an AC_TRY_RUN.
+ * configure: Regenerate.
+ * config.h.in: Likewise.
+
+2008-08-24 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * acinclude.m4 ([GLIBCXX_ENABLE_CLOCK_GETTIME]): Improve documentation.
+ * doc/xml/manual/configure.xml: Likewise.
+
+2008-08-23 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * acinclude.m4 ([GLIBCXX_ENABLE_CLOCK_GETTIME]): Use [=KIND] in
+ GLIBCXX_ENABLE.
+ * configure: Regenerate.
+
+2008-08-23 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * acinclude.m4 ([GLIBCXX_CHECK_GETTIMEOFDAY]): Change to use
+ GCC_TRY_COMPILE_OR_LINK.
+ ([GLIBCXX_CHECK_CLOCK_GETTIME]): Rename to
+ [GLIBCXX_ENABLE_CLOCK_GETTIME], a versatile configure-time option,
+ [no] by default, since it includes TRY_LINK checks. librt is also
+ searched, if requested.
+ * doc/xml/manual/configure.xml: Document the latter.
+ * configure.ac: Move the above checks outside native-only.
+ * configure: Regenerate.
+
+2008-08-23 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * testsuite/lib/libstdc++.exp (check_v3_target_atomic_builtins): Add.
+ * testsuite/lib/dg-options.exp (dg-require-atomic-builtins): Likewise.
+ * testsuite/18_support/exception_ptr/current_exception.cc: Use it.
+ * testsuite/18_support/exception_ptr/rethrow_exception.cc: Likewise.
+ * testsuite/18_support/exception_ptr/lifespan.cc: Likewise.
+
+2008-08-23 Sebastian Redl <sebastian.redl@getdesigned.at>
+
+ Add (again) exception propagation support as per N2179. Feature is
+ available only when _GLIBCXX_ATOMIC_BUILTINS_4 is defined.
+ * 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-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.
+ * include/debug/multiset.h: Likewise.
+ * include/debug/safe_association.h: Likewise.
+ * include/debug/vector: Likewise.
+ * include/debug/map.h: Likewise.
+ * include/debug/string: Likewise.
+ * include/debug/multimap.h: Likewise.
+ * include/bits/stl_list.h: Likewise.
+ * include/bits/stl_map.h: Likewise.
+ * include/bits/stl_set.h: Likewise.
+ * include/bits/stl_multimap.h: Likewise.
+ * include/bits/stl_vector.h: Likewise.
+ * include/bits/stl_multiset.h: Likewise.
+ * include/bits/stl_bvector.h: Likewise.
+
+2008-07-29 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/std/utility: Include <initializer_list>, per the current WP.
+
+ * testsuite/lib/libstdc++.exp (check_v3_target_cstdint): Tweak,
+ don't use -std=gnu++0x unnecessarily.
+ * testsuite/18_support/numeric_limits/char16_32_t.cc: Use
+ dg-require-cstdint.
+ * testsuite/18_support/headers/cstdint/types_std_c++0x.cc: Likewise.
+ * testsuite/tr1/8_c_compatibility/cstdint/types_std_tr1.cc: Likewise.
+
+2008-07-28 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/36949
+ * include/tr1_impl/boost_shared_ptr.h
+ (__shared_ptr(_Sp_make_shared_tag, _Alloc, _Args&&...): Call
+ __enable_shared_from_this_helper.
+ * testsuite/20_util/shared_ptr/creation/36949.cc: New.
+
+2008-07-24 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR libstdc++/36924
+ Revert:
+ 2008-07-23 Chris Fairles <chris.fairles@gmail.com>
+
+ * acinclude.m4 ([GLIBCXX_CHECK_CLOCK_GETTIME]): Define GLIBCXX_LIBS.
+ Holds the lib that defines clock_gettime (-lrt or -lposix4).
+ * src/Makefile.am: Use it.
+ * 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-23 Chris Fairles <chris.fairles@gmail.com>
+
+ * include/std/condition_variable: Update to N2691 WD.
+ * include/std/mutex: Likewise.
+ * testsuite/30_threads/mutex/cons/assign_neg.cc: Adjust line numbers.
+ * testsuite/30_threads/mutex/cons/copy_neg.cc: Likewise.
+ * testsuite/30_threads/recursive_mutex/cons/assign_neg.cc: Likewise.
+ * testsuite/30_threads/recursive_mutex/cons/copy_neg.cc: Likewise.
+
+2008-07-23 Chris Fairles <chris.fairles@gmail.com>
+
+ * acinclude.m4 ([GLIBCXX_CHECK_CLOCK_GETTIME]): Define GLIBCXX_LIBS.
+ Holds the lib that defines clock_gettime (-lrt or -lposix4).
+ * src/Makefile.am: Use it.
+ * 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-22 Paolo Carlini <paolo.carlini@oracle.com>
* include/ext/sso_string_base.h
@@ -65,10 +623,10 @@
Update error lineno.
* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
Update error lineno.
- * testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc:
- Update error lineno.
- * testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc:
- Update error lineno.
+ * testsuite/23_containers/vector/requirements/dr438/
+ constructor_1_neg.cc: Update error lineno.
+ * testsuite/23_containers/vector/requirements/dr438/
+ constructor_2_neg.cc: Update error lineno.
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
Update error lineno.
* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
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..052515b2156 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>
@@ -1009,68 +1074,107 @@ AC_DEFUN([GLIBCXX_ENABLE_C99], [
dnl
-dnl Check for IEEE Std 1003.1-2001 clock_gettime required for
-dnl 20.8.5 [time.clock] in the current C++0X working draft.
+dnl Check for clock_gettime clocks, used in the implementation of 20.8.5
+dnl [time.clock] in the current C++0x working draft.
dnl
-AC_DEFUN([GLIBCXX_CHECK_CLOCK_GETTIME], [
+dnl --enable-clock-gettime
+dnl --enable-clock-gettime=yes
+dnl checks for the availability of monotonic and realtime clocks
+dnl in libc and libposix4 and in case links the latter
+dnl --enable-clock-gettime=rt
+dnl also searches (and, in case, links) librt. Note that this is
+dnl not always desirable because, in glibc, for example, in turn it
+dnl triggers the linking of libpthread too, which activates locking,
+dnl a large overhead for single-thread programs.
+dnl --enable-clock-gettime=no
+dnl --disable-clock-gettime
+dnl disables the checks completely
+dnl
+AC_DEFUN([GLIBCXX_ENABLE_CLOCK_GETTIME], [
+
+ AC_MSG_CHECKING([for clock_gettime clocks])
+ GLIBCXX_ENABLE(clock-gettime,$1,[=KIND],
+ [use KIND for check type],
+ [permit yes|no|rt])
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -fno-exceptions"
-
- AC_CHECK_HEADERS(unistd.h, ac_has_unistd_h=yes, ac_has_unistd_h=no)
-
+ ac_save_LIBS="$LIBS"
+
ac_has_clock_monotonic=no;
- ac_has_clock_realtime=no;
- if test x"$ac_has_unistd_h" = x"yes"; then
- AC_MSG_CHECKING([for monotonic clock])
- AC_TRY_LINK(
- [#include <unistd.h>
- #include <time.h>
- ],
- [#if _POSIX_TIMERS > 0 && defined(_POSIX_MONOTONIC_CLOCK)
- timespec tp;
- #endif
- clock_gettime(CLOCK_MONOTONIC, &tp);
- ], [ac_has_clock_monotonic=yes], [ac_has_clock_monotonic=no])
-
- AC_MSG_RESULT($ac_has_clock_monotonic)
-
- AC_MSG_CHECKING([for realtime clock])
- AC_TRY_LINK(
- [#include <unistd.h>
- #include <time.h>
- ],
- [#if _POSIX_TIMERS > 0
- timespec tp;
- #endif
- clock_gettime(CLOCK_REALTIME, &tp);
- ], [ac_has_clock_realtime=yes], [ac_has_clock_realtime=no])
+ ac_has_clock_realtime=no;
+
+ if test x"$enable_clock_gettime" != x"no"; then
+
+ if test x"$enable_clock_gettime" = x"rt"; then
+ AC_SEARCH_LIBS(clock_gettime, [rt posix4])
+ else
+ AC_SEARCH_LIBS(clock_gettime, [posix4])
+ fi
+
+ case "$ac_cv_search_clock_gettime" in
+ -l*) GLIBCXX_LIBS=$ac_cv_search_clock_gettime
+ esac
+
+ AC_CHECK_HEADERS(unistd.h, ac_has_unistd_h=yes, ac_has_unistd_h=no)
+
+ if test x"$ac_has_unistd_h" = x"yes"; then
+ AC_MSG_CHECKING([for monotonic clock])
+ AC_TRY_LINK(
+ [#include <unistd.h>
+ #include <time.h>
+ ],
+ [#if _POSIX_TIMERS > 0 && defined(_POSIX_MONOTONIC_CLOCK)
+ timespec tp;
+ #endif
+ clock_gettime(CLOCK_MONOTONIC, &tp);
+ ], [ac_has_clock_monotonic=yes], [ac_has_clock_monotonic=no])
+
+ AC_MSG_RESULT($ac_has_clock_monotonic)
- AC_MSG_RESULT($ac_has_clock_realtime)
- fi
-
+ AC_MSG_CHECKING([for realtime clock])
+ AC_TRY_LINK(
+ [#include <unistd.h>
+ #include <time.h>
+ ],
+ [#if _POSIX_TIMERS > 0
+ timespec tp;
+ #endif
+ clock_gettime(CLOCK_REALTIME, &tp);
+ ], [ac_has_clock_realtime=yes], [ac_has_clock_realtime=no])
+
+ AC_MSG_RESULT($ac_has_clock_realtime)
+ fi
+
+ fi
+
if test x"$ac_has_clock_monotonic" = x"yes"; then
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
])
dnl
-dnl Check for IEEE Std 1003.1-2001 gettimeofday required for
-dnl 20.8.5 [time.clock] in the current C++0X working draft.
+dnl Check for gettimeofday, used in the implementation of 20.8.5
+dnl [time.clock] in the current C++0x working draft.
dnl
AC_DEFUN([GLIBCXX_CHECK_GETTIMEOFDAY], [
+ AC_MSG_CHECKING([for gettimeofday])
+
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
ac_save_CXXFLAGS="$CXXFLAGS"
@@ -1080,7 +1184,7 @@ AC_DEFUN([GLIBCXX_CHECK_GETTIMEOFDAY], [
AC_CHECK_HEADERS(sys/time.h, ac_has_sys_time_h=yes, ac_has_sys_time_h=no)
if test x"$ac_has_sys_time_h" = x"yes"; then
AC_MSG_CHECKING([for gettimeofday])
- AC_TRY_LINK([#include <sys/time.h>],
+ GCC_TRY_COMPILE_OR_LINK([#include <sys/time.h>],
[timeval tv; gettimeofday(&tv, 0);],
[ac_has_gettimeofday=yes], [ac_has_gettimeofday=no])
@@ -1155,7 +1259,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 +1302,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
@@ -1385,33 +1549,53 @@ AC_DEFUN([GLIBCXX_CHECK_C99_TR1], [
])
dnl
-dnl Check whether "dev/random" and "dev/urandom" are available for the
+dnl Check whether "/dev/random" and "/dev/urandom" are available for the
dnl random_device of "TR1" (Chapter 5.1, "Random number generation").
dnl
AC_DEFUN([GLIBCXX_CHECK_RANDOM_TR1], [
- AC_MSG_CHECKING([for "dev/random" and "dev/urandom" for TR1 random_device])
+ AC_MSG_CHECKING([for "/dev/random" and "/dev/urandom" for TR1 random_device])
AC_CACHE_VAL(glibcxx_cv_random_tr1, [
- AC_TRY_RUN([#include <stdio.h>
- int main()
- {
- return !(fopen("/dev/random", "r")
- && fopen("/dev/urandom", "r"));
- }
- ],
- [glibcxx_cv_random_tr1=yes], [glibcxx_cv_random_tr1=no],
- [glibcxx_cv_random_tr1=no])
+ if test -r /dev/random && test -r /dev/urandom; then
+ glibcxx_cv_random_tr1=yes;
+ else
+ glibcxx_cv_random_tr1=no;
+ fi
])
AC_MSG_RESULT($glibcxx_cv_random_tr1)
+
if test x"$glibcxx_cv_random_tr1" = x"yes"; then
AC_DEFINE(_GLIBCXX_USE_RANDOM_TR1, 1,
- [Define if dev/random and dev/urandom are available for
+ [Define if /dev/random and /dev/urandom are available for
the random_device of TR1 (Chapter 5.1).])
fi
])
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], [
@@ -2632,6 +2816,45 @@ AC_DEFUN([GLIBCXX_ENABLE_THREADS], [
])
+dnl
+dnl Check if gthread implementation defines the types and functions
+dnl required by the c++0x thread library. Conforming gthread
+dnl implementations can define __GTHREADS_CXX0X to enable use with c++0x.
+dnl
+AC_DEFUN([GLIBCXX_CHECK_GTHREADS], [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions -I${toplevel_srcdir}/gcc"
+
+ target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'`
+ case $target_thread_file in
+ posix)
+ CXXFLAGS="$CXXFLAGS -DSUPPORTS_WEAK -DGTHREAD_USE_WEAK -D_PTHREADS"
+ esac
+
+ AC_MSG_CHECKING([for gthreads library])
+
+ AC_TRY_COMPILE([#include "gthr.h"],
+ [
+ #ifndef __GTHREADS_CXX0X
+ #error
+ #endif
+ ], [ac_has_gthreads=yes], [ac_has_gthreads=no])
+
+ AC_MSG_RESULT([$ac_has_gthreads])
+
+ if test x"$ac_has_gthreads" = x"yes"; then
+ AC_DEFINE(_GLIBCXX_HAS_GTHREADS, 1,
+ [Define if gthreads library is available.])
+ fi
+
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
+])
+
+
# Check whether LC_MESSAGES is available in <locale.h>.
# Ulrich Drepper <drepper@cygnus.com>, 1995.
#
@@ -2642,7 +2865,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..91e6cb87e0e 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
@@ -634,48 +631,6 @@
/* Define to 1 if you have the `_tanl' function. */
#undef HAVE__TANL
-/* Define if the compiler/host combination has __builtin_abs. */
-#undef HAVE___BUILTIN_ABS
-
-/* Define if the compiler/host combination has __builtin_cos. */
-#undef HAVE___BUILTIN_COS
-
-/* Define if the compiler/host combination has __builtin_cosf. */
-#undef HAVE___BUILTIN_COSF
-
-/* Define if the compiler/host combination has __builtin_cosl. */
-#undef HAVE___BUILTIN_COSL
-
-/* Define if the compiler/host combination has __builtin_fabs. */
-#undef HAVE___BUILTIN_FABS
-
-/* Define if the compiler/host combination has __builtin_fabsf. */
-#undef HAVE___BUILTIN_FABSF
-
-/* Define if the compiler/host combination has __builtin_fabsl. */
-#undef HAVE___BUILTIN_FABSL
-
-/* Define if the compiler/host combination has __builtin_labs. */
-#undef HAVE___BUILTIN_LABS
-
-/* Define if the compiler/host combination has __builtin_sin. */
-#undef HAVE___BUILTIN_SIN
-
-/* Define if the compiler/host combination has __builtin_sinf. */
-#undef HAVE___BUILTIN_SINF
-
-/* Define if the compiler/host combination has __builtin_sinl. */
-#undef HAVE___BUILTIN_SINL
-
-/* Define if the compiler/host combination has __builtin_sqrt. */
-#undef HAVE___BUILTIN_SQRT
-
-/* Define if the compiler/host combination has __builtin_sqrtf. */
-#undef HAVE___BUILTIN_SQRTF
-
-/* Define if the compiler/host combination has __builtin_sqrtl. */
-#undef HAVE___BUILTIN_SQRTL
-
/* Define to 1 if you have the `__signbit' function. */
#undef HAVE___SIGNBIT
@@ -743,6 +698,9 @@
/* Define if a fully dynamic basic_string is wanted. */
#undef _GLIBCXX_FULLY_DYNAMIC_STRING
+/* Define if gthreads library is available. */
+#undef _GLIBCXX_HAS_GTHREADS
+
/* Define to 1 if a full hosted library is built, or 0 if freestanding. */
#undef _GLIBCXX_HOSTED
@@ -761,6 +719,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
@@ -829,8 +790,8 @@
/* Define if NLS translations are to be used. */
#undef _GLIBCXX_USE_NLS
-/* Define if dev/random and dev/urandom are available for the random_device of
- TR1 (Chapter 5.1). */
+/* Define if /dev/random and /dev/urandom are available for the random_device
+ of TR1 (Chapter 5.1). */
#undef _GLIBCXX_USE_RANDOM_TR1
/* Define if standard layout types are supported in C++200x. */
diff --git a/libstdc++-v3/config/abi/pre/gnu.ver b/libstdc++-v3/config/abi/pre/gnu.ver
index 7b31a1cfa47..0ec4879ffd4 100644
--- a/libstdc++-v3/config/abi/pre/gnu.ver
+++ b/libstdc++-v3/config/abi/pre/gnu.ver
@@ -66,7 +66,9 @@ GLIBCXX_3.4 {
# std::condition_variable;
std::co[^n]*;
std::c[p-s]*;
- std::c[u-z]*;
+ std::cu[^r]*;
+# std::current_exception
+ std::c[v-z]*;
# std::[d-g]*;
std::d[a-d]*;
std::d[f-z]*;
@@ -112,10 +114,13 @@ GLIBCXX_3.4 {
std::n[^au]*;
std::nu[^m]*;
std::num[^e]*;
- std::[p-r]*;
std::ostrstream*;
std::out_of_range*;
std::overflow_error*;
+ std::[p-q]*;
+ std::r[^e]*;
+ std::re[^t]*;
+# std::rethrow_exception
std::set_new_handler*;
std::set_terminate*;
std::set_unexpected*;
@@ -1047,4 +1052,24 @@ CXXABI_1.3.3 {
_ZTIPu8char32_t;
_ZTIPKu8char32_t;
+ # exception_ptr
+ _ZNSt15__exception_ptr13exception_ptrC1Ev;
+ _ZNSt15__exception_ptr13exception_ptrC2Ev;
+ _ZNSt15__exception_ptr13exception_ptrC1ERKS0_;
+ _ZNSt15__exception_ptr13exception_ptrC2ERKS0_;
+ _ZNSt15__exception_ptr13exception_ptrC1EMS0_FvvE;
+ _ZNSt15__exception_ptr13exception_ptrC2EMS0_FvvE;
+ _ZNSt15__exception_ptr13exception_ptrD1Ev;
+ _ZNSt15__exception_ptr13exception_ptrD2Ev;
+ _ZNSt15__exception_ptr13exception_ptraSERKS0_;
+ _ZNKSt15__exception_ptr13exception_ptrcvMS0_FvvEEv;
+ _ZNKSt15__exception_ptr13exception_ptrntEv;
+ _ZNKSt15__exception_ptr13exception_ptr20__cxa_exception_typeEv;
+ _ZNSt15__exception_ptr13exception_ptr4swapERS0_;
+ _ZNSt15__exception_ptreqERKNS_13exception_ptrES2_;
+ _ZNSt15__exception_ptrneERKNS_13exception_ptrES2_;
+
+ _ZSt17current_exceptionv;
+ _ZSt17rethrow_exceptionNSt15__exception_ptr13exception_ptrE;
+
} CXXABI_1.3.2;
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..4287de594d8 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 GLIBCXX_LIBS 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_files=''
ac_pwd=`pwd`
@@ -1052,6 +1052,8 @@ Optional Features:
--enable-fully-dynamic-string
do not put empty strings in per-process static
memory [default=no]
+ --enable-clock-gettime=KIND
+ use KIND for check type [default=no]
--enable-tls Use thread-local storage [default=yes]
--disable-rpath do not hardcode runtime library paths
--enable-linux-futex use the Linux futex system call
@@ -4686,13 +4688,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:4689: $ac_compile\"" >&5)
+ (eval echo "\"\$as_me:4691: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
- (eval echo "\"\$as_me:4692: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval echo "\"\$as_me:4694: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
- (eval echo "\"\$as_me:4695: output\"" >&5)
+ (eval echo "\"\$as_me:4697: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@@ -5736,7 +5738,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 5739 "configure"' > conftest.$ac_ext
+ echo '#line 5741 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -7200,11 +7202,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:7203: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7205: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7207: \$? = $ac_status" >&5
+ echo "$as_me:7209: \$? = $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.
@@ -7522,11 +7524,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:7525: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7527: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7529: \$? = $ac_status" >&5
+ echo "$as_me:7531: \$? = $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.
@@ -7627,11 +7629,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:7630: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7632: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:7634: \$? = $ac_status" >&5
+ echo "$as_me:7636: \$? = $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
@@ -7682,11 +7684,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:7685: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7687: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:7689: \$? = $ac_status" >&5
+ echo "$as_me:7691: \$? = $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
@@ -10534,7 +10536,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10537 "configure"
+#line 10539 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10634,7 +10636,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10637 "configure"
+#line 10639 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12672,11 +12674,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:12675: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12677: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:12679: \$? = $ac_status" >&5
+ echo "$as_me:12681: \$? = $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.
@@ -12771,11 +12773,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:12774: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12776: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:12778: \$? = $ac_status" >&5
+ echo "$as_me:12780: \$? = $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
@@ -12823,11 +12825,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:12826: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:12828: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:12830: \$? = $ac_status" >&5
+ echo "$as_me:12832: \$? = $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
@@ -13872,7 +13874,7 @@ fi;
#
# Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
cat > conftest.$ac_ext << EOF
-#line 13875 "configure"
+#line 13877 "configure"
struct S { ~S(); };
void bar();
void foo()
@@ -14018,7 +14020,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
# unnecessary for a builtins test.
cat > conftest.$ac_ext << EOF
-#line 14021 "configure"
+#line 14023 "configure"
int main()
{
// NB: _Atomic_word not necessarily int.
@@ -14058,7 +14060,7 @@ echo "${ECHO_T}$enable_atomic_builtinsi" >&6
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 14061 "configure"
+#line 14063 "configure"
int main()
{
typedef bool atomic_type;
@@ -14155,7 +14157,7 @@ _ACEOF
-# Checks for compiler support that don't require linking.
+# Checks for compiler support that doesn't require linking.
# All these tests are for C++; save the language and the compiler flags.
# The CXXFLAGS thing is suspicious, but based on similar bits previously
@@ -14349,7 +14351,7 @@ _ACEOF
fi
-# Enable all the variable C++ runtime options that doesn't require linking.
+# Enable all the variable C++ runtime options that don't require linking.
echo "$as_me:$LINENO: checking for underlying I/O to use" >&5
echo $ECHO_N "checking for underlying I/O to use... $ECHO_C" >&6
@@ -17361,7 +17363,7 @@ _ACEOF
fi
-# Checks for operating systems support that don't require linking.
+# Checks for operating systems support that doesn't require linking.
echo "$as_me:$LINENO: checking for EOWNERDEAD" >&5
@@ -18249,31 +18251,3661 @@ 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 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
+
+
+
+
+
+ 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
+
+
+
+# For gettimeofday support.
+
+
+ echo "$as_me:$LINENO: checking for gettimeofday" >&5
+echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
+
+
+
+ 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_has_gettimeofday=no;
+
+for ac_header in sys/time.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_sys_time_h=yes
+else
+ ac_has_sys_time_h=no
+fi
+
+done
+
+ if test x"$ac_has_sys_time_h" = x"yes"; then
+ echo "$as_me:$LINENO: checking for gettimeofday" >&5
+echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
+ 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/time.h>
+int
+main ()
+{
+timeval tv; gettimeofday(&tv, 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
+ ac_has_gettimeofday=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_has_gettimeofday=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/time.h>
+int
+main ()
+{
+timeval tv; gettimeofday(&tv, 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
+ ac_has_gettimeofday=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_has_gettimeofday=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ echo "$as_me:$LINENO: result: $ac_has_gettimeofday" >&5
+echo "${ECHO_T}$ac_has_gettimeofday" >&6
+ fi
+ if test x"$ac_has_gettimeofday" = x"yes"; then
+cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_GETTIMEOFDAY 1
+_ACEOF
+ fi
+ 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 clock_gettime support.
+# NB: The default is [no], because otherwise it requires linking.
+ echo "$as_me:$LINENO: checking for clock_gettime clocks" >&5
+echo $ECHO_N "checking for clock_gettime clocks... $ECHO_C" >&6
+ # Check whether --enable-clock-gettime or --disable-clock-gettime was given.
+if test "${enable_clock_gettime+set}" = set; then
+ enableval="$enable_clock_gettime"
+ case "$enableval" in
+ yes|no|rt) ;;
+ *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clock-gettime" >&5
+echo "$as_me: error: Unknown argument to enable/disable clock-gettime" >&2;}
+ { (exit 1); exit 1; }; } ;;
+ esac
+
+else
+ enable_clock_gettime=no
+fi;
+
+
+
+
+ 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"
-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
+ ac_has_clock_monotonic=no;
+ ac_has_clock_realtime=no;
+
+ if test x"$enable_clock_gettime" != x"no"; then
+
+ if test x"$enable_clock_gettime" = x"rt"; 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
+ 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; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.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 ()
+{
+clock_gettime ();
+ ;
+ 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
+ ac_cv_search_clock_gettime="none required"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_clock_gettime" = no; then
+ for ac_lib in rt 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;}
+ { (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. */
+
+/* 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 ()
+{
+clock_gettime ();
+ ;
+ 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
+ ac_cv_search_clock_gettime="-l$ac_lib"
+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_exeext conftest.$ac_ext
+ done
+fi
+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
+
+ else
+ 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
+ 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; }; }
+fi
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.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 ()
+{
+clock_gettime ();
+ ;
+ 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
+ ac_cv_search_clock_gettime="none required"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+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;}
+ { (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. */
+
+/* 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 ()
+{
+clock_gettime ();
+ ;
+ 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
+ ac_cv_search_clock_gettime="-l$ac_lib"
+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_exeext conftest.$ac_ext
+ done
+fi
+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
+
+ fi
+
+ case "$ac_cv_search_clock_gettime" in
+ -l*) GLIBCXX_LIBS=$ac_cv_search_clock_gettime
+ esac
+
+
+for ac_header in 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_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_unistd_h=yes
+else
+ ac_has_unistd_h=no
+fi
+
+done
+
+
+ if test x"$ac_has_unistd_h" = x"yes"; then
+ echo "$as_me:$LINENO: checking for monotonic clock" >&5
+echo $ECHO_N "checking for monotonic clock... $ECHO_C" >&6
+ 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 <time.h>
+
+int
+main ()
+{
+#if _POSIX_TIMERS > 0 && defined(_POSIX_MONOTONIC_CLOCK)
+ timespec tp;
+ #endif
+ clock_gettime(CLOCK_MONOTONIC, &tp);
+
+ ;
+ 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
+ ac_has_clock_monotonic=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_has_clock_monotonic=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+ echo "$as_me:$LINENO: result: $ac_has_clock_monotonic" >&5
+echo "${ECHO_T}$ac_has_clock_monotonic" >&6
+
+ echo "$as_me:$LINENO: checking for realtime clock" >&5
+echo $ECHO_N "checking for realtime clock... $ECHO_C" >&6
+ 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 <time.h>
+
+int
+main ()
+{
+#if _POSIX_TIMERS > 0
+ timespec tp;
+ #endif
+ clock_gettime(CLOCK_REALTIME, &tp);
+
+ ;
+ 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
+ ac_has_clock_realtime=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_has_clock_realtime=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+
+ echo "$as_me:$LINENO: result: $ac_has_clock_realtime" >&5
+echo "${ECHO_T}$ac_has_clock_realtime" >&6
+ fi
+
+ fi
+
+ if test x"$ac_has_clock_monotonic" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_CLOCK_MONOTONIC 1
+_ACEOF
+
+ fi
+
+ if test x"$ac_has_clock_realtime" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_CLOCK_REALTIME 1
+_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'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# For gthread 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 -I${toplevel_srcdir}/gcc"
+
+ target_thread_file=`$CXX -v 2>&1 | sed -n 's/^Thread model: //p'`
+ case $target_thread_file in
+ posix)
+ CXXFLAGS="$CXXFLAGS -DSUPPORTS_WEAK -DGTHREAD_USE_WEAK -D_PTHREADS"
+ esac
+
+ echo "$as_me:$LINENO: checking for gthreads library" >&5
+echo $ECHO_N "checking for gthreads library... $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 "gthr.h"
+int
+main ()
+{
+
+ #ifndef __GTHREADS_CXX0X
+ #error
+ #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_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_has_gthreads=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_has_gthreads=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ echo "$as_me:$LINENO: result: $ac_has_gthreads" >&5
+echo "${ECHO_T}$ac_has_gthreads" >&6
+
+ if test x"$ac_has_gthreads" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_HAS_GTHREADS 1
+_ACEOF
+
+ fi
+
+ 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
+
+
+
+
+ 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
@@ -18423,6 +22055,12 @@ 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.
@@ -36091,2097 +39729,6 @@ done
- echo "$as_me:$LINENO: checking for __builtin_abs declaration" >&5
-echo $ECHO_N "checking for __builtin_abs declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_abs_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_abs_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_abs(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_func___builtin_abs_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_abs_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_abs_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_abs_use" >&6
- if test x$glibcxx_cv_func___builtin_abs_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_abs linkage" >&5
-echo $ECHO_N "checking for __builtin_abs linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_abs_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_abs_link+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 <math.h>
-int
-main ()
-{
- __builtin_abs(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_func___builtin_abs_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_abs_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_abs_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_abs_link" >&6
-
- if test x$glibcxx_cv_func___builtin_abs_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_ABS 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_fabsf declaration" >&5
-echo $ECHO_N "checking for __builtin_fabsf declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabsf_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabsf_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_fabsf(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_func___builtin_fabsf_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabsf_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsf_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsf_use" >&6
- if test x$glibcxx_cv_func___builtin_fabsf_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_fabsf linkage" >&5
-echo $ECHO_N "checking for __builtin_fabsf linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabsf_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabsf_link+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 <math.h>
-int
-main ()
-{
- __builtin_fabsf(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_func___builtin_fabsf_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabsf_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsf_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsf_link" >&6
-
- if test x$glibcxx_cv_func___builtin_fabsf_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_FABSF 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_fabs declaration" >&5
-echo $ECHO_N "checking for __builtin_fabs declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabs_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabs_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_fabs(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_func___builtin_fabs_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabs_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabs_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabs_use" >&6
- if test x$glibcxx_cv_func___builtin_fabs_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_fabs linkage" >&5
-echo $ECHO_N "checking for __builtin_fabs linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabs_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabs_link+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 <math.h>
-int
-main ()
-{
- __builtin_fabs(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_func___builtin_fabs_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabs_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabs_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabs_link" >&6
-
- if test x$glibcxx_cv_func___builtin_fabs_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_FABS 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_fabsl declaration" >&5
-echo $ECHO_N "checking for __builtin_fabsl declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabsl_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabsl_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_fabsl(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_func___builtin_fabsl_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabsl_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsl_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsl_use" >&6
- if test x$glibcxx_cv_func___builtin_fabsl_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_fabsl linkage" >&5
-echo $ECHO_N "checking for __builtin_fabsl linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabsl_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabsl_link+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 <math.h>
-int
-main ()
-{
- __builtin_fabsl(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_func___builtin_fabsl_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabsl_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsl_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsl_link" >&6
-
- if test x$glibcxx_cv_func___builtin_fabsl_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_FABSL 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_labs declaration" >&5
-echo $ECHO_N "checking for __builtin_labs declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_labs_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_labs_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_labs(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_func___builtin_labs_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_labs_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_labs_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_labs_use" >&6
- if test x$glibcxx_cv_func___builtin_labs_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_labs linkage" >&5
-echo $ECHO_N "checking for __builtin_labs linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_labs_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_labs_link+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 <math.h>
-int
-main ()
-{
- __builtin_labs(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_func___builtin_labs_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_labs_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_labs_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_labs_link" >&6
-
- if test x$glibcxx_cv_func___builtin_labs_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_LABS 1
-_ACEOF
-
- fi
-
- fi
-
-
-
- echo "$as_me:$LINENO: checking for __builtin_sqrtf declaration" >&5
-echo $ECHO_N "checking for __builtin_sqrtf declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrtf_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrtf_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sqrtf(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_func___builtin_sqrtf_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrtf_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtf_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtf_use" >&6
- if test x$glibcxx_cv_func___builtin_sqrtf_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sqrtf linkage" >&5
-echo $ECHO_N "checking for __builtin_sqrtf linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrtf_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrtf_link+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 <math.h>
-int
-main ()
-{
- __builtin_sqrtf(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_func___builtin_sqrtf_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrtf_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtf_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtf_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sqrtf_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SQRTF 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_sqrt declaration" >&5
-echo $ECHO_N "checking for __builtin_sqrt declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrt_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrt_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sqrt(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_func___builtin_sqrt_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrt_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrt_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrt_use" >&6
- if test x$glibcxx_cv_func___builtin_sqrt_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sqrt linkage" >&5
-echo $ECHO_N "checking for __builtin_sqrt linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrt_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrt_link+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 <math.h>
-int
-main ()
-{
- __builtin_sqrt(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_func___builtin_sqrt_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrt_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrt_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrt_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sqrt_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SQRT 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_sqrtl declaration" >&5
-echo $ECHO_N "checking for __builtin_sqrtl declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrtl_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrtl_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sqrtl(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_func___builtin_sqrtl_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrtl_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtl_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtl_use" >&6
- if test x$glibcxx_cv_func___builtin_sqrtl_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sqrtl linkage" >&5
-echo $ECHO_N "checking for __builtin_sqrtl linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrtl_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrtl_link+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 <math.h>
-int
-main ()
-{
- __builtin_sqrtl(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_func___builtin_sqrtl_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrtl_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtl_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtl_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sqrtl_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SQRTL 1
-_ACEOF
-
- fi
-
- fi
-
-
-
- echo "$as_me:$LINENO: checking for __builtin_sinf declaration" >&5
-echo $ECHO_N "checking for __builtin_sinf declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sinf_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sinf_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sinf(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_func___builtin_sinf_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sinf_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinf_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sinf_use" >&6
- if test x$glibcxx_cv_func___builtin_sinf_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sinf linkage" >&5
-echo $ECHO_N "checking for __builtin_sinf linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sinf_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sinf_link+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 <math.h>
-int
-main ()
-{
- __builtin_sinf(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_func___builtin_sinf_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sinf_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinf_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sinf_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sinf_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SINF 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_sin declaration" >&5
-echo $ECHO_N "checking for __builtin_sin declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sin_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sin_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sin(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_func___builtin_sin_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sin_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sin_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sin_use" >&6
- if test x$glibcxx_cv_func___builtin_sin_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sin linkage" >&5
-echo $ECHO_N "checking for __builtin_sin linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sin_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sin_link+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 <math.h>
-int
-main ()
-{
- __builtin_sin(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_func___builtin_sin_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sin_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sin_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sin_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sin_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SIN 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_sinl declaration" >&5
-echo $ECHO_N "checking for __builtin_sinl declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sinl_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sinl_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sinl(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_func___builtin_sinl_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sinl_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinl_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sinl_use" >&6
- if test x$glibcxx_cv_func___builtin_sinl_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sinl linkage" >&5
-echo $ECHO_N "checking for __builtin_sinl linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sinl_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sinl_link+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 <math.h>
-int
-main ()
-{
- __builtin_sinl(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_func___builtin_sinl_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sinl_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinl_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sinl_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sinl_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SINL 1
-_ACEOF
-
- fi
-
- fi
-
-
-
- echo "$as_me:$LINENO: checking for __builtin_cosf declaration" >&5
-echo $ECHO_N "checking for __builtin_cosf declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cosf_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cosf_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_cosf(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_func___builtin_cosf_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cosf_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosf_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cosf_use" >&6
- if test x$glibcxx_cv_func___builtin_cosf_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_cosf linkage" >&5
-echo $ECHO_N "checking for __builtin_cosf linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cosf_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cosf_link+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 <math.h>
-int
-main ()
-{
- __builtin_cosf(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_func___builtin_cosf_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cosf_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosf_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cosf_link" >&6
-
- if test x$glibcxx_cv_func___builtin_cosf_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_COSF 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_cos declaration" >&5
-echo $ECHO_N "checking for __builtin_cos declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cos_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cos_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_cos(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_func___builtin_cos_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cos_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cos_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cos_use" >&6
- if test x$glibcxx_cv_func___builtin_cos_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_cos linkage" >&5
-echo $ECHO_N "checking for __builtin_cos linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cos_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cos_link+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 <math.h>
-int
-main ()
-{
- __builtin_cos(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_func___builtin_cos_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cos_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cos_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cos_link" >&6
-
- if test x$glibcxx_cv_func___builtin_cos_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_COS 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_cosl declaration" >&5
-echo $ECHO_N "checking for __builtin_cosl declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cosl_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cosl_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_cosl(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_func___builtin_cosl_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cosl_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosl_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cosl_use" >&6
- if test x$glibcxx_cv_func___builtin_cosl_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_cosl linkage" >&5
-echo $ECHO_N "checking for __builtin_cosl linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cosl_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cosl_link+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 <math.h>
-int
-main ()
-{
- __builtin_cosl(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_func___builtin_cosl_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cosl_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosl_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cosl_link" >&6
-
- if test x$glibcxx_cv_func___builtin_cosl_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_COSL 1
-_ACEOF
-
- fi
-
- fi
-
-
-
-
echo "$as_me:$LINENO: checking for main in -lm" >&5
echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
if test "${ac_cv_lib_m_main+set}" = set; then
@@ -39083,1860 +40630,26 @@ 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
-
-
- # 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 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 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.
- # 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
+ 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
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
+ if test -r /dev/random && test -r /dev/urandom; then
+ glibcxx_cv_random_tr1=yes;
+ else
+ glibcxx_cv_random_tr1=no;
+ fi
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
@@ -40947,571 +40660,6 @@ _ACEOF
- # 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"
-
-
-for ac_header in 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_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_unistd_h=yes
-else
- ac_has_unistd_h=no
-fi
-
-done
-
-
- ac_has_clock_monotonic=no;
- ac_has_clock_realtime=no;
- if test x"$ac_has_unistd_h" = x"yes"; then
- echo "$as_me:$LINENO: checking for monotonic clock" >&5
-echo $ECHO_N "checking for monotonic clock... $ECHO_C" >&6
- 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 <time.h>
-
-int
-main ()
-{
-#if _POSIX_TIMERS > 0 && defined(_POSIX_MONOTONIC_CLOCK)
- timespec tp;
- #endif
- clock_gettime(CLOCK_MONOTONIC, &tp);
-
- ;
- 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
- ac_has_clock_monotonic=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_has_clock_monotonic=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
- echo "$as_me:$LINENO: result: $ac_has_clock_monotonic" >&5
-echo "${ECHO_T}$ac_has_clock_monotonic" >&6
-
- echo "$as_me:$LINENO: checking for realtime clock" >&5
-echo $ECHO_N "checking for realtime clock... $ECHO_C" >&6
- 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 <time.h>
-
-int
-main ()
-{
-#if _POSIX_TIMERS > 0
- timespec tp;
- #endif
- clock_gettime(CLOCK_REALTIME, &tp);
-
- ;
- 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
- ac_has_clock_realtime=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_has_clock_realtime=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
- echo "$as_me:$LINENO: result: $ac_has_clock_realtime" >&5
-echo "${ECHO_T}$ac_has_clock_realtime" >&6
- fi
-
- if test x"$ac_has_clock_monotonic" = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_CLOCK_MONOTONIC 1
-_ACEOF
-
- fi
-
- if test x"$ac_has_clock_realtime" = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_CLOCK_REALTIME 1
-_ACEOF
-
- fi
-
- 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 gettimeofday 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"
-
- ac_has_gettimeofday=no;
-
-for ac_header in sys/time.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_sys_time_h=yes
-else
- ac_has_sys_time_h=no
-fi
-
-done
-
- if test x"$ac_has_sys_time_h" = x"yes"; then
- echo "$as_me:$LINENO: checking for gettimeofday" >&5
-echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6
- 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/time.h>
-int
-main ()
-{
-timeval tv; gettimeofday(&tv, 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
- ac_has_gettimeofday=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_has_gettimeofday=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
- echo "$as_me:$LINENO: result: $ac_has_gettimeofday" >&5
-echo "${ECHO_T}$ac_has_gettimeofday" >&6
- fi
-
- if test x"$ac_has_gettimeofday" = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define _GLIBCXX_USE_GETTIMEOFDAY 1
-_ACEOF
-
- fi
-
- 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 TLS support.
# Check whether --enable-tls or --disable-tls was given.
@@ -41907,711 +41055,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
@@ -43438,7 +41881,6 @@ else
fi
# Construct crosses by hand, eliminating bits that need ld...
- # GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
# GLIBCXX_CHECK_MATH_SUPPORT
# First, test for "known" system libraries. We may be using newlib even
@@ -43455,11 +41897,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 +41996,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 +42009,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'
@@ -61398,2097 +59659,6 @@ done
- echo "$as_me:$LINENO: checking for __builtin_abs declaration" >&5
-echo $ECHO_N "checking for __builtin_abs declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_abs_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_abs_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_abs(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_func___builtin_abs_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_abs_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_abs_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_abs_use" >&6
- if test x$glibcxx_cv_func___builtin_abs_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_abs linkage" >&5
-echo $ECHO_N "checking for __builtin_abs linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_abs_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_abs_link+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 <math.h>
-int
-main ()
-{
- __builtin_abs(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_func___builtin_abs_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_abs_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_abs_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_abs_link" >&6
-
- if test x$glibcxx_cv_func___builtin_abs_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_ABS 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_fabsf declaration" >&5
-echo $ECHO_N "checking for __builtin_fabsf declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabsf_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabsf_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_fabsf(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_func___builtin_fabsf_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabsf_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsf_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsf_use" >&6
- if test x$glibcxx_cv_func___builtin_fabsf_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_fabsf linkage" >&5
-echo $ECHO_N "checking for __builtin_fabsf linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabsf_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabsf_link+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 <math.h>
-int
-main ()
-{
- __builtin_fabsf(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_func___builtin_fabsf_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabsf_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsf_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsf_link" >&6
-
- if test x$glibcxx_cv_func___builtin_fabsf_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_FABSF 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_fabs declaration" >&5
-echo $ECHO_N "checking for __builtin_fabs declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabs_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabs_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_fabs(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_func___builtin_fabs_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabs_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabs_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabs_use" >&6
- if test x$glibcxx_cv_func___builtin_fabs_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_fabs linkage" >&5
-echo $ECHO_N "checking for __builtin_fabs linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabs_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabs_link+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 <math.h>
-int
-main ()
-{
- __builtin_fabs(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_func___builtin_fabs_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabs_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabs_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabs_link" >&6
-
- if test x$glibcxx_cv_func___builtin_fabs_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_FABS 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_fabsl declaration" >&5
-echo $ECHO_N "checking for __builtin_fabsl declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabsl_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabsl_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_fabsl(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_func___builtin_fabsl_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabsl_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsl_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsl_use" >&6
- if test x$glibcxx_cv_func___builtin_fabsl_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_fabsl linkage" >&5
-echo $ECHO_N "checking for __builtin_fabsl linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabsl_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabsl_link+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 <math.h>
-int
-main ()
-{
- __builtin_fabsl(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_func___builtin_fabsl_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabsl_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsl_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsl_link" >&6
-
- if test x$glibcxx_cv_func___builtin_fabsl_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_FABSL 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_labs declaration" >&5
-echo $ECHO_N "checking for __builtin_labs declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_labs_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_labs_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_labs(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_func___builtin_labs_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_labs_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_labs_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_labs_use" >&6
- if test x$glibcxx_cv_func___builtin_labs_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_labs linkage" >&5
-echo $ECHO_N "checking for __builtin_labs linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_labs_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_labs_link+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 <math.h>
-int
-main ()
-{
- __builtin_labs(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_func___builtin_labs_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_labs_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_labs_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_labs_link" >&6
-
- if test x$glibcxx_cv_func___builtin_labs_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_LABS 1
-_ACEOF
-
- fi
-
- fi
-
-
-
- echo "$as_me:$LINENO: checking for __builtin_sqrtf declaration" >&5
-echo $ECHO_N "checking for __builtin_sqrtf declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrtf_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrtf_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sqrtf(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_func___builtin_sqrtf_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrtf_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtf_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtf_use" >&6
- if test x$glibcxx_cv_func___builtin_sqrtf_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sqrtf linkage" >&5
-echo $ECHO_N "checking for __builtin_sqrtf linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrtf_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrtf_link+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 <math.h>
-int
-main ()
-{
- __builtin_sqrtf(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_func___builtin_sqrtf_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrtf_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtf_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtf_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sqrtf_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SQRTF 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_sqrt declaration" >&5
-echo $ECHO_N "checking for __builtin_sqrt declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrt_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrt_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sqrt(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_func___builtin_sqrt_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrt_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrt_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrt_use" >&6
- if test x$glibcxx_cv_func___builtin_sqrt_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sqrt linkage" >&5
-echo $ECHO_N "checking for __builtin_sqrt linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrt_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrt_link+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 <math.h>
-int
-main ()
-{
- __builtin_sqrt(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_func___builtin_sqrt_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrt_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrt_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrt_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sqrt_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SQRT 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_sqrtl declaration" >&5
-echo $ECHO_N "checking for __builtin_sqrtl declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrtl_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrtl_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sqrtl(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_func___builtin_sqrtl_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrtl_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtl_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtl_use" >&6
- if test x$glibcxx_cv_func___builtin_sqrtl_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sqrtl linkage" >&5
-echo $ECHO_N "checking for __builtin_sqrtl linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrtl_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrtl_link+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 <math.h>
-int
-main ()
-{
- __builtin_sqrtl(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_func___builtin_sqrtl_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrtl_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtl_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtl_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sqrtl_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SQRTL 1
-_ACEOF
-
- fi
-
- fi
-
-
-
- echo "$as_me:$LINENO: checking for __builtin_sinf declaration" >&5
-echo $ECHO_N "checking for __builtin_sinf declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sinf_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sinf_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sinf(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_func___builtin_sinf_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sinf_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinf_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sinf_use" >&6
- if test x$glibcxx_cv_func___builtin_sinf_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sinf linkage" >&5
-echo $ECHO_N "checking for __builtin_sinf linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sinf_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sinf_link+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 <math.h>
-int
-main ()
-{
- __builtin_sinf(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_func___builtin_sinf_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sinf_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinf_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sinf_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sinf_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SINF 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_sin declaration" >&5
-echo $ECHO_N "checking for __builtin_sin declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sin_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sin_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sin(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_func___builtin_sin_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sin_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sin_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sin_use" >&6
- if test x$glibcxx_cv_func___builtin_sin_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sin linkage" >&5
-echo $ECHO_N "checking for __builtin_sin linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sin_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sin_link+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 <math.h>
-int
-main ()
-{
- __builtin_sin(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_func___builtin_sin_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sin_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sin_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sin_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sin_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SIN 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_sinl declaration" >&5
-echo $ECHO_N "checking for __builtin_sinl declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sinl_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sinl_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sinl(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_func___builtin_sinl_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sinl_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinl_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sinl_use" >&6
- if test x$glibcxx_cv_func___builtin_sinl_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sinl linkage" >&5
-echo $ECHO_N "checking for __builtin_sinl linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sinl_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sinl_link+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 <math.h>
-int
-main ()
-{
- __builtin_sinl(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_func___builtin_sinl_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sinl_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinl_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sinl_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sinl_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SINL 1
-_ACEOF
-
- fi
-
- fi
-
-
-
- echo "$as_me:$LINENO: checking for __builtin_cosf declaration" >&5
-echo $ECHO_N "checking for __builtin_cosf declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cosf_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cosf_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_cosf(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_func___builtin_cosf_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cosf_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosf_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cosf_use" >&6
- if test x$glibcxx_cv_func___builtin_cosf_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_cosf linkage" >&5
-echo $ECHO_N "checking for __builtin_cosf linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cosf_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cosf_link+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 <math.h>
-int
-main ()
-{
- __builtin_cosf(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_func___builtin_cosf_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cosf_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosf_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cosf_link" >&6
-
- if test x$glibcxx_cv_func___builtin_cosf_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_COSF 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_cos declaration" >&5
-echo $ECHO_N "checking for __builtin_cos declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cos_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cos_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_cos(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_func___builtin_cos_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cos_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cos_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cos_use" >&6
- if test x$glibcxx_cv_func___builtin_cos_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_cos linkage" >&5
-echo $ECHO_N "checking for __builtin_cos linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cos_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cos_link+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 <math.h>
-int
-main ()
-{
- __builtin_cos(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_func___builtin_cos_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cos_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cos_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cos_link" >&6
-
- if test x$glibcxx_cv_func___builtin_cos_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_COS 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_cosl declaration" >&5
-echo $ECHO_N "checking for __builtin_cosl declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cosl_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cosl_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_cosl(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_func___builtin_cosl_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cosl_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosl_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cosl_use" >&6
- if test x$glibcxx_cv_func___builtin_cosl_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_cosl linkage" >&5
-echo $ECHO_N "checking for __builtin_cosl linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cosl_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cosl_link+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 <math.h>
-int
-main ()
-{
- __builtin_cosl(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_func___builtin_cosl_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cosl_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosl_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cosl_link" >&6
-
- if test x$glibcxx_cv_func___builtin_cosl_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_COSL 1
-_ACEOF
-
- fi
-
- fi
-
-
-
-
echo "$as_me:$LINENO: checking for main in -lm" >&5
echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
if test "${ac_cv_lib_m_main+set}" = set; then
@@ -64390,164 +60560,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 +60604,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}"
@@ -82143,2097 +77992,6 @@ done
- echo "$as_me:$LINENO: checking for __builtin_abs declaration" >&5
-echo $ECHO_N "checking for __builtin_abs declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_abs_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_abs_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_abs(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_func___builtin_abs_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_abs_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_abs_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_abs_use" >&6
- if test x$glibcxx_cv_func___builtin_abs_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_abs linkage" >&5
-echo $ECHO_N "checking for __builtin_abs linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_abs_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_abs_link+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 <math.h>
-int
-main ()
-{
- __builtin_abs(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_func___builtin_abs_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_abs_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_abs_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_abs_link" >&6
-
- if test x$glibcxx_cv_func___builtin_abs_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_ABS 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_fabsf declaration" >&5
-echo $ECHO_N "checking for __builtin_fabsf declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabsf_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabsf_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_fabsf(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_func___builtin_fabsf_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabsf_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsf_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsf_use" >&6
- if test x$glibcxx_cv_func___builtin_fabsf_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_fabsf linkage" >&5
-echo $ECHO_N "checking for __builtin_fabsf linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabsf_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabsf_link+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 <math.h>
-int
-main ()
-{
- __builtin_fabsf(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_func___builtin_fabsf_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabsf_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsf_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsf_link" >&6
-
- if test x$glibcxx_cv_func___builtin_fabsf_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_FABSF 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_fabs declaration" >&5
-echo $ECHO_N "checking for __builtin_fabs declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabs_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabs_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_fabs(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_func___builtin_fabs_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabs_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabs_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabs_use" >&6
- if test x$glibcxx_cv_func___builtin_fabs_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_fabs linkage" >&5
-echo $ECHO_N "checking for __builtin_fabs linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabs_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabs_link+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 <math.h>
-int
-main ()
-{
- __builtin_fabs(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_func___builtin_fabs_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabs_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabs_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabs_link" >&6
-
- if test x$glibcxx_cv_func___builtin_fabs_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_FABS 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_fabsl declaration" >&5
-echo $ECHO_N "checking for __builtin_fabsl declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabsl_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabsl_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_fabsl(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_func___builtin_fabsl_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabsl_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsl_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsl_use" >&6
- if test x$glibcxx_cv_func___builtin_fabsl_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_fabsl linkage" >&5
-echo $ECHO_N "checking for __builtin_fabsl linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabsl_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabsl_link+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 <math.h>
-int
-main ()
-{
- __builtin_fabsl(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_func___builtin_fabsl_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabsl_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsl_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsl_link" >&6
-
- if test x$glibcxx_cv_func___builtin_fabsl_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_FABSL 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_labs declaration" >&5
-echo $ECHO_N "checking for __builtin_labs declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_labs_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_labs_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_labs(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_func___builtin_labs_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_labs_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_labs_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_labs_use" >&6
- if test x$glibcxx_cv_func___builtin_labs_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_labs linkage" >&5
-echo $ECHO_N "checking for __builtin_labs linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_labs_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_labs_link+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 <math.h>
-int
-main ()
-{
- __builtin_labs(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_func___builtin_labs_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_labs_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_labs_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_labs_link" >&6
-
- if test x$glibcxx_cv_func___builtin_labs_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_LABS 1
-_ACEOF
-
- fi
-
- fi
-
-
-
- echo "$as_me:$LINENO: checking for __builtin_sqrtf declaration" >&5
-echo $ECHO_N "checking for __builtin_sqrtf declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrtf_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrtf_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sqrtf(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_func___builtin_sqrtf_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrtf_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtf_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtf_use" >&6
- if test x$glibcxx_cv_func___builtin_sqrtf_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sqrtf linkage" >&5
-echo $ECHO_N "checking for __builtin_sqrtf linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrtf_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrtf_link+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 <math.h>
-int
-main ()
-{
- __builtin_sqrtf(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_func___builtin_sqrtf_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrtf_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtf_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtf_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sqrtf_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SQRTF 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_sqrt declaration" >&5
-echo $ECHO_N "checking for __builtin_sqrt declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrt_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrt_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sqrt(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_func___builtin_sqrt_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrt_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrt_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrt_use" >&6
- if test x$glibcxx_cv_func___builtin_sqrt_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sqrt linkage" >&5
-echo $ECHO_N "checking for __builtin_sqrt linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrt_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrt_link+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 <math.h>
-int
-main ()
-{
- __builtin_sqrt(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_func___builtin_sqrt_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrt_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrt_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrt_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sqrt_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SQRT 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_sqrtl declaration" >&5
-echo $ECHO_N "checking for __builtin_sqrtl declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrtl_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrtl_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sqrtl(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_func___builtin_sqrtl_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrtl_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtl_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtl_use" >&6
- if test x$glibcxx_cv_func___builtin_sqrtl_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sqrtl linkage" >&5
-echo $ECHO_N "checking for __builtin_sqrtl linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrtl_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrtl_link+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 <math.h>
-int
-main ()
-{
- __builtin_sqrtl(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_func___builtin_sqrtl_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrtl_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtl_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtl_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sqrtl_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SQRTL 1
-_ACEOF
-
- fi
-
- fi
-
-
-
- echo "$as_me:$LINENO: checking for __builtin_sinf declaration" >&5
-echo $ECHO_N "checking for __builtin_sinf declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sinf_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sinf_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sinf(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_func___builtin_sinf_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sinf_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinf_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sinf_use" >&6
- if test x$glibcxx_cv_func___builtin_sinf_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sinf linkage" >&5
-echo $ECHO_N "checking for __builtin_sinf linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sinf_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sinf_link+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 <math.h>
-int
-main ()
-{
- __builtin_sinf(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_func___builtin_sinf_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sinf_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinf_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sinf_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sinf_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SINF 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_sin declaration" >&5
-echo $ECHO_N "checking for __builtin_sin declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sin_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sin_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sin(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_func___builtin_sin_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sin_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sin_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sin_use" >&6
- if test x$glibcxx_cv_func___builtin_sin_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sin linkage" >&5
-echo $ECHO_N "checking for __builtin_sin linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sin_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sin_link+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 <math.h>
-int
-main ()
-{
- __builtin_sin(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_func___builtin_sin_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sin_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sin_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sin_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sin_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SIN 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_sinl declaration" >&5
-echo $ECHO_N "checking for __builtin_sinl declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sinl_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sinl_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sinl(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_func___builtin_sinl_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sinl_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinl_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sinl_use" >&6
- if test x$glibcxx_cv_func___builtin_sinl_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sinl linkage" >&5
-echo $ECHO_N "checking for __builtin_sinl linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sinl_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sinl_link+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 <math.h>
-int
-main ()
-{
- __builtin_sinl(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_func___builtin_sinl_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sinl_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinl_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sinl_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sinl_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SINL 1
-_ACEOF
-
- fi
-
- fi
-
-
-
- echo "$as_me:$LINENO: checking for __builtin_cosf declaration" >&5
-echo $ECHO_N "checking for __builtin_cosf declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cosf_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cosf_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_cosf(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_func___builtin_cosf_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cosf_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosf_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cosf_use" >&6
- if test x$glibcxx_cv_func___builtin_cosf_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_cosf linkage" >&5
-echo $ECHO_N "checking for __builtin_cosf linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cosf_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cosf_link+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 <math.h>
-int
-main ()
-{
- __builtin_cosf(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_func___builtin_cosf_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cosf_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosf_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cosf_link" >&6
-
- if test x$glibcxx_cv_func___builtin_cosf_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_COSF 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_cos declaration" >&5
-echo $ECHO_N "checking for __builtin_cos declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cos_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cos_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_cos(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_func___builtin_cos_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cos_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cos_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cos_use" >&6
- if test x$glibcxx_cv_func___builtin_cos_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_cos linkage" >&5
-echo $ECHO_N "checking for __builtin_cos linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cos_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cos_link+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 <math.h>
-int
-main ()
-{
- __builtin_cos(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_func___builtin_cos_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cos_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cos_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cos_link" >&6
-
- if test x$glibcxx_cv_func___builtin_cos_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_COS 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_cosl declaration" >&5
-echo $ECHO_N "checking for __builtin_cosl declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cosl_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cosl_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_cosl(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_func___builtin_cosl_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cosl_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosl_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cosl_use" >&6
- if test x$glibcxx_cv_func___builtin_cosl_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_cosl linkage" >&5
-echo $ECHO_N "checking for __builtin_cosl linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cosl_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cosl_link+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 <math.h>
-int
-main ()
-{
- __builtin_cosl(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_func___builtin_cosl_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cosl_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosl_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cosl_link" >&6
-
- if test x$glibcxx_cv_func___builtin_cosl_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_COSL 1
-_ACEOF
-
- fi
-
- fi
-
-
-
-
echo "$as_me:$LINENO: checking for main in -lm" >&5
echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
if test "${ac_cv_lib_m_main+set}" = set; then
@@ -85134,835 +78892,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
@@ -85992,63 +78924,6 @@ _ACEOF
#define HAVE_HYPOT 1
_ACEOF
- # GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_ABS 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_FABSF 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_FABS 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_FABSL 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_LABS 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SQRTF 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SQRT 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SQRTL 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SINF 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SIN 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SINL 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_COSF 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_COS 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_COSL 1
-_ACEOF
-
# GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
# GLIBCXX_CHECK_STDLIB_SUPPORT
cat >>confdefs.h <<\_ACEOF
@@ -86059,190 +78934,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 +79631,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 +79676,6 @@ _ACEOF
cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
#define HAVE_ACOSF 1
_ACEOF
@@ -87109,169 +79787,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 +80526,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'
@@ -105830,2097 +98176,6 @@ done
- echo "$as_me:$LINENO: checking for __builtin_abs declaration" >&5
-echo $ECHO_N "checking for __builtin_abs declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_abs_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_abs_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_abs(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_func___builtin_abs_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_abs_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_abs_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_abs_use" >&6
- if test x$glibcxx_cv_func___builtin_abs_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_abs linkage" >&5
-echo $ECHO_N "checking for __builtin_abs linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_abs_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_abs_link+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 <math.h>
-int
-main ()
-{
- __builtin_abs(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_func___builtin_abs_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_abs_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_abs_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_abs_link" >&6
-
- if test x$glibcxx_cv_func___builtin_abs_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_ABS 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_fabsf declaration" >&5
-echo $ECHO_N "checking for __builtin_fabsf declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabsf_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabsf_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_fabsf(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_func___builtin_fabsf_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabsf_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsf_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsf_use" >&6
- if test x$glibcxx_cv_func___builtin_fabsf_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_fabsf linkage" >&5
-echo $ECHO_N "checking for __builtin_fabsf linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabsf_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabsf_link+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 <math.h>
-int
-main ()
-{
- __builtin_fabsf(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_func___builtin_fabsf_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabsf_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsf_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsf_link" >&6
-
- if test x$glibcxx_cv_func___builtin_fabsf_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_FABSF 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_fabs declaration" >&5
-echo $ECHO_N "checking for __builtin_fabs declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabs_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabs_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_fabs(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_func___builtin_fabs_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabs_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabs_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabs_use" >&6
- if test x$glibcxx_cv_func___builtin_fabs_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_fabs linkage" >&5
-echo $ECHO_N "checking for __builtin_fabs linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabs_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabs_link+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 <math.h>
-int
-main ()
-{
- __builtin_fabs(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_func___builtin_fabs_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabs_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabs_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabs_link" >&6
-
- if test x$glibcxx_cv_func___builtin_fabs_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_FABS 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_fabsl declaration" >&5
-echo $ECHO_N "checking for __builtin_fabsl declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabsl_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabsl_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_fabsl(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_func___builtin_fabsl_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabsl_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsl_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsl_use" >&6
- if test x$glibcxx_cv_func___builtin_fabsl_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_fabsl linkage" >&5
-echo $ECHO_N "checking for __builtin_fabsl linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_fabsl_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_fabsl_link+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 <math.h>
-int
-main ()
-{
- __builtin_fabsl(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_func___builtin_fabsl_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_fabsl_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_fabsl_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_fabsl_link" >&6
-
- if test x$glibcxx_cv_func___builtin_fabsl_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_FABSL 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_labs declaration" >&5
-echo $ECHO_N "checking for __builtin_labs declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_labs_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_labs_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_labs(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_func___builtin_labs_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_labs_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_labs_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_labs_use" >&6
- if test x$glibcxx_cv_func___builtin_labs_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_labs linkage" >&5
-echo $ECHO_N "checking for __builtin_labs linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_labs_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_labs_link+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 <math.h>
-int
-main ()
-{
- __builtin_labs(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_func___builtin_labs_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_labs_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_labs_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_labs_link" >&6
-
- if test x$glibcxx_cv_func___builtin_labs_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_LABS 1
-_ACEOF
-
- fi
-
- fi
-
-
-
- echo "$as_me:$LINENO: checking for __builtin_sqrtf declaration" >&5
-echo $ECHO_N "checking for __builtin_sqrtf declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrtf_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrtf_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sqrtf(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_func___builtin_sqrtf_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrtf_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtf_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtf_use" >&6
- if test x$glibcxx_cv_func___builtin_sqrtf_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sqrtf linkage" >&5
-echo $ECHO_N "checking for __builtin_sqrtf linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrtf_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrtf_link+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 <math.h>
-int
-main ()
-{
- __builtin_sqrtf(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_func___builtin_sqrtf_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrtf_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtf_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtf_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sqrtf_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SQRTF 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_sqrt declaration" >&5
-echo $ECHO_N "checking for __builtin_sqrt declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrt_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrt_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sqrt(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_func___builtin_sqrt_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrt_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrt_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrt_use" >&6
- if test x$glibcxx_cv_func___builtin_sqrt_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sqrt linkage" >&5
-echo $ECHO_N "checking for __builtin_sqrt linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrt_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrt_link+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 <math.h>
-int
-main ()
-{
- __builtin_sqrt(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_func___builtin_sqrt_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrt_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrt_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrt_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sqrt_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SQRT 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_sqrtl declaration" >&5
-echo $ECHO_N "checking for __builtin_sqrtl declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrtl_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrtl_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sqrtl(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_func___builtin_sqrtl_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrtl_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtl_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtl_use" >&6
- if test x$glibcxx_cv_func___builtin_sqrtl_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sqrtl linkage" >&5
-echo $ECHO_N "checking for __builtin_sqrtl linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sqrtl_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sqrtl_link+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 <math.h>
-int
-main ()
-{
- __builtin_sqrtl(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_func___builtin_sqrtl_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sqrtl_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sqrtl_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sqrtl_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sqrtl_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SQRTL 1
-_ACEOF
-
- fi
-
- fi
-
-
-
- echo "$as_me:$LINENO: checking for __builtin_sinf declaration" >&5
-echo $ECHO_N "checking for __builtin_sinf declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sinf_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sinf_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sinf(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_func___builtin_sinf_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sinf_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinf_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sinf_use" >&6
- if test x$glibcxx_cv_func___builtin_sinf_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sinf linkage" >&5
-echo $ECHO_N "checking for __builtin_sinf linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sinf_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sinf_link+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 <math.h>
-int
-main ()
-{
- __builtin_sinf(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_func___builtin_sinf_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sinf_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinf_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sinf_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sinf_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SINF 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_sin declaration" >&5
-echo $ECHO_N "checking for __builtin_sin declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sin_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sin_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sin(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_func___builtin_sin_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sin_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sin_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sin_use" >&6
- if test x$glibcxx_cv_func___builtin_sin_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sin linkage" >&5
-echo $ECHO_N "checking for __builtin_sin linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sin_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sin_link+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 <math.h>
-int
-main ()
-{
- __builtin_sin(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_func___builtin_sin_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sin_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sin_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sin_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sin_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SIN 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_sinl declaration" >&5
-echo $ECHO_N "checking for __builtin_sinl declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sinl_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sinl_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_sinl(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_func___builtin_sinl_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sinl_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinl_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sinl_use" >&6
- if test x$glibcxx_cv_func___builtin_sinl_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_sinl linkage" >&5
-echo $ECHO_N "checking for __builtin_sinl linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_sinl_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_sinl_link+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 <math.h>
-int
-main ()
-{
- __builtin_sinl(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_func___builtin_sinl_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_sinl_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_sinl_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_sinl_link" >&6
-
- if test x$glibcxx_cv_func___builtin_sinl_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SINL 1
-_ACEOF
-
- fi
-
- fi
-
-
-
- echo "$as_me:$LINENO: checking for __builtin_cosf declaration" >&5
-echo $ECHO_N "checking for __builtin_cosf declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cosf_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cosf_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_cosf(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_func___builtin_cosf_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cosf_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosf_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cosf_use" >&6
- if test x$glibcxx_cv_func___builtin_cosf_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_cosf linkage" >&5
-echo $ECHO_N "checking for __builtin_cosf linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cosf_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cosf_link+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 <math.h>
-int
-main ()
-{
- __builtin_cosf(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_func___builtin_cosf_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cosf_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosf_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cosf_link" >&6
-
- if test x$glibcxx_cv_func___builtin_cosf_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_COSF 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_cos declaration" >&5
-echo $ECHO_N "checking for __builtin_cos declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cos_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cos_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_cos(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_func___builtin_cos_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cos_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cos_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cos_use" >&6
- if test x$glibcxx_cv_func___builtin_cos_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_cos linkage" >&5
-echo $ECHO_N "checking for __builtin_cos linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cos_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cos_link+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 <math.h>
-int
-main ()
-{
- __builtin_cos(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_func___builtin_cos_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cos_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cos_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cos_link" >&6
-
- if test x$glibcxx_cv_func___builtin_cos_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_COS 1
-_ACEOF
-
- fi
-
- fi
-
-
- echo "$as_me:$LINENO: checking for __builtin_cosl declaration" >&5
-echo $ECHO_N "checking for __builtin_cosl declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cosl_use+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cosl_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- 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
-
- 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 ()
-{
- __builtin_cosl(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_func___builtin_cosl_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cosl_use=no
-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
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosl_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cosl_use" >&6
- if test x$glibcxx_cv_func___builtin_cosl_use = x"yes"; then
- echo "$as_me:$LINENO: checking for __builtin_cosl linkage" >&5
-echo $ECHO_N "checking for __builtin_cosl linkage... $ECHO_C" >&6
- if test x${glibcxx_cv_func___builtin_cosl_link+set} != xset; then
- if test "${glibcxx_cv_func___builtin_cosl_link+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 <math.h>
-int
-main ()
-{
- __builtin_cosl(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_func___builtin_cosl_link=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func___builtin_cosl_link=no
-fi
-rm -f conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func___builtin_cosl_link" >&5
-echo "${ECHO_T}$glibcxx_cv_func___builtin_cosl_link" >&6
-
- if test x$glibcxx_cv_func___builtin_cosl_link = x"yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_COSL 1
-_ACEOF
-
- fi
-
- fi
-
-
-
-
echo "$as_me:$LINENO: checking for main in -lm" >&5
echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6
if test "${ac_cv_lib_m_main+set}" = set; then
@@ -108822,2019 +99077,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 +99338,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 +100039,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 +100788,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 +101493,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 +102410,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 +102421,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
@@ -115333,47 +102435,6 @@ _ACEOF
;;
esac
case "$target" in
- sparc*-*-solaris2.8 | sparc*-*-solaris2.9 | sparc*-*-solaris2.10)
- # I saw these on sparc-sun-solaris2.8, but not 2.6, and not on i386
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_ABS 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_LABS 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_FABS 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_FABSF 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_FABSL 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_COS 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_COSF 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SIN 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
-#define HAVE___BUILTIN_SINF 1
-_ACEOF
-
- ;;
- esac
- case "$target" in
*-*-solaris2.10)
# These two C99 functions are present only in Solaris >= 10
cat >>confdefs.h <<\_ACEOF
@@ -115387,10 +102448,6 @@ _ACEOF
;;
esac
cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
#define HAVE_COPYSIGN 1
_ACEOF
@@ -115412,164 +102469,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 +103231,6 @@ _ACEOF
;;
*-vxworks)
cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
#define HAVE_ACOSF 1
_ACEOF
@@ -122534,6 +109429,7 @@ s,@GLIBCXX_BUILD_DEBUG_FALSE@,$GLIBCXX_BUILD_DEBUG_FALSE,;t t
s,@ENABLE_PARALLEL_TRUE@,$ENABLE_PARALLEL_TRUE,;t t
s,@ENABLE_PARALLEL_FALSE@,$ENABLE_PARALLEL_FALSE,;t t
s,@EXTRA_CXX_FLAGS@,$EXTRA_CXX_FLAGS,;t t
+s,@GLIBCXX_LIBS@,$GLIBCXX_LIBS,;t t
s,@SECTION_LDFLAGS@,$SECTION_LDFLAGS,;t t
s,@OPT_LDFLAGS@,$OPT_LDFLAGS,;t t
s,@LIBMATHOBJS@,$LIBMATHOBJS,;t t
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index b23e17714dd..ff388ab50c4 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -100,11 +100,11 @@ GLIBCXX_ENABLE_PCH($is_hosted)
GLIBCXX_ENABLE_ATOMIC_BUILTINS
GLIBCXX_ENABLE_THREADS
-# Checks for compiler support that don't require linking.
+# Checks for compiler support that doesn't require linking.
GLIBCXX_CHECK_COMPILER_FEATURES
GLIBCXX_CHECK_STANDARD_LAYOUT
-# Enable all the variable C++ runtime options that doesn't require linking.
+# Enable all the variable C++ runtime options that don't require linking.
GLIBCXX_ENABLE_CSTDIO
GLIBCXX_ENABLE_CLOCALE
GLIBCXX_ENABLE_ALLOCATOR
@@ -119,9 +119,48 @@ GLIBCXX_ENABLE_PARALLEL([yes])
GLIBCXX_ENABLE_CXX_FLAGS
GLIBCXX_ENABLE_FULLY_DYNAMIC_STRING([no])
-# Checks for operating systems support that don't require linking.
+# Checks for operating systems support that doesn'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
+
+# For gettimeofday support.
+GLIBCXX_CHECK_GETTIMEOFDAY
+
+# For clock_gettime support.
+# NB: The default is [no], because otherwise it requires linking.
+GLIBCXX_ENABLE_CLOCK_GETTIME([no])
+
+# For gthread support
+GLIBCXX_CHECK_GTHREADS
+
+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,62 +168,20 @@ 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.
+ # For /dev/random and /dev/urandom for TR1.
GLIBCXX_CHECK_RANDOM_TR1
- # For clock_gettime support.
- GLIBCXX_CHECK_CLOCK_GETTIME
-
- # For gettimeofday support.
- GLIBCXX_CHECK_GETTIMEOFDAY
-
# For TLS support.
GCC_CHECK_TLS
# 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
@@ -216,7 +213,6 @@ else
fi
# Construct crosses by hand, eliminating bits that need ld...
- # GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
# GLIBCXX_CHECK_MATH_SUPPORT
# First, test for "known" system libraries. We may be using newlib even
@@ -227,8 +223,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 +249,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..399077546d3 100644
--- a/libstdc++-v3/crossconfig.m4
+++ b/libstdc++-v3/crossconfig.m4
@@ -11,23 +11,13 @@ 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
GLIBCXX_CHECK_LINKER_FEATURES
GLIBCXX_CHECK_MATH_SUPPORT
- 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 +35,14 @@ 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)
@@ -90,44 +51,18 @@ case "${host}" in
AC_DEFINE(HAVE_COPYSIGN)
AC_DEFINE(HAVE_SINCOS)
AC_DEFINE(HAVE_HYPOT)
- # GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
- AC_DEFINE(HAVE___BUILTIN_ABS)
- AC_DEFINE(HAVE___BUILTIN_FABSF)
- AC_DEFINE(HAVE___BUILTIN_FABS)
- AC_DEFINE(HAVE___BUILTIN_FABSL)
- AC_DEFINE(HAVE___BUILTIN_LABS)
- AC_DEFINE(HAVE___BUILTIN_SQRTF)
- AC_DEFINE(HAVE___BUILTIN_SQRT)
- AC_DEFINE(HAVE___BUILTIN_SQRTL)
- AC_DEFINE(HAVE___BUILTIN_SINF)
- AC_DEFINE(HAVE___BUILTIN_SIN)
- AC_DEFINE(HAVE___BUILTIN_SINL)
- AC_DEFINE(HAVE___BUILTIN_COSF)
- AC_DEFINE(HAVE___BUILTIN_COS)
- AC_DEFINE(HAVE___BUILTIN_COSL)
# GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
# 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 +74,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 +105,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,64 +125,26 @@ 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
GLIBCXX_CHECK_LINKER_FEATURES
GLIBCXX_CHECK_MATH_SUPPORT
- GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
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 +166,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 +173,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,58 +196,23 @@ 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
case "$target" in
- sparc*-*-solaris2.8 | sparc*-*-solaris2.9 | sparc*-*-solaris2.10)
- # I saw these on sparc-sun-solaris2.8, but not 2.6, and not on i386
- AC_DEFINE(HAVE___BUILTIN_ABS)
- AC_DEFINE(HAVE___BUILTIN_LABS)
- AC_DEFINE(HAVE___BUILTIN_FABS)
- AC_DEFINE(HAVE___BUILTIN_FABSF)
- AC_DEFINE(HAVE___BUILTIN_FABSL)
- AC_DEFINE(HAVE___BUILTIN_COS)
- AC_DEFINE(HAVE___BUILTIN_COSF)
- AC_DEFINE(HAVE___BUILTIN_SIN)
- AC_DEFINE(HAVE___BUILTIN_SINF)
- ;;
- esac
- case "$target" in
*-*-solaris2.10)
# These two C99 functions are present only in Solaris >= 10
AC_DEFINE(HAVE_STRTOF)
AC_DEFINE(HAVE_STRTOLD)
;;
esac
- AC_DEFINE(HAVE_MMAP)
AC_DEFINE(HAVE_COPYSIGN)
AC_DEFINE(HAVE_ISNAN)
AC_DEFINE(HAVE_ISNANF)
@@ -373,8 +220,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 +244,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.am b/libstdc++-v3/doc/Makefile.am
index 3b2cfbb0af7..d9c30426152 100644
--- a/libstdc++-v3/doc/Makefile.am
+++ b/libstdc++-v3/doc/Makefile.am
@@ -79,7 +79,6 @@ xml_sources = \
${xml_srcdir}/manual/auto_ptr.xml \
${xml_srcdir}/manual/backwards_compatibility.xml \
${xml_srcdir}/manual/bitmap_allocator.xml \
- ${xml_srcdir}/manual/build.xml \
${xml_srcdir}/manual/build_hacking.xml \
${xml_srcdir}/manual/codecvt.xml \
${xml_srcdir}/manual/concurrency.xml \
@@ -101,6 +100,7 @@ xml_sources = \
${xml_srcdir}/manual/mt_allocator.xml \
${xml_srcdir}/manual/numerics.xml \
${xml_srcdir}/manual/parallel_mode.xml \
+ ${xml_srcdir}/manual/prerequisites.xml \
${xml_srcdir}/manual/internals.xml \
${xml_srcdir}/manual/shared_ptr.xml \
${xml_srcdir}/manual/spine.xml \
diff --git a/libstdc++-v3/doc/Makefile.in b/libstdc++-v3/doc/Makefile.in
index 7ffe5766ce1..17c2e864d3c 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@
@@ -303,7 +304,6 @@ xml_sources = \
${xml_srcdir}/manual/auto_ptr.xml \
${xml_srcdir}/manual/backwards_compatibility.xml \
${xml_srcdir}/manual/bitmap_allocator.xml \
- ${xml_srcdir}/manual/build.xml \
${xml_srcdir}/manual/build_hacking.xml \
${xml_srcdir}/manual/codecvt.xml \
${xml_srcdir}/manual/concurrency.xml \
@@ -325,6 +325,7 @@ xml_sources = \
${xml_srcdir}/manual/mt_allocator.xml \
${xml_srcdir}/manual/numerics.xml \
${xml_srcdir}/manual/parallel_mode.xml \
+ ${xml_srcdir}/manual/prerequisites.xml \
${xml_srcdir}/manual/internals.xml \
${xml_srcdir}/manual/shared_ptr.xml \
${xml_srcdir}/manual/spine.xml \
diff --git a/libstdc++-v3/doc/html/api.html b/libstdc++-v3/doc/html/api.html
index 26bebed1a39..a502be4b11c 100644
--- a/libstdc++-v3/doc/html/api.html
+++ b/libstdc++-v3/doc/html/api.html
@@ -5,7 +5,7 @@
<a class="ulink" href="http://www.fsf.org/" target="_top">FSF
</a>
- </p></div><div><div class="legalnotice"><a id="id344716"></a><p>
+ </p></div><div><div class="legalnotice"><a id="id552919"></a><p>
<a class="ulink" href="17_intro/license.html" target="_top">License
</a>
</p></div></div></div><hr /></div><p>
diff --git a/libstdc++-v3/doc/html/manual/abi.html b/libstdc++-v3/doc/html/manual/abi.html
index bceda223735..66a60c03ec9 100644
--- a/libstdc++-v3/doc/html/manual/abi.html
+++ b/libstdc++-v3/doc/html/manual/abi.html
@@ -436,54 +436,54 @@ gcc test.c -g -O2 -L. -lone -ltwo /usr/lib/libstdc++.so.5 /usr/lib/libstdc++.so.
<a class="ulink" href="http://gcc.gnu.org/PR24660" target="_top">24660: versioning weak symbols in libstdc++</a>
</p><p>
<a class="ulink" href="http://gcc.gnu.org/PR19664" target="_top">19664: libstdc++ headers should have pop/push of the visibility around the declarations</a>
-</p></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="abi.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id473963"></a><p><span class="title"><i>
+</p></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="abi.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id484026"></a><p><span class="title"><i>
ABIcheck, a vague idea of checking ABI compatibility
</i>. </span><span class="biblioid">
<a class="ulink" href="http://abicheck.sourceforge.net/" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id473980"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id484043"></a><p><span class="title"><i>
C++ ABI Reference
</i>. </span><span class="biblioid">
<a class="ulink" href="http://www.codesourcery.com/cxx-abi" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id473998"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id484061"></a><p><span class="title"><i>
Intel® Compilers for Linux* -Compatibility with the GNU Compilers
</i>. </span><span class="biblioid">
<a class="ulink" href="http://developer.intel.com/software/products/compilers/techtopics/LinuxCompilersCompatibility.htm" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id474016"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id484078"></a><p><span class="title"><i>
Intel® Compilers for Linux* -Compatibility with the GNU Compilers
</i>. </span><span class="biblioid">
<a class="ulink" href="http://developer.intel.com/software/products/compilers/techtopics/LinuxCompilersCompatibility.htm" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id369651"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id529978"></a><p><span class="title"><i>
Sun Solaris 2.9 : Linker and Libraries Guide (document 816-1386)
</i>. </span><span class="biblioid">
<a class="ulink" href="http://docs.sun.com/?p=/doc/816-1386&amp;a=load" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id369667"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id529995"></a><p><span class="title"><i>
Sun Solaris 2.9 : C++ Migration Guide (document 816-2459)
</i>. </span><span class="biblioid">
<a class="ulink" href="http://docs.sun.com/db/prod/solaris.9" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id369685"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id530013"></a><p><span class="title"><i>
ELF Symbol Versioning
</i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="biblioid">
<a class="ulink" href="http://people.redhat.com/drepper/symbol-versioning" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id369713"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id530041"></a><p><span class="title"><i>
C++ ABI for the ARM Architecture
</i>. </span><span class="biblioid">
<a class="ulink" href="http://www.arm.com/miscPDFs/8033.pdf" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id369730"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id530058"></a><p><span class="title"><i>
Dynamic Shared Objects: Survey and Issues
</i>. </span><span class="subtitle">
ISO C++ J16/06-0046
. </span><span class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span>. </span><span class="biblioid">
<a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1976.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id369763"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id530090"></a><p><span class="title"><i>
Versioning With Namespaces
</i>. </span><span class="subtitle">
ISO C++ J16/06-0083
diff --git a/libstdc++-v3/doc/html/manual/api.html b/libstdc++-v3/doc/html/manual/api.html
index 4b093b1cbf4..95e7636f5b3 100644
--- a/libstdc++-v3/doc/html/manual/api.html
+++ b/libstdc++-v3/doc/html/manual/api.html
@@ -72,11 +72,11 @@ _Alloc_traits</code> have been removed.
<span class="type">__alloc</span> to select an underlying allocator that
satisfied memory allocation requests. The selection of this
underlying allocator was not user-configurable.
- </p><div class="table"><a id="id418406"></a><p class="title"><b>Table B.1. Extension Allocators</b></p><div class="table-contents"><table summary="Extension Allocators" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Allocator (3.4)</th><th align="left">Header (3.4)</th><th align="left">Allocator (3.[0-3])</th><th align="left">Header (3.[0-3])</th></tr></thead><tbody><tr><td align="left"><code class="classname">__gnu_cxx::new_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/new_allocator.h</code></td><td align="left"><code class="classname">std::__new_alloc</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::malloc_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/malloc_allocator.h</code></td><td align="left"><code class="classname">std::__malloc_alloc_template&lt;int&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::debug_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/debug_allocator.h</code></td><td align="left"><code class="classname">std::debug_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__pool_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">ext/pool_allocator.h</code></td><td align="left"><code class="classname">std::__default_alloc_template&lt;bool,int&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__mt_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">ext/mt_allocator.h</code></td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><code class="classname">__gnu_cxx::bitmap_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/bitmap_allocator.h</code></td><td align="left"> </td><td align="left"> </td></tr></tbody></table></div></div><br class="table-break" /><p> Releases after gcc-3.4 have continued to add to the collection
+ </p><div class="table"><a id="id488788"></a><p class="title"><b>Table B.1. Extension Allocators</b></p><div class="table-contents"><table summary="Extension Allocators" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Allocator (3.4)</th><th align="left">Header (3.4)</th><th align="left">Allocator (3.[0-3])</th><th align="left">Header (3.[0-3])</th></tr></thead><tbody><tr><td align="left"><code class="classname">__gnu_cxx::new_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/new_allocator.h</code></td><td align="left"><code class="classname">std::__new_alloc</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::malloc_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/malloc_allocator.h</code></td><td align="left"><code class="classname">std::__malloc_alloc_template&lt;int&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::debug_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/debug_allocator.h</code></td><td align="left"><code class="classname">std::debug_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__pool_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">ext/pool_allocator.h</code></td><td align="left"><code class="classname">std::__default_alloc_template&lt;bool,int&gt;</code></td><td align="left"><code class="filename">memory</code></td></tr><tr><td align="left"><code class="classname">__gnu_cxx::__mt_alloc&lt;T&gt;</code></td><td align="left"><code class="filename">ext/mt_allocator.h</code></td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><code class="classname">__gnu_cxx::bitmap_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/bitmap_allocator.h</code></td><td align="left"> </td><td align="left"> </td></tr></tbody></table></div></div><br class="table-break" /><p> Releases after gcc-3.4 have continued to add to the collection
of available allocators. All of these new allocators are
standard-style. The following table includes details, along with
the first released version of GCC that included the extension allocator.
- </p><div class="table"><a id="id476738"></a><p class="title"><b>Table B.2. Extension Allocators Continued</b></p><div class="table-contents"><table summary="Extension Allocators Continued" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Allocator</th><th align="left">Include</th><th align="left">Version</th></tr></thead><tbody><tr><td align="left"><code class="classname">__gnu_cxx::array_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/array_allocator.h</code></td><td align="left">4.0.0</td></tr><tr><td align="left"><code class="classname">__gnu_cxx::throw_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/throw_allocator.h</code></td><td align="left">4.2.0</td></tr></tbody></table></div></div><br class="table-break" /><p>
+ </p><div class="table"><a id="id594393"></a><p class="title"><b>Table B.2. Extension Allocators Continued</b></p><div class="table-contents"><table summary="Extension Allocators Continued" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Allocator</th><th align="left">Include</th><th align="left">Version</th></tr></thead><tbody><tr><td align="left"><code class="classname">__gnu_cxx::array_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/array_allocator.h</code></td><td align="left">4.0.0</td></tr><tr><td align="left"><code class="classname">__gnu_cxx::throw_allocator&lt;T&gt;</code></td><td align="left"><code class="filename">ext/throw_allocator.h</code></td><td align="left">4.2.0</td></tr></tbody></table></div></div><br class="table-break" /><p>
Debug mode first appears.
</p><p>
Precompiled header support <acronym class="acronym">PCH</acronym> support.
diff --git a/libstdc++-v3/doc/html/manual/backwards.html b/libstdc++-v3/doc/html/manual/backwards.html
index 4e7f6e33c98..b0e62138d1e 100644
--- a/libstdc++-v3/doc/html/manual/backwards.html
+++ b/libstdc++-v3/doc/html/manual/backwards.html
@@ -14,8 +14,8 @@ ISO Standard (e.g., statistical analysis). While there are a lot of
really useful things that are used by a lot of people, the Standards
Committee couldn't include everything, and so a lot of those
“<span class="quote">obvious</span>†classes didn't get included.
-</p><p>Known Issues include many of the limitations of its immediate ancestor.</p><p>Portability notes and known implementation limitations are as follows.</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id442299"></a>No <code class="code">ios_base</code></h4></div></div></div><p> At least some older implementations don't have <code class="code">std::ios_base</code>, so you should use <code class="code">std::ios::badbit</code>, <code class="code">std::ios::failbit</code> and <code class="code">std::ios::eofbit</code> and <code class="code">std::ios::goodbit</code>.
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id442331"></a>No <code class="code">cout</code> in <code class="code">ostream.h</code>, no <code class="code">cin</code> in <code class="code">istream.h</code></h4></div></div></div><p>
+</p><p>Known Issues include many of the limitations of its immediate ancestor.</p><p>Portability notes and known implementation limitations are as follows.</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id508903"></a>No <code class="code">ios_base</code></h4></div></div></div><p> At least some older implementations don't have <code class="code">std::ios_base</code>, so you should use <code class="code">std::ios::badbit</code>, <code class="code">std::ios::failbit</code> and <code class="code">std::ios::eofbit</code> and <code class="code">std::ios::goodbit</code>.
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id508935"></a>No <code class="code">cout</code> in <code class="code">ostream.h</code>, no <code class="code">cin</code> in <code class="code">istream.h</code></h4></div></div></div><p>
In earlier versions of the standard,
<code class="filename">fstream.h</code>,
<code class="filename">ostream.h</code>
@@ -41,7 +41,7 @@ considered replaced and rewritten.
archived. The code is considered replaced and rewritten.
</p><p>
Portability notes and known implementation limitations are as follows.
-</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id386246"></a>Namespace <code class="code">std::</code> not supported</h4></div></div></div><p>
+</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id509035"></a>Namespace <code class="code">std::</code> not supported</h4></div></div></div><p>
Some care is required to support C++ compiler and or library
implementation that do not have the standard library in
<code class="code">namespace std</code>.
@@ -105,7 +105,7 @@ AC_DEFUN([AC_CXX_NAMESPACE_STD], [
AC_DEFINE(HAVE_NAMESPACE_STD,,[Define if g++ supports namespace std. ])
fi
])
-</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id386369"></a>Illegal iterator usage</h4></div></div></div><p>
+</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id509158"></a>Illegal iterator usage</h4></div></div></div><p>
The following illustrate implementation-allowed illegal iterator
use, and then correct use.
</p><div class="itemizedlist"><ul type="disc"><li><p>
@@ -118,7 +118,7 @@ AC_DEFUN([AC_CXX_NAMESPACE_STD], [
</p></li><li><p>
<code class="code">if (iterator)</code> won't work any more =&gt; use
<code class="code">if (iterator != iterator_type())</code>
- </p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id386430"></a><code class="code">isspace</code> from <code class="filename">cctype</code> is a macro
+ </p></li></ul></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id590218"></a><code class="code">isspace</code> from <code class="filename">cctype</code> is a macro
</h4></div></div></div><p>
Glibc 2.0.x and 2.1.x define <code class="filename">ctype.h</code> functionality as macros
(isspace, isalpha etc.).
@@ -151,7 +151,7 @@ std:: (__ctype_b[(int) ( ( 'X' ) )] &amp; (unsigned short int) _ISspace ) ;
(<code class="filename">ctype.h</code>) and the
definitions in namespace <code class="code">std::</code>
(<code class="code">&lt;cctype&gt;</code>).
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id496113"></a>No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></h4></div></div></div><p>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id590311"></a>No <code class="code">vector::at</code>, <code class="code">deque::at</code>, <code class="code">string::at</code></h4></div></div></div><p>
One solution is to add an autoconf-test for this:
</p><pre class="programlisting">
AC_MSG_CHECKING(for container::at)
@@ -177,7 +177,7 @@ AC_DEFINE(HAVE_CONTAINER_AT)],
</pre><p>
If you are using other (non-GNU) compilers it might be a good idea
to check for <code class="code">string::at</code> separately.
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id496151"></a>No <code class="code">std::char_traits&lt;char&gt;::eof</code></h4></div></div></div><p>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id590349"></a>No <code class="code">std::char_traits&lt;char&gt;::eof</code></h4></div></div></div><p>
Use some kind of autoconf test, plus this:
</p><pre class="programlisting">
#ifdef HAVE_CHAR_TRAITS
@@ -185,7 +185,7 @@ AC_DEFINE(HAVE_CONTAINER_AT)],
#else
#define CPP_EOF EOF
#endif
-</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id496169"></a>No <code class="code">string::clear</code></h4></div></div></div><p>
+</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id590367"></a>No <code class="code">string::clear</code></h4></div></div></div><p>
There are two functions for deleting the contents of a string:
<code class="code">clear</code> and <code class="code">erase</code> (the latter returns the
string).
@@ -203,12 +203,12 @@ erase(size_type __pos = 0, size_type __n = npos)
Unfortunately, <code class="code">clear</code> is not implemented in this
version, so you should use <code class="code">erase</code> (which is probably
faster than <code class="code">operator=(charT*)</code>).
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id496214"></a>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id590413"></a>
Removal of <code class="code">ostream::form</code> and <code class="code">istream::scan</code>
extensions
</h4></div></div></div><p>
These are no longer supported. Please use stringstreams instead.
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id496234"></a>No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></h4></div></div></div><p>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id590432"></a>No <code class="code">basic_stringbuf</code>, <code class="code">basic_stringstream</code></h4></div></div></div><p>
Although the ISO standard <code class="code">i/ostringstream</code>-classes are
provided, (<code class="filename">sstream</code>), for
compatibility with older implementations the pre-ISO
@@ -296,14 +296,14 @@ any = temp;
Another example of using stringstreams is in <a class="link" href="bk01pt05ch13s05.html" title="Shrink to Fit">this howto</a>.
</p><p> There is additional information in the libstdc++-v2 info files, in
particular “<span class="quote">info iostream</span>â€.
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id496386"></a>Little or no wide character support</h4></div></div></div><p>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id590584"></a>Little or no wide character support</h4></div></div></div><p>
Classes <code class="classname">wstring</code> and
<code class="classname">char_traits&lt;wchar_t&gt;</code> are
not supported.
- </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id364967"></a>No templatized iostreams</h4></div></div></div><p>
+ </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id474404"></a>No templatized iostreams</h4></div></div></div><p>
Classes <code class="classname">wfilebuf</code> and
<code class="classname">wstringstream</code> are not supported.
- </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id364986"></a>Thread safety issues</h4></div></div></div><p>
+ </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id474423"></a>Thread safety issues</h4></div></div></div><p>
Earlier GCC releases had a somewhat different approach to
threading configuration and proper compilation. Before GCC 3.0,
configuration of the threading model was dictated by compiler
@@ -361,7 +361,7 @@ libstdc++-v3.
of the SGI STL (version 3.3), with extensive changes.
</p><p>A more formal description of the V3 goals can be found in the
official <a class="ulink" href="../17_intro/DESIGN" target="_top">design document</a>.
- </p><p>Portability notes and known implementation limitations are as follows.</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id365104"></a>Pre-ISO headers moved to backwards or removed</h4></div></div></div><p> The pre-ISO C++ headers
+ </p><p>Portability notes and known implementation limitations are as follows.</p><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id474542"></a>Pre-ISO headers moved to backwards or removed</h4></div></div></div><p> The pre-ISO C++ headers
(<code class="code">iostream.h</code>, <code class="code">defalloc.h</code> etc.) are
available, unlike previous libstdc++ versions, but inclusion
generates a warning that you are using deprecated headers.
@@ -433,7 +433,7 @@ like <code class="filename">vector.h</code> can be replaced with <code class="fi
directive <code class="code">using namespace std;</code> can be put at the global
scope. This should be enough to get this code compiling, assuming the
other usage is correct.
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id365186"></a>Extension headers hash_map, hash_set moved to ext or backwards</h4></div></div></div><p>At this time most of the features of the SGI STL extension have been
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id474625"></a>Extension headers hash_map, hash_set moved to ext or backwards</h4></div></div></div><p>At this time most of the features of the SGI STL extension have been
replaced by standardized libraries.
In particular, the unordered_map and unordered_set containers of TR1
are suitable replacement for the non-standard hash_map and hash_set
@@ -505,7 +505,7 @@ AC_DEFUN([AC_HEADER_EXT_HASH_SET], [
AC_DEFINE(HAVE_EXT_HASH_SET,,[Define if ext/hash_set is present. ])
fi
])
-</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id363795"></a>No <code class="code">ios::nocreate/ios::noreplace</code>.
+</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id474727"></a>No <code class="code">ios::nocreate/ios::noreplace</code>.
</h4></div></div></div><p> The existence of <code class="code">ios::nocreate</code> being used for
input-streams has been confirmed, most probably because the author
thought it would be more correct to specify nocreate explicitly. So
@@ -516,7 +516,7 @@ open the file for reading, check if it has been opened, and then
decide whether you want to create/replace or not. To my knowledge,
even older implementations support <code class="code">app</code>, <code class="code">ate</code>
and <code class="code">trunc</code> (except for <code class="code">app</code> ?).
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id363843"></a>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id474775"></a>
No <code class="code">stream::attach(int fd)</code>
</h4></div></div></div><p>
Phil Edwards writes: It was considered and rejected for the ISO
@@ -539,7 +539,7 @@ No <code class="code">stream::attach(int fd)</code>
For another example of this, refer to
<a class="ulink" href="http://www.josuttis.com/cppcode/fdstream.html" target="_top">fdstream example</a>
by Nicolai Josuttis.
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id363907"></a>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id572745"></a>
Support for C++98 dialect.
</h4></div></div></div><p>Check for complete library coverage of the C++1998/2003 standard.
</p><pre class="programlisting">
@@ -607,7 +607,7 @@ AC_DEFUN([AC_HEADER_STDCXX_98], [
AC_DEFINE(STDCXX_98_HEADERS,,[Define if ISO C++ 1998 header files are present. ])
fi
])
-</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id363935"></a>
+</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id572772"></a>
Support for C++TR1 dialect.
</h4></div></div></div><p>Check for library coverage of the TR1 standard.
</p><pre class="programlisting">
@@ -684,7 +684,7 @@ AC_DEFUN([AC_HEADER_TR1_UNORDERED_SET], [
AC_DEFINE(HAVE_TR1_UNORDERED_SET,,[Define if tr1/unordered_set is present. ])
fi
])
-</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id363978"></a>
+</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id572816"></a>
Support for C++0x dialect.
</h4></div></div></div><p>Check for baseline language coverage in the compiler for the C++0xstandard.
</p><pre class="programlisting">
@@ -896,27 +896,27 @@ AC_DEFUN([AC_HEADER_UNORDERED_SET], [
AC_DEFINE(HAVE_UNORDERED_SET,,[Define if unordered_set is present. ])
fi
])
-</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id364056"></a>
+</pre></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id572893"></a>
Container::iterator_type is not necessarily Container::value_type*
</h4></div></div></div><p>
This is a change in behavior from the previous version. Now, most
<span class="type">iterator_type</span> typedefs in container classes are POD
objects, not <span class="type">value_type</span> pointers.
-</p></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id364087"></a><p>[<abbr class="abbrev">
+</p></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="backwards.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id572925"></a><p>[<abbr class="abbrev">
kegel41
</abbr>] <span class="title"><i>
Migrating to GCC 4.1
</i>. </span><span class="author"><span class="firstname">Dan</span> <span class="surname">Kegel</span>. </span><span class="biblioid">
<a class="ulink" href="http://www.kegel.com/gcc/gcc4.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id374201"></a><p>[<abbr class="abbrev">
+ . </span></p></div><div class="biblioentry"><a id="id572957"></a><p>[<abbr class="abbrev">
kegel41
</abbr>] <span class="title"><i>
Building the Whole Debian Archive with GCC 4.1: A Summary
</i>. </span><span class="author"><span class="firstname">Martin</span> <span class="surname">Michlmayr</span>. </span><span class="biblioid">
<a class="ulink" href="http://lists.debian.org/debian-gcc/2006/03/msg00405.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id374234"></a><p>[<abbr class="abbrev">
+ . </span></p></div><div class="biblioentry"><a id="id572990"></a><p>[<abbr class="abbrev">
lbl32
</abbr>] <span class="title"><i>
Migration guide for GCC-3.2
diff --git a/libstdc++-v3/doc/html/manual/bitmap_allocator.html b/libstdc++-v3/doc/html/manual/bitmap_allocator.html
index 5e6458dcd29..cafa08ff825 100644
--- a/libstdc++-v3/doc/html/manual/bitmap_allocator.html
+++ b/libstdc++-v3/doc/html/manual/bitmap_allocator.html
@@ -103,7 +103,7 @@ else return false.</p></li></ol></div><p>
</p><p>
Consider a block of size 64 ints. In memory, it would look like this:
(assume a 32-bit system where, size_t is a 32-bit entity).
- </p><div class="table"><a id="id390307"></a><p class="title"><b>Table 32.1. Bitmap Allocator Memory Map</b></p><div class="table-contents"><table summary="Bitmap Allocator Memory Map" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left">268</td><td align="left">0</td><td align="left">4294967295</td><td align="left">4294967295</td><td align="left">Data -&gt; Space for 64 ints</td></tr></tbody></table></div></div><br class="table-break" /><p>
+ </p><div class="table"><a id="id588050"></a><p class="title"><b>Table 32.1. Bitmap Allocator Memory Map</b></p><div class="table-contents"><table summary="Bitmap Allocator Memory Map" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left">268</td><td align="left">0</td><td align="left">4294967295</td><td align="left">4294967295</td><td align="left">Data -&gt; Space for 64 ints</td></tr></tbody></table></div></div><br class="table-break" /><p>
The first Column(268) represents the size of the Block in bytes as
seen by the Bitmap Allocator. Internally, a global free list is
used to keep track of the free blocks used and given back by the
diff --git a/libstdc++-v3/doc/html/manual/bk01pt01ch01.html b/libstdc++-v3/doc/html/manual/bk01pt01ch01.html
index 688f019c03a..82a2e92355d 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt01ch01.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt01ch01.html
@@ -6101,7 +6101,7 @@ In this implementation the header names are prefixed by
</p><p>
This page describes the TR1 support in mainline GCC SVN, not in any particular
release.
-</p><div class="table"><a id="id337485"></a><p class="title"><b>Table 1.1. C++ TR1 Implementation Status</b></p><div class="table-contents"><table summary="C++ TR1 Implementation Status" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Section</th><th align="left">Description</th><th align="left">Done</th><th align="left">Broken</th><th align="left">Missing</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>2</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>General Utilities</em></span></td></tr><tr><td align="left">2.1</td><td align="left">Reference wrappers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.1</td><td align="left">Additions to header <code class="code">&lt;functional&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.2</td><td align="left">Class template <code class="code">reference_wrapper</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.2.1</td><td align="left"><code class="code">reference_wrapper</code> construct/copy/destroy</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.2.2</td><td align="left"><code class="code">reference_wrapper</code> assignment</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.2.3</td><td align="left"><code class="code">reference_wrapper</code> access</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.2.4</td><td align="left"><code class="code">reference_wrapper</code> invocation</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.2.5</td><td align="left"><code class="code">reference_wrapper</code> helper functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2</td><td align="left">Smart pointers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.1</td><td align="left">Additions to header <code class="code">&lt;memory&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.2</td><td align="left">Class <code class="code">bad_weak_ptr</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3</td><td align="left">Class template <code class="code">shared_ptr</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">See Footnotes</td></tr><tr><td align="left">2.2.3.1</td><td align="left"><code class="code">shared_ptr</code> constructors</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3.2</td><td align="left"><code class="code">shared_ptr</code> destructor</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3.3</td><td align="left"><code class="code">shared_ptr</code> assignment</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3.4</td><td align="left"><code class="code">shared_ptr</code> modifiers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3.5</td><td align="left"><code class="code">shared_ptr</code> observers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3.6</td><td align="left"><code class="code">shared_ptr</code> comparison</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3.7</td><td align="left"><code class="code">shared_ptr</code> I/O</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3.8</td><td align="left"><code class="code">shared_ptr</code> specialized algorithms</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3.9</td><td align="left"><code class="code">shared_ptr</code> casts</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3.10</td><td align="left"><code class="code">get_deleter</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.4</td><td align="left">Class template <code class="code">weak_ptr</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.4.1</td><td align="left"><code class="code">weak_ptr</code> constructors</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.4.2</td><td align="left"><code class="code">weak_ptr</code> destructor</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.4.3</td><td align="left"><code class="code">weak_ptr</code> assignment</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.4.4</td><td align="left"><code class="code">weak_ptr</code> modifiers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.4.5</td><td align="left"><code class="code">weak_ptr</code> observers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.4.6</td><td align="left"><code class="code">weak_ptr</code> comparison</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.4.7</td><td align="left"><code class="code">weak_ptr</code> specialized algorithms</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.5</td><td align="left">Class template <code class="code">enable_shared_from_this</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><span class="emphasis"><em>3</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>Function Objects</em></span></td></tr><tr><td align="left">3.1</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.2</td><td align="left">Additions to <code class="code">&lt;functional&gt; synopsis</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.3</td><td align="left">Requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.4</td><td align="left">Function return types</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.5</td><td align="left">Function template <code class="code">mem_fn</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.6</td><td align="left">Function object binders</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.6.1</td><td align="left">Class template <code class="code">is_bind_expression</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.6.2</td><td align="left">Class template <code class="code">is_placeholder</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.6.3</td><td align="left">Function template <code class="code">bind</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.6.4</td><td align="left">Placeholders</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7</td><td align="left">Polymorphic function wrappers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.1</td><td align="left">Class <code class="code">bad_function_call<code class="code"></code></code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.1.1</td><td align="left"><code class="code">bad_function_call</code> constructor</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.2</td><td align="left">Class template <code class="code">function</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.2.1</td><td align="left"><code class="code">function</code> construct/copy/destroy</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.2.2</td><td align="left"><code class="code">function</code> modifiers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.2.3</td><td align="left"><code class="code">function</code> capacity</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.2.4</td><td align="left"><code class="code">function</code> invocation</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.2.5</td><td align="left"><code class="code">function</code> target access</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.2.6</td><td align="left">undefined operators</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.2.7</td><td align="left">null pointer comparison operators</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.2.8</td><td align="left">specialized algorithms</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><span class="emphasis"><em>4</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>Metaprogramming and type traits</em></span></td></tr><tr><td align="left">4.1</td><td align="left">Requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.2</td><td align="left">Header <code class="code">&lt;type_traits&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.3</td><td align="left">Helper classes</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.4</td><td align="left">General Requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.5</td><td align="left">Unary Type Traits</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.5.1</td><td align="left">Primary Type Categories</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.5.2</td><td align="left">Composite type traits</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.5.3</td><td align="left">Type properties</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.6</td><td align="left">Relationships between types</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.7</td><td align="left">Transformations between types</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.7.1</td><td align="left">Const-volatile modifications</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.7.2</td><td align="left">Reference modifications</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.7.3</td><td align="left">Array modifications</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.7.4</td><td align="left">Pointer modifications</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.8</td><td align="left">Other transformations</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.9</td><td align="left">Implementation requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><span class="emphasis"><em>5</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>Numerical Facilities</em></span></td></tr><tr><td align="left">5.1</td><td align="left">Random number generation</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.1</td><td align="left">Requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.2</td><td align="left">Header <code class="code">&lt;random&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.3</td><td align="left">Class template <code class="code">variate_generator</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.4</td><td align="left">Random number engine class templates</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.4.1</td><td align="left">Class template <code class="code">linear_congruential</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.4.2</td><td align="left">Class template <code class="code">mersenne_twister</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.4.3</td><td align="left">Class template <code class="code">subtract_with_carry</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.4.4</td><td align="left">Class template <code class="code">subtract_with_carry_01</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.4.5</td><td align="left">Class template <code class="code">discard_block</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.4.6</td><td align="left">Class template <code class="code">xor_combine</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">operator()() per N2079</td></tr><tr><td align="left">5.1.5</td><td align="left">Engines with predefined parameters</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.6</td><td align="left">Class <code class="code">random_device</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7</td><td align="left">Random distribution class templates</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7.1</td><td align="left">Class template <code class="code">uniform_int</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7.2</td><td align="left">Class <code class="code">bernoulli_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7.3</td><td align="left">Class template <code class="code">geometric_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7.4</td><td align="left">Class template <code class="code">poisson_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7.5</td><td align="left">Class template <code class="code">binomial_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7.6</td><td align="left">Class template <code class="code">uniform_real</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7.7</td><td align="left">Class template <code class="code">exponential_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7.8</td><td align="left">Class template <code class="code">normal_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7.9</td><td align="left">Class template <code class="code">gamma_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2</td><td align="left">Mathematical special functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1</td><td align="left">Additions to header <code class="code">&lt;cmath&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.1</td><td align="left">associated Laguerre polynomials</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.2</td><td align="left">associated Legendre functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.3</td><td align="left">beta function</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.4</td><td align="left">(complete) elliptic integral of the first kind</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.5</td><td align="left">(complete) elliptic integral of the second kind</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.6</td><td align="left">(complete) elliptic integral of the third kind</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.7</td><td align="left">confluent hypergeometric functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.8</td><td align="left">regular modified cylindrical Bessel functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.9</td><td align="left">cylindrical Bessel functions (of the first kind)</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.10</td><td align="left">irregular modified cylindrical Bessel functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.11</td><td align="left">cylindrical Neumann functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.12</td><td align="left">(incomplete) elliptic integral of the first kind</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.13</td><td align="left">(incomplete) elliptic integral of the second kind</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.14</td><td align="left">(incomplete) elliptic integral of the third kind</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.15</td><td align="left">exponential integral</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.16</td><td align="left">Hermite polynomials</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.17</td><td align="left">hypergeometric functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.18</td><td align="left">Laguerre polynomials</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.19</td><td align="left">Legendre polynomials</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.20</td><td align="left">Riemann zeta function</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.21</td><td align="left">spherical Bessel functions (of the first kind)</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.22</td><td align="left">spherical associated Legendre functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.23</td><td align="left">spherical Neumann functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.2</td><td align="left">Additions to header <code class="code">&lt;math.h&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><span class="emphasis"><em>6</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>Containers</em></span></td></tr><tr><td align="left">6.1</td><td align="left">Tuple types</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.1.1</td><td align="left">Header <code class="code">&lt;tuple&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.1.2</td><td align="left">Additions to header <code class="code">&lt;utility&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.1.3</td><td align="left">Class template <code class="code">tuple</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.1.3.1</td><td align="left">Construction</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.1.3.2</td><td align="left">Tuple creation functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.1.3.3</td><td align="left">Tuple helper classes</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.1.3.4</td><td align="left">Element access</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.1.3.5</td><td align="left">Relational operators</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.1.4</td><td align="left">Pairs</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.2</td><td align="left">Fixed size array</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.2.1</td><td align="left">Header <code class="code">&lt;array&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.2.2</td><td align="left">Class template <code class="code">array</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.2.2.1</td><td align="left"><code class="code">array</code> constructors, copy, and assignment</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.2.2.2</td><td align="left"><code class="code">array</code> specialized algorithms</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.2.2.3</td><td align="left"><code class="code">array</code> size</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.2.2.4</td><td align="left">Zero sized <code class="code">array</code>s</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.2.2.5</td><td align="left">Tuple interface to class template <code class="code">array</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3</td><td align="left">Unordered associative containers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.1</td><td align="left">Unordered associative container requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.1.1</td><td align="left">Exception safety guarantees</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.2</td><td align="left">Additions to header <code class="code">&lt;functional&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.3</td><td align="left">Class template <code class="code">hash</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4</td><td align="left">Unordered associative container classes</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.1</td><td align="left">Header <code class="code">&lt;unordered_set&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.2</td><td align="left">Header <code class="code">&lt;unordered_map&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.3</td><td align="left">Class template <code class="code">unordered_set</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.3.1</td><td align="left"><code class="code">unordered_set</code> constructors</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.3.2</td><td align="left"><code class="code">unordered_set</code> swap</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.4</td><td align="left">Class template <code class="code">unordered_map</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.4.1</td><td align="left"><code class="code">unordered_map</code> constructors</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.4.2</td><td align="left"><code class="code">unordered_map</code> element access</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.4.3</td><td align="left"><code class="code">unordered_map</code> swap</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.5</td><td align="left">Class template <code class="code">unordered_multiset<code class="code"></code></code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.5.1</td><td align="left"><code class="code">unordered_multiset</code> constructors</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.5.2</td><td align="left"><code class="code">unordered_multiset</code> swap</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.6</td><td align="left">Class template <code class="code">unordered_multimap</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.6.1</td><td align="left"><code class="code">unordered_multimap</code> constructors</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.6.2</td><td align="left"><code class="code">unordered_multimap</code> swap</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><span class="emphasis"><em>7</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>Regular Expressions</em></span></td></tr><tr><td align="left">7.1</td><td align="left">Definitions</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.2</td><td align="left">Requirements</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.3</td><td align="left">Regular expressions summary</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.4</td><td align="left">Header <code class="code">&lt;regex&gt;</code> synopsis</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.5</td><td align="left">Namespace <code class="code">tr1::regex_constants</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.5.1</td><td align="left">Bitmask Type <code class="code">syntax_option_type</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.5.2</td><td align="left">Bitmask Type <code class="code">regex_constants::match_flag_type</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.5.3</td><td align="left">Implementation defined <code class="code">error_type</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.6</td><td align="left">Class <code class="code">regex_error</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.7</td><td align="left">Class template <code class="code">regex_traits</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.8</td><td align="left">Class template <code class="code">basic_regex</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.8.1</td><td align="left"><code class="code">basic_regex</code> constants</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.8.2</td><td align="left"><code class="code">basic_regex</code> constructors</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.8.3</td><td align="left"><code class="code">basic_regex</code> assign</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.8.4</td><td align="left"><code class="code">basic_regex</code> constant operations</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.8.5</td><td align="left"><code class="code">basic_regex</code> locale</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.8.6</td><td align="left"><code class="code">basic_regex</code> swap</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.8.7</td><td align="left"><code class="code">basic_regex</code> non-member functions</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.8.7.1</td><td align="left"><code class="code">basic_regex</code> non-member swap</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.9</td><td align="left">Class template <code class="code">sub_match</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.9.1</td><td align="left"><code class="code">sub_match</code> members</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.9.2</td><td align="left"><code class="code">sub_match</code> non-member operators</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.10</td><td align="left">Class template <code class="code">match_results</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.10.1</td><td align="left"><code class="code">match_results</code> constructors</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.10.2</td><td align="left"><code class="code">match_results</code> size</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.10.3</td><td align="left"><code class="code">match_results</code> element access</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.10.4</td><td align="left"><code class="code">match_results</code> formatting</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.10.5</td><td align="left"><code class="code">match_results</code> allocator</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.10.6</td><td align="left"><code class="code">match_results</code> swap</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.11</td><td align="left">Regular expression algorithms</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.11.1</td><td align="left">exceptions</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.11.2</td><td align="left"><code class="code">regex_match</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.11.3</td><td align="left"><code class="code">regex_search</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.11.4</td><td align="left"><code class="code">regex_replace</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12</td><td align="left">Regular expression Iterators</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.1</td><td align="left">Class template <code class="code">regex_iterator</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.1.1</td><td align="left"><code class="code">regex_iterator</code> constructors</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.1.2</td><td align="left"><code class="code">regex_iterator</code> comparisons</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.1.3</td><td align="left"><code class="code">regex_iterator</code> dereference</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.1.4</td><td align="left"><code class="code">regex_iterator</code> increment</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.2</td><td align="left">Class template <code class="code">regex_token_iterator</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.2.1</td><td align="left"><code class="code">regex_token_iterator</code> constructors</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.2.2</td><td align="left"><code class="code">regex_token_iterator</code> comparisons</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.2.3</td><td align="left"><code class="code">regex_token_iterator</code> dereference</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.2.4</td><td align="left"><code class="code">regex_token_iterator</code> increment</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.13</td><td align="left">Modified ECMAScript regular expression grammar</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left"><span class="emphasis"><em>8</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>C Compatibility</em></span></td></tr><tr><td align="left">8.1</td><td align="left">Additions to header <code class="code">&lt;complex&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.1.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.1.2</td><td align="left">Function <code class="code">acos</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.1.3</td><td align="left">Function <code class="code">asin</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.1.4</td><td align="left">Function <code class="code">atan</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.1.5</td><td align="left">Function <code class="code">acosh</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.1.6</td><td align="left">Function <code class="code">asinh</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.1.7</td><td align="left">Function <code class="code">atanh</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.1.8</td><td align="left">Function <code class="code">fabs</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.1.9</td><td align="left">Additional Overloads</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.2</td><td align="left">Header <code class="code">&lt;ccomplex&gt;</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left">DR 551</td></tr><tr><td align="left">8.3</td><td align="left">Header <code class="code">&lt;complex.h&gt;</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left">DR 551</td></tr><tr><td align="left">8.4</td><td align="left">Additions to header <code class="code">&lt;cctype&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.4.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.4.2</td><td align="left">Function <code class="code">isblank</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.5</td><td align="left">Additions to header <code class="code">&lt;ctype.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.6</td><td align="left">Header <code class="code">&lt;cfenv&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.6.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.6.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.7</td><td align="left">Header <code class="code">&lt;fenv.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.8</td><td align="left">Additions to header <code class="code">&lt;cfloat&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.9</td><td align="left">Additions to header <code class="code">&lt;float.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.10</td><td align="left">Additions to header <code class="code">&lt;ios&gt;</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">8.10.1</td><td align="left">Synopsis</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">8.10.2</td><td align="left">Function <code class="code">hexfloat</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">8.11</td><td align="left">Header <code class="code">&lt;cinttypes&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.11.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">DR 557</td></tr><tr><td align="left">8.11.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.12</td><td align="left">Header <code class="code">&lt;inttypes.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.13</td><td align="left">Additions to header <code class="code">&lt;climits&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.14</td><td align="left">Additions to header <code class="code">&lt;limits.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.15</td><td align="left">Additions to header <code class="code">&lt;locale&gt;</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">8.16</td><td align="left">Additions to header <code class="code">&lt;cmath&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.16.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.16.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.16.3</td><td align="left">Function template definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.16.4</td><td align="left">Additional overloads</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">DR 568; DR 550</td></tr><tr><td align="left">8.17</td><td align="left">Additions to header <code class="code">&lt;math.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.18</td><td align="left">Additions to header <code class="code">&lt;cstdarg&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.19</td><td align="left">Additions to header <code class="code">&lt;stdarg.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.20</td><td align="left">The header <code class="code">&lt;cstdbool&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.21</td><td align="left">The header <code class="code">&lt;stdbool.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.22</td><td align="left">The header <code class="code">&lt;cstdint&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.22.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.22.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.23</td><td align="left">The header <code class="code">&lt;stdint.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.24</td><td align="left">Additions to header <code class="code">&lt;cstdio&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.24.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.24.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.24.3</td><td align="left">Additional format specifiers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">C library responsibility</td></tr><tr><td align="left">8.24.4</td><td align="left">Additions to header <code class="code">&lt;stdio.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.25</td><td align="left">Additions to header <code class="code">&lt;cstdlib&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.25.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.25.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.25.3</td><td align="left">Function <code class="code">abs</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.25.4</td><td align="left">Function <code class="code">div</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.26</td><td align="left">Additions to header <code class="code">&lt;stdlib.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.27</td><td align="left">Header <code class="code">&lt;ctgmath&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">DR 551</td></tr><tr><td align="left">8.28</td><td align="left">Header <code class="code">&lt;tgmath.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">DR 551</td></tr><tr><td align="left">8.29</td><td align="left">Additions to header <code class="code">&lt;ctime&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">C library responsibility</td></tr><tr><td align="left">8.30</td><td align="left">Additions to header <code class="code">&lt;cwchar&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.30.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.30.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.30.3</td><td align="left">Additional wide format specifiers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">C library responsibility</td></tr><tr><td align="left">8.31</td><td align="left">Additions to header <code class="code">&lt;wchar.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.32</td><td align="left">Additions to header <code class="code">&lt;cwctype&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.32.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.32.2</td><td align="left">Function <code class="code">iswblank</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.33</td><td align="left">Additions to header <code class="code">&lt;wctype.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr></tbody></table></div></div><br class="table-break" /><p>
+</p><div class="table"><a id="id438495"></a><p class="title"><b>Table 1.1. C++ TR1 Implementation Status</b></p><div class="table-contents"><table summary="C++ TR1 Implementation Status" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Section</th><th align="left">Description</th><th align="left">Done</th><th align="left">Broken</th><th align="left">Missing</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>2</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>General Utilities</em></span></td></tr><tr><td align="left">2.1</td><td align="left">Reference wrappers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.1</td><td align="left">Additions to header <code class="code">&lt;functional&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.2</td><td align="left">Class template <code class="code">reference_wrapper</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.2.1</td><td align="left"><code class="code">reference_wrapper</code> construct/copy/destroy</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.2.2</td><td align="left"><code class="code">reference_wrapper</code> assignment</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.2.3</td><td align="left"><code class="code">reference_wrapper</code> access</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.2.4</td><td align="left"><code class="code">reference_wrapper</code> invocation</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.1.2.5</td><td align="left"><code class="code">reference_wrapper</code> helper functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2</td><td align="left">Smart pointers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.1</td><td align="left">Additions to header <code class="code">&lt;memory&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.2</td><td align="left">Class <code class="code">bad_weak_ptr</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3</td><td align="left">Class template <code class="code">shared_ptr</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">See Footnotes</td></tr><tr><td align="left">2.2.3.1</td><td align="left"><code class="code">shared_ptr</code> constructors</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3.2</td><td align="left"><code class="code">shared_ptr</code> destructor</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3.3</td><td align="left"><code class="code">shared_ptr</code> assignment</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3.4</td><td align="left"><code class="code">shared_ptr</code> modifiers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3.5</td><td align="left"><code class="code">shared_ptr</code> observers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3.6</td><td align="left"><code class="code">shared_ptr</code> comparison</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3.7</td><td align="left"><code class="code">shared_ptr</code> I/O</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3.8</td><td align="left"><code class="code">shared_ptr</code> specialized algorithms</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3.9</td><td align="left"><code class="code">shared_ptr</code> casts</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.3.10</td><td align="left"><code class="code">get_deleter</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.4</td><td align="left">Class template <code class="code">weak_ptr</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.4.1</td><td align="left"><code class="code">weak_ptr</code> constructors</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.4.2</td><td align="left"><code class="code">weak_ptr</code> destructor</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.4.3</td><td align="left"><code class="code">weak_ptr</code> assignment</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.4.4</td><td align="left"><code class="code">weak_ptr</code> modifiers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.4.5</td><td align="left"><code class="code">weak_ptr</code> observers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.4.6</td><td align="left"><code class="code">weak_ptr</code> comparison</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.4.7</td><td align="left"><code class="code">weak_ptr</code> specialized algorithms</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">2.2.5</td><td align="left">Class template <code class="code">enable_shared_from_this</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><span class="emphasis"><em>3</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>Function Objects</em></span></td></tr><tr><td align="left">3.1</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.2</td><td align="left">Additions to <code class="code">&lt;functional&gt; synopsis</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.3</td><td align="left">Requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.4</td><td align="left">Function return types</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.5</td><td align="left">Function template <code class="code">mem_fn</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.6</td><td align="left">Function object binders</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.6.1</td><td align="left">Class template <code class="code">is_bind_expression</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.6.2</td><td align="left">Class template <code class="code">is_placeholder</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.6.3</td><td align="left">Function template <code class="code">bind</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.6.4</td><td align="left">Placeholders</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7</td><td align="left">Polymorphic function wrappers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.1</td><td align="left">Class <code class="code">bad_function_call<code class="code"></code></code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.1.1</td><td align="left"><code class="code">bad_function_call</code> constructor</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.2</td><td align="left">Class template <code class="code">function</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.2.1</td><td align="left"><code class="code">function</code> construct/copy/destroy</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.2.2</td><td align="left"><code class="code">function</code> modifiers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.2.3</td><td align="left"><code class="code">function</code> capacity</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.2.4</td><td align="left"><code class="code">function</code> invocation</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.2.5</td><td align="left"><code class="code">function</code> target access</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.2.6</td><td align="left">undefined operators</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.2.7</td><td align="left">null pointer comparison operators</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">3.7.2.8</td><td align="left">specialized algorithms</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><span class="emphasis"><em>4</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>Metaprogramming and type traits</em></span></td></tr><tr><td align="left">4.1</td><td align="left">Requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.2</td><td align="left">Header <code class="code">&lt;type_traits&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.3</td><td align="left">Helper classes</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.4</td><td align="left">General Requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.5</td><td align="left">Unary Type Traits</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.5.1</td><td align="left">Primary Type Categories</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.5.2</td><td align="left">Composite type traits</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.5.3</td><td align="left">Type properties</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.6</td><td align="left">Relationships between types</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.7</td><td align="left">Transformations between types</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.7.1</td><td align="left">Const-volatile modifications</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.7.2</td><td align="left">Reference modifications</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.7.3</td><td align="left">Array modifications</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.7.4</td><td align="left">Pointer modifications</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.8</td><td align="left">Other transformations</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">4.9</td><td align="left">Implementation requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><span class="emphasis"><em>5</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>Numerical Facilities</em></span></td></tr><tr><td align="left">5.1</td><td align="left">Random number generation</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.1</td><td align="left">Requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.2</td><td align="left">Header <code class="code">&lt;random&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.3</td><td align="left">Class template <code class="code">variate_generator</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.4</td><td align="left">Random number engine class templates</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.4.1</td><td align="left">Class template <code class="code">linear_congruential</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.4.2</td><td align="left">Class template <code class="code">mersenne_twister</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.4.3</td><td align="left">Class template <code class="code">subtract_with_carry</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.4.4</td><td align="left">Class template <code class="code">subtract_with_carry_01</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.4.5</td><td align="left">Class template <code class="code">discard_block</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.4.6</td><td align="left">Class template <code class="code">xor_combine</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">operator()() per N2079</td></tr><tr><td align="left">5.1.5</td><td align="left">Engines with predefined parameters</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.6</td><td align="left">Class <code class="code">random_device</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7</td><td align="left">Random distribution class templates</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7.1</td><td align="left">Class template <code class="code">uniform_int</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7.2</td><td align="left">Class <code class="code">bernoulli_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7.3</td><td align="left">Class template <code class="code">geometric_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7.4</td><td align="left">Class template <code class="code">poisson_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7.5</td><td align="left">Class template <code class="code">binomial_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7.6</td><td align="left">Class template <code class="code">uniform_real</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7.7</td><td align="left">Class template <code class="code">exponential_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7.8</td><td align="left">Class template <code class="code">normal_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.1.7.9</td><td align="left">Class template <code class="code">gamma_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2</td><td align="left">Mathematical special functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1</td><td align="left">Additions to header <code class="code">&lt;cmath&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.1</td><td align="left">associated Laguerre polynomials</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.2</td><td align="left">associated Legendre functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.3</td><td align="left">beta function</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.4</td><td align="left">(complete) elliptic integral of the first kind</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.5</td><td align="left">(complete) elliptic integral of the second kind</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.6</td><td align="left">(complete) elliptic integral of the third kind</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.7</td><td align="left">confluent hypergeometric functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.8</td><td align="left">regular modified cylindrical Bessel functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.9</td><td align="left">cylindrical Bessel functions (of the first kind)</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.10</td><td align="left">irregular modified cylindrical Bessel functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.11</td><td align="left">cylindrical Neumann functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.12</td><td align="left">(incomplete) elliptic integral of the first kind</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.13</td><td align="left">(incomplete) elliptic integral of the second kind</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.14</td><td align="left">(incomplete) elliptic integral of the third kind</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.15</td><td align="left">exponential integral</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.16</td><td align="left">Hermite polynomials</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.17</td><td align="left">hypergeometric functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.18</td><td align="left">Laguerre polynomials</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.19</td><td align="left">Legendre polynomials</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.20</td><td align="left">Riemann zeta function</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.21</td><td align="left">spherical Bessel functions (of the first kind)</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.22</td><td align="left">spherical associated Legendre functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.1.23</td><td align="left">spherical Neumann functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">5.2.2</td><td align="left">Additions to header <code class="code">&lt;math.h&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><span class="emphasis"><em>6</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>Containers</em></span></td></tr><tr><td align="left">6.1</td><td align="left">Tuple types</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.1.1</td><td align="left">Header <code class="code">&lt;tuple&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.1.2</td><td align="left">Additions to header <code class="code">&lt;utility&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.1.3</td><td align="left">Class template <code class="code">tuple</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.1.3.1</td><td align="left">Construction</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.1.3.2</td><td align="left">Tuple creation functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.1.3.3</td><td align="left">Tuple helper classes</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.1.3.4</td><td align="left">Element access</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.1.3.5</td><td align="left">Relational operators</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.1.4</td><td align="left">Pairs</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.2</td><td align="left">Fixed size array</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.2.1</td><td align="left">Header <code class="code">&lt;array&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.2.2</td><td align="left">Class template <code class="code">array</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.2.2.1</td><td align="left"><code class="code">array</code> constructors, copy, and assignment</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.2.2.2</td><td align="left"><code class="code">array</code> specialized algorithms</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.2.2.3</td><td align="left"><code class="code">array</code> size</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.2.2.4</td><td align="left">Zero sized <code class="code">array</code>s</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.2.2.5</td><td align="left">Tuple interface to class template <code class="code">array</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3</td><td align="left">Unordered associative containers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.1</td><td align="left">Unordered associative container requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.1.1</td><td align="left">Exception safety guarantees</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.2</td><td align="left">Additions to header <code class="code">&lt;functional&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.3</td><td align="left">Class template <code class="code">hash</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4</td><td align="left">Unordered associative container classes</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.1</td><td align="left">Header <code class="code">&lt;unordered_set&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.2</td><td align="left">Header <code class="code">&lt;unordered_map&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.3</td><td align="left">Class template <code class="code">unordered_set</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.3.1</td><td align="left"><code class="code">unordered_set</code> constructors</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.3.2</td><td align="left"><code class="code">unordered_set</code> swap</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.4</td><td align="left">Class template <code class="code">unordered_map</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.4.1</td><td align="left"><code class="code">unordered_map</code> constructors</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.4.2</td><td align="left"><code class="code">unordered_map</code> element access</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.4.3</td><td align="left"><code class="code">unordered_map</code> swap</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.5</td><td align="left">Class template <code class="code">unordered_multiset<code class="code"></code></code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.5.1</td><td align="left"><code class="code">unordered_multiset</code> constructors</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.5.2</td><td align="left"><code class="code">unordered_multiset</code> swap</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.6</td><td align="left">Class template <code class="code">unordered_multimap</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.6.1</td><td align="left"><code class="code">unordered_multimap</code> constructors</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">6.3.4.6.2</td><td align="left"><code class="code">unordered_multimap</code> swap</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><span class="emphasis"><em>7</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>Regular Expressions</em></span></td></tr><tr><td align="left">7.1</td><td align="left">Definitions</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.2</td><td align="left">Requirements</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.3</td><td align="left">Regular expressions summary</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.4</td><td align="left">Header <code class="code">&lt;regex&gt;</code> synopsis</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.5</td><td align="left">Namespace <code class="code">tr1::regex_constants</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.5.1</td><td align="left">Bitmask Type <code class="code">syntax_option_type</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.5.2</td><td align="left">Bitmask Type <code class="code">regex_constants::match_flag_type</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.5.3</td><td align="left">Implementation defined <code class="code">error_type</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.6</td><td align="left">Class <code class="code">regex_error</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.7</td><td align="left">Class template <code class="code">regex_traits</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.8</td><td align="left">Class template <code class="code">basic_regex</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.8.1</td><td align="left"><code class="code">basic_regex</code> constants</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.8.2</td><td align="left"><code class="code">basic_regex</code> constructors</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.8.3</td><td align="left"><code class="code">basic_regex</code> assign</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.8.4</td><td align="left"><code class="code">basic_regex</code> constant operations</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.8.5</td><td align="left"><code class="code">basic_regex</code> locale</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.8.6</td><td align="left"><code class="code">basic_regex</code> swap</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.8.7</td><td align="left"><code class="code">basic_regex</code> non-member functions</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.8.7.1</td><td align="left"><code class="code">basic_regex</code> non-member swap</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.9</td><td align="left">Class template <code class="code">sub_match</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.9.1</td><td align="left"><code class="code">sub_match</code> members</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.9.2</td><td align="left"><code class="code">sub_match</code> non-member operators</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.10</td><td align="left">Class template <code class="code">match_results</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.10.1</td><td align="left"><code class="code">match_results</code> constructors</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.10.2</td><td align="left"><code class="code">match_results</code> size</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.10.3</td><td align="left"><code class="code">match_results</code> element access</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.10.4</td><td align="left"><code class="code">match_results</code> formatting</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.10.5</td><td align="left"><code class="code">match_results</code> allocator</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.10.6</td><td align="left"><code class="code">match_results</code> swap</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.11</td><td align="left">Regular expression algorithms</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.11.1</td><td align="left">exceptions</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.11.2</td><td align="left"><code class="code">regex_match</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.11.3</td><td align="left"><code class="code">regex_search</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.11.4</td><td align="left"><code class="code">regex_replace</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12</td><td align="left">Regular expression Iterators</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.1</td><td align="left">Class template <code class="code">regex_iterator</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.1.1</td><td align="left"><code class="code">regex_iterator</code> constructors</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.1.2</td><td align="left"><code class="code">regex_iterator</code> comparisons</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.1.3</td><td align="left"><code class="code">regex_iterator</code> dereference</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.1.4</td><td align="left"><code class="code">regex_iterator</code> increment</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.2</td><td align="left">Class template <code class="code">regex_token_iterator</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.2.1</td><td align="left"><code class="code">regex_token_iterator</code> constructors</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.2.2</td><td align="left"><code class="code">regex_token_iterator</code> comparisons</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.2.3</td><td align="left"><code class="code">regex_token_iterator</code> dereference</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.12.2.4</td><td align="left"><code class="code">regex_token_iterator</code> increment</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">7.13</td><td align="left">Modified ECMAScript regular expression grammar</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left"><span class="emphasis"><em>8</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>C Compatibility</em></span></td></tr><tr><td align="left">8.1</td><td align="left">Additions to header <code class="code">&lt;complex&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.1.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.1.2</td><td align="left">Function <code class="code">acos</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.1.3</td><td align="left">Function <code class="code">asin</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.1.4</td><td align="left">Function <code class="code">atan</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.1.5</td><td align="left">Function <code class="code">acosh</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.1.6</td><td align="left">Function <code class="code">asinh</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.1.7</td><td align="left">Function <code class="code">atanh</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.1.8</td><td align="left">Function <code class="code">fabs</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.1.9</td><td align="left">Additional Overloads</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.2</td><td align="left">Header <code class="code">&lt;ccomplex&gt;</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left">DR 551</td></tr><tr><td align="left">8.3</td><td align="left">Header <code class="code">&lt;complex.h&gt;</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left">DR 551</td></tr><tr><td align="left">8.4</td><td align="left">Additions to header <code class="code">&lt;cctype&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.4.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.4.2</td><td align="left">Function <code class="code">isblank</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.5</td><td align="left">Additions to header <code class="code">&lt;ctype.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.6</td><td align="left">Header <code class="code">&lt;cfenv&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.6.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.6.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.7</td><td align="left">Header <code class="code">&lt;fenv.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.8</td><td align="left">Additions to header <code class="code">&lt;cfloat&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.9</td><td align="left">Additions to header <code class="code">&lt;float.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.10</td><td align="left">Additions to header <code class="code">&lt;ios&gt;</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">8.10.1</td><td align="left">Synopsis</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">8.10.2</td><td align="left">Function <code class="code">hexfloat</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">8.11</td><td align="left">Header <code class="code">&lt;cinttypes&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.11.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">DR 557</td></tr><tr><td align="left">8.11.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.12</td><td align="left">Header <code class="code">&lt;inttypes.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.13</td><td align="left">Additions to header <code class="code">&lt;climits&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.14</td><td align="left">Additions to header <code class="code">&lt;limits.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.15</td><td align="left">Additions to header <code class="code">&lt;locale&gt;</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">8.16</td><td align="left">Additions to header <code class="code">&lt;cmath&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.16.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.16.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.16.3</td><td align="left">Function template definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.16.4</td><td align="left">Additional overloads</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">DR 568; DR 550</td></tr><tr><td align="left">8.17</td><td align="left">Additions to header <code class="code">&lt;math.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.18</td><td align="left">Additions to header <code class="code">&lt;cstdarg&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.19</td><td align="left">Additions to header <code class="code">&lt;stdarg.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.20</td><td align="left">The header <code class="code">&lt;cstdbool&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.21</td><td align="left">The header <code class="code">&lt;stdbool.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.22</td><td align="left">The header <code class="code">&lt;cstdint&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.22.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.22.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.23</td><td align="left">The header <code class="code">&lt;stdint.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.24</td><td align="left">Additions to header <code class="code">&lt;cstdio&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.24.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.24.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.24.3</td><td align="left">Additional format specifiers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">C library responsibility</td></tr><tr><td align="left">8.24.4</td><td align="left">Additions to header <code class="code">&lt;stdio.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.25</td><td align="left">Additions to header <code class="code">&lt;cstdlib&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.25.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.25.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.25.3</td><td align="left">Function <code class="code">abs</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.25.4</td><td align="left">Function <code class="code">div</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.26</td><td align="left">Additions to header <code class="code">&lt;stdlib.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.27</td><td align="left">Header <code class="code">&lt;ctgmath&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">DR 551</td></tr><tr><td align="left">8.28</td><td align="left">Header <code class="code">&lt;tgmath.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">DR 551</td></tr><tr><td align="left">8.29</td><td align="left">Additions to header <code class="code">&lt;ctime&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">C library responsibility</td></tr><tr><td align="left">8.30</td><td align="left">Additions to header <code class="code">&lt;cwchar&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.30.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.30.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.30.3</td><td align="left">Additional wide format specifiers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">C library responsibility</td></tr><tr><td align="left">8.31</td><td align="left">Additions to header <code class="code">&lt;wchar.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.32</td><td align="left">Additions to header <code class="code">&lt;cwctype&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.32.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.32.2</td><td align="left">Function <code class="code">iswblank</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">8.33</td><td align="left">Additions to header <code class="code">&lt;wctype.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr></tbody></table></div></div><br class="table-break" /><p>
Footnotes
</p><p>
The shared_ptr implementation uses some code from the
@@ -6120,7 +6120,7 @@ presence of the required flag.
</p><p>
This page describes the C++0x support in mainline GCC SVN, not in any
particular release.
-</p><div class="table"><a id="id382201"></a><p class="title"><b>Table 1.2. C++ 200x Implementation Status</b></p><div class="table-contents"><table summary="C++ 200x Implementation Status" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Section</th><th align="left">Description</th><th align="left">Done</th><th align="left">Broken</th><th align="left">Missing</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>20</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>General Utilities</em></span></td></tr><tr><td align="left">20.2</td><td align="left">Utility Components</td><td align="left"> </td><td align="left"> </td><td align="left">incomplete</td><td align="left"> </td></tr><tr><td align="left">20.2.1</td><td align="left">Operators</td><td align="left"> </td><td align="left"> </td><td align="left">partial</td><td align="left"> </td></tr><tr><td align="left">20.2.2</td><td align="left">forward/move helpers</td><td align="left"> </td><td align="left"> </td><td align="left">partial</td><td align="left"> </td></tr><tr><td align="left">20.2.3</td><td align="left">Pairs</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.3</td><td align="left">Header <code class="code">&lt;tuple&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.3.1</td><td align="left">Class template <code class="code">tuple</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.3.1.1</td><td align="left">Construction</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.3.1.2</td><td align="left">Tuple creation functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.3.1.3</td><td align="left">Tuple helper classes</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.3.1.4</td><td align="left">Element access</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.3.1.5</td><td align="left">Relational operators</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4</td><td colspan="5" align="left"><span class="emphasis"><em>Metaprogramming and type traits</em></span></td></tr><tr><td align="left">20.4.1</td><td align="left">Requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.2</td><td align="left">Header <code class="code">&lt;type_traits&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.3</td><td align="left">Helper classes</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.4</td><td align="left">General Requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.5</td><td align="left">Unary Type Traits</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.5.1</td><td align="left">Primary Type Categories</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.5.2</td><td align="left">Composite type traits</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.5.3</td><td align="left">Type properties</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.6</td><td align="left">Relationships between types</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.7</td><td align="left">Transformations between types</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.7.1</td><td align="left">Const-volatile modifications</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.7.2</td><td align="left">Reference modifications</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.7.3</td><td align="left">Array modifications</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.7.4</td><td align="left">Pointer modifications</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.8</td><td align="left">Other transformations</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.9</td><td align="left">Implementation requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5 </td><td align="left">Function Objects</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5</td><td align="left">Additions to header <code class="code">&lt;functional&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.1</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.2</td><td align="left">Requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.3</td><td align="left">Base</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.4</td><td align="left">Function return types</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.5</td><td align="left">Class template <code class="code">reference_wrapper</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.5.1</td><td align="left"><code class="code">reference_wrapper</code> construct/copy/destroy</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.5.2</td><td align="left"><code class="code">reference_wrapper</code> assignment</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.5.3</td><td align="left"><code class="code">reference_wrapper</code> access</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.5.4</td><td align="left"><code class="code">reference_wrapper</code> invocation</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.5.5</td><td align="left"><code class="code">reference_wrapper</code> helper functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.14</td><td align="left">Function template <code class="code">mem_fn</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.11</td><td align="left">Template function bind</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.11.1</td><td align="left">Function object binders</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.11.1.1</td><td align="left">Class template <code class="code">is_bind_expression</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.11.1.2</td><td align="left">Class template <code class="code">is_placeholder</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.11.1.3</td><td align="left">Function template <code class="code">bind</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.11.1.4</td><td align="left">Placeholders</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15</td><td align="left">Polymorphic function wrappers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.1</td><td align="left">Class <code class="code">bad_function_call<code class="code"></code></code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.1.1</td><td align="left"><code class="code">bad_function_call</code> constructor</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.2</td><td align="left">Class template <code class="code">function</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.2.1</td><td align="left"><code class="code">function</code> construct/copy/destroy</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.2.2</td><td align="left"><code class="code">function</code> modifiers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.2.3</td><td align="left"><code class="code">function</code> capacity</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.2.4</td><td align="left"><code class="code">function</code> invocation</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.2.5</td><td align="left"><code class="code">function</code> target access</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.2.7</td><td align="left">null pointer comparison operators</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.2.8</td><td align="left">specialized algorithms</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.16</td><td align="left">Class template <code class="code">hash</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6</td><td align="left">Additions to header <code class="code">&lt;memory&gt;</code> synopsis</td><td align="left"> </td><td align="left"> </td><td align="left">partial</td><td align="left">missing <code class="code">unique_ptr</code></td></tr><tr><td align="left">20.6.5</td><td align="left">Class template <code class="code">unique_ptr</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">20.6.6</td><td align="left">Smart pointers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.1</td><td align="left">Class <code class="code">bad_weak_ptr</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.2</td><td align="left">Class template <code class="code">shared_ptr</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">See Footnotes.</td></tr><tr><td align="left">20.6.6.2.1</td><td align="left"><code class="code">shared_ptr</code> constructors</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.2.2</td><td align="left"><code class="code">shared_ptr</code> destructor</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.2.3</td><td align="left"><code class="code">shared_ptr</code> assignment</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.2.4</td><td align="left"><code class="code">shared_ptr</code> modifiers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.2.5</td><td align="left"><code class="code">shared_ptr</code> observers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.2.6</td><td align="left"><code class="code">shared_ptr</code> creation</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">
+</p><div class="table"><a id="id563872"></a><p class="title"><b>Table 1.2. C++ 200x Implementation Status</b></p><div class="table-contents"><table summary="C++ 200x Implementation Status" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Section</th><th align="left">Description</th><th align="left">Done</th><th align="left">Broken</th><th align="left">Missing</th><th align="left">Comments</th></tr></thead><tbody><tr><td align="left"><span class="emphasis"><em>20</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>General Utilities</em></span></td></tr><tr><td align="left">20.2</td><td align="left">Utility Components</td><td align="left"> </td><td align="left"> </td><td align="left">incomplete</td><td align="left"> </td></tr><tr><td align="left">20.2.1</td><td align="left">Operators</td><td align="left"> </td><td align="left"> </td><td align="left">partial</td><td align="left"> </td></tr><tr><td align="left">20.2.2</td><td align="left">forward/move helpers</td><td align="left"> </td><td align="left"> </td><td align="left">partial</td><td align="left"> </td></tr><tr><td align="left">20.2.3</td><td align="left">Pairs</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.3</td><td align="left">Header <code class="code">&lt;tuple&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.3.1</td><td align="left">Class template <code class="code">tuple</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.3.1.1</td><td align="left">Construction</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.3.1.2</td><td align="left">Tuple creation functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.3.1.3</td><td align="left">Tuple helper classes</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.3.1.4</td><td align="left">Element access</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.3.1.5</td><td align="left">Relational operators</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4</td><td colspan="5" align="left"><span class="emphasis"><em>Metaprogramming and type traits</em></span></td></tr><tr><td align="left">20.4.1</td><td align="left">Requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.2</td><td align="left">Header <code class="code">&lt;type_traits&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.3</td><td align="left">Helper classes</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.4</td><td align="left">General Requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.5</td><td align="left">Unary Type Traits</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.5.1</td><td align="left">Primary Type Categories</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.5.2</td><td align="left">Composite type traits</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.5.3</td><td align="left">Type properties</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.6</td><td align="left">Relationships between types</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.7</td><td align="left">Transformations between types</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.7.1</td><td align="left">Const-volatile modifications</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.7.2</td><td align="left">Reference modifications</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.7.3</td><td align="left">Array modifications</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.7.4</td><td align="left">Pointer modifications</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.8</td><td align="left">Other transformations</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.4.9</td><td align="left">Implementation requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5 </td><td align="left">Function Objects</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5</td><td align="left">Additions to header <code class="code">&lt;functional&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.1</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.2</td><td align="left">Requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.3</td><td align="left">Base</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.4</td><td align="left">Function return types</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.5</td><td align="left">Class template <code class="code">reference_wrapper</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.5.1</td><td align="left"><code class="code">reference_wrapper</code> construct/copy/destroy</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.5.2</td><td align="left"><code class="code">reference_wrapper</code> assignment</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.5.3</td><td align="left"><code class="code">reference_wrapper</code> access</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.5.4</td><td align="left"><code class="code">reference_wrapper</code> invocation</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.5.5</td><td align="left"><code class="code">reference_wrapper</code> helper functions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.14</td><td align="left">Function template <code class="code">mem_fn</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.11</td><td align="left">Template function bind</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.11.1</td><td align="left">Function object binders</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.11.1.1</td><td align="left">Class template <code class="code">is_bind_expression</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.11.1.2</td><td align="left">Class template <code class="code">is_placeholder</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.11.1.3</td><td align="left">Function template <code class="code">bind</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.11.1.4</td><td align="left">Placeholders</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15</td><td align="left">Polymorphic function wrappers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.1</td><td align="left">Class <code class="code">bad_function_call<code class="code"></code></code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.1.1</td><td align="left"><code class="code">bad_function_call</code> constructor</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.2</td><td align="left">Class template <code class="code">function</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.2.1</td><td align="left"><code class="code">function</code> construct/copy/destroy</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.2.2</td><td align="left"><code class="code">function</code> modifiers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.2.3</td><td align="left"><code class="code">function</code> capacity</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.2.4</td><td align="left"><code class="code">function</code> invocation</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.2.5</td><td align="left"><code class="code">function</code> target access</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.2.7</td><td align="left">null pointer comparison operators</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.15.2.8</td><td align="left">specialized algorithms</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.5.16</td><td align="left">Class template <code class="code">hash</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6</td><td align="left">Additions to header <code class="code">&lt;memory&gt;</code> synopsis</td><td align="left"> </td><td align="left"> </td><td align="left">partial</td><td align="left">missing <code class="code">unique_ptr</code></td></tr><tr><td align="left">20.6.5</td><td align="left">Class template <code class="code">unique_ptr</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">20.6.6</td><td align="left">Smart pointers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.1</td><td align="left">Class <code class="code">bad_weak_ptr</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.2</td><td align="left">Class template <code class="code">shared_ptr</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">See Footnotes.</td></tr><tr><td align="left">20.6.6.2.1</td><td align="left"><code class="code">shared_ptr</code> constructors</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.2.2</td><td align="left"><code class="code">shared_ptr</code> destructor</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.2.3</td><td align="left"><code class="code">shared_ptr</code> assignment</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.2.4</td><td align="left"><code class="code">shared_ptr</code> modifiers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.2.5</td><td align="left"><code class="code">shared_ptr</code> observers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.2.6</td><td align="left"><code class="code">shared_ptr</code> creation</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">
<a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2351.htm" target="_top">N2351</a>
</td></tr><tr><td align="left">20.6.6.2.7</td><td align="left"><code class="code">shared_ptr</code> comparison</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.2.8</td><td align="left"><code class="code">shared_ptr</code> I/O</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.2.9</td><td align="left"><code class="code">shared_ptr</code> specialized algorithms</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.2.10</td><td align="left"><code class="code">shared_ptr</code> casts</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.2.11</td><td align="left"><code class="code">get_deleter</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.3</td><td align="left">Class template <code class="code">weak_ptr</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.3.1</td><td align="left"><code class="code">weak_ptr</code> constructors</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.3.2</td><td align="left"><code class="code">weak_ptr</code> destructor</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.3.3</td><td align="left"><code class="code">weak_ptr</code> assignment</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.3.4</td><td align="left"><code class="code">weak_ptr</code> modifiers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.3.5</td><td align="left"><code class="code">weak_ptr</code> observers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.3.6</td><td align="left"><code class="code">weak_ptr</code> comparison</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.3.7</td><td align="left"><code class="code">weak_ptr</code> specialized algorithms</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">20.6.6.4</td><td align="left">Class template <code class="code">enable_shared_from_this</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><span class="emphasis"><em>23</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>Containers</em></span></td></tr><tr><td align="left">23.2.1</td><td align="left">Header <code class="code">&lt;array&gt;</code> synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.2.1</td><td align="left">Class template array</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.2.1.1</td><td align="left"><code class="code">array</code> constructors, copy, and assignment</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.2.1.2</td><td align="left"><code class="code">array</code> specialized algorithms</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.2.1.3</td><td align="left"><code class="code">array </code>size</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.2.1.4</td><td align="left"><code class="code">array </code>data</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.2.1.5</td><td align="left">Zero sized <code class="code">array</code>s</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.2.1.6</td><td align="left">Tuple interface to class template <code class="code">array</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.4</td><td align="left">Unordered associative containers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.4.1</td><td align="left">Class template <code class="code">unordered_map</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.4.1.1</td><td align="left"><code class="code">unordered_map</code> constructors</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.4.1.2</td><td align="left"><code class="code">unordered_map</code> element access</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.4.1.3</td><td align="left"><code class="code">unordered_map</code> swap</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.4.2</td><td align="left">Class template <code class="code">unordered_multimap</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.4.2.1</td><td align="left"><code class="code">unordered_multimap</code> constructors</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.4.2.2</td><td align="left"><code class="code">unordered_multimap</code> swap</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.4.3</td><td align="left">Class template <code class="code">unordered_set</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.4.3.1</td><td align="left"><code class="code">unordered_set</code> constructors</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.4.3.2</td><td align="left"><code class="code">unordered_set</code> swap</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.4.4</td><td align="left">Class template <code class="code">unordered_multiset<code class="code"></code></code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.4.4.1</td><td align="left"><code class="code">unordered_multiset</code> constructors</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">23.4.4.2</td><td align="left"><code class="code">unordered_multiset</code> swap</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><span class="emphasis"><em>26</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>Numerics</em></span></td></tr><tr><td align="left">26.4</td><td align="left">Random number generation</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.1</td><td align="left">Requirements</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.2</td><td align="left">Header <code class="code">&lt;random&gt;</code> synopsis</td><td align="left"> </td><td align="left"> </td><td align="left">partial</td><td align="left"> </td></tr><tr><td align="left">26.4.3</td><td align="left">Random number engine class templates</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.3.1</td><td align="left">Class template <code class="code">linear_congruential_engine</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.3.2</td><td align="left">Class template <code class="code">mersenne_twister_engine</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.3.3</td><td align="left">Class template <code class="code">subtract_with_carry_engine</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.4</td><td align="left">Random number engine adaptor class templates</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.4.1</td><td align="left">Class template <code class="code">discard_block_engine</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.4.2</td><td align="left">Class template <code class="code">independent_bits_engine</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.4.3</td><td align="left">Class template <code class="code">shuffle_order_engine</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.4.4</td><td align="left">Class template <code class="code">xor_combine_engine</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">operator()() per N2079</td></tr><tr><td align="left">26.4.5</td><td align="left">Engines and engine adaptors with predefined parameters</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.6</td><td align="left">Class <code class="code">random_device</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.7</td><td align="left">Utilities</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.7.1</td><td align="left">Class <code class="code">seed_seq</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">26.4.7.2</td><td align="left">Function template <code class="code">generate_canonical</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">26.4.8</td><td align="left">Random number generation class templates</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.8.1</td><td align="left">Uniform distributions</td><td align="left"> </td><td align="left"> </td><td align="left">partial</td><td align="left"> </td></tr><tr><td align="left">26.4.8.1</td><td align="left">Class template <code class="code">uniform_int_distribution</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">26.4.8.1</td><td align="left">Class template <code class="code">uniform_real_distribution</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">26.4.8.2</td><td align="left">Bernoulli distributions</td><td align="left"> </td><td align="left"> </td><td align="left">partial</td><td align="left"> </td></tr><tr><td align="left">26.4.8.2.1</td><td align="left">Class <code class="code">bernoulli_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.8.2.2</td><td align="left">Class template <code class="code">binomial_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.8.2.3</td><td align="left">Class template <code class="code">geometric_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.8.2.4</td><td align="left">Class template <code class="code">negative_binomial_distribution</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">26.4.8.3</td><td align="left">Poisson distributions</td><td align="left"> </td><td align="left"> </td><td align="left">partial</td><td align="left"> </td></tr><tr><td align="left">26.4.8.3.1</td><td align="left">Class template <code class="code">poisson_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.8.3.2</td><td align="left">Class template <code class="code">exponential_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.8.3.3</td><td align="left">Class template <code class="code">gamma_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.8.3.4</td><td align="left">Class template <code class="code">weibull_distribution</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">26.4.8.3.5</td><td align="left">Class template <code class="code">extreme_value_distribution</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">26.4.8.4</td><td align="left">Normal distributions</td><td align="left"> </td><td align="left"> </td><td align="left">partial</td><td align="left"> </td></tr><tr><td align="left">26.4.8.4.1</td><td align="left">Class template <code class="code">normal_distribution</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">26.4.8.4.2</td><td align="left">Class template <code class="code">lognormal_distribution</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">26.4.8.4.3</td><td align="left">Class template <code class="code">chi_squared_distribution</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">26.4.8.4.4</td><td align="left">Class template <code class="code">cauchy_distribution</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">26.4.8.4.5</td><td align="left">Class template <code class="code">fisher_f_distribution</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">26.4.8.4.6</td><td align="left">Class template <code class="code">student_t_distribution</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">26.4.8.5</td><td align="left">Sampling distributions</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">26.4.8.5.1</td><td align="left">Class template <code class="code">discrete_distribution</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">26.4.8.5.1</td><td align="left">Class template <code class="code">piecewise_constant_distribution</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">26.4.8.5.1</td><td align="left">Class template <code class="code">general_pdf_distribution</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left"><span class="emphasis"><em>28</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>Regular Expressions</em></span></td></tr><tr><td align="left">28.1</td><td align="left">Definitions</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.2</td><td align="left">Requirements</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.3</td><td align="left">Regular expressions summary</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.4</td><td align="left">Header <code class="code">&lt;regex&gt;</code> synopsis</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.5</td><td align="left">Namespace <code class="code">tr1::regex_constants</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.5.1</td><td align="left">Bitmask Type <code class="code">syntax_option_type</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.5.2</td><td align="left">Bitmask Type <code class="code">regex_constants::match_flag_type</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.5.3</td><td align="left">Implementation defined <code class="code">error_type</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.6</td><td align="left">Class <code class="code">regex_error</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.7</td><td align="left">Class template <code class="code">regex_traits</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.8</td><td align="left">Class template <code class="code">basic_regex</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.8.1</td><td align="left"><code class="code">basic_regex</code> constants</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.8.2</td><td align="left"><code class="code">basic_regex</code> constructors</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.8.3</td><td align="left"><code class="code">basic_regex</code> assign</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.8.4</td><td align="left"><code class="code">basic_regex</code> constant operations</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.8.5</td><td align="left"><code class="code">basic_regex</code> locale</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.8.6</td><td align="left"><code class="code">basic_regex</code> swap</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.8.7</td><td align="left"><code class="code">basic_regex</code> non-member functions</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.8.7.1</td><td align="left"><code class="code">basic_regex</code> non-member swap</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.9</td><td align="left">Class template <code class="code">sub_match</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.9.1</td><td align="left"><code class="code">sub_match</code> members</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.9.2</td><td align="left"><code class="code">sub_match</code> non-member operators</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.10</td><td align="left">Class template <code class="code">match_results</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.10.1</td><td align="left"><code class="code">match_results</code> constructors</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.10.2</td><td align="left"><code class="code">match_results</code> size</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.10.3</td><td align="left"><code class="code">match_results</code> element access</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.10.4</td><td align="left"><code class="code">match_results</code> formatting</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.10.5</td><td align="left"><code class="code">match_results</code> allocator</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.10.6</td><td align="left"><code class="code">match_results</code> swap</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.11</td><td align="left">Regular expression algorithms</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.11.1</td><td align="left">exceptions</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.11.2</td><td align="left"><code class="code">regex_match</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.11.3</td><td align="left"><code class="code">regex_search</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.11.4</td><td align="left"><code class="code">regex_replace</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.12</td><td align="left">Regular expression Iterators</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.12.1</td><td align="left">Class template <code class="code">regex_iterator</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.12.1.1</td><td align="left"><code class="code">regex_iterator</code> constructors</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.12.1.2</td><td align="left"><code class="code">regex_iterator</code> comparisons</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.12.1.3</td><td align="left"><code class="code">regex_iterator</code> dereference</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.12.1.4</td><td align="left"><code class="code">regex_iterator</code> increment</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.12.2</td><td align="left">Class template <code class="code">regex_token_iterator</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.12.2.1</td><td align="left"><code class="code">regex_token_iterator</code> constructors</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.12.2.2</td><td align="left"><code class="code">regex_token_iterator</code> comparisons</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.12.2.3</td><td align="left"><code class="code">regex_token_iterator</code> dereference</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.12.2.4</td><td align="left"><code class="code">regex_token_iterator</code> increment</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">28.13</td><td align="left">Modified ECMAScript regular expression grammar</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left"><span class="emphasis"><em>C</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>C Compatibility</em></span></td></tr><tr><td align="left">C2.1</td><td align="left">Additions to header <code class="code">&lt;complex&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.1.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.1.2</td><td align="left">Function <code class="code">acos</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.1.3</td><td align="left">Function <code class="code">asin</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.1.4</td><td align="left">Function <code class="code">atan</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.1.5</td><td align="left">Function <code class="code">acosh</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.1.6</td><td align="left">Function <code class="code">asinh</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.1.7</td><td align="left">Function <code class="code">atanh</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.1.8</td><td align="left">Function <code class="code">fabs</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.1.9</td><td align="left">Additional Overloads</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.2</td><td align="left">Header <code class="code">&lt;ccomplex&gt;</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left">DR 551</td></tr><tr><td align="left">C2.3</td><td align="left">Header <code class="code">&lt;complex.h&gt;</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left">DR 551</td></tr><tr><td align="left">C2.4</td><td align="left">Additions to header <code class="code">&lt;cctype&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.4.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.4.2</td><td align="left">Function <code class="code">isblank</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.5</td><td align="left">Additions to header <code class="code">&lt;ctype.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.6</td><td align="left">Header <code class="code">&lt;cfenv&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.6.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.6.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.7</td><td align="left">Header <code class="code">&lt;fenv.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.8</td><td align="left">Additions to header <code class="code">&lt;cfloat&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.9</td><td align="left">Additions to header <code class="code">&lt;float.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.10</td><td align="left">Additions to header <code class="code">&lt;ios&gt;</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">C2.10.1</td><td align="left">Synopsis</td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">C2.10.2</td><td align="left">Function <code class="code">hexfloat</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">C2.11</td><td align="left">Header <code class="code">&lt;cinttypes&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.11.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">DR 557</td></tr><tr><td align="left">C2.11.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.12</td><td align="left">Header <code class="code">&lt;inttypes.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.13</td><td align="left">Additions to header <code class="code">&lt;climits&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.14</td><td align="left">Additions to header <code class="code">&lt;limits.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.15</td><td align="left">Additions to header <code class="code">&lt;locale&gt;</code></td><td align="left"> </td><td align="left"> </td><td align="left">missing</td><td align="left"> </td></tr><tr><td align="left">C2.16</td><td align="left">Additions to header <code class="code">&lt;cmath&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.16.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.16.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.16.3</td><td align="left">Function template definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.16.4</td><td align="left">Additional overloads</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">DR 568; DR 550</td></tr><tr><td align="left">C2.17</td><td align="left">Additions to header <code class="code">&lt;math.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.18</td><td align="left">Additions to header <code class="code">&lt;cstdarg&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.19</td><td align="left">Additions to header <code class="code">&lt;stdarg.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.20</td><td align="left">The header <code class="code">&lt;cstdbool&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.21</td><td align="left">The header <code class="code">&lt;stdbool.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.22</td><td align="left">The header <code class="code">&lt;cstdint&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.22.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.22.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.23</td><td align="left">The header <code class="code">&lt;stdint.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.24</td><td align="left">Additions to header <code class="code">&lt;cstdio&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.24.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.24.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.24.3</td><td align="left">Additional format specifiers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">C library responsibility</td></tr><tr><td align="left">C2.24.4</td><td align="left">Additions to header <code class="code">&lt;stdio.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.25</td><td align="left">Additions to header <code class="code">&lt;cstdlib&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.25.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.25.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.25.3</td><td align="left">Function <code class="code">abs</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.25.4</td><td align="left">Function <code class="code">div</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.26</td><td align="left">Additions to header <code class="code">&lt;stdlib.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.27</td><td align="left">Header <code class="code">&lt;ctgmath&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">DR 551</td></tr><tr><td align="left">C2.28</td><td align="left">Header <code class="code">&lt;tgmath.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">DR 551</td></tr><tr><td align="left">C2.29</td><td align="left">Additions to header <code class="code">&lt;ctime&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">C library responsibility</td></tr><tr><td align="left">C2.30</td><td align="left">Additions to header <code class="code">&lt;cwchar&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.30.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.30.2</td><td align="left">Definitions</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.30.3</td><td align="left">Additional wide format specifiers</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left">C library responsibility</td></tr><tr><td align="left">C2.31</td><td align="left">Additions to header <code class="code">&lt;wchar.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.32</td><td align="left">Additions to header <code class="code">&lt;cwctype&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.32.1</td><td align="left">Synopsis</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.32.2</td><td align="left">Function <code class="code">iswblank</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">C2.33</td><td align="left">Additions to header <code class="code">&lt;wctype.h&gt;</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left"><span class="emphasis"><em>D</em></span></td><td colspan="5" align="left"><span class="emphasis"><em>Compatibility Features</em></span></td></tr><tr><td align="left">D.6</td><td align="left">Old iostream members</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr><tr><td align="left">D.8</td><td align="left">Binders</td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"><a class="ulink" href="http://gcc.gnu.org/PR33911" target="_top">33911</a></td></tr><tr><td align="left">D.9</td><td align="left">Class template <code class="code">auto_ptr</code></td><td align="left">done</td><td align="left"> </td><td align="left"> </td><td align="left"><a class="ulink" href="http://gcc.gnu.org/PR33911" target="_top">33911</a></td></tr></tbody></table></div></div><br class="table-break" /><p>
Footnotes
diff --git a/libstdc++-v3/doc/html/manual/bk01pt01ch02.html b/libstdc++-v3/doc/html/manual/bk01pt01ch02.html
index 7ddc9cabeb4..90687415529 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt01ch02.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt01ch02.html
@@ -1,181 +1,98 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 2. Setup</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="start" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="intro.html" title="Part I. Introduction" /><link rel="prev" href="bk01pt01ch01s03.html" title="Bugs" /><link rel="next" href="build.html" title="Build" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. Setup</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt01ch01s03.html">Prev</a> </td><th width="60%" align="center">Part I. Introduction</th><td width="20%" align="right"> <a accesskey="n" href="build.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.setup"></a>Chapter 2. Setup</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="bk01pt01ch02.html#manual.intro.setup.configure">Configure</a></span></dt><dt><span class="sect1"><a href="build.html">Build</a></span></dt><dd><dl><dt><span class="sect2"><a href="build.html#build.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="build.html#build.configure">Make</a></span></dt></dl></dd><dt><span class="sect1"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="sect2"><a href="test.html#test.organization">Organization</a></span></dt><dt><span class="sect2"><a href="test.html#test.naming">Naming Conventions</a></span></dt><dt><span class="sect2"><a href="test.html#test.utils">Utilities</a></span></dt><dt><span class="sect2"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="sect2"><a href="test.html#test.new_tests">New Test Cases</a></span></dt><dt><span class="sect2"><a href="test.html#test.dejagnu">Test Harness Details</a></span></dt><dt><span class="sect2"><a href="test.html#test.future">Future</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.setup.configure"></a>Configure</h2></div></div></div><p>
- Here are some of the non-obvious options to libstdc++'s configure.
- Keep in mind that
-
- <a class="ulink" href="http://www.gnu.org/software/autoconf/manual/autoconf-2.57/html_node/autoconf_131.html#SEC131" target="_top">they
- all have opposite forms as well</a>
- (enable/disable and with/without). The defaults are for <span class="emphasis"><em>current
- development sources</em></span>, which may be different than those for
- released versions.
-</p><p>The canonical way to find out the configure options that are
- available for a given set of libstdc++ sources is to go to the
- source directory and then type:<code class="code"> ./configure --help</code>
-</p><div class="variablelist"><dl><dt><span class="term"><code class="code">--enable-multilib</code>[default]</span></dt><dd><p>This is part of the generic multilib support for building cross
- compilers. As such, targets like "powerpc-elf" will have
- libstdc++ built many different ways: "-msoft-float"
- and not, etc. A different libstdc++ will be built for each of
- the different multilib versions. This option is on by default.
- </p></dd><dt><span class="term"><code class="code">--enable-sjlj-exceptions</code></span></dt><dd><p>Forces old, set-jump/long-jump exception handling model. If
- at all possible, the new, frame unwinding exception handling routines
- should be used instead, as they significantly reduce both
- runtime memory usage and executable size. This option can
- change the library ABI.
- </p></dd><dt><span class="term"><code class="code">--enable-version-specific-runtime-libs</code></span></dt><dd><p>Specify that run-time libraries should be installed in the
- compiler-specific subdirectory (i.e.,
- <code class="code">${libdir}/gcc-lib/${target_alias}/${gcc_version}</code>)
- instead of <code class="code">${libdir}</code>. This option is useful if you
- intend to use several versions of gcc in parallel. In addition,
- libstdc++'s include files will be installed in
- <code class="code">${libdir}/gcc-lib/${target_alias}/${gcc_version}/include/g++</code>,
- unless you also specify
- <code class="literal">--with-gxx-include-dir=<code class="filename">dirname</code></code> during configuration.
- </p></dd><dt><span class="term"><code class="code">--with-gxx-include-dir=&lt;include-files dir&gt;</code></span></dt><dd><p>Adds support for named libstdc++ include directory. For instance,
- the following puts all the libstdc++ headers into a directory
- called "2.97-20001008" instead of the usual
- "c++/(version)".
- </p><pre class="programlisting">
- --with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/2.97-20001008</pre></dd><dt><span class="term"><code class="code">--enable-cstdio</code></span></dt><dd><p>This is an abbreviated form of <code class="code">'--enable-cstdio=stdio'</code>
- (described next). This option can change the library ABI.
- </p></dd><dt><span class="term"><code class="code">--enable-cstdio=OPTION</code></span></dt><dd><p>Select a target-specific I/O package. At the moment, the only
- choice is to use 'stdio', a generic "C" abstraction.
- The default is 'stdio'.
- </p></dd><dt><span class="term"><code class="code">--enable-clocale</code></span></dt><dd><p>This is an abbreviated form of <code class="code">'--enable-clocale=generic'</code>
- (described next). This option can change the library ABI.
- </p></dd><dt><span class="term"><code class="code">--enable-clocale=OPTION</code></span></dt><dd><p>Select a target-specific underlying locale package. The
- choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix
- (IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets,
- 'gnu' to specify a model based on functionality from the GNU C
- library (langinfo/iconv/gettext) (from <a class="ulink" href="http://sources.redhat.com/glibc/" target="_top">glibc</a>, the GNU C
- library), or 'generic' to use a generic "C"
- abstraction which consists of "C" locale info.
- </p><p>As part of the configuration process, the "C" library is
- probed both for sufficient vintage, and installed locale
- data. If either of these elements are not present, the C++
- locale model default to 'generic.' On glibc-based systems of
- version 2.2.5 and above with installed locale files, 'gnu' is
- automatically selected.
- </p></dd><dt><span class="term"><code class="code">--enable-libstdcxx-allocator</code></span></dt><dd><p>This is an abbreviated form of
- <code class="code">'--enable-libstdcxx-allocator=auto'</code> (described
- next). This option can change the library ABI.
- </p></dd><dt><span class="term"><code class="code">--enable-libstdcxx-allocator=OPTION </code></span></dt><dd><p>Select a target-specific underlying std::allocator. The
- choices are 'new' to specify a wrapper for new, 'malloc' to
- specify a wrapper for malloc, 'mt' for a fixed power of two allocator
- (<a class="ulink" href="ext/mt_allocator.html" target="_top">documented</a> under extensions),
- 'pool' for the SGI pooled allocator or 'bitmap' for a bitmap allocator.
- This option can change the library ABI.
- </p></dd><dt><span class="term"><code class="code">--enable-cheaders=OPTION</code></span></dt><dd><p>This allows the user to define the approach taken for C header
- compatibility with C++. Options are c, c_std, and c_global.
- These correspond to the source directory's include/c,
- include/c_std, and include/c_global, and may also include
- include/c_compatibility. The default is c_global.
- </p></dd><dt><span class="term"><code class="code">--enable-threads</code></span></dt><dd><p>This is an abbreviated form of <code class="code">'--enable-threads=yes'</code>
- (described next). This option can change the library ABI.
- </p></dd><dt><span class="term"><code class="code">--enable-threads=OPTION</code></span></dt><dd><p>Select a threading library. A full description is given in the
- general <a class="ulink" href="http://gcc.gnu.org/install/configure.html" target="_top">compiler
- configuration instructions</a>.
- </p></dd><dt><span class="term"><code class="code">--enable-libstdcxx-debug</code></span></dt><dd><p>Build separate debug libraries in addition to what is normally built.
- By default, the debug libraries are compiled with
- <code class="code"> CXXFLAGS='-g3 -O0'</code>
- , are installed in <code class="code">${libdir}/debug</code>, and have the
- same names and versioning information as the non-debug
- libraries. This option is off by default.
- </p><p>Note this make command, executed in
- the build directory, will do much the same thing, without the
- configuration difference and without building everything twice:
- <code class="code">make CXXFLAGS='-g3 -O0' all</code>
- </p></dd><dt><span class="term"><code class="code">--enable-libstdcxx-debug-flags=FLAGS</code></span></dt><dd><p>This option is only valid when <code class="code"> --enable-debug </code>
- is also specified, and applies to the debug builds only. With
- this option, you can pass a specific string of flags to the
- compiler to use when building the debug versions of libstdc++.
- FLAGS is a quoted string of options, like
- </p><pre class="programlisting">
- --enable-libstdcxx-debug-flags='-g3 -O1 -gdwarf-2'</pre></dd><dt><span class="term"><code class="code">--enable-cxx-flags=FLAGS</code></span></dt><dd><p>With this option, you can pass a string of -f (functionality)
- flags to the compiler to use when building libstdc++. This
- option can change the library ABI. FLAGS is a quoted string of
- options, like
- </p><pre class="programlisting">
- --enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi'</pre><p>
- Note that the flags don't necessarily have to all be -f flags,
- as shown, but usually those are the ones that will make sense
- for experimentation and configure-time overriding.
- </p><p>The advantage of --enable-cxx-flags over setting CXXFLAGS in
- the 'make' environment is that, if files are automatically
- rebuilt, the same flags will be used when compiling those files
- as well, so that everything matches.
- </p><p>Fun flags to try might include combinations of
- </p><pre class="programlisting">
- -fstrict-aliasing
- -fno-exceptions
- -ffunction-sections
- -fvtable-gc</pre><p>and opposite forms (-fno-) of the same. Tell us (the libstdc++
- mailing list) if you discover more!
- </p></dd><dt><span class="term"><code class="code">--enable-c99</code></span></dt><dd><p>The "long long" type was introduced in C99, along
- with many other functions for wide characters, and math
- classification macros, etc. If enabled, all C99 functions not
- specified by the C++ standard will be put into <code class="code">namespace
- __gnu_cxx</code>, and then all these names will
- be injected into namespace std, so that C99 functions can be
- used "as if" they were in the C++ standard (as they
- will eventually be in some future revision of the standard,
- without a doubt). By default, C99 support is on, assuming the
- configure probes find all the necessary functions and bits
- necessary. This option can change the library ABI.
- </p></dd><dt><span class="term"><code class="code">--enable-wchar_t</code>[default]</span></dt><dd><p>Template specializations for the "wchar_t" type are
- required for wide character conversion support. Disabling
- wide character specializations may be expedient for initial
- porting efforts, but builds only a subset of what is required by
- ISO, and is not recommended. By default, this option is on.
- This option can change the library ABI.
- </p></dd><dt><span class="term"><code class="code">--enable-long-long </code></span></dt><dd><p>The "long long" type was introduced in C99. It is
- provided as a GNU extension to C++98 in g++. This flag builds
- support for "long long" into the library (specialized
- templates and the like for iostreams). This option is on by default:
- if enabled, users will have to either use the new-style "C"
- headers by default (i.e., &lt;cmath&gt; not &lt;math.h&gt;)
- or add appropriate compile-time flags to all compile lines to
- allow "C" visibility of this feature (on GNU/Linux,
- the flag is -D_ISOC99_SOURCE, which is added automatically via
- CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE).
- This option can change the library ABI.
- </p></dd><dt><span class="term"><code class="code">--enable-fully-dynamic-string</code></span></dt><dd><p>This option enables a special version of basic_string avoiding
- the optimization that allocates empty objects in static memory.
- Mostly useful together with shared memory allocators, see PR
- libstdc++/16612 for details.
- </p></dd><dt><span class="term"><code class="code">--enable-concept-checks</code></span></dt><dd><p>This turns on additional compile-time checks for instantiated
- library templates, in the form of specialized templates,
- <a class="ulink" href="19_diagnostics/howto.html#3" target="_top">described here</a>. They
- can help users discover when they break the rules of the STL, before
- their programs run.
- </p></dd><dt><span class="term"><code class="code">--enable-symvers[=style]</code></span></dt><dd><p>In 3.1 and later, tries to turn on symbol versioning in the
- shared library (if a shared library has been
- requested). Values for 'style' that are currently supported
- are 'gnu', 'gnu-versioned-namespace', 'darwin', and
- 'darwin-export'. Both gnu- options require that a recent
- version of the GNU linker be in use. Both darwin options are
- equivalent. With no style given, the configure script will try
- to guess correct defaults for the host system, probe to see if
- additional requirements are necessary and present for
- activation, and if so, will turn symbol versioning on. This
- option can change the library ABI.
- </p></dd><dt><span class="term"><code class="code">--enable-visibility</code></span></dt><dd><p> In 4.2 and later, enables or disables visibility attributes.
- If enabled (as by default), and the compiler seems capable of
- passing the simple sanity checks thrown at it, adjusts items
- in namespace std, namespace std::tr1, and namespace __gnu_cxx
- so that -fvisibility options work.
- </p></dd><dt><span class="term"><code class="code">--enable-libstdcxx-pch</code></span></dt><dd><p>In 3.4 and later, tries to turn on the generation of
- stdc++.h.gch, a pre-compiled file including all the standard
- C++ includes. If enabled (as by default), and the compiler
- seems capable of passing the simple sanity checks thrown at
- it, try to build stdc++.h.gch as part of the make process.
- In addition, this generated file is used later on (by appending <code class="code">
- --include bits/stdc++.h </code> to CXXFLAGS) when running the
- testsuite.
- </p></dd><dt><span class="term"><code class="code">--disable-hosted-libstdcxx</code></span></dt><dd><p>
- By default, a complete <span class="emphasis"><em>hosted</em></span> C++ library is
- built. The C++ Standard also describes a
- <span class="emphasis"><em>freestanding</em></span> environment, in which only a
- minimal set of headers are provided. This option builds such an
- environment.
- </p></dd></dl></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt01ch01s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="intro.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="build.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Bugs </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Build</td></tr></table></div></body></html>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 2. Setup</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="start" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="intro.html" title="Part I. Introduction" /><link rel="prev" href="bk01pt01ch01s03.html" title="Bugs" /><link rel="next" href="configure.html" title="Configure" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. Setup</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt01ch01s03.html">Prev</a> </td><th width="60%" align="center">Part I. Introduction</th><td width="20%" align="right"> <a accesskey="n" href="configure.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.intro.setup"></a>Chapter 2. Setup</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="bk01pt01ch02.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="sect1"><a href="configure.html">Configure</a></span></dt><dt><span class="sect1"><a href="bk01pt01ch02s03.html">Make</a></span></dt><dt><span class="sect1"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="sect2"><a href="test.html#test.organization">Organization</a></span></dt><dt><span class="sect2"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="sect2"><a href="test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="sect2"><a href="test.html#test.harness">Test Harness and Utilities</a></span></dt></dl></dd></dl></div><p>To transform libstdc++ sources into installed include files
+ and properly built binaries useful for linking to other software is
+ a multi-step process. Steps include getting the sources,
+ configuring and building the sources, testing, and installation.
+ </p><p>The general outline of commands is something like:
+ </p><pre class="programlisting">
+ <span class="emphasis"><em>get gcc sources</em></span>
+ <span class="emphasis"><em>extract into gccsrcdir</em></span>
+ mkdir <span class="emphasis"><em>gccbuilddir</em></span>
+ cd <span class="emphasis"><em>gccbuilddir</em></span>
+ <span class="emphasis"><em>gccsrcdir</em></span>/configure --prefix=<span class="emphasis"><em>destdir</em></span> --other-opts...
+ make
+ make check
+ make install
+ </pre><p>
+ Each step is described in more detail in the following sections.
+ </p><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.setup.prereq"></a>Prerequisites</h2></div></div></div><p>
+ Because libstdc++ is part of GCC, the primary source for
+ installation instructions is
+ <a class="ulink" href="http://gcc.gnu.org/install/" target="_top">the GCC install page</a>.
+ In particular, list of prerequisite software needed to build the library
+ <a class="ulink" href="http://gcc.gnu.org/install/prerequisites.html" target="_top">
+ starts with those requirements.</a> The same pages also list
+ the tools you will need if you wish to modify the source.
+</p><p>
+ Additional data is given here only where it applies to libstdc++.
+ </p><p>As of GCC 4.0.1 the minimum version of binutils required to build
+ libstdc++ is <code class="code">2.15.90.0.1.1</code>. You can get snapshots
+ (as well as releases) of binutils from
+ <a class="ulink" href="ftp://sources.redhat.com/pub/binutils" target="_top">
+ ftp://sources.redhat.com/pub/binutils</a>.
+ Older releases of libstdc++ do not require such a recent version,
+ but to take full advantage of useful space-saving features and
+ bug-fixes you should use a recent binutils whenever possible.
+ The configure process will automatically detect and use these
+ features if the underlying support is present.
+ </p><p>
+ Finally, a few system-specific requirements:
+ </p><div class="variablelist"><dl><dt><span class="term">linux</span></dt><dd><p>
+ If gcc 3.1.0 or later on is being used on linux, an attempt
+ will be made to use "C" library functionality necessary for
+ C++ named locale support. For gcc 3.2.1 and later, this
+ means that glibc 2.2.5 or later is required and the "C"
+ library de_DE locale information must be installed.
+ </p><p>
+ Note however that the sanity checks involving the de_DE
+ locale are skipped when an explicit --enable-clocale=gnu
+ configure option is used: only the basic checks are carried
+ out, defending against misconfigurations.
+ </p><p>
+ If the 'gnu' locale model is being used, the following
+ locales are used and tested in the libstdc++ testsuites.
+ The first column is the name of the locale, the second is
+ the character set it is expected to use.
+ </p><pre class="programlisting">
+de_DE ISO-8859-1
+de_DE@euro ISO-8859-15
+en_HK ISO-8859-1
+en_PH ISO-8859-1
+en_US ISO-8859-1
+en_US.ISO-8859-1 ISO-8859-1
+en_US.ISO-8859-15 ISO-8859-15
+en_US.UTF-8 UTF-8
+es_ES ISO-8859-1
+es_MX ISO-8859-1
+fr_FR ISO-8859-1
+fr_FR@euro ISO-8859-15
+is_IS UTF-8
+it_IT ISO-8859-1
+ja_JP.eucjp EUC-JP
+se_NO.UTF-8 UTF-8
+ta_IN UTF-8
+zh_TW BIG5
+</pre><p>Failure to have the underlying "C" library locale
+ information installed will mean that C++ named locales for the
+ above regions will not work: because of this, the libstdc++
+ testsuite will skip the named locale tests. If this isn't an
+ issue, don't worry about it. If named locales are needed, the
+ underlying locale information must be installed. Note that
+ rebuilding libstdc++ after the "C" locales are installed is not
+ necessary.
+ </p><p>
+ To install support for locales, do only one of the following:
+ </p><div class="itemizedlist"><ul type="disc"><li><p>install all locales</p><div class="itemizedlist"><ul type="circle"><li><p>with RedHat Linux:
+ </p><p> <code class="code"> export LC_ALL=C </code>
+ </p><p> <code class="code"> rpm -e glibc-common --nodeps </code>
+ </p><p>
+ <code class="code"> rpm -i --define "_install_langs all"
+ glibc-common-2.2.5-34.i386.rpm
+ </code>
+ </p></li><li><p>
+ Instructions for other operating systems solicited.
+ </p></li></ul></div></li><li><p>install just the necessary locales</p><div class="itemizedlist"><ul type="circle"><li><p>with Debian Linux:</p><p> Add the above list, as shown, to the file
+ <code class="code">/etc/locale.gen</code> </p><p> run <code class="code">/usr/sbin/locale-gen</code> </p></li><li><p>on most Unix-like operating systems:</p><p><code class="code"> localedef -i de_DE -f ISO-8859-1 de_DE </code></p><p>(repeat for each entry in the above list) </p></li><li><p>
+ Instructions for other operating systems solicited.
+ </p></li></ul></div></li></ul></div></dd></dl></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt01ch01s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="intro.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="configure.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Bugs </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Configure</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt01ch03s02.html b/libstdc++-v3/doc/html/manual/bk01pt01ch03s02.html
index ba8763dec0e..d3dd827cf7d 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt01ch03s02.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt01ch03s02.html
@@ -20,14 +20,14 @@
upcoming 200x standard.
</p><p>
C++98/03 include files. These are available in the default compilation mode, i.e. <code class="code">-std=c++98</code> or <code class="code">-std=gnu++98</code>.
- </p><div class="table"><a id="id394301"></a><p class="title"><b>Table 3.1. C++ 1998 Library Headers</b></p><div class="table-contents"><table summary="C++ 1998 Library Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col /></colgroup><tbody><tr><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="filename">iomanip</code></td><td align="left"><code class="filename">list</code></td><td align="left"><code class="filename">ostream</code></td><td align="left"><code class="filename">streambuf</code></td></tr><tr><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="filename">ios</code></td><td align="left"><code class="filename">locale</code></td><td align="left"><code class="filename">queue</code></td><td align="left"><code class="filename">string</code></td></tr><tr><td align="left"><code class="filename">complex</code></td><td align="left"><code class="filename">iosfwd</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="filename">typeinfo</code></td></tr><tr><td align="left"><code class="filename">deque</code></td><td align="left"><code class="filename">iostream</code></td><td align="left"><code class="filename">memory</code></td><td align="left"><code class="filename">sstream</code></td><td align="left"><code class="filename">utility</code></td></tr><tr><td align="left"><code class="filename">exception</code></td><td align="left"><code class="filename">istream</code></td><td align="left"><code class="filename">new</code></td><td align="left"><code class="filename">stack</code></td><td align="left"><code class="filename">valarray</code></td></tr><tr><td align="left"><code class="filename">fstream</code></td><td align="left"><code class="filename">iterator</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="filename">stdexcept</code></td><td align="left"><code class="filename">vector</code></td></tr><tr><td align="left"><code class="filename">functional</code></td><td align="left"><code class="filename">limits</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id440630"></a><p class="title"><b>Table 3.2. C++ 1998 Library Headers for C Library Facilities</b></p><div class="table-contents"><table summary="C++ 1998 Library Headers for C Library Facilities" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col /></colgroup><tbody><tr><td align="left"><code class="filename">cassert</code></td><td align="left"><code class="filename">ciso646</code></td><td align="left"><code class="filename">csetjmp</code></td><td align="left"><code class="filename">cstdio</code></td><td align="left"><code class="filename">ctime</code></td></tr><tr><td align="left"><code class="filename">cctype</code></td><td align="left"><code class="filename">climits</code></td><td align="left"><code class="filename">csignal</code></td><td align="left"><code class="filename">cstdlib</code></td><td align="left"><code class="filename">cwchar</code></td></tr><tr><td align="left"><code class="filename">cerrno</code></td><td align="left"><code class="filename">clocale</code></td><td align="left"><code class="filename">cstdarg</code></td><td align="left"><code class="filename">cstring</code></td><td align="left"><code class="filename">cwctype</code></td></tr><tr><td align="left"><code class="filename">cfloat</code></td><td align="left"><code class="filename">cmath</code></td><td align="left"><code class="filename">cstddef</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p>C++0x include files. These are only available in C++0x compilation mode, i.e. <code class="code">-std=c++0x</code> or <code class="code">-std=gnu++0x</code>.
-</p><p></p><div class="table"><a id="id382991"></a><p class="title"><b>Table 3.3. C++ 200x Library Headers</b></p><div class="table-contents"><table summary="C++ 200x Library Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col /></colgroup><tbody><tr><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="filename">iomanip</code></td><td align="left"><code class="filename">locale</code></td><td align="left"><code class="filename">regex</code></td><td align="left"><code class="filename">tuple</code></td></tr><tr><td align="left"><code class="filename">array</code></td><td align="left"><code class="filename">ios</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="filename">typeinfo</code></td></tr><tr><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="filename">iosfwd</code></td><td align="left"><code class="filename">memory</code></td><td align="left"><code class="filename">sstream</code></td><td align="left"><code class="filename">type_traits</code></td></tr><tr><td align="left"><code class="filename">complex</code></td><td align="left"><code class="filename">iostream</code></td><td align="left"><code class="filename">new</code></td><td align="left"><code class="filename">stack</code></td><td align="left"><code class="filename">unordered_map</code></td></tr><tr><td align="left"><code class="filename">deque</code></td><td align="left"><code class="filename">istream</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="filename">stdexcept</code></td><td align="left"><code class="filename">unordered_set</code></td></tr><tr><td align="left"><code class="filename">exception</code></td><td align="left"><code class="filename">iterator</code></td><td align="left"><code class="filename">ostream</code></td><td align="left"><code class="filename">streambuf</code></td><td align="left"><code class="filename">utility</code></td></tr><tr><td align="left"><code class="filename">fstream</code></td><td align="left"><code class="filename">limits</code></td><td align="left"><code class="filename">queue</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="filename">valarray</code></td></tr><tr><td align="left"><code class="filename">functional</code></td><td align="left"><code class="filename">list</code></td><td align="left"><code class="filename">random</code></td><td align="left"><code class="filename">system_error</code></td><td align="left"><code class="filename">vector</code></td></tr><tr><td align="left"><code class="filename">condition_variable</code></td><td align="left"><code class="filename">mutex</code></td><td align="left"><code class="filename">thread</code></td><td align="left"> </td><td align="left"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id425965"></a><p class="title"><b>Table 3.4. C++ 200x Library Headers for C Library Facilities</b></p><div class="table-contents"><table summary="C++ 200x Library Headers for C Library Facilities" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">cassert</code></td><td align="left"><code class="filename">cfloat</code></td><td align="left"><code class="filename">cmath</code></td><td align="left"><code class="filename">cstddef</code></td><td align="left"><code class="filename">ctgmath</code></td></tr><tr><td align="left"><code class="filename">ccomplex</code></td><td align="left"><code class="filename">cinttypes</code></td><td align="left"><code class="filename">csetjmp</code></td><td align="left"><code class="filename">cstdint</code></td><td align="left"><code class="filename">ctime</code></td></tr><tr><td align="left"><code class="filename">cctype</code></td><td align="left"><code class="filename">ciso646</code></td><td align="left"><code class="filename">csignal</code></td><td align="left"><code class="filename">cstdio</code></td><td align="left"><code class="filename">cuchar</code></td></tr><tr><td align="left"><code class="filename">cerrno</code></td><td align="left"><code class="filename">climits</code></td><td align="left"><code class="filename">cstdarg</code></td><td align="left"><code class="filename">cstdlib</code></td><td align="left"><code class="filename">cwchar</code></td></tr><tr><td align="left"><code class="filename">cfenv</code></td><td align="left"><code class="filename">clocale</code></td><td align="left"><code class="filename">cstdbool</code></td><td align="left"><code class="filename">cstring</code></td><td align="left"><code class="filename">cwctype</code></td></tr><tr><td align="left"><code class="filename">cstdatomic</code></td><td align="left"> </td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr></tbody></table></div></div><br class="table-break" /><p>
+ </p><div class="table"><a id="id505554"></a><p class="title"><b>Table 3.1. C++ 1998 Library Headers</b></p><div class="table-contents"><table summary="C++ 1998 Library Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col /></colgroup><tbody><tr><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="filename">iomanip</code></td><td align="left"><code class="filename">list</code></td><td align="left"><code class="filename">ostream</code></td><td align="left"><code class="filename">streambuf</code></td></tr><tr><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="filename">ios</code></td><td align="left"><code class="filename">locale</code></td><td align="left"><code class="filename">queue</code></td><td align="left"><code class="filename">string</code></td></tr><tr><td align="left"><code class="filename">complex</code></td><td align="left"><code class="filename">iosfwd</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="filename">typeinfo</code></td></tr><tr><td align="left"><code class="filename">deque</code></td><td align="left"><code class="filename">iostream</code></td><td align="left"><code class="filename">memory</code></td><td align="left"><code class="filename">sstream</code></td><td align="left"><code class="filename">utility</code></td></tr><tr><td align="left"><code class="filename">exception</code></td><td align="left"><code class="filename">istream</code></td><td align="left"><code class="filename">new</code></td><td align="left"><code class="filename">stack</code></td><td align="left"><code class="filename">valarray</code></td></tr><tr><td align="left"><code class="filename">fstream</code></td><td align="left"><code class="filename">iterator</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="filename">stdexcept</code></td><td align="left"><code class="filename">vector</code></td></tr><tr><td align="left"><code class="filename">functional</code></td><td align="left"><code class="filename">limits</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id476402"></a><p class="title"><b>Table 3.2. C++ 1998 Library Headers for C Library Facilities</b></p><div class="table-contents"><table summary="C++ 1998 Library Headers for C Library Facilities" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col /></colgroup><tbody><tr><td align="left"><code class="filename">cassert</code></td><td align="left"><code class="filename">ciso646</code></td><td align="left"><code class="filename">csetjmp</code></td><td align="left"><code class="filename">cstdio</code></td><td align="left"><code class="filename">ctime</code></td></tr><tr><td align="left"><code class="filename">cctype</code></td><td align="left"><code class="filename">climits</code></td><td align="left"><code class="filename">csignal</code></td><td align="left"><code class="filename">cstdlib</code></td><td align="left"><code class="filename">cwchar</code></td></tr><tr><td align="left"><code class="filename">cerrno</code></td><td align="left"><code class="filename">clocale</code></td><td align="left"><code class="filename">cstdarg</code></td><td align="left"><code class="filename">cstring</code></td><td align="left"><code class="filename">cwctype</code></td></tr><tr><td align="left"><code class="filename">cfloat</code></td><td align="left"><code class="filename">cmath</code></td><td align="left"><code class="filename">cstddef</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p>C++0x include files. These are only available in C++0x compilation mode, i.e. <code class="code">-std=c++0x</code> or <code class="code">-std=gnu++0x</code>.
+</p><p></p><div class="table"><a id="id541430"></a><p class="title"><b>Table 3.3. C++ 200x Library Headers</b></p><div class="table-contents"><table summary="C++ 200x Library Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col /></colgroup><tbody><tr><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="filename">iomanip</code></td><td align="left"><code class="filename">locale</code></td><td align="left"><code class="filename">regex</code></td><td align="left"><code class="filename">tuple</code></td></tr><tr><td align="left"><code class="filename">array</code></td><td align="left"><code class="filename">ios</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="filename">typeinfo</code></td></tr><tr><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="filename">iosfwd</code></td><td align="left"><code class="filename">memory</code></td><td align="left"><code class="filename">sstream</code></td><td align="left"><code class="filename">type_traits</code></td></tr><tr><td align="left"><code class="filename">complex</code></td><td align="left"><code class="filename">iostream</code></td><td align="left"><code class="filename">new</code></td><td align="left"><code class="filename">stack</code></td><td align="left"><code class="filename">unordered_map</code></td></tr><tr><td align="left"><code class="filename">deque</code></td><td align="left"><code class="filename">istream</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="filename">stdexcept</code></td><td align="left"><code class="filename">unordered_set</code></td></tr><tr><td align="left"><code class="filename">exception</code></td><td align="left"><code class="filename">iterator</code></td><td align="left"><code class="filename">ostream</code></td><td align="left"><code class="filename">streambuf</code></td><td align="left"><code class="filename">utility</code></td></tr><tr><td align="left"><code class="filename">fstream</code></td><td align="left"><code class="filename">limits</code></td><td align="left"><code class="filename">queue</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="filename">valarray</code></td></tr><tr><td align="left"><code class="filename">functional</code></td><td align="left"><code class="filename">list</code></td><td align="left"><code class="filename">random</code></td><td align="left"><code class="filename">system_error</code></td><td align="left"><code class="filename">vector</code></td></tr><tr><td align="left"><code class="filename">condition_variable</code></td><td align="left"><code class="filename">mutex</code></td><td align="left"><code class="filename">thread</code></td><td align="left"> </td><td align="left"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id489256"></a><p class="title"><b>Table 3.4. C++ 200x Library Headers for C Library Facilities</b></p><div class="table-contents"><table summary="C++ 200x Library Headers for C Library Facilities" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">cassert</code></td><td align="left"><code class="filename">cfloat</code></td><td align="left"><code class="filename">cmath</code></td><td align="left"><code class="filename">cstddef</code></td><td align="left"><code class="filename">ctgmath</code></td></tr><tr><td align="left"><code class="filename">ccomplex</code></td><td align="left"><code class="filename">cinttypes</code></td><td align="left"><code class="filename">csetjmp</code></td><td align="left"><code class="filename">cstdint</code></td><td align="left"><code class="filename">ctime</code></td></tr><tr><td align="left"><code class="filename">cctype</code></td><td align="left"><code class="filename">ciso646</code></td><td align="left"><code class="filename">csignal</code></td><td align="left"><code class="filename">cstdio</code></td><td align="left"><code class="filename">cuchar</code></td></tr><tr><td align="left"><code class="filename">cerrno</code></td><td align="left"><code class="filename">climits</code></td><td align="left"><code class="filename">cstdarg</code></td><td align="left"><code class="filename">cstdlib</code></td><td align="left"><code class="filename">cwchar</code></td></tr><tr><td align="left"><code class="filename">cfenv</code></td><td align="left"><code class="filename">clocale</code></td><td align="left"><code class="filename">cstdbool</code></td><td align="left"><code class="filename">cstring</code></td><td align="left"><code class="filename">cwctype</code></td></tr><tr><td align="left"><code class="filename">cstdatomic</code></td><td align="left"> </td><td align="left"> </td><td align="left"> </td><td align="left"> </td></tr></tbody></table></div></div><br class="table-break" /><p>
In addition, TR1 includes as:
-</p><div class="table"><a id="id442369"></a><p class="title"><b>Table 3.5. C++ TR1 Library Headers</b></p><div class="table-contents"><table summary="C++ TR1 Library Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">tr1/array</code></td><td align="left"><code class="filename">tr1/memory</code></td><td align="left"><code class="filename">tr1/regex</code></td><td align="left"><code class="filename">tr1/type_traits</code></td><td align="left"><code class="filename">tr1/unordered_set</code></td></tr><tr><td align="left"><code class="filename">tr1/complex</code></td><td align="left"><code class="filename">tr1/random</code></td><td align="left"><code class="filename">tr1/tuple</code></td><td align="left"><code class="filename">tr1/unordered_map</code></td><td align="left"><code class="filename">tr1/utility</code></td></tr><tr><td align="left"><code class="filename">tr1/functional</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id401478"></a><p class="title"><b>Table 3.6. C++ TR1 Library Headers for C Library Facilities</b></p><div class="table-contents"><table summary="C++ TR1 Library Headers for C Library Facilities" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">tr1/cmath</code></td><td align="left"><code class="filename">tr1/cfloat</code></td><td align="left"><code class="filename">tr1/cstdarg</code></td><td align="left"><code class="filename">tr1/cstdio</code></td><td align="left"><code class="filename">tr1/ctime</code></td></tr><tr><td align="left"><code class="filename">tr1/ccomplex</code></td><td align="left"><code class="filename">tr1/cinttypes</code></td><td align="left"><code class="filename">tr1/cstdbool</code></td><td align="left"><code class="filename">tr1/cstdlib</code></td><td align="left"><code class="filename">tr1/cwchar</code></td></tr><tr><td align="left"><code class="filename">tr1/cfenv</code></td><td align="left"><code class="filename">tr1/climits</code></td><td align="left"><code class="filename">tr1/cstdint</code></td><td align="left"><code class="filename">tr1/ctgmath</code></td><td align="left"><code class="filename">tr1/cwctype</code></td></tr></tbody></table></div></div><br class="table-break" /><p>
+</p><div class="table"><a id="id492746"></a><p class="title"><b>Table 3.5. C++ TR1 Library Headers</b></p><div class="table-contents"><table summary="C++ TR1 Library Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">tr1/array</code></td><td align="left"><code class="filename">tr1/memory</code></td><td align="left"><code class="filename">tr1/regex</code></td><td align="left"><code class="filename">tr1/type_traits</code></td><td align="left"><code class="filename">tr1/unordered_set</code></td></tr><tr><td align="left"><code class="filename">tr1/complex</code></td><td align="left"><code class="filename">tr1/random</code></td><td align="left"><code class="filename">tr1/tuple</code></td><td align="left"><code class="filename">tr1/unordered_map</code></td><td align="left"><code class="filename">tr1/utility</code></td></tr><tr><td align="left"><code class="filename">tr1/functional</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id535005"></a><p class="title"><b>Table 3.6. C++ TR1 Library Headers for C Library Facilities</b></p><div class="table-contents"><table summary="C++ TR1 Library Headers for C Library Facilities" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">tr1/cmath</code></td><td align="left"><code class="filename">tr1/cfloat</code></td><td align="left"><code class="filename">tr1/cstdarg</code></td><td align="left"><code class="filename">tr1/cstdio</code></td><td align="left"><code class="filename">tr1/ctime</code></td></tr><tr><td align="left"><code class="filename">tr1/ccomplex</code></td><td align="left"><code class="filename">tr1/cinttypes</code></td><td align="left"><code class="filename">tr1/cstdbool</code></td><td align="left"><code class="filename">tr1/cstdlib</code></td><td align="left"><code class="filename">tr1/cwchar</code></td></tr><tr><td align="left"><code class="filename">tr1/cfenv</code></td><td align="left"><code class="filename">tr1/climits</code></td><td align="left"><code class="filename">tr1/cstdint</code></td><td align="left"><code class="filename">tr1/ctgmath</code></td><td align="left"><code class="filename">tr1/cwctype</code></td></tr></tbody></table></div></div><br class="table-break" /><p>
Also included are files for the C++ ABI interface:
-</p><div class="table"><a id="id435323"></a><p class="title"><b>Table 3.7. C++ ABI Headers</b></p><div class="table-contents"><table summary="C++ ABI Headers" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">cxxabi.h</code></td><td align="left"><code class="filename">cxxabi_forced.h</code></td></tr></tbody></table></div></div><br class="table-break" /><p>
+</p><div class="table"><a id="id484224"></a><p class="title"><b>Table 3.7. C++ ABI Headers</b></p><div class="table-contents"><table summary="C++ ABI Headers" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">cxxabi.h</code></td><td align="left"><code class="filename">cxxabi_forced.h</code></td></tr></tbody></table></div></div><br class="table-break" /><p>
And a large variety of extensions.
-</p><div class="table"><a id="id432329"></a><p class="title"><b>Table 3.8. Extension Headers</b></p><div class="table-contents"><table summary="Extension Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">ext/algorithm</code></td><td align="left"><code class="filename">ext/debug_allocator.h</code></td><td align="left"><code class="filename">ext/mt_allocator.h</code></td><td align="left"><code class="filename">ext/pod_char_traits.h</code></td><td align="left"><code class="filename">ext/stdio_sync_filebuf.h</code></td></tr><tr><td align="left"><code class="filename">ext/array_allocator.h</code></td><td align="left"><code class="filename">ext/enc_filebuf.h</code></td><td align="left"><code class="filename">ext/new_allocator.h</code></td><td align="left"><code class="filename">ext/pool_allocator.h</code></td><td align="left"><code class="filename">ext/throw_allocator.h</code></td></tr><tr><td align="left"><code class="filename">ext/atomicity.h</code></td><td align="left"><code class="filename">ext/functional</code></td><td align="left"><code class="filename">ext/numeric</code></td><td align="left"><code class="filename">ext/rb_tree</code></td><td align="left"><code class="filename">ext/typelist.h</code></td></tr><tr><td align="left"><code class="filename">ext/bitmap_allocator.h</code></td><td align="left"><code class="filename">ext/iterator</code></td><td align="left"><code class="filename">ext/numeric_traits.h</code></td><td align="left"><code class="filename">ext/rope</code></td><td align="left"><code class="filename">ext/type_traits.h</code></td></tr><tr><td align="left"><code class="filename">ext/codecvt_specializations.h</code></td><td align="left"><code class="filename">ext/malloc_allocator.h</code></td><td align="left"><code class="filename">ext/pb_ds/assoc_container.h</code></td><td align="left"><code class="filename">ext/slist</code></td><td align="left"><code class="filename">ext/vstring.h</code></td></tr><tr><td align="left"><code class="filename">ext/concurrence.h</code></td><td align="left"><code class="filename">ext/memory</code></td><td align="left"><code class="filename">ext/pb_ds/priority_queue.h</code></td><td align="left"><code class="filename">ext/stdio_filebuf.h</code></td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id440887"></a><p class="title"><b>Table 3.9. Extension Debug Headers</b></p><div class="table-contents"><table summary="Extension Debug Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">debug/bitset</code></td><td align="left"><code class="filename">debug/list</code></td><td align="left"><code class="filename">debug/set</code></td><td align="left"><code class="filename">debug/unordered_map</code></td><td align="left"><code class="filename">debug/vector</code></td></tr><tr><td align="left"><code class="filename">debug/deque</code></td><td align="left"><code class="filename">debug/map</code></td><td align="left"><code class="filename">debug/string</code></td><td align="left"><code class="filename">debug/unordered_set</code></td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id457206"></a><p class="title"><b>Table 3.10. Extension Parallel Headers</b></p><div class="table-contents"><table summary="Extension Parallel Headers" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">parallel/algorithm</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr></tbody></table></div></div><br class="table-break" /></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.headers.mixing"></a>Mixing Headers</h3></div></div></div><p> A few simple rules.
+</p><div class="table"><a id="id538981"></a><p class="title"><b>Table 3.8. Extension Headers</b></p><div class="table-contents"><table summary="Extension Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">ext/algorithm</code></td><td align="left"><code class="filename">ext/debug_allocator.h</code></td><td align="left"><code class="filename">ext/mt_allocator.h</code></td><td align="left"><code class="filename">ext/pod_char_traits.h</code></td><td align="left"><code class="filename">ext/stdio_sync_filebuf.h</code></td></tr><tr><td align="left"><code class="filename">ext/array_allocator.h</code></td><td align="left"><code class="filename">ext/enc_filebuf.h</code></td><td align="left"><code class="filename">ext/new_allocator.h</code></td><td align="left"><code class="filename">ext/pool_allocator.h</code></td><td align="left"><code class="filename">ext/throw_allocator.h</code></td></tr><tr><td align="left"><code class="filename">ext/atomicity.h</code></td><td align="left"><code class="filename">ext/functional</code></td><td align="left"><code class="filename">ext/numeric</code></td><td align="left"><code class="filename">ext/rb_tree</code></td><td align="left"><code class="filename">ext/typelist.h</code></td></tr><tr><td align="left"><code class="filename">ext/bitmap_allocator.h</code></td><td align="left"><code class="filename">ext/iterator</code></td><td align="left"><code class="filename">ext/numeric_traits.h</code></td><td align="left"><code class="filename">ext/rope</code></td><td align="left"><code class="filename">ext/type_traits.h</code></td></tr><tr><td align="left"><code class="filename">ext/codecvt_specializations.h</code></td><td align="left"><code class="filename">ext/malloc_allocator.h</code></td><td align="left"><code class="filename">ext/pb_ds/assoc_container.h</code></td><td align="left"><code class="filename">ext/slist</code></td><td align="left"><code class="filename">ext/vstring.h</code></td></tr><tr><td align="left"><code class="filename">ext/concurrence.h</code></td><td align="left"><code class="filename">ext/memory</code></td><td align="left"><code class="filename">ext/pb_ds/priority_queue.h</code></td><td align="left"><code class="filename">ext/stdio_filebuf.h</code></td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id483812"></a><p class="title"><b>Table 3.9. Extension Debug Headers</b></p><div class="table-contents"><table summary="Extension Debug Headers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">debug/bitset</code></td><td align="left"><code class="filename">debug/list</code></td><td align="left"><code class="filename">debug/set</code></td><td align="left"><code class="filename">debug/unordered_map</code></td><td align="left"><code class="filename">debug/vector</code></td></tr><tr><td align="left"><code class="filename">debug/deque</code></td><td align="left"><code class="filename">debug/map</code></td><td align="left"><code class="filename">debug/string</code></td><td align="left"><code class="filename">debug/unordered_set</code></td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p></p><div class="table"><a id="id479085"></a><p class="title"><b>Table 3.10. Extension Parallel Headers</b></p><div class="table-contents"><table summary="Extension Parallel Headers" border="1"><colgroup><col align="left" /><col align="left" /></colgroup><tbody><tr><td align="left"><code class="filename">parallel/algorithm</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr></tbody></table></div></div><br class="table-break" /></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.using.headers.mixing"></a>Mixing Headers</h3></div></div></div><p> A few simple rules.
</p><p>First, mixing different dialects of the standard headers is not
possible. It's an all-or-nothing affair. Thus, code like
</p><pre class="programlisting">
diff --git a/libstdc++-v3/doc/html/manual/bk01pt01ch03s04.html b/libstdc++-v3/doc/html/manual/bk01pt01ch03s04.html
index 48002e7e6c4..87423b10658 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt01ch03s04.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt01ch03s04.html
@@ -22,7 +22,7 @@
listed.</p><p>“<span class="quote">Configurable</span>†(or “<span class="quote">Not configurable</span>â€) means
that the symbol is initially chosen (or not) based on
--enable/--disable options at library build and configure time
- (documented <a class="link" href="bk01pt01ch02.html#manual.intro.setup.configure" title="Configure">here</a>), with the
+ (documented <a class="link" href="configure.html" title="Configure">here</a>), with the
various --enable/--disable choices being translated to
#define/#undef).
</p><p> <acronym class="acronym">ABI</acronym> means that changing from the default value may
diff --git a/libstdc++-v3/doc/html/manual/bk01pt02pr01.html b/libstdc++-v3/doc/html/manual/bk01pt02pr01.html
index 6f7451e9ae7..88f2cd62f4d 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt02pr01.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt02pr01.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="start" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="support.html" title="Part II. Support" /><link rel="prev" href="support.html" title="Part II. Support" /><link rel="next" href="bk01pt02ch04.html" title="Chapter 4. Types" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="support.html">Prev</a> </td><th width="60%" align="center">Part II. Support</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt02ch04.html">Next</a></td></tr></table><hr /></div><div class="preface" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id450521"></a></h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="start" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="support.html" title="Part II. Support" /><link rel="prev" href="support.html" title="Part II. Support" /><link rel="next" href="bk01pt02ch04.html" title="Chapter 4. Types" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="support.html">Prev</a> </td><th width="60%" align="center">Part II. Support</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt02ch04.html">Next</a></td></tr></table><hr /></div><div class="preface" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id483158"></a></h2></div></div></div><p>
This part deals with the functions called and objects created
automatically during the course of a program's existence.
</p><p>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt04ch11.html b/libstdc++-v3/doc/html/manual/bk01pt04ch11.html
index 905be71755b..e4058fa35d3 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt04ch11.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt04ch11.html
@@ -90,7 +90,7 @@
or loading and unloading shared objects in memory. As such, using
caching allocators on systems that do not support
<code class="function">abi::__cxa_atexit</code> is not recommended.
- </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.impl"></a>Implementation</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id388518"></a>Interface Design</h4></div></div></div><p>
+ </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.impl"></a>Implementation</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id493543"></a>Interface Design</h4></div></div></div><p>
The only allocator interface that
is support is the standard C++ interface. As such, all STL
containers have been adjusted, and all external allocators have
@@ -103,7 +103,7 @@
</p><p>
The base class that <code class="classname">allocator</code> is derived from
may not be user-configurable.
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id449357"></a>Selecting Default Allocation Policy</h4></div></div></div><p>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id565976"></a>Selecting Default Allocation Policy</h4></div></div></div><p>
It's difficult to pick an allocation strategy that will provide
maximum utility, without excessively penalizing some behavior. In
fact, it's difficult just deciding which typical actions to measure
@@ -140,7 +140,7 @@
The current default choice for
<code class="classname">allocator</code> is
<code class="classname">__gnu_cxx::new_allocator</code>.
- </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id385486"></a>Disabling Memory Caching</h4></div></div></div><p>
+ </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id506394"></a>Disabling Memory Caching</h4></div></div></div><p>
In use, <code class="classname">allocator</code> may allocate and
deallocate using implementation-specified strategies and
heuristics. Because of this, every call to an allocator object's
@@ -305,11 +305,11 @@
A high-performance allocator that uses a bit-map to keep track
of the used and unused memory locations. It has its own
documentation, found <a class="link" href="bitmap_allocator.html" title="bitmap_allocator">here</a>.
- </p></li></ol></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id336934"></a><p><span class="title"><i>
+ </p></li></ol></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="allocator.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id475582"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++
</i>. </span>
isoc++_1998
- <span class="pagenums">20.4 Memory. </span></p></div><div class="biblioentry"><a id="id336949"></a><p><span class="title"><i>The Standard Librarian: What Are Allocators Good
+ <span class="pagenums">20.4 Memory. </span></p></div><div class="biblioentry"><a id="id491290"></a><p><span class="title"><i>The Standard Librarian: What Are Allocators Good
</i>. </span>
austernm
<span class="author"><span class="firstname">Matt</span> <span class="surname">Austern</span>. </span><span class="publisher"><span class="publishername">
@@ -317,28 +317,28 @@
. </span></span><span class="biblioid">
<a class="ulink" href="http://www.cuj.com/documents/s=8000/cujcexp1812austern/" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id402117"></a><p><span class="title"><i>The Hoard Memory Allocator</i>. </span>
+ . </span></p></div><div class="biblioentry"><a id="id480225"></a><p><span class="title"><i>The Hoard Memory Allocator</i>. </span>
emeryb
<span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span><span class="biblioid">
<a class="ulink" href="http://www.cs.umass.edu/~emery/hoard/" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id386707"></a><p><span class="title"><i>Reconsidering Custom Memory Allocation</i>. </span>
+ . </span></p></div><div class="biblioentry"><a id="id482598"></a><p><span class="title"><i>Reconsidering Custom Memory Allocation</i>. </span>
bergerzorn
<span class="author"><span class="firstname">Emery</span> <span class="surname">Berger</span>. </span><span class="author"><span class="firstname">Ben</span> <span class="surname">Zorn</span>. </span><span class="author"><span class="firstname">Kathryn</span> <span class="surname">McKinley</span>. </span><span class="copyright">Copyright © 2002 OOPSLA. </span><span class="biblioid">
<a class="ulink" href="http://www.cs.umass.edu/~emery/pubs/berger-oopsla2002.pdf" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id404915"></a><p><span class="title"><i>Allocator Types</i>. </span>
+ . </span></p></div><div class="biblioentry"><a id="id502321"></a><p><span class="title"><i>Allocator Types</i>. </span>
kreftlanger
<span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="publisher"><span class="publishername">
C/C++ Users Journal
. </span></span><span class="biblioid">
<a class="ulink" href="http://www.langer.camelot.de/Articles/C++Report/Allocators/Allocators.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id378638"></a><p><span class="title"><i>The C++ Programming Language</i>. </span>
+ . </span></p></div><div class="biblioentry"><a id="id483616"></a><p><span class="title"><i>The C++ Programming Language</i>. </span>
tcpl
<span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 . </span><span class="pagenums">19.4 Allocators. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id401191"></a><p><span class="title"><i>Yalloc: A Recycling C++ Allocator</i>. </span>
+ . </span></span></p></div><div class="biblioentry"><a id="id491902"></a><p><span class="title"><i>Yalloc: A Recycling C++ Allocator</i>. </span>
yenf
<span class="author"><span class="firstname">Felix</span> <span class="surname">Yen</span>. </span><span class="copyright">Copyright © . </span><span class="biblioid">
<a class="ulink" href="http://home.earthlink.net/~brimar/yalloc/" target="_top">
diff --git a/libstdc++-v3/doc/html/manual/bk01pt06ch14.html b/libstdc++-v3/doc/html/manual/bk01pt06ch14.html
index dbfaa8ddf72..faff537bb6b 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt06ch14.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt06ch14.html
@@ -395,25 +395,25 @@ global locale" (emphasis Paolo), that is:
What should non-required facet instantiations do? If the
generic implementation is provided, then how to end-users
provide specializations?
- </p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="locales.locale.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id431371"></a><p><span class="title"><i>
+ </p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="locales.locale.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id476919"></a><p><span class="title"><i>
The GNU C Library
- </i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry"><a id="id446999"></a><p><span class="title"><i>
+ </i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry"><a id="id557982"></a><p><span class="title"><i>
Correspondence
- </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id376809"></a><p><span class="title"><i>
+ </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id472314"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++
- </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id376828"></a><p><span class="title"><i>
+ </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id472332"></a><p><span class="title"><i>
ISO/IEC 9899:1999 Programming languages - C
- </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id401235"></a><p><span class="title"><i>
+ </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id478654"></a><p><span class="title"><i>
System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x)
</i>. </span><span class="copyright">Copyright © 1999
The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span><span class="biblioid">
<a class="ulink" href="http://www.opennc.org/austin/docreg.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id398149"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id478681"></a><p><span class="title"><i>
The C++ Programming Language, Special Edition
</i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id426390"></a><p><span class="title"><i>
+ . </span></span></p></div><div class="biblioentry"><a id="id561217"></a><p><span class="title"><i>
Standard C++ IOStreams and Locales
</i>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
diff --git a/libstdc++-v3/doc/html/manual/bk01pt06ch15.html b/libstdc++-v3/doc/html/manual/bk01pt06ch15.html
index 948928c1a7c..08c35356ec0 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt06ch15.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt06ch15.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 15. Facets aka Categories</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="start" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="localization.html" title="Part VI. Localization" /><link rel="prev" href="bk01pt06ch14.html" title="Chapter 14. Locales" /><link rel="next" href="codecvt.html" title="codecvt" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 15. Facets aka Categories</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt06ch14.html">Prev</a> </td><th width="60%" align="center">Part VI. Localization</th><td width="20%" align="right"> <a accesskey="n" href="codecvt.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.localization.facet"></a>Chapter 15. Facets aka Categories</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="bk01pt06ch15.html#manual.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt06ch15.html#facet.ctype.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="bk01pt06ch15.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="codecvt.html">codecvt</a></span></dt><dd><dl><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.design">Design</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.use">Use</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="messages.html">messages</a></span></dt><dd><dl><dt><span class="sect2"><a href="messages.html#facet.messages.req">Requirements</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.design">Design</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.use">Use</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.localization.facet.ctype"></a>ctype</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="facet.ctype.impl"></a>Implementation</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id373746"></a>Specializations</h4></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 15. Facets aka Categories</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="start" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="localization.html" title="Part VI. Localization" /><link rel="prev" href="bk01pt06ch14.html" title="Chapter 14. Locales" /><link rel="next" href="codecvt.html" title="codecvt" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 15. Facets aka Categories</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt06ch14.html">Prev</a> </td><th width="60%" align="center">Part VI. Localization</th><td width="20%" align="right"> <a accesskey="n" href="codecvt.html">Next</a></td></tr></table><hr /></div><div class="chapter" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="manual.localization.facet"></a>Chapter 15. Facets aka Categories</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="bk01pt06ch15.html#manual.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt06ch15.html#facet.ctype.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="bk01pt06ch15.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="codecvt.html">codecvt</a></span></dt><dd><dl><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.design">Design</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.use">Use</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="messages.html">messages</a></span></dt><dd><dl><dt><span class="sect2"><a href="messages.html#facet.messages.req">Requirements</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.design">Design</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.use">Use</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.localization.facet.ctype"></a>ctype</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="facet.ctype.impl"></a>Implementation</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id468579"></a>Specializations</h4></div></div></div><p>
For the required specialization codecvt&lt;wchar_t, char, mbstate_t&gt; ,
conversions are made between the internal character set (always UCS4
on GNU/Linux) and whatever the currently selected locale for the
@@ -47,25 +47,25 @@ characters.
</p></li><li><p>
Rename abstract base class. See if just smash-overriding is a
better approach. Clarify, add sanity to naming.
- </p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="facet.ctype.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id382630"></a><p><span class="title"><i>
+ </p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="facet.ctype.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id481489"></a><p><span class="title"><i>
The GNU C Library
- </i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry"><a id="id336899"></a><p><span class="title"><i>
+ </i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry"><a id="id482684"></a><p><span class="title"><i>
Correspondence
- </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id433304"></a><p><span class="title"><i>
+ </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id541901"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++
- </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id433322"></a><p><span class="title"><i>
+ </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id541920"></a><p><span class="title"><i>
ISO/IEC 9899:1999 Programming languages - C
- </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id428978"></a><p><span class="title"><i>
+ </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id477212"></a><p><span class="title"><i>
System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x)
</i>. </span><span class="copyright">Copyright © 1999
The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span><span class="biblioid">
<a class="ulink" href="http://www.opennc.org/austin/docreg.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id429006"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id477238"></a><p><span class="title"><i>
The C++ Programming Language, Special Edition
</i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id380310"></a><p><span class="title"><i>
+ . </span></span></p></div><div class="biblioentry"><a id="id546249"></a><p><span class="title"><i>
Standard C++ IOStreams and Locales
</i>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
diff --git a/libstdc++-v3/doc/html/manual/bk01pt09pr02.html b/libstdc++-v3/doc/html/manual/bk01pt09pr02.html
index 93b071c47b7..7fb7fac9b16 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt09pr02.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt09pr02.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; , &#10; algorithm&#10; " /><link rel="start" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="algorithms.html" title="Part IX. Algorithms" /><link rel="prev" href="algorithms.html" title="Part IX. Algorithms" /><link rel="next" href="bk01pt09ch20.html" title="Chapter 20. Mutating" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="algorithms.html">Prev</a> </td><th width="60%" align="center">Part IX. Algorithms</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt09ch20.html">Next</a></td></tr></table><hr /></div><div class="preface" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id457861"></a></h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; , &#10; algorithm&#10; " /><link rel="start" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="algorithms.html" title="Part IX. Algorithms" /><link rel="prev" href="algorithms.html" title="Part IX. Algorithms" /><link rel="next" href="bk01pt09ch20.html" title="Chapter 20. Mutating" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="algorithms.html">Prev</a> </td><th width="60%" align="center">Part IX. Algorithms</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt09ch20.html">Next</a></td></tr></table><hr /></div><div class="preface" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id541597"></a></h2></div></div></div><p>
The neatest accomplishment of the algorithms chapter is that all the
work is done via iterators, not containers directly. This means two
important things:
diff --git a/libstdc++-v3/doc/html/manual/bk01pt12ch30s03.html b/libstdc++-v3/doc/html/manual/bk01pt12ch30s03.html
index d3c60f88747..a24243e185a 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt12ch30s03.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt12ch30s03.html
@@ -19,6 +19,6 @@
mode or with debug mode. The
following table provides the names and headers of the debugging
containers:
-</p><div class="table"><a id="id449953"></a><p class="title"><b>Table 30.1. Debugging Containers</b></p><div class="table-contents"><table summary="Debugging Containers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col /><col /></colgroup><thead><tr><th align="left">Container</th><th align="left">Header</th><th align="left">Debug container</th><th align="left">Debug header</th><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></thead><tbody><tr><td align="left"><code class="classname">std::bitset</code></td><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="classname">__gnu_debug::bitset</code></td><td align="left"><code class="filename">bitset</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::deque</code></td><td align="left"><code class="filename">deque</code></td><td align="left"><code class="classname">__gnu_debug::deque</code></td><td align="left"><code class="filename">deque</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::list</code></td><td align="left"><code class="filename">list</code></td><td align="left"><code class="classname">__gnu_debug::list</code></td><td align="left"><code class="filename">list</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::map</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="classname">__gnu_debug::map</code></td><td align="left"><code class="filename">map</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::multimap</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="classname">__gnu_debug::multimap</code></td><td align="left"><code class="filename">map</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::multiset</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="classname">__gnu_debug::multiset</code></td><td align="left"><code class="filename">set</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::set</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="classname">__gnu_debug::set</code></td><td align="left"><code class="filename">set</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::string</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::string</code></td><td align="left"><code class="filename">string</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::wstring</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::wstring</code></td><td align="left"><code class="filename">string</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::basic_string</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::basic_string</code></td><td align="left"><code class="filename">string</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::vector</code></td><td align="left"><code class="filename">vector</code></td><td align="left"><code class="classname">__gnu_debug::vector</code></td><td align="left"><code class="filename">vector</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p>In addition, when compiling in C++0x mode, these additional
+</p><div class="table"><a id="id479508"></a><p class="title"><b>Table 30.1. Debugging Containers</b></p><div class="table-contents"><table summary="Debugging Containers" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col /><col /></colgroup><thead><tr><th align="left">Container</th><th align="left">Header</th><th align="left">Debug container</th><th align="left">Debug header</th><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></thead><tbody><tr><td align="left"><code class="classname">std::bitset</code></td><td align="left"><code class="filename">bitset</code></td><td align="left"><code class="classname">__gnu_debug::bitset</code></td><td align="left"><code class="filename">bitset</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::deque</code></td><td align="left"><code class="filename">deque</code></td><td align="left"><code class="classname">__gnu_debug::deque</code></td><td align="left"><code class="filename">deque</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::list</code></td><td align="left"><code class="filename">list</code></td><td align="left"><code class="classname">__gnu_debug::list</code></td><td align="left"><code class="filename">list</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::map</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="classname">__gnu_debug::map</code></td><td align="left"><code class="filename">map</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::multimap</code></td><td align="left"><code class="filename">map</code></td><td align="left"><code class="classname">__gnu_debug::multimap</code></td><td align="left"><code class="filename">map</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::multiset</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="classname">__gnu_debug::multiset</code></td><td align="left"><code class="filename">set</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::set</code></td><td align="left"><code class="filename">set</code></td><td align="left"><code class="classname">__gnu_debug::set</code></td><td align="left"><code class="filename">set</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::string</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::string</code></td><td align="left"><code class="filename">string</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::wstring</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::wstring</code></td><td align="left"><code class="filename">string</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::basic_string</code></td><td align="left"><code class="filename">string</code></td><td align="left"><code class="classname">__gnu_debug::basic_string</code></td><td align="left"><code class="filename">string</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::vector</code></td><td align="left"><code class="filename">vector</code></td><td align="left"><code class="classname">__gnu_debug::vector</code></td><td align="left"><code class="filename">vector</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /><p>In addition, when compiling in C++0x mode, these additional
containers have additional debug capability.
-</p><div class="table"><a id="id319073"></a><p class="title"><b>Table 30.2. Debugging Containers C++0x</b></p><div class="table-contents"><table summary="Debugging Containers C++0x" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col /><col /></colgroup><thead><tr><th align="left">Container</th><th align="left">Header</th><th align="left">Debug container</th><th align="left">Debug header</th><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></thead><tbody><tr><td align="left"><code class="classname">std::unordered_map</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="classname">__gnu_debug::unordered_map</code></td><td align="left"><code class="filename">unordered_map</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::unordered_multimap</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="classname">__gnu_debug::unordered_multimap</code></td><td align="left"><code class="filename">unordered_map</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::unordered_set</code></td><td align="left"><code class="filename">unordered_set</code></td><td align="left"><code class="classname">__gnu_debug::unordered_set</code></td><td align="left"><code class="filename">unordered_set</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::unordered_multiset</code></td><td align="left"><code class="filename">unordered_set</code></td><td align="left"><code class="classname">__gnu_debug::unordered_multiset</code></td><td align="left"><code class="filename">unordered_set</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch30s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="debug_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch30s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html>
+</p><div class="table"><a id="id565812"></a><p class="title"><b>Table 30.2. Debugging Containers C++0x</b></p><div class="table-contents"><table summary="Debugging Containers C++0x" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col /><col /></colgroup><thead><tr><th align="left">Container</th><th align="left">Header</th><th align="left">Debug container</th><th align="left">Debug header</th><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></thead><tbody><tr><td align="left"><code class="classname">std::unordered_map</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="classname">__gnu_debug::unordered_map</code></td><td align="left"><code class="filename">unordered_map</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::unordered_multimap</code></td><td align="left"><code class="filename">unordered_map</code></td><td align="left"><code class="classname">__gnu_debug::unordered_multimap</code></td><td align="left"><code class="filename">unordered_map</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::unordered_set</code></td><td align="left"><code class="filename">unordered_set</code></td><td align="left"><code class="classname">__gnu_debug::unordered_set</code></td><td align="left"><code class="filename">unordered_set</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr><tr><td align="left"><code class="classname">std::unordered_multiset</code></td><td align="left"><code class="filename">unordered_set</code></td><td align="left"><code class="classname">__gnu_debug::unordered_multiset</code></td><td align="left"><code class="filename">unordered_set</code></td><td class="auto-generated"> </td><td class="auto-generated"> </td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch30s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="debug_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch30s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt12ch31s03.html b/libstdc++-v3/doc/html/manual/bk01pt12ch31s03.html
index 53a56bf526c..364998c0dc4 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt12ch31s03.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt12ch31s03.html
@@ -63,4 +63,4 @@ Then compile this code with the prerequisite compiler flags
flags for atomic operations.)
</p><p> The following table provides the names and headers of all the
parallel algorithms that can be used in a similar manner:
-</p><div class="table"><a id="id392310"></a><p class="title"><b>Table 31.1. Parallel Algorithms</b></p><div class="table-contents"><table summary="Parallel Algorithms" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Algorithm</th><th align="left">Header</th><th align="left">Parallel algorithm</th><th align="left">Parallel header</th></tr></thead><tbody><tr><td align="left"><code class="function">std::accumulate</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::accumulate</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::adjacent_difference</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::adjacent_difference</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::inner_product</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::inner_product</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::partial_sum</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::partial_sum</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::adjacent_find</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::adjacent_find</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::count</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::count</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::count_if</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::count_if</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::equal</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::equal</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::find</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::find</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::find_if</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::find_if</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::find_first_of</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::find_first_of</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::for_each</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::for_each</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::generate</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::generate</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::generate_n</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::generate_n</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::lexicographical_compare</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::lexicographical_compare</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::mismatch</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::mismatch</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::search</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::search</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::search_n</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::search_n</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::transform</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::transform</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::replace</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::replace</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::replace_if</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::replace_if</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::max_element</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::max_element</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::merge</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::merge</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::min_element</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::min_element</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::nth_element</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::nth_element</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::partial_sort</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::partial_sort</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::partition</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::partition</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::random_shuffle</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::random_shuffle</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_union</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_union</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_intersection</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_intersection</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_symmetric_difference</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_symmetric_difference</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_difference</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_difference</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::sort</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::sort</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::stable_sort</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::stable_sort</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::unique_copy</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::unique_copy</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch31s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch31s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html>
+</p><div class="table"><a id="id572219"></a><p class="title"><b>Table 31.1. Parallel Algorithms</b></p><div class="table-contents"><table summary="Parallel Algorithms" border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th align="left">Algorithm</th><th align="left">Header</th><th align="left">Parallel algorithm</th><th align="left">Parallel header</th></tr></thead><tbody><tr><td align="left"><code class="function">std::accumulate</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::accumulate</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::adjacent_difference</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::adjacent_difference</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::inner_product</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::inner_product</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::partial_sum</code></td><td align="left"><code class="filename">numeric</code></td><td align="left"><code class="function">__gnu_parallel::partial_sum</code></td><td align="left"><code class="filename">parallel/numeric</code></td></tr><tr><td align="left"><code class="function">std::adjacent_find</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::adjacent_find</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::count</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::count</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::count_if</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::count_if</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::equal</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::equal</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::find</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::find</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::find_if</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::find_if</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::find_first_of</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::find_first_of</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::for_each</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::for_each</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::generate</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::generate</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::generate_n</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::generate_n</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::lexicographical_compare</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::lexicographical_compare</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::mismatch</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::mismatch</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::search</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::search</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::search_n</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::search_n</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::transform</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::transform</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::replace</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::replace</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::replace_if</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::replace_if</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::max_element</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::max_element</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::merge</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::merge</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::min_element</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::min_element</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::nth_element</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::nth_element</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::partial_sort</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::partial_sort</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::partition</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::partition</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::random_shuffle</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::random_shuffle</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_union</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_union</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_intersection</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_intersection</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_symmetric_difference</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_symmetric_difference</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::set_difference</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::set_difference</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::sort</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::sort</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::stable_sort</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::stable_sort</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr><tr><td align="left"><code class="function">std::unique_copy</code></td><td align="left"><code class="filename">algorithm</code></td><td align="left"><code class="function">__gnu_parallel::unique_copy</code></td><td align="left"><code class="filename">parallel/algorithm</code></td></tr></tbody></table></div></div><br class="table-break" /></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt12ch31s02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="parallel_mode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt12ch31s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Semantics </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Design</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/bk01pt12pr03.html b/libstdc++-v3/doc/html/manual/bk01pt12pr03.html
index fc79407e59b..c7ade7fefd7 100644
--- a/libstdc++-v3/doc/html/manual/bk01pt12pr03.html
+++ b/libstdc++-v3/doc/html/manual/bk01pt12pr03.html
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="start" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII. Extensions" /><link rel="prev" href="extensions.html" title="Part XII. Extensions" /><link rel="next" href="bk01pt12ch29.html" title="Chapter 29. Compile Time Checks" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="extensions.html">Prev</a> </td><th width="60%" align="center">Part XII. Extensions</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch29.html">Next</a></td></tr></table><hr /></div><div class="preface" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id337521"></a></h2></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="start" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="extensions.html" title="Part XII. Extensions" /><link rel="prev" href="extensions.html" title="Part XII. Extensions" /><link rel="next" href="bk01pt12ch29.html" title="Chapter 29. Compile Time Checks" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="extensions.html">Prev</a> </td><th width="60%" align="center">Part XII. Extensions</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt12ch29.html">Next</a></td></tr></table><hr /></div><div class="preface" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="id531065"></a></h2></div></div></div><p>
Here we will make an attempt at describing the non-Standard extensions to
the library. Some of these are from SGI's STL, some of these are GNU's,
and some just seemed to appear on the doorstep.
diff --git a/libstdc++-v3/doc/html/manual/build.html b/libstdc++-v3/doc/html/manual/build.html
deleted file mode 100644
index 4322717cf52..00000000000
--- a/libstdc++-v3/doc/html/manual/build.html
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Build</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; build&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="start" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="bk01pt01ch02.html" title="Chapter 2. Setup" /><link rel="prev" href="bk01pt01ch02.html" title="Chapter 2. Setup" /><link rel="next" href="test.html" title="Test" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Build</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt01ch02.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Setup</th><td width="20%" align="right"> <a accesskey="n" href="test.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.setup.build"></a>Build</h2></div></div></div><p>
- Because libstdc++ is part of GCC, the primary source for
- installation instructions is
- <a class="ulink" href="http://gcc.gnu.org/install/" target="_top">the GCC install page</a>.
- Additional data is given here only where it applies to libstdc++.
-</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="build.prereq"></a>Prerequisites</h3></div></div></div><p>
- The list of software needed to build the library is kept with the
- rest of the compiler, at
- <a class="ulink" href="http://gcc.gnu.org/install/prerequisites.html" target="_top">
- http://gcc.gnu.org/install/prerequisites.html</a>. The same page
- also lists the tools you will need if you wish to modify the source.
- </p><p>As of GCC 4.0.1 the minimum version of binutils required to build
- libstdc++ is <code class="code">2.15.90.0.1.1</code>. You can get snapshots
- (as well as releases) of binutils from
- <a class="ulink" href="ftp://sources.redhat.com/pub/binutils" target="_top">
- ftp://sources.redhat.com/pub/binutils</a>.
- Older releases of libstdc++ do not require such a recent version,
- but to take full advantage of useful space-saving features and
- bug-fixes you should use a recent binutils if possible.
- The configure process will automatically detect and use these
- features if the underlying support is present.
- </p><p>
- Finally, a few system-specific requirements:
- </p><div class="variablelist"><dl><dt><span class="term">linux</span></dt><dd><p>
- If gcc 3.1.0 or later on is being used on linux, an attempt
- will be made to use "C" library functionality necessary for
- C++ named locale support. For gcc 3.2.1 and later, this
- means that glibc 2.2.5 or later is required and the "C"
- library de_DE locale information must be installed.
- </p><p>
- Note however that the sanity checks involving the de_DE
- locale are skipped when an explicit --enable-clocale=gnu
- configure option is used: only the basic checks are carried
- out, defending against misconfigurations.
- </p><p>
- If the 'gnu' locale model is being used, the following
- locales are used and tested in the libstdc++ testsuites.
- The first column is the name of the locale, the second is
- the character set it is expected to use.
- </p><pre class="programlisting">
-de_DE ISO-8859-1
-de_DE@euro ISO-8859-15
-en_HK ISO-8859-1
-en_PH ISO-8859-1
-en_US ISO-8859-1
-en_US.ISO-8859-1 ISO-8859-1
-en_US.ISO-8859-15 ISO-8859-15
-en_US.UTF-8 UTF-8
-es_ES ISO-8859-1
-es_MX ISO-8859-1
-fr_FR ISO-8859-1
-fr_FR@euro ISO-8859-15
-is_IS UTF-8
-it_IT ISO-8859-1
-ja_JP.eucjp EUC-JP
-se_NO.UTF-8 UTF-8
-ta_IN UTF-8
-zh_TW BIG5
-</pre><p>Failure to have the underlying "C" library locale
- information installed will mean that C++ named locales for the
- above regions will not work: because of this, the libstdc++
- testsuite will skip the named locale tests. If this isn't an
- issue, don't worry about it. If named locales are needed, the
- underlying locale information must be installed. Note that
- rebuilding libstdc++ after the "C" locales are installed is not
- necessary.
- </p><p>
- To install support for locales, do only one of the following:
- </p><div class="itemizedlist"><ul type="disc"><li><p>install all locales</p><div class="itemizedlist"><ul type="circle"><li><p>with RedHat Linux:
- </p><p> <code class="code"> export LC_ALL=C </code>
- </p><p> <code class="code"> rpm -e glibc-common --nodeps </code>
- </p><p>
- <code class="code"> rpm -i --define "_install_langs all"
- glibc-common-2.2.5-34.i386.rpm
- </code>
- </p></li><li><p>
- Instructions for other operating systems solicited.
- </p></li></ul></div></li><li><p>install just the necessary locales</p><div class="itemizedlist"><ul type="circle"><li><p>with Debian Linux:</p><p> Add the above list, as shown, to the file
- <code class="code">/etc/locale.gen</code> </p><p> run <code class="code">/usr/sbin/locale-gen</code> </p></li><li><p>on most Unix-like operating systems:</p><p><code class="code"> localedef -i de_DE -f ISO-8859-1 de_DE </code></p><p>(repeat for each entry in the above list) </p></li><li><p>
- Instructions for other operating systems solicited.
- </p></li></ul></div></li></ul></div></dd></dl></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="build.configure"></a>Make</h3></div></div></div><p>If you have never done this before, you should read the basic
- <a class="ulink" href="http://gcc.gnu.org/install/" target="_top">GCC Installation
- Instructions</a> first. Read <span class="emphasis"><em>all of them</em></span>.
- <span class="emphasis"><em>Twice.</em></span>
- </p><p>When building libstdc++ you'll have to configure
- the entire <span class="emphasis"><em>gccsrcdir</em></span> directory. The full list of libstdc++
- specific configuration options, not dependent on the specific compiler
- release being used, can be found <a class="ulink" href="configopts.html" target="_top">here</a>.
- </p><p>Consider possibly using --enable-languages=c++ to save time by only
- building the C++ language parts.
- </p><pre class="programlisting">
- cd <span class="emphasis"><em>gccbuilddir</em></span>
- <span class="emphasis"><em>gccsrcdir</em></span>/configure --prefix=<span class="emphasis"><em>destdir</em></span> --other-opts...</pre></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt01ch02.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="bk01pt01ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="test.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. Setup </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Test</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/codecvt.html b/libstdc++-v3/doc/html/manual/codecvt.html
index 258acd27814..c46c52a5014 100644
--- a/libstdc++-v3/doc/html/manual/codecvt.html
+++ b/libstdc++-v3/doc/html/manual/codecvt.html
@@ -337,41 +337,41 @@ codecvt usage.
</p></li><li><p>
wchar_t/char internal buffers and conversions between
internal/external buffers?
- </p></li></ul></div></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="facet.codecvt.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id272734"></a><p><span class="title"><i>
+ </p></li></ul></div></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="facet.codecvt.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id480720"></a><p><span class="title"><i>
The GNU C Library
- </i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry"><a id="id399498"></a><p><span class="title"><i>
+ </i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling and 7 Locales and Internationalization. </span></p></div><div class="biblioentry"><a id="id535649"></a><p><span class="title"><i>
Correspondence
- </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id442423"></a><p><span class="title"><i>
+ </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id533973"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++
- </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id438296"></a><p><span class="title"><i>
+ </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id534707"></a><p><span class="title"><i>
ISO/IEC 9899:1999 Programming languages - C
- </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id438314"></a><p><span class="title"><i>
+ </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id534725"></a><p><span class="title"><i>
System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x)
</i>. </span><span class="copyright">Copyright © 1999
The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span><span class="biblioid">
<a class="ulink" href="http://www.opennc.org/austin/docreg.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id436032"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id506111"></a><p><span class="title"><i>
The C++ Programming Language, Special Edition
</i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id400418"></a><p><span class="title"><i>
+ . </span></span></p></div><div class="biblioentry"><a id="id493170"></a><p><span class="title"><i>
Standard C++ IOStreams and Locales
</i>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley Longman, Inc.. </span><span class="publisher"><span class="publishername">
Addison Wesley Longman
- . </span></span></p></div><div class="biblioentry"><a id="id402869"></a><p><span class="title"><i>
+ . </span></span></p></div><div class="biblioentry"><a id="id558306"></a><p><span class="title"><i>
A brief description of Normative Addendum 1
</i>. </span><span class="author"><span class="firstname">Clive</span> <span class="surname">Feather</span>. </span><span class="pagenums">Extended Character Sets. </span><span class="biblioid">
<a class="ulink" href="http://www.lysator.liu.se/c/na1.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id435221"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id478698"></a><p><span class="title"><i>
The Unicode HOWTO
</i>. </span><span class="author"><span class="firstname">Bruno</span> <span class="surname">Haible</span>. </span><span class="biblioid">
<a class="ulink" href="ftp://ftp.ilog.fr/pub/Users/haible/utf8/Unicode-HOWTO.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id435248"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id478726"></a><p><span class="title"><i>
UTF-8 and Unicode FAQ for Unix/Linux
</i>. </span><span class="author"><span class="firstname">Markus</span> <span class="surname">Khun</span>. </span><span class="biblioid">
<a class="ulink" href="http://www.cl.cam.ac.uk/~mgk25/unicode.html" target="_top">
diff --git a/libstdc++-v3/doc/html/manual/debug.html b/libstdc++-v3/doc/html/manual/debug.html
index a975621a7c5..311438cee91 100644
--- a/libstdc++-v3/doc/html/manual/debug.html
+++ b/libstdc++-v3/doc/html/manual/debug.html
@@ -11,19 +11,20 @@
The default optimizations and debug flags for a libstdc++ build
are <code class="code">-g -O2</code>. However, both debug and optimization
flags can be varied to change debugging characteristics. For
- instance, turning off all optimization via the <code class="code">-g -O0</code>
- flag will disable inlining, so that stepping through all
- functions, including inlined constructors and destructors, is
- possible. In addition,
- <code class="code">-fno-eliminate-unused-debug-types</code> can be used when
- additional debug information, such as nested class info, is
- desired.
+ instance, turning off all optimization via the <code class="code">-g -O0
+ -fno-inline</code> flags will disable inlining and optimizations,
+ and add debugging information, so that stepping through all functions,
+ (including inlined constructors and destructors) is possible. In
+ addition, <code class="code">-fno-eliminate-unused-debug-types</code> can be
+ used when additional debug information, such as nested class info,
+ is desired.
</p><p>
Or, the debug format that the compiler and debugger use to
communicate information about source constructs can be changed via
- <code class="code"> -gdwarf-2 </code> or <code class="code"> -gstabs </code> flags: some
- debugging formats permit more expressive type and scope information
- to be shown in gdb. The default debug information for a particular
+ <code class="code">-gdwarf-2</code> or <code class="code">-gstabs</code> flags: some debugging
+ formats permit more expressive type and scope information to be
+ shown in gdb. Expressiveness can be enhanced by flags like
+ <code class="code">-g3</code>. The default debug information for a particular
platform can be identified via the value set by the
PREFERRED_DEBUGGING_TYPE macro in the gcc sources.
</p><p>
@@ -43,15 +44,15 @@
debug build will persist, without having to specify
<code class="code">CXXFLAGS</code>, and the debug library will be installed in a
separate directory tree, in <code class="code">(prefix)/lib/debug</code>. For
- more information, look at the <a class="ulink" href="configopts.html" target="_top">configuration options</a> document.
+ more information, look at the <a class="link" href="configure.html" title="Configure">configuration</a> section.
</p><p>
A second approach is to use the configuration flags
</p><pre class="programlisting">
- make CXXFLAGS='-g3 -O0' all
+ make CXXFLAGS='-g3 -fno-inline -O0' all
</pre><p>
This quick and dirty approach is often sufficient for quick
debugging tasks, when you cannot or don't want to recompile your
- application to use the <a class="ulink" href="#safe" target="_top">debug mode</a>.</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug.memory"></a>Memory Leak Hunting</h3></div></div></div><p>
+ application to use the <a class="link" href="debug_mode.html" title="Chapter 30. Debug Mode">debug mode</a>.</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug.memory"></a>Memory Leak Hunting</h3></div></div></div><p>
There are various third party memory tracing and debug utilities
that can be used to provide detailed memory allocation information
about C++ code. An exhaustive list of tools is not going to be
@@ -66,7 +67,7 @@
thing of great importance to keep in mind when debugging C++ code
that uses <code class="code">new</code> and <code class="code">delete</code>: there are
different kinds of allocation schemes that can be used by <code class="code">
- std::allocator </code>. For implementation details, see the <a class="ulink" href="ext/mt_allocator.html" target="_top">mt allocator</a> documentation and
+ std::allocator </code>. For implementation details, see the <a class="link" href="bk01pt12ch32.html#manual.ext.allocator.mt" title="mt_allocator">mt allocator</a> documentation and
look specifically for <code class="code">GLIBCXX_FORCE_NEW</code>.
</p><p>
In a nutshell, the default allocator used by <code class="code">
@@ -122,7 +123,7 @@
valgrind -v --num-callers=20 --leak-check=yes --leak-resolution=high --show-reachable=yes a.out
</pre></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="debug.gdb"></a>Using <span class="command"><strong>gdb</strong></span></h3></div></div></div><p>
</p><p>
- Many options are available for gdb itself: please see <a class="ulink" href="http://sources.redhat.com/gdb/current/onlinedocs/gdb_13.html#SEC109" target="_top">
+ Many options are available for gdb itself: please see <a class="ulink" href="http://sources.redhat.com/gdb/current/onlinedocs/gdb_13.html#SEC125" target="_top">
"GDB features for C++" </a> in the gdb documentation. Also
recommended: the other parts of this manual.
</p><p>
diff --git a/libstdc++-v3/doc/html/manual/intro.html b/libstdc++-v3/doc/html/manual/intro.html
index 9020ed815be..d4f976ba112 100644
--- a/libstdc++-v3/doc/html/manual/intro.html
+++ b/libstdc++-v3/doc/html/manual/intro.html
@@ -1,3 +1,3 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Part I. Introduction</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="start" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="spine.html" title="The GNU C++ Library" /><link rel="next" href="bk01pt01ch01.html" title="Chapter 1. Status" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part I. Introduction</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="spine.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt01ch01.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.intro"></a>Part I. Introduction</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="bk01pt01ch01.html">1. Status</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt01ch01.html#manual.intro.status.standard">Implementation Status</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch01.html#manual.intro.status.standard.1998">C++ 1998</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch01.html#manual.intro.status.standard.tr1">C++ TR1</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch01.html#manual.intro.status.standard.200x">C++ 200x</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch01s02.html">License</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch01s02.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch01s02.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch01s03.html">Bugs</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch01s03.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch01s03.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="bk01pt01ch02.html">2. Setup</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt01ch02.html#manual.intro.setup.configure">Configure</a></span></dt><dt><span class="sect1"><a href="build.html">Build</a></span></dt><dd><dl><dt><span class="sect2"><a href="build.html#build.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="build.html#build.configure">Make</a></span></dt></dl></dd><dt><span class="sect1"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="sect2"><a href="test.html#test.organization">Organization</a></span></dt><dt><span class="sect2"><a href="test.html#test.naming">Naming Conventions</a></span></dt><dt><span class="sect2"><a href="test.html#test.utils">Utilities</a></span></dt><dt><span class="sect2"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="sect2"><a href="test.html#test.new_tests">New Test Cases</a></span></dt><dt><span class="sect2"><a href="test.html#test.dejagnu">Test Harness Details</a></span></dt><dt><span class="sect2"><a href="test.html#test.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="using.html">3. Using</a></span></dt><dd><dl><dt><span class="sect1"><a href="using.html#manual.intro.using.lib">Linking Library Binary Files</a></span></dt><dt><span class="sect1"><a href="bk01pt01ch03s02.html">Headers</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch03s02.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s02.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s02.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s02.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch03s03.html">Namespaces</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch03s03.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s03.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s03.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch03s04.html">Macros</a></span></dt><dt><span class="sect1"><a href="bk01pt01ch03s05.html">Concurrency</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.io">IO</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch03s06.html">Exceptions</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch03s06.html#intro.using.exception.propagating">Propagating Exceptions aka Exception Neutrality</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s06.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s06.html#intro.using.exception.no">Support for <code class="literal">-fno-exceptions</code></a></span></dt></dl></dd><dt><span class="sect1"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="sect2"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="sect2"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="sect2"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt></dl></dd></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="spine.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt01ch01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The GNU C++ Library </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 1. Status</td></tr></table></div></body></html>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Part I. Introduction</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="start" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="spine.html" title="The GNU C++ Library" /><link rel="prev" href="spine.html" title="The GNU C++ Library" /><link rel="next" href="bk01pt01ch01.html" title="Chapter 1. Status" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Part I. Introduction</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="spine.html">Prev</a> </td><th width="60%" align="center">The GNU C++ Library</th><td width="20%" align="right"> <a accesskey="n" href="bk01pt01ch01.html">Next</a></td></tr></table><hr /></div><div class="part" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual.intro"></a>Part I. Introduction</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="bk01pt01ch01.html">1. Status</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt01ch01.html#manual.intro.status.standard">Implementation Status</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch01.html#manual.intro.status.standard.1998">C++ 1998</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch01.html#manual.intro.status.standard.tr1">C++ TR1</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch01.html#manual.intro.status.standard.200x">C++ 200x</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch01s02.html">License</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch01s02.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch01s02.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch01s03.html">Bugs</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch01s03.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch01s03.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="bk01pt01ch02.html">2. Setup</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt01ch02.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="sect1"><a href="configure.html">Configure</a></span></dt><dt><span class="sect1"><a href="bk01pt01ch02s03.html">Make</a></span></dt><dt><span class="sect1"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="sect2"><a href="test.html#test.organization">Organization</a></span></dt><dt><span class="sect2"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="sect2"><a href="test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="sect2"><a href="test.html#test.harness">Test Harness and Utilities</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="using.html">3. Using</a></span></dt><dd><dl><dt><span class="sect1"><a href="using.html#manual.intro.using.lib">Linking Library Binary Files</a></span></dt><dt><span class="sect1"><a href="bk01pt01ch03s02.html">Headers</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch03s02.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s02.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s02.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s02.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch03s03.html">Namespaces</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch03s03.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s03.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s03.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch03s04.html">Macros</a></span></dt><dt><span class="sect1"><a href="bk01pt01ch03s05.html">Concurrency</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.io">IO</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch03s06.html">Exceptions</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch03s06.html#intro.using.exception.propagating">Propagating Exceptions aka Exception Neutrality</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s06.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s06.html#intro.using.exception.no">Support for <code class="literal">-fno-exceptions</code></a></span></dt></dl></dd><dt><span class="sect1"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="sect2"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="sect2"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="sect2"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt></dl></dd></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="spine.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="spine.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="bk01pt01ch01.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The GNU C++ Library </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 1. Status</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/messages.html b/libstdc++-v3/doc/html/manual/messages.html
index 5284e8f11cc..4a94e5805eb 100644
--- a/libstdc++-v3/doc/html/manual/messages.html
+++ b/libstdc++-v3/doc/html/manual/messages.html
@@ -241,38 +241,38 @@ void test01()
model. As of this writing, it is unknown how to query to see
if a specified message catalog exists using the gettext
package.
- </p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="facet.messages.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id435992"></a><p><span class="title"><i>
+ </p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="facet.messages.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id491564"></a><p><span class="title"><i>
The GNU C Library
</i>. </span><span class="author"><span class="firstname">Roland</span> <span class="surname">McGrath</span>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2007 FSF. </span><span class="pagenums">Chapters 6 Character Set Handling, and 7 Locales and Internationalization
- . </span></p></div><div class="biblioentry"><a id="id375623"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id558204"></a><p><span class="title"><i>
Correspondence
- </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id377133"></a><p><span class="title"><i>
+ </i>. </span><span class="author"><span class="firstname">Ulrich</span> <span class="surname">Drepper</span>. </span><span class="copyright">Copyright © 2002 . </span></p></div><div class="biblioentry"><a id="id539214"></a><p><span class="title"><i>
ISO/IEC 14882:1998 Programming languages - C++
- </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id377151"></a><p><span class="title"><i>
+ </i>. </span><span class="copyright">Copyright © 1998 ISO. </span></p></div><div class="biblioentry"><a id="id539233"></a><p><span class="title"><i>
ISO/IEC 9899:1999 Programming languages - C
- </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id430388"></a><p><span class="title"><i>
+ </i>. </span><span class="copyright">Copyright © 1999 ISO. </span></p></div><div class="biblioentry"><a id="id559064"></a><p><span class="title"><i>
System Interface Definitions, Issue 6 (IEEE Std. 1003.1-200x)
</i>. </span><span class="copyright">Copyright © 1999
The Open Group/The Institute of Electrical and Electronics Engineers, Inc.. </span><span class="biblioid">
<a class="ulink" href="http://www.opennc.org/austin/docreg.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id430416"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id559090"></a><p><span class="title"><i>
The C++ Programming Language, Special Edition
</i>. </span><span class="author"><span class="firstname">Bjarne</span> <span class="surname">Stroustrup</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley, Inc.. </span><span class="pagenums">Appendix D. </span><span class="publisher"><span class="publishername">
Addison Wesley
- . </span></span></p></div><div class="biblioentry"><a id="id470349"></a><p><span class="title"><i>
+ . </span></span></p></div><div class="biblioentry"><a id="id483268"></a><p><span class="title"><i>
Standard C++ IOStreams and Locales
</i>. </span><span class="subtitle">
Advanced Programmer's Guide and Reference
. </span><span class="author"><span class="firstname">Angelika</span> <span class="surname">Langer</span>. </span><span class="author"><span class="firstname">Klaus</span> <span class="surname">Kreft</span>. </span><span class="copyright">Copyright © 2000 Addison Wesley Longman, Inc.. </span><span class="publisher"><span class="publishername">
Addison Wesley Longman
- . </span></span></p></div><div class="biblioentry"><a id="id433912"></a><p><span class="title"><i>
+ . </span></span></p></div><div class="biblioentry"><a id="id483100"></a><p><span class="title"><i>
Java 2 Platform, Standard Edition, v 1.3.1 API Specification
</i>. </span><span class="pagenums">java.util.Properties, java.text.MessageFormat,
java.util.Locale, java.util.ResourceBundle. </span><span class="biblioid">
<a class="ulink" href="http://java.sun.com/j2se/1.3/docs/api" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id433933"></a><p><span class="title"><i>
+ . </span></p></div><div class="biblioentry"><a id="id559805"></a><p><span class="title"><i>
GNU gettext tools, version 0.10.38, Native Language Support
Library and Tools.
</i>. </span><span class="biblioid">
diff --git a/libstdc++-v3/doc/html/manual/parallel_mode.html b/libstdc++-v3/doc/html/manual/parallel_mode.html
index f008aa39bc6..57fe700a76a 100644
--- a/libstdc++-v3/doc/html/manual/parallel_mode.html
+++ b/libstdc++-v3/doc/html/manual/parallel_mode.html
@@ -10,11 +10,11 @@ explicit source declaration or by compiling existing sources with a
specific compiler flag.
</p><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.ext.parallel_mode.intro"></a>Intro</h2></div></div></div><p>The following library components in the include
<code class="filename">numeric</code> are included in the parallel mode:</p><div class="itemizedlist"><ul type="disc"><li><p><code class="function">std::accumulate</code></p></li><li><p><code class="function">std::adjacent_difference</code></p></li><li><p><code class="function">std::inner_product</code></p></li><li><p><code class="function">std::partial_sum</code></p></li></ul></div><p>The following library components in the include
-<code class="filename">algorithm</code> are included in the parallel mode:</p><div class="itemizedlist"><ul type="disc"><li><p><code class="function">std::adjacent_find</code></p></li><li><p><code class="function">std::count</code></p></li><li><p><code class="function">std::count_if</code></p></li><li><p><code class="function">std::equal</code></p></li><li><p><code class="function">std::find</code></p></li><li><p><code class="function">std::find_if</code></p></li><li><p><code class="function">std::find_first_of</code></p></li><li><p><code class="function">std::for_each</code></p></li><li><p><code class="function">std::generate</code></p></li><li><p><code class="function">std::generate_n</code></p></li><li><p><code class="function">std::lexicographical_compare</code></p></li><li><p><code class="function">std::mismatch</code></p></li><li><p><code class="function">std::search</code></p></li><li><p><code class="function">std::search_n</code></p></li><li><p><code class="function">std::transform</code></p></li><li><p><code class="function">std::replace</code></p></li><li><p><code class="function">std::replace_if</code></p></li><li><p><code class="function">std::max_element</code></p></li><li><p><code class="function">std::merge</code></p></li><li><p><code class="function">std::min_element</code></p></li><li><p><code class="function">std::nth_element</code></p></li><li><p><code class="function">std::partial_sort</code></p></li><li><p><code class="function">std::partition</code></p></li><li><p><code class="function">std::random_shuffle</code></p></li><li><p><code class="function">std::set_union</code></p></li><li><p><code class="function">std::set_intersection</code></p></li><li><p><code class="function">std::set_symmetric_difference</code></p></li><li><p><code class="function">std::set_difference</code></p></li><li><p><code class="function">std::sort</code></p></li><li><p><code class="function">std::stable_sort</code></p></li><li><p><code class="function">std::unique_copy</code></p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="parallel_mode.biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry"><a id="id470991"></a><p><span class="title"><i>
+<code class="filename">algorithm</code> are included in the parallel mode:</p><div class="itemizedlist"><ul type="disc"><li><p><code class="function">std::adjacent_find</code></p></li><li><p><code class="function">std::count</code></p></li><li><p><code class="function">std::count_if</code></p></li><li><p><code class="function">std::equal</code></p></li><li><p><code class="function">std::find</code></p></li><li><p><code class="function">std::find_if</code></p></li><li><p><code class="function">std::find_first_of</code></p></li><li><p><code class="function">std::for_each</code></p></li><li><p><code class="function">std::generate</code></p></li><li><p><code class="function">std::generate_n</code></p></li><li><p><code class="function">std::lexicographical_compare</code></p></li><li><p><code class="function">std::mismatch</code></p></li><li><p><code class="function">std::search</code></p></li><li><p><code class="function">std::search_n</code></p></li><li><p><code class="function">std::transform</code></p></li><li><p><code class="function">std::replace</code></p></li><li><p><code class="function">std::replace_if</code></p></li><li><p><code class="function">std::max_element</code></p></li><li><p><code class="function">std::merge</code></p></li><li><p><code class="function">std::min_element</code></p></li><li><p><code class="function">std::nth_element</code></p></li><li><p><code class="function">std::partial_sort</code></p></li><li><p><code class="function">std::partition</code></p></li><li><p><code class="function">std::random_shuffle</code></p></li><li><p><code class="function">std::set_union</code></p></li><li><p><code class="function">std::set_intersection</code></p></li><li><p><code class="function">std::set_symmetric_difference</code></p></li><li><p><code class="function">std::set_difference</code></p></li><li><p><code class="function">std::sort</code></p></li><li><p><code class="function">std::stable_sort</code></p></li><li><p><code class="function">std::unique_copy</code></p></li></ul></div></div><div class="bibliography"><div class="titlepage"><div><div><h2 class="title"><a id="parallel_mode.biblio"></a>Bibliography</h2></div></div></div><div class="biblioentry"><a id="id481250"></a><p><span class="title"><i>
Parallelization of Bulk Operations for STL Dictionaries
</i>. </span><span class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span>. </span><span class="author"><span class="firstname">Leonor</span> <span class="surname">Frias</span>. </span><span class="copyright">Copyright © 2007 . </span><span class="publisher"><span class="publishername">
Workshop on Highly Parallel Processing on a Chip (HPPC) 2007. (LNCS)
- . </span></span></p></div><div class="biblioentry"><a id="id471037"></a><p><span class="title"><i>
+ . </span></span></p></div><div class="biblioentry"><a id="id502406"></a><p><span class="title"><i>
The Multi-Core Standard Template Library
</i>. </span><span class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span>. </span><span class="author"><span class="firstname">Peter</span> <span class="surname">Sanders</span>. </span><span class="author"><span class="firstname">Felix</span> <span class="surname">Putze</span>. </span><span class="copyright">Copyright © 2007 . </span><span class="publisher"><span class="publishername">
Euro-Par 2007: Parallel Processing. (LNCS 4641)
diff --git a/libstdc++-v3/doc/html/manual/shared_ptr.html b/libstdc++-v3/doc/html/manual/shared_ptr.html
index 88dc97de6d0..b45a9f2d816 100644
--- a/libstdc++-v3/doc/html/manual/shared_ptr.html
+++ b/libstdc++-v3/doc/html/manual/shared_ptr.html
@@ -29,7 +29,7 @@ drops to zero.
Derived classes override those functions to destroy resources in a context
where the correct dynamic type is known. This is an application of the
technique known as type erasure.
- </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="shared_ptr.impl"></a>Implementation</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id399768"></a>Class Hierarchy</h4></div></div></div><p>
+ </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="shared_ptr.impl"></a>Implementation</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id476828"></a>Class Hierarchy</h4></div></div></div><p>
A <code class="classname">shared_ptr&lt;T&gt;</code> contains a pointer of
type <span class="type">T*</span> and an object of type
<code class="classname">__shared_count</code>. The shared_count contains a
@@ -71,7 +71,7 @@ be forwarded to <span class="type">Tp</span>'s constructor.
Unlike the other <code class="classname">_Sp_counted_*</code> classes, this one is parameterized on the
type of object, not the type of pointer; this is purely a convenience
that simplifies the implementation slightly.
- </p></dd></dl></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id438247"></a>Thread Safety</h4></div></div></div><p>
+ </p></dd></dl></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id541894"></a>Thread Safety</h4></div></div></div><p>
The interface of <code class="classname">tr1::shared_ptr</code> was extended for C++0x
with support for rvalue-references and the other features from
N2351. As with other libstdc++ headers shared by TR1 and C++0x,
@@ -129,7 +129,7 @@ compiler, standard library, platform etc. For the version of
shared_ptr in libstdc++ the compiler and library are fixed, which
makes things much simpler: we have an atomic CAS or we don't, see Lock
Policy below for details.
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id445836"></a>Selecting Lock Policy</h4></div></div></div><p>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id510938"></a>Selecting Lock Policy</h4></div></div></div><p>
</p><p>
There is a single <code class="classname">_Sp_counted_base</code> class,
which is a template parameterized on the enum
@@ -170,7 +170,7 @@ used when libstdc++ is built without <code class="literal">--enable-threads</cod
<code class="filename">ext/atomicity.h</code>, which detect if the program
is multi-threaded. If only one thread of execution exists in
the program then less expensive non-atomic operations are used.
- </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id390904"></a>Dual C++0x and TR1 Implementation</h4></div></div></div><p>
+ </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id438058"></a>Dual C++0x and TR1 Implementation</h4></div></div></div><p>
The classes derived from <code class="classname">_Sp_counted_base</code> (see Class Hierarchy
below) and <code class="classname">__shared_count</code> are implemented separately for C++0x
and TR1, in <code class="filename">bits/boost_sp_shared_count.h</code> and
@@ -181,7 +181,7 @@ The TR1 implementation is considered relatively stable, so is unlikely to
change unless bug fixes require it. If the code that is common to both
C++0x and TR1 modes needs to diverge further then it might be necessary to
duplicate additional classes and only make changes to the C++0x versions.
-</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id398449"></a>Related functions and classes</h4></div></div></div><div class="variablelist"><dl><dt><span class="term"><code class="code">dynamic_pointer_cast</code>, <code class="code">static_pointer_cast</code>,
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id483862"></a>Related functions and classes</h4></div></div></div><div class="variablelist"><dl><dt><span class="term"><code class="code">dynamic_pointer_cast</code>, <code class="code">static_pointer_cast</code>,
<code class="code">const_pointer_cast</code></span></dt><dd><p>
As noted in N2351, these functions can be implemented non-intrusively using
the alias constructor. However the aliasing constructor is only available
@@ -214,10 +214,10 @@ is called. Users should not try to use this.
As well as the extra constructors, this implementation also needs some
members of _Sp_counted_deleter to be protected where they could otherwise
be private.
- </p></dd></dl></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="shared_ptr.using"></a>Use</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id399153"></a>Examples</h4></div></div></div><p>
+ </p></dd></dl></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="shared_ptr.using"></a>Use</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id467181"></a>Examples</h4></div></div></div><p>
Examples of use can be found in the testsuite, under
<code class="filename">testsuite/tr1/2_general_utilities/shared_ptr</code>.
- </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id440522"></a>Unresolved Issues</h4></div></div></div><p>
+ </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="id467197"></a>Unresolved Issues</h4></div></div></div><p>
The resolution to C++ Standard Library issue <a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#674" target="_top">674</a>,
"shared_ptr interface changes for consistency with N1856" will
need to be implemented after it is accepted into the working
@@ -265,7 +265,7 @@ be private.
code to work with, Peter Dimov in particular for his help and
invaluable advice on thread safety. Phillip Jordan and Paolo
Carlini for the lock policy implementation.
- </p></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="shared_ptr.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id372846"></a><p>[<abbr class="abbrev">
+ </p></div><div class="bibliography"><div class="titlepage"><div><div><h3 class="title"><a id="shared_ptr.biblio"></a>Bibliography</h3></div></div></div><div class="biblioentry"><a id="id530534"></a><p>[<abbr class="abbrev">
n2351
</abbr>] <span class="title"><i>
Improving shared_ptr for C++0x, Revision 2
@@ -274,7 +274,7 @@ be private.
. </span><span class="biblioid">
<a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2351.htm" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id372870"></a><p>[<abbr class="abbrev">
+ . </span></p></div><div class="biblioentry"><a id="id530558"></a><p>[<abbr class="abbrev">
n2456
</abbr>] <span class="title"><i>
C++ Standard Library Active Issues List (Revision R52)
@@ -283,7 +283,7 @@ be private.
. </span><span class="biblioid">
<a class="ulink" href="http://open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2456.html" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id426703"></a><p>[<abbr class="abbrev">
+ . </span></p></div><div class="biblioentry"><a id="id563958"></a><p>[<abbr class="abbrev">
n2461
</abbr>] <span class="title"><i>
Working Draft, Standard for Programming Language C++
@@ -292,7 +292,7 @@ be private.
. </span><span class="biblioid">
<a class="ulink" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2461.pdf" target="_top">
</a>
- . </span></p></div><div class="biblioentry"><a id="id446795"></a><p>[<abbr class="abbrev">
+ . </span></p></div><div class="biblioentry"><a id="id529558"></a><p>[<abbr class="abbrev">
boostshared_ptr
</abbr>] <span class="title"><i>
Boost C++ Libraries documentation - shared_ptr class template
diff --git a/libstdc++-v3/doc/html/manual/spine.html b/libstdc++-v3/doc/html/manual/spine.html
index 8b932707032..1c4833ff681 100644
--- a/libstdc++-v3/doc/html/manual/spine.html
+++ b/libstdc++-v3/doc/html/manual/spine.html
@@ -2,6 +2,6 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>The GNU C++ Library</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><link rel="start" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="prev" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="next" href="intro.html" title="Part I. Introduction" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The GNU C++ Library</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="../spine.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="intro.html">Next</a></td></tr></table><hr /></div><div class="book" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="manual-index"></a>The GNU C++ Library</h1></div><div><p class="copyright">Copyright © 2008
<a class="ulink" href="http://fsf.org" target="_top">FSF</a>
- </p></div><div><div class="legalnotice"><a id="id441102"></a><p>
+ </p></div><div><div class="legalnotice"><a id="id578209"></a><p>
<a class="ulink" href="17_intro/license.html" target="_top">License</a>
- </p></div></div></div><hr /></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="part"><a href="intro.html">I. Introduction</a></span></dt><dd><dl><dt><span class="chapter"><a href="bk01pt01ch01.html">1. Status</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt01ch01.html#manual.intro.status.standard">Implementation Status</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch01.html#manual.intro.status.standard.1998">C++ 1998</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch01.html#manual.intro.status.standard.tr1">C++ TR1</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch01.html#manual.intro.status.standard.200x">C++ 200x</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch01s02.html">License</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch01s02.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch01s02.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch01s03.html">Bugs</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch01s03.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch01s03.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="bk01pt01ch02.html">2. Setup</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt01ch02.html#manual.intro.setup.configure">Configure</a></span></dt><dt><span class="sect1"><a href="build.html">Build</a></span></dt><dd><dl><dt><span class="sect2"><a href="build.html#build.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="build.html#build.configure">Make</a></span></dt></dl></dd><dt><span class="sect1"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="sect2"><a href="test.html#test.organization">Organization</a></span></dt><dt><span class="sect2"><a href="test.html#test.naming">Naming Conventions</a></span></dt><dt><span class="sect2"><a href="test.html#test.utils">Utilities</a></span></dt><dt><span class="sect2"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="sect2"><a href="test.html#test.new_tests">New Test Cases</a></span></dt><dt><span class="sect2"><a href="test.html#test.dejagnu">Test Harness Details</a></span></dt><dt><span class="sect2"><a href="test.html#test.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="using.html">3. Using</a></span></dt><dd><dl><dt><span class="sect1"><a href="using.html#manual.intro.using.lib">Linking Library Binary Files</a></span></dt><dt><span class="sect1"><a href="bk01pt01ch03s02.html">Headers</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch03s02.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s02.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s02.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s02.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch03s03.html">Namespaces</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch03s03.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s03.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s03.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch03s04.html">Macros</a></span></dt><dt><span class="sect1"><a href="bk01pt01ch03s05.html">Concurrency</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.io">IO</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch03s06.html">Exceptions</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch03s06.html#intro.using.exception.propagating">Propagating Exceptions aka Exception Neutrality</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s06.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s06.html#intro.using.exception.no">Support for <code class="literal">-fno-exceptions</code></a></span></dt></dl></dd><dt><span class="sect1"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="sect2"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="sect2"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="sect2"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="support.html">II. Support</a></span></dt><dd><dl><dt><span class="preface"><a href="bk01pt02pr01.html"></a></span></dt><dt><span class="chapter"><a href="bk01pt02ch04.html">4. Types</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt02ch04.html#manual.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="sect1"><a href="bk01pt02ch04s02.html">Numeric Properties</a></span></dt><dt><span class="sect1"><a href="bk01pt02ch04s03.html">NULL</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt02ch05.html">5. Dynamic Memory</a></span></dt><dt><span class="chapter"><a href="bk01pt02ch06.html">6. Termination</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt02ch06.html#support.termination.handlers">Termination Handlers</a></span></dt><dt><span class="sect1"><a href="bk01pt02ch06s02.html">Verbose Terminate Handler</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="diagnostics.html">III. Diagnostics</a></span></dt><dd><dl><dt><span class="chapter"><a href="bk01pt03ch07.html">7. Exceptions</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt03ch07.html#manual.diagnostics.exceptions.hierarchy">Exception Classes</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch07s02.html">Adding Data to Exceptions</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch07s03.html">Cancellation</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt03ch08.html">8. Concept Checking</a></span></dt></dl></dd><dt><span class="part"><a href="utilities.html">IV. Utilities</a></span></dt><dd><dl><dt><span class="chapter"><a href="bk01pt04ch09.html">9. Functors</a></span></dt><dt><span class="chapter"><a href="bk01pt04ch10.html">10. Pairs</a></span></dt><dt><span class="chapter"><a href="bk01pt04ch11.html">11. Memory</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt04ch11.html#manual.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt04ch11.html#allocator.req">Requirements</a></span></dt><dt><span class="sect2"><a href="bk01pt04ch11.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="bk01pt04ch11.html#allocator.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="bk01pt04ch11.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="sect2"><a href="bk01pt04ch11.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="sect2"><a href="bk01pt04ch11.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="sect1"><a href="auto_ptr.html">auto_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="auto_ptr.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="sect2"><a href="auto_ptr.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="shared_ptr.html">shared_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.using">Use</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="bk01pt04ch12.html">12. Traits</a></span></dt></dl></dd><dt><span class="part"><a href="strings.html">V. Strings</a></span></dt><dd><dl><dt><span class="chapter"><a href="bk01pt05ch13.html">13. String Classes</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt05ch13.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s02.html">Case Sensitivity</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s03.html">Arbitrary Character Types</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s04.html">Tokenizing</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s05.html">Shrink to Fit</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s06.html">CString (MFC)</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="localization.html">VI. Localization</a></span></dt><dd><dl><dt><span class="chapter"><a href="bk01pt06ch14.html">14. Locales</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt06ch14.html#manual.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt06ch14.html#locales.locale.req">Requirements</a></span></dt><dt><span class="sect2"><a href="bk01pt06ch14.html#locales.locale.design">Design</a></span></dt><dt><span class="sect2"><a href="bk01pt06ch14.html#locales.locale.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="bk01pt06ch14.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="bk01pt06ch15.html">15. Facets aka Categories</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt06ch15.html#manual.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt06ch15.html#facet.ctype.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="bk01pt06ch15.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="codecvt.html">codecvt</a></span></dt><dd><dl><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.design">Design</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.use">Use</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="messages.html">messages</a></span></dt><dd><dl><dt><span class="sect2"><a href="messages.html#facet.messages.req">Requirements</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.design">Design</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.use">Use</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="containers.html">VII. Containers</a></span></dt><dd><dl><dt><span class="chapter"><a href="bk01pt07ch16.html">16. Sequences</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt07ch16.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt07ch16.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt07ch16s02.html">vector</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt07ch16s02.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="bk01pt07ch17.html">17. Associative</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt07ch17.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="sect1"><a href="bk01pt07ch17s02.html">bitset</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt07ch17s02.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="sect2"><a href="bk01pt07ch17s02.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="bk01pt07ch18.html">18. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt07ch18.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="iterators.html">VIII. Iterators</a></span></dt><dd><dl><dt><span class="chapter"><a href="bk01pt08ch19.html">19. Predefined</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt08ch19.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="sect1"><a href="bk01pt08ch19s02.html">One Past the End</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="algorithms.html">IX. Algorithms</a></span></dt><dd><dl><dt><span class="preface"><a href="bk01pt09pr02.html"></a></span></dt><dt><span class="chapter"><a href="bk01pt09ch20.html">20. Mutating</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt09ch20.html#algorithms.mutating.swap"><code class="function">swap</code></a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt09ch20.html#algorithms.swap.specializations">Specializations</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="numerics.html">X. Numerics</a></span></dt><dd><dl><dt><span class="chapter"><a href="bk01pt10ch21.html">21. Complex</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt10ch21.html#numerics.complex.processing">complex Processing</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt10ch22.html">22. Generalized Operations</a></span></dt><dt><span class="chapter"><a href="bk01pt10ch23.html">23. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt10ch23.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="sect1"><a href="bk01pt10ch23s02.html">C99</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="io.html">XI. Input and Output</a></span></dt><dd><dl><dt><span class="chapter"><a href="bk01pt11ch24.html">24. Iostream Objects</a></span></dt><dt><span class="chapter"><a href="bk01pt11ch25.html">25. Stream Buffers</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt11ch25.html#io.streambuf.derived">Derived streambuf Classes</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch25s02.html">Buffering</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt11ch26.html">26. Memory Based Streams</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt11ch26.html#manual.io.memstreams.compat">Compatibility With strstream</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt11ch27.html">27. File Based Streams</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt11ch27.html#manual.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch27s02.html">Binary Input and Output</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch27s03.html">More Binary Input and Output</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt11ch28.html">28. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt11ch28.html#manual.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch28s02.html">Performance</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="extensions.html">XII. Extensions</a></span></dt><dd><dl><dt><span class="preface"><a href="bk01pt12pr03.html"></a></span></dt><dt><span class="chapter"><a href="bk01pt12ch29.html">29. Compile Time Checks</a></span></dt><dt><span class="chapter"><a href="debug_mode.html">30. Debug Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch30s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch30s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch30s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch30s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch30s04.html#manual.ext.debug_mode.design.goals">Goals</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s04.html#manual.ext.debug_mode.design.methods">Methods</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s04.html#manual.ext.debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="parallel_mode.html">31. Parallel Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch31s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch31s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch31s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch31s04.html#manual.ext.parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s04.html#manual.ext.parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s04.html#manual.ext.parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch31s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt12ch32.html">32. Allocators</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt12ch32.html#manual.ext.allocator.mt">mt_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch32.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32.html#allocator.mt.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32.html#allocator.mt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32.html#allocator.mt.example_single">Single Thread Example</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32.html#allocator.mt.example_multi">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="bitmap_allocator.html">bitmap_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.impl">Implementation</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="bk01pt12ch33.html">33. Containers</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt12ch33.html#manual.ext.containers.pbds">Policy Based Data Structures</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch33s02.html">HP/SGI</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch33s03.html">Deprecated HP/SGI</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt12ch34.html">34. Utilities</a></span></dt><dt><span class="chapter"><a href="bk01pt12ch35.html">35. Algorithms</a></span></dt><dt><span class="chapter"><a href="bk01pt12ch36.html">36. Numerics</a></span></dt><dt><span class="chapter"><a href="bk01pt12ch37.html">37. Iterators</a></span></dt><dt><span class="chapter"><a href="bk01pt12ch38.html">38. Input and Output</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt12ch38.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt12ch39.html">39. Demangling</a></span></dt><dt><span class="chapter"><a href="concurrency.html">40. Concurrency</a></span></dt><dd><dl><dt><span class="sect1"><a href="concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="sect2"><a href="concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch40s02.html">Implementation</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch40s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch40s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch40s03.html">Use</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="appendix_contributing.html">A. Contributing</a></span></dt><dd><dl><dt><span class="sect1"><a href="appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01apas02.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="sect1"><a href="bk01apas03.html">Coding Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01apas03.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="sect2"><a href="bk01apas03.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01apas04.html">Documentation Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01apas04.html#doc_style.doxygen">Doxygen</a></span></dt><dt><span class="sect2"><a href="bk01apas04.html#doc_style.docbook">Docbook</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01apas05.html">Design Notes</a></span></dt></dl></dd><dt><span class="appendix"><a href="appendix_porting.html">B. Porting and Maintenance</a></span></dt><dd><dl><dt><span class="sect1"><a href="appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.enable"><code class="constant">GLIBCXX_ENABLE</code>, the <code class="literal">--enable</code> maker</a></span></dt></dl></dd><dt><span class="sect1"><a href="internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="sect2"><a href="internals.html#internals.os">Operating System</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.cpu">CPU</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="sect1"><a href="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="sect2"><a href="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.versioning">Versioning</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.testing">Testing</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="sect1"><a href="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="sect2"><a href="api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt></dl></dd><dt><span class="sect1"><a href="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="sect2"><a href="backwards.html#backwards.first">First</a></span></dt><dt><span class="sect2"><a href="backwards.html#backwards.second">Second</a></span></dt><dt><span class="sect2"><a href="backwards.html#backwards.third">Third</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="appendix_free.html">C. Free Software Needs Free Documentation</a></span></dt><dt><span class="appendix"><a href="bk01apd.html">D. GNU General Public License</a></span></dt><dd><dl><dt><span class="section"><a href="bk01apd.html#gpl-1">Preamble</a></span></dt><dt><span class="section"><a href="bk01apds02.html">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</a></span></dt><dd><dl><dt><span class="section"><a href="bk01apds02.html#gpl-2-0">Section 0</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-1">Section 1</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-2">Section 2</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-3">Section 3</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-4">Section 4</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-5">Section 5</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-6">Section 6</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-7">Section 7</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-8">Section 8</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-9">Section 9</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-10">Section 10</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-11">NO WARRANTY Section 11</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-12">Section 12</a></span></dt></dl></dd><dt><span class="section"><a href="bk01apds03.html">How to Apply These Terms to Your New Programs</a></span></dt></dl></dd><dt><span class="appendix"><a href="bk01ape.html">E. GNU Free Documentation License</a></span></dt></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>1.1. <a href="bk01pt01ch01.html#id337485">C++ TR1 Implementation Status</a></dt><dt>1.2. <a href="bk01pt01ch01.html#id382201">C++ 200x Implementation Status</a></dt><dt>3.1. <a href="bk01pt01ch03s02.html#id394301">C++ 1998 Library Headers</a></dt><dt>3.2. <a href="bk01pt01ch03s02.html#id440630">C++ 1998 Library Headers for C Library Facilities</a></dt><dt>3.3. <a href="bk01pt01ch03s02.html#id382991">C++ 200x Library Headers</a></dt><dt>3.4. <a href="bk01pt01ch03s02.html#id425965">C++ 200x Library Headers for C Library Facilities</a></dt><dt>3.5. <a href="bk01pt01ch03s02.html#id442369">C++ TR1 Library Headers</a></dt><dt>3.6. <a href="bk01pt01ch03s02.html#id401478">C++ TR1 Library Headers for C Library Facilities</a></dt><dt>3.7. <a href="bk01pt01ch03s02.html#id435323">C++ ABI Headers</a></dt><dt>3.8. <a href="bk01pt01ch03s02.html#id432329">Extension Headers</a></dt><dt>3.9. <a href="bk01pt01ch03s02.html#id440887">Extension Debug Headers</a></dt><dt>3.10. <a href="bk01pt01ch03s02.html#id457206">Extension Parallel Headers</a></dt><dt>30.1. <a href="bk01pt12ch30s03.html#id449953">Debugging Containers</a></dt><dt>30.2. <a href="bk01pt12ch30s03.html#id319073">Debugging Containers C++0x</a></dt><dt>31.1. <a href="bk01pt12ch31s03.html#id392310">Parallel Algorithms</a></dt><dt>32.1. <a href="bitmap_allocator.html#id390307">Bitmap Allocator Memory Map</a></dt><dt>B.1. <a href="api.html#id418406">Extension Allocators</a></dt><dt>B.2. <a href="api.html#id476738">Extension Allocators Continued</a></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="../spine.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="intro.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The GNU C++ Library Documentation </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Part I. Introduction</td></tr></table></div></body></html>
+ </p></div></div></div><hr /></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="part"><a href="intro.html">I. Introduction</a></span></dt><dd><dl><dt><span class="chapter"><a href="bk01pt01ch01.html">1. Status</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt01ch01.html#manual.intro.status.standard">Implementation Status</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch01.html#manual.intro.status.standard.1998">C++ 1998</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch01.html#manual.intro.status.standard.tr1">C++ TR1</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch01.html#manual.intro.status.standard.200x">C++ 200x</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch01s02.html">License</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch01s02.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch01s02.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch01s03.html">Bugs</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch01s03.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch01s03.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="bk01pt01ch02.html">2. Setup</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt01ch02.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="sect1"><a href="configure.html">Configure</a></span></dt><dt><span class="sect1"><a href="bk01pt01ch02s03.html">Make</a></span></dt><dt><span class="sect1"><a href="test.html">Test</a></span></dt><dd><dl><dt><span class="sect2"><a href="test.html#test.organization">Organization</a></span></dt><dt><span class="sect2"><a href="test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="sect2"><a href="test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="sect2"><a href="test.html#test.harness">Test Harness and Utilities</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="using.html">3. Using</a></span></dt><dd><dl><dt><span class="sect1"><a href="using.html#manual.intro.using.lib">Linking Library Binary Files</a></span></dt><dt><span class="sect1"><a href="bk01pt01ch03s02.html">Headers</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch03s02.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s02.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s02.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s02.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch03s03.html">Namespaces</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch03s03.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s03.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s03.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch03s04.html">Macros</a></span></dt><dt><span class="sect1"><a href="bk01pt01ch03s05.html">Concurrency</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.io">IO</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s05.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt01ch03s06.html">Exceptions</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt01ch03s06.html#intro.using.exception.propagating">Propagating Exceptions aka Exception Neutrality</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s06.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="sect2"><a href="bk01pt01ch03s06.html#intro.using.exception.no">Support for <code class="literal">-fno-exceptions</code></a></span></dt></dl></dd><dt><span class="sect1"><a href="debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="sect2"><a href="debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="sect2"><a href="debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="sect2"><a href="debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="sect2"><a href="debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="support.html">II. Support</a></span></dt><dd><dl><dt><span class="preface"><a href="bk01pt02pr01.html"></a></span></dt><dt><span class="chapter"><a href="bk01pt02ch04.html">4. Types</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt02ch04.html#manual.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="sect1"><a href="bk01pt02ch04s02.html">Numeric Properties</a></span></dt><dt><span class="sect1"><a href="bk01pt02ch04s03.html">NULL</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt02ch05.html">5. Dynamic Memory</a></span></dt><dt><span class="chapter"><a href="bk01pt02ch06.html">6. Termination</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt02ch06.html#support.termination.handlers">Termination Handlers</a></span></dt><dt><span class="sect1"><a href="bk01pt02ch06s02.html">Verbose Terminate Handler</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="diagnostics.html">III. Diagnostics</a></span></dt><dd><dl><dt><span class="chapter"><a href="bk01pt03ch07.html">7. Exceptions</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt03ch07.html#manual.diagnostics.exceptions.hierarchy">Exception Classes</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch07s02.html">Adding Data to Exceptions</a></span></dt><dt><span class="sect1"><a href="bk01pt03ch07s03.html">Cancellation</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt03ch08.html">8. Concept Checking</a></span></dt></dl></dd><dt><span class="part"><a href="utilities.html">IV. Utilities</a></span></dt><dd><dl><dt><span class="chapter"><a href="bk01pt04ch09.html">9. Functors</a></span></dt><dt><span class="chapter"><a href="bk01pt04ch10.html">10. Pairs</a></span></dt><dt><span class="chapter"><a href="bk01pt04ch11.html">11. Memory</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt04ch11.html#manual.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt04ch11.html#allocator.req">Requirements</a></span></dt><dt><span class="sect2"><a href="bk01pt04ch11.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="bk01pt04ch11.html#allocator.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="bk01pt04ch11.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="sect2"><a href="bk01pt04ch11.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="sect2"><a href="bk01pt04ch11.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="sect1"><a href="auto_ptr.html">auto_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="auto_ptr.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="sect2"><a href="auto_ptr.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="shared_ptr.html">shared_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.using">Use</a></span></dt><dt><span class="sect2"><a href="shared_ptr.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="bk01pt04ch12.html">12. Traits</a></span></dt></dl></dd><dt><span class="part"><a href="strings.html">V. Strings</a></span></dt><dd><dl><dt><span class="chapter"><a href="bk01pt05ch13.html">13. String Classes</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt05ch13.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s02.html">Case Sensitivity</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s03.html">Arbitrary Character Types</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s04.html">Tokenizing</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s05.html">Shrink to Fit</a></span></dt><dt><span class="sect1"><a href="bk01pt05ch13s06.html">CString (MFC)</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="localization.html">VI. Localization</a></span></dt><dd><dl><dt><span class="chapter"><a href="bk01pt06ch14.html">14. Locales</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt06ch14.html#manual.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt06ch14.html#locales.locale.req">Requirements</a></span></dt><dt><span class="sect2"><a href="bk01pt06ch14.html#locales.locale.design">Design</a></span></dt><dt><span class="sect2"><a href="bk01pt06ch14.html#locales.locale.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="bk01pt06ch14.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="bk01pt06ch15.html">15. Facets aka Categories</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt06ch15.html#manual.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt06ch15.html#facet.ctype.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="bk01pt06ch15.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="codecvt.html">codecvt</a></span></dt><dd><dl><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.design">Design</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.use">Use</a></span></dt><dt><span class="sect2"><a href="codecvt.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="messages.html">messages</a></span></dt><dd><dl><dt><span class="sect2"><a href="messages.html#facet.messages.req">Requirements</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.design">Design</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.use">Use</a></span></dt><dt><span class="sect2"><a href="messages.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="containers.html">VII. Containers</a></span></dt><dd><dl><dt><span class="chapter"><a href="bk01pt07ch16.html">16. Sequences</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt07ch16.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt07ch16.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt07ch16s02.html">vector</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt07ch16s02.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="bk01pt07ch17.html">17. Associative</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt07ch17.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="sect1"><a href="bk01pt07ch17s02.html">bitset</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt07ch17s02.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="sect2"><a href="bk01pt07ch17s02.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="bk01pt07ch18.html">18. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt07ch18.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="iterators.html">VIII. Iterators</a></span></dt><dd><dl><dt><span class="chapter"><a href="bk01pt08ch19.html">19. Predefined</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt08ch19.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="sect1"><a href="bk01pt08ch19s02.html">One Past the End</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="algorithms.html">IX. Algorithms</a></span></dt><dd><dl><dt><span class="preface"><a href="bk01pt09pr02.html"></a></span></dt><dt><span class="chapter"><a href="bk01pt09ch20.html">20. Mutating</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt09ch20.html#algorithms.mutating.swap"><code class="function">swap</code></a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt09ch20.html#algorithms.swap.specializations">Specializations</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="numerics.html">X. Numerics</a></span></dt><dd><dl><dt><span class="chapter"><a href="bk01pt10ch21.html">21. Complex</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt10ch21.html#numerics.complex.processing">complex Processing</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt10ch22.html">22. Generalized Operations</a></span></dt><dt><span class="chapter"><a href="bk01pt10ch23.html">23. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt10ch23.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="sect1"><a href="bk01pt10ch23s02.html">C99</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="io.html">XI. Input and Output</a></span></dt><dd><dl><dt><span class="chapter"><a href="bk01pt11ch24.html">24. Iostream Objects</a></span></dt><dt><span class="chapter"><a href="bk01pt11ch25.html">25. Stream Buffers</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt11ch25.html#io.streambuf.derived">Derived streambuf Classes</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch25s02.html">Buffering</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt11ch26.html">26. Memory Based Streams</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt11ch26.html#manual.io.memstreams.compat">Compatibility With strstream</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt11ch27.html">27. File Based Streams</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt11ch27.html#manual.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch27s02.html">Binary Input and Output</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch27s03.html">More Binary Input and Output</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt11ch28.html">28. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt11ch28.html#manual.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="sect1"><a href="bk01pt11ch28s02.html">Performance</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="extensions.html">XII. Extensions</a></span></dt><dd><dl><dt><span class="preface"><a href="bk01pt12pr03.html"></a></span></dt><dt><span class="chapter"><a href="bk01pt12ch29.html">29. Compile Time Checks</a></span></dt><dt><span class="chapter"><a href="debug_mode.html">30. Debug Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch30s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch30s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch30s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch30s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch30s04.html#manual.ext.debug_mode.design.goals">Goals</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s04.html#manual.ext.debug_mode.design.methods">Methods</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch30s04.html#manual.ext.debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="parallel_mode.html">31. Parallel Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch31s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch31s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch31s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch31s04.html#manual.ext.parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s04.html#manual.ext.parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch31s04.html#manual.ext.parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch31s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt12ch32.html">32. Allocators</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt12ch32.html#manual.ext.allocator.mt">mt_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch32.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32.html#allocator.mt.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32.html#allocator.mt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32.html#allocator.mt.example_single">Single Thread Example</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch32.html#allocator.mt.example_multi">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="bitmap_allocator.html">bitmap_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="sect2"><a href="bitmap_allocator.html#allocator.bitmap.impl">Implementation</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="bk01pt12ch33.html">33. Containers</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt12ch33.html#manual.ext.containers.pbds">Policy Based Data Structures</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch33s02.html">HP/SGI</a></span></dt><dt><span class="sect1"><a href="bk01pt12ch33s03.html">Deprecated HP/SGI</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt12ch34.html">34. Utilities</a></span></dt><dt><span class="chapter"><a href="bk01pt12ch35.html">35. Algorithms</a></span></dt><dt><span class="chapter"><a href="bk01pt12ch36.html">36. Numerics</a></span></dt><dt><span class="chapter"><a href="bk01pt12ch37.html">37. Iterators</a></span></dt><dt><span class="chapter"><a href="bk01pt12ch38.html">38. Input and Output</a></span></dt><dd><dl><dt><span class="sect1"><a href="bk01pt12ch38.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="bk01pt12ch39.html">39. Demangling</a></span></dt><dt><span class="chapter"><a href="concurrency.html">40. Concurrency</a></span></dt><dd><dl><dt><span class="sect1"><a href="concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="sect2"><a href="concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch40s02.html">Implementation</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01pt12ch40s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="sect2"><a href="bk01pt12ch40s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01pt12ch40s03.html">Use</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="appendix_contributing.html">A. Contributing</a></span></dt><dd><dl><dt><span class="sect1"><a href="appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="sect2"><a href="appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01apas02.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="sect1"><a href="bk01apas03.html">Coding Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01apas03.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="sect2"><a href="bk01apas03.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01apas04.html">Documentation Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="bk01apas04.html#doc_style.doxygen">Doxygen</a></span></dt><dt><span class="sect2"><a href="bk01apas04.html#doc_style.docbook">Docbook</a></span></dt></dl></dd><dt><span class="sect1"><a href="bk01apas05.html">Design Notes</a></span></dt></dl></dd><dt><span class="appendix"><a href="appendix_porting.html">B. Porting and Maintenance</a></span></dt><dd><dl><dt><span class="sect1"><a href="appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="sect2"><a href="appendix_porting.html#build_hacking.enable"><code class="constant">GLIBCXX_ENABLE</code>, the <code class="literal">--enable</code> maker</a></span></dt></dl></dd><dt><span class="sect1"><a href="internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="sect2"><a href="internals.html#internals.os">Operating System</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.cpu">CPU</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="sect2"><a href="internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="sect1"><a href="abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="sect2"><a href="abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.versioning">Versioning</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.testing">Testing</a></span></dt><dt><span class="sect2"><a href="abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="sect1"><a href="api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="sect2"><a href="api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="sect2"><a href="api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt></dl></dd><dt><span class="sect1"><a href="backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="sect2"><a href="backwards.html#backwards.first">First</a></span></dt><dt><span class="sect2"><a href="backwards.html#backwards.second">Second</a></span></dt><dt><span class="sect2"><a href="backwards.html#backwards.third">Third</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="appendix_free.html">C. Free Software Needs Free Documentation</a></span></dt><dt><span class="appendix"><a href="bk01apd.html">D. GNU General Public License</a></span></dt><dd><dl><dt><span class="section"><a href="bk01apd.html#gpl-1">Preamble</a></span></dt><dt><span class="section"><a href="bk01apds02.html">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</a></span></dt><dd><dl><dt><span class="section"><a href="bk01apds02.html#gpl-2-0">Section 0</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-1">Section 1</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-2">Section 2</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-3">Section 3</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-4">Section 4</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-5">Section 5</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-6">Section 6</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-7">Section 7</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-8">Section 8</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-9">Section 9</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-10">Section 10</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-11">NO WARRANTY Section 11</a></span></dt><dt><span class="section"><a href="bk01apds02.html#gpl-2-12">Section 12</a></span></dt></dl></dd><dt><span class="section"><a href="bk01apds03.html">How to Apply These Terms to Your New Programs</a></span></dt></dl></dd><dt><span class="appendix"><a href="bk01ape.html">E. GNU Free Documentation License</a></span></dt></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>1.1. <a href="bk01pt01ch01.html#id438495">C++ TR1 Implementation Status</a></dt><dt>1.2. <a href="bk01pt01ch01.html#id563872">C++ 200x Implementation Status</a></dt><dt>3.1. <a href="bk01pt01ch03s02.html#id505554">C++ 1998 Library Headers</a></dt><dt>3.2. <a href="bk01pt01ch03s02.html#id476402">C++ 1998 Library Headers for C Library Facilities</a></dt><dt>3.3. <a href="bk01pt01ch03s02.html#id541430">C++ 200x Library Headers</a></dt><dt>3.4. <a href="bk01pt01ch03s02.html#id489256">C++ 200x Library Headers for C Library Facilities</a></dt><dt>3.5. <a href="bk01pt01ch03s02.html#id492746">C++ TR1 Library Headers</a></dt><dt>3.6. <a href="bk01pt01ch03s02.html#id535005">C++ TR1 Library Headers for C Library Facilities</a></dt><dt>3.7. <a href="bk01pt01ch03s02.html#id484224">C++ ABI Headers</a></dt><dt>3.8. <a href="bk01pt01ch03s02.html#id538981">Extension Headers</a></dt><dt>3.9. <a href="bk01pt01ch03s02.html#id483812">Extension Debug Headers</a></dt><dt>3.10. <a href="bk01pt01ch03s02.html#id479085">Extension Parallel Headers</a></dt><dt>30.1. <a href="bk01pt12ch30s03.html#id479508">Debugging Containers</a></dt><dt>30.2. <a href="bk01pt12ch30s03.html#id565812">Debugging Containers C++0x</a></dt><dt>31.1. <a href="bk01pt12ch31s03.html#id572219">Parallel Algorithms</a></dt><dt>32.1. <a href="bitmap_allocator.html#id588050">Bitmap Allocator Memory Map</a></dt><dt>B.1. <a href="api.html#id488788">Extension Allocators</a></dt><dt>B.2. <a href="api.html#id594393">Extension Allocators Continued</a></dt></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="../spine.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="intro.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The GNU C++ Library Documentation </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Part I. Introduction</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/manual/test.html b/libstdc++-v3/doc/html/manual/test.html
index 72213ba18c5..297899eb3fd 100644
--- a/libstdc++-v3/doc/html/manual/test.html
+++ b/libstdc++-v3/doc/html/manual/test.html
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Test</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; test&#10; , &#10; testsuite&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="start" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="bk01pt01ch02.html" title="Chapter 2. Setup" /><link rel="prev" href="build.html" title="Build" /><link rel="next" href="using.html" title="Chapter 3. Using" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Test</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="build.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Setup</th><td width="20%" align="right"> <a accesskey="n" href="using.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.setup.test"></a>Test</h2></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="test.organization"></a>Organization</h3></div></div></div><p>
+<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Test</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; test&#10; , &#10; testsuite&#10; , &#10; performance&#10; , &#10; conformance&#10; , &#10; ABI&#10; , &#10; exception safety&#10; " /><meta name="keywords" content="&#10; ISO C++&#10; , &#10; library&#10; " /><link rel="start" href="../spine.html" title="The GNU C++ Library Documentation" /><link rel="up" href="bk01pt01ch02.html" title="Chapter 2. Setup" /><link rel="prev" href="bk01pt01ch02s03.html" title="Make" /><link rel="next" href="using.html" title="Chapter 3. Using" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Test</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="bk01pt01ch02s03.html">Prev</a> </td><th width="60%" align="center">Chapter 2. Setup</th><td width="20%" align="right"> <a accesskey="n" href="using.html">Next</a></td></tr></table><hr /></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.setup.test"></a>Test</h2></div></div></div><p>
+The libstdc++ testsuite includes testing for standard conformance,
+regressions, ABI, and performance.
+</p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="test.organization"></a>Organization</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="test.organization.layout"></a>Directory Layout</h4></div></div></div><p>
The directory <span class="emphasis"><em>libsrcdir/testsuite</em></span> contains the
individual test cases organized in sub-directories corresponding to
chapters of the C++ standard (detailed below), the dejagnu test
@@ -69,7 +72,7 @@ util Files for libtestc++, utilities and testing routines.
</pre><p>
All new tests should be written with the policy of one test
case, one file in mind.
- </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="test.naming"></a>Naming Conventions</h3></div></div></div><p>
+ </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="test.organization.naming"></a>Naming Conventions</h4></div></div></div><p>
In addition, there are some special names and suffixes that are
used within the testsuite to designate particular kinds of
tests.
@@ -123,69 +126,7 @@ cat 27_io/objects/char/3_xin.in | a.out
analyze runtime performance, for performance regression testing,
or for other optimization related analysis. At the moment, these
test cases are not run by default.
- </p></li></ul></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="test.utils"></a>Utilities</h3></div></div></div><p>
- </p><p>
- The testsuite directory also contains some files that implement
- functionality that is intended to make writing test cases easier,
- or to avoid duplication, or to provide error checking in a way that
- is consistent across platforms and test harnesses. A stand-alone
- executable, called <span class="emphasis"><em>abi_check</em></span>, and a static
- library called <span class="emphasis"><em>libtestc++</em></span> are
- constructed. Both of these items are not installed, and only used
- during testing.
- </p><p>
- These files include the following functionality:
- </p><div class="itemizedlist"><ul type="disc"><li><p>
- <span class="emphasis"><em>testsuite_abi.h</em></span>,
- <span class="emphasis"><em>testsuite_abi.cc</em></span>,
- <span class="emphasis"><em>testsuite_abi_check.cc</em></span>
- </p><p>
- Creates the executable <span class="emphasis"><em>abi_check</em></span>.
- Used to check correctness of symbol versioning, visibility of
- exported symbols, and compatibility on symbols in the shared
- library, for hosts that support this feature. More information
- can be found in the ABI documentation <a class="ulink" href="abi.html" target="_top">here</a>
- </p></li><li><p>
- <span class="emphasis"><em>testsuite_allocator.h</em></span>,
- <span class="emphasis"><em>testsuite_allocator.cc</em></span>
- </p><p>
- Contains specialized allocators that keep track of construction
- and destruction. Also, support for overriding global new and
- delete operators, including verification that new and delete
- are called during execution, and that allocation over max_size
- fails.
- </p></li><li><p>
- <span class="emphasis"><em>testsuite_character.h</em></span>
- </p><p>
- Contains <code class="code">std::char_traits</code> and
- <code class="code">std::codecvt</code> specializations for a user-defined
- POD.
- </p></li><li><p>
- <span class="emphasis"><em>testsuite_hooks.h</em></span>,
- <span class="emphasis"><em>testsuite_hooks.cc</em></span>
- </p><p>
- A large number of utilities, including:
- </p><div class="itemizedlist"><ul type="circle"><li><p>VERIFY</p></li><li><p>set_memory_limits</p></li><li><p>verify_demangle</p></li><li><p>run_tests_wrapped_locale</p></li><li><p>run_tests_wrapped_env</p></li><li><p>try_named_locale</p></li><li><p>try_mkfifo</p></li><li><p>func_callback</p></li><li><p>counter</p></li><li><p>copy_tracker</p></li><li><p>copy_constructor</p></li><li><p>assignment_operator</p></li><li><p>destructor</p></li><li><p>pod_char, pod_int and associated char_traits specializations</p></li></ul></div></li><li><p>
- <span class="emphasis"><em>testsuite_io.h</em></span>
- </p><p>
- Error, exception, and constraint checking for
- <code class="code">std::streambuf, std::basic_stringbuf, std::basic_filebuf</code>.
- </p></li><li><p>
- <span class="emphasis"><em>testsuite_iterators.h</em></span>
- </p><p>
- Wrappers for various iterators.
- </p></li><li><p>
- <span class="emphasis"><em>testsuite_performance.h</em></span>
- </p><p>
- A number of class abstractions for performance counters, and
- reporting functions including:
- </p><div class="itemizedlist"><ul type="circle"><li><p>time_counter</p></li><li><p>resource_counter</p></li><li><p>report_performance</p></li></ul></div></li></ul></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="test.run"></a>Running the Testsuite</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="test.run.basic"></a>Basic Results</h4></div></div></div><p>
- There are several options for running tests, including testing
- the regression tests, testing a subset of the regression tests,
- testing the performance tests, testing just compilation, testing
- installed tools, etc. In addition, there is a special rule for
- checking the exported symbols of the shared library.
- </p><p>
+ </p></li></ul></div></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="test.run"></a>Running the Testsuite</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="test.run.basic"></a>Basic</h4></div></div></div><p>
You can check the status of the build without installing it
using the dejagnu harness, much like the rest of the gcc
tools.</p><pre class="programlisting"> make check</pre><p>in the <span class="emphasis"><em>libbuilddir</em></span> directory.</p><p>or</p><pre class="programlisting"> make check-target-libstdc++-v3</pre><p>in the <span class="emphasis"><em>gccbuilddir</em></span> directory.
@@ -200,12 +141,18 @@ cat 27_io/objects/char/3_xin.in | a.out
output, and the executable output (if any).
</p><p>
Archives of test results for various versions and platforms are
- available on the GCC website in the <a class="ulink" href="http://gcc.gnu.org/gcc-4.1/buildstat.html" target="_top">build
+ available on the GCC website in the <a class="ulink" href="http://gcc.gnu.org/gcc-4.3/buildstat.html" target="_top">build
status</a> section of each individual release, and are also
archived on a daily basis on the <a class="ulink" href="http://gcc.gnu.org/ml/gcc-testresults/current" target="_top">gcc-testresults</a>
mailing list. Please check either of these places for a similar
combination of source version, operating system, and host CPU.
- </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="test.run.options"></a>Options</h4></div></div></div><p>
+ </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="test.run.variations"></a>Variations</h4></div></div></div><p>
+ There are several options for running tests, including testing
+ the regression tests, testing a subset of the regression tests,
+ testing the performance tests, testing just compilation, testing
+ installed tools, etc. In addition, there is a special rule for
+ checking the exported symbols of the shared library.
+ </p><p>
To debug the dejagnu test harness during runs, try invoking with a
specific argument to the variable RUNTESTFLAGS, as below.
</p><pre class="programlisting">
@@ -325,7 +272,7 @@ runtest --tool libstdc++ --srcdir=/path/to/gcc/libstdc++-v3/testsuite
We are interested in any strange failures of the testsuite;
please email the main libstdc++ mailing list if you see
something odd or have questions.
- </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="test.run.permutations"></a>Test Permutations</h4></div></div></div><p>
+ </p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="test.run.permutations"></a>Permutations</h4></div></div></div><p>
To run the libstdc++ test suite under the <a class="link" href="debug_mode.html" title="Chapter 30. Debug Mode">debug mode</a>, edit
<code class="filename">libstdc++-v3/scripts/testsuite_flags</code> to add the
compile-time flag <code class="constant">-D_GLIBCXX_DEBUG</code> to the
@@ -337,9 +284,15 @@ runtest --tool libstdc++ --srcdir=/path/to/gcc/libstdc++-v3/testsuite
release mode: any deviation indicates an error in either the
library or the test suite.
</p><p>
+ The <a class="link" href="parallel_mode.html" title="Chapter 31. Parallel Mode">parallel
+ mode</a> can be tested in much the same manner, substituting
+ <code class="constant">-D_GLIBCXX_PARALLEL</code> for
+ <code class="constant">-D_GLIBCXX_DEBUG</code> in the previous paragraph.
+ </p><p>
Or, just run the testsuites with <code class="constant">CXXFLAGS</code>
- set to <code class="constant">-D_GLIBCXX_DEBUG</code>.
- </p></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="test.new_tests"></a>New Test Cases</h3></div></div></div><p>
+ set to <code class="constant">-D_GLIBCXX_DEBUG</code> or
+ <code class="constant">-D_GLIBCXX_PARALLEL</code>.
+ </p></div></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="test.new_tests"></a>Writing a new test case</h3></div></div></div><p>
The first step in making a new test case is to choose the correct
directory and file name, given the organization as previously
described.
@@ -450,8 +403,10 @@ up in the normal.exp file.
// { dg-options "-O0" { target *-*-* } }
</pre><p>
More examples can be found in the libstdc++-v3/testsuite/*/*.cc files.
- </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="test.dejagnu"></a>Test Harness Details</h3></div></div></div><p>
- Underlying details of testing are abstracted via the GNU Dejagnu package.
+ </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="test.harness"></a>Test Harness and Utilities</h3></div></div></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="test.harness.dejagnu"></a>Dejagnu Harness Details</h4></div></div></div><p>
+ Underlying details of testing for conformance and regressions are
+ abstracted via the GNU Dejagnu package. This is similar to the
+ rest of GCC.
</p><p>This is information for those looking at making changes to the testsuite
structure, and/or needing to trace dejagnu's actions with --verbose. This
will not be useful to people who are "merely" adding new tests to the existing
@@ -475,29 +430,60 @@ callbacks loaded from the support library.
</p><p>The <code class="code">config</code> directory is searched for any particular "target
board" information unique to this library. This is currently unused and sets
only default variables.
-</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="test.future"></a>Future</h3></div></div></div><p>
+</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="test.harness.utils"></a>Utilities</h4></div></div></div><p>
</p><p>
-Shared runs need to be implemented, for targets that support shared libraries.
-</p><p>
-Diffing of expected output to standard streams needs to be finished off.
-</p><p>
-The V3 testing framework supports, or will eventually support,
-additional keywords for the purpose of easing the job of writing
-test cases. All V3-keywords are of the form <code class="code">@xxx@</code>.
-Currently plans for supported keywords include:
-</p><div class="variablelist"><dl><dt><span class="term"> <code class="code"> @require@ &lt;files&gt; </code> </span></dt><dd><p>
- The existence of &lt;files&gt; is essential for the test to complete
- successfully. For example, a test case foo.C using bar.baz as
- input file could say
- </p><pre class="programlisting">
- // @require@ bar.baz</pre><p>
- The special variable % stands for the rootname, e.g. the
- file-name without its `.C' extension. Example of use (taken
- verbatim from 27_io/filebuf.cc)
- </p><pre class="programlisting">
- // @require@ %-*.tst %-*.txt</pre></dd><dt><span class="term"> <code class="code"> @diff@ &lt;first-list&gt; &lt;second-list&gt; </code> </span></dt><dd><p>
- After the test case compiles and ran successfully, diff
- &lt;first-list&gt; against &lt;second-list&gt;, these lists should
- have the same length. The test fails if diff returns non-zero a
- pair of files.
- </p></dd></dl></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="build.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="bk01pt01ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="using.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Build </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 3. Using</td></tr></table></div></body></html>
+ The testsuite directory also contains some files that implement
+ functionality that is intended to make writing test cases easier,
+ or to avoid duplication, or to provide error checking in a way that
+ is consistent across platforms and test harnesses. A stand-alone
+ executable, called <span class="emphasis"><em>abi_check</em></span>, and a static
+ library called <span class="emphasis"><em>libtestc++</em></span> are
+ constructed. Both of these items are not installed, and only used
+ during testing.
+ </p><p>
+ These files include the following functionality:
+ </p><div class="itemizedlist"><ul type="disc"><li><p>
+ <span class="emphasis"><em>testsuite_abi.h</em></span>,
+ <span class="emphasis"><em>testsuite_abi.cc</em></span>,
+ <span class="emphasis"><em>testsuite_abi_check.cc</em></span>
+ </p><p>
+ Creates the executable <span class="emphasis"><em>abi_check</em></span>.
+ Used to check correctness of symbol versioning, visibility of
+ exported symbols, and compatibility on symbols in the shared
+ library, for hosts that support this feature. More information
+ can be found in the ABI documentation <a class="ulink" href="abi.html" target="_top">here</a>
+ </p></li><li><p>
+ <span class="emphasis"><em>testsuite_allocator.h</em></span>,
+ <span class="emphasis"><em>testsuite_allocator.cc</em></span>
+ </p><p>
+ Contains specialized allocators that keep track of construction
+ and destruction. Also, support for overriding global new and
+ delete operators, including verification that new and delete
+ are called during execution, and that allocation over max_size
+ fails.
+ </p></li><li><p>
+ <span class="emphasis"><em>testsuite_character.h</em></span>
+ </p><p>
+ Contains <code class="code">std::char_traits</code> and
+ <code class="code">std::codecvt</code> specializations for a user-defined
+ POD.
+ </p></li><li><p>
+ <span class="emphasis"><em>testsuite_hooks.h</em></span>,
+ <span class="emphasis"><em>testsuite_hooks.cc</em></span>
+ </p><p>
+ A large number of utilities, including:
+ </p><div class="itemizedlist"><ul type="circle"><li><p>VERIFY</p></li><li><p>set_memory_limits</p></li><li><p>verify_demangle</p></li><li><p>run_tests_wrapped_locale</p></li><li><p>run_tests_wrapped_env</p></li><li><p>try_named_locale</p></li><li><p>try_mkfifo</p></li><li><p>func_callback</p></li><li><p>counter</p></li><li><p>copy_tracker</p></li><li><p>copy_constructor</p></li><li><p>assignment_operator</p></li><li><p>destructor</p></li><li><p>pod_char, pod_int and associated char_traits specializations</p></li></ul></div></li><li><p>
+ <span class="emphasis"><em>testsuite_io.h</em></span>
+ </p><p>
+ Error, exception, and constraint checking for
+ <code class="code">std::streambuf, std::basic_stringbuf, std::basic_filebuf</code>.
+ </p></li><li><p>
+ <span class="emphasis"><em>testsuite_iterators.h</em></span>
+ </p><p>
+ Wrappers for various iterators.
+ </p></li><li><p>
+ <span class="emphasis"><em>testsuite_performance.h</em></span>
+ </p><p>
+ A number of class abstractions for performance counters, and
+ reporting functions including:
+ </p><div class="itemizedlist"><ul type="circle"><li><p>time_counter</p></li><li><p>resource_counter</p></li><li><p>report_performance</p></li></ul></div></li></ul></div></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="bk01pt01ch02s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="bk01pt01ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="using.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Make </td><td width="20%" align="center"><a accesskey="h" href="../spine.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 3. Using</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/html/spine.html b/libstdc++-v3/doc/html/spine.html
index 87cbe66353c..432f577c763 100644
--- a/libstdc++-v3/doc/html/spine.html
+++ b/libstdc++-v3/doc/html/spine.html
@@ -2,4 +2,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>The GNU C++ Library Documentation</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><link rel="start" href="spine.html" title="The GNU C++ Library Documentation" /><link rel="next" href="manual/spine.html" title="The GNU C++ Library" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The GNU C++ Library Documentation</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="manual/spine.html">Next</a></td></tr></table><hr /></div><div class="set" lang="en" xml:lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="set-index"></a>The GNU C++ Library Documentation</h1></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">Paolo</span> <span class="surname">Carlini</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Phil</span> <span class="surname">Edwards</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Doug</span> <span class="surname">Gregor</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Benjamin</span> <span class="surname">Kosnik</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Dhruv</span> <span class="surname">Matani</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Jason</span> <span class="surname">Merrill</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Mark</span> <span class="surname">Mitchell</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Nathan</span> <span class="surname">Myers</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Felix</span> <span class="surname">Natter</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Stefan</span> <span class="surname">Olsson</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Johannes</span> <span class="surname">Singler</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Ami</span> <span class="surname">Tavory</span></h3></div><div class="author"><h3 class="author"><span class="firstname">Jonathan</span> <span class="surname">Wakely</span></h3></div></div></div><div><p class="copyright">Copyright © 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
<a class="ulink" href="http://fsf.org" target="_top">FSF</a>
- </p></div></div><hr /></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="book"><a href="manual/spine.html">The GNU C++ Library</a></span></dt><dd><dl><dt><span class="part"><a href="manual/intro.html">I. Introduction</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/bk01pt01ch01.html">1. Status</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt01ch01.html#manual.intro.status.standard">Implementation Status</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt01ch01.html#manual.intro.status.standard.1998">C++ 1998</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch01.html#manual.intro.status.standard.tr1">C++ TR1</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch01.html#manual.intro.status.standard.200x">C++ 200x</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt01ch01s02.html">License</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt01ch01s02.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch01s02.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt01ch01s03.html">Bugs</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt01ch01s03.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch01s03.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/bk01pt01ch02.html">2. Setup</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt01ch02.html#manual.intro.setup.configure">Configure</a></span></dt><dt><span class="sect1"><a href="manual/build.html">Build</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/build.html#build.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="manual/build.html#build.configure">Make</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/test.html">Test</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/test.html#test.organization">Organization</a></span></dt><dt><span class="sect2"><a href="manual/test.html#test.naming">Naming Conventions</a></span></dt><dt><span class="sect2"><a href="manual/test.html#test.utils">Utilities</a></span></dt><dt><span class="sect2"><a href="manual/test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="sect2"><a href="manual/test.html#test.new_tests">New Test Cases</a></span></dt><dt><span class="sect2"><a href="manual/test.html#test.dejagnu">Test Harness Details</a></span></dt><dt><span class="sect2"><a href="manual/test.html#test.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/using.html">3. Using</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/using.html#manual.intro.using.lib">Linking Library Binary Files</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt01ch03s02.html">Headers</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt01ch03s02.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s02.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s02.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s02.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt01ch03s03.html">Namespaces</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt01ch03s03.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s03.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s03.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt01ch03s04.html">Macros</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt01ch03s05.html">Concurrency</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt01ch03s05.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s05.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s05.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s05.html#manual.intro.using.concurrency.io">IO</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s05.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt01ch03s06.html">Exceptions</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt01ch03s06.html#intro.using.exception.propagating">Propagating Exceptions aka Exception Neutrality</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s06.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s06.html#intro.using.exception.no">Support for <code class="literal">-fno-exceptions</code></a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="manual/support.html">II. Support</a></span></dt><dd><dl><dt><span class="preface"><a href="manual/bk01pt02pr01.html"></a></span></dt><dt><span class="chapter"><a href="manual/bk01pt02ch04.html">4. Types</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt02ch04.html#manual.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt02ch04s02.html">Numeric Properties</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt02ch04s03.html">NULL</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt02ch05.html">5. Dynamic Memory</a></span></dt><dt><span class="chapter"><a href="manual/bk01pt02ch06.html">6. Termination</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt02ch06.html#support.termination.handlers">Termination Handlers</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt02ch06s02.html">Verbose Terminate Handler</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/diagnostics.html">III. Diagnostics</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/bk01pt03ch07.html">7. Exceptions</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt03ch07.html#manual.diagnostics.exceptions.hierarchy">Exception Classes</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt03ch07s02.html">Adding Data to Exceptions</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt03ch07s03.html">Cancellation</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt03ch08.html">8. Concept Checking</a></span></dt></dl></dd><dt><span class="part"><a href="manual/utilities.html">IV. Utilities</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/bk01pt04ch09.html">9. Functors</a></span></dt><dt><span class="chapter"><a href="manual/bk01pt04ch10.html">10. Pairs</a></span></dt><dt><span class="chapter"><a href="manual/bk01pt04ch11.html">11. Memory</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt04ch11.html#manual.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt04ch11.html#allocator.req">Requirements</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt04ch11.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt04ch11.html#allocator.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt04ch11.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt04ch11.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt04ch11.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/auto_ptr.html">auto_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/auto_ptr.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="sect2"><a href="manual/auto_ptr.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/shared_ptr.html">shared_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/shared_ptr.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="sect2"><a href="manual/shared_ptr.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="manual/shared_ptr.html#shared_ptr.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/shared_ptr.html#shared_ptr.using">Use</a></span></dt><dt><span class="sect2"><a href="manual/shared_ptr.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/bk01pt04ch12.html">12. Traits</a></span></dt></dl></dd><dt><span class="part"><a href="manual/strings.html">V. Strings</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/bk01pt05ch13.html">13. String Classes</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt05ch13.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt05ch13s02.html">Case Sensitivity</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt05ch13s03.html">Arbitrary Character Types</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt05ch13s04.html">Tokenizing</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt05ch13s05.html">Shrink to Fit</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt05ch13s06.html">CString (MFC)</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/localization.html">VI. Localization</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/bk01pt06ch14.html">14. Locales</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt06ch14.html#manual.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt06ch14.html#locales.locale.req">Requirements</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt06ch14.html#locales.locale.design">Design</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt06ch14.html#locales.locale.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt06ch14.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/bk01pt06ch15.html">15. Facets aka Categories</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt06ch15.html#manual.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt06ch15.html#facet.ctype.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt06ch15.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/codecvt.html">codecvt</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/codecvt.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="sect2"><a href="manual/codecvt.html#facet.codecvt.design">Design</a></span></dt><dt><span class="sect2"><a href="manual/codecvt.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/codecvt.html#facet.codecvt.use">Use</a></span></dt><dt><span class="sect2"><a href="manual/codecvt.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/messages.html">messages</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/messages.html#facet.messages.req">Requirements</a></span></dt><dt><span class="sect2"><a href="manual/messages.html#facet.messages.design">Design</a></span></dt><dt><span class="sect2"><a href="manual/messages.html#facet.messages.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/messages.html#facet.messages.use">Use</a></span></dt><dt><span class="sect2"><a href="manual/messages.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="manual/containers.html">VII. Containers</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/bk01pt07ch16.html">16. Sequences</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt07ch16.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt07ch16.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt07ch16s02.html">vector</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt07ch16s02.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/bk01pt07ch17.html">17. Associative</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt07ch17.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt07ch17s02.html">bitset</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt07ch17s02.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt07ch17s02.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/bk01pt07ch18.html">18. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt07ch18.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/iterators.html">VIII. Iterators</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/bk01pt08ch19.html">19. Predefined</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt08ch19.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt08ch19s02.html">One Past the End</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/algorithms.html">IX. Algorithms</a></span></dt><dd><dl><dt><span class="preface"><a href="manual/bk01pt09pr02.html"></a></span></dt><dt><span class="chapter"><a href="manual/bk01pt09ch20.html">20. Mutating</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt09ch20.html#algorithms.mutating.swap"><code class="function">swap</code></a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt09ch20.html#algorithms.swap.specializations">Specializations</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="manual/numerics.html">X. Numerics</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/bk01pt10ch21.html">21. Complex</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt10ch21.html#numerics.complex.processing">complex Processing</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt10ch22.html">22. Generalized Operations</a></span></dt><dt><span class="chapter"><a href="manual/bk01pt10ch23.html">23. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt10ch23.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt10ch23s02.html">C99</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/io.html">XI. Input and Output</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/bk01pt11ch24.html">24. Iostream Objects</a></span></dt><dt><span class="chapter"><a href="manual/bk01pt11ch25.html">25. Stream Buffers</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt11ch25.html#io.streambuf.derived">Derived streambuf Classes</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt11ch25s02.html">Buffering</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt11ch26.html">26. Memory Based Streams</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt11ch26.html#manual.io.memstreams.compat">Compatibility With strstream</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt11ch27.html">27. File Based Streams</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt11ch27.html#manual.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt11ch27s02.html">Binary Input and Output</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt11ch27s03.html">More Binary Input and Output</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt11ch28.html">28. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt11ch28.html#manual.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt11ch28s02.html">Performance</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/extensions.html">XII. Extensions</a></span></dt><dd><dl><dt><span class="preface"><a href="manual/bk01pt12pr03.html"></a></span></dt><dt><span class="chapter"><a href="manual/bk01pt12ch29.html">29. Compile Time Checks</a></span></dt><dt><span class="chapter"><a href="manual/debug_mode.html">30. Debug Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch30s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch30s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch30s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch30s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch30s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch30s04.html#manual.ext.debug_mode.design.goals">Goals</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch30s04.html#manual.ext.debug_mode.design.methods">Methods</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch30s04.html#manual.ext.debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/parallel_mode.html">31. Parallel Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch31s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch31s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch31s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch31s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch31s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch31s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch31s04.html#manual.ext.parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch31s04.html#manual.ext.parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch31s04.html#manual.ext.parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch31s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="manual/parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt12ch32.html">32. Allocators</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt12ch32.html#manual.ext.allocator.mt">mt_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch32.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32.html#allocator.mt.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32.html#allocator.mt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32.html#allocator.mt.example_single">Single Thread Example</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32.html#allocator.mt.example_multi">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bitmap_allocator.html">bitmap_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="sect2"><a href="manual/bitmap_allocator.html#allocator.bitmap.impl">Implementation</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/bk01pt12ch33.html">33. Containers</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt12ch33.html#manual.ext.containers.pbds">Policy Based Data Structures</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch33s02.html">HP/SGI</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch33s03.html">Deprecated HP/SGI</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt12ch34.html">34. Utilities</a></span></dt><dt><span class="chapter"><a href="manual/bk01pt12ch35.html">35. Algorithms</a></span></dt><dt><span class="chapter"><a href="manual/bk01pt12ch36.html">36. Numerics</a></span></dt><dt><span class="chapter"><a href="manual/bk01pt12ch37.html">37. Iterators</a></span></dt><dt><span class="chapter"><a href="manual/bk01pt12ch38.html">38. Input and Output</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt12ch38.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt12ch39.html">39. Demangling</a></span></dt><dt><span class="chapter"><a href="manual/concurrency.html">40. Concurrency</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="sect2"><a href="manual/concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch40s02.html">Implementation</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch40s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch40s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch40s03.html">Use</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="manual/appendix_contributing.html">A. Contributing</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="sect2"><a href="manual/appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="sect2"><a href="manual/appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="sect2"><a href="manual/appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01apas02.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="sect1"><a href="manual/bk01apas03.html">Coding Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01apas03.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="sect2"><a href="manual/bk01apas03.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01apas04.html">Documentation Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01apas04.html#doc_style.doxygen">Doxygen</a></span></dt><dt><span class="sect2"><a href="manual/bk01apas04.html#doc_style.docbook">Docbook</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01apas05.html">Design Notes</a></span></dt></dl></dd><dt><span class="appendix"><a href="manual/appendix_porting.html">B. Porting and Maintenance</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.enable"><code class="constant">GLIBCXX_ENABLE</code>, the <code class="literal">--enable</code> maker</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/internals.html#internals.os">Operating System</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.cpu">CPU</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.versioning">Versioning</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.testing">Testing</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/backwards.html#backwards.first">First</a></span></dt><dt><span class="sect2"><a href="manual/backwards.html#backwards.second">Second</a></span></dt><dt><span class="sect2"><a href="manual/backwards.html#backwards.third">Third</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="manual/appendix_free.html">C. Free Software Needs Free Documentation</a></span></dt><dt><span class="appendix"><a href="manual/bk01apd.html">D. GNU General Public License</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01apd.html#gpl-1">Preamble</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-0">Section 0</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-1">Section 1</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-2">Section 2</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-3">Section 3</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-4">Section 4</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-5">Section 5</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-6">Section 6</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-7">Section 7</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-8">Section 8</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-9">Section 9</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-10">Section 10</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-11">NO WARRANTY Section 11</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-12">Section 12</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01apds03.html">How to Apply These Terms to Your New Programs</a></span></dt></dl></dd><dt><span class="appendix"><a href="manual/bk01ape.html">E. GNU Free Documentation License</a></span></dt></dl></dd><dt><span class="book"><a href="bk02.html"></a></span></dt><dd><dl><dt><span class="article"><a href="api.html">API and Source Level Documentation</a></span></dt></dl></dd><dt><span class="book"><a href="bk03.html"></a></span></dt><dd><dl><dt><span class="article"><a href="faq.html">Frequently Asked Questions</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="manual/spine.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> The GNU C++ Library</td></tr></table></div></body></html>
+ </p></div></div><hr /></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="book"><a href="manual/spine.html">The GNU C++ Library</a></span></dt><dd><dl><dt><span class="part"><a href="manual/intro.html">I. Introduction</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/bk01pt01ch01.html">1. Status</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt01ch01.html#manual.intro.status.standard">Implementation Status</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt01ch01.html#manual.intro.status.standard.1998">C++ 1998</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch01.html#manual.intro.status.standard.tr1">C++ TR1</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch01.html#manual.intro.status.standard.200x">C++ 200x</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt01ch01s02.html">License</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt01ch01s02.html#manual.intro.status.license.gpl">The Code: GPL</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch01s02.html#manual.intro.status.license.fdl">The Documentation: GPL, FDL</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt01ch01s03.html">Bugs</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt01ch01s03.html#manual.intro.status.bugs.impl">Implementation Bugs</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch01s03.html#manual.intro.status.bugs.iso">Standard Bugs</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/bk01pt01ch02.html">2. Setup</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt01ch02.html#manual.intro.setup.prereq">Prerequisites</a></span></dt><dt><span class="sect1"><a href="manual/configure.html">Configure</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt01ch02s03.html">Make</a></span></dt><dt><span class="sect1"><a href="manual/test.html">Test</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/test.html#test.organization">Organization</a></span></dt><dt><span class="sect2"><a href="manual/test.html#test.run">Running the Testsuite</a></span></dt><dt><span class="sect2"><a href="manual/test.html#test.new_tests">Writing a new test case</a></span></dt><dt><span class="sect2"><a href="manual/test.html#test.harness">Test Harness and Utilities</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/using.html">3. Using</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/using.html#manual.intro.using.lib">Linking Library Binary Files</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt01ch03s02.html">Headers</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt01ch03s02.html#manual.intro.using.headers.all">Header Files</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s02.html#manual.intro.using.headers.mixing">Mixing Headers</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s02.html#manual.intro.using.headers.cheaders">The C Headers and <code class="code">namespace std</code></a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s02.html#manual.intro.using.headers.pre">Precompiled Headers</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt01ch03s03.html">Namespaces</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt01ch03s03.html#manual.intro.using.namespaces.all">Available Namespaces</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s03.html#manual.intro.using.namespaces.std">namespace std</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s03.html#manual.intro.using.namespaces.comp">Using Namespace Composition</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt01ch03s04.html">Macros</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt01ch03s05.html">Concurrency</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt01ch03s05.html#manual.intro.using.concurrency.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s05.html#manual.intro.using.concurrency.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s05.html#manual.intro.using.concurrency.atomics">Atomics</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s05.html#manual.intro.using.concurrency.io">IO</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s05.html#manual.intro.using.concurrency.containers">Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt01ch03s06.html">Exceptions</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt01ch03s06.html#intro.using.exception.propagating">Propagating Exceptions aka Exception Neutrality</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s06.html#intro.using.exception.safety">Exception Safety</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt01ch03s06.html#intro.using.exception.no">Support for <code class="literal">-fno-exceptions</code></a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/debug.html">Debugging Support</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/debug.html#debug.compiler">Using <span class="command"><strong>g++</strong></span></a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.req">Debug Versions of Library Binary Files</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.memory">Memory Leak Hunting</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.gdb">Using <span class="command"><strong>gdb</strong></span></a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.exceptions">Tracking uncaught exceptions</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.debug_mode">Debug Mode</a></span></dt><dt><span class="sect2"><a href="manual/debug.html#debug.compile_time_checks">Compile Time Checking</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="manual/support.html">II. Support</a></span></dt><dd><dl><dt><span class="preface"><a href="manual/bk01pt02pr01.html"></a></span></dt><dt><span class="chapter"><a href="manual/bk01pt02ch04.html">4. Types</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt02ch04.html#manual.support.types.fundamental">Fundamental Types</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt02ch04s02.html">Numeric Properties</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt02ch04s03.html">NULL</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt02ch05.html">5. Dynamic Memory</a></span></dt><dt><span class="chapter"><a href="manual/bk01pt02ch06.html">6. Termination</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt02ch06.html#support.termination.handlers">Termination Handlers</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt02ch06s02.html">Verbose Terminate Handler</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/diagnostics.html">III. Diagnostics</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/bk01pt03ch07.html">7. Exceptions</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt03ch07.html#manual.diagnostics.exceptions.hierarchy">Exception Classes</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt03ch07s02.html">Adding Data to Exceptions</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt03ch07s03.html">Cancellation</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt03ch08.html">8. Concept Checking</a></span></dt></dl></dd><dt><span class="part"><a href="manual/utilities.html">IV. Utilities</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/bk01pt04ch09.html">9. Functors</a></span></dt><dt><span class="chapter"><a href="manual/bk01pt04ch10.html">10. Pairs</a></span></dt><dt><span class="chapter"><a href="manual/bk01pt04ch11.html">11. Memory</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt04ch11.html#manual.util.memory.allocator">Allocators</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt04ch11.html#allocator.req">Requirements</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt04ch11.html#allocator.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt04ch11.html#allocator.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt04ch11.html#allocator.using">Using a Specific Allocator</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt04ch11.html#allocator.custom">Custom Allocators</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt04ch11.html#allocator.ext">Extension Allocators</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/auto_ptr.html">auto_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/auto_ptr.html#auto_ptr.limitations">Limitations</a></span></dt><dt><span class="sect2"><a href="manual/auto_ptr.html#auto_ptr.using">Use in Containers</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/shared_ptr.html">shared_ptr</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/shared_ptr.html#shared_ptr.req">Requirements</a></span></dt><dt><span class="sect2"><a href="manual/shared_ptr.html#shared_ptr.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="manual/shared_ptr.html#shared_ptr.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/shared_ptr.html#shared_ptr.using">Use</a></span></dt><dt><span class="sect2"><a href="manual/shared_ptr.html#shared_ptr.ack">Acknowledgments</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/bk01pt04ch12.html">12. Traits</a></span></dt></dl></dd><dt><span class="part"><a href="manual/strings.html">V. Strings</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/bk01pt05ch13.html">13. String Classes</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt05ch13.html#strings.string.simple">Simple Transformations</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt05ch13s02.html">Case Sensitivity</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt05ch13s03.html">Arbitrary Character Types</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt05ch13s04.html">Tokenizing</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt05ch13s05.html">Shrink to Fit</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt05ch13s06.html">CString (MFC)</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/localization.html">VI. Localization</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/bk01pt06ch14.html">14. Locales</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt06ch14.html#manual.localization.locales.locale">locale</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt06ch14.html#locales.locale.req">Requirements</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt06ch14.html#locales.locale.design">Design</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt06ch14.html#locales.locale.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt06ch14.html#locales.locale.future">Future</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/bk01pt06ch15.html">15. Facets aka Categories</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt06ch15.html#manual.localization.facet.ctype">ctype</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt06ch15.html#facet.ctype.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt06ch15.html#facet.ctype.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/codecvt.html">codecvt</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/codecvt.html#facet.codecvt.req">Requirements</a></span></dt><dt><span class="sect2"><a href="manual/codecvt.html#facet.codecvt.design">Design</a></span></dt><dt><span class="sect2"><a href="manual/codecvt.html#facet.codecvt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/codecvt.html#facet.codecvt.use">Use</a></span></dt><dt><span class="sect2"><a href="manual/codecvt.html#facet.codecvt.future">Future</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/messages.html">messages</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/messages.html#facet.messages.req">Requirements</a></span></dt><dt><span class="sect2"><a href="manual/messages.html#facet.messages.design">Design</a></span></dt><dt><span class="sect2"><a href="manual/messages.html#facet.messages.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/messages.html#facet.messages.use">Use</a></span></dt><dt><span class="sect2"><a href="manual/messages.html#facet.messages.future">Future</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="manual/containers.html">VII. Containers</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/bk01pt07ch16.html">16. Sequences</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt07ch16.html#containers.sequences.list">list</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt07ch16.html#sequences.list.size">list::size() is O(n)</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt07ch16s02.html">vector</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt07ch16s02.html#sequences.vector.management">Space Overhead Management</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/bk01pt07ch17.html">17. Associative</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt07ch17.html#containers.associative.insert_hints">Insertion Hints</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt07ch17s02.html">bitset</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt07ch17s02.html#associative.bitset.size_variable">Size Variable</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt07ch17s02.html#associative.bitset.type_string">Type String</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/bk01pt07ch18.html">18. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt07ch18.html#containers.c.vs_array">Containers vs. Arrays</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/iterators.html">VIII. Iterators</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/bk01pt08ch19.html">19. Predefined</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt08ch19.html#iterators.predefined.vs_pointers">Iterators vs. Pointers</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt08ch19s02.html">One Past the End</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/algorithms.html">IX. Algorithms</a></span></dt><dd><dl><dt><span class="preface"><a href="manual/bk01pt09pr02.html"></a></span></dt><dt><span class="chapter"><a href="manual/bk01pt09ch20.html">20. Mutating</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt09ch20.html#algorithms.mutating.swap"><code class="function">swap</code></a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt09ch20.html#algorithms.swap.specializations">Specializations</a></span></dt></dl></dd></dl></dd></dl></dd><dt><span class="part"><a href="manual/numerics.html">X. Numerics</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/bk01pt10ch21.html">21. Complex</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt10ch21.html#numerics.complex.processing">complex Processing</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt10ch22.html">22. Generalized Operations</a></span></dt><dt><span class="chapter"><a href="manual/bk01pt10ch23.html">23. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt10ch23.html#numerics.c.array">Numerics vs. Arrays</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt10ch23s02.html">C99</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/io.html">XI. Input and Output</a></span></dt><dd><dl><dt><span class="chapter"><a href="manual/bk01pt11ch24.html">24. Iostream Objects</a></span></dt><dt><span class="chapter"><a href="manual/bk01pt11ch25.html">25. Stream Buffers</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt11ch25.html#io.streambuf.derived">Derived streambuf Classes</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt11ch25s02.html">Buffering</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt11ch26.html">26. Memory Based Streams</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt11ch26.html#manual.io.memstreams.compat">Compatibility With strstream</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt11ch27.html">27. File Based Streams</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt11ch27.html#manual.io.filestreams.copying_a_file">Copying a File</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt11ch27s02.html">Binary Input and Output</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt11ch27s03.html">More Binary Input and Output</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt11ch28.html">28. Interacting with C</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt11ch28.html#manual.io.c.FILE">Using FILE* and file descriptors</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt11ch28s02.html">Performance</a></span></dt></dl></dd></dl></dd><dt><span class="part"><a href="manual/extensions.html">XII. Extensions</a></span></dt><dd><dl><dt><span class="preface"><a href="manual/bk01pt12pr03.html"></a></span></dt><dt><span class="chapter"><a href="manual/bk01pt12ch29.html">29. Compile Time Checks</a></span></dt><dt><span class="chapter"><a href="manual/debug_mode.html">30. Debug Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/debug_mode.html#manual.ext.debug_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch30s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch30s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch30s03.html#debug_mode.using.mode">Using the Debug Mode</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch30s03.html#debug_mode.using.specific">Using a Specific Debug Container</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch30s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch30s04.html#manual.ext.debug_mode.design.goals">Goals</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch30s04.html#manual.ext.debug_mode.design.methods">Methods</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch30s04.html#manual.ext.debug_mode.design.other">Other Implementations</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/parallel_mode.html">31. Parallel Mode</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/parallel_mode.html#manual.ext.parallel_mode.intro">Intro</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch31s02.html">Semantics</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch31s03.html">Using</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch31s03.html#parallel_mode.using.prereq_flags">Prerequisite Compiler Flags</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch31s03.html#parallel_mode.using.parallel_mode">Using Parallel Mode</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch31s03.html#parallel_mode.using.specific">Using Specific Parallel Components</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch31s04.html">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch31s04.html#manual.ext.parallel_mode.design.intro">Interface Basics</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch31s04.html#manual.ext.parallel_mode.design.tuning">Configuration and Tuning</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch31s04.html#manual.ext.parallel_mode.design.impl">Implementation Namespaces</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch31s05.html">Testing</a></span></dt><dt><span class="bibliography"><a href="manual/parallel_mode.html#parallel_mode.biblio">Bibliography</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt12ch32.html">32. Allocators</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt12ch32.html#manual.ext.allocator.mt">mt_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch32.html#allocator.mt.intro">Intro</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32.html#allocator.mt.design_issues">Design Issues</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32.html#allocator.mt.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32.html#allocator.mt.example_single">Single Thread Example</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch32.html#allocator.mt.example_multi">Multiple Thread Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bitmap_allocator.html">bitmap_allocator</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bitmap_allocator.html#allocator.bitmap.design">Design</a></span></dt><dt><span class="sect2"><a href="manual/bitmap_allocator.html#allocator.bitmap.impl">Implementation</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="manual/bk01pt12ch33.html">33. Containers</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt12ch33.html#manual.ext.containers.pbds">Policy Based Data Structures</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch33s02.html">HP/SGI</a></span></dt><dt><span class="sect1"><a href="manual/bk01pt12ch33s03.html">Deprecated HP/SGI</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt12ch34.html">34. Utilities</a></span></dt><dt><span class="chapter"><a href="manual/bk01pt12ch35.html">35. Algorithms</a></span></dt><dt><span class="chapter"><a href="manual/bk01pt12ch36.html">36. Numerics</a></span></dt><dt><span class="chapter"><a href="manual/bk01pt12ch37.html">37. Iterators</a></span></dt><dt><span class="chapter"><a href="manual/bk01pt12ch38.html">38. Input and Output</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/bk01pt12ch38.html#manual.ext.io.filebuf_derived">Derived filebufs</a></span></dt></dl></dd><dt><span class="chapter"><a href="manual/bk01pt12ch39.html">39. Demangling</a></span></dt><dt><span class="chapter"><a href="manual/concurrency.html">40. Concurrency</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/concurrency.html#manual.ext.concurrency.design">Design</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/concurrency.html#manual.ext.concurrency.design.threads">Interface to Locks and Mutexes</a></span></dt><dt><span class="sect2"><a href="manual/concurrency.html#manual.ext.concurrency.design.atomics">Interface to Atomic Functions</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch40s02.html">Implementation</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01pt12ch40s02.html#manual.ext.concurrency.impl.atomic_fallbacks">Using Builtin Atomic Functions</a></span></dt><dt><span class="sect2"><a href="manual/bk01pt12ch40s02.html#manual.ext.concurrency.impl.thread">Thread Abstraction</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01pt12ch40s03.html">Use</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="manual/appendix_contributing.html">A. Contributing</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/appendix_contributing.html#contrib.list">Contributor Checklist</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/appendix_contributing.html#list.reading">Reading</a></span></dt><dt><span class="sect2"><a href="manual/appendix_contributing.html#list.copyright">Assignment</a></span></dt><dt><span class="sect2"><a href="manual/appendix_contributing.html#list.getting">Getting Sources</a></span></dt><dt><span class="sect2"><a href="manual/appendix_contributing.html#list.patches">Submitting Patches</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01apas02.html">Directory Layout and Source Conventions</a></span></dt><dt><span class="sect1"><a href="manual/bk01apas03.html">Coding Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01apas03.html#coding_style.bad_identifiers">Bad Identifiers</a></span></dt><dt><span class="sect2"><a href="manual/bk01apas03.html#coding_style.example">By Example</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01apas04.html">Documentation Style</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/bk01apas04.html#doc_style.doxygen">Doxygen</a></span></dt><dt><span class="sect2"><a href="manual/bk01apas04.html#doc_style.docbook">Docbook</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/bk01apas05.html">Design Notes</a></span></dt></dl></dd><dt><span class="appendix"><a href="manual/appendix_porting.html">B. Porting and Maintenance</a></span></dt><dd><dl><dt><span class="sect1"><a href="manual/appendix_porting.html#appendix.porting.build_hacking">Configure and Build Hacking</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.prereq">Prerequisites</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.map">Overview: What Comes from Where</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.scripts">Storing Information in non-AC files (like configure.host)</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.conventions">Coding and Commenting Conventions</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.acinclude">The acinclude.m4 layout</a></span></dt><dt><span class="sect2"><a href="manual/appendix_porting.html#build_hacking.enable"><code class="constant">GLIBCXX_ENABLE</code>, the <code class="literal">--enable</code> maker</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/internals.html">Porting to New Hardware or Operating Systems</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/internals.html#internals.os">Operating System</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.cpu">CPU</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.char_types">Character Types</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.thread_safety">Thread Safety</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.numeric_limits">Numeric Limits</a></span></dt><dt><span class="sect2"><a href="manual/internals.html#internals.libtool">Libtool</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/abi.html">ABI Policy and Guidelines</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/abi.html#abi.cxx_interface">The C++ Interface</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.versioning">Versioning</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.changes_allowed">Allowed Changes</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.changes_no">Prohibited Changes</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.impl">Implementation</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.testing">Testing</a></span></dt><dt><span class="sect2"><a href="manual/abi.html#abi.issues">Outstanding Issues</a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/api.html">API Evolution and Deprecation History</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/api.html#api.rel_300"><code class="constant">3.0</code></a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_310"><code class="constant">3.1</code></a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_320"><code class="constant">3.2</code></a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_330"><code class="constant">3.3</code></a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_340"><code class="constant">3.4</code></a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_400"><code class="constant">4.0</code></a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_410"><code class="constant">4.1</code></a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_420"><code class="constant">4.2</code></a></span></dt><dt><span class="sect2"><a href="manual/api.html#api.rel_430"><code class="constant">4.3</code></a></span></dt></dl></dd><dt><span class="sect1"><a href="manual/backwards.html">Backwards Compatibility</a></span></dt><dd><dl><dt><span class="sect2"><a href="manual/backwards.html#backwards.first">First</a></span></dt><dt><span class="sect2"><a href="manual/backwards.html#backwards.second">Second</a></span></dt><dt><span class="sect2"><a href="manual/backwards.html#backwards.third">Third</a></span></dt></dl></dd></dl></dd><dt><span class="appendix"><a href="manual/appendix_free.html">C. Free Software Needs Free Documentation</a></span></dt><dt><span class="appendix"><a href="manual/bk01apd.html">D. GNU General Public License</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01apd.html#gpl-1">Preamble</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html">TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION</a></span></dt><dd><dl><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-0">Section 0</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-1">Section 1</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-2">Section 2</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-3">Section 3</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-4">Section 4</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-5">Section 5</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-6">Section 6</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-7">Section 7</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-8">Section 8</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-9">Section 9</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-10">Section 10</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-11">NO WARRANTY Section 11</a></span></dt><dt><span class="section"><a href="manual/bk01apds02.html#gpl-2-12">Section 12</a></span></dt></dl></dd><dt><span class="section"><a href="manual/bk01apds03.html">How to Apply These Terms to Your New Programs</a></span></dt></dl></dd><dt><span class="appendix"><a href="manual/bk01ape.html">E. GNU Free Documentation License</a></span></dt></dl></dd><dt><span class="book"><a href="bk02.html"></a></span></dt><dd><dl><dt><span class="article"><a href="api.html">API and Source Level Documentation</a></span></dt></dl></dd><dt><span class="book"><a href="bk03.html"></a></span></dt><dd><dl><dt><span class="article"><a href="faq.html">Frequently Asked Questions</a></span></dt></dl></dd></dl></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="manual/spine.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> The GNU C++ Library</td></tr></table></div></body></html>
diff --git a/libstdc++-v3/doc/xml/manual/build.xml b/libstdc++-v3/doc/xml/manual/build.xml
deleted file mode 100644
index d5d78291f43..00000000000
--- a/libstdc++-v3/doc/xml/manual/build.xml
+++ /dev/null
@@ -1,182 +0,0 @@
-<sect1 id="manual.intro.setup.build" xreflabel="Building">
-<?dbhtml filename="build.html"?>
-
-<sect1info>
- <keywordset>
- <keyword>
- ISO C++
- </keyword>
- <keyword>
- build
- </keyword>
- </keywordset>
-</sect1info>
-
-<title>Build</title>
-
-<para>
- Because libstdc++ is part of GCC, the primary source for
- installation instructions is
- <ulink url="http://gcc.gnu.org/install/">the GCC install page</ulink>.
- Additional data is given here only where it applies to libstdc++.
-</para>
-
-<sect2 id="build.prereq" xreflabel="build.prereq">
-<title>Prerequisites</title>
- <para>
- The list of software needed to build the library is kept with the
- rest of the compiler, at
- <ulink url="http://gcc.gnu.org/install/prerequisites.html">
- http://gcc.gnu.org/install/prerequisites.html</ulink>. The same page
- also lists the tools you will need if you wish to modify the source.
- </para>
-
- <para>As of GCC 4.0.1 the minimum version of binutils required to build
- libstdc++ is <code>2.15.90.0.1.1</code>. You can get snapshots
- (as well as releases) of binutils from
- <ulink url="ftp://sources.redhat.com/pub/binutils">
- ftp://sources.redhat.com/pub/binutils</ulink>.
- Older releases of libstdc++ do not require such a recent version,
- but to take full advantage of useful space-saving features and
- bug-fixes you should use a recent binutils if possible.
- The configure process will automatically detect and use these
- features if the underlying support is present.
- </para>
-
- <para>
- Finally, a few system-specific requirements:
- </para>
-
- <variablelist>
- <varlistentry>
- <term>linux</term>
-
- <listitem>
- <para>
- If gcc 3.1.0 or later on is being used on linux, an attempt
- will be made to use "C" library functionality necessary for
- C++ named locale support. For gcc 3.2.1 and later, this
- means that glibc 2.2.5 or later is required and the "C"
- library de_DE locale information must be installed.
- </para>
-
- <para>
- Note however that the sanity checks involving the de_DE
- locale are skipped when an explicit --enable-clocale=gnu
- configure option is used: only the basic checks are carried
- out, defending against misconfigurations.
- </para>
-
- <para>
- If the 'gnu' locale model is being used, the following
- locales are used and tested in the libstdc++ testsuites.
- The first column is the name of the locale, the second is
- the character set it is expected to use.
- </para>
-<programlisting>
-de_DE ISO-8859-1
-de_DE@euro ISO-8859-15
-en_HK ISO-8859-1
-en_PH ISO-8859-1
-en_US ISO-8859-1
-en_US.ISO-8859-1 ISO-8859-1
-en_US.ISO-8859-15 ISO-8859-15
-en_US.UTF-8 UTF-8
-es_ES ISO-8859-1
-es_MX ISO-8859-1
-fr_FR ISO-8859-1
-fr_FR@euro ISO-8859-15
-is_IS UTF-8
-it_IT ISO-8859-1
-ja_JP.eucjp EUC-JP
-se_NO.UTF-8 UTF-8
-ta_IN UTF-8
-zh_TW BIG5
-</programlisting>
- <para>Failure to have the underlying "C" library locale
- information installed will mean that C++ named locales for the
- above regions will not work: because of this, the libstdc++
- testsuite will skip the named locale tests. If this isn't an
- issue, don't worry about it. If named locales are needed, the
- underlying locale information must be installed. Note that
- rebuilding libstdc++ after the "C" locales are installed is not
- necessary.
- </para>
-
- <para>
- To install support for locales, do only one of the following:
- </para>
-
- <itemizedlist>
- <listitem>
- <para>install all locales</para>
- <itemizedlist>
- <listitem>
- <para>with RedHat Linux:
- </para>
- <para> <code> export LC_ALL=C </code>
- </para>
- <para> <code> rpm -e glibc-common --nodeps </code>
- </para>
- <para>
- <code> rpm -i --define "_install_langs all"
- glibc-common-2.2.5-34.i386.rpm
- </code>
- </para>
- </listitem>
- <listitem>
- <para>
- Instructions for other operating systems solicited.
- </para>
- </listitem>
- </itemizedlist>
- </listitem>
- <listitem>
- <para>install just the necessary locales</para>
- <itemizedlist>
- <listitem>
- <para>with Debian Linux:</para>
- <para> Add the above list, as shown, to the file
- <code>/etc/locale.gen</code> </para>
- <para> run <code>/usr/sbin/locale-gen</code> </para>
- </listitem>
- <listitem>
- <para>on most Unix-like operating systems:</para>
- <para><code> localedef -i de_DE -f ISO-8859-1 de_DE </code></para>
- <para>(repeat for each entry in the above list) </para>
- </listitem>
- <listitem>
- <para>
- Instructions for other operating systems solicited.
- </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- </variablelist>
-
-</sect2>
-
-<sect2 id="build.configure" xreflabel="build.make">
-<title>Make</title>
- <para>If you have never done this before, you should read the basic
- <ulink url="http://gcc.gnu.org/install/">GCC Installation
- Instructions</ulink> first. Read <emphasis>all of them</emphasis>.
- <emphasis>Twice.</emphasis>
- </para>
- <para>When building libstdc++ you'll have to configure
- the entire <emphasis>gccsrcdir</emphasis> directory. The full list of libstdc++
- specific configuration options, not dependent on the specific compiler
- release being used, can be found <ulink url="configopts.html">here</ulink>.
- </para>
- <para>Consider possibly using --enable-languages=c++ to save time by only
- building the C++ language parts.
- </para>
-
- <programlisting>
- cd <emphasis>gccbuilddir</emphasis>
- <emphasis>gccsrcdir</emphasis>/configure --prefix=<emphasis>destdir</emphasis> --other-opts...</programlisting>
-</sect2>
-</sect1> \ No newline at end of file
diff --git a/libstdc++-v3/doc/xml/manual/configure.xml b/libstdc++-v3/doc/xml/manual/configure.xml
index a47635cd029..9ddd31cf89e 100644
--- a/libstdc++-v3/doc/xml/manual/configure.xml
+++ b/libstdc++-v3/doc/xml/manual/configure.xml
@@ -18,18 +18,26 @@
<title>Configure</title>
<para>
- Here are some of the non-obvious options to libstdc++'s configure.
- Keep in mind that
+ When configuring libstdc++, you'll have to configure the entire
+ <emphasis>gccsrcdir</emphasis> directory. Consider using the
+ toplevel gcc configuration option
+ <literal>--enable-languages=c++</literal>, which saves time by only
+ building the C++ toolchain.
+</para>
+
+<para>
+ Here are all of the configure options specific to libstdc++. Keep
+ in mind that
<!-- This SECnn should be the "Choosing Package Options" section. -->
<ulink url="http://www.gnu.org/software/autoconf/manual/autoconf-2.57/html_node/autoconf_131.html#SEC131">they
- all have opposite forms as well</ulink>
- (enable/disable and with/without). The defaults are for <emphasis>current
- development sources</emphasis>, which may be different than those for
- released versions.
+ all have opposite forms as well</ulink> (enable/disable and
+ with/without). The defaults are for the <emphasis>current
+ development sources</emphasis>, which may be different than those
+ for released versions.
</para>
<para>The canonical way to find out the configure options that are
available for a given set of libstdc++ sources is to go to the
- source directory and then type:<code> ./configure --help</code>
+ source directory and then type:<command>./configure --help</command>.
</para>
<variablelist>
@@ -121,10 +129,10 @@
<varlistentry><term><code>--enable-libstdcxx-allocator=OPTION </code></term>
<listitem><para>Select a target-specific underlying std::allocator. The
choices are 'new' to specify a wrapper for new, 'malloc' to
- specify a wrapper for malloc, 'mt' for a fixed power of two allocator
- (<ulink url="ext/mt_allocator.html">documented</ulink> under extensions),
+ specify a wrapper for malloc, 'mt' for a fixed power of two allocator,
'pool' for the SGI pooled allocator or 'bitmap' for a bitmap allocator.
- This option can change the library ABI.
+ This option can change the library ABI. See this page for more information on allocator
+ <link linkend="allocator.ext">extensions</link>
</para>
</listitem></varlistentry>
@@ -153,7 +161,7 @@
<varlistentry><term><code>--enable-libstdcxx-debug</code></term>
<listitem><para>Build separate debug libraries in addition to what is normally built.
By default, the debug libraries are compiled with
- <code> CXXFLAGS='-g3 -O0'</code>
+ <code> CXXFLAGS='-g3 -O0 -fno-inline'</code>
, are installed in <code>${libdir}/debug</code>, and have the
same names and versioning information as the non-debug
libraries. This option is off by default.
@@ -161,7 +169,7 @@
<para>Note this make command, executed in
the build directory, will do much the same thing, without the
configuration difference and without building everything twice:
- <code>make CXXFLAGS='-g3 -O0' all</code>
+ <code>make CXXFLAGS='-g3 -O0 -fno-inline' all</code>
</para>
</listitem></varlistentry>
@@ -174,7 +182,7 @@
FLAGS is a quoted string of options, like
</para>
<programlisting>
- --enable-libstdcxx-debug-flags='-g3 -O1 -gdwarf-2'</programlisting>
+ --enable-libstdcxx-debug-flags='-g3 -O1 -fno-inline'</programlisting>
</listitem></varlistentry>
<varlistentry><term><code>--enable-cxx-flags=FLAGS</code></term>
@@ -258,7 +266,7 @@
<varlistentry><term><code>--enable-concept-checks</code></term>
<listitem><para>This turns on additional compile-time checks for instantiated
library templates, in the form of specialized templates,
- <ulink url="19_diagnostics/howto.html#3">described here</ulink>. They
+ <link linkend="manual.diagnostics.concept_checking">described here</link>. They
can help users discover when they break the rules of the STL, before
their programs run.
</para>
@@ -312,7 +320,27 @@
environment.
</para>
</listitem></varlistentry>
-</variablelist>
+ <varlistentry><term><code>--enable-clock-gettime</code></term>
+ <listitem><para>This is an abbreviated form of
+ <code>'--enable-clock-gettime=yes'</code>(described next).
+ </para>
+ </listitem></varlistentry>
+
+ <varlistentry><term><code>--enable-clock-gettime=OPTION</code></term>
+ <listitem><para>Enables link-type checks for the availability of the
+ clock_gettime clocks, used in [time.clock] of the current C++0x draft.
+ The choice OPTION=yes checks for the availability of the monotonic and
+ realtime clocks in libc and libposix4. In case of need the latter is
+ also linked to libstdc++ as part of the build process. OPTION=rt
+ also searches (and, in case, links) librt. Note that the latter
+ is not always desirable because, in glibc, for example, in turn it
+ triggers the linking of libpthread too, which activates locking,
+ a large overhead for single-thread programs. OPTION=no skips the
+ tests completely. The default is OPTION=no.
+ </para>
+ </listitem></varlistentry>
+
+</variablelist>
-</sect1> \ No newline at end of file
+</sect1>
diff --git a/libstdc++-v3/doc/xml/manual/debug.xml b/libstdc++-v3/doc/xml/manual/debug.xml
index b52a2469161..2ad542b97b1 100644
--- a/libstdc++-v3/doc/xml/manual/debug.xml
+++ b/libstdc++-v3/doc/xml/manual/debug.xml
@@ -31,21 +31,22 @@
The default optimizations and debug flags for a libstdc++ build
are <code>-g -O2</code>. However, both debug and optimization
flags can be varied to change debugging characteristics. For
- instance, turning off all optimization via the <code>-g -O0</code>
- flag will disable inlining, so that stepping through all
- functions, including inlined constructors and destructors, is
- possible. In addition,
- <code>-fno-eliminate-unused-debug-types</code> can be used when
- additional debug information, such as nested class info, is
- desired.
+ instance, turning off all optimization via the <code>-g -O0
+ -fno-inline</code> flags will disable inlining and optimizations,
+ and add debugging information, so that stepping through all functions,
+ (including inlined constructors and destructors) is possible. In
+ addition, <code>-fno-eliminate-unused-debug-types</code> can be
+ used when additional debug information, such as nested class info,
+ is desired.
</para>
<para>
Or, the debug format that the compiler and debugger use to
communicate information about source constructs can be changed via
- <code> -gdwarf-2 </code> or <code> -gstabs </code> flags: some
- debugging formats permit more expressive type and scope information
- to be shown in gdb. The default debug information for a particular
+ <code>-gdwarf-2</code> or <code>-gstabs</code> flags: some debugging
+ formats permit more expressive type and scope information to be
+ shown in gdb. Expressiveness can be enhanced by flags like
+ <code>-g3</code>. The default debug information for a particular
platform can be identified via the value set by the
PREFERRED_DEBUGGING_TYPE macro in the gcc sources.
</para>
@@ -78,21 +79,21 @@
debug build will persist, without having to specify
<code>CXXFLAGS</code>, and the debug library will be installed in a
separate directory tree, in <code>(prefix)/lib/debug</code>. For
- more information, look at the <ulink
- url="configopts.html">configuration options</ulink> document.
+ more information, look at the <link
+ linkend="manual.intro.setup.configure">configuration</link> section.
</para>
<para>
A second approach is to use the configuration flags
</para>
<programlisting>
- make CXXFLAGS='-g3 -O0' all
+ make CXXFLAGS='-g3 -fno-inline -O0' all
</programlisting>
<para>
This quick and dirty approach is often sufficient for quick
debugging tasks, when you cannot or don't want to recompile your
- application to use the <ulink url="#safe">debug mode</ulink>.</para>
+ application to use the <link linkend="manual.ext.debug_mode">debug mode</link>.</para>
</sect2>
<sect2 id="debug.memory" xreflabel="debug.memory">
@@ -115,8 +116,8 @@
thing of great importance to keep in mind when debugging C++ code
that uses <code>new</code> and <code>delete</code>: there are
different kinds of allocation schemes that can be used by <code>
- std::allocator </code>. For implementation details, see the <ulink
- url="ext/mt_allocator.html">mt allocator</ulink> documentation and
+ std::allocator </code>. For implementation details, see the <link
+ linkend="manual.ext.allocator.mt">mt allocator</link> documentation and
look specifically for <code>GLIBCXX_FORCE_NEW</code>.
</para>
@@ -197,7 +198,7 @@
<para>
Many options are available for gdb itself: please see <ulink
- url="http://sources.redhat.com/gdb/current/onlinedocs/gdb_13.html#SEC109">
+ url="http://sources.redhat.com/gdb/current/onlinedocs/gdb_13.html#SEC125">
"GDB features for C++" </ulink> in the gdb documentation. Also
recommended: the other parts of this manual.
</para>
diff --git a/libstdc++-v3/doc/xml/manual/intro.xml b/libstdc++-v3/doc/xml/manual/intro.xml
index 1176fd65096..8cca6f39842 100644
--- a/libstdc++-v3/doc/xml/manual/intro.xml
+++ b/libstdc++-v3/doc/xml/manual/intro.xml
@@ -707,17 +707,56 @@
<chapter id="manual.intro.setup" xreflabel="Setup">
<title>Setup</title>
- <!-- Section 01 : Configure -->
+ <para>To transform libstdc++ sources into installed include files
+ and properly built binaries useful for linking to other software is
+ a multi-step process. Steps include getting the sources,
+ configuring and building the sources, testing, and installation.
+ </para>
+
+ <para>The general outline of commands is something like:
+ </para>
+
+ <programlisting>
+ <emphasis>get gcc sources</emphasis>
+ <emphasis>extract into gccsrcdir</emphasis>
+ mkdir <emphasis>gccbuilddir</emphasis>
+ cd <emphasis>gccbuilddir</emphasis>
+ <emphasis>gccsrcdir</emphasis>/configure --prefix=<emphasis>destdir</emphasis> --other-opts...
+ make
+ make check
+ make install
+ </programlisting>
+
+ <para>
+ Each step is described in more detail in the following sections.
+ </para>
+
+ <!-- Section 01 : Prerequisites -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="configure.xml">
+ parse="xml" href="prerequisites.xml">
</xi:include>
- <!-- Section 02 : Build -->
+ <!-- Section 02 : Configure -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
- parse="xml" href="build.xml">
+ parse="xml" href="configure.xml">
</xi:include>
- <!-- Section 03 : Test -->
+ <!-- Section 03 : Make -->
+<sect1 id="manual.intro.setup.make" xreflabel="Make">
+<title>Make</title>
+ <para>If you have never done this before, you should read the basic
+ <ulink url="http://gcc.gnu.org/install/">GCC Installation
+ Instructions</ulink> first. Read <emphasis>all of them</emphasis>.
+ <emphasis>Twice.</emphasis>
+ </para>
+
+<para>Then type:<command>make</command>, and congratulations, you're
+started to build.
+</para>
+
+</sect1>
+
+ <!-- Section 04 : Test -->
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
parse="xml" href="test.xml">
</xi:include>
diff --git a/libstdc++-v3/doc/xml/manual/test.xml b/libstdc++-v3/doc/xml/manual/test.xml
index 58eaf980200..7072c81e609 100644
--- a/libstdc++-v3/doc/xml/manual/test.xml
+++ b/libstdc++-v3/doc/xml/manual/test.xml
@@ -12,13 +12,34 @@
<keyword>
testsuite
</keyword>
+ <keyword>
+ performance
+ </keyword>
+ <keyword>
+ conformance
+ </keyword>
+ <keyword>
+ ABI
+ </keyword>
+ <keyword>
+ exception safety
+ </keyword>
</keywordset>
</sect1info>
<title>Test</title>
+<para>
+The libstdc++ testsuite includes testing for standard conformance,
+regressions, ABI, and performance.
+</para>
+
<sect2 id="test.organization" xreflabel="test.organization">
<title>Organization</title>
+
+<sect3 id="test.organization.layout" xreflabel="Directory Layout">
+<title>Directory Layout</title>
+
<para>
The directory <emphasis>libsrcdir/testsuite</emphasis> contains the
individual test cases organized in sub-directories corresponding to
@@ -108,10 +129,10 @@ util Files for libtestc++, utilities and testing routines.
All new tests should be written with the policy of one test
case, one file in mind.
</para>
+</sect3>
-</sect2>
-<sect2 id="test.naming" xreflabel="test.naming">
+<sect3 id="test.organization.naming" xreflabel="Naming Conventions">
<title>Naming Conventions</title>
<para>
@@ -202,139 +223,15 @@ cat 27_io/objects/char/3_xin.in | a.out
</listitem>
</itemizedlist>
+</sect3>
</sect2>
-<sect2 id="test.utils" xreflabel="test.utils">
-<title>Utilities</title>
- <para>
- </para>
- <para>
- The testsuite directory also contains some files that implement
- functionality that is intended to make writing test cases easier,
- or to avoid duplication, or to provide error checking in a way that
- is consistent across platforms and test harnesses. A stand-alone
- executable, called <emphasis>abi_check</emphasis>, and a static
- library called <emphasis>libtestc++</emphasis> are
- constructed. Both of these items are not installed, and only used
- during testing.
- </para>
-
- <para>
- These files include the following functionality:
- </para>
-
- <itemizedlist>
- <listitem>
- <para>
- <emphasis>testsuite_abi.h</emphasis>,
- <emphasis>testsuite_abi.cc</emphasis>,
- <emphasis>testsuite_abi_check.cc</emphasis>
- </para>
- <para>
- Creates the executable <emphasis>abi_check</emphasis>.
- Used to check correctness of symbol versioning, visibility of
- exported symbols, and compatibility on symbols in the shared
- library, for hosts that support this feature. More information
- can be found in the ABI documentation <ulink url="abi.html">here</ulink>
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>testsuite_allocator.h</emphasis>,
- <emphasis>testsuite_allocator.cc</emphasis>
- </para>
- <para>
- Contains specialized allocators that keep track of construction
- and destruction. Also, support for overriding global new and
- delete operators, including verification that new and delete
- are called during execution, and that allocation over max_size
- fails.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>testsuite_character.h</emphasis>
- </para>
- <para>
- Contains <code>std::char_traits</code> and
- <code>std::codecvt</code> specializations for a user-defined
- POD.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>testsuite_hooks.h</emphasis>,
- <emphasis>testsuite_hooks.cc</emphasis>
- </para>
- <para>
- A large number of utilities, including:
- </para>
- <itemizedlist>
- <listitem><para>VERIFY</para></listitem>
- <listitem><para>set_memory_limits</para></listitem>
- <listitem><para>verify_demangle</para></listitem>
- <listitem><para>run_tests_wrapped_locale</para></listitem>
- <listitem><para>run_tests_wrapped_env</para></listitem>
- <listitem><para>try_named_locale</para></listitem>
- <listitem><para>try_mkfifo</para></listitem>
- <listitem><para>func_callback</para></listitem>
- <listitem><para>counter</para></listitem>
- <listitem><para>copy_tracker</para></listitem>
- <listitem><para>copy_constructor</para></listitem>
- <listitem><para>assignment_operator</para></listitem>
- <listitem><para>destructor</para></listitem>
- <listitem>
- <para>pod_char, pod_int and associated char_traits specializations</para>
- </listitem>
- </itemizedlist>
- </listitem>
- <listitem>
- <para>
- <emphasis>testsuite_io.h</emphasis>
- </para>
- <para>
- Error, exception, and constraint checking for
- <code>std::streambuf, std::basic_stringbuf, std::basic_filebuf</code>.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>testsuite_iterators.h</emphasis>
- </para>
- <para>
- Wrappers for various iterators.
- </para>
- </listitem>
- <listitem>
- <para>
- <emphasis>testsuite_performance.h</emphasis>
- </para>
- <para>
- A number of class abstractions for performance counters, and
- reporting functions including:
- </para>
- <itemizedlist>
- <listitem><para>time_counter</para></listitem>
- <listitem><para>resource_counter</para></listitem>
- <listitem><para>report_performance</para></listitem>
- </itemizedlist>
- </listitem>
- </itemizedlist>
-
-</sect2>
<sect2 id="test.run" xreflabel="test.run">
<title>Running the Testsuite</title>
<sect3 id="test.run.basic" xreflabel="test.run.basic">
- <title>Basic Results</title>
- <para>
- There are several options for running tests, including testing
- the regression tests, testing a subset of the regression tests,
- testing the performance tests, testing just compilation, testing
- installed tools, etc. In addition, there is a special rule for
- checking the exported symbols of the shared library.
- </para>
+ <title>Basic</title>
<para>
You can check the status of the build without installing it
@@ -361,7 +258,7 @@ cat 27_io/objects/char/3_xin.in | a.out
<para>
Archives of test results for various versions and platforms are
available on the GCC website in the <ulink
- url="http://gcc.gnu.org/gcc-4.1/buildstat.html">build
+ url="http://gcc.gnu.org/gcc-4.3/buildstat.html">build
status</ulink> section of each individual release, and are also
archived on a daily basis on the <ulink
url="http://gcc.gnu.org/ml/gcc-testresults/current">gcc-testresults</ulink>
@@ -370,8 +267,15 @@ cat 27_io/objects/char/3_xin.in | a.out
</para>
</sect3>
- <sect3 id="test.run.options" xreflabel="test.run.options">
- <title>Options</title>
+ <sect3 id="test.run.variations" xreflabel="test.run.variations">
+ <title>Variations</title>
+ <para>
+ There are several options for running tests, including testing
+ the regression tests, testing a subset of the regression tests,
+ testing the performance tests, testing just compilation, testing
+ installed tools, etc. In addition, there is a special rule for
+ checking the exported symbols of the shared library.
+ </para>
<para>
To debug the dejagnu test harness during runs, try invoking with a
specific argument to the variable RUNTESTFLAGS, as below.
@@ -567,7 +471,7 @@ runtest --tool libstdc++ --srcdir=/path/to/gcc/libstdc++-v3/testsuite
</sect3>
<sect3 id="test.run.permutations" xreflabel="test.run.permutations">
- <title>Test Permutations</title>
+ <title>Permutations</title>
<para>
To run the libstdc++ test suite under the <link
linkend="manual.ext.debug_mode">debug mode</link>, edit
@@ -583,14 +487,22 @@ runtest --tool libstdc++ --srcdir=/path/to/gcc/libstdc++-v3/testsuite
</para>
<para>
+ The <link linkend="manual.ext.parallel_mode">parallel
+ mode</link> can be tested in much the same manner, substituting
+ <constant>-D_GLIBCXX_PARALLEL</constant> for
+ <constant>-D_GLIBCXX_DEBUG</constant> in the previous paragraph.
+ </para>
+
+ <para>
Or, just run the testsuites with <constant>CXXFLAGS</constant>
- set to <constant>-D_GLIBCXX_DEBUG</constant>.
+ set to <constant>-D_GLIBCXX_DEBUG</constant> or
+ <constant>-D_GLIBCXX_PARALLEL</constant>.
</para>
</sect3>
</sect2>
<sect2 id="test.new_tests" xreflabel="test.new_tests">
-<title>New Test Cases</title>
+<title>Writing a new test case</title>
<para>
The first step in making a new test case is to choose the correct
@@ -718,14 +630,18 @@ up in the normal.exp file.
<para>
More examples can be found in the libstdc++-v3/testsuite/*/*.cc files.
</para>
+</sect2>
-</sect2>
+<sect2 id="test.harness" xreflabel="Test Harness and Utilities">
+<title>Test Harness and Utilities</title>
-<sect2 id="test.dejagnu" xreflabel="test.dejagnu">
-<title>Test Harness Details</title>
+<sect3 id="test.harness.dejagnu" xreflabel="test.harness.dejagnu">
+<title>Dejagnu Harness Details</title>
<para>
- Underlying details of testing are abstracted via the GNU Dejagnu package.
+ Underlying details of testing for conformance and regressions are
+ abstracted via the GNU Dejagnu package. This is similar to the
+ rest of GCC.
</para>
@@ -764,58 +680,125 @@ board" information unique to this library. This is currently unused and sets
only default variables.
</para>
-</sect2>
+</sect3>
-<sect2 id="test.future" xreflabel="test.future">
-<title>Future</title>
+<sect3 id="test.harness.utils" xreflabel="test.utils">
+<title>Utilities</title>
<para>
</para>
+ <para>
+ The testsuite directory also contains some files that implement
+ functionality that is intended to make writing test cases easier,
+ or to avoid duplication, or to provide error checking in a way that
+ is consistent across platforms and test harnesses. A stand-alone
+ executable, called <emphasis>abi_check</emphasis>, and a static
+ library called <emphasis>libtestc++</emphasis> are
+ constructed. Both of these items are not installed, and only used
+ during testing.
+ </para>
+ <para>
+ These files include the following functionality:
+ </para>
-<para>
-Shared runs need to be implemented, for targets that support shared libraries.
-</para>
-
-<para>
-Diffing of expected output to standard streams needs to be finished off.
-</para>
-
-<para>
-The V3 testing framework supports, or will eventually support,
-additional keywords for the purpose of easing the job of writing
-test cases. All V3-keywords are of the form <code>@xxx@</code>.
-Currently plans for supported keywords include:
-</para>
-
-<variablelist>
-<varlistentry><term> <code> @require@ &lt;files&gt; </code> </term>
-<listitem>
- <para>
- The existence of &lt;files&gt; is essential for the test to complete
- successfully. For example, a test case foo.C using bar.baz as
- input file could say
- </para>
- <programlisting>
- // @require@ bar.baz</programlisting>
- <para>
- The special variable % stands for the rootname, e.g. the
- file-name without its `.C' extension. Example of use (taken
- verbatim from 27_io/filebuf.cc)
- </para>
- <programlisting>
- // @require@ %-*.tst %-*.txt</programlisting>
-</listitem></varlistentry>
-<varlistentry><term> <code> @diff@ &lt;first-list&gt; &lt;second-list&gt; </code> </term>
-<listitem>
- <para>
- After the test case compiles and ran successfully, diff
- &lt;first-list&gt; against &lt;second-list&gt;, these lists should
- have the same length. The test fails if diff returns non-zero a
- pair of files.
- </para>
-</listitem></varlistentry>
-</variablelist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>testsuite_abi.h</emphasis>,
+ <emphasis>testsuite_abi.cc</emphasis>,
+ <emphasis>testsuite_abi_check.cc</emphasis>
+ </para>
+ <para>
+ Creates the executable <emphasis>abi_check</emphasis>.
+ Used to check correctness of symbol versioning, visibility of
+ exported symbols, and compatibility on symbols in the shared
+ library, for hosts that support this feature. More information
+ can be found in the ABI documentation <ulink url="abi.html">here</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>testsuite_allocator.h</emphasis>,
+ <emphasis>testsuite_allocator.cc</emphasis>
+ </para>
+ <para>
+ Contains specialized allocators that keep track of construction
+ and destruction. Also, support for overriding global new and
+ delete operators, including verification that new and delete
+ are called during execution, and that allocation over max_size
+ fails.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>testsuite_character.h</emphasis>
+ </para>
+ <para>
+ Contains <code>std::char_traits</code> and
+ <code>std::codecvt</code> specializations for a user-defined
+ POD.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>testsuite_hooks.h</emphasis>,
+ <emphasis>testsuite_hooks.cc</emphasis>
+ </para>
+ <para>
+ A large number of utilities, including:
+ </para>
+ <itemizedlist>
+ <listitem><para>VERIFY</para></listitem>
+ <listitem><para>set_memory_limits</para></listitem>
+ <listitem><para>verify_demangle</para></listitem>
+ <listitem><para>run_tests_wrapped_locale</para></listitem>
+ <listitem><para>run_tests_wrapped_env</para></listitem>
+ <listitem><para>try_named_locale</para></listitem>
+ <listitem><para>try_mkfifo</para></listitem>
+ <listitem><para>func_callback</para></listitem>
+ <listitem><para>counter</para></listitem>
+ <listitem><para>copy_tracker</para></listitem>
+ <listitem><para>copy_constructor</para></listitem>
+ <listitem><para>assignment_operator</para></listitem>
+ <listitem><para>destructor</para></listitem>
+ <listitem>
+ <para>pod_char, pod_int and associated char_traits specializations</para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>testsuite_io.h</emphasis>
+ </para>
+ <para>
+ Error, exception, and constraint checking for
+ <code>std::streambuf, std::basic_stringbuf, std::basic_filebuf</code>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>testsuite_iterators.h</emphasis>
+ </para>
+ <para>
+ Wrappers for various iterators.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>testsuite_performance.h</emphasis>
+ </para>
+ <para>
+ A number of class abstractions for performance counters, and
+ reporting functions including:
+ </para>
+ <itemizedlist>
+ <listitem><para>time_counter</para></listitem>
+ <listitem><para>resource_counter</para></listitem>
+ <listitem><para>report_performance</para></listitem>
+ </itemizedlist>
+ </listitem>
+ </itemizedlist>
+</sect3>
</sect2>
-
</sect1>
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_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h
index ad0ed87a115..4409d9c3665 100644
--- a/libstdc++-v3/include/bits/stl_bvector.h
+++ b/libstdc++-v3/include/bits/stl_bvector.h
@@ -1,6 +1,6 @@
// vector<bool> specialization -*- 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
@@ -534,7 +534,7 @@ template<typename _Alloc>
vector(initializer_list<bool> __l,
const allocator_type& __a = allocator_type())
- : _Base(__a)
+ : _Base(__a)
{
_M_initialize_range(__l.begin(), __l.end(),
random_access_iterator_tag());
diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h
index b38fa55cf79..91c339c1746 100644
--- a/libstdc++-v3/include/bits/stl_list.h
+++ b/libstdc++-v3/include/bits/stl_list.h
@@ -553,7 +553,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
*/
list(initializer_list<value_type> __l,
const allocator_type& __a = allocator_type())
- : _Base(__a)
+ : _Base(__a)
{ _M_initialize_dispatch(__l.begin(), __l.end(), __false_type()); }
#endif
diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h
index b402b8292c5..3fe69c925d4 100644
--- a/libstdc++-v3/include/bits/stl_map.h
+++ b/libstdc++-v3/include/bits/stl_map.h
@@ -201,7 +201,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
map(initializer_list<value_type> __l,
const _Compare& __c = _Compare(),
const allocator_type& __a = allocator_type())
- : _M_t(__c, __a)
+ : _M_t(__c, __a)
{ _M_t._M_insert_unique(__l.begin(), __l.end()); }
#endif
diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h
index 0834c95cfd6..64a23b94920 100644
--- a/libstdc++-v3/include/bits/stl_multimap.h
+++ b/libstdc++-v3/include/bits/stl_multimap.h
@@ -198,7 +198,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
multimap(initializer_list<value_type> __l,
const _Compare& __comp = _Compare(),
const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a)
+ : _M_t(__comp, __a)
{ _M_t._M_insert_equal(__l.begin(), __l.end()); }
#endif
diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h
index 2fea83f847c..18757551e5d 100644
--- a/libstdc++-v3/include/bits/stl_multiset.h
+++ b/libstdc++-v3/include/bits/stl_multiset.h
@@ -211,7 +211,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
multiset(initializer_list<value_type> __l,
const _Compare& __comp = _Compare(),
const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a)
+ : _M_t(__comp, __a)
{ _M_t._M_insert_equal(__l.begin(), __l.end()); }
#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/stl_set.h b/libstdc++-v3/include/bits/stl_set.h
index 98c74e9a27c..65dc13569da 100644
--- a/libstdc++-v3/include/bits/stl_set.h
+++ b/libstdc++-v3/include/bits/stl_set.h
@@ -215,10 +215,10 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
* This is linear in N if the list is already sorted, and NlogN
* otherwise (where N is @a l.size()).
*/
- set(initializer_list<value_type> __l,
- const _Compare& __comp = _Compare(),
- const allocator_type& __a = allocator_type())
- : _M_t(__comp, __a)
+ set(initializer_list<value_type> __l,
+ const _Compare& __comp = _Compare(),
+ const allocator_type& __a = allocator_type())
+ : _M_t(__comp, __a)
{ _M_t._M_insert_unique(__l.begin(), __l.end()); }
#endif
diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h
index 9ccd9b8ca23..28222f408f3 100644
--- a/libstdc++-v3/include/bits/stl_vector.h
+++ b/libstdc++-v3/include/bits/stl_vector.h
@@ -277,11 +277,11 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
*/
vector(initializer_list<value_type> __l,
const allocator_type& __a = allocator_type())
- : _Base(__a)
- {
- _M_range_initialize(__l.begin(), __l.end(),
- random_access_iterator_tag());
- }
+ : _Base(__a)
+ {
+ _M_range_initialize(__l.begin(), __l.end(),
+ random_access_iterator_tag());
+ }
#endif
/**
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/debug/map.h b/libstdc++-v3/include/debug/map.h
index 8232c742a63..88d3e9842f8 100644
--- a/libstdc++-v3/include/debug/map.h
+++ b/libstdc++-v3/include/debug/map.h
@@ -102,7 +102,7 @@ namespace __debug
map(initializer_list<value_type> __l,
const _Compare& __c = _Compare(),
const allocator_type& __a = allocator_type())
- : _Base(__l, __c, __a), _Safe_base() { }
+ : _Base(__l, __c, __a), _Safe_base() { }
#endif
~map() { }
diff --git a/libstdc++-v3/include/debug/multimap.h b/libstdc++-v3/include/debug/multimap.h
index b7c5ee7181c..b8e78d153a9 100644
--- a/libstdc++-v3/include/debug/multimap.h
+++ b/libstdc++-v3/include/debug/multimap.h
@@ -103,7 +103,7 @@ namespace __debug
multimap(initializer_list<value_type> __l,
const _Compare& __c = _Compare(),
const allocator_type& __a = allocator_type())
- : _Base(__l, __c, __a), _Safe_base() { }
+ : _Base(__l, __c, __a), _Safe_base() { }
#endif
~multimap() { }
diff --git a/libstdc++-v3/include/debug/multiset.h b/libstdc++-v3/include/debug/multiset.h
index f108531638e..ba159b4c537 100644
--- a/libstdc++-v3/include/debug/multiset.h
+++ b/libstdc++-v3/include/debug/multiset.h
@@ -100,7 +100,7 @@ namespace __debug
multiset(initializer_list<value_type> __l,
const _Compare& __comp = _Compare(),
const allocator_type& __a = allocator_type())
- : _Base(__l, __comp, __a), _Safe_base() { }
+ : _Base(__l, __comp, __a), _Safe_base() { }
#endif
~multiset() { }
diff --git a/libstdc++-v3/include/debug/safe_association.h b/libstdc++-v3/include/debug/safe_association.h
index a413b01f872..de8945301f6 100644
--- a/libstdc++-v3/include/debug/safe_association.h
+++ b/libstdc++-v3/include/debug/safe_association.h
@@ -1,6 +1,6 @@
// Safe associated container base class implementation -*- 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
@@ -110,7 +110,7 @@ namespace __gnu_debug
const hasher& __hf,
const key_equal& __eql,
const allocator_type& __a = allocator_type())
- : _Base(__l, __n, __hf, __eql, __a)
+ : _Base(__l, __n, __hf, __eql, __a)
{ }
_Safe_association(const _Base& __x) : _Base(__x) { }
diff --git a/libstdc++-v3/include/debug/set.h b/libstdc++-v3/include/debug/set.h
index 00711cd321d..310f3ab61a2 100644
--- a/libstdc++-v3/include/debug/set.h
+++ b/libstdc++-v3/include/debug/set.h
@@ -100,7 +100,7 @@ namespace __debug
set(initializer_list<value_type> __l,
const _Compare& __comp = _Compare(),
const allocator_type& __a = allocator_type())
- : _Base(__l, __comp, __a), _Safe_base() { }
+ : _Base(__l, __comp, __a), _Safe_base() { }
#endif
~set() { }
diff --git a/libstdc++-v3/include/debug/string b/libstdc++-v3/include/debug/string
index 68882fed581..c00e0f38afc 100644
--- a/libstdc++-v3/include/debug/string
+++ b/libstdc++-v3/include/debug/string
@@ -117,8 +117,8 @@ namespace __gnu_debug
#ifdef __GXX_EXPERIMENTAL_CXX0X__
basic_string(initializer_list<_CharT> __l, const _Alloc& __a = _Alloc())
- : _Base(__l, __a)
- { }
+ : _Base(__l, __a)
+ { }
#endif // __GXX_EXPERIMENTAL_CXX0X__
~basic_string() { }
diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector
index a00419200d0..4e8cf5799b6 100644
--- a/libstdc++-v3/include/debug/vector
+++ b/libstdc++-v3/include/debug/vector
@@ -109,8 +109,8 @@ namespace __debug
vector(initializer_list<value_type> __l,
const allocator_type& __a = allocator_type())
- : _Base(__l, __a), _Safe_base(),
- _M_guaranteed_capacity(__l.size()) { }
+ : _Base(__l, __a), _Safe_base(),
+ _M_guaranteed_capacity(__l.size()) { }
#endif
~vector() { }
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 911bf240b48..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
@@ -589,7 +598,7 @@ namespace std
#endif
static time_point
- now();
+ now();
// Map to C API
static std::time_t
diff --git a/libstdc++-v3/include/std/condition_variable b/libstdc++-v3/include/std/condition_variable
index 1dfb7789499..1a7a7cd1f37 100644
--- a/libstdc++-v3/include/std/condition_variable
+++ b/libstdc++-v3/include/std/condition_variable
@@ -44,8 +44,14 @@
namespace std
{
- // XXX
- class system_time;
+ namespace chrono
+ {
+ template<typename _Rep, typename _Period>
+ struct duration;
+
+ template<typename _Clock, typename _Duration>
+ struct time_point;
+ }
/// condition_variable
class condition_variable
@@ -78,22 +84,27 @@ namespace std
wait(__lock);
}
- template<typename _Duration>
- bool
- timed_wait(unique_lock<mutex>& __lock, const _Duration& __rtime);
-
- bool
- timed_wait(unique_lock<mutex>& __lock, const system_time& __atime);
-
- template<typename _Predicate>
- bool
- timed_wait(unique_lock<mutex>& __lock, const system_time& __atime,
- _Predicate pred);
-
- template<typename _Duration, typename _Predicate>
+ template<typename _Clock, typename _Duration>
bool
- timed_wait(unique_lock<mutex>& __lock, const _Duration& __rtime,
- _Predicate pred);
+ wait_until(unique_lock<mutex>& __lock,
+ const chrono::time_point<_Clock, _Duration>& __atime);
+
+ template<typename _Clock, typename _Duration, typename _Predicate>
+ bool
+ wait_until(unique_lock<mutex>& __lock,
+ const chrono::time_point<_Clock, _Duration>& __atime,
+ _Predicate __p);
+
+ template<typename _Rep, typename _Period>
+ bool
+ wait_for(unique_lock<mutex>& __lock,
+ const chrono::duration<_Rep, _Period>& __rtime);
+
+ template<typename _Rep, typename _Period, typename _Predicate>
+ bool
+ wait_for(unique_lock<mutex>& __lock,
+ const chrono::duration<_Rep, _Period>& __rtime,
+ _Predicate __p);
native_handle_type
native_handle() { return _M_cond; }
@@ -132,21 +143,27 @@ namespace std
void
wait(_Lock& __lock, _Predicate __p);
- template<typename _Lock>
- bool
- timed_wait(_Lock& __lock, const system_time& __atime);
-
- template<typename _Lock, typename _Duration>
- bool
- timed_wait(_Lock& __lock, const _Duration& __rtime);
-
- template<typename _Lock, typename _Predicate>
+ template<typename _Lock, typename _Clock, typename _Duration>
bool
- timed_wait(_Lock& __lock, const system_time& __atime, _Predicate __p);
+ wait_until(_Lock& __lock,
+ const chrono::time_point<_Clock, _Duration>& __atime);
- template<typename _Lock, typename _Duration, typename _Predicate>
+ template<typename _Lock, typename _Clock,
+ typename _Duration, typename _Predicate>
bool
- timed_wait(_Lock& __lock, const _Duration& __rtime, _Predicate __p);
+ wait_until(_Lock& __lock,
+ const chrono::time_point<_Clock, _Duration>& __atime,
+ _Predicate __p);
+
+ template<typename _Lock, typename _Rep, typename _Period>
+ bool
+ wait_for(_Lock& __lock, const chrono::duration<_Rep, _Period>& __rtime);
+
+ template<typename _Lock, typename _Rep,
+ typename _Period, typename _Predicate>
+ bool
+ wait_for(_Lock& __lock,
+ const chrono::duration<_Rep, _Period>& __rtime, _Predicate __p);
native_handle_type
native_handle() { return _M_cond; }
diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex
index e4ba94def11..779394a5891 100644
--- a/libstdc++-v3/include/std/mutex
+++ b/libstdc++-v3/include/std/mutex
@@ -48,8 +48,14 @@
namespace std
{
- // XXX
- class system_time;
+ namespace chrono
+ {
+ template<typename _Rep, typename _Period>
+ struct duration;
+
+ template<typename _Clock, typename _Duration>
+ struct time_point;
+ }
/// mutex
class mutex
@@ -74,22 +80,22 @@ namespace std
int __e = __gthread_mutex_lock(&_M_mutex);
// EINVAL, EAGAIN, EBUSY, EINVAL, EDEADLK(may)
- if (__e)
- __throw_system_error(__e);
+ if (__e)
+ __throw_system_error(__e);
}
bool
try_lock()
{
- // XXX EINVAL, EAGAIN, EBUSY
- return !__gthread_mutex_trylock(&_M_mutex);
+ // XXX EINVAL, EAGAIN, EBUSY
+ return !__gthread_mutex_trylock(&_M_mutex);
}
void
unlock()
{
// XXX EINVAL, EAGAIN, EPERM
- __gthread_mutex_unlock(&_M_mutex);
+ __gthread_mutex_unlock(&_M_mutex);
}
native_handle_type
@@ -102,7 +108,6 @@ namespace std
mutex& operator=(const mutex&);
};
-
/// recursive_mutex
class recursive_mutex
{
@@ -126,8 +131,8 @@ namespace std
int __e = __gthread_recursive_mutex_lock(&_M_mutex);
// EINVAL, EAGAIN, EBUSY, EINVAL, EDEADLK(may)
- if (__e)
- __throw_system_error(__e);
+ if (__e)
+ __throw_system_error(__e);
}
bool
@@ -145,7 +150,8 @@ namespace std
}
native_handle_type
- native_handle() { return _M_mutex; }
+ native_handle()
+ { return _M_mutex; }
private:
native_handle_type _M_mutex;
@@ -154,9 +160,65 @@ namespace std
recursive_mutex& operator=(const recursive_mutex&);
};
+ /// timed_mutex
+ class timed_mutex
+ {
+ public:
+ typedef __gthread_mutex_t native_handle_type;
+
+ void lock();
+ bool try_lock();
+
+ template <class _Rep, class _Period>
+ bool
+ try_lock_for(const chrono::duration<_Rep, _Period>& __rtime);
+
+ template <class _Clock, class _Duration>
+ bool
+ try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime);
+
+ void unlock();
- // class timed_mutex;
- // class recursive_timed_mutex;
+ native_handle_type
+ native_handle()
+ { return _M_mutex; }
+
+ private:
+ native_handle_type _M_mutex;
+
+ timed_mutex(const timed_mutex&);
+ timed_mutex& operator=(const timed_mutex&);
+ };
+
+ /// recursive_timed_mutex
+ class recursive_timed_mutex
+ {
+ public:
+ typedef __gthread_mutex_t native_handle_type;
+
+ void lock();
+ bool try_lock();
+
+ template <class _Rep, class _Period>
+ bool
+ try_lock_for(const chrono::duration<_Rep, _Period>& __rtime);
+
+ template <class _Clock, class _Duration>
+ bool
+ try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime);
+
+ void unlock();
+
+ native_handle_type
+ native_handle()
+ { return _M_mutex; }
+
+ private:
+ native_handle_type _M_mutex;
+
+ recursive_timed_mutex(const recursive_timed_mutex&);
+ recursive_timed_mutex& operator=(const recursive_timed_mutex&);
+ };
/// Do not acquire ownership of the mutex.
struct defer_lock_t { };
@@ -211,19 +273,24 @@ namespace std
public:
typedef _Mutex mutex_type;
- unique_lock() : _M_device(NULL), _M_owns(false) { }
+ unique_lock()
+ : _M_device(NULL), _M_owns(false)
+ { }
- explicit unique_lock(mutex_type& __m) : _M_device(&__m)
+ explicit unique_lock(mutex_type& __m)
+ : _M_device(&__m)
{
lock();
_M_owns = true;
}
unique_lock(mutex_type& __m, defer_lock_t)
- : _M_device(&__m), _M_owns(false) { }
+ : _M_device(&__m), _M_owns(false)
+ { }
unique_lock(mutex_type& __m, try_to_lock_t)
- : _M_device(&__m), _M_owns(_M_device->try_lock()) { }
+ : _M_device(&__m), _M_owns(_M_device->try_lock())
+ { }
unique_lock(mutex_type& __m, adopt_lock_t)
: _M_device(&__m), _M_owns(true)
@@ -231,10 +298,13 @@ namespace std
// XXX calling thread owns mutex
}
- unique_lock(mutex_type& __m, const system_time& abs_time);
+ template<typename _Clock, typename _Duration>
+ unique_lock(mutex_type& __m,
+ const chrono::time_point<_Clock, _Duration>& __atime);
- template<typename _Duration>
- unique_lock(mutex_type& __m, const _Duration& rel_time);
+ template<typename _Rep, typename _Period>
+ unique_lock(mutex_type& __m,
+ const chrono::duration<_Rep, _Period>& __rtime);
~unique_lock()
{
@@ -246,7 +316,6 @@ namespace std
unique_lock& operator=(unique_lock&&);
-
void
lock()
{
@@ -276,12 +345,13 @@ namespace std
throw lock_error();
}
+ template<typename _Rep, typename _Period>
+ bool
+ try_lock_for(const chrono::duration<_Rep, _Period>& __rtime);
- template<typename _Duration>
- bool timed_lock(const _Duration& rel_time);
-
- bool
- timed_lock(const system_time& abs_time);
+ template<typename _Clock, typename _Duration>
+ bool
+ try_lock_until(const chrono::time_point<_Clock, _Duration>& __atime);
void
swap(unique_lock&& __u);
@@ -296,9 +366,11 @@ namespace std
}
bool
- owns_lock() const { return _M_owns; }
+ owns_lock() const
+ { return _M_owns; }
- operator bool () const { return owns_lock(); }
+ operator bool () const
+ { return owns_lock(); }
mutex_type*
mutex() const
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/std/utility b/libstdc++-v3/include/std/utility
index 027d513ccca..8a006ca500b 100644
--- a/libstdc++-v3/include/std/utility
+++ b/libstdc++-v3/include/std/utility
@@ -85,6 +85,7 @@
# undef _GLIBCXX_INCLUDE_AS_CXX0X
# endif
# include <bits/move.h>
+# include <initializer_list>
#endif
#endif /* _GLIBCXX_UTILITY */
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/boost_shared_ptr.h b/libstdc++-v3/include/tr1_impl/boost_shared_ptr.h
index a3fd80e8551..5da40516bd6 100644
--- a/libstdc++-v3/include/tr1_impl/boost_shared_ptr.h
+++ b/libstdc++-v3/include/tr1_impl/boost_shared_ptr.h
@@ -1,6 +1,6 @@
// <tr1_impl/boost_shared_ptr.h> -*- 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
@@ -505,13 +505,14 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
// This constructor is non-standard, it is used by allocate_shared.
template<typename _Alloc, typename... _Args>
__shared_ptr(_Sp_make_shared_tag __tag, _Alloc __a, _Args&&... __args)
- : _M_ptr()
- , _M_refcount(__tag, (_Tp*)0, __a, std::forward<_Args>(__args)...)
+ : _M_ptr(), _M_refcount(__tag, (_Tp*)0, __a,
+ std::forward<_Args>(__args)...)
{
// _M_ptr needs to point to the newly constructed object.
// This relies on _Sp_counted_ptr_inplace::_M_get_deleter.
- void * __p = _M_refcount._M_get_deleter(typeid(__tag));
+ void* __p = _M_refcount._M_get_deleter(typeid(__tag));
_M_ptr = static_cast<_Tp*>(__p);
+ __enable_shared_from_this_helper(_M_refcount, _M_ptr, _M_ptr);
}
template<typename _Tp1, _Lock_policy _Lp1, typename _Alloc,
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/hashtable b/libstdc++-v3/include/tr1_impl/hashtable
index 33857a43ab3..c76deb06ca7 100644
--- a/libstdc++-v3/include/tr1_impl/hashtable
+++ b/libstdc++-v3/include/tr1_impl/hashtable
@@ -149,6 +149,8 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
// hasher, if present, comes from _Hash_code_base.
typedef typename _Allocator::difference_type difference_type;
typedef typename _Allocator::size_type size_type;
+ typedef typename _Allocator::pointer pointer;
+ typedef typename _Allocator::const_pointer const_pointer;
typedef typename _Allocator::reference reference;
typedef typename _Allocator::const_reference const_reference;
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/libmath/mathconf.h b/libstdc++-v3/libmath/mathconf.h
index be8e96a4b3c..50ab0214c66 100644
--- a/libstdc++-v3/libmath/mathconf.h
+++ b/libstdc++-v3/libmath/mathconf.h
@@ -1,6 +1,7 @@
/* Configuration data for libmath subpart of libstdc++. */
-/* Copyright (C) 1997-1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1997-1999, 2000, 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
@@ -263,10 +264,10 @@ do { \
/* Replacement for non-existing float functions. */
-#if !defined(HAVE_FABSF) && !defined(HAVE___BUILTIN_FABSF)
+#ifndef HAVE_FABSF
# define fabsf(x) fabs (x)
#endif
-#if !defined(HAVE_COSF) && !defined(HAVE___BUILTIN_COSF)
+#ifndef HAVE_COSF
# define cosf(x) cos (x)
#endif
#ifndef HAVE_COSHF
@@ -284,13 +285,13 @@ do { \
#ifndef HAVE_POWF
# define powf(x, y) pow (x, y)
#endif
-#if !defined(HAVE_SINF) && !defined(HAVE___BUILTIN_SINF)
+#ifndef HAVE_SINF
# define sinf(x) sin (x)
#endif
#ifndef HAVE_SINHF
# define sinhf(x) sinh (x)
#endif
-#if !defined(HAVE_SQRTF) && !defined(HAVE___BUILTIN_SQRTF)
+#ifndef HAVE_SQRTF
# define sqrtf(x) sqrt (x)
#endif
#ifndef HAVE_TANF
@@ -306,4 +307,3 @@ do { \
#ifdef __cplusplus
}
#endif
-
diff --git a/libstdc++-v3/libsupc++/Makefile.am b/libstdc++-v3/libsupc++/Makefile.am
index c0412f0b8ed..680005fbf83 100644
--- a/libstdc++-v3/libsupc++/Makefile.am
+++ b/libstdc++-v3/libsupc++/Makefile.am
@@ -34,7 +34,7 @@ noinst_LTLIBRARIES = libsupc++convenience.la
headers = \
exception new typeinfo cxxabi.h cxxabi-forced.h exception_defines.h \
- initializer_list
+ initializer_list exception_ptr.h
if GLIBCXX_HOSTED
c_sources = \
@@ -60,6 +60,7 @@ sources = \
eh_exception.cc \
eh_globals.cc \
eh_personality.cc \
+ eh_ptr.cc \
eh_term_handler.cc \
eh_terminate.cc \
eh_throw.cc \
diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in
index 0f7cf8c517e..c3d1c6c6b43 100644
--- a/libstdc++-v3/libsupc++/Makefile.in
+++ b/libstdc++-v3/libsupc++/Makefile.in
@@ -79,7 +79,7 @@ am__libsupc___la_SOURCES_DIST = array_type_info.cc atexit_arm.cc \
bad_cast.cc bad_typeid.cc class_type_info.cc del_op.cc \
del_opnt.cc del_opv.cc del_opvnt.cc dyncast.cc eh_alloc.cc \
eh_arm.cc eh_aux_runtime.cc eh_call.cc eh_catch.cc \
- eh_exception.cc eh_globals.cc eh_personality.cc \
+ eh_exception.cc eh_globals.cc eh_personality.cc eh_ptr.cc \
eh_term_handler.cc eh_terminate.cc eh_throw.cc eh_type.cc \
eh_unex_handler.cc enum_type_info.cc function_type_info.cc \
fundamental_type_info.cc guard.cc new_handler.cc new_op.cc \
@@ -91,7 +91,7 @@ am__objects_1 = array_type_info.lo atexit_arm.lo bad_cast.lo \
bad_typeid.lo class_type_info.lo del_op.lo del_opnt.lo \
del_opv.lo del_opvnt.lo dyncast.lo eh_alloc.lo eh_arm.lo \
eh_aux_runtime.lo eh_call.lo eh_catch.lo eh_exception.lo \
- eh_globals.lo eh_personality.lo eh_term_handler.lo \
+ eh_globals.lo eh_personality.lo eh_ptr.lo eh_term_handler.lo \
eh_terminate.lo eh_throw.lo eh_type.lo eh_unex_handler.lo \
enum_type_info.lo function_type_info.lo \
fundamental_type_info.lo guard.lo new_handler.lo new_op.lo \
@@ -107,7 +107,7 @@ am__libsupc__convenience_la_SOURCES_DIST = array_type_info.cc \
atexit_arm.cc bad_cast.cc bad_typeid.cc class_type_info.cc \
del_op.cc del_opnt.cc del_opv.cc del_opvnt.cc dyncast.cc \
eh_alloc.cc eh_arm.cc eh_aux_runtime.cc eh_call.cc eh_catch.cc \
- eh_exception.cc eh_globals.cc eh_personality.cc \
+ eh_exception.cc eh_globals.cc eh_personality.cc eh_ptr.cc \
eh_term_handler.cc eh_terminate.cc eh_throw.cc eh_type.cc \
eh_unex_handler.cc enum_type_info.cc function_type_info.cc \
fundamental_type_info.cc guard.cc new_handler.cc new_op.cc \
@@ -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@
@@ -355,7 +356,7 @@ toolexeclib_LTLIBRARIES = libsupc++.la
noinst_LTLIBRARIES = libsupc++convenience.la
headers = \
exception new typeinfo cxxabi.h cxxabi-forced.h exception_defines.h \
- initializer_list
+ initializer_list exception_ptr.h
@GLIBCXX_HOSTED_TRUE@c_sources = \
@GLIBCXX_HOSTED_TRUE@ cp-demangle.c
@@ -379,6 +380,7 @@ sources = \
eh_exception.cc \
eh_globals.cc \
eh_personality.cc \
+ eh_ptr.cc \
eh_term_handler.cc \
eh_terminate.cc \
eh_throw.cc \
diff --git a/libstdc++-v3/libsupc++/eh_alloc.cc b/libstdc++-v3/libsupc++/eh_alloc.cc
index 553c1c1e858..6bc46fc9a91 100644
--- a/libstdc++-v3/libsupc++/eh_alloc.cc
+++ b/libstdc++-v3/libsupc++/eh_alloc.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- Allocate exception objects.
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008
// Free Software Foundation, Inc.
//
// This file is part of GCC.
@@ -89,6 +89,9 @@ typedef char one_buffer[EMERGENCY_OBJ_SIZE] __attribute__((aligned));
static one_buffer emergency_buffer[EMERGENCY_OBJ_COUNT];
static bitmask_type emergency_used;
+static __cxa_dependent_exception dependents_buffer[EMERGENCY_OBJ_COUNT];
+static bitmask_type dependents_used;
+
namespace
{
// A single mutex controlling emergency allocations.
@@ -157,3 +160,66 @@ __cxxabiv1::__cxa_free_exception(void *vptr) throw()
else
free (ptr - sizeof (__cxa_exception));
}
+
+
+extern "C" __cxa_dependent_exception*
+__cxxabiv1::__cxa_allocate_dependent_exception() throw()
+{
+ __cxa_dependent_exception *ret;
+
+ ret = static_cast<__cxa_dependent_exception*>
+ (malloc (sizeof (__cxa_dependent_exception)));
+
+ if (!ret)
+ {
+ __gnu_cxx::__scoped_lock sentry(emergency_mutex);
+
+ bitmask_type used = dependents_used;
+ unsigned int which = 0;
+
+ while (used & 1)
+ {
+ used >>= 1;
+ if (++which >= EMERGENCY_OBJ_COUNT)
+ goto failed;
+ }
+
+ dependents_used |= (bitmask_type)1 << which;
+ ret = &dependents_buffer[which];
+
+ failed:;
+
+ if (!ret)
+ std::terminate ();
+ }
+
+ // We have an uncaught exception as soon as we allocate memory. This
+ // yields uncaught_exception() true during the copy-constructor that
+ // initializes the exception object. See Issue 475.
+ __cxa_eh_globals *globals = __cxa_get_globals ();
+ globals->uncaughtExceptions += 1;
+
+ memset (ret, 0, sizeof (__cxa_dependent_exception));
+
+ return ret;
+}
+
+
+extern "C" void
+__cxxabiv1::__cxa_free_dependent_exception
+ (__cxa_dependent_exception *vptr) throw()
+{
+ char *base = (char *) dependents_buffer;
+ char *ptr = (char *) vptr;
+ if (ptr >= base
+ && ptr < base + sizeof (dependents_buffer))
+ {
+ const unsigned int which
+ = (unsigned) (ptr - base) / sizeof (__cxa_dependent_exception);
+
+ __gnu_cxx::__scoped_lock sentry(emergency_mutex);
+ dependents_used &= ~((bitmask_type)1 << which);
+ }
+ else
+ free (vptr);
+}
diff --git a/libstdc++-v3/libsupc++/eh_arm.cc b/libstdc++-v3/libsupc++/eh_arm.cc
index 6f770e95663..f10bb41e5c0 100644
--- a/libstdc++-v3/libsupc++/eh_arm.cc
+++ b/libstdc++-v3/libsupc++/eh_arm.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- ARM specific Exception handling support routines.
-// Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+// Copyright (C) 2004, 2005, 2008 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -48,13 +48,19 @@ __cxa_type_match(_Unwind_Exception* ue_header,
{
bool forced_unwind = __is_gxx_forced_unwind_class(ue_header->exception_class);
bool foreign_exception = !forced_unwind && !__is_gxx_exception_class(ue_header->exception_class);
+ bool dependent_exception =
+ __is_dependent_exception(ue_header->exception_class);
__cxa_exception* xh = __get_exception_header_from_ue(ue_header);
+ __cxa_dependent_exception *dx = __get_dependent_exception_from_ue(ue_header);
const std::type_info* throw_type;
if (forced_unwind)
throw_type = &typeid(abi::__forced_unwind);
else if (foreign_exception)
throw_type = &typeid(abi::__foreign_exception);
+ else if (dependent_exception)
+ throw_type = __get_exception_header_from_obj
+ (dx->primaryException)->exceptionType;
else
throw_type = xh->exceptionType;
diff --git a/libstdc++-v3/libsupc++/eh_call.cc b/libstdc++-v3/libsupc++/eh_call.cc
index edf62188a6b..497d8623c67 100644
--- a/libstdc++-v3/libsupc++/eh_call.cc
+++ b/libstdc++-v3/libsupc++/eh_call.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- Helpers for calling unextected and terminate
-// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2008 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -125,7 +125,7 @@ __cxa_call_unexpected(void* exc_obj_in)
__cxa_eh_globals* globals = __cxa_get_globals_fast();
__cxa_exception* new_xh = globals->caughtExceptions;
- void* new_ptr = new_xh + 1;
+ void* new_ptr = __get_object_from_ambiguous_exception (new_xh);
const std::type_info* catch_type;
int n;
bool bad_exception_allowed = false;
diff --git a/libstdc++-v3/libsupc++/eh_personality.cc b/libstdc++-v3/libsupc++/eh_personality.cc
index b7d957c4d37..12b54c16587 100644
--- a/libstdc++-v3/libsupc++/eh_personality.cc
+++ b/libstdc++-v3/libsupc++/eh_personality.cc
@@ -377,7 +377,7 @@ PERSONALITY_FUNCTION (int version,
const unsigned char *p;
_Unwind_Ptr landing_pad, ip;
int handler_switch_value;
- void* thrown_ptr = ue_header + 1;
+ void* thrown_ptr = 0;
bool foreign_exception;
int ip_before_insn = 0;
@@ -543,30 +543,33 @@ PERSONALITY_FUNCTION (int version,
bool saw_handler = false;
#ifdef __ARM_EABI_UNWINDER__
+ // ??? How does this work - more importantly, how does it interact with
+ // dependent exceptions?
throw_type = ue_header;
if (actions & _UA_FORCE_UNWIND)
{
__GXX_INIT_FORCED_UNWIND_CLASS(ue_header->exception_class);
- thrown_ptr = 0;
}
- else if (foreign_exception)
- thrown_ptr = 0;
+ else if (!foreign_exception)
+ thrown_ptr = __get_object_from_ue (ue_header);
#else
// During forced unwinding, match a magic exception type.
if (actions & _UA_FORCE_UNWIND)
{
throw_type = &typeid(abi::__forced_unwind);
- thrown_ptr = 0;
}
// With a foreign exception class, there's no exception type.
// ??? What to do about GNU Java and GNU Ada exceptions?
else if (foreign_exception)
{
throw_type = &typeid(abi::__foreign_exception);
- thrown_ptr = 0;
}
else
- throw_type = xh->exceptionType;
+ {
+ thrown_ptr = __get_object_from_ue (ue_header);
+ throw_type = __get_exception_header_from_obj
+ (thrown_ptr)->exceptionType;
+ }
#endif
while (1)
@@ -758,13 +761,14 @@ __cxa_call_unexpected (void *exc_obj_in)
__cxa_eh_globals *globals = __cxa_get_globals_fast ();
__cxa_exception *new_xh = globals->caughtExceptions;
- void *new_ptr = new_xh + 1;
+ void *new_ptr = __get_object_from_ambiguous_exception (new_xh);
// We don't quite have enough stuff cached; re-parse the LSDA.
parse_lsda_header (0, xh_lsda, &info);
// If this new exception meets the exception spec, allow it.
- if (check_exception_spec (&info, new_xh->exceptionType,
+ if (check_exception_spec (&info, __get_exception_header_from_obj
+ (new_ptr)->exceptionType,
new_ptr, xh_switch_value))
__throw_exception_again;
diff --git a/libstdc++-v3/libsupc++/eh_throw.cc b/libstdc++-v3/libsupc++/eh_throw.cc
index b405f8f7c64..24b357772b4 100644
--- a/libstdc++-v3/libsupc++/eh_throw.cc
+++ b/libstdc++-v3/libsupc++/eh_throw.cc
@@ -1,5 +1,6 @@
// -*- C++ -*- Exception handling routines for throwing.
-// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+// Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -36,20 +37,27 @@ using namespace __cxxabiv1;
static void
__gxx_exception_cleanup (_Unwind_Reason_Code code, _Unwind_Exception *exc)
{
+ // This cleanup is set only for primaries.
__cxa_exception *header = __get_exception_header_from_ue (exc);
- // If we haven't been caught by a foreign handler, then this is
- // some sort of unwind error. In that case just die immediately.
+ // We only want to be called through _Unwind_DeleteException.
// _Unwind_DeleteException in the HP-UX IA64 libunwind library
- // returns _URC_NO_REASON and not _URC_FOREIGN_EXCEPTION_CAUGHT
+ // returns _URC_NO_REASON and not _URC_FOREIGN_EXCEPTION_CAUGHT
// like the GCC _Unwind_DeleteException function does.
if (code != _URC_FOREIGN_EXCEPTION_CAUGHT && code != _URC_NO_REASON)
__terminate (header->terminateHandler);
- if (header->exceptionDestructor)
- header->exceptionDestructor (header + 1);
+#ifdef _GLIBCXX_ATOMIC_BUILTINS_4
+ if (__sync_sub_and_fetch (&header->referenceCount, 1) == 0)
+ {
+#endif
+ if (header->exceptionDestructor)
+ header->exceptionDestructor (header + 1);
- __cxa_free_exception (header + 1);
+ __cxa_free_exception (header + 1);
+#ifdef _GLIBCXX_ATOMIC_BUILTINS_4
+ }
+#endif
}
@@ -57,12 +65,14 @@ extern "C" void
__cxxabiv1::__cxa_throw (void *obj, std::type_info *tinfo,
void (*dest) (void *))
{
+ // Definitely a primary.
__cxa_exception *header = __get_exception_header_from_obj (obj);
+ header->referenceCount = 1;
header->exceptionType = tinfo;
header->exceptionDestructor = dest;
header->unexpectedHandler = __unexpected_handler;
header->terminateHandler = __terminate_handler;
- __GXX_INIT_EXCEPTION_CLASS(header->unwindHeader.exception_class);
+ __GXX_INIT_PRIMARY_EXCEPTION_CLASS(header->unwindHeader.exception_class);
header->unwindHeader.exception_cleanup = __gxx_exception_cleanup;
#ifdef _GLIBCXX_SJLJ_EXCEPTIONS
diff --git a/libstdc++-v3/libsupc++/eh_type.cc b/libstdc++-v3/libsupc++/eh_type.cc
index 99627efdd97..03432976714 100644
--- a/libstdc++-v3/libsupc++/eh_type.cc
+++ b/libstdc++-v3/libsupc++/eh_type.cc
@@ -1,5 +1,5 @@
// -*- C++ -*- Exception handling routines for catching.
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2008 Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -43,7 +43,15 @@ std::type_info *__cxa_current_exception_type ()
__cxa_eh_globals *globals = __cxa_get_globals ();
__cxa_exception *header = globals->caughtExceptions;
if (header)
- return header->exceptionType;
+ {
+ if (__is_dependent_exception (header->unwindHeader.exception_class))
+ {
+ __cxa_dependent_exception *de =
+ __get_dependent_exception_from_ue (&header->unwindHeader);
+ header = __get_exception_header_from_obj (de->primaryException);
+ }
+ return header->exceptionType;
+ }
else
return 0;
}
diff --git a/libstdc++-v3/libsupc++/exception b/libstdc++-v3/libsupc++/exception
index a7e2db78dd1..0accb2f4938 100644
--- a/libstdc++-v3/libsupc++/exception
+++ b/libstdc++-v3/libsupc++/exception
@@ -1,7 +1,7 @@
// Exception Handling support header for -*- C++ -*-
// Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
-// 2004, 2005, 2006, 2007
+// 2004, 2005, 2006, 2007, 2008
// Free Software Foundation
//
// This file is part of GCC.
@@ -110,6 +110,7 @@ namespace std
* result in a call of @c terminate() (15.5.1)."
*/
bool uncaught_exception() throw();
+
} // namespace std
_GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
@@ -132,4 +133,9 @@ _GLIBCXX_END_NAMESPACE
#pragma GCC visibility pop
+#if (defined(__GXX_EXPERIMENTAL_CXX0X__) \
+ && defined(_GLIBCXX_ATOMIC_BUILTINS_4))
+#include <exception_ptr.h>
+#endif
+
#endif
diff --git a/libstdc++-v3/libsupc++/unwind-cxx.h b/libstdc++-v3/libsupc++/unwind-cxx.h
index 75874fc5da4..3f6a76560fd 100644
--- a/libstdc++-v3/libsupc++/unwind-cxx.h
+++ b/libstdc++-v3/libsupc++/unwind-cxx.h
@@ -1,5 +1,6 @@
// -*- C++ -*- Exception handling and frame unwind runtime interface routines.
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+// Free Software Foundation, Inc.
//
// This file is part of GCC.
//
@@ -39,18 +40,22 @@
#include <exception>
#include <cstddef>
#include "unwind.h"
+#include <bits/atomic_word.h>
#pragma GCC visibility push(default)
namespace __cxxabiv1
{
-// A C++ exception object consists of a header, which is a wrapper around
-// an unwind object header with additional C++ specific information,
+// A primary C++ exception object consists of a header, which is a wrapper
+// around an unwind object header with additional C++ specific information,
// followed by the exception object itself.
struct __cxa_exception
-{
+{
+ // Manage this header.
+ _Atomic_word referenceCount;
+
// Manage the exception object itself.
std::type_info *exceptionType;
void (*exceptionDestructor)(void *);
@@ -87,6 +92,47 @@ struct __cxa_exception
_Unwind_Exception unwindHeader;
};
+// A dependent C++ exception object consists of a wrapper around an unwind
+// object header with additional C++ specific information, containing a pointer
+// to a primary exception object.
+
+struct __cxa_dependent_exception
+{
+ // The primary exception this thing depends on.
+ void *primaryException;
+
+ // The C++ standard has entertaining rules wrt calling set_terminate
+ // and set_unexpected in the middle of the exception cleanup process.
+ std::unexpected_handler unexpectedHandler;
+ std::terminate_handler terminateHandler;
+
+ // The caught exception stack threads through here.
+ __cxa_exception *nextException;
+
+ // How many nested handlers have caught this exception. A negated
+ // value is a signal that this object has been rethrown.
+ int handlerCount;
+
+#ifdef __ARM_EABI_UNWINDER__
+ // Stack of exceptions in cleanups.
+ __cxa_exception* nextPropagatingException;
+
+ // The nuber of active cleanup handlers for this exception.
+ int propagationCount;
+#else
+ // Cache parsed handler data from the personality routine Phase 1
+ // for Phase 2 and __cxa_call_unexpected.
+ int handlerSwitchValue;
+ const unsigned char *actionRecord;
+ const unsigned char *languageSpecificData;
+ _Unwind_Ptr catchTemp;
+ void *adjustedPtr;
+#endif
+
+ // The generic exception header. Must be last.
+ _Unwind_Exception unwindHeader;
+};
+
// Each thread in a C++ program has access to a __cxa_eh_globals object.
struct __cxa_eh_globals
{
@@ -105,12 +151,20 @@ struct __cxa_eh_globals
extern "C" __cxa_eh_globals *__cxa_get_globals () throw();
extern "C" __cxa_eh_globals *__cxa_get_globals_fast () throw();
-// Allocate memory for the exception plus the thown object.
+// Allocate memory for the primary exception plus the thrown object.
extern "C" void *__cxa_allocate_exception(std::size_t thrown_size) throw();
-// Free the space allocated for the exception.
+// Free the space allocated for the primary exception.
extern "C" void __cxa_free_exception(void *thrown_exception) throw();
+// Allocate memory for a dependent exception.
+extern "C" __cxa_dependent_exception*
+__cxa_allocate_dependent_exception() throw();
+
+// Free the space allocated for the dependent exception.
+extern "C" void
+__cxa_free_dependent_exception(__cxa_dependent_exception *ex) throw();
+
// Throw the exception.
extern "C" void __cxa_throw (void *thrown_exception,
std::type_info *tinfo,
@@ -173,6 +227,12 @@ __get_exception_header_from_ue (_Unwind_Exception *exc)
return reinterpret_cast<__cxa_exception *>(exc + 1) - 1;
}
+static inline __cxa_dependent_exception *
+__get_dependent_exception_from_ue (_Unwind_Exception *exc)
+{
+ return reinterpret_cast<__cxa_dependent_exception *>(exc + 1) - 1;
+}
+
#ifdef __ARM_EABI_UNWINDER__
static inline bool
__is_gxx_exception_class(_Unwind_Exception_Class c)
@@ -185,11 +245,19 @@ __is_gxx_exception_class(_Unwind_Exception_Class c)
&& c[4] == 'C'
&& c[5] == '+'
&& c[6] == '+'
- && c[7] == '\0';
+ && (c[7] == '\0' || c[7] == '\x01');
+}
+
+// Only checks for primary or dependent, but not that it is a C++ exception at
+// all.
+static inline bool
+__is_dependent_exception(_Unwind_Exception_Class c)
+{
+ return c[7] == '\x01';
}
static inline void
-__GXX_INIT_EXCEPTION_CLASS(_Unwind_Exception_Class c)
+__GXX_INIT_PRIMARY_EXCEPTION_CLASS(_Unwind_Exception_Class c)
{
c[0] = 'G';
c[1] = 'N';
@@ -201,6 +269,19 @@ __GXX_INIT_EXCEPTION_CLASS(_Unwind_Exception_Class c)
c[7] = '\0';
}
+static inline void
+__GXX_INIT_DEPENDENT_EXCEPTION_CLASS(_Unwind_Exception_Class c)
+{
+ c[0] = 'G';
+ c[1] = 'N';
+ c[2] = 'U';
+ c[3] = 'C';
+ c[4] = 'C';
+ c[5] = '+';
+ c[6] = '+';
+ c[7] = '\x01';
+}
+
static inline bool
__is_gxx_forced_unwind_class(_Unwind_Exception_Class c)
{
@@ -233,8 +314,8 @@ __gxx_caught_object(_Unwind_Exception* eo)
return (void*)eo->barrier_cache.bitpattern[0];
}
#else // !__ARM_EABI_UNWINDER__
-// This is the exception class we report -- "GNUCC++\0".
-const _Unwind_Exception_Class __gxx_exception_class
+// This is the primary exception class we report -- "GNUCC++\0".
+const _Unwind_Exception_Class __gxx_primary_exception_class
= ((((((((_Unwind_Exception_Class) 'G'
<< 8 | (_Unwind_Exception_Class) 'N')
<< 8 | (_Unwind_Exception_Class) 'U')
@@ -244,13 +325,36 @@ const _Unwind_Exception_Class __gxx_exception_class
<< 8 | (_Unwind_Exception_Class) '+')
<< 8 | (_Unwind_Exception_Class) '\0');
+// This is the dependent (from std::rethrow_exception) exception class we report
+// "GNUCC++\x01"
+const _Unwind_Exception_Class __gxx_dependent_exception_class
+= ((((((((_Unwind_Exception_Class) 'G'
+ << 8 | (_Unwind_Exception_Class) 'N')
+ << 8 | (_Unwind_Exception_Class) 'U')
+ << 8 | (_Unwind_Exception_Class) 'C')
+ << 8 | (_Unwind_Exception_Class) 'C')
+ << 8 | (_Unwind_Exception_Class) '+')
+ << 8 | (_Unwind_Exception_Class) '+')
+ << 8 | (_Unwind_Exception_Class) '\x01');
+
static inline bool
__is_gxx_exception_class(_Unwind_Exception_Class c)
{
- return c == __gxx_exception_class;
+ return c == __gxx_primary_exception_class
+ || c == __gxx_dependent_exception_class;
}
-#define __GXX_INIT_EXCEPTION_CLASS(c) c = __gxx_exception_class
+// Only checks for primary or dependent, but not that it is a C++ exception at
+// all.
+static inline bool
+__is_dependent_exception(_Unwind_Exception_Class c)
+{
+ return (c & 1);
+}
+
+#define __GXX_INIT_PRIMARY_EXCEPTION_CLASS(c) c = __gxx_primary_exception_class
+#define __GXX_INIT_DEPENDENT_EXCEPTION_CLASS(c) \
+ c = __gxx_dependent_exception_class
// GNU C++ personality routine, Version 0.
extern "C" _Unwind_Reason_Code __gxx_personality_v0
@@ -265,11 +369,27 @@ extern "C" _Unwind_Reason_Code __gxx_personality_sj0
static inline void*
__gxx_caught_object(_Unwind_Exception* eo)
{
+ // Bad as it looks, this actually works for dependent exceptions too.
__cxa_exception* header = __get_exception_header_from_ue (eo);
return header->adjustedPtr;
}
#endif // !__ARM_EABI_UNWINDER__
+static inline void*
+__get_object_from_ue(_Unwind_Exception* eo) throw()
+{
+ return __is_dependent_exception (eo->exception_class) ?
+ __get_dependent_exception_from_ue (eo)->primaryException :
+ eo + 1;
+}
+
+static inline void *
+__get_object_from_ambiguous_exception(__cxa_exception *p_or_d) throw()
+{
+ return __get_object_from_ue (&p_or_d->unwindHeader);
+}
+
+
} /* namespace __cxxabiv1 */
#pragma GCC visibility pop
diff --git a/libstdc++-v3/linkage.m4 b/libstdc++-v3/linkage.m4
index 62d2c1da140..f1a15ac1885 100644
--- a/libstdc++-v3/linkage.m4
+++ b/libstdc++-v3/linkage.m4
@@ -291,94 +291,6 @@ AC_DEFUN([GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_3], [
])
dnl
-dnl Because the builtins are picky picky picky about the arguments they take,
-dnl do an explict linkage tests here.
-dnl Check to see if the (math function) argument passed is
-dnl 1) declared when using the c++ compiler
-dnl 2) has "C" linkage
-dnl
-dnl Define HAVE_CARGF etc if "cargf" is declared and links
-dnl
-dnl argument 1 is name of function to check
-dnl
-dnl ASSUMES argument is a math function with ONE parameter
-dnl
-dnl GLIBCXX_CHECK_BUILTIN_MATH_DECL_LINKAGE_1
-AC_DEFUN([GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1], [
- AC_MSG_CHECKING([for $1 declaration])
- if test x${glibcxx_cv_func_$1_use+set} != xset; then
- AC_CACHE_VAL(glibcxx_cv_func_$1_use, [
- AC_LANG_SAVE
- AC_LANG_CPLUSPLUS
- AC_TRY_COMPILE([#include <math.h>],
- [ $1(0);],
- [glibcxx_cv_func_$1_use=yes], [glibcxx_cv_func_$1_use=no])
- AC_LANG_RESTORE
- ])
- fi
- AC_MSG_RESULT($glibcxx_cv_func_$1_use)
- if test x$glibcxx_cv_func_$1_use = x"yes"; then
- AC_MSG_CHECKING([for $1 linkage])
- if test x${glibcxx_cv_func_$1_link+set} != xset; then
- AC_CACHE_VAL(glibcxx_cv_func_$1_link, [
- AC_TRY_LINK([#include <math.h>],
- [ $1(0);],
- [glibcxx_cv_func_$1_link=yes], [glibcxx_cv_func_$1_link=no])
- ])
- fi
- AC_MSG_RESULT($glibcxx_cv_func_$1_link)
- define([NAME], [translit([$1],[abcdefghijklmnopqrstuvwxyz],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ])])
- if test x$glibcxx_cv_func_$1_link = x"yes"; then
- AC_DEFINE([HAVE_]NAME, 1, [Define if the compiler/host combination has $1.])
- fi
- undefine([NAME])
- fi
-])
-
-
-dnl
-dnl Check to see what builtin math functions are supported
-dnl
-dnl check for __builtin_abs
-dnl check for __builtin_fabsf
-dnl check for __builtin_fabs
-dnl check for __builtin_fabl
-dnl check for __builtin_labs
-dnl check for __builtin_sqrtf
-dnl check for __builtin_sqrtl
-dnl check for __builtin_sqrt
-dnl check for __builtin_sinf
-dnl check for __builtin_sin
-dnl check for __builtin_sinl
-dnl check for __builtin_cosf
-dnl check for __builtin_cos
-dnl check for __builtin_cosl
-dnl
-dnl GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT
-AC_DEFUN([GLIBCXX_CHECK_BUILTIN_MATH_SUPPORT], [
- dnl Test for builtin math functions.
- dnl These are made in gcc/c-common.c
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_abs)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsf)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabs)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_fabsl)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_labs)
-
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtf)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrt)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sqrtl)
-
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinf)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sin)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_sinl)
-
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosf)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cos)
- GLIBCXX_CHECK_BUILTIN_MATH_DECL_AND_LINKAGE_1(__builtin_cosl)
-])
-
-dnl
dnl Check to see what the underlying c library is like
dnl These checks need to do two things:
dnl 1) make sure the name is declared when using the c++ compiler
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/src/mt_allocator.cc b/libstdc++-v3/src/mt_allocator.cc
index da0b09cef21..1e64227e4e3 100644
--- a/libstdc++-v3/src/mt_allocator.cc
+++ b/libstdc++-v3/src/mt_allocator.cc
@@ -610,7 +610,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
// If we have thread support and it's active we check the thread
// key value and return its id or if it's not set we take the
// first record from _M_thread_freelist and sets the key and
- // returns it's id.
+ // returns its id.
if (__gthread_active_p())
{
void* v = __gthread_getspecific(freelist._M_key);
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/18_support/exception_ptr/current_exception.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/current_exception.cc
new file mode 100644
index 00000000000..f38b10a3293
--- /dev/null
+++ b/libstdc++-v3/testsuite/18_support/exception_ptr/current_exception.cc
@@ -0,0 +1,92 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-atomic-builtins "" }
+
+// 2008-05-25 Sebastian Redl <sebastian.redl@getdesigned.at>
+
+// 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.
+
+// current_exception() under various conditions.
+
+#include <exception>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ exception_ptr ep = current_exception();
+ VERIFY( !ep );
+}
+
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ try {
+ throw 0;
+ } catch(...) {
+ exception_ptr ep = current_exception();
+ VERIFY( ep );
+ }
+}
+
+void test03()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ try {
+ throw exception();
+ } catch(std::exception&) {
+ exception_ptr ep = current_exception();
+ VERIFY( ep );
+ }
+}
+
+void test04()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ try {
+ throw 0;
+ } catch(...) {
+ exception_ptr ep1 = current_exception();
+ try {
+ throw 0;
+ } catch(...) {
+ exception_ptr ep2 = current_exception();
+ VERIFY( ep1 != ep2 );
+ }
+ exception_ptr ep3 = current_exception();
+ // Not guaranteed by standard, but by this implementation.
+ VERIFY( ep1 == ep3 );
+ }
+}
+
+int main()
+{
+ test01();
+ test02();
+ test03();
+ test04();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/18_support/exception_ptr/lifespan.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/lifespan.cc
new file mode 100644
index 00000000000..a43c56b0379
--- /dev/null
+++ b/libstdc++-v3/testsuite/18_support/exception_ptr/lifespan.cc
@@ -0,0 +1,190 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-atomic-builtins "" }
+
+// 2008-05-25 Sebastian Redl <sebastian.redl@getdesigned.at>
+
+// 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.
+
+// Tests the life span of the exception object.
+
+#include <exception>
+#include <testsuite_hooks.h>
+
+bool may_destruct = false;
+
+class destructing
+{
+ mutable bool copied;
+
+public:
+ destructing() : copied(false) { }
+ destructing(const destructing &o) : copied(false) { o.copied = true; }
+ ~destructing() { VERIFY( copied || may_destruct ); }
+};
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ may_destruct = false;
+
+ // Test the destructing class.
+ {
+ destructing *d = new destructing;
+ destructing d2(*d);
+ delete d;
+ may_destruct = true;
+ }
+ may_destruct = false;
+}
+
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ may_destruct = false;
+
+ try {
+ throw destructing();
+ } catch(...) {
+ may_destruct = true;
+ }
+ may_destruct = false;
+}
+
+void test03()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ may_destruct = false;
+
+ try {
+ throw destructing();
+ } catch(...) {
+ {
+ exception_ptr ep = current_exception();
+ }
+ may_destruct = true;
+ }
+ may_destruct = false;
+}
+
+void test04()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ may_destruct = false;
+
+ {
+ exception_ptr ep;
+ try {
+ throw destructing();
+ } catch(...) {
+ ep = current_exception();
+ }
+ may_destruct = true;
+ }
+ may_destruct = false;
+}
+
+void test05_helper()
+{
+ using namespace std;
+ try {
+ throw destructing();
+ } catch(...) {
+ exception_ptr ep = current_exception();
+ rethrow_exception(ep);
+ }
+}
+
+void test05()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ may_destruct = false;
+
+ try {
+ test05_helper();
+ } catch(...) {
+ may_destruct = true;
+ }
+ may_destruct = false;
+}
+
+void test06_helper()
+{
+ using namespace std;
+ try {
+ throw destructing();
+ } catch(...) {
+ exception_ptr ep = current_exception();
+ throw;
+ }
+}
+
+void test06()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ may_destruct = false;
+
+ try {
+ test06_helper();
+ } catch(...) {
+ may_destruct = true;
+ }
+ may_destruct = false;
+}
+
+std::exception_ptr gep;
+
+void test99()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ may_destruct = false;
+
+ try {
+ throw destructing();
+ } catch(...) {
+ gep = current_exception();
+ }
+}
+
+int main()
+{
+ test01();
+ test02();
+ test03();
+ test04();
+ test05();
+ test06();
+
+ test99();
+ may_destruct = true;
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/18_support/exception_ptr/rethrow_exception.cc b/libstdc++-v3/testsuite/18_support/exception_ptr/rethrow_exception.cc
new file mode 100644
index 00000000000..a78903d9724
--- /dev/null
+++ b/libstdc++-v3/testsuite/18_support/exception_ptr/rethrow_exception.cc
@@ -0,0 +1,115 @@
+// { dg-options "-std=gnu++0x" }
+// { dg-require-atomic-builtins "" }
+
+// 2008-05-25 Sebastian Redl <sebastian.redl@getdesigned.at>
+
+// 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.
+
+// rethrow_exception() and preservation of data
+
+#include <exception>
+#include <typeinfo>
+#include <cstring>
+#include <stdexcept>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ try {
+ rethrow_exception(copy_exception(0));
+ } catch(...) {
+ }
+}
+
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ try {
+ rethrow_exception(copy_exception(runtime_error("test")));
+ } catch(exception &e) {
+ VERIFY( typeid(e) == typeid(runtime_error) );
+ VERIFY( strcmp(e.what(), "test") == 0 );
+ }
+}
+
+void test03()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ exception_ptr ep;
+ try {
+ throw 0;
+ } catch(...) {
+ ep = current_exception();
+ }
+ try {
+ rethrow_exception(ep);
+ } catch(...) {
+ }
+}
+
+void test04()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ // Weave the exceptions in an attempt to confuse the machinery.
+ try {
+ throw 0;
+ } catch(...) {
+ exception_ptr ep1 = current_exception();
+ try {
+ throw 1;
+ } catch(...) {
+ exception_ptr ep2 = current_exception();
+ try {
+ rethrow_exception(ep1);
+ } catch(...) {
+ try {
+ rethrow_exception(ep2);
+ } catch(...) {
+ try {
+ rethrow_exception(ep1);
+ } catch(...) {
+ }
+ try {
+ rethrow_exception(ep2);
+ } catch(...) {
+ }
+ }
+ }
+ }
+ }
+}
+
+int main()
+{
+ test01();
+ test02();
+ test03();
+ test04();
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/18_support/headers/cstdint/types_std_c++0x.cc b/libstdc++-v3/testsuite/18_support/headers/cstdint/types_std_c++0x.cc
index 7a5363c4f74..eff1d6dd27c 100644
--- a/libstdc++-v3/testsuite/18_support/headers/cstdint/types_std_c++0x.cc
+++ b/libstdc++-v3/testsuite/18_support/headers/cstdint/types_std_c++0x.cc
@@ -1,7 +1,8 @@
-// { dg-options "-std=gnu++0x" }
// { dg-do compile }
+// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
-// 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
@@ -23,8 +24,6 @@
void test01()
{
-#if _GLIBCXX_USE_C99_STDINT_TR1
-
typedef std::int8_t my_int8_t;
typedef std::int16_t my_int16_t;
typedef std::int32_t my_int32_t;
@@ -53,6 +52,4 @@ void test01()
typedef std::uint_least64_t my_uint_least64_t;
typedef std::uintmax_t my_uintmax_t;
typedef std::uintptr_t my_uintptr_t;
-
-#endif
}
diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/char16_32_t.cc b/libstdc++-v3/testsuite/18_support/numeric_limits/char16_32_t.cc
index c2957506cb0..84499480146 100644
--- a/libstdc++-v3/testsuite/18_support/numeric_limits/char16_32_t.cc
+++ b/libstdc++-v3/testsuite/18_support/numeric_limits/char16_32_t.cc
@@ -1,4 +1,6 @@
// { dg-options "-std=gnu++0x" }
+// { dg-require-cstdint "" }
+
// 2008-05-20 Paolo Carlini <paolo.carlini@oracle.com>
//
// Copyright (C) 2008 Free Software Foundation
@@ -69,9 +71,8 @@ template<typename T, typename R>
int main()
{
-#if _GLIBCXX_USE_C99_STDINT_TR1
do_test<char16_t, uint_least16_t>();
do_test<char32_t, uint_least32_t>();
-#endif
+
return 0;
}
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/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/25_algorithms/nth_element/2.cc b/libstdc++-v3/testsuite/25_algorithms/nth_element/2.cc
index 84f959ae9a2..47084ad77a8 100644
--- a/libstdc++-v3/testsuite/25_algorithms/nth_element/2.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/nth_element/2.cc
@@ -18,6 +18,12 @@
// 25.3.2 [lib.alg.nth.element]
+// { dg-options "-DMAX_SIZE=256" { target simulator } }
+
+#ifndef MAX_SIZE
+#define MAX_SIZE (1 << 10)
+#endif
+
#include <vector>
#include <algorithm>
#include <testsuite_hooks.h>
@@ -64,7 +70,7 @@ do_test01(unsigned size)
void
test01()
{
- for (unsigned size = 4; size <= 1 << 10; size <<= 1)
+ for (unsigned size = 4; size <= MAX_SIZE; size <<= 1)
do_test01(size);
}
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/30_threads/mutex/cons/assign_neg.cc b/libstdc++-v3/testsuite/30_threads/mutex/cons/assign_neg.cc
index f365d1167c1..8c66bb53cd7 100644
--- a/libstdc++-v3/testsuite/30_threads/mutex/cons/assign_neg.cc
+++ b/libstdc++-v3/testsuite/30_threads/mutex/cons/assign_neg.cc
@@ -39,4 +39,4 @@ void test01()
m1 = m2;
}
// { dg-error "within this context" "" { target *-*-* } 39 }
-// { dg-error "is private" "" { target *-*-* } 102 }
+// { dg-error "is private" "" { target *-*-* } 108 }
diff --git a/libstdc++-v3/testsuite/30_threads/mutex/cons/copy_neg.cc b/libstdc++-v3/testsuite/30_threads/mutex/cons/copy_neg.cc
index d0a91025b54..666506a36b1 100644
--- a/libstdc++-v3/testsuite/30_threads/mutex/cons/copy_neg.cc
+++ b/libstdc++-v3/testsuite/30_threads/mutex/cons/copy_neg.cc
@@ -38,4 +38,4 @@ void test01()
mutex_type m2(m1);
}
// { dg-error "within this context" "" { target *-*-* } 38 }
-// { dg-error "is private" "" { target *-*-* } 101 }
+// { dg-error "is private" "" { target *-*-* } 107 }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/assign_neg.cc b/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/assign_neg.cc
index 2e057104ec4..b7e27847667 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/assign_neg.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/assign_neg.cc
@@ -39,4 +39,4 @@ void test01()
m1 = m2;
}
// { dg-error "within this context" "" { target *-*-* } 39 }
-// { dg-error "is private" "" { target *-*-* } 154 }
+// { dg-error "is private" "" { target *-*-* } 160 }
diff --git a/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/copy_neg.cc b/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/copy_neg.cc
index a98e73333e5..2d20cb98c3d 100644
--- a/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/copy_neg.cc
+++ b/libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/copy_neg.cc
@@ -38,4 +38,4 @@ void test01()
mutex_type m2(m1);
}
// { dg-error "within this context" "" { target *-*-* } 38 }
-// { dg-error "is private" "" { target *-*-* } 153 }
+// { dg-error "is private" "" { target *-*-* } 159 }
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/dg-options.exp b/libstdc++-v3/testsuite/lib/dg-options.exp
index e2d22ae598b..44dea807302 100644
--- a/libstdc++-v3/testsuite/lib/dg-options.exp
+++ b/libstdc++-v3/testsuite/lib/dg-options.exp
@@ -97,3 +97,12 @@ proc dg-require-cstdint { args } {
}
return
}
+
+proc dg-require-atomic-builtins { args } {
+ if { ![ check_v3_target_atomic_builtins ] } {
+ upvar dg-do-what dg-do-what
+ set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
+ return
+ }
+ return
+}
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index 29258c35b4c..45b6fb27f2c 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
@@ -1055,7 +1038,7 @@ proc check_v3_target_cstdint { } {
set exe cstdint[pid].exe
set f [open $src "w"]
- puts $f "#include <cstdint>"
+ puts $f "#include <tr1/cstdint>"
puts $f "int main()"
puts $f "#ifdef _GLIBCXX_USE_C99_STDINT_TR1"
puts $f "{ return 0; }"
@@ -1063,7 +1046,7 @@ proc check_v3_target_cstdint { } {
close $f
set cxxflags_saved $cxxflags
- set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -std=gnu++0x -Werror"
+ set cxxflags "$cxxflags $DEFAULT_CXXFLAGS -Werror"
set lines [v3_target_compile $src $exe executable ""]
set cxxflags $cxxflags_saved
@@ -1079,3 +1062,61 @@ proc check_v3_target_cstdint { } {
verbose "check_v3_target_cstdint: $et_cstdint" 2
return $et_cstdint
}
+
+proc check_v3_target_atomic_builtins { } {
+ global cxxflags
+ global DEFAULT_CXXFLAGS
+ global et_cstdint
+
+ global tool
+
+ if { ![info exists et_atomic_builtins_target_name] } {
+ set et_atomic_builtins_target_name ""
+ }
+
+ # If the target has changed since we set the cached value, clear it.
+ set current_target [current_target_name]
+ if { $current_target != $et_atomic_builtins_target_name } {
+ verbose "check_v3_target_atomic_builtins: `$et_atomic_builtins_target_name'" 2
+ set et_atomic_builtins_target_name $current_target
+ if [info exists et_atomic_builtins] {
+ verbose "check_v3_target_atomic_builtins: removing cached result" 2
+ unset et_atomic_builtins
+ }
+ }
+
+ if [info exists et_atomic_builtins] {
+ verbose "check_v3_target_atomic_builtins: using cached result" 2
+ } else {
+ set et_atomic_builtins 0
+
+ # Set up and compile a C++0x test program that depends
+ # on the C99 stdint facilities to be available.
+ set src atomic_builtins[pid].cc
+ set exe atomic_builtins[pid].exe
+
+ set f [open $src "w"]
+ puts $f "#include <bits/c++config.h>"
+ puts $f "int main()"
+ puts $f "#ifdef _GLIBCXX_ATOMIC_BUILTINS_4"
+ puts $f "{ return 0; }"
+ puts $f "#endif"
+ 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.
+ set et_atomic_builtins 1
+ } else {
+ verbose "check_v3_target_atomic_builtins: compilation failed" 2
+ }
+ }
+ verbose "check_v3_target_atomic_builtins: $et_atomic_builtins" 2
+ return $et_atomic_builtins
+}
diff --git a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdint/types_std_tr1.cc b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdint/types_std_tr1.cc
index d7159739803..3826713f753 100644
--- a/libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdint/types_std_tr1.cc
+++ b/libstdc++-v3/testsuite/tr1/8_c_compatibility/cstdint/types_std_tr1.cc
@@ -1,8 +1,9 @@
// { dg-do compile }
+// { dg-require-cstdint "" }
// 2006-01-29 Paolo Carlini <pcarlini@suse.de>
//
-// Copyright (C) 2006 Free Software Foundation, Inc.
+// Copyright (C) 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
@@ -26,8 +27,6 @@
void test01()
{
-#if _GLIBCXX_USE_C99_STDINT_TR1
-
typedef std::tr1::int8_t my_int8_t;
typedef std::tr1::int16_t my_int16_t;
typedef std::tr1::int32_t my_int32_t;
@@ -56,6 +55,4 @@ void test01()
typedef std::tr1::uint_least64_t my_uint_least64_t;
typedef std::tr1::uintmax_t my_uintmax_t;
typedef std::tr1::uintptr_t my_uintptr_t;
-
-#endif
}
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 ); }
}
};
diff --git a/svn-mergepoint b/svn-mergepoint
index 54db4ace92b..8d36c8938d6 100644
--- a/svn-mergepoint
+++ b/svn-mergepoint
@@ -1 +1 @@
-138082
+139818